diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/advice.el | 15 | ||||
-rw-r--r-- | lisp/emacs-lisp/byte-run.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/chart.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/disass.el | 8 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio.el | 17 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 12 | ||||
-rw-r--r-- | lisp/emacs-lisp/tcover-unsafep.el | 6 |
9 files changed, 43 insertions, 34 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 5934975e36a..a245a91c5c1 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2135,16 +2135,27 @@ Redefining advices affect the construction of an advised definition." ;; @@ Interactive input functions: ;; =============================== +(declare-function 'function-called-at-point "help") + (defun ad-read-advised-function (&optional prompt predicate default) "Read name of advised function with completion from the minibuffer. An optional PROMPT will be used to prompt for the function. PREDICATE plays the same role as for `try-completion' (which see). DEFAULT will -be returned on empty input (defaults to the first advised function for -which PREDICATE returns non-nil)." +be returned on empty input (defaults to the first advised function or +function at point for which PREDICATE returns non-nil)." (if (null ad-advised-functions) (error "ad-read-advised-function: There are no advised functions")) (setq default (or default + ;; Prefer func name at point, if it's in ad-advised-functions etc. + (let ((function (progn + (require 'help) + (function-called-at-point)))) + (and function + (assoc (symbol-name function) ad-advised-functions) + (or (null predicate) + (funcall predicate function)) + function)) (ad-do-advised-functions (function) (if (or (null predicate) (funcall predicate function)) diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 3fb3d841ed1..c76cdffd62f 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -72,7 +72,7 @@ The return value of this function is not used." ;; "Cause the named functions to be open-coded when called from compiled code. ;; They will only be compiled open-coded when byte-compile-optimize is true." ;; (cons 'eval-and-compile -;; (mapcar '(lambda (x) +;; (mapcar (lambda (x) ;; (or (memq (get x 'byte-optimizer) ;; '(nil byte-compile-inline-expand)) ;; (error @@ -85,7 +85,7 @@ The return value of this function is not used." ;; (defmacro proclaim-notinline (&rest fns) ;; "Cause the named functions to no longer be open-coded." ;; (cons 'eval-and-compile -;; (mapcar '(lambda (x) +;; (mapcar (lambda (x) ;; (if (eq (get x 'byte-optimizer) 'byte-compile-inline-expand) ;; (put x 'byte-optimizer nil)) ;; (list 'if (list 'eq (list 'get (list 'quote x) ''byte-optimizer) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 49b39b6a1f9..f0f59123aa9 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3525,9 +3525,9 @@ discarding." ;; and (funcall (function foo)) will lose with autoloads. (defun byte-compile-function-form (form) - (byte-compile-constant (if (symbolp (nth 1 form)) - (nth 1 form) - (byte-compile-lambda (nth 1 form))))) + (byte-compile-constant (if (eq 'lambda (car-safe (nth 1 form))) + (byte-compile-lambda (nth 1 form)) + (nth 1 form)))) (defun byte-compile-indent-to (form) (let ((len (length form))) diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 01eb1efdc3b..56930a74693 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -639,7 +639,7 @@ SORT-PRED if desired." extlst "File Extensions" cntlst "# of occurrences" 10 - '(lambda (a b) (> (cdr a) (cdr b)))) + (lambda (a b) (> (cdr a) (cdr b)))) )) (defun chart-space-usage (d) @@ -669,7 +669,7 @@ SORT-PRED if desired." nmlst "File Name" cntlst "File Size" 10 - '(lambda (a b) (> (cdr a) (cdr b)))) + (lambda (a b) (> (cdr a) (cdr b)))) )) (defun chart-emacs-storage () @@ -737,7 +737,7 @@ SORT-PRED if desired." nmlst "User Names" cntlst "# of occurrences" 10 - '(lambda (a b) (> (cdr a) (cdr b)))) + (lambda (a b) (> (cdr a) (cdr b)))) )) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index aead75668f1..7eb6e6ef765 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -38,8 +38,7 @@ ;; or [menu-bar emacs-lisp eval-buffer]. Additional key-bindings ;; are also provided under C-c ? KEY ;; (require 'checkdoc) -;; (add-hook 'emacs-lisp-mode-hook -;; '(lambda () (checkdoc-minor-mode 1))) +;; (add-hook 'emacs-lisp-mode-hook 'checkdoc-minor-mode) ;; ;; Using `checkdoc': ;; diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index 4fd10185c17..2a41e611dc0 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -251,10 +251,10 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler." ((eq (car-safe (car-safe arg)) 'byte-code) (insert "(<byte code>...)\n") (mapc ;recurse on list of byte-code objects - '(lambda (obj) - (disassemble-1 - obj - (+ indent disassemble-recursive-indent))) + (lambda (obj) + (disassemble-1 + obj + (+ indent disassemble-recursive-indent))) arg)) (t ;; really just a constant diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 8c5260106a8..83c09b6fe0f 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -1226,29 +1226,28 @@ IMPL is the symbol holding the method implementation." (if (not (eieio-object-p (car local-args))) ;; Not an object. Just signal. (signal 'no-method-definition - (list ,(list 'quote method) local-args)) + (list ',method local-args)) ;; We do have an object. Make sure it is the right type. (if ,(if (eq class eieio-default-superclass) - nil ; default superclass means just an obj. Already asked. + nil ; default superclass means just an obj. Already asked. `(not (child-of-class-p (aref (car local-args) object-class) - ,(list 'quote class))) - ) + ',class))) ;; If not the right kind of object, call no applicable (apply 'no-applicable-method (car local-args) - ,(list 'quote method) local-args) + ',method local-args) ;; It is ok, do the call. ;; Fill in inter-call variables then evaluate the method. - (let ((scoped-class ,(list 'quote class)) + (let ((scoped-class ',class) (eieio-generic-call-next-method-list nil) (eieio-generic-call-key method-primary) - (eieio-generic-call-methodname ,(list 'quote method)) + (eieio-generic-call-methodname ',method) (eieio-generic-call-arglst local-args) ) - (apply ,(list 'quote impl) local-args) - ;(,impl local-args) + (apply #',impl local-args) + ;;(,impl local-args) ))))))) (defsubst eieio-defgeneric-reset-generic-form-primary-only-one (method) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index ef0c49b8616..ece96fe2515 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -145,12 +145,12 @@ This command assumes point is not in a string or comment." (while (/= arg 0) (if (null forward-sexp-function) (goto-char (or (scan-lists (point) inc 1) (buffer-end arg))) - (condition-case err - (while (progn (setq pos (point)) - (forward-sexp inc) - (/= (point) pos))) - (scan-error (goto-char (nth 2 err)))) - (if (= (point) pos) + (condition-case err + (while (progn (setq pos (point)) + (forward-sexp inc) + (/= (point) pos))) + (scan-error (goto-char (nth (if (> arg 0) 3 2) err)))) + (if (= (point) pos) (signal 'scan-error (list "Unbalanced parentheses" (point) (point))))) (setq arg (- arg inc))))) diff --git a/lisp/emacs-lisp/tcover-unsafep.el b/lisp/emacs-lisp/tcover-unsafep.el index 2be026b98eb..cc3e633f098 100644 --- a/lisp/emacs-lisp/tcover-unsafep.el +++ b/lisp/emacs-lisp/tcover-unsafep.el @@ -29,13 +29,13 @@ ;;;These forms are all considered safe (defconst testcover-unsafep-safe '(((lambda (x) (* x 2)) 14) - (apply 'cdr (mapcar '(lambda (x) (car x)) y)) + (apply 'cdr (mapcar (lambda (x) (car x)) y)) (cond ((= x 4) 5) (t 27)) (condition-case x (car y) (error (car x))) (dolist (x y) (message "here: %s" x)) (dotimes (x 14 (* x 2)) (message "here: %d" x)) (let (x) (dolist (y '(1 2 3) (1+ y)) (push y x))) - (let (x) (apply '(lambda (x) (* x 2)) 14)) + (let (x) (apply (lambda (x) (* x 2)) 14)) (let ((x '(2))) (push 1 x) (pop x) (add-to-list 'x 2)) (let ((x 1) (y 2)) (setq x (+ x y))) (let ((x 1)) (let ((y (+ x 3))) (* x y))) @@ -90,7 +90,7 @@ . (function kill-buffer)) ( (mapcar x y) . (unquoted x)) - ( (mapcar '(lambda (x) (rename-file x "x")) '("unsafep.el")) + ( (mapcar (lambda (x) (rename-file x "x")) '("unsafep.el")) . (function rename-file)) ( (mapconcat x1 x2 " ") . (unquoted x1)) |