diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/advice.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/autoload.el | 471 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-extra.el | 60 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 1234 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 77 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-seq.el | 64 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl.el | 162 | ||||
-rw-r--r-- | lisp/emacs-lisp/copyright.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/easymenu.el | 40 | ||||
-rw-r--r-- | lisp/emacs-lisp/eldoc.el | 120 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 18 | ||||
-rw-r--r-- | lisp/emacs-lisp/rx.el | 2 |
12 files changed, 1882 insertions, 370 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 8023bc58a53..0123124b26d 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -3759,7 +3759,7 @@ The syntax of `defadvice' is as follows: \(defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...) [DOCSTRING] [INTERACTIVE-FORM] - BODY... ) + BODY...) FUNCTION ::= Name of the function to be advised. CLASS ::= `before' | `around' | `after' | `activation' | `deactivation'. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 5e37e275632..90943b33e49 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -41,15 +41,19 @@ A `.el' file can set this in its local variables section to make its autoloads go somewhere else. The autoload file is assumed to contain a trailer starting with a FormFeed character.") +;;;###autoload +(put 'generated-autoload-file 'safe-local-variable 'stringp) -(defconst generate-autoload-cookie ";;;###autoload" +;; This feels like it should be a defconst, but MH-E sets it to +;; ";;;###mh-autoload" for the autoloads that are to go into mh-loaddefs.el. +(defvar generate-autoload-cookie ";;;###autoload" "Magic comment indicating the following form should be autoloaded. Used by \\[update-file-autoloads]. This string should be meaningless to Lisp (e.g., a comment). This string is used: -;;;###autoload +\;;;###autoload \(defun function-to-be-autoloaded () ...) If this string appears alone on a line, the following form will be @@ -65,6 +69,8 @@ that text will be copied verbatim to `generated-autoload-file'.") (defconst generate-autoload-section-continuation ";;;;;; " "String to add on each continuation of the section header form.") +(defvar autoload-modified-buffers) ;Dynamically scoped var. + (defun make-autoload (form file) "Turn FORM into an autoload or defvar for source file FILE. Returns nil if FORM is not a special autoload form (i.e. a function definition @@ -149,16 +155,14 @@ or macro definition or a defcustom)." ;; the doc-string in FORM. ;; Those properties are now set in lisp-mode.el. +(defun autoload-generated-file () + (expand-file-name generated-autoload-file + ;; File-local settings of generated-autoload-file should + ;; be interpreted relative to the file's location, + ;; of course. + (if (not (local-variable-p 'generated-autoload-file)) + (expand-file-name "lisp" source-directory)))) -(defun autoload-trim-file-name (file) - ;; Returns a relative file path for FILE - ;; starting from the directory that loaddefs.el is in. - ;; That is normally a directory in load-path, - ;; which means Emacs will be able to find FILE when it looks. - ;; Any extra directory names here would prevent finding the file. - (setq file (expand-file-name file)) - (file-relative-name file - (file-name-directory generated-autoload-file))) (defun autoload-read-section-header () "Read a section header form. @@ -253,9 +257,7 @@ put the output in." "Insert the section-header line, which lists the file name and which functions are in it, etc." (insert generate-autoload-section-header) - (prin1 (list 'autoloads autoloads load-name - (if (stringp file) (autoload-trim-file-name file) file) - time) + (prin1 (list 'autoloads autoloads load-name file time) outbuf) (terpri outbuf) ;; Break that line at spaces, to avoid very long lines. @@ -272,12 +274,14 @@ which lists the file name and which functions are in it, etc." (defun autoload-find-file (file) "Fetch file and put it in a temp buffer. Return the buffer." ;; It is faster to avoid visiting the file. + (setq file (expand-file-name file)) (with-current-buffer (get-buffer-create " *autoload-file*") (kill-all-local-variables) (erase-buffer) (setq buffer-undo-list t buffer-read-only nil) (emacs-lisp-mode) + (setq default-directory (file-name-directory file)) (insert-file-contents file nil) (let ((enable-local-variables :safe)) (hack-local-variables)) @@ -286,6 +290,12 @@ which lists the file name and which functions are in it, etc." (defvar no-update-autoloads nil "File local variable to prevent scanning this file for autoload cookies.") +(defun autoload-file-load-name (file) + (let ((name (file-name-nondirectory file))) + (if (string-match "\\.elc?\\(\\.\\|\\'\\)" name) + (substring name 0 (match-beginning 0)) + name))) + (defun generate-file-autoloads (file) "Insert at point a loaddefs autoload section for FILE. Autoloads are generated for defuns and defmacros in FILE @@ -294,100 +304,155 @@ If FILE is being visited in a buffer, the contents of the buffer are used. Return non-nil in the case where no autoloads were added at point." (interactive "fGenerate autoloads for file: ") - (let ((outbuf (current-buffer)) - (autoloads-done '()) - (load-name (let ((name (file-name-nondirectory file))) - (if (string-match "\\.elc?\\(\\.\\|$\\)" name) - (substring name 0 (match-beginning 0)) - name))) - (print-length nil) - (print-readably t) ; This does something in Lucid Emacs. - (float-output-format nil) - (done-any nil) - (visited (get-file-buffer file)) - output-start) - - ;; If the autoload section we create here uses an absolute - ;; file name for FILE in its header, and then Emacs is installed - ;; under a different path on another system, - ;; `update-autoloads-here' won't be able to find the files to be - ;; autoloaded. So, if FILE is in the same directory or a - ;; subdirectory of the current buffer's directory, we'll make it - ;; relative to the current buffer's directory. - (setq file (expand-file-name file)) - (let* ((source-truename (file-truename file)) - (dir-truename (file-name-as-directory - (file-truename default-directory))) - (len (length dir-truename))) - (if (and (< len (length source-truename)) - (string= dir-truename (substring source-truename 0 len))) - (setq file (substring source-truename len)))) - - (with-current-buffer (or visited - ;; It is faster to avoid visiting the file. - (autoload-find-file file)) - ;; Obey the no-update-autoloads file local variable. - (unless no-update-autoloads - (message "Generating autoloads for %s..." file) - (setq output-start (with-current-buffer outbuf (point))) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (while (not (eobp)) - (skip-chars-forward " \t\n\f") - (cond - ((looking-at (regexp-quote generate-autoload-cookie)) - (search-forward generate-autoload-cookie) - (skip-chars-forward " \t") - (setq done-any t) - (if (eolp) - ;; Read the next form and make an autoload. - (let* ((form (prog1 (read (current-buffer)) - (or (bolp) (forward-line 1)))) - (autoload (make-autoload form load-name))) - (if autoload - (push (nth 1 form) autoloads-done) - (setq autoload form)) - (let ((autoload-print-form-outbuf outbuf)) - (autoload-print-form autoload))) - - ;; Copy the rest of the line to the output. - (princ (buffer-substring - (progn - ;; Back up over whitespace, to preserve it. - (skip-chars-backward " \f\t") - (if (= (char-after (1+ (point))) ? ) - ;; Eat one space. - (forward-char 1)) - (point)) - (progn (forward-line 1) (point))) - outbuf))) - ((looking-at ";") - ;; Don't read the comment. - (forward-line 1)) - (t - (forward-sexp 1) - (forward-line 1)))))) - - (when done-any - (with-current-buffer outbuf - (save-excursion - ;; Insert the section-header line which lists the file name - ;; and which functions are in it, etc. - (goto-char output-start) - (autoload-insert-section-header - outbuf autoloads-done load-name file - (nth 5 (file-attributes file))) - (insert ";;; Generated autoloads from " - (autoload-trim-file-name file) "\n")) - (insert generate-autoload-section-trailer))) - (message "Generating autoloads for %s...done" file)) - (or visited - ;; We created this buffer, so we should kill it. - (kill-buffer (current-buffer)))) - (not done-any))) + (autoload-generate-file-autoloads file (current-buffer))) + +;; When called from `generate-file-autoloads' we should ignore +;; `generated-autoload-file' altogether. When called from +;; `update-file-autoloads' we don't know `outbuf'. And when called from +;; `update-directory-autoloads' it's in between: we know the default +;; `outbuf' but we should obey any file-local setting of +;; `generated-autoload-file'. +(defun autoload-generate-file-autoloads (file &optional outbuf outfile) + "Insert an autoload section for FILE in the appropriate buffer. +Autoloads are generated for defuns and defmacros in FILE +marked by `generate-autoload-cookie' (which see). +If FILE is being visited in a buffer, the contents of the buffer are used. +OUTBUF is the buffer in which the autoload statements should be inserted. +If OUTBUF is nil, it will be determined by `autoload-generated-file'. + +If provided, OUTFILE is expected to be the file name of OUTBUF. +If OUTFILE is non-nil and FILE specifies a `generated-autoload-file' +different from OUTFILE, then OUTBUF is ignored. + +Return non-nil iff FILE adds no autoloads to OUTFILE +\(or OUTBUF if OUTFILE is nil)." + (catch 'done + (let ((autoloads-done '()) + (load-name (autoload-file-load-name file)) + (print-length nil) + (print-readably t) ; This does something in Lucid Emacs. + (float-output-format nil) + (visited (get-file-buffer file)) + (otherbuf nil) + (absfile (expand-file-name file)) + relfile + ;; nil until we found a cookie. + output-start) + + (with-current-buffer (or visited + ;; It is faster to avoid visiting the file. + (autoload-find-file file)) + ;; Obey the no-update-autoloads file local variable. + (unless no-update-autoloads + (message "Generating autoloads for %s..." file) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (not (eobp)) + (skip-chars-forward " \t\n\f") + (cond + ((looking-at (regexp-quote generate-autoload-cookie)) + ;; If not done yet, figure out where to insert this text. + (unless output-start + (when (and outfile + (not (equal outfile (autoload-generated-file)))) + ;; A file-local setting of autoload-generated-file says + ;; we should ignore OUTBUF. + (setq outbuf nil) + (setq otherbuf t)) + (unless outbuf + (setq outbuf (autoload-find-destination absfile)) + (unless outbuf + ;; The file has autoload cookies, but they're + ;; already up-to-date. If OUTFILE is nil, the + ;; entries are in the expected OUTBUF, otherwise + ;; they're elsewhere. + (throw 'done outfile))) + (with-current-buffer outbuf + (setq relfile (file-relative-name absfile)) + (setq output-start (point))) + ;; (message "file=%S, relfile=%S, dest=%S" + ;; file relfile (autoload-generated-file)) + ) + (search-forward generate-autoload-cookie) + (skip-chars-forward " \t") + (if (eolp) + (condition-case err + ;; Read the next form and make an autoload. + (let* ((form (prog1 (read (current-buffer)) + (or (bolp) (forward-line 1)))) + (autoload (make-autoload form load-name))) + (if autoload + (push (nth 1 form) autoloads-done) + (setq autoload form)) + (let ((autoload-print-form-outbuf outbuf)) + (autoload-print-form autoload))) + (error + (message "Error in %s: %S" file err))) + + ;; Copy the rest of the line to the output. + (princ (buffer-substring + (progn + ;; Back up over whitespace, to preserve it. + (skip-chars-backward " \f\t") + (if (= (char-after (1+ (point))) ? ) + ;; Eat one space. + (forward-char 1)) + (point)) + (progn (forward-line 1) (point))) + outbuf))) + ((looking-at ";") + ;; Don't read the comment. + (forward-line 1)) + (t + (forward-sexp 1) + (forward-line 1)))))) + + (when output-start + (let ((secondary-autoloads-file-buf + (if (local-variable-p 'generated-autoload-file) + (current-buffer)))) + (with-current-buffer outbuf + (save-excursion + ;; Insert the section-header line which lists the file name + ;; and which functions are in it, etc. + (goto-char output-start) + (autoload-insert-section-header + outbuf autoloads-done load-name relfile + (if secondary-autoloads-file-buf + ;; MD5 checksums are much better because they do not + ;; change unless the file changes (so they'll be + ;; equal on two different systems and will change + ;; less often than time-stamps, thus leading to fewer + ;; unneeded changes causing spurious conflicts), but + ;; using time-stamps is a very useful optimization, + ;; so we use time-stamps for the main autoloads file + ;; (loaddefs.el) where we have special ways to + ;; circumvent the "random change problem", and MD5 + ;; checksum in secondary autoload files where we do + ;; not need the time-stamp optimization because it is + ;; already provided by the primary autoloads file. + (md5 secondary-autoloads-file-buf + ;; We'd really want to just use + ;; `emacs-internal' instead. + nil nil 'emacs-mule-unix) + (nth 5 (file-attributes relfile)))) + (insert ";;; Generated autoloads from " relfile "\n")) + (insert generate-autoload-section-trailer)))) + (message "Generating autoloads for %s...done" file)) + (or visited + ;; We created this buffer, so we should kill it. + (kill-buffer (current-buffer)))) + ;; If the entries were added to some other buffer, then the file + ;; doesn't add entries to OUTFILE. + (or (not output-start) otherbuf)))) +(defun autoload-save-buffers () + (while autoload-modified-buffers + (with-current-buffer (pop autoload-modified-buffers) + (save-buffer)))) + ;;;###autoload (defun update-file-autoloads (file &optional save-after) "Update the autoloads for FILE in `generated-autoload-file' @@ -397,80 +462,80 @@ save the buffer too. Return FILE if there was no autoload cookie in it, else nil." (interactive "fUpdate autoloads for file: \np") - (let ((load-name (let ((name (file-name-nondirectory file))) - (if (string-match "\\.elc?\\(\\.\\|$\\)" name) - (substring name 0 (match-beginning 0)) - name))) - (found nil) - (existing-buffer (get-file-buffer file)) - (no-autoloads nil)) - (save-excursion - ;; We want to get a value for generated-autoload-file from - ;; the local variables section if it's there. - (if existing-buffer - (set-buffer existing-buffer)) - ;; We must read/write the file without any code conversion, - ;; but still decode EOLs. - (let ((coding-system-for-read 'raw-text)) - (set-buffer (find-file-noselect - (autoload-ensure-default-file - (expand-file-name generated-autoload-file - (expand-file-name "lisp" - source-directory))))) - ;; This is to make generated-autoload-file have Unix EOLs, so - ;; that it is portable to all platforms. - (setq buffer-file-coding-system 'raw-text-unix)) - (or (> (buffer-size) 0) - (error "Autoloads file %s does not exist" buffer-file-name)) - (or (file-writable-p buffer-file-name) - (error "Autoloads file %s is not writable" buffer-file-name)) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - ;; Look for the section for LOAD-NAME. - (while (and (not found) - (search-forward generate-autoload-section-header nil t)) - (let ((form (autoload-read-section-header))) - (cond ((string= (nth 2 form) load-name) - ;; We found the section for this file. - ;; Check if it is up to date. - (let ((begin (match-beginning 0)) - (last-time (nth 4 form)) - (file-time (nth 5 (file-attributes file)))) - (if (and (or (null existing-buffer) - (not (buffer-modified-p existing-buffer))) - (listp last-time) (= (length last-time) 2) - (not (time-less-p last-time file-time))) - (progn - (if (interactive-p) - (message "\ -Autoload section for %s is up to date." - file)) - (setq found 'up-to-date)) - (search-forward generate-autoload-section-trailer) - (delete-region begin (point)) - (setq found t)))) - ((string< load-name (nth 2 form)) - ;; We've come to a section alphabetically later than - ;; LOAD-NAME. We assume the file is in order and so - ;; there must be no section for LOAD-NAME. We will - ;; insert one before the section here. - (goto-char (match-beginning 0)) - (setq found 'new))))) - (or found - (progn - (setq found 'new) - ;; No later sections in the file. Put before the last page. - (goto-char (point-max)) - (search-backward "\f" nil t))) - (or (eq found 'up-to-date) - (setq no-autoloads (generate-file-autoloads file))))) - (and save-after - (buffer-modified-p) - (save-buffer)) - - (if no-autoloads file)))) + (let* ((autoload-modified-buffers nil) + (no-autoloads (autoload-generate-file-autoloads file))) + (if autoload-modified-buffers + (if save-after (autoload-save-buffers)) + (if (interactive-p) + (message "Autoload section for %s is up to date." file))) + (if no-autoloads file))) + +(defun autoload-find-destination (file) + "Find the destination point of the current buffer's autoloads. +FILE is the file name of the current buffer. +Returns a buffer whose point is placed at the requested location. +Returns nil if the file's autoloads are uptodate, otherwise +removes any prior now out-of-date autoload entries." + (catch 'up-to-date + (let* ((load-name (autoload-file-load-name file)) + (buf (current-buffer)) + (existing-buffer (if buffer-file-name buf)) + (found nil)) + (with-current-buffer + ;; We must read/write the file without any code conversion, + ;; but still decode EOLs. + (let ((coding-system-for-read 'raw-text)) + (find-file-noselect + (autoload-ensure-default-file (autoload-generated-file)))) + ;; This is to make generated-autoload-file have Unix EOLs, so + ;; that it is portable to all platforms. + (setq buffer-file-coding-system 'raw-text-unix) + (or (> (buffer-size) 0) + (error "Autoloads file %s does not exist" buffer-file-name)) + (or (file-writable-p buffer-file-name) + (error "Autoloads file %s is not writable" buffer-file-name)) + (widen) + (goto-char (point-min)) + ;; Look for the section for LOAD-NAME. + (while (and (not found) + (search-forward generate-autoload-section-header nil t)) + (let ((form (autoload-read-section-header))) + (cond ((string= (nth 2 form) load-name) + ;; We found the section for this file. + ;; Check if it is up to date. + (let ((begin (match-beginning 0)) + (last-time (nth 4 form)) + (file-time (nth 5 (file-attributes file)))) + (if (and (or (null existing-buffer) + (not (buffer-modified-p existing-buffer))) + (or + ;; last-time is the time-stamp (specifying + ;; the last time we looked at the file) and + ;; the file hasn't been changed since. + (and (listp last-time) (= (length last-time) 2) + (not (time-less-p last-time file-time))) + ;; last-time is an MD5 checksum instead. + (and (stringp last-time) + (equal last-time + (md5 buf nil nil 'emacs-mule))))) + (throw 'up-to-date nil) + (autoload-remove-section begin) + (setq found t)))) + ((string< load-name (nth 2 form)) + ;; We've come to a section alphabetically later than + ;; LOAD-NAME. We assume the file is in order and so + ;; there must be no section for LOAD-NAME. We will + ;; insert one before the section here. + (goto-char (match-beginning 0)) + (setq found t))))) + (or found + (progn + ;; No later sections in the file. Put before the last page. + (goto-char (point-max)) + (search-backward "\f" nil t))) + (unless (memq (current-buffer) autoload-modified-buffers) + (push (current-buffer) autoload-modified-buffers)) + (current-buffer))))) (defun autoload-remove-section (begin) (goto-char begin) @@ -498,20 +563,21 @@ directory or directories specified." (directory-files (expand-file-name dir) t files-re)) dirs))) + (done ()) (this-time (current-time)) - (no-autoloads nil) ;files with no autoload cookies. - (autoloads-file - (expand-file-name generated-autoload-file - (expand-file-name "lisp" source-directory))) - (top-dir (file-name-directory autoloads-file))) + ;; Files with no autoload cookies or whose autoloads go to other + ;; files because of file-local autoload-generated-file settings. + (no-autoloads nil) + (autoload-modified-buffers nil)) (with-current-buffer - (find-file-noselect (autoload-ensure-default-file autoloads-file)) + (find-file-noselect + (autoload-ensure-default-file (autoload-generated-file))) (save-excursion ;; Canonicalize file names and remove the autoload file itself. - (setq files (delete (autoload-trim-file-name buffer-file-name) - (mapcar 'autoload-trim-file-name files))) + (setq files (delete (file-relative-name buffer-file-name) + (mapcar 'file-relative-name files))) (goto-char (point-min)) (while (search-forward generate-autoload-section-header nil t) @@ -531,19 +597,27 @@ directory or directories specified." (push file no-autoloads) (setq files (delete file files))))))) ((not (stringp file))) - ((not (file-exists-p (expand-file-name file top-dir))) - ;; Remove the obsolete section. + ((or (not (file-exists-p file)) + ;; Remove duplicates as well, just in case. + (member file done)) + ;; Remove the obsolete section. (autoload-remove-section (match-beginning 0))) - ((equal (nth 4 form) (nth 5 (file-attributes file))) + ((not (time-less-p (nth 4 form) + (nth 5 (file-attributes file)))) ;; File hasn't changed. nil) (t - (update-file-autoloads file))) + (autoload-remove-section (match-beginning 0)) + (if (autoload-generate-file-autoloads + file (current-buffer) buffer-file-name) + (push file no-autoloads)))) + (push file done) (setq files (delete file files))))) ;; Elements remaining in FILES have no existing autoload sections yet. - (setq no-autoloads - (append no-autoloads - (delq nil (mapcar 'update-file-autoloads files)))) + (dolist (file files) + (if (autoload-generate-file-autoloads file nil buffer-file-name) + (push file no-autoloads))) + (when no-autoloads ;; Sort them for better readability. (setq no-autoloads (sort no-autoloads 'string<)) @@ -554,7 +628,10 @@ directory or directories specified." (current-buffer) nil nil no-autoloads this-time) (insert generate-autoload-section-trailer)) - (save-buffer)))) + (save-buffer) + ;; In case autoload entries were added to other files because of + ;; file-local autoload-generated-file settings. + (autoload-save-buffers)))) (define-obsolete-function-alias 'update-autoloads-from-directories 'update-directory-autoloads "22.1") diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 60c20e68b03..98e55dab98f 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -43,6 +43,7 @@ ;;; Type coercion. +;;;###autoload (defun coerce (x type) "Coerce OBJECT to type TYPE. TYPE is a Common Lisp type specifier. @@ -60,6 +61,7 @@ TYPE is a Common Lisp type specifier. ;;; Predicates. +;;;###autoload (defun equalp (x y) "Return t if two Lisp objects have similar structures and contents. This is like `equal', except that it accepts numerically equal @@ -87,6 +89,7 @@ strings case-insensitively." ;;; Control structures. +;;;###autoload (defun cl-mapcar-many (cl-func cl-seqs) (if (cdr (cdr cl-seqs)) (let* ((cl-res nil) @@ -119,6 +122,7 @@ strings case-insensitively." cl-res))) (nreverse cl-res)))) +;;;###autoload (defun map (cl-type cl-func cl-seq &rest cl-rest) "Map a FUNCTION across one or more SEQUENCEs, returning a sequence. TYPE is the sequence type to return. @@ -126,6 +130,7 @@ TYPE is the sequence type to return. (let ((cl-res (apply 'mapcar* cl-func cl-seq cl-rest))) (and cl-type (coerce cl-res cl-type)))) +;;;###autoload (defun maplist (cl-func cl-list &rest cl-rest) "Map FUNCTION to each sublist of LIST or LISTs. Like `mapcar', except applies to lists and their cdr's rather than to @@ -154,6 +159,7 @@ the elements themselves. cl-seq) (mapc cl-func cl-seq))) +;;;###autoload (defun mapl (cl-func cl-list &rest cl-rest) "Like `maplist', but does not accumulate values returned by the function. \n(fn FUNCTION LIST...)" @@ -163,16 +169,19 @@ the elements themselves. (while cl-p (funcall cl-func cl-p) (setq cl-p (cdr cl-p))))) cl-list) +;;;###autoload (defun mapcan (cl-func cl-seq &rest cl-rest) "Like `mapcar', but nconc's together the values returned by the function. \n(fn FUNCTION SEQUENCE...)" (apply 'nconc (apply 'mapcar* cl-func cl-seq cl-rest))) +;;;###autoload (defun mapcon (cl-func cl-list &rest cl-rest) "Like `maplist', but nconc's together the values returned by the function. \n(fn FUNCTION LIST...)" (apply 'nconc (apply 'maplist cl-func cl-list cl-rest))) +;;;###autoload (defun some (cl-pred cl-seq &rest cl-rest) "Return true if PREDICATE is true of any element of SEQ or SEQs. If so, return the true (non-nil) value returned by PREDICATE. @@ -188,6 +197,7 @@ If so, return the true (non-nil) value returned by PREDICATE. (while (and cl-seq (not (setq cl-x (funcall cl-pred (pop cl-seq)))))) cl-x))) +;;;###autoload (defun every (cl-pred cl-seq &rest cl-rest) "Return true if PREDICATE is true of every element of SEQ or SEQs. \n(fn PREDICATE SEQ...)" @@ -201,19 +211,23 @@ If so, return the true (non-nil) value returned by PREDICATE. (setq cl-seq (cdr cl-seq))) (null cl-seq))) +;;;###autoload (defun notany (cl-pred cl-seq &rest cl-rest) "Return true if PREDICATE is false of every element of SEQ or SEQs. \n(fn PREDICATE SEQ...)" (not (apply 'some cl-pred cl-seq cl-rest))) +;;;###autoload (defun notevery (cl-pred cl-seq &rest cl-rest) "Return true if PREDICATE is false of some element of SEQ or SEQs. \n(fn PREDICATE SEQ...)" (not (apply 'every cl-pred cl-seq cl-rest))) ;;; Support for `loop'. +;;;###autoload (defalias 'cl-map-keymap 'map-keymap) +;;;###autoload (defun cl-map-keymap-recursively (cl-func-rec cl-map &optional cl-base) (or cl-base (setq cl-base (copy-sequence [0]))) @@ -228,6 +242,7 @@ If so, return the true (non-nil) value returned by PREDICATE. (funcall cl-func-rec cl-base cl-bind)))) cl-map)) +;;;###autoload (defun cl-map-intervals (cl-func &optional cl-what cl-prop cl-start cl-end) (or cl-what (setq cl-what (current-buffer))) (if (bufferp cl-what) @@ -255,6 +270,7 @@ If so, return the true (non-nil) value returned by PREDICATE. (funcall cl-func cl-start (min cl-next cl-end)) (setq cl-start cl-next))))) +;;;###autoload (defun cl-map-overlays (cl-func &optional cl-buffer cl-start cl-end cl-arg) (or cl-buffer (setq cl-buffer (current-buffer))) (if (fboundp 'overlay-lists) @@ -296,6 +312,7 @@ If so, return the true (non-nil) value returned by PREDICATE. (set-marker cl-mark nil) (if cl-mark2 (set-marker cl-mark2 nil))))) ;;; Support for `setf'. +;;;###autoload (defun cl-set-frame-visible-p (frame val) (cond ((null val) (make-frame-invisible frame)) ((eq val 'icon) (iconify-frame frame)) @@ -304,6 +321,7 @@ If so, return the true (non-nil) value returned by PREDICATE. ;;; Support for `progv'. (defvar cl-progv-save) +;;;###autoload (defun cl-progv-before (syms values) (while syms (push (if (boundp (car syms)) @@ -323,6 +341,7 @@ If so, return the true (non-nil) value returned by PREDICATE. ;;; Numbers. +;;;###autoload (defun gcd (&rest args) "Return the greatest common divisor of the arguments." (let ((a (abs (or (pop args) 0)))) @@ -331,6 +350,7 @@ If so, return the true (non-nil) value returned by PREDICATE. (while (> b 0) (setq b (% a (setq a b)))))) a)) +;;;###autoload (defun lcm (&rest args) "Return the least common multiple of the arguments." (if (memq 0 args) @@ -341,6 +361,7 @@ If so, return the true (non-nil) value returned by PREDICATE. (setq a (* (/ a (gcd a b)) b)))) a))) +;;;###autoload (defun isqrt (x) "Return the integer square root of the argument." (if (and (integerp x) (> x 0)) @@ -352,12 +373,14 @@ If so, return the true (non-nil) value returned by PREDICATE. g) (if (eq x 0) 0 (signal 'arith-error nil)))) +;;;###autoload (defun floor* (x &optional y) "Return a list of the floor of X and the fractional part of X. With two arguments, return floor and remainder of their quotient." (let ((q (floor x y))) (list q (- x (if y (* y q) q))))) +;;;###autoload (defun ceiling* (x &optional y) "Return a list of the ceiling of X and the fractional part of X. With two arguments, return ceiling and remainder of their quotient." @@ -365,12 +388,14 @@ With two arguments, return ceiling and remainder of their quotient." (if (= (car (cdr res)) 0) res (list (1+ (car res)) (- (car (cdr res)) (or y 1)))))) +;;;###autoload (defun truncate* (x &optional y) "Return a list of the integer part of X and the fractional part of X. With two arguments, return truncation and remainder of their quotient." (if (eq (>= x 0) (or (null y) (>= y 0))) (floor* x y) (ceiling* x y))) +;;;###autoload (defun round* (x &optional y) "Return a list of X rounded to the nearest integer and the remainder. With two arguments, return rounding and remainder of their quotient." @@ -389,14 +414,17 @@ With two arguments, return rounding and remainder of their quotient." (let ((q (round x))) (list q (- x q)))))) +;;;###autoload (defun mod* (x y) "The remainder of X divided by Y, with the same sign as Y." (nth 1 (floor* x y))) +;;;###autoload (defun rem* (x y) "The remainder of X divided by Y, with the same sign as X." (nth 1 (truncate* x y))) +;;;###autoload (defun signum (x) "Return 1 if X is positive, -1 if negative, 0 if zero." (cond ((> x 0) 1) ((< x 0) -1) (t 0))) @@ -405,6 +433,7 @@ With two arguments, return rounding and remainder of their quotient." ;; Random numbers. (defvar *random-state*) +;;;###autoload (defun random* (lim &optional state) "Return a random nonnegative number less than LIM, an integer or float. Optional second arg STATE is a random-state object." @@ -412,7 +441,7 @@ Optional second arg STATE is a random-state object." ;; Inspired by "ran3" from Numerical Recipes. Additive congruential method. (let ((vec (aref state 3))) (if (integerp vec) - (let ((i 0) (j (- 1357335 (% (abs vec) 1357333))) (k 1) ii) + (let ((i 0) (j (- 1357335 (% (abs vec) 1357333))) (k 1)) (aset state 3 (setq vec (make-vector 55 nil))) (aset vec 0 j) (while (> (setq i (% (+ i 21) 55)) 0) @@ -429,6 +458,7 @@ Optional second arg STATE is a random-state object." (if (< (setq n (logand n mask)) lim) n (random* lim state)))) (* (/ n '8388608e0) lim))))) +;;;###autoload (defun make-random-state (&optional state) "Return a copy of random-state STATE, or of `*random-state*' if omitted. If STATE is t, return a new state object seeded from the time of day." @@ -437,6 +467,7 @@ If STATE is t, return a new state object seeded from the time of day." ((integerp state) (vector 'cl-random-state-tag -1 30 state)) (t (make-random-state (cl-random-time))))) +;;;###autoload (defun random-state-p (object) "Return t if OBJECT is a random-state object." (and (vectorp object) (= (length object) 4) @@ -460,6 +491,7 @@ If STATE is t, return a new state object seeded from the time of day." (defvar float-epsilon) (defvar float-negative-epsilon) +;;;###autoload (defun cl-float-limits () (or most-positive-float (not (numberp '2e1)) (let ((x '2e0) y z) @@ -497,6 +529,7 @@ If STATE is t, return a new state object seeded from the time of day." ;;; Sequence functions. +;;;###autoload (defun subseq (seq start &optional end) "Return the subsequence of SEQ from START to END. If END is omitted, it defaults to the length of the sequence. @@ -522,6 +555,7 @@ If START or END is negative, it counts from the end." (setq i (1+ i) start (1+ start))) res)))))) +;;;###autoload (defun concatenate (type &rest seqs) "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs. \n(fn TYPE SEQUENCE...)" @@ -533,14 +567,17 @@ If START or END is negative, it counts from the end." ;;; List functions. +;;;###autoload (defun revappend (x y) "Equivalent to (append (reverse X) Y)." (nconc (reverse x) y)) +;;;###autoload (defun nreconc (x y) "Equivalent to (nconc (nreverse X) Y)." (nconc (nreverse x) y)) +;;;###autoload (defun list-length (x) "Return the length of list X. Return nil if list is circular." (let ((n 0) (fast x) (slow x)) @@ -548,6 +585,7 @@ If START or END is negative, it counts from the end." (setq n (+ n 2) fast (cdr (cdr fast)) slow (cdr slow))) (if fast (if (cdr fast) nil (1+ n)) n))) +;;;###autoload (defun tailp (sublist list) "Return true if SUBLIST is a tail of LIST." (while (and (consp list) (not (eq sublist list))) @@ -559,6 +597,7 @@ If START or END is negative, it counts from the end." ;;; Property lists. +;;;###autoload (defun get* (sym tag &optional def) ; See compiler macro in cl-macs.el "Return the value of SYMBOL's PROPNAME property, or DEFAULT if none. \n(fn SYMBOL PROPNAME &optional DEFAULT)" @@ -569,6 +608,7 @@ If START or END is negative, it counts from the end." (setq plist (cdr (cdr plist)))) (if plist (car (cdr plist)) def))))) +;;;###autoload (defun getf (plist tag &optional def) "Search PROPLIST for property PROPNAME; return its value or DEFAULT. PROPLIST is a list of the sort returned by `symbol-plist'. @@ -583,16 +623,19 @@ PROPLIST is a list of the sort returned by `symbol-plist'. (setq plist (cdr (cdr plist)))) (if plist (car (cdr plist)) def)))) +;;;###autoload (defun cl-set-getf (plist tag val) (let ((p plist)) (while (and p (not (eq (car p) tag))) (setq p (cdr (cdr p)))) (if p (progn (setcar (cdr p) val) plist) (list* tag val plist)))) +;;;###autoload (defun cl-do-remf (plist tag) (let ((p (cdr plist))) (while (and (cdr p) (not (eq (car (cdr p)) tag))) (setq p (cdr (cdr p)))) (and (cdr p) (progn (setcdr p (cdr (cdr (cdr p)))) t)))) +;;;###autoload (defun cl-remprop (sym tag) "Remove from SYMBOL's plist the property PROPNAME and its value. \n(fn SYMBOL PROPNAME)" @@ -600,6 +643,7 @@ PROPLIST is a list of the sort returned by `symbol-plist'. (if (and plist (eq tag (car plist))) (progn (setplist sym (cdr (cdr plist))) t) (cl-do-remf plist tag)))) +;;;###autoload (defalias 'remprop 'cl-remprop) @@ -616,14 +660,22 @@ PROPLIST is a list of the sort returned by `symbol-plist'. (defvar cl-builtin-clrhash (symbol-function 'clrhash)) (defvar cl-builtin-maphash (symbol-function 'maphash)) +;;;###autoload (defalias 'cl-gethash 'gethash) +;;;###autoload (defalias 'cl-puthash 'puthash) +;;;###autoload (defalias 'cl-remhash 'remhash) +;;;###autoload (defalias 'cl-clrhash 'clrhash) +;;;###autoload (defalias 'cl-maphash 'maphash) ;; These three actually didn't exist in Emacs-20. +;;;###autoload (defalias 'cl-make-hash-table 'make-hash-table) +;;;###autoload (defalias 'cl-hash-table-p 'hash-table-p) +;;;###autoload (defalias 'cl-hash-table-count 'hash-table-count) ;;; Some debugging aids. @@ -672,6 +724,7 @@ PROPLIST is a list of the sort returned by `symbol-plist'. (defvar cl-macroexpand-cmacs nil) (defvar cl-closure-vars nil) +;;;###autoload (defun cl-macroexpand-all (form &optional env) "Expand all macro calls through a Lisp FORM. This also does some trivial optimizations to make the form prettier." @@ -753,6 +806,7 @@ This also does some trivial optimizations to make the form prettier." (defun cl-macroexpand-body (body &optional env) (mapcar (function (lambda (x) (cl-macroexpand-all x env))) body)) +;;;###autoload (defun cl-prettyexpand (form &optional full) (message "Expanding...") (let ((cl-macroexpand-cmacs full) (cl-compiling-file full) @@ -767,5 +821,9 @@ This also does some trivial optimizations to make the form prettier." (run-hooks 'cl-extra-load-hook) +;; Local variables: +;; generated-autoload-file: "cl-loaddefs.el" +;; End: + ;; arch-tag: bcd03437-0871-43fb-a8f1-ad0e0b5427ed ;;; cl-extra.el ends here diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el new file mode 100644 index 00000000000..1589e19cbb2 --- /dev/null +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -0,0 +1,1234 @@ +;;; cl-loaddefs.el --- automatically extracted autoloads +;; +;;; Code: + + +;;;### (autoloads (cl-prettyexpand cl-macroexpand-all cl-remprop +;;;;;; cl-do-remf cl-set-getf getf get* tailp list-length nreconc +;;;;;; revappend concatenate subseq cl-float-limits random-state-p +;;;;;; make-random-state random* signum rem* mod* round* truncate* +;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p +;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively +;;;;;; notevery notany every some mapcon mapcan mapl maplist map +;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "47c92504dda976a632c2c10bedd4b6a4") +;;; Generated autoloads from cl-extra.el + +(autoload (quote coerce) "cl-extra" "\ +Coerce OBJECT to type TYPE. +TYPE is a Common Lisp type specifier. + +\(fn OBJECT TYPE)" nil nil) + +(autoload (quote equalp) "cl-extra" "\ +Return t if two Lisp objects have similar structures and contents. +This is like `equal', except that it accepts numerically equal +numbers of different types (float vs. integer), and also compares +strings case-insensitively. + +\(fn X Y)" nil nil) + +(autoload (quote cl-mapcar-many) "cl-extra" "\ +Not documented + +\(fn CL-FUNC CL-SEQS)" nil nil) + +(autoload (quote map) "cl-extra" "\ +Map a FUNCTION across one or more SEQUENCEs, returning a sequence. +TYPE is the sequence type to return. + +\(fn TYPE FUNCTION SEQUENCE...)" nil nil) + +(autoload (quote maplist) "cl-extra" "\ +Map FUNCTION to each sublist of LIST or LISTs. +Like `mapcar', except applies to lists and their cdr's rather than to +the elements themselves. + +\(fn FUNCTION LIST...)" nil nil) + +(autoload (quote mapl) "cl-extra" "\ +Like `maplist', but does not accumulate values returned by the function. + +\(fn FUNCTION LIST...)" nil nil) + +(autoload (quote mapcan) "cl-extra" "\ +Like `mapcar', but nconc's together the values returned by the function. + +\(fn FUNCTION SEQUENCE...)" nil nil) + +(autoload (quote mapcon) "cl-extra" "\ +Like `maplist', but nconc's together the values returned by the function. + +\(fn FUNCTION LIST...)" nil nil) + +(autoload (quote some) "cl-extra" "\ +Return true if PREDICATE is true of any element of SEQ or SEQs. +If so, return the true (non-nil) value returned by PREDICATE. + +\(fn PREDICATE SEQ...)" nil nil) + +(autoload (quote every) "cl-extra" "\ +Return true if PREDICATE is true of every element of SEQ or SEQs. + +\(fn PREDICATE SEQ...)" nil nil) + +(autoload (quote notany) "cl-extra" "\ +Return true if PREDICATE is false of every element of SEQ or SEQs. + +\(fn PREDICATE SEQ...)" nil nil) + +(autoload (quote notevery) "cl-extra" "\ +Return true if PREDICATE is false of some element of SEQ or SEQs. + +\(fn PREDICATE SEQ...)" nil nil) + +(defalias (quote cl-map-keymap) (quote map-keymap)) + +(autoload (quote cl-map-keymap-recursively) "cl-extra" "\ +Not documented + +\(fn CL-FUNC-REC CL-MAP &optional CL-BASE)" nil nil) + +(autoload (quote cl-map-intervals) "cl-extra" "\ +Not documented + +\(fn CL-FUNC &optional CL-WHAT CL-PROP CL-START CL-END)" nil nil) + +(autoload (quote cl-map-overlays) "cl-extra" "\ +Not documented + +\(fn CL-FUNC &optional CL-BUFFER CL-START CL-END CL-ARG)" nil nil) + +(autoload (quote cl-set-frame-visible-p) "cl-extra" "\ +Not documented + +\(fn FRAME VAL)" nil nil) + +(autoload (quote cl-progv-before) "cl-extra" "\ +Not documented + +\(fn SYMS VALUES)" nil nil) + +(autoload (quote gcd) "cl-extra" "\ +Return the greatest common divisor of the arguments. + +\(fn &rest ARGS)" nil nil) + +(autoload (quote lcm) "cl-extra" "\ +Return the least common multiple of the arguments. + +\(fn &rest ARGS)" nil nil) + +(autoload (quote isqrt) "cl-extra" "\ +Return the integer square root of the argument. + +\(fn X)" nil nil) + +(autoload (quote floor*) "cl-extra" "\ +Return a list of the floor of X and the fractional part of X. +With two arguments, return floor and remainder of their quotient. + +\(fn X &optional Y)" nil nil) + +(autoload (quote ceiling*) "cl-extra" "\ +Return a list of the ceiling of X and the fractional part of X. +With two arguments, return ceiling and remainder of their quotient. + +\(fn X &optional Y)" nil nil) + +(autoload (quote truncate*) "cl-extra" "\ +Return a list of the integer part of X and the fractional part of X. +With two arguments, return truncation and remainder of their quotient. + +\(fn X &optional Y)" nil nil) + +(autoload (quote round*) "cl-extra" "\ +Return a list of X rounded to the nearest integer and the remainder. +With two arguments, return rounding and remainder of their quotient. + +\(fn X &optional Y)" nil nil) + +(autoload (quote mod*) "cl-extra" "\ +The remainder of X divided by Y, with the same sign as Y. + +\(fn X Y)" nil nil) + +(autoload (quote rem*) "cl-extra" "\ +The remainder of X divided by Y, with the same sign as X. + +\(fn X Y)" nil nil) + +(autoload (quote signum) "cl-extra" "\ +Return 1 if X is positive, -1 if negative, 0 if zero. + +\(fn X)" nil nil) + +(autoload (quote random*) "cl-extra" "\ +Return a random nonnegative number less than LIM, an integer or float. +Optional second arg STATE is a random-state object. + +\(fn LIM &optional STATE)" nil nil) + +(autoload (quote make-random-state) "cl-extra" "\ +Return a copy of random-state STATE, or of `*random-state*' if omitted. +If STATE is t, return a new state object seeded from the time of day. + +\(fn &optional STATE)" nil nil) + +(autoload (quote random-state-p) "cl-extra" "\ +Return t if OBJECT is a random-state object. + +\(fn OBJECT)" nil nil) + +(autoload (quote cl-float-limits) "cl-extra" "\ +Not documented + +\(fn)" nil nil) + +(autoload (quote subseq) "cl-extra" "\ +Return the subsequence of SEQ from START to END. +If END is omitted, it defaults to the length of the sequence. +If START or END is negative, it counts from the end. + +\(fn SEQ START &optional END)" nil nil) + +(autoload (quote concatenate) "cl-extra" "\ +Concatenate, into a sequence of type TYPE, the argument SEQUENCEs. + +\(fn TYPE SEQUENCE...)" nil nil) + +(autoload (quote revappend) "cl-extra" "\ +Equivalent to (append (reverse X) Y). + +\(fn X Y)" nil nil) + +(autoload (quote nreconc) "cl-extra" "\ +Equivalent to (nconc (nreverse X) Y). + +\(fn X Y)" nil nil) + +(autoload (quote list-length) "cl-extra" "\ +Return the length of list X. Return nil if list is circular. + +\(fn X)" nil nil) + +(autoload (quote tailp) "cl-extra" "\ +Return true if SUBLIST is a tail of LIST. + +\(fn SUBLIST LIST)" nil nil) + +(autoload (quote get*) "cl-extra" "\ +Return the value of SYMBOL's PROPNAME property, or DEFAULT if none. + +\(fn SYMBOL PROPNAME &optional DEFAULT)" nil nil) + +(autoload (quote getf) "cl-extra" "\ +Search PROPLIST for property PROPNAME; return its value or DEFAULT. +PROPLIST is a list of the sort returned by `symbol-plist'. + +\(fn PROPLIST PROPNAME &optional DEFAULT)" nil nil) + +(autoload (quote cl-set-getf) "cl-extra" "\ +Not documented + +\(fn PLIST TAG VAL)" nil nil) + +(autoload (quote cl-do-remf) "cl-extra" "\ +Not documented + +\(fn PLIST TAG)" nil nil) + +(autoload (quote cl-remprop) "cl-extra" "\ +Remove from SYMBOL's plist the property PROPNAME and its value. + +\(fn SYMBOL PROPNAME)" nil nil) + +(defalias (quote remprop) (quote cl-remprop)) + +(defalias (quote cl-gethash) (quote gethash)) + +(defalias (quote cl-puthash) (quote puthash)) + +(defalias (quote cl-remhash) (quote remhash)) + +(defalias (quote cl-clrhash) (quote clrhash)) + +(defalias (quote cl-maphash) (quote maphash)) + +(defalias (quote cl-make-hash-table) (quote make-hash-table)) + +(defalias (quote cl-hash-table-p) (quote hash-table-p)) + +(defalias (quote cl-hash-table-count) (quote hash-table-count)) + +(autoload (quote cl-macroexpand-all) "cl-extra" "\ +Expand all macro calls through a Lisp FORM. +This also does some trivial optimizations to make the form prettier. + +\(fn FORM &optional ENV)" nil nil) + +(autoload (quote cl-prettyexpand) "cl-extra" "\ +Not documented + +\(fn FORM &optional FULL)" nil nil) + +;;;*** + +;;;### (autoloads (compiler-macroexpand define-compiler-macro ignore-errors +;;;;;; assert check-type typep cl-struct-setf-expander defstruct +;;;;;; define-modify-macro callf2 callf letf* letf rotatef shiftf +;;;;;; remf cl-do-pop psetf setf get-setf-method defsetf define-setf-method +;;;;;; declare the locally multiple-value-setq multiple-value-bind +;;;;;; lexical-let* lexical-let symbol-macrolet macrolet labels +;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist +;;;;;; do* do loop return-from return block etypecase typecase ecase +;;;;;; case load-time-value eval-when destructuring-bind function* +;;;;;; defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs" +;;;;;; "cl-macs.el" "7ccc827d272482ca276937ca18a7895a") +;;; Generated autoloads from cl-macs.el + +(autoload (quote cl-compile-time-init) "cl-macs" "\ +Not documented + +\(fn)" nil nil) + +(autoload (quote gensym) "cl-macs" "\ +Generate a new uninterned symbol. +The name is made by appending a number to PREFIX, default \"G\". + +\(fn &optional PREFIX)" nil nil) + +(autoload (quote gentemp) "cl-macs" "\ +Generate a new interned symbol with a unique name. +The name is made by appending a number to PREFIX, default \"G\". + +\(fn &optional PREFIX)" nil nil) + +(autoload (quote defun*) "cl-macs" "\ +Define NAME as a function. +Like normal `defun', except ARGLIST allows full Common Lisp conventions, +and BODY is implicitly surrounded by (block NAME ...). + +\(fn NAME ARGLIST [DOCSTRING] BODY...)" nil (quote macro)) + +(autoload (quote defmacro*) "cl-macs" "\ +Define NAME as a macro. +Like normal `defmacro', except ARGLIST allows full Common Lisp conventions, +and BODY is implicitly surrounded by (block NAME ...). + +\(fn NAME ARGLIST [DOCSTRING] BODY...)" nil (quote macro)) + +(autoload (quote function*) "cl-macs" "\ +Introduce a function. +Like normal `function', except that if argument is a lambda form, +its argument list allows full Common Lisp conventions. + +\(fn FUNC)" nil (quote macro)) + +(autoload (quote destructuring-bind) "cl-macs" "\ +Not documented + +\(fn ARGS EXPR &rest BODY)" nil (quote macro)) + +(autoload (quote eval-when) "cl-macs" "\ +Control when BODY is evaluated. +If `compile' is in WHEN, BODY is evaluated when compiled at top-level. +If `load' is in WHEN, BODY is evaluated when loaded after top-level compile. +If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level. + +\(fn (WHEN...) BODY...)" nil (quote macro)) + +(autoload (quote load-time-value) "cl-macs" "\ +Like `progn', but evaluates the body at load time. +The result of the body appears to the compiler as a quoted constant. + +\(fn FORM &optional READ-ONLY)" nil (quote macro)) + +(autoload (quote case) "cl-macs" "\ +Eval EXPR and choose among clauses on that value. +Each clause looks like (KEYLIST BODY...). EXPR is evaluated and compared +against each key in each KEYLIST; the corresponding BODY is evaluated. +If no clause succeeds, case returns nil. A single atom may be used in +place of a KEYLIST of one atom. A KEYLIST of t or `otherwise' is +allowed only in the final clause, and matches if no other keys match. +Key values are compared by `eql'. + +\(fn EXPR (KEYLIST BODY...)...)" nil (quote macro)) + +(autoload (quote ecase) "cl-macs" "\ +Like `case', but error if no case fits. +`otherwise'-clauses are not allowed. + +\(fn EXPR (KEYLIST BODY...)...)" nil (quote macro)) + +(autoload (quote typecase) "cl-macs" "\ +Evals EXPR, chooses among clauses on that value. +Each clause looks like (TYPE BODY...). EXPR is evaluated and, if it +satisfies TYPE, the corresponding BODY is evaluated. If no clause succeeds, +typecase returns nil. A TYPE of t or `otherwise' is allowed only in the +final clause, and matches if no other keys match. + +\(fn EXPR (TYPE BODY...)...)" nil (quote macro)) + +(autoload (quote etypecase) "cl-macs" "\ +Like `typecase', but error if no case fits. +`otherwise'-clauses are not allowed. + +\(fn EXPR (TYPE BODY...)...)" nil (quote macro)) + +(autoload (quote block) "cl-macs" "\ +Define a lexically-scoped block named NAME. +NAME may be any symbol. Code inside the BODY forms can call `return-from' +to jump prematurely out of the block. This differs from `catch' and `throw' +in two respects: First, the NAME is an unevaluated symbol rather than a +quoted symbol or other form; and second, NAME is lexically rather than +dynamically scoped: Only references to it within BODY will work. These +references may appear inside macro expansions, but not inside functions +called from BODY. + +\(fn NAME &rest BODY)" nil (quote macro)) + +(autoload (quote return) "cl-macs" "\ +Return from the block named nil. +This is equivalent to `(return-from nil RESULT)'. + +\(fn &optional RESULT)" nil (quote macro)) + +(autoload (quote return-from) "cl-macs" "\ +Return from the block named NAME. +This jump out to the innermost enclosing `(block NAME ...)' form, +returning RESULT from that form (or nil if RESULT is omitted). +This is compatible with Common Lisp, but note that `defun' and +`defmacro' do not create implicit blocks as they do in Common Lisp. + +\(fn NAME &optional RESULT)" nil (quote macro)) + +(autoload (quote loop) "cl-macs" "\ +The Common Lisp `loop' macro. +Valid clauses are: + for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM, + for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR, + for VAR across ARRAY, repeat NUM, with VAR = INIT, while COND, until COND, + always COND, never COND, thereis COND, collect EXPR into VAR, + append EXPR into VAR, nconc EXPR into VAR, sum EXPR into VAR, + count EXPR into VAR, maximize EXPR into VAR, minimize EXPR into VAR, + if COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...], + unless COND CLAUSE [and CLAUSE]... else CLAUSE [and CLAUSE...], + do EXPRS..., initially EXPRS..., finally EXPRS..., return EXPR, + finally return EXPR, named NAME. + +\(fn CLAUSE...)" nil (quote macro)) + +(autoload (quote do) "cl-macs" "\ +The Common Lisp `do' loop. + +\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil (quote macro)) + +(autoload (quote do*) "cl-macs" "\ +The Common Lisp `do*' loop. + +\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" nil (quote macro)) + +(autoload (quote dolist) "cl-macs" "\ +Loop over a list. +Evaluate BODY with VAR bound to each `car' from LIST, in turn. +Then evaluate RESULT to get return value, default nil. + +\(fn (VAR LIST [RESULT]) BODY...)" nil (quote macro)) + +(autoload (quote dotimes) "cl-macs" "\ +Loop a certain number of times. +Evaluate BODY with VAR bound to successive integers from 0, inclusive, +to COUNT, exclusive. Then evaluate RESULT to get return value, default +nil. + +\(fn (VAR COUNT [RESULT]) BODY...)" nil (quote macro)) + +(autoload (quote do-symbols) "cl-macs" "\ +Loop over all symbols. +Evaluate BODY with VAR bound to each interned symbol, or to each symbol +from OBARRAY. + +\(fn (VAR [OBARRAY [RESULT]]) BODY...)" nil (quote macro)) + +(autoload (quote do-all-symbols) "cl-macs" "\ +Not documented + +\(fn SPEC &rest BODY)" nil (quote macro)) + +(autoload (quote psetq) "cl-macs" "\ +Set SYMs to the values VALs in parallel. +This is like `setq', except that all VAL forms are evaluated (in order) +before assigning any symbols SYM to the corresponding values. + +\(fn SYM VAL SYM VAL ...)" nil (quote macro)) + +(autoload (quote progv) "cl-macs" "\ +Bind SYMBOLS to VALUES dynamically in BODY. +The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. +Each symbol in the first list is bound to the corresponding value in the +second list (or made unbound if VALUES is shorter than SYMBOLS); then the +BODY forms are executed and their result is returned. This is much like +a `let' form, except that the list of symbols can be computed at run-time. + +\(fn SYMBOLS VALUES &rest BODY)" nil (quote macro)) + +(autoload (quote flet) "cl-macs" "\ +Make temporary function definitions. +This is an analogue of `let' that operates on the function cell of FUNC +rather than its value cell. The FORMs are evaluated with the specified +function definitions in place, then the definitions are undone (the FUNCs +go back to their previous definitions, or lack thereof). + +\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil (quote macro)) + +(autoload (quote labels) "cl-macs" "\ +Make temporary function bindings. +This is like `flet', except the bindings are lexical instead of dynamic. +Unlike `flet', this macro is fully compliant with the Common Lisp standard. + +\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" nil (quote macro)) + +(autoload (quote macrolet) "cl-macs" "\ +Make temporary macro definitions. +This is like `flet', but for macros instead of functions. + +\(fn ((NAME ARGLIST BODY...) ...) FORM...)" nil (quote macro)) + +(autoload (quote symbol-macrolet) "cl-macs" "\ +Make symbol macro definitions. +Within the body FORMs, references to the variable NAME will be replaced +by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). + +\(fn ((NAME EXPANSION) ...) FORM...)" nil (quote macro)) + +(autoload (quote lexical-let) "cl-macs" "\ +Like `let', but lexically scoped. +The main visible difference is that lambdas inside BODY will create +lexical closures as in Common Lisp. + +\(fn VARLIST BODY)" nil (quote macro)) + +(autoload (quote lexical-let*) "cl-macs" "\ +Like `let*', but lexically scoped. +The main visible difference is that lambdas inside BODY will create +lexical closures as in Common Lisp. + +\(fn VARLIST BODY)" nil (quote macro)) + +(autoload (quote multiple-value-bind) "cl-macs" "\ +Collect multiple return values. +FORM must return a list; the BODY is then executed with the first N elements +of this list bound (`let'-style) to each of the symbols SYM in turn. This +is analogous to the Common Lisp `multiple-value-bind' macro, using lists to +simulate true multiple return values. For compatibility, (values A B C) is +a synonym for (list A B C). + +\(fn (SYM...) FORM BODY)" nil (quote macro)) + +(autoload (quote multiple-value-setq) "cl-macs" "\ +Collect multiple return values. +FORM must return a list; the first N elements of this list are stored in +each of the symbols SYM in turn. This is analogous to the Common Lisp +`multiple-value-setq' macro, using lists to simulate true multiple return +values. For compatibility, (values A B C) is a synonym for (list A B C). + +\(fn (SYM...) FORM)" nil (quote macro)) + +(autoload (quote locally) "cl-macs" "\ +Not documented + +\(fn &rest BODY)" nil (quote macro)) + +(autoload (quote the) "cl-macs" "\ +Not documented + +\(fn TYPE FORM)" nil (quote macro)) + +(autoload (quote declare) "cl-macs" "\ +Not documented + +\(fn &rest SPECS)" nil (quote macro)) + +(autoload (quote define-setf-method) "cl-macs" "\ +Define a `setf' method. +This method shows how to handle `setf's to places of the form (NAME ARGS...). +The argument forms ARGS are bound according to ARGLIST, as if NAME were +going to be expanded as a macro, then the BODY forms are executed and must +return a list of five elements: a temporary-variables list, a value-forms +list, a store-variables list (of length one), a store-form, and an access- +form. See `defsetf' for a simpler way to define most setf-methods. + +\(fn NAME ARGLIST BODY...)" nil (quote macro)) + +(autoload (quote defsetf) "cl-macs" "\ +Define a `setf' method. +This macro is an easy-to-use substitute for `define-setf-method' that works +well for simple place forms. In the simple `defsetf' form, `setf's of +the form (setf (NAME ARGS...) VAL) are transformed to function or macro +calls of the form (FUNC ARGS... VAL). Example: + + (defsetf aref aset) + +Alternate form: (defsetf NAME ARGLIST (STORE) BODY...). +Here, the above `setf' call is expanded by binding the argument forms ARGS +according to ARGLIST, binding the value form VAL to STORE, then executing +BODY, which must return a Lisp form that does the necessary `setf' operation. +Actually, ARGLIST and STORE may be bound to temporary variables which are +introduced automatically to preserve proper execution order of the arguments. +Example: + + (defsetf nth (n x) (v) (list 'setcar (list 'nthcdr n x) v)) + +\(fn NAME [FUNC | ARGLIST (STORE) BODY...])" nil (quote macro)) + +(autoload (quote get-setf-method) "cl-macs" "\ +Return a list of five values describing the setf-method for PLACE. +PLACE may be any Lisp form which can appear as the PLACE argument to +a macro like `setf' or `incf'. + +\(fn PLACE &optional ENV)" nil nil) + +(autoload (quote setf) "cl-macs" "\ +Set each PLACE to the value of its VAL. +This is a generalized version of `setq'; the PLACEs may be symbolic +references such as (car x) or (aref x i), as well as plain symbols. +For example, (setf (cadar x) y) is equivalent to (setcar (cdar x) y). +The return value is the last VAL in the list. + +\(fn PLACE VAL PLACE VAL ...)" nil (quote macro)) + +(autoload (quote psetf) "cl-macs" "\ +Set PLACEs to the values VALs in parallel. +This is like `setf', except that all VAL forms are evaluated (in order) +before assigning any PLACEs to the corresponding values. + +\(fn PLACE VAL PLACE VAL ...)" nil (quote macro)) + +(autoload (quote cl-do-pop) "cl-macs" "\ +Not documented + +\(fn PLACE)" nil nil) + +(autoload (quote remf) "cl-macs" "\ +Remove TAG from property list PLACE. +PLACE may be a symbol, or any generalized variable allowed by `setf'. +The form returns true if TAG was found and removed, nil otherwise. + +\(fn PLACE TAG)" nil (quote macro)) + +(autoload (quote shiftf) "cl-macs" "\ +Shift left among PLACEs. +Example: (shiftf A B C) sets A to B, B to C, and returns the old A. +Each PLACE may be a symbol, or any generalized variable allowed by `setf'. + +\(fn PLACE... VAL)" nil (quote macro)) + +(autoload (quote rotatef) "cl-macs" "\ +Rotate left among PLACEs. +Example: (rotatef A B C) sets A to B, B to C, and C to A. It returns nil. +Each PLACE may be a symbol, or any generalized variable allowed by `setf'. + +\(fn PLACE...)" nil (quote macro)) + +(autoload (quote letf) "cl-macs" "\ +Temporarily bind to PLACEs. +This is the analogue of `let', but with generalized variables (in the +sense of `setf') for the PLACEs. Each PLACE is set to the corresponding +VALUE, then the BODY forms are executed. On exit, either normally or +because of a `throw' or error, the PLACEs are set back to their original +values. Note that this macro is *not* available in Common Lisp. +As a special case, if `(PLACE)' is used instead of `(PLACE VALUE)', +the PLACE is not modified before executing BODY. + +\(fn ((PLACE VALUE) ...) BODY...)" nil (quote macro)) + +(autoload (quote letf*) "cl-macs" "\ +Temporarily bind to PLACEs. +This is the analogue of `let*', but with generalized variables (in the +sense of `setf') for the PLACEs. Each PLACE is set to the corresponding +VALUE, then the BODY forms are executed. On exit, either normally or +because of a `throw' or error, the PLACEs are set back to their original +values. Note that this macro is *not* available in Common Lisp. +As a special case, if `(PLACE)' is used instead of `(PLACE VALUE)', +the PLACE is not modified before executing BODY. + +\(fn ((PLACE VALUE) ...) BODY...)" nil (quote macro)) + +(autoload (quote callf) "cl-macs" "\ +Set PLACE to (FUNC PLACE ARGS...). +FUNC should be an unquoted function name. PLACE may be a symbol, +or any generalized variable allowed by `setf'. + +\(fn FUNC PLACE ARGS...)" nil (quote macro)) + +(autoload (quote callf2) "cl-macs" "\ +Set PLACE to (FUNC ARG1 PLACE ARGS...). +Like `callf', but PLACE is the second argument of FUNC, not the first. + +\(fn FUNC ARG1 PLACE ARGS...)" nil (quote macro)) + +(autoload (quote define-modify-macro) "cl-macs" "\ +Define a `setf'-like modify macro. +If NAME is called, it combines its PLACE argument with the other arguments +from ARGLIST using FUNC: (define-modify-macro incf (&optional (n 1)) +) + +\(fn NAME ARGLIST FUNC &optional DOC)" nil (quote macro)) + +(autoload (quote defstruct) "cl-macs" "\ +Define a struct type. +This macro defines a new Lisp data type called NAME, which contains data +stored in SLOTs. This defines a `make-NAME' constructor, a `copy-NAME' +copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors. + +\(fn (NAME OPTIONS...) (SLOT SLOT-OPTS...)...)" nil (quote macro)) + +(autoload (quote cl-struct-setf-expander) "cl-macs" "\ +Not documented + +\(fn X NAME ACCESSOR PRED-FORM POS)" nil nil) + +(autoload (quote typep) "cl-macs" "\ +Check that OBJECT is of type TYPE. +TYPE is a Common Lisp-style type specifier. + +\(fn OBJECT TYPE)" nil nil) + +(autoload (quote check-type) "cl-macs" "\ +Verify that FORM is of type TYPE; signal an error if not. +STRING is an optional description of the desired type. + +\(fn FORM TYPE &optional STRING)" nil (quote macro)) + +(autoload (quote assert) "cl-macs" "\ +Verify that FORM returns non-nil; signal an error if not. +Second arg SHOW-ARGS means to include arguments of FORM in message. +Other args STRING and ARGS... are arguments to be passed to `error'. +They are not evaluated unless the assertion fails. If STRING is +omitted, a default message listing FORM itself is used. + +\(fn FORM &optional SHOW-ARGS STRING &rest ARGS)" nil (quote macro)) + +(autoload (quote ignore-errors) "cl-macs" "\ +Execute BODY; if an error occurs, return nil. +Otherwise, return result of last form in BODY. + +\(fn &rest BODY)" nil (quote macro)) + +(autoload (quote define-compiler-macro) "cl-macs" "\ +Define a compiler-only macro. +This is like `defmacro', but macro expansion occurs only if the call to +FUNC is compiled (i.e., not interpreted). Compiler macros should be used +for optimizing the way calls to FUNC are compiled; the form returned by +BODY should do the same thing as a call to the normal function called +FUNC, though possibly more efficiently. Note that, like regular macros, +compiler macros are expanded repeatedly until no further expansions are +possible. Unlike regular macros, BODY can decide to \"punt\" and leave the +original function call alone by declaring an initial `&whole foo' parameter +and then returning foo. + +\(fn FUNC ARGS &rest BODY)" nil (quote macro)) + +(autoload (quote compiler-macroexpand) "cl-macs" "\ +Not documented + +\(fn FORM)" nil nil) + +;;;*** + +;;;### (autoloads (tree-equal nsublis sublis nsubst-if-not nsubst-if +;;;;;; nsubst subst-if-not subst-if subsetp nset-exclusive-or set-exclusive-or +;;;;;; nset-difference set-difference nintersection intersection +;;;;;; nunion union rassoc-if-not rassoc-if rassoc* assoc-if-not +;;;;;; assoc-if assoc* cl-adjoin member-if-not member-if member* +;;;;;; merge stable-sort sort* search mismatch count-if-not count-if +;;;;;; count position-if-not position-if position find-if-not find-if +;;;;;; find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not +;;;;;; substitute-if substitute delete-duplicates remove-duplicates +;;;;;; delete-if-not delete-if delete* remove-if-not remove-if remove* +;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "8805f76626399794931f5db36ddf855f") +;;; Generated autoloads from cl-seq.el + +(autoload (quote reduce) "cl-seq" "\ +Reduce two-argument FUNCTION across SEQ. + +Keywords supported: :start :end :from-end :initial-value :key + +\(fn FUNCTION SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote fill) "cl-seq" "\ +Fill the elements of SEQ with ITEM. + +Keywords supported: :start :end + +\(fn SEQ ITEM [KEYWORD VALUE]...)" nil nil) + +(autoload (quote replace) "cl-seq" "\ +Replace the elements of SEQ1 with the elements of SEQ2. +SEQ1 is destructively modified, then returned. + +Keywords supported: :start1 :end1 :start2 :end2 + +\(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote remove*) "cl-seq" "\ +Remove all occurrences of ITEM in SEQ. +This is a non-destructive function; it makes a copy of SEQ if necessary +to avoid corrupting the original SEQ. + +Keywords supported: :test :test-not :key :count :start :end :from-end + +\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote remove-if) "cl-seq" "\ +Remove all items satisfying PREDICATE in SEQ. +This is a non-destructive function; it makes a copy of SEQ if necessary +to avoid corrupting the original SEQ. + +Keywords supported: :key :count :start :end :from-end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote remove-if-not) "cl-seq" "\ +Remove all items not satisfying PREDICATE in SEQ. +This is a non-destructive function; it makes a copy of SEQ if necessary +to avoid corrupting the original SEQ. + +Keywords supported: :key :count :start :end :from-end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote delete*) "cl-seq" "\ +Remove all occurrences of ITEM in SEQ. +This is a destructive function; it reuses the storage of SEQ whenever possible. + +Keywords supported: :test :test-not :key :count :start :end :from-end + +\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote delete-if) "cl-seq" "\ +Remove all items satisfying PREDICATE in SEQ. +This is a destructive function; it reuses the storage of SEQ whenever possible. + +Keywords supported: :key :count :start :end :from-end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote delete-if-not) "cl-seq" "\ +Remove all items not satisfying PREDICATE in SEQ. +This is a destructive function; it reuses the storage of SEQ whenever possible. + +Keywords supported: :key :count :start :end :from-end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote remove-duplicates) "cl-seq" "\ +Return a copy of SEQ with all duplicate elements removed. + +Keywords supported: :test :test-not :key :start :end :from-end + +\(fn SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote delete-duplicates) "cl-seq" "\ +Remove all duplicate elements from SEQ (destructively). + +Keywords supported: :test :test-not :key :start :end :from-end + +\(fn SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote substitute) "cl-seq" "\ +Substitute NEW for OLD in SEQ. +This is a non-destructive function; it makes a copy of SEQ if necessary +to avoid corrupting the original SEQ. + +Keywords supported: :test :test-not :key :count :start :end :from-end + +\(fn NEW OLD SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote substitute-if) "cl-seq" "\ +Substitute NEW for all items satisfying PREDICATE in SEQ. +This is a non-destructive function; it makes a copy of SEQ if necessary +to avoid corrupting the original SEQ. + +Keywords supported: :key :count :start :end :from-end + +\(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote substitute-if-not) "cl-seq" "\ +Substitute NEW for all items not satisfying PREDICATE in SEQ. +This is a non-destructive function; it makes a copy of SEQ if necessary +to avoid corrupting the original SEQ. + +Keywords supported: :key :count :start :end :from-end + +\(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nsubstitute) "cl-seq" "\ +Substitute NEW for OLD in SEQ. +This is a destructive function; it reuses the storage of SEQ whenever possible. + +Keywords supported: :test :test-not :key :count :start :end :from-end + +\(fn NEW OLD SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nsubstitute-if) "cl-seq" "\ +Substitute NEW for all items satisfying PREDICATE in SEQ. +This is a destructive function; it reuses the storage of SEQ whenever possible. + +Keywords supported: :key :count :start :end :from-end + +\(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nsubstitute-if-not) "cl-seq" "\ +Substitute NEW for all items not satisfying PREDICATE in SEQ. +This is a destructive function; it reuses the storage of SEQ whenever possible. + +Keywords supported: :key :count :start :end :from-end + +\(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote find) "cl-seq" "\ +Find the first occurrence of ITEM in SEQ. +Return the matching ITEM, or nil if not found. + +Keywords supported: :test :test-not :key :start :end :from-end + +\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote find-if) "cl-seq" "\ +Find the first item satisfying PREDICATE in SEQ. +Return the matching item, or nil if not found. + +Keywords supported: :key :start :end :from-end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote find-if-not) "cl-seq" "\ +Find the first item not satisfying PREDICATE in SEQ. +Return the matching item, or nil if not found. + +Keywords supported: :key :start :end :from-end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote position) "cl-seq" "\ +Find the first occurrence of ITEM in SEQ. +Return the index of the matching item, or nil if not found. + +Keywords supported: :test :test-not :key :start :end :from-end + +\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote position-if) "cl-seq" "\ +Find the first item satisfying PREDICATE in SEQ. +Return the index of the matching item, or nil if not found. + +Keywords supported: :key :start :end :from-end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote position-if-not) "cl-seq" "\ +Find the first item not satisfying PREDICATE in SEQ. +Return the index of the matching item, or nil if not found. + +Keywords supported: :key :start :end :from-end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote count) "cl-seq" "\ +Count the number of occurrences of ITEM in SEQ. + +Keywords supported: :test :test-not :key :start :end + +\(fn ITEM SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote count-if) "cl-seq" "\ +Count the number of items satisfying PREDICATE in SEQ. + +Keywords supported: :key :start :end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote count-if-not) "cl-seq" "\ +Count the number of items not satisfying PREDICATE in SEQ. + +Keywords supported: :key :start :end + +\(fn PREDICATE SEQ [KEYWORD VALUE]...)" nil nil) + +(autoload (quote mismatch) "cl-seq" "\ +Compare SEQ1 with SEQ2, return index of first mismatching element. +Return nil if the sequences match. If one sequence is a prefix of the +other, the return value indicates the end of the shorter sequence. + +Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end + +\(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote search) "cl-seq" "\ +Search for SEQ1 as a subsequence of SEQ2. +Return the index of the leftmost element of the first match found; +return nil if there are no matches. + +Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end + +\(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote sort*) "cl-seq" "\ +Sort the argument SEQ according to PREDICATE. +This is a destructive function; it reuses the storage of SEQ if possible. + +Keywords supported: :key + +\(fn SEQ PREDICATE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote stable-sort) "cl-seq" "\ +Sort the argument SEQ stably according to PREDICATE. +This is a destructive function; it reuses the storage of SEQ if possible. + +Keywords supported: :key + +\(fn SEQ PREDICATE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote merge) "cl-seq" "\ +Destructively merge the two sequences to produce a new sequence. +TYPE is the sequence type to return, SEQ1 and SEQ2 are the two argument +sequences, and PREDICATE is a `less-than' predicate on the elements. + +Keywords supported: :key + +\(fn TYPE SEQ1 SEQ2 PREDICATE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote member*) "cl-seq" "\ +Find the first occurrence of ITEM in LIST. +Return the sublist of LIST whose car is ITEM. + +Keywords supported: :test :test-not :key + +\(fn ITEM LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote member-if) "cl-seq" "\ +Find the first item satisfying PREDICATE in LIST. +Return the sublist of LIST whose car matches. + +Keywords supported: :key + +\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote member-if-not) "cl-seq" "\ +Find the first item not satisfying PREDICATE in LIST. +Return the sublist of LIST whose car matches. + +Keywords supported: :key + +\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote cl-adjoin) "cl-seq" "\ +Not documented + +\(fn CL-ITEM CL-LIST &rest CL-KEYS)" nil nil) + +(autoload (quote assoc*) "cl-seq" "\ +Find the first item whose car matches ITEM in LIST. + +Keywords supported: :test :test-not :key + +\(fn ITEM LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote assoc-if) "cl-seq" "\ +Find the first item whose car satisfies PREDICATE in LIST. + +Keywords supported: :key + +\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote assoc-if-not) "cl-seq" "\ +Find the first item whose car does not satisfy PREDICATE in LIST. + +Keywords supported: :key + +\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote rassoc*) "cl-seq" "\ +Find the first item whose cdr matches ITEM in LIST. + +Keywords supported: :test :test-not :key + +\(fn ITEM LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote rassoc-if) "cl-seq" "\ +Find the first item whose cdr satisfies PREDICATE in LIST. + +Keywords supported: :key + +\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote rassoc-if-not) "cl-seq" "\ +Find the first item whose cdr does not satisfy PREDICATE in LIST. + +Keywords supported: :key + +\(fn PREDICATE LIST [KEYWORD VALUE]...)" nil nil) + +(autoload (quote union) "cl-seq" "\ +Combine LIST1 and LIST2 using a set-union operation. +The result list contains all items that appear in either LIST1 or LIST2. +This is a non-destructive function; it makes a copy of the data if necessary +to avoid corrupting the original LIST1 and LIST2. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nunion) "cl-seq" "\ +Combine LIST1 and LIST2 using a set-union operation. +The result list contains all items that appear in either LIST1 or LIST2. +This is a destructive function; it reuses the storage of LIST1 and LIST2 +whenever possible. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote intersection) "cl-seq" "\ +Combine LIST1 and LIST2 using a set-intersection operation. +The result list contains all items that appear in both LIST1 and LIST2. +This is a non-destructive function; it makes a copy of the data if necessary +to avoid corrupting the original LIST1 and LIST2. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nintersection) "cl-seq" "\ +Combine LIST1 and LIST2 using a set-intersection operation. +The result list contains all items that appear in both LIST1 and LIST2. +This is a destructive function; it reuses the storage of LIST1 and LIST2 +whenever possible. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote set-difference) "cl-seq" "\ +Combine LIST1 and LIST2 using a set-difference operation. +The result list contains all items that appear in LIST1 but not LIST2. +This is a non-destructive function; it makes a copy of the data if necessary +to avoid corrupting the original LIST1 and LIST2. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nset-difference) "cl-seq" "\ +Combine LIST1 and LIST2 using a set-difference operation. +The result list contains all items that appear in LIST1 but not LIST2. +This is a destructive function; it reuses the storage of LIST1 and LIST2 +whenever possible. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote set-exclusive-or) "cl-seq" "\ +Combine LIST1 and LIST2 using a set-exclusive-or operation. +The result list contains all items that appear in exactly one of LIST1, LIST2. +This is a non-destructive function; it makes a copy of the data if necessary +to avoid corrupting the original LIST1 and LIST2. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nset-exclusive-or) "cl-seq" "\ +Combine LIST1 and LIST2 using a set-exclusive-or operation. +The result list contains all items that appear in exactly one of LIST1, LIST2. +This is a destructive function; it reuses the storage of LIST1 and LIST2 +whenever possible. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote subsetp) "cl-seq" "\ +Return true if LIST1 is a subset of LIST2. +I.e., if every element of LIST1 also appears in LIST2. + +Keywords supported: :test :test-not :key + +\(fn LIST1 LIST2 [KEYWORD VALUE]...)" nil nil) + +(autoload (quote subst-if) "cl-seq" "\ +Substitute NEW for elements matching PREDICATE in TREE (non-destructively). +Return a copy of TREE with all matching elements replaced by NEW. + +Keywords supported: :key + +\(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote subst-if-not) "cl-seq" "\ +Substitute NEW for elts not matching PREDICATE in TREE (non-destructively). +Return a copy of TREE with all non-matching elements replaced by NEW. + +Keywords supported: :key + +\(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nsubst) "cl-seq" "\ +Substitute NEW for OLD everywhere in TREE (destructively). +Any element of TREE which is `eql' to OLD is changed to NEW (via a call +to `setcar'). + +Keywords supported: :test :test-not :key + +\(fn NEW OLD TREE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nsubst-if) "cl-seq" "\ +Substitute NEW for elements matching PREDICATE in TREE (destructively). +Any element of TREE which matches is changed to NEW (via a call to `setcar'). + +Keywords supported: :key + +\(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nsubst-if-not) "cl-seq" "\ +Substitute NEW for elements not matching PREDICATE in TREE (destructively). +Any element of TREE which matches is changed to NEW (via a call to `setcar'). + +Keywords supported: :key + +\(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote sublis) "cl-seq" "\ +Perform substitutions indicated by ALIST in TREE (non-destructively). +Return a copy of TREE with all matching elements replaced. + +Keywords supported: :test :test-not :key + +\(fn ALIST TREE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote nsublis) "cl-seq" "\ +Perform substitutions indicated by ALIST in TREE (destructively). +Any matching element of TREE is changed via a call to `setcar'. + +Keywords supported: :test :test-not :key + +\(fn ALIST TREE [KEYWORD VALUE]...)" nil nil) + +(autoload (quote tree-equal) "cl-seq" "\ +Return t if trees TREE1 and TREE2 have `eql' leaves. +Atoms are compared by `eql'; cons cells are compared recursively. + +Keywords supported: :test :test-not :key + +\(fn TREE1 TREE2 [KEYWORD VALUE]...)" nil nil) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: + +;; arch-tag: 08cc5aab-e992-47f6-992e-12a7428c1a0e +;;; cl-loaddefs.el ends here diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index adbe7054cda..2615a8fdf7c 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -58,8 +58,8 @@ (defvar cl-optimize-speed) -;;; This kludge allows macros which use cl-transform-function-property -;;; to be called at compile-time. +;; This kludge allows macros which use cl-transform-function-property +;; to be called at compile-time. (require (progn @@ -75,6 +75,7 @@ (defvar cl-old-bc-file-form nil) +;;;###autoload (defun cl-compile-time-init () (run-hooks 'cl-hack-bytecomp-hook)) @@ -165,6 +166,7 @@ ;;; Symbols. (defvar *gensym-counter*) +;;;###autoload (defun gensym (&optional prefix) "Generate a new uninterned symbol. The name is made by appending a number to PREFIX, default \"G\"." @@ -174,6 +176,7 @@ The name is made by appending a number to PREFIX, default \"G\"." (setq *gensym-counter* (1+ *gensym-counter*)))))) (make-symbol (format "%s%d" pfix num)))) +;;;###autoload (defun gentemp (&optional prefix) "Generate a new interned symbol with a unique name. The name is made by appending a number to PREFIX, default \"G\"." @@ -186,6 +189,7 @@ The name is made by appending a number to PREFIX, default \"G\"." ;;; Program structure. +;;;###autoload (defmacro defun* (name args &rest body) "Define NAME as a function. Like normal `defun', except ARGLIST allows full Common Lisp conventions, @@ -196,6 +200,7 @@ and BODY is implicitly surrounded by (block NAME ...). (form (list* 'defun name (cdr res)))) (if (car res) (list 'progn (car res) form) form))) +;;;###autoload (defmacro defmacro* (name args &rest body) "Define NAME as a macro. Like normal `defmacro', except ARGLIST allows full Common Lisp conventions, @@ -206,6 +211,7 @@ and BODY is implicitly surrounded by (block NAME ...). (form (list* 'defmacro name (cdr res)))) (if (car res) (list 'progn (car res) form) form))) +;;;###autoload (defmacro function* (func) "Introduce a function. Like normal `function', except that if argument is a lambda form, @@ -422,6 +428,7 @@ its argument list allows full Common Lisp conventions." (setq res (nconc res (cl-arglist-args arg)))))) (nconc res (and args (list args)))))) +;;;###autoload (defmacro destructuring-bind (args expr &rest body) (let* ((bind-lets nil) (bind-forms nil) (bind-inits nil) (bind-defs nil) (bind-block 'cl-none)) @@ -435,6 +442,7 @@ its argument list allows full Common Lisp conventions." (defvar cl-not-toplevel nil) +;;;###autoload (defmacro eval-when (when &rest body) "Control when BODY is evaluated. If `compile' is in WHEN, BODY is evaluated when compiled at top-level. @@ -466,6 +474,7 @@ If `eval' is in WHEN, BODY is evaluated when interpreted or at non-top-level. form))) (t (eval form) form))) +;;;###autoload (defmacro load-time-value (form &optional read-only) "Like `progn', but evaluates the body at load time. The result of the body appears to the compiler as a quoted constant." @@ -488,6 +497,7 @@ The result of the body appears to the compiler as a quoted constant." ;;; Conditional control structures. +;;;###autoload (defmacro case (expr &rest clauses) "Eval EXPR and choose among clauses on that value. Each clause looks like (KEYLIST BODY...). EXPR is evaluated and compared @@ -522,12 +532,14 @@ Key values are compared by `eql'. (if (eq temp expr) body (list 'let (list (list temp expr)) body)))) +;;;###autoload (defmacro ecase (expr &rest clauses) "Like `case', but error if no case fits. `otherwise'-clauses are not allowed. \n(fn EXPR (KEYLIST BODY...)...)" (list* 'case expr (append clauses '((ecase-error-flag))))) +;;;###autoload (defmacro typecase (expr &rest clauses) "Evals EXPR, chooses among clauses on that value. Each clause looks like (TYPE BODY...). EXPR is evaluated and, if it @@ -554,6 +566,7 @@ final clause, and matches if no other keys match. (if (eq temp expr) body (list 'let (list (list temp expr)) body)))) +;;;###autoload (defmacro etypecase (expr &rest clauses) "Like `typecase', but error if no case fits. `otherwise'-clauses are not allowed. @@ -563,6 +576,7 @@ final clause, and matches if no other keys match. ;;; Blocks and exits. +;;;###autoload (defmacro block (name &rest body) "Define a lexically-scoped block named NAME. NAME may be any symbol. Code inside the BODY forms can call `return-from' @@ -598,11 +612,13 @@ called from BODY." (if cl-found (setcdr cl-found t))) (byte-compile-normal-call (cons 'throw (cdr cl-form)))) +;;;###autoload (defmacro return (&optional result) "Return from the block named nil. This is equivalent to `(return-from nil RESULT)'." (list 'return-from nil result)) +;;;###autoload (defmacro return-from (name &optional result) "Return from the block named NAME. This jump out to the innermost enclosing `(block NAME ...)' form, @@ -622,6 +638,7 @@ This is compatible with Common Lisp, but note that `defun' and (defvar loop-result) (defvar loop-result-explicit) (defvar loop-result-var) (defvar loop-steps) (defvar loop-symbol-macs) +;;;###autoload (defmacro loop (&rest args) "The Common Lisp `loop' macro. Valid clauses are: @@ -1181,12 +1198,14 @@ Valid clauses are: ;;; Other iteration control structures. +;;;###autoload (defmacro do (steps endtest &rest body) "The Common Lisp `do' loop. \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" (cl-expand-do-loop steps endtest body nil)) +;;;###autoload (defmacro do* (steps endtest &rest body) "The Common Lisp `do*' loop. @@ -1214,6 +1233,7 @@ Valid clauses are: (apply 'append sets))))))) (or (cdr endtest) '(nil))))) +;;;###autoload (defmacro dolist (spec &rest body) "Loop over a list. Evaluate BODY with VAR bound to each `car' from LIST, in turn. @@ -1230,6 +1250,7 @@ Then evaluate RESULT to get return value, default nil. (cons (list 'setq (car spec) nil) (cdr (cdr spec))) '(nil)))))) +;;;###autoload (defmacro dotimes (spec &rest body) "Loop a certain number of times. Evaluate BODY with VAR bound to successive integers from 0, inclusive, @@ -1244,6 +1265,7 @@ nil. (append body (list (list 'incf (car spec))))) (or (cdr (cdr spec)) '(nil)))))) +;;;###autoload (defmacro do-symbols (spec &rest body) "Loop over all symbols. Evaluate BODY with VAR bound to each interned symbol, or to each symbol @@ -1258,12 +1280,14 @@ from OBARRAY. (and (cadr spec) (list (cadr spec)))) (caddr spec)))) +;;;###autoload (defmacro do-all-symbols (spec &rest body) (list* 'do-symbols (list (car spec) nil (cadr spec)) body)) ;;; Assignments. +;;;###autoload (defmacro psetq (&rest args) "Set SYMs to the values VALs in parallel. This is like `setq', except that all VAL forms are evaluated (in order) @@ -1275,6 +1299,7 @@ before assigning any symbols SYM to the corresponding values. ;;; Binding control structures. +;;;###autoload (defmacro progv (symbols values &rest body) "Bind SYMBOLS to VALUES dynamically in BODY. The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. @@ -1288,6 +1313,7 @@ a `let' form, except that the list of symbols can be computed at run-time." '(cl-progv-after)))) ;;; This should really have some way to shadow 'byte-compile properties, etc. +;;;###autoload (defmacro flet (bindings &rest body) "Make temporary function definitions. This is an analogue of `let' that operates on the function cell of FUNC @@ -1315,6 +1341,7 @@ go back to their previous definitions, or lack thereof). bindings) body)) +;;;###autoload (defmacro labels (bindings &rest body) "Make temporary function bindings. This is like `flet', except the bindings are lexical instead of dynamic. @@ -1339,6 +1366,7 @@ Unlike `flet', this macro is fully compliant with the Common Lisp standard. ;; The following ought to have a better definition for use with newer ;; byte compilers. +;;;###autoload (defmacro macrolet (bindings &rest body) "Make temporary macro definitions. This is like `flet', but for macros instead of functions. @@ -1355,6 +1383,7 @@ This is like `flet', but for macros instead of functions. (cons (list* name 'lambda (cdr res)) cl-macro-environment)))))) +;;;###autoload (defmacro symbol-macrolet (bindings &rest body) "Make symbol macro definitions. Within the body FORMs, references to the variable NAME will be replaced @@ -1371,6 +1400,7 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). cl-macro-environment))))) (defvar cl-closure-vars nil) +;;;###autoload (defmacro lexical-let (bindings &rest body) "Like `let', but lexically scoped. The main visible difference is that lambdas inside BODY will create @@ -1414,6 +1444,7 @@ lexical closures as in Common Lisp. vars)) ebody)))) +;;;###autoload (defmacro lexical-let* (bindings &rest body) "Like `let*', but lexically scoped. The main visible difference is that lambdas inside BODY will create @@ -1434,6 +1465,7 @@ lexical closures as in Common Lisp. ;;; Multiple values. +;;;###autoload (defmacro multiple-value-bind (vars form &rest body) "Collect multiple return values. FORM must return a list; the BODY is then executed with the first N elements @@ -1451,6 +1483,7 @@ a synonym for (list A B C). vars)) body))) +;;;###autoload (defmacro multiple-value-setq (vars form) "Collect multiple return values. FORM must return a list; the first N elements of this list are stored in @@ -1477,7 +1510,9 @@ values. For compatibility, (values A B C) is a synonym for (list A B C). ;;; Declarations. +;;;###autoload (defmacro locally (&rest body) (cons 'progn body)) +;;;###autoload (defmacro the (type form) form) (defvar cl-proclaim-history t) ; for future compilers @@ -1532,6 +1567,7 @@ values. For compatibility, (values A B C) is a synonym for (list A B C). (while p (cl-do-proclaim (pop p) t)) (setq cl-proclaims-deferred nil)) +;;;###autoload (defmacro declare (&rest specs) (if (cl-compiling-file) (while specs @@ -1543,6 +1579,7 @@ values. For compatibility, (values A B C) is a synonym for (list A B C). ;;; Generalized variables. +;;;###autoload (defmacro define-setf-method (func args &rest body) "Define a `setf' method. This method shows how to handle `setf's to places of the form (NAME ARGS...). @@ -1561,8 +1598,9 @@ form. See `defsetf' for a simpler way to define most setf-methods. func 'setf-method (cons args body))))) (defalias 'define-setf-expander 'define-setf-method) +;;;###autoload (defmacro defsetf (func arg1 &rest args) - "(defsetf NAME FUNC): define a `setf' method. + "Define a `setf' method. This macro is an easy-to-use substitute for `define-setf-method' that works well for simple place forms. In the simple `defsetf' form, `setf's of the form (setf (NAME ARGS...) VAL) are transformed to function or macro @@ -1836,6 +1874,7 @@ Example: (list 'substring (nth 4 method) from-temp to-temp)))) ;;; Getting and optimizing setf-methods. +;;;###autoload (defun get-setf-method (place &optional env) "Return a list of five values describing the setf-method for PLACE. PLACE may be any Lisp form which can appear as the PLACE argument to @@ -1903,6 +1942,7 @@ a macro like `setf' or `incf'." (not (eq (car-safe (symbol-function (car form))) 'macro)))) ;;; The standard modify macros. +;;;###autoload (defmacro setf (&rest args) "Set each PLACE to the value of its VAL. This is a generalized version of `setq'; the PLACEs may be symbolic @@ -1921,6 +1961,7 @@ The return value is the last VAL in the list. (store (cl-setf-do-store (nth 1 method) (nth 1 args)))) (if (car method) (list 'let* (car method) store) store))))) +;;;###autoload (defmacro psetf (&rest args) "Set PLACEs to the values VALs in parallel. This is like `setf', except that all VAL forms are evaluated (in order) @@ -1944,6 +1985,7 @@ before assigning any PLACEs to the corresponding values. (setq expr (list 'setf (cadr args) (list 'prog1 (car args) expr)))) (list 'progn expr nil))))) +;;;###autoload (defun cl-do-pop (place) (if (cl-simple-expr-p place) (list 'prog1 (list 'car place) (list 'setf place (list 'cdr place))) @@ -1956,6 +1998,7 @@ before assigning any PLACEs to the corresponding values. (list 'car temp) (cl-setf-do-store (nth 1 method) (list 'cdr temp))))))) +;;;###autoload (defmacro remf (place tag) "Remove TAG from property list PLACE. PLACE may be a symbol, or any generalized variable allowed by `setf'. @@ -1976,6 +2019,7 @@ The form returns true if TAG was found and removed, nil otherwise." t) (list 'cl-do-remf tval ttag))))) +;;;###autoload (defmacro shiftf (place &rest args) "Shift left among PLACEs. Example: (shiftf A B C) sets A to B, B to C, and returns the old A. @@ -1991,6 +2035,7 @@ Each PLACE may be a symbol, or any generalized variable allowed by `setf'. (prog1 ,(nth 2 method) ,(cl-setf-do-store (nth 1 method) `(shiftf ,@args)))))))) +;;;###autoload (defmacro rotatef (&rest args) "Rotate left among PLACEs. Example: (rotatef A B C) sets A to B, B to C, and C to A. It returns nil. @@ -2016,6 +2061,7 @@ Each PLACE may be a symbol, or any generalized variable allowed by `setf'. (list 'let* (append (car method) (list (list temp (nth 2 method)))) (cl-setf-do-store (nth 1 method) form) nil))))) +;;;###autoload (defmacro letf (bindings &rest body) "Temporarily bind to PLACEs. This is the analogue of `let', but with generalized variables (in the @@ -2072,6 +2118,7 @@ the PLACE is not modified before executing BODY. rev (cdr rev)))) (list* 'let* lets body)))) +;;;###autoload (defmacro letf* (bindings &rest body) "Temporarily bind to PLACEs. This is the analogue of `let*', but with generalized variables (in the @@ -2090,6 +2137,7 @@ the PLACE is not modified before executing BODY. (setq body (list (list* 'letf (list (pop bindings)) body)))) (car body))) +;;;###autoload (defmacro callf (func place &rest args) "Set PLACE to (FUNC PLACE ARGS...). FUNC should be an unquoted function name. PLACE may be a symbol, @@ -2104,6 +2152,7 @@ or any generalized variable allowed by `setf'. (list* 'funcall (list 'function func) rargs)))))) +;;;###autoload (defmacro callf2 (func arg1 place &rest args) "Set PLACE to (FUNC ARG1 PLACE ARGS...). Like `callf', but PLACE is the second argument of FUNC, not the first. @@ -2120,6 +2169,7 @@ Like `callf', but PLACE is the second argument of FUNC, not the first. (list* 'funcall (list 'function func) rargs))))))) +;;;###autoload (defmacro define-modify-macro (name arglist func &optional doc) "Define a `setf'-like modify macro. If NAME is called, it combines its PLACE argument with the other arguments @@ -2134,6 +2184,7 @@ from ARGLIST using FUNC: (define-modify-macro incf (&optional (n 1)) +)" ;;; Structures. +;;;###autoload (defmacro defstruct (struct &rest descs) "Define a struct type. This macro defines a new Lisp data type called NAME, which contains data @@ -2358,6 +2409,7 @@ copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors. forms) (cons 'progn (nreverse (cons (list 'quote name) forms))))) +;;;###autoload (defun cl-struct-setf-expander (x name accessor pred-form pos) (let* ((temp (make-symbol "--cl-x--")) (store (make-symbol "--cl-store--"))) (list (list temp) (list x) (list store) @@ -2426,11 +2478,13 @@ The type name can then be used in `typecase', `check-type', etc." ((eq (car type) 'satisfies) (list (cadr type) val)) (t (error "Bad type spec: %s" type))))) +;;;###autoload (defun typep (object type) ; See compiler macro below. "Check that OBJECT is of type TYPE. TYPE is a Common Lisp-style type specifier." (eval (cl-make-type-test 'object type))) +;;;###autoload (defmacro check-type (form type &optional string) "Verify that FORM is of type TYPE; signal an error if not. STRING is an optional description of the desired type." @@ -2445,6 +2499,7 @@ STRING is an optional description of the desired type." (if (eq temp form) (list 'progn body nil) (list 'let (list (list temp form)) body nil))))) +;;;###autoload (defmacro assert (form &optional show-args string &rest args) "Verify that FORM returns non-nil; signal an error if not. Second arg SHOW-ARGS means to include arguments of FORM in message. @@ -2466,6 +2521,7 @@ omitted, a default message listing FORM itself is used." (list* 'list (list 'quote form) sargs)))) nil)))) +;;;###autoload (defmacro ignore-errors (&rest body) "Execute BODY; if an error occurs, return nil. Otherwise, return result of last form in BODY." @@ -2474,6 +2530,7 @@ Otherwise, return result of last form in BODY." ;;; Compiler macros. +;;;###autoload (defmacro define-compiler-macro (func args &rest body) "Define a compiler-only macro. This is like `defmacro', but macro expansion occurs only if the call to @@ -2497,6 +2554,7 @@ and then returning foo." (list 'put (list 'quote func) '(quote byte-compile) '(quote cl-byte-compile-compiler-macro))))) +;;;###autoload (defun compiler-macroexpand (form) (while (let ((func (car-safe form)) (handler nil)) @@ -2552,9 +2610,9 @@ surrounded by (block NAME ...). (if lets (list 'let lets body) body)))) -;;; Compile-time optimizations for some functions defined in this package. -;;; Note that cl.el arranges to force cl-macs to be loaded at compile-time, -;;; mainly to make sure these macros will be present. +;; Compile-time optimizations for some functions defined in this package. +;; Note that cl.el arranges to force cl-macs to be loaded at compile-time, +;; mainly to make sure these macros will be present. (put 'eql 'byte-compile nil) (define-compiler-macro eql (&whole form a b) @@ -2665,9 +2723,10 @@ surrounded by (block NAME ...). (run-hooks 'cl-macs-load-hook) -;;; Local variables: -;;; byte-compile-warnings: (redefine callargs free-vars unresolved obsolete noruntime) -;;; End: +;; Local variables: +;; byte-compile-warnings: (redefine callargs free-vars unresolved obsolete noruntime) +;; generated-autoload-file: "cl-loaddefs.el" +;; End: ;; arch-tag: afd947a6-b553-4df1-bba5-000be6388f46 ;;; cl-macs.el ends here diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index 0027da1f9d2..742d2af2397 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -125,6 +125,7 @@ (defvar cl-key) +;;;###autoload (defun reduce (cl-func cl-seq &rest cl-keys) "Reduce two-argument FUNCTION across SEQ. \nKeywords supported: :start :end :from-end :initial-value :key @@ -145,6 +146,7 @@ (cl-check-key (pop cl-seq)))))) cl-accum))) +;;;###autoload (defun fill (seq item &rest cl-keys) "Fill the elements of SEQ with ITEM. \nKeywords supported: :start :end @@ -164,6 +166,7 @@ (setq cl-start (1+ cl-start))))) seq)) +;;;###autoload (defun replace (cl-seq1 cl-seq2 &rest cl-keys) "Replace the elements of SEQ1 with the elements of SEQ2. SEQ1 is destructively modified, then returned. @@ -206,6 +209,7 @@ SEQ1 is destructively modified, then returned. (setq cl-start2 (1+ cl-start2) cl-start1 (1+ cl-start1)))))) cl-seq1)) +;;;###autoload (defun remove* (cl-item cl-seq &rest cl-keys) "Remove all occurrences of ITEM in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary @@ -251,6 +255,7 @@ to avoid corrupting the original SEQ. cl-seq)) cl-seq))))) +;;;###autoload (defun remove-if (cl-pred cl-list &rest cl-keys) "Remove all items satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary @@ -259,6 +264,7 @@ to avoid corrupting the original SEQ. \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'remove* nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun remove-if-not (cl-pred cl-list &rest cl-keys) "Remove all items not satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary @@ -267,6 +273,7 @@ to avoid corrupting the original SEQ. \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'remove* nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun delete* (cl-item cl-seq &rest cl-keys) "Remove all occurrences of ITEM in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. @@ -310,6 +317,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible. cl-seq) (apply 'remove* cl-item cl-seq cl-keys))))) +;;;###autoload (defun delete-if (cl-pred cl-list &rest cl-keys) "Remove all items satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. @@ -317,6 +325,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible. \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'delete* nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun delete-if-not (cl-pred cl-list &rest cl-keys) "Remove all items not satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. @@ -324,12 +333,14 @@ This is a destructive function; it reuses the storage of SEQ whenever possible. \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'delete* nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun remove-duplicates (cl-seq &rest cl-keys) "Return a copy of SEQ with all duplicate elements removed. \nKeywords supported: :test :test-not :key :start :end :from-end \n(fn SEQ [KEYWORD VALUE]...)" (cl-delete-duplicates cl-seq cl-keys t)) +;;;###autoload (defun delete-duplicates (cl-seq &rest cl-keys) "Remove all duplicate elements from SEQ (destructively). \nKeywords supported: :test :test-not :key :start :end :from-end @@ -376,6 +387,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible. (let ((cl-res (cl-delete-duplicates (append cl-seq nil) cl-keys nil))) (if (stringp cl-seq) (concat cl-res) (vconcat cl-res))))) +;;;###autoload (defun substitute (cl-new cl-old cl-seq &rest cl-keys) "Substitute NEW for OLD in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary @@ -397,6 +409,7 @@ to avoid corrupting the original SEQ. (apply 'nsubstitute cl-new cl-old cl-seq :count cl-count :start cl-i cl-keys)))))) +;;;###autoload (defun substitute-if (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary @@ -405,6 +418,7 @@ to avoid corrupting the original SEQ. \n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'substitute cl-new nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun substitute-if-not (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items not satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary @@ -413,6 +427,7 @@ to avoid corrupting the original SEQ. \n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'substitute cl-new nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun nsubstitute (cl-new cl-old cl-seq &rest cl-keys) "Substitute NEW for OLD in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. @@ -446,6 +461,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible. (setq cl-start (1+ cl-start)))))) cl-seq)) +;;;###autoload (defun nsubstitute-if (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. @@ -453,6 +469,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible. \n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'nsubstitute cl-new nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun nsubstitute-if-not (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items not satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. @@ -460,6 +477,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible. \n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'nsubstitute cl-new nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun find (cl-item cl-seq &rest cl-keys) "Find the first occurrence of ITEM in SEQ. Return the matching ITEM, or nil if not found. @@ -468,6 +486,7 @@ Return the matching ITEM, or nil if not found. (let ((cl-pos (apply 'position cl-item cl-seq cl-keys))) (and cl-pos (elt cl-seq cl-pos)))) +;;;###autoload (defun find-if (cl-pred cl-list &rest cl-keys) "Find the first item satisfying PREDICATE in SEQ. Return the matching item, or nil if not found. @@ -475,6 +494,7 @@ Return the matching item, or nil if not found. \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'find nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun find-if-not (cl-pred cl-list &rest cl-keys) "Find the first item not satisfying PREDICATE in SEQ. Return the matching item, or nil if not found. @@ -482,6 +502,7 @@ Return the matching item, or nil if not found. \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'find nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun position (cl-item cl-seq &rest cl-keys) "Find the first occurrence of ITEM in SEQ. Return the index of the matching item, or nil if not found. @@ -512,6 +533,7 @@ Return the index of the matching item, or nil if not found. (setq cl-start (1+ cl-start))) (and (< cl-start cl-end) cl-start)))) +;;;###autoload (defun position-if (cl-pred cl-list &rest cl-keys) "Find the first item satisfying PREDICATE in SEQ. Return the index of the matching item, or nil if not found. @@ -519,6 +541,7 @@ Return the index of the matching item, or nil if not found. \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'position nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun position-if-not (cl-pred cl-list &rest cl-keys) "Find the first item not satisfying PREDICATE in SEQ. Return the index of the matching item, or nil if not found. @@ -526,6 +549,7 @@ Return the index of the matching item, or nil if not found. \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'position nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun count (cl-item cl-seq &rest cl-keys) "Count the number of occurrences of ITEM in SEQ. \nKeywords supported: :test :test-not :key :start :end @@ -540,18 +564,21 @@ Return the index of the matching item, or nil if not found. (setq cl-start (1+ cl-start))) cl-count))) +;;;###autoload (defun count-if (cl-pred cl-list &rest cl-keys) "Count the number of items satisfying PREDICATE in SEQ. \nKeywords supported: :key :start :end \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'count nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun count-if-not (cl-pred cl-list &rest cl-keys) "Count the number of items not satisfying PREDICATE in SEQ. \nKeywords supported: :key :start :end \n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'count nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun mismatch (cl-seq1 cl-seq2 &rest cl-keys) "Compare SEQ1 with SEQ2, return index of first mismatching element. Return nil if the sequences match. If one sequence is a prefix of the @@ -582,6 +609,7 @@ other, the return value indicates the end of the shorter sequence. (and (or (< cl-start1 cl-end1) (< cl-start2 cl-end2)) cl-start1))))) +;;;###autoload (defun search (cl-seq1 cl-seq2 &rest cl-keys) "Search for SEQ1 as a subsequence of SEQ2. Return the index of the leftmost element of the first match found; @@ -608,6 +636,7 @@ return nil if there are no matches. (if cl-from-end (setq cl-end2 cl-pos) (setq cl-start2 (1+ cl-pos)))) (and (< cl-start2 cl-end2) cl-pos))))) +;;;###autoload (defun sort* (cl-seq cl-pred &rest cl-keys) "Sort the argument SEQ according to PREDICATE. This is a destructive function; it reuses the storage of SEQ if possible. @@ -622,6 +651,7 @@ This is a destructive function; it reuses the storage of SEQ if possible. (funcall cl-pred (funcall cl-key cl-x) (funcall cl-key cl-y))))))))) +;;;###autoload (defun stable-sort (cl-seq cl-pred &rest cl-keys) "Sort the argument SEQ stably according to PREDICATE. This is a destructive function; it reuses the storage of SEQ if possible. @@ -629,6 +659,7 @@ This is a destructive function; it reuses the storage of SEQ if possible. \n(fn SEQ PREDICATE [KEYWORD VALUE]...)" (apply 'sort* cl-seq cl-pred cl-keys)) +;;;###autoload (defun merge (cl-type cl-seq1 cl-seq2 cl-pred &rest cl-keys) "Destructively merge the two sequences to produce a new sequence. TYPE is the sequence type to return, SEQ1 and SEQ2 are the two argument @@ -647,6 +678,7 @@ sequences, and PREDICATE is a `less-than' predicate on the elements. (coerce (nconc (nreverse cl-res) cl-seq1 cl-seq2) cl-type)))) ;;; See compiler macro in cl-macs.el +;;;###autoload (defun member* (cl-item cl-list &rest cl-keys) "Find the first occurrence of ITEM in LIST. Return the sublist of LIST whose car is ITEM. @@ -661,6 +693,7 @@ Return the sublist of LIST whose car is ITEM. (member cl-item cl-list) (memq cl-item cl-list)))) +;;;###autoload (defun member-if (cl-pred cl-list &rest cl-keys) "Find the first item satisfying PREDICATE in LIST. Return the sublist of LIST whose car matches. @@ -668,6 +701,7 @@ Return the sublist of LIST whose car matches. \n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'member* nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun member-if-not (cl-pred cl-list &rest cl-keys) "Find the first item not satisfying PREDICATE in LIST. Return the sublist of LIST whose car matches. @@ -675,6 +709,7 @@ Return the sublist of LIST whose car matches. \n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'member* nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun cl-adjoin (cl-item cl-list &rest cl-keys) (if (cl-parsing-keywords (:key) t (apply 'member* (cl-check-key cl-item) cl-list cl-keys)) @@ -682,6 +717,7 @@ Return the sublist of LIST whose car matches. (cons cl-item cl-list))) ;;; See compiler macro in cl-macs.el +;;;###autoload (defun assoc* (cl-item cl-alist &rest cl-keys) "Find the first item whose car matches ITEM in LIST. \nKeywords supported: :test :test-not :key @@ -697,18 +733,21 @@ Return the sublist of LIST whose car matches. (assoc cl-item cl-alist) (assq cl-item cl-alist)))) +;;;###autoload (defun assoc-if (cl-pred cl-list &rest cl-keys) "Find the first item whose car satisfies PREDICATE in LIST. \nKeywords supported: :key \n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'assoc* nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun assoc-if-not (cl-pred cl-list &rest cl-keys) "Find the first item whose car does not satisfy PREDICATE in LIST. \nKeywords supported: :key \n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'assoc* nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun rassoc* (cl-item cl-alist &rest cl-keys) "Find the first item whose cdr matches ITEM in LIST. \nKeywords supported: :test :test-not :key @@ -722,18 +761,21 @@ Return the sublist of LIST whose car matches. (and cl-alist (car cl-alist))) (rassq cl-item cl-alist))) +;;;###autoload (defun rassoc-if (cl-pred cl-list &rest cl-keys) "Find the first item whose cdr satisfies PREDICATE in LIST. \nKeywords supported: :key \n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'rassoc* nil cl-list :if cl-pred cl-keys)) +;;;###autoload (defun rassoc-if-not (cl-pred cl-list &rest cl-keys) "Find the first item whose cdr does not satisfy PREDICATE in LIST. \nKeywords supported: :key \n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'rassoc* nil cl-list :if-not cl-pred cl-keys)) +;;;###autoload (defun union (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-union operation. The result list contains all items that appear in either LIST1 or LIST2. @@ -754,6 +796,7 @@ to avoid corrupting the original LIST1 and LIST2. (pop cl-list2)) cl-list1))) +;;;###autoload (defun nunion (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-union operation. The result list contains all items that appear in either LIST1 or LIST2. @@ -764,6 +807,7 @@ whenever possible. (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) (t (apply 'union cl-list1 cl-list2 cl-keys)))) +;;;###autoload (defun intersection (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-intersection operation. The result list contains all items that appear in both LIST1 and LIST2. @@ -786,6 +830,7 @@ to avoid corrupting the original LIST1 and LIST2. (pop cl-list2)) cl-res))))) +;;;###autoload (defun nintersection (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-intersection operation. The result list contains all items that appear in both LIST1 and LIST2. @@ -795,6 +840,7 @@ whenever possible. \n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (and cl-list1 cl-list2 (apply 'intersection cl-list1 cl-list2 cl-keys))) +;;;###autoload (defun set-difference (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-difference operation. The result list contains all items that appear in LIST1 but not LIST2. @@ -814,6 +860,7 @@ to avoid corrupting the original LIST1 and LIST2. (pop cl-list1)) cl-res)))) +;;;###autoload (defun nset-difference (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-difference operation. The result list contains all items that appear in LIST1 but not LIST2. @@ -824,6 +871,7 @@ whenever possible. (if (or (null cl-list1) (null cl-list2)) cl-list1 (apply 'set-difference cl-list1 cl-list2 cl-keys))) +;;;###autoload (defun set-exclusive-or (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-exclusive-or operation. The result list contains all items that appear in exactly one of LIST1, LIST2. @@ -836,6 +884,7 @@ to avoid corrupting the original LIST1 and LIST2. (t (append (apply 'set-difference cl-list1 cl-list2 cl-keys) (apply 'set-difference cl-list2 cl-list1 cl-keys))))) +;;;###autoload (defun nset-exclusive-or (cl-list1 cl-list2 &rest cl-keys) "Combine LIST1 and LIST2 using a set-exclusive-or operation. The result list contains all items that appear in exactly one of LIST1, LIST2. @@ -848,6 +897,7 @@ whenever possible. (t (nconc (apply 'nset-difference cl-list1 cl-list2 cl-keys) (apply 'nset-difference cl-list2 cl-list1 cl-keys))))) +;;;###autoload (defun subsetp (cl-list1 cl-list2 &rest cl-keys) "Return true if LIST1 is a subset of LIST2. I.e., if every element of LIST1 also appears in LIST2. @@ -862,6 +912,7 @@ I.e., if every element of LIST1 also appears in LIST2. (pop cl-list1)) (null cl-list1))))) +;;;###autoload (defun subst-if (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elements matching PREDICATE in TREE (non-destructively). Return a copy of TREE with all matching elements replaced by NEW. @@ -869,6 +920,7 @@ Return a copy of TREE with all matching elements replaced by NEW. \n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" (apply 'sublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) +;;;###autoload (defun subst-if-not (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elts not matching PREDICATE in TREE (non-destructively). Return a copy of TREE with all non-matching elements replaced by NEW. @@ -876,6 +928,7 @@ Return a copy of TREE with all non-matching elements replaced by NEW. \n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" (apply 'sublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) +;;;###autoload (defun nsubst (cl-new cl-old cl-tree &rest cl-keys) "Substitute NEW for OLD everywhere in TREE (destructively). Any element of TREE which is `eql' to OLD is changed to NEW (via a call @@ -884,6 +937,7 @@ to `setcar'). \n(fn NEW OLD TREE [KEYWORD VALUE]...)" (apply 'nsublis (list (cons cl-old cl-new)) cl-tree cl-keys)) +;;;###autoload (defun nsubst-if (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elements matching PREDICATE in TREE (destructively). Any element of TREE which matches is changed to NEW (via a call to `setcar'). @@ -891,6 +945,7 @@ Any element of TREE which matches is changed to NEW (via a call to `setcar'). \n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" (apply 'nsublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) +;;;###autoload (defun nsubst-if-not (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elements not matching PREDICATE in TREE (destructively). Any element of TREE which matches is changed to NEW (via a call to `setcar'). @@ -898,6 +953,7 @@ Any element of TREE which matches is changed to NEW (via a call to `setcar'). \n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" (apply 'nsublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) +;;;###autoload (defun sublis (cl-alist cl-tree &rest cl-keys) "Perform substitutions indicated by ALIST in TREE (non-destructively). Return a copy of TREE with all matching elements replaced. @@ -920,6 +976,7 @@ Return a copy of TREE with all matching elements replaced. (cons cl-a cl-d))) cl-tree)))) +;;;###autoload (defun nsublis (cl-alist cl-tree &rest cl-keys) "Perform substitutions indicated by ALIST in TREE (destructively). Any matching element of TREE is changed via a call to `setcar'. @@ -944,6 +1001,7 @@ Any matching element of TREE is changed via a call to `setcar'. (progn (setcdr cl-tree (cdr (car cl-p))) (setq cl-tree nil)) (setq cl-tree (cdr cl-tree)))))) +;;;###autoload (defun tree-equal (cl-x cl-y &rest cl-keys) "Return t if trees TREE1 and TREE2 have `eql' leaves. Atoms are compared by `eql'; cons cells are compared recursively. @@ -961,5 +1019,9 @@ Atoms are compared by `eql'; cons cells are compared recursively. (run-hooks 'cl-seq-load-hook) -;;; arch-tag: ec1cc072-9006-4225-b6ba-d6b07ed1710c +;; Local variables: +;; generated-autoload-file: "cl-loaddefs.el" +;; End: + +;; arch-tag: ec1cc072-9006-4225-b6ba-d6b07ed1710c ;;; cl-seq.el ends here diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 83dffb41b2d..f8b178ac07c 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -113,8 +113,9 @@ a future Emacs interpreter will be able to use it.") (defun cl-cannot-unload () (error "Cannot unload the feature `cl'")) -;;; Generalized variables. These macros are defined here so that they -;;; can safely be used in .emacs files. +;;; Generalized variables. +;; These macros are defined here so that they +;; can safely be used in .emacs files. (defmacro incf (place &optional x) "Increment PLACE by X (1 by default). @@ -185,8 +186,8 @@ an element already on the list. ;;; Control structures. -;;; These macros are so simple and so often-used that it's better to have -;;; them all the time than to load them from cl-macs.el. +;; These macros are so simple and so often-used that it's better to have +;; them all the time than to load them from cl-macs.el. (defun cl-map-extents (&rest cl-args) (apply 'cl-map-overlays cl-args)) @@ -198,9 +199,10 @@ an element already on the list. (defalias 'cl-block-throw 'throw) -;;; Multiple values. True multiple values are not supported, or even -;;; simulated. Instead, multiple-value-bind and friends simply expect -;;; the target form to return the values as a list. +;;; Multiple values. +;; True multiple values are not supported, or even +;; simulated. Instead, multiple-value-bind and friends simply expect +;; the target form to return the values as a list. (defsubst values (&rest values) "Return multiple values, Common Lisp style. @@ -321,7 +323,7 @@ always returns nil." (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time))) -;;; The following are actually set by cl-float-limits. +;; The following are actually set by cl-float-limits. (defconst most-positive-float nil) (defconst most-negative-float nil) (defconst least-positive-float nil) @@ -585,105 +587,55 @@ If ALIST is non-nil, the new pairs are prepended to it." ;;; Miscellaneous. -(defvar cl-fake-autoloads nil - "Non-nil means don't make CL functions autoload.") - -;;; Autoload the other portions of the package. +;; Define data for indentation and edebug. +(dolist (entry + '(((defun* defmacro*) 2) + ((function*) nil + (&or symbolp ([&optional 'macro] 'lambda (&rest sexp) &rest form))) + ((eval-when) 1 (sexp &rest form)) + ((declare) nil (&rest sexp)) + ((the) 1 (sexp &rest form)) + ((case ecase typecase etypecase) 1 (form &rest (sexp &rest form))) + ((block return-from) 1 (sexp &rest form)) + ((return) nil (&optional form)) + ((do do*) 2 ((&rest &or symbolp (symbolp &optional form form)) + (form &rest form) + &rest form)) + ((do-symbols) 1 ((symbolp form &optional form form) &rest form)) + ((do-all-symbols) 1 ((symbolp form &optional form) &rest form)) + ((psetq setf psetf) nil edebug-setq-form) + ((progv) 2 (&rest form)) + ((flet labels macrolet) 1 + ((&rest (sexp sexp &rest form)) &rest form)) + ((symbol-macrolet lexical-let lexical-let*) 1 + ((&rest &or symbolp (symbolp form)) &rest form)) + ((multiple-value-bind) 2 ((&rest symbolp) &rest form)) + ((multiple-value-setq) 1 ((&rest symbolp) &rest form)) + ((incf decf remf pushnew shiftf rotatef) nil (&rest form)) + ((letf letf*) 1 ((&rest (&rest form)) &rest form)) + ((callf destructuring-bind) 2 (sexp form &rest form)) + ((callf2) 3 (sexp form form &rest form)) + ((loop) nil (&rest &or symbolp form)) + ((ignore-errors) 0 (&rest form)))) + (dolist (func (car entry)) + (put func 'lisp-indent-function (nth 1 entry)) + (put func 'lisp-indent-hook (nth 1 entry)) + (or (get func 'edebug-form-spec) + (put func 'edebug-form-spec (nth 2 entry))))) + +;; Autoload the other portions of the package. ;; We want to replace the basic versions of dolist, dotimes, declare below. (fmakunbound 'dolist) (fmakunbound 'dotimes) (fmakunbound 'declare) -(mapcar (function - (lambda (set) - (let ((file (if cl-fake-autoloads "<none>" (car set)))) - (mapcar (function - (lambda (func) - (autoload func (car set) nil nil (nth 1 set)))) - (cddr set))))) - '(("cl-extra" nil - coerce equalp cl-map-keymap maplist mapc mapl mapcan mapcon - cl-map-keymap cl-map-keymap-recursively cl-map-intervals - cl-map-overlays cl-set-frame-visible-p cl-float-limits - gcd lcm isqrt floor* ceiling* truncate* round* - mod* rem* signum random* make-random-state random-state-p - subseq concatenate cl-mapcar-many map some every notany - notevery revappend nreconc list-length tailp copy-tree get* getf - cl-set-getf cl-do-remf remprop cl-make-hash-table cl-hash-lookup - cl-gethash cl-puthash cl-remhash cl-clrhash cl-maphash cl-hash-table-p - cl-hash-table-count cl-progv-before cl-prettyexpand - cl-macroexpand-all) - ("cl-seq" nil - reduce fill replace remove* remove-if remove-if-not - delete* delete-if delete-if-not remove-duplicates - delete-duplicates substitute substitute-if substitute-if-not - nsubstitute nsubstitute-if nsubstitute-if-not find find-if - find-if-not position position-if position-if-not count count-if - count-if-not mismatch search sort* stable-sort merge member* - member-if member-if-not cl-adjoin assoc* assoc-if assoc-if-not - rassoc* rassoc-if rassoc-if-not union nunion intersection - nintersection set-difference nset-difference set-exclusive-or - nset-exclusive-or subsetp subst-if subst-if-not nsubst nsubst-if - nsubst-if-not sublis nsublis tree-equal) - ("cl-macs" nil - gensym gentemp typep cl-do-pop get-setf-method - cl-struct-setf-expander compiler-macroexpand cl-compile-time-init) - ("cl-macs" t - defun* defmacro* function* destructuring-bind eval-when - load-time-value case ecase typecase etypecase - block return return-from loop do do* dolist dotimes do-symbols - do-all-symbols psetq progv flet labels macrolet symbol-macrolet - lexical-let lexical-let* multiple-value-bind multiple-value-setq - locally the declare define-setf-method defsetf define-modify-macro - setf psetf remf shiftf rotatef letf letf* callf callf2 defstruct - check-type assert ignore-errors define-compiler-macro))) - -;;; Define data for indentation and edebug. -(mapcar (function - (lambda (entry) - (mapcar (function - (lambda (func) - (put func 'lisp-indent-function (nth 1 entry)) - (put func 'lisp-indent-hook (nth 1 entry)) - (or (get func 'edebug-form-spec) - (put func 'edebug-form-spec (nth 2 entry))))) - (car entry)))) - '(((defun* defmacro*) 2) - ((function*) nil - (&or symbolp ([&optional 'macro] 'lambda (&rest sexp) &rest form))) - ((eval-when) 1 (sexp &rest form)) - ((declare) nil (&rest sexp)) - ((the) 1 (sexp &rest form)) - ((case ecase typecase etypecase) 1 (form &rest (sexp &rest form))) - ((block return-from) 1 (sexp &rest form)) - ((return) nil (&optional form)) - ((do do*) 2 ((&rest &or symbolp (symbolp &optional form form)) - (form &rest form) - &rest form)) - ((do-symbols) 1 ((symbolp form &optional form form) &rest form)) - ((do-all-symbols) 1 ((symbolp form &optional form) &rest form)) - ((psetq setf psetf) nil edebug-setq-form) - ((progv) 2 (&rest form)) - ((flet labels macrolet) 1 - ((&rest (sexp sexp &rest form)) &rest form)) - ((symbol-macrolet lexical-let lexical-let*) 1 - ((&rest &or symbolp (symbolp form)) &rest form)) - ((multiple-value-bind) 2 ((&rest symbolp) &rest form)) - ((multiple-value-setq) 1 ((&rest symbolp) &rest form)) - ((incf decf remf pushnew shiftf rotatef) nil (&rest form)) - ((letf letf*) 1 ((&rest (&rest form)) &rest form)) - ((callf destructuring-bind) 2 (sexp form &rest form)) - ((callf2) 3 (sexp form form &rest form)) - ((loop) nil (&rest &or symbolp form)) - ((ignore-errors) 0 (&rest form)))) - - -;;; This goes here so that cl-macs can find it if it loads right now. -(provide 'cl-19) ; usage: (require 'cl-19 "cl") +(load "cl-loaddefs" nil 'quiet) +;; This goes here so that cl-macs can find it if it loads right now. +(provide 'cl-19) ; usage: (require 'cl-19 "cl") -;;; Things to do after byte-compiler is loaded. -;;; As a side effect, we cause cl-macs to be loaded when compiling, so -;;; that the compiler-macros defined there will be present. +;; Things to do after byte-compiler is loaded. +;; As a side effect, we cause cl-macs to be loaded when compiling, so +;; that the compiler-macros defined there will be present. (defvar cl-hacked-flag nil) (defun cl-hack-byte-compiler () @@ -692,15 +644,15 @@ If ALIST is non-nil, the new pairs are prepended to it." (setq cl-hacked-flag t) ; Do it first, to prevent recursion. (cl-compile-time-init)))) ; In cl-macs.el. -;;; Try it now in case the compiler has already been loaded. +;; Try it now in case the compiler has already been loaded. (cl-hack-byte-compiler) -;;; Also make a hook in case compiler is loaded after this file. +;; Also make a hook in case compiler is loaded after this file. (add-hook 'bytecomp-load-hook 'cl-hack-byte-compiler) -;;; The following ensures that packages which expect the old-style cl.el -;;; will be happy with this one. +;; The following ensures that packages which expect the old-style cl.el +;; will be happy with this one. (provide 'cl) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index ac61c5a9ada..facdf9e9aae 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -79,7 +79,7 @@ When this is `function', only ask when called non-interactively." ;; when modifying this, also modify the comment generated by autoinsert.el -(defconst copyright-current-gpl-version "2" +(defconst copyright-current-gpl-version "3" "String representing the current version of the GPL or nil.") (defvar copyright-update t) diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index d1ec5a1fe39..19df1a16a11 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -152,6 +152,21 @@ A menu item can be a list with the same format as MENU. This is a submenu." ,(if symbol `(defvar ,symbol nil ,doc)) (easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu))) +(defun easy-menu-binding (menu &optional item-name) + "Return a binding suitable to pass to `define-key'. +This is expected to be bound to a mouse event." + ;; Under Emacs this is almost trivial, whereas under XEmacs this may + ;; involve defining a function that calls popup-menu. + (let ((props (if (symbolp menu) + (prog1 (get menu 'menu-prop) + (setq menu (symbol-function menu)))))) + (cons 'menu-item + (cons (or item-name + (if (keymapp menu) + (keymap-prompt menu)) + "") + (cons menu props))))) + ;;;###autoload (defun easy-menu-do-define (symbol maps doc menu) ;; We can't do anything that might differ between Emacs dialects in @@ -173,15 +188,10 @@ A menu item can be a list with the same format as MENU. This is a submenu." 'identity) (symbol-function ,symbol))) ,symbol))))) - (mapcar (lambda (map) - (define-key map (vector 'menu-bar (easy-menu-intern (car menu))) - (cons 'menu-item - (cons (car menu) - (if (not (symbolp keymap)) - (list keymap) - (cons (symbol-function keymap) - (get keymap 'menu-prop))))))) - (if (keymapp maps) (list maps) maps)))) + (dolist (map (if (keymapp maps) (list maps) maps)) + (define-key map + (vector 'menu-bar (easy-menu-intern (car menu))) + (easy-menu-binding keymap (car menu)))))) (defun easy-menu-filter-return (menu &optional name) "Convert MENU to the right thing to return from a menu filter. @@ -249,10 +259,6 @@ possibly preceded by keyword pairs as described in `easy-menu-define'." (defvar easy-menu-button-prefix '((radio . :radio) (toggle . :toggle))) -(defun easy-menu-do-add-item (menu item &optional before) - (setq item (easy-menu-convert-item item)) - (easy-menu-define-key menu (easy-menu-intern (car item)) (cdr item) before)) - (defvar easy-menu-converted-items-table (make-hash-table :test 'equal)) (defun easy-menu-convert-item (item) @@ -269,7 +275,7 @@ would always fail because the key is `equal' but not `eq'." (defun easy-menu-convert-item-1 (item) "Parse an item description and convert it to a menu keymap element. ITEM defines an item as in `easy-menu-define'." - (let (name command label prop remove help) + (let (name command label prop remove) (cond ((stringp item) ; An item or separator. (setq label item)) @@ -536,7 +542,8 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'." (setq item (symbol-value item)))) ;; Item is a keymap, find the prompt string and use as item name. (setq item (cons (keymap-prompt item) item))) - (easy-menu-do-add-item map item before))) + (setq item (easy-menu-convert-item item)) + (easy-menu-define-key map (easy-menu-intern (car item)) (cdr item) before))) (defun easy-menu-item-present-p (map path name) "In submenu of MAP with path PATH, return non-nil iff item NAME is present. @@ -615,7 +622,8 @@ In some cases we use that to select between the local and global maps." (catch 'found (if (and map (symbolp map) (not (keymapp map))) (setq map (symbol-value map))) - (let ((maps (if map (list map) (current-active-maps)))) + (let ((maps (if map (if (keymapp map) (list map) map) + (current-active-maps)))) ;; Look for PATH in each map. (unless map (push 'menu-bar path)) (dolist (name path) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 85b150b6ae5..37e2eb351f2 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -124,8 +124,8 @@ directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.") (defconst eldoc-last-data (make-vector 3 nil) "Bookkeeping; elements are as follows: 0 - contains the last symbol read from the buffer. - 1 - contains the string last displayed in the echo area for that - symbol, so it can be printed again if necessary without reconsing. + 1 - contains the string last displayed in the echo area for variables, + or argument string for functions. 2 - 'function if function args, 'variable if variable documentation.") (defvar eldoc-last-message nil) @@ -249,12 +249,16 @@ Emacs Lisp mode) that support Eldoc.") (let* ((current-symbol (eldoc-current-symbol)) (current-fnsym (eldoc-fnsym-in-current-sexp)) (doc (cond - ((eq current-symbol current-fnsym) - (or (eldoc-get-fnsym-args-string current-fnsym) + ((null current-fnsym) + nil) + ((eq current-symbol (car current-fnsym)) + (or (apply 'eldoc-get-fnsym-args-string + current-fnsym) (eldoc-get-var-docstring current-symbol))) (t (or (eldoc-get-var-docstring current-symbol) - (eldoc-get-fnsym-args-string current-fnsym)))))) + (apply 'eldoc-get-fnsym-args-string + current-fnsym)))))) (eldoc-message doc)))) ;; This is run from post-command-hook or some idle timer thing, ;; so we need to be careful that errors aren't ignored. @@ -263,24 +267,62 @@ Emacs Lisp mode) that support Eldoc.") ;; Return a string containing the function parameter list, or 1-line ;; docstring if function is a subr and no arglist is obtainable from the ;; docstring or elsewhere. -(defun eldoc-get-fnsym-args-string (sym) +(defun eldoc-get-fnsym-args-string (sym argument-index) (let ((args nil) (doc nil)) (cond ((not (and sym (symbolp sym) (fboundp sym)))) ((and (eq sym (aref eldoc-last-data 0)) (eq 'function (aref eldoc-last-data 2))) - (setq doc (aref eldoc-last-data 1))) + (setq args (aref eldoc-last-data 1))) ((setq doc (help-split-fundoc (documentation sym t) sym)) (setq args (car doc)) (string-match "\\`[^ )]* ?" args) - (setq args (concat "(" (substring args (match-end 0))))) + (setq args (concat "(" (substring args (match-end 0)))) + (eldoc-last-data-store sym args 'function)) (t (setq args (eldoc-function-argstring sym)))) - (cond (args - (setq doc (eldoc-docstring-format-sym-doc sym args)) - (eldoc-last-data-store sym doc 'function))) + (when args + (setq doc (eldoc-highlight-function-argument sym args argument-index))) doc)) +;; Highlight argument INDEX in ARGS list for SYM. +(defun eldoc-highlight-function-argument (sym args index) + (let ((start nil) + (end 0) + (argument-face 'bold)) + ;; Find the current argument in the argument string. We need to + ;; handle `&rest' and informal `...' properly. + ;; + ;; FIXME: What to do with optional arguments, like in + ;; (defun NAME ARGLIST [DOCSTRING] BODY...) case? + ;; The problem is there is no robust way to determine if + ;; the current argument is indeed a docstring. + (while (>= index 1) + (if (string-match "[^ ()]+" args end) + (progn + (setq start (match-beginning 0) + end (match-end 0)) + (let ((argument (match-string 0 args))) + (cond ((string= argument "&rest") + ;; All the rest arguments are the same. + (setq index 1)) + ((string= argument "&optional")) + ((string-match "\\.\\.\\.$" argument) + (setq index 0)) + (t + (setq index (1- index)))))) + (setq end (length args) + start (1- end) + argument-face 'font-lock-warning-face + index 0))) + (let ((doc args)) + (when start + (setq doc (copy-sequence args)) + (add-text-properties start end (list 'face argument-face) doc)) + (setq doc (eldoc-docstring-format-sym-doc + sym doc 'font-lock-function-name-face)) + doc))) + ;; Return a string containing a brief (one-line) documentation string for ;; the variable. (defun eldoc-get-var-docstring (sym) @@ -292,7 +334,8 @@ Emacs Lisp mode) that support Eldoc.") (let ((doc (documentation-property sym 'variable-documentation t))) (cond (doc (setq doc (eldoc-docstring-format-sym-doc - sym (eldoc-docstring-first-line doc))) + sym (eldoc-docstring-first-line doc) + 'font-lock-variable-name-face)) (eldoc-last-data-store sym doc 'variable))) doc))))) @@ -316,7 +359,7 @@ Emacs Lisp mode) that support Eldoc.") ;; If the entire line cannot fit in the echo area, the symbol name may be ;; truncated or eliminated entirely from the output to make room for the ;; description. -(defun eldoc-docstring-format-sym-doc (sym doc) +(defun eldoc-docstring-format-sym-doc (sym doc face) (save-match-data (let* ((name (symbol-name sym)) (ea-multi eldoc-echo-area-use-multiline-p) @@ -328,7 +371,7 @@ Emacs Lisp mode) that support Eldoc.") (cond ((or (<= strip 0) (eq ea-multi t) (and ea-multi (> (length doc) ea-width))) - (format "%s: %s" sym doc)) + (format "%s: %s" (propertize name 'face face) doc)) ((> (length doc) ea-width) (substring (format "%s" doc) 0 ea-width)) ((>= strip (length name)) @@ -338,27 +381,44 @@ Emacs Lisp mode) that support Eldoc.") ;; than the beginning, since the former is more likely ;; to be unique given package namespace conventions. (setq name (substring name strip)) - (format "%s: %s" name doc)))))) + (format "%s: %s" (propertize name 'face face) doc)))))) +;; Return a list of current function name and argument index. (defun eldoc-fnsym-in-current-sexp () - (let ((p (point))) - (eldoc-beginning-of-sexp) - (prog1 - ;; Don't do anything if current word is inside a string. - (if (= (or (char-after (1- (point))) 0) ?\") - nil - (eldoc-current-symbol)) - (goto-char p)))) - + (save-excursion + (let ((argument-index (1- (eldoc-beginning-of-sexp)))) + ;; If we are at the beginning of function name, this will be -1. + (when (< argument-index 0) + (setq argument-index 0)) + ;; Don't do anything if current word is inside a string. + (if (= (or (char-after (1- (point))) 0) ?\") + nil + (list (eldoc-current-symbol) argument-index))))) + +;; Move to the beginnig of current sexp. Return the number of nested +;; sexp the point was over or after. (defun eldoc-beginning-of-sexp () - (let ((parse-sexp-ignore-comments t)) + (let ((parse-sexp-ignore-comments t) + (num-skipped-sexps 0)) (condition-case err - (while (progn - (forward-sexp -1) - (or (= (char-before) ?\") - (> (point) (point-min))))) - (error nil)))) + (progn + ;; First account for the case the point is directly over a + ;; beginning of a nested sexp. + (condition-case err + (let ((p (point))) + (forward-sexp -1) + (forward-sexp 1) + (when (< (point) p) + (setq num-skipped-sexps 1))) + (error)) + (while + (let ((p (point))) + (forward-sexp -1) + (when (< (point) p) + (setq num-skipped-sexps (1+ num-skipped-sexps)))))) + (error)) + num-skipped-sexps)) ;; returns nil unless current word is an interned symbol. (defun eldoc-current-symbol () diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 164756dfdc3..374d3ae2327 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -628,13 +628,13 @@ this command arranges for all errors to enter the debugger." (interactive "P") (if (null eval-expression-debug-on-error) (eval-last-sexp-1 eval-last-sexp-arg-internal) - (let ((old-value eval-last-sexp-fake-value) new-value value) - (let ((debug-on-error old-value)) - (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal)) - (setq new-value debug-on-error)) - (unless (eq old-value new-value) - (setq debug-on-error new-value)) - value))) + (let ((value + (let ((debug-on-error eval-last-sexp-fake-value)) + (cons (eval-last-sexp-1 eval-last-sexp-arg-internal) + debug-on-error)))) + (unless (eq (cdr value) eval-last-sexp-fake-value) + (setq debug-on-error (cdr value))) + (car value)))) (defun eval-defun-1 (form) "Treat some expressions specially. @@ -730,7 +730,9 @@ If the current defun is actually a call to `defvar' or `defcustom', evaluating it this way resets the variable using its initial value expression even if the variable already has some other value. \(Normally `defvar' and `defcustom' do not alter the value if there -already is one.) +already is one.) In an analogous way, evaluating a `defface' +overrides any customizations of the face, so that it becomes +defined exactly as the `defface' expression says. If `eval-expression-debug-on-error' is non-nil, which is the default, this command arranges for all errors to enter the debugger. diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 54f88ba3ea5..6caa77220bb 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -120,7 +120,7 @@ (| . or) ; SRE (not-newline . ".") (nonl . not-newline) ; SRE - (anything . ".\\|\n") + (anything . "\\(?:.\\|\n\\)") (any . (rx-any 1 nil rx-check-any)) ; inconsistent with SRE (in . any) (char . any) ; sregex |