diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-08-05 14:09:08 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-08-05 14:09:08 -0700 |
commit | 6b780a2e97c032d1749f190e0f5cfbbce99d0a60 (patch) | |
tree | 18287633d9eb2d63d8badf035144e8a3143c00db /lisp/emacs-lisp | |
parent | 95c6606a477e017ed7b418fcc81fd937895fee20 (diff) | |
parent | 9ba51edf62b25c678508a316ec78a09b18d3bf9e (diff) | |
download | emacs-6b780a2e97c032d1749f190e0f5cfbbce99d0a60.tar.gz |
Merge from origin/emacs-25
9ba51ed Document buffer-swap-text+save-excursion interaction
452aa94 Fix eieio vs cl-generic incompatibilities found in Rudel (bug...
248d5dd Include cl-generic in package--builtin-versions (bug#22817)
8f5a8b6 Improve timing in `tramp-test29-environment-variables'
05ba7a0 Add test for handling environment variables in Tramp
e393d4f * lisp/emacs-lisp/package.el (describe-package-1) (package-st...
5e38887 ; * lisp/net/tramp.el: Fix 2010-10-04 comment typo. (Bug#23913)
90f2169 ; Spelling fixes
069fc05 Improve documentation of search functions
0a0144a Delete environment variables in Tramp when needed
f624671 Add "New in Emacs 25" section to the FAQ
658daf9 Fix 'vertical-motion' in non-interactive sessions
686b520 Fix memory leak in imagemagick-types
4069b71 Update ELisp manual to match 'string-collate-equalp' doc string
1b2d6a6 Clarify docstring of find-feature-regexp
aac62a6 Add details to cl-lib defining macros' docstrings
d6aa4da Clarify doc string of 'save-buffer'
03bcf11 Un-confuse doc string of 'string-collate-equalp'
c53135b Clarify documentation of 'mouse-on-link-p'
# Conflicts:
# lisp/emacs-lisp/eieio-core.el
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-generic.el | 14 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 29 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-compat.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 9 |
6 files changed, 52 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index d5612f4eb13..61186e1a881 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -86,6 +86,11 @@ ;;; Code: +;; The autoloads.el mechanism which adds package--builtin-versions +;; maintenance to loaddefs.el doesn't work for preloaded packages (such +;; as this one), so we have to do it by hand! +(push (purecopy '(cl-generic 1 0)) package--builtin-versions) + ;; Note: For generic functions that dispatch on several arguments (i.e. those ;; which use the multiple-dispatch feature), we always use the same "tagcodes" ;; and the same set of arguments on which to dispatch. This works, but is @@ -697,6 +702,15 @@ FUN is the function that should be called when METHOD calls (setq fun (cl-generic-call-method generic method fun))) fun))))) +(defun cl-generic-apply (generic args) + "Like `apply' but takes a cl-generic object rather than a function." + ;; Handy in cl-no-applicable-method, for example. + ;; In Common Lisp, generic-function objects are funcallable. Ideally + ;; we'd want the same in Elisp, but it would either require using a very + ;; different (and less efficient) representation of cl--generic objects, + ;; or non-trivial changes in the general infrastructure (compiler and such). + (apply (cl--generic-name generic) args)) + (defun cl--generic-arg-specializer (method dispatch-arg) (or (if (integerp dispatch-arg) (nth dispatch-arg diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 56170e6a71b..37244f5c350 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -327,6 +327,20 @@ FORM is of the form (ARGS . BODY)." Like normal `defun', except ARGLIST allows full Common Lisp conventions, and BODY is implicitly surrounded by (cl-block NAME ...). +The full form of a Common Lisp function argument list is + + (VAR... + [&optional (VAR [INITFORM [SVAR]])...] + [&rest|&body VAR] + [&key (([KEYWORD] VAR) [INITFORM [SVAR]])... [&allow-other-keys]] + [&aux (VAR [INITFORM])...]) + +VAR maybe be replaced recursively with an argument list for +destructing, `&whole' is supported within these sublists. If +SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be +written simply `VAR'. See the Info node `(cl)Argument Lists' for +more details. + \(fn NAME ARGLIST [DOCSTRING] BODY...)" (declare (debug ;; Same as defun but use cl-lambda-list. @@ -406,6 +420,21 @@ and BODY is implicitly surrounded by (cl-block NAME ...). Like normal `defmacro', except ARGLIST allows full Common Lisp conventions, and BODY is implicitly surrounded by (cl-block NAME ...). +The full form of a Common Lisp macro argument list is + + (VAR... + [&optional (VAR [INITFORM [SVAR]])...] + [&rest|&body VAR] + [&key (([KEYWORD] VAR) [INITFORM [SVAR]])... [&allow-other-keys]] + [&aux (VAR [INITFORM])...] + [&environment VAR]) + +VAR maybe be replaced recursively with an argument list for +destructing, `&whole' is supported within these sublists. If +SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be +written simply `VAR'. See the Info node `(cl)Argument Lists' for +more details. + \(fn NAME ARGLIST [DOCSTRING] BODY...)" (declare (debug (&define name cl-macro-list cl-declarations-or-string def-body)) diff --git a/lisp/emacs-lisp/eieio-compat.el b/lisp/emacs-lisp/eieio-compat.el index 7ee897093b2..413b94f01a8 100644 --- a/lisp/emacs-lisp/eieio-compat.el +++ b/lisp/emacs-lisp/eieio-compat.el @@ -188,7 +188,8 @@ Summary: (`no-applicable-method (setq method 'cl-no-applicable-method) (setq specializers `(generic ,@specializers)) - (lambda (generic arg &rest args) (apply code arg generic args))) + (lambda (generic arg &rest args) + (apply code arg (cl--generic-name generic) (cons arg args)))) (_ code)))) (cl-generic-define-method method (unless (memq kind '(nil :primary)) (list kind)) diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 0567c87dd39..52577adefac 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -971,7 +971,7 @@ If a consistent order does not exist, signal an error." (defun eieio--class-precedence-c3 (class) "Return all parents of CLASS in c3 order." - (let ((parents (eieio--class-parents (cl--find-class class)))) + (let ((parents (eieio--class-parents class))) (eieio--c3-merge-lists (list class) (append diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 4a7b7109106..cbb134e95d5 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -105,7 +105,7 @@ Please send improvements and fixes to the maintainer." (defcustom find-feature-regexp (concat ";;; Code:") "The regexp used by `xref-find-definitions' when searching for a feature definition. -Note it must contain a `%s' at the place where `format' +Note it may contain up to one `%s' at the place where `format' should insert the feature name." ;; We search for ";;; Code" rather than (feature '%s) because the ;; former is near the start of the code, and the latter is very diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 540a0e90273..e721b553eae 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2259,13 +2259,13 @@ Otherwise no newline is inserted." (package--print-help-section "Status") (cond (built-in (insert (propertize (capitalize status) - 'font-lock-face 'package-status-builtin-face) + 'font-lock-face 'package-status-built-in) ".")) (pkg-dir (insert (propertize (if (member status '("unsigned" "dependency")) "Installed" (capitalize status)) - 'font-lock-face 'package-status-builtin-face)) + 'font-lock-face 'package-status-built-in)) (insert (substitute-command-keys " in `")) (let ((dir (abbreviate-file-name (file-name-as-directory @@ -2278,7 +2278,7 @@ Otherwise no newline is inserted." (insert (substitute-command-keys "',\n shadowing a ") (propertize "built-in package" - 'font-lock-face 'package-status-builtin-face)) + 'font-lock-face 'package-status-built-in)) (insert (substitute-command-keys "'"))) (if signed (insert ".") @@ -2830,13 +2830,14 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])." "Face used on package description summaries in the package menu." :version "25.1") +;; Shame this hyphenates "built-in", when "font-lock-builtin-face" doesn't. (defface package-status-built-in '((t :inherit font-lock-builtin-face)) "Face used on the status and version of built-in packages." :version "25.1") (defface package-status-external - '((t :inherit package-status-builtin-face)) + '((t :inherit package-status-built-in)) "Face used on the status and version of external packages." :version "25.1") |