• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/emacs-lisp/

Lines Matching +defs:orig +defs:args

356 ;; (as they do v19s), `(&rest ad-subr-args)' will be used.
438 ;; (ad-get-args 2) -> (2 3 4 5 6)
439 ;; (ad-get-args 4) -> (4 5 6)
442 ;; at <position>, `(ad-get-args <position>)' will return the list of actual
453 ;; called. `(ad-set-args <position> <value-list-form>)' can be used to set
457 ;; (ad-set-args 0 '(5 4 3 2 1 0))
500 ;; `(&rest ad-subr-args)' as the argument list of the original function
517 ;; `(&rest ad-subr-args)' which will always work but is inefficient because
518 ;; it conses up arguments. The macro `ad-define-subr-args' can be used by
522 ;; (ad-define-subr-args 'fset '(sym newdef))
527 ;; (ad-undefine-subr-args 'fset)
536 ;; 3) otherwise use `(&rest ad-subr-args)'
919 ;; ad-subr-args name of &rest argument variable used for advised
922 ;; (ad-get-arg <pos>), (ad-get-args <pos>),
923 ;; (ad-set-arg <pos> <value>), (ad-set-args <pos> <value-list>)
1598 ;; (defadvice fuu (before fg-print-args act)
1600 ;; (print (ad-get-args 0)))
1607 ;; (defadvice fuu (before fg-set-args act)
1609 ;; (ad-set-args 1 (list (ad-get-arg 2) (ad-get-arg 1))))
1662 ;; This means that Advice has to use `(&rest ad-subr-args)' as the
1674 ;; (&rest ad-subr-args)
1679 ;; (ad-define-subr-args 'car '(list))
1692 ;; list if it was successful, otherwise `(&rest ad-subr-args)' will be used.
2180 ;; we need to use `ad-real-orig-definition'.
2186 (defmacro ad-get-orig-definition (function)
2191 (defmacro ad-set-orig-definition (function definition)
2195 (defmacro ad-clear-orig-definition (function)
2553 ;; Store subr-args as `((arg1 arg2 ...))' so I can distinguish
2555 (defmacro ad-define-subr-args (subr arglist)
2557 (defmacro ad-undefine-subr-args (subr)
2559 (defmacro ad-subr-args-defined-p (subr)
2561 (defmacro ad-get-subr-args (subr)
2568 that property, or otherwise use `(&rest ad-subr-args)'."
2569 (if (ad-subr-args-defined-p subr-name)
2570 (ad-get-subr-args subr-name)
2572 ;;((fboundp 'subr-min-args)
2575 ;; of `subr-min-args' and `subr-max-args' to construct the subr arglist
2579 ;; way to distinguish a subr with args `(a &optional b &rest c)' from
2580 ;; one with args `(a &rest c)' using that mechanism. Also, the argument
2588 '(&rest ad-subr-args)
2589 (ad-define-subr-args
2593 (ad-get-subr-args subr-name)))))
2676 (defun ad-real-orig-definition (function)
2728 ;; Use original arguments where possible and `(&rest ad-subr-args)'
2730 ;; uniform than a general `(&rest args)' approach. My reason to still
2759 (defun ad-retrieve-args-form (arglist)
2799 (reqopt-args (append (nth 0 parsed-arglist)
2802 (cond ((< index (length reqopt-args))
2803 (nth index reqopt-args))
2805 (list (- index (length reqopt-args)) rest-arg)))))
2831 (reqopt-args (append (nth 0 parsed-arglist)
2834 args-form)
2835 (if (< index (length reqopt-args))
2836 (setq args-form `(list ,@(nthcdr index reqopt-args))))
2838 (if args-form
2839 (setq args-form `(nconc ,args-form ,rest-arg))
2840 (setq args-form (ad-list-access (- index (length reqopt-args))
2842 args-form))
2845 "Make form to assign elements of VALUES-FORM as actual ARGLIST args.
2892 '(ad-get-arg ad-get-args ad-set-arg ad-set-args))
2897 (ad-retrieve-args-form arglist)
2906 ((eq accessor 'ad-get-args)
2908 ((eq accessor 'ad-set-args)
2928 Example: `(ad-map-arglists '(a &rest args) '(w x y z))' will return
2929 `(funcall function a (car args) (car (cdr args)) (nth 2 args))'."
2931 (source-reqopt-args (append (nth 0 parsed-source-arglist)
2935 (target-reqopt-args (append (nth 0 parsed-target-arglist)
2941 ;; of a case like (&rest a) mapped onto (x &rest y) where the actual args
2946 (append source-reqopt-args (list source-rest-arg)))
2952 (append target-reqopt-args
2955 ;; remaining source args:
2956 (nthcdr (length target-reqopt-args)
2957 source-reqopt-args)))))))))
2960 "Make form to call TARGET-FUNCTION with args from SOURCE-ARGLIST."
3006 (let* ((origdef (ad-real-orig-definition function))
3064 (let* ((origdef (ad-real-orig-definition function))
3066 (orig-interactive-p (ad-interactive-p origdef))
3067 (orig-subr-p (ad-subr-p origdef))
3068 (orig-special-form-p (ad-special-form-p origdef))
3069 (orig-macro-p (ad-macro-p origdef))
3071 (orig-arglist (ad-arglist origdef function))
3073 orig-arglist))
3076 (cond (orig-macro-p nil)
3085 (orig-interactive-p
3087 (orig-form
3088 (cond ((or orig-special-form-p orig-macro-p)
3103 `(,(if orig-macro-p 'macroexpand 'eval)
3106 ((and orig-subr-p
3107 orig-interactive-p
3115 orig-arglist
3120 advised-arglist orig-arglist origname)))))
3124 (cond (orig-macro-p 'macro)
3125 (orig-special-form-p 'special-form)
3130 orig-form
3136 (type args docstring interactive orig &optional befores arounds afters)
3160 (setq around-form `(setq ad-return-value ,orig))
3193 ,args
3202 (ad-insert-argument-access-forms definition args)))
3295 (let ((original-definition (ad-real-orig-definition function))
3347 (let ((original-definition (ad-real-orig-definition function))
3447 (orig-definition
3450 (or (ad-get-orig-definition function)
3474 (ad-set-orig-definition function orig-definition)
3492 (or (ad-get-orig-definition ',function)
3517 (or (ad-subr-p (ad-get-orig-definition function))
3518 (ad-compiled-p (ad-get-orig-definition function))))
3557 (let ((original-definition (ad-get-orig-definition function))
3572 (ad-set-orig-definition function current-definition)
3582 (ad-set-orig-definition function current-definition)
3617 (if (ad-get-orig-definition function)
3643 (if (not (ad-get-orig-definition function))
3646 (ad-safe-fset function (ad-get-orig-definition function))
3668 (ad-clear-orig-definition function)
3683 (cond ((ad-get-orig-definition function)
3684 (ad-safe-fset function (ad-get-orig-definition function))
3685 (ad-clear-orig-definition function)))
3768 (defmacro defadvice (function args &rest body)
3821 (let* ((class (car args))
3824 (nth 1 args)))
3827 (setq args (nthcdr 2 args))
3828 (if (ad-position-p (car args))
3829 (prog1 (car args)
3830 (setq args (cdr args))))))
3831 (arglist (if (listp (car args))
3832 (prog1 (car args)
3833 (setq args (cdr args)))))
3845 args))
3909 (or (ad-get-orig-definition ',function)
3937 (ad-define-subr-args 'documentation '(function &optional raw))