commit 9bfcee52c1f191706d50adc194739f642686607e (HEAD, refs/remotes/origin/master) Author: Basil L. Contovounesios Date: Fri Dec 11 01:50:17 2020 +0000 Fix quoting in gnus-buffer-configuration * lisp/gnus/gnus-win.el (gnus-buffer-configuration): Include shell-command-buffer-name value rather than symbol in pipe configuration. (Bug#39138, bug#45154) diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index baa3146e64..e900e294c5 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -68,7 +68,7 @@ used to display Gnus windows." :type 'boolean) (defvar gnus-buffer-configuration - '((group + `((group (vertical 1.0 (group 1.0 point))) (summary @@ -142,7 +142,7 @@ used to display Gnus windows." (pipe (vertical 1.0 (summary 0.25 point) - (shell-command-buffer-name 1.0))) + (,shell-command-buffer-name 1.0))) (bug (vertical 1.0 (if gnus-bug-create-help-buffer '("*Gnus Help Bug*" 0.5)) commit 808817d76f0c1e1d7f9d9f60f1f6f72773d71d5f Author: Eric Abrahamsen Date: Thu Nov 12 20:03:05 2020 -0800 Be more graceful about handling Gnus search errors One search may be applied to several servers: don't let one server's error derail the whole process. * lisp/gnus/gnus-search.el (gnus-search-config-error): Define new error. (gnus-search-run-search, gnus-search-server-to-engine): Raise this specific error as appropriate. (gnus-search-run-query): Catch this error and effectively demote it. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 89d8cff925..0e67fac002 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -105,6 +105,8 @@ (define-error 'gnus-search-parse-error "Gnus search parsing error") +(define-error 'gnus-search-config-error "Gnus search configuration error") + ;;; User Customizable Variables: (defgroup gnus-search nil @@ -1852,8 +1854,10 @@ Assume \"size\" key is equal to \"larger\"." (grouplist (or groups (gnus-search-get-active server))) (buffer (slot-value engine 'proc-buffer))) (unless directory - (error "No directory found in method specification of server %s" - server)) + (signal 'gnus-search-config-error + (list (format-message + "No directory found in definition of server %s" + server)))) (apply 'vconcat (mapcar (lambda (x) @@ -1885,7 +1889,9 @@ Assume \"size\" key is equal to \"larger\"." group nil t))) group)))))) (unless group - (error "Cannot locate directory for group")) + (signal 'gnus-search-config-error + (list + "Cannot locate directory for group"))) (save-excursion (apply 'call-process "find" nil t @@ -1934,12 +1940,19 @@ Assume \"size\" key is equal to \"larger\"." (limit (alist-get 'limit prepared-query))) (mapc (pcase-lambda (`(,server . ,groups)) - (let ((search-engine (gnus-search-server-to-engine server))) - (setq results - (vconcat - (gnus-search-run-search - search-engine server prepared-query groups) - results)))) + (condition-case err + (let ((search-engine (gnus-search-server-to-engine server))) + (setq results + (vconcat + (gnus-search-run-search + search-engine server prepared-query groups) + results))) + (gnus-search-config-error + (if (< 1 (length (alist-get 'search-group-spec specs))) + (apply #'nnheader-message 4 + "Search engine for %s improperly configured: %s" + server (cdr err)) + (signal 'gnus-search-config-error err))))) (alist-get 'search-group-spec specs)) ;; Some search engines do their own limiting, but some don't, so ;; do it again here. This is bad because, if the user is @@ -1949,7 +1962,7 @@ Assume \"size\" key is equal to \"larger\"." ;; from a later group entirely. (if limit (seq-subseq results 0 (min limit (length results))) - results))) + results))) (defun gnus-search-prepare-query (query-spec) "Accept a search query in raw format, and prepare it. @@ -2023,11 +2036,13 @@ remaining string, then adds all that to the top-level spec." (condition-case nil (setf (slot-value inst key) value) ((invalid-slot-name invalid-slot-type) - (nnheader-message - 5 "Invalid search engine parameter: (%s %s)" + (nnheader-report 'search + "Invalid search engine parameter: (%s %s)" key value))))) (push (cons srv inst) gnus-search-engine-instance-alist)) - (error "No search engine defined for %s" srv)) + (signal 'gnus-search-config-error + (list (format-message + "No search engine configured for %s" srv)))) inst)) (declare-function gnus-registry-get-id-key "gnus-registry" (id key)) commit 8ace7700b93c6c0835ddac6633a7ec07daf56225 Author: Stefan Kangas Date: Thu Dec 10 17:42:50 2020 +0100 Remove some ancient Emacs compat code from cperl-mode This variable has this value by default since Emacs 19.34. * lisp/progmodes/cperl-mode.el (cperl-mode): Remove some compat code. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 09d816d88f..ed9b234d69 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1673,10 +1673,6 @@ or as help on variables `cperl-tips', `cperl-problems', (cperl-fontify-syntaxically end)))) ;; Do not introduce variable if not needed, we check it! (setq-local parse-sexp-lookup-properties t) - ;; Fix broken font-lock: - (or (boundp 'font-lock-unfontify-region-function) - (setq font-lock-unfontify-region-function - #'font-lock-default-unfontify-region)) ;; Our: just a plug for wrong font-lock (setq-local font-lock-unfontify-region-function ;; not present with old Emacs commit 26dbba71786913927283443c8b1d0cb4c103a317 Author: Stefan Kangas Date: Thu Dec 10 17:34:05 2020 +0100 Prefer setq-local in cperl-mode.el * lisp/progmodes/cperl-mode.el (cperl-mode, cperl-info-buffer) (cperl-setup-tmp-buf, cperl-emulate-lazy-lock): Prefer setq-local. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 48f0a34880..09d816d88f 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1599,111 +1599,110 @@ or as help on variables `cperl-tips', `cperl-problems', ;; Until Emacs is multi-threaded, we do not actually need it local: (make-local-variable 'cperl-font-lock-multiline-start) (make-local-variable 'cperl-font-locking) - (set (make-local-variable 'outline-regexp) cperl-outline-regexp) - (set (make-local-variable 'outline-level) 'cperl-outline-level) - (set (make-local-variable 'add-log-current-defun-function) - (lambda () - (save-excursion - (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t) - (match-string-no-properties 1))))) - - (set (make-local-variable 'paragraph-start) (concat "^$\\|" page-delimiter)) - (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'paragraph-ignore-fill-prefix) t) - (set (make-local-variable 'indent-line-function) #'cperl-indent-line) - (set (make-local-variable 'require-final-newline) mode-require-final-newline) - (set (make-local-variable 'comment-start) "# ") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'comment-column) cperl-comment-column) - (set (make-local-variable 'comment-start-skip) "#+ *") + (setq-local outline-regexp cperl-outline-regexp) + (setq-local outline-level 'cperl-outline-level) + (setq-local add-log-current-defun-function + (lambda () + (save-excursion + (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t) + (match-string-no-properties 1))))) + + (setq-local paragraph-start (concat "^$\\|" page-delimiter)) + (setq-local paragraph-separate paragraph-start) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local indent-line-function #'cperl-indent-line) + (setq-local require-final-newline mode-require-final-newline) + (setq-local comment-start "# ") + (setq-local comment-end "") + (setq-local comment-column cperl-comment-column) + (setq-local comment-start-skip "#+ *") ;; "[ \t]*sub" ;; (cperl-after-sub-regexp 'named nil) ; 8=name 11=proto 14=attr-start ;; cperl-maybe-white-and-comment-rex ; 15=pre-block - (set (make-local-variable 'defun-prompt-regexp) - (concat "^[ \t]*\\(" - cperl-sub-regexp - (cperl-after-sub-regexp 'named 'attr-groups) - "\\|" ; per toke.c - "\\(BEGIN\\|UNITCHECK\\|CHECK\\|INIT\\|END\\|AUTOLOAD\\|DESTROY\\)" - "\\)" - cperl-maybe-white-and-comment-rex)) - (set (make-local-variable 'comment-indent-function) #'cperl-comment-indent) - (set (make-local-variable 'fill-paragraph-function) - #'cperl-fill-paragraph) - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'indent-region-function) #'cperl-indent-region) + (setq-local defun-prompt-regexp + (concat "^[ \t]*\\(" + cperl-sub-regexp + (cperl-after-sub-regexp 'named 'attr-groups) + "\\|" ; per toke.c + "\\(BEGIN\\|UNITCHECK\\|CHECK\\|INIT\\|END\\|AUTOLOAD\\|DESTROY\\)" + "\\)" + cperl-maybe-white-and-comment-rex)) + (setq-local comment-indent-function #'cperl-comment-indent) + (setq-local fill-paragraph-function #'cperl-fill-paragraph) + (setq-local parse-sexp-ignore-comments t) + (setq-local indent-region-function #'cperl-indent-region) ;;(setq auto-fill-function #'cperl-do-auto-fill) ; Need to switch on and off! - (set (make-local-variable 'imenu-create-index-function) - #'cperl-imenu--create-perl-index) - (set (make-local-variable 'imenu-sort-function) nil) - (set (make-local-variable 'vc-rcs-header) cperl-vc-rcs-header) - (set (make-local-variable 'vc-sccs-header) cperl-vc-sccs-header) + (setq-local imenu-create-index-function #'cperl-imenu--create-perl-index) + (setq-local imenu-sort-function nil) + (setq-local vc-rcs-header cperl-vc-rcs-header) + (setq-local vc-sccs-header cperl-vc-sccs-header) (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x - (set (make-local-variable 'compilation-error-regexp-alist-alist) - (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) - compilation-error-regexp-alist-alist)) + (setq-local compilation-error-regexp-alist-alist + (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) + compilation-error-regexp-alist-alist)) (if (fboundp 'compilation-build-compilation-error-regexp-alist) (let ((f 'compilation-build-compilation-error-regexp-alist)) (funcall f)) (make-local-variable 'compilation-error-regexp-alist) (push 'cperl compilation-error-regexp-alist))) ((boundp 'compilation-error-regexp-alist);; xemacs 19.x - (set (make-local-variable 'compilation-error-regexp-alist) - (append cperl-compilation-error-regexp-alist - compilation-error-regexp-alist)))) - (set (make-local-variable 'font-lock-defaults) - '((cperl-load-font-lock-keywords - cperl-load-font-lock-keywords-1 - cperl-load-font-lock-keywords-2) nil nil ((?_ . "w")))) + (setq-local compilation-error-regexp-alist + (append cperl-compilation-error-regexp-alist + compilation-error-regexp-alist)))) + (setq-local font-lock-defaults + '((cperl-load-font-lock-keywords + cperl-load-font-lock-keywords-1 + cperl-load-font-lock-keywords-2) + nil nil ((?_ . "w")))) ;; Reset syntaxification cache. - (set (make-local-variable 'cperl-syntax-state) nil) + (setq-local cperl-syntax-state nil) (if cperl-use-syntax-table-text-property (if (eval-when-compile (fboundp 'syntax-propertize-rules)) (progn ;; Reset syntaxification cache. - (set (make-local-variable 'cperl-syntax-done-to) nil) - (set (make-local-variable 'syntax-propertize-function) - (lambda (start end) - (goto-char start) - ;; Even if cperl-fontify-syntaxically has already gone - ;; beyond `start', syntax-propertize has just removed - ;; syntax-table properties between start and end, so we have - ;; to re-apply them. - (setq cperl-syntax-done-to start) - (cperl-fontify-syntaxically end)))) + (setq-local cperl-syntax-done-to nil) + (setq-local syntax-propertize-function + (lambda (start end) + (goto-char start) + ;; Even if cperl-fontify-syntaxically has already gone + ;; beyond `start', syntax-propertize has just removed + ;; syntax-table properties between start and end, so we have + ;; to re-apply them. + (setq cperl-syntax-done-to start) + (cperl-fontify-syntaxically end)))) ;; Do not introduce variable if not needed, we check it! - (set (make-local-variable 'parse-sexp-lookup-properties) t) + (setq-local parse-sexp-lookup-properties t) ;; Fix broken font-lock: (or (boundp 'font-lock-unfontify-region-function) (setq font-lock-unfontify-region-function #'font-lock-default-unfontify-region)) ;; Our: just a plug for wrong font-lock - (set (make-local-variable 'font-lock-unfontify-region-function) - ;; not present with old Emacs - #'cperl-font-lock-unfontify-region-function) + (setq-local font-lock-unfontify-region-function + ;; not present with old Emacs + #'cperl-font-lock-unfontify-region-function) ;; Reset syntaxification cache. - (set (make-local-variable 'cperl-syntax-done-to) nil) - (set (make-local-variable 'font-lock-syntactic-keywords) - (if cperl-syntaxify-by-font-lock - '((cperl-fontify-syntaxically)) - ;; unless font-lock-syntactic-keywords, font-lock (pre-22.1) - ;; used to ignore syntax-table text-properties. (t) is a hack - ;; to make font-lock think that font-lock-syntactic-keywords - ;; are defined. - '(t))))) + (setq-local cperl-syntax-done-to nil) + (setq-local font-lock-syntactic-keywords + (if cperl-syntaxify-by-font-lock + '((cperl-fontify-syntaxically)) + ;; unless font-lock-syntactic-keywords, font-lock (pre-22.1) + ;; used to ignore syntax-table text-properties. (t) is a hack + ;; to make font-lock think that font-lock-syntactic-keywords + ;; are defined. + '(t))))) (setq cperl-font-lock-multiline t) ; Not localized... - (set (make-local-variable 'font-lock-multiline) t) - (set (make-local-variable 'font-lock-fontify-region-function) - #'cperl-font-lock-fontify-region-function) + (setq-local font-lock-multiline t) + (setq-local font-lock-fontify-region-function + #'cperl-font-lock-fontify-region-function) (make-local-variable 'cperl-old-style) - (set (make-local-variable 'normal-auto-fill-function) - #'cperl-do-auto-fill) + (setq-local normal-auto-fill-function + #'cperl-do-auto-fill) (if (cperl-val 'cperl-font-lock) (progn (or cperl-faces-init (cperl-init-faces)) (font-lock-mode 1))) - (set (make-local-variable 'facemenu-add-face-function) - #'cperl-facemenu-add-face-function) ; XXXX What this guy is for??? + (setq-local facemenu-add-face-function + #'cperl-facemenu-add-face-function) ; XXXX What this guy is for??? (and (boundp 'msb-menu-cond) (not cperl-msb-fixed) (cperl-msb-fix)) @@ -6107,7 +6106,7 @@ side-effect of memorizing only. Examples in `cperl-style-examples'." (set-buffer "*info-perl-tmp*") (rename-buffer "*info*") (set-buffer bname))) - (set (make-local-variable 'window-min-height) 2) + (setq-local window-min-height 2) (current-buffer))))) (defun cperl-word-at-point (&optional p) @@ -6425,7 +6424,7 @@ by CPerl." (if cperl-use-syntax-table-text-property-for-tags (progn ;; Do not introduce variable if not needed, we check it! - (set (make-local-variable 'parse-sexp-lookup-properties) t)))) + (setq-local parse-sexp-lookup-properties t)))) ;; Copied from imenu-example--name-and-position. (defvar imenu-use-markers) @@ -8347,7 +8346,7 @@ may be used to debug problems with delayed incremental fontification." (goto-char pos) (normal-mode) ;; Why needed??? With older font-locks??? - (set (make-local-variable 'font-lock-cache-position) (make-marker)) + (setq-local font-lock-cache-position (make-marker)) (while (if (> window-size 0) (< pos (point-max)) (> pos (point-min))) commit 904c327ae89399321ed13bc8ca59d5b4e7c007cf Author: Stefan Kangas Date: Thu Dec 10 09:44:25 2020 +0100 Prefer setq-local in bibtex-style.el * lisp/textmodes/bibtex-style.el (bibtex-style-mode): Prefer setq-local. diff --git a/lisp/textmodes/bibtex-style.el b/lisp/textmodes/bibtex-style.el index 952b81621e..41650eb437 100644 --- a/lisp/textmodes/bibtex-style.el +++ b/lisp/textmodes/bibtex-style.el @@ -66,12 +66,12 @@ ;;;###autoload (define-derived-mode bibtex-style-mode nil "BibStyle" "Major mode for editing BibTeX style files." - (set (make-local-variable 'comment-start) "%") - (set (make-local-variable 'outline-regexp) "^[a-z]") - (set (make-local-variable 'imenu-generic-expression) - '((nil "\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" 2))) - (set (make-local-variable 'indent-line-function) 'bibtex-style-indent-line) - (set (make-local-variable 'parse-sexp-ignore-comments) t) + (setq-local comment-start "%") + (setq-local outline-regexp "^[a-z]") + (setq-local imenu-generic-expression + '((nil "\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" 2))) + (setq-local indent-line-function 'bibtex-style-indent-line) + (setq-local parse-sexp-ignore-comments t) (setq font-lock-defaults '(bibtex-style-font-lock-keywords nil t ((?. . "w"))))) commit 97c2bca729862ef5f50b03997e47b63b97b0d2c2 Author: Eli Zaretskii Date: Thu Dec 10 17:10:06 2020 +0200 Avoid segfaults in pos_visible_p * src/xdisp.c (pos_visible_p): Don't try accessing the glyphs produced by iterator whose glyph_row was set to NULL; instead, record the X coordinate before the display string when moving past it, and use the recorded coordinate if needed. (Bug#45156) diff --git a/src/xdisp.c b/src/xdisp.c index ed1d4761b9..689b87df42 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1925,12 +1925,12 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, /* If it3_moved stays false after the 'while' loop below, that means we already were at a newline before the loop (e.g., the display string begins - with a newline), so we don't need to (and cannot) - inspect the glyphs of it3.glyph_row, because - PRODUCE_GLYPHS will not produce anything for a - newline, and thus it3.glyph_row stays at its - stale content it got at top of the window. */ + with a newline), so we don't need to return to + the last position before the display string, + because PRODUCE_GLYPHS will not produce anything + for a newline. */ bool it3_moved = false; + int top_x_before_string = it3.current_x; /* Finally, advance the iterator until we hit the first display element whose character position is CHARPOS, or until the first newline from the @@ -1938,6 +1938,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, display line. */ while (get_next_display_element (&it3)) { + if (!EQ (it3.object, string)) + top_x_before_string = it3.current_x; PRODUCE_GLYPHS (&it3); if (IT_CHARPOS (it3) == charpos || ITERATOR_AT_END_OF_LINE_P (&it3)) @@ -1952,32 +1954,26 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, if (!it3.line_number_produced_p) { if (it3.lnum_pixel_width > 0) - top_x += it3.lnum_pixel_width; + { + top_x += it3.lnum_pixel_width; + top_x_before_string += it3.lnum_pixel_width; + } else if (it.line_number_produced_p) - top_x += it.lnum_pixel_width; + { + top_x += it.lnum_pixel_width; + top_x_before_string += it3.lnum_pixel_width; + } } /* Normally, we would exit the above loop because we found the display element whose character position is CHARPOS. For the contingency that we didn't, and stopped at the first newline from the - display string, move back over the glyphs - produced from the string, until we find the - rightmost glyph not from the string. */ + display string, reset top_x to the coordinate of + the rightmost glyph not from the string. */ if (it3_moved && newline_in_string && IT_CHARPOS (it3) != charpos && EQ (it3.object, string)) - { - struct glyph *g = it3.glyph_row->glyphs[TEXT_AREA] - + it3.glyph_row->used[TEXT_AREA]; - - while (EQ ((g - 1)->object, string)) - { - --g; - top_x -= g->pixel_width; - } - eassert (g < it3.glyph_row->glyphs[TEXT_AREA] - + it3.glyph_row->used[TEXT_AREA]); - } + top_x = top_x_before_string; } } commit 6596b5541dd147749e2091953ac77bcd73c8d404 Author: Mattias Engdegård Date: Thu Dec 10 10:57:16 2020 +0100 Fupcase no longer maps ?ß to itself (bug#11309) * test/src/casefiddle-tests.el (casefiddle-tests-char-casing): (upcase ?ß) now returns ?ẞ (U+7838), partly for technical reasons but the previous behaviour was arbitrary and arguably less useful. Correct upcasing of ß is normally SS, which is what Fupcase returns if given a string, or (for special purposes) ẞ. diff --git a/test/src/casefiddle-tests.el b/test/src/casefiddle-tests.el index 7abb79eadd..3eba4cfd78 100644 --- a/test/src/casefiddle-tests.el +++ b/test/src/casefiddle-tests.el @@ -247,7 +247,8 @@ ;; input upcase downcase [titlecase] (dolist (test '((?a ?A ?a) (?A ?A ?a) (?ł ?Ł ?ł) (?Ł ?Ł ?ł) - (?ß ?ß ?ß) (?ẞ ?ẞ ?ß) + ;; We char-upcase ß to ẞ; see bug #11309. + (?ß ?ẞ ?ß) (?ẞ ?ẞ ?ß) (?ⅷ ?Ⅷ ?ⅷ) (?Ⅷ ?Ⅷ ?ⅷ) (?DŽ ?DŽ ?dž ?Dž) (?Dž ?DŽ ?dž ?Dž) (?dž ?DŽ ?dž ?Dž))) (let ((ch (car test))