commit 80837653ebc588a026e756c482678774941d538f (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Thu Aug 11 08:41:11 2022 +0200 ; Fix typo in tramp-archive.el * lisp/net/tramp-archive.el (tramp-archive-file-name-handler): Fix typo. (Bug#57130) diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index fda1441615..548999ca1d 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -325,7 +325,7 @@ arguments to pass to the OPERATION." ;; Starting with Emacs 29, `tramp-archive-file-name-handler' is ;; autoloaded. But it must still be in tramp-loaddefs.el for older ;; Emacsen. -;;;###autoload(autoload 'tramp-archive-file-name-handler "tramp-archine") +;;;###autoload(autoload 'tramp-archive-file-name-handler "tramp-archive") ;;;###tramp-autoload (defun tramp-archive-file-name-handler (operation &rest args) "Invoke the file archive related OPERATION. commit 7d70320f35af6880d6bbd83a1f52694f43374fd2 Merge: edffda8609 648acc8848 Author: Stefan Kangas Date: Thu Aug 11 06:30:24 2022 +0200 Merge from origin/emacs-28 648acc8848 ; Fix @setfilename in calc.texi commit edffda8609bd5828c08dceea30f2373bbcfe7c1c Author: Po Lu Date: Thu Aug 11 09:56:15 2022 +0800 Adjust client pointer upon help event * src/xterm.c (handle_one_xevent): Keep track of the device that set do_help and make it the client pointer so that tooltips show up under the right pointer. diff --git a/src/xterm.c b/src/xterm.c index 17043e078c..4372fdb959 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -17316,6 +17316,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, union buffered_input_event inev; int count = 0; int do_help = 0; +#ifdef HAVE_XINPUT2 + struct xi_device_t *gen_help_device; + Time gen_help_time; +#endif ptrdiff_t nbytes = 0; struct frame *any, *f = NULL; Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; @@ -17345,6 +17349,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, EVENT_INIT (inev.ie); inev.ie.kind = NO_EVENT; inev.ie.arg = Qnil; +#ifdef HAVE_XINPUT2 + gen_help_device = NULL; +#endif /* Ignore events coming from various extensions, such as XFIXES and XKB. */ @@ -21270,7 +21277,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, has changed, generate a HELP_EVENT. */ if (!NILP (help_echo_string) || !NILP (previous_help_echo_string)) - do_help = 1; + { + /* Also allow the focus and client pointer to be + adjusted accordingly, in case a help tooltip is + shown. */ + gen_help_device = device; + gen_help_time = xev->time; + + do_help = 1; + } goto XI_OTHER; } @@ -23207,6 +23222,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (do_help > 0) { any_help_event_p = true; +#ifdef HAVE_XINPUT2 + if (gen_help_device) + xi_handle_interaction (dpyinfo, f, + gen_help_device, + gen_help_time); +#endif gen_help_event (help_echo_string, frame, help_echo_window, help_echo_object, help_echo_pos); } commit e7b348b08ac5cea01141ece6b06f95c6d0b8c292 Author: Eli Zaretskii Date: Wed Aug 10 15:31:59 2022 +0300 Fix 'describe-char' in "C" locale * lisp/descr-text.el (describe-char): Avoid assertions if 'buffer-file-coding-system' is nil. (Bug#57066) diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 16971aa661..7fad031add 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -655,7 +655,9 @@ The character information includes: ("file code" ,@(if multibyte-p (let* ((coding buffer-file-coding-system) - (encoded (encode-coding-char char coding charset))) + (encoded + (and coding + (encode-coding-char char coding charset)))) (if encoded (list (encoded-string-description encoded coding) (format "(encoded by coding system %S)" commit bca31619e8d862e57cce443f7357af187283e0df Author: Visuwesh Date: Tue Aug 9 21:12:39 2022 +0530 Improve the bengali-probhat input method * lisp/leim/quail/indian.el ("bengali-probhat"): Set KBD-TRANSLATE and SHOW-LAYOUT flags non-nil. This makes the IM usable with Dvorak keyboard and also shows more useful help. Reported by Akib Azmain Turja . diff --git a/lisp/leim/quail/indian.el b/lisp/leim/quail/indian.el index e652f108dd..431d8369c1 100644 --- a/lisp/leim/quail/indian.el +++ b/lisp/leim/quail/indian.el @@ -702,7 +702,7 @@ is." ;; Probhat Input Method (quail-define-package "bengali-probhat" "Bengali" "BngPB" t - "Probhat keyboard for Bengali/Bangla" nil t nil nil nil nil nil nil nil nil t) + "Probhat keyboard for Bengali/Bangla" nil t nil t t nil nil nil nil nil t) (quail-define-rules ("!" ?!) commit 648acc8848422ef07fd1620a4ce1444d636db27b (refs/remotes/origin/emacs-28) Author: Eli Zaretskii Date: Wed Aug 10 14:57:07 2022 +0300 ; Fix @setfilename in calc.texi * doc/misc/calc.texi: Move the @setfilename command to its proper place. (Bug#57107) diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index d83edc15f3..32d2dd6f24 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -1,7 +1,7 @@ \input texinfo @c -*- mode: texinfo; coding: utf-8 -*- +@setfilename ../../info/calc.info @comment %**start of header (This is for running Texinfo on a region.) @c smallbook -@setfilename ../../info/calc.info @c [title] @settitle GNU Emacs Calc Manual @include docstyle.texi commit 8c0c9398f324bed79200c85ca9b0d4e95bf4a686 Author: Po Lu Date: Wed Aug 10 19:30:55 2022 +0800 Fix some undesirable frame focus changes * src/xterm.c (handle_one_xevent): Only detach upon actual device tree change. diff --git a/src/xterm.c b/src/xterm.c index 41537ade15..17043e078c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -22436,11 +22436,14 @@ handle_one_xevent (struct x_display_info *dpyinfo, case XI_HierarchyChanged: { - XIHierarchyEvent *hev = (XIHierarchyEvent *) xi_event; + XIHierarchyEvent *hev; XIDeviceInfo *info; int i, ndevices, n_disabled, *disabled; struct xi_device_t *device; + bool any_changed; + any_changed = false; + hev = (XIHierarchyEvent *) xi_event; disabled = SAFE_ALLOCA (sizeof *disabled * hev->num_info); n_disabled = 0; @@ -22450,8 +22453,17 @@ handle_one_xevent (struct x_display_info *dpyinfo, { /* Handle all disabled devices now, to prevent things happening out-of-order later. */ - xi_disable_devices (dpyinfo, disabled, n_disabled); - n_disabled = 0; + + if (ndevices) + { + xi_disable_devices (dpyinfo, disabled, n_disabled); + n_disabled = 0; + + /* This flag really just means that disabled + devices were handled early and should be + used in conjunction with n_disabled. */ + any_changed = true; + } x_catch_errors (dpyinfo->display); info = XIQueryDevice (dpyinfo->display, hev->info[i].deviceid, @@ -22502,9 +22514,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, event. */ xi_disable_devices (dpyinfo, disabled, n_disabled); - /* Now that the device hierarchy has been changed, - recompute focus. */ - xi_handle_focus_change (dpyinfo); + /* If the device hierarchy has been changed, recompute + focus. This might seem like a micro-optimization but + it actually keeps the focus from changing in some + cases where it would be undesierable. */ + if (any_changed || n_disabled) + xi_handle_focus_change (dpyinfo); goto XI_OTHER; } commit d8d582dc3c30e184e6f849eb302d0c89be019c83 Author: Mattias EngdegÄrd Date: Wed Aug 10 13:06:12 2022 +0200 ; * lisp/emacs-lisp/subr-x.el (string-pad): Optimise. diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index b7083bfe7c..1cce97cdb1 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -254,13 +254,9 @@ the string." (unless (natnump length) (signal 'wrong-type-argument (list 'natnump length))) (let ((pad-length (- length (length string)))) - (if (< pad-length 0) - string - (concat (and start - (make-string pad-length (or padding ?\s))) - string - (and (not start) - (make-string pad-length (or padding ?\s))))))) + (cond ((<= pad-length 0) string) + (start (concat (make-string pad-length (or padding ?\s)) string)) + (t (concat string (make-string pad-length (or padding ?\s))))))) (defun string-chop-newline (string) "Remove the final newline (if any) from STRING." commit f6356dc88d23eb405aa6d8bd9dd5f669f1bc45ee Author: Stefan Kangas Date: Wed Aug 10 12:54:31 2022 +0200 Make gdb-pad-string obsolete in favor of string-pad * lisp/progmodes/gdb-mi.el (subr-x): Require. (gdb-pad-string): Make obsolete in favor of 'string-pad'. Update callers. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 9c2c640525..6f67eff31a 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -92,6 +92,7 @@ (require 'cl-seq) (require 'bindat) (eval-when-compile (require 'pcase)) +(require 'subr-x) ; `string-pad' (declare-function speedbar-change-initial-expansion-list "speedbar" (new-default)) @@ -2943,7 +2944,8 @@ Return position where LINE begins." start-posn))) (defun gdb-pad-string (string padding) - (format (concat "%" (number-to-string padding) "s") string)) + (declare (obsolete string-pad "29.1")) + (string-pad string padding nil t)) ;; gdb-table struct is a way to programmatically construct simple ;; tables. It help to reliably align columns of data in GDB buffers @@ -2985,13 +2987,13 @@ calling `gdb-table-string'." "Return TABLE as a string with columns separated with SEP." (let ((column-sizes (gdb-table-column-sizes table))) (mapconcat - 'identity + #'identity (cl-mapcar (lambda (row properties) - (apply 'propertize - (mapconcat 'identity - (cl-mapcar (lambda (s x) (gdb-pad-string s x)) - row column-sizes) + (apply #'propertize + (mapconcat #'identity + (cl-mapcar (lambda (s x) (string-pad s x nil t)) + row column-sizes) sep) properties)) (gdb-table-rows table) @@ -3688,10 +3690,11 @@ in `gdb-memory-format'." (dolist (row memory) (insert (concat (gdb-mi--field row 'addr) ":")) (dolist (column (gdb-mi--field row 'data)) - (insert (gdb-pad-string column - (+ 2 (gdb-memory-column-width - gdb-memory-unit - gdb-memory-format))))) + (insert (string-pad column + (+ 2 (gdb-memory-column-width + gdb-memory-unit + gdb-memory-format)) + nil t))) (newline))) ;; Show last page instead of empty buffer when out of bounds (when gdb-memory-last-address commit 9d35afed49896928433bb28a781b6060bc1601b1 Author: Mattias EngdegÄrd Date: Tue Aug 9 10:57:46 2022 +0200 Extend LAP optimisations to more operations Extend the set of eligible opcodes for certain peephole transformations, which then provide further optimisation opportunities. * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Optimise empty save-current-buffer in the same way as we already do for save-excursion and save-restriction. This is safe because (save-current-buffer) is a no-op. (byte-compile-side-effect-and-error-free-ops): Add list3, list4 and listN. These were all apparent oversights as list1 and list2 were already included. (byte-after-unbind-ops): Add stack-ref, stack-set, discard, list3, list4 and listN. Stack manipulation is safe because unbind cannot read or modify stack entries. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 7a4bbf2e8a..a7edecfac7 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1747,10 +1747,10 @@ See Info node `(elisp) Integer Basics'." byte-goto-if-not-nil-else-pop)) (defconst byte-after-unbind-ops - '(byte-constant byte-dup + '(byte-constant byte-dup byte-stack-ref byte-stack-set byte-discard byte-symbolp byte-consp byte-stringp byte-listp byte-numberp byte-integerp byte-eq byte-not - byte-cons byte-list1 byte-list2 ; byte-list3 byte-list4 + byte-cons byte-list1 byte-list2 byte-list3 byte-list4 byte-listN byte-interactive-p) ;; How about other side-effect-free-ops? Is it safe to move an ;; error invocation (such as from nth) out of an unwind-protect? @@ -1762,7 +1762,8 @@ See Info node `(elisp) Integer Basics'." (defconst byte-compile-side-effect-and-error-free-ops '(byte-constant byte-dup byte-symbolp byte-consp byte-stringp byte-listp byte-integerp byte-numberp byte-eq byte-equal byte-not byte-car-safe - byte-cdr-safe byte-cons byte-list1 byte-list2 byte-point byte-point-max + byte-cdr-safe byte-cons byte-list1 byte-list2 byte-list3 byte-list4 + byte-listN byte-point byte-point-max byte-point-min byte-following-char byte-preceding-char byte-current-column byte-eolp byte-eobp byte-bolp byte-bobp byte-current-buffer byte-stack-ref)) @@ -2113,13 +2114,15 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." (setcar (cdr rest) lap0) (setq keep-going t)) ;; - ;; varbind-X unbind-N --> discard unbind-(N-1) - ;; save-excursion unbind-N --> unbind-(N-1) - ;; save-restriction unbind-N --> unbind-(N-1) + ;; varbind-X unbind-N --> discard unbind-(N-1) + ;; save-excursion unbind-N --> unbind-(N-1) + ;; save-restriction unbind-N --> unbind-(N-1) + ;; save-current-buffer unbind-N --> unbind-(N-1) ;; ((and (eq 'byte-unbind (car lap1)) (memq (car lap0) '(byte-varbind byte-save-excursion - byte-save-restriction)) + byte-save-restriction + byte-save-current-buffer)) (< 0 (cdr lap1))) (if (zerop (setcdr lap1 (1- (cdr lap1)))) (delq lap1 rest)) commit 1d9ee2727046c1ca405e8c5a03069b0254d1277d Author: Lars Ingebrigtsen Date: Wed Aug 10 12:31:20 2022 +0200 Fix compilation warning in wisent/comp.el * lisp/cedet/semantic/wisent/comp.el (require): string-pad is used run-time. diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 17cd3b1d59..e24f6128a6 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -38,7 +38,7 @@ ;;; Code: (require 'semantic/wisent) (eval-when-compile (require 'cl-lib)) -(eval-when-compile (require 'subr-x)) ; `string-pad' +(require 'subr-x) ; `string-pad' ;;;; ------------------- ;;;; Misc. useful things commit 8b31c18fc8669e3b6e493769c7e033ddea08375c Author: Stefan Kangas Date: Wed Aug 10 11:53:27 2022 +0200 Prefer defvar-keymap in vc/*.el * lisp/vc/add-log.el (change-log-mode-map): * lisp/vc/ediff-mult.el (ediff-dir-diffs-buffer-map): * lisp/vc/vc-annotate.el (vc-annotate-mode-map): * lisp/vc/vc-bzr.el (vc-bzr-shelve-map): * lisp/vc/vc-dir.el (vc-dir-status-mouse-map) (vc-dir-filename-mouse-map): * lisp/vc/vc-git.el (vc-git-stash-shared-map, vc-git-stash-map) (vc-git-stash-button-map, vc-git-log-edit-mode-map): * lisp/vc/vc-hg.el (vc-hg-log-edit-mode-map) (vc-hg-extra-menu-map): * lisp/vc/vc-hooks.el (vc-prefix-map): Prefer defvar-keymap. diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index e02d84f1f5..d710578fff 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -568,14 +568,12 @@ Compatibility function for \\[next-error] invocations." ;; Select window displaying source file. (select-window change-log-find-window))))) -(defvar change-log-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [?\C-c ?\C-p] #'add-log-edit-prev-comment) - (define-key map [?\C-c ?\C-n] #'add-log-edit-next-comment) - (define-key map [?\C-c ?\C-f] #'change-log-find-file) - (define-key map [?\C-c ?\C-c] #'change-log-goto-source) - map) - "Keymap for Change Log major mode.") +(defvar-keymap change-log-mode-map + :doc "Keymap for Change Log major mode." + "C-c C-p" #'add-log-edit-prev-comment + "C-c C-n" #'add-log-edit-next-comment + "C-c C-f" #'change-log-find-file + "C-c C-c" #'change-log-goto-source) (easy-menu-define change-log-mode-menu change-log-mode-map "Menu for Change Log major mode." diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index 7e15060f8c..52e356d8e9 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -144,20 +144,18 @@ Useful commands (type ? to hide them and free up screen): (ediff-defvar-local ediff-meta-buffer-map nil "The keymap for the meta buffer.") -(defvar ediff-dir-diffs-buffer-map - (let ((map (make-sparse-keymap))) - (suppress-keymap map) - (define-key map "q" #'ediff-bury-dir-diffs-buffer) - (define-key map " " #'next-line) - (define-key map "n" #'next-line) - (define-key map "\C-?" #'previous-line) - (define-key map "p" #'previous-line) - (define-key map "C" #'ediff-dir-diff-copy-file) - (define-key map [mouse-2] #'ediff-dir-diff-copy-file) - (define-key map [delete] #'previous-line) - (define-key map [backspace] #'previous-line) - map) - "Keymap for buffer showing differences between directories.") +(defvar-keymap ediff-dir-diffs-buffer-map + :doc "Keymap for buffer showing differences between directories." + :suppress t + "q" #'ediff-bury-dir-diffs-buffer + "SPC" #'next-line + "n" #'next-line + "DEL" #'previous-line + "p" #'previous-line + "C" #'ediff-dir-diff-copy-file + "" #'ediff-dir-diff-copy-file + "" #'previous-line + "" #'previous-line) ;; Variable specifying the action to take when the use invokes ediff in the ;; meta buffer. This is usually ediff-registry-action or ediff-filegroup-action diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index 1f19c4cfe2..a15cf417de 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -162,22 +162,20 @@ List of factors, used to expand/compress the time scale. See `vc-annotate'." :type '(repeat number) :group 'vc) -(defvar vc-annotate-mode-map - (let ((m (make-sparse-keymap))) - (define-key m "a" #'vc-annotate-revision-previous-to-line) - (define-key m "d" #'vc-annotate-show-diff-revision-at-line) - (define-key m "=" #'vc-annotate-show-diff-revision-at-line) - (define-key m "D" #'vc-annotate-show-changeset-diff-revision-at-line) - (define-key m "f" #'vc-annotate-find-revision-at-line) - (define-key m "j" #'vc-annotate-revision-at-line) - (define-key m "l" #'vc-annotate-show-log-revision-at-line) - (define-key m "n" #'vc-annotate-next-revision) - (define-key m "p" #'vc-annotate-prev-revision) - (define-key m "w" #'vc-annotate-working-revision) - (define-key m "v" #'vc-annotate-toggle-annotation-visibility) - (define-key m "\C-m" #'vc-annotate-goto-line) - m) - "Local keymap used for VC-Annotate mode.") +(defvar-keymap vc-annotate-mode-map + :doc "Local keymap used for VC-Annotate mode." + "a" #'vc-annotate-revision-previous-to-line + "d" #'vc-annotate-show-diff-revision-at-line + "=" #'vc-annotate-show-diff-revision-at-line + "D" #'vc-annotate-show-changeset-diff-revision-at-line + "f" #'vc-annotate-find-revision-at-line + "j" #'vc-annotate-revision-at-line + "l" #'vc-annotate-show-log-revision-at-line + "n" #'vc-annotate-next-revision + "p" #'vc-annotate-prev-revision + "w" #'vc-annotate-working-revision + "v" #'vc-annotate-toggle-annotation-visibility + "RET" #'vc-annotate-goto-line) ;;; Annotate functionality diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 072bd72b44..f6b17d4ce0 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -1008,19 +1008,17 @@ stream. Standard error output is discarded." ;; frob the results accordingly. (file-relative-name dir (vc-bzr-root dir))))) -(defvar vc-bzr-shelve-map - (let ((map (make-sparse-keymap))) - ;; Turn off vc-dir marking - (define-key map [mouse-2] #'ignore) - - (define-key map [down-mouse-3] #'vc-bzr-shelve-menu) - (define-key map "\C-k" #'vc-bzr-shelve-delete-at-point) - (define-key map "=" #'vc-bzr-shelve-show-at-point) - (define-key map "\C-m" #'vc-bzr-shelve-show-at-point) - (define-key map "A" #'vc-bzr-shelve-apply-and-keep-at-point) - (define-key map "P" #'vc-bzr-shelve-apply-at-point) - (define-key map "S" #'vc-bzr-shelve-snapshot) - map)) +(defvar-keymap vc-bzr-shelve-map + ;; Turn off vc-dir marking + "" #'ignore + + "" #'vc-bzr-shelve-menu + "C-k" #'vc-bzr-shelve-delete-at-point + "=" #'vc-bzr-shelve-show-at-point + "RET" #'vc-bzr-shelve-show-at-point + "A" #'vc-bzr-shelve-apply-and-keep-at-point + "P" #'vc-bzr-shelve-apply-at-point + "S" #'vc-bzr-shelve-snapshot) (defvar vc-bzr-shelve-menu-map (let ((map (make-sparse-keymap "Bzr Shelve"))) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 9335da1006..068a66b25b 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1467,17 +1467,13 @@ These are the commands available for use in the file status buffer: (propertize "Please add backend specific headers here. It's easy!" 'face 'vc-dir-status-warning))) -(defvar vc-dir-status-mouse-map - (let ((map (make-sparse-keymap))) - (define-key map [mouse-2] #'vc-dir-toggle-mark) - map) - "Local keymap for toggling mark.") +(defvar-keymap vc-dir-status-mouse-map + :doc "Local keymap for toggling mark." + "" #'vc-dir-toggle-mark) -(defvar vc-dir-filename-mouse-map - (let ((map (make-sparse-keymap))) - (define-key map [mouse-2] #'vc-dir-find-file-other-window) - map) - "Local keymap for visiting a file.") +(defvar-keymap vc-dir-filename-mouse-map + :doc "Local keymap for visiting a file." + "" #'vc-dir-find-file-other-window) (defun vc-default-dir-printer (_backend fileentry) "Pretty print FILEENTRY." diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 8937454d11..46a486a46c 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -664,32 +664,26 @@ or an empty string if none." :files files :update-function update-function))) -(defvar vc-git-stash-shared-map - (let ((map (make-sparse-keymap))) - (define-key map "S" #'vc-git-stash-snapshot) - (define-key map "C" #'vc-git-stash) - map)) - -(defvar vc-git-stash-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map vc-git-stash-shared-map) - ;; Turn off vc-dir marking - (define-key map [mouse-2] #'ignore) - - (define-key map [down-mouse-3] #'vc-git-stash-menu) - (define-key map "\C-k" #'vc-git-stash-delete-at-point) - (define-key map "=" #'vc-git-stash-show-at-point) - (define-key map "\C-m" #'vc-git-stash-show-at-point) - (define-key map "A" #'vc-git-stash-apply-at-point) - (define-key map "P" #'vc-git-stash-pop-at-point) - map)) - -(defvar vc-git-stash-button-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map vc-git-stash-shared-map) - (define-key map [mouse-2] #'push-button) - (define-key map "\C-m" #'push-button) - map)) +(defvar-keymap vc-git-stash-shared-map + "S" #'vc-git-stash-snapshot + "C" #'vc-git-stash) + +(defvar-keymap vc-git-stash-map + :parent vc-git-stash-shared-map + ;; Turn off vc-dir marking + "" #'ignore + + "" #'vc-git-stash-menu + "C-k" #'vc-git-stash-delete-at-point + "=" #'vc-git-stash-show-at-point + "RET" #'vc-git-stash-show-at-point + "A" #'vc-git-stash-apply-at-point + "P" #'vc-git-stash-pop-at-point) + +(defvar-keymap vc-git-stash-button-map + :parent vc-git-stash-shared-map + "" #'push-button + "RET" #'push-button) (defconst vc-git-stash-shared-help "\\\\[vc-git-stash]: Create named stash\n\\[vc-git-stash-snapshot]: Snapshot stash") @@ -910,12 +904,11 @@ If toggling on, also insert its message into the buffer." standard-output 1 nil "log" "--max-count=1" "--pretty=format:%B" "HEAD"))))) -(defvar vc-git-log-edit-mode-map - (let ((map (make-sparse-keymap "Git-Log-Edit"))) - (define-key map "\C-c\C-s" #'vc-git-log-edit-toggle-signoff) - (define-key map "\C-c\C-n" #'vc-git-log-edit-toggle-no-verify) - (define-key map "\C-c\C-e" #'vc-git-log-edit-toggle-amend) - map)) +(defvar-keymap vc-git-log-edit-mode-map + :name "Git-Log-Edit" + "C-c C-s" #'vc-git-log-edit-toggle-signoff + "C-c C-n" #'vc-git-log-edit-toggle-no-verify + "C-c C-e" #'vc-git-log-edit-toggle-amend) (define-derived-mode vc-git-log-edit-mode log-edit-mode "Log-Edit/git" "Major mode for editing Git log messages. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 5fba2b3908..61976288e3 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1177,10 +1177,9 @@ If toggling on, also insert its message into the buffer." standard-output 1 nil "log" "--limit=1" "--template" "{desc}"))))) -(defvar vc-hg-log-edit-mode-map - (let ((map (make-sparse-keymap "Hg-Log-Edit"))) - (define-key map "\C-c\C-e" #'vc-hg-log-edit-toggle-amend) - map)) +(defvar-keymap vc-hg-log-edit-mode-map + :name "Hg-Log-Edit" + "C-c C-e" #'vc-hg-log-edit-toggle-amend) (define-derived-mode vc-hg-log-edit-mode log-edit-mode "Log-Edit/hg" "Major mode for editing Hg log messages. @@ -1262,9 +1261,7 @@ REV is the revision to check out into WORKFILE." ;;; Hg specific functionality. -(defvar vc-hg-extra-menu-map - (let ((map (make-sparse-keymap))) - map)) +(defvar-keymap vc-hg-extra-menu-map) (defun vc-hg-extra-menu () vc-hg-extra-menu-map) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 405c9bc2ca..1f0eeb7e18 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -855,38 +855,37 @@ In the latter case, VC mode is deactivated for this buffer." ;; Autoloading works fine, but it prevents shortcuts from appearing ;; in the menu because they don't exist yet when the menu is built. ;; (autoload 'vc-prefix-map "vc" nil nil 'keymap) -(defvar vc-prefix-map - (let ((map (make-sparse-keymap))) - (define-key map "a" #'vc-update-change-log) - (with-suppressed-warnings ((obsolete vc-switch-backend)) - (define-key map "b" #'vc-switch-backend)) - (define-key map "d" #'vc-dir) - (define-key map "g" #'vc-annotate) - (define-key map "G" #'vc-ignore) - (define-key map "h" #'vc-region-history) - (define-key map "i" #'vc-register) - (define-key map "l" #'vc-print-log) - (define-key map "L" #'vc-print-root-log) - (define-key map "I" #'vc-log-incoming) - (define-key map "O" #'vc-log-outgoing) - (define-key map "ML" #'vc-log-mergebase) - (define-key map "MD" #'vc-diff-mergebase) - (define-key map "m" #'vc-merge) - (define-key map "r" #'vc-retrieve-tag) - (define-key map "s" #'vc-create-tag) - (define-key map "u" #'vc-revert) - (define-key map "v" #'vc-next-action) - (define-key map "+" #'vc-update) - ;; I'd prefer some kind of symmetry with vc-update: - (define-key map "P" #'vc-push) - (define-key map "=" #'vc-diff) - (define-key map "D" #'vc-root-diff) - (define-key map "~" #'vc-revision-other-window) - (define-key map "x" #'vc-delete-file) - map)) +(defvar-keymap vc-prefix-map + "a" #'vc-update-change-log + "d" #'vc-dir + "g" #'vc-annotate + "G" #'vc-ignore + "h" #'vc-region-history + "i" #'vc-register + "l" #'vc-print-log + "L" #'vc-print-root-log + "I" #'vc-log-incoming + "O" #'vc-log-outgoing + "M L" #'vc-log-mergebase + "M D" #'vc-diff-mergebase + "m" #'vc-merge + "r" #'vc-retrieve-tag + "s" #'vc-create-tag + "u" #'vc-revert + "v" #'vc-next-action + "+" #'vc-update + ;; I'd prefer some kind of symmetry with vc-update: + "P" #'vc-push + "=" #'vc-diff + "D" #'vc-root-diff + "~" #'vc-revision-other-window + "x" #'vc-delete-file) (fset 'vc-prefix-map vc-prefix-map) (define-key ctl-x-map "v" 'vc-prefix-map) +(with-suppressed-warnings ((obsolete vc-switch-backend)) + (keymap-set vc-prefix-map "b" #'vc-switch-backend)) + (defvar vc-menu-map (let ((map (make-sparse-keymap "Version Control"))) ;;(define-key map [show-files] commit f002fa8bfc3a217fdce0d54c6b92220d9c8ad6f4 Author: Stefan Kangas Date: Wed Aug 10 11:27:14 2022 +0200 Delete dead code in checkdoc.el * lisp/emacs-lisp/checkdoc.el: Delete code commented out since 1997. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index ac589b82f8..04ead562f2 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1,6 +1,6 @@ ;;; checkdoc.el --- check documentation strings for style requirements -*- lexical-binding:t -*- -;; Copyright (C) 1997-1998, 2001-2022 Free Software Foundation, Inc. +;; Copyright (C) 1997-2022 Free Software Foundation, Inc. ;; Author: Eric M. Ludlam ;; Old-Version: 0.6.2 @@ -1357,23 +1357,6 @@ checking of documentation strings. checkdoc-common-verbs-wrong-voice "\\|") "\\)\\>")))) -;; Profiler says this is not yet faster than just calling assoc -;;(defun checkdoc-word-in-alist-vector (word vector) -;; "Check to see if WORD is in the car of an element of VECTOR. -;;VECTOR must be sorted. The CDR should be a replacement. Since the -;;word list is getting bigger, it is time for a quick bisecting search." -;; (let ((max (length vector)) (min 0) i -;; (found nil) (fw nil)) -;; (setq i (/ max 2)) -;; (while (and (not found) (/= min max)) -;; (setq fw (car (aref vector i))) -;; (cond ((string= word fw) (setq found (cdr (aref vector i)))) -;; ((string< word fw) (setq max i)) -;; (t (setq min i))) -;; (setq i (/ (+ max min) 2)) -;; ) -;; found)) - ;;; Checking engines ;; (defun checkdoc-this-string-valid (&optional take-notes) @@ -2860,8 +2843,6 @@ function called to create the messages." (custom-add-option 'emacs-lisp-mode-hook 'checkdoc-minor-mode) -;; Obsolete - (define-obsolete-function-alias 'checkdoc-run-hooks #'run-hook-with-args-until-success "28.1") (defvar checkdoc-version "0.6.2" commit 29f2b1728bf4fc3520c247f009e94c83fd62e5a0 Author: Stefan Kangas Date: Wed Aug 10 11:21:24 2022 +0200 Fix namespacing issues in array.el * lisp/array.el (array--limit-index, array-current-line) (array-move-to-column-untabify, array--untabify-backward): Rename from 'limit-index', 'current-line', 'move-to-column-untabify', and 'untabify-backward'. Update callers. diff --git a/lisp/array.el b/lisp/array.el index 08c5ff45dd..aed93ffb65 100644 --- a/lisp/array.el +++ b/lisp/array.el @@ -103,7 +103,7 @@ Set them to the optional arguments A-ROW and A-COLUMN if those are supplied." (defun array-update-buffer-position () "Set `array-buffer-line' and `array-buffer-column' to their current values." - (setq array-buffer-line (current-line) + (setq array-buffer-line (array-current-line) array-buffer-column (current-column))) @@ -113,7 +113,7 @@ Set them to the optional arguments A-ROW and A-COLUMN if those are supplied." (defun array-what-position () "Display the row and column in which the cursor is positioned." (interactive) - (let ((array-buffer-line (current-line)) + (let ((array-buffer-line (array-current-line)) (array-buffer-column (current-column))) (message "Array row: %s Array column: %s" (prin1-to-string (array-current-row)) @@ -147,13 +147,13 @@ Set them to the optional arguments A-ROW and A-COLUMN if those are supplied." ;;; Internal movement functions. (defun array-beginning-of-field (&optional go-there) - "Return the column of the beginning of the current field. + "Return the column of the beginning of the current field. Optional argument GO-THERE, if non-nil, means go there too." - ;; Requires that array-buffer-column be current. - (let ((goal-column (- array-buffer-column (% array-buffer-column array-field-width)))) - (if go-there - (move-to-column-untabify goal-column) - goal-column))) + ;; Requires that array-buffer-column be current. + (let ((goal-column (- array-buffer-column (% array-buffer-column array-field-width)))) + (if go-there + (array-move-to-column-untabify goal-column) + goal-column))) (defun array-end-of-field (&optional go-there) "Return the column of the end of the current array field. @@ -162,7 +162,7 @@ If optional argument GO-THERE is non-nil, go there too." (let ((goal-column (+ (- array-buffer-column (% array-buffer-column array-field-width)) array-field-width))) (if go-there - (move-to-column-untabify goal-column) + (array-move-to-column-untabify goal-column) goal-column))) (defun array-move-to-cell (a-row a-column) @@ -174,7 +174,7 @@ Leave point at the beginning of the field and return the new buffer column." (goal-column (* array-field-width (% (1- a-column) array-columns-per-line)))) (goto-char (point-min)) (forward-line goal-line) - (move-to-column-untabify goal-column))) + (array-move-to-column-untabify goal-column))) (defun array-move-to-row (a-row) "Move to array row A-ROW preserving the current array column. @@ -184,7 +184,7 @@ Leave point at the beginning of the field and return the new array row." (% array-buffer-line array-lines-per-row))) (goal-column (- array-buffer-column (% array-buffer-column array-field-width)))) (forward-line (- goal-line array-buffer-line)) - (move-to-column-untabify goal-column) + (array-move-to-column-untabify goal-column) a-row)) (defun array-move-to-column (a-column) @@ -196,7 +196,7 @@ Leave point at the beginning of the field and return the new array column." (floor (1- a-column) array-columns-per-line))) (goal-column (* array-field-width (% (1- a-column) array-columns-per-line)))) (forward-line (- goal-line array-buffer-line)) - (move-to-column-untabify goal-column) + (array-move-to-column-untabify goal-column) a-column)) (defun array-move-one-row (sign) @@ -214,7 +214,7 @@ If requested to move beyond the array bounds, signal an error." (t (progn (forward-line (* sign array-lines-per-row)) - (move-to-column-untabify goal-column) + (array-move-to-column-untabify goal-column) (+ array-row sign)))))) (defun array-move-one-column (sign) @@ -233,15 +233,15 @@ If requested to move beyond the array bounds, signal an error." ;; Going backward from first column on the line. ((and (= sign -1) (= 1 (% array-column array-columns-per-line))) (forward-line -1) - (move-to-column-untabify + (array-move-to-column-untabify (* array-field-width (1- array-columns-per-line)))) ;; Going forward from last column on the line. ((and (= sign 1) (zerop (% array-column array-columns-per-line))) (forward-line 1)) ;; Somewhere in the middle of the line. (t - (move-to-column-untabify (+ (array-beginning-of-field) - (* array-field-width sign))))) + (array-move-to-column-untabify (+ (array-beginning-of-field) + (* array-field-width sign))))) (+ array-column sign))))) (defun array-normalize-cursor () @@ -281,15 +281,15 @@ If necessary, scroll horizontally to keep the cursor in view." "Move down one array row, staying in the current array column. If optional ARG is given, move down ARG array rows." (interactive "p") - (let ((array-buffer-line (current-line)) + (let ((array-buffer-line (array-current-line)) (array-buffer-column (current-column))) (if (= (abs arg) 1) (array-move-one-row arg) (array-move-to-row - (limit-index (+ (or (array-current-row) - (error "Cursor is not in an array cell")) - arg) - array-max-row)))) + (array--limit-index (+ (or (array-current-row) + (error "Cursor is not in an array cell")) + arg) + array-max-row)))) (array-normalize-cursor)) (defun array-previous-row (&optional arg) @@ -303,15 +303,15 @@ If optional ARG is given, move up ARG array rows." If optional ARG is given, move forward ARG array columns. If necessary, keep the cursor in the window by scrolling right or left." (interactive "p") - (let ((array-buffer-line (current-line)) + (let ((array-buffer-line (array-current-line)) (array-buffer-column (current-column))) (if (= (abs arg) 1) (array-move-one-column arg) (array-move-to-column - (limit-index (+ (or (array-current-column) - (error "Cursor is not in an array cell")) - arg) - array-max-column)))) + (array--limit-index (+ (or (array-current-column) + (error "Cursor is not in an array cell")) + arg) + array-max-column)))) (array-normalize-cursor)) (defun array-backward-column (&optional arg) @@ -325,8 +325,8 @@ If necessary, keep the cursor in the window by scrolling right or left." "Go to array row A-ROW and array column A-COLUMN." (interactive "nArray row: \nnArray column: ") (array-move-to-cell - (limit-index a-row array-max-row) - (limit-index a-column array-max-column)) + (array--limit-index a-row array-max-row) + (array--limit-index a-column array-max-column)) (array-normalize-cursor)) @@ -417,7 +417,7 @@ Leave point at the beginning of the field." "Copy the current field one array row down. If optional ARG is given, copy down through ARG array rows." (interactive "p") - (let* ((array-buffer-line (current-line)) + (let* ((array-buffer-line (array-current-line)) (array-buffer-column (current-column)) (array-row (or (array-current-row) (error "Cursor is not in a valid array cell"))) @@ -425,7 +425,7 @@ If optional ARG is given, copy down through ARG array rows." (if (= (abs arg) 1) (array-copy-once-vertically arg) (array-copy-to-row - (limit-index (+ array-row arg) array-max-row)))) + (array--limit-index (+ array-row arg) array-max-row)))) (array-normalize-cursor)) (defun array-copy-up (&optional arg) @@ -438,7 +438,7 @@ If optional ARG is given, copy up through ARG array rows." "Copy the current field one array column to the right. If optional ARG is given, copy through ARG array columns to the right." (interactive "p") - (let* ((array-buffer-line (current-line)) + (let* ((array-buffer-line (array-current-line)) (array-buffer-column (current-column)) (array-column (or (array-current-column) (error "Cursor is not in a valid array cell"))) @@ -446,7 +446,7 @@ If optional ARG is given, copy through ARG array columns to the right." (if (= (abs arg) 1) (array-copy-once-horizontally arg) (array-copy-to-column - (limit-index (+ array-column arg) array-max-column)))) + (array--limit-index (+ array-column arg) array-max-column)))) (array-normalize-cursor)) (defun array-copy-backward (&optional arg) @@ -473,7 +473,7 @@ If optional ARG is given, copy through ARG array columns to the right." (if (= (abs arg) 1) (array-copy-once-horizontally arg) (array-copy-to-column - (limit-index (+ array-column arg) array-max-column)))))) + (array--limit-index (+ array-column arg) array-max-column)))))) (message "Working...done") (array-move-to-row array-row) (array-normalize-cursor)) @@ -506,7 +506,7 @@ If optional ARG is given, copy through ARG rows down." (forward-line 1) (point)))) (this-row array-row) - (goal-row (limit-index (+ this-row arg) array-max-row)) + (goal-row (array--limit-index (+ this-row arg) array-max-row)) (num (- goal-row this-row)) (count (abs num)) (sign (if (not (zerop count)) (/ num count)))) @@ -700,13 +700,13 @@ of `array-rows-numbered'." (floor (1- temp-max-column) new-columns-per-line)) (newlines-added 0)) (while (< newlines-removed newlines-to-be-removed) - (move-to-column-untabify + (array-move-to-column-untabify (* (1+ newlines-removed) old-line-length)) (kill-line 1) (setq newlines-removed (1+ newlines-removed))) (beginning-of-line) (while (< newlines-added newlines-to-be-added) - (move-to-column-untabify (* old-field-width new-columns-per-line)) + (array-move-to-column-untabify (* old-field-width new-columns-per-line)) (newline) (setq newlines-added (1+ newlines-added))) (forward-line 1)))) @@ -735,16 +735,16 @@ of `array-rows-numbered'." ;;; Utilities. -(defun limit-index (index limit) +(defun array--limit-index (index limit) (cond ((< index 1) 1) ((> index limit) limit) (t index))) -(defun current-line () +(defun array-current-line () "Return the current buffer line at point. The first line is 0." (count-lines (point-min) (line-beginning-position))) -(defun move-to-column-untabify (column) +(defun array-move-to-column-untabify (column) "Move to COLUMN on the current line, untabifying if necessary. Return COLUMN." (or (and (= column (move-to-column column)) @@ -753,10 +753,10 @@ Return COLUMN." (if array-respect-tabs (error "There is a TAB character in the way") (progn - (untabify-backward) + (array--untabify-backward) (move-to-column column))))) -(defun untabify-backward () +(defun array--untabify-backward () "Untabify the preceding TAB." (save-excursion (let ((start (point))) @@ -885,7 +885,10 @@ Entering array mode calls the function `array-mode-hook'." (setq-local truncate-lines t) (setq overwrite-mode 'overwrite-mode-textual)) - +(define-obsolete-function-alias 'limit-index #'array--limit-index "29.1") +(define-obsolete-function-alias 'current-line #'array-current-line "29.1") +(define-obsolete-function-alias 'move-to-column-untabify #'array-move-to-column-untabify "29.1") +(define-obsolete-function-alias 'untabify-backward #'array--untabify-backward "29.1") (provide 'array)