commit d73229c48ec2d18e5ee67a9739a9a4e7d424fccc (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Sat Apr 3 04:25:59 2021 +0200 * lisp/pixel-scroll.el: Use lexical-binding. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 68dc0fb94b..78b8259b39 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -1,4 +1,4 @@ -;;; pixel-scroll.el --- Scroll a line smoothly +;;; pixel-scroll.el --- Scroll a line smoothly -*- lexical-binding: t -*- ;; Copyright (C) 2017-2021 Free Software Foundation, Inc. ;; Author: Tak Kunihiro @@ -124,7 +124,7 @@ This is an alternative of `scroll-up'. Scope moves downward." (or arg (setq arg 1)) (if (pixel-scroll-in-rush-p) (scroll-up arg) - (dotimes (ii arg) ; move scope downward + (dotimes (_ arg) ; move scope downward (let ((amt (if pixel-resolution-fine-flag (if (integerp pixel-resolution-fine-flag) pixel-resolution-fine-flag @@ -145,7 +145,7 @@ This is and alternative of `scroll-down'. Scope moves upward." (or arg (setq arg 1)) (if (pixel-scroll-in-rush-p) (scroll-down arg) - (dotimes (ii arg) + (dotimes (_ arg) (let ((amt (if pixel-resolution-fine-flag (if (integerp pixel-resolution-fine-flag) pixel-resolution-fine-flag @@ -244,7 +244,7 @@ that was scrolled." (dst (* line height)) ; goal @25 @25 @92 (delta (- dst src))) ; pixels to be scrolled 25 17 4 (pixel--whistlestop-pixel-up (1- delta)) ; until one less @24 @24 @91 - (dotimes (ii line) + (dotimes (_ line) ;; On horizontal scrolling, move cursor. (when (> (window-hscroll) 0) (vertical-motion 1)) commit cd5dfa086d204c01791bfdcdf9fe1215c4bf1e42 Author: Stefan Kangas Date: Sat Apr 3 01:21:32 2021 +0200 Replace two functions with seq-subseq * lisp/emacs-lisp/seq.el (seq-subseq): Add autoload cookie. * lisp/eshell/esh-util.el (eshell-sublist): Redefine using seq-subseq and make obsolete. Update callers. * lisp/wid-edit.el (widget-sublist): Redefine as obsolete function alias for seq-subseq. Update callers. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 2b8807faad..f2f7d677e8 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -147,6 +147,7 @@ the sequence, and its index within the sequence." "Return a shallow copy of SEQUENCE." (copy-sequence sequence)) +;;;###autoload (cl-defgeneric seq-subseq (sequence start &optional end) "Return the sequence of elements of SEQUENCE from START to END. END is exclusive. diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index b7b1778ebb..e559f5b39f 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -758,7 +758,7 @@ matched." (setq nth (eshell-hist-word-reference nth))) (unless (numberp mth) (setq mth (eshell-hist-word-reference mth))) - (cons (mapconcat #'identity (eshell-sublist textargs nth mth) " ") + (cons (mapconcat #'identity (seq-subseq textargs nth (1+ mth)) " ") end)))) (defun eshell-hist-parse-modifier (hist reference) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 8ef1ac9c34..1dcbed3d96 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -223,18 +223,6 @@ then quoting is done by a backslash, rather than a doubled delimiter." (string-to-number string) string)))))) -(defun eshell-sublist (l &optional n m) - "Return from LIST the N to M elements. -If N or M is nil, it means the end of the list." - (let ((a (copy-sequence l))) - (if (and m (consp (nthcdr m a))) - (setcdr (nthcdr m a) nil)) - (if n - (setq a (nthcdr n a)) - (setq n (1- (length a)) - a (last a))) - a)) - (defvar-local eshell-path-env (getenv "PATH") "Content of $PATH. It might be different from \(getenv \"PATH\"), when @@ -710,9 +698,17 @@ gid format. Valid values are `string' and `integer', defaulting to ; (or result ; (file-attributes filename)))) +;; Obsolete. + (define-obsolete-function-alias 'eshell-copy-tree #'copy-tree "28.1") (define-obsolete-function-alias 'eshell-user-name #'user-login-name "28.1") +(defun eshell-sublist (l &optional n m) + "Return from LIST the N to M elements. +If N or M is nil, it means the end of the list." + (declare (obsolete seq-subseq "28.1")) + (seq-subseq l n (1+ m))) + (provide 'esh-util) ;;; esh-util.el ends here diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index e71290c7ef..51c6b49e6d 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1878,20 +1878,9 @@ as the argument to `documentation-property'." (let ((value (widget-get widget :value))) (and (listp value) (<= (length value) (length vals)) - (let ((head (widget-sublist vals 0 (length value)))) + (let ((head (seq-subseq vals 0 (length value)))) (and (equal head value) - (cons head (widget-sublist vals (length value)))))))) - -(defun widget-sublist (list start &optional end) - "Return the sublist of LIST from START to END. -If END is omitted, it defaults to the length of LIST." - (if (> start 0) (setq list (nthcdr start list))) - (if end - (unless (<= end start) - (setq list (copy-sequence list)) - (setcdr (nthcdr (- end start 1) list) nil) - list) - (copy-sequence list))) + (cons head (seq-subseq vals (length value)))))))) (defun widget-item-action (widget &optional event) ;; Just notify itself. @@ -4117,7 +4106,9 @@ is inline." (setq help-echo (funcall help-echo widget))) (if help-echo (message "%s" (eval help-echo))))) -;;; The End: +;;; Obsolete. + +(define-obsolete-function-alias 'widget-sublist #'seq-subseq "28.1") (provide 'wid-edit) commit be9e3c48fab335c9084e472acef2065f41d20969 Author: Stefan Kangas Date: Sat Apr 3 01:06:56 2021 +0200 Remove redundant #' before lambda in eshell/*.el * lisp/eshell/em-dirs.el (eshell-dirs-initialize): * lisp/eshell/em-pred.el (eshell-predicate-alist) (eshell-modifier-alist): * lisp/eshell/em-script.el (eshell-script-initialize): * lisp/eshell/eshell.el (eshell-command): Remove redundant #' before lambda. diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index c702ee192a..c04a1a67d5 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -199,10 +199,10 @@ Thus, this does not include the current directory.") (when eshell-cd-on-directory (setq-local eshell-interpreter-alist - (cons (cons #'(lambda (file _args) - (eshell-lone-directory-p file)) - 'eshell-dirs-substitute-cd) - eshell-interpreter-alist))) + (cons (cons (lambda (file _args) + (eshell-lone-directory-p file)) + 'eshell-dirs-substitute-cd) + eshell-interpreter-alist))) (add-hook 'eshell-parse-argument-hook #'eshell-parse-user-reference nil t) diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index aecc8bb4e0..b0a7544bda 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -85,18 +85,18 @@ ordinary strings." (?s . (eshell-pred-file-mode #o4000)) ; setuid (?S . (eshell-pred-file-mode #o2000)) ; setgid (?t . (eshell-pred-file-mode #o1000)) ; sticky bit - (?U . #'(lambda (file) ; owned by effective uid - (if (file-exists-p file) - (= (file-attribute-user-id (file-attributes file)) - (user-uid))))) - ;; (?G . #'(lambda (file) ; owned by effective gid - ;; (if (file-exists-p file) - ;; (= (file-attribute-user-id (file-attributes file)) - ;; (user-uid))))) - (?* . #'(lambda (file) - (and (file-regular-p file) - (not (file-symlink-p file)) - (file-executable-p file)))) + (?U . (lambda (file) ; owned by effective uid + (if (file-exists-p file) + (= (file-attribute-user-id (file-attributes file)) + (user-uid))))) + ;; (?G . (lambda (file) ; owned by effective gid + ;; (if (file-exists-p file) + ;; (= (file-attribute-user-id (file-attributes file)) + ;; (user-uid))))) + (?* . (lambda (file) + (and (file-regular-p file) + (not (file-symlink-p file)) + (file-executable-p file)))) (?l . (eshell-pred-file-links)) (?u . (eshell-pred-user-or-group ?u "user" 2 'eshell-user-id)) (?g . (eshell-pred-user-or-group ?g "group" 3 'eshell-group-id)) @@ -114,25 +114,25 @@ The format of each entry is (put 'eshell-predicate-alist 'risky-local-variable t) (defcustom eshell-modifier-alist - '((?E . #'(lambda (lst) - (mapcar - (lambda (str) - (eshell-stringify - (car (eshell-parse-argument str)))) - lst))) - (?L . #'(lambda (lst) (mapcar 'downcase lst))) - (?U . #'(lambda (lst) (mapcar 'upcase lst))) - (?C . #'(lambda (lst) (mapcar 'capitalize lst))) - (?h . #'(lambda (lst) (mapcar 'file-name-directory lst))) + '((?E . (lambda (lst) + (mapcar + (lambda (str) + (eshell-stringify + (car (eshell-parse-argument str)))) + lst))) + (?L . (lambda (lst) (mapcar #'downcase lst))) + (?U . (lambda (lst) (mapcar #'upcase lst))) + (?C . (lambda (lst) (mapcar #'capitalize lst))) + (?h . (lambda (lst) (mapcar #'file-name-directory lst))) (?i . (eshell-include-members)) (?x . (eshell-include-members t)) - (?r . #'(lambda (lst) (mapcar 'file-name-sans-extension lst))) - (?e . #'(lambda (lst) (mapcar 'file-name-extension lst))) - (?t . #'(lambda (lst) (mapcar 'file-name-nondirectory lst))) - (?q . #'(lambda (lst) (mapcar 'eshell-escape-arg lst))) - (?u . #'(lambda (lst) (eshell-uniquify-list lst))) - (?o . #'(lambda (lst) (sort lst 'string-lessp))) - (?O . #'(lambda (lst) (nreverse (sort lst 'string-lessp)))) + (?r . (lambda (lst) (mapcar #'file-name-sans-extension lst))) + (?e . (lambda (lst) (mapcar #'file-name-extension lst))) + (?t . (lambda (lst) (mapcar #'file-name-nondirectory lst))) + (?q . (lambda (lst) (mapcar #'eshell-escape-arg lst))) + (?u . (lambda (lst) (eshell-uniquify-list lst))) + (?o . (lambda (lst) (sort lst #'string-lessp))) + (?O . (lambda (lst) (nreverse (sort lst #'string-lessp)))) (?j . (eshell-join-members)) (?S . (eshell-split-members)) (?R . 'reverse) diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index aecc48610f..658ea085c9 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el @@ -59,11 +59,11 @@ This includes when running `eshell-command'." (defun eshell-script-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the script parsing code." (setq-local eshell-interpreter-alist - (cons (cons #'(lambda (file _args) - (string= (file-name-nondirectory file) - "eshell")) - 'eshell/source) - eshell-interpreter-alist)) + (cons (cons (lambda (file _args) + (string= (file-name-nondirectory file) + "eshell")) + 'eshell/source) + eshell-interpreter-alist)) (setq-local eshell-complex-commands (append '("source" ".") eshell-complex-commands)) ;; these two variables are changed through usage, but we don't want diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 3aaf2fb78a..101ac86034 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -294,9 +294,9 @@ With prefix ARG, insert output into the current buffer at point." (setq arg current-prefix-arg)) (let ((eshell-non-interactive-p t)) ;; Enable `eshell-mode' only in this minibuffer. - (minibuffer-with-setup-hook #'(lambda () - (eshell-mode) - (eshell-command-mode +1)) + (minibuffer-with-setup-hook (lambda () + (eshell-mode) + (eshell-command-mode +1)) (unless command (setq command (read-from-minibuffer "Emacs shell command: ")) (if (eshell-using-module 'eshell-hist) commit 0b613c90a5fcbcc483f09d909cb77e7d0c8fb31e Author: Stefan Monnier Date: Fri Apr 2 19:51:41 2021 -0400 * lisp/progmodes/simula.el: Use lexical-binding (simula-tab-always-indent): Mark as obsolete. (simula-mode-map): Don't bind TAB. (simula-indent-command): Mark as obsolete. (hilit-set-mode-patterns): Remove obsolete support for hilit19. (simula-mode-syntax-table): Move initialization code into the declaration. diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el index f92f446809..7c0de9fc35 100644 --- a/lisp/progmodes/simula.el +++ b/lisp/progmodes/simula.el @@ -1,4 +1,4 @@ -;;; simula.el --- SIMULA 87 code editing commands for Emacs +;;; simula.el --- SIMULA 87 code editing commands for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1992, 1994, 1996, 2001-2021 Free Software Foundation, ;; Inc. @@ -52,6 +52,7 @@ the run of whitespace at the beginning of the line.") Otherwise TAB indents only when point is within the run of whitespace at the beginning of the line." :type 'boolean) +(make-obsolete-variable 'simula-tab-always-indent 'tab-always-indent "28.1") (defconst simula-indent-level-default 3 "Indentation of SIMULA statements with respect to containing block.") @@ -148,7 +149,24 @@ Please note that the standard definitions are required for SIMULA mode to function correctly." :type '(choice file (const nil))) -(defvar simula-mode-syntax-table nil +(defvar simula-mode-syntax-table + (let ((st (copy-syntax-table (standard-syntax-table)))) + (modify-syntax-entry ?! "<" st) + (modify-syntax-entry ?$ "." st) + (modify-syntax-entry ?% "< b" st) + (modify-syntax-entry ?\n "> b" st) + (modify-syntax-entry ?' "\"" st) + (modify-syntax-entry ?\( "()" st) + (modify-syntax-entry ?\) ")(" st) + (modify-syntax-entry ?\; ">" st) + (modify-syntax-entry ?\[ "." st) + (modify-syntax-entry ?\\ "." st) + (modify-syntax-entry ?\] "." st) + (modify-syntax-entry ?_ "_" st) + (modify-syntax-entry ?\| "." st) + (modify-syntax-entry ?\{ "." st) + (modify-syntax-entry ?\} "." st) + st) "Syntax table in SIMULA mode buffers.") (defconst simula-syntax-propertize-function @@ -237,39 +255,20 @@ for SIMULA mode to function correctly." ["Forward Statement" simula-next-statement t] ["Backward Up Level" simula-backward-up-level t] ["Forward Down Statement" simula-forward-down-level t]) - "Lucid Emacs menu for SIMULA mode.") - -(if simula-mode-syntax-table - () - (setq simula-mode-syntax-table (copy-syntax-table (standard-syntax-table))) - (modify-syntax-entry ?! "<" simula-mode-syntax-table) - (modify-syntax-entry ?$ "." simula-mode-syntax-table) - (modify-syntax-entry ?% "< b" simula-mode-syntax-table) - (modify-syntax-entry ?\n "> b" simula-mode-syntax-table) - (modify-syntax-entry ?' "\"" simula-mode-syntax-table) - (modify-syntax-entry ?\( "()" simula-mode-syntax-table) - (modify-syntax-entry ?\) ")(" simula-mode-syntax-table) - (modify-syntax-entry ?\; ">" simula-mode-syntax-table) - (modify-syntax-entry ?\[ "." simula-mode-syntax-table) - (modify-syntax-entry ?\\ "." simula-mode-syntax-table) - (modify-syntax-entry ?\] "." simula-mode-syntax-table) - (modify-syntax-entry ?_ "_" simula-mode-syntax-table) - (modify-syntax-entry ?\| "." simula-mode-syntax-table) - (modify-syntax-entry ?\{ "." simula-mode-syntax-table) - (modify-syntax-entry ?\} "." simula-mode-syntax-table)) + "Emacs menu for SIMULA mode.") (defvar simula-mode-map (let ((map (make-sparse-keymap))) - (define-key map "\C-c\C-u" 'simula-backward-up-level) - (define-key map "\C-c\C-p" 'simula-previous-statement) - (define-key map "\C-c\C-d" 'simula-forward-down-level) - (define-key map "\C-c\C-n" 'simula-next-statement) - ;; (define-key map "\C-c\C-g" 'simula-goto-definition) - ;; (define-key map "\C-c\C-h" 'simula-standard-help) - (define-key map "\177" 'backward-delete-char-untabify) - (define-key map ":" 'simula-electric-label) - (define-key map "\e\C-q" 'simula-indent-exp) - (define-key map "\t" 'simula-indent-command) + (define-key map "\C-c\C-u" #'simula-backward-up-level) + (define-key map "\C-c\C-p" #'simula-previous-statement) + (define-key map "\C-c\C-d" #'simula-forward-down-level) + (define-key map "\C-c\C-n" #'simula-next-statement) + ;; (define-key map "\C-c\C-g" #'simula-goto-definition) + ;; (define-key map "\C-c\C-h" #'simula-standard-help) + (define-key map "\177" #'backward-delete-char-untabify) + (define-key map ":" #'simula-electric-label) + (define-key map "\e\C-q" #'simula-indent-exp) + ;; (define-key map "\t" #'simula-indent-command) map) "Keymap used in `simula-mode'.") @@ -285,8 +284,8 @@ for SIMULA mode to function correctly." ["Previous Statement" simula-previous-statement :enable (not (bobp))] "---" - ["Indent Line" simula-indent-command - :enable (not buffer-read-only)] + ;; ["Indent Line" simula-indent-command + ;; :enable (not buffer-read-only)] ["Indent Expression" simula-indent-exp :enable (not buffer-read-only)])) @@ -295,9 +294,6 @@ for SIMULA mode to function correctly." "Major mode for editing SIMULA code. \\{simula-mode-map} Variables controlling indentation style: - `simula-tab-always-indent' - Non-nil means TAB in SIMULA mode should always reindent the current line, - regardless of where in the line point is when the TAB command is used. `simula-indent-level' Indentation of SIMULA statements with respect to containing block. `simula-substatement-offset' @@ -335,7 +331,7 @@ with no arguments, if that value is non-nil." ;; (setq-local end-comment-column 75) (setq-local paragraph-start "[ \t]*$\\|\f") (setq-local paragraph-separate paragraph-start) - (setq-local indent-line-function 'simula-indent-line) + (setq-local indent-line-function #'simula-indent-line) (setq-local comment-start "! ") (setq-local comment-end " ;") (setq-local comment-start-skip "!+ *") @@ -415,6 +411,7 @@ A numeric argument, regardless of its value, means indent rigidly all the lines of the SIMULA statement after point so that this line becomes properly indented. The relative indentation among the lines of the statement are preserved." + (declare (obsolete indent-for-tab-command "28.1")) (interactive "P") (let ((case-fold-search t)) (if (or whole-exp simula-tab-always-indent @@ -1564,30 +1561,6 @@ If not nil and not t, move to limit of search and return nil." (simula-install-standard-abbrevs)) ;; Hilit mode support. -(when (fboundp 'hilit-set-mode-patterns) - (when (and (boundp 'hilit-patterns-alist) - (not (assoc 'simula-mode hilit-patterns-alist))) - (hilit-set-mode-patterns - 'simula-mode - '( - ("^%\\([ \t\f].*\\)?$" nil comment) - ("^%include\\>" nil include) - ("\"[^\"\n]*\"\\|'.'\\|'![0-9]+!'" nil string) - ((regexp-opt '("ACTIVATE" "AFTER" "AND" "ARRAY" "AT" "BEFORE" - "BEGIN" "BOOLEAN" "CHARACTER" "CLASS" "DELAY" - "DO" "ELSE" "END" "EQ" "EQV" "EXTERNAL" "FALSE" - "FOR" "GE" "GO" "GOTO" "GT" "HIDDEN" "IF" "IMP" - "IN" "INNER" "INSPECT" "INTEGER" "IS" "LABEL" - "LE" "LONG" "LT" "NAME" "NE" "NEW" "NONE" "NOT" - "NOTEXT" "OR" "OTHERWISE" "PRIOR" "PROCEDURE" - "PROTECTED" "QUA" "REACTIVATE" "REAL" "REF" - "SHORT" "STEP" "SWITCH" "TEXT" "THEN" "THIS" - "TO" "TRUE" "UNTIL" "VALUE" "VIRTUAL" "WHEN" - "WHILE") - 'words) - nil keyword) - ("!\\|\\" ";" comment)) - nil 'case-insensitive))) ;; obsolete @@ -1598,7 +1571,7 @@ If not nil and not t, move to limit of search and return nil." "24.4") (define-obsolete-function-alias 'simula-submit-bug-report - 'report-emacs-bug "24.4") + #'report-emacs-bug "24.4") (defun simula-popup-menu (_e) "Pops up the SIMULA menu." commit 5c7766ed1072c5748776e56d6f27a6a9504648d3 Author: Stefan Kangas Date: Sat Apr 3 00:50:55 2021 +0200 Use lexical-binding in recentf.el * lisp/recentf.el: Use lexical-binding. Doc fix. (recentf-save-file): Strength reduce 'eval' to 'symbol-value'. (recentf-trunc-list): Make into obsolete function alias for 'seq-take'. Update callers. (recentf-show-file-shortcuts-flag): Doc fix. (recentf-menu-elements, recentf-make-menu-items) (recentf-make-menu-item, recentf-dialog-mode-map) (recentf-dialog, recentf-open-files-item) (recentf-open-files-items, recentf-open-files) (recentf-load-list): Quote function symbols as such. (recentf-relative-filter, recentf-file-name-nondir): Remove redundant #' before lambda. diff --git a/lisp/recentf.el b/lisp/recentf.el index c819397a33..9ae059a70d 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1,4 +1,4 @@ -;;; recentf.el --- setup a menu of recently opened files +;;; recentf.el --- setup a menu of recently opened files -*- lexical-binding: t -*- ;; Copyright (C) 1999-2021 Free Software Foundation, Inc. @@ -24,16 +24,21 @@ ;;; Commentary: ;; This package maintains a menu for visiting files that were operated -;; on recently. When enabled a new "Open Recent" sub menu is +;; on recently. When enabled a new "Open Recent" submenu is ;; displayed in the "File" menu. The recent files list is -;; automatically saved across Emacs sessions. You can customize the -;; number of recent files displayed, the location of the menu and -;; others options (see the source code for details). +;; automatically saved across Emacs sessions. -;; To enable this package, add the following to your .emacs: -;; (recentf-mode 1) +;; You can customize the number of recent files displayed, the +;; location of the menu and others options. Type: +;; +;; M-x customize-group RET recentf RET + +;; To enable this package, add this line to your Init file: +;; +;; (recentf-mode 1) ;;; Code: + (require 'tree-widget) (require 'timer) @@ -73,7 +78,7 @@ See the command `recentf-save-list'." :type 'file :initialize 'custom-initialize-default :set (lambda (symbol value) - (let ((oldvalue (eval symbol))) + (let ((oldvalue (symbol-value symbol))) (custom-set-default symbol value) (and (not (equal value oldvalue)) recentf-mode @@ -292,7 +297,7 @@ They are successively passed a file name to transform it." (function :tag "Other function"))))) (defcustom recentf-show-file-shortcuts-flag t - "Whether to show \"[N]\" for the Nth item up to 10. + "Non-nil means to show \"[N]\" for the Nth item up to 10. If non-nil, `recentf-open-files' will show labels for keys that can be used as shortcuts to open the Nth file." :group 'recentf @@ -327,15 +332,6 @@ Ignore case if `recentf-case-fold-search' is non-nil." (setq list (cdr list))) list) -(defsubst recentf-trunc-list (l n) - "Return from L the list of its first N elements." - (let (nl) - (while (and l (> n 0)) - (setq nl (cons (car l) nl) - n (1- n) - l (cdr l))) - (nreverse nl))) - (defun recentf-dump-variable (variable &optional limit) "Insert a \"(setq VARIABLE value)\" in the current buffer. When the value of VARIABLE is a list, optional argument LIMIT @@ -345,7 +341,7 @@ the full list." (if (atom value) (insert (format "\n(setq %S '%S)\n" variable value)) (when (and (integerp limit) (> limit 0)) - (setq value (recentf-trunc-list value limit))) + (setq value (seq-take value limit))) (insert (format "\n(setq %S\n '(" variable)) (dolist (e value) (insert (format "\n %S" e))) @@ -516,7 +512,7 @@ filter function this variable is reset to nil.") (defsubst recentf-elements (n) "Return a list of the first N elements of the recent list." - (recentf-trunc-list recentf-list n)) + (seq-take recentf-list n)) (defsubst recentf-make-menu-element (menu-item menu-value) "Create a new menu-element. @@ -556,7 +552,7 @@ This a menu element (FILE . FILE)." (defsubst recentf-menu-elements (n) "Return a list of the first N default menu elements from the recent list. See also `recentf-make-default-menu-element'." - (mapcar 'recentf-make-default-menu-element + (mapcar #'recentf-make-default-menu-element (recentf-elements n))) (defun recentf-apply-menu-filter (filter l) @@ -597,7 +593,7 @@ This is a menu filter function which ignores the MENU argument." (let* ((recentf-menu-shortcuts 0) (file-items (condition-case err - (mapcar 'recentf-make-menu-item + (mapcar #'recentf-make-menu-item (recentf-apply-menu-filter recentf-menu-filter (recentf-menu-elements recentf-max-menu-items))) @@ -639,7 +635,7 @@ Return nil if file NAME is not one of the ten more recent." (let ((item (recentf-menu-element-item elt)) (value (recentf-menu-element-value elt))) (if (recentf-sub-menu-element-p elt) - (cons item (mapcar 'recentf-make-menu-item value)) + (cons item (mapcar #'recentf-make-menu-item value)) (let ((k (and (< recentf-menu-shortcuts 10) (recentf-menu-value-shortcut value)))) (vector item @@ -764,12 +760,12 @@ This filter combines the `recentf-sort-basenames-descending' and (defun recentf-relative-filter (l) "Filter the list of menu-elements L to show relative filenames. Filenames are relative to the `default-directory'." - (mapcar #'(lambda (menu-element) - (let* ((ful (recentf-menu-element-value menu-element)) - (rel (file-relative-name ful default-directory))) - (if (string-match "^\\.\\." rel) - menu-element - (recentf-make-menu-element rel ful)))) + (mapcar (lambda (menu-element) + (let* ((ful (recentf-menu-element-value menu-element)) + (rel (file-relative-name ful default-directory))) + (if (string-match "^\\.\\." rel) + menu-element + (recentf-make-menu-element rel ful)))) l)) ;;; Rule based menu filters @@ -941,10 +937,10 @@ Rules obey `recentf-arrange-rules' format." This simplified version of `recentf-show-basenames' does not handle duplicates. It is used by `recentf-arrange-by-dir' as its `recentf-arrange-by-rule-subfilter'." - (mapcar #'(lambda (e) - (recentf-make-menu-element - (file-name-nondirectory (recentf-menu-element-value e)) - (recentf-menu-element-value e))) + (mapcar (lambda (e) + (recentf-make-menu-element + (file-name-nondirectory (recentf-menu-element-value e)) + (recentf-menu-element-value e))) l)) (defun recentf-dir-rule (file) @@ -997,15 +993,15 @@ Filtering of L is delegated to the selected filter in the menu." (list `("Show files" ,@(mapcar - #'(lambda (f) - `[,(cdr f) - (setq recentf-filter-changer-current ',(car f)) - ;;:active t - :style radio ;;radio Don't work with GTK :-( - :selected (eq recentf-filter-changer-current - ',(car f)) - ;;:help ,(cdr f) - ]) + (lambda (f) + `[,(cdr f) + (setq recentf-filter-changer-current ',(car f)) + ;;:active t + :style radio ;;radio Don't work with GTK :-( + :selected (eq recentf-filter-changer-current + ',(car f)) + ;;:help ,(cdr f) + ]) recentf-filter-changer-alist)))) (recentf-apply-menu-filter recentf-filter-changer-current l))) @@ -1062,9 +1058,9 @@ Go to the beginning of buffer if not found." (defvar recentf-dialog-mode-map (let ((km (copy-keymap recentf--shortcuts-keymap))) (set-keymap-parent km widget-keymap) - (define-key km "q" 'recentf-cancel-dialog) - (define-key km "n" 'next-line) - (define-key km "p" 'previous-line) + (define-key km "q" #'recentf-cancel-dialog) + (define-key km "n" #'next-line) + (define-key km "p" #'previous-line) km) "Keymap used in recentf dialogs.") @@ -1083,8 +1079,8 @@ Go to the beginning of buffer if not found." ;; Cleanup buffer (let ((inhibit-read-only t) (ol (overlay-lists))) - (mapc 'delete-overlay (car ol)) - (mapc 'delete-overlay (cdr ol)) + (mapc #'delete-overlay (car ol)) + (mapc #'delete-overlay (cdr ol)) (erase-buffer)) (recentf-dialog-mode) ,@forms @@ -1178,7 +1174,7 @@ IGNORE other arguments." :node (item :tag ,(car menu-element) :sample-face bold :format "%{%t%}:\n") - ,@(mapcar 'recentf-open-files-item + ,@(mapcar #'recentf-open-files-item (cdr menu-element))) ;; Represent a single file with a link widget `(link :tag ,(car menu-element) @@ -1193,8 +1189,8 @@ IGNORE other arguments." (defun recentf-open-files-items (files) "Return a list of widgets to display FILES in a dialog buffer." (setq-local recentf--files-with-key - (recentf-trunc-list files 10)) - (mapcar 'recentf-open-files-item + (seq-take files 10)) + (mapcar #'recentf-open-files-item (append ;; When requested group the files with shortcuts together ;; at the top of the list. @@ -1202,12 +1198,12 @@ IGNORE other arguments." (setq files (nthcdr 10 files)) (recentf-apply-menu-filter 'recentf-show-digit-shortcut-filter - (mapcar 'recentf-make-default-menu-element + (mapcar #'recentf-make-default-menu-element recentf--files-with-key))) ;; Then the other files. (recentf-apply-menu-filter recentf-menu-filter - (mapcar 'recentf-make-default-menu-element + (mapcar #'recentf-make-default-menu-element files))))) (defun recentf-open-files (&optional files buffer-name) @@ -1228,7 +1224,7 @@ use for the dialog. It defaults to \"*`recentf-menu-title'*\"." (format-message "Click on Cancel or type `q' to cancel.\n")) ;; Use a L&F that looks like the recentf menu. (tree-widget-set-theme "folder") - (apply 'widget-create + (apply #'widget-create `(group :indent 2 :format "\n%v\n" @@ -1310,7 +1306,7 @@ empty `file-name-history' with the recent list." (load-file file) (and recentf-initialize-file-name-history (not file-name-history) - (setq file-name-history (mapcar 'abbreviate-file-name + (setq file-name-history (mapcar #'abbreviate-file-name recentf-list)))))) (defun recentf-cleanup () @@ -1377,6 +1373,10 @@ buffers you switch to a lot, you can say something like the following: ;; continue standard unloading nil) +;; Obsolete. + +(define-obsolete-function-alias 'recentf-trunc-list #'seq-take "28.1") + (provide 'recentf) (run-hooks 'recentf-load-hook) commit 74a86c1acf951da7451c3c8a1cd6ec277f782d41 Author: Stefan Kangas Date: Fri Apr 2 19:32:32 2021 +0200 Remove references to very old versions of Emacs from eintr * doc/lispintro/emacs-lisp-intro.texi (Making Errors) (Void Function, Void Variable, Wrong Type of Argument, debug) (debug-on-entry): Remove commented out references to Emacs 20 or earlier. * doc/lispintro/emacs-lisp-intro.texi (what-line) (print-elements-of-list, debug, X Axis Tic Marks): Don't call version 22 or earlier a "recent" version of Emacs. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 5b15a456ff..fade4096e3 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -1364,19 +1364,6 @@ C-e}: (this is an unquoted list) @end smallexample -@ignore -@noindent -What you see depends on which version of Emacs you are running. GNU -Emacs version 22 provides more information than version 20 and before. -First, the more recent result of generating an error; then the -earlier, version 20 result. - -@need 1250 -@noindent -In GNU Emacs version 22, a @file{*Backtrace*} window will open up and -you will see the following in it: -@end ignore - A @file{*Backtrace*} window will open up and you should see the following in it: @@ -1838,19 +1825,6 @@ Debugger entered--Lisp error: (void-function fill-column) (Remember, to quit the debugger and make the debugger window go away, type @kbd{q} in the @file{*Backtrace*} buffer.) -@ignore -@need 800 -In GNU Emacs 20 and before, you will produce an error message that says: - -@smallexample -Symbol's function definition is void:@: fill-column -@end smallexample - -@noindent -(The message will go away as soon as you move the cursor or type -another key.) -@end ignore - @node Void Variable @subsection Error Message for a Symbol Without a Value @cindex Symbol without value error @@ -1907,18 +1881,6 @@ Since @code{+} does not have a value bound to it, just the function definition, the error message reported that the symbol's value as a variable was void. -@ignore -@need 800 -In GNU Emacs version 20 and before, your error message will say: - -@example -Symbol's value as variable is void:@: + -@end example - -@noindent -The meaning is the same as in GNU Emacs 22. -@end ignore - @node Arguments @section Arguments @cindex Arguments @@ -2197,19 +2159,6 @@ addition had been passed the correct type of object, the value passed would have been a number, such as 37, rather than a symbol like @code{hello}. But then you would not have got the error message. -@ignore -@need 1250 -In GNU Emacs version 20 and before, the echo area displays an error -message that says: - -@smallexample -Wrong type argument:@: number-or-marker-p, hello -@end smallexample - -This says, in different words, the same as the top line of the -@file{*Backtrace*} buffer. -@end ignore - @node message @subsection The @code{message} Function @findex message @@ -6663,9 +6612,9 @@ original text of the function: @end group @end smallexample -(In recent versions of GNU Emacs, the @code{what-line} function has +(In modern versions of GNU Emacs, the @code{what-line} function has been expanded to tell you your line number in a narrowed buffer as -well as your line number in a widened buffer. The recent version is +well as your line number in a widened buffer. The modern version is more complex than the version shown here. If you feel adventurous, you might want to look at it after figuring out how this version works. You will probably need to use @kbd{C-h f} @@ -10392,9 +10341,8 @@ echo area: @code{^Jgazelle^J^Jgiraffe^J^Jlion^J^Jtiger^Jnil}, in which each @samp{^J} stands for a newline.) @need 1500 -In a recent instance of GNU Emacs, you can evaluate these expressions -directly in the Info buffer, and the echo area will grow to show the -results. +You can evaluate these expressions directly in the Info buffer, and +the echo area will grow to show the results. @smallexample @group @@ -18104,8 +18052,7 @@ argument of 4: @end smallexample @noindent -In a recent GNU Emacs, you will create and enter a @file{*Backtrace*} -buffer that says: +This will create and enter a @file{*Backtrace*} buffer that says: @noindent @smallexample @@ -18139,25 +18086,12 @@ In practice, for a bug as simple as this, the Lisp error line will tell you what you need to know to correct the definition. The function @code{1=} is void. -@ignore -@need 800 -In GNU Emacs 20 and before, you will see: - -@smallexample -Symbol's function definition is void:@: 1= -@end smallexample - -@noindent -which has the same meaning as the @file{*Backtrace*} buffer line in -version 21. -@end ignore - However, suppose you are not quite certain what is going on? You can read the complete backtrace. -In this case, you need to run a recent GNU Emacs, which automatically -starts the debugger that puts you in the @file{*Backtrace*} buffer; or -else, you need to start the debugger manually as described below. +Emacs automatically starts the debugger that puts you in the +@file{*Backtrace*} buffer. You can also start the debugger manually +as described below. Read the @file{*Backtrace*} buffer from the bottom up; it tells you what Emacs did that led to the error. Emacs made an interactive call @@ -18197,14 +18131,8 @@ then run your test again. @section @code{debug-on-entry} @findex debug-on-entry -A recent GNU Emacs starts the debugger automatically when your -function has an error. - -@ignore -GNU Emacs version 20 and before did not; it simply -presented you with an error message. You had to start the debugger -manually. -@end ignore +Emacs starts the debugger automatically when your function has an +error. Incidentally, you can start the debugger manually for all versions of Emacs; the advantage is that the debugger runs even if you do not have @@ -20079,8 +20007,8 @@ the tic marks themselves and their spacing: @code{defvar}. The @code{boundp} predicate checks whether it has already been set; @code{boundp} returns @code{nil} if it has not. If @code{graph-blank} were unbound and we did not use this conditional -construction, in a recent GNU Emacs, we would enter the debugger and -see an error message saying @samp{@w{Debugger entered--Lisp error:} +construction, we would enter the debugger and see an error message +saying @samp{@w{Debugger entered--Lisp error:} @w{(void-variable graph-blank)}}.) @need 1200 commit b65a1cfed7371e27130db9e9a05f8e656ee77c6f Author: Stefan Kangas Date: Fri Apr 2 16:33:01 2021 +0200 * doc/misc/woman.texi (Introduction): Remove reference to old Emacs. diff --git a/doc/misc/woman.texi b/doc/misc/woman.texi index 4470afcad2..33b3a33f0f 100644 --- a/doc/misc/woman.texi +++ b/doc/misc/woman.texi @@ -105,11 +105,9 @@ Mile End Road, London E1 4NS, UK @chapter Introduction @cindex introduction -This version of WoMan should run with GNU Emacs 20.3 or later on any -platform. It has not been tested, and may not run, with any other -version of Emacs. It was developed primarily on various versions of -Microsoft Windows, but has also been tested on MS-DOS, and various -versions of UNIX and GNU/Linux. +WoMan was developed primarily on various versions of Microsoft +Windows, but has also been tested on MS-DOS, and various versions of +UNIX and GNU/Linux. WoMan is distributed with GNU Emacs. commit b281d0aefac3592ff60d974648c1cc871c243d80 Author: Stefan Kangas Date: Fri Apr 2 13:22:16 2021 +0200 Remove redundant #' before lambda in textmodes/*.el * lisp/textmodes/fill.el: * lisp/textmodes/ispell.el (ispell-find-enchant-dictionaries): * lisp/textmodes/rst.el (rst-re, rst-Ado-position) (rst-Hdr-member-ado, rst-mode-abbrev-table) (rst-preferred-adornments, rst-new-preferred-hdr) (rst-classify-adornment, rst-ttl-at-point, rst-hdr-hierarchy) (rst-all-ttls-with-level, rst-get-previous-hdr) (rst-adjust-region, rst-preferred-bullets, rst-find-begs) (rst-straighten-bullets-region, rst-stn-containing-point) (rst-toc-update, rst-forward-section, rst-shift-region) (rst-enumerate-region, rst-bullet-list-region) (rst-line-block-region, rst-forward-indented-block): Remove redundant #' before lambda. diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index cb5027a976..61514d6761 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -412,12 +412,12 @@ and `fill-nobreak-invisible'." ;; Register `kinsoku' for scripts HAN, KANA, BOPOMOFO, and CJK-MISC. ;; Also tell that they don't use space between words. (map-char-table - #'(lambda (key val) - (when (memq val '(han kana bopomofo cjk-misc)) - (set-char-table-range fill-find-break-point-function-table - key 'kinsoku) - (set-char-table-range fill-nospace-between-words-table - key t))) + (lambda (key val) + (when (memq val '(han kana bopomofo cjk-misc)) + (set-char-table-range fill-find-break-point-function-table + key 'kinsoku) + (set-char-table-range fill-nospace-between-words-table + key t))) char-script-table) ;; Do the same thing also for full width characters and half ;; width kana variants. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index cee578fc4b..eb521134dc 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1207,9 +1207,9 @@ If LANG is omitted, get the extra word characters for the default language." (split-string (ispell--call-enchant-lsmod "-list-dicts") " ([^)]+)\n" t)) (found - (mapcar #'(lambda (lang) - `(,lang "[[:alpha:]]" "[^[:alpha:]]" - ,(ispell--get-extra-word-characters lang) t nil nil utf-8)) + (mapcar (lambda (lang) + `(,lang "[[:alpha:]]" "[^[:alpha:]]" + ,(ispell--get-extra-word-characters lang) t nil nil utf-8)) dictionaries))) ;; Merge into FOUND any elements from the standard ispell-dictionary-base-alist ;; which have no element in FOUND at all. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index ce156370d5..56cca84004 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -554,30 +554,30 @@ After interpretation of ARGS the results are concatenated as for `:seq'." (apply #'concat (mapcar - #'(lambda (re) - (cond - ((stringp re) - re) - ((symbolp re) - (cadr (assoc re rst-re-alist))) - ((characterp re) - (regexp-quote (char-to-string re))) - ((listp re) - (let ((nested - (mapcar #'rst-re (cdr re)))) - (cond - ((eq (car re) :seq) - (mapconcat #'identity nested "")) - ((eq (car re) :shy) - (concat "\\(?:" (mapconcat #'identity nested "") "\\)")) - ((eq (car re) :grp) - (concat "\\(" (mapconcat #'identity nested "") "\\)")) - ((eq (car re) :alt) - (concat "\\(?:" (mapconcat #'identity nested "\\|") "\\)")) - (t - (error "Unknown list car: %s" (car re)))))) - (t - (error "Unknown object type for building regex: %s" re)))) + (lambda (re) + (cond + ((stringp re) + re) + ((symbolp re) + (cadr (assoc re rst-re-alist))) + ((characterp re) + (regexp-quote (char-to-string re))) + ((listp re) + (let ((nested + (mapcar #'rst-re (cdr re)))) + (cond + ((eq (car re) :seq) + (mapconcat #'identity nested "")) + ((eq (car re) :shy) + (concat "\\(?:" (mapconcat #'identity nested "") "\\)")) + ((eq (car re) :grp) + (concat "\\(" (mapconcat #'identity nested "") "\\)")) + ((eq (car re) :alt) + (concat "\\(?:" (mapconcat #'identity nested "\\|") "\\)")) + (t + (error "Unknown list car: %s" (car re)))))) + (t + (error "Unknown object type for building regex: %s" re)))) args))) ;; FIXME: Remove circular dependency between `rst-re' and `rst-re-alist'. @@ -709,8 +709,8 @@ Return CHAR if so or signal an error otherwise." ;; testcover: ok. "Return position of SELF in ADOS or nil." (cl-check-type self rst-Ado) - (cl-position-if #'(lambda (e) - (rst-Ado-equal self e)) + (cl-position-if (lambda (e) + (rst-Ado-equal self e)) ados)) @@ -814,8 +814,8 @@ Return ADO if so or signal an error otherwise." "Return sublist of HDRS whose car's adornment equals that of SELF or nil." (cl-check-type self rst-Hdr) (let ((ado (rst-Hdr-ado self))) - (cl-member-if #'(lambda (hdr) - (rst-Ado-equal ado (rst-Hdr-ado hdr))) + (cl-member-if (lambda (hdr) + (rst-Ado-equal ado (rst-Hdr-ado hdr))) hdrs))) (defun rst-Hdr-ado-map (selves) @@ -1277,8 +1277,8 @@ This inherits from Text mode.") ;; Abbrevs. (define-abbrev-table 'rst-mode-abbrev-table - (mapcar #'(lambda (x) - (append x '(nil 0 system))) + (mapcar (lambda (x) + (append x '(nil 0 system))) '(("contents" ".. contents::\n..\n ") ("con" ".. contents::\n..\n ") ("cont" "[...]") @@ -1501,9 +1501,9 @@ file." :type `(repeat (group :tag "Adornment specification" (choice :tag "Adornment character" - ,@(mapcar #'(lambda (char) - (list 'const - :tag (char-to-string char) char)) + ,@(mapcar (lambda (char) + (list 'const + :tag (char-to-string char) char)) rst-adornment-chars)) (radio :tag "Adornment type" (const :tag "Overline and underline" over-and-under) @@ -1540,8 +1540,8 @@ search starts after this entry. Return nil if no new preferred ;; Start searching after the level of the previous adornment. (cdr (rst-Hdr-member-ado prev (rst-Hdr-preferred-adornments)))) (rst-Hdr-preferred-adornments)))) - (cl-find-if #'(lambda (cand) - (not (rst-Hdr-member-ado cand seen))) + (cl-find-if (lambda (cand) + (not (rst-Hdr-member-ado cand seen))) candidates))) (defun rst-update-section (hdr) @@ -1620,55 +1620,55 @@ returned." (ttl-blw ; Title found below starting here. (rst-forward-line-looking-at +1 'ttl-beg-1 - #'(lambda (mtcd) - (when mtcd - (setq txt-blw (match-string-no-properties 1)) - (point))))) + (lambda (mtcd) + (when mtcd + (setq txt-blw (match-string-no-properties 1)) + (point))))) txt-abv (ttl-abv ; Title found above starting here. (rst-forward-line-looking-at -1 'ttl-beg-1 - #'(lambda (mtcd) - (when mtcd - (setq txt-abv (match-string-no-properties 1)) - (point))))) + (lambda (mtcd) + (when mtcd + (setq txt-abv (match-string-no-properties 1)) + (point))))) (und-fnd ; Matching underline found starting here. (and ttl-blw (rst-forward-line-looking-at +2 (list ado-re 'lin-end) - #'(lambda (mtcd) - (when mtcd - (point)))))) + (lambda (mtcd) + (when mtcd + (point)))))) (ovr-fnd ; Matching overline found starting here. (and ttl-abv (rst-forward-line-looking-at -2 (list ado-re 'lin-end) - #'(lambda (mtcd) - (when mtcd - (point)))))) + (lambda (mtcd) + (when mtcd + (point)))))) (und-wng ; Wrong underline found starting here. (and ttl-blw (not und-fnd) (rst-forward-line-looking-at +2 'ado-beg-2-1 - #'(lambda (mtcd) - (when mtcd - (point)))))) + (lambda (mtcd) + (when mtcd + (point)))))) (ovr-wng ; Wrong overline found starting here. (and ttl-abv (not ovr-fnd) (rst-forward-line-looking-at -2 'ado-beg-2-1 - #'(lambda (mtcd) - (when (and - mtcd - ;; An adornment above may be a legal - ;; adornment for the line above - consider it - ;; a wrong overline only when it is equally - ;; long. - (equal - (length (match-string-no-properties 1)) - (length adornment))) - (point))))))) + (lambda (mtcd) + (when (and + mtcd + ;; An adornment above may be a legal + ;; adornment for the line above - consider it + ;; a wrong overline only when it is equally + ;; long. + (equal + (length (match-string-no-properties 1)) + (length adornment))) + (point))))))) (cond ((and nxt-emp prv-emp) ;; A transition. @@ -1708,11 +1708,11 @@ a section header or nil if no title line is found." (rst-forward-line-strict 0)) (let* (cnd-beg ; Beginning of a title candidate. cnd-txt ; Text of a title candidate. - (cnd-fun #'(lambda (mtcd) ; Function setting title candidate data. - (when mtcd - (setq cnd-beg (match-beginning 0)) - (setq cnd-txt (match-string-no-properties 1)) - t))) + (cnd-fun (lambda (mtcd) ; Function setting title candidate data. + (when mtcd + (setq cnd-beg (match-beginning 0)) + (setq cnd-txt (match-string-no-properties 1)) + t))) ttl) (cond ((looking-at (rst-re 'ado-beg-2-1)) @@ -1728,10 +1728,10 @@ a section header or nil if no title line is found." ;; Title line found - check for a following underline. (setq ttl (rst-forward-line-looking-at 1 'ado-beg-2-1 - #'(lambda (mtcd) - (when mtcd - (rst-classify-adornment - (match-string-no-properties 0) (match-end 0)))))) + (lambda (mtcd) + (when mtcd + (rst-classify-adornment + (match-string-no-properties 0) (match-end 0)))))) ;; Title candidate found if no valid adornment found. (funcall cnd-fun (not ttl)))) (cond @@ -1827,15 +1827,15 @@ given." (ignore-ttl (if ignore-position (cl-find-if - #'(lambda (ttl) - (equal (rst-Ttl-contains ttl ignore-position) 0)) + (lambda (ttl) + (equal (rst-Ttl-contains ttl ignore-position) 0)) all-ttls))) (really-ignore (if ignore-ttl (<= (cl-count-if - #'(lambda (ttl) - (rst-Ado-equal (rst-Ttl-ado ignore-ttl) - (rst-Ttl-ado ttl))) + (lambda (ttl) + (rst-Ado-equal (rst-Ttl-ado ignore-ttl) + (rst-Ttl-ado ttl))) all-ttls) 1))) (real-ttls (delq (if really-ignore ignore-ttl) all-ttls))) @@ -1859,14 +1859,14 @@ given." Return a list of (`rst-Ttl' . LEVEL) with ascending line number." (let ((hier (rst-Hdr-ado-map (rst-hdr-hierarchy)))) (mapcar - #'(lambda (ttl) - (cons ttl (rst-Ado-position (rst-Ttl-ado ttl) hier))) + (lambda (ttl) + (cons ttl (rst-Ado-position (rst-Ttl-ado ttl) hier))) (rst-all-ttls)))) (defun rst-get-previous-hdr () "Return the `rst-Hdr' before point or nil if none." - (let ((prev (cl-find-if #'(lambda (ttl) - (< (rst-Ttl-contains ttl (point)) 0)) + (let ((prev (cl-find-if (lambda (ttl) + (< (rst-Ttl-contains ttl (point)) 0)) (rst-all-ttls) :from-end t))) (and prev (rst-Ttl-hdr prev)))) @@ -2169,19 +2169,19 @@ hierarchy is similar to that used by `rst-adjust-section'." (let* ((beg (region-beginning)) (end (region-end)) (ttls-reg (cl-remove-if-not - #'(lambda (ttl) - (and - (>= (rst-Ttl-contains ttl beg) 0) - (< (rst-Ttl-contains ttl end) 0))) + (lambda (ttl) + (and + (>= (rst-Ttl-contains ttl beg) 0) + (< (rst-Ttl-contains ttl end) 0))) (rst-all-ttls)))) (save-excursion ;; Apply modifications. (rst-destructuring-dolist ((marker &rest hdr &aux (hier (rst-hdr-hierarchy))) - (mapcar #'(lambda (ttl) - (cons (copy-marker (rst-Ttl-get-title-beginning ttl)) - (rst-Ttl-hdr ttl))) + (mapcar (lambda (ttl) + (cons (copy-marker (rst-Ttl-get-title-beginning ttl)) + (rst-Ttl-hdr ttl))) ttls-reg)) (set-marker (goto-char marker) nil) @@ -2391,9 +2391,9 @@ also arranged by `rst-insert-list-new-tag'." "List of favorite bullets." :group 'rst :type `(repeat - (choice ,@(mapcar #'(lambda (char) - (list 'const - :tag (char-to-string char) char)) + (choice ,@(mapcar (lambda (char) + (list 'const + :tag (char-to-string char) char)) rst-bullets))) :package-version '(rst . "1.1.0")) @@ -2517,13 +2517,13 @@ ordered by POINT." (looking-at (rst-re rst-re-beg)) ; Start found (not (rst-forward-line-looking-at -1 'lin-end - #'(lambda (mtcd) ; Previous line exists and is... - (and - (not mtcd) ; non-empty, - (<= (current-indentation) clm) ; less indented - (not (and (= (current-indentation) clm) + (lambda (mtcd) ; Previous line exists and is... + (and + (not mtcd) ; non-empty, + (<= (current-indentation) clm) ; less indented + (not (and (= (current-indentation) clm) ; not a beg at same level. - (looking-at (rst-re rst-re-beg))))))))) + (looking-at (rst-re rst-re-beg))))))))) (back-to-indentation) (push (cons (point) clm) r))) (1value ; At least one line is moved in this loop. @@ -2553,8 +2553,8 @@ modified." ((bullet _clm &rest pnts) ;; Zip preferred bullets and sorted columns associating a bullet ;; with a column and all the points this column is found. - (cl-mapcar #'(lambda (bullet clm2pnt) - (cons bullet clm2pnt)) + (cl-mapcar (lambda (bullet clm2pnt) + (cons bullet clm2pnt)) rst-preferred-bullets (sort clm2pnts #'car-less-than-car))) ;; Replace the bullets by the preferred ones. @@ -2614,8 +2614,8 @@ section headers at all." (when (>= point (rst-Stn-get-title-beginning stn)) ;; Point may be in this section or a child. (let ((in-child (cl-find-if - #'(lambda (child) - (>= point (rst-Stn-get-title-beginning child))) + (lambda (child) + (>= point (rst-Stn-get-title-beginning child))) (rst-Stn-children stn) :from-end t))) (if in-child @@ -2829,18 +2829,18 @@ file-write hook to always make it up-to-date automatically." (and beg (rst-forward-line-looking-at 1 'lin-end - #'(lambda (mtcd) - (unless mtcd - (rst-apply-indented-blocks - (point) (point-max) (current-indentation) - #'(lambda (count _in-first _in-sub in-super in-empty - _relind) - (cond - ((or (> count 1) in-super)) - ((not in-empty) - (setq fnd (line-end-position)) - nil))))) - t))) + (lambda (mtcd) + (unless mtcd + (rst-apply-indented-blocks + (point) (point-max) (current-indentation) + (lambda (count _in-first _in-sub in-super in-empty + _relind) + (cond + ((or (> count 1) in-super)) + ((not in-empty) + (setq fnd (line-end-position)) + nil))))) + t))) (when fnd (delete-region beg fnd)) (goto-char beg) @@ -3024,14 +3024,14 @@ direction." (contained nil) ; Title contains point (or is after point otherwise). (found (or (cl-position-if ;; Find a title containing or after point. - #'(lambda (ttl) - (let ((cmp (rst-Ttl-contains ttl pnt))) - (cond - ((= cmp 0) ; Title contains point. - (setq contained t) - t) - ((> cmp 0) ; Title after point. - t)))) + (lambda (ttl) + (let ((cmp (rst-Ttl-contains ttl pnt))) + (cond + ((= cmp 0) ; Title contains point. + (setq contained t) + t) + ((> cmp 0) ; Title after point. + t)))) ttls) ;; Point after all titles. count)) @@ -3290,8 +3290,8 @@ remove all indentation (CNT = 0). A tab is taken from the text above. If no suitable tab is found `rst-indent-width' is used." (interactive "r\np") (let ((tabs (sort (rst-compute-tabs beg) - #'(lambda (x y) - (<= x y)))) + (lambda (x y) + (<= x y)))) (leftmostcol (rst-find-leftmost-column beg end))) (when (or (> leftmostcol 0) (> cnt 0)) ;; Apply the indent. @@ -3306,8 +3306,8 @@ above. If no suitable tab is found `rst-indent-width' is used." (dir (cl-signum cnt)) ; Direction to take. (abs (abs cnt)) ; Absolute number of steps to take. ;; Get the position of the first tab beyond leftmostcol. - (fnd (cl-position-if #'(lambda (elt) - (funcall cmp elt leftmostcol)) + (fnd (cl-position-if (lambda (elt) + (funcall cmp elt leftmostcol)) tabs)) ;; Virtual position of tab. (pos (+ (or fnd len) (1- abs))) @@ -3492,20 +3492,20 @@ do all lines instead of just paragraphs." (indent "")) (rst-apply-indented-blocks beg end (rst-find-leftmost-column beg end) - #'(lambda (count in-first in-sub in-super in-empty _relind) - (cond - (in-empty) - (in-super) - ((zerop count)) - (in-sub - (insert indent)) - ((or in-first all) - (let ((tag (format "%d. " (cl-incf enum)))) - (setq indent (make-string (length tag) ? )) - (insert tag))) - (t - (insert indent))) - nil)))) + (lambda (count in-first in-sub in-super in-empty _relind) + (cond + (in-empty) + (in-super) + ((zerop count)) + (in-sub + (insert indent)) + ((or in-first all) + (let ((tag (format "%d. " (cl-incf enum)))) + (setq indent (make-string (length tag) ? )) + (insert tag))) + (t + (insert indent))) + nil)))) ;; FIXME: Does not deal with deeper indentation - although ;; `rst-apply-indented-blocks' could. @@ -3520,18 +3520,18 @@ do all lines instead of just paragraphs." (indent (make-string (length bul) ? ))) (rst-apply-indented-blocks beg end (rst-find-leftmost-column beg end) - #'(lambda (count in-first in-sub in-super in-empty _relind) - (cond - (in-empty) - (in-super) - ((zerop count)) - (in-sub - (insert indent)) - ((or in-first all) - (insert bul)) - (t - (insert indent))) - nil)))) + (lambda (count in-first in-sub in-super in-empty _relind) + (cond + (in-empty) + (in-super) + ((zerop count)) + (in-sub + (insert indent)) + ((or in-first all) + (insert bul)) + (t + (insert indent))) + nil)))) ;; FIXME: Does not deal with a varying number of digits appropriately. ;; FIXME: Does not deal with multiple levels independently. @@ -3561,11 +3561,11 @@ Region is from BEG to END. With WITH-EMPTY prefix empty lines too." (let ((ind (rst-find-leftmost-column beg end))) (rst-apply-indented-blocks beg end ind - #'(lambda (_count _in-first _in-sub in-super in-empty _relind) - (when (and (not in-super) (or with-empty (not in-empty))) - (move-to-column ind t) - (insert "| ")) - nil)))) + (lambda (_count _in-first _in-sub in-super in-empty _relind) + (when (and (not in-super) (or with-empty (not in-empty))) + (move-to-column ind t) + (insert "| ")) + nil)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -4085,16 +4085,16 @@ end of the buffer) return nil and do not move point." (setq fnd (rst-apply-indented-blocks (line-beginning-position 2) ; Skip the current line (or limit (point-max)) (or column (current-column)) - #'(lambda (_count _in-first _in-sub in-super in-empty _relind) - (cond - (in-empty - (setq candidate (or candidate (line-beginning-position))) - nil) - (in-super - (or candidate (line-beginning-position))) - (t ; Non-empty, same or more indented line. - (setq candidate nil) - nil))))) + (lambda (_count _in-first _in-sub in-super in-empty _relind) + (cond + (in-empty + (setq candidate (or candidate (line-beginning-position))) + nil) + (in-super + (or candidate (line-beginning-position))) + (t ; Non-empty, same or more indented line. + (setq candidate nil) + nil))))) (when fnd (goto-char fnd)))) commit a9645338e4109570ec64c902526d028c75e4369f Author: Stefan Monnier Date: Fri Apr 2 09:40:22 2021 -0400 * doc/misc/reftex.texi: Remove outdated instructions (Building and Installing, Installation with make) (Installation by Hand, Loading @RefTeX{}): Delete sections. (Entering @RefTeX{} Mode): Merge into its parent. (AUCTeX): Point to GNU ELPA for installation. (Problems and Work-Arounds): Remove XEmacs-specific item. diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index 599252fabf..f1074d3d14 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi @@ -254,73 +254,6 @@ version 20.2. It has also been bundled and pre-installed with XEmacs plug-in package which is available from the @value{XEMACSFTP}. See the XEmacs 21.x documentation on package installation for details. -Users of earlier Emacs distributions (including Emacs 19) or people -craving for new features and bugs can get a copy of the @RefTeX{} -distribution from the maintainer's web page. @xref{Imprint}, for more -information. The following instructions will guide you through the -process of installing such a distribution. - -@subsection Building and Installing - -Note: Currently installation is supported for Emacs only. XEmacs users -might want to refer to the @RefTeX{} package available through the -package system of XEmacs. - -@subsubheading Installation with make - -In order to install RefTeX, unpack the distribution and edit the header -of the Makefile. Basically, you need to change the path specifications -for Emacs Lisp files and info files. Also, enter the name of your Emacs -executable (usually either @samp{emacs} or @samp{xemacs}). - -Then, type - -@example -make -make install -@end example - -to compile and install the code and documentation. - -Per default @RefTeX{} is installed in its own subdirectory which might -not be on your load path. In this case, add it to load path with a -command like the following, replacing the sample directory with the one -where @RefTeX{} is installed in your case. - -@example -(add-to-list 'load-path "/path/to/reftex") -@end example - -Put this command into your init file before other @RefTeX{}-related -settings. - -@subsubheading Installation by Hand - -If you want to get your hands dirty, there is also the possibility to -install by manually copying files. - -@enumerate a -@item -Copy the reftex*.el lisp files to a directory on your load path. Make -sure that no old copy of @RefTeX{} shadows these files. -@item -Byte compile the files. The sequence of compiling should be: -reftex-var.el, reftex.el, and then all the others. -@item -Copy the info file reftex.info to the info directory. -@end enumerate - -@subsection Loading @RefTeX{} - -In order to make the most important functions for entering @RefTeX{} -mode available add the following line to your init file. - -@example -(require 'reftex) -@end example - -@subsection Entering @RefTeX{} Mode - @findex turn-on-reftex @findex reftex-mode @vindex LaTeX-mode-hook @@ -3259,9 +3192,9 @@ with the @kbd{g} key. To get this behavior, use instead @AUCTeX{} is without doubt the best major mode for editing @TeX{} and @LaTeX{} files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}). -If @AUCTeX{} is not part of your Emacs distribution, you can get -it@footnote{XEmacs 21.x users may want to install the corresponding -XEmacs package.} by FTP from the @value{AUCTEXSITE}. +You can get it from its home page at @value{AUCTEXSITE}, but since +it is available from GNU ELPA, you can simply install it from @kbd{M-x +list-packages}. @menu * AUCTeX-RefTeX Interface:: How both packages work together @@ -3610,18 +3543,6 @@ as a label of type @code{?p}. Argument count for this macro starts only after the @samp{@{step+@}}, also when specifying how to get context. -@item -@b{Idle timers in XEmacs}@* -@cindex Idle timer restart -@vindex reftex-use-itimer-in-xemacs -In XEmacs, idle timer restart does not work reliably after fast -keystrokes. Therefore @RefTeX{} currently uses the post command -hook to start the timer used for automatic crossref information. When -this bug gets fixed, a real idle timer can be requested with -@lisp -(setq reftex-use-itimer-in-xemacs t) -@end lisp - @item @b{Viper mode}@* @cindex Viper mode commit dcc3212809d7cbcfe3cb0be291c132c75aedb7af Author: Arash Esbati Date: Tue Mar 30 19:59:15 2021 +0200 Delete XEmacs-only definition * lisp/textmodes/reftex-vars.el (reftex-label-regexps): Remove XEmacs compat code. diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index a65772da1a..0d6bfb5d86 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -888,50 +888,46 @@ DOWNCASE t: Downcase words before using them." (string :tag "")) (option (boolean :tag "Downcase words ")))) -(if (featurep 'xemacs) - ;; XEmacs 21.5 doesn't have explicitly numbered matching groups, - ;; so this list mustn't get any more items. - (defconst reftex-label-regexps '("\\\\label{\\([^}]*\\)}")) - (defcustom reftex-label-regexps - `(;; Normal \\label{foo} labels - "\\\\label{\\(?1:[^}]*\\)}" - ;; keyvals [..., label = {foo}, ...] forms used by ctable, - ;; listings, breqn, ... - ,(concat - ;; Make sure we search only for optional arguments of - ;; environments/macros and don't match any other [. ctable - ;; provides a macro called \ctable, beamer/breqn/listings have - ;; environments. Start with a backslash and a group for names - "\\\\\\(?:" - ;; begin, optional spaces and opening brace - "begin[[:space:]]*{" - ;; Build a regexp for env names - (regexp-opt '("lstlisting" "dmath" "dseries" "dgroup" - "darray" "frame")) - ;; closing brace, optional spaces - "}[[:space:]]*" - ;; Now for macros - "\\|" - ;; Build a regexp for macro names; currently only \ctable - (regexp-opt '("ctable")) - ;; Close the group for names - "\\)" - ;; Match the opening [ and the following chars - "\\[[^][]*" - ;; Allow nested levels of chars enclosed in braces - "\\(?:{[^}{]*" - "\\(?:{[^}{]*" - "\\(?:{[^}{]*}[^}{]*\\)*" - "}[^}{]*\\)*" - "}[^][]*\\)*" - ;; Match the label key - "\\