commit 4bfcfdb41638f37c89c0db8f297707773c677656 (HEAD, refs/remotes/origin/master) Author: Arash Esbati Date: Mon Mar 29 22:40:26 2021 -0400 * lisp/textmodes/reftex-auc.el: Improve the external function declarations (LaTeX-add-bibitems): Move declaration closer to the others. Fix those declarations to refer to the right file. diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el index 8429fce625..977da700fd 100644 --- a/lisp/textmodes/reftex-auc.el +++ b/lisp/textmodes/reftex-auc.el @@ -32,11 +32,12 @@ (optional prompt default &optional complete)) (declare-function TeX-argument-insert "ext:tex" (name optional &optional prefix)) -(declare-function LaTeX-add-labels "ext:tex" (&rest entries) t) -(declare-function LaTeX-add-index-entries "ext:tex" (&rest entries) t) -(declare-function LaTeX-bibitem-list "ext:tex" () t) -(declare-function LaTeX-index-entry-list "ext:tex" () t) -(declare-function LaTeX-label-list "ext:tex" () t) +(declare-function LaTeX-add-labels "ext:latex" (&rest labels) t) +(declare-function LaTeX-add-index-entries "ext:latex" (&rest index-entries) t) +(declare-function LaTeX-add-bibitems "ext:latex" (&rest bibitems) t) +(declare-function LaTeX-bibitem-list "ext:latex" () t) +(declare-function LaTeX-index-entry-list "ext:latex" () t) +(declare-function LaTeX-label-list "ext:latex" () t) (declare-function multi-prompt "ext:multi-prompt" (separator unique prompt table &optional mp-predicate require-match initial history)) @@ -69,8 +70,6 @@ What is being used depends upon `reftex-plug-into-AUCTeX'." (LaTeX-add-labels label)) (TeX-argument-insert label optional))) -(declare-function LaTeX-add-bibitems "latex") ;FIXME: Can't find the definition - ;;;###autoload (defun reftex-arg-cite (optional &optional prompt definition) "Use `reftex-citation' or AUCTeX's code to insert a cite-key macro argument. @@ -88,7 +87,6 @@ What is being used depends upon `reftex-plug-into-AUCTeX'." (TeX-argument-insert (mapconcat #'identity items reftex-cite-key-separator) optional))) - ;;;###autoload (defun reftex-arg-index-tag (optional &optional prompt &rest _args) "Prompt for an index tag with completion. commit 24c92b35b5ed8432e53a27ed3cb477788894ecdc Author: Dmitry Gutov Date: Tue Mar 30 03:42:11 2021 +0300 Provide information to show icons with Elisp completions * lisp/progmodes/elisp-mode.el (elisp--company-kind): New function. (elisp-completion-at-point): Use it. And a couple of anonymous :company-kind functions too. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index cdf60859d0..8ade718640 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -530,6 +530,7 @@ functions are annotated with \"\" via the ((elisp--expect-function-p beg) (list nil obarray :predicate #'fboundp + :company-kind #'elisp--company-kind :company-doc-buffer #'elisp--company-doc-buffer :company-docsig #'elisp--company-doc-string :company-location #'elisp--company-location)) @@ -543,6 +544,7 @@ functions are annotated with \"\" via the (symbol-plist sym))) :annotation-function (lambda (str) (if (fboundp (intern-soft str)) " ")) + :company-kind #'elisp--company-kind :company-doc-buffer #'elisp--company-doc-buffer :company-docsig #'elisp--company-doc-string :company-location #'elisp--company-location)) @@ -553,6 +555,11 @@ functions are annotated with \"\" via the obarray #'boundp 'strict)) + :company-kind + (lambda (s) + (if (test-completion s elisp--local-variables-completion-table) + 'value + 'variable)) :company-doc-buffer #'elisp--company-doc-buffer :company-docsig #'elisp--company-doc-string :company-location #'elisp--company-location))) @@ -599,11 +606,13 @@ functions are annotated with \"\" via the (looking-at "\\_")))) (list t obarray :predicate #'boundp + :company-kind (lambda (_) 'variable) :company-doc-buffer #'elisp--company-doc-buffer :company-docsig #'elisp--company-doc-string :company-location #'elisp--company-location)) (_ (list nil obarray :predicate #'fboundp + :company-kind #'elisp--company-kind :company-doc-buffer #'elisp--company-doc-buffer :company-docsig #'elisp--company-doc-string :company-location #'elisp--company-location @@ -619,6 +628,16 @@ functions are annotated with \"\" via the " " (cadr table-etc))) (cddr table-etc))))))))) +(defun elisp--company-kind (str) + (let ((sym (intern-soft str))) + (cond + ((or (macrop sym) (special-form-p sym)) 'keyword) + ((fboundp sym) 'function) + ((boundp sym) 'variable) + ((featurep sym) 'module) + ((facep sym) 'color) + (t 'text)))) + (defun lisp-completion-at-point (&optional _predicate) (declare (obsolete elisp-completion-at-point "25.1")) (elisp-completion-at-point)) commit 5a5cccb6ac8b4511195b5a1348e29b3ee1cba4ad Author: Stefan Monnier Date: Mon Mar 29 18:35:01 2021 -0400 lisp/progmodes/verilog-mode.el: Prepare for lexical-binding. * lisp/progmodes/verilog-mode.el: Activate lexical-binding. Insert newlines to avoid some situations where arguments were easy to misunderstand. (verilog-set-compile-command): Strength-reduce `eval` to `symbol-value`. (verilog-error-regexp-add-emacs): Replace `mapcar` => `mapc` since the result is not used. (verilog-surelint-off): Remove always-nil var `dir`. (verilog-do-indent): Minor simplification of the code. (verilog-pred): Delete var. It was always nil. (verilog-flag): Delete var; pass the corresponding data via explicit arguments instead. (verilog-keyword-completion): Use `dolist`. (verilog-completion-response): Rename to `verilog--complete-with-action`. Change calling convention to match that of `complete-with-action`. Use `complete-with-action` instead when available. Adjust all callers. (verilog-completion, verilog-comp-defun): Change arg names so they don't collide with dynamically scoped vars, and let-bind `verilog-str` explicitly instead. Use `with-current-buffer`. (verilog-batch-execute-func): Use `with-current-buffer`. (verilog-complete-word): Don't convert the completion list into a completion alist, since lists work just as well. (verilog-showscopes): Use `with-current-buffer`. (verilog-symbol-detick, verilog-symbol-detick-text) (verilog-signals-matching-enum): Strength-reduce `eval` to `symbol-value`. (verilog--insert-indent): Rename from `verilog--insert-indent`. Add `indent-pt` argument. (verilog-insert-indent): New macro wrapper to provide the old calling convention. (verilog-auto-assign-modport, verilog-auto-inout-modport): Remove always-nil var `direction-re`. (verilog--auto-inst-first): Rename from `verilog-auto-inst-first`. Add `indent-pt` argument. (verilog-auto-inst-port): Adjust call accordingly. diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 9f7285ca40..8ba3483bcc 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -9,7 +9,7 @@ ;; Keywords: languages ;; The "Version" is the date followed by the decimal rendition of the Git ;; commit hex. -;; Version: 2021.03.29.211984233 +;; Version: 2021.03.29.215531170 ;; Yoni Rabkin contacted the maintainer of this ;; file on 19/3/2008, and the maintainer agreed that when a bug is @@ -124,7 +124,7 @@ ;; ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "2021-03-29-ca29f69-vpo-GNU" +(defconst verilog-mode-version "2021-03-29-cd8bea2-vpo-GNU" "Version of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -2013,9 +2013,10 @@ portion, will be substituted." (t (set (make-local-variable 'compile-command) (if verilog-tool - (if (string-match "%s" (eval verilog-tool)) - (format (eval verilog-tool) (or buffer-file-name "")) - (concat (eval verilog-tool) " " (or buffer-file-name ""))) + (let ((cmd (symbol-value verilog-tool))) + (if (string-match "%s" cmd) + (format cmd (or buffer-file-name "")) + (concat cmd " " (or buffer-file-name "")))) "")))) (verilog-modify-compile-command)) @@ -2102,7 +2103,7 @@ find the errors." (interactive) (when (boundp 'compilation-error-regexp-alist-alist) (when (not (assoc 'verilog-xl-1 compilation-error-regexp-alist-alist)) - (mapcar + (mapc (lambda (item) (push (car item) compilation-error-regexp-alist) (push item compilation-error-regexp-alist-alist)) @@ -5459,8 +5460,7 @@ becomes: (let* ((code (match-string 2)) (file (match-string 3)) (line (match-string 4)) - (buffer (get-file-buffer file)) - dir filename) + (buffer (get-file-buffer file))) (unless buffer (progn (setq buffer @@ -5472,9 +5472,8 @@ becomes: (read-file-name (format "Find this error in: (default %s) " file) - dir file t)))) - (if (file-directory-p name) - (setq name (expand-file-name filename name))) + nil ;; dir + file t)))) (setq buffer (and (file-exists-p name) (find-file-noselect name)))))))) @@ -5617,12 +5616,11 @@ Save the result unless optional NO-SAVE is t." ;; Process the files (mapc (lambda (buf) (when (buffer-file-name buf) - (save-excursion - (if (not (file-exists-p (buffer-file-name buf))) - (error - "File not found: %s" (buffer-file-name buf))) - (message "Processing %s" (buffer-file-name buf)) - (set-buffer buf) + (if (not (file-exists-p (buffer-file-name buf))) + (error + "File not found: %s" (buffer-file-name buf))) + (message "Processing %s" (buffer-file-name buf)) + (with-current-buffer buf (funcall funref) (verilog-star-cleanup) (when (and (not no-save) @@ -6864,16 +6862,19 @@ Only look at a few lines to determine indent level." (indent-line-to val))) (t (goto-char here) - (let ((val)) - (verilog-beg-of-statement-1) - (if (and (< (point) here) - (verilog-re-search-forward "=[ \t]*" here 'move) - ;; not at a |=>, #=#, or [=n] operator - (not (string-match "\\[=.\\|#=#\\||=>" - (or (buffer-substring (- (point) 2) (1+ (point))) - "")))) ; don't let buffer over/under-run spoil the party - (setq val (current-column)) - (setq val (eval (cdr (assoc type verilog-indent-alist))))) + (verilog-beg-of-statement-1) + (let ((val + (if (and (< (point) here) + (verilog-re-search-forward "=[ \t]*" here 'move) + ;; not at a |=>, #=#, or [=n] operator + (not (string-match "\\[=.\\|#=#\\||=>" + (or (buffer-substring + (- (point) 2) (1+ (point))) + ;; Don't let buffer over/under + ;; run spoil the party. + "")))) + (current-column) + (eval (cdr (assoc type verilog-indent-alist)))))) (goto-char here) (indent-line-to val)))))) @@ -7309,7 +7310,8 @@ BASEIND is the base indent to offset everything." (if (verilog-re-search-backward (or (and verilog-indent-declaration-macros verilog-declaration-re-1-macro) - verilog-declaration-re-1-no-macro) lim t) + verilog-declaration-re-1-no-macro) + lim t) (progn (goto-char (match-end 0)) (skip-chars-forward " \t") @@ -7427,9 +7429,7 @@ BEG and END." ;; (defvar verilog-str nil) (defvar verilog-all nil) -(defvar verilog-pred nil) (defvar verilog-buffer-to-use nil) -(defvar verilog-flag nil) (defvar verilog-toggle-completions nil "True means \\\\[verilog-complete-word] should try all possible completions one by one. Repeated use of \\[verilog-complete-word] will show you all of them. @@ -7576,9 +7576,7 @@ TYPE is `module', `tf' for task or function, or t if unknown." (while (verilog-re-search-forward verilog-str (point-max) t) (progn (setq match (buffer-substring (match-beginning 2) (match-end 2))) - (if (or (null verilog-pred) - (funcall verilog-pred match)) - (setq verilog-all (cons match verilog-all))))) + (setq verilog-all (cons match verilog-all)))) (if (match-beginning 0) (goto-char (match-beginning 0))))) @@ -7598,9 +7596,7 @@ for matches of `str' and adding the occurrence tp `all' through point END." (not (match-end 1))) (setq match (buffer-substring (match-beginning 0) (match-end 0))) (if (string-match (concat "\\<" verilog-str) match) - (if (or (null verilog-pred) - (funcall verilog-pred match)) - (setq verilog-all (cons match verilog-all))))) + (setq verilog-all (cons match verilog-all)))) (forward-line 1))) verilog-all) @@ -7615,28 +7611,25 @@ for matches of `str' and adding the occurrence tp `all' through point END." (defun verilog-keyword-completion (keyword-list) "Give list of all possible completions of keywords in KEYWORD-LIST." - (mapcar (lambda (s) - (if (string-match (concat "\\<" verilog-str) s) - (if (or (null verilog-pred) - (funcall verilog-pred s)) - (setq verilog-all (cons s verilog-all))))) - keyword-list)) - - -(defun verilog-completion (verilog-str verilog-pred verilog-flag) - "Function passed to `completing-read', `try-completion' or `all-completions'. -Called to get completion on VERILOG-STR. If VERILOG-PRED is non-nil, it -must be a function to be called for every match to check if this should -really be a match. If VERILOG-FLAG is t, the function returns a list of -all possible completions. If VERILOG-FLAG is nil it returns a string, -the longest possible completion, or t if VERILOG-STR is an exact match. -If VERILOG-FLAG is `lambda', the function returns t if VERILOG-STR is an -exact match, nil otherwise." - (save-excursion - (let ((verilog-all nil)) - ;; Set buffer to use for searching labels. This should be set - ;; within functions which use verilog-completions - (set-buffer verilog-buffer-to-use) + (dolist (s keyword-list) + (if (string-match (concat "\\<" verilog-str) s) + (push s verilog-all)))) + + +(defun verilog-completion (str pred flag) + "Completion table for Verilog tokens. +Function passed to `completing-read', `try-completion' or `all-completions'. +Called to get completion on STR. +If FLAG is t, the function returns a list of all possible completions. +If FLAG is nil it returns a string, the longest possible completion, +or t if STR is an exact match. +If FLAG is `lambda', the function returns t if STR is an exact match, +nil otherwise." + (let ((verilog-str str) + (verilog-all nil)) + ;; Set buffer to use for searching labels. This should be set + ;; within functions which use verilog-completions + (with-current-buffer verilog-buffer-to-use ;; Determine what should be completed (let ((state (car (verilog-calculate-indent)))) @@ -7678,43 +7671,47 @@ exact match, nil otherwise." (verilog-keyword-completion verilog-separator-keywords)))) ;; Now we have built a list of all matches. Give response to caller - (verilog-completion-response)))) - -(defun verilog-completion-response () - (cond ((or (equal verilog-flag 'lambda) (null verilog-flag)) - ;; This was not called by all-completions - (if (null verilog-all) - ;; Return nil if there was no matching label - nil - ;; Get longest string common in the labels - ;; FIXME: Why not use `try-completion'? - (let* ((elm (cdr verilog-all)) - (match (car verilog-all)) - (min (length match)) - tmp) - (if (string= match verilog-str) - ;; Return t if first match was an exact match - (setq match t) - (while (not (null elm)) - ;; Find longest common string - (if (< (setq tmp (verilog-string-diff match (car elm))) min) - (progn - (setq min tmp) - (setq match (substring match 0 min)))) - ;; Terminate with match=t if this is an exact match - (if (string= (car elm) verilog-str) - (progn - (setq match t) - (setq elm nil)) - (setq elm (cdr elm))))) - ;; If this is a test just for exact match, return nil ot t - (if (and (equal verilog-flag 'lambda) (not (equal match 't))) - nil - match)))) - ;; If flag is t, this was called by all-completions. Return - ;; list of all possible completions - (verilog-flag - verilog-all))) + (verilog--complete-with-action flag verilog-all verilog-str pred)))) + + +(defalias 'verilog--complete-with-action + (if (fboundp 'complete-with-action) + #'complete-with-action + (lambda (flag collection string _predicate) + (cond ((or (equal flag 'lambda) (null flag)) + ;; This was not called by all-completions + (if (null collection) + ;; Return nil if there was no matching label + nil + ;; Get longest string common in the labels + (let* ((elm (cdr collection)) + (match (car collection)) + (min (length match)) + tmp) + (if (string= match string) + ;; Return t if first match was an exact match + (setq match t) + (while (not (null elm)) + ;; Find longest common string + (if (< (setq tmp (verilog-string-diff match (car elm))) + min) + (progn + (setq min tmp) + (setq match (substring match 0 min)))) + ;; Terminate with match=t if this is an exact match + (if (string= (car elm) string) + (progn + (setq match t) + (setq elm nil)) + (setq elm (cdr elm))))) + ;; If this is a test just for exact match, return nil ot t + (if (and (equal flag 'lambda) (not (equal match 't))) + nil + match)))) + ;; If flag is t, this was called by all-completions. Return + ;; list of all possible completions + (flag + collection))))) (defvar verilog-last-word-numb 0) (defvar verilog-last-word-shown nil) @@ -7748,9 +7745,7 @@ and `verilog-separator-keywords'.)" (verilog-str (buffer-substring b e)) (allcomp (nth 2 comp-info)) (match (if verilog-toggle-completions - "" (try-completion - verilog-str (mapcar (lambda (elm) - (cons elm 0)) allcomp))))) + "" (try-completion verilog-str allcomp)))) ;; Delete old string (delete-region b e) @@ -7822,39 +7817,38 @@ With optional second ARG non-nil, STR is the complete name of the instruction." (setq str (concat str "[a-zA-Z0-9_]*"))) (concat "^\\s-*\\(function\\|task\\|module\\)[ \t]+\\(?:\\(?:static\\|automatic\\)\\s-+\\)?\\(" str "\\)\\>")) -(defun verilog-comp-defun (verilog-str verilog-pred verilog-flag) - "Function passed to `completing-read', `try-completion' or `all-completions'. -Returns a completion on any function name based on VERILOG-STR prefix. If -VERILOG-PRED is non-nil, it must be a function to be called for every match -to check if this should really be a match. If VERILOG-FLAG is t, the -function returns a list of all possible completions. If it is nil it -returns a string, the longest possible completion, or t if VERILOG-STR is -an exact match. If VERILOG-FLAG is `lambda', the function returns t if -VERILOG-STR is an exact match, nil otherwise." - (save-excursion - (let ((verilog-all nil) - match) - - ;; Set buffer to use for searching labels. This should be set - ;; within functions which use verilog-completions - (set-buffer verilog-buffer-to-use) +(defun verilog-comp-defun (str pred flag) + "Completion table for function names. +Function passed to `completing-read', `try-completion' or `all-completions'. +Returns a completion on any function name based on STR prefix. +If FLAG is t, the function returns a list of all possible completions. +If it is nil it returns a string, the longest possible completion, +or t if STR is an exact match. +If FLAG is `lambda', the function returns t if STR is an exact match, +nil otherwise." + (let ((verilog-all nil) + (verilog-str str) + match) + + ;; Set buffer to use for searching labels. This should be set + ;; within functions which use verilog-completions + (with-current-buffer verilog-buffer-to-use (let ((verilog-str verilog-str)) ;; Build regular expression for functions - (if (string= verilog-str "") - (setq verilog-str (verilog-build-defun-re "[a-zA-Z_]")) - (setq verilog-str (verilog-build-defun-re verilog-str))) + (setq verilog-str + (verilog-build-defun-re (if (string= verilog-str "") + "[a-zA-Z_]" + verilog-str))) (goto-char (point-min)) ;; Build a list of all possible completions (while (verilog-re-search-forward verilog-str nil t) (setq match (buffer-substring (match-beginning 2) (match-end 2))) - (if (or (null verilog-pred) - (funcall verilog-pred match)) - (setq verilog-all (cons match verilog-all))))) + (setq verilog-all (cons match verilog-all)))) ;; Now we have built a list of all matches. Give response to caller - (verilog-completion-response)))) + (verilog--complete-with-action flag verilog-all verilog-str pred)))) (defun verilog-goto-defun () "Move to specified Verilog module/interface/task/function. @@ -7931,10 +7925,9 @@ If search fails, other files are checked based on (tag (format "%3d" linenum)) (empty (make-string (length tag) ?\ )) tem) - (save-excursion - (setq tem (make-marker)) - (set-marker tem (point)) - (set-buffer standard-output) + (setq tem (make-marker)) + (set-marker tem (point)) + (with-current-buffer standard-output (setq occur-pos-list (cons tem occur-pos-list)) (or first (zerop nlines) (insert "--------\n")) @@ -10098,7 +10091,7 @@ If undefined, and WING-IT, return just SYMBOL without the tick, else nil." ;; variable in only one buffer returns t in another. ;; This can confuse, so check for nil. ;; Namespace intentionally short for AUTOs and compatibility - (let ((val (eval (intern (concat "vh-" symbol))))) + (let ((val (symbol-value (intern (concat "vh-" symbol))))) (if (eq val nil) (if wing-it symbol nil) val)) @@ -10137,7 +10130,7 @@ This function is intended for use in AUTO_TEMPLATE Lisp expressions." ;; variable in only one buffer returns t in another. ;; This can confuse, so check for nil. ;; Namespace intentionally short for AUTOs and compatibility - (setq val (eval (intern (concat "vh-" symbol))))) + (setq val (symbol-value (intern (concat "vh-" symbol))))) (setq text (replace-match val nil nil text))) (t (setq ok nil))))) text) @@ -10492,7 +10485,7 @@ those clocking block's signals." ;; New scheme ;; Namespace intentionally short for AUTOs and compatibility (let* ((enumvar (intern (concat "venum-" enum)))) - (dolist (en (and (boundp enumvar) (eval enumvar))) + (dolist (en (and (boundp enumvar) (symbol-value enumvar))) (let ((sig (list en))) (unless (member sig out-list) (push sig out-list))))) @@ -10697,9 +10690,7 @@ When MODI is non-null, also add to modi-cache, for tracking." (verilog-insert "// " (verilog-sig-comment sig) "\n")) (setq sigs (cdr sigs))))) -(defvar indent-pt) ;; Local used by `verilog-insert-indent'. - -(defun verilog-insert-indent (&rest stuff) +(defun verilog--insert-indent (indent-pt &rest stuff) "Indent to position stored in local `indent-pt' variable, then insert STUFF. Presumes that any newlines end a list element." (let ((need-indent t)) @@ -10709,6 +10700,10 @@ Presumes that any newlines end a list element." (verilog-insert (car stuff)) (setq need-indent (string-match "\n$" (car stuff)) stuff (cdr stuff))))) + +(defmacro verilog-insert-indent (&rest stuff) + `(verilog--insert-indent indent-pt ,@stuff)) + ;;(let ((indent-pt 10)) (verilog-insert-indent "hello\n" "addon" "there\n")) (defun verilog-forward-or-insert-line () @@ -11517,7 +11512,8 @@ See the example in `verilog-auto-inout-modport'." (inst-name (nth 2 params)) (regexp (nth 3 params)) (prefix (nth 4 params)) - direction-re submodi) ; direction argument not supported until requested + ;; direction-re ; direction argument not supported until requested + submodi) ;; Lookup position, etc of co-module ;; Note this may raise an error (when (setq submodi (verilog-modi-lookup submod t)) @@ -11538,11 +11534,11 @@ See the example in `verilog-auto-inout-modport'." (setq sig-list-i (verilog-signals-edit-wire-reg (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-i regexp) - "input" direction-re)) + "input" nil)) ;; direction-re sig-list-o (verilog-signals-edit-wire-reg (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-o regexp) - "output" direction-re))) + "output" nil))) ;; direction-re (setq sig-list-i (sort (copy-alist sig-list-i) #'verilog-signals-sort-compare)) (setq sig-list-o (sort (copy-alist sig-list-o) #'verilog-signals-sort-compare)) (when (or sig-list-i sig-list-o) @@ -11683,7 +11679,7 @@ If PAR-VALUES replace final strings with these parameter values." (setq tpl-net (verilog-string-replace-matches "\\[\\]" vl-bits nil nil tpl-net))) ;; Insert it (when (or tpl-ass (not verilog-auto-inst-template-required)) - (verilog-auto-inst-first section) + (verilog--auto-inst-first indent-pt section) (indent-to indent-pt) (insert "." port) (unless (and verilog-auto-inst-dot-name @@ -11722,7 +11718,7 @@ If PAR-VALUES replace final strings with these parameter values." (defvar verilog-auto-inst-first-any nil "Local first-in-any-section for `verilog-auto-inst-first'.") -(defun verilog-auto-inst-first (section) +(defun verilog--auto-inst-first (indent-pt section) "Insert , and SECTION before port, as part of \\[verilog-auto-inst]." ;; Do we need a trailing comma? ;; There maybe an ifdef or something similar before us. What a mess. Thus @@ -12956,21 +12952,25 @@ that expression are included." (verilog-signals-not-matching-regexp (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-i regexp) - "input" direction-re) not-re)) + "input" direction-re) + not-re)) sig-list-o (verilog-signals-edit-wire-reg (verilog-signals-not-matching-regexp (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-o regexp) - "output" direction-re) not-re)) + "output" direction-re) + not-re)) sig-list-io (verilog-signals-edit-wire-reg (verilog-signals-not-matching-regexp (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-io regexp) - "inout" direction-re) not-re)) + "inout" direction-re) + not-re)) sig-list-if (verilog-signals-not-matching-regexp (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-if regexp) - "interface" direction-re) not-re)) + "interface" direction-re) + not-re)) (when v2k (verilog-repair-open-comma)) (when (or sig-list-i sig-list-o sig-list-io sig-list-if) (verilog-insert-indent "// Beginning of automatic in/out/inouts (from specific module)\n") @@ -13256,7 +13256,8 @@ driver/monitor using AUTOINST in the testbench." (modport-re (nth 1 params)) (regexp (nth 2 params)) (prefix (nth 3 params)) - direction-re submodi) ; direction argument not supported until requested + ;; direction-re ; direction argument not supported until requested + submodi) ;; Lookup position, etc of co-module ;; Note this may raise an error (when (setq submodi (verilog-modi-lookup submod t)) @@ -13287,7 +13288,7 @@ driver/monitor using AUTOINST in the testbench." (verilog-signals-add-prefix (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-i regexp) - "input" direction-re) + "input" nil) ;; direction-re prefix) (verilog-decls-get-ports moddecls))) sig-list-o (verilog-signals-edit-wire-reg @@ -13295,7 +13296,7 @@ driver/monitor using AUTOINST in the testbench." (verilog-signals-add-prefix (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-o regexp) - "output" direction-re) + "output" nil) ;; direction-re prefix) (verilog-decls-get-ports moddecls))) sig-list-io (verilog-signals-edit-wire-reg @@ -13303,7 +13304,7 @@ driver/monitor using AUTOINST in the testbench." (verilog-signals-add-prefix (verilog-signals-matching-dir-re (verilog-signals-matching-regexp sig-list-io regexp) - "inout" direction-re) + "inout" nil) ;; direction-re prefix) (verilog-decls-get-ports moddecls)))) (when v2k (verilog-repair-open-comma)) commit 66d04c04380f63513b90164b77bdf6fe584ac8b4 Author: Stefan Monnier Date: Mon Mar 29 18:07:25 2021 -0400 * lisp/progmodes/verilog-mode.el: Use #' where appropriate. diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index a9745e14c4..9f7285ca40 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -9,7 +9,7 @@ ;; Keywords: languages ;; The "Version" is the date followed by the decimal rendition of the Git ;; commit hex. -;; Version: 2021.03.18.062085829 +;; Version: 2021.03.29.211984233 ;; Yoni Rabkin contacted the maintainer of this ;; file on 19/3/2008, and the maintainer agreed that when a bug is @@ -124,7 +124,7 @@ ;; ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "2021-03-18-3b35ac5-vpo-GNU" +(defconst verilog-mode-version "2021-03-29-ca29f69-vpo-GNU" "Version of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -290,7 +290,7 @@ STRING should be given if the last search was by `string-match' on STRING." (concat open (mapconcat 'regexp-quote strings "\\|") close))) ) ;; Emacs. - (defalias 'verilog-regexp-opt 'regexp-opt))) + (defalias 'verilog-regexp-opt #'regexp-opt))) ;; emacs >=22 has looking-back, but older emacs and xemacs don't. ;; This function is lifted directly from emacs's subr.el @@ -300,7 +300,7 @@ STRING should be given if the last search was by `string-match' on STRING." (eval-and-compile (cond ((fboundp 'looking-back) - (defalias 'verilog-looking-back 'looking-back)) + (defalias 'verilog-looking-back #'looking-back)) (t (defun verilog-looking-back (regexp limit &optional greedy) "Return non-nil if text before point matches regular expression REGEXP. @@ -340,14 +340,14 @@ wherever possible, since it is slow." (cond ((fboundp 'restore-buffer-modified-p) ;; Faster, as does not update mode line when nothing changes - (defalias 'verilog-restore-buffer-modified-p 'restore-buffer-modified-p)) + (defalias 'verilog-restore-buffer-modified-p #'restore-buffer-modified-p)) (t - (defalias 'verilog-restore-buffer-modified-p 'set-buffer-modified-p)))) + (defalias 'verilog-restore-buffer-modified-p #'set-buffer-modified-p)))) (eval-and-compile (cond ((fboundp 'quit-window) - (defalias 'verilog-quit-window 'quit-window)) + (defalias 'verilog-quit-window #'quit-window)) (t (defun verilog-quit-window (_kill-ignored window) "Quit WINDOW and bury its buffer. KILL-IGNORED is ignored." @@ -379,7 +379,7 @@ wherever possible, since it is slow." ;; Added in Emacs 25.1 (condition-case nil (unless (fboundp 'forward-word-strictly) - (defalias 'forward-word-strictly 'forward-word)) + (defalias 'forward-word-strictly #'forward-word)) (error nil))) (eval-when-compile @@ -1483,48 +1483,48 @@ If set will become buffer local.") (defvar verilog-mode-map (let ((map (make-sparse-keymap))) - (define-key map ";" 'electric-verilog-semi) - (define-key map [(control 59)] 'electric-verilog-semi-with-comment) - (define-key map ":" 'electric-verilog-colon) + (define-key map ";" #'electric-verilog-semi) + (define-key map [(control 59)] #'electric-verilog-semi-with-comment) + (define-key map ":" #'electric-verilog-colon) ;;(define-key map "=" 'electric-verilog-equal) - (define-key map "`" 'electric-verilog-tick) - (define-key map "\t" 'electric-verilog-tab) - (define-key map "\r" 'electric-verilog-terminate-line) + (define-key map "`" #'electric-verilog-tick) + (define-key map "\t" #'electric-verilog-tab) + (define-key map "\r" #'electric-verilog-terminate-line) ;; backspace/delete key bindings - (define-key map [backspace] 'backward-delete-char-untabify) + (define-key map [backspace] #'backward-delete-char-untabify) (unless (boundp 'delete-key-deletes-forward) ; XEmacs variable - (define-key map [delete] 'delete-char) - (define-key map [(meta delete)] 'kill-word)) - (define-key map "\M-\C-b" 'electric-verilog-backward-sexp) - (define-key map "\M-\C-f" 'electric-verilog-forward-sexp) - (define-key map "\M-\r" 'electric-verilog-terminate-and-indent) + (define-key map [delete] #'delete-char) + (define-key map [(meta delete)] #'kill-word)) + (define-key map "\M-\C-b" #'electric-verilog-backward-sexp) + (define-key map "\M-\C-f" #'electric-verilog-forward-sexp) + (define-key map "\M-\r" #'electric-verilog-terminate-and-indent) (define-key map "\M-\t" (if (fboundp 'completion-at-point) - 'completion-at-point 'verilog-complete-word)) + #'completion-at-point #'verilog-complete-word)) (define-key map "\M-?" (if (fboundp 'completion-help-at-point) - 'completion-help-at-point 'verilog-show-completions)) + #'completion-help-at-point #'verilog-show-completions)) ;; Note \C-c and letter are reserved for users - (define-key map "\C-c`" 'verilog-lint-off) - (define-key map "\C-c*" 'verilog-delete-auto-star-implicit) - (define-key map "\C-c?" 'verilog-diff-auto) - (define-key map "\C-c\C-r" 'verilog-label-be) - (define-key map "\C-c\C-i" 'verilog-pretty-declarations) - (define-key map "\C-c=" 'verilog-pretty-expr) - (define-key map "\C-c\C-b" 'verilog-submit-bug-report) - (define-key map "\C-c/" 'verilog-star-comment) - (define-key map "\C-c\C-c" 'verilog-comment-region) - (define-key map "\C-c\C-u" 'verilog-uncomment-region) + (define-key map "\C-c`" #'verilog-lint-off) + (define-key map "\C-c*" #'verilog-delete-auto-star-implicit) + (define-key map "\C-c?" #'verilog-diff-auto) + (define-key map "\C-c\C-r" #'verilog-label-be) + (define-key map "\C-c\C-i" #'verilog-pretty-declarations) + (define-key map "\C-c=" #'verilog-pretty-expr) + (define-key map "\C-c\C-b" #'verilog-submit-bug-report) + (define-key map "\C-c/" #'verilog-star-comment) + (define-key map "\C-c\C-c" #'verilog-comment-region) + (define-key map "\C-c\C-u" #'verilog-uncomment-region) (when (featurep 'xemacs) - (define-key map [(meta control h)] 'verilog-mark-defun) - (define-key map "\M-\C-a" 'verilog-beg-of-defun) - (define-key map "\M-\C-e" 'verilog-end-of-defun)) - (define-key map "\C-c\C-d" 'verilog-goto-defun) - (define-key map "\C-c\C-k" 'verilog-delete-auto) - (define-key map "\C-c\C-a" 'verilog-auto) - (define-key map "\C-c\C-s" 'verilog-auto-save-compile) - (define-key map "\C-c\C-p" 'verilog-preprocess) - (define-key map "\C-c\C-z" 'verilog-inject-auto) - (define-key map "\C-c\C-e" 'verilog-expand-vector) - (define-key map "\C-c\C-h" 'verilog-header) + (define-key map [(meta control h)] #'verilog-mark-defun) + (define-key map "\M-\C-a" #'verilog-beg-of-defun) + (define-key map "\M-\C-e" #'verilog-end-of-defun)) + (define-key map "\C-c\C-d" #'verilog-goto-defun) + (define-key map "\C-c\C-k" #'verilog-delete-auto) + (define-key map "\C-c\C-a" #'verilog-auto) + (define-key map "\C-c\C-s" #'verilog-auto-save-compile) + (define-key map "\C-c\C-p" #'verilog-preprocess) + (define-key map "\C-c\C-z" #'verilog-inject-auto) + (define-key map "\C-c\C-e" #'verilog-expand-vector) + (define-key map "\C-c\C-h" #'verilog-header) map) "Keymap used in Verilog mode.") @@ -7732,7 +7732,7 @@ exact match, nil otherwise." (allcomp (if (and verilog-toggle-completions (string= verilog-last-word-shown verilog-str)) verilog-last-completions - (all-completions verilog-str 'verilog-completion)))) + (all-completions verilog-str #'verilog-completion)))) (list b e allcomp))) (defun verilog-complete-word () @@ -7869,10 +7869,10 @@ If search fails, other files are checked based on ;; Do completion with default (completing-read (concat "Goto-Label: (default " default ") ") - 'verilog-comp-defun nil nil "") + #'verilog-comp-defun nil nil "") ;; There is no default value. Complete without it (completing-read "Goto-Label: " - 'verilog-comp-defun nil nil ""))) + #'verilog-comp-defun nil nil ""))) pt) ;; Make sure library paths are correct, in case need to resolve module (verilog-auto-reeval-locals) @@ -14274,37 +14274,37 @@ Wilson Snyder (wsnyder@wsnyder.org)." (defvar verilog-template-map (let ((map (make-sparse-keymap))) - (define-key map "a" 'verilog-sk-always) - (define-key map "b" 'verilog-sk-begin) - (define-key map "c" 'verilog-sk-case) - (define-key map "f" 'verilog-sk-for) - (define-key map "g" 'verilog-sk-generate) - (define-key map "h" 'verilog-sk-header) - (define-key map "i" 'verilog-sk-initial) - (define-key map "j" 'verilog-sk-fork) - (define-key map "m" 'verilog-sk-module) - (define-key map "o" 'verilog-sk-ovm-class) - (define-key map "p" 'verilog-sk-primitive) - (define-key map "r" 'verilog-sk-repeat) - (define-key map "s" 'verilog-sk-specify) - (define-key map "t" 'verilog-sk-task) - (define-key map "u" 'verilog-sk-uvm-object) - (define-key map "w" 'verilog-sk-while) - (define-key map "x" 'verilog-sk-casex) - (define-key map "z" 'verilog-sk-casez) - (define-key map "?" 'verilog-sk-if) - (define-key map ":" 'verilog-sk-else-if) - (define-key map "/" 'verilog-sk-comment) - (define-key map "A" 'verilog-sk-assign) - (define-key map "F" 'verilog-sk-function) - (define-key map "I" 'verilog-sk-input) - (define-key map "O" 'verilog-sk-output) - (define-key map "S" 'verilog-sk-state-machine) - (define-key map "=" 'verilog-sk-inout) - (define-key map "U" 'verilog-sk-uvm-component) - (define-key map "W" 'verilog-sk-wire) - (define-key map "R" 'verilog-sk-reg) - (define-key map "D" 'verilog-sk-define-signal) + (define-key map "a" #'verilog-sk-always) + (define-key map "b" #'verilog-sk-begin) + (define-key map "c" #'verilog-sk-case) + (define-key map "f" #'verilog-sk-for) + (define-key map "g" #'verilog-sk-generate) + (define-key map "h" #'verilog-sk-header) + (define-key map "i" #'verilog-sk-initial) + (define-key map "j" #'verilog-sk-fork) + (define-key map "m" #'verilog-sk-module) + (define-key map "o" #'verilog-sk-ovm-class) + (define-key map "p" #'verilog-sk-primitive) + (define-key map "r" #'verilog-sk-repeat) + (define-key map "s" #'verilog-sk-specify) + (define-key map "t" #'verilog-sk-task) + (define-key map "u" #'verilog-sk-uvm-object) + (define-key map "w" #'verilog-sk-while) + (define-key map "x" #'verilog-sk-casex) + (define-key map "z" #'verilog-sk-casez) + (define-key map "?" #'verilog-sk-if) + (define-key map ":" #'verilog-sk-else-if) + (define-key map "/" #'verilog-sk-comment) + (define-key map "A" #'verilog-sk-assign) + (define-key map "F" #'verilog-sk-function) + (define-key map "I" #'verilog-sk-input) + (define-key map "O" #'verilog-sk-output) + (define-key map "S" #'verilog-sk-state-machine) + (define-key map "=" #'verilog-sk-inout) + (define-key map "U" #'verilog-sk-uvm-component) + (define-key map "W" #'verilog-sk-wire) + (define-key map "R" #'verilog-sk-reg) + (define-key map "D" #'verilog-sk-define-signal) map) "Keymap used in Verilog mode for smart template operations.") @@ -14695,13 +14695,13 @@ and the case items." (let ((map (make-sparse-keymap))) ; as described in info pages, make a map (set-keymap-parent map verilog-mode-map) ;; mouse button bindings - (define-key map "\r" 'verilog-load-file-at-point) + (define-key map "\r" #'verilog-load-file-at-point) + (define-key map + (if (featurep 'xemacs) 'button2 [mouse-2]) + #'verilog-load-file-at-mouse) (if (featurep 'xemacs) - (define-key map 'button2 'verilog-load-file-at-mouse);ffap-at-mouse ? - (define-key map [mouse-2] 'verilog-load-file-at-mouse)) - (if (featurep 'xemacs) - (define-key map 'Sh-button2 'mouse-yank) ; you wanna paste don't you ? - (define-key map [S-mouse-2] 'mouse-yank-at-click)) + (define-key map 'Sh-button2 #'mouse-yank) ; you wanna paste don't you ? + (define-key map [S-mouse-2] #'mouse-yank-at-click)) map) "Map containing mouse bindings for `verilog-mode'.") @@ -14774,7 +14774,7 @@ Clicking on the middle-mouse button loads them in a buffer (as in dired)." (verilog-highlight-region (point-min) (point-max) nil)) ;; Deprecated, but was interactive, so we'll keep it around -(defalias 'verilog-colorize-include-files-buffer 'verilog-highlight-buffer) +(defalias 'verilog-colorize-include-files-buffer #'verilog-highlight-buffer) ;; ffap-at-mouse isn't useful for Verilog mode. It uses library paths. ;; so define this function to do more or less the same as ffap-at-mouse commit b4831acebdc63b8a588c5d0a18b17d70f112eea9 Author: Wilson Snyder Date: Mon Mar 29 18:03:33 2021 -0400 lisp/progmodes/verilog-mode.el: Fix indentation of enum. * lisp/progmodes/verilog-mode.el (verilog-at-close-struct-p): Fix indentation of enum with multiple objects. Reported by punzik. (#1716). diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 55c04e1332..a9745e14c4 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -9,7 +9,7 @@ ;; Keywords: languages ;; The "Version" is the date followed by the decimal rendition of the Git ;; commit hex. -;; Version: 2021.02.02.263931197 +;; Version: 2021.03.18.062085829 ;; Yoni Rabkin contacted the maintainer of this ;; file on 19/3/2008, and the maintainer agreed that when a bug is @@ -124,7 +124,7 @@ ;; ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "2021-02-02-fbb453d-vpo-GNU" +(defconst verilog-mode-version "2021-03-18-3b35ac5-vpo-GNU" "Version of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -1969,7 +1969,11 @@ To call on \\[verilog-auto], set `verilog-auto-delete-trailing-whitespace'." (unless (bolp) (insert "\n")))) (defvar compile-command) +;; These are known to be from other packages and may not be defined +(defvar diff-command) +;; There are known to be from newer versions of Emacs (defvar create-lockfiles) ; Emacs 24 +(defvar which-func-modes) ;; compilation program (defun verilog-set-compile-command () @@ -6653,7 +6657,7 @@ Return >0 for nested struct." (verilog-in-struct-p)) ;; true (save-excursion - (if (looking-at "}\\(?:\\s-*\\w+\\s-*\\)?;") 1)) + (if (looking-at "}\\(?:\\s-*\\w+\\s-*\\(\\s-*\\,\\s-*\\w+\\)*\\)?;") 1)) ;; false nil)) @@ -8648,11 +8652,6 @@ Optional NUM-PARAM and MAX-PARAM check for a specific number of parameters." (defvar sigs-out-i) (defvar sigs-out-unk) (defvar sigs-temp) -;; These are known to be from other packages and may not be defined -(defvar diff-command) -;; There are known to be from newer versions of Emacs -(defvar create-lockfiles) -(defvar which-func-modes) (defun verilog-read-decls () "Compute signal declaration information for the current module at point. commit 5c23621db53365b1ce4d8570aa8dbfb555ebe21b Author: Stefan Monnier Date: Mon Mar 29 16:46:41 2021 -0400 * lisp/completion.el: Activate lexical-binding Remove redundant `:group` arguments. (list-all-completions-1): Merge into `list-all-completions` and then delete. (list-all-completions-by-hash-bucket-1): Use `push`. Merge into `list-all-completions-by-hash-bucket` and then delete. (completions-list-return-value): Delete variable, not used any more. diff --git a/lisp/completion.el b/lisp/completion.el index da2fb38feb..dc0af36cd2 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -1,7 +1,6 @@ -;;; completion.el --- dynamic word-completion code +;;; completion.el --- dynamic word-completion code -*- lexical-binding: t; -*- -;; Copyright (C) 1990, 1993, 1995, 1997, 2001-2021 Free Software -;; Foundation, Inc. +;; Copyright (C) 1990-2021 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org ;; Keywords: abbrev convenience @@ -286,62 +285,52 @@ (defcustom enable-completion t "Non-nil means enable recording and saving of completions. If nil, no new words are added to the database or saved to the init file." - :type 'boolean - :group 'completion) + :type 'boolean) (defcustom save-completions-flag t "Non-nil means save most-used completions when exiting Emacs. See also `save-completions-retention-time'." - :type 'boolean - :group 'completion) + :type 'boolean) (defcustom save-completions-file-name (locate-user-emacs-file "completions" ".completions") "The filename to save completions to." - :type 'file - :group 'completion) + :type 'file) (defcustom save-completions-retention-time 336 "Discard a completion if unused for this many hours. \(1 day = 24, 1 week = 168). If this is 0, non-permanent completions will not be saved unless these are used. Default is two weeks." - :type 'integer - :group 'completion) + :type 'integer) (defcustom completion-on-separator-character nil "Non-nil means separator characters mark previous word as used. This means the word will be saved as a completion." - :type 'boolean - :group 'completion) + :type 'boolean) (defcustom completions-file-versions-kept kept-new-versions "Number of versions to keep for the saved completions file." - :type 'integer - :group 'completion) + :type 'integer) (defcustom completion-prompt-speed-threshold 4800 "Minimum output speed at which to display next potential completion." - :type 'integer - :group 'completion) + :type 'integer) (defcustom completion-cdabbrev-prompt-flag nil "If non-nil, the next completion prompt does a cdabbrev search. This can be time consuming." - :type 'boolean - :group 'completion) + :type 'boolean) (defcustom completion-search-distance 15000 "How far to search in the buffer when looking for completions. In number of characters. If nil, search the whole buffer." - :type 'integer - :group 'completion) + :type 'integer) (defcustom completions-merging-modes '(lisp c) "List of modes {`c' or `lisp'} for automatic completions merging. Definitions from visited files which have these modes are automatically added to the completion database." - :type '(set (const lisp) (const c)) - :group 'completion) + :type '(set (const lisp) (const c))) ;;(defvar *completion-auto-save-period* 1800 ;; "The period in seconds to wait for emacs to be idle before autosaving @@ -950,9 +939,9 @@ Each symbol is bound to a single completion entry.") ;; READER Macros -(defalias 'cmpl-prefix-entry-head 'car) +(defalias 'cmpl-prefix-entry-head #'car) -(defalias 'cmpl-prefix-entry-tail 'cdr) +(defalias 'cmpl-prefix-entry-tail #'cdr) ;; WRITER Macros @@ -978,31 +967,27 @@ Each symbol is bound to a single completion entry.") (setq cmpl-prefix-obarray (make-vector cmpl-obarray-length 0)) (setq cmpl-obarray (make-vector cmpl-obarray-length 0))) -(defvar completions-list-return-value) - (defun list-all-completions () "Return a list of all the known completion entries." - (let ((completions-list-return-value nil)) - (mapatoms 'list-all-completions-1 cmpl-prefix-obarray) - completions-list-return-value)) - -(defun list-all-completions-1 (prefix-symbol) - (if (boundp prefix-symbol) - (setq completions-list-return-value - (append (cmpl-prefix-entry-head (symbol-value prefix-symbol)) - completions-list-return-value)))) - -(defun list-all-completions-by-hash-bucket () + (let ((return-value nil)) + (mapatoms (lambda (prefix-symbol) + (if (boundp prefix-symbol) + (setq return-value + (append (cmpl-prefix-entry-head + (symbol-value prefix-symbol)) + return-value)))) + cmpl-prefix-obarray) + return-value)) + +(defun list-all-completions-by-hash-bucket () ;FIXME: Unused! "Return list of lists of known completion entries, organized by hash bucket." - (let ((completions-list-return-value nil)) - (mapatoms 'list-all-completions-by-hash-bucket-1 cmpl-prefix-obarray) - completions-list-return-value)) - -(defun list-all-completions-by-hash-bucket-1 (prefix-symbol) - (if (boundp prefix-symbol) - (setq completions-list-return-value - (cons (cmpl-prefix-entry-head (symbol-value prefix-symbol)) - completions-list-return-value)))) + (let ((return-value nil)) + (mapatoms (lambda (prefix-symbol) + (if (boundp prefix-symbol) + (push (cmpl-prefix-entry-head (symbol-value prefix-symbol)) + return-value))) + cmpl-prefix-obarray) + return-value)) ;;----------------------------------------------- @@ -2155,7 +2140,6 @@ TYPE is the type of the wrapper to be added. Can be :before or :under." (define-minor-mode dynamic-completion-mode "Toggle dynamic word-completion on or off." :global t - :group 'completion ;; This is always good, not specific to dynamic-completion-mode. (define-key function-key-map [C-return] [?\C-\r]) @@ -2239,7 +2223,7 @@ TYPE is the type of the wrapper to be added. Can be :before or :under." (completion-def-wrapper 'delete-backward-char-untabify :backward) ;; Old name, non-namespace-clean. -(defalias 'initialize-completions 'completion-initialize) +(defalias 'initialize-completions #'completion-initialize) (provide 'completion) commit 990720337baf5b1509cfb4592f873d4f616ba356 Author: Stefan Monnier Date: Mon Mar 29 16:34:19 2021 -0400 * lisp/woman.el: Activate lexical-binding. Require `cl-lib` (woman-mode, woman2-roff-buffer): Use `cl-letf`. (woman-request): Move declaration before first use. (woman0-macro): Rename arg to not shadow the dynamically scoped var. (woman-set-arg): Strength-reduce `eval` to `symbol-value`. diff --git a/lisp/woman.el b/lisp/woman.el index d4f7e8c0db..505fdb4c9e 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1,4 +1,4 @@ -;;; woman.el --- browse UN*X manual pages `wo (without) man' +;;; woman.el --- browse UN*X manual pages `wo (without) man' -*- lexical-binding: t; -*- ;; Copyright (C) 2000-2021 Free Software Foundation, Inc. @@ -388,6 +388,8 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) + (defvar woman-version "0.551 (beta)" "WoMan version information.") (make-obsolete-variable 'woman-version nil "28.1") @@ -418,14 +420,14 @@ As a special case, if PATHS is nil then replace it by calling ;; an empty substring of MANPATH denotes the default list. (if (memq system-type '(windows-nt ms-dos)) (cond ((null paths) - (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf))) + (mapcar #'woman-Cyg-to-Win (woman-parse-man.conf))) ((string-match-p ";" paths) ;; Assume DOS-style path-list... (mapcan ; splice list into list (lambda (x) (if x (list x) - (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf)))) + (mapcar #'woman-Cyg-to-Win (woman-parse-man.conf)))) (parse-colon-path paths))) ((string-match-p "\\`[a-zA-Z]:" paths) ;; Assume single DOS-style path... @@ -434,7 +436,7 @@ As a special case, if PATHS is nil then replace it by calling ;; Assume UNIX/Cygwin-style path-list... (mapcan ; splice list into list (lambda (x) - (mapcar 'woman-Cyg-to-Win + (mapcar #'woman-Cyg-to-Win (if x (list x) (woman-parse-man.conf)))) (let ((path-separator ":")) (parse-colon-path paths))))) @@ -509,7 +511,7 @@ Change only via `Customization' or the function `add-hook'." (defcustom woman-man.conf-path (let ((path '("/usr/lib" "/etc"))) (cond ((eq system-type 'windows-nt) - (mapcar 'woman-Cyg-to-Win path)) + (mapcar #'woman-Cyg-to-Win path)) ((eq system-type 'darwin) (cons "/usr/share/misc" path)) (t path))) @@ -809,7 +811,7 @@ in the ncurses package include `toe.1m', `form.3x', etc. Note: an optional compression regexp will be appended, so this regexp MUST NOT end with any kind of string terminator such as $ or \\\\='." :type 'regexp - :set 'set-woman-file-regexp + :set #'set-woman-file-regexp :group 'woman-interface) (defcustom woman-file-compression-regexp @@ -825,7 +827,7 @@ Should begin with \\. and end with \\\\=' and MUST NOT be optional." ;; not loaded by default! :version "24.1" ; added xz :type 'regexp - :set 'set-woman-file-regexp + :set #'set-woman-file-regexp :group 'woman-interface) (defcustom woman-use-own-frame nil @@ -1186,7 +1188,7 @@ Called both to generate and to check the cache!" (setq dir (and (member (car dir) path) (cdr dir)))) (when dir (cl-pushnew (substitute-in-file-name dir) lst :test #'equal)))) - (mapcar 'substitute-in-file-name woman-path))) + (mapcar #'substitute-in-file-name woman-path))) (defun woman-read-directory-cache () "Load the directory and topic cache. @@ -1501,14 +1503,14 @@ Also make each path-info component into a list. (if (woman-not-member dir path) ; use each directory only once! (setq files (nconc files (directory-files dir t topic-regexp)))))) - (mapcar 'list files))) + (mapcar #'list files))) ;;; dired support (defun woman-dired-define-key (key) "Bind the argument KEY to the command `woman-dired-find-file'." - (define-key dired-mode-map key 'woman-dired-find-file)) + (define-key dired-mode-map key #'woman-dired-find-file)) (defsubst woman-dired-define-key-maybe (key) "If KEY is undefined in Dired, bind it to command `woman-dired-find-file'." @@ -1520,7 +1522,7 @@ Also make each path-info component into a list. "Define dired keys to run WoMan according to `woman-dired-keys'." (if woman-dired-keys (if (listp woman-dired-keys) - (mapc 'woman-dired-define-key woman-dired-keys) + (mapc #'woman-dired-define-key woman-dired-keys) (woman-dired-define-key-maybe "w") (woman-dired-define-key-maybe "W"))) (define-key-after (lookup-key dired-mode-map [menu-bar immediate]) @@ -1528,7 +1530,7 @@ Also make each path-info component into a list. (if (featurep 'dired) (woman-dired-define-keys) - (add-hook 'dired-mode-hook 'woman-dired-define-keys)) + (add-hook 'dired-mode-hook #'woman-dired-define-keys)) (declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep)) @@ -1754,15 +1756,15 @@ Leave point at end of new text. Return length of inserted text." (let ((map (make-sparse-keymap))) (set-keymap-parent map Man-mode-map) - (define-key map "R" 'woman-reformat-last-file) - (define-key map "w" 'woman) - (define-key map "\en" 'WoMan-next-manpage) - (define-key map "\ep" 'WoMan-previous-manpage) - (define-key map [M-mouse-2] 'woman-follow-word) + (define-key map "R" #'woman-reformat-last-file) + (define-key map "w" #'woman) + (define-key map "\en" #'WoMan-next-manpage) + (define-key map "\ep" #'WoMan-previous-manpage) + (define-key map [M-mouse-2] #'woman-follow-word) ;; We don't need to call `man' when we are in `woman-mode'. - (define-key map [remap man] 'woman) - (define-key map [remap man-follow] 'woman-follow) + (define-key map [remap man] #'woman) + (define-key map [remap man-follow] #'woman-follow) map) "Keymap for `woman-mode'.") @@ -1865,23 +1867,13 @@ See `Man-mode' for additional details. \\{woman-mode-map}" ;; FIXME: Should all this just be re-arranged so that this can just ;; inherit `man-common' and be done with it? - (let ((Man-build-page-list (symbol-function 'Man-build-page-list)) - (Man-strip-page-headers (symbol-function 'Man-strip-page-headers)) - (Man-unindent (symbol-function 'Man-unindent)) - (Man-goto-page (symbol-function 'Man-goto-page))) + (cl-letf (((symbol-function 'Man-build-page-list) #'ignore) + ((symbol-function 'Man-strip-page-headers) #'ignore) + ((symbol-function 'Man-unindent) #'ignore) + ((symbol-function 'Man-goto-page) #'ignore)) ;; Prevent inappropriate operations: - (fset 'Man-build-page-list 'ignore) - (fset 'Man-strip-page-headers 'ignore) - (fset 'Man-unindent 'ignore) - (fset 'Man-goto-page 'ignore) - (unwind-protect - (delay-mode-hooks (Man-mode)) - ;; Restore the status quo: - (fset 'Man-build-page-list Man-build-page-list) - (fset 'Man-strip-page-headers Man-strip-page-headers) - (fset 'Man-unindent Man-unindent) - (fset 'Man-goto-page Man-goto-page) - (setq tab-width woman-tab-width))) + (delay-mode-hooks (Man-mode))) + (setq tab-width woman-tab-width) (setq major-mode 'woman-mode mode-name "WoMan") ;; Don't show page numbers like Man-mode does. (Online documents do @@ -1892,7 +1884,7 @@ See `Man-mode' for additional details. (setq imenu-generic-expression woman-imenu-generic-expression) (setq-local imenu-space-replacement " ") ;; Bookmark support. - (setq-local bookmark-make-record-function 'woman-bookmark-make-record) + (setq-local bookmark-make-record-function #'woman-bookmark-make-record) ;; For reformat ... ;; necessary when reformatting a file in its old buffer: (setq imenu--last-menubar-index-alist nil) @@ -2431,6 +2423,10 @@ Preserves location of `point'." (defvar woman0-rename-alist) ; bound in woman0-roff-buffer +;; Bound locally by woman[012]-roff-buffer, and woman0-macro. +;; Use dynamically in woman-unquote and woman-forward-arg. +(defvar woman-request) + (defun woman0-roff-buffer (from) "Process conditional-type requests and user-defined macros. Start at FROM and re-scan new text as appropriate." @@ -2750,15 +2746,16 @@ Optional argument APPEND, if non-nil, means append macro." ;; request may be used dynamically (woman-interpolate-macro calls ;; woman-forward-arg). -(defun woman0-macro (woman-request) - "Process the macro call named WOMAN-REQUEST." +(defun woman0-macro (request) + "Process the macro call named REQUEST." ;; Leaves point at start of new text. - (let ((macro (assoc woman-request woman0-macro-alist))) + (let ((woman-request request) + (macro (assoc request woman0-macro-alist))) (if macro (woman-interpolate-macro (cdr macro)) ;; SHOULD DELETE THE UNINTERPRETED REQUEST!!!!! ;; Output this message once only per call (cf. strings)? - (WoMan-warn "Undefined macro %s not interpolated!" woman-request)))) + (WoMan-warn "Undefined macro %s not interpolated!" request)))) (defun woman-interpolate-macro (macro) "Interpolate (.de) or append (.am) expansion of MACRO into the buffer." @@ -2982,11 +2979,6 @@ Useful for constructing the alist variable `woman-special-characters'." ;;; Formatting macros that do not cause a break: -;; Bound locally by woman[012]-roff-buffer, and also, annoyingly and -;; confusingly, as a function argument. Use dynamically in -;; woman-unquote and woman-forward-arg. -(defvar woman-request) - (defun woman-unquote (to) "Delete any double-quote characters between point and TO. Leave point at TO (which should be a marker)." @@ -3067,7 +3059,7 @@ B-OR-I is the appropriate complete control line." ".SM -- Set the current line in small font, i.e. IGNORE!" nil) -(defalias 'woman1-SB 'woman1-B) +(defalias 'woman1-SB #'woman1-B) ;; .SB -- Set the current line in small bold font, i.e. just embolden! ;; (This is what /usr/local/share/groff/tmac/tmac.an does. The ;; Linux man.7 is wrong about this!) @@ -3197,27 +3189,27 @@ If optional arg CONCAT is non-nil then join arguments." ;;; Other non-breaking requests correctly ignored by nroff: (put 'woman1-ps 'notfont t) -(defalias 'woman1-ps 'woman-delete-whole-line) +(defalias 'woman1-ps #'woman-delete-whole-line) ;; .ps -- Point size -- IGNORE! (put 'woman1-ss 'notfont t) -(defalias 'woman1-ss 'woman-delete-whole-line) +(defalias 'woman1-ss #'woman-delete-whole-line) ;; .ss -- Space-character size -- IGNORE! (put 'woman1-cs 'notfont t) -(defalias 'woman1-cs 'woman-delete-whole-line) +(defalias 'woman1-cs #'woman-delete-whole-line) ;; .cs -- Constant character space (width) mode -- IGNORE! (put 'woman1-ne 'notfont t) -(defalias 'woman1-ne 'woman-delete-whole-line) +(defalias 'woman1-ne #'woman-delete-whole-line) ;; .ne -- Need vertical space -- IGNORE! (put 'woman1-vs 'notfont t) -(defalias 'woman1-vs 'woman-delete-whole-line) +(defalias 'woman1-vs #'woman-delete-whole-line) ;; .vs -- Vertical base line spacing -- IGNORE! (put 'woman1-bd 'notfont t) -(defalias 'woman1-bd 'woman-delete-whole-line) +(defalias 'woman1-bd #'woman-delete-whole-line) ;; .bd -- Embolden font -- IGNORE! ;;; Non-breaking SunOS-specific macros: @@ -3228,7 +3220,7 @@ If optional arg CONCAT is non-nil then join arguments." (woman-forward-arg 'unquote 'concat)) (put 'woman1-IX 'notfont t) -(defalias 'woman1-IX 'woman-delete-whole-line) +(defalias 'woman1-IX #'woman-delete-whole-line) ;; .IX -- Index macro, for Sun internal use -- IGNORE! @@ -3577,7 +3569,7 @@ expression in parentheses. Leaves point after the value." inc (cdr value) ;; eval internal (.X) registers ;; stored as lisp variable names: - value (eval (car value))) + value (eval (car value) t)) (if (and pm inc) ; auto-increment (setq value (funcall (intern-soft pm) value inc) @@ -3637,64 +3629,55 @@ expression in parentheses. Leaves point after the value." "Process breaks. Format paragraphs and headings." (let ((case-fold-search t) (to (make-marker)) - (canonically-space-region - (symbol-function 'canonically-space-region)) - (insert-and-inherit (symbol-function 'insert-and-inherit)) - (set-text-properties (symbol-function 'set-text-properties)) (woman-registers woman-registers) fn woman-request woman-translations tab-stop-list) (set-marker-insertion-type to t) ;; ?roff does not squeeze multiple spaces, but does fill, so... - (fset 'canonically-space-region 'ignore) - ;; Try to avoid spaces inheriting underlines from preceding text! - (fset 'insert-and-inherit (symbol-function 'insert)) - (fset 'set-text-properties 'ignore) - (unwind-protect - (progn - (while - ;; Find next control line: - (re-search-forward woman-request-regexp nil t) - (cond - ;; Construct woman function to call: - ((setq fn (intern-soft - (concat "woman2-" - (setq woman-request (match-string 1))))) - ;; Delete request or macro name: - (woman-delete-match 0)) - ;; Unrecognized request: - ((prog1 nil - ;; (WoMan-warn ".%s request ignored!" woman-request) - (WoMan-warn-ignored woman-request "ignored!") - ;; (setq fn 'woman2-LP) - ;; AVOID LEAVING A BLANK LINE! - ;; (setq fn 'woman2-format-paragraphs) - )) - ;; .LP assumes it is at eol and leaves a (blank) line, - ;; so leave point at end of line before paragraph: - ((or (looking-at "[ \t]*$") ; no argument - woman-ignore) ; ignore all - ;; (beginning-of-line) (kill-line) - ;; AVOID LEAVING A BLANK LINE! - (beginning-of-line) (woman-delete-line 1)) - (t (end-of-line) (insert ?\n))) - (if (not (or fn - (and (not (memq (following-char) '(?. ?'))) - (setq fn 'woman2-format-paragraphs)))) - () - ;; Find next control line: - (if (equal woman-request "TS") - (set-marker to (woman-find-next-control-line "TE")) - (set-marker to (woman-find-next-control-line))) - ;; Call the appropriate function: - (funcall fn to))) - (if (not (eobp)) ; This should not happen, but ... - (woman2-format-paragraphs (copy-marker (point-max) t) - woman-left-margin))) - (fset 'canonically-space-region canonically-space-region) - (fset 'set-text-properties set-text-properties) - (fset 'insert-and-inherit insert-and-inherit) - (set-marker to nil)))) + (cl-letf (((symbol-function 'canonically-space-region) #'ignore) + ;; Try to avoid spaces inheriting underlines from preceding text! + ((symbol-function 'insert-and-inherit) #'insert) + ((symbol-function 'set-text-properties) #'ignore)) + (while + ;; Find next control line: + (re-search-forward woman-request-regexp nil t) + (cond + ;; Construct woman function to call: + ((setq fn (intern-soft + (concat "woman2-" + (setq woman-request (match-string 1))))) + ;; Delete request or macro name: + (woman-delete-match 0)) + ;; Unrecognized request: + ((prog1 nil + ;; (WoMan-warn ".%s request ignored!" woman-request) + (WoMan-warn-ignored woman-request "ignored!") + ;; (setq fn 'woman2-LP) + ;; AVOID LEAVING A BLANK LINE! + ;; (setq fn 'woman2-format-paragraphs) + )) + ;; .LP assumes it is at eol and leaves a (blank) line, + ;; so leave point at end of line before paragraph: + ((or (looking-at "[ \t]*$") ; no argument + woman-ignore) ; ignore all + ;; (beginning-of-line) (kill-line) + ;; AVOID LEAVING A BLANK LINE! + (beginning-of-line) (woman-delete-line 1)) + (t (end-of-line) (insert ?\n))) + (if (not (or fn + (and (not (memq (following-char) '(?. ?'))) + (setq fn 'woman2-format-paragraphs)))) + () + ;; Find next control line: + (if (equal woman-request "TS") + (set-marker to (woman-find-next-control-line "TE")) + (set-marker to (woman-find-next-control-line))) + ;; Call the appropriate function: + (funcall fn to))) + (if (not (eobp)) ; This should not happen, but ... + (woman2-format-paragraphs (copy-marker (point-max) t) + woman-left-margin))) + (set-marker to nil))) (defun woman-find-next-control-line (&optional pat) "Find and return start of next control line. @@ -3805,8 +3788,8 @@ Leave 1 blank line. Format paragraphs upto TO." (setq woman-prevailing-indent woman-default-indent) (woman2-format-paragraphs to woman-left-margin)) -(defalias 'woman2-PP 'woman2-LP) -(defalias 'woman2-P 'woman2-LP) +(defalias 'woman2-PP #'woman2-LP) +(defalias 'woman2-P #'woman2-LP) (defun woman2-ns (to) ".ns -- Turn on no-space mode. Format paragraphs upto TO." @@ -4277,16 +4260,16 @@ Set prevailing indent to amount of starting .RS." If no argument then use value of optional arg PREVIOUS if non-nil, otherwise set PREVIOUS. Delete the whole remaining control line." (if (eolp) ; space already skipped - (set arg (if previous (eval previous) 0)) - (if previous (set previous (eval arg))) + (set arg (if previous (symbol-value previous) 0)) + (if previous (set previous (symbol-value arg))) (woman2-process-escapes-to-eol 'numeric) (let ((pm (if (looking-at "[+-]") (prog1 (following-char) (forward-char 1)))) (i (woman-parse-numeric-arg))) (cond ((null pm) (set arg i)) - ((= pm ?+) (set arg (+ (eval arg) i))) - ((= pm ?-) (set arg (- (eval arg) i))) + ((= pm ?+) (set arg (+ (symbol-value arg) i))) + ((= pm ?-) (set arg (- (symbol-value arg) i))) )) (beginning-of-line)) (woman-delete-line 1)) ; ignore any remaining arguments @@ -4483,7 +4466,7 @@ Format paragraphs upto TO." (setq woman-nofill t) (woman2-format-paragraphs to)) -(defalias 'woman2-TE 'woman2-fi) +(defalias 'woman2-TE #'woman2-fi) ;; ".TE -- End of table code for the tbl processor." ;; Turn filling and adjusting back on. commit b6552b1d7c5e6eb66b7b641efa3a0fe175fb7eba Author: Juri Linkov Date: Mon Mar 29 22:34:51 2021 +0300 * lisp/progmodes/project.el (project-regexp-history-variable): New variable. (project--read-regexp): Use it as HISTORY arg of 'read-regexp' with 'grep-regexp-history' default (bug#47012). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index f1546541d5..4101962f06 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -782,9 +782,12 @@ pattern to search for." (user-error "No matches for: %s" regexp)) xrefs)) +(defvar project-regexp-history-variable 'grep-regexp-history) + (defun project--read-regexp () (let ((sym (thing-at-point 'symbol t))) - (read-regexp "Find regexp" (and sym (regexp-quote sym))))) + (read-regexp "Find regexp" (and sym (regexp-quote sym)) + project-regexp-history-variable))) ;;;###autoload (defun project-find-file () commit fcc7373b28b41d6fb8d3767538bdb4b087ab0850 Author: Stefan Monnier Date: Mon Mar 29 15:29:26 2021 -0400 * lisp/allout*.el: Use lexical-binding * lisp/allout.el: Activate lexical-binding. (allout-setup-menubar): Delete "complex no-op" function. (allout-mode): Delete call to it. (allout-hotspot-key-handler): Delete XEmacs-only code. (allout-copy-exposed-to-buffer): Remove always-nil var `start-list`. * lisp/allout-widgets.el: Activate lexical-binding. (allout-item-icon-keymap): Use `ignore`. (allout-widgets-exposure-change-processor): Use `cl-callf` instead of relying on dynamic binding to apply some code to two different variables. diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index a642af2dae..931dfbc961 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -1,4 +1,4 @@ -;; allout-widgets.el --- Visually highlight allout outline structure. +;; allout-widgets.el --- Visually highlight allout outline structure. -*- lexical-binding: t; -*- ;; Copyright (C) 2005-2021 Free Software Foundation, Inc. @@ -72,11 +72,11 @@ (eval-when-compile (require 'cl-lib)) ;;;_ : internal variables needed before user-customization variables -;;; In order to enable activation of allout-widgets-mode via customization, -;;; allout-widgets-auto-activation uses a setting function. That function -;;; is invoked when the customization variable definition is evaluated, -;;; during file load, so the involved code must reside above that -;;; definition in the file. +;; In order to enable activation of allout-widgets-mode via customization, +;; allout-widgets-auto-activation uses a setting function. That function +;; is invoked when the customization variable definition is evaluated, +;; during file load, so the involved code must reside above that +;; definition in the file. ;;;_ = allout-widgets-mode (defvar-local allout-widgets-mode nil "Allout mode enhanced with graphical widgets.") @@ -100,8 +100,8 @@ with allout-mode." See `allout-widgets-mode-inhibit' for per-file/per-buffer inhibition of allout-widgets-mode." - (add-hook 'allout-mode-off-hook 'allout-widgets-mode-off) - (add-hook 'allout-mode-on-hook 'allout-widgets-mode-on) + (add-hook 'allout-mode-off-hook #'allout-widgets-mode-off) + (add-hook 'allout-mode-on-hook #'allout-widgets-mode-on) t) ;;;_ > allout-widgets-mode-disable (defun allout-widgets-mode-disable () @@ -109,8 +109,8 @@ inhibition of allout-widgets-mode." See `allout-widgets-mode-inhibit' for per-file/per-buffer inhibition of allout-widgets-mode." - (remove-hook 'allout-mode-off-hook 'allout-widgets-mode-off) - (remove-hook 'allout-mode-on-hook 'allout-widgets-mode-on) + (remove-hook 'allout-mode-off-hook #'allout-widgets-mode-off) + (remove-hook 'allout-mode-on-hook #'allout-widgets-mode-on) t) ;;;_ > allout-widgets-setup (varname value) ;;;###autoload @@ -141,7 +141,7 @@ See `allout-widgets-mode' for allout widgets mode features." :version "24.1" :type 'boolean :group 'allout-widgets - :set 'allout-widgets-setup + :set #'allout-widgets-setup ) ;; ;;;_ = allout-widgets-allow-unruly-edits ;; (defcustom allout-widgets-allow-unruly-edits nil @@ -307,7 +307,7 @@ In addition, you can invoked `allout-widgets-mode' allout-mode buffers where this is set to enable and disable widget enhancements, directly.") ;;;###autoload -(put 'allout-widgets-mode-inhibit 'safe-local-variable 'booleanp) +(put 'allout-widgets-mode-inhibit 'safe-local-variable #'booleanp) ;;;_ = allout-inhibit-body-modification-hook (defvar-local allout-inhibit-body-modification-hook nil "Override de-escaping of text-prefixes in item bodies during specific changes. @@ -402,14 +402,14 @@ not altered with an escape sequence.") (set-keymap-parent km as-parent) (dolist (digit '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")) - (define-key km digit 'digit-argument)) - (define-key km "-" 'negative-argument) + (define-key km digit #'digit-argument)) + (define-key km "-" #'negative-argument) ;; Override underlying mouse-1 and mouse-2 bindings in icon territory: - (define-key km [(mouse-1)] (lambda () (interactive) nil)) - (define-key km [(mouse-2)] (lambda () (interactive) nil)) + (define-key km [(mouse-1)] #'ignore) + (define-key km [(mouse-2)] #'ignore) ;; Catchall, handles actual keybindings, dynamically doing keymap lookups: - (define-key km [t] 'allout-item-icon-key-handler) + (define-key km [t] #'allout-item-icon-key-handler) km) "General tree-node key bindings.") @@ -535,7 +535,7 @@ outline hot-spot navigation (see `allout-mode')." "\\1\\3")) ) - (add-hook 'after-change-functions 'allout-widgets-after-change-handler + (add-hook 'after-change-functions #'allout-widgets-after-change-handler nil t) (allout-setup-text-properties) @@ -551,23 +551,23 @@ outline hot-spot navigation (see `allout-mode')." (set-keymap-parent allout-item-icon-keymap as-parent)) (add-hook 'allout-exposure-change-functions - 'allout-widgets-exposure-change-recorder nil 'local) + #'allout-widgets-exposure-change-recorder nil 'local) (add-hook 'allout-structure-added-functions - 'allout-widgets-additions-recorder nil 'local) + #'allout-widgets-additions-recorder nil 'local) (add-hook 'allout-structure-deleted-functions - 'allout-widgets-deletions-recorder nil 'local) + #'allout-widgets-deletions-recorder nil 'local) (add-hook 'allout-structure-shifted-functions - 'allout-widgets-shifts-recorder nil 'local) + #'allout-widgets-shifts-recorder nil 'local) (add-hook 'allout-after-copy-or-kill-hook - 'allout-widgets-after-copy-or-kill-function nil 'local) + #'allout-widgets-after-copy-or-kill-function nil 'local) (add-hook 'allout-post-undo-hook - 'allout-widgets-after-undo-function nil 'local) + #'allout-widgets-after-undo-function nil 'local) - (add-hook 'before-change-functions 'allout-widgets-before-change-handler + (add-hook 'before-change-functions + #'allout-widgets-before-change-handler nil 'local) + (add-hook 'post-command-hook #'allout-widgets-post-command-business nil 'local) - (add-hook 'post-command-hook 'allout-widgets-post-command-business - nil 'local) - (add-hook 'pre-command-hook 'allout-widgets-pre-command-business + (add-hook 'pre-command-hook #'allout-widgets-pre-command-business nil 'local) ;; init the widgets tally for debugging: @@ -596,23 +596,23 @@ outline hot-spot navigation (see `allout-mode')." (remove-from-invisibility-spec 'allout-escapes) (remove-hook 'after-change-functions - 'allout-widgets-after-change-handler 'local) + #'allout-widgets-after-change-handler 'local) (remove-hook 'allout-exposure-change-functions - 'allout-widgets-exposure-change-recorder 'local) + #'allout-widgets-exposure-change-recorder 'local) (remove-hook 'allout-structure-added-functions - 'allout-widgets-additions-recorder 'local) + #'allout-widgets-additions-recorder 'local) (remove-hook 'allout-structure-deleted-functions - 'allout-widgets-deletions-recorder 'local) + #'allout-widgets-deletions-recorder 'local) (remove-hook 'allout-structure-shifted-functions - 'allout-widgets-shifts-recorder 'local) + #'allout-widgets-shifts-recorder 'local) (remove-hook 'allout-after-copy-or-kill-hook - 'allout-widgets-after-copy-or-kill-function 'local) + #'allout-widgets-after-copy-or-kill-function 'local) (remove-hook 'before-change-functions - 'allout-widgets-before-change-handler 'local) + #'allout-widgets-before-change-handler 'local) (remove-hook 'post-command-hook - 'allout-widgets-post-command-business 'local) + #'allout-widgets-post-command-business 'local) (remove-hook 'pre-command-hook - 'allout-widgets-pre-command-business 'local) + #'allout-widgets-pre-command-business 'local) (assq-delete-all 'allout-widgets-mode-inhibit minor-mode-alist) (set-buffer-modified-p was-modified)))) ;;;_ > allout-widgets-mode-off @@ -710,7 +710,7 @@ Optional RECURSING is for internal use, to limit recursion." (when allout-widgets-reenable-before-change-handler (add-hook 'before-change-functions - 'allout-widgets-before-change-handler + #'allout-widgets-before-change-handler nil 'local) (setq allout-widgets-reenable-before-change-handler nil)) @@ -879,7 +879,7 @@ encompassing condition-case." (message header) (sit-for allout-widgets-hook-error-post-time) ;; reraise the error, or one concerning this function if unexpected: (if (equal mode 'error) - (apply 'signal args) + (apply #'signal args) (error "%s: unexpected mode, %s %s" this mode args)))) ;;;_ > allout-widgets-changes-exceed-threshold-p () (defun allout-widgets-adjusting-message (message) @@ -973,9 +973,8 @@ Generally invoked via `allout-exposure-change-functions'." deactivate-mark) (dolist (change changes) - (let (handling - (from (cadr change)) - bucket got + (let ((from (cadr change)) + bucket (to (caddr change)) (flag (cadddr change)) parent) @@ -986,10 +985,11 @@ Generally invoked via `allout-exposure-change-functions'." from bucket)) ;; have we already handled exposure changes in this region? - (setq handling (if flag 'handled-conceal 'handled-expose) - got (allout-range-overlaps from to (symbol-value handling)) - covered (car got)) - (set handling (cadr got)) + (cl-callf (lambda (x) + (let ((got (allout-range-overlaps from to x))) + (setq covered (car got)) + (cadr got))) + (if flag handled-conceal handled-expose)) (when (not covered) (save-excursion @@ -1825,7 +1825,7 @@ reapplying this method will rectify the glyphs." (if (> increment 1) (setq increment 1)) (when extenders ;; paint extenders after a connector, else leave spaces. - (dotimes (i extenders) + (dotimes (_ extenders) (put-text-property position (setq position (1+ position)) 'display (allout-fetch-icon-image diff --git a/lisp/allout.el b/lisp/allout.el index 1876235753..f50f5fd4b2 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1,6 +1,6 @@ -;;; allout.el --- extensive outline mode for use alone and with other modes +;;; allout.el --- extensive outline mode for use alone and with other modes -*- lexical-binding: t; -*- -;; Copyright (C) 1992-1994, 2001-2021 Free Software Foundation, Inc. +;; Copyright (C) 1992-2021 Free Software Foundation, Inc. ;; Author: Ken Manheimer ;; Created: Dec 1991 -- first release to usenet @@ -133,13 +133,14 @@ respective allout-mode keybinding variables, `allout-command-prefix', (when (boundp 'allout-unprefixed-keybindings) (dolist (entry allout-unprefixed-keybindings) (define-key map (car (read-from-string (car entry))) (cadr entry)))) - (substitute-key-definition 'beginning-of-line 'allout-beginning-of-line + (substitute-key-definition #'beginning-of-line #'allout-beginning-of-line map global-map) - (substitute-key-definition 'move-beginning-of-line 'allout-beginning-of-line + (substitute-key-definition #'move-beginning-of-line + #'allout-beginning-of-line map global-map) - (substitute-key-definition 'end-of-line 'allout-end-of-line + (substitute-key-definition #'end-of-line #'allout-end-of-line map global-map) - (substitute-key-definition 'move-end-of-line 'allout-end-of-line + (substitute-key-definition #'move-end-of-line #'allout-end-of-line map global-map) (allout-institute-keymap map))) ;;;_ > allout-institute-keymap (map) @@ -169,7 +170,7 @@ Default is `\C-c'; just `\C-c' is more short-and-sweet, if you're willing to let allout use a bunch of \C-c keybindings." :type 'string :group 'allout-keybindings - :set 'allout-compose-and-institute-keymap) + :set #'allout-compose-and-institute-keymap) ;;;_ = allout-keybindings-binding (define-widget 'allout-keybindings-binding 'lazy "Structure of allout keybindings customization items." @@ -230,7 +231,7 @@ prevails." :version "24.1" :type 'allout-keybindings-binding :group 'allout-keybindings - :set 'allout-compose-and-institute-keymap + :set #'allout-compose-and-institute-keymap ) ;;;_ = allout-unprefixed-keybindings (defcustom allout-unprefixed-keybindings @@ -254,7 +255,7 @@ See the existing keys for examples." :version "24.1" :type 'allout-keybindings-binding :group 'allout-keybindings - :set 'allout-compose-and-institute-keymap + :set #'allout-compose-and-institute-keymap ) ;;;_ > allout-auto-activation-helper (var value) @@ -276,8 +277,8 @@ Establishes allout processing as part of visiting a file if The proper way to use this is through customizing the setting of `allout-auto-activation'." (if (not allout-auto-activation) - (remove-hook 'find-file-hook 'allout-find-file-hook) - (add-hook 'find-file-hook 'allout-find-file-hook))) + (remove-hook 'find-file-hook #'allout-find-file-hook) + (add-hook 'find-file-hook #'allout-find-file-hook))) ;;;_ = allout-auto-activation ;;;###autoload (defcustom allout-auto-activation nil @@ -298,7 +299,7 @@ With value \"activate\", only auto-mode-activation is enabled. Auto-layout is not. With value nil, inhibit any automatic allout-mode activation." - :set 'allout-auto-activation-helper + :set #'allout-auto-activation-helper ;; FIXME: Using strings here is unusual and less efficient than symbols. :type '(choice (const :tag "On" t) (const :tag "Ask about layout" "ask") @@ -405,7 +406,7 @@ where auto-fill occurs." :group 'allout) (make-variable-buffer-local 'allout-use-hanging-indents) ;;;###autoload -(put 'allout-use-hanging-indents 'safe-local-variable 'booleanp) +(put 'allout-use-hanging-indents 'safe-local-variable #'booleanp) ;;;_ = allout-reindent-bodies (defcustom allout-reindent-bodies (if allout-use-hanging-indents 'text) @@ -434,7 +435,7 @@ just the header." :group 'allout) (make-variable-buffer-local 'allout-show-bodies) ;;;###autoload -(put 'allout-show-bodies 'safe-local-variable 'booleanp) +(put 'allout-show-bodies 'safe-local-variable #'booleanp) ;;;_ = allout-beginning-of-line-cycles (defcustom allout-beginning-of-line-cycles t @@ -507,7 +508,7 @@ character, which is typically set to the `allout-primary-bullet'." :group 'allout) (make-variable-buffer-local 'allout-header-prefix) ;;;###autoload -(put 'allout-header-prefix 'safe-local-variable 'stringp) +(put 'allout-header-prefix 'safe-local-variable #'stringp) ;;;_ = allout-primary-bullet (defcustom allout-primary-bullet "*" "Bullet used for top-level outline topics. @@ -524,7 +525,7 @@ bullets." :group 'allout) (make-variable-buffer-local 'allout-primary-bullet) ;;;###autoload -(put 'allout-primary-bullet 'safe-local-variable 'stringp) +(put 'allout-primary-bullet 'safe-local-variable #'stringp) ;;;_ = allout-plain-bullets-string (defcustom allout-plain-bullets-string ".," "The bullets normally used in outline topic prefixes. @@ -540,7 +541,7 @@ of this var to take effect." :group 'allout) (make-variable-buffer-local 'allout-plain-bullets-string) ;;;###autoload -(put 'allout-plain-bullets-string 'safe-local-variable 'stringp) +(put 'allout-plain-bullets-string 'safe-local-variable #'stringp) ;;;_ = allout-distinctive-bullets-string (defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^" "Persistent outline header bullets used to distinguish special topics. @@ -588,7 +589,7 @@ strings." :group 'allout) (make-variable-buffer-local 'allout-distinctive-bullets-string) ;;;###autoload -(put 'allout-distinctive-bullets-string 'safe-local-variable 'stringp) +(put 'allout-distinctive-bullets-string 'safe-local-variable #'stringp) ;;;_ = allout-use-mode-specific-leader (defcustom allout-use-mode-specific-leader t @@ -655,7 +656,7 @@ are always respected by the topic maneuvering functions." :group 'allout) (make-variable-buffer-local 'allout-old-style-prefixes) ;;;###autoload -(put 'allout-old-style-prefixes 'safe-local-variable 'booleanp) +(put 'allout-old-style-prefixes 'safe-local-variable #'booleanp) ;;;_ = allout-stylish-prefixes -- alternating bullets (defcustom allout-stylish-prefixes t "Do fancy stuff with topic prefix bullets according to level, etc. @@ -703,7 +704,7 @@ is non-nil." :group 'allout) (make-variable-buffer-local 'allout-stylish-prefixes) ;;;###autoload -(put 'allout-stylish-prefixes 'safe-local-variable 'booleanp) +(put 'allout-stylish-prefixes 'safe-local-variable #'booleanp) ;;;_ = allout-numbered-bullet (defcustom allout-numbered-bullet "#" @@ -717,7 +718,7 @@ disables numbering maintenance." :group 'allout) (make-variable-buffer-local 'allout-numbered-bullet) ;;;###autoload -(put 'allout-numbered-bullet 'safe-local-variable 'string-or-null-p) +(put 'allout-numbered-bullet 'safe-local-variable #'string-or-null-p) ;;;_ = allout-file-xref-bullet (defcustom allout-file-xref-bullet "@" "Bullet signifying file cross-references, for `allout-resolve-xref'. @@ -726,7 +727,7 @@ Set this var to the bullet you want to use for file cross-references." :type '(choice (const nil) string) :group 'allout) ;;;###autoload -(put 'allout-file-xref-bullet 'safe-local-variable 'string-or-null-p) +(put 'allout-file-xref-bullet 'safe-local-variable #'string-or-null-p) ;;;_ = allout-presentation-padding (defcustom allout-presentation-padding 2 "Presentation-format white-space padding factor, for greater indent." @@ -735,7 +736,7 @@ Set this var to the bullet you want to use for file cross-references." (make-variable-buffer-local 'allout-presentation-padding) ;;;###autoload -(put 'allout-presentation-padding 'safe-local-variable 'integerp) +(put 'allout-presentation-padding 'safe-local-variable #'integerp) ;;;_ = allout-flattened-numbering-abbreviation (define-obsolete-variable-alias 'allout-abbreviate-flattened-numbering @@ -1056,7 +1057,7 @@ invoking it directly." (setq allout-primary-bullet leader)) allout-header-prefix))) (defalias 'allout-infer-header-lead - 'allout-infer-header-lead-and-primary-bullet) + #'allout-infer-header-lead-and-primary-bullet) ;;;_ > allout-infer-body-reindent () (defun allout-infer-body-reindent () "Determine proper setting for `allout-reindent-bodies'. @@ -1196,7 +1197,7 @@ Also refresh various data structures that hinge on the regexp." "[^" allout-primary-bullet "]")) "\\)" )))) -(define-obsolete-function-alias 'set-allout-regexp 'allout-set-regexp "26.1") +(define-obsolete-function-alias 'set-allout-regexp #'allout-set-regexp "26.1") ;;;_ : Menu bar (defvar allout-mode-exposure-menu) (defvar allout-mode-editing-menu) @@ -1589,17 +1590,6 @@ non-nil in a lasting way.") (defvar-local allout-explicitly-deactivated nil "If t, `allout-mode's last deactivation was deliberate. So `allout-post-command-business' should not reactivate it...") -;;;_ > allout-setup-menubar () -(defun allout-setup-menubar () - "Populate the current buffer's menubar with `allout-mode' stuff." - (let ((menus (list allout-mode-exposure-menu - allout-mode-editing-menu - allout-mode-navigation-menu - allout-mode-misc-menu)) - cur) - (while menus - (setq cur (car menus) - menus (cdr menus))))) ;;;_ > allout-overlay-preparations (defun allout-overlay-preparations () "Set the properties of the allout invisible-text overlay and others." @@ -1613,7 +1603,7 @@ So `allout-post-command-business' should not reactivate it...") ;; property controls the isearch _arrival_ behavior. This is the case at ;; least in emacs 21, 22.1, and xemacs 21.4. (put 'allout-exposure-category 'isearch-open-invisible - 'allout-isearch-end-handler) + #'allout-isearch-end-handler) (put 'allout-exposure-category 'insert-in-front-hooks '(allout-overlay-insert-in-front-handler)) (put 'allout-exposure-category 'modification-hooks @@ -1903,12 +1893,12 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be." (allout-do-resumptions) (remove-from-invisibility-spec '(allout . t)) - (remove-hook 'pre-command-hook 'allout-pre-command-business t) - (remove-hook 'post-command-hook 'allout-post-command-business t) - (remove-hook 'before-change-functions 'allout-before-change-handler t) - (remove-hook 'isearch-mode-end-hook 'allout-isearch-end-handler t) + (remove-hook 'pre-command-hook #'allout-pre-command-business t) + (remove-hook 'post-command-hook #'allout-post-command-business t) + (remove-hook 'before-change-functions #'allout-before-change-handler t) + (remove-hook 'isearch-mode-end-hook #'allout-isearch-end-handler t) (remove-hook 'write-contents-functions - 'allout-write-contents-hook-handler t) + #'allout-write-contents-hook-handler t) (remove-overlays (point-min) (point-max) 'category 'allout-exposure-category)) @@ -1937,11 +1927,11 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be." (add-to-invisibility-spec '(allout . t)) (allout-add-resumptions '(line-move-ignore-invisible t)) - (add-hook 'pre-command-hook 'allout-pre-command-business nil t) - (add-hook 'post-command-hook 'allout-post-command-business nil t) - (add-hook 'before-change-functions 'allout-before-change-handler nil t) - (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler nil t) - (add-hook 'write-contents-functions 'allout-write-contents-hook-handler + (add-hook 'pre-command-hook #'allout-pre-command-business nil t) + (add-hook 'post-command-hook #'allout-post-command-business nil t) + (add-hook 'before-change-functions #'allout-before-change-handler nil t) + (add-hook 'isearch-mode-end-hook #'allout-isearch-end-handler nil t) + (add-hook 'write-contents-functions #'allout-write-contents-hook-handler nil t) ;; Stash auto-fill settings and adjust so custom allout auto-fill @@ -1966,8 +1956,6 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be." ;; allout-auto-fill will use the stashed values and so forth. (allout-add-resumptions '(auto-fill-function allout-auto-fill))) - (allout-setup-menubar) - ;; Do auto layout if warranted: (when (and allout-layout allout-auto-activation @@ -1987,7 +1975,7 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be." (allout-this-or-next-heading) (condition-case err (progn - (apply 'allout-expose-topic (list use-layout)) + (apply #'allout-expose-topic (list use-layout)) (message "Adjusting `%s' exposure... done." (buffer-name))) ;; Problem applying exposure -- notify user, but don't @@ -1999,7 +1987,7 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be." ) ; let (()) ) ; define-minor-mode ;;;_ > allout-minor-mode alias -(defalias 'allout-minor-mode 'allout-mode) +(defalias 'allout-minor-mode #'allout-mode) ;;;_ > allout-unload-function (defun allout-unload-function () "Unload the allout outline library." @@ -2068,7 +2056,7 @@ internal functions use this feature cohesively bunch changes." (error "Concealed-text change abandoned, text reconcealed")))) (goto-char start)))) ;;;_ > allout-before-change-handler (beg end) -(defun allout-before-change-handler (beg end) +(defun allout-before-change-handler (_beg _end) "Protect against changes to invisible text. See `allout-overlay-interior-modification-handler' for details." @@ -2232,7 +2220,7 @@ Actually, returns prefix beginning point." (or (not (allout-do-doublecheck)) (not (allout-aberrant-container-p))))))) ;;;_ > allout-on-heading-p () -(defalias 'allout-on-heading-p 'allout-on-current-heading-p) +(defalias 'allout-on-heading-p #'allout-on-current-heading-p) ;;;_ > allout-e-o-prefix-p () (defun allout-e-o-prefix-p () "True if point is located where current topic prefix ends, heading begins." @@ -2768,7 +2756,7 @@ of (before any) topics, in which case we return nil." (goto-char (point-min)) nil)))) ;;;_ > allout-back-to-heading () -(defalias 'allout-back-to-heading 'allout-back-to-current-heading) +(defalias 'allout-back-to-heading #'allout-back-to-current-heading) ;;;_ > allout-pre-next-prefix () (defun allout-pre-next-prefix () "Skip forward to just before the next heading line. @@ -2850,7 +2838,7 @@ collapsed." (allout-beginning-of-current-entry) (search-forward "\n" nil t) (forward-char -1)) -(defalias 'allout-end-of-heading 'allout-end-of-current-heading) +(defalias 'allout-end-of-heading #'allout-end-of-current-heading) ;;;_ > allout-get-body-text () (defun allout-get-body-text () "Return the unmangled body text of the topic immediately containing point." @@ -3289,10 +3277,6 @@ Returns the qualifying command, if any, else nil." (interactive) (let* ((modified (event-modifiers last-command-event)) (key-num (cond ((numberp last-command-event) last-command-event) - ;; for XEmacs character type: - ((and (fboundp 'characterp) - (apply 'characterp (list last-command-event))) - (apply 'char-to-int (list last-command-event))) (t 0))) mapped-binding) @@ -5137,7 +5121,7 @@ Optional FOLLOWERS arguments dictate exposure for succeeding siblings." (if (and spec (allout-descend-to-depth new-depth) (not (allout-hidden-p))) - (progn (setq got (apply 'allout-old-expose-topic spec)) + (progn (setq got (apply #'allout-old-expose-topic spec)) (if (and got (or (not max-pos) (> got max-pos))) (setq max-pos got))))))) (while (and followers @@ -5215,7 +5199,7 @@ Optional arg CONTEXT indicates interior levels to include." (setq flat-index (cdr flat-index))) ;; Dispose of single extra delim: (setq result (cdr result)))) - (apply 'concat result))) + (apply #'concat result))) ;;;_ > allout-stringify-flat-index-plain (flat-index) (defun allout-stringify-flat-index-plain (flat-index) "Convert list representing section/subsection/... to document string." @@ -5226,7 +5210,7 @@ Optional arg CONTEXT indicates interior levels to include." (if result (cons delim result)))) (setq flat-index (cdr flat-index))) - (apply 'concat result))) + (apply #'concat result))) ;;;_ > allout-stringify-flat-index-indented (flat-index) (defun allout-stringify-flat-index-indented (flat-index) "Convert list representing section/subsection/... to document string." @@ -5255,7 +5239,7 @@ Optional arg CONTEXT indicates interior levels to include." (setq flat-index (cdr flat-index))) ;; Dispose of single extra delim: (setq result (cdr result)))) - (apply 'concat result))) + (apply #'concat result))) ;;;_ > allout-listify-exposed (&optional start end format) (defun allout-listify-exposed (&optional start end format) @@ -5381,7 +5365,7 @@ header and body. The elements of that list are: ;; Put the list with first at front, to last at back: (nreverse result)))) -(define-obsolete-function-alias 'allout-region-active-p 'region-active-p "28.1") +(define-obsolete-function-alias 'allout-region-active-p #'region-active-p "28.1") ;;_ > allout-process-exposed (&optional func from to frombuf ;;; tobuf format) @@ -5498,7 +5482,7 @@ alternate presentation format for the outline: (beg (if arg (allout-back-to-current-heading) (point-min))) (end (if arg (allout-end-of-current-subtree) (point-max))) (buf (current-buffer)) - (start-list ())) + ) ;; (start-list ()) (if (eq format 'flat) (setq format (if arg (save-excursion (goto-char beg) @@ -5510,7 +5494,7 @@ alternate presentation format for the outline: end (current-buffer) tobuf - format start-list) + format nil) ;; start-list (goto-char (point-min)) (pop-to-buffer buf) (goto-char start-pt))) @@ -5622,11 +5606,12 @@ environment. Leaves point at the end of the line." (begindoc "\\begin{document}\n\\begin{center}\n") (title (format "%s%s%s%s" "\\titlecmd{" - (allout-latex-verb-quote (if allout-title - (condition-case nil - (eval allout-title) - (error "")) - "Unnamed Outline")) + (allout-latex-verb-quote + (if allout-title + (condition-case nil + (eval allout-title t) + (error "")) + "Unnamed Outline")) "}\n" "\\end{center}\n\n")) (hsize "\\hsize = 7.5 true in\n") @@ -6219,7 +6204,7 @@ save. See `allout-encrypt-unencrypted-on-saves' for more info." ;;;_ > outlineify-sticky () ;; outlinify-sticky is correct spelling; provide this alias for sticklers: ;;;###autoload -(defalias 'outlinify-sticky 'outlineify-sticky) +(defalias 'outlinify-sticky #'outlineify-sticky) ;;;###autoload (defun outlineify-sticky (&optional _arg) "Activate outline mode and establish file var so it is started subsequently. @@ -6441,7 +6426,7 @@ If BEG is bigger than END we return 0." ;;;_ > allout-format-quote (string) (defun allout-format-quote (string) "Return a copy of string with all \"%\" characters doubled." - (apply 'concat + (apply #'concat (mapcar (lambda (char) (if (= char ?%) "%%" (char-to-string char))) string))) (define-obsolete-function-alias 'allout-flatten #'flatten-tree "27.1") commit 1440dbed544a76ee3b876cb573b5110211e798bb Author: Alan Mackenzie Date: Mon Mar 29 15:32:40 2021 +0000 Fix an infinite loop in C++ Mode redisplay. This was bug #47191. * lisp/progmodes/cc-defs.el (c-forward-syntactic-ws, c-backward-syntactic-ws): When point is on the wrong side of a supplied search limit, leave point unmoved rather than setting it to that limit. * lisp/progmodes/cc-engine.el (c-forward-name): After scanning a template argument list (which is not itself subject to a search limit) recalculate the search limit starting from the end point, since these argument lists can legitimately be long. At each of the scanning loops, check point hasn't gone past the limit. diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 38fe23b0ea..536e676626 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -691,14 +691,16 @@ whitespace. LIMIT sets an upper limit of the forward movement, if specified. If LIMIT or the end of the buffer is reached inside a comment or -preprocessor directive, the point will be left there. +preprocessor directive, the point will be left there. If point starts +on the wrong side of LIMIT, it stays unchanged. Note that this function might do hidden buffer changes. See the comment at the start of cc-engine.el for more info." (if limit - `(save-restriction - (narrow-to-region (point-min) (or ,limit (point-max))) - (c-forward-sws)) + `(when (< (point) (or ,limit (point-max))) + (save-restriction + (narrow-to-region (point-min) (or ,limit (point-max))) + (c-forward-sws))) '(c-forward-sws))) (defmacro c-backward-syntactic-ws (&optional limit) @@ -710,14 +712,16 @@ whitespace. LIMIT sets a lower limit of the backward movement, if specified. If LIMIT is reached inside a line comment or preprocessor directive then -the point is moved into it past the whitespace at the end. +the point is moved into it past the whitespace at the end. If point +starts on the wrong side of LIMIT, it stays unchanged. Note that this function might do hidden buffer changes. See the comment at the start of cc-engine.el for more info." (if limit - `(save-restriction - (narrow-to-region (or ,limit (point-min)) (point-max)) - (c-backward-sws)) + `(when (> (point) (or ,limit (point-min))) + (save-restriction + (narrow-to-region (or ,limit (point-min)) (point-max)) + (c-backward-sws))) '(c-backward-sws))) (defmacro c-forward-sexp (&optional count) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index b7ad02cf0c..cc9833a434 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -8300,7 +8300,7 @@ comment at the start of cc-engine.el for more info." ;; o - nil if no name is found; ;; o - 'template if it's an identifier ending with an angle bracket ;; arglist; - ;; o - 'operator of it's an operator identifier; + ;; o - 'operator if it's an operator identifier; ;; o - t if it's some other kind of name. ;; ;; This function records identifier ranges on @@ -8320,6 +8320,7 @@ comment at the start of cc-engine.el for more info." (lim+ (c-determine-+ve-limit 500))) (while (and + (< (point) lim+) (looking-at c-identifier-key) (progn @@ -8369,23 +8370,28 @@ comment at the start of cc-engine.el for more info." ;; '*', '&' or a name followed by ":: *", ;; where each can be followed by a sequence ;; of `c-opt-type-modifier-key'. - (while (cond ((looking-at "[*&]") - (goto-char (match-end 0)) - t) - ((looking-at c-identifier-start) - (and (c-forward-name) - (looking-at "::") - (progn - (goto-char (match-end 0)) - (c-forward-syntactic-ws lim+) - (eq (char-after) ?*)) - (progn - (forward-char) - t)))) + (while + (and + (< (point) lim+) + (cond ((looking-at "[*&]") + (goto-char (match-end 0)) + t) + ((looking-at c-identifier-start) + (and (c-forward-name) + (looking-at "::") + (progn + (goto-char (match-end 0)) + (c-forward-syntactic-ws lim+) + (eq (char-after) ?*)) + (progn + (forward-char) + t))))) (while (progn (c-forward-syntactic-ws lim+) (setq pos (point)) - (looking-at c-opt-type-modifier-key)) + (and + (<= (point) lim+) + (looking-at c-opt-type-modifier-key))) (goto-char (match-end 1)))))) ((looking-at c-overloadable-operators-regexp) @@ -8431,6 +8437,9 @@ comment at the start of cc-engine.el for more info." ;; Maybe an angle bracket arglist. (when (let (c-last-identifier-range) (c-forward-<>-arglist nil)) + ;; <> arglists can legitimately be very long, so recalculate + ;; `lim+'. + (setq lim+ (c-determine-+ve-limit 500)) (c-forward-syntactic-ws lim+) (unless (eq (char-after) ?\() commit 309635af6949ca07da8f6bf8b8e25a1679f7f418 Merge: c0bf73ee39 8a92030f6a Author: Glenn Morris Date: Mon Mar 29 08:31:15 2021 -0700 Merge from origin/emacs-27 8a92030f6a (origin/emacs-27) Fix hang in autorevert-tests.el # Conflicts: # test/lisp/autorevert-tests.el commit c0bf73ee394d4895041246b5b158f7e0de39d6f4 Merge: 7ebd79f3c6 91eea74229 Author: Glenn Morris Date: Mon Mar 29 08:26:25 2021 -0700 ; Merge from origin/emacs-27 The following commits were skipped: 91eea74229 Revert "Clarify dired-do-shell-command doc string" b23e22e0de Clarify dired-do-shell-command doc string commit 7ebd79f3c618773852ed09f4c121dd717368c23a Merge: 31153cb509 bcc4cc3362 Author: Glenn Morris Date: Mon Mar 29 08:26:25 2021 -0700 Merge from origin/emacs-27 bcc4cc3362 Doc fixes for 'face-foreground' and 'face-background'. bf6442fafd ; * admin/make-tarball.txt: Minor addition to the Web page... 38b127d32e * admin/admin.el (set-version): Handle malformed NEWS markup. 0d7e2a993e admin.el fix for bug#47394 fdec444758 ; * etc/NEWS: Fix typo. 1e6ca2765f ; * admin/make-tarball.txt: Another minor addition. # Conflicts: # etc/NEWS commit 31153cb50938fb15030efd6af5b3a888f317224e Merge: 5805697d3b 3e9047115e Author: Glenn Morris Date: Mon Mar 29 08:26:25 2021 -0700 ; Merge from origin/emacs-27 The following commit was skipped: 3e9047115e Bump Emacs version past 27.2 commit 5805697d3b6c223633f167660b13bf48440f2cc5 Author: Michael Albinus Date: Mon Mar 29 16:51:50 2021 +0200 ; Fix schedule in admin/notes/emba diff --git a/admin/notes/emba b/admin/notes/emba index 05d8eb8353..36b126e773 100644 --- a/admin/notes/emba +++ b/admin/notes/emba @@ -44,7 +44,7 @@ corresponding 'test-*' jobs run the ert tests. A special job is 'test-all-inotify', which runs 'make check-expensive'. While most of the jobs run as soon as a respective file has been committed into the Emacs git repository, this test job runs scheduled, -every 6 hours. +every 8 hours. The log files for every test job are kept on the server for a week. They can be downloaded from the server, visiting the URL commit f113d0c4fdb100ce72ce88b5c8affe497037a5fa Author: Michael Albinus Date: Mon Mar 29 13:52:01 2021 +0200 Some Tramp doc clarifications * doc/misc/tramp.texi (Remote shell setup): Explain meaning of `tramp-sh-extra-args' for bash. (Frequently Asked Questions): New item about unloading / reloading Tramp. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 7ae562244e..5ea0275baf 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2305,6 +2305,8 @@ which support this. This approach has also the advantage, that settings in @code{tramp-sh-extra-args} will be applied. For @command{zsh}, the trouble with the shell prompt due to set zle options will be avoided. +For @command{bash}, loading @file{~/.editrc} or @file{~/.inputrc} is +suppressed. Similar problems can happen with the local shell Tramp uses to create a process. By default, it uses the command @command{/bin/sh} for @@ -5076,6 +5078,24 @@ In case you have installed it from its Git repository, @ref{Recompilation}. @end ifset +@item +I get an error @samp{tramp-file-name-handler: Invalid function: +tramp-compat-with-mutex} + +Likely, you have a running Emacs session with loaded @value{tramp}, +and you try to upgrade it to another version from GNU ELPA. Since +@value{tramp} is not forward compatible, you must unload / reload it. +Try the following steps: + +@example +@kbd{M-x tramp-unload-tramp @key{RET}} +@kbd{M-x load-library @key{RET} tramp @key{RET}} +@end example + +If this doesn't work, you must restart Emacs with proper +@code{load-path} for the new @value{tramp} version. + + @item I get an error @samp{Remote file error: Forbidden reentrant call of Tramp} commit a1e454d6df011f2a02d3b4900dd33d1d3717c6ef Author: Eli Zaretskii Date: Mon Mar 29 13:39:43 2021 +0300 Protect add-variable-watcher from incorrect usage * src/data.c (Fadd_variable_watcher): Avoid crashes if SYMBOL isn't. (Bug#47462) diff --git a/src/data.c b/src/data.c index 0fa491b17a..3667b03c0e 100644 --- a/src/data.c +++ b/src/data.c @@ -1589,6 +1589,7 @@ All writes to aliases of SYMBOL will call WATCH-FUNCTION too. */) (Lisp_Object symbol, Lisp_Object watch_function) { symbol = Findirect_variable (symbol); + CHECK_SYMBOL (symbol); set_symbol_trapped_write (symbol, SYMBOL_TRAPPED_WRITE); map_obarray (Vobarray, harmonize_variable_watchers, symbol); commit afc214f139688b0b89bbb887405e247045fd891f Author: Michael Albinus Date: Mon Mar 29 12:12:33 2021 +0200 ; Fix last change diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 17dda1a91b..6355513cc9 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -144,11 +144,11 @@ default: rules: - if: '$CI_JOB_STAGE =~ "fast|normal" && $CI_PIPELINE_SOURCE == "schedule"' when: never + - when: always artifacts: name: ${test_name} public: true expire_in: 1 week - when: always paths: - "${test_name}/**/*.log" commit e1177f0258c44b6a810ed3a8bcd7074018eeb0c3 Author: Michael Albinus Date: Mon Mar 29 11:33:36 2021 +0200 Optimize test jobs for emba * test/infra/gitlab-ci.yml (.test-template): Do not run fast and normal test jobs when scheduled. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 25231f5504..17dda1a91b 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -140,6 +140,10 @@ default: - docker push ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} .test-template: + # Do not run fast and normal test jobs when scheduled + rules: + - if: '$CI_JOB_STAGE =~ "fast|normal" && $CI_PIPELINE_SOURCE == "schedule"' + when: never artifacts: name: ${test_name} public: true commit 67ef8c36bde32a8bf33b118aa38f8339b0183c46 Author: Stefan Kangas Date: Mon Mar 29 11:30:53 2021 +0200 Doc fixes in follow.el * lisp/follow.el: (follow-pos-visible-in-window-p, follow-adjust-window) (follow-prev-buffer, follow-internal-force-redisplay): Minor doc fixes. diff --git a/lisp/follow.el b/lisp/follow.el index 42e3b60ec4..56f06b11d3 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -25,7 +25,7 @@ ;;; Commentary: -;; `Follow mode' is a minor mode that combines windows into one tall +;; `follow-mode' is a minor mode that combines windows into one tall ;; virtual window. ;; ;; The feeling of a "virtual window" has been accomplished by the use @@ -81,7 +81,7 @@ ;; text. Enter long lines spanning several lines, or several ;; windows. ;; -;; * Should you find `Follow' mode annoying, just type +;; * Should you find Follow mode annoying, just type ;; M-x follow-mode ;; to turn it off. @@ -93,25 +93,24 @@ ;; key map. To do so, add the following lines (replacing `[f7]' and ;; `[f8]' with your favorite keys) to the init file: ;; -;; (global-set-key [f8] 'follow-mode) -;; (global-set-key [f7] 'follow-delete-other-windows-and-split) +;; (global-set-key [f8] #'follow-mode) +;; (global-set-key [f7] #'follow-delete-other-windows-and-split) ;; There exist two system variables that control the appearance of ;; lines wider than the window containing them. The default is to ;; truncate long lines whenever a window isn't as wide as the frame. ;; -;; To make sure lines are never truncated, please place the following -;; lines in your init file: +;; To make sure lines are never truncated, place the following lines +;; in your Init file: ;; ;; (setq truncate-lines nil) ;; (setq truncate-partial-width-windows nil) -;; The correct way to configure Follow mode, or any other mode for -;; that matter, is to create one or more functions that do -;; whatever you would like to do. These functions are then added to -;; a hook. +;; One way to configure Follow mode is to create one or more functions +;; that do whatever you would like to do. These functions are then +;; added to a hook. ;; ;; The keymap `follow-mode-map' contains key bindings activated by ;; `follow-mode'. @@ -120,8 +119,8 @@ ;; (add-hook 'follow-mode-hook 'my-follow-mode-hook) ;; ;; (defun my-follow-mode-hook () -;; (define-key follow-mode-map "\C-ca" 'your-favorite-function) -;; (define-key follow-mode-map "\C-cb" 'another-function)) +;; (define-key follow-mode-map "\C-ca" #'your-favorite-function) +;; (define-key follow-mode-map "\C-cb" #'another-function)) ;; Usage: @@ -129,60 +128,60 @@ ;; To activate, issue the command "M-x follow-mode" ;; and press Return. To deactivate, do it again. ;; -;; The following is a list of commands useful when follow-mode is active. +;; The following is a list of commands useful when `follow-mode' is active. ;; -;; follow-scroll-up C-c . C-v +;; `follow-scroll-up' C-c . C-v ;; Scroll text in a Follow mode window chain up. ;; -;; follow-scroll-down C-c . v +;; `follow-scroll-down' C-c . v ;; Like `follow-scroll-up', but in the other direction. ;; -;; follow-delete-other-windows-and-split C-c . 1 +;; `follow-delete-other-windows-and-split' C-c . 1 ;; Maximize the visible area of the current buffer, -;; and enter Follow mode. This is a very convenient +;; and enter Follow mode. This is a very convenient ;; way to start Follow mode, hence we recommend that ;; this command be added to the global keymap. ;; -;; follow-recenter C-c . C-l +;; `follow-recenter' C-c . C-l ;; Place point in the center of the middle window, ;; or a specified number of lines from either top or bottom. ;; -;; follow-switch-to-buffer C-c . b +;; `follow-switch-to-buffer' C-c . b ;; Switch buffer in all windows displaying the current buffer ;; in this frame. ;; -;; follow-switch-to-buffer-all C-c . C-b +;; `follow-switch-to-buffer-all' C-c . C-b ;; Switch buffer in all windows in the selected frame. ;; -;; follow-switch-to-current-buffer-all +;; `follow-switch-to-current-buffer-all' ;; Show the current buffer in all windows on the current ;; frame and turn on `follow-mode'. ;; -;; follow-first-window C-c . < +;; `follow-first-window' C-c . < ;; Select the first window in the frame showing the same buffer. ;; -;; follow-last-window C-c . > +;; `follow-last-window' C-c . > ;; Select the last window in the frame showing the same buffer. ;; -;; follow-next-window C-c . n +;; `follow-next-window' C-c . n ;; Select the next window in the frame showing the same buffer. ;; -;; follow-previous-window C-c . p +;; `follow-previous-window' C-c . p ;; Select the previous window showing the same buffer. ;; Well, it seems ok, but what if I really want to look at two different -;; positions in the text? Here are two simple methods to use: +;; positions in the text? Here are two simple methods to use: ;; ;; 1) Use multiple frames; `follow' mode only affects windows displayed -;; in the same frame. (My apologies to you who can't use frames.) +;; in the same frame. (My apologies to you who can't use frames.) ;; ;; 2) Bind `follow-mode' to key so you can turn it off whenever -;; you want to view two locations. Of course, `follow' mode can +;; you want to view two locations. Of course, `follow-mode' can ;; be reactivated by hitting the same key again. ;; ;; Example from my ~/.emacs: -;; (global-set-key [f8] 'follow-mode) +;; (global-set-key [f8] #'follow-mode) ;; Implementation: ;; @@ -342,7 +341,7 @@ property `follow-mode-use-cache' to non-nil.") ;; Internal variables: (defvar follow-internal-force-redisplay nil - "True when Follow mode should redisplay the windows.") + "Non-nil when Follow mode should redisplay the windows.") (defvar follow-active-menu nil "The menu visible when Follow mode is active.") @@ -1019,8 +1018,8 @@ returned by `follow-windows-start-end'." (setq win-start-end (cdr win-start-end))) result)) -;; Check if point is visible in all windows. (So that -;; no one will be recentered.) +;; Check if point is visible in all windows. +;; (So that no one will be recentered.) (defun follow-point-visible-all-windows-p (win-start-end) "Non-nil when the `window-point' is visible in all windows." @@ -1069,11 +1068,11 @@ Return the selected window." win)) ;; Lets select a window showing the end. Make sure we only select it if -;; it wasn't just moved here. (I.e. M-> shall not unconditionally place +;; it wasn't just moved here. (I.e. M-> shall not unconditionally place ;; point in the selected window.) ;; ;; (Compatibility kludge: in Emacs `window-end' is equal to `point-max'; -;; in XEmacs, it is equal to `point-max + 1'. Should I really bother +;; in XEmacs, it is equal to `point-max + 1'. Should I really bother ;; checking `window-end' now when I check `end-of-buffer' explicitly?) (defun follow-select-if-end-visible (win-start-end) @@ -1097,7 +1096,7 @@ Return the selected window." ;; Select a window that will display point if the windows would -;; be redisplayed with the first window fixed. This is useful for +;; be redisplayed with the first window fixed. This is useful for ;; example when the user has pressed return at the bottom of a window ;; as point is not visible in any window. @@ -1202,7 +1201,7 @@ should be a member of WINDOWS, starts at position START." (goto-char guess) (while (not done) (if (not (= (vertical-motion 1 (car windows)) 1)) - ;; Hit bottom! (Can we really do this?) + ;; Hit bottom! (Can we really do this?) ;; We'll keep it, since it ensures termination. (progn (setq done t) @@ -1283,7 +1282,7 @@ non-first windows in Follow mode." (defvar follow-prev-buffer nil "The buffer current at the last call to `follow-adjust-window' or nil. -follow-mode is not necessarily enabled in this buffer.") +`follow-mode' is not necessarily enabled in this buffer.") ;; This function is added to `pre-display-function' and is thus called ;; before each redisplay operation. It supersedes (2018-09) the @@ -1331,7 +1330,7 @@ follow-mode is not necessarily enabled in this buffer.") ;; . (defun follow-adjust-window (win) - ;; Adjust the window WIN and its followers. + "Adjust the window WIN and its followers." (cl-assert (eq (window-buffer win) (current-buffer))) ;; Have we moved out of or into a follow-mode window group? @@ -1646,17 +1645,17 @@ This is updated by redisplay or by calling (defun follow-window-end (&optional window update) "Return position at which display currently ends in the Follow - Mode group of windows which includes WINDOW. +Mode group of windows which includes WINDOW. - WINDOW must be a live window and defaults to the selected one. - This is updated by redisplay, when it runs to completion. - Simply changing the buffer text or setting `window-start' does - not update this value. - - Return nil if there is no recorded value. (This can happen if - the last redisplay of WINDOW was preempted, and did not - finish.) If UPDATE is non-nil, compute the up-to-date position - if it isn't already recorded." +WINDOW must be a live window and defaults to the selected one. +This is updated by redisplay, when it runs to completion. +Simply changing the buffer text or setting `window-start' does +not update this value. + +Return nil if there is no recorded value. (This can happen if +the last redisplay of WINDOW was preempted, and did not +finish.) If UPDATE is non-nil, compute the up-to-date position +if it isn't already recorded." (let* ((windows (follow-all-followers window)) (last (car (last windows)))) (when (and update follow-start-end-invalid) @@ -1676,7 +1675,7 @@ overriding motion of point in order to display at this exact start." (defun follow-pos-visible-in-window-p (&optional pos window partially) "Return non-nil if position POS is currently on the frame in one of - the windows in the Follow Mode group which includes WINDOW. +the windows in the Follow Mode group which includes WINDOW. WINDOW must be a live window and defaults to the selected one. commit 8a92030f6af29c8b4892218052c2f8da00c45806 (refs/remotes/origin/emacs-27) Author: Michael Albinus Date: Sun Mar 28 21:06:24 2021 +0200 Fix hang in autorevert-tests.el * test/lisp/autorevert-tests.el (auto-revert--wait-for-revert): Apply more robust check, whether file notification is used. diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 6ced9a1ac8..8b8313df01 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -131,7 +131,9 @@ This expects `auto-revert--messages' to be bound by (format-message "Reverting buffer `%s'\\." (buffer-name buffer)) auto-revert--messages))) - (if (with-current-buffer buffer auto-revert-use-notify) + (if (and (or file-notify--library + (file-remote-p temporary-file-directory)) + (with-current-buffer buffer auto-revert-use-notify)) (read-event nil nil 0.1) (sleep-for 0.1))))) commit 91eea74229e074f45eced0263755b0d15ee38874 Author: Lars Ingebrigtsen Date: Sun Mar 28 17:06:01 2021 +0200 Revert "Clarify dired-do-shell-command doc string" This reverts commit cf607c262e15c873961fdfcced254e6f8e82f8d7. The doc string already explains this. (cherry picked from commit 01cf0eb75786834b7a0ee5be34be53f6e8e14c11) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index b45ea56c89..6c7908118a 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -703,8 +703,6 @@ If no files are marked or a numeric prefix arg is given, the next ARG files are used. Just \\[universal-argument] means the current file. The prompt mentions the file(s) or the marker, as appropriate. -When executing, FILE-LIST is appended to the COMMAND string. - If there is a `*' in COMMAND, surrounded by whitespace, this runs COMMAND just once with the entire file list substituted there. commit b23e22e0de6b63d984bc1b90f1498f6c7e17f13f Author: Lars Ingebrigtsen Date: Sun Mar 28 16:01:53 2021 +0200 Clarify dired-do-shell-command doc string * lisp/dired-aux.el (dired-do-shell-command): Mention what happens to FILE-LIST (bug#47432). (cherry picked from commit cf607c262e15c873961fdfcced254e6f8e82f8d7) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 6c7908118a..b45ea56c89 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -703,6 +703,8 @@ If no files are marked or a numeric prefix arg is given, the next ARG files are used. Just \\[universal-argument] means the current file. The prompt mentions the file(s) or the marker, as appropriate. +When executing, FILE-LIST is appended to the COMMAND string. + If there is a `*' in COMMAND, surrounded by whitespace, this runs COMMAND just once with the entire file list substituted there. commit bcc4cc3362fdb0f2b299087af5e7b31b92862fbb Author: Eli Zaretskii Date: Sun Mar 28 16:26:21 2021 +0300 Doc fixes for 'face-foreground' and 'face-background'. * lisp/faces.el (face-foreground, face-background): Clarify how a face specified in INHERIT arg is used. (Bug#47437) diff --git a/lisp/faces.el b/lisp/faces.el index 1813f8f736..794343e88a 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -503,7 +503,8 @@ If INHERIT is t, and FACE doesn't define a foreground color, then any foreground color that FACE inherits through its `:inherit' attribute is considered as well; however the return value may still be nil. If INHERIT is a face or a list of faces, then it is used to try to - resolve an unspecified foreground color. + resolve an unspecified foreground color, in addition to using any +inherited color. To ensure that a valid color is always returned, use a value of `default' for INHERIT; this will resolve any unspecified values by @@ -523,7 +524,8 @@ If INHERIT is t, and FACE doesn't define a background color, then any background color that FACE inherits through its `:inherit' attribute is considered as well; however the return value may still be nil. If INHERIT is a face or a list of faces, then it is used to try to - resolve an unspecified background color. + resolve an unspecified background color, in addition to using any +inherited color. To ensure that a valid color is always returned, use a value of `default' for INHERIT; this will resolve any unspecified values by commit bf6442fafddf7228362975bd16286c68ee5ce85b Author: Eli Zaretskii Date: Fri Mar 26 09:37:56 2021 +0300 ; * admin/make-tarball.txt: Minor addition to the Web pages section. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 2268579f15..fd63b7501b 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -272,5 +272,14 @@ page for about a month, then comment it again. Regenerate the various manuals in manual/. The scripts admin/make-manuals and admin/upload-manuals summarize the process. +If you have Texinfo installed locally, make-manuals might fail if it +cannot find epsf.tex. In that case define in the environment + + TEXINPUTS=:/path/to/texinfo-tree/doc + +where /path/to/texinfo-tree is the absolute file name of the top-level +directory where you have the Texinfo source tree. Then re-run +make-manuals. + Browsing is one way to check for any files that still need updating. commit 38b127d32efe39e4ffb2bdd9d43e9f3c517afd8f Author: Glenn Morris Date: Thu Mar 25 11:48:13 2021 -0700 * admin/admin.el (set-version): Handle malformed NEWS markup. diff --git a/admin/admin.el b/admin/admin.el index 9be6f4a607..d75612cb51 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -151,7 +151,7 @@ Root must be the root of an Emacs source tree." (display-warning 'admin "NEWS file contains empty sections - remove them?")) (goto-char (point-min)) - (if (re-search-forward "^\\(\\+\\+\\+ *$\\|--- *$\\|Temporary note:\\)" nil t) + (if (re-search-forward "^\\(\\+\\+\\+? *$\\|---? *$\\|Temporary note:\\)" nil t) (display-warning 'admin "NEWS file still contains temporary markup. Documentation changes might not have been completed!")))) commit 0d7e2a993e791d0a39e2c2d7e20279bebb8b418d Author: Glenn Morris Date: Thu Mar 25 11:23:17 2021 -0700 admin.el fix for bug#47394 * admin/admin.el (manual-html-fix-index-2): Handle Texinfo 6.7. diff --git a/admin/admin.el b/admin/admin.el index fa96b7e5ca..9be6f4a607 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -545,7 +545,7 @@ Leave point after the table." (forward-line 1) (while (not done) (cond ((re-search-forward "\\)\ -:  ]*>\\(.*\\)" (line-end-position) t) +:?  ]*>\\(.*\\)" (line-end-position) t) (replace-match (format "\\1\n\\2" (if table-workaround " bgcolor=\"white\"" ""))) commit fdec444758ce6bc22847980a0f421c1fac04fa15 Author: Michael Albinus Date: Thu Mar 25 18:52:44 2021 +0100 ; * etc/NEWS: Fix typo. diff --git a/etc/NEWS b/etc/NEWS index e79a9d0120..8226ad3d1d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -999,7 +999,6 @@ the entire list as before. An integer value limits the list length *** 'vc-git-stash' is now bound to 'C' in the stash headers. --- *** Some stash keybindings are now available in the stash button. 'vc-git-stash' and 'vc-git-stash-snapshot' can now be run using 'C' and 'S' respectively, including when there are no stashes. commit 1e6ca2765fc31671a084d04e99d875ecdc635c3c Author: Eli Zaretskii Date: Thu Mar 25 19:22:55 2021 +0200 ; * admin/make-tarball.txt: Another minor addition. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 65c6e86b1d..2268579f15 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -247,8 +247,12 @@ General steps (for each step, check for possible errors): because replies that invariably are not announcements also get sent out as if they were.) -12. After a release, update the Emacs pages as below. +12. After a release, update the Emacs pages as described below. +13. Bump the Emacs version on the release branch. + If the released version was XX.Y, use 'set-version' from + admin/admin.el to bump the version on the release branch to + XX.Y.50. Commit the changes. UPDATING THE EMACS WEB PAGES AFTER A RELEASE commit 3e9047115e1375b5c52aa477077fcc3cccd3d77a Author: Eli Zaretskii Date: Thu Mar 25 19:12:25 2021 +0200 Bump Emacs version past 27.2 * README: * configure.ac: * nt/README.W32: * msdos/sed2v2.inp: * etc/NEWS: Bump Emacs version to 27.2.50. diff --git a/README b/README index 6b27b52d0d..e9c931a937 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Copyright (C) 2001-2021 Free Software Foundation, Inc. See the end of the file for license conditions. -This directory tree holds version 27.2 of GNU Emacs, the extensible, +This directory tree holds version 27.2.50 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. The file INSTALL in this directory says how to build and install GNU diff --git a/configure.ac b/configure.ac index 0b3453202b..866f12a45a 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ dnl along with GNU Emacs. If not, see . AC_PREREQ(2.65) dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el. -AC_INIT(GNU Emacs, 27.2, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/) +AC_INIT(GNU Emacs, 27.2.50, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/) dnl Set emacs_config_options to the options of 'configure', quoted for the shell, dnl and then quoted again for a C string. Separate options with spaces. diff --git a/etc/NEWS b/etc/NEWS index d96925705f..e79a9d0120 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -15,6 +15,39 @@ in older Emacs versions. You can narrow news to a specific version by calling 'view-emacs-news' with a prefix argument or by typing 'C-u C-h C-n'. +Temporary note: ++++ indicates that all relevant manuals in doc/ have been updated. +--- means no change in the manuals is needed. +When you add a new item, use the appropriate mark if you are sure it +applies, and please also update docstrings as needed. + + +* Installation Changes in Emacs 27.3 + + +* Startup Changes in Emacs 27.3 + + +* Changes in Emacs 27.3 + + +* Editing Changes in Emacs 27.3 + + +* Changes in Specialized Modes and Packages in Emacs 27.3 + + +* New Modes and Packages in Emacs 27.3 + + +* Incompatible Lisp Changes in Emacs 27.3 + + +* Lisp Changes in Emacs 27.3 + + +* Changes in Emacs 27.3 on Non-Free Operating Systems + * Changes in Emacs 27.2 diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index 7ecf5cded5..0bd73f71bd 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -66,7 +66,7 @@ /^#undef PACKAGE_NAME/s/^.*$/#define PACKAGE_NAME ""/ /^#undef PACKAGE_STRING/s/^.*$/#define PACKAGE_STRING ""/ /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/ -/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "27.2"/ +/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "27.2.50"/ /^#undef SYSTEM_TYPE/s/^.*$/#define SYSTEM_TYPE "ms-dos"/ /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/ /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/ diff --git a/nt/README.W32 b/nt/README.W32 index 8cdabbf5a1..f786e81262 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -1,7 +1,7 @@ Copyright (C) 2001-2021 Free Software Foundation, Inc. See the end of the file for license conditions. - Emacs version 27.2 for MS-Windows + Emacs version 27.2.50 for MS-Windows This README file describes how to set up and run a precompiled distribution of the latest version of GNU Emacs for MS-Windows. You