commit e3fc16fd71a46990503a71b11a2ad592e99d9edb (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat May 29 11:17:53 2021 +0300 Fix last change * lisp/international/quail.el (quail-add-unread-command-events): Fix wording of the doc string. Move the rationale for the function out of the doc string and into a comment. diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 33851f09a1..5d1311530a 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1368,19 +1368,22 @@ If STR has `advice' text property, append the following special event: (delete-region (overlay-start quail-overlay) (overlay-end quail-overlay)))) +;; Quail puts keys back in `unread-command-events' to be re-read +;; again, but these keys have already been recorded in recent-keys and +;; in the keyboard macro, if one is being defined, which means that +;; recording them again creates duplicates. This function is a +;; wrapper around adding input events to `unread-command-events', but +;; it makes sure these events will not be recorded a second time. (defun quail-add-unread-command-events (key &optional reset) - "Add KEY to `unread-command-events', ensuring that it is not recorded. + "Add KEY to `unread-command-events', but avoid recording it a second time. If KEY is a character, it is prepended to `unread-command-events' as a cons cell of the form (no-record . KEY). If KEY is a vector of events, the events in the vector are prepended to `unread-command-events', after converting each event to a cons cell of the form (no-record . EVENT). -Quail puts keys back in `unread-command-events' to be handled again, -and when it does this these keys have already been recorded in the -recent keys and in the keyboard macro being defined, which means that -recording them again creates duplicates. -When RESET is non-nil, the events in `unread-command-events' are first -discarded." +If RESET is non-nil, the events in `unread-command-events' are first +discarded, i.e. in this case KEY will end up being the only key +in `unread-command-events'." (if reset (setq unread-command-events nil)) (setq unread-command-events (if (characterp key) commit bd5c7404195e45f11946b4e0933a1f8b697d8b87 Author: Gregory Heytings Date: Sat May 15 20:15:59 2021 +0000 Fix key recording bug when an input method is activated * lisp/international/quail.el (quail-add-unread-command-events): New function. (quail-start-translation, quail-start-conversion) (quail-update-translation, quail-next-translation) (quail-prev-translation, quail-next-translation-block) (quail-prev-translation-block, quail-minibuffer-message): Use 'quail-add-unread-command-events' (and partly revert commit 03e3440dbb). (Bug#48042) * lisp/subr.el (inhibit--record-char): Now obsolete. * lisp/term/xterm.el (xterm--init): New function, with most of the code of former 'terminal-init-xterm'. (terminal-init-xterm): Clear the lossage after terminal initialization (see Bug#44908). (xterm--read-event-for-query): Do not use 'inhibit--record-char' anymore (revert commit 3e6525d69f). * src/keyboard.c (syms_of_keyboard): Remove 'inhibit--record-char' (partly revert 03e3440dbb). (record_char, syms_of_keyboard_for_pdumper): Do not use 'inhibit_record_char anymore'. diff --git a/lisp/international/quail.el b/lisp/international/quail.el index fff06deee8..33851f09a1 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1368,6 +1368,27 @@ If STR has `advice' text property, append the following special event: (delete-region (overlay-start quail-overlay) (overlay-end quail-overlay)))) +(defun quail-add-unread-command-events (key &optional reset) + "Add KEY to `unread-command-events', ensuring that it is not recorded. +If KEY is a character, it is prepended to `unread-command-events' as +a cons cell of the form (no-record . KEY). +If KEY is a vector of events, the events in the vector are prepended +to `unread-command-events', after converting each event to a cons cell +of the form (no-record . EVENT). +Quail puts keys back in `unread-command-events' to be handled again, +and when it does this these keys have already been recorded in the +recent keys and in the keyboard macro being defined, which means that +recording them again creates duplicates. +When RESET is non-nil, the events in `unread-command-events' are first +discarded." + (if reset (setq unread-command-events nil)) + (setq unread-command-events + (if (characterp key) + (cons (cons 'no-record key) unread-command-events) + (append (mapcan (lambda (e) (list (cons 'no-record e))) + (append key nil)) + unread-command-events)))) + (defun quail-start-translation (key) "Start translation of the typed character KEY by the current Quail package. Return the input string." @@ -1385,13 +1406,11 @@ Return the input string." ;; (generated-events nil) ;FIXME: What is this? (input-method-function nil) (modified-p (buffer-modified-p)) - last-command-event last-command this-command inhibit-record) + last-command-event last-command this-command) (setq quail-current-key "" quail-current-str "" quail-translating t) - (if key - (setq unread-command-events (cons key unread-command-events) - inhibit-record t)) + (if key (quail-add-unread-command-events key)) (while quail-translating (set-buffer-modified-p modified-p) (quail-show-guidance) @@ -1400,13 +1419,8 @@ Return the input string." (or input-method-previous-message "") quail-current-str quail-guidance-str))) - ;; We inhibit record_char only for the first key, - ;; because it was already recorded before read_char - ;; called quail-input-method. - (inhibit--record-char inhibit-record) (keyseq (read-key-sequence prompt nil nil t)) (cmd (lookup-key (quail-translation-keymap) keyseq))) - (setq inhibit-record nil) (if (if key (and (commandp cmd) (not (eq cmd 'quail-other-command))) (eq cmd 'quail-self-insert-command)) @@ -1420,9 +1434,7 @@ Return the input string." (quail-error (message "%s" (cdr err)) (beep)))) ;; KEYSEQ is not defined in the translation keymap. ;; Let's return the event(s) to the caller. - (setq unread-command-events - (append (this-single-command-raw-keys) - unread-command-events)) + (quail-add-unread-command-events (this-single-command-raw-keys)) (setq quail-translating nil)))) (quail-delete-region) quail-current-str) @@ -1450,15 +1462,13 @@ Return the input string." ;; (generated-events nil) ;FIXME: What is this? (input-method-function nil) (modified-p (buffer-modified-p)) - last-command-event last-command this-command inhibit-record) + last-command-event last-command this-command) (setq quail-current-key "" quail-current-str "" quail-translating t quail-converting t quail-conversion-str "") - (if key - (setq unread-command-events (cons key unread-command-events) - inhibit-record t)) + (if key (quail-add-unread-command-events key)) (while quail-converting (set-buffer-modified-p modified-p) (or quail-translating @@ -1474,13 +1484,8 @@ Return the input string." quail-conversion-str quail-current-str quail-guidance-str))) - ;; We inhibit record_char only for the first key, - ;; because it was already recorded before read_char - ;; called quail-input-method. - (inhibit--record-char inhibit-record) (keyseq (read-key-sequence prompt nil nil t)) (cmd (lookup-key (quail-conversion-keymap) keyseq))) - (setq inhibit-record nil) (if (if key (commandp cmd) (eq cmd 'quail-self-insert-command)) (progn (setq last-command-event (aref keyseq (1- (length keyseq))) @@ -1503,9 +1508,7 @@ Return the input string." (setq quail-converting nil))))) ;; KEYSEQ is not defined in the conversion keymap. ;; Let's return the event(s) to the caller. - (setq unread-command-events - (append (this-single-command-raw-keys) - unread-command-events)) + (quail-add-unread-command-events (this-single-command-raw-keys)) (setq quail-converting nil)))) (setq quail-translating nil) (if (overlay-start quail-conv-overlay) @@ -1551,9 +1554,8 @@ with more keys." (or input-method-exit-on-first-char (while (> len control-flag) (setq len (1- len)) - (setq unread-command-events - (cons (aref quail-current-key len) - unread-command-events)))))) + (quail-add-unread-command-events + (aref quail-current-key len)))))) ((null control-flag) (unless quail-current-str (setq quail-current-str @@ -1799,8 +1801,7 @@ sequence counting from the head." (setcar indices (1+ (car indices))) (quail-update-current-translations) (quail-update-translation nil))) - (setq unread-command-events - (cons last-command-event unread-command-events)) + (quail-add-unread-command-events last-command-event) (quail-terminate-translation))) (defun quail-prev-translation () @@ -1814,8 +1815,7 @@ sequence counting from the head." (setcar indices (1- (car indices))) (quail-update-current-translations) (quail-update-translation nil))) - (setq unread-command-events - (cons last-command-event unread-command-events)) + (quail-add-unread-command-events last-command-event) (quail-terminate-translation))) (defun quail-next-translation-block () @@ -1830,8 +1830,7 @@ sequence counting from the head." (setcar indices (+ (nth 2 indices) offset)) (quail-update-current-translations) (quail-update-translation nil))) - (setq unread-command-events - (cons last-command-event unread-command-events)) + (quail-add-unread-command-events last-command-event) (quail-terminate-translation))) (defun quail-prev-translation-block () @@ -1850,8 +1849,7 @@ sequence counting from the head." (setcar indices (+ (nth 1 indices) offset)) (quail-update-current-translations))) (quail-update-translation nil))) - (setq unread-command-events - (cons last-command-event unread-command-events)) + (quail-add-unread-command-events last-command-event) (quail-terminate-translation))) (defun quail-abort-translation () @@ -2006,8 +2004,8 @@ Remaining args are for FUNC." (sit-for 1000000) (delete-region point-max (point-max)) (when quit-flag - (setq quit-flag nil - unread-command-events '(7))))) + (setq quit-flag nil) + (quail-add-unread-command-events 7 t)))) (defun quail-show-guidance () "Display a guidance for Quail input method in some window. diff --git a/lisp/subr.el b/lisp/subr.el index 82c2d221a6..78507a552c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1757,6 +1757,12 @@ be a list of the form returned by `event-start' and `event-end'." (make-obsolete-variable 'load-dangerous-libraries "no longer used." "27.1") +(defvar inhibit--record-char nil + "Obsolete variable. +This was used internally by quail.el and keyboard.c in Emacs 27. +It does nothing in Emacs 28.") +(make-obsolete-variable 'inhibit--record-char nil "28.1") + ;; We can't actually make `values' obsolete, because that will result ;; in warnings when using `values' in let-bindings. ;;(make-obsolete-variable 'values "no longer used" "28.1") diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index eeaf805930..8bcae37afe 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -770,8 +770,7 @@ Can be nil to mean \"no timeout\".") By not redisplaying right away for xterm queries, we can avoid unsightly flashing during initialization. Give up and redisplay anyway if we've been waiting a little while." - (let ((start-time (current-time)) - (inhibit--record-char t)) + (let ((start-time (current-time))) (or (let ((inhibit-redisplay t)) (read-event nil nil xterm-query-redisplay-timeout)) (read-event nil nil @@ -839,8 +838,8 @@ We run the first FUNCTION whose STRING matches the input events." basemap (make-composed-keymap map (keymap-parent basemap)))) -(defun terminal-init-xterm () - "Terminal initialization function for xterm." +(defun xterm--init () + "Initialize the terminal for xterm." ;; rxvt terminals sometimes set the TERM variable to "xterm", but ;; rxvt's keybindings are incompatible with xterm's. It is ;; better in that case to use rxvt's initialization function. @@ -882,9 +881,18 @@ We run the first FUNCTION whose STRING matches the input events." ;; support it just ignore the sequence. (xterm--init-bracketed-paste-mode) ;; We likewise unconditionally enable support for focus tracking. - (xterm--init-focus-tracking) + (xterm--init-focus-tracking)) - (run-hooks 'terminal-init-xterm-hook)) +(defun terminal-init-xterm () + "Terminal initialization function for xterm." + (unwind-protect + (progn + (xterm--init) + ;; If the terminal initialization completed without errors, clear + ;; the lossage to discard the responses of the terminal emulator + ;; during initialization; otherwise they appear in the recent keys. + (clear-this-command-keys)) + (run-hooks 'terminal-init-xterm-hook))) (defun xterm--init-modify-other-keys () "Terminal initialization for xterm's modifyOtherKeys support." diff --git a/src/keyboard.c b/src/keyboard.c index 47b5e59024..c855d45afa 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3233,10 +3233,6 @@ help_char_p (Lisp_Object c) static void record_char (Lisp_Object c) { - /* quail.el binds this to avoid recording keys twice. */ - if (inhibit_record_char) - return; - int recorded = 0; if (CONSP (c) && (EQ (XCAR (c), Qhelp_echo) || EQ (XCAR (c), Qmouse_movement))) @@ -12343,13 +12339,6 @@ If nil, Emacs crashes immediately in response to fatal signals. */); Vwhile_no_input_ignore_events, doc: /* Ignored events from while-no-input. */); - DEFVAR_BOOL ("inhibit--record-char", - inhibit_record_char, - doc: /* If non-nil, don't record input events. -This inhibits recording input events for the purposes of keyboard -macros, dribble file, and `recent-keys'. -Internal use only. */); - pdumper_do_now_and_after_load (syms_of_keyboard_for_pdumper); } @@ -12383,8 +12372,6 @@ syms_of_keyboard_for_pdumper (void) /* Create the initial keyboard. Qt means 'unset'. */ eassert (initial_kboard == NULL); initial_kboard = allocate_kboard (Qt); - - inhibit_record_char = false; } void commit 7bbd6b720e60cb5e726214268c5b80a3e23f799e Author: Mattias Engdegård Date: Sat May 29 09:32:49 2021 +0200 ; * etc/NEWS: Slight improvement of last entry diff --git a/etc/NEWS b/etc/NEWS index 392b164c8b..49bde94e8d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2497,11 +2497,12 @@ This is to keep the same behavior as Eshell. * Incompatible Lisp Changes in Emacs 28.1 --- -** Some floating point numbers are now handled differently by the Lisp reader. -In previous versions of Emacs, floating point numbers like 1.e6 would -be read as 1. This has now been changed, and the Lisp reader will now -read that construct as 1000000.0. -That is, (read-from-string "1.e6") => (1000000.0 . 4) now. +** Some floating-point numbers are now handled differently by the Lisp reader. +In previous versions of Emacs, numbers with a trailing dot and an exponent +were read as integers and the exponent ignored: 2.e6 was interpreted as the +integer 2. Such numerals are now read as floats with the exponent included: +2.e6 is now read as the floating-point value 2000000.0. +That is, (read-from-string "1.e3") => (1000.0 . 4) now. +++ ** The 'lexical-binding' local variable is always enabled. commit 0cbfb7e7951e3a3e277835958f6daa139a653c52 Author: Mattias Engdegård Date: Fri May 28 11:51:32 2021 +0200 ; * lisp/emacs-lisp/rx.el (rx--pcase-macroexpander): slight rephrase diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 43bd84d999..071d390f0e 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -1442,10 +1442,9 @@ following constructs: introduced by a previous (let REF ...) construct." (let* ((rx--pcase-vars nil) - (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps)))) - (nvars (length rx--pcase-vars))) + (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps))))) `(and (pred stringp) - ,(pcase nvars + ,(pcase (length rx--pcase-vars) (0 ;; No variables bound: a single predicate suffices. `(pred (string-match ,regexp))) @@ -1458,7 +1457,7 @@ following constructs: (match-string 1 s) 0)) (and ,(car rx--pcase-vars) (pred (not numberp))))) - (_ + (nvars ;; Pack the submatches into a dotted list which is then ;; immediately destructured into individual variables again. ;; This is of course slightly inefficient. commit 61961903fd979f0f385db3138025866c88908c6f Author: Mattias Engdegård Date: Fri May 28 11:48:00 2021 +0200 ; * lisp/mail/rmail.el (rmail-simplified-subject): Dodge relint nag diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 7ef3754dad..e479a8e9b4 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3360,7 +3360,7 @@ tags such as [tag]." ;; Corporate mailing systems sometimes add `[External] :'; if that happened, ;; delete everything up thru there. Empirically, that deletion makes ;; the Subject match the other messages in the thread. - (if (string-match "[[]external][ \t\n]*:" subject) + (if (string-match "\\[external][ \t\n]*:" subject) (setq subject (substring subject (match-end 0)))) (setq subject (rfc2047-decode-string subject)) (setq subject (replace-regexp-in-string regexp "" subject)) commit 93162efd7901ada02995103797237beb2d49a04e Author: Mattias Engdegård Date: Fri May 28 11:43:24 2021 +0200 Fix shortdoc examples Make sure that each example in shortdoc actually contains the function it illustrates, and add a test for it. * lisp/emacs-lisp/shortdoc.el (string, list, buffer, number): Use the right functions in examples for string-version-lessp, lax-plist-put, point-min and ffloor. * test/lisp/emacs-lisp/shortdoc-tests.el: New test file. diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 652806ea28..38d8ad6cc1 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -221,7 +221,7 @@ There can be any number of :example/:result elements." (string-greaterp :eval (string-greaterp "foo" "bar")) (string-version-lessp - :eval (string-lessp "foo32.png" "bar4.png")) + :eval (string-version-lessp "pic4.png" "pic32.png")) (string-prefix-p :eval (string-prefix-p "foo" "foobar")) (string-suffix-p @@ -613,7 +613,7 @@ There can be any number of :example/:result elements." (lax-plist-get :eval (lax-plist-get '("a" 1 "b" 2 "c" 3) "b")) (lax-plist-put - :no-eval (setq plist (plist-put plist "d" 4)) + :no-eval (setq plist (lax-plist-put plist "d" 4)) :eq-result '("a" 1 "b" 2 "c" 3 "d" 4)) (plist-member :eval (plist-member '(a 1 b 2 c 3) 'b)) @@ -838,7 +838,7 @@ There can be any number of :example/:result elements." (point :eval (point)) (point-min - :eval (point-max)) + :eval (point-min)) (point-max :eval (point-max)) (line-beginning-position @@ -1056,7 +1056,7 @@ There can be any number of :example/:result elements." (logb :eval (logb 10.5)) (ffloor - :eval (floor 1.2)) + :eval (ffloor 1.2)) (fceiling :eval (fceiling 1.2)) (ftruncate diff --git a/test/lisp/emacs-lisp/shortdoc-tests.el b/test/lisp/emacs-lisp/shortdoc-tests.el new file mode 100644 index 0000000000..050aac3165 --- /dev/null +++ b/test/lisp/emacs-lisp/shortdoc-tests.el @@ -0,0 +1,45 @@ +;;; shortdoc-tests.el --- tests for shortdoc.el -*- lexical-binding: t -*- + +;; Copyright (C) 2021 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +(require 'ert) +(require 'shortdoc) + +(defun shortdoc-tests--tree-contains (tree fun) + "Whether TREE contains a call to FUN." + (and (proper-list-p tree) + (or (eq (car tree) fun) + (cl-some (lambda (x) (shortdoc-tests--tree-contains x fun)) tree)))) + +(ert-deftest shortdoc-examples () + "Check that each example actually contains the corresponding form." + (dolist (group shortdoc--groups) + (dolist (item group) + (when (consp item) + (let ((fun (car item)) + (props (cdr item))) + (while props + (when (memq (car props) '(:eval :no-eval :no-eval*)) + (let* ((example (cadr props)) + (expr (cond + ((consp example) example) + ((stringp example) (read example))))) + (should (shortdoc-tests--tree-contains expr fun)))) + (setq props (cddr props)))))))) + +(provide 'shortdoc-tests) commit 0eb0fe987b62540f892954d0eb09bb9e44cc6b08 Author: Lars Ingebrigtsen Date: Sat May 29 08:09:34 2021 +0200 Add lambda to the pretty Ruby symbols list * lisp/progmodes/ruby-mode.el (ruby--prettify-symbols-alist): Add lambda (bug#48681). diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index cb8bbcd9b9..01fb044161 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2426,7 +2426,8 @@ If there is no Rubocop config file, Rubocop will be passed a flag (">=" . ?≥) ("->" . ?→) ("=>" . ?⇒) - ("::" . ?∷)) + ("::" . ?∷) + ("lambda" . ?λ)) "Value for `prettify-symbols-alist' in `ruby-mode'.") ;;;###autoload commit 90cd4d6caeac337054fa0c4548281cc54eed37d3 Author: William Denton Date: Sat May 29 08:08:35 2021 +0200 Add pretty symbols to ruby-mode * lisp/progmodes/ruby-mode.el (ruby--prettify-symbols-alist): Add pretty symbols (bug#48681). (ruby-mode): Use them. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 0c54a1d27a..cb8bbcd9b9 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2421,6 +2421,14 @@ If there is no Rubocop config file, Rubocop will be passed a flag report-fn args)) +(defconst ruby--prettify-symbols-alist + '(("<=" . ?≤) + (">=" . ?≥) + ("->" . ?→) + ("=>" . ?⇒) + ("::" . ?∷)) + "Value for `prettify-symbols-alist' in `ruby-mode'.") + ;;;###autoload (define-derived-mode ruby-mode prog-mode "Ruby" "Major mode for editing Ruby code." @@ -2437,6 +2445,7 @@ If there is no Rubocop config file, Rubocop will be passed a flag (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil ((?_ . "w")))) + (setq-local prettify-symbols-alist ruby--prettify-symbols-alist) (setq-local syntax-propertize-function #'ruby-syntax-propertize)) commit 2e1510dd009a97e3952df6e6f6deb51aac854933 Author: Lars Ingebrigtsen Date: Sat May 29 08:02:10 2021 +0200 Mention the recent floating point reader changes in NEWS * etc/NEWS: Mention the floating point reader changes (bug#48678). diff --git a/etc/NEWS b/etc/NEWS index 876f63c69c..392b164c8b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2496,6 +2496,13 @@ This is to keep the same behavior as Eshell. * Incompatible Lisp Changes in Emacs 28.1 +--- +** Some floating point numbers are now handled differently by the Lisp reader. +In previous versions of Emacs, floating point numbers like 1.e6 would +be read as 1. This has now been changed, and the Lisp reader will now +read that construct as 1000000.0. +That is, (read-from-string "1.e6") => (1000000.0 . 4) now. + +++ ** The 'lexical-binding' local variable is always enabled. Previously, if 'enable-local-variables' was nil, a 'lexical-binding' commit 2ee7e8a129ea0838ed2de5ae3531c3b21a8cb2c3 Author: Lars Ingebrigtsen Date: Sat May 29 07:49:19 2021 +0200 Improve the dired-guess-shell-alist-user doc string * lisp/dired-x.el (dired-guess-shell-alist-user): Document how REGEXP is used (bug#17251). diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 56f7f4724a..6619a39167 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -941,10 +941,15 @@ Each element of this list looks like (REGEXP COMMAND...) -where each COMMAND can either be a string or a Lisp expression that evaluates +COMMAND will be used if REGEXP matches the file to be processed. +If several files are to be processed, REGEXP has to match all the +files. + +Each COMMAND can either be a string or a Lisp expression that evaluates to a string. If this expression needs to consult the name of the file for which the shell commands are being requested, it can access that file name as the variable `file'. + If several COMMANDs are given, the first one will be the default and the rest will be added temporarily to the history and can be retrieved with \\[previous-history-element] (M-p) . commit 22520811e2054df1d7a61691faa2c203bf3bbda0 Author: Lars Ingebrigtsen Date: Sat May 29 07:38:00 2021 +0200 Fix folding of non-ASCII lines when printing to Postscript * lisp/ps-mule.el (ps-mule-plot-string): Fix folding of non-ASCII Latin-1 lines (bug#17758). diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index a8b5210e96..ab8af40628 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el @@ -673,7 +673,7 @@ the sequence." (not (vectorp (aref (nth 2 composition) 0)))) (car composition) to)) - (ascii-or-latin-1 "[\000-\377]+") + (ascii-or-latin-1 "[\000-ÿ]+") (run-width 0) (endpos nil) (font-spec-table (aref ps-mule-font-spec-tables @@ -699,6 +699,7 @@ the sequence." (setq composition (find-composition (point) to nil t)) (setq stop (if composition (car composition) to))))) + ;; We fold lines that contain ASCII or Latin-1. ((looking-at ascii-or-latin-1) (let ((nchars (- (min (match-end 0) stop) (point)))) (setq width (* average-width nchars)) @@ -710,6 +711,7 @@ the sequence." (setq run-width (+ run-width width)) (forward-char nchars)))) + ;; Don't fold other lines. (But why?) (t (while (and (< (point) stop) (not endpos)) (setq width (char-width (following-char))) commit 30c09a16744ccc108689c66b283c1c7b6abe010c Author: Lars Ingebrigtsen Date: Sat May 29 07:04:34 2021 +0200 Improve Octave indentation after continuation lines * lisp/progmodes/octave.el (octave-smie-rules): Indent continuation lines better (bug#17955). diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index a1a5192ee1..5d877fc6ba 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -460,7 +460,8 @@ Non-nil means always go to the next Octave code line after sending." (smie-rule-parent octave-block-offset) ;; For (invalid) code between switch and case. ;; (if (smie-rule-parent-p "switch") 4) - nil)))) + nil)) + ('(:after . "=") octave-block-offset))) (defun octave-indent-comment () "A function for `smie-indent-functions' (which see)." commit cee502ea18a43614a2c7ac76a48befdff038e12e Author: Lars Ingebrigtsen Date: Sat May 29 06:02:13 2021 +0200 Improve the file-accessible-directory-p doc strin * src/fileio.c (Ffile_accessible_directory_p): Don't use the phrase "directory name spec", which isn't defined (bug#18201). diff --git a/src/fileio.c b/src/fileio.c index 741e297d29..caf077e2fb 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2987,12 +2987,16 @@ file_directory_p (Lisp_Object file) DEFUN ("file-accessible-directory-p", Ffile_accessible_directory_p, Sfile_accessible_directory_p, 1, 1, 0, doc: /* Return t if FILENAME names a directory you can open. -For the value to be t, FILENAME must specify the name of a directory -as a file, and the directory must allow you to open files in it. In -order to use a directory as a buffer's current directory, this -predicate must return true. A directory name spec may be given -instead; then the value is t if the directory so specified exists and -really is a readable and searchable directory. */) +This means that FILENAME must specify the name of a directory, and the +directory must allow you to open files in it. If this isn't the case, +return nil. + +FILENAME can either be a directory name (eg. \"/tmp/foo/\") or the +file name of a file which is a directory (eg. \"/tmp/foo\", without +the final slash). + +In order to use a directory as a buffer's current directory, this +predicate must return true. */) (Lisp_Object filename) { Lisp_Object absname; commit bff3edfd17ede3f6c9ae2f2a3588c155d6d11de4 Author: Lars Ingebrigtsen Date: Sat May 29 05:22:31 2021 +0200 Fix point movement in morse-region and nato-region * lisp/play/morse.el (morse-region): (nato-region): Leave point after the translated region (bug#18717). diff --git a/lisp/play/morse.el b/lisp/play/morse.el index 91dc687d19..66a826fbd4 100644 --- a/lisp/play/morse.el +++ b/lisp/play/morse.el @@ -165,7 +165,7 @@ Geospatial-Intelligence Agency at URL `https://www.nga.mil/'") (setq sep "")) ((setq morse (assoc str morse-code)) (delete-char 1) - (insert sep (cdr morse)) + (insert-before-markers sep (cdr morse)) (setq sep "/")) (t (forward-char 1) @@ -211,7 +211,7 @@ Geospatial-Intelligence Agency at URL `https://www.nga.mil/'") (setq sep "")) ((setq nato (assoc str nato-alphabet)) (delete-char 1) - (insert sep (cdr nato)) + (insert-before-markers sep (cdr nato)) (setq sep "-")) (t (forward-char 1) commit ee7752aac55468f06a71ea0e9ee0be0dff5b1f67 Author: Peter Oliver Date: Sat May 29 04:15:28 2021 +0200 Rename emacs.appdata.xml to emacs.metainfo.xml and add more data * Makefile.in: Replace "appdata" with "metainfo". This is the name currently recommended by the spec at . * etc/emacs.metainfo.xml: Populate more fields, based on those available in https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html (bug#48662). Copyright-paperwork-exempt: yes diff --git a/Makefile.in b/Makefile.in index 65eceb2a0c..3facfa59a9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -185,8 +185,8 @@ x_default_search_path=@x_default_search_path@ # Where the etc/emacs.desktop file is to be installed. desktopdir=$(datarootdir)/applications -# Where the etc/emacs.appdata.xml file is to be installed. -appdatadir=$(datarootdir)/metainfo +# Where the etc/emacs.metainfo.xml file is to be installed. +metainfodir=$(datarootdir)/metainfo # Where the etc/emacs.service file is to be installed. # The system value (typically /usr/lib/systemd/user) can be @@ -721,11 +721,11 @@ install-etc: ${srcdir}/etc/emacsclient.desktop > $${tmp}; \ ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \ rm -f $${tmp} - umask 022; ${MKDIR_P} "$(DESTDIR)${appdatadir}" - tmp=etc/emacs.tmpappdata; rm -f $${tmp}; \ + umask 022; ${MKDIR_P} "$(DESTDIR)${metainfodir}" + tmp=etc/emacs.tmpmetainfo; rm -f $${tmp}; \ sed -e "s/emacs\.desktop/${EMACS_NAME}.desktop/" \ - ${srcdir}/etc/emacs.appdata.xml > $${tmp}; \ - ${INSTALL_DATA} $${tmp} "$(DESTDIR)${appdatadir}/${EMACS_NAME}.appdata.xml"; \ + ${srcdir}/etc/emacs.metainfo.xml > $${tmp}; \ + ${INSTALL_DATA} $${tmp} "$(DESTDIR)${metainfodir}/${EMACS_NAME}.metainfo.xml"; \ rm -f $${tmp} umask 022; $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)" tmp=etc/emacs.tmpservice; rm -f $${tmp}; \ @@ -811,7 +811,7 @@ uninstall: uninstall-$(NTDIR) uninstall-doc "hicolor/scalable/mimetypes/${EMACS_NAME}-document23.svg"; \ fi) -rm -f "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop" - -rm -f "$(DESTDIR)${appdatadir}/${EMACS_NAME}.appdata.xml" + -rm -f "$(DESTDIR)${metainfodir}/${EMACS_NAME}.metainfo.xml" -rm -f "$(DESTDIR)$(systemdunitdir)/${EMACS_NAME}.service" ifneq (,$(use_gamedir)) for file in snake-scores tetris-scores; do \ diff --git a/etc/emacs.appdata.xml b/etc/emacs.metainfo.xml similarity index 58% rename from etc/emacs.appdata.xml rename to etc/emacs.metainfo.xml index ca6233a59a..7467b88e73 100644 --- a/etc/emacs.appdata.xml +++ b/etc/emacs.metainfo.xml @@ -3,9 +3,9 @@ org.gnu.emacs GFDL-1.3+ - GPL-3.0+ and GFDL-1.3+ GNU Emacs An extensible text editor + https://www.gnu.org/software/emacs/images/emacs.png

GNU Emacs is an extensible, customizable text editor - and more. @@ -23,13 +23,26 @@ interface, calendar, and more + + Development + TextEditor + + https://www.gnu.org/software/emacs + https://debbugs.gnu.org/ + https://www.gnu.org/software/emacs/manual/html_mono/efaq.html + https://www.gnu.org/software/emacs/documentation.html + https://my.fsf.org/donate/ + https://lists.gnu.org/mailman/listinfo/emacs-devel/ + emacs.desktop + emacs.service + GNU + GPL-3.0+ and GFDL-1.3+ + Free Software Foundation - https://www.gnu.org/software/emacs/images/appdata-26.png - + https://www.gnu.org/software/emacs/images/appdata-26.png + Editing a Lisp program whilst viewing the Emacs manual. + - emacs - https://www.gnu.org/software/emacs emacs-devel_AT_gnu.org - GNU commit 459f89f3bcbe5fb1a160b2d215154669343b78d9 Author: Lars Ingebrigtsen Date: Sat May 29 04:08:57 2021 +0200 Revert "Continue checking the same line when hitting SPC in ispell" This reverts commit 390044f854fa103020ffca00eb1fe0e16805ad72. This breaks the `a' command, so it should be fixed in a different way. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 574cf38e56..4dbc7640bc 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3431,7 +3431,7 @@ Returns the sum SHIFT due to changes in word replacements." (word-len (length (car poss))) (line-end (copy-marker ispell-end)) (line-start (copy-marker ispell-start)) - accepted recheck-region replace) + recheck-region replace) (goto-char word-start) ;; Adjust the horizontal scroll & point (ispell-horiz-scroll) @@ -3486,18 +3486,13 @@ Returns the sum SHIFT due to changes in word replacements." ;; Insert correction if needed. (cond - ((equal 0 replace) ; INSERT + ((or (null replace) + (equal 0 replace)) ; ACCEPT/INSERT (if (equal 0 replace) ; BUFFER-LOCAL DICT ADD (ispell-add-per-file-word-list (car poss))) ;; Do not recheck accepted word on this line. (setq accept-list (cons (car poss) accept-list))) - (t - ;; The user hit SPC, so accept this word, but keep - ;; checking the rest of the line. - (unless replace - (setq accepted t) - (setq replace (list (buffer-substring-no-properties - (point) (+ word-len (point)))))) + (t ; Replacement word selected or entered. (delete-region (point) (+ word-len (point))) (if (not (listp replace)) (progn @@ -3516,9 +3511,9 @@ Returns the sum SHIFT due to changes in word replacements." (query-replace (car poss) (car replace) t))) (goto-char word-start) ;; Do not recheck if already accepted. - (if (or accepted - (member replace-word accept-list)) - (setq replace replace-word) + (if (member replace-word accept-list) + (setq accept-list (cons replace-word accept-list) + replace replace-word) (let ((region-end (copy-marker ispell-region-end))) (setq recheck-region ispell-filter ispell-filter nil ; Save filter. commit 2003a407c8bdf79dabe4f782039706d91c4fd9c5 Author: Juri Linkov Date: Fri May 28 21:58:11 2021 +0300 * lisp/outline.el (outline-font-lock-keywords): Fix highlight case (bug#48707) diff --git a/lisp/outline.el b/lisp/outline.el index efe3314ead..68b8f4b6dd 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -205,7 +205,9 @@ in the file it applies to.") (list 'face (outline-font-lock-face) 'keymap outline-mode-cycle-map) (list 'face nil - 'keymap outline-mode-cycle-map))) + 'keymap outline-mode-cycle-map)) + (if outline-minor-mode-highlight + (list 'face (outline-font-lock-face)))) (outline-font-lock-face)) (when outline-minor-mode (pcase outline-minor-mode-highlight commit 51c6bafa9b9f5b4d8632607bc5b6cfff3c558664 Author: Utkarsh Singh Date: Fri May 28 21:55:13 2021 +0300 * lisp/outline.el (outline-minor-mode-highlight): Fix safe-local-variable. Copyright-paperwork-exempt: yes diff --git a/lisp/outline.el b/lisp/outline.el index fa7c1a27d9..efe3314ead 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -349,7 +349,7 @@ faces to major mode's faces." (const :tag "Append outline faces to major mode faces" append) (const :tag "Highlight separately from major mode faces" t)) :version "28.1") -;;;###autoload(put 'outline-minor-mode-highlight 'safe-local-variable 'booleanp) +;;;###autoload(put 'outline-minor-mode-highlight 'safe-local-variable 'symbolp) (defun outline-minor-mode-highlight-buffer () ;; Fallback to overlays when font-lock is unsupported. commit a52f572e627dc8fdef17b77512cba0a3f56825e1 Author: Philipp Stephani Date: Fri May 28 16:56:17 2021 +0200 ; * src/Makefile.in: Fix typo. diff --git a/src/Makefile.in b/src/Makefile.in index d9f65b5bd0..79cddb35b5 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -342,7 +342,7 @@ DUMPING=@DUMPING@ CHECK_STRUCTS = @CHECK_STRUCTS@ HAVE_PDUMPER = @HAVE_PDUMPER@ -## ARM Macs require that all code have a valid signature. Since pump +## ARM Macs require that all code have a valid signature. Since pdump ## invalidates the signature, we must re-sign to fix it. DO_CODESIGN=$(patsubst aarch64-apple-darwin%,yes,@configuration@) commit 6d916bfb37d88a63663ad5777c8c3b83fbcfdbd0 Author: Eli Zaretskii Date: Fri May 28 14:03:16 2021 +0300 Another stability fix in 'lisp_string_width' * src/character.c (lisp_string_width): Compute C pointer to data of STRING immediately before using it, since STRING could be relocated by GC triggered by processing compositions. (Bug#48711) diff --git a/src/character.c b/src/character.c index e44ab8d43b..e874cf5e53 100644 --- a/src/character.c +++ b/src/character.c @@ -339,7 +339,6 @@ lisp_string_width (Lisp_Object string, ptrdiff_t from, ptrdiff_t to, contains only ascii and eight-bit-graphic, but that's intentional. */ bool multibyte = SCHARS (string) < SBYTES (string); - unsigned char *str = SDATA (string); ptrdiff_t i = from, i_byte = from ? string_char_to_byte (string, from) : 0; ptrdiff_t from_byte = i_byte; ptrdiff_t width = 0; @@ -414,6 +413,7 @@ lisp_string_width (Lisp_Object string, ptrdiff_t from, ptrdiff_t to, else { int c; + unsigned char *str = SDATA (string); if (multibyte) {