commit c69c17d573860ebe74320cee2a1850baa865183d (HEAD, refs/remotes/origin/master) Author: Nick Gasson Date: Fri Oct 9 06:57:07 2020 +0200 Match OpenBSD doas password prompt in comint * lisp/comint.el (comint-password-prompt-regexp): match OpenBSD doas password prompt. OpenBSD 5.8 replaced sudo with doas in the base install. * test/lisp/comint-tests.el (comint-testsuite-password-strings): test that the doas password prompt is matched (bug#43846). Copyright-paperwork-exempt: yes diff --git a/lisp/comint.el b/lisp/comint.el index 611947605f..944e1ae8c0 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -362,6 +362,7 @@ This variable is buffer-local." ;; Some implementations of passwd use "Password (again)" as the 2nd prompt. ;; Something called "perforce" uses "Enter password:". ;; OpenVPN prints a prompt like: "Enter Auth Password:". +;; OpenBSD doas prints "doas (user@host) password:". ;; See ert test `comint-test-password-regexp'. (defcustom comint-password-prompt-regexp (concat @@ -370,7 +371,7 @@ This variable is buffer-local." '("Enter" "enter" "Enter same" "enter same" "Enter the" "enter the" "Enter Auth" "enter auth" "Old" "old" "New" "new" "'s" "login" "Kerberos" "CVS" "UNIX" " SMB" "LDAP" "PEM" "SUDO" - "[sudo]" "Repeat" "Bad" "Retype") + "[sudo]" "doas" "Repeat" "Bad" "Retype") t) ;; Allow for user name to precede password equivalent (Bug#31075). " +.*\\)" diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el index 5b59340902..923f588e9e 100644 --- a/test/lisp/comint-tests.el +++ b/test/lisp/comint-tests.el @@ -39,6 +39,7 @@ "Passphrase for key root@GNU.ORG: " ; plink "[sudo] password for user:" ; Ubuntu sudo "[sudo] user 的密码:" ; localized + "doas (user@host) password:" ; OpenBSD doas "PIN for user:" ; Bug#35523 "Password (again):" "Enter password:" commit e45b0c5d94eaf3e456a2616df029b6d451064e5b Author: Lars Ingebrigtsen Date: Fri Oct 9 06:48:51 2020 +0200 message-signature doc fix * lisp/gnus/message.el (message-signature): Mention message-signature-insert-empty-line (bug#43853). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 77856aedde..a906e56aac 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1106,7 +1106,8 @@ point and mark around the citation text as modified." If nil, don't insert a signature. If t, insert `message-signature-file'. If a function or form, insert its result. -See `mail-signature' for the recommended format of a signature." +See `mail-signature' for the recommended format of a signature. +Also see `message-signature-insert-empty-line'." :version "23.2" :type '(choice string (const :tag "None" nil) commit 82d70d3aab7ae25beb089b3d6bb9415867db317b Author: Lars Ingebrigtsen Date: Fri Oct 9 06:36:53 2020 +0200 Clarify define-minor-mode hooks * doc/lispref/modes.texi (Defining Minor Modes): Note that the code (and the hook) is run both when the mode is enabled and disabled (bug#43868). diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index be2ee5721c..41c86d69ab 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1729,7 +1729,8 @@ The command named @var{mode} first performs the standard actions such as setting the variable named @var{mode} and then executes the @var{body} forms, if any. It then runs the mode hook variable @code{@var{mode}-hook} and finishes by evaluating any form in -@code{:after-hook}. +@code{:after-hook}. (Note that all of this, including running the +hook, is done both when the mode is enabled and disabled.) @end defmac The initial value must be @code{nil} except in cases where (1) the commit e2ece082732323738e56046a7bd667e5f9126ced Author: Lars Ingebrigtsen Date: Fri Oct 9 06:26:17 2020 +0200 Revert "Don't eagerly store articles in the Agent by default" This reverts commit def34a20766ea5179afd5e5ed090a2b86fcccb5e. This made storing articles in the Agent very slow. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index f748996acc..6a7e81b3e9 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -3812,7 +3812,6 @@ has been fetched." t)))) (defun gnus-agent-store-article (article group) - (declare (obsolete nil "28.1")) (let* ((gnus-command-method (gnus-find-method-for-group group)) (file (gnus-agent-article-name (number-to-string article) group)) (file-name-coding-system nnmail-pathname-coding-system) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index b1147924ff..2d9d5ece01 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -7092,7 +7092,10 @@ If given a prefix, show the hidden text instead." gnus-summary-buffer) (when gnus-keep-backlog (gnus-backlog-enter-article - group article (current-buffer)))) + group article (current-buffer))) + (when (and gnus-agent + (gnus-agent-group-covered-p group)) + (gnus-agent-store-article article group))) (setq result 'article)) (methods (setq gnus-override-method (pop methods))) diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el index 9bcb6c33a6..e3e81c8bbc 100644 --- a/lisp/gnus/gnus-async.el +++ b/lisp/gnus/gnus-async.el @@ -225,6 +225,12 @@ that was fetched." (save-excursion (save-restriction (narrow-to-region mark (point-max)) + ;; Put the articles into the agent, if they aren't already. + (when (and gnus-agent + (gnus-agent-group-covered-p group)) + (save-restriction + (narrow-to-region mark (point-max)) + (gnus-agent-store-article article group))) ;; Prefetch images for the groups that want that. (when (fboundp 'gnus-html-prefetch-images) (gnus-html-prefetch-images summary)) commit f3dbde7e6ffabfef7526b04bf2e633250970672d Author: Lars Ingebrigtsen Date: Fri Oct 9 06:15:02 2020 +0200 Only skip directories in lgrep, not the other grep commands * lisp/progmodes/grep.el (lgrep): Do the directory ignores here (bug#23590). (grep-compute-defaults): ... instead of here, because this would affect all grep commands, not just lgrep. diff --git a/etc/NEWS b/etc/NEWS index 63a740cf64..e1f9382228 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -545,6 +545,11 @@ grep emits SGR ANSI escape sequences to color its output. The new variable markers in order to provide highlighting in the source buffer. The variable can be customized to accommodate other grep-like tools. +--- +*** The 'lgrep' command now ignores directories. +On systems where the grep command supports it, directories will be +skipped. + ** Help +++ diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 6bc187028f..f028a4279d 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -703,11 +703,6 @@ The value depends on `grep-command', `grep-template', (let ((grep-options (concat (if grep-use-null-device "-n" "-nH") (if grep-use-null-filename-separator " --null") - (when (grep-probe grep-program - `(nil nil nil "--directories=skip" "foo" - ,null-device) - nil 1) - " --directories=skip") (when (grep-probe grep-program `(nil nil nil "-e" "foo" ,null-device) nil 1) @@ -1126,6 +1121,11 @@ command before it's run." grep-find-ignored-files " --exclude="))))) (when command + (when (grep-probe grep-program + `(nil nil nil "--directories=skip" "foo" + ,null-device) + nil 1) + (setq command (concat command " --directories=skip"))) (if confirm (setq command (read-from-minibuffer "Confirm: " commit 81fe8990c0e4c0980e599b6ec9cad6dcb945275a Author: Alan Mackenzie Date: Thu Oct 8 16:49:49 2020 +0000 CC Mode: Move the handling of keyword auto into type handling for C++. This should allow auto, const, static, ... to be in any order. * lisp/progmodes/cc-engine.el (c-forward-type): New return value 'no-id for when auto precludes the parsing of a type identifier. Adapt processing for this. (c-forward-decl-or-cast-1): Use the new facility from c-forward-type. * lisp/progmodes/cc-langs.el (c-type-modifier-prefix-kwds): Insert the value of c-no-type-kwds into the value. (c-no-type-kwds, c-no-type-key): New lang consts/vars, basically "auto". (c-typeless-decl-kwds, c-modifier-kwds): Remove "auto" from the C++ value. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 4e336c0a06..1649f50736 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -8426,6 +8426,7 @@ comment at the start of cc-engine.el for more info." ;; o - 'found if it's a type that matches one in `c-found-types'; ;; o - 'maybe if it's an identifier that might be a type; ;; o - 'decltype if it's a decltype(variable) declaration; - or + ;; o - 'no-id if "auto" precluded parsing a type identifier. ;; o - nil if it can't be a type (the point isn't moved then). ;; ;; The point is assumed to be at the beginning of a token. @@ -8450,9 +8451,12 @@ comment at the start of cc-engine.el for more info." ;; prefix of a type. (when c-opt-type-modifier-prefix-key ; e.g. "const" "volatile", but NOT "typedef" (while (looking-at c-opt-type-modifier-prefix-key) + (when (looking-at c-no-type-key) + (setq res 'no-id)) (goto-char (match-end 1)) (c-forward-syntactic-ws) - (setq res 'prefix))) + (or (eq res 'no-id) + (setq res 'prefix)))) (cond ((looking-at c-typeof-key) ; e.g. C++'s "decltype". @@ -8503,28 +8507,30 @@ comment at the start of cc-engine.el for more info." (setq res t)) (unless res (goto-char start))) ; invalid syntax - ((progn - (setq pos nil) - (if (looking-at c-identifier-start) - (save-excursion - (setq id-start (point) - name-res (c-forward-name)) - (when name-res - (setq id-end (point) - id-range c-last-identifier-range)))) - (and (cond ((looking-at c-primitive-type-key) - (setq res t)) - ((c-with-syntax-table c-identifier-syntax-table - (looking-at c-known-type-key)) - (setq res 'known))) - (or (not id-end) - (>= (save-excursion - (save-match-data - (goto-char (match-end 1)) - (c-forward-syntactic-ws) - (setq pos (point)))) - id-end) - (setq res nil)))) + ((and + (not (eq res 'no-id)) + (progn + (setq pos nil) + (if (looking-at c-identifier-start) + (save-excursion + (setq id-start (point) + name-res (c-forward-name)) + (when name-res + (setq id-end (point) + id-range c-last-identifier-range)))) + (and (cond ((looking-at c-primitive-type-key) + (setq res t)) + ((c-with-syntax-table c-identifier-syntax-table + (looking-at c-known-type-key)) + (setq res 'known))) + (or (not id-end) + (>= (save-excursion + (save-match-data + (goto-char (match-end 1)) + (c-forward-syntactic-ws) + (setq pos (point)))) + id-end) + (setq res nil))))) ;; Looking at a primitive or known type identifier. We've ;; checked for a name first so that we don't go here if the ;; known type match only is a prefix of another name. @@ -8599,7 +8605,7 @@ comment at the start of cc-engine.el for more info." (goto-char start) (setq res nil))))) - (when res + (when (not (memq res '(nil no-id))) ;; Skip trailing type modifiers. If any are found we know it's ;; a type. (when c-opt-type-modifier-key @@ -9452,12 +9458,11 @@ This function might do hidden buffer changes." (when (setq found-type (c-forward-type t)) ; brace-block-too ;; Found a known or possible type or a prefix of a known type. - (when (and (c-major-mode-is 'c++-mode) ; C++11 style "auto"? - (eq prev-kwd-sym (c-keyword-sym "auto")) - (looking-at "[=(]")) ; FIXME!!! proper regexp. - (setq new-style-auto t) - (setq found-type nil) - (goto-char start)) ; position of foo in "auto foo" + (when (and (eq found-type 'no-id) + (save-excursion + (and (c-forward-name) ; over the identifier + (looking-at "[=(]")))) ; FIXME!!! proper regexp. + (setq new-style-auto t)) ; position of foo in "auto foo" (when at-type ;; Got two identifiers with nothing but whitespace @@ -9540,7 +9545,7 @@ This function might do hidden buffer changes." ;; over all specifiers and type identifiers. The reason ;; to do this for a known type prefix is to make things ;; like "unsigned INT16" work. - (and found-type (not (eq found-type t)))))) + (and found-type (not (memq found-type '(t no-id))))))) (cond ((eq at-type t) @@ -9560,6 +9565,10 @@ This function might do hidden buffer changes." ;; followed by another type. (setq at-type t)) + ((eq at-type 'no-id) + ;; For an auto type, we assume we definitely have a type construct. + (setq at-type t)) + ((not at-type) ;; Got no type but set things up to continue anyway to handle ;; the various cases when a declaration doesn't start with a diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 13e70a3251..80c461c76c 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -2121,7 +2121,9 @@ fontified with the keyword face and not the type face." t nil c '("const" "restrict" "volatile") c++ '("const" "noexcept" "volatile") - objc '("const" "volatile")) + objc '("const" "volatile") + t (append (c-lang-const c-no-type-kwds) + (c-lang-const c-type-modifier-prefix-kwds))) (c-lang-defconst c-opt-type-modifier-prefix-key ;; Adorned regexp matching `c-type-modifier-prefix-kwds', or nil in @@ -2348,6 +2350,16 @@ will be handled." t (c-make-keywords-re t (c-lang-const c-using-kwds))) (c-lang-defvar c-using-key (c-lang-const c-using-key)) +(c-lang-defconst c-no-type-kwds + "Keywords which remove the need to specify a type in declarations" + t nil + c++ '("auto")) + +(c-lang-defconst c-no-type-key + ;; Regexp matching an entry from `c-no-type-kwds' + t (c-make-keywords-re t (c-lang-const c-no-type-kwds))) +(c-lang-defvar c-no-type-key (c-lang-const c-no-type-key)) + (c-lang-defconst c-typeless-decl-kwds "Keywords introducing declarations where the (first) identifier \(declarator) follows directly after the keyword, without any type. @@ -2361,7 +2373,6 @@ will be handled." ;; {...}"). t (append (c-lang-const c-class-decl-kwds) (c-lang-const c-brace-list-decl-kwds)) - c++ (append (c-lang-const c-typeless-decl-kwds) '("auto")) ; C++11. ;; Note: "manages" for CORBA CIDL clashes with its presence on ;; `c-type-list-kwds' for IDL. idl (append (c-lang-const c-typeless-decl-kwds) @@ -2396,7 +2407,8 @@ If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', `c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses will be handled." t nil - (c c++) '("auto" "extern" "inline" "register" "static") + (c c++) '("extern" "inline" "register" "static") + c (append '("auto") (c-lang-const c-modifier-kwds)) c++ (append '("constexpr" "explicit" "friend" "mutable" "template" "thread_local" "virtual") ;; "using" is now handled specially (2020-09-14). commit c7804ac4018fb03787f291d7ef1739b34914d930 Author: Stefan Monnier Date: Thu Oct 8 09:49:20 2020 -0400 * src/ftcrfont.c (ftcrfont_open): Initialize the `max_width` field On a 32bit build, Emacs can otherwise crash with a !FIXNUM_OVERFLOW_P assertion in `Ffont_info` by simply doing `emacs -Q` and then `C-s`. * src/font.c: Try and detect uninitialized `max_width` fields. (font_make_object): Set max_width to a silly value. (Ffont_info): Check the value is not silly any more. diff --git a/src/font.c b/src/font.c index 20686ce0ec..fe257f47dc 100644 --- a/src/font.c +++ b/src/font.c @@ -188,6 +188,9 @@ font_make_object (int size, Lisp_Object entity, int pixelsize) FONT_OBJECT_MAX, PVEC_FONT); int i; + /* Poison the max_width, so we can detect when it hasn't been set. */ + eassert (font->max_width = 1024 * 1024 * 1024); + /* GC can happen before the driver is set up, so avoid dangling pointer here (Bug#17771). */ font->driver = NULL; @@ -5171,6 +5174,9 @@ If the named font cannot be opened and loaded, return nil. */) return Qnil; font = XFONT_OBJECT (font_object); + /* Sanity check to make sure we have initialized max_width. */ + eassert (XFONT_OBJECT (font_object)->max_width < 1024 * 1024 * 1024); + info = CALLN (Fvector, AREF (font_object, FONT_NAME_INDEX), AREF (font_object, FONT_FULLNAME_INDEX), diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 7832d4f5ce..4892a34a3a 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -187,7 +187,8 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) block_input (); cairo_glyph_t stack_glyph; - font->min_width = font->average_width = font->space_width = 0; + font->min_width = font->max_width = 0; + font->average_width = font->space_width = 0; for (char c = 32; c < 127; c++) { cairo_glyph_t *glyphs = &stack_glyph; @@ -211,6 +212,8 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) && (! font->min_width || font->min_width > this_width)) font->min_width = this_width; + if (this_width > font->max_width) + font->max_width = this_width; if (c == 32) font->space_width = this_width; font->average_width += this_width; @@ -266,6 +269,7 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) font->relative_compose = 0; font->default_ascent = 0; font->vertical_centering = false; + eassert (font->max_width < 512 * 1024 * 1024); return font_object; } commit d340a979dbbd6150a3af4783cf8b3b65368bbdad Author: Stefan Monnier Date: Wed Oct 7 10:51:35 2020 -0400 * lisp/doc-view.el: Fix "can't resize root window" error (doc-view-fit-window-to-page): Change approach to detect when the frame needs to be resized. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 8aaf38aab2..02d89650b8 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -910,17 +910,27 @@ Resize the containing frame if needed." (width-diff (- img-width win-width)) (height-diff (- img-height win-height)) (new-frame-params + ;; If we can't resize the window, try and resize the frame. + ;; We used to compare the `window-width/height` and the + ;; `frame-width/height` instead of catching the errors, but + ;; it's too fiddly (e.g. in the presence of the miniwindow, + ;; the height the frame should be equal to the height of the + ;; root window +1). (append - (if (= (window-width) (frame-width)) - `((width . (text-pixels - . ,(+ (frame-text-width) width-diff)))) - (enlarge-window (/ width-diff (frame-char-width)) 'horiz) - nil) - (if (= (window-height) (frame-height)) - `((height . (text-pixels - . ,(+ (frame-text-height) height-diff)))) - (enlarge-window (/ height-diff (frame-char-height)) nil) - nil)))) + (condition-case nil + (progn + (enlarge-window (/ width-diff (frame-char-width)) 'horiz) + nil) + (error + `((width . (text-pixels + . ,(+ (frame-text-width) width-diff)))))) + (condition-case nil + (progn + (enlarge-window (/ height-diff (frame-char-height)) nil) + nil) + (error + `((height . (text-pixels + . ,(+ (frame-text-height) height-diff))))))))) (when new-frame-params (modify-frame-parameters (selected-frame) new-frame-params))))