Changeset 3894 for trunk/lisp/emacs-lisp/advice.el
- Timestamp:
- 2005年10月02日 09時47分43秒 (3 years ago)
- Files:
-
- trunk/lisp/emacs-lisp/advice.el (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/emacs-lisp/advice.el
r3809 r3894 2219 2219 (function 2220 2220 (completing-read 2221 (format "%s (default %s) " (or prompt "Function:") default)2221 (format "%s (default %s): " (or prompt "Function") default) 2222 2222 ad-advised-functions 2223 2223 (if predicate … … 2251 2251 (error "ad-read-advice-class: `%s' has no advices" function))) 2252 2252 (let ((class (completing-read 2253 (format "%s (default %s) " (or prompt "Class:") default)2253 (format "%s (default %s): " (or prompt "Class") default) 2254 2254 ad-advice-class-completion-table nil t))) 2255 2255 (if (equal class "") … … 2269 2269 function class) 2270 2270 (car (car name-completion-table)))) 2271 (prompt (format "%s (default %s) " (or prompt "Name:") default))2271 (prompt (format "%s (default %s): " (or prompt "Name") default)) 2272 2272 (name (completing-read prompt name-completion-table nil t))) 2273 2273 (if (equal name "") … … 2290 2290 "Read a regular expression from the minibuffer." 2291 2291 (let ((regexp (read-from-minibuffer 2292 (concat (or prompt "Regular expression :")2293 (if (equal ad-last-regexp "") " "2294 (format " (default \"%s\")" ad-last-regexp))))))2292 (concat (or prompt "Regular expression") 2293 (if (equal ad-last-regexp "") ": " 2294 (format " (default %s): " ad-last-regexp)))))) 2295 2295 (setq ad-last-regexp 2296 2296 (if (equal regexp "") ad-last-regexp regexp)))) … … 2353 2353 (defun ad-enable-advice (function class name) 2354 2354 "Enables the advice of FUNCTION with CLASS and NAME." 2355 (interactive (ad-read-advice-specification "Enable advice of :"))2355 (interactive (ad-read-advice-specification "Enable advice of")) 2356 2356 (if (ad-is-advised function) 2357 2357 (if (eq (ad-enable-advice-internal function class name t) 0) … … 2362 2362 (defun ad-disable-advice (function class name) 2363 2363 "Disable the advice of FUNCTION with CLASS and NAME." 2364 (interactive (ad-read-advice-specification "Disable advice of :"))2364 (interactive (ad-read-advice-specification "Disable advice of")) 2365 2365 (if (ad-is-advised function) 2366 2366 (if (eq (ad-enable-advice-internal function class name nil) 0) … … 2386 2386 All currently advised functions will be considered." 2387 2387 (interactive 2388 (list (ad-read-regexp "Enable advices via regexp :")))2388 (list (ad-read-regexp "Enable advices via regexp"))) 2389 2389 (let ((matched-advices (ad-enable-regexp-internal regexp 'any t))) 2390 2390 (if (interactive-p) … … 2396 2396 All currently advised functions will be considered." 2397 2397 (interactive 2398 (list (ad-read-regexp "Disable advices via regexp :")))2398 (list (ad-read-regexp "Disable advices via regexp"))) 2399 2399 (let ((matched-advices (ad-enable-regexp-internal regexp 'any nil))) 2400 2400 (if (interactive-p) … … 2406 2406 If such an advice was found it will be removed from the list of advices 2407 2407 in that CLASS." 2408 (interactive (ad-read-advice-specification "Remove advice of :"))2408 (interactive (ad-read-advice-specification "Remove advice of")) 2409 2409 (if (ad-is-advised function) 2410 2410 (let* ((advice-to-remove (ad-find-advice function class name))) … … 3286 3286 advised definition from scratch." 3287 3287 (interactive 3288 (list (ad-read-advised-function "Clear cached definition of :")))3288 (list (ad-read-advised-function "Clear cached definition of"))) 3289 3289 (ad-set-advice-info-field function 'cache nil)) 3290 3290 … … 3603 3603 definition will always be cached for later usage." 3604 3604 (interactive 3605 (list (ad-read-advised-function "Activate advice of :")3605 (list (ad-read-advised-function "Activate advice of") 3606 3606 current-prefix-arg)) 3607 3607 (if ad-activate-on-top-level … … 3633 3633 a call to `ad-activate'." 3634 3634 (interactive 3635 (list (ad-read-advised-function "Deactivate advice of :" 'ad-is-active)))3635 (list (ad-read-advised-function "Deactivate advice of" 'ad-is-active))) 3636 3636 (if (not (ad-is-advised function)) 3637 3637 (error "ad-deactivate: `%s' is not advised" function) … … 3651 3651 (interactive 3652 3652 (list (ad-read-advised-function 3653 "Update advised definition of :" 'ad-is-active)))3653 "Update advised definition of" 'ad-is-active))) 3654 3654 (if (ad-is-active function) 3655 3655 (ad-activate function compile))) … … 3659 3659 If FUNCTION was not advised this will be a noop." 3660 3660 (interactive 3661 (list (ad-read-advised-function "Unadvise function :")))3661 (list (ad-read-advised-function "Unadvise function"))) 3662 3662 (cond ((ad-is-advised function) 3663 3663 (if (ad-is-active function) … … 3690 3690 See `ad-activate' for documentation on the optional COMPILE argument." 3691 3691 (interactive 3692 (list (ad-read-regexp "Activate via advice regexp :")3692 (list (ad-read-regexp "Activate via advice regexp") 3693 3693 current-prefix-arg)) 3694 3694 (ad-do-advised-functions (function) … … 3701 3701 that has at least one piece of advice whose name includes a match for REGEXP." 3702 3702 (interactive 3703 (list (ad-read-regexp "Deactivate via advice regexp :")))3703 (list (ad-read-regexp "Deactivate via advice regexp"))) 3704 3704 (ad-do-advised-functions (function) 3705 3705 (if (ad-find-some-advice function 'any regexp) … … 3712 3712 See `ad-activate' for documentation on the optional COMPILE argument." 3713 3713 (interactive 3714 (list (ad-read-regexp "Update via advice regexp :")3714 (list (ad-read-regexp "Update via advice regexp") 3715 3715 current-prefix-arg)) 3716 3716 (ad-do-advised-functions (function)
