commit d46a2fa319808963bbe8d3a90e7dbb13fcd844f5 (HEAD, refs/remotes/origin/master) Author: Al Petrofsky Date: Fri Jun 16 20:06:57 2023 -0400 Make C-SPC work in "M-x term" * lisp/term.el (term-raw-map): Add bindings for C-SPC, C-M-SPC, and C-M-/. (term-send-C-@, term-send-C-M-_, term-send-C-M-@): New commands. (Bug#64121) diff --git a/lisp/term.el b/lisp/term.el index e1392908b90..73f583ff718 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -948,6 +948,9 @@ term-raw-map (define-key map [next] 'term-send-next) (define-key map [xterm-paste] #'term--xterm-paste) (define-key map [?\C-/] #'term-send-C-_) + (define-key map [?\C- ] #'term-send-C-@) + (define-key map [?\C-\M-/] #'term-send-C-M-_) + (define-key map [?\C-\M- ] #'term-send-C-M-@) (when term-bind-function-keys (dotimes (key 21) @@ -1411,6 +1414,9 @@ term-send-next (defun term-send-del () (interactive) (term-send-raw-string "\e[3~")) (defun term-send-backspace () (interactive) (term-send-raw-string "\C-?")) (defun term-send-C-_ () (interactive) (term-send-raw-string "\C-_")) +(defun term-send-C-@ () (interactive) (term-send-raw-string "\C-@")) +(defun term-send-C-M-_ () (interactive) (term-send-raw-string "\e\C-_")) +(defun term-send-C-M-@ () (interactive) (term-send-raw-string "\e\C-@")) (defun term-send-function-key () "If bound to a function key, this will send that key to the underlying shell." commit 1b0348d95934a66d9991a7331ab55e1b9a6c1367 Merge: a9c962be961 cd8d3f3379e Author: Stefan Monnier Date: Sat Jun 17 18:06:01 2023 -0400 Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs commit a9c962be961ae121c4202943879dcf28f3a8364a Author: Stefan Monnier Date: Sat Jun 17 18:05:33 2023 -0400 pp-fill: Fix tests breakage * lisp/emacs-lisp/pp.el (pp-to-string, pp-buffer, pp): Preserve old behavior of (almost always) returning a trailing newline. * test/lisp/emacs-lisp/pp-tests.el (pp-print-quote): Adjust tests, now that `pp-to-string` always returns a trailing newline, rather than only most of the time. * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--single-and-multi-line): Make the test less sensitive to the choice of what is "pretty". diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 88ce5cb3ee8..625fc5f252d 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -142,6 +142,8 @@ pp-to-string (lisp-mode-variables nil) (set-syntax-table emacs-lisp-mode-syntax-table) (funcall (or pp-function pp-default-function) object) + ;; Preserve old behavior of (usually) finishing with a newline. + (unless (bolp) (insert "\n")) (buffer-string))) (defun pp--within-fill-column-p () @@ -236,7 +238,12 @@ pp-fill (defun pp-buffer () "Prettify the current buffer with printed representation of a Lisp object." (interactive) - (funcall pp-default-function (point-min) (point-max))) + (funcall pp-default-function (point-min) (point-max)) + ;; Preserve old behavior of (usually) finishing with a newline and + ;; with point at BOB. + (goto-char (point-max)) + (unless (bolp) (insert "\n")) + (goto-char (point-min))) (defun pp-28 (beg &optional end) ;FIXME: Better name? "Prettify the current region with printed representation of a Lisp object. @@ -283,7 +290,9 @@ pp (eq (syntax-table) emacs-lisp-mode-syntax-table) (eq indent-line-function #'lisp-indent-line)) ;; Skip the buffer->string->buffer middle man. - (funcall pp-default-function object)) + (funcall pp-default-function object) + ;; Preserve old behavior of (usually) finishing with a newline. + (unless (bolp) (insert "\n"))) (t (princ (pp-to-string object) (or stream standard-output))))) diff --git a/test/lisp/emacs-lisp/backtrace-tests.el b/test/lisp/emacs-lisp/backtrace-tests.el index 794488edae8..e5899446ee4 100644 --- a/test/lisp/emacs-lisp/backtrace-tests.el +++ b/test/lisp/emacs-lisp/backtrace-tests.el @@ -226,6 +226,9 @@ backtrace-tests--single-and-multi-line "Forms in backtrace frames can be on a single line or on multiple lines." (ert-with-test-buffer (:name "single-multi-line") (let* ((arg '(lambda (x) ; Quote this so it isn't made into a closure. + ;; Make the form long enough so `number' should not + ;; appear on the first line once pretty-printed. + (interactive (region-beginning)) (let ((number (1+ x))) (+ x number)))) (header-string "Test header: ") @@ -280,7 +283,8 @@ backtrace-tests--verify-single-and-multi-line ;; Verify that the form is now back on one line, ;; and that point is at the same place. (should (string= (backtrace-tests--get-substring - (- (point) 6) (point)) "number")) + (- (point) 6) (point)) + "number")) (should-not (= (point) (pos-bol))) (should (string= (backtrace-tests--get-substring (pos-bol) (1+ (pos-eol))) diff --git a/test/lisp/emacs-lisp/pp-tests.el b/test/lisp/emacs-lisp/pp-tests.el index 72c7cb880d2..1b248e19a31 100644 --- a/test/lisp/emacs-lisp/pp-tests.el +++ b/test/lisp/emacs-lisp/pp-tests.el @@ -23,8 +23,8 @@ (require 'ert-x) (ert-deftest pp-print-quote () - (should (string= (pp-to-string 'quote) "quote")) - (should (string= (pp-to-string ''quote) "'quote")) + (should (string= (pp-to-string 'quote) "quote\n")) + (should (string= (pp-to-string ''quote) "'quote\n")) (should (string= (pp-to-string '('a 'b)) "('a 'b)\n")) (should (string= (pp-to-string '(''quote 'quote)) "(''quote 'quote)\n")) (should (string= (pp-to-string '(quote)) "(quote)\n")) commit 017475a70ed51b69ebe41610e0dd1299bda1bfe3 Author: Stefan Monnier Date: Fri Jun 16 13:35:36 2023 -0400 * doc/lispref/streams.texi (Output Variables): Document `pp-default-function` diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index 89046a68249..896cf4caab5 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -981,6 +981,15 @@ Output Variables having their own escape syntax such as newline. @end defvar +@defopt pp-default-function +This user variable specifies the function used by @code{pp} to prettify +its output. By default it uses @code{pp-fill} which attempts to +strike a good balance between speed and generating natural looking output +that fits within @code{fill-column}. The previous default was +@code{pp-28}, which tends to be faster but generate output that looks +less natural and is less compact. +@end defopt + @node Output Overrides @section Overriding Output Variables @cindex overrides, in output functions diff --git a/etc/NEWS b/etc/NEWS index 61e6e161665..2170323e74a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -396,6 +396,13 @@ name as a string. The new function 'dictionary-completing-read-dictionary' can be used to prompt with completion based on dictionaries that the server supports. +** Pp +*** New 'pp-default-function' custom variable replaces 'pp-use-max-width'. + +*** New default pretty printing function, which tries to obey 'fill-column'. + +*** 'pp-to-string' takes an additional 'pp-function' argument. +This arg specifies the prettifying algorithm to use. * New Modes and Packages in Emacs 30.1 commit 2f181d60323bd9e0196775828de633100479f4c2 Author: Stefan Monnier Date: Fri Jun 16 13:35:06 2023 -0400 pp.el (pp-fill): New default pp function * lisp/emacs-lisp/pp.el (pp-default-function): Change default. (pp--within-fill-column-p): New helper function. (pp-fill): New function. diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index d0356234384..88ce5cb3ee8 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -54,7 +54,7 @@ pp-use-max-width :version "29.1") (make-obsolete-variable 'pp-use-max-width 'pp-default-function "30.1") -(defcustom pp-default-function #'pp-29 +(defcustom pp-default-function #'pp-fill ;; FIXME: The best pretty printer to use depends on the use-case ;; so maybe we should allow callers to specify what they want (maybe with ;; options like `fast', `compact', `code', `data', ...) and these @@ -68,6 +68,7 @@ pp-default-function In both cases, the function can presume that the buffer is setup for Lisp syntax." :type '(choice + (const :tag "Fit within `fill-column'" pp-fill) (const :tag "Emacs<29 algorithm, fast and good enough" pp-28) (const :tag "Work hard for code (slow on large inputs)" pp-emacs-lisp-code) @@ -143,6 +144,94 @@ pp-to-string (funcall (or pp-function pp-default-function) object) (buffer-string))) +(defun pp--within-fill-column-p () + "Return non-nil if point is within `fill-column'." + ;; Try and make it O(fill-column) rather than O(current-column), + ;; so as to avoid major slowdowns on long lines. + ;; FIXME: This doesn't account for invisible text or `display' properties :-( + (and (save-excursion + (re-search-backward + "^\\|\n" (max (point-min) (- (point) fill-column)) t)) + (<= (current-column) fill-column))) + +(defun pp-fill (beg &optional end) + "Break lines in Lisp code between BEG and END so it fits within `fill-column'. +Presumes the current buffer has syntax and indentation properly +configured for that. +Designed under the assumption that the region occupies a single line, +tho it should also work if that's not the case. +Can also be called with a single argument, in which case +it inserts and pretty-prints that arg at point." + (interactive "r") + (if (null end) (pp--object beg #'pp-fill) + (goto-char beg) + (let ((end (copy-marker end t)) + (newline (lambda () + (skip-chars-forward ")]}") + (unless (save-excursion (skip-chars-forward " \t") (eolp)) + (insert "\n") + (indent-according-to-mode))))) + (while (progn (forward-comment (point-max)) + (< (point) end)) + (let ((beg (point)) + ;; Whether we're in front of an element with paired delimiters. + ;; Can be something funky like #'(lambda ..) or ,'#s(...). + (paired (when (looking-at "['`,#]*[[:alpha:]]*\\([({[\"]\\)") + (match-beginning 1)))) + ;; Go to the end of the sexp. + (goto-char (or (scan-sexps (or paired (point)) 1) end)) + (unless + (and + ;; The sexp is all on a single line. + (save-excursion (not (search-backward "\n" beg t))) + ;; And its end is within `fill-column'. + (or (pp--within-fill-column-p) + ;; If the end of the sexp is beyond `fill-column', + ;; try to move the sexp to its own line. + (and + (save-excursion + (goto-char beg) + (if (save-excursion (skip-chars-backward " \t({[',") + (bolp)) + ;; The sexp was already on its own line. + nil + (skip-chars-backward " \t") + (setq beg (copy-marker beg t)) + (if paired (setq paired (copy-marker paired t))) + ;; We could try to undo this insertion if it + ;; doesn't reduce the indentation depth, but I'm + ;; not sure it's worth the trouble. + (insert "\n") (indent-according-to-mode) + t)) + ;; Check again if we moved the whole exp to a new line. + (pp--within-fill-column-p)))) + ;; The sexp is spread over several lines, and/or its end is + ;; (still) beyond `fill-column'. + (when (and paired (not (eq ?\" (char-after paired)))) + ;; The sexp has sub-parts, so let's try and spread + ;; them over several lines. + (save-excursion + (goto-char beg) + (when (looking-at "(\\([^][()\" \t\n;']+\\)") + ;; Inside an expression of the form (SYM ARG1 + ;; ARG2 ... ARGn) where SYM has a `lisp-indent-function' + ;; property that's a number, insert a newline after + ;; the corresponding ARGi, because it tends to lead to + ;; more natural and less indented code. + (let* ((sym (intern-soft (match-string 1))) + (lif (and sym (get sym 'lisp-indent-function)))) + (if (eq lif 'defun) (setq lif 2)) + (when (natnump lif) + (goto-char (match-end 0)) + (forward-sexp lif) + (funcall newline))))) + (save-excursion + (pp-fill (1+ paired) (1- (point))))) + ;; Now the sexp either ends beyond `fill-column' or is + ;; spread over several lines (or both). Either way, the + ;; rest of the line should be moved to its own line. + (funcall newline))))))) + ;;;###autoload (defun pp-buffer () "Prettify the current buffer with printed representation of a Lisp object." commit 184106be2678f18ae90ccd35d69c2ccd61198b0a Author: Stefan Monnier Date: Fri Jun 16 13:31:13 2023 -0400 pp.el (pp-default-function): New custom var * lisp/emacs-lisp/pp.el (pp-use-max-width): Make obsolete. (pp-default-function): New custom var. (pp--object, pp--region): New helper functions. (pp-29): New function, extracted from `pp-to-string`. (pp-to-string): Add `pp-function` arg and obey `pp-default-function`. (pp-28): New function, extracted from `pp-buffer`. (pp-buffer): Rewrite, to obey `pp-default-function`. (pp): Obey `pp-default-function`. (pp-emacs-lisp-code): Add new calling convention to apply it to a region. diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index e6e3cd6c6f4..d0356234384 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -52,53 +52,132 @@ pp-use-max-width large lists." :type 'boolean :version "29.1") +(make-obsolete-variable 'pp-use-max-width 'pp-default-function "30.1") + +(defcustom pp-default-function #'pp-29 + ;; FIXME: The best pretty printer to use depends on the use-case + ;; so maybe we should allow callers to specify what they want (maybe with + ;; options like `fast', `compact', `code', `data', ...) and these + ;; can then be mapped to actual pretty-printing algorithms. + ;; Then again, callers can just directly call the corresponding function. + "Function that `pp' should dispatch to for pretty printing. +That function can be called in one of two ways: +- with a single argument, which it should insert and pretty-print at point. +- with two arguments which delimit a region containing Lisp sexps + which should be pretty-printed. +In both cases, the function can presume that the buffer is setup for +Lisp syntax." + :type '(choice + (const :tag "Emacs<29 algorithm, fast and good enough" pp-28) + (const :tag "Work hard for code (slow on large inputs)" + pp-emacs-lisp-code) + (const :tag "`pp-emacs-lisp-code' if `pp-use-max-width' else `pp-28'" + pp-29) + function) + :version "30.1") (defvar pp--inhibit-function-formatting nil) +;; There are basically two APIs for a pretty-printing function: +;; +;; - either the function takes an object (and prints it in addition to +;; prettifying it). +;; - or the function takes a region containing an already printed object +;; and prettifies its content. +;; +;; `pp--object' and `pp--region' are helper functions to convert one +;; API to the other. + + +(defun pp--object (object region-function) + "Pretty-print OBJECT at point. +The prettifying is done by REGION-FUNCTION which is +called with two positions as arguments and should fold lines +within that region. Returns the result as a string." + (let ((print-escape-newlines pp-escape-newlines) + (print-quoted t) + (beg (point))) + ;; FIXME: In many cases it would be preferable to use `cl-prin1' here. + (prin1 object (current-buffer)) + (funcall region-function beg (point)))) + +(defun pp--region (beg end object-function) + "Pretty-print the object(s) contained within BEG..END. +OBJECT-FUNCTION is called with a single object as argument +and should pretty print it at point into the current buffer." + (save-excursion + (with-restriction beg end + (goto-char (point-min)) + (while + (progn + ;; We'll throw away all the comments within objects, but let's + ;; try at least to preserve the comments between objects. + (forward-comment (point-max)) + (let ((beg (point)) + (object (ignore-error end-of-buffer + (list (read (current-buffer)))))) + (when (consp object) + (delete-region beg (point)) + (funcall object-function (car object)) + t))))))) + +(defun pp-29 (beg-or-sexp &optional end) ;FIXME: Better name? + "Prettify the current region with printed representation of a Lisp object. +Uses the pretty-printing algorithm that was standard in Emacs-29, +which, depending on `pp-use-max-width', will either use `pp-28' +or `pp-emacs-lisp-code'." + (if pp-use-max-width + (let ((pp--inhibit-function-formatting t)) ;FIXME: Why? + (pp-emacs-lisp-code beg-or-sexp end)) + (pp-28 beg-or-sexp end))) + ;;;###autoload -(defun pp-to-string (object) +(defun pp-to-string (object &optional pp-function) "Return a string containing the pretty-printed representation of OBJECT. OBJECT can be any Lisp object. Quoting characters are used as needed -to make output that `read' can handle, whenever this is possible." - (if pp-use-max-width - (let ((pp--inhibit-function-formatting t)) - (with-temp-buffer - (pp-emacs-lisp-code object) - (buffer-string))) - (with-temp-buffer - (lisp-mode-variables nil) - (set-syntax-table emacs-lisp-mode-syntax-table) - (let ((print-escape-newlines pp-escape-newlines) - (print-quoted t)) - (prin1 object (current-buffer))) - (pp-buffer) - (buffer-string)))) +to make output that `read' can handle, whenever this is possible. +Optional argument PP-FUNCTION overrides `pp-default-function'." + (with-temp-buffer + (lisp-mode-variables nil) + (set-syntax-table emacs-lisp-mode-syntax-table) + (funcall (or pp-function pp-default-function) object) + (buffer-string))) ;;;###autoload (defun pp-buffer () "Prettify the current buffer with printed representation of a Lisp object." (interactive) - (goto-char (point-min)) - (while (not (eobp)) - (cond - ((ignore-errors (down-list 1) t) - (save-excursion - (backward-char 1) - (skip-chars-backward "'`#^") - (when (and (not (bobp)) (memq (char-before) '(?\s ?\t ?\n))) + (funcall pp-default-function (point-min) (point-max))) + +(defun pp-28 (beg &optional end) ;FIXME: Better name? + "Prettify the current region with printed representation of a Lisp object. +Uses the pretty-printing algorithm that was standard before Emacs-30. +Non-interactively can also be called with a single argument, in which +case that argument will be inserted pretty-printed at point." + (interactive "r") + (if (null end) (pp--object beg #'pp-29) + (save-restriction beg end + (goto-char (point-min)) + (while (not (eobp)) + (cond + ((ignore-errors (down-list 1) t) + (save-excursion + (backward-char 1) + (skip-chars-backward "'`#^") + (when (and (not (bobp)) (memq (char-before) '(?\s ?\t ?\n))) + (delete-region + (point) + (progn (skip-chars-backward " \t\n") (point))) + (insert "\n")))) + ((ignore-errors (up-list 1) t) + (skip-syntax-forward ")") (delete-region (point) - (progn (skip-chars-backward " \t\n") (point))) - (insert "\n")))) - ((ignore-errors (up-list 1) t) - (skip-syntax-forward ")") - (delete-region - (point) - (progn (skip-chars-forward " \t\n") (point))) - (insert ?\n)) - (t (goto-char (point-max))))) - (goto-char (point-min)) - (indent-sexp)) + (progn (skip-chars-forward " \t\n") (point))) + (insert ?\n)) + (t (goto-char (point-max))))) + (goto-char (point-min)) + (indent-sexp)))) ;;;###autoload (defun pp (object &optional stream) @@ -106,14 +185,18 @@ pp Quoting characters are printed as needed to make output that `read' can handle, whenever this is possible. -This function does not apply special formatting rules for Emacs -Lisp code. See `pp-emacs-lisp-code' instead. - -By default, this function won't limit the line length of lists -and vectors. Bind `pp-use-max-width' to a non-nil value to do so. +Uses the pretty-printing code specified in `pp-default-function'. Output stream is STREAM, or value of `standard-output' (which see)." - (princ (pp-to-string object) (or stream standard-output))) + (cond + ((and (eq (or stream standard-output) (current-buffer)) + ;; Make sure the current buffer is setup sanely. + (eq (syntax-table) emacs-lisp-mode-syntax-table) + (eq indent-line-function #'lisp-indent-line)) + ;; Skip the buffer->string->buffer middle man. + (funcall pp-default-function object)) + (t + (princ (pp-to-string object) (or stream standard-output))))) ;;;###autoload (defun pp-display-expression (expression out-buffer-name &optional lisp) @@ -220,21 +303,24 @@ pp-macroexpand-last-sexp (pp-macroexpand-expression (pp-last-sexp)))) ;;;###autoload -(defun pp-emacs-lisp-code (sexp) +(defun pp-emacs-lisp-code (sexp &optional end) "Insert SEXP into the current buffer, formatted as Emacs Lisp code. Use the `pp-max-width' variable to control the desired line length. -Note that this could be slow for large SEXPs." +Note that this could be slow for large SEXPs. +Can also be called with two arguments, in which case they're taken to be +the bounds of a region containing Lisp code to pretty-print." (require 'edebug) - (let ((obuf (current-buffer))) - (with-temp-buffer - (emacs-lisp-mode) - (pp--insert-lisp sexp) - (insert "\n") - (goto-char (point-min)) - (indent-sexp) - (while (re-search-forward " +$" nil t) - (replace-match "")) - (insert-into-buffer obuf)))) + (if end (pp--region sexp end #'pp-emacs-lisp-code) + (let ((obuf (current-buffer))) + (with-temp-buffer + (emacs-lisp-mode) + (pp--insert-lisp sexp) + (insert "\n") + (goto-char (point-min)) + (indent-sexp) + (while (re-search-forward " +$" nil t) + (replace-match "")) + (insert-into-buffer obuf))))) (defun pp--insert-lisp (sexp) (cl-case (type-of sexp) commit f411cc3a9578eae4ea4549959109817a467f9a16 Author: Stefan Monnier Date: Fri Jun 16 13:14:27 2023 -0400 * lisp/emacs-lisp/lisp-mode.el (lisp-ppss): Fix performance bug (nth 2 ppss) can be absent but not incorrect, so don't recompute ppss for (nth 2 ppss) when (nth 2 ppss) is already provided. When calling `lisp-indent-line` on all the lines in a region, this sometimes introduced a gratuitous O(N²) complexity. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d44c9d6e23d..9914ededb85 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -876,7 +876,7 @@ lisp-ppss 2 (counting from 0). This is important for Lisp indentation." (unless pos (setq pos (point))) (let ((pss (syntax-ppss pos))) - (if (nth 9 pss) + (if (and (not (nth 2 pss)) (nth 9 pss)) (let ((sexp-start (car (last (nth 9 pss))))) (parse-partial-sexp sexp-start pos nil nil (syntax-ppss sexp-start))) pss))) commit cd8d3f3379ec7179fac4bb8e9c40658be15a64f6 Author: Basil L. Contovounesios Date: Tue Jun 13 13:53:31 2023 +0100 Fix some tree-sitter :match regexps This was originally installed on 2023-06-17 in the emacs-29 release branch and later reverted. The intention is to backport it after Emacs 29.1 is released. The shy groups were caught by modified versions of the GNU ELPA packages xr and relint: - https://github.com/mattiase/xr/pull/6 - https://github.com/mattiase/relint/pull/14 * lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Quote special character in regexp. * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): * lisp/progmodes/js.el (js--plain-method-re): (js--treesit-font-lock-settings): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Replace character alternative [\\d], which matches '\' or 'd', with the most likely intention [0-9]. Fix shy groups mistyped as optional colons. Remove unneeded numbered :match group in rust-ts-mode (bug#64019). diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index d7fb833d72b..121c8550be0 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -168,7 +168,7 @@ java-ts-mode--font-lock-settings :override t :feature 'constant `(((identifier) @font-lock-constant-face - (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face)) + (:match "\\`[A-Z_][0-9A-Z_]*\\'" @font-lock-constant-face)) [(true) (false)] @font-lock-constant-face) :language 'java :override t diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 0aeea163b31..5b1984f215f 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -106,7 +106,7 @@ js--opt-cpp-start (defconst js--plain-method-re (concat "^\\s-*?\\(" js--dotted-name-re "\\)\\.prototype" - "\\.\\(" js--name-re "\\)\\s-*?=\\s-*?\\(\\(:?async[ \t\n]+\\)function\\)\\_>") + "\\.\\(" js--name-re "\\)\\s-*?=\\s-*?\\(\\(?:async[ \t\n]+\\)function\\)\\_>") "Regexp matching an explicit JavaScript prototype \"method\" declaration. Group 1 is a (possibly-dotted) class name, group 2 is a method name, and group 3 is the `function' keyword.") @@ -3493,7 +3493,7 @@ js--treesit-font-lock-settings :language 'javascript :feature 'constant '(((identifier) @font-lock-constant-face - (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face)) + (:match "\\`[A-Z_][0-9A-Z_]*\\'" @font-lock-constant-face)) [(true) (false) (null)] @font-lock-constant-face) @@ -3612,7 +3612,7 @@ js--treesit-font-lock-settings :feature 'number '((number) @font-lock-number-face ((identifier) @font-lock-number-face - (:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face))) + (:match "\\`\\(?:NaN\\|Infinity\\)\\'" @font-lock-number-face))) :language 'javascript :feature 'operator diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index 7a00977f14a..adbf18786cb 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1021,7 +1021,7 @@ ruby-ts--s-p-query (:match "\\`\\$[#\"'`:?]" @global_var)) ;; ?' ?" ?` are character literals. ((character) @char - (:match "\\`?[#\"'`:?]" @char)) + (:match "\\`\\?[#\"'`:?]" @char)) ;; Symbols like :+, :<=> or :foo=. ((simple_symbol) @symbol (:match "\\s." @symbol)) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index b55af0b49e3..999c1d7ae96 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -143,7 +143,7 @@ rust-ts-mode--font-lock-settings eol)) @font-lock-builtin-face))) ((identifier) @font-lock-type-face - (:match "\\`\\(:?Err\\|Ok\\|None\\|Some\\)\\'" @font-lock-type-face))) + (:match "\\`\\(?:Err\\|Ok\\|None\\|Some\\)\\'" @font-lock-type-face))) :language 'rust :feature 'comment @@ -232,9 +232,12 @@ rust-ts-mode--font-lock-settings (type_identifier) @font-lock-type-face ((scoped_identifier name: (identifier) @rust-ts-mode--fontify-tail)) ((scoped_identifier path: (identifier) @font-lock-type-face) - (:match - "\\`\\(u8\\|u16\\|u32\\|u64\\|u128\\|usize\\|i8\\|i16\\|i32\\|i64\\|i128\\|isize\\|char\\|str\\)\\'" - @font-lock-type-face)) + (:match ,(rx bos + (or "u8" "u16" "u32" "u64" "u128" "usize" + "i8" "i16" "i32" "i64" "i128" "isize" + "char" "str") + eos) + @font-lock-type-face)) ((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope)) ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope)) (type_identifier) @font-lock-type-face) @@ -249,7 +252,7 @@ rust-ts-mode--font-lock-settings :feature 'constant `((boolean_literal) @font-lock-constant-face ((identifier) @font-lock-constant-face - (:match "\\`[A-Z][A-Z\\d_]*\\'" @font-lock-constant-face))) + (:match "\\`[A-Z][0-9A-Z_]*\\'" @font-lock-constant-face))) :language 'rust :feature 'variable diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 684f69b3567..ccf0026d7ba 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -153,7 +153,7 @@ typescript-ts-mode--font-lock-settings :language language :feature 'constant `(((identifier) @font-lock-constant-face - (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face)) + (:match "\\`[A-Z_][0-9A-Z_]*\\'" @font-lock-constant-face)) [(true) (false) (null)] @font-lock-constant-face) :language language @@ -311,7 +311,7 @@ typescript-ts-mode--font-lock-settings :feature 'number `((number) @font-lock-number-face ((identifier) @font-lock-number-face - (:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face))) + (:match "\\`\\(?:NaN\\|Infinity\\)\\'" @font-lock-number-face))) :language language :feature 'operator commit fef27d28fa70b52b6dc302d0b3ae1687499dd499 Author: Basil L. Contovounesios Date: Mon Jun 12 00:23:56 2023 +0100 Fix more shy group regexps These issues were caught by modified versions of the GNU ELPA packages xr and relint: - https://github.com/mattiase/xr/pull/6 - https://github.com/mattiase/relint/pull/14 * lisp/gnus/gnus-art.el (gnus-parse-news-url): Remove redundant numbered group and calls to match-string. * lisp/progmodes/c-ts-mode.el (c-ts-mode--c-or-c++-regexp): Fix shy group mistyped as optional colon (bug#64019#29). * lisp/vc/vc-git.el (vc-git-annotate-time): Ditto. Also fix timezone parsing by using iso8601-parse (bug#64069). * test/lisp/vc/vc-git-tests.el (vc-git-test-annotate-time): New test. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 6a7a3f41746..6f201f9c3df 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -8331,11 +8331,10 @@ gnus-parse-news-url (when (looking-at "\\([A-Za-z]+\\):") (setq scheme (match-string 1)) (goto-char (match-end 0))) - (when (looking-at "//\\([^:/]+\\)\\(:?\\)\\([0-9]+\\)?/") + (when (looking-at "//\\([^:/]+\\):?\\([0-9]+\\)?/") (setq server (match-string 1)) - (setq port (if (stringp (match-string 3)) - (string-to-number (match-string 3)) - (match-string 3))) + (setq port (and (match-beginning 2) + (string-to-number (match-string 2)))) (goto-char (match-end 0))) (cond diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index b99388a4074..f16e06942b9 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -1355,7 +1355,7 @@ c-ts-mode--c-or-c++-regexp "\\|" id "::" "\\|" id ws-maybe "=\\)" "\\|" "\\(?:inline" ws "\\)?namespace" - "\\(:?" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{" + "\\(?:" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{" "\\|" "class" ws id "\\(?:" ws "final" "\\)?" ws-maybe "[:{;\n]" "\\|" "struct" ws id "\\(?:" ws "final" ws-maybe "[:{\n]" diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index a3469b71386..dfca944dc74 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1723,14 +1723,19 @@ vc-git-annotate-command (declare-function vc-annotate-convert-time "vc-annotate" (&optional time)) +(autoload 'decoded-time-set-defaults "time-date") +(autoload 'iso8601-parse "iso8601") + (defun vc-git-annotate-time () - (and (re-search-forward "^[0-9a-f^]+[^()]+(.*?\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\(:?\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\\)? *[0-9]+) " nil t) - (vc-annotate-convert-time - (apply #'encode-time (mapcar (lambda (match) - (if (match-beginning match) - (string-to-number (match-string match)) - 0)) - '(6 5 4 3 2 1 7)))))) + (and (re-search-forward "^[0-9a-f^]+[^()]+(.*?\\([0-9]+-[0-9]+-[0-9]+\\)\\(?: \\([0-9]+:[0-9]+:[0-9]+\\) \\([-+0-9]+\\)\\)? +[0-9]+) " nil t) + (let* ((dt (match-string 1)) + (dt (if (not (match-beginning 2)) dt + ;; Format as ISO 8601. + (concat dt "T" (match-string 2) (match-string 3)))) + (decoded (ignore-errors (iso8601-parse dt)))) + (and decoded + (vc-annotate-convert-time + (encode-time (decoded-time-set-defaults decoded))))))) (defun vc-git-annotate-extract-revision-at-line () (save-excursion diff --git a/test/lisp/vc/vc-git-tests.el b/test/lisp/vc/vc-git-tests.el index f12c5d3434b..b331b77cf01 100644 --- a/test/lisp/vc/vc-git-tests.el +++ b/test/lisp/vc/vc-git-tests.el @@ -64,4 +64,21 @@ vc-git-test--run-program-version-test (actual-output (vc-git--program-version))) (should (equal actual-output expected-output)))) +(ert-deftest vc-git-test-annotate-time () + "Test `vc-git-annotate-time'." + (require 'vc-annotate) + (with-temp-buffer + (insert "\ +00000000 (Foo Bar 2023-06-14 1) a +00000001 (Foo Bar 2023-06-14 00:00:00 -0130 2) b +00000002 (Foo Bar 2023-06-14 00:00:00 +0145 3) c +00000003 (Foo Bar 2023-06-14 00:00:00 4) d +00000004 (Foo Bar 0-0-0 5) \n") + (goto-char (point-min)) + (should (floatp (vc-git-annotate-time))) + (should (> (vc-git-annotate-time) + (vc-git-annotate-time))) + (should-not (vc-git-annotate-time)) + (should-not (vc-git-annotate-time)))) + ;;; vc-git-tests.el ends here commit f47cf7110edf94b7fb7c7a5ffa97e817f7a0e9d1 Author: Alan Mackenzie Date: Sat Jun 17 13:19:18 2023 +0000 CC Mode: Correct some regexp typos, \\(:? -> \\(?: This partly corrects bug#64069. * lisp/progmodes/cc-langs.el (c-ml-string-back-closer-re): Fix four occurrences, one of which was in a comment, one in a doc string. * lisp/progmodes/cc-mode.el (c-or-c++-mode--regexp.): Fix one occurrence. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 3b4fdc6e141..ffb8c5c7b16 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -739,11 +739,11 @@ c-ml-string-back-closer-re such a backward search will match a minimal string, so a \"context character\" is probably needed at the start of the regexp. The value for csharp-mode would be something like -\"\\\\(:?\\\\`\\\\|[^\\\"]\\\\)\\\"*\\\\\\==\"." +\"\\\\(?:\\\\`\\\\|[^\\\"]\\\\)\\\"*\\\\\\==\"." t nil - pike "\\(:?\\`\\|[^\\\"]\\)\\(:?\\\\.\\)*\\=" + pike "\\(?:\\`\\|[^\\\"]\\)\\(?:\\\\.\\)*\\=" ;;pike ;; 2 - ;; "\\(:?\\`\\|[^\"]\\)\"*\\=" + ;; "\\(?:\\`\\|[^\"]\\)\"*\\=" ) (c-lang-defvar c-ml-string-back-closer-re (c-lang-const c-ml-string-back-closer-re)) diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 11a1d3fe6c2..5cf9b7e17f8 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -2859,7 +2859,7 @@ c-or-c++-mode--regexp "\\|" id "::" "\\|" id ws-maybe "=\\)" "\\|" "\\(?:inline" ws "\\)?namespace" - "\\(:?" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{" + "\\(?:" ws "\\(?:" id "::\\)*" id "\\)?" ws-maybe "{" "\\|" "class" ws id "\\(?:" ws "final" "\\)?" ws-maybe "[:{;\n]" "\\|" "struct" ws id "\\(?:" ws "final" ws-maybe "[:{\n]" commit c279369a7a9e373bb4b88feff0a05f56f3c0fa3b Author: Mattias Engdegård Date: Sat Jun 17 11:55:12 2023 +0200 ; * src/treesit.c (treesit_query_string_string): fix last change Escape the backslash character itself. diff --git a/src/treesit.c b/src/treesit.c index 680e510b74d..87aa1eeb377 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -2312,7 +2312,8 @@ treesit_query_string_string (Lisp_Object str) for (ptrdiff_t i = 0; i < nbytes; i++) { unsigned char c = SREF (str, i); - escapes += (c == '\0' || c == '\n' || c == '\r' || c == '\t' || c == '"'); + escapes += (c == '\0' || c == '\n' || c == '\r' || c == '\t' + || c == '"' || c == '\\'); } ptrdiff_t nchars = SCHARS (str); ptrdiff_t extra = escapes + 2; /* backslashes + double quotes */ @@ -2331,7 +2332,8 @@ treesit_query_string_string (Lisp_Object str) case '\n': *d++ = '\\'; *d++ = 'n'; break; case '\r': *d++ = '\\'; *d++ = 'r'; break; case '\t': *d++ = '\\'; *d++ = 't'; break; - case '"': *d++ = '\\'; *d++ = '"'; break; + case '"': + case '\\': *d++ = '\\'; *d++ = c; break; default: *d++ = c; break; } } diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 6e7d0fc48d2..34540b463cd 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -465,8 +465,8 @@ treesit-query-api ;; Test string conversion in `treesit-pattern-expand'. (should (equal - (treesit-pattern-expand "a\nb\rc\td\0e\"f\1g") - "\"a\\nb\\rc\\td\\0e\\\"f\1g\""))))) + (treesit-pattern-expand "a\nb\rc\td\0e\"f\1g\\h\fi") + "\"a\\nb\\rc\\td\\0e\\\"f\1g\\\\h\fi\""))))) ;;; Narrow commit 30d5f1e62c0769a8d8ec41d0cd49e87b6ae45d40 Author: Eli Zaretskii Date: Sat Jun 17 05:27:03 2023 -0400 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index ddaa3f83fbb..898dcd55f58 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -2428,7 +2428,12 @@ browse-url-default-handlers (fn &optional BUFFER)" t) (autoload 'browse-url-of-dired-file "browse-url" "\ -In Dired, ask a WWW browser to display the file named on this line." t) +In Dired, ask a WWW browser to display the file named on this line. +With prefix arg, use the secondary browser instead (e.g. EWW if +`browse-url-secondary-browser-function' is set to +`eww-browse-url'. + +(fn &optional SECONDARY)" t) (autoload 'browse-url-of-region "browse-url" "\ Use a web browser to display the current region. See `browse-url' for details. @@ -2918,6 +2923,11 @@ "bytecomp" (register-definition-prefixes "semantic/bovine/c" '("semantic")) + +;;; Generated autoloads from progmodes/c-ts-common.el + +(register-definition-prefixes "c-ts-common" '("c-ts-common-")) + ;;; Generated autoloads from progmodes/c-ts-mode.el @@ -4919,6 +4929,16 @@ "comint" of (commands) to run simultaneously. (fn FILES &optional RECURSIVELY LOAD SELECTOR)") +(autoload 'comp-function-type-spec "comp" "\ +Return the type specifier of FUNCTION. + +This function returns a cons cell whose car is the function +specifier, and cdr is a symbol, either `inferred' or `know'. +If the symbol is `inferred', the type specifier is automatically +inferred from the code itself by the native compiler; if it is +`know', the type specifier comes from `comp-known-type-specifiers'. + +(fn FUNCTION)") (register-definition-prefixes "comp" '("comp-" "make-comp-edge" "native-" "no-native-compile")) @@ -7274,7 +7294,7 @@ "diary-lib" the word at mouse click. (fn MENU CLICK)") -(register-definition-prefixes "dictionary" '("dictionary-" "global-dictionary-tooltip-mode")) +(register-definition-prefixes "dictionary" '("dictionary-" "global-dictionary-tooltip-mode" "help-word")) ;;; Generated autoloads from cedet/srecode/dictionary.el @@ -9225,7 +9245,7 @@ "edt-vt100" ;;; Generated autoloads from progmodes/eglot.el -(push (purecopy '(eglot 1 14)) package--builtin-versions) +(push (purecopy '(eglot 1 15)) package--builtin-versions) (autoload 'eglot "eglot" "\ Start LSP server for PROJECT's buffers under MANAGED-MAJOR-MODES. @@ -9269,6 +9289,11 @@ "edt-vt100" (fn MANAGED-MAJOR-MODES PROJECT CLASS CONTACT LANGUAGE-IDS &optional INTERACTIVE)" t) (autoload 'eglot-ensure "eglot" "\ Start Eglot session for current buffer if there isn't one.") +(autoload 'eglot-upgrade-eglot "eglot" "\ +Update Eglot to latest version. + +(fn &rest _)" t) +(define-obsolete-function-alias 'eglot-update 'eglot-upgrade-eglot "29.1") (put 'eglot-workspace-configuration 'safe-local-variable 'listp) (put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t) (defun eglot--debbugs-or-github-bug-uri nil (format (if (string= (match-string 2) "github") "https://github.com/joaotavora/eglot/issues/%s" "https://debbugs.gnu.org/%s") (match-string 3))) @@ -9522,6 +9547,15 @@ "elide-head" (fn &optional REINIT)" t) (register-definition-prefixes "elint" '("elint-")) + +;;; Generated autoloads from progmodes/elixir-ts-mode.el + +(autoload 'elixir-ts-mode "elixir-ts-mode" "\ +Major mode for editing Elixir, powered by tree-sitter. + +(fn)" t) +(register-definition-prefixes "elixir-ts-mode" '("elixir-ts-")) + ;;; Generated autoloads from emacs-lisp/elp.el @@ -11327,7 +11361,7 @@ "ewoc" ;;; Generated autoloads from net/eww.el -(defvar eww-suggest-uris '(eww-links-at-point thing-at-point-url-at-point eww-current-url) "\ +(defvar eww-suggest-uris '(eww-links-at-point thing-at-point-url-at-point eww-current-url eww-bookmark-urls) "\ List of functions called to form the list of default URIs for `eww'. Each of the elements is a function returning either a string or a list of strings. The results will be joined into a single list with @@ -15114,6 +15148,15 @@ "hanoi" (fn &optional ARG)" t) (register-definition-prefixes "hashcash" '("hashcash-")) + +;;; Generated autoloads from progmodes/heex-ts-mode.el + +(autoload 'heex-ts-mode "heex-ts-mode" "\ +Major mode for editing HEEx, powered by tree-sitter. + +(fn)" t) +(register-definition-prefixes "heex-ts-mode" '("heex-ts-")) + ;;; Generated autoloads from help-at-pt.el @@ -16284,6 +16327,15 @@ "holidays" (register-definition-prefixes "semantic/html" '("semantic-")) + +;;; Generated autoloads from textmodes/html-ts-mode.el + +(autoload 'html-ts-mode "html-ts-mode" "\ +Major mode for editing Html, powered by tree-sitter. + +(fn)" t) +(register-definition-prefixes "html-ts-mode" '("html-ts-mode-")) + ;;; Generated autoloads from htmlfontify.el @@ -20684,15 +20736,17 @@ "minibuf-eldef" (fn ARG)" t) (autoload 'forward-to-word "misc" "\ -Move forward until encountering the beginning of a word. -With argument, do this that many times. +Move forward until encountering the beginning of the ARGth word. +ARG defaults to 1. When called interactively, ARG is the prefix +numeric argument. -(fn ARG)" t) +(fn &optional ARG)" t) (autoload 'backward-to-word "misc" "\ -Move backward until encountering the end of a word. -With argument, do this that many times. +Move backward until encountering the end of the ARGth word. +ARG defaults to 1. When called interactively, ARG is the prefix +numeric argument. -(fn ARG)" t) +(fn &optional ARG)" t) (autoload 'butterfly "misc" "\ Use butterflies to flip the desired bit on the drive platter. Open hands and let the delicate wings flap once. The disturbance @@ -22454,7 +22508,7 @@ "opascal" ;;; Generated autoloads from org/org.el -(push (purecopy '(org 9 6 4)) package--builtin-versions) +(push (purecopy '(org 9 6 6)) package--builtin-versions) (autoload 'org-babel-do-load-languages "org" "\ Load the languages defined in `org-babel-load-languages'. @@ -23463,15 +23517,21 @@ package-activate-all had been enabled. (fn PKG &optional DONT-SELECT)" t) -(autoload 'package-update "package" "\ -Update package NAME if a newer version exists. +(autoload 'package-upgrade "package" "\ +Upgrade package NAME if a newer version exists. (fn NAME)" t) -(autoload 'package-update-all "package" "\ +(autoload 'package-upgrade-all "package" "\ Refresh package list and upgrade all packages. -If QUERY, ask the user before updating packages. When called +If QUERY, ask the user before upgrading packages. When called interactively, QUERY is always true. +Currently, packages which are part of the Emacs distribution are +not upgraded by this command. To enable upgrading such a package +using this command, first upgrade the package to a newer version +from ELPA by either using `\\[package-upgrade]' or +`\\\\[package-menu-mark-install]' after `\\[list-packages]'. + (fn &optional QUERY)" t) (autoload 'package-install-from-buffer "package" "\ Install a package from the current buffer. @@ -23556,10 +23616,10 @@ "package" (autoload 'package-vc-install-selected-packages "package-vc" "\ Ensure packages specified in `package-vc-selected-packages' are installed." t) -(autoload 'package-vc-update-all "package-vc" "\ -Attempt to update all installed VC packages." t) -(autoload 'package-vc-update "package-vc" "\ -Attempt to update the package PKG-DESC. +(autoload 'package-vc-upgrade-all "package-vc" "\ +Attempt to upgrade all installed VC packages." t) +(autoload 'package-vc-upgrade "package-vc" "\ +Attempt to upgrade the package PKG-DESC. (fn PKG-DESC)" t) (autoload 'package-vc-install "package-vc" "\ @@ -23575,11 +23635,13 @@ "package" symbol whose name is the package name, and the URL for the package will be taken from the package's metadata. -By default, this function installs the last version of the package -available from its repository, but if REV is given and non-nil, it -specifies the revision to install. If REV has the special value -`:last-release' (interactively, the prefix argument), that stands -for the last released version of the package. +By default, this function installs the last revision of the +package available from its repository. If REV is a string, it +describes the revision to install, as interpreted by the VC +backend. The special value `:last-release' (interactively, the +prefix argument), will use the commit of the latest release, if +it exists. The last release is the latest revision which changed +the \"Version:\" header of the package's main Lisp file. Optional argument BACKEND specifies the VC backend to use for cloning the package's repository; this is only possible if NAME-OR-URL is a URL, @@ -23616,7 +23678,7 @@ "package" cookies, re-compiling Emacs Lisp files, building and installing any documentation, downloading any missing dependencies. This command does not fetch new revisions from a remote server. That -is the responsibility of `package-vc-update'. Interactively, +is the responsibility of `package-vc-upgrade'. Interactively, prompt for the name of the package to rebuild. (fn PKG-DESC)" t) @@ -23671,7 +23733,9 @@ "page-ext" any unknown values other than DST are returned as nil, and an unknown DST value is returned as -1. -(fn STRING)") +See `decode-time' for the meaning of FORM. + +(fn STRING &optional FORM)") (register-definition-prefixes "parse-time" '("parse-")) @@ -24504,7 +24568,7 @@ "pixel-scroll" (fn FILE)") (autoload 'plstore-mode "plstore" "\ -Major mode for editing PLSTORE files. +Major mode for editing plstore files. (fn)" t) (register-definition-prefixes "plstore" '("plstore-")) @@ -25210,6 +25274,11 @@ "ede/proj-shared" of the project instance object. (fn &optional MAYBE-PROMPT DIRECTORY)") +(put 'project-vc-ignores 'safe-local-variable #'listp) +(put 'project-vc-merge-submodules 'safe-local-variable #'booleanp) +(put 'project-vc-include-untracked 'safe-local-variable #'booleanp) +(put 'project-vc-name 'safe-local-variable #'stringp) +(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (not (memq nil (mapcar #'stringp val)))))) (defvar project-prefix-map (let ((map (make-sparse-keymap))) (define-key map "!" 'project-shell-command) (define-key map "&" 'project-async-shell-command) (define-key map "f" 'project-find-file) (define-key map "F" 'project-or-external-find-file) (define-key map "b" 'project-switch-to-buffer) (define-key map "s" 'project-shell) (define-key map "d" 'project-find-dir) (define-key map "D" 'project-dired) (define-key map "v" 'project-vc-dir) (define-key map "c" 'project-compile) (define-key map "e" 'project-eshell) (define-key map "k" 'project-kill-buffers) (define-key map "p" 'project-switch-project) (define-key map "g" 'project-find-regexp) (define-key map "G" 'project-or-external-find-regexp) (define-key map "r" 'project-query-replace-regexp) (define-key map "x" 'project-execute-extended-command) (define-key map "\2" 'project-list-buffers) map) "\ Keymap for project commands.") (define-key ctl-x-map "p" project-prefix-map) @@ -25359,6 +25428,7 @@ project-prefix-map ARG, show only buffers that are visiting files. (fn &optional ARG)" t) +(put 'project-kill-buffers-display-buffer-list 'safe-local-variable #'booleanp) (autoload 'project-kill-buffers "project" "\ Kill the buffers belonging to the current project. Two buffers belong to the same project if their project @@ -26033,7 +26103,7 @@ 'irc `rcirc-server-alist'. STARTUP-CHANNELS is a list of channels that are joined after authentication. -(fn SERVER &optional PORT NICK USER-NAME FULL-NAME STARTUP-CHANNELS PASSWORD ENCRYPTION CERTFP SERVER-ALIAS)") +(fn SERVER &optional PORT NICK USER-NAME FULL-NAME STARTUP-CHANNELS PASSWORD ENCRYPTION SERVER-ALIAS CERTFP)") (defvar rcirc-track-minor-mode nil "\ Non-nil if Rcirc-Track minor mode is enabled. See the `rcirc-track-minor-mode' command @@ -26497,6 +26567,8 @@ "reftex-vars" (parenthesized expressions) in REGEXP. (fn REGEXP)") +(function-put 'regexp-opt-depth 'pure 't) +(function-put 'regexp-opt-depth 'side-effect-free 't) (register-definition-prefixes "regexp-opt" '("regexp-opt-")) @@ -27433,6 +27505,16 @@ "rtree" (dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8")) (add-to-list 'interpreter-mode-alist (cons (purecopy name) 'ruby-mode))) (register-definition-prefixes "ruby-mode" '("ruby-")) + +;;; Generated autoloads from progmodes/ruby-ts-mode.el + +(push (purecopy '(ruby-ts-mode 0 2)) package--builtin-versions) +(autoload 'ruby-ts-mode "ruby-ts-mode" "\ +Major mode for editing Ruby, powered by tree-sitter. + +(fn)" t) +(register-definition-prefixes "ruby-ts-mode" '("ruby-ts-")) + ;;; Generated autoloads from ruler-mode.el @@ -27481,6 +27563,7 @@ "rust-ts-mode" For extending the `rx' notation in FORM, use `rx-define' or `rx-let-eval'. (fn FORM &optional NO-GROUP)") +(function-put 'rx-to-string 'important-return-value 't) (autoload 'rx "rx" "\ Translate regular expressions REGEXPS in sexp form to a regexp string. Each argument is one of the forms below; RX is a subform, and RX... stands @@ -29240,7 +29323,7 @@ "so-long" ;;; Generated autoloads from net/soap-client.el -(push (purecopy '(soap-client 3 2 1)) package--builtin-versions) +(push (purecopy '(soap-client 3 2 3)) package--builtin-versions) (register-definition-prefixes "soap-client" '("soap-")) @@ -30313,6 +30396,7 @@ string-blank-p removed. (fn STRING)") +(function-put 'string-clean-whitespace 'important-return-value 't) (autoload 'named-let "subr-x" "\ Looping construct taken from Scheme. Like `let', bind variables in BINDINGS and then evaluate BODY, @@ -30326,6 +30410,7 @@ string-blank-p Return the width of STRING in pixels. (fn STRING)") +(function-put 'string-pixel-width 'important-return-value 't) (autoload 'string-glyph-split "subr-x" "\ Split STRING into a list of strings representing separate glyphs. This takes into account combining characters and grapheme clusters: @@ -30334,6 +30419,7 @@ string-blank-p indivisible unit. (fn STRING)") +(function-put 'string-glyph-split 'side-effect-free 't) (autoload 'add-display-text-property "subr-x" "\ Add display property PROP with VALUE to the text from START to END. If any text in the region has a non-nil `display' property, those @@ -30347,7 +30433,7 @@ string-blank-p Query the user for a process and return the process object. (fn PROMPT)") -(register-definition-prefixes "subr-x" '("emacs-etc--hide-local-variables" "hash-table-" "internal--thread-argument" "replace-region-contents" "string-" "thread-" "with-buffer-unmodified-if-unchanged")) +(register-definition-prefixes "subr-x" '("emacs-etc--hide-local-variables" "eval-command-interactive-spec" "hash-table-" "internal--thread-argument" "replace-region-contents" "string-" "thread-" "with-buffer-unmodified-if-unchanged")) ;;; Generated autoloads from progmodes/subword.el @@ -31762,7 +31848,7 @@ texinfo-close-quote value of `texinfo-mode-hook'. (fn)" t) -(register-definition-prefixes "texinfo" '("texinfo-")) +(register-definition-prefixes "texinfo" '("fill-paragraph-separate" "texinfo-")) ;;; Generated autoloads from textmodes/texnfo-upd.el @@ -32906,8 +32992,9 @@ "tree-widget" Interactively, if `treesit-language-source-alist' doesn't already have data for building the grammar for LANG, prompt for its -repository URL and the C/C++ compiler to use. Non-interactively, -signal an error when there's no recipe for LANG. +repository URL and the C/C++ compiler to use. The recipe built +by the prompts are saved for the current session if the +installation is successful and the grammar is loadable. This command requires Git, a C compiler and (sometimes) a C++ compiler, and the linker to be installed and on PATH. It also requires that the @@ -33993,6 +34080,8 @@ "use-package-bind-key" :custom-face Call `custom-set-faces' with each face definition. :ensure Loads the package using package.el if necessary. :pin Pin the package to an archive. +:vc Install the package directly from a version control system + (using `package-vc.el'). (fn NAME &rest ARGS)" nil t) (function-put 'use-package 'lisp-indent-function 'defun) @@ -34362,35 +34451,58 @@ 'vc-resolve-conflicts (autoload 'vc-create-tag "vc" "\ Descending recursively from DIR, make a tag called NAME. For each registered file, the working revision becomes part of -the named configuration. If the prefix argument BRANCHP is -given, the tag is made as a new branch and the files are -checked out in that new branch. +the configuration identified by the tag. +If BRANCHP is non-nil (interactively, the prefix argument), the +tag NAME is a new branch, and the files are checked out and +updated to reflect their revisions on that branch. +In interactive use, DIR is `default-directory' for repository-granular +VCSes (all the modern decentralized VCSes belong to this group), +otherwise the command will prompt for DIR. (fn DIR NAME BRANCHP)" t) (autoload 'vc-create-branch "vc" "\ -Descending recursively from DIR, make a branch called NAME. -After a new branch is made, the files are checked out in that new branch. -Uses `vc-create-tag' with the non-nil arg `branchp'. +Make a branch called NAME in directory DIR. +After making the new branch, check out the branch, i.e. update the +files in the tree to their revisions on the branch. + +Interactively, prompt for the NAME of the branch. + +With VCSes that maintain version information per file, this command also +prompts for the directory DIR whose files, recursively, will be tagged +with the NAME of new branch. For VCSes that maintain version +information for the entire repository (all the modern decentralized +VCSes belong to this group), DIR is always the `default-directory'. + +Finally, this command might prompt for the branch or tag from which to +start (\"fork\") the new branch, with completion candidates including +all the known branches and tags in the repository. + +This command invokes `vc-create-tag' with the non-nil BRANCHP argument. (fn DIR NAME)" t) (autoload 'vc-retrieve-tag "vc" "\ -For each file in or below DIR, retrieve their tagged version NAME. +For each file in or below DIR, retrieve their version identified by tag NAME. NAME can name a branch, in which case this command will switch to the named branch in the directory DIR. Interactively, prompt for DIR only for VCS that works at file level; -otherwise use the repository root of the current buffer. +otherwise use the root directory of the current buffer's VC tree. If NAME is empty, it refers to the latest revisions of the current branch. If locking is used for the files in DIR, then there must not be any locked files at or below DIR (but if NAME is empty, locked files are allowed and simply skipped). -If the prefix argument BRANCHP is given, switch the branch -and check out the files in that branch. +If BRANCHP is non-nil (interactively, the prefix argument), switch to the +branch and check out and update the files to their version on that branch. This function runs the hook `vc-retrieve-tag-hook' when finished. (fn DIR NAME &optional BRANCHP)" t) (autoload 'vc-switch-branch "vc" "\ Switch to the branch NAME in the directory DIR. -If NAME is empty, it refers to the latest revisions of the current branch. +If NAME is empty, it refers to the latest revision of the current branch. +Interactively, prompt for DIR only for VCS that works at file level; +otherwise use the root directory of the current buffer's VC tree. +Interactively, prompt for the NAME of the branch. +After switching to the branch, check out and update the files to their +version on that branch. Uses `vc-retrieve-tag' with the non-nil arg `branchp'. (fn DIR NAME)" t) @@ -34423,7 +34535,8 @@ 'vc-resolve-conflicts (fn &optional LIMIT REVISION)" t) (autoload 'vc-print-branch-log "vc" "\ -Show the change log for BRANCH root in a window. +Show the change log for BRANCH in another window. +The command prompts for the branch whose change log to show. (fn BRANCH)" t) (autoload 'vc-log-incoming "vc" "\ @@ -34844,7 +34957,7 @@ "vera-mode" ;;; Generated autoloads from progmodes/verilog-mode.el -(push (purecopy '(verilog-mode 2022 12 18 181110314)) package--builtin-versions) +(push (purecopy '(verilog-mode 2023 6 6 141322628)) package--builtin-versions) (autoload 'verilog-mode "verilog-mode" "\ Major mode for editing Verilog code. \\ @@ -37161,57 +37274,15 @@ "zeroconf" (fn &optional PGM)" t) (register-definition-prefixes "zone" '("zone-")) - - -;;; Generated autoloads from progmodes/ruby-ts-mode.el - -(push (purecopy '(ruby-ts-mode 0 2)) package--builtin-versions) -(autoload 'ruby-ts-mode "ruby-ts-mode" "\ -Major mode for editing Ruby, powered by tree-sitter. - -(fn)" t) -(register-definition-prefixes "ruby-ts-mode" '("ruby-ts-")) - - -;;; Generated autoloads from textmodes/html-ts-mode.el - -(autoload 'html-ts-mode "html-ts-mode" "\ -Major mode for editing Html, powered by tree-sitter. - -(fn)" t) -(register-definition-prefixes "html-ts-mode" '("html-ts-mode-")) - - -;;; Generated autoloads from progmodes/c-ts-common.el - -(register-definition-prefixes "c-ts-common" '("c-ts-common-")) - - -;;; Generated autoloads from progmodes/elixir-ts-mode.el - -(autoload 'elixir-ts-mode "elixir-ts-mode" "\ -Major mode for editing Elixir, powered by tree-sitter. - -(fn)" t) -(register-definition-prefixes "elixir-ts-mode" '("elixir-ts-")) - - -;;; Generated autoloads from progmodes/heex-ts-mode.el - -(autoload 'heex-ts-mode "heex-ts-mode" "\ -Major mode for editing HEEx, powered by tree-sitter. - -(fn)" t) -(register-definition-prefixes "heex-ts-mode" '("heex-ts-")) ;;; End of scraped data (provide 'loaddefs) ;; Local Variables: -;; no-byte-compile: t ;; version-control: never ;; no-update-autoloads: t +;; no-byte-compile: t ;; no-native-compile: t ;; coding: utf-8-emacs-unix ;; End: commit b51be64a715f9f00d3f413aff4ee8a10d30d2a04 Merge: f01821cd00b 3b0bf359e9a Author: Eli Zaretskii Date: Sat Jun 17 05:02:56 2023 -0400 Merge from origin/emacs-29 3b0bf359e9a Fix documentation of comment-dwim (bug#64104) commit f01821cd00b1f941b6a3ea5fc44a10834d02786d Merge: d1ddd1d5d9c 71b27779a9a Author: Eli Zaretskii Date: Sat Jun 17 05:02:56 2023 -0400 ; Merge from origin/emacs-29 The following commits were skipped: 71b27779a9a ; * lisp/net/ldap.el (ldap-search-internal): Fix last cha... d2246b26275 Fix parsing of dn line if WITHDN is non-nil commit d1ddd1d5d9c0b14dff35e7589368dbe8c30549e3 Merge: 8657afac774 84d2da003e1 Author: Eli Zaretskii Date: Sat Jun 17 05:02:55 2023 -0400 Merge from origin/emacs-29 84d2da003e1 ; Fix example in the Flymake manual 0a1459f1d9b * doc/misc/calc.texi (Advanced Math Functions): Correct c... 92faf1f5645 Consider 'dired-kill-when-opening-new-dired-buffer' in mo... bafe71a69fc ; Fix use-package.texi markup 018e4ca6c5d ; * doc/misc/calc.texi (Advanced Math Functions): Fix las... 1952dbd4c5f Fix Gamma function definition in calc.texi f73f82d7e89 Fix subscripts in the Calc manual 70fc7c41ef3 Improve documentation of 'declare' forms c8357582389 ; * src/lread.c (bytecode_from_rev_list): Avoid C++ comment. 28478574961 Improve tree-sitter docs 0e9307eb2b8 Fix some Texinfo markup in manuals 8dc08333eea Fix bol/bos anchors in tree-sitter :match regexps 8225ade6151 ; * src/xdisp.c (syms_of_xdisp) : F... 1f0527a312a ; Fix last change in tex-mode.el 4da479920e6 * lisp/subr.el (with-restriction): Tweak indent rule 36aa9bd8183 ; Fix previous change aaeaf608d89 Fix setting region in the minibuffer 1383efe01d0 Fix setting $DBUS_SESSION_BUS_ADDRESS after Emacs has sta... bdb0bc2b4e4 Fix tex-mode display-buffer issues 90047c38ce9 Add test for when 'completion-auto-help' is 'visible' 2c623e4feb9 Avoid errors in 'apropos-documentation' after 'eval-buffer' dd3b98121cc ; * doc/emacs/indent.texi (Indentation Commands): Fix las... 904edf1f076 Mention indent-rigidly in the Emacs manual commit 3b0bf359e9ac2d1a0abe1d625ce63fa8c9c6e9b4 Author: Eli Zaretskii Date: Sat Jun 17 11:37:19 2023 +0300 Fix documentation of comment-dwim (bug#64104) * lisp/newcomment.el (comment-dwim): Doc fix. * doc/emacs/programs.texi (Comment Commands): More accurate description of what 'M-;' does when there's no active region. diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 69b4f56bee1..a0e0fc06385 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -1095,14 +1095,17 @@ Comment Commands @findex comment-kill @kindex C-u M-; - @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) kills any -comment on the current line, along with the whitespace before it. -Since the comment is saved to the kill ring, you can reinsert it on -another line by moving to the end of that line, doing @kbd{C-y}, and -then @kbd{M-;} to realign the comment. You can achieve the same -effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill} -(@code{comment-dwim} actually calls @code{comment-kill} as a -subroutine when it is given a prefix argument). + @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) when the +region is not active kills any comment on the current line, along with +the whitespace before it. Since the comment is saved to the kill +ring, you can reinsert it on another line by moving to the end of that +line, doing @kbd{C-y}, and then @kbd{M-;} to realign the comment. You +can achieve the same effect as @kbd{C-u M-;} by typing @kbd{M-x +comment-kill} (@code{comment-dwim} actually calls @code{comment-kill} +as a subroutine when it is given a prefix argument). Invoking +@code{comment-dwim} with a prefix numeric argument, as in @w{@kbd{C-u +@var{n} M-;}}, when there's no active region, tells +@code{comment-kill} to kill comments on @var{n} lines. @kindex C-c C-c @r{(C mode)} @findex comment-region diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 022bf3059be..9ae7de70a0e 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -1356,10 +1356,15 @@ comment-dwim "Call the comment command you want (Do What I Mean). If the region is active and `transient-mark-mode' is on, call `comment-region' (unless it only consists of comments, in which -case it calls `uncomment-region'). +case it calls `uncomment-region'); in this case, prefix numeric +argument ARG specifies how many characters to remove from each +comment delimiter (so don't specify a prefix argument whose value +is greater than the total length of the comment delimiters). Else, if the current line is empty, call `comment-insert-comment-function' if it is defined, otherwise insert a comment and indent it. -Else if a prefix ARG is specified, call `comment-kill'. +Else, if a prefix ARG is specified, call `comment-kill'; in this +case, prefix numeric argument ARG specifies on how many lines to kill +the comments. Else, call `comment-indent'. You can configure `comment-style' to change the way regions are commented." (interactive "*P") commit 71b27779a9a014cc5ff594cb0b34fc763387e071 Author: Eli Zaretskii Date: Sat Jun 17 10:59:44 2023 +0300 ; * lisp/net/ldap.el (ldap-search-internal): Fix last change. (Bug#64089) diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 4275b45e6f5..8897c3b6d54 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -710,7 +710,7 @@ ldap-search-internal ;; otherwise `ldap-decode-attribute' would throw a much less ;; comprehensible error later. (cond ((not withdn)) - ((looking-at "^dn[=:\t ]+\\(.*\\)$") + ((looking-at "dn[=:\t ]+\\(.*\\)$") (setq dn (list "dn" (match-string 1)))) (t (error "Incorrect dn line \"%s\" in ldapsearch result" (buffer-substring (point) (line-end-position))))) commit d2246b2627531523dc0decd6bee863820dd2f5bf Author: Jens Schmidt Date: Fri Jun 16 00:04:04 2023 +0200 Fix parsing of dn line if WITHDN is non-nil Function `ldap-search' errors out with `wrong-type-argument listp' when called with WITHDN non-nil. * lisp/net/ldap.el (ldap-search-internal): Parse the dn line correctly so that `ldap-search' can grok it. (Bug#64089) diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 78405414a28..4275b45e6f5 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -703,7 +703,17 @@ ldap-search-internal (while (progn (skip-chars-forward " \t\n") (not (eobp))) - (setq dn (buffer-substring (point) (line-end-position))) + ;; Ignore first (dn) line if WITHDN equals nil. If WITHDN + ;; is non-nil, check syntax of the line and split it into a + ;; pair as expected by `ldap-decode-attribute' (Bug#64089). + ;; If the syntax is wrong, better throw an error here, since + ;; otherwise `ldap-decode-attribute' would throw a much less + ;; comprehensible error later. + (cond ((not withdn)) + ((looking-at "^dn[=:\t ]+\\(.*\\)$") + (setq dn (list "dn" (match-string 1)))) + (t (error "Incorrect dn line \"%s\" in ldapsearch result" + (buffer-substring (point) (line-end-position))))) (forward-line 1) (while (looking-at "^\\([A-Za-z][-A-Za-z0-9]*\ \\|[0-9]+\\(?:\\.[0-9]+\\)*\\)\\(;[-A-Za-z0-9]+\\)*[=:\t ]+\ commit 84d2da003e1c2acc2dddd7b6bc271cb6e1af9755 Author: Eli Zaretskii Date: Sat Jun 17 10:49:45 2023 +0300 ; Fix example in the Flymake manual * doc/misc/flymake.texi (An annotated example backend): Fix the example. (Bug#64070) diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index c7c46896709..66dba8a1d3c 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -738,9 +738,13 @@ An annotated example backend Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. @example +@group ;;; ruby-flymake.el --- A ruby Flymake backend -*- lexical-binding: t; -*- +(require 'cl-lib) (defvar-local ruby--flymake-proc nil) +@end group +@group (defun ruby-flymake (report-fn &rest _args) ;; Not having a ruby interpreter is a serious problem which should cause ;; the backend to disable itself, so an @code{error} is signaled. @@ -754,7 +758,9 @@ An annotated example backend ;; (when (process-live-p ruby--flymake-proc) (kill-process ruby--flymake-proc)) +@end group +@group ;; Save the current buffer, the narrowing restriction, remove any ;; narrowing restriction. ;; @@ -820,11 +826,14 @@ An annotated example backend ;; (process-send-region ruby--flymake-proc (point-min) (point-max)) (process-send-eof ruby--flymake-proc)))) +@end group +@group (defun ruby-setup-flymake-backend () (add-hook 'flymake-diagnostic-functions 'ruby-flymake nil t)) (add-hook 'ruby-mode-hook 'ruby-setup-flymake-backend) +@end group @end example @node The legacy Proc backend commit 8657afac774f36777d0fdd368e0bec64beca22ae Author: Mattias Engdegård Date: Fri Jun 16 12:37:07 2023 +0200 Correct conversion of strings to tree-sitter query syntax The treesitter query syntax for string literals differs from that of Elisp so we cannot just use the Lisp printer (bug#64017). * src/treesit.c (treesit_query_string_string): New function. (Ftreesit_pattern_expand): Use it. * test/src/treesit-tests.el (treesit-query-api): Add test case. diff --git a/src/treesit.c b/src/treesit.c index 0af0e347694..680e510b74d 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -2299,6 +2299,47 @@ DEFUN ("treesit-node-eq", /*** Query functions */ +/* Convert a Lisp string to its printed representation in the tree-sitter + query syntax. */ +static Lisp_Object +treesit_query_string_string (Lisp_Object str) +{ + /* Strings in the treesit query syntax only have the escapes + \n \r \t \0 and any other escaped char stands for that character. + Literal LF, NUL and " are forbidden. */ + ptrdiff_t nbytes = SBYTES (str); + ptrdiff_t escapes = 0; + for (ptrdiff_t i = 0; i < nbytes; i++) + { + unsigned char c = SREF (str, i); + escapes += (c == '\0' || c == '\n' || c == '\r' || c == '\t' || c == '"'); + } + ptrdiff_t nchars = SCHARS (str); + ptrdiff_t extra = escapes + 2; /* backslashes + double quotes */ + Lisp_Object dst = (STRING_MULTIBYTE (str) + ? make_uninit_multibyte_string (nchars + extra, + nbytes + extra) + : make_uninit_string (nbytes + extra)); + unsigned char *d = SDATA (dst); + *d++ = '"'; + for (ptrdiff_t i = 0; i < nbytes; i++) + { + unsigned char c = SREF (str, i); + switch (c) + { + case '\0': *d++ = '\\'; *d++ = '0'; break; + case '\n': *d++ = '\\'; *d++ = 'n'; break; + case '\r': *d++ = '\\'; *d++ = 'r'; break; + case '\t': *d++ = '\\'; *d++ = 't'; break; + case '"': *d++ = '\\'; *d++ = '"'; break; + default: *d++ = c; break; + } + } + *d++ = '"'; + eassert (d == SDATA (dst) + SBYTES (dst)); + return dst; +} + DEFUN ("treesit-pattern-expand", Ftreesit_pattern_expand, Streesit_pattern_expand, 1, 1, 0, @@ -2349,6 +2390,9 @@ DEFUN ("treesit-pattern-expand", pattern, Vtreesit_str_space), closing_delimiter); + if (STRINGP (pattern)) + return treesit_query_string_string (pattern); + return Fprin1_to_string (pattern, Qnil, Qt); } diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 7a8e53924eb..04aa91ddca6 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -461,7 +461,12 @@ treesit-query-api "(type field: (_) @capture .) ? * + \"return\"" (treesit-query-expand '((type field: (_) @capture :anchor) - :? :* :+ "return"))))))) + :? :* :+ "return")))) + + ;; Test string conversion in `treesit-pattern-expand'. + (should (equal + (treesit-pattern-expand "a\nb\rc\td\0e\"f\1g") + "\"a\\nb\\rc\\td\\0e\\\"f\1g\""))))) ;;; Narrow commit f2aae8b879baa4986b69af7ee54fe4eb987b99d6 Author: Tony Zorman Date: Sat Jun 3 14:23:19 2023 +0200 eshell-next-prompt: More precisely navigate to the prompt (bug#63748) * lisp/eshell/em-prompt.el (eshell-next-prompt): Navigate to the current prompt more accurately by using text properties instead of going to the beginning of the line. This is important for multiline prompts, as they don't necessarily start at the beginning of the current line. * test/lisp/eshell/em-prompt-tests.el (em-prompt-test--with-multiline): Execute a given body with a multiline prompt. (em-prompt-test/next-previous-prompt-with): (em-prompt-test/forward-backward-matching-input-with): Helper functions for code reuse. (em-prompt-test/forward-backward-matching-input): (em-prompt-test/next-previous-prompt): Rewrite in terms of the appropriate helper functions. (em-prompt-test/next-previous-prompt-multiline): (em-prompt-test/forward-backward-matching-input-multiline): Add multiline variants of existing tests. diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index 9f9e58e83d7..42f8f273b52 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el @@ -180,7 +180,8 @@ eshell-next-prompt (text-property-search-forward 'field 'prompt t)) (setq n (1- n))) (let (match this-match) - (forward-line 0) ; Don't count prompt on current line. + ;; Don't count the current prompt. + (text-property-search-backward 'field 'prompt t) (while (and (< n 0) (setq this-match (text-property-search-backward 'field 'prompt t))) diff --git a/test/lisp/eshell/em-prompt-tests.el b/test/lisp/eshell/em-prompt-tests.el index 257549e40fb..93bf9d84ab3 100644 --- a/test/lisp/eshell/em-prompt-tests.el +++ b/test/lisp/eshell/em-prompt-tests.el @@ -80,8 +80,13 @@ em-prompt-test/field-properties/no-highlight (apply #'propertize "hello\n" eshell-command-output-properties))))))) -(ert-deftest em-prompt-test/next-previous-prompt () - "Check that navigating forward/backward through old prompts works correctly." +(defmacro em-prompt-test--with-multiline (&rest body) + "Execute BODY with a multiline Eshell prompt." + `(let ((eshell-prompt-function (lambda () "multiline prompt\n$ "))) + ,@body)) + +(defun em-prompt-test/next-previous-prompt-with () + "Helper for checking forward/backward navigation of old prompts." (with-temp-eshell (eshell-insert-command "echo one") (eshell-insert-command "echo two") @@ -98,8 +103,17 @@ em-prompt-test/next-previous-prompt (eshell-next-prompt 3) (should (equal (eshell-get-old-input) "echo fou")))) -(ert-deftest em-prompt-test/forward-backward-matching-input () - "Check that navigating forward/backward via regexps works correctly." +(ert-deftest em-prompt-test/next-previous-prompt () + "Check that navigating forward/backward through old prompts works correctly." + (em-prompt-test/next-previous-prompt-with)) + +(ert-deftest em-prompt-test/next-previous-prompt-multiline () + "Check old prompt forward/backward navigation for multiline prompts." + (em-prompt-test--with-multiline + (em-prompt-test/next-previous-prompt-with))) + +(defun em-prompt-test/forward-backward-matching-input-with () + "Helper for checking forward/backward navigation via regexps." (with-temp-eshell (eshell-insert-command "echo one") (eshell-insert-command "printnl something else") @@ -117,4 +131,13 @@ em-prompt-test/forward-backward-matching-input (eshell-forward-matching-input "echo" 3) (should (equal (eshell-get-old-input) "echo fou")))) +(ert-deftest em-prompt-test/forward-backward-matching-input () + "Check that navigating forward/backward via regexps works correctly." + (em-prompt-test/forward-backward-matching-input-with)) + +(ert-deftest em-prompt-test/forward-backward-matching-input-multiline () + "Check forward/backward regexp navigation for multiline prompts." + (em-prompt-test--with-multiline + (em-prompt-test/forward-backward-matching-input-with))) + ;;; em-prompt-tests.el ends here commit 1acce3b5c7fdf0b2a7301db25dfc2a616df36744 Author: Harald Jörg Date: Thu Jun 15 17:08:07 2023 +0200 ; cperl-mode.el: Fix font-lock after yanking into POD When extending the region to fontify for jit-lock-mode, make sure we start fontifying at the beginning of a POD section (Bug#64056). diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ed021a7ebc9..6548ba3bd36 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3394,7 +3394,9 @@ cperl-unwind-to-safe (goto-char (nth 8 state)) ; beginning of this here-doc (cperl-backward-to-noncomment ; skip back over more (point-min)) ; here-documents (if any) - (beginning-of-line)))) ; skip back over here-doc starters + (beginning-of-line)) ; skip back over here-doc starters + ((nth 4 state) ; in a comment (or POD) + (goto-char (nth 8 state))))) ; ...so go to its beginning (while (and pos (progn (beginning-of-line) (get-text-property (setq pos (point)) 'syntax-type))) commit 0a1459f1d9bcff32d11026a5b20ab6416020c0ae Author: Andreas Schwab Date: Thu Jun 15 16:18:58 2023 +0200 * doc/misc/calc.texi (Advanced Math Functions): Correct calc algebraic syntax. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 8e42e2ee5d0..de014bf0344 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -18613,7 +18613,7 @@ Advanced Math Functions arguments the gamma function can be defined by the following definite integral: @texline @math{\Gamma(a) = \int_0^\infty t^{a-1} e^{-t} dt}. -@infoline @samp{gamma(a) = integ(t@sup{a-1} exp@sup{-t}, t, 0, inf)}. +@infoline @expr{gamma(a) = integ(t^(a-1) exp(-t), t, 0, inf)}. (The actual implementation uses far more efficient computational methods.) @kindex f G @@ -18647,7 +18647,7 @@ Advanced Math Functions the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by the integral, @texline @math{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}. -@infoline @samp{gammaP(a,x) = integ(t@sup{a-1} e@sup{t}, t, 0, x) / gamma(a)}. +@infoline @expr{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}. This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the definition of the normal gamma function). @@ -18682,7 +18682,7 @@ Advanced Math Functions @infoline @expr{beta(a,b) = gamma(a) gamma(b) / gamma(a+b)}, or by @texline @math{B(a,b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}. -@infoline @samp{beta(a,b) = integ(t@sup{a-1} (1-t)@sup{b-1}, t, 0, 1)}. +@infoline @expr{beta(a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, 1)}. @kindex f B @kindex H f B @@ -18692,7 +18692,7 @@ Advanced Math Functions The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes the incomplete beta function @expr{I(x,a,b)}. It is defined by @texline @math{I(x,a,b) = \left( \int_0^x t^{a-1} (1-t)^{b-1} dt \right) / B(a,b)}. -@infoline @samp{betaI(x,a,b) = integ(t@sup{a-1} (1-t)@sup{b-1}, t, 0, x) / beta(a,b)}. +@infoline @expr{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}. Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding un-normalized version [@code{betaB}]. @@ -18704,7 +18704,7 @@ Advanced Math Functions The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the error function @texline @math{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}. -@infoline @samp{erf(x) = 2 integ(exp(-(t@sup{2})), t, 0, x) / sqrt(pi)}. +@infoline @expr{erf(x) = 2 integ(exp(-(t^(2))), t, 0, x) / sqrt(pi)}. The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}] is the corresponding integral from @samp{x} to infinity; the sum @texline @math{\hbox{erf}(x) + \hbox{erfc}(x) = 1}. commit 92faf1f5645c6a38e2cfc71f6fdc008f23a3b4e6 Author: Eli Zaretskii Date: Thu Jun 15 16:12:24 2023 +0300 Consider 'dired-kill-when-opening-new-dired-buffer' in mouse clicks * lisp/dired.el (dired-mouse-find-file): Honor the value of 'dired-kill-when-opening-new-dired-buffer'. (Bug#64079) diff --git a/lisp/dired.el b/lisp/dired.el index 4a4ecc901c4..de875302793 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2765,10 +2765,11 @@ dired-mouse-find-file The optional arguments FIND-FILE-FUNC and FIND-DIR-FUNC specify functions to visit the file and directory, respectively. If omitted or nil, these arguments default to `find-file' and `dired', -respectively." +respectively. If `dired-kill-when-opening-new-dired-buffer' is +non-nil, FIND-DIR-FUNC defaults to `find-alternate-file' instead, +so that the original Dired buffer is not kept." (interactive "e") (or find-file-func (setq find-file-func 'find-file)) - (or find-dir-func (setq find-dir-func 'dired)) (let (window pos file) (save-excursion (setq window (posn-window (event-end event)) @@ -2776,6 +2777,12 @@ dired-mouse-find-file (if (not (windowp window)) (error "No file chosen")) (set-buffer (window-buffer window)) + (unless find-dir-func + (setq find-dir-func + (if (and dired-kill-when-opening-new-dired-buffer + (< (length (get-buffer-window-list)) 2)) + 'find-alternate-file + 'dired))) (goto-char pos) (setq file (dired-get-file-for-visit))) (if (file-directory-p file) commit bafe71a69fc1f33d36e32a80cd3cebd93269b4c2 Author: Robert Pluim Date: Thu Jun 15 12:23:29 2023 +0200 ; Fix use-package.texi markup * doc/misc/use-package.texi (Best practices): It's a subsection, not a subheading. diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi index 87105c4db00..3e98dfd0b71 100644 --- a/doc/misc/use-package.texi +++ b/doc/misc/use-package.texi @@ -790,7 +790,7 @@ Config keyword Emacs start as quickly as possible. @node Best practices -@subheading When to use @code{:preface}, @code{:config} and @code{:init}? +@subsection When to use @code{:preface}, @code{:config} and @code{:init}? @cindex tips for using @code{:preface}, @code{:config}, @code{:init} Where possible, it is better to avoid @code{:preface}, @code{:config} commit 018e4ca6c5de9a1c4dcb524ebc731bcb2a61bd85 Author: Eli Zaretskii Date: Thu Jun 15 11:38:32 2023 +0300 ; * doc/misc/calc.texi (Advanced Math Functions): Fix last change. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index dae071bbd3b..8e42e2ee5d0 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -18647,7 +18647,7 @@ Advanced Math Functions the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by the integral, @texline @math{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}. -@infoline @samp{gammaP(a,x) = integ(t@sup{a-1} exp@sup{t}, t, 0, x) / gamma(a)}. +@infoline @samp{gammaP(a,x) = integ(t@sup{a-1} e@sup{t}, t, 0, x) / gamma(a)}. This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the definition of the normal gamma function). commit ad3ec429a12fb8caa460de5911145d1d3c46d626 Author: Yuan Fu Date: Thu Jun 15 01:22:53 2023 -0700 Fix treesit-install-language-grammar (bug#63990) * lisp/treesit.el: (treesit-install-language-grammar): When called non-interactively, out-dir should default to default-out-dir. diff --git a/lisp/treesit.el b/lisp/treesit.el index ea701ce1ff7..d79e7732387 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -3070,7 +3070,9 @@ treesit-install-language-grammar nil 'treesit--install-language-grammar-out-dir-history default-out-dir) - out-dir))) + ;; When called non-interactively, OUT-DIR should + ;; default to DEFAULT-OUT-DIR. + (or out-dir default-out-dir)))) (condition-case err (progn (apply #'treesit--install-language-grammar-1 commit 1952dbd4c5fe7f82d6e0d10e1ba719b7e6422969 Author: Eli Zaretskii Date: Thu Jun 15 10:39:55 2023 +0300 Fix Gamma function definition in calc.texi * doc/misc/calc.texi (Advanced Math Functions): Fix definition of Gamma function. Use @sup in @infoline lines. (Bug#64077) diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index db6cad3450c..dae071bbd3b 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -18612,8 +18612,8 @@ Advanced Math Functions factorial function: @samp{gamma(n+1) = fact(n)}. For general complex arguments the gamma function can be defined by the following definite integral: -@texline @math{\Gamma(a) = \int_0^\infty t^{a-1} e^t dt}. -@infoline @expr{gamma(a) = integ(t^(a-1) exp(t), t, 0, inf)}. +@texline @math{\Gamma(a) = \int_0^\infty t^{a-1} e^{-t} dt}. +@infoline @samp{gamma(a) = integ(t@sup{a-1} exp@sup{-t}, t, 0, inf)}. (The actual implementation uses far more efficient computational methods.) @kindex f G @@ -18647,7 +18647,7 @@ Advanced Math Functions the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by the integral, @texline @math{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}. -@infoline @expr{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}. +@infoline @samp{gammaP(a,x) = integ(t@sup{a-1} exp@sup{t}, t, 0, x) / gamma(a)}. This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the definition of the normal gamma function). @@ -18682,7 +18682,7 @@ Advanced Math Functions @infoline @expr{beta(a,b) = gamma(a) gamma(b) / gamma(a+b)}, or by @texline @math{B(a,b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}. -@infoline @expr{beta(a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, 1)}. +@infoline @samp{beta(a,b) = integ(t@sup{a-1} (1-t)@sup{b-1}, t, 0, 1)}. @kindex f B @kindex H f B @@ -18692,7 +18692,7 @@ Advanced Math Functions The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes the incomplete beta function @expr{I(x,a,b)}. It is defined by @texline @math{I(x,a,b) = \left( \int_0^x t^{a-1} (1-t)^{b-1} dt \right) / B(a,b)}. -@infoline @expr{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}. +@infoline @samp{betaI(x,a,b) = integ(t@sup{a-1} (1-t)@sup{b-1}, t, 0, x) / beta(a,b)}. Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding un-normalized version [@code{betaB}]. @@ -18704,7 +18704,7 @@ Advanced Math Functions The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the error function @texline @math{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}. -@infoline @expr{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi)}. +@infoline @samp{erf(x) = 2 integ(exp(-(t@sup{2})), t, 0, x) / sqrt(pi)}. The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}] is the corresponding integral from @samp{x} to infinity; the sum @texline @math{\hbox{erf}(x) + \hbox{erfc}(x) = 1}. commit f73f82d7e89884f1bf6374f9f26f792996f77e19 Author: Eli Zaretskii Date: Thu Jun 15 10:08:55 2023 +0300 Fix subscripts in the Calc manual * doc/misc/calc.texi (Musical Notes): Use @sub instead of TeX-only '_' notation. For the details, see the discussion in https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00096.html. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 3ba1a9d4d15..db6cad3450c 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -28470,13 +28470,13 @@ Musical Notes @c flat and @expr{B}. the octave numbered 0 was chosen to correspond to the lowest audible frequency. Using this system, middle C (about 261.625 Hz) -corresponds to the note @expr{C} in octave 4 and is denoted -@expr{C_4}. Any frequency can be described by giving a note plus an +corresponds to the note @slanted{C} in octave 4 and is denoted +@slanted{C@sub{4}}. Any frequency can be described by giving a note plus an offset in cents (where a cent is a ratio of frequencies so that a semitone consists of 100 cents). The midi note number system assigns numbers to notes so that -@expr{C_(-1)} corresponds to the midi note number 0 and @expr{G_9} +@slanted{C@sub{-1}} corresponds to the midi note number 0 and @slanted{G@sub{9}} corresponds to the midi note number 127. A midi controller can have up to 128 keys and each midi note number from 0 to 127 corresponds to a possible key. commit 70fc7c41ef393078001ca339f6abe02776f2e2ae Author: Eli Zaretskii Date: Thu Jun 15 09:28:26 2023 +0300 Improve documentation of 'declare' forms * lisp/simple.el (read-extended-command-predicate): Mention the '(declare completion ...' form in the doc string. * doc/lispref/functions.texi (Declare Form): Clarify 'completion-predicate' and 'modes'; add cross-references. (Bug#64045) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index fc902a70bf0..e646e7c8b0a 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -2609,14 +2609,18 @@ Declare Form @item (completion @var{completion-predicate}) Declare @var{completion-predicate} as a function to determine whether -to include the symbol in the list of functions when asking for -completions in @kbd{M-x}. @var{completion-predicate} is called with -two parameters: The first parameter is the symbol, and the second is -the current buffer. +to include a function's symbol in the list of functions when asking +for completions in @kbd{M-x}. This predicate function will only be +called when @code{read-extended-command-predicate} is customized to +@code{command-completion-default-include-p}; by default the value of +@code{read-extended-command-predicate} is nil (@pxref{Interactive +Call, execute-extended-command}). The predicate +@var{completion-predicate} is called with two arguments: the +function's symbol and the current buffer. @item (modes @var{modes}) -Specify that this command is meant to be applicable for @var{modes} -only. +Specify that this command is meant to be applicable only to specified +@var{modes}. @xref{Command Modes}. @item (interactive-args @var{arg} ...) Specify the arguments that should be stored for @code{repeat-command}. diff --git a/lisp/simple.el b/lisp/simple.el index 9df5958a168..406f1008df3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2225,7 +2225,10 @@ read-extended-command-predicate This excludes from completion candidates those commands which have been marked specific to modes other than the current buffer's mode. Commands that are not specific - to any mode are included. + to any mode are included. If a command has a + `(declare completion...' form which specifies a predicate, + that predicate will be called to determine whether to + include the command in the completion candidates. `command-completion-using-modes-p' This includes in completion candidates only commands commit 020fd630184406a4e25f93e1fb2a3df77c6c9db9 Author: Stefan Monnier Date: Wed Jun 14 17:06:37 2023 -0400 Avoid using `(lambda ...) to build function values * lisp/emacs-lisp/nadvice.el (advice-eval-interactive-spec): Avoid `(lambda ...). diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index e6977f2012a..cd80df2c41d 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -176,7 +176,9 @@ advice-eval-interactive-spec ;; FIXME: Despite appearances, this is not faithful: SPEC and ;; (advice-eval-interactive-spec SPEC) will behave subtly differently w.r.t ;; command-history (and maybe a few other details). - (call-interactively `(lambda (&rest args) (interactive ,spec) args))) + (call-interactively + ;; Sadly (lambda (&rest args) (interactive spec) args) doesn't work :-( + (cconv--interactive-helper (lambda (&rest args) args) spec))) ;; ((functionp spec) (funcall spec)) (t (eval spec)))) commit 9cbd25e5cdd3881a024da8279f42fb8a8115b688 Author: Spencer Baugh Date: Mon Apr 24 10:05:24 2023 -0400 Handle point not at EOB in minibuffer-choose-completion Without this change, only the minibuffer contents before point are cleared when a completion is chosen, which results in stray text when point is in the middle of the minibuffer. After this change, we heuristically decide either to clear the whole buffer or only part of it, taking into account the location of point. * lisp/minibuffer.el (minibuffer-completion-help): Use point when calculating completion-base-affixes. (Bug#62700) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 539206a19e4..d079dc0bcdf 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2395,7 +2395,11 @@ minibuffer-completion-help (prefix (unless (zerop base-size) (substring string 0 base-size))) (base-prefix (buffer-substring (minibuffer--completion-prompt-end) (+ start base-size))) - (base-suffix (buffer-substring (point) (point-max))) + (base-suffix + (if (eq (alist-get 'category (cdr md)) 'file) + (buffer-substring (save-excursion (or (search-forward "/" nil t) (point-max))) + (point-max)) + "")) (all-md (completion--metadata (buffer-substring-no-properties start (point)) base-size md commit c8357582389e7090744c9fbc3ea577d7d639cd1b Author: Po Lu Date: Wed Jun 14 13:54:53 2023 +0800 ; * src/lread.c (bytecode_from_rev_list): Avoid C++ comment. diff --git a/src/lread.c b/src/lread.c index c9df72a7306..cb63021923e 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3286,7 +3286,7 @@ bytecode_from_rev_list (Lisp_Object elems, Lisp_Object readcharfun) Convert them back to the original unibyte form. */ vec[COMPILED_BYTECODE] = Fstring_as_unibyte (vec[COMPILED_BYTECODE]); } - // Bytecode must be immovable. + /* Bytecode must be immovable. */ pin_string (vec[COMPILED_BYTECODE]); } commit 28478574961db23288ba4f6c78fe8e2f5470e0e6 Author: Basil L. Contovounesios Date: Sun Jun 11 15:19:28 2023 +0100 Improve tree-sitter docs * doc/lispref/positions.texi (List Motion): Incorporate more accurate description of treesit-defun-type-regexp from '(elisp) Tree-sitter Major Modes', replacing that duplicate entry (bug#64018). * doc/lispref/parsing.texi (Parsing Program Source) (Language Grammar, Using Parser, Retrieving Nodes) (Accessing Node Information, Pattern Matching, Multiple Languages): (Tree-sitter Major Modes): * doc/lispref/modes.texi (Parser-based Font Lock): Improve wording, grammar, punctuation, and markup. Fix typos. (Parser-based Indentation): Ditto. Document indent rule presets field-is, catch-all, nth-sibling, grand-parent, and great-grand-parent. * lisp/treesit.el (treesit-simple-indent-presets): Mention field-is, catch-all, nth-sibling, grand-parent, great-grand-parent in docstring. (treesit-major-mode-setup, treesit-explore-mode): Improve docstring/commentary grammar. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index bd09386de2b..3eb61b4d565 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -4069,7 +4069,7 @@ Parser-based Font Lock Parser-based font lock and other font lock mechanisms are not mutually exclusive. By default, if enabled, parser-based font lock runs first, -replacing syntactic font lock, then the regexp-based font lock. +replacing syntactic font lock, followed by regexp-based font lock. Although parser-based font lock doesn't share the same customization variables with regexp-based font lock, it uses similar customization @@ -4102,7 +4102,7 @@ Parser-based Font Lock For more information about queries, patterns, and capture names, see @ref{Pattern Matching}. -To setup tree-sitter fontification, a major mode should first set +To set up tree-sitter fontification, a major mode should first set @code{treesit-font-lock-settings} with the output of @code{treesit-font-lock-rules}, then call @code{treesit-major-mode-setup}. @@ -4129,15 +4129,15 @@ Parser-based Font Lock This function takes a series of @var{query-spec}s, where each @var{query-spec} is a @var{query} preceded by one or more -@var{:keyword}/@var{value} pairs. Each @var{query} is a -tree-sitter query in either the string, s-expression or compiled form. +@var{keyword}/@var{value} pairs. Each @var{query} is a tree-sitter +query in either the string, s-expression, or compiled form. @c FIXME: Cross-ref treesit-font-lock-level to user manual. -For each @var{query}, the @var{:keyword}/@var{value} pairs that -precede it add meta information to it. The @code{:language} keyword -declares @var{query}'s language. The @code{:feature} keyword sets the -feature name of @var{query}. Users can control which features are -enabled with @code{treesit-font-lock-level} and +For each @var{query}, the @var{keyword}/@var{value} pairs that precede +it add meta information to it. The @code{:language} keyword declares +@var{query}'s language. The @code{:feature} keyword sets the feature +name of @var{query}. Users can control which features are enabled +with @code{treesit-font-lock-level} and @code{treesit-font-lock-feature-list} (described below). These two keywords are mandatory. @@ -4161,11 +4161,11 @@ Parser-based Font Lock with that face. @findex treesit-fontify-with-override -Capture names can also be function names, in which case the function +A capture name can also be a function name, in which case the function is called with 4 arguments: @var{node} and @var{override}, @var{start} and @var{end}, where @var{node} is the node itself, @var{override} is -the override property of the rule which captured this node, and -@var{start} and @var{end} limits the region in which this function +the @code{:override} property of the rule which captured this node, +and @var{start} and @var{end} limit the region which this function should fontify. (If this function wants to respect the @var{override} argument, it can use @code{treesit-fontify-with-override}.) @@ -4201,9 +4201,9 @@ Parser-based Font Lock highlights whatever is being defined, e.g., the function name in a function definition, the struct name in a struct definition, the variable name in a variable definition; @code{assignment} highlights -the whatever is being assigned to, e.g., the variable or field in an +whatever is being assigned to, e.g., the variable or field in an assignment statement; @code{key} highlights keys in key-value pairs, -e.g., keys in a JSON object, or a Python dictionary; @code{doc} +e.g., keys in a JSON object or Python dictionary; @code{doc} highlights docstrings or doc-comments. For example, the value of this variable could be: @@ -4977,7 +4977,7 @@ Parser-based Indentation to write a custom indentation function that queries the syntax tree and indents accordingly for each language, but that is a lot of work. It is more convenient to use the simple indentation engine described -below: then the major mode needs only to write some indentation rules +below: then the major mode needs only write some indentation rules, and the engine takes care of the rest. To enable the parser-based indentation engine, either set @@ -4996,10 +4996,11 @@ Parser-based Indentation @cindex indentation rules, for parser-based indentation @defvar treesit-simple-indent-rules -This local variable stores indentation rules for every language. It is -a list of the form: @w{@code{(@var{language} . @var{rules})}}, where -@var{language} is a language symbol, and @var{rules} is a list of the -form @w{@code{(@var{matcher} @var{anchor} @var{offset})}}. +This local variable stores indentation rules for every language. It +is an alist with elements of the form @w{@code{(@var{language} +. @var{rules})}}, where @var{language} is a language symbol, and +@var{rules} is a list with elements of the form +@w{@code{(@var{matcher} @var{anchor} @var{offset})}}. First, Emacs passes the smallest tree-sitter node at the beginning of the current line to @var{matcher}; if it returns non-@code{nil}, this @@ -5033,14 +5034,14 @@ Parser-based Indentation @defvar treesit-simple-indent-presets This is a list of defaults for @var{matcher}s and @var{anchor}s in -@code{treesit-simple-indent-rules}. Each of them represents a function -that takes 3 arguments: @var{node}, @var{parent} and @var{bol}. The -available default functions are: +@code{treesit-simple-indent-rules}. Each of them represents a +function that takes 3 arguments: @var{node}, @var{parent}, and +@var{bol}. The available default functions are: @ftable @code @item no-node This matcher is a function that is called with 3 arguments: -@var{node}, @var{parent}, and @var{bol}, and returns non-@code{nil}, +@var{node}, @var{parent}, and @var{bol}. It returns non-@code{nil}, indicating a match, if @var{node} is @code{nil}, i.e., there is no node that starts at @var{bol}. This is the case when @var{bol} is on an empty line or inside a multi-line string, etc. @@ -5057,6 +5058,12 @@ Parser-based Indentation and @var{bol}, and returns non-@code{nil} if @var{node}'s type matches regexp @var{type}. +@item field-is +This matcher is a function of one argument, @var{name}; it returns a +function that is called with 3 arguments: @var{node}, @var{parent}, +and @var{bol}, and returns non-@code{nil} if @var{node}'s field name +in @var{parent} matches regexp @var{name}. + @item query This matcher is a function of one argument, @var{query}; it returns a function that is called with 3 arguments: @var{node}, @var{parent}, @@ -5097,30 +5104,53 @@ Parser-based Indentation @item comment-end This matcher is a function that is called with 3 arguments: @var{node}, @var{parent}, and @var{bol}, and returns non-@code{nil} if -point is before a comment ending token. Comment ending tokens are -defined by regular expression @code{comment-end-skip} +point is before a comment-ending token. Comment-ending tokens are +defined by regexp @code{comment-end-skip}. + +@item catch-all +This matcher is a function that is called with 3 arguments: +@var{node}, @var{parent}, and @var{bol}. It always returns +non-@code{nil}, indicating a match. @item first-sibling This anchor is a function that is called with 3 arguments: @var{node}, @var{parent}, and @var{bol}, and returns the start of the first child of @var{parent}. +@item nth-sibling +This anchor is a function of two arguments: @var{n}, and an optional +argument @var{named}. It returns a function that is called with 3 +arguments: @var{node}, @var{parent}, and @var{bol}, and returns the +start of the @var{n}th child of @var{parent}. If @var{named} is +non-@code{nil}, only named children are counted (@pxref{tree-sitter +named node, named node}). + @item parent This anchor is a function that is called with 3 arguments: @var{node}, @var{parent}, and @var{bol}, and returns the start of @var{parent}. +@item grand-parent +This anchor is a function that is called with 3 arguments: @var{node}, +@var{parent}, and @var{bol}, and returns the start of @var{parent}'s +parent. + +@item great-grand-parent +This anchor is a function that is called with 3 arguments: @var{node}, +@var{parent}, and @var{bol}, and returns the start of @var{parent}'s +parent's parent. + @item parent-bol This anchor is a function that is called with 3 arguments: @var{node}, @var{parent}, and @var{bol}, and returns the first non-space character on the line which @var{parent}'s start is on. -@item parent-bol +@item standalone-parent This anchor is a function that is called with 3 arguments: @var{node}, @var{parent}, and @var{bol}. It finds the first ancestor node -(parent, grandparent, etc) of @var{node} that starts on its own line, -and return the start of that node. ``Starting on its own line'' means -there is only whitespace character before the node on the line which -the node's start is on. +(parent, grandparent, etc.@:) of @var{node} that starts on its own +line, and return the start of that node. ``Starting on its own line'' +means there is only whitespace character before the node on the line +which the node's start is on. @item prev-sibling This anchor is a function that is called with 3 arguments: @var{node}, @@ -5150,14 +5180,14 @@ Parser-based Indentation @item prev-adaptive-prefix This anchor is a function that is called with 3 arguments: @var{node}, -@var{parent}, and @var{bol}. It tries to go to the beginning of the -previous non-empty line, and matches @code{adaptive-fill-regexp}. If -there is a match, this function returns the end of the match, -otherwise it returns @code{nil}. However, if the current line begins -with a prefix (e.g., ``-''), return the beginning of the prefix of the -previous line instead, so that the two prefixes align. This anchor is -useful for an @code{indent-relative}-like indent behavior for block -comments. +@var{parent}, and @var{bol}. It tries to match +@code{adaptive-fill-regexp} to the text at the beginning of the +previous non-empty line. If there is a match, this function returns +the end of the match, otherwise it returns @code{nil}. However, if +the current line begins with a prefix (e.g., @samp{-}), return the +beginning of the prefix of the previous line instead, so that the two +prefixes align. This anchor is useful for an +@code{indent-relative}-like indent behavior for block comments. @end ftable @end defvar @@ -5168,14 +5198,14 @@ Parser-based Indentation Here are some utility functions that can help writing parser-based indentation rules. -@defun treesit-check-indent mode -This function checks the current buffer's indentation against major +@deffn Command treesit-check-indent mode +This command checks the current buffer's indentation against major mode @var{mode}. It indents the current buffer according to @var{mode} and compares the results with the current indentation. Then it pops up a buffer showing the differences. Correct indentation (target) is shown in green color, current indentation is shown in red color. @c Are colors customizable? faces? -@end defun +@end deffn It is also helpful to use @code{treesit-inspect-mode} (@pxref{Language Grammar}) when writing indentation rules. diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 7e77af0a5cf..3906ca0118a 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -9,7 +9,7 @@ Parsing Program Source Emacs provides various ways to parse program source text and produce a @dfn{syntax tree}. In a syntax tree, text is no longer considered a one-dimensional stream of characters, but a structured tree of nodes, -where each node representing a piece of text. Thus, a syntax tree can +where each node represents a piece of text. Thus, a syntax tree can enable interesting features like precise fontification, indentation, navigation, structured editing, etc. @@ -19,8 +19,8 @@ Parsing Program Source In addition to those, Emacs also provides integration with @uref{https://tree-sitter.github.io/tree-sitter, the tree-sitter -library}) if support for it was compiled in. The tree-sitter library -implements an incremental parser and has support from a wide range of +library} if support for it was compiled in. The tree-sitter library +implements an incremental parser and has support for a wide range of programming languages. @defun treesit-available-p @@ -65,10 +65,10 @@ Language Grammar @vindex treesit-extra-load-path @vindex treesit-load-language-error -Tree-sitter language grammar are distributed as dynamic libraries. +Tree-sitter language grammars are distributed as dynamic libraries. In order to use a language grammar in Emacs, you need to make sure that the dynamic library is installed on the system. Emacs looks for -language grammar in several places, in the following order: +language grammars in several places, in the following order: @itemize @bullet @item @@ -95,8 +95,8 @@ Language Grammar This means that Emacs could not find in the library the expected function that every language grammar library should export. @item (version-mismatch @var{error-msg}) -This means that the version of language grammar library is incompatible -with that of the tree-sitter library. +This means that the version of the language grammar library is +incompatible with that of the tree-sitter library. @end table @noindent @@ -105,7 +105,7 @@ Language Grammar @defun treesit-language-available-p language &optional detail This function returns non-@code{nil} if the language grammar for -@var{language} exist and can be loaded. +@var{language} exists and can be loaded. If @var{detail} is non-@code{nil}, return @code{(t . nil)} when @var{language} is available, and @code{(nil . @var{data})} when it's @@ -126,7 +126,7 @@ Language Grammar @end example to the list in the variable @code{treesit-load-name-override-list}, where -@var{library-base-name} is the basename of the dynamic library's file name, +@var{library-base-name} is the basename of the dynamic library's file name (usually, @file{libtree-sitter-@var{language}}), and @var{function-name} is the function provided by the library (usually, @code{tree_sitter_@var{language}}). For example, @@ -146,7 +146,7 @@ Language Grammar tree-sitter library. By default, it returns the latest ABI version supported by the library, but if @var{min-compatible} is non-@code{nil}, it returns the oldest ABI version which the library -still can support. language grammar libraries must be built for +still can support. Language grammar libraries must be built for ABI versions between the oldest and the latest versions supported by the tree-sitter library, otherwise the library will be unable to load them. @@ -232,11 +232,11 @@ Language Grammar @cindex explore tree-sitter syntax tree @cindex inspection of tree-sitter parse tree nodes -To aid in understanding the syntax of a language and in debugging of -Lisp program that use the syntax tree, Emacs provides an ``explore'' -mode, which displays the syntax tree of the source in the current -buffer in real time. Emacs also comes with an ``inspect mode'', which -displays information of the nodes at point in the mode-line. +To aid in understanding the syntax of a language and in debugging Lisp +programs that use the syntax tree, Emacs provides an ``explore'' mode, +which displays the syntax tree of the source in the current buffer in +real time. Emacs also comes with an ``inspect mode'', which displays +information of the nodes at point in the mode-line. @deffn Command treesit-explore-mode This mode pops up a window displaying the syntax tree of the source in @@ -271,7 +271,7 @@ Language Grammar @heading Reading the grammar definition @cindex reading grammar definition, tree-sitter -Authors of language grammar define the @dfn{grammar} of a +Authors of language grammars define the @dfn{grammar} of a programming language, which determines how a parser constructs a concrete syntax tree out of the program text. In order to use the syntax tree effectively, you need to consult the @dfn{grammar file}. @@ -283,7 +283,7 @@ Language Grammar homepage}. The grammar definition is written in JavaScript. For example, the -rule matching a @code{function_definition} node looks like +rule matching a @code{function_definition} node may look like @example @group @@ -331,13 +331,13 @@ Language Grammar @item choice(@var{rule1}, @var{rule2}, @dots{}) matches one of the rules in its arguments. @item repeat(@var{rule}) -matches @var{rule} for @emph{zero or more} times. +matches @var{rule} @emph{zero or more} times. This is like the @samp{*} operator in regular expressions. @item repeat1(@var{rule}) -matches @var{rule} for @emph{one or more} times. +matches @var{rule} @emph{one or more} times. This is like the @samp{+} operator in regular expressions. @item optional(@var{rule}) -matches @var{rule} for @emph{zero or one} time. +matches @var{rule} @emph{zero or one} times. This is like the @samp{?} operator in regular expressions. @item field(@var{name}, @var{rule}) assigns field name @var{name} to the child node matched by @var{rule}. @@ -366,7 +366,7 @@ Language Grammar @item token.immediate(@var{rule}) Normally, grammar rules ignore preceding whitespace; this changes @var{rule} to match only when there is no preceding -whitespaces. +whitespace. @item prec(@var{n}, @var{rule}) gives @var{rule} the level-@var{n} precedence. @item prec.left([@var{n},] @var{rule}) @@ -412,7 +412,7 @@ Using Parser If that buffer is an indirect buffer, its base buffer is used instead. That is, indirect buffers use their base buffer's parsers. If the base buffer is narrowed, an indirect buffer might not be able to -retrieve information of the portion of the buffer text that are +retrieve information of the portion of the buffer text that is invisible in the base buffer. Lisp programs should widen as necessary should they want to use a parser in an indirect buffer. @end defun @@ -441,7 +441,7 @@ Using Parser @vindex treesit-buffer-too-large When a parser does parse, it checks for the size of the buffer. -Tree-sitter can only handle buffer no larger than about 4GB. If the +Tree-sitter can only handle buffers no larger than about 4GB@. If the size exceeds that, Emacs signals the @code{treesit-buffer-too-large} error with signal data being the buffer size. @@ -500,13 +500,12 @@ Using Parser though the text is not directly edited, it is deemed to be ``changed'' nevertheless. -Emacs lets a Lisp program to register callback functions -(a.k.a.@: @dfn{notifiers}) for this kind of changes. A notifier -function takes two arguments: @var{ranges} and @var{parser}. -@var{ranges} is a list of cons cells of the form @w{@code{(@var{start} -. @var{end})}}, where @var{start} and @var{end} mark the start and the -end positions of a range. @var{parser} is the parser issuing the -notification. +Emacs lets a Lisp program register callback functions (a.k.a.@: +@dfn{notifiers}) for these kinds of changes. A notifier function +takes two arguments: @var{ranges} and @var{parser}. @var{ranges} is a +list of cons cells of the form @w{@code{(@var{start} . @var{end})}}, +where @var{start} and @var{end} mark the start and the end positions +of a range. @var{parser} is the parser issuing the notification. Every time a parser reparses a buffer, it compares the old and new parse-tree, computes the ranges in which nodes have changed, and @@ -537,7 +536,7 @@ Retrieving Nodes @cindex get node, tree-sitter @cindex terminology, for tree-sitter functions -Here's some terminology and conventions we use when documenting +Here are some terms and conventions we use when documenting tree-sitter functions. A node in a syntax tree spans some portion of the program text in the @@ -571,8 +570,8 @@ Retrieving Nodes A leaf node is a node that doesn't have any child nodes. This function tries to return a node whose span covers @var{pos}: the -node's beginning position is less or equal to @var{pos}, and the -node's end position is greater or equal to @var{pos}. +node's beginning position is less than or equal to @var{pos}, and the +node's end position is greater than or equal to @var{pos}. If no leaf node's span covers @var{pos} (e.g., @var{pos} is in the whitespace between two leaf nodes), this function returns the first @@ -612,7 +611,7 @@ Retrieving Nodes is at or after @var{end}. @emph{Beware:} calling this function on an empty line that is not -inside any top-level construct (function definition, etc.) most +inside any top-level construct (function definition, etc.@:) most probably will give you the root node, because the root node is the smallest node that covers that empty line. Most of the time, you want to use @code{treesit-node-at} instead. @@ -672,7 +671,7 @@ Retrieving Nodes is the string text. This function returns @code{nil} if there is no @var{n}'th child. -@var{n} could be negative, e.g., @code{-1} represents the last child. +@var{n} could be negative, e.g., @minus{}1 represents the last child. @end defun @defun treesit-node-children node &optional named @@ -694,7 +693,7 @@ Retrieving Nodes @cindex nodes, by field name @cindex syntax tree nodes, by field name -To make the syntax tree easier to analyze, many language grammar +To make the syntax tree easier to analyze, many language grammars assign @dfn{field names} to child nodes (@pxref{tree-sitter node field name, field name}). For example, a @code{function_definition} node could have a @code{declarator} node and a @code{body} node. @@ -729,7 +728,7 @@ Retrieving Nodes This function finds the @emph{smallest} descendant node of @var{node} that spans the region of text between positions @var{beg} and @var{end}. It is similar to @code{treesit-node-at}. If @var{named} -is non-@code{nil}, it looks for smallest named child. +is non-@code{nil}, it looks for the smallest named child. @end defun @heading Searching for node @@ -755,8 +754,8 @@ Retrieving Nodes Like @code{treesit-search-subtree}, this function also traverses the parse tree and matches each node with @var{predicate} (except for @var{start}), where @var{predicate} can be a regexp or a function. -For a tree like the below where @var{start} is marked S, this function -traverses as numbered from 1 to 12: +For a tree like the one below where @var{start} is marked @samp{S}, +this function traverses as numbered from 1 to 12: @example @group @@ -773,7 +772,7 @@ Retrieving Nodes @end example Note that this function doesn't traverse the subtree of @var{start}, -and it always traverse leaf nodes first, then upwards. +and it always traverses leaf nodes first, before moving upwards. Like @code{treesit-search-subtree}, this function only searches for named nodes by default, but if @var{all} is non-@code{nil}, it @@ -786,10 +785,10 @@ Retrieving Nodes start positions greater than the end position of @var{start}. In the tree shown above, @code{treesit-search-subtree} traverses node -S (@var{start}) and nodes marked with @code{o}, where this function -traverses the nodes marked with numbers. This function is useful for -answering questions like ``what is the first node after @var{start} in -the buffer that satisfies some condition?'' +@samp{S} (@var{start}) and nodes marked with @code{o}, where this +function traverses the nodes marked with numbers. This function is +useful for answering questions like ``what is the first node after +@var{start} in the buffer that satisfies some condition?'' @end defun @defun treesit-search-forward-goto node predicate &optional start backward all @@ -801,7 +800,7 @@ Retrieving Nodes progress in terms of buffer position: the start/end position of the returned node is always greater than that of @var{node}. -Arguments @var{predicate}, @var{backward} and @var{all} are the same +Arguments @var{predicate}, @var{backward}, and @var{all} are the same as in @code{treesit-search-forward}. @end defun @@ -811,12 +810,12 @@ Retrieving Nodes It takes the subtree under @var{root}, and combs it so only the nodes that match @var{predicate} are left. Like previous functions, the @var{predicate} can be a regexp string that matches against each -node's type, or a function that takes a node and return non-@code{nil} -if it matches. +node's type, or a function that takes a node and returns +non-@code{nil} if it matches. -For example, for a subtree on the left that consist of both numbers -and letters, if @var{predicate} is ``letter only'', the returned tree -is the one on the right. +For example, given the subtree on the left that consists of both +numbers and letters, if @var{predicate} is ``letter only'', the +returned tree is the one on the right. @example @group @@ -836,9 +835,9 @@ Retrieving Nodes If @var{process-fn} is non-@code{nil}, instead of returning the matched nodes, this function passes each node to @var{process-fn} and -uses the returned value instead. If non-@code{nil}, @var{depth} is -the number of levels to go down from @var{root}. If @var{depth} is -@code{nil}, it defaults to 1000. +uses the returned value instead. If non-@code{nil}, @var{depth} +limits the number of levels to go down from @var{root}. If +@var{depth} is @code{nil}, it defaults to 1000. Each node in the returned tree looks like @w{@code{(@var{tree-sitter-node} . (@var{child} @dots{}))}}. The @@ -853,17 +852,17 @@ Retrieving Nodes This function finds immediate children of @var{node} that satisfy @var{predicate}. -The @var{predicate} function takes a node as the argument and should +The @var{predicate} function takes a node as argument and should return non-@code{nil} to indicate that the node should be kept. If -@var{named} is non-@code{nil}, this function only examines the named +@var{named} is non-@code{nil}, this function only examines named nodes. @end defun @defun treesit-parent-until node predicate &optional include-node This function repeatedly finds the parents of @var{node}, and returns the parent that satisfies @var{pred}, a function that takes a node as -the argument and returns a boolean that indicates a match. If no -parent satisfies @var{pred}, this function returns @code{nil}. +argument and returns a boolean that indicates a match. If no parent +satisfies @var{pred}, this function returns @code{nil}. Normally this function only looks at the parents of @var{node} but not @var{node} itself. But if @var{include-node} is non-@code{nil}, this @@ -873,10 +872,10 @@ Retrieving Nodes @defun treesit-parent-while node pred This function goes up the tree starting from @var{node}, and keeps doing so as long as the nodes satisfy @var{pred}, a function that -takes a node as the argument. That is, this function returns the -highest parent of @var{node} that still satisfies @var{pred}. Note -that if @var{node} satisfies @var{pred} but its immediate parent -doesn't, @var{node} itself is returned. +takes a node as argument. That is, this function returns the highest +parent of @var{node} that still satisfies @var{pred}. Note that if +@var{node} satisfies @var{pred} but its immediate parent doesn't, +@var{node} itself is returned. @end defun @defun treesit-node-top-level node &optional type @@ -979,7 +978,7 @@ Accessing Node Information @cindex tree-sitter, live parsing node @cindex live node, tree-sitter A node is considered @dfn{live} if its parser is not deleted, and the -buffer to which it belongs to is a live buffer (@pxref{Killing Buffers}). +buffer to which it belongs is a live buffer (@pxref{Killing Buffers}). @defun treesit-node-check node property This function returns non-@code{nil} if @var{node} has the specified @@ -1016,12 +1015,12 @@ Accessing Node Information @var{node}. It returns @code{nil} if there is no @var{n}'th child, or the @var{n}'th child doesn't have a field name. -Note that @var{n} counts both named and anonymous child. And @var{n} -could be negative, e.g., @code{-1} represents the last child. +Note that @var{n} counts both named and anonymous children, and +@var{n} can be negative, e.g., @minus{}1 represents the last child. @end defun @defun treesit-node-child-count node &optional named -This function finds the number of children of @var{node}. If +This function returns the number of children of @var{node}. If @var{named} is non-@code{nil}, it only counts named children (@pxref{tree-sitter named node, named node}). @end defun @@ -1048,7 +1047,7 @@ Pattern Matching @cindex query, tree-sitter A @dfn{query} consists of multiple @dfn{patterns}. Each pattern is an s-expression that matches a certain node in the syntax node. A -pattern has the form @w{@code{(@var{type} (@var{child}@dots{}))}} +pattern has the form @w{@code{(@var{type} (@var{child}@dots{}))}}. For example, a pattern that matches a @code{binary_expression} node that contains @code{number_literal} child nodes would look like @@ -1084,25 +1083,26 @@ Pattern Matching Now we can introduce the @dfn{query functions}. @defun treesit-query-capture node query &optional beg end node-only -This function matches patterns in @var{query} within @var{node}. -The argument @var{query} can be either a string, a s-expression, or a +This function matches patterns in @var{query} within @var{node}. The +argument @var{query} can be either a string, an s-expression, or a compiled query object. For now, we focus on the string syntax; -s-expression syntax and compiled query are described at the end of the -section. +s-expression syntax and compiled queries are described at the end of +the section. The argument @var{node} can also be a parser or a language symbol. A -parser means using its root node, a language symbol means find or -create a parser for that language in the current buffer, and use the -root node. - -The function returns all the captured nodes in a list of the form -@w{@code{(@var{capture_name} . @var{node})}}. If @var{node-only} is -non-@code{nil}, it returns the list of nodes instead. By default the -entire text of @var{node} is searched, but if @var{beg} and @var{end} -are both non-@code{nil}, they specify the region of buffer text where -this function should match nodes. Any matching node whose span -overlaps with the region between @var{beg} and @var{end} are captured, -it doesn't have to be completely in the region. +parser means use its root node, a language symbol means find or create +a parser for that language in the current buffer, and use the root +node. + +The function returns all the captured nodes in an alist with elements +of the form @w{@code{(@var{capture_name} . @var{node})}}. If +@var{node-only} is non-@code{nil}, it returns the list of @var{node}s +instead. By default the entire text of @var{node} is searched, but if +@var{beg} and @var{end} are both non-@code{nil}, they specify the +region of buffer text where this function should match nodes. Any +matching node whose span overlaps with the region between @var{beg} +and @var{end} is captured; it doesn't have to be completely contained +in the region. @vindex treesit-query-error @findex treesit-query-validate @@ -1146,13 +1146,13 @@ Pattern Matching @end example @defun treesit-query-string string query language -This function parses @var{string} with @var{language}, matches its -root node with @var{query}, and returns the result. +This function parses @var{string} as @var{language}, matches its root +node with @var{query}, and returns the result. @end defun @heading More query syntax -Besides node type and capture, tree-sitter's pattern syntax can +Besides node type and capture name, tree-sitter's pattern syntax can express anonymous node, field name, wildcard, quantification, grouping, alternation, anchor, and predicate. @@ -1168,11 +1168,11 @@ Pattern Matching @subheading Wild card In a pattern, @samp{(_)} matches any named node, and @samp{_} matches -any named and anonymous node. For example, to capture any named child +any named or anonymous node. For example, to capture any named child of a @code{binary_expression} node, the pattern would be @example -(binary_expression (_) @@in_biexp) +(binary_expression (_) @@in-biexp) @end example @subheading Field name @@ -1190,7 +1190,7 @@ Pattern Matching @end example It is also possible to capture a node that doesn't have a certain -field, say, a @code{function_definition} without a @code{body} field. +field, say, a @code{function_definition} without a @code{body} field: @example (function_definition !body) @@func-no-body @@ -1199,20 +1199,20 @@ Pattern Matching @subheading Quantify node @cindex quantify node, tree-sitter -Tree-sitter recognizes quantification operators @samp{*}, @samp{+} and -@samp{?}. Their meanings are the same as in regular expressions: +Tree-sitter recognizes quantification operators @samp{*}, @samp{+}, +and @samp{?}. Their meanings are the same as in regular expressions: @samp{*} matches the preceding pattern zero or more times, @samp{+} -matches one or more times, and @samp{?} matches zero or one time. +matches one or more times, and @samp{?} matches zero or one times. For example, the following pattern matches @code{type_declaration} -nodes that has @emph{zero or more} @code{long} keyword. +nodes that have @emph{zero or more} @code{long} keywords. @example (type_declaration "long"*) @@long-type @end example -The following pattern matches a type declaration that has zero or one -@code{long} keyword: +The following pattern matches a type declaration that may or may not +have a @code{long} keyword: @example (type_declaration "long"?) @@long-type @@ -1220,9 +1220,9 @@ Pattern Matching @subheading Grouping -Similar to groups in regular expression, we can bundle patterns into +Similar to groups in regular expressions, we can bundle patterns into groups and apply quantification operators to them. For example, to -express a comma separated list of identifiers, one could write +express a comma-separated list of identifiers, one could write @example (identifier) ("," (identifier))* @@ -1230,10 +1230,10 @@ Pattern Matching @subheading Alternation -Again, similar to regular expressions, we can express ``match anyone -from this group of patterns'' in a pattern. The syntax is a list of -patterns enclosed in square brackets. For example, to capture some -keywords in C, the pattern would be +Again, similar to regular expressions, we can express ``match any one +of these patterns'' in a pattern. The syntax is a list of patterns +enclosed in square brackets. For example, to capture some keywords in +C, the pattern would be @example @group @@ -1292,14 +1292,14 @@ Pattern Matching @end example @noindent -tree-sitter only matches arrays where the first element equals to the -last element. To attach a predicate to a pattern, we need to group -them together. A predicate always starts with a @samp{#}. Currently -there are three predicates, @code{#equal}, @code{#match}, and -@code{#pred}. +tree-sitter only matches arrays where the first element is equal to +the last element. To attach a predicate to a pattern, we need to +group them together. A predicate always starts with a @samp{#}. +Currently there are three predicates: @code{#equal}, @code{#match}, +and @code{#pred}. @deffn Predicate equal arg1 arg2 -Matches if @var{arg1} equals to @var{arg2}. Arguments can be either +Matches if @var{arg1} is equal to @var{arg2}. Arguments can be either strings or capture names. Capture names represent the text that the captured node spans in the buffer. @end deffn @@ -1322,7 +1322,7 @@ Pattern Matching @cindex tree-sitter patterns as sexps @cindex patterns, tree-sitter, in sexp form -Besides strings, Emacs provides a s-expression based syntax for +Besides strings, Emacs provides an s-expression based syntax for tree-sitter patterns. It largely resembles the string-based syntax. For example, the following query @@ -1354,7 +1354,7 @@ Pattern Matching @end example Most patterns can be written directly as strange but nevertheless -valid s-expressions. Only a few of them needs modification: +valid s-expressions. Only a few of them need modification: @itemize @item @@ -1382,7 +1382,7 @@ Pattern Matching @end example @noindent -is written in s-expression as +is written in s-expression syntax as @example @group @@ -1440,8 +1440,8 @@ Multiple Languages need to be assigned different parsers. Traditionally, this is achieved by using narrowing. While tree-sitter works with narrowing (@pxref{tree-sitter narrowing, narrowing}), the recommended way is -instead to set regions of buffer text (i.e., ranges) in which a parser -will operate. This section describes functions for setting and +instead to specify regions of buffer text (i.e., ranges) in which a +parser will operate. This section describes functions for setting and getting ranges for a parser. Lisp programs should call @code{treesit-update-ranges} to make sure @@ -1459,7 +1459,7 @@ Multiple Languages @defun treesit-parser-set-included-ranges parser ranges This function sets up @var{parser} to operate on @var{ranges}. The @var{parser} will only read the text of the specified ranges. Each -range in @var{ranges} is a list of the form @w{@code{(@var{beg} +range in @var{ranges} is a pair of the form @w{@code{(@var{beg} . @var{end})}}. The ranges in @var{ranges} must come in order and must not overlap. @@ -1533,7 +1533,7 @@ Multiple Languages @heading Supporting multiple languages in Lisp programs It should suffice for general Lisp programs to call the following two -functions in order to support program sources that mixes multiple +functions in order to support program sources that mix multiple languages. @defun treesit-update-ranges &optional beg end @@ -1569,13 +1569,13 @@ Multiple Languages embedded languages with that information, and then parses the embedded languages. -Take a buffer containing @acronym{HTML}, @acronym{CSS} and JavaScript +Take a buffer containing @acronym{HTML}, @acronym{CSS}, and JavaScript as an example. A Lisp program will first parse the whole buffer with an @acronym{HTML} parser, then query the parser for -@code{style_element} and @code{script_element} nodes, which -correspond to @acronym{CSS} and JavaScript text, respectively. Then -it sets the range of the @acronym{CSS} and JavaScript parser to the -ranges in which their corresponding nodes span. +@code{style_element} and @code{script_element} nodes, which correspond +to @acronym{CSS} and JavaScript text, respectively. Then it sets the +range of the @acronym{CSS} and JavaScript parsers to the range which +their corresponding nodes span. Given a simple @acronym{HTML} document: @@ -1629,17 +1629,17 @@ Multiple Languages @example @group -(setq-local treesit-range-settings - (treesit-range-rules - :embed 'javascript - :host 'html - '((script_element (raw_text) @@capture)) +(setq treesit-range-settings + (treesit-range-rules + :embed 'javascript + :host 'html + '((script_element (raw_text) @@capture)) @end group @group - :embed 'css - :host 'html - '((style_element (raw_text) @@capture)))) + :embed 'css + :host 'html + '((style_element (raw_text) @@capture)))) @end group @end example @@ -1650,21 +1650,21 @@ Multiple Languages It takes a series of @var{query-spec}s, where each @var{query-spec} is a @var{query} preceded by zero or more @var{keyword}/@var{value} -pairs. Each @var{query} is a tree-sitter query in either the -string, s-expression or compiled form, or a function. +pairs. Each @var{query} is a tree-sitter query in either the string, +s-expression, or compiled form, or a function. If @var{query} is a tree-sitter query, it should be preceded by two -@var{:keyword}/@var{value} pairs, where the @code{:embed} keyword +@var{keyword}/@var{value} pairs, where the @code{:embed} keyword specifies the embedded language, and the @code{:host} keyword -specified the host language. +specifies the host language. @code{treesit-update-ranges} uses @var{query} to figure out how to set the ranges for parsers for the embedded language. It queries -@var{query} in a host language parser, computes the ranges in which -the captured nodes span, and applies these ranges to embedded -language parsers. +@var{query} in a host language parser, computes the ranges which the +captured nodes span, and applies these ranges to embedded language +parsers. -If @var{query} is a function, it doesn't need any @var{:keyword} and +If @var{query} is a function, it doesn't need any @var{keyword} and @var{value} pair. It should be a function that takes 2 arguments, @var{start} and @var{end}, and sets the ranges for parsers in the current buffer in the region between @var{start} and @var{end}. It is @@ -1717,8 +1717,8 @@ Tree-sitter Major Modes @code{treesit-ready-p} automatically emits a warning if conditions for enabling tree-sitter aren't met. -If a tree-sitter major mode shares setup with their ``native'' -counterpart, they can create a ``base mode'' that contains the common +If a tree-sitter major mode shares setup with its ``native'' +counterpart, one can create a ``base mode'' that contains the common setup, like this: @example @@ -1749,9 +1749,9 @@ Tree-sitter Major Modes @defun treesit-ready-p language &optional quiet This function checks for conditions for activating tree-sitter. It checks whether Emacs was built with tree-sitter, whether the buffer's -size is not too large for tree-sitter to handle it, and whether the -language grammar for @var{language} is available on the system -(@pxref{Language Grammar}). +size is not too large for tree-sitter to handle, and whether the +grammar for @var{language} is available on the system (@pxref{Language +Grammar}). This function emits a warning if tree-sitter cannot be activated. If @var{quiet} is @code{message}, the warning is turned into a message; @@ -1789,7 +1789,7 @@ Tree-sitter Major Modes @end itemize @end defun -For more information of these built-in tree-sitter features, +For more information on these built-in tree-sitter features, @pxref{Parser-based Font Lock}, @pxref{Parser-based Indentation}, and @pxref{List Motion}. @@ -1828,28 +1828,17 @@ Tree-sitter Major Modes @defvar treesit-defun-name-function If non-@code{nil}, this variable's value should be a function that is called with a node as its argument, and returns the defun name of the -node. The function should have the same semantic as +node. The function should have the same semantics as @code{treesit-defun-name}: if the node is not a defun node, or the node is a defun node but doesn't have a name, or the node is @code{nil}, it should return @code{nil}. @end defvar -@defvar treesit-defun-type-regexp -This variable determines which nodes are considered defuns by Emacs. -It can be a regexp that matches the type of defun nodes. - -Sometimes not all nodes matched by the regexp are valid defuns. -Therefore, this variable can also be a cons cell of the form -@w{(@var{regexp} . @var{pred})}, where @var{pred} should be a function -that takes a node as its argument, and returns @code{t} if the node is -valid defun, or @code{nil} if it is not valid. -@end defvar - @node Tree-sitter C API @section Tree-sitter C API Correspondence Emacs' tree-sitter integration doesn't expose every feature -provided by tree-sitter's C API. Missing features include: +provided by tree-sitter's C API@. Missing features include: @itemize @item diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index e09fd4e7ca5..d8115ac3ad3 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -844,18 +844,25 @@ List Motion @code{treesit-beginning-of-defun} and @code{treesit-end-of-defun}. @defvar treesit-defun-type-regexp -The value of this variable is a regexp matching the node type of defun -nodes. (For ``node'' and ``node type'', @pxref{Parsing Program Source}.) +This variable determines which nodes are considered defuns by Emacs. +It can be a regexp that matches the type of defun nodes. (For +``node'' and ``node type'', @pxref{Parsing Program Source}.) For example, @code{python-mode} sets this variable to a regexp that -matches either @code{"function_definition"} or @code{"class_definition"}. +matches either @samp{function_definition} or @samp{class_definition}. + +Sometimes not all nodes matched by the regexp are valid defuns. +Therefore, this variable can also be a cons cell of the form +@w{(@var{regexp} . @var{pred})}, where @var{pred} should be a function +that takes a node as its argument, and returns non-@code{nil} if the +node is a valid defun, or @code{nil} if it is not valid. @end defvar @defvar treesit-defun-tactic -This variable determines how Emacs treats nested defuns. If the -value is @code{top-level}, navigation functions only move across -top-level defuns, if the value is @code{nested}, navigation functions -recognize nested defuns. +This variable determines how Emacs treats nested defuns. If the value +is @code{top-level}, navigation functions only move across top-level +defuns. If the value is @code{nested}, navigation functions recognize +nested defuns. @end defvar @node Skipping Characters diff --git a/lisp/treesit.el b/lisp/treesit.el index 3ec4fbc5c91..0e1d7931d49 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1168,7 +1168,6 @@ treesit-simple-indent-presets (save-excursion (goto-char bol) (looking-at-p comment-end-skip)))) - ;; TODO: Document. (cons 'catch-all (lambda (&rest _) t)) (cons 'query (lambda (pattern) @@ -1182,7 +1181,6 @@ treesit-simple-indent-presets (cons 'first-sibling (lambda (_n parent &rest _) (treesit-node-start (treesit-node-child parent 0)))) - ;; TODO: Document. (cons 'nth-sibling (lambda (n &optional named) (lambda (_n parent &rest _) (treesit-node-start @@ -1224,7 +1222,6 @@ treesit-simple-indent-presets (or (and this-line-has-prefix (match-beginning 1)) (match-end 0))))))) - ;; TODO: Document. (cons 'grand-parent (lambda (_n parent &rest _) (treesit-node-start (treesit-node-parent parent)))) @@ -1295,10 +1292,10 @@ treesit-simple-indent-presets (mapcar (lambda (fn) (funcall fn node parent bol)) fns))))) - "A list of presets. -These presets that can be used as MATHER and ANCHOR in -`treesit-simple-indent-rules'. MACHTERs and ANCHORs are -functions that take 3 arguments: NODE, PARENT and BOL. + "A list of indent rule presets. +These presets can be used as MATCHER and ANCHOR values in +`treesit-simple-indent-rules'. MATCHERs and ANCHORs are +functions that take 3 arguments: NODE, PARENT, and BOL. MATCHER: @@ -1329,6 +1326,10 @@ treesit-simple-indent-presets Checks that NODE's type matches regexp TYPE. +\(field-is NAME) + + Checks that NODE's field name in PARENT matches regexp NAME. + \(n-p-gp NODE-TYPE PARENT-TYPE GRANDPARENT-TYPE) Checks for NODE's, its parent's, and its grandparent's type. @@ -1342,16 +1343,33 @@ treesit-simple-indent-presets Matches if text after point matches `treesit-comment-end'. +catch-all + + Always matches. + ANCHOR: first-sibling Returns the start of the first child of PARENT. +\(nth-sibling N &optional NAMED) + + Returns the start of the Nth child of PARENT. + NAMED non-nil means count only named nodes. + parent Returns the start of PARENT. +grand-parent + + Returns the start of PARENT's parent. + +great-grand-parent + + Returns the start of PARENT's parent's parent. + parent-bol Returns the beginning of non-space characters on the line where @@ -1359,8 +1377,8 @@ treesit-simple-indent-presets standalone-parent - Finds the first ancestor node (parent, grandparent, etc) that - starts on its own line, and return the start of that node. + Finds the first ancestor node (parent, grandparent, etc.) that + starts on its own line, and returns the start of that node. prev-sibling @@ -1391,7 +1409,7 @@ treesit-simple-indent-presets end of the match, otherwise return nil. However, if the current line begins with a prefix, return the beginning of the prefix of the previous line instead, so that the two - prefixes aligns. This is useful for a `indent-relative'-like + prefixes aligns. This is useful for an `indent-relative'-like indent behavior for block comments.") (defun treesit--simple-indent-eval (exp) @@ -2332,24 +2350,24 @@ treesit-ready-p (defun treesit-major-mode-setup () "Activate tree-sitter to power major-mode features. -If `treesit-font-lock-settings' is non-nil, setup fontification and -enable `font-lock-mode'. +If `treesit-font-lock-settings' is non-nil, set up fontification +and enable `font-lock-mode'. -If `treesit-simple-indent-rules' is non-nil, setup indentation. +If `treesit-simple-indent-rules' is non-nil, set up indentation. -If `treesit-defun-type-regexp' is non-nil, setup -`beginning/end-of-defun' functions. +If `treesit-defun-type-regexp' is non-nil, set up +`beginning-of-defun-function' and `end-of-defun-function'. -If `treesit-defun-name-function' is non-nil, setup +If `treesit-defun-name-function' is non-nil, set up `add-log-current-defun'. -If `treesit-simple-imenu-settings' is non-nil, setup Imenu. +If `treesit-simple-imenu-settings' is non-nil, set up Imenu. Make sure necessary parsers are created for the current buffer before calling this function." ;; Font-lock. (when treesit-font-lock-settings - ;; `font-lock-mode' wouldn't setup properly if + ;; `font-lock-mode' wouldn't set up properly if ;; `font-lock-defaults' is nil, see `font-lock-specified-p'. (setq-local font-lock-defaults '( nil nil nil nil @@ -2803,7 +2821,7 @@ treesit-explore-mode (display-buffer treesit--explorer-buffer (cons nil '((inhibit-same-window . t)))) (treesit--explorer-refresh) - ;; Setup variables and hooks. + ;; Set up variables and hooks. (add-hook 'post-command-hook #'treesit--explorer-post-command 0 t) (add-hook 'kill-buffer-hook commit 0e9307eb2b8a7ee527427164b9d07f8232d5c34f Author: Basil L. Contovounesios Date: Mon Jun 12 14:42:31 2023 +0100 Fix some Texinfo markup in manuals * doc/emacs/macos.texi (Mac / GNUstep Customization): * doc/lispintro/emacs-lisp-intro.texi (condition-case): * doc/lispref/control.texi (pcase Macro): * doc/lispref/debugging.texi (Internals of Debugger): * doc/lispref/internals.texi (Building Emacs): * doc/lispref/modes.texi (Imenu): (Parser-based Font Lock, Parser-based Indentation): * doc/lispref/parsing.texi (Retrieving Nodes, Tree-sitter C API): * doc/lispref/processes.texi (Network, Bindat Types): * doc/lispref/searching.texi (Rx Functions): * doc/lispref/text.texi (Replacing): * doc/lispref/windows.texi (Textual Scrolling): * doc/misc/calc.texi (Killing From Stack, Customizing Calc): * doc/misc/cc-mode.texi (Misc Font Locking, List Line-Up): * doc/misc/ede.texi (ede-cpp-root-project) (ede-proj-target-makefile, ede-sourcecode): * doc/misc/ert.texi (Running Tests in Batch Mode): * doc/misc/eudc.texi (Emacs-only Configuration, The Server Hotlist): * doc/misc/eww.texi (Advanced): * doc/misc/flymake.texi (Starting Flymake) (Proc customization variables): * doc/misc/tramp.texi (File name completion): * doc/misc/gnus.texi (Summary Buffer Lines, Gnus Registry Setup) (Fancy splitting to parent, Customizing the IMAP Connection) (Mail Source Specifiers, Agent as Cache): Consistently mark up nil and t as @code. Also fix the markup and wording of some surrounding text (bug#64016). * doc/lispref/display.texi (SVG Images, Icons): * doc/lispref/modes.texi (Customizing Keywords): Prefer ASCII apostrophe over Unicode right single quotation mark. diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi index 9f2c4721cab..18811291a9e 100644 --- a/doc/emacs/macos.texi +++ b/doc/emacs/macos.texi @@ -177,10 +177,10 @@ Mac / GNUstep Customization @vindex ns-use-mwheel-acceleration @item ns-use-mwheel-acceleration This variable controls whether Emacs ignores the system mousewheel -acceleration. When nil each `click' of the mousewheel will correspond -exactly with one mousewheel event. When non-@code{nil}, the default, each -`click' may correspond with more than one mousewheel event, depending -on the user's input. +acceleration. When @code{nil} each `click' of the mousewheel will +correspond exactly with one mousewheel event. When non-@code{nil}, +the default, each `click' may correspond with more than one mousewheel +event, depending on the user's input. @vindex ns-use-mwheel-momentum @item ns-use-mwheel-momentum @@ -194,8 +194,8 @@ Mac / GNUstep Customization This variable controls the sensitivity of scrolling with the trackpad. Apple trackpads scroll by pixels, not lines, so Emacs converts the system's pixel values into lines. When set to a number, this variable -sets the number of pixels Emacs will consider as one line. When nil -or a non-number the default line height is used. +sets the number of pixels Emacs will consider as one line. When +@code{nil} or a non-number the default line height is used. Setting a lower number makes the trackpad more sensitive, and a higher number makes the trackpad less sensitive. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 6447ff74bc9..37ef6133fb4 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -8115,10 +8115,9 @@ condition-case handler is run. Lastly, the first argument to the @code{condition-case} expression, -the @var{var} argument, is sometimes bound to a variable that -contains information about the error. However, if that argument is -nil, as is the case in @code{kill-region}, that information is -discarded. +the @var{var} argument, is sometimes bound to a variable that contains +information about the error. However, if that argument is @code{nil}, +as is the case in @code{kill-region}, that information is discarded. @need 1200 In brief, in the @code{kill-region} function, the code diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index e621a28acda..3aee9dd80e4 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -694,7 +694,7 @@ pcase Macro @item (let @var{ref} @var{rx-expr}@dots{}) Bind the symbol @var{ref} to a submatch that matches @var{rx-expr}@enddots{}. @var{ref} is bound in @var{body-forms} to -the string of the submatch or nil, but can also be used in +the string of the submatch or @code{nil}, but can also be used in @code{backref}. @item (backref @var{ref}) diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index d2e4f687f64..ea11d2d8d9c 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -740,7 +740,7 @@ Internals of Debugger @cindex call stack This function prints a trace of Lisp function calls currently active. The trace is identical to the one that @code{debug} would show in the -@file{*Backtrace*} buffer. The return value is always nil. +@file{*Backtrace*} buffer. The return value is always @code{nil}. In the following example, a Lisp expression calls @code{backtrace} explicitly. This prints the backtrace to the stream diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index f1b4b001889..7655ca8839d 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -6530,7 +6530,7 @@ SVG Images @deffn Command horizontal-lineto x-coordinates Draw a horizontal line from the current point to the first element in @var{x-coordinates}. Specifying multiple coordinates is possible, -although usually this doesn’t make sense. +although this usually doesn't make sense. @lisp (svg-path svg '((moveto ((100 . 200))) @@ -6554,7 +6554,7 @@ SVG Images curve from the current point. If there are multiple coordinate sets, draw a polybezier. Each coordinate set is a list of the form @code{(@var{x1} @var{y1} @var{x2} @var{y2} @var{x} @var{y})}, where -@w{(@var{x}, @var{y})} is the curve’s end point. @w{(@var{x1}, +@w{(@var{x}, @var{y})} is the curve's end point. @w{(@var{x1}, @var{y1})} and @w{(@var{x2}, @var{y2})} are control points at the beginning and at the end, respectively. @@ -6571,7 +6571,7 @@ SVG Images curve from the current point. If there are multiple coordinate sets, draw a polybezier. Each coordinate set is a list of the form @code{(@var{x2} @var{y2} @var{x} @var{y})}, where @w{(@var{x}, -@var{y})} is the curve’s end point and @w{(@var{x2}, @var{y2})} is the +@var{y})} is the curve's end point and @w{(@var{x2}, @var{y2})} is the corresponding control point. The first control point is the reflection of the second control point of the previous command relative to the current point, if that command was @command{curveto} @@ -6591,7 +6591,7 @@ SVG Images Bézier curve from the current point. If there are multiple coordinate sets, draw a polybezier. Each coordinate set is a list of the form @code{(@var{x1} @var{y1} @var{x} @var{y})}, where @w{(@var{x}, -@var{y})} is the curve’s end point and @w{(@var{x1}, @var{y1})} is the +@var{y})} is the curve's end point and @w{(@var{x1}, @var{y1})} is the control point. @lisp @@ -6608,7 +6608,7 @@ SVG Images Using the first element in @var{coordinate-sets}, draw a quadratic Bézier curve from the current point. If there are multiple coordinate sets, draw a polybezier. Each coordinate set is a list of the form -@code{(@var{x} @var{y})}, where @w{(@var{x}, @var{y})} is the curve’s +@code{(@var{x} @var{y})}, where @w{(@var{x}, @var{y})} is the curve's end point. The control point is the reflection of the control point of the previous command relative to the current point, if that command was @command{quadratic-bezier-curveto} or @@ -7269,7 +7269,7 @@ Icons @item :width This is only valid for @code{image} icons, and can be either a number (which specifies the width in pixels), or the symbol @code{font}, -which will use the width in pixels of the current buffer’s default +which will use the width in pixels of the current buffer's default face font. @end table diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index e896c69bc38..2dc1f1c6116 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -248,7 +248,7 @@ Building Emacs where @var{file} is the name of the dump file, and @var{time} is the time in seconds it took to restore the state from the dump file. If the current session was not restored from a dump file, the -value is nil. +value is @code{nil}. @end defun @node Pure Storage diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index cb491d52c50..bd09386de2b 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -2921,13 +2921,13 @@ Imenu return non-@code{nil} if the node is a valid node for @var{category}, or @code{nil} if not. -@var{category} could also be @code{nil}. In which case the entries +@var{category} could also be @code{nil}, in which case the entries matched by @var{regexp} and @var{pred} are not grouped under @var{category}. -@var{name-fn} should be either @var{nil} or a function that takes a +@var{name-fn} should be either @code{nil} or a function that takes a defun node and returns the name of that defun, e.g., the function name -for a function definition. If @var{name-fn} is @var{nil}, +for a function definition. If @var{name-fn} is @code{nil}, @code{treesit-defun-name} (@pxref{Tree-sitter Major Modes}) is used instead. @@ -3446,7 +3446,7 @@ Customizing Keywords non-@code{nil}. @item @code{(not @var{condition})} -This matches if @var{condition} doesn’t. +This matches if @var{condition} doesn't. @item @code{(and @var{condition} @dots{})} This matches if each of the @var{condition}s matches. @@ -4145,9 +4145,9 @@ Parser-based Font Lock @multitable @columnfractions .15 .15 .6 @headitem Keyword @tab Value @tab Description -@item @code{:override} @tab nil +@item @code{:override} @tab @code{nil} @tab If the region already has a face, discard the new face -@item @tab t @tab Always apply the new face +@item @tab @code{t} @tab Always apply the new face @item @tab @code{append} @tab Append the new face to existing ones @item @tab @code{prepend} @tab Prepend the new face to existing ones @item @tab @code{keep} @tab Fill-in regions without an existing face @@ -5153,10 +5153,10 @@ Parser-based Indentation @var{parent}, and @var{bol}. It tries to go to the beginning of the previous non-empty line, and matches @code{adaptive-fill-regexp}. If there is a match, this function returns the end of the match, -otherwise it returns nil. However, if the current line begins with a -prefix (e.g., ``-''), return the beginning of the prefix of the -previous line instead, so that the two prefixes aligns. This anchor -is useful for a @code{indent-relative}-like indent behavior for block +otherwise it returns @code{nil}. However, if the current line begins +with a prefix (e.g., ``-''), return the beginning of the prefix of the +previous line instead, so that the two prefixes align. This anchor is +useful for an @code{indent-relative}-like indent behavior for block comments. @end ftable diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index b70f953f8ed..7e77af0a5cf 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -656,7 +656,7 @@ Retrieving Nodes This function returns the immediate parent of @var{node}. If @var{node} is more than 1000 levels deep in a parse tree, the -return value is undefined. Currently it returns @var{nil}, but that +return value is undefined. Currently it returns @code{nil}, but that could change in the future. @end defun @@ -842,7 +842,7 @@ Retrieving Nodes Each node in the returned tree looks like @w{@code{(@var{tree-sitter-node} . (@var{child} @dots{}))}}. The -@var{tree-sitter-node} of the root of this tree will be nil if +@var{tree-sitter-node} of the root of this tree will be @code{nil} if @var{root} doesn't match @var{predicate}. If no node matches @var{predicate}, the function returns @code{nil}. @end defun @@ -866,7 +866,7 @@ Retrieving Nodes parent satisfies @var{pred}, this function returns @code{nil}. Normally this function only looks at the parents of @var{node} but not -@var{node} itself. But if @var{include-node} is non-@var{nil}, this +@var{node} itself. But if @var{include-node} is non-@code{nil}, this function returns @var{node} if @var{node} satisfies @var{pred}. @end defun @@ -1880,7 +1880,7 @@ Tree-sitter C API Instead of using byte positions, the Emacs Lisp API uses character positions. @item -Null nodes are converted to nil. +Null nodes are converted to @code{nil}. @end itemize Below is the correspondence between all C API functions and their diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index c901215d35d..43c794104b8 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -2662,7 +2662,7 @@ Network Library}). Only used for @acronym{TLS} or @acronym{STARTTLS}. To enable automatic queries of @code{auth-source} when @code{:client-certificate} is not specified customize -@code{network-stream-use-client-certificates} to t. +@code{network-stream-use-client-certificates} to @code{t}. @item :return-list @var{cons-or-nil} The return value of this function. If omitted or @code{nil}, return a @@ -3575,7 +3575,7 @@ Bindat Types @item fill @var{len} @var{len} bytes used as a mere filler. In packing, these bytes are left unchanged, which normally means they remain zero. -When unpacking, this just returns nil. +When unpacking, this just returns @code{nil}. @item align @var{len} Same as @code{fill} except the number of bytes is that needed to skip diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 06b3556c855..b8d9094b28d 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1568,7 +1568,7 @@ Rx Functions @defun rx-to-string rx-expr &optional no-group Translate @var{rx-expr} to a string regexp which is returned. -If @var{no-group} is absent or nil, bracket the result in a +If @var{no-group} is absent or @code{nil}, bracket the result in a non-capturing group, @samp{\(?:@dots{}\)}, if necessary to ensure that a postfix operator appended to it will apply to the whole expression. Example: diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index f15b3c33e0c..0f43f3d464a 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -4764,9 +4764,9 @@ Replacing the actual costs exceed this limit, heuristics are used to provide a faster but suboptimal solution. The default value is 1000000. -@code{replace-buffer-contents} returns t if a non-destructive +@code{replace-buffer-contents} returns @code{t} if a non-destructive replacement could be performed. Otherwise, i.e., if @var{max-secs} -was exceeded, it returns nil. +was exceeded, it returns @code{nil}. @end deffn @defun replace-region-contents beg end replace-fn &optional max-secs max-costs diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 0196ed0e813..a49e63e49de 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -5569,7 +5569,7 @@ Textual Scrolling value of @code{recenter-redisplay}. Thus, omitting the second argument can be used to countermand the effect of @code{recenter-redisplay} being non-@code{nil}. Interactive calls -pass non-‘nil’ for @var{redisplay}. +pass non-@code{nil} for @var{redisplay}. When @code{recenter} is called interactively, @var{count} is the raw prefix argument. Thus, typing @kbd{C-u} as the prefix sets the diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 3b525996d6f..3ba1a9d4d15 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -29875,10 +29875,10 @@ Killing From Stack @kbd{C-k} with a prefix argument of 1 copies the number with its trailing newline. -You can customize @code{calc-kill-line-numbering} to nil to exclude -line numbering from kills and copies made by @code{calc-kill} and -@code{calc-copy-as-kill}. This option does not affect calc kill and -copy commands which operate on the region, as that would not make +You can customize @code{calc-kill-line-numbering} to @code{nil} to +exclude line numbering from kills and copies made by @code{calc-kill} +and @code{calc-copy-as-kill}. This option does not affect calc kill +and copy commands which operate on the region, as that would not make sense. @node Yanking Into Stack @@ -35590,11 +35590,11 @@ Customizing Calc See @ref{Displaying Selections}.@* The variable @code{calc-highlight-selections-with-faces} determines how selected sub-formulas are distinguished. -If @code{calc-highlight-selections-with-faces} is nil, then +If @code{calc-highlight-selections-with-faces} is @code{nil}, then a selected sub-formula is distinguished either by changing every character not part of the sub-formula with a dot or by changing every character in the sub-formula with a @samp{#} sign. -If @code{calc-highlight-selections-with-faces} is t, +If @code{calc-highlight-selections-with-faces} is @code{t}, then a selected sub-formula is distinguished either by displaying the non-selected portion of the formula with @code{calc-nonselected-face} or by displaying the selected sub-formula with diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 3a808619868..888a51e0e15 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -2191,10 +2191,10 @@ Misc Font Locking @defvar c-asymmetry-fontification-flag @vindex asymmetry-fontification-flag @r{(c-)} -When @code{c-asymmetry-fontification-flag} is non-@code{nil} (which it is by -default), code like the above, with white space either before or after -the operator, but not both, is fontified as a declaration. When the -variable is nil, such a construct gets the default face. +When @code{c-asymmetry-fontification-flag} is non-@code{nil} (which it +is by default), code like the above, with white space either before or +after the operator, but not both, is fontified as a declaration. When +the variable is @code{nil}, such a construct gets the default face. @end defvar When the construct is an expression there will often be white space @@ -5998,7 +5998,7 @@ List Line-Up List Symbols}). This function is intended for use in a list. If the construct being -analyzed isn't like the preceding, the function returns nil. +analyzed isn't like the preceding, the function returns @code{nil}. Otherwise it returns the function @code{c-lineup-arglist-intro-after-paren}, which the caller then uses to perform indentation. @@ -6042,8 +6042,8 @@ List Line-Up (@pxref{Brace List Symbols}). This function is intended for use in a list. If the above structure -isn't present, the function returns nil, allowing a different offset -specification to indent the line. +isn't present, the function returns @code{nil}, allowing a different +offset specification to indent the line. @workswith{} @code{brace-list-intro}. @end defun @@ -6085,8 +6085,8 @@ List Line-Up the caller then uses to perform the indentation. This function is intended for use in a list. If the above structure -isn't present, the function returns nil, allowing a different offset -specification to indent the line. +isn't present, the function returns @code{nil}, allowing a different +offset specification to indent the line. @workswith{} @code{brace-list-intro}. @end defun diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi index e4ec72af5cd..d49d2296aa7 100644 --- a/doc/misc/ede.texi +++ b/doc/misc/ede.texi @@ -1896,19 +1896,19 @@ ede-cpp-root-project @end deffn @deffn Method ede-preprocessor-map :AFTER this -Get the pre-processor map for project @var{THIS}. +Get the pre-processor map for project @var{this}. @end deffn @deffn Method ede-cpp-root-header-file-p :AFTER proj name -Non @code{nil} if in @var{PROJ} the filename @var{NAME} is a header. +Non-@code{nil} if in @var{proj} the filename @var{name} is a header. @end deffn @deffn Method ede-system-include-path :AFTER this -Get the system include path used by project @var{THIS}. +Get the system include path used by project @var{this}. @end deffn @deffn Method ede-expand-filename-impl :AFTER proj name -Within this project @var{PROJ}, find the file @var{NAME}. +Within this project @var{proj}, find the file @var{name}. This knows details about or source tree. @end deffn @@ -2796,7 +2796,7 @@ ede-proj-target-makefile Type: @code{boolean} @* Default Value: @code{t} -Non @code{nil} means the rule created is part of the all target. +Non-@code{nil} means the rule created is part of the all target. Setting this to @code{nil} creates the rule to build this item, but does not include it in the @code{all:} rule. @@ -3888,10 +3888,10 @@ ede-sourcecode Type: @code{boolean} @* Default Value: @code{nil} -Non @code{nil} if this sourcecode type uses subdirectores. -If sourcecode always lives near the target creating it, this should be nil. -If sourcecode can, or typically lives in a subdirectory of the owning -target, set this to t. +Non-@code{nil} if this sourcecode type uses subdirectores. If +sourcecode always lives near the target creating it, this should be +@code{nil}. If sourcecode can, or typically lives in a subdirectory +of the owning target, set this to @code{t}. @item :garbagepattern Type: @code{list} @* diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index fd96fcf8b8c..a6b62a058f2 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -409,13 +409,13 @@ Running Tests in Batch Mode @end example @vindex ert-batch-backtrace-line-length -Even modest settings for @code{print-level} and @code{print-length} can -produce extremely long lines in backtraces, however, with attendant -pauses in execution progress. Set -@code{ert-batch-backtrace-line-length} to t to use the value of -@code{backtrace-line-length}, @code{nil} to stop any limitations on backtrace -line lengths (that is, to get full backtraces), or a positive integer to -limit backtrace line length to that number. +Even modest settings for @code{print-level} and @code{print-length} +can produce extremely long lines in backtraces, however, with +attendant pauses in execution progress. Set +@code{ert-batch-backtrace-line-length} to @code{t} to use the value of +@code{backtrace-line-length}, @code{nil} to stop any limitations on +backtrace line lengths (that is, to get full backtraces), or a +positive integer to limit backtrace line length to that number. @vindex ert-quiet By default, ERT in batch mode is quite verbose, printing a line with diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 743d7da946b..d82dec971cd 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -374,7 +374,7 @@ Emacs-only Configuration Specifying the function @code{ldap-password-read} for @code{passwd} will cause Emacs to prompt interactively for the password. The password will then be validated and cached, unless -@code{password-cache} is nil. You can customize +@code{password-cache} is @code{nil}. You can customize @code{password-cache-expiry} to control the duration for which the password is cached. If you want to clear the cache, call @code{password-reset}. @@ -1023,9 +1023,9 @@ The Server Hotlist eudc-bookmark-current-server}. The list is contained in the variable @code{eudc-server-hotlist} which is stored in and retrieved from the file designated by @code{eudc-options-file}, or normal Emacs -initialization if @code{eudc-ignore-options-file} is non-nil. EUDC -also provides a facility to edit the hotlist interactively (@pxref{The -Hotlist Edit Buffer}). +initialization if @code{eudc-ignore-options-file} is non-@code{nil}. +EUDC also provides a facility to edit the hotlist interactively +(@pxref{The Hotlist Edit Buffer}). The hotlist is also used to make queries on multiple servers successively (@pxref{Multi-server Queries}). The order in which the @@ -1041,18 +1041,18 @@ The Server Hotlist @end deffn @defvar eudc-ignore-options-file -If non-nil, then EUDC ignores @code{eudc-options-file} and warns or +If non-@code{nil}, EUDC ignores @code{eudc-options-file} and warns or issues an error when an attempt is made to use it. Most users should set this, and keep their EUDC configuration in the main Emacs -initialization file instead. The separate eudc-options file has -created confusion for users in the past. +initialization file instead. The separate @file{eudc-options} file +has created confusion for users in the past. @end defvar @defvar eudc-options-file The name of a file where EUDC stores its internal variables (the hotlist and the current server). EUDC will try to load that file upon initialization so, if you choose a file name different from the -defaults @file{~/.emacs.d/eudc-options}, be sure to set this variable +default @file{~/.emacs.d/eudc-options}, be sure to set this variable to the appropriate value @emph{before} EUDC is itself loaded. @end defvar diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index bc556ed88e2..1a5688b0358 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -367,8 +367,8 @@ Advanced The latter, however, tend to be overly large to preserve in the desktop file, so they get omitted, thus rendering the respective entries entirely equivalent. By default, such duplicate entries are -not saved. Setting @code{eww-desktop-remove-duplicates} to nil will -force EWW to save them anyway. +not saved. Setting @code{eww-desktop-remove-duplicates} to @code{nil} +will force EWW to save them anyway. @vindex eww-restore-desktop Restoring EWW buffers' contents may prove to take too long to diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 03d296a1d42..c7c46896709 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -115,11 +115,11 @@ Starting Flymake @itemize @bullet @item @code{flymake-mode} is started, unless -@code{flymake-start-on-flymake-mode} is nil; +@code{flymake-start-on-flymake-mode} is @code{nil}; @item the buffer is saved, unless @code{flymake-start-on-save-buffer} is -nil; +@code{nil}; @item some changes were made to the buffer more than @code{0.5} seconds ago @@ -876,13 +876,18 @@ Proc customization variables line-idx col-idx err-text-idx)}. @xref{Parsing the output}. @item flymake-proc-diagnostic-type-pred -A function to classify a diagnostic text as particular type of error. -Should be a function taking an error text and returning a diagnostic -symbol (@pxref{Flymake error types}). If non-@code{nil} is returned but -there is no such symbol in that table, a warning is assumed. If nil -is returned, an error is assumed. Can also be a regular expression -that should match only warnings. This variable replaces the old -@code{flymake-warning-re} and @code{flymake-warning-predicate}. +A function to classify a diagnostic text as a particular type of +error. The value of this variable should be a function taking an +error text and returning a diagnostic symbol (@pxref{Flymake error +types}). If it returns a non-@code{nil} value but there is no such +symbol in that table, the text is interpreted as a warning. If the +function returns @code{nil}, the text is assumed to be an error. + +The value of this variable can alternatively be a regular expression +that should match only warnings. + +This variable replaces the old @code{flymake-warning-re} and +@code{flymake-warning-predicate}. @item flymake-proc-compilation-prevents-syntax-check A flag indicating whether compilation and syntax check of the same diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index d77d4be1bee..e995469ee3d 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -5014,14 +5014,14 @@ Summary Buffer Lines @item L Number of lines in the article. @item Z -Retrieval Score Value (RSV) of the article; nil if not in an nnselect -group. +Retrieval Score Value (RSV) of the article; @code{nil} if not in an +nnselect group. @item G -Originating group name of the article; nil if not in an nnselect -group. +Originating group name of the article; @code{nil} if not in an +nnselect group. @item g -Short form of the originating group name of the article; nil if not in -an nnselect group. +Short form of the originating group name of the article; @code{nil} if +not in an nnselect group. @item c Number of characters in the article. This specifier is not supported in some methods (like nnfolder). @@ -14568,18 +14568,20 @@ Customizing the IMAP Connection @vindex nnimap-expunge @item nnimap-expunge When to expunge deleted messages. If @code{never}, deleted articles -are marked with the IMAP @code{\\Delete} flag but not automatically -expunged. If @code{immediately}, deleted articles are immediately expunged -(this requires the server to support the UID EXPUNGE command). If -@code{on-exit}, deleted articles are flagged, and all flagged articles are -expunged when the group is closed. - -For backwards compatibility, this variable may also be set to t -or nil. If the server supports UID EXPUNGE, both t and nil are -equivalent to @code{immediately}. If the server does not support UID -EXPUNGE nil is equivalent to @code{never}, while t will immediately -expunge ALL articles that are currently flagged as deleted -(i.e., potentially not only the article that was just deleted). +are marked with the @acronym{IMAP} @code{\\Delete} flag but not +automatically expunged. If @code{immediately}, deleted articles are +immediately expunged (this requires the server to support the +@code{UID EXPUNGE} command). If @code{on-exit}, deleted articles are +flagged, and all flagged articles are expunged when the group is +closed. + +For backwards compatibility, this variable may also be set to @code{t} +or @code{nil}. If the server supports @code{UID EXPUNGE}, both +@code{t} and @code{nil} are equivalent to @code{immediately}. If the +server does not support @code{UID EXPUNGE}, @code{nil} is equivalent +to @code{never}, while @code{t} will immediately expunge @emph{all} +articles that are currently flagged as deleted (i.e., potentially not +only the article that was just deleted). @vindex nnimap-streaming @item nnimap-streaming @@ -15296,9 +15298,9 @@ Mail Source Specifiers @end lisp @item imap -Get mail from a @acronym{IMAP} server. If you don't want to use +Get mail from an @acronym{IMAP} server. If you don't want to use @acronym{IMAP} as intended, as a network mail reading protocol (i.e., -with nnimap), for some reason or other, Gnus let you treat it similar +with nnimap), for some reason or other, Gnus lets you treat it similar to a @acronym{POP} server and fetches articles from a given @acronym{IMAP} mailbox. @xref{Using IMAP}, for more information. @@ -19404,7 +19406,7 @@ Agent as Cache @pxref{Agent Variables}) to always download headers and articles while plugged. Gnus will almost certainly be slower, but it will be kept synchronized with the server. That last point probably won't make any -sense if you are using a nntp or nnimap back end. +sense if you are using an nntp or nnimap back end. @node Agent Expiry @subsection Agent Expiry @@ -26369,7 +26371,7 @@ Gnus Registry Setup you see them. This is important to making split-to-parent and Message-ID references work correctly, as the registry needs to know where all messages are, but it can slow down group opening and the -saving of Gnus. If this option is nil, entries must be created +saving of Gnus. If this option is @code{nil}, entries must be created manually, for instance by storing a custom flag or keyword for the message. @end defvar @@ -26391,8 +26393,8 @@ Gnus Registry Setup If a function is given, it should sort least valuable entries first, as pruning starts from the beginning of the list. The default value is @code{gnus-registry-sort-by-creation-time}, which proposes the -oldest entries for pruning. Set to nil to perform no sorting, which -will speed up the pruning process. +oldest entries for pruning. Set to @code{nil} to perform no sorting, +which will speed up the pruning process. @end defvar @defvar gnus-registry-cache-file @@ -26465,10 +26467,10 @@ Fancy splitting to parent in your fancy split setup. -If @code{gnus-registry-register-all} is non-@code{nil} (the default), the -registry will perform splitting for all messages. If it is nil, -splitting will only happen for children of messages you've explicitly -registered. +If @code{gnus-registry-register-all} is non-@code{nil} (the default), +the registry will perform splitting for all messages. If it is +@code{nil}, splitting will only happen for children of messages you've +explicitly registered. In addition, you may want to customize the following variables. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index f9617f7a5cd..6ed7e0ac032 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3553,7 +3553,7 @@ File name completion there are invalid entries in the persistency file, for example if the host configuration changes often, or if you plug your laptop to different networks frequently, you can set the user option -@code{tramp-completion-use-cache} to nil. +@code{tramp-completion-use-cache} to @code{nil}. After remote host name completion comes completion of file names on the remote host. It works the same as with local host file completion commit 4c975111af2163aca8be716ba578d29747c73469 Author: Eli Zaretskii Date: Tue Jun 13 16:42:38 2023 +0300 ; * etc/NEWS: Backward compatibility with 'doc-view-svg-face'. diff --git a/etc/NEWS b/etc/NEWS index ec1b40aa0a7..61e6e161665 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -273,6 +273,10 @@ asynchronously (which is the default behavior). --- *** New face 'doc-view-svg-face'. This replaces 'doc-view-svg-foreground' and 'doc-view-svg-background'. +If you don't like the colors produced by the default definition of +this new face when DocView displays documents, customize this face to +restore the colors you were used to, or to get colors more to your +liking. ** Shortdoc commit 8dc08333eeaa5938227512cb14fa288f4d6823b6 Author: Basil L. Contovounesios Date: Tue Jun 13 13:45:08 2023 +0100 Fix bol/bos anchors in tree-sitter :match regexps Further regexp fixes to follow separately (bug#64019#29). * lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): * lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--font-lock-settings): * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): * lisp/progmodes/js.el (js--treesit-font-lock-settings): * lisp/progmodes/python.el (python--treesit-settings): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): * lisp/progmodes/sh-script.el (sh-mode--treesit-settings): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): * test/src/treesit-tests.el (treesit-query-api): Anchor :match regexps at beginning/end of string, not line. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index c6cb9520e58..7f4f6f11387 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -701,7 +701,7 @@ c-ts-mode--font-lock-settings `(((call_expression (call_expression function: (identifier) @fn) @c-ts-mode--fontify-DEFUN) - (:match "^DEFUN$" @fn)) + (:match "\\`DEFUN\\'" @fn)) ((function_definition type: (_) @for-each-tail) @c-ts-mode--fontify-for-each-tail diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el index d83a956af21..9d35d8077bd 100644 --- a/lisp/progmodes/cmake-ts-mode.el +++ b/lisp/progmodes/cmake-ts-mode.el @@ -134,7 +134,8 @@ cmake-ts-mode--font-lock-settings :language 'cmake :feature 'number '(((unquoted_argument) @font-lock-number-face - (:match "^[[:digit:]]*\\.?[[:digit:]]*\\.?[[:digit:]]+$" @font-lock-number-face))) + (:match "\\`[[:digit:]]*\\.?[[:digit:]]*\\.?[[:digit:]]+\\'" + @font-lock-number-face))) :language 'cmake :feature 'string diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 44dfd74cafd..463872dcbc8 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -168,7 +168,7 @@ java-ts-mode--font-lock-settings :override t :feature 'constant `(((identifier) @font-lock-constant-face - (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face)) + (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face)) [(true) (false)] @font-lock-constant-face) :language 'java :override t @@ -237,7 +237,7 @@ java-ts-mode--font-lock-settings (scoped_identifier (identifier) @font-lock-constant-face) ((scoped_identifier name: (identifier) @font-lock-type-face) - (:match "^[A-Z]" @font-lock-type-face)) + (:match "\\`[A-Z]" @font-lock-type-face)) (type_identifier) @font-lock-type-face diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 52ed19cc682..414b6eb2baf 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3493,7 +3493,7 @@ js--treesit-font-lock-settings :language 'javascript :feature 'constant '(((identifier) @font-lock-constant-face - (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face)) + (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face)) [(true) (false) (null)] @font-lock-constant-face) @@ -3612,7 +3612,7 @@ js--treesit-font-lock-settings :feature 'number '((number) @font-lock-number-face ((identifier) @font-lock-number-face - (:match "^\\(:?NaN\\|Infinity\\)$" @font-lock-number-face))) + (:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face))) :language 'javascript :feature 'operator diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index fd196df7550..d9ca37145e1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1106,7 +1106,7 @@ python--treesit-settings :language 'python `([,@python--treesit-keywords] @font-lock-keyword-face ((identifier) @font-lock-keyword-face - (:match "^self$" @font-lock-keyword-face))) + (:match "\\`self\\'" @font-lock-keyword-face))) :feature 'definition :language 'python diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index c3cf8d0cf44..b55af0b49e3 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -143,7 +143,7 @@ rust-ts-mode--font-lock-settings eol)) @font-lock-builtin-face))) ((identifier) @font-lock-type-face - (:match "^\\(:?Err\\|Ok\\|None\\|Some\\)$" @font-lock-type-face))) + (:match "\\`\\(:?Err\\|Ok\\|None\\|Some\\)\\'" @font-lock-type-face))) :language 'rust :feature 'comment @@ -212,11 +212,11 @@ rust-ts-mode--font-lock-settings (scoped_use_list path: (scoped_identifier name: (identifier) @font-lock-constant-face)) ((use_as_clause alias: (identifier) @font-lock-type-face) - (:match "^[A-Z]" @font-lock-type-face)) + (:match "\\`[A-Z]" @font-lock-type-face)) ((use_as_clause path: (identifier) @font-lock-type-face) - (:match "^[A-Z]" @font-lock-type-face)) + (:match "\\`[A-Z]" @font-lock-type-face)) ((use_list (identifier) @font-lock-type-face) - (:match "^[A-Z]" @font-lock-type-face)) + (:match "\\`[A-Z]" @font-lock-type-face)) (use_wildcard [(identifier) @rust-ts-mode--fontify-scope (scoped_identifier name: (identifier) @rust-ts-mode--fontify-scope)]) @@ -233,7 +233,7 @@ rust-ts-mode--font-lock-settings ((scoped_identifier name: (identifier) @rust-ts-mode--fontify-tail)) ((scoped_identifier path: (identifier) @font-lock-type-face) (:match - "^\\(u8\\|u16\\|u32\\|u64\\|u128\\|usize\\|i8\\|i16\\|i32\\|i64\\|i128\\|isize\\|char\\|str\\)$" + "\\`\\(u8\\|u16\\|u32\\|u64\\|u128\\|usize\\|i8\\|i16\\|i32\\|i64\\|i128\\|isize\\|char\\|str\\)\\'" @font-lock-type-face)) ((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope)) ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope)) @@ -249,7 +249,7 @@ rust-ts-mode--font-lock-settings :feature 'constant `((boolean_literal) @font-lock-constant-face ((identifier) @font-lock-constant-face - (:match "^[A-Z][A-Z\\d_]*$" @font-lock-constant-face))) + (:match "\\`[A-Z][A-Z\\d_]*\\'" @font-lock-constant-face))) :language 'rust :feature 'variable diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 54da1e0468e..9bc1f4dcfdc 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -3363,7 +3363,7 @@ sh-mode--treesit-settings :feature 'number :language 'bash `(((word) @font-lock-number-face - (:match "^[0-9]+$" @font-lock-number-face))) + (:match "\\`[0-9]+\\'" @font-lock-number-face))) :feature 'bracket :language 'bash diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 1c19a031878..5df34de0472 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -153,7 +153,7 @@ typescript-ts-mode--font-lock-settings :language language :feature 'constant `(((identifier) @font-lock-constant-face - (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face)) + (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face)) [(true) (false) (null)] @font-lock-constant-face) :language language @@ -311,7 +311,7 @@ typescript-ts-mode--font-lock-settings :feature 'number `((number) @font-lock-number-face ((identifier) @font-lock-number-face - (:match "^\\(:?NaN\\|Infinity\\)$" @font-lock-number-face))) + (:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face))) :language language :feature 'operator diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index fef603840f9..69db37fc0b4 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -368,14 +368,14 @@ treesit-query-api ;; String query. '("(string) @string (pair key: (_) @keyword) -((_) @bob (#match \"^B.b$\" @bob)) +((_) @bob (#match \"\\\\`B.b\\\\'\" @bob)) (number) @number ((number) @n3 (#equal \"3\" @n3)) ((number) @n3p (#pred treesit--ert-pred-last-sibling @n3p))" ;; Sexp query. ((string) @string (pair key: (_) @keyword) - ((_) @bob (:match "^B.b$" @bob)) + ((_) @bob (:match "\\`B.b\\'" @bob)) (number) @number ((number) @n3 (:equal "3" @n3)) ((number) @n3p (:pred treesit--ert-pred-last-sibling commit 8225ade6151a2d3564b8f68fc8157731c3a1b60f Author: Gregory Heytings Date: Tue Jun 13 13:12:55 2023 +0000 ; * src/xdisp.c (syms_of_xdisp) : Fix typo diff --git a/src/xdisp.c b/src/xdisp.c index c9b488b7fb2..763af7d3bc8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -37072,7 +37072,7 @@ syms_of_xdisp (void) the current narrowing, or from buffer beginning. The variable `display-line-numbers-offset', if non-zero, is a signed offset added to each absolute line number; it also forces line numbers to be counted -from the beginning of the buffer, as if `display-line-numbers-wide' +from the beginning of the buffer, as if `display-line-numbers-widen' were non-nil. It has no effect when line numbers are not absolute. If the value is `relative', display for each line not containing the commit 0485955f5aa98d1864ae9441c7133351e265ab2a Author: Robert Pluim Date: Mon Jun 5 13:12:08 2023 +0200 Replace unneeded sprintfs with print * admin/unidata/emoji-zwj.awk: Printing strings doesn't need sprintf, so just use print and string concatenation. diff --git a/admin/unidata/emoji-zwj.awk b/admin/unidata/emoji-zwj.awk index 4b648aa675e..53170214d8a 100644 --- a/admin/unidata/emoji-zwj.awk +++ b/admin/unidata/emoji-zwj.awk @@ -83,31 +83,29 @@ END { trigger_codepoints[12] = "1F575" trigger_codepoints[13] = "1F590" - printf "(setq auto-composition-emoji-eligible-codepoints\n" - printf "'(" + print "(setq auto-composition-emoji-eligible-codepoints" + print "'(" for (trig in trigger_codepoints) { - printf("\n?\\N{U+%s}", trigger_codepoints[trig]) + print "?\\N{U+" trigger_codepoints[trig] "}" } - printf "\n))\n\n" + print "))" # We add entries for 'codepoint U+FE0F' here to ensure that the # code in font_range is triggered. for (trig in trigger_codepoints) { - codepoint = trigger_codepoints[trig] - c = sprintf("\\N{U+%s}", codepoint) - vec[codepoint] = vec[codepoint] "\n\"" c "\\N{U+FE0F}\"" + vec[codepoint] = vec[codepoint] "\n\"\\N{U+" trigger_codepoints[trig] "}\\N{U+FE0F}\"" } print "(dolist (elt `(" for (elt in ch) { - entries = vec[elt] sprintf("\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", elt, elt) - printf("(#x%s .\n,(eval-when-compile (regexp-opt\n'(\n%s\n))))\n", elt, entries) + print "(#x" elt " .\n,(eval-when-compile (regexp-opt\n'(\n" vec[elt] + print "\"\\N{U+" elt "}\\N{U+FE0E}\"\n\"\\N{U+" elt "}\\N{U+FE0F}\"\n))))" } print "))" print " (set-char-table-range composition-function-table" commit daf7902ed9dd1df186425149c8c5fa782a820afc Author: Robert Pluim Date: Tue Jun 13 14:37:53 2023 +0200 Insert timestamp when converting icalendar to org event * lisp/gnus/gnus-icalendar.el (gnus-icalendar--update-org-event): Insert the timestamp even if the description is empty. (Bug#64023) diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index adbc39547ff..b0efe689636 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -642,16 +642,16 @@ gnus-icalendar--update-org-event (delete-region (point) entry-end)) ;; put new event description in the entry body - (when description - (save-restriction - (narrow-to-region (point) (point)) - (insert "\n" - (gnus-icalendar-event:org-timestamp event) - "\n\n" - (replace-regexp-in-string "[\n]+$" "\n" description) - "\n") - (indent-region (point-min) (point-max) (1+ entry-outline-level)) - (fill-region (point-min) (point-max)))) + (save-restriction + (narrow-to-region (point) (point)) + (insert "\n" + (gnus-icalendar-event:org-timestamp event) + "\n\n" + (replace-regexp-in-string "[\n]+$" "\n" + (or description "No description")) + "\n") + (indent-region (point-min) (point-max) (1+ entry-outline-level)) + (fill-region (point-min) (point-max))) ;; update entry properties (cl-labels commit ef1394fca0405bb3738f4f08c21c2d0ca8602d52 Author: Mattias Engdegård Date: Tue Jun 13 14:08:11 2023 +0200 Move quoted lambda funarg check and expand coverage * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Move check for incorrectly quoted lambda arguments from here... * lisp/emacs-lisp/bytecomp.el (byte-compile-form): ... to here, which should provide more detection opportunities. Expand the set of functions for which this check is performed, now also for some keyword arguments. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 4cf244aedbf..0d878846304 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3505,6 +3505,18 @@ byte-compile-form (if (consp arg) "list" (type-of arg)) idx)))))) + (let ((funargs (function-get (car form) 'funarg-positions))) + (dolist (funarg funargs) + (let ((arg (if (numberp funarg) + (nth funarg form) + (cadr (memq funarg form))))) + (when (and (eq 'quote (car-safe arg)) + (eq 'lambda (car-safe (cadr arg)))) + (byte-compile-warn-x + arg "(lambda %s ...) quoted with %s rather than with #%s" + (or (nth 1 (cadr arg)) "()") + "'" "'"))))) ; avoid styled quotes + (if (eq (car-safe (symbol-function (car form))) 'macro) (byte-compile-report-error (format-message "`%s' defined after use in %S (missing `require' of a library file?)" @@ -3614,6 +3626,74 @@ byte-compile-form (dolist (entry mutating-fns) (put (car entry) 'mutates-arguments (cdr entry)))) +;; Record which arguments expect functions, so we can warn when those +;; are accidentally quoted with ' rather than with #' +;; The value of the `funarg-positions' property is a list of function +;; argument positions, starting with 1, and keywords. +(dolist (f '( funcall apply mapcar mapatoms mapconcat mapc maphash + mapcan map-char-table map-keymap map-keymap-internal + functionp + seq-do seq-do-indexed seq-sort seq-sort-by seq-group-by + seq-find seq-count + seq-filter seq-reduce seq-remove seq-keep + seq-map seq-map-indexed seq-mapn seq-mapcat + seq-drop-while seq-take-while + seq-some seq-every-p + cl-every cl-some + cl-mapcar cl-mapcan cl-mapcon cl-mapc cl-mapl cl-maplist + )) + (put f 'funarg-positions '(1))) +(dolist (f '( defalias fset sort + replace-regexp-in-string + add-hook remove-hook advice-remove advice--remove-function + global-set-key local-set-key keymap-global-set keymap-local-set + set-process-filter set-process-sentinel + )) + (put f 'funarg-positions '(2))) +(dolist (f '( assoc assoc-default assoc-delete-all + plist-get plist-member + advice-add define-key keymap-set + run-at-time run-with-idle-timer run-with-timer + seq-contains seq-contains-p seq-set-equal-p + seq-position seq-positions seq-uniq + seq-union seq-intersection seq-difference)) + (put f 'funarg-positions '(3))) +(dolist (f '( cl-find cl-member cl-assoc cl-rassoc cl-position cl-count + cl-remove cl-delete + cl-subst cl-nsubst + cl-substitute cl-nsubstitute + cl-remove-duplicates cl-delete-duplicates + cl-union cl-nunion cl-intersection cl-nintersection + cl-set-difference cl-nset-difference + cl-set-exclusive-or cl-nset-exclusive-or + cl-nsublis + cl-search + )) + (put f 'funarg-positions '(:test :test-not :key))) +(dolist (f '( cl-find-if cl-find-if-not cl-member-if cl-member-if-not + cl-assoc-if cl-assoc-if-not cl-rassoc-if cl-rassoc-if-not + cl-position-if cl-position-if-not cl-count-if cl-count-if-not + cl-remove-if cl-remove-if-not cl-delete-if cl-delete-if-not + cl-reduce cl-adjoin + cl-subsetp + )) + (put f 'funarg-positions '(1 :key))) +(dolist (f '( cl-subst-if cl-subst-if-not cl-nsubst-if cl-nsubst-if-not + cl-substitute-if cl-substitute-if-not + cl-nsubstitute-if cl-nsubstitute-if-not + cl-sort cl-stable-sort + )) + (put f 'funarg-positions '(2 :key))) +(dolist (fa '((plist-put 4) (alist-get 5) (add-to-list 5) + (cl-merge 4 :key) + (custom-declare-variable :set :get :initialize :safe) + (make-process :filter :sentinel) + (make-network-process :filter :sentinel) + (all-completions 2 3) (try-completion 2 3) (test-completion 2 3) + (completing-read 2 3) + )) + (put (car fa) 'funarg-positions (cdr fa))) + (defun byte-compile-normal-call (form) (when (and (symbolp (car form)) diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 8a0185d597b..f3d0804323e 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -461,20 +461,7 @@ macroexp--expand-all (_ `(,fn ,eexp . ,eargs))))) (`(funcall . ,_) form) ;bug#53227 (`(,func . ,_) - (let ((handler (function-get func 'compiler-macro)) - (funargs (function-get func 'funarg-positions))) - ;; Check functions quoted with ' rather than with #' - (dolist (funarg funargs) - (let ((arg (nth funarg form))) - (when (and (eq 'quote (car-safe arg)) - (eq 'lambda (car-safe (cadr arg)))) - (setcar - (nthcdr funarg form) - (macroexp-warn-and-return - (format - "(lambda %s ...) quoted with ' rather than with #'" - (or (nth 1 (cadr arg)) "()")) - arg nil nil (cadr arg)))))) + (let ((handler (function-get func 'compiler-macro))) ;; Macro expand compiler macros. This cannot be delayed to ;; byte-optimize-form because the output of the compiler-macro can ;; use macros. @@ -501,19 +488,6 @@ macroexp--expand-all (_ form)))) (pop byte-compile-form-stack))) -;; Record which arguments expect functions, so we can warn when those -;; are accidentally quoted with ' rather than with #' -(dolist (f '( funcall apply mapcar mapatoms mapconcat mapc cl-mapcar maphash - mapcan map-char-table map-keymap map-keymap-internal)) - (put f 'funarg-positions '(1))) -(dolist (f '( add-hook remove-hook advice-remove advice--remove-function - defalias fset global-set-key run-after-idle-timeout - set-process-filter set-process-sentinel sort)) - (put f 'funarg-positions '(2))) -(dolist (f '( advice-add define-key - run-at-time run-with-idle-timer run-with-timer )) - (put f 'funarg-positions '(3))) - ;;;###autoload (defun macroexpand-all (form &optional environment) "Return result of expanding macros at all levels in FORM. commit 1f0527a312ac67cea28d8d3868c3d3e25751110a Author: Eli Zaretskii Date: Tue Jun 13 14:11:41 2023 +0300 ; Fix last change in tex-mode.el * lisp/textmodes/tex-mode.el (tex-cmd-doc-view): Remove the second argument. (Bug#63956) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 44984697e70..294c9792f39 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2426,7 +2426,7 @@ tex-compile-default (if cmds (tex-format-cmd (caar cmds) fspec)))))) (defun tex-cmd-doc-view (file) - (pop-to-buffer (find-file-noselect file) display-tex-shell-buffer-action)) + (pop-to-buffer (find-file-noselect file))) (defun tex-compile (dir cmd) "Run a command CMD on current TeX buffer's file in DIR." commit ba349aa32e98a53146794197c316f4765598ddbd Author: Robert Pluim Date: Mon Jun 5 11:57:03 2023 +0200 Don't feed the awk scripts into themselves * admin/unidata/Makefile.in (${unidir}/charscript.el, ${unidir}/emoji-zwj.el): Define variables for the required sources and pass those to awk instead of $^, since the latter includes the awk script itself. diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in index cccd85213f1..c7737583700 100644 --- a/admin/unidata/Makefile.in +++ b/admin/unidata/Makefile.in @@ -105,19 +105,23 @@ .PHONY: charscript.el: ${unidir}/charscript.el blocks = ${srcdir}/blocks.awk - +blocks_sources = ${srcdir}/Blocks.txt ${srcdir}/emoji-data.txt ${unidir}/charscript.el: ${blocks} -${unidir}/charscript.el: ${srcdir}/Blocks.txt ${srcdir}/emoji-data.txt - $(AM_V_GEN)$(AWK) -f ${blocks} $^ > $@ +# Don't use $^, since that includes the awk script. +${unidir}/charscript.el: ${blocks_sources} + $(AM_V_GEN)$(AWK) -f ${blocks} ${blocks_sources} > $@ .PHONY: emoji-zwj.el emoji-zwj.el: ${unidir}/emoji-zwj.el zwj = ${srcdir}/emoji-zwj.awk +zwj_sources = ${srcdir}/emoji-zwj-sequences.txt $(srcdir)/emoji-sequences.txt +${unidir}/emoji-zwj.el: ${zwj} -${unidir}/emoji-zwj.el: ${srcdir}/emoji-zwj-sequences.txt $(srcdir)/emoji-sequences.txt ${zwj} - $(AM_V_GEN)$(AWK) -f ${zwj} $^ > $@ +# Don't use $^, since that includes the awk script. +${unidir}/emoji-zwj.el: ${zwj_sources} + $(AM_V_GEN)$(AWK) -f ${zwj} ${zwj_sources} > $@ .PHONY: clean bootstrap-clean distclean maintainer-clean gen-clean commit 4da479920e66ba245fd374da661bf7a27af718b9 Author: Stefan Monnier Date: Mon Jun 12 22:43:44 2023 -0400 * lisp/subr.el (with-restriction): Tweak indent rule diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el index 6f9df554da0..78fa91b5cdc 100644 --- a/lisp/nxml/xmltok.el +++ b/lisp/nxml/xmltok.el @@ -738,7 +738,7 @@ xmltok-scan-attributes ;; avoid slowdowns due to the quadratic ;; complexity of the regexp. See bug#61514. (when (with-restriction - (point) (min (+ (point) 10000) (point-max)) + (point) (min (+ (point) 10000) (point-max)) (looking-at (concat "[^<>\n]+?" (xmltok-attribute regexp)))) (unless recovering diff --git a/lisp/subr.el b/lisp/subr.el index 950902039b1..85adef5b689 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3971,7 +3971,7 @@ with-restriction same LABEL argument. \(fn START END [:label LABEL] BODY)" - (declare (indent 0) (debug t)) + (declare (indent 2) (debug t)) (if (eq (car rest) :label) `(internal--with-restriction ,start ,end (lambda () ,@(cddr rest)) ,(cadr rest)) commit 410aac81832daf028f162aa00d42ffd2f15beb99 Author: Stefan Monnier Date: Mon Jun 12 13:25:08 2023 -0400 * lisp/transient.el (transient--wrap-command): Use `letrec` and a closure diff --git a/lisp/transient.el b/lisp/transient.el index 048554eee13..78496843284 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -2190,39 +2190,35 @@ transient--with-suspended-override (defun transient--wrap-command () (let* ((prefix transient--prefix) - (suffix this-command) - (advice nil) - (advice-interactive - (lambda (spec) - (let ((abort t)) - (unwind-protect - (prog1 (advice-eval-interactive-spec spec) - (setq abort nil)) - (when abort + (suffix this-command)) + (letrec ((advice + (lambda (fn &rest args) + (interactive + (lambda (spec) + (let ((abort t)) + (unwind-protect + (prog1 (advice-eval-interactive-spec spec) + (setq abort nil)) + (when abort + (when-let ((unwind (oref prefix unwind-suffix))) + (transient--debug 'unwind-interactive) + (funcall unwind suffix)) + (if (symbolp suffix) + (advice-remove suffix advice) + (remove-function suffix advice)) + (oset prefix unwind-suffix nil)))))) + (unwind-protect + (apply fn args) (when-let ((unwind (oref prefix unwind-suffix))) - (transient--debug 'unwind-interactive) + (transient--debug 'unwind-command) (funcall unwind suffix)) (if (symbolp suffix) (advice-remove suffix advice) (remove-function suffix advice)) - (oset prefix unwind-suffix nil)))))) - (advice-body - (lambda (fn &rest args) - (unwind-protect - (apply fn args) - (when-let ((unwind (oref prefix unwind-suffix))) - (transient--debug 'unwind-command) - (funcall unwind suffix)) - (if (symbolp suffix) - (advice-remove suffix advice) - (remove-function suffix advice)) - (oset prefix unwind-suffix nil))))) - (setq advice `(lambda (fn &rest args) - (interactive ,advice-interactive) - (apply ',advice-body fn args))) - (if (symbolp suffix) - (advice-add suffix :around advice '((depth . -99))) - (add-function :around (var suffix) advice '((depth . -99)))))) + (oset prefix unwind-suffix nil))))) + (if (symbolp suffix) + (advice-add suffix :around advice '((depth . -99))) + (add-function :around (var suffix) advice '((depth . -99))))))) (defun transient--premature-post-command () (and (equal (this-command-keys-vector) []) commit 36aa9bd818334bba56b0fdd6e10d7dc05ba4bbd4 Author: Robert Pluim Date: Mon Jun 12 19:02:29 2023 +0200 ; Fix previous change * lisp/window.el (display-tex-shell-buffer-action): Fix default value's type. (Bug#63956) diff --git a/lisp/window.el b/lisp/window.el index 78b0787abdb..16f16a75418 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8776,7 +8776,7 @@ display-comint-buffer-action :group 'windows :group 'comint) -(defcustom display-tex-shell-buffer-action 'display-buffer-in-previous-window +(defcustom display-tex-shell-buffer-action '(display-buffer-in-previous-window) "`display-buffer' action for displaying TeX shell buffers." :type display-buffer--action-custom-type :risky t commit aaeaf608d89b866eb13551aa31ad44e2df93b0fd Author: Eli Zaretskii Date: Mon Jun 12 18:47:04 2023 +0300 Fix setting region in the minibuffer * lisp/minibuffer.el (minibuffer-beginning-of-buffer): Fix setting region. (Bug#64022) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 44226449af2..41eb95fd20f 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4399,9 +4399,9 @@ minibuffer-beginning-of-buffer Otherwise move to the start of the buffer." (declare (interactive-only "use `(goto-char (point-min))' instead.")) (interactive "^P") - (when (or (consp arg) - (region-active-p)) - (push-mark)) + (or (consp arg) + (region-active-p) + (push-mark)) (goto-char (cond ;; We want to go N/10th of the way from the beginning. ((and arg (not (consp arg))) commit 1383efe01d0ee8ba3ea8da5ab41b07f5672191bf Author: Michael Albinus Date: Mon Jun 12 12:45:38 2023 +0200 Fix setting $DBUS_SESSION_BUS_ADDRESS after Emacs has started * doc/misc/dbus.texi (Alternative Buses): Explain using $DBUS_SESSION_BUS_ADDRESS after Emacs has started. * src/dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Use egetenv. diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index 97a0f39ea13..2bd6b9556c8 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi @@ -1847,8 +1847,24 @@ Alternative Buses corresponding bus. For the system and session buses, this function is called when loading @file{dbus.el}, there is no need to call it again. -The function returns the number of connections this Emacs session has -established to the @var{bus} under the same unique name +If Emacs was invoked when there was no D-Bus session bus available +yet, you can set the environment variable +@env{DBUS_SESSION_BUS_ADDRESS} once the session bus daemon is running +and offering the address. Calling @code{dbus-init-bus} initializes +the connection to the session bus. + +@lisp +(setenv "DBUS_SESSION_BUS_ADDRESS" "unix:path=/run/user/1000/bus") + +@result{} "unix:path=/run/user/1000/bus" + +(dbus-init-bus :session) + +@result{} 2 +@end lisp + +@code{dbus-init-bus} returns the number of connections this Emacs +session has established to the @var{bus} under the same unique name (@pxref{dbus-get-unique-name}). It depends on the libraries Emacs is linked with, and on the environment Emacs is running. For example, if Emacs is linked with the GTK+ toolkit, and it runs in a GTK+-aware diff --git a/src/dbusbind.c b/src/dbusbind.c index d96b735c79a..97094e407d7 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -276,7 +276,7 @@ XD_OBJECT_TO_STRING (Lisp_Object object) #define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \ do { \ - char const *session_bus_address = getenv ("DBUS_SESSION_BUS_ADDRESS"); \ + char const *session_bus_address = egetenv ("DBUS_SESSION_BUS_ADDRESS"); \ if (STRINGP (bus)) \ { \ DBusAddressEntry **entries; \ commit 560c15a04f9578d607c68e63a04901dce924b227 Author: Mattias Engdegård Date: Fri Jun 9 10:10:49 2023 +0200 ; * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): minor tweaks Don't lose `funcall` symbol position. Remove outdated comment. diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index b05aba3e1a7..8a0185d597b 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -458,7 +458,7 @@ macroexp--expand-all ((and `#',f (guard (not (or (special-form-p f) (macrop f))))) ;; bug#46636 (macroexp--expand-all `(,f . ,eargs))) - (_ `(funcall ,eexp . ,eargs))))) + (_ `(,fn ,eexp . ,eargs))))) (`(funcall . ,_) form) ;bug#53227 (`(,func . ,_) (let ((handler (function-get func 'compiler-macro)) @@ -479,9 +479,7 @@ macroexp--expand-all ;; byte-optimize-form because the output of the compiler-macro can ;; use macros. (if (null handler) - ;; No compiler macro. We just expand each argument (for - ;; setq/setq-default this works alright because the variable names - ;; are symbols). + ;; No compiler macro. We just expand each argument. (macroexp--all-forms form 1) ;; If the handler is not loaded yet, try (auto)loading the ;; function itself, which may in turn load the handler. commit edfbdb3f1655b1a61fa7a060041e5e58f32bb4a5 Author: F. Jason Park Date: Fri Jun 9 23:34:58 2023 -0700 Define missing groups for ERC modules * lisp/erc/erc-imenu.el (erc-imenu): Define group even though there aren't any associated faces or user options because `imenu' is a global module, and `define-erc-module' calls `define-minor-mode', which needs a group for its mode variable. This should have been handled by bug#60954 but wasn't. * lisp/erc/erc-sound.el (erc-sound): Move group definition above module definition. * lisp/erc/erc-spelling.el (erc-spelling): Define group. diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index 60df4e9ac8e..f053c6279b8 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -41,6 +41,10 @@ (require 'erc) (require 'imenu) +(defgroup erc-imenu nil + "Imenu integration for ERC." + :group 'erc) + (defun erc-unfill-notice () "Return text from point to a computed end as a string unfilled. Don't rely on this function, read it first!" diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index 9da9202f0cf..083d72805df 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el @@ -47,6 +47,10 @@ (require 'erc) +(defgroup erc-sound nil + "Make ERC play bells and whistles while chatting with people." + :group 'erc) + ;;;###autoload(put 'ctcp-sound 'erc--module 'sound) ;;;###autoload(autoload 'erc-sound-mode "erc-sound") (define-erc-module sound ctcp-sound @@ -61,10 +65,6 @@ sound (erc-define-catalog-entry 'english 'CTCP-SOUND "%n (%u@%h) plays %s:%m") -(defgroup erc-sound nil - "Make ERC play bells and whistles while chatting with people." - :group 'erc) - (defcustom erc-play-sound t "Play sounds when you receive CTCP SOUND requests." :type 'boolean) diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el index 8e5424f4162..83eb849f1b4 100644 --- a/lisp/erc/erc-spelling.el +++ b/lisp/erc/erc-spelling.el @@ -33,6 +33,10 @@ (require 'erc) (require 'flyspell) +(defgroup erc-spelling nil + "Flyspell integration for ERC." + :group 'erc) + ;;;###autoload(autoload 'erc-spelling-mode "erc-spelling" nil t) (define-erc-module spelling nil "Enable flyspell mode in ERC buffers." commit 56e1922281d53ab0c28002a99b27c9a79807d430 Author: F. Jason Park Date: Thu Jun 8 23:38:05 2023 -0700 Revert "Add hook to regain nickname in ERC" This reverts commit 8c0c98268440b27a77faf30738dfd72c909bb33f. The functionality it introduced is likely being migrated to a "regain"-specific local module to live in the library erc-services.el alongside the existing `services' module. Its scope will be expanded to address common "regain" cases requiring NickServ. This commit is being reverted to prevent any confusion that might arise from users encountering the old interface while the new one is being hashed out on the tracker. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 2de24e7cb25..b5bd96c189d 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -427,9 +427,7 @@ erc-server-reconnect-timeout If this value is too low, servers may reject your initial nick request upon reconnecting because they haven't yet noticed that your previous connection is dead. If this happens, try setting -this value to 120 or greater and/or exploring the option -`erc-nickname-in-use-functions', which may provide a more -proactive means of handling this situation on some servers." +this value to 120 or greater." :type 'number) (defcustom erc-server-reconnect-function 'erc-server-delayed-reconnect diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index c1c5b7b5e9a..a1538962602 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -403,24 +403,6 @@ erc-nick-changed-functions :group 'erc-hooks :type 'hook) -(defcustom erc-nickname-in-use-functions nil - "Function to run before trying for a different nickname. -Called with two arguments: the desired but just rejected nickname -and the alternate nickname about to be requested. Use cases -include special handling during connection registration and -wrestling with nickname services. For example, value -`erc-regain-nick-on-connect' is aimed at dealing with reaping -lingering connections that may prevent you from being issued a -requested nick immediately when reconnecting. It's meant to be -used with an `erc-server-reconnect-function' value of -`erc-server-delayed-check-reconnect' alongside SASL -authentication." - :package-version '(ERC . "5.6") - :group 'erc-hooks - :type '(choice (function-item erc-regain-nick-on-connect) - function - (const nil))) - (defcustom erc-connect-pre-hook '(erc-initialize-log-marker) "Hook called just before `erc' calls `erc-connect'. Functions are passed a buffer as the first argument." @@ -4992,34 +4974,6 @@ erc-wash-quit-reason (match-string 1 reason)) reason)) -(defun erc-regain-nick-on-connect (want temp) - "Try at most once to grab nickname WANT after settling for TEMP. -Only do so during connection registration, likely prior to -authenticating with SASL. Assume the prior connection was lost -due to connectivity failure and that the server hasn't yet -noticed. Also assume that the server won't process any -authentication-related messages until it has accepted a mulligan -nick or at least sent a 433 and thus triggered -`erc-nickname-in-use-functions'. Expect authentication to have -succeeded by the time a logical IRC connection has been -established and that the contending connection may otherwise -still be alive and require manual intervention involving -NickServ." - (unless erc-server-connected - (letrec ((after-connect - (lambda (_ nick) - (remove-hook 'erc-after-connect after-connect t) - (when (equal temp nick) - (erc-cmd-NICK want)))) - (on-900 - (lambda (_ parsed) - (remove-hook 'erc-server-900-functions on-900 t) - (unless erc-server-connected - (when (equal (car (erc-response.command-args parsed)) temp) - (add-hook 'erc-after-connect after-connect nil t))) - nil))) - (add-hook 'erc-server-900-functions on-900 nil t)))) - (defun erc-nickname-in-use (nick reason) "If NICK is unavailable, tell the user the REASON. @@ -5053,7 +5007,6 @@ erc-nickname-in-use ;; established a connection yet (- 9 (length erc-nick-uniquifier)))) erc-nick-uniquifier))) - (run-hook-with-args 'erc-nickname-in-use-functions nick newnick) (erc-cmd-NICK newnick) (erc-display-error-notice nil diff --git a/test/lisp/erc/erc-scenarios-base-renick.el b/test/lisp/erc/erc-scenarios-base-renick.el index f8350676fb7..f1723200533 100644 --- a/test/lisp/erc/erc-scenarios-base-renick.el +++ b/test/lisp/erc/erc-scenarios-base-renick.el @@ -303,47 +303,4 @@ erc-scenarios-base-renick-queries-bouncer (should-not (search-forward "now known as frenemy" nil t)) (erc-d-t-search-for 25 "I have lost")))) -;; The server rejects your nick during registration, so ERC acquires a -;; placeholder and successfully renicks once the connection is up. -;; See also `erc-scenarios-base-renick-self-auto'. - -(ert-deftest erc-scenarios-base-renick-auto-regain () - :tags '(:expensive-test) - (erc-scenarios-common-with-cleanup - ((erc-server-flood-penalty 0.1) - (erc-scenarios-common-dialog "base/renick/regain") - (dumb-server (erc-d-run "localhost" t 'normal 'normal-again)) - (port (process-contact dumb-server :service)) - (erc-server-auto-reconnect t) - (erc-modules (cons 'sasl erc-modules)) - (erc-nickname-in-use-functions '(erc-regain-nick-on-connect)) - (expect (erc-d-t-make-expecter))) - - (ert-info ("Session succeeds but cut short") - (with-current-buffer (erc :server "127.0.0.1" - :port port - :nick "tester" - :user "tester" - :password "changeme" - :full-name "tester") - (funcall expect 10 "Last login from") - (erc-cmd-JOIN "#test"))) - - (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#test")) - (funcall expect 10 "was created on")) - - (ert-info ("Service restored") - (with-current-buffer "Libera.Chat" - (erc-d-t-wait-for 10 erc--server-reconnect-timer) - (funcall expect 10 "Connection failed!") - (funcall expect 10 "already in use") - (funcall expect 10 "changed mode for tester`") - (funcall expect 10 "Last login from") - (funcall expect 10 "Your new nickname is tester"))) - - (with-current-buffer (get-buffer "#test") - (funcall expect 10 "tester ") - (funcall expect 10 "was created on")))) - - ;;; erc-scenarios-base-renick.el ends here diff --git a/test/lisp/erc/resources/base/renick/regain/normal-again.eld b/test/lisp/erc/resources/base/renick/regain/normal-again.eld deleted file mode 100644 index c0529052c70..00000000000 --- a/test/lisp/erc/resources/base/renick/regain/normal-again.eld +++ /dev/null @@ -1,56 +0,0 @@ -;; -*- mode: lisp-data; -*- -((cap 10 "CAP REQ :sasl")) -((nick 10 "NICK tester")) -((user 10 "USER tester 0 * :tester")) - -((authenticate 10 "AUTHENTICATE PLAIN") - (0.04 ":tantalum.libera.chat NOTICE * :*** Checking Ident") - (0.01 ":tantalum.libera.chat NOTICE * :*** Looking up your hostname...") - (0.01 ":tantalum.libera.chat NOTICE * :*** Couldn't look up your hostname") - (0.06 ":tantalum.libera.chat NOTICE * :*** No Ident response") - (0.02 ":tantalum.libera.chat CAP * ACK :sasl") - (0.03 ":tantalum.libera.chat 433 * tester :Nickname is already in use.")) - -((nick 10 "NICK tester`") - (0.03 "AUTHENTICATE +")) - -((authenticate 10 "AUTHENTICATE AHRlc3RlcgBjaGFuZ2VtZQ==") - (0.06 ":tantalum.libera.chat 900 tester` tester`!tester@127.0.0.1 tester :You are now logged in as tester") - (0.02 ":tantalum.libera.chat 903 tester` :SASL authentication successful")) - -((cap 10 "CAP END") - (0.02 ":tantalum.libera.chat 001 tester` :Welcome to the Libera.Chat Internet Relay Chat Network tester`") - (0.02 ":tantalum.libera.chat 002 tester` :Your host is tantalum.libera.chat[93.158.237.2/6697], running version solanum-1.0-dev") - (0.02 ":tantalum.libera.chat 003 tester` :This server was created Mon Feb 13 2023 at 12:05:04 UTC") - (0.01 ":tantalum.libera.chat 004 tester` tantalum.libera.chat solanum-1.0-dev DGMQRSZaghilopsuwz CFILMPQRSTbcefgijklmnopqrstuvz bkloveqjfI") - (0.01 ":tantalum.libera.chat 005 tester` WHOX MONITOR=100 SAFELIST ELIST=CMNTU ETRACE FNC CALLERID=g KNOCK CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQRSTcgimnprstuz :are supported by this server") - (0.01 ":tantalum.libera.chat 005 tester` CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server") - (0.03 ":tantalum.libera.chat 005 tester` TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz :are supported by this server") - (0.01 ":tantalum.libera.chat 251 tester` :There are 70 users and 42977 invisible on 28 servers") - (0.00 ":tantalum.libera.chat 252 tester` 38 :IRC Operators online") - (0.00 ":tantalum.libera.chat 253 tester` 87 :unknown connection(s)") - (0.00 ":tantalum.libera.chat 254 tester` 22908 :channels formed") - (0.00 ":tantalum.libera.chat 255 tester` :I have 2507 clients and 1 servers") - (0.00 ":tantalum.libera.chat 265 tester` 2507 3232 :Current local users 2507, max 3232") - (0.00 ":tantalum.libera.chat 266 tester` 43047 51777 :Current global users 43047, max 51777") - (0.00 ":tantalum.libera.chat 250 tester` :Highest connection count: 3233 (3232 clients) (284887 connections received)") - (0.03 ":tantalum.libera.chat 375 tester` :- tantalum.libera.chat Message of the Day - ") - (0.00 ":tantalum.libera.chat 372 tester` :- This server provided by Hyperfilter (https://hyperfilter.com)") - (0.00 ":tantalum.libera.chat 372 tester` :- Email: support@libera.chat") - (0.02 ":tantalum.libera.chat 376 tester` :End of /MOTD command.")) - -((mode 10 "MODE tester` +i") - (0.01 ":tester` MODE tester` :+Ziw") - (0.02 ":SaslServ!SaslServ@services.libera.chat NOTICE tester` :Last login from: \2~tester@127.0.0.1\2 on Apr 07 01:36:25 2023 +0000.")) - -((nick 10 "NICK tester") - (0.02 ":tester`!~tester@127.0.0.1 NICK :tester")) - -((join 10 "JOIN #test") - (0.02 ":tester!~tester@127.0.0.1 JOIN #test") - (0.02 ":tantalum.libera.chat 353 tester = #test :tester zbyqbepbqre7 pusevgfpu Thrfg2187 zngbeb qnexNssvavgl wrebzr- rqpentt Ilehf grfg2 AvtugZbaxrl pevfgvvbna xrivap_ fnvybePng shohxv gxan arrqyr avpx16 NeanhqW_kzcc jvyyr wrnaogeq Wnarg cnefavc0 Xbentt RcvpArb flfqrs wfgbxre hafcrag__ Lbevpx_") - (0.02 ":tantalum.libera.chat 366 tester #test :End of /NAMES list.")) - -((mode 10 "MODE #test") - (0.02 ":tantalum.libera.chat 324 tester #test +nt") - (0.02 ":tantalum.libera.chat 329 tester #test 1621432263")) diff --git a/test/lisp/erc/resources/base/renick/regain/normal.eld b/test/lisp/erc/resources/base/renick/regain/normal.eld deleted file mode 100644 index 9f4df70e580..00000000000 --- a/test/lisp/erc/resources/base/renick/regain/normal.eld +++ /dev/null @@ -1,53 +0,0 @@ -;; -*- mode: lisp-data; -*- -((cap 10 "CAP REQ :sasl")) -((nick 10 "NICK tester")) -((user 10 "USER tester 0 * :tester")) - -((authenticate 10 "AUTHENTICATE PLAIN") - (0.02 ":cadmium.libera.chat NOTICE * :*** Checking Ident") - (0.01 ":cadmium.libera.chat NOTICE * :*** Looking up your hostname...") - (0.01 ":cadmium.libera.chat NOTICE * :*** Couldn't look up your hostname") - (0.06 ":cadmium.libera.chat NOTICE * :*** No Ident response") - (0.09 ":cadmium.libera.chat CAP * ACK :sasl") - (0.01 "AUTHENTICATE +")) - -((authenticate 10 "AUTHENTICATE AHRlc3RlcgBjaGFuZ2VtZQ==") - (0.03 ":cadmium.libera.chat 900 tester tester!tester@127.0.0.1 tester :You are now logged in as tester") - (0.01 ":cadmium.libera.chat 903 tester :SASL authentication successful")) - -((cap 10 "CAP END") - (0.03 ":cadmium.libera.chat 001 tester :Welcome to the Libera.Chat Internet Relay Chat Network tester") - (0.02 ":cadmium.libera.chat 002 tester :Your host is cadmium.libera.chat[103.196.37.95/6697], running version solanum-1.0-dev") - (0.01 ":cadmium.libera.chat 003 tester :This server was created Wed Jan 25 2023 at 10:22:45 UTC") - (0.01 ":cadmium.libera.chat 004 tester cadmium.libera.chat solanum-1.0-dev DGMQRSZaghilopsuwz CFILMPQRSTbcefgijklmnopqrstuvz bkloveqjfI") - (0.00 ":cadmium.libera.chat 005 tester CALLERID=g WHOX ETRACE FNC SAFELIST ELIST=CMNTU KNOCK MONITOR=100 CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQRSTcgimnprstuz :are supported by this server") - (0.01 ":cadmium.libera.chat 005 tester CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server") - (0.01 ":cadmium.libera.chat 005 tester TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz :are supported by this server") - (0.01 ":cadmium.libera.chat 251 tester :There are 70 users and 42996 invisible on 28 servers") - (0.02 ":cadmium.libera.chat 252 tester 38 :IRC Operators online") - (0.01 ":cadmium.libera.chat 253 tester 57 :unknown connection(s)") - (0.01 ":cadmium.libera.chat 254 tester 22912 :channels formed") - (0.01 ":cadmium.libera.chat 255 tester :I have 2499 clients and 1 servers") - (0.01 ":cadmium.libera.chat 265 tester 2499 4187 :Current local users 2499, max 4187") - (0.01 ":cadmium.libera.chat 266 tester 43066 51827 :Current global users 43066, max 51827") - (0.01 ":cadmium.libera.chat 250 tester :Highest connection count: 4188 (4187 clients) (319420 connections received)") - (0.01 ":cadmium.libera.chat 375 tester :- cadmium.libera.chat Message of the Day - ") - (0.01 ":cadmium.libera.chat 372 tester :- This server kindly provided by Mach Dilemma (www.m-d.net)") - (0.01 ":cadmium.libera.chat 372 tester :- Welcome to Libera Chat, the IRC network for") - (0.00 ":cadmium.libera.chat 372 tester :- Email: support@libera.chat") - (0.00 ":cadmium.libera.chat 376 tester :End of /MOTD command.") - (0.00 ":tester MODE tester :+Ziw") - (0.02 ":SaslServ!SaslServ@services.libera.chat NOTICE tester :Last login from: \2~tester@127.0.0.1\2 on Apr 07 01:02:11 2023 +0000.")) - -((mode 10 "MODE tester +i")) - -((join 10 "JOIN #test") - (0.09 ":tester!~tester@127.0.0.1 JOIN #test")) - -((mode 10 "MODE #test") - (0.03 ":cadmium.libera.chat 353 tester = #test :tester zbyqbepbqre7 pusevgfpu Thrfg2187 zngbeb qnexNssvavgl wrebzr- rqpentt Ilehf grfg2 AvtugZbaxrl pevfgvvbna xrivap_ fnvybePng shohxv gxan arrqyr avpx16 NeanhqW_kzcc Lbevpx_ hafcrag__ wfgbxre flfqrs RcvpArb Xbentt jvyyr cnefavc0 Wnarg wrnaogeq") - (0.02 ":cadmium.libera.chat 366 tester #test :End of /NAMES list.") - (0.00 ":cadmium.libera.chat 324 tester #test +nt") - (0.01 ":cadmium.libera.chat 329 tester #test 1621432263")) - -((drop 0 DROP)) commit 2daa71f93294240f899fa94e3f7a87900bd64e3f Author: F. Jason Park Date: Sat Jun 10 00:17:44 2023 -0700 Don't insert prompt input before markers in ERC * etc/ERC-NEWS: Update entry in 5.6 section announcing a persistent prompt. * lisp/erc/erc-dcc.el (erc-dcc-chat-setup): Use helper `erc--initialize-markers' to set up prompt. * lisp/erc/erc.el (erc--initialize-markers): Change `erc-insert-marker' type to t. Do this to spare modules that want to remember the current message location from resorting to workarounds, like leaving a marker one char before the end of a message, which is not foolproof. (erc--refresh-prompt): Temporarily change type of `erc-insert-marker' when inserting prompt. (erc-display-line-1): Insert incoming message normally instead of forcing before markers, thus respecting markers left by third parties. Strictly speaking, this is a breaking change. (erc-display-msg): Insert normally instead of calling `insert-before-markers', which was a regression introduced by 05f6fdb9 "Preserve ERC prompt and its bounding markers". * test/lisp/erc/erc-dcc-tests.el (erc-dcc-tests--dcc-handle-ctcp-send, erc-dcc-tests--erc-dcc-do-GET-command): Use helper to initialize prompt and markers. * test/lisp/erc/erc-networks-tests.el (erc-networks--ensure-announced, erc-networks--rename-server-buffer--existing--reuse, erc-networks--rename-server-buffer--existing--noreuse, erc-networks--rename-server-buffer--reconnecting, erc-networks--rename-server-buffer--id, erc-networks--rename-server-buffer--existing--live, erc-networks--rename-server-buffer--local-match, erc-networks--rename-server-buffer--local-nomatch): Use helper to initialize prompt and bounding markers. * test/lisp/erc/erc-stamp-tests.el (erc-stamp-tests--insert-right): Use `erc--initialize-markers' for setting up prompt. * test/lisp/erc/erc-tests.el (erc--refresh-prompt): Adjust assertions for expected prompt content. (Bug#60936) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index e4947d0c64d..68f1083621c 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -244,7 +244,14 @@ running hooks during message insertion, and the position of its "insert marker" (ERC's per-buffer process mark) was inconsistent during these spells. To make insertion handling more predictable in preparation for incorporating various protocol extensions, the prompt -and its bounding markers have become perennial fixtures. In rare +and its bounding markers have become perennial fixtures. To effect +this change, small behavioral differences in message insertion have +been adopted. Crucially, 'erc-insert-marker' now has an "insertion +type" of t, and 'erc-display-line-1' now calls 'insert' instead of +'insert-before-prompt'. This allows user code to leave its own +markers via 'erc-insert-modify-hook' and 'erc-insert-post-hook' +instead of having to resort to workarounds. Message insertion for +outgoing messages, in 'erc-display-msg', remains as before. In rare cases, these changes may mean third-party code needs tweaking, for example, requiring the use of 'insert-before-markers' instead of 'insert'. As always, users feeling unduly inconvenienced by these diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 2012bcadae1..cc2dcc9a788 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -1213,9 +1213,8 @@ erc-dcc-chat-setup erc-dcc-from nick erc-dcc-entry-data entry erc-dcc-unprocessed-output "" - erc-insert-marker (point-max-marker) erc-input-marker (make-marker)) - (erc-display-prompt buffer (point-max)) + (erc--initialize-markers (point) nil) (set-process-buffer proc buffer) (add-hook 'kill-buffer-hook #'erc-dcc-chat-buffer-killed nil t) (run-hook-with-args 'erc-dcc-chat-connect-hook proc)) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index c0fa48bd9bd..c1c5b7b5e9a 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2214,8 +2214,8 @@ erc--initialize-markers (alist-get 'erc-insert-marker continued-session)) (set-marker erc-input-marker (alist-get 'erc-input-marker continued-session)) - (goto-char erc-insert-marker) - (cl-assert (= (field-end) erc-input-marker)) + (set-marker-insertion-type erc-insert-marker t) + (cl-assert (= (field-end erc-insert-marker) erc-input-marker)) (goto-char old-point) (erc--unhide-prompt)) (cl-assert (not (get-text-property (point) 'erc-prompt))) @@ -2226,6 +2226,7 @@ erc--initialize-markers (insert "\n\n") (set-marker erc-insert-marker (point)) (erc-display-prompt) + (set-marker-insertion-type erc-insert-marker t) (cl-assert (= (point) (point-max))))) (defun erc-open (&optional server port nick full-name @@ -2821,10 +2822,12 @@ erc--refresh-prompt (when (functionp erc-prompt) (save-excursion (goto-char erc-insert-marker) + (set-marker-insertion-type erc-insert-marker nil) ;; Avoid `erc-prompt' (the named function), which appends a ;; space, and `erc-display-prompt', which propertizes all but ;; that space. (insert-and-inherit (funcall erc-prompt)) + (set-marker-insertion-type erc-insert-marker t) (delete-region (point) (1- erc-input-marker))))) (defun erc-display-line-1 (string buffer) @@ -2860,7 +2863,7 @@ erc-display-line-1 (save-restriction (widen) (goto-char insert-position) - (insert-before-markers string) + (insert string) (erc--assert-input-bounds) ;; run insertion hook, with point at restored location (save-restriction @@ -6490,15 +6493,14 @@ erc-display-msg (when erc-insert-this (save-excursion (erc--assert-input-bounds) - (let ((insert-position (marker-position erc-insert-marker)) + (let ((insert-position (marker-position (goto-char erc-insert-marker))) beg) - (goto-char insert-position) - (insert-before-markers (erc-format-my-nick)) + (insert (erc-format-my-nick)) (setq beg (point)) - (insert-before-markers line) + (insert line) (erc-put-text-property beg (point) 'font-lock-face 'erc-input-face) (erc-put-text-property insert-position (point) 'erc-command 'PRIVMSG) - (insert-before-markers "\n") + (insert "\n") (save-restriction (narrow-to-region insert-position (point)) (run-hooks 'erc-send-modify-hook) diff --git a/test/lisp/erc/erc-dcc-tests.el b/test/lisp/erc/erc-dcc-tests.el index 7fb5f82e784..f02ddf228a2 100644 --- a/test/lisp/erc/erc-dcc-tests.el +++ b/test/lisp/erc/erc-dcc-tests.el @@ -57,11 +57,8 @@ erc-dcc-tests--dcc-handle-ctcp-send (erc-mode) (setq erc-server-process (start-process "fake" (current-buffer) "sleep" "10") - erc-input-marker (make-marker) - erc-insert-marker (make-marker) erc-server-current-nick "dummy") - (erc-display-prompt) - (set-marker erc-insert-marker (pos-bol)) + (erc--initialize-markers (point) nil) (set-process-query-on-exit-flag erc-server-process nil) (should-not erc-dcc-list) (erc-ctcp-query-DCC erc-server-process @@ -121,17 +118,14 @@ erc-dcc-tests--erc-dcc-do-GET-command calls) (erc-mode) (setq erc-server-process proc - erc-input-marker (make-marker) - erc-insert-marker (make-marker) erc-server-current-nick "dummy") + (erc--initialize-markers (point) nil) (set-process-query-on-exit-flag proc nil) (cl-letf (((symbol-function 'read-file-name) (lambda (&rest _) file)) ((symbol-function 'erc-dcc-get-file) (lambda (&rest r) (push r calls)))) (goto-char (point-max)) - (set-marker erc-insert-marker (point-max)) - (erc-display-prompt) (ert-info ("No turbo") (should-not (plist-member elt :turbo)) diff --git a/test/lisp/erc/erc-networks-tests.el b/test/lisp/erc/erc-networks-tests.el index b9d216f217b..f0fcbbc81c6 100644 --- a/test/lisp/erc/erc-networks-tests.el +++ b/test/lisp/erc/erc-networks-tests.el @@ -1233,10 +1233,7 @@ erc-networks--ensure-announced :contents "MOTD File is missing"))) (erc-mode) ; boilerplate displayable start (needs `erc-server-process') - (insert "\n\n") - (setq erc-input-marker (make-marker) erc-insert-marker (make-marker)) - (set-marker erc-insert-marker (point-max)) - (erc-display-prompt) ; boilerplate displayable end + (erc--initialize-markers (point) nil) (erc-networks--ensure-announced erc-server-process parsed) (goto-char (point-min)) @@ -1277,9 +1274,9 @@ erc-networks--rename-server-buffer--existing--reuse (with-current-buffer old-buf (erc-mode) (insert "*** Old buf") + (erc--initialize-markers (point) nil) (setq erc-network 'FooNet erc-server-current-nick "tester" - erc-insert-marker (set-marker (make-marker) (point-max)) erc-server-process old-proc erc-networks--id (erc-networks--id-create nil))) @@ -1328,10 +1325,10 @@ erc-networks--rename-server-buffer--existing--noreuse erc-reuse-buffers) (with-current-buffer old-buf (erc-mode) + (erc--initialize-markers (point) nil) (insert "*** Old buf") (setq erc-network 'FooNet erc-server-current-nick "tester" - erc-insert-marker (set-marker (make-marker) (point-max)) erc-server-process old-proc erc-networks--id (erc-networks--id-create nil))) (with-current-buffer (get-buffer-create "#chan") @@ -1377,10 +1374,10 @@ erc-networks--rename-server-buffer--reconnecting (with-current-buffer old-buf (erc-mode) + (erc--initialize-markers (point) nil) (insert "*** Old buf") (setq erc-network 'FooNet erc-server-current-nick "tester" - erc-insert-marker (set-marker (make-marker) (point-max)) erc-server-process old-proc erc-networks--id (erc-networks--id-create nil))) @@ -1415,10 +1412,10 @@ erc-networks--rename-server-buffer--id (with-current-buffer old-buf (erc-mode) + (erc--initialize-markers (point) nil) (insert "*** Old buf") (setq erc-network 'FooNet erc-networks--id (erc-networks--id-create 'MySession) - erc-insert-marker (set-marker (make-marker) (point-max)) erc-server-process old-proc)) (with-current-buffer (get-buffer-create "#chan") @@ -1454,10 +1451,10 @@ erc-networks--rename-server-buffer--existing--live (with-current-buffer old-buf (erc-mode) + (erc--initialize-markers (point) nil) (insert "*** Old buf") (setq erc-network 'FooNet erc-server-current-nick "tester" - erc-insert-marker (set-marker (make-marker) (point-max)) erc-server-process old-proc erc-networks--id (erc-networks--id-create nil)) (should (erc-server-process-alive))) @@ -1473,15 +1470,12 @@ erc-networks--rename-server-buffer--existing--live (ert-info ("New buffer rejected, abandoned, not killed") (with-current-buffer (get-buffer-create "irc.foonet.org") (erc-mode) + (erc--initialize-markers (point) nil) (setq erc-network 'FooNet erc-server-current-nick "tester" - erc-insert-marker (make-marker) - erc-input-marker (make-marker) erc-server-process (erc-networks-tests--create-live-proc) erc-networks--id (erc-networks--id-create nil)) (set-process-sentinel erc-server-process #'ignore) - (erc-display-prompt nil (point-max)) - (set-marker erc-insert-marker (pos-bol)) (erc-display-message nil 'notice (current-buffer) "notice") (with-silent-modifications (should-not (erc-networks--rename-server-buffer erc-server-process))) @@ -1514,10 +1508,10 @@ erc-networks--rename-server-buffer--local-match (with-current-buffer old-buf (erc-mode) (insert "*** Old buf") + (erc--initialize-markers (point) nil) (setq erc-network 'FooNet erc-server-current-nick "tester" erc-server-announced-name "us-east.foonet.org" - erc-insert-marker (set-marker (make-marker) (point-max)) erc-server-process old-proc erc--isupport-params (make-hash-table) erc-networks--id (erc-networks--id-create nil)) @@ -1566,10 +1560,10 @@ erc-networks--rename-server-buffer--local-nomatch (with-current-buffer old-buf (erc-mode) (insert "*** Old buf") + (erc--initialize-markers (point) nil) (setq erc-network 'FooNet erc-server-current-nick "tester" erc-server-announced-name "us-west.foonet.org" - erc-insert-marker (set-marker (make-marker) (point-max)) erc-server-process old-proc erc--isupport-params (make-hash-table) erc-networks--id (erc-networks--id-create nil)) diff --git a/test/lisp/erc/erc-stamp-tests.el b/test/lisp/erc/erc-stamp-tests.el index 01e71e348e0..6da7ed4503d 100644 --- a/test/lisp/erc/erc-stamp-tests.el +++ b/test/lisp/erc/erc-stamp-tests.el @@ -43,13 +43,10 @@ erc-stamp-tests--insert-right (with-current-buffer (get-buffer-create "*erc-stamp-tests--insert-right*") (erc-mode) (erc-munge-invisibility-spec) + (erc--initialize-markers (point) nil) (setq erc-server-process (start-process "p" (current-buffer) - "sleep" "1") - erc-input-marker (make-marker) - erc-insert-marker (make-marker)) + "sleep" "1")) (set-process-query-on-exit-flag erc-server-process nil) - (set-marker erc-insert-marker (point-max)) - (erc-display-prompt) (funcall test) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 7d1e20132e1..f3489a16386 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -294,16 +294,19 @@ erc--refresh-prompt (set-process-query-on-exit-flag erc-server-process nil) ;; Incoming message redraws prompt (erc-display-message nil 'notice nil "Welcome") + (should (looking-at-p (rx "*** Welcome"))) + (forward-line) (should (looking-at-p "ServNet 4>")) ;; Say something - (save-excursion (goto-char erc-input-marker) - (insert "Howdy") - (erc-send-current-line) - (forward-line -1) + (goto-char erc-input-marker) + (insert "Howdy") + (erc-send-current-line) + (save-excursion (forward-line -1) (should (looking-at "No target")) (forward-line -1) (should (looking-at " Howdy"))) - (should (looking-at-p "ServNet 6>")) + (should (looking-back "ServNet 6> ")) + (should (= erc-input-marker (point))) ;; Space after prompt is unpropertized (should (get-text-property (1- erc-input-marker) 'erc-prompt)) (should-not (get-text-property erc-input-marker 'erc-prompt)) @@ -317,6 +320,7 @@ erc--refresh-prompt (erc-tests--send-prep) (goto-char erc-insert-marker) (should (looking-at-p "#chan 9>")) + (goto-char erc-input-marker) (setq erc-server-process (buffer-local-value 'erc-server-process (get-buffer "ServNet")) erc-networks--id (erc-with-server-buffer erc-networks--id) @@ -328,18 +332,18 @@ erc--refresh-prompt (erc-update-current-channel-member "tester" "tester") (erc-display-message nil nil (current-buffer) (erc-format-privmessage "alice" "Hi" nil t)) - (should (looking-at-p "#chan@ServNet 10>")) - (save-excursion (goto-char erc-input-marker) - (insert "Howdy") - (erc-send-current-line) - (forward-line -1) + (should (looking-back "#chan@ServNet 10> ")) + (goto-char erc-input-marker) + (insert "Howdy") + (erc-send-current-line) + (save-excursion (forward-line -1) (should (looking-at " Howdy"))) - (should (looking-at-p "#chan@ServNet 11>")) - (save-excursion (goto-char erc-input-marker) - (insert "/query bob") - (erc-send-current-line)) + (should (looking-back "#chan@ServNet 11> ")) + (should (= (point) erc-input-marker)) + (insert "/query bob") + (erc-send-current-line) ;; Query does not redraw (nor /help, only message input) - (should (looking-at-p "#chan@ServNet 11>")) + (should (looking-back "#chan@ServNet 11> ")) ;; No sign of old prompts (save-excursion (goto-char (point-min)) @@ -349,15 +353,16 @@ erc--refresh-prompt (with-current-buffer (get-buffer "bob") (goto-char erc-insert-marker) (should (looking-at-p "bob@ServNet 14>")) + (goto-char erc-input-marker) (erc-display-message nil nil (current-buffer) (erc-format-privmessage "bob" "Hi" nil t)) - (should (looking-at-p "bob@ServNet 15>")) - (save-excursion (goto-char erc-input-marker) - (insert "Howdy") - (erc-send-current-line) - (forward-line -1) + (should (looking-back "bob@ServNet 15> ")) + (goto-char erc-input-marker) + (insert "Howdy") + (erc-send-current-line) + (save-excursion (forward-line -1) (should (looking-at " Howdy"))) - (should (looking-at-p "bob@ServNet 16>")) + (should (looking-back "bob@ServNet 16> ")) ;; No sign of old prompts (save-excursion (goto-char (point-min)) commit d880a08f9592e51ada5749d10b472396683fb6ee Author: F. Jason Park Date: Mon Jun 5 03:49:44 2023 -0700 Cement ordering of essential hook members in ERC * etc/ERC-NEWS: Add new section explaining the pinning of certain hook members owned by built-in modules to fixed depths. * lisp/erc/erc-button.el (erc-button-mode, erc-button-enable): Change hook depth for `erc-button-add-buttons' from 90 to 30. * lisp/erc/erc-fill.el (erc-fill-mode, erc-fill-enable): Change hook depth for `erc-fill' from 0 to 40. * lisp/erc/erc-match.el (erc-match-mode, erc-match-enable): Change hook depth for `erc-match-message' from 90 to 60. * lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable): Change hook depth for `erc-add-timestamp' from 90 to 50. * test/lisp/erc/erc-tests.el (erc-tests--assert-printed-in-subprocess): Add fixture for testing a form printed from a subprocess. (erc--find-mode, erc--essential-hook-ordering): Use helper in existing and new tests, respectively. (Bug#60936) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 1534f0adc25..e4947d0c64d 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -178,6 +178,26 @@ impactfully, the value of the 'field' property for ERC's prompt has changed from 't' to the more useful 'erc-prompt', although the property of the same name has been retained. +*** Members of insert- and send-related hooks have been reordered. +Built-in and third-party modules rely on certain hooks for adjusting +incoming and outgoing messages upon insertion. And some modules only +want to do so after others have done their damage. Traditionally, +this required various hacks and finagling to achieve. And while this +release makes an effort to load modules in a more consistent order, +that alone isn't enough to ensure similar predictability among +essential members of important hooks. + +Luckily, ERC now leverages a feature introduced in Emacs 27, "hook +depth," to secure the positions of a few key members of +'erc-insert-modify-hook' and 'erc-send-modify-hook'. So far, this +includes the functions 'erc-button-add-buttons', 'erc-fill', +'erc-add-timestamp', and 'erc-match-message', which now appear in that +order, when present, at depths beginning at 20 and ending below 80. +Of most interest to module authors is the new relative positioning of +the first two, 'erc-button-add-buttons' and 'erc-fill', which have +been swapped with respect to their previous places in recent ERC +versions. + *** ERC now manages timestamp-related properties a bit differently. For starters, the 'cursor-sensor-functions' property no longer contains unique closures and thus no longer proves effective for diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 931236891bf..08610860630 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -52,8 +52,8 @@ erc-button ;;;###autoload(autoload 'erc-button-mode "erc-button" nil t) (define-erc-module button nil "This mode buttonizes all messages according to `erc-button-alist'." - ((add-hook 'erc-insert-modify-hook #'erc-button-add-buttons 'append) - (add-hook 'erc-send-modify-hook #'erc-button-add-buttons 'append) + ((add-hook 'erc-insert-modify-hook #'erc-button-add-buttons 30) + (add-hook 'erc-send-modify-hook #'erc-button-add-buttons 30) (add-hook 'erc-mode-hook #'erc-button-setup 91) (unless erc--updating-modules-p (erc-buffer-do #'erc-button-setup)) (add-hook 'erc--tab-functions #'erc-button-next) diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 306d74a0741..5115e45210d 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -49,8 +49,8 @@ fill ;; other modules. Ideally, this module's processing should happen ;; after "morphological" modifications to a message's text but ;; before superficial decorations. - ((add-hook 'erc-insert-modify-hook #'erc-fill) - (add-hook 'erc-send-modify-hook #'erc-fill)) + ((add-hook 'erc-insert-modify-hook #'erc-fill 40) + (add-hook 'erc-send-modify-hook #'erc-fill 40)) ((remove-hook 'erc-insert-modify-hook #'erc-fill) (remove-hook 'erc-send-modify-hook #'erc-fill))) diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index 0c58524cd9f..6ba524ef9a8 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -52,7 +52,7 @@ match `erc-current-nick-highlight-type'. For all these highlighting types, you can decide whether the entire message or only the sending nick is highlighted." - ((add-hook 'erc-insert-modify-hook #'erc-match-message 'append) + ((add-hook 'erc-insert-modify-hook #'erc-match-message 60) (add-hook 'erc-mode-hook #'erc-match--modify-invisibility-spec) (unless erc--updating-modules-p (erc-buffer-do #'erc-match--modify-invisibility-spec)) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 78a8b1bc100..aac51135a07 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -163,8 +163,8 @@ erc-timestamp-face (define-erc-module stamp timestamp "This mode timestamps messages in the channel buffers." ((add-hook 'erc-mode-hook #'erc-munge-invisibility-spec) - (add-hook 'erc-insert-modify-hook #'erc-add-timestamp t) - (add-hook 'erc-send-modify-hook #'erc-add-timestamp t) + (add-hook 'erc-insert-modify-hook #'erc-add-timestamp 50) + (add-hook 'erc-send-modify-hook #'erc-add-timestamp 50) (add-hook 'erc-mode-hook #'erc-stamp--recover-on-reconnect) (add-hook 'erc--pre-clear-functions #'erc-stamp--reset-on-clear) (unless erc--updating-modules-p diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 1c75f35e1b5..7d1e20132e1 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -2085,48 +2085,77 @@ erc--normalize-module-symbol (should (eq (erc--normalize-module-symbol 'timestamp) 'stamp)) (should (eq (erc--normalize-module-symbol 'nickserv) 'services))) -;; Worrying about which library a module comes from is mostly not -;; worth the hassle so long as ERC can find its minor mode. However, -;; bugs involving multiple modules living in the same library may slip -;; by because a module's loading problems may remain hidden on account -;; of its place in the default ordering. - -(ert-deftest erc--find-mode () +(defun erc-tests--assert-printed-in-subprocess (code expected) (let* ((package (if-let* ((found (getenv "ERC_PACKAGE_NAME")) ((string-prefix-p "erc-" found))) (intern found) 'erc)) + ;; This is for integrations testing with managed configs + ;; ("starter kits") that use a different package manager. + (init (and-let* ((found (getenv "ERC_TESTS_INIT")) + (files (split-string found ",")) + ((seq-every-p #'file-exists-p files))) + (mapcan (lambda (f) (list "-l" f)) files))) (prog - `(,@(and (featurep 'compat) - `((progn - (require 'package) - (let ((package-load-list '((compat t) (,package t)))) - (package-initialize))))) - (require 'erc) - (let ((mods (mapcar #'cadddr - (cdddr (get 'erc-modules 'custom-type)))) - moded) - (setq mods - (sort mods (lambda (a b) (if (zerop (random 2)) a b)))) - (dolist (mod mods) - (unless (keywordp mod) - (push (if-let ((mode (erc--find-mode mod))) - mod - (list :missing mod)) - moded))) - (message "%S" - (sort moded - (lambda (a b) - (string< (symbol-name a) (symbol-name b)))))))) - (proc (start-process "erc--module-mode-autoloads" - (current-buffer) - (concat invocation-directory invocation-name) - "-batch" "-Q" - "-eval" (format "%S" (cons 'progn prog))))) + `(progn + ,@(and (not init) (featurep 'compat) + `((require 'package) + (let ((package-load-list '((compat t) (,package t)))) + (package-initialize)))) + (require 'erc) + (cl-assert (equal erc-version ,erc-version) t) + ,code)) + (proc (apply #'start-process + (symbol-name (ert-test-name (ert-running-test))) + (current-buffer) + (concat invocation-directory invocation-name) + `("-batch" ,@(or init '("-Q")) + "-eval" ,(format "%S" prog))))) (set-process-query-on-exit-flag proc t) (while (accept-process-output proc 10)) (goto-char (point-min)) - (should (equal (read (current-buffer)) erc-tests--modules)))) + (unless (equal (read (current-buffer)) expected) + (message "Exepcted: %S\nGot: %s" expected (buffer-string)) + (ert-fail "Mismatch")))) + +;; Worrying about which library a module comes from is mostly not +;; worth the hassle so long as ERC can find its minor mode. However, +;; bugs involving multiple modules living in the same library may slip +;; by because a module's loading problems may remain hidden on account +;; of its place in the default ordering. + +(ert-deftest erc--find-mode () + (erc-tests--assert-printed-in-subprocess + `(let ((mods (mapcar #'cadddr (cdddr (get 'erc-modules 'custom-type)))) + moded) + (setq mods (sort mods (lambda (a b) (if (zerop (random 2)) a b)))) + (dolist (mod mods) + (unless (keywordp mod) + (push (if-let ((mode (erc--find-mode mod))) mod (list :missing mod)) + moded))) + (message "%S" + (sort moded (lambda (a b) + (string< (symbol-name a) (symbol-name b)))))) + erc-tests--modules)) + +(ert-deftest erc--essential-hook-ordering () + (erc-tests--assert-printed-in-subprocess + '(progn + (erc-update-modules) + (message "%S" + (list :erc-insert-modify-hook erc-insert-modify-hook + :erc-send-modify-hook erc-send-modify-hook))) + + '( :erc-insert-modify-hook (erc-controls-highlight ; 0 + erc-button-add-buttons ; 30 + erc-fill ; 40 + erc-add-timestamp ; 50 + erc-match-message) ; 60 + + :erc-send-modify-hook ( erc-controls-highlight ; 0 + erc-button-add-buttons ; 30 + erc-fill ; 40 + erc-add-timestamp)))) ; 50 (ert-deftest erc-migrate-modules () (should (equal (erc-migrate-modules '(autojoin timestamp button)) commit 1c3f6aa98f5ab0ddc99fd778dd17fd72a1052aa3 Author: F. Jason Park Date: Mon Jun 5 02:35:53 2023 -0700 Measure stamps pixel-wise with erc-fill-wrap * lisp/erc/erc-fill.el (erc-fill-wrap-mode, erc-fill-wrap-enable): Change "how" for advice applied to `erc-stamp--insert-date-function' from `:filter-args' to `:after'. (erc-fill--wrap-stamp-insert-prefixed-date): Change signature to conform to `:after'-style advice. Use `buffer-text-pixel-size' when desired and available for generating display spec. (erc-fill-wrap): Remove confusing comment. Don't apply text props to newlines because there's no obvious use case for inheriting these. * lisp/erc/erc.el (erc-send-action, erc-display-msg): Add `erc-command' property (as "PRIVMSG") to inserted message, sans newline, so that all inserted messages in an ERC buffer contain this property. * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update data. * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update data. * test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld: Update. * test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld: Update. * test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld: Update. * test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld: Update. * test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld: Update. (Bug#60936) diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 718e51a058c..306d74a0741 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -336,7 +336,7 @@ fill-wrap erc-fill--wrap-value erc-fill-static-center) (setq erc-fill--function #'erc-fill-wrap) ;; Internal integrations. - (add-function :filter-args (local 'erc-stamp--insert-date-function) + (add-function :after (local 'erc-stamp--insert-date-function) #'erc-fill--wrap-stamp-insert-prefixed-date) (when (or erc-stamp-mode (memq 'stamp erc-modules)) (erc-stamp--display-margin-mode +1)) @@ -398,14 +398,24 @@ erc-fill--wrap-continued-message-p ((erc-nick-equal-p (car props) nick)))) (set-marker erc-fill--wrap-last-msg (point-min)))) -(defun erc-fill--wrap-stamp-insert-prefixed-date (args) +(defun erc-fill--wrap-stamp-insert-prefixed-date (&rest args) "Apply `line-prefix' property to args." - (let* ((ts-left (car args))) - (put-text-property 0 (length ts-left) 'line-prefix - `(space :width - (- erc-fill--wrap-value - ,(length (string-trim-left ts-left)))) - ts-left)) + (let* ((ts-left (car args)) + (start) + ;; Insert " " to simulate gap between and msg beg. + (end (save-excursion (skip-chars-backward "\n") + (setq start (pos-bol)) + (insert " ") + (point))) + (width (if (and erc-fill-wrap-use-pixels + (fboundp 'buffer-text-pixel-size)) + (save-restriction (narrow-to-region start end) + (list (car (buffer-text-pixel-size)))) + (length (string-trim-left ts-left))))) + (delete-region (1- end) end) + ;; Use `point-min' instead of `start' to cover leading newilnes. + (put-text-property (point-min) (point) 'line-prefix + `(space :width (- erc-fill--wrap-value ,width)))) args) (defun erc-fill-wrap () @@ -434,8 +444,7 @@ erc-fill-wrap (narrow-to-region (point-min) (point)) (list (car (buffer-text-pixel-size))))) (t (- (point) (point-min)))))))) - ;; Leaving out the final newline doesn't seem to affect anything. - (erc-put-text-properties (point-min) (point-max) + (erc-put-text-properties (point-min) (1- (point-max)) ; exclude "\n" '(line-prefix wrap-prefix) nil `((space :width (- erc-fill--wrap-value ,len)) (space :width erc-fill--wrap-value)))))) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index d68d27e76d0..c0fa48bd9bd 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2782,9 +2782,12 @@ erc-toggle-debug-irc-protocol (defun erc-send-action (tgt str &optional force) "Send CTCP ACTION information described by STR to TGT." (erc-send-ctcp-message tgt (format "ACTION %s" str) force) - (erc-display-message - nil 'input (current-buffer) - 'ACTION ?n (erc-current-nick) ?a str ?u "" ?h "")) + (let ((erc-insert-pre-hook + (cons (lambda (s) ; Leave newline be. + (put-text-property 0 (1- (length s)) 'erc-command 'PRIVMSG s)) + erc-insert-pre-hook))) + (erc-display-message nil 'input (current-buffer) + 'ACTION ?n (erc-current-nick) ?a str ?u "" ?h ""))) ;; Display interface @@ -6494,6 +6497,7 @@ erc-display-msg (setq beg (point)) (insert-before-markers line) (erc-put-text-property beg (point) 'font-lock-face 'erc-input-face) + (erc-put-text-property insert-position (point) 'erc-command 'PRIVMSG) (insert-before-markers "\n") (save-restriction (narrow-to-region insert-position (point)) diff --git a/test/lisp/erc/erc-fill-tests.el b/test/lisp/erc/erc-fill-tests.el index fc33d0b9103..15a8087f848 100644 --- a/test/lisp/erc/erc-fill-tests.el +++ b/test/lisp/erc/erc-fill-tests.el @@ -109,10 +109,12 @@ erc-fill-tests--wrap-check-prefixes (dolist (prefix prefixes) (should (search-forward prefix nil t)) (should (get-text-property (pos-bol) 'line-prefix)) - (should (get-text-property (pos-eol) 'line-prefix)) + (should (get-text-property (1- (pos-eol)) 'line-prefix)) + (should-not (get-text-property (pos-eol) 'line-prefix)) (should (equal (get-text-property (pos-bol) 'wrap-prefix) '(space :width erc-fill--wrap-value))) - (should (equal (get-text-property (pos-eol) 'wrap-prefix) + (should-not (get-text-property (pos-eol) 'wrap-prefix)) + (should (equal (get-text-property (1- (pos-eol)) 'wrap-prefix) '(space :width erc-fill--wrap-value)))))) ;; Set this variable to t to generate new snapshots after carefully diff --git a/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld b/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld index 88defb6c09e..689bacc7012 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 21 (erc-timestamp 0 line-prefix (space :width (- 27 18)) field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 27) line-prefix #3=(space :width (- 27 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=(#7=(margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 190 191 (wrap-prefix #2# line-prefix #3#) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 27 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 348 349 (wrap-prefix #2# line-prefix #4#) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 27 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 435 436 (wrap-prefix #2# line-prefix #5#) 436 455 (erc-timestamp 1680332400 line-prefix (space :width (- 27 18)) field erc-timestamp) 455 456 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6=(space :width (- 27 (6))) erc-command PRIVMSG) 456 459 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 459 466 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 466 473 (erc-timestamp 1680332400 field erc-timestamp wrap-prefix #2# line-prefix #6# display #8=(#7# #("[07:00]" 0 7 (display #8# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 473 474 (wrap-prefix #2# line-prefix #6#) 474 475 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9=(space :width (- 27 (8))) erc-command PRIVMSG) 475 480 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 480 486 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 486 487 (wrap-prefix #2# line-prefix #9#) 487 488 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10=(space :width (- 27 0)) display #11="" erc-command PRIVMSG) 488 493 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# display #11# erc-command PRIVMSG) 493 495 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# display #11# erc-command PRIVMSG) 495 499 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# erc-command PRIVMSG) 499 500 (wrap-prefix #2# line-prefix #10#) 500 501 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12=(space :width (- 27 (6))) erc-command PRIVMSG) 501 504 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12# erc-command PRIVMSG) 504 512 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12# erc-command PRIVMSG) 512 513 (wrap-prefix #2# line-prefix #12#) 513 514 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13=(space :width (- 27 0)) display #11# erc-command PRIVMSG) 514 517 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# display #11# erc-command PRIVMSG) 517 519 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# display #11# erc-command PRIVMSG) 519 524 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# erc-command PRIVMSG) 524 525 (wrap-prefix #2# line-prefix #13#) 525 526 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14=(space :width (- 27 (8))) erc-command PRIVMSG) 526 531 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14# erc-command PRIVMSG) 531 538 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14# erc-command PRIVMSG) 538 539 (wrap-prefix #2# line-prefix #14#) 539 540 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15=(space :width (- 27 0)) display #11# erc-command PRIVMSG) 540 545 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# display #11# erc-command PRIVMSG) 545 547 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# display #11# erc-command PRIVMSG) 547 551 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# erc-command PRIVMSG) 551 552 (wrap-prefix #2# line-prefix #15#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 20 (erc-timestamp 0 line-prefix (space :width (- 27 (18))) field erc-timestamp) 20 21 (erc-timestamp 0 field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 27) line-prefix #3=(space :width (- 27 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=(#7=(margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 27 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 27 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 436 454 (erc-timestamp 1680332400 line-prefix (space :width (- 27 (18))) field erc-timestamp) 454 455 (erc-timestamp 1680332400 field erc-timestamp) 455 456 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6=(space :width (- 27 (6))) erc-command PRIVMSG) 456 459 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 459 466 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 466 473 (erc-timestamp 1680332400 field erc-timestamp wrap-prefix #2# line-prefix #6# display #8=(#7# #("[07:00]" 0 7 (display #8# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 474 475 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9=(space :width (- 27 (8))) erc-command PRIVMSG) 475 480 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 480 486 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 487 488 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10=(space :width (- 27 0)) display #11="" erc-command PRIVMSG) 488 493 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# display #11# erc-command PRIVMSG) 493 495 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# display #11# erc-command PRIVMSG) 495 499 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# erc-command PRIVMSG) 500 501 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12=(space :width (- 27 (6))) erc-command PRIVMSG) 501 504 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12# erc-command PRIVMSG) 504 512 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12# erc-command PRIVMSG) 513 514 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13=(space :width (- 27 0)) display #11# erc-command PRIVMSG) 514 517 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# display #11# erc-command PRIVMSG) 517 519 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# display #11# erc-command PRIVMSG) 519 524 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# erc-command PRIVMSG) 525 526 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14=(space :width (- 27 (8))) erc-command PRIVMSG) 526 531 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14# erc-command PRIVMSG) 531 538 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14# erc-command PRIVMSG) 539 540 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15=(space :width (- 27 0)) display #11# erc-command PRIVMSG) 540 545 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# display #11# erc-command PRIVMSG) 545 547 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# display #11# erc-command PRIVMSG) 547 551 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# erc-command PRIVMSG)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld b/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld index c5a9cbfc05d..9fa23a7d332 100644 --- a/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld +++ b/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 21 (erc-timestamp 0 line-prefix (space :width (- 29 18)) field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 29) line-prefix #3=(space :width (- 29 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=(#7=(margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 190 191 (wrap-prefix #2# line-prefix #3#) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 29 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 348 349 (wrap-prefix #2# line-prefix #4#) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 29 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 435 436 (wrap-prefix #2# line-prefix #5#) 436 455 (erc-timestamp 1680332400 line-prefix (space :width (- 29 18)) field erc-timestamp) 455 456 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6=(space :width (- 29 (6))) erc-command PRIVMSG) 456 459 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 459 466 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 466 473 (erc-timestamp 1680332400 field erc-timestamp wrap-prefix #2# line-prefix #6# display #8=(#7# #("[07:00]" 0 7 (display #8# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 473 474 (wrap-prefix #2# line-prefix #6#) 474 475 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9=(space :width (- 29 (8))) erc-command PRIVMSG) 475 480 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 480 486 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 486 487 (wrap-prefix #2# line-prefix #9#) 487 488 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10=(space :width (- 29 0)) display #11="" erc-command PRIVMSG) 488 493 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# display #11# erc-command PRIVMSG) 493 495 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# display #11# erc-command PRIVMSG) 495 499 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# erc-command PRIVMSG) 499 500 (wrap-prefix #2# line-prefix #10#) 500 501 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12=(space :width (- 29 (6))) erc-command PRIVMSG) 501 504 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12# erc-command PRIVMSG) 504 512 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12# erc-command PRIVMSG) 512 513 (wrap-prefix #2# line-prefix #12#) 513 514 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13=(space :width (- 29 0)) display #11# erc-command PRIVMSG) 514 517 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# display #11# erc-command PRIVMSG) 517 519 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# display #11# erc-command PRIVMSG) 519 524 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# erc-command PRIVMSG) 524 525 (wrap-prefix #2# line-prefix #13#) 525 526 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14=(space :width (- 29 (8))) erc-command PRIVMSG) 526 531 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14# erc-command PRIVMSG) 531 538 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14# erc-command PRIVMSG) 538 539 (wrap-prefix #2# line-prefix #14#) 539 540 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15=(space :width (- 29 0)) display #11# erc-command PRIVMSG) 540 545 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# display #11# erc-command PRIVMSG) 545 547 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# display #11# erc-command PRIVMSG) 547 551 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# erc-command PRIVMSG) 551 552 (wrap-prefix #2# line-prefix #15#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr 1 2023]\n zero.[07:00]\n one.\n two.\n three.\n four.\n five.\n six.\n" 2 20 (erc-timestamp 0 line-prefix (space :width (- 29 (18))) field erc-timestamp) 20 21 (erc-timestamp 0 field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 29) line-prefix #3=(space :width (- 29 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=(#7=(margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 29 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 29 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 436 454 (erc-timestamp 1680332400 line-prefix (space :width (- 29 (18))) field erc-timestamp) 454 455 (erc-timestamp 1680332400 field erc-timestamp) 455 456 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6=(space :width (- 29 (6))) erc-command PRIVMSG) 456 459 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 459 466 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 466 473 (erc-timestamp 1680332400 field erc-timestamp wrap-prefix #2# line-prefix #6# display #8=(#7# #("[07:00]" 0 7 (display #8# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 474 475 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9=(space :width (- 29 (8))) erc-command PRIVMSG) 475 480 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 480 486 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 487 488 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10=(space :width (- 29 0)) display #11="" erc-command PRIVMSG) 488 493 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# display #11# erc-command PRIVMSG) 493 495 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# display #11# erc-command PRIVMSG) 495 499 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #10# erc-command PRIVMSG) 500 501 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12=(space :width (- 29 (6))) erc-command PRIVMSG) 501 504 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12# erc-command PRIVMSG) 504 512 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #12# erc-command PRIVMSG) 513 514 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13=(space :width (- 29 0)) display #11# erc-command PRIVMSG) 514 517 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# display #11# erc-command PRIVMSG) 517 519 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# display #11# erc-command PRIVMSG) 519 524 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #13# erc-command PRIVMSG) 525 526 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14=(space :width (- 29 (8))) erc-command PRIVMSG) 526 531 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14# erc-command PRIVMSG) 531 538 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #14# erc-command PRIVMSG) 539 540 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15=(space :width (- 29 0)) display #11# erc-command PRIVMSG) 540 545 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# display #11# erc-command PRIVMSG) 545 547 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# display #11# erc-command PRIVMSG) 547 551 (erc-timestamp 1680332400 wrap-prefix #2# line-prefix #15# erc-command PRIVMSG)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld b/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld index 67ebad542fb..80c9e1d80f5 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-01-start.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 21 (erc-timestamp 0 line-prefix (space :width (- 27 18)) field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 27) line-prefix #3=(space :width (- 27 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 190 191 (wrap-prefix #2# line-prefix #3#) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 27 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 348 349 (wrap-prefix #2# line-prefix #4#) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 27 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 435 436 (wrap-prefix #2# line-prefix #5#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 20 (erc-timestamp 0 line-prefix (space :width (- 27 (18))) field erc-timestamp) 20 21 (erc-timestamp 0 field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 27) line-prefix #3=(space :width (- 27 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 27 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 27 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld b/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld index 0bf8001475d..e675695f660 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-02-right.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 21 (erc-timestamp 0 line-prefix (space :width (- 29 18)) field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 29) line-prefix #3=(space :width (- 29 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 190 191 (wrap-prefix #2# line-prefix #3#) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 29 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 348 349 (wrap-prefix #2# line-prefix #4#) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 29 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 435 436 (wrap-prefix #2# line-prefix #5#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 20 (erc-timestamp 0 line-prefix (space :width (- 29 (18))) field erc-timestamp) 20 21 (erc-timestamp 0 field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 29) line-prefix #3=(space :width (- 29 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 29 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 29 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld b/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld index 7d231d19cef..a6070c2e3ff 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-03-left.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 21 (erc-timestamp 0 line-prefix (space :width (- 25 18)) field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 25) line-prefix #3=(space :width (- 25 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 190 191 (wrap-prefix #2# line-prefix #3#) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 25 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 348 349 (wrap-prefix #2# line-prefix #4#) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 25 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 435 436 (wrap-prefix #2# line-prefix #5#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 20 (erc-timestamp 0 line-prefix (space :width (- 25 (18))) field erc-timestamp) 20 21 (erc-timestamp 0 field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 25) line-prefix #3=(space :width (- 25 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 25 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 25 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld b/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld index 67ebad542fb..80c9e1d80f5 100644 --- a/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld +++ b/test/lisp/erc/resources/fill/snapshots/monospace-04-reset.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 21 (erc-timestamp 0 line-prefix (space :width (- 27 18)) field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 27) line-prefix #3=(space :width (- 27 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 190 191 (wrap-prefix #2# line-prefix #3#) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 27 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 348 349 (wrap-prefix #2# line-prefix #4#) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 27 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 435 436 (wrap-prefix #2# line-prefix #5#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n" 2 20 (erc-timestamp 0 line-prefix (space :width (- 27 (18))) field erc-timestamp) 20 21 (erc-timestamp 0 field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 27) line-prefix #3=(space :width (- 27 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 27 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 27 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG)) \ No newline at end of file diff --git a/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld b/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld index 45c3883b023..2b8766c27f4 100644 --- a/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld +++ b/test/lisp/erc/resources/fill/snapshots/spacing-01-mono.eld @@ -1 +1 @@ -#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n This buffer is for text.\n*** one two three\n*** four five six\n Somebody stop me\n" 2 21 (erc-timestamp 0 line-prefix (space :width (- 27 18)) field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 27) line-prefix #3=(space :width (- 27 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 190 191 (line-spacing 0.5 wrap-prefix #2# line-prefix #3#) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 27 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 348 349 (line-spacing 0.5 wrap-prefix #2# line-prefix #4#) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 27 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 435 436 (line-spacing 0.5 wrap-prefix #2# line-prefix #5#) 436 437 (erc-timestamp 0 wrap-prefix #2# line-prefix #6=(space :width (- 27 0)) display #7="" erc-command PRIVMSG) 437 440 (erc-timestamp 0 wrap-prefix #2# line-prefix #6# display #7# erc-command PRIVMSG) 440 442 (erc-timestamp 0 wrap-prefix #2# line-prefix #6# display #7# erc-command PRIVMSG) 442 466 (erc-timestamp 0 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 466 467 (line-spacing 0.5 wrap-prefix #2# line-prefix #6#) 467 484 (erc-timestamp 0 wrap-prefix #2# line-prefix #8=(space :width (- 27 (4)))) 484 485 (wrap-prefix #2# line-prefix #8#) 485 502 (erc-timestamp 0 wrap-prefix #2# line-prefix #10=(space :width (- 27 (4)))) 502 503 (line-spacing 0.5 wrap-prefix #2# line-prefix #10#) 503 504 (erc-timestamp 0 wrap-prefix #2# line-prefix #9=(space :width (- 27 (6))) erc-command PRIVMSG) 504 507 (erc-timestamp 0 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 507 525 (erc-timestamp 0 wrap-prefix #2# line-prefix #9# erc-command PRIVMSG) 525 526 (wrap-prefix #2# line-prefix #9#)) \ No newline at end of file +#("\n\n\n[Thu Jan 1 1970]\n*** This server is in debug mode and is logging all user I/O. If you do not wish for everything you send to be readable by the server owner(s), please disconnect.[00:00]\n bob: come, you are a tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause to complain of? Come me to what was done to her.\n alice: Either your unparagoned mistress is dead, or she's outprized by a trifle.\n This buffer is for text.\n*** one two three\n*** four five six\n Somebody stop me\n" 2 20 (erc-timestamp 0 line-prefix (space :width (- 27 (18))) field erc-timestamp) 20 21 (erc-timestamp 0 field erc-timestamp) 21 183 (erc-timestamp 0 wrap-prefix #2=(space :width 27) line-prefix #3=(space :width (- 27 (4)))) 183 190 (erc-timestamp 0 field erc-timestamp wrap-prefix #2# line-prefix #3# display #1=((margin right-margin) #("[00:00]" 0 7 (display #1# isearch-open-invisible timestamp invisible timestamp font-lock-face erc-timestamp-face)))) 190 191 (line-spacing 0.5) 191 192 (erc-timestamp 0 wrap-prefix #2# line-prefix #4=(space :width (- 27 (8))) erc-command PRIVMSG) 192 197 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 197 199 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 199 202 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 202 315 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 315 316 (erc-timestamp 0 erc-command PRIVMSG) 316 348 (erc-timestamp 0 wrap-prefix #2# line-prefix #4# erc-command PRIVMSG) 348 349 (line-spacing 0.5) 349 350 (erc-timestamp 0 wrap-prefix #2# line-prefix #5=(space :width (- 27 (6))) erc-command PRIVMSG) 350 353 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 353 355 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 355 360 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 360 435 (erc-timestamp 0 wrap-prefix #2# line-prefix #5# erc-command PRIVMSG) 435 436 (line-spacing 0.5) 436 437 (erc-timestamp 0 wrap-prefix #2# line-prefix #6=(space :width (- 27 0)) display #7="" erc-command PRIVMSG) 437 440 (erc-timestamp 0 wrap-prefix #2# line-prefix #6# display #7# erc-command PRIVMSG) 440 442 (erc-timestamp 0 wrap-prefix #2# line-prefix #6# display #7# erc-command PRIVMSG) 442 466 (erc-timestamp 0 wrap-prefix #2# line-prefix #6# erc-command PRIVMSG) 466 467 (line-spacing 0.5) 467 484 (erc-timestamp 0 wrap-prefix #2# line-prefix (space :width (- 27 (4)))) 485 502 (erc-timestamp 0 wrap-prefix #2# line-prefix (space :width (- 27 (4)))) 502 503 (line-spacing 0.5) 503 504 (erc-timestamp 0 wrap-prefix #2# line-prefix #8=(space :width (- 27 (6))) erc-command PRIVMSG) 504 507 (erc-timestamp 0 wrap-prefix #2# line-prefix #8# erc-command PRIVMSG) 507 525 (erc-timestamp 0 wrap-prefix #2# line-prefix #8# erc-command PRIVMSG)) \ No newline at end of file commit e560f9af8e8edb2cd41a08c6b0e8637cbac7b1f5 Author: F. Jason Park Date: Sun Dec 18 19:01:40 2022 -0800 Allow ERC modules to extend erc-nick-popup-alist * etc/ERC-NEWS: Mention changes to `erc-button-alist' and superficial changes to `erc-nick-popup-alist'. * lisp/erc/erc-button.el (erc-nick-popup-alist): Change type to prefer associating strings with functions instead of arbitrary sexps. (erc-button-cmd-KICK, erc-button-cmd-MSG): New functions to serve as interrogative wrappers for `erc-cmd-KICK' and `erc-cmd-MSG' in `erc-nick-popup-alist'. The first also fixes a bug in which all but the first token of a given "reason" would be omitted from the ":trailing" portion of an outgoing "KICK" message. (erc-button--nick-popup-alist): New variable to help built-in modules expose special actions to `erc-nick-popup' without touching `erc-nick-popup-alist'. (erc-nick-popup): Present members from both `erc--nick-popup-alist' and `erc-nick-popup-alist' to the invoking user. Accommodate functions as well as arbitrary sexps. (bug#63569) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 5753120107a..1534f0adc25 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -116,13 +116,19 @@ asking users who've customized this option to switch to that some other solution, like automatic migration, is justified, please make that known on the bug list. -** The 'nicknames' entry in 'erc-button-alist' is officially exceptional. +** 'erc-button-alist' and 'erc-nick-popup-alist' have evolved slightly. It's no secret that the 'buttons' module treats potential nicknames -specially. To simplify ERC's move to next-gen "rich UI" extensions, -this special treatment is being canonized. From now on, all values -other than the symbol 'erc-button-buttonize-nicks' appearing in the -"FORM" field (third element) of this entry are considered deprecated -and will incur a warning. +specially. This is perhaps most evident in its treatment of the +'nicknames' entry in 'erc-button-alist'. Indeed, to simplify ERC's +move to next-gen "rich UI" extensions, this special treatment is being +canonized. From here on out, this entry will no longer appear in the +option's default value but will instead be applied implicitly so long +as the option 'erc-button-buttonize-nicks' is non-nil, which it is by +default. Relatedly, the option 'erc-nick-popup-alist' now favors +functions, which ERC calls non-interactively, over arbitrary +s-expressions, which ERC will continue to honor. Although the default +lineup remains functionally equivalent, its members have all been +updated accordingly. ** Option 'erc-query-on-unjoined-chan-privmsg' restored and renamed. This option was accidentally removed from the default client in ERC diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 3045bb44889..931236891bf 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -685,20 +685,20 @@ erc-browse-emacswiki-lisp ;;; Nickname buttons: (defcustom erc-nick-popup-alist - '(("DeOp" . (erc-cmd-DEOP nick)) - ("Kick" . (erc-cmd-KICK (concat nick " " - (read-from-minibuffer - (concat "Kick " nick ", reason: "))))) - ("Msg" . (erc-cmd-MSG (concat nick " " - (read-from-minibuffer - (concat "Message to " nick ": "))))) - ("Op" . (erc-cmd-OP nick)) - ("Query" . (erc-cmd-QUERY nick)) - ("Whois" . (erc-cmd-WHOIS nick)) - ("Lastlog" . (erc-cmd-LASTLOG nick))) + '(("DeOp" . erc-cmd-DEOP) + ("Kick" . erc-button-cmd-KICK) + ("Msg" . erc-button-cmd-MSG) + ("Op" . erc-cmd-OP) + ("Query" . erc-cmd-QUERY) + ("Whois" . erc-cmd-WHOIS) + ("Lastlog" . erc-cmd-LASTLOG)) "An alist of possible actions to take on a nickname. -An entry looks like (\"Action\" . SEXP) where SEXP is evaluated with -the variable `nick' bound to the nick in question. +For all entries (ACTION . FUNC), ERC offers ACTION as a possible +completion item and calls the selected entry's FUNC with the +buttonized nickname at point as the only argument. For +historical reasons, FUNC can also be an arbitrary sexp, in which +case, ERC binds the nick in question to the variable `nick' and +evaluates the expression. Examples: (\"DebianDB\" . @@ -706,18 +706,48 @@ erc-nick-popup-alist (format \"ldapsearch -x -P 2 -h db.debian.org -b dc=debian,dc=org ircnick=%s\" nick)))" + :package-version '(ERC . "5.6") ; FIXME sync on release :type '(repeat (cons (string :tag "Op") - sexp))) + (choice function sexp)))) + +(defun erc-button-cmd-KICK (nick) + "Prompt for a reason, then kick NICK via `erc-cmd-KICK'. +In server buffers, also prompt for a channel." + (erc-cmd-KICK + (or (and erc--target (erc-default-target)) + (let ((targets (mapcar (lambda (b) + (cons (erc--target-string + (buffer-local-value 'erc--target b)) + b)) + (erc-channel-list erc-server-process)))) + (completing-read (format "Channel (%s): " (caar targets)) + targets (pcase-lambda (`(,_ . ,buf)) + (with-current-buffer buf + (erc-get-channel-user nick))) + t nil t (caar targets)))) + nick + (read-from-minibuffer "Reason: "))) + +(defun erc-button-cmd-MSG (nick) + "Prompt for a message to NICK, and send it via `erc-cmd-MSG'." + (let ((msg (read-from-minibuffer (concat "Message to " nick ": ")))) + (erc-cmd-MSG (concat nick " " msg)))) + +(defvar-local erc-button--nick-popup-alist nil + "Internally controlled items for `erc-nick-popup-alist'.") (defun erc-nick-popup (nick) (let* ((completion-ignore-case t) + (alist (append erc-nick-popup-alist erc-button--nick-popup-alist)) (action (completing-read (format-message "What action to take on `%s'? " nick) - erc-nick-popup-alist)) - (code (cdr (assoc action erc-nick-popup-alist)))) + alist)) + (code (cdr (assoc action alist)))) (when code (erc-set-active-buffer (current-buffer)) - (eval code `((nick . ,nick)))))) + (if (functionp code) + (funcall code nick) + (eval code `((nick . ,nick))))))) ;;; Callback functions (defun erc-button-describe-symbol (symbol-name) commit 67f7ac2bbee2f58d919232682f6ea9e7039eb5f3 Author: F. Jason Park Date: Thu Jun 1 22:07:03 2023 -0700 Deprecate nicknames entry in erc-button-alist * lisp/erc/erc-button.el (erc-button-mode, erc-button-enable, erc-button-disable): Restore running `erc-button-setup' on `erc-mode-hook' and also do so immediately in all ERC buffers. Do this instead of calling `erc-button--check-nicknames-entry. (erc-button-buttonize-nicks): Mention that this option's value must be non-nil for all but the most basic client functionality. (erc-button-alist): Remove `nicknames' entry entirely. Describe deprecation, replacement behavior, and available escape hatches in doc string. Update and improve custom type definition, in particular, by including long supported but never mentioned variants for the "REGEXP" field. (erc-button-keys-added): Deprecate because unused and misleading: keys are bound during module init and remain so while module is enabled. (erc-button--has-nickname-entry): New variable to indicate whether to follow legacy code path when a `nicknames' entry exists in `erc-button-alist'. (erc-button-setup): Rewrite to provide warnings about deprecated values for `erc-button-alist'. (erc-button-nickname-callback-function): Add escape hatch for those needing a custom callback for what was the default `nickname' entry in `erc-button-alist'. (erc-button-add-buttons): Always run `erc-button-add-nickname-buttons' unless `erc-button--has-nickname-entry' is non-nil. (erc-button--maybe-warn-arbitrary-sexp, erc-button--extract-form): Rename former to latter and abstain from emitting a warning. (erc-button--check-nicknames-entry): Remove unused function. (erc-button-add-nickname-buttons): Defer to `erc-button--extract-form' for determining value of third FORM slot of entry. (erc-button-add-buttons-1): Call renamed version of `erc-button--maybe-warn-arbitrary-sexp'. (Bug#60933) diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 33b93ff6744..3045bb44889 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -52,13 +52,15 @@ erc-button ;;;###autoload(autoload 'erc-button-mode "erc-button" nil t) (define-erc-module button nil "This mode buttonizes all messages according to `erc-button-alist'." - ((erc-button--check-nicknames-entry) - (add-hook 'erc-insert-modify-hook #'erc-button-add-buttons 'append) + ((add-hook 'erc-insert-modify-hook #'erc-button-add-buttons 'append) (add-hook 'erc-send-modify-hook #'erc-button-add-buttons 'append) + (add-hook 'erc-mode-hook #'erc-button-setup 91) + (unless erc--updating-modules-p (erc-buffer-do #'erc-button-setup)) (add-hook 'erc--tab-functions #'erc-button-next) (erc--modify-local-map t "" #'erc-button-previous)) ((remove-hook 'erc-insert-modify-hook #'erc-button-add-buttons) (remove-hook 'erc-send-modify-hook #'erc-button-add-buttons) + (remove-hook 'erc-mode-hook #'erc-button-setup) (remove-hook 'erc--tab-functions #'erc-button-next) (erc--modify-local-map nil "" #'erc-button-previous))) @@ -103,7 +105,10 @@ erc-button-wrap-long-urls :type '(choice integer boolean)) (defcustom erc-button-buttonize-nicks t - "Flag indicating whether nicks should be buttonized or not." + "Flag indicating whether nicks should be buttonized. +Note that beginning in ERC 5.6, some functionality provided by +other modules, such as `fill-wrap', may depend on this option +being non-nil." :type 'boolean) (defcustom erc-button-rfc-url "https://tools.ietf.org/html/rfc%s" @@ -126,8 +131,7 @@ erc-button-alist ;; a button, it makes no sense to optimize performance by ;; bytecompiling lambdas in this alist. On the other hand, it makes ;; things hard to maintain. - '((nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0) - (erc-button-url-regexp 0 t browse-url-button-open-url 0) + '((erc-button-url-regexp 0 t browse-url-button-open-url 0) ;; (" ]+\\) *>" 0 t browse-url-button-open-url 1) ;;; ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3) ;; emacs internal @@ -159,41 +163,45 @@ erc-button-alist strings, or an alist with the strings in the car. Note that entries in lists or alists are considered to be nicks or other complete words. Therefore they are enclosed in \\< and \\> - while searching. REGEXP can also be the symbol - `nicknames', which matches the nickname of any user on the - current server. + while searching. Also, use of the special symbol `nicknames' + for this slot was deprecated in ERC 5.6, but users can still + use `erc-button-buttonize-nicks' to control whether nicks get + buttonized. And because customizing a corresponding CALLBACK + is no longer possible, an escape hatch has been provided via + the variable `erc-button-nickname-callback-function'. BUTTON is the number of the regexp grouping actually matching the - button. This is ignored if REGEXP is `nicknames'. + button. FORM is either a boolean or a special variable whose value must - be non-nil for the button to be added. When REGEXP is the - special symbol `nicknames', FORM must be the symbol - `erc-button-buttonize-nicks'. Anything else is deprecated. - For all other entries, FORM can also be a function to call in - place of `erc-button-add-button' with the exact same arguments. - When FORM is also a special variable, ERC disregards the - variable and calls the function. + be non-nil for the button to be added. It can also be a + function to call in place of `erc-button-add-button' with the + exact same arguments. When FORM is also a special variable, + ERC disregards the variable and calls the function. Note that + arbitrary s-expressions were deprecated in ERC 5.6 and may not + be respected in the future. If necessary, users can instead + supply a function that calls `erc-button-add-button' when such + an expression is non-nil. CALLBACK is the function to call when the user push this button. CALLBACK can also be a symbol. Its variable value will be used as the callback function. PAR is a number of a regexp grouping whose text will be passed to - CALLBACK. There can be several PAR arguments. If REGEXP is - `nicknames', these are ignored, and CALLBACK will be called with - the nickname matched as the argument." + CALLBACK. There can be several PAR arguments." :package-version '(ERC . "5.6") ; FIXME sync on release :type '(repeat (list :tag "Button" (choice :tag "Matches" regexp (variable :tag "Variable containing regexp") - (const :tag "Nicknames" nicknames)) + (repeat :tag "List of words" string) + (alist :key-type string :value-type sexp)) (integer :tag "Number of the regexp section that matches") (choice :tag "When to buttonize" (const :tag "Always" t) - (sexp :tag "Only when this evaluates to non-nil")) + (function :tag "Alternative buttonizing function") + (variable :tag "Var with value treated as boolean")) (function :tag "Function to call when button is pressed") (repeat :tag "Sections of regexp to send to the function" :inline t @@ -239,15 +247,40 @@ erc-button-syntax-table (defvar erc-button-keys-added nil "Internal variable used to keep track of whether we've added the global-level ERC button keys yet.") +(make-obsolete-variable 'erc-button-keys-added "no longer relevant" "30.1") + +(defvar-local erc-button--has-nickname-entry nil + "Whether `erc-button-alist' contains a legacy `nicknames' entry.") -;; Maybe deprecate this function and `erc-button-keys-added' if they -;; continue to go unused for a another version (currently 5.6). (defun erc-button-setup () - "Add ERC mode-level button movement keys. This is only done once." - ;; Add keys. - (unless erc-button-keys-added - (define-key erc-mode-map (kbd "") #'erc-button-previous) - (setq erc-button-keys-added t))) + "Perform major-mode setup for ERC's button module. +Note that prior to ERC 5.6, this function used to modify +`erc-mode-map', but that's now handled by the mode toggles +themselves." + (setq erc-button-keys-added t) + (cl-assert (derived-mode-p 'erc-mode)) + ;; It would probably suffice to run this in server buffers alone, + ;; even though buttonizing happens in all ERC buffers and users have + ;; been known to set `erc-button-alist' locally. + (dolist (entry erc-button-alist) + (pcase entry + ((or `(nicknames ,_ ,sym . ,_) `('nicknames ,_ ,sym . ,_)) + (setq erc-button--has-nickname-entry t) + (unless (eq sym 'erc-button-buttonize-nicks) + (erc--warn-once-before-connect 'erc-button-mode + "The legacy `nicknames' entry in `erc-button-alist'" + " is deprecated. See doc string for details."))) + ((and `(,_ ,_ ,form . ,_) + (guard (not (or (and (symbolp form) + (special-variable-p form)) + (functionp form))))) + (erc--warn-once-before-connect 'erc-button-mode + "Arbitrary sexps for the third, FORM slot of `erc-button-alist'" + " entries are deprecated. Either use a variable or a function" + " that conditionally calls `erc-button-add-button'."))))) + +(defvar erc-button-nickname-callback-function #'erc-nick-popup + "Escape hatch for those needing a different nickname callback.") (defun erc-button-add-buttons () "Find external references in the current buffer and make buttons of them. @@ -261,6 +294,11 @@ erc-button-add-buttons (alist erc-button-alist) regexp) (erc-button-remove-old-buttons) + (unless (or erc-button--has-nickname-entry + (not erc-button-buttonize-nicks)) + (erc-button-add-nickname-buttons + `(_ _ erc-button--modify-nick-function + ,erc-button-nickname-callback-function))) (dolist (entry alist) (if (or (eq (car entry) 'nicknames) ;; Old form retained for backward compatibility. @@ -284,28 +322,18 @@ erc-button-add-buttons (concat "\\<" (regexp-quote (car elem)) "\\>") entry))))))))))) -(defun erc-button--maybe-warn-arbitrary-sexp (form) - (cl-assert (not (booleanp form))) ; covered by caller +(defun erc-button--extract-form (form) ;; If a special-variable is also a function, favor the function. - (cond ((functionp form) form) - ((and (symbolp form) (special-variable-p form)) (symbol-value form)) - (t (unless (get 'erc-button--maybe-warn-arbitrary-sexp - 'warned-arbitrary-sexp) - (put 'erc-button--maybe-warn-arbitrary-sexp - 'warned-arbitrary-sexp t) - (lwarn 'erc :warning (concat "Arbitrary sexps for the third FORM" - " slot of `erc-button-alist' entries" - " have been deprecated."))) - (eval form t)))) - -(defun erc-button--check-nicknames-entry () - ;; This helper exists because the module is defined after its options. - (when (eq major-mode 'erc-mode) - (unless (eq (nth 1 (alist-get 'nicknames erc-button-alist)) - 'erc-button-buttonize-nicks) - (erc-button--display-error-notice-with-keys-and-warn - "Values other than `erc-button-buttonize-nicks' in the third slot of " - "the `nicknames' entry of `erc-button-alist' are deprecated.")))) + (cond ((eq t form) t) + ((functionp form) form) + ((and (symbolp form) (special-variable-p form)) + (while (let ((val (symbol-value form))) + (prog1 (and (not (eq val form)) + (symbolp val) + (special-variable-p val)) + (setq form val)))) + form) + (t (eval form t)))) (cl-defstruct erc-button--nick ( bounds nil :type cons @@ -405,12 +433,10 @@ erc-button-add-nickname-buttons "Search through the buffer for nicknames, and add buttons." (let ((form (nth 2 entry)) (fun (nth 3 entry)) + (erc-button-buttonize-nicks (and erc-button-buttonize-nicks + erc-button--modify-nick-function)) bounds word) - (when (eq form 'erc-button-buttonize-nicks) - (setq form (and (symbol-value form) erc-button--modify-nick-function))) - (when (or (functionp form) - (eq t form) - (and form (erc-button--maybe-warn-arbitrary-sexp form))) + (when (and form (setq form (erc-button--extract-form form))) (goto-char (point-min)) (while (erc-forward-word) (when (setq bounds (erc-bounds-of-word-at-point)) @@ -456,8 +482,7 @@ erc-button-add-buttons-1 (and-let* ((raw-form (nth 2 entry)) (res (or (eq t raw-form) - (erc-button--maybe-warn-arbitrary-sexp - raw-form)))) + (erc-button--extract-form raw-form)))) (if (functionp res) res #'erc-button-add-button))))) (let ((start (match-beginning (nth 1 entry))) (end (match-end (nth 1 entry))) commit bd969326e96584249b6c140d972f7b27ab3274f6 Author: F. Jason Park Date: Thu Jun 1 22:07:03 2023 -0700 Add alias erc-buffer-do for erc-buffer-filter * lisp/erc/erc-goodies.el (erc-scrolltobottom-enable, erc-scrolltobottom-mode): Prefer `erc-buffer-do' to `erc-buffer-filter'. (erc-move-to-prompt-mode, erc-move-to-prompt-enable): Prefer `erc-buffer-do' to `erc-buffer-filter'. * lisp/erc/erc-imenu.el (erc-imenu-mode, erc-imenu-enable): Prefer `erc-buffer-do' to `erc-buffer-filter'. * lisp/erc/erc-match.el (erc-match-enable, erc-match-mode): Prefer `erc-buffer-do' to `erc-buffer-filter'. * lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable): Prefer `erc-buffer-do' to `erc-buffer-filter'. * lisp/erc/erc.el (erc-buffer-filter): Improve doc string. (erc-buffer-do): Add alias for new code to prefer when calling `erc-buffer-filter' for effect. Do this because continually having to refer back to the doc strings and implementations of the latter as well as `erc-buffer-p', `erc-buffer-list', and co. is unproductive. (erc-buffer-list): Use `always' as fallback predicate. diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 01eae4b63c5..afc05148506 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -53,8 +53,7 @@ scrolltobottom "This mode causes the prompt to stay at the end of the window." ((add-hook 'erc-mode-hook #'erc-add-scroll-to-bottom) (add-hook 'erc-insert-done-hook #'erc-possibly-scroll-to-bottom) - (unless erc--updating-modules-p - (erc-buffer-filter #'erc-add-scroll-to-bottom))) + (unless erc--updating-modules-p (erc-buffer-do #'erc-add-scroll-to-bottom))) ((remove-hook 'erc-mode-hook #'erc-add-scroll-to-bottom) (remove-hook 'erc-insert-done-hook #'erc-possibly-scroll-to-bottom) (dolist (buffer (erc-buffer-list)) @@ -119,8 +118,7 @@ erc-make-read-only (define-erc-module move-to-prompt nil "This mode causes the point to be moved to the prompt when typing text." ((add-hook 'erc-mode-hook #'erc-move-to-prompt-setup) - (unless erc--updating-modules-p - (erc-buffer-filter #'erc-move-to-prompt-setup))) + (unless erc--updating-modules-p (erc-buffer-do #'erc-move-to-prompt-setup))) ((remove-hook 'erc-mode-hook #'erc-move-to-prompt-setup) (dolist (buffer (erc-buffer-list)) (with-current-buffer buffer diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index 9864d7c4042..60df4e9ac8e 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -139,7 +139,7 @@ erc-imenu-setup (define-erc-module imenu nil "Simple Imenu integration for ERC." ((add-hook 'erc-mode-hook #'erc-imenu-setup) - (unless erc--updating-modules-p (erc-buffer-filter #'erc-imenu-setup))) + (unless erc--updating-modules-p (erc-buffer-do #'erc-imenu-setup))) ((remove-hook 'erc-mode-hook #'erc-imenu-setup) (erc-with-all-buffers-of-server nil nil (when erc-imenu--create-index-function diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index 86883260413..0c58524cd9f 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -55,7 +55,7 @@ match ((add-hook 'erc-insert-modify-hook #'erc-match-message 'append) (add-hook 'erc-mode-hook #'erc-match--modify-invisibility-spec) (unless erc--updating-modules-p - (erc-buffer-filter #'erc-match--modify-invisibility-spec)) + (erc-buffer-do #'erc-match--modify-invisibility-spec)) (erc--modify-local-map t "C-c C-k" #'erc-go-to-log-matches-buffer)) ((remove-hook 'erc-insert-modify-hook #'erc-match-message) (remove-hook 'erc-mode-hook #'erc-match--modify-invisibility-spec) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 500f6f3c0c9..78a8b1bc100 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -168,7 +168,7 @@ stamp (add-hook 'erc-mode-hook #'erc-stamp--recover-on-reconnect) (add-hook 'erc--pre-clear-functions #'erc-stamp--reset-on-clear) (unless erc--updating-modules-p - (erc-buffer-filter #'erc-munge-invisibility-spec))) + (erc-buffer-do #'erc-munge-invisibility-spec))) ((remove-hook 'erc-mode-hook #'erc-munge-invisibility-spec) (remove-hook 'erc-insert-modify-hook #'erc-add-timestamp) (remove-hook 'erc-send-modify-hook #'erc-add-timestamp) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 0349dc67dbd..d68d27e76d0 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1830,8 +1830,9 @@ erc--buffer-p (defun erc-buffer-filter (predicate &optional proc) "Return a list of `erc-mode' buffers matching certain criteria. -PREDICATE is a function executed with each buffer, if it returns t, that buffer -is considered a valid match. +Call PREDICATE without arguments in all ERC buffers or only those +belonging to a non-nil PROC. Expect it to return non-nil in +buffers that should be included in the returned list. PROC is either an `erc-server-process', identifying a certain server connection, or nil which means all open connections." @@ -1843,15 +1844,21 @@ erc-buffer-filter (erc--buffer-p buf predicate proc))) (buffer-list))))) +(defalias 'erc-buffer-do 'erc-buffer-filter + "Call FUNCTION in all ERC buffers or only those for PROC. +Expect users to prefer this alias to `erc-buffer-filter' in cases +where the latter would only be called for effect and its return +value thrown away. + +\(fn FUNCTION &optional PROC)") + (defun erc-buffer-list (&optional predicate proc) "Return a list of ERC buffers. PREDICATE is a function which executes with every buffer satisfying the predicate. If PREDICATE is passed as nil, return a list of all ERC buffers. If PROC is given, the buffers local variable `erc-server-process' needs to match PROC." - (unless predicate - (setq predicate (lambda () t))) - (erc-buffer-filter predicate proc)) + (erc-buffer-filter (or predicate #'always) proc)) (define-obsolete-function-alias 'erc-iswitchb #'erc-switch-to-buffer "25.1") (defun erc--switch-to-buffer (&optional arg) commit 0f76bed4928289ff062483738ec8486793df9093 Author: F. Jason Park Date: Fri Jun 9 20:40:59 2023 -0700 ; * lisp/erc/erc.el (erc-send-input-line-function): Doc. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 99505a2355f..0349dc67dbd 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3185,13 +3185,16 @@ erc--called-as-input-p "Non-nil when a user types a \"/slash\" command. Remains bound until `erc-cmd-SLASH' returns.") -(defvar-local erc-send-input-line-function 'erc-send-input-line - "Function for sending lines lacking a leading user command. -When a line typed into a buffer contains an explicit command, like /msg, -a corresponding handler (here, erc-cmd-MSG) is called. But lines typed -into a channel or query buffer already have an implicit target and -command (PRIVMSG). This function is called on such occasions and also -for special purposes (see erc-dcc.el).") +(defvar-local erc-send-input-line-function #'erc-send-input-line + "Function for sending lines lacking a leading \"slash\" command. +When prompt input starts with a \"slash\" command, like \"/MSG\", +ERC calls a corresponding handler, like `erc-cmd-MSG'. But +normal \"chat\" input also needs processing, for example, to +convert it into a proper IRC command. ERC calls this variable's +value to perform that task, which, by default, simply involves +constructing a \"PRIVMSG\" with the current channel or query +partner as the target. Some libraries, like `erc-dcc', use this +for other purposes.") (defun erc-send-input-line (target line &optional force) "Send LINE to TARGET." commit ac80e37783072b310121b7d3b7b0c335f0a6371f Author: F. Jason Park Date: Thu Jun 8 00:40:02 2023 -0700 ; * doc/misc/erc.texi: Fix reconnecting in SOCKS example. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 14c6a457654..e848ed21a50 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -1281,20 +1281,23 @@ Integrations some networks, setting @code{erc-server-connect-function} to @code{socks-open-network-stream} might be enough. Others, like @samp{Libera.Chat}, involve additional setup. At the time of writing, -connecting to @samp{Libera.Chat} requires both @acronym{TLS} and a -non-@samp{PLAIN} @acronym{SASL} mechanism (@pxref{SASL}). One way to -achieve that is by using the @samp{EXTERNAL} mechanism, as shown in -the following example: +connecting to that network requires both @acronym{TLS} and a permitted +@acronym{SASL} mechanism, like @samp{EXTERNAL} (@pxref{SASL}), as +shown in the following example: @lisp (require 'erc) (require 'socks) -(let* ((socks-password "") - (socks-server '("tor" "localhost" 9050 5)) - (erc-modules (cons 'sasl erc-modules)) +(defun my-erc-open-socks-tls-stream (&rest args) + (let ((socks-username "") + (socks-password "") + (socks-server '("tor" "localhost" 9050 5))) + (apply #'erc-open-socks-tls-stream args))) + +(let* ((erc-modules (cons 'sasl erc-modules)) (erc-sasl-mechanism 'external) - (erc-server-connect-function #'erc-open-socks-tls-stream)) + (erc-server-connect-function #'my-erc-open-socks-tls-stream)) (erc-tls :server "libera75jm6of4wxpxt4aynol3xjmbtxgfyjpu34ss4d7r7q2v5zrpyd.onion" :port 6697 @@ -1304,6 +1307,14 @@ Integrations :client-certificate (list "/home/jrh/key.pem" "/home/jrh/cert.pem"))) @end lisp +@noindent +Here, the user-provided @code{my-erc-open-socks-tls-stream} ensures +that the preferred values for @code{socks-server} and friends will be +available when reconnecting. If you plan on using @acronym{SOCKS} +with ERC exclusively, you can just set those options and variables +globally and bind @code{erc-server-connect-function} to +@code{erc-open-socks-tls-stream} instead. + @node auth-source @subsection auth-source @cindex auth-source commit a4df74832959f2f11d4dd52a39781ccc8d86550d Author: F. Jason Park Date: Thu Jun 1 23:18:56 2023 -0700 Prefer emacs-news-mode in etc/ERC-NEWS * etc/ERC-NEWS: Remove `outline' from prop line and prefer `emacs-news-mode' in local variables list. * lisp/erc/erc.el (erc-news): Overwrite cached file and ask before re-fetching. diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index e9ec9e2caab..5753120107a 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -1,4 +1,4 @@ -ERC NEWS -*- outline -*- +ERC NEWS Copyright (C) 2006-2023 Free Software Foundation, Inc. See the end of the file for license conditions. @@ -1926,5 +1926,6 @@ along with GNU Emacs. If not, see . Local variables: coding: utf-8 mode: outline +mode: emacs-news paragraph-separate: "[ ]*$" end: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 2c2df81fa6d..99505a2355f 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -7458,8 +7458,9 @@ erc-news contain more up-to-date information, even for older versions." (interactive "P") (find-file - (or (and arg erc--news-temp-file + (or (and erc--news-temp-file (time-less-p (current-time) (car erc--news-temp-file)) + (not (and arg (y-or-n-p (format "Re-fetch? ")))) (cdr erc--news-temp-file)) (and arg (with-current-buffer (url-retrieve-synchronously erc--news-url) @@ -7467,7 +7468,10 @@ erc-news (search-forward "200 OK" (pos-eol)) (search-forward "\n\n") (delete-region (point-min) (point)) - (let ((tempfile (make-temp-file "erc-news."))) + ;; May warn about file having changed on disk (unless + ;; `query-about-changed-file' is nil on 28+). + (let ((tempfile (or (cdr erc--news-temp-file) + (make-temp-file "erc-news.")))) (write-region (point-min) (point-max) tempfile) (kill-buffer) (cdr (setq erc--news-temp-file @@ -7482,13 +7486,12 @@ erc-news (expand-file-name "ERC-NEWS" data-directory))) (when (fboundp 'emacs-news-view-mode) (emacs-news-view-mode)) + (goto-char (point-min)) (let ((v (mapcar #'number-to-string (seq-take-while #'natnump (version-to-list erc-version))))) - (while (and v - (goto-char (point-min)) - (not (search-forward (concat "\014\n* Changes in ERC " - (string-join v ".")) - nil t))) + (while (and v (not (search-forward (concat "\014\n* Changes in ERC " + (string-join v ".")) + nil t))) (setq v (butlast v)))) (beginning-of-line)) commit b6d48190609be84a9e456929a51b778474261937 Author: Michael Albinus Date: Sun Jun 11 20:34:11 2023 +0200 Adapt emba integration * test/infra/Makefile.in (subdir_template): Special handling of lib-src. * test/infra/test-jobs.yml: Regenerate. diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index 5f7d6281a7c..fff7281b566 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -41,7 +41,11 @@ define subdir_template SUBDIR_TARGETS += $(target) $(eval - ifeq ($(findstring src, $(1)), src) + ifeq ($(findstring lib-src, $(1)), lib-src) + define changes + @echo ' - $(1)/*.{h,c}' >>$(FILE) + endef + else ifeq ($(findstring src, $(1)), src) define changes @echo ' - $(1)/treesit.{h,c}' >>$(FILE) @echo ' - test/$(1)/treesit-tests.el' >>$(FILE) diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index b49dd369611..2f6e0dab4d5 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml @@ -9,10 +9,6 @@ test-lib-src-inotify: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - - changes: - - lib-src/treesit.{h,c} - - test/lib-src/treesit-tests.el - when: never - changes: - lib-src/*.{h,c} - test/lib-src/*resources/** commit 4256123c4673d8b13f9acd6b0e06a80d258f140a Author: Michael Albinus Date: Sun Jun 11 20:33:34 2023 +0200 Fix tramp-sshfs * lisp/net/tramp-fuse.el (tramp-fuse-handle-file-exists-p): New defun. (tramp-fuse-mount-timeout): Move up. (tramp-fuse-mount-point): Use `tramp-fuse-mount-timeout'. (tramp-fuse-unmount): Flush "mount-point" file property. * lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist): Use `tramp-fuse-handle-file-exists-p'. * test/lisp/net/tramp-tests.el (all): Use function read syntax where appropriate. (tramp-test39-detect-external-change): Let-bind `read-from-minibuffer' instead of `yes-or-no-p'. diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el index 8626610211a..99360c2c28e 100644 --- a/lisp/net/tramp-fuse.el +++ b/lisp/net/tramp-fuse.el @@ -95,6 +95,11 @@ tramp-fuse-handle-file-executable-p (with-tramp-file-property v localname "file-executable-p" (file-executable-p (tramp-fuse-local-file-name filename))))) +(defun tramp-fuse-handle-file-exists-p (filename) + "Like `file-exists-p' for Tramp files." + (tramp-skeleton-file-exists-p filename + (file-exists-p (tramp-fuse-local-file-name filename)))) + (defun tramp-fuse-handle-file-name-all-completions (filename directory) "Like `file-name-all-completions' for Tramp files." (tramp-fuse-remove-hidden-files @@ -139,24 +144,24 @@ tramp-fuse-mount-spec (format "%s@%s:/" user host) (format "%s:/" host))) -(defun tramp-fuse-mount-point (vec) - "Return local mount point of VEC." - (or (tramp-get-file-property vec "/" "mount-point") - (expand-file-name - (concat - tramp-temp-name-prefix - (tramp-file-name-method vec) "." - (when (tramp-file-name-user vec) - (concat (tramp-file-name-user-domain vec) "@")) - (tramp-file-name-host-port vec)) - (or small-temporary-file-directory - tramp-compat-temporary-file-directory)))) - (defconst tramp-fuse-mount-timeout (eval (car (get 'remote-file-name-inhibit-cache 'standard-value)) t) "Time period to check whether the mount point still exists. It has the same meaning as `remote-file-name-inhibit-cache'.") +(defun tramp-fuse-mount-point (vec) + "Return local mount point of VEC." + (let ((remote-file-name-inhibit-cache tramp-fuse-mount-timeout)) + (or (tramp-get-file-property vec "/" "mount-point") + (expand-file-name + (concat + tramp-temp-name-prefix + (tramp-file-name-method vec) "." + (when (tramp-file-name-user vec) + (concat (tramp-file-name-user-domain vec) "@")) + (tramp-file-name-host-port vec)) + tramp-compat-temporary-file-directory)))) + (defun tramp-fuse-mounted-p (vec) "Check, whether fuse volume determined by VEC is mounted." ;; Remember the mount status by using a file property on "/", @@ -198,6 +203,7 @@ tramp-fuse-unmount (command (format "%s -u %s" (tramp-fuse-get-fusermount) mount-point))) (tramp-message vec 6 "%s\n%s" command (shell-command-to-string command)) (tramp-flush-file-property vec "/" "mounted") + (tramp-flush-file-property vec "/" "mount-point") (setq tramp-fuse-mount-points (delete (tramp-file-name-unify vec) tramp-fuse-mount-points)) ;; Give the caches a chance to expire. diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index 9d871276f7a..e3c9e0b53b2 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -100,7 +100,7 @@ tramp-sshfs-file-name-handler-alist (file-directory-p . tramp-handle-file-directory-p) (file-equal-p . tramp-handle-file-equal-p) (file-executable-p . tramp-fuse-handle-file-executable-p) - (file-exists-p . tramp-handle-file-exists-p) + (file-exists-p . tramp-fuse-handle-file-exists-p) (file-group-gid . tramp-handle-file-group-gid) (file-in-directory-p . tramp-handle-file-in-directory-p) (file-local-copy . tramp-handle-file-local-copy) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 017cb73f3bb..0b01c13470a 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2559,7 +2559,7 @@ tramp-test10-write-region ;; Do not overwrite if excluded. (cl-letf (((symbol-function #'y-or-n-p) #'tramp-compat-always) ;; Ange-FTP. - ((symbol-function 'yes-or-no-p) #'tramp-compat-always)) + ((symbol-function #'yes-or-no-p) #'tramp-compat-always)) (write-region "foo" nil tmp-name nil nil nil 'mustbenew)) (should-error (cl-letf (((symbol-function #'y-or-n-p) #'ignore) @@ -6737,8 +6737,9 @@ tramp-test39-detect-external-change (insert "foo") ;; Bug#53207: with `create-lockfiles' nil, saving the ;; buffer results in a prompt. - (cl-letf (((symbol-function 'yes-or-no-p) - (lambda (_) (ert-fail "Test failed unexpectedly")))) + (cl-letf (((symbol-function #'read-from-minibuffer) + (lambda (&rest _) + (ert-fail "Test failed unexpectedly")))) (should (buffer-modified-p)) (save-buffer) (should-not (buffer-modified-p))) @@ -6756,7 +6757,7 @@ tramp-test39-detect-external-change ;; modification time properly, for them it doesn't ;; make sense to test. (when (not (verify-visited-file-modtime)) - (cl-letf (((symbol-function 'read-char-choice) + (cl-letf (((symbol-function #'read-char-choice) (lambda (prompt &rest _) (message "%s" prompt) ?y))) (ert-with-message-capture captured-messages (insert "bar") @@ -6772,9 +6773,9 @@ tramp-test39-detect-external-change (should (file-locked-p tmp-name))))) ;; `save-buffer' removes the file lock. - (cl-letf (((symbol-function 'yes-or-no-p) + (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always) - ((symbol-function 'read-char-choice) + ((symbol-function #'read-char-choice) (lambda (&rest _) ?y))) (should (buffer-modified-p)) (save-buffer) commit bdb0bc2b4e44a7d40369e10e3de825d58fe46825 Author: Eli Zaretskii Date: Sun Jun 11 09:15:01 2023 +0300 Fix tex-mode display-buffer issues * lisp/window.el (display-tex-shell-buffer-action): New defcustom. * lisp/textmodes/tex-mode.el (tex-display-shell) (tex-cmd-doc-view, tex-recenter-output-buffer): Use it. (Bug#63956) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index fcb01fb6c08..44984697e70 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2025,7 +2025,7 @@ tex-feed-input (defun tex-display-shell () "Make the TeX shell buffer visible in a window." - (display-buffer (tex-shell-buf) display-comint-buffer-action) + (display-buffer (tex-shell-buf) display-tex-shell-buffer-action) (tex-recenter-output-buffer nil)) (defun tex-shell-sentinel (proc _msg) @@ -2426,7 +2426,7 @@ tex-compile-default (if cmds (tex-format-cmd (caar cmds) fspec)))))) (defun tex-cmd-doc-view (file) - (pop-to-buffer (find-file-noselect file) display-comint-buffer-action)) + (pop-to-buffer (find-file-noselect file) display-tex-shell-buffer-action)) (defun tex-compile (dir cmd) "Run a command CMD on current TeX buffer's file in DIR." @@ -2681,7 +2681,7 @@ tex-recenter-output-buffer (window)) (if (null tex-shell) (message "No TeX output buffer") - (setq window (display-buffer tex-shell display-comint-buffer-action)) + (setq window (display-buffer tex-shell display-tex-shell-buffer-action)) (with-selected-window window (bury-buffer tex-shell) (goto-char (point-max)) diff --git a/lisp/window.el b/lisp/window.el index a11b1a51f8f..78b0787abdb 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8776,6 +8776,14 @@ display-comint-buffer-action :group 'windows :group 'comint) +(defcustom display-tex-shell-buffer-action 'display-buffer-in-previous-window + "`display-buffer' action for displaying TeX shell buffers." + :type display-buffer--action-custom-type + :risky t + :version "29.1" + :group 'windows + :group 'tex-run) + (defun read-buffer-to-switch (prompt) "Read the name of a buffer to switch to, prompting with PROMPT. Return the name of the buffer as a string. commit 90047c38ce98af4ac7d0fa9d59ba0d668e4ae902 Author: Morgan J. Smith Date: Tue Jun 6 15:02:57 2023 -0400 Add test for when 'completion-auto-help' is 'visible' * test/lisp/minibuffer-tests.el (completion-auto-help-test): Add test for when 'completion-auto-help' is 'visible'. Also test for successful completion message. (Bug#63913) diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 1de8e56cbd4..a67fc555772 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -353,12 +353,23 @@ completion-auto-help-test '("a" "ab" "ac") (execute-kbd-macro (kbd "a TAB TAB")) (should (equal (car messages) "Complete, but not unique")) - (should-not (get-buffer-window "*Completions*" 0)))) + (should-not (get-buffer-window "*Completions*" 0)) + (execute-kbd-macro (kbd "b TAB")) + (should (equal (car messages) "Sole completion")))) (let ((completion-auto-help t)) (completing-read-with-minibuffer-setup '("a" "ab" "ac") (execute-kbd-macro (kbd "a TAB TAB")) - (should (get-buffer-window "*Completions*" 0))))))) + (should (get-buffer-window "*Completions*" 0)) + (execute-kbd-macro (kbd "b TAB")) + (should (equal (car messages) "Sole completion")))) + (let ((completion-auto-help 'visible)) + (completing-read-with-minibuffer-setup + '("a" "ab" "ac" "achoo") + (execute-kbd-macro (kbd "a TAB TAB")) + (should (get-buffer-window "*Completions*" 0)) + (execute-kbd-macro (kbd "ch TAB")) + (should (equal (car messages) "Sole completion"))))))) (ert-deftest completion-auto-select-test () (let ((completion-auto-select t)) commit 2c623e4feb9e141715a4959655f894c335ca3668 Author: Eli Zaretskii Date: Sat Jun 10 20:48:21 2023 +0300 Avoid errors in 'apropos-documentation' after 'eval-buffer' * lisp/apropos.el (apropos--map-preloaded-atoms): Support the case where an element of 'load-history' has nil as its car. (Bug#63881) diff --git a/lisp/apropos.el b/lisp/apropos.el index 5d7fe6962a5..c9551b06529 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -900,7 +900,8 @@ apropos--map-preloaded-atoms ;; state of the `obarray' when we dumped, which we may also be able to ;; use in `bytecomp' to provide a clean initial environment?) (dolist (x load-history) - (when (string-match preloaded-regexp (car x)) + (when (let ((elt (car x))) + (and (stringp elt) (string-match preloaded-regexp elt))) (dolist (def (cdr x)) (cond ((symbolp def) (funcall f def)) commit dd3b98121cc820f3f151ffc3875b8b6cd5f9c2dc Author: Eli Zaretskii Date: Sat Jun 10 14:16:22 2023 +0300 ; * doc/emacs/indent.texi (Indentation Commands): Fix last change. diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi index 2fe632b822b..17b663d22e1 100644 --- a/doc/emacs/indent.texi +++ b/doc/emacs/indent.texi @@ -130,7 +130,7 @@ Indentation Commands Indent all lines that begin in the region, moving the affected lines as a rigid unit (@code{indent-rigidly}). -If called with no argument, the command activates a transient mode for +If called with no argument, this command activates a transient mode for adjusting the indentation of the affected lines interactively. While this transient mode is active, typing @kbd{@key{LEFT}} or @kbd{@key{RIGHT}} indents leftward and rightward, respectively, by one commit 904edf1f076b3ccc69b545b812df32d546b79bea Author: Daniel Martín Date: Sat Jun 10 12:36:53 2023 +0200 Mention indent-rigidly in the Emacs manual * doc/emacs/indent.texi (Indentation Commands): Rewrite the first sentence of 'C-x TAB' to mention the command that it executes, and without using passive voice. (Bug#63997) diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi index 95ad726828d..2fe632b822b 100644 --- a/doc/emacs/indent.texi +++ b/doc/emacs/indent.texi @@ -127,8 +127,8 @@ Indentation Commands @kindex C-x TAB @findex indent-rigidly @cindex remove indentation -This command is used to change the indentation of all lines that begin -in the region, moving the affected lines as a rigid unit. +Indent all lines that begin in the region, moving the affected lines +as a rigid unit (@code{indent-rigidly}). If called with no argument, the command activates a transient mode for adjusting the indentation of the affected lines interactively. While commit acfd261a61a5bdc00f714aeec74635ac9ef87457 Merge: c777779bf24 0d8b69e0ad3 Author: Eli Zaretskii Date: Sat Jun 10 06:42:43 2023 -0400 Merge from origin/emacs-29 0d8b69e0ad3 Don't ding when completion succeeded f11e2d36999 ; * admin/git-bisect-start: Update failing commits 9855a3ea744 ; * src/xdisp.c (redisplay_tool_bar): Fix a typo in a com... f4ee696b887 Improve documentation of color-related functions 90eadc3e234 Revert "* package.el (package--get-activatable-pkg): Pref... 65f355ea0a3 ; Update my mail address a3a69ec2342 Fix connection-local user options handling (bug#63300) 240803cc3e1 Document 'startup-redirect-eln-cache' 026afb22984 ; * etc/PROBLEMS: Entry about crashes due to anti-virus (... bcc222251e1 Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#5... 07c8211ca30 Add 'infer' as a keyword to typescript-ts-mode (bug#63880) dd2d8ff2f5c ; * etc/NEWS: Mention the issue with PGTK on WSL (bug#633... fa8135f8916 Revert changes to the order in which package descs are lo... 27fcfa2c0a7 ; * etc/NEWS: Improve instructions for grammar libraries. 2a84ab905c8 Handle point in last file-name component in minibuffer co... 05f25238b7b Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 4bc043ff45d Avoid asking redundant question in emacsbug.el 2eadf328d05 * test/infra/Dockerfile.emba (emacs-base): Don't install ... 583ba1db7ee typescript-ts-mode: Add a rule for function_signature # Conflicts: # etc/NEWS # lisp/minibuffer.el commit c777779bf24507e4bf55cfff77e2cc31d8d25ef3 Merge: 3de8ed09ab4 a3459a28e41 Author: Eli Zaretskii Date: Sat Jun 10 06:36:58 2023 -0400 ; Merge from origin/emacs-29 The following commit was skipped: a3459a28e41 * admin/unidata/emoji-zwj.awk: Avoid sprint buffer overflow commit 0d8b69e0ad37fe2d801e16a0ccafd8759dd33d02 Author: Morgan J. Smith Date: Mon Jun 5 13:34:59 2023 -0400 Don't ding when completion succeeded * lisp/minibuffer.el (minibuffer-completion-help): Ensure 'ding' is not called on a successful completion. Ensure 'ding' is not called on a failure if 'completion-fail-discreetly' is set. Also change "No completions" to "No match" as that is what is used elsewhere. (Bug#63913) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index a873e5f9747..44226449af2 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2388,9 +2388,11 @@ minibuffer-completion-help ;; If there are no completions, or if the current input is already ;; the sole completion, then hide (previous&stale) completions. (minibuffer-hide-completions) - (ding) - (completion--message - (if completions "Sole completion" "No completions"))) + (if completions + (completion--message "Sole completion") + (unless completion-fail-discreetly + (ding) + (completion--message "No match")))) (let* ((last (last completions)) (base-size (or (cdr last) 0)) commit f11e2d369995ffc514005578857e5b7819e779eb Author: Gregory Heytings Date: Sat Jun 10 08:50:47 2023 +0000 ; * admin/git-bisect-start: Update failing commits diff --git a/admin/git-bisect-start b/admin/git-bisect-start index cae9c7918a8..f4ffb8f33b6 100755 --- a/admin/git-bisect-start +++ b/admin/git-bisect-start @@ -82,7 +82,7 @@ done # SKIP-BRANCH 58cc931e92ece70c3e64131ee12a799d65409100 ## The list below is the exhaustive list of all commits between Dec 1 -## 2016 and Apr 30 2023 on which building Emacs with the default +## 2016 and Jun 8 2023 on which building Emacs with the default ## options, on a GNU/Linux computer and with GCC, fails. It is ## possible (though unlikely) that building Emacs with non-default ## options, with other compilers, or on other platforms, would succeed @@ -1723,3 +1723,15 @@ $REAL_GIT bisect skip $(cat $0 | grep '^# SKIP-SINGLE ' | sed 's/^# SKIP-SINGLE # SKIP-SINGLE 9686b015a0d71d08828afb0cfe6e477bbc4909ae # SKIP-SINGLE 621e732ade0f3dc165498ebde4d55d5aacb05b56 # SKIP-SINGLE 200dbf7d302e659e618f74bde81c7b3ccd795639 +# SKIP-SINGLE 03663b8798a06bf18ff1e235ac0fb87870f8fe77 +# SKIP-SINGLE 4897c98b6c496801aad2477c289a40a300eee27f +# SKIP-SINGLE e6585e0be2efc3f2eaec7210b036169fbdffa9ce +# SKIP-SINGLE 8ec786349e18068bff39b1387bc4a88d62265e34 +# SKIP-SINGLE 0eba9cf65119a68596c4bf3689086a517d51ce72 +# SKIP-SINGLE ede3535051a8f3b209b830adcaba9cb1ddf58685 +# SKIP-SINGLE 2f94f6de9d64f9fd89284dac171e166e7d721dcd +# SKIP-SINGLE ab5258b19255ebff04df01d6f55888f43c42dcb9 +# SKIP-SINGLE dc7acb1aafe9b0b84481ac51a5bd5125d263537e +# SKIP-SINGLE 348e4504c6d5588443809ec28da3c3c693368e16 +# SKIP-SINGLE 970f94a2dd8bc4be4d71f1075421093ca6f87d28 +# SKIP-SINGLE 6b2c8dc9050c5c0514fa404733ce1d4a37d00e39 commit 3de8ed09ab46b9922e15aaf0cc8884b41087c996 Author: Eli Zaretskii Date: Sat Jun 10 11:48:37 2023 +0300 Avoid infinite recursion in 'window_wants_header_line' * src/window.c (null_header_line_format): Avoid infinite recursion by disallowing :eval on recursive calls. (Bug#63988) diff --git a/src/window.c b/src/window.c index 3802efb992a..e22fea0bb7a 100644 --- a/src/window.c +++ b/src/window.c @@ -5470,6 +5470,7 @@ window_wants_mode_line (struct window *w) && WINDOW_PIXEL_HEIGHT (w) > WINDOW_FRAME_LINE_HEIGHT (w)); } +static int header_line_eval_called = 0; /** * null_header_line_format: @@ -5497,9 +5498,18 @@ null_header_line_format (Lisp_Object fmt, struct frame *f) { if (EQ (car, QCeval)) { + if (header_line_eval_called > 0) + return false; + eassert (header_line_eval_called == 0); + header_line_eval_called++; val = safe_eval_inhibit_quit (XCAR (XCDR (fmt))); + header_line_eval_called--; + eassert (header_line_eval_called == 0); if (!FRAME_LIVE_P (f)) - signal_error (":eval deleted the frame being displayed", fmt); + { + header_line_eval_called = 0; + signal_error (":eval deleted the frame being displayed", fmt); + } return NILP (val); } val = find_symbol_value (car); commit 9855a3ea7447b6045407ff55ad2c448d1302bcce Author: Eli Zaretskii Date: Fri Jun 9 19:19:07 2023 +0300 ; * src/xdisp.c (redisplay_tool_bar): Fix a typo in a comment. diff --git a/src/xdisp.c b/src/xdisp.c index 2ddfdf0d51b..c9b488b7fb2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15346,7 +15346,7 @@ redisplay_tool_bar (struct frame *f) 0, 0, 0, STRING_MULTIBYTE (f->desired_tool_bar_string)); /* FIXME: This should be controlled by a user option. But it doesn't make sense to have an R2L tool bar if the menu bar cannot - be drawn also R2L, and making the menu bar R2L is tricky due + be drawn also R2L, and making the menu bar R2L is tricky due to toolkit-specific code that implements it. If an R2L tool bar is ever supported, display_tool_bar_line should also be augmented to call unproduce_glyphs like display_line and display_string commit f4ee696b887ca9f0ebf3685817f9b9cfbfc49b99 Author: Eli Zaretskii Date: Fri Jun 9 10:28:36 2023 +0300 Improve documentation of color-related functions * doc/lispref/frames.texi (Color Names): Document 'color-name-to-rgb' and 'color-dark-p'. diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index c78ab1c34ba..a8ac9a214f6 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -4518,6 +4518,20 @@ Color Names and that name is still supported as an alias. @end defun +@defun color-name-to-rgb color &optional frame +This function does the same as @code{color-values}, but it returns +color values as floating-point numbers between 0.0 and 1.0 inclusive. +@end defun + +@defun color-dark-p rgb +This function returns non-@code{nil} if the color described by its RGB +triplet @var{rgb} is more readable against white background than +against dark background. The argument @var{rgb} should be a list of +the form @w{@code{(@var{r} @var{g} @var{b})}}, with each component a +floating-point number in the range 0.0 to 1.0 inclusive. You can use +@code{color-name-to-rgb} to convert a color's name to such a list. +@end defun + @node Text Terminal Colors @section Text Terminal Colors @cindex colors on text terminals commit 3c01060c02359e5b813979b7b950bf904c87dcfa Author: João Távora Date: Fri Jun 9 02:11:38 2023 +0100 ; Eglot: simplify last change to eglot-unregister-capability * lisp/progmodes/eglot.el (eglot-unregister-capability): Simplify. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index c5a58d7ace6..7d5d786dea3 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3586,11 +3586,10 @@ eglot-unregister-capability (server (_method (eql workspace/didChangeWatchedFiles)) id) "Handle dynamic unregistration of workspace/didChangeWatchedFiles." (maphash (lambda (dir watch-and-ids) - (when (member id (cdr watch-and-ids)) - (setcdr watch-and-ids (delete id (cdr watch-and-ids))) - (when (null (cdr watch-and-ids)) - (file-notify-rm-watch (car watch-and-ids)) - (remhash dir (eglot--file-watches server))))) + (setcdr watch-and-ids (delete id (cdr watch-and-ids))) + (when (null (cdr watch-and-ids)) + (file-notify-rm-watch (car watch-and-ids)) + (remhash dir (eglot--file-watches server)))) (eglot--file-watches server)) (list t "OK")) commit c9c0d1cf7f6ab6bbd93941c23304a25b81b29fd5 Author: Mattias Engdegård Date: Thu Jun 8 13:05:13 2023 +0200 ; fix important-return-value-fns mistake * lisp/emacs-lisp/bytecomp.el (important-return-value-fns): Remove assoc-string; it's already side-effect-free. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 2646a588b92..4cf244aedbf 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3560,7 +3560,7 @@ byte-compile-form ;; These functions are side-effect-free except for the ;; behaviour of functions passed as argument. mapcar mapcan mapconcat - assoc assoc-string plist-get plist-member + assoc plist-get plist-member ;; It's safe to ignore the value of `sort' and `nreverse' ;; when used on arrays, but most calls pass lists. commit 0d411a0a6df83168c4f9bfed40803de7ec79ef14 Author: Mattias Engdegård Date: Thu Jun 8 11:50:44 2023 +0200 Remove special fset byte-compilation warning * lisp/emacs-lisp/bytecomp.el (fset, byte-compile-fset): Remove special warning for fset, subsumed by the more general quoted lambda funarg warning. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 384a357ee51..2646a588b92 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3962,6 +3962,7 @@ memq (byte-defop-compiler cons 2) (byte-defop-compiler aref 2) (byte-defop-compiler set 2) +(byte-defop-compiler fset 2) (byte-defop-compiler (= byte-eqlsign) 2-cmp) (byte-defop-compiler (< byte-lss) 2-cmp) (byte-defop-compiler (> byte-gtr) 2-cmp) @@ -4226,7 +4227,6 @@ backward-char (byte-defop-compiler backward-word) (byte-defop-compiler list) (byte-defop-compiler concat) -(byte-defop-compiler fset) (byte-defop-compiler (indent-to-column byte-indent-to) byte-compile-indent-to) (byte-defop-compiler indent-to) (byte-defop-compiler insert) @@ -4323,26 +4323,6 @@ byte-compile-nconc (byte-compile-form (car form)) (byte-compile-out 'byte-nconc 0)))))) -(defun byte-compile-fset (form) - ;; warn about forms like (fset 'foo '(lambda () ...)) - ;; (where the lambda expression is non-trivial...) - (let ((fn (nth 2 form)) - body) - (if (and (eq (car-safe fn) 'quote) - (eq (car-safe (setq fn (nth 1 fn))) 'lambda)) - (progn - (setq body (cdr (cdr fn))) - (if (stringp (car body)) (setq body (cdr body))) - (if (eq 'interactive (car-safe (car body))) (setq body (cdr body))) - (if (and (consp (car body)) - (not (eq 'byte-code (car (car body))))) - (byte-compile-warn-x - (nth 2 form) - "A quoted lambda form is the second argument of `fset'. This is probably - not what you want, as that lambda cannot be compiled. Consider using - the syntax #'(lambda (...) ...) instead."))))) - (byte-compile-two-args form)) - ;; (function foo) must compile like 'foo, not like (symbol-function 'foo). ;; Otherwise it will be incompatible with the interpreter, ;; and (funcall (function foo)) will lose with autoloads. commit 976cb7e0e6561e10cebcf89c861b8f9f0e2934cb Author: João Távora Date: Thu Jun 8 13:12:49 2023 +0100 Eglot: also add watches for newly created directories GitHub-reference: https://github.com/joaotavora/eglot/pull/1228 GitHub-reference: https://github.com/joaotavora/eglot/discussions/1226 * lisp/progmodes/eglot.el (eglot-register-capability): Rework. Suggested by: https://github.com/thejeffphil diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index c171cc2597a..c5a58d7ace6 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3543,8 +3543,7 @@ eglot-register-capability (project-files (eglot--project server)))))) (cl-labels - ((handle-event - (event) + ((handle-event (event) (pcase-let* ((`(,desc ,action ,file ,file1) event) (action-type (cl-case action (created 1) (changed 2) (deleted 3))) @@ -3558,19 +3557,24 @@ eglot-register-capability (jsonrpc-notify server :workspace/didChangeWatchedFiles `(:changes ,(vector `(:uri ,(eglot--path-to-uri file) - :type ,action-type))))) + :type ,action-type)))) + (when (and (eq action 'created) + (file-directory-p file)) + (watch-dir file))) ((eq action 'renamed) (handle-event `(,desc 'deleted ,file)) - (handle-event `(,desc 'created ,file1))))))) + (handle-event `(,desc 'created ,file1)))))) + (watch-dir (dir) + (when-let ((probe + (and (file-readable-p dir) + (or (gethash dir (eglot--file-watches server)) + (puthash dir (list (file-notify-add-watch + dir '(change) #'handle-event)) + (eglot--file-watches server)))))) + (push id (cdr probe))))) (unwind-protect (progn - (cl-loop for dir in dirs-to-watch - for probe = - (and (file-readable-p dir) - (or (gethash dir (eglot--file-watches server)) - (puthash dir (list (file-notify-add-watch dir '(change) #'handle-event)) - (eglot--file-watches server)))) - when probe do (push id (cdr probe))) + (mapc #'watch-dir dirs-to-watch) (setq success `(:message ,(format "OK, watching %s directories in %s watchers" commit 433a452814fb9eb443819d5a21324364d2600116 Author: João Távora Date: Thu Jun 8 02:19:06 2023 +0100 Eglot: try reuse file watchers when server over-watches GitHub-reference: https://github.com/joaotavora/eglot/pull/1228 GitHub-reference: https://github.com/joaotavora/eglot/discussions/1226 The Pyright language server issues very heavy file watching requests, which sometimes exceed the OS limit. Most of these file watches are useless, but Pyright insists on issuing them. What's more, for some (absurd?) reason, Pyright issues two file watching requests for the _same_ directories, only to then almost immediately ask to undo the effects of one of these requests. This change to Eglot makes it so that if a single server requests to watch a specific directory twice, only one file watch object is used. Suggested by: https://github.com/thejeffphil * lisp/progmodes/eglot.el (eglot-lsp-server): Change structure of file-watches field. (eglot--on-shutdown): Adapt to new structure. (eglot-register-capability): Rework. (eglot-unregister-capability): Rework. * etc/EGLOT-NEWS: Mention change diff --git a/etc/EGLOT-NEWS b/etc/EGLOT-NEWS index 569481a8dc1..6a2e9051ddc 100644 --- a/etc/EGLOT-NEWS +++ b/etc/EGLOT-NEWS @@ -17,6 +17,16 @@ This refers to https://github.com/joaotavora/eglot/issues/. That is, to look up issue github#1234, go to https://github.com/joaotavora/eglot/issues/1234. + +* Changes in upcoming Eglot + +** Optimized file-watching capability + +Some servers, like the Pyright language server, issue too many file +watching requests. This change slightly reduces the number of file +watcher objects requested from the operating system, which can be a +problem, particularly on Mac OS. See github#1228 and github#1226. + * Changes in Eglot 1.15 (29/4/2023) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 0140db0c4b3..c171cc2597a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -888,7 +888,7 @@ eglot-lsp-server :documentation "Generalized boolean inhibiting auto-reconnection if true." :accessor eglot--inhibit-autoreconnect) (file-watches - :documentation "Map ID to list of WATCHES for `didChangeWatchedFiles'." + :documentation "Map (DIR -> (WATCH ID1 ID2...)) for `didChangeWatchedFiles'." :initform (make-hash-table :test #'equal) :accessor eglot--file-watches) (managed-buffers :documentation "List of buffers managed by server." @@ -959,8 +959,8 @@ eglot--on-shutdown (eglot-autoshutdown nil)) (eglot--when-live-buffer buffer (eglot--managed-mode-off)))) ;; Kill any expensive watches - (maphash (lambda (_id watches) - (mapcar #'file-notify-rm-watch watches)) + (maphash (lambda (_dir watch-and-ids) + (file-notify-rm-watch (car watch-and-ids))) (eglot--file-watches server)) ;; Kill any autostarted inferior processes (when-let (proc (eglot--inferior-process server)) @@ -3564,10 +3564,13 @@ eglot-register-capability (handle-event `(,desc 'created ,file1))))))) (unwind-protect (progn - (dolist (dir dirs-to-watch) - (when (file-readable-p dir) - (push (file-notify-add-watch dir '(change) #'handle-event) - (gethash id (eglot--file-watches server))))) + (cl-loop for dir in dirs-to-watch + for probe = + (and (file-readable-p dir) + (or (gethash dir (eglot--file-watches server)) + (puthash dir (list (file-notify-add-watch dir '(change) #'handle-event)) + (eglot--file-watches server)))) + when probe do (push id (cdr probe))) (setq success `(:message ,(format "OK, watching %s directories in %s watchers" @@ -3578,8 +3581,13 @@ eglot-register-capability (cl-defmethod eglot-unregister-capability (server (_method (eql workspace/didChangeWatchedFiles)) id) "Handle dynamic unregistration of workspace/didChangeWatchedFiles." - (mapc #'file-notify-rm-watch (gethash id (eglot--file-watches server))) - (remhash id (eglot--file-watches server)) + (maphash (lambda (dir watch-and-ids) + (when (member id (cdr watch-and-ids)) + (setcdr watch-and-ids (delete id (cdr watch-and-ids))) + (when (null (cdr watch-and-ids)) + (file-notify-rm-watch (car watch-and-ids)) + (remhash dir (eglot--file-watches server))))) + (eglot--file-watches server)) (list t "OK")) commit 46b6d175054e8f6bf7cb45e112048c0cf02bfee9 Author: Amritpal Singh Date: Fri Jun 2 10:51:21 2023 +0530 Support files compressed by 'pigz' * src/decompress.c (md5_gz_stream): Check 'stream.avail_in' as well. (Bug#63832) Copyright-paperwork-exempt: yes diff --git a/src/decompress.c b/src/decompress.c index 6ef17db07d6..162f6167b73 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -151,7 +151,7 @@ md5_gz_stream (FILE *source, void *resblock) return -1; accumulate_and_process_md5 (out, MD5_BLOCKSIZE - stream.avail_out, &ctx); - } while (!stream.avail_out); + } while (stream.avail_in && !stream.avail_out); } while (res != Z_STREAM_END); commit 90eadc3e2349c155a14aedb6cf09d9c571d8e698 Author: Eli Zaretskii Date: Thu Jun 8 12:23:11 2023 +0300 Revert "* package.el (package--get-activatable-pkg): Prefer source packages" This reverts commit fb87d5008e21d1bc03547c1edf2280fb4cb8311e. It caused problems when new versions of packages are installed without deleting old versions. (Bug#63757) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 43368b59522..3e6acd9b388 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -924,22 +924,14 @@ package-activate-1 (defun package--get-activatable-pkg (pkg-name) ;; Is "activatable" a word? - (let ((pkg-descs (sort (cdr (assq pkg-name package-alist)) - (lambda (p1 p2) - (let ((v1 (package-desc-version p1)) - (v2 (package-desc-version p2))) - (or - ;; Prefer VC packages. - (package-vc-p p1) - (package-vc-p p2) - ;; Prefer builtin packages. - (package-disabled-p p1 v1) - (not (package-disabled-p p2 v2)))))))) + (let ((pkg-descs (cdr (assq pkg-name package-alist)))) ;; Check if PACKAGE is available in `package-alist'. (while (when pkg-descs (let ((available-version (package-desc-version (car pkg-descs)))) - (package-disabled-p pkg-name available-version))) + (or (package-disabled-p pkg-name available-version) + ;; Prefer a builtin package. + (package-built-in-p pkg-name available-version)))) (setq pkg-descs (cdr pkg-descs))) (car pkg-descs))) commit 65f355ea0a3652eb0051ad4919afe0e1b67eebaa Author: Andrea Corallo Date: Thu Jun 8 10:59:41 2023 +0200 ; Update my mail address * lisp/emacs-lisp/comp-cstr.el: Update author mail. * lisp/emacs-lisp/comp.el: Likewise. * src/comp.c: Likewise. * test/lisp/emacs-lisp/comp-cstr-tests.el: Likewise. * test/src/comp-resources/comp-test-funcs-dyn.el: Likewise. * test/src/comp-resources/comp-test-funcs.el: Likewise. * test/src/comp-resources/comp-test-pure.el: Likewise. * test/src/comp-tests.el: Likewise. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index d4200c16c19..787232067a1 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2020-2023 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; Keywords: lisp ;; Package: emacs diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 469f921a38e..322df0e86a1 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; Keywords: lisp ;; Package: emacs diff --git a/src/comp.c b/src/comp.c index 3f72d088a66..59c9e9619a3 100644 --- a/src/comp.c +++ b/src/comp.c @@ -1,7 +1,7 @@ /* Compile Emacs Lisp into native code. Copyright (C) 2019-2023 Free Software Foundation, Inc. -Author: Andrea Corallo +Author: Andrea Corallo This file is part of GNU Emacs. diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el b/test/lisp/emacs-lisp/comp-cstr-tests.el index aeb620326b0..78d9bb49b98 100644 --- a/test/lisp/emacs-lisp/comp-cstr-tests.el +++ b/test/lisp/emacs-lisp/comp-cstr-tests.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2020-2023 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; This file is part of GNU Emacs. diff --git a/test/src/comp-resources/comp-test-funcs-dyn.el b/test/src/comp-resources/comp-test-funcs-dyn.el index 7f9daf67019..8cd127f7e1b 100644 --- a/test/src/comp-resources/comp-test-funcs-dyn.el +++ b/test/src/comp-resources/comp-test-funcs-dyn.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2020-2023 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; This file is part of GNU Emacs. diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el index fff881dd595..3525e118153 100644 --- a/test/src/comp-resources/comp-test-funcs.el +++ b/test/src/comp-resources/comp-test-funcs.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; This file is part of GNU Emacs. diff --git a/test/src/comp-resources/comp-test-pure.el b/test/src/comp-resources/comp-test-pure.el index 9b4c1ee2dae..cc5ba7edef7 100644 --- a/test/src/comp-resources/comp-test-pure.el +++ b/test/src/comp-resources/comp-test-pure.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2020-2023 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; This file is part of GNU Emacs. diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index c5e5b346adb..b0d865292b7 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; This file is part of GNU Emacs. commit a3a69ec23421dd65671be37f829d5a29c8c0ef89 Author: Michael Albinus Date: Thu Jun 8 09:59:06 2023 +0200 Fix connection-local user options handling (bug#63300) * lisp/files-x.el (connection-local-set-profiles) (connection-local-set-profile-variables): Avoid saving the changed user option to file unless triggered explicitly by user. (Bug#63300) diff --git a/lisp/files-x.el b/lisp/files-x.el index 548d9efc193..9b1a7a17902 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -674,15 +674,21 @@ connection-local-set-profiles (dolist (profile profiles) (unless (assq profile connection-local-profile-alist) (error "No such connection profile `%s'" (symbol-name profile)))) - (let* ((criteria (connection-local-normalize-criteria criteria)) + ;; Avoid saving the changed user option to file unless triggered + ;; explicitly by user. This workaround can be removed once there is + ;; a solution for bug#63891. + (let* ((saved-value (get 'connection-local-criteria-alist 'saved-value)) + (criteria (connection-local-normalize-criteria criteria)) (slot (assoc criteria connection-local-criteria-alist))) (if slot (setcdr slot (delete-dups (append (cdr slot) profiles))) (setq connection-local-criteria-alist (cons (cons criteria (delete-dups profiles)) - connection-local-criteria-alist)))) - (custom-set-variables - `(connection-local-criteria-alist ',connection-local-criteria-alist now))) + connection-local-criteria-alist))) + (custom-set-variables + `(connection-local-criteria-alist ',connection-local-criteria-alist now)) + (unless saved-value + (put 'connection-local-criteria-alist 'saved-value nil)))) (defsubst connection-local-get-profile-variables (profile) "Return the connection-local variable list for PROFILE." @@ -701,9 +707,15 @@ connection-local-set-profile-variables variables are set in the server's process buffer according to the VARIABLES list of the connection profile. The list is processed in order." - (setf (alist-get profile connection-local-profile-alist) variables) - (custom-set-variables - `(connection-local-profile-alist ',connection-local-profile-alist now))) + ;; Avoid saving the changed user option to file unless triggered + ;; explicitly by user. This workaround can be removed once there is + ;; a solution for bug#63891. + (let ((saved-value (get 'connection-local-profile-alist 'saved-value))) + (setf (alist-get profile connection-local-profile-alist) variables) + (custom-set-variables + `(connection-local-profile-alist ',connection-local-profile-alist now)) + (unless saved-value + (put 'connection-local-profile-alist 'saved-value nil)))) ;;;###autoload (defun connection-local-update-profile-variables (profile variables) commit 240803cc3e1f361baf5665f91e4d0bd9576956a7 Author: Eli Zaretskii Date: Thu Jun 8 08:50:54 2023 +0300 Document 'startup-redirect-eln-cache' * doc/lispref/compile.texi (Native Compilation) (Native-Compilation Functions): Document 'startup-redirect-eln-cache'. * etc/PROBLEMS: Fix last change. * etc/NEWS: Mark 'startup-redirect-eln-cache' as documented. diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index 6ae6755ad76..a51691bddcf 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -854,7 +854,10 @@ Native Compilation @file{*.eln} files if Emacs needs to generate @dfn{trampolines}, which are used if Lisp primitives are advised or redefined in your Lisp code that is being natively compiled. @xref{Native-Compilation Variables, -trampolines}. +trampolines}. Alternatively, you can specify that the @file{*.eln} +files are written to a non-default directory using the +@code{startup-redirect-eln-cache} function; @pxref{Native-Compilation +Functions}. @menu * Native-Compilation Functions:: Functions to natively-compile Lisp. @@ -977,6 +980,22 @@ Native-Compilation Functions @file{libgccjit} dynamically, it also makes sure that library is available and can be loaded. Lisp programs that need to know up front whether native-compilation is available should use this predicate. +@end defun + + By default, asynchronous native compilation writes the @file{*.eln} +files it produces to a subdirectory of the first writable directory +specified by the @code{native-comp-eln-load-path} variable +(@pxref{Native-Compilation Variables}). You can change this by using +the following function in your startup files: + +@defun startup-redirect-eln-cache cache-directory +This function arranges for the asynchronous native compilation to +write the produced @file{*.eln} files to @var{cache-directory}, which +must be a single directory, a string. It also destructively modifies +@code{native-comp-eln-load-path} such that its first element is +@var{cache-directory}. If @var{cache-directory} is not an absolute +file name, it is interpreted relative to @code{user-emacs-directory} +(@pxref{Init File}). @end defun @node Native-Compilation Variables diff --git a/etc/NEWS b/etc/NEWS index d3146fab8eb..ca0d602e9ad 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -226,7 +226,7 @@ ones for the current Emacs version). Note that subdirectories of the system directory where the "*.eln" files are installed (usually, the last entry in 'native-comp-eln-load-path') are not deleted. ---- ++++ *** New function 'startup-redirect-eln-cache'. This function can be called in your init files to change the user-specific directory where Emacs stores the "*.eln" files produced diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 561b116c9bd..e5baa8ee18a 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -2755,8 +2755,7 @@ one, you could use the following workarounds: directory to that new home directory. . Move all the *.eln files from ~/.emacs.d/eln-cache to a directory out of the C:\Users tree, and customize Emacs to use that - directory for *.eln files. This requires to add that directory to - the value of native-comp-eln-load-path, and also call the function + directory for *.eln files. This requires to call the function startup-redirect-eln-cache in your init file, to force Emacs to write *.eln files compiled at run time to that directory. . Delete all *.eln files in your ~/.emacs.d/eln-cache directory, and commit 026afb229847f4a76890b09a196c8431fce2804d Author: Eli Zaretskii Date: Thu Jun 8 08:30:18 2023 +0300 ; * etc/PROBLEMS: Entry about crashes due to anti-virus (bug#57880). diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 5b9b5ee4ead..561b116c9bd 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -2730,6 +2730,45 @@ C-r C-t, to toggle whether C-x gets through to Emacs. * Runtime problems specific to MS-Windows +** Emacs with native compilation crashes/signals errors accessing *.eln files + +This is known to be caused by some flavors of Windows anti-virus +software. The problem could manifest itself in several ways: + + . Emacs crashes when it tries to load certain *.eln files + . Emacs signals an error when it tries to load some *.eln files, + claiming they are "not GPL compatible" + . Emacs crashes during GC when it calls unload_comp_unit + +This was specifically reported to happen with *.eln files in +directories under the C:\Users directory, which is where Emacs on +Windows places the emulated HOME directory, and thus also the +~/.emacs.d/eln-cache directory holding the *.eln files compiled during +Emacs sessions (as opposed to those that came precompiled and were +installed with the rest of Emacs distribution). + +If you cannot disable such anti-virus software or switch to another +one, you could use the following workarounds: + + . Define the HOME environment variable to point to a directory + outside of the C:\Users tree, then copy/move your ~/.emacs.d + directory to that new home directory. + . Move all the *.eln files from ~/.emacs.d/eln-cache to a directory + out of the C:\Users tree, and customize Emacs to use that + directory for *.eln files. This requires to add that directory to + the value of native-comp-eln-load-path, and also call the function + startup-redirect-eln-cache in your init file, to force Emacs to + write *.eln files compiled at run time to that directory. + . Delete all *.eln files in your ~/.emacs.d/eln-cache directory, and + then disable run-time native compilation. To disable native + compilation, set the variables native-comp-jit-compilation and + native-comp-enable-subr-trampolines to nil. + . Install Emacs built without native compilation. + +With any of the above methods, you'd need to restart Emacs (and +preferably also your Windows system) after making the changes, to have +them take effect. + ** Emacs on Windows 9X requires UNICOWS.DLL If that DLL is not available, Emacs will display an error dialog commit a902156068ab071f93cc9bbd34cd320919b74064 Author: Paul Eggert Date: Wed Jun 7 12:00:15 2023 -0700 Update from Gnulib by running admin/merge-gnulib diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c index 359d497396c..49c92dcc196 100644 --- a/lib/careadlinkat.c +++ b/lib/careadlinkat.c @@ -35,10 +35,6 @@ # define SIZE_MAX ((size_t) -1) #endif -#ifndef SSIZE_MAX -# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) -#endif - #include "allocator.h" enum { STACK_BUF_SIZE = 1024 }; @@ -55,7 +51,9 @@ When the GCC bug is fixed this workaround should be limited to the broken GCC versions. */ #if _GL_GNUC_PREREQ (10, 1) -# if defined GCC_LINT || defined lint +# if _GL_GNUC_PREREQ (12, 1) +# pragma GCC diagnostic ignored "-Wreturn-local-addr" +# elif defined GCC_LINT || defined lint __attribute__ ((__noinline__)) # elif __OPTIMIZE__ && !__NO_INLINE__ # define GCC_BOGUS_WRETURN_LOCAL_ADDR diff --git a/lib/diffseq.h b/lib/diffseq.h index dfaf4f295e8..06e1465bf1b 100644 --- a/lib/diffseq.h +++ b/lib/diffseq.h @@ -48,6 +48,10 @@ OFFSET A signed integer type sufficient to hold the difference between two indices. Usually something like ptrdiff_t. + OFFSET_MAX (Optional) The maximum value of OFFSET (e.g., + PTRDIFF_MAX). If omitted, it is inferred in a + way portable to the vast majority of C platforms, + as they lack padding bits. EXTRA_CONTEXT_FIELDS Declarations of fields for 'struct context'. NOTE_DELETE(ctxt, xoff) Record the removal of the object xvec[xoff]. NOTE_INSERT(ctxt, yoff) Record the insertion of the object yvec[yoff]. @@ -74,8 +78,10 @@ */ /* Maximum value of type OFFSET. */ -#define OFFSET_MAX \ - ((((OFFSET)1 << (sizeof (OFFSET) * CHAR_BIT - 2)) - 1) * 2 + 1) +#ifndef OFFSET_MAX +# define OFFSET_MAX \ + ((((OFFSET) 1 << (sizeof (OFFSET) * CHAR_BIT - 2)) - 1) * 2 + 1) +#endif /* Default to no early abort. */ #ifndef EARLY_ABORT @@ -88,11 +94,17 @@ #define OFFSET_MAX \ /* Use this to suppress gcc's "...may be used before initialized" warnings. Beware: The Code argument must not contain commas. */ +#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4 +# pragma GCC diagnostic push +#endif #ifndef IF_LINT # if defined GCC_LINT || defined lint # define IF_LINT(Code) Code # else # define IF_LINT(Code) /* empty */ +# if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4 +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +# endif # endif #endif @@ -556,6 +568,10 @@ compareseq (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, #undef XREF_YREF_EQUAL } +#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4 +# pragma GCC diagnostic pop +#endif + #undef ELEMENT #undef EQUAL #undef OFFSET diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index 4cddc80bd13..3eeaf9c57d1 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -28,7 +28,7 @@ #include "acl.h" #include "acl-internal.h" - +#include "attribute.h" #include "minmax.h" #if USE_ACL && HAVE_LINUX_XATTR_H && HAVE_LISTXATTR @@ -40,6 +40,12 @@ # ifndef XATTR_NAME_NFSV4_ACL # define XATTR_NAME_NFSV4_ACL "system.nfs4_acl" # endif +# ifndef XATTR_NAME_POSIX_ACL_ACCESS +# define XATTR_NAME_POSIX_ACL_ACCESS "system.posix_acl_access" +# endif +# ifndef XATTR_NAME_POSIX_ACL_DEFAULT +# define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default" +# endif enum { /* ACE4_ACCESS_ALLOWED_ACE_TYPE = 0x00000000, */ @@ -50,7 +56,7 @@ /* Return true if ATTR is in the set represented by the NUL-terminated strings in LISTBUF, which is of size LISTSIZE. */ -static bool +ATTRIBUTE_PURE static bool have_xattr (char const *attr, char const *listbuf, ssize_t listsize) { char const *blim = listbuf + listsize; diff --git a/lib/flexmember.h b/lib/flexmember.h index 8c5915ecf9c..8df44195392 100644 --- a/lib/flexmember.h +++ b/lib/flexmember.h @@ -43,7 +43,7 @@ followed by N bytes of other data. The result is suitable as an argument to malloc. For example: - struct s { int n; char d[FLEXIBLE_ARRAY_MEMBER]; }; + struct s { int a; char d[FLEXIBLE_ARRAY_MEMBER]; }; struct s *p = malloc (FLEXSIZEOF (struct s, d, n * sizeof (char))); FLEXSIZEOF (TYPE, MEMBER, N) is not simply (sizeof (TYPE) + N), @@ -63,3 +63,14 @@ #define FLEXSIZEOF(type, member, n) \ ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \ & ~ (FLEXALIGNOF (type) - 1)) + +/* Yield a properly aligned upper bound on the size of a struct of + type TYPE with a flexible array member named MEMBER that has N + elements. The result is suitable as an argument to malloc. + For example: + + struct s { int a; double d[FLEXIBLE_ARRAY_MEMBER]; }; + struct s *p = malloc (FLEXNSIZEOF (struct s, d, n)); + */ +#define FLEXNSIZEOF(type, member, n) \ + FLEXSIZEOF (type, member, (n) * sizeof (((type *) 0)->member[0])) diff --git a/lib/limits.in.h b/lib/limits.in.h index 45d46fd6897..1d479c3d192 100644 --- a/lib/limits.in.h +++ b/lib/limits.in.h @@ -134,6 +134,18 @@ #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) # endif #endif +/* Macro specified by POSIX. */ + +/* The maximal size_t value. Although it might not be of ssize_t type + as it should be, it's too much trouble to fix this minor detail. */ +#ifndef SSIZE_MAX +# ifdef _WIN64 +# define SSIZE_MAX LLONG_MAX +# else +# define SSIZE_MAX LONG_MAX +# endif +#endif + #endif /* _@GUARD_PREFIX@_LIMITS_H */ #endif /* _@GUARD_PREFIX@_LIMITS_H */ #endif diff --git a/lib/nstrftime.c b/lib/nstrftime.c index 2a1dd8d88d7..c4bef575fcd 100644 --- a/lib/nstrftime.c +++ b/lib/nstrftime.c @@ -276,6 +276,14 @@ #define cpy(n, s) width_cpy (width, n, s) more reliable way to accept other sets of digits. */ #define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9) +/* Avoid false GCC warning "'memset' specified size 18446744073709551615 exceeds + maximum object size 9223372036854775807", caused by insufficient data flow + analysis and value propagation of the 'width_add' expansion when GCC is not + optimizing. Cf. . */ +#if __GNUC__ >= 7 && !__OPTIMIZE__ +# pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + #if FPRINTFTIME static void fwrite_lowcase (FILE *fp, const CHAR_T *src, size_t len) @@ -1384,7 +1392,7 @@ #define DO_NUMBER_SPACEPAD(d, v) \ if (len < w) { size_t delta = w - len; - wmemmove (p + delta, p, len); + __wmemmove (p + delta, p, len); wchar_t wc = pad == L_('0') || pad == L_('+') ? L'0' : L' '; wmemset (p, wc, delta); } diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 0270091df70..7e35a112ec2 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -151,9 +151,6 @@ #define WIDE_NEWLINE_CHAR L'\n' as some non-GCC platforms lack them, an issue when this code is used in Gnulib. */ -#ifndef SSIZE_MAX -# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) -#endif #ifndef ULONG_WIDTH # define ULONG_WIDTH REGEX_UINTEGER_WIDTH (ULONG_MAX) /* The number of usable bits in an unsigned integer type with maximum diff --git a/m4/copy-file-range.m4 b/m4/copy-file-range.m4 index d41f2c48313..fa6ab341091 100644 --- a/m4/copy-file-range.m4 +++ b/m4/copy-file-range.m4 @@ -39,21 +39,9 @@ AC_DEFUN case $host_os in linux*) - AC_CACHE_CHECK([whether copy_file_range is known to work], - [gl_cv_copy_file_range_known_to_work], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include - ]], - [[#if LINUX_VERSION_CODE < KERNEL_VERSION (5, 3, 0) - #error "copy_file_range is buggy" - #endif - ]])], - [gl_cv_copy_file_range_known_to_work=yes], - [gl_cv_copy_file_range_known_to_work=no])]) - if test "$gl_cv_copy_file_range_known_to_work" = no; then - REPLACE_COPY_FILE_RANGE=1 - fi;; + # See copy-file-range.c comment re pre-5.3 Linux kernel bugs. + # We should be able to remove this hack in 2025. + REPLACE_COPY_FILE_RANGE=1;; esac fi ]) diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index a2b53d33dca..2426eb63985 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1053,7 +1053,6 @@ AC_DEFUN dnl -Wno-float-conversion >= 4.9 >= 3.9 dnl -Wno-float-equal >= 3 >= 3.9 dnl -Wimplicit-fallthrough >= 7 >= 3.9 - dnl -Wno-missing-field-initializers >= 4.0, < 11 dnl -Wno-pedantic >= 4.8 >= 3.9 dnl -Wno-sign-compare >= 3 >= 3.9 dnl -Wno-sign-conversion >= 4.3 >= 3.9 @@ -1079,9 +1078,6 @@ AC_DEFUN #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wimplicit-fallthrough #endif - #if __GNUC__ >= 4 && __GNUC__ < 11 && !defined __clang__ - -Wno-missing-field-initializers - #endif #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-pedantic #endif diff --git a/m4/limits-h.m4 b/m4/limits-h.m4 index ca0294e5500..6a5983ebc25 100644 --- a/m4/limits-h.m4 +++ b/m4/limits-h.m4 @@ -28,11 +28,22 @@ AC_DEFUN_ONCE ]])], [gl_cv_header_limits_width=yes], [gl_cv_header_limits_width=no])]) - if test "$gl_cv_header_limits_width" = yes; then - GL_GENERATE_LIMITS_H=false - else - GL_GENERATE_LIMITS_H=true - fi + GL_GENERATE_LIMITS_H=true + AS_IF([test "$gl_cv_header_limits_width" = yes], + [AC_CACHE_CHECK([whether limits.h has SSIZE_MAX], + [gl_cv_header_limits_ssize_max], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#include + #ifndef SSIZE_MAX + #error "SSIZE_MAX is not defined" + #endif + ]])], + [gl_cv_header_limits_ssize_max=yes], + [gl_cv_header_limits_ssize_max=no])]) + if test "$gl_cv_header_limits_ssize_max" = yes; then + GL_GENERATE_LIMITS_H=false + fi]) ]) dnl Unconditionally enables the replacement of . diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 13db996516d..a06f26f672e 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,4 +1,4 @@ -# manywarnings.m4 serial 23 +# manywarnings.m4 serial 24 dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,6 +6,8 @@ dnl From Simon Josefsson +AC_PREREQ([2.64]) + # gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR) # -------------------------------------------------- # Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR. @@ -21,7 +23,7 @@ AC_DEFUN *" $gl_warn_item "*) ;; *) - gl_AS_VAR_APPEND([gl_warn_set], [" $gl_warn_item"]) + AS_VAR_APPEND([gl_warn_set], [" $gl_warn_item"]) ;; esac done @@ -47,40 +49,29 @@ AC_DEFUN dnl gcc warning categories. AC_REQUIRE([AC_PROG_CC]) AS_IF([test -n "$GCC"], [ - dnl Check if -Wextra -Werror -Wno-missing-field-initializers is supported - dnl with the current $CC $CFLAGS $CPPFLAGS. - AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported], - [gl_cv_cc_nomfi_supported], - [gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wextra -Werror -Wno-missing-field-initializers" + AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed], + [gl_cv_cc_nomfi_needed], + [gl_cv_cc_nomfi_needed=no + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wextra -Werror" AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [gl_cv_cc_nomfi_supported=yes], - [gl_cv_cc_nomfi_supported=no]) + [AC_LANG_PROGRAM( + [[struct file_data { int desc, name; }; + struct cmp { struct file_data file[1]; }; + void f (struct cmp *r) + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + struct cmp cmp = { .file[0].desc = r->file[0].desc + s1.a }; + *r = cmp; + } + ]], + [[]])], + [], + [CFLAGS="$CFLAGS -Wno-missing-field-initializers" + AC_COMPILE_IFELSE([], + [gl_cv_cc_nomfi_needed=yes])]) CFLAGS="$gl_save_CFLAGS" - ]) - - AS_IF([test "$gl_cv_cc_nomfi_supported" = yes], [ - dnl Now check whether -Wno-missing-field-initializers is needed - dnl for the { 0, } construct. - AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed], - [gl_cv_cc_nomfi_needed], - [gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wextra -Werror" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[int f (void) - { - typedef struct { int a; int b; } s_t; - s_t s1 = { 0, }; - return s1.b; - } - ]], - [[]])], - [gl_cv_cc_nomfi_needed=no], - [gl_cv_cc_nomfi_needed=yes]) - CFLAGS="$gl_save_CFLAGS" - ]) ]) dnl Next, check if -Werror -Wuninitialized is useful with the @@ -159,51 +150,51 @@ AC_DEFUN -Wwrite-strings \ \ ; do - gl_AS_VAR_APPEND([$1], [" $gl_manywarn_item"]) + AS_VAR_APPEND([$1], [" $gl_manywarn_item"]) done # gcc --help=warnings outputs an unusual form for these options; list # them here so that the above 'comm' command doesn't report a false match. - gl_AS_VAR_APPEND([$1], [' -Warray-bounds=2']) - gl_AS_VAR_APPEND([$1], [' -Wattribute-alias=2']) - gl_AS_VAR_APPEND([$1], [' -Wbidi-chars=any,ucn']) - gl_AS_VAR_APPEND([$1], [' -Wformat-overflow=2']) - gl_AS_VAR_APPEND([$1], [' -Wformat=2']) - gl_AS_VAR_APPEND([$1], [' -Wformat-truncation=2']) - gl_AS_VAR_APPEND([$1], [' -Wimplicit-fallthrough=5']) - gl_AS_VAR_APPEND([$1], [' -Wshift-overflow=2']) - gl_AS_VAR_APPEND([$1], [' -Wuse-after-free=3']) - gl_AS_VAR_APPEND([$1], [' -Wunused-const-variable=2']) - gl_AS_VAR_APPEND([$1], [' -Wvla-larger-than=4031']) + AS_VAR_APPEND([$1], [' -Warray-bounds=2']) + AS_VAR_APPEND([$1], [' -Wattribute-alias=2']) + AS_VAR_APPEND([$1], [' -Wbidi-chars=any,ucn']) + AS_VAR_APPEND([$1], [' -Wformat-overflow=2']) + AS_VAR_APPEND([$1], [' -Wformat=2']) + AS_VAR_APPEND([$1], [' -Wformat-truncation=2']) + AS_VAR_APPEND([$1], [' -Wimplicit-fallthrough=5']) + AS_VAR_APPEND([$1], [' -Wshift-overflow=2']) + AS_VAR_APPEND([$1], [' -Wuse-after-free=3']) + AS_VAR_APPEND([$1], [' -Wunused-const-variable=2']) + AS_VAR_APPEND([$1], [' -Wvla-larger-than=4031']) # These are needed for older GCC versions. if test -n "$GCC" && gl_gcc_version=`($CC --version) 2>/dev/null`; then case $gl_gcc_version in 'gcc (GCC) '[[0-3]].* | \ 'gcc (GCC) '4.[[0-7]].*) - gl_AS_VAR_APPEND([$1], [' -fdiagnostics-show-option']) - gl_AS_VAR_APPEND([$1], [' -funit-at-a-time']) + AS_VAR_APPEND([$1], [' -fdiagnostics-show-option']) + AS_VAR_APPEND([$1], [' -funit-at-a-time']) ;; esac case $gl_gcc_version in 'gcc (GCC) '[[0-9]].*) - gl_AS_VAR_APPEND([$1], [' -fno-common']) + AS_VAR_APPEND([$1], [' -fno-common']) ;; esac fi # Disable specific options as needed. if test "$gl_cv_cc_nomfi_needed" = yes; then - gl_AS_VAR_APPEND([$1], [' -Wno-missing-field-initializers']) + AS_VAR_APPEND([$1], [' -Wno-missing-field-initializers']) fi if test "$gl_cv_cc_uninitialized_supported" = no; then - gl_AS_VAR_APPEND([$1], [' -Wno-uninitialized']) + AS_VAR_APPEND([$1], [' -Wno-uninitialized']) fi # This warning have too many false alarms in GCC 11.2.1. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101713 - gl_AS_VAR_APPEND([$1], [' -Wno-analyzer-malloc-leak']) + AS_VAR_APPEND([$1], [' -Wno-analyzer-malloc-leak']) AC_LANG_POP([C]) ]) diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4 index 1c12c33ea09..52bd77d2aeb 100644 --- a/m4/ssize_t.m4 +++ b/m4/ssize_t.m4 @@ -1,23 +1,37 @@ -# ssize_t.m4 serial 5 (gettext-0.18.2) +# ssize_t.m4 serial 6 dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -dnl Test whether ssize_t is defined. +dnl Define ssize_t if it does not already exist. AC_DEFUN([gt_TYPE_SSIZE_T], [ - AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], + AC_CACHE_CHECK([for ssize_t], [gl_cv_ssize_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[int x = sizeof (ssize_t *) + sizeof (ssize_t); return !x;]])], - [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) - if test $gt_cv_ssize_t = no; then - AC_DEFINE([ssize_t], [int], - [Define as a signed type of the same size as size_t.]) + [gl_cv_ssize_t=yes], [gl_cv_ssize_t=no])]) + if test $gl_cv_ssize_t = no; then + dnl On 64-bit native Windows, ssize_t needs to be defined as 'long long', + dnl for consistency with the 64-bit size_t. + AC_CACHE_CHECK([whether size_t is wider than 'long'], [gl_cv_size_t_large], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + typedef int array [2 * (sizeof (size_t) > sizeof (long)) - 1]; + ]])], + [gl_cv_size_t_large=yes], [gl_cv_size_t_large=no])]) + if test $gl_cv_size_t_large = yes; then + gl_def_ssize_t='long long' + else + gl_def_ssize_t='long' + fi + AC_DEFINE_UNQUOTED([ssize_t], [$gl_def_ssize_t], + [Define as a signed type of the same size as size_t.]) fi ]) diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 index ec09609cd42..a0cbc805bc9 100644 --- a/m4/strtoll.m4 +++ b/m4/strtoll.m4 @@ -1,4 +1,4 @@ -# strtoll.m4 serial 10 +# strtoll.m4 serial 11 dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -19,10 +19,16 @@ AC_DEFUN char *term; /* This test fails on Minix and native Windows. */ { - const char input[] = "0x"; - (void) strtoll (input, &term, 16); - if (term != input + 1) - result |= 1; + static char const input[2][3] = {"0x", "0b"}; + static int const base[] = {0, 2, 10}; + int i, j; + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + { + (void) strtoll (input[i], &term, base[j]); + if (term != input[i] + 1) + result |= 1; + } } /* This test fails on pre-C23 platforms. */ { diff --git a/m4/warnings.m4 b/m4/warnings.m4 index 063bc5ca64a..1a3107f846d 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -1,4 +1,4 @@ -# warnings.m4 serial 16 +# warnings.m4 serial 18 dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,14 +6,7 @@ dnl From Simon Josefsson -# gl_AS_VAR_APPEND(VAR, VALUE) -# ---------------------------- -# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it. -m4_ifdef([AS_VAR_APPEND], -[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])], -[m4_define([gl_AS_VAR_APPEND], -[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])]) - +AC_PREREQ([2.64]) # gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED], # [PROGRAM = AC_LANG_PROGRAM()]) @@ -34,7 +27,7 @@ AC_DEFUN m4_pushdef([gl_Positive], [$gl_positive])])dnl AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [ gl_save_compiler_FLAGS="$gl_Flags" - gl_AS_VAR_APPEND(m4_defn([gl_Flags]), + AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([[]])])], [AS_VAR_SET([gl_Warn], [yes])], @@ -97,7 +90,7 @@ AC_DEFUN AC_DEFUN([gl_WARN_ADD], [AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)]) gl_COMPILER_OPTION_IF([$1], - [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])], + [AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])], [], [$3]) m4_ifval([$2], @@ -105,6 +98,67 @@ AC_DEFUN [AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl ]) + +# gl_CC_INHIBIT_WARNINGS +# sets and substitutes a variable GL_CFLAG_INHIBIT_WARNINGS, to a $(CC) option +# that reverts all preceding -W* options, if available. +# This is expected to be '-w' at least on gcc, clang, AIX xlc, xlclang, Sun cc, +# "compile cl" (MSVC), "compile clang-cl" (MSVC-compatible clang). Or it can be +# empty. +AC_DEFUN([gl_CC_INHIBIT_WARNINGS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_CACHE_CHECK([for C compiler option to inhibit all warnings], + [gl_cv_cc_winhibit], + [rm -f conftest* + echo 'int dummy;' > conftest.c + AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c 2>conftest1.err]) >/dev/null + AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -w -c conftest.c 2>conftest2.err]) >/dev/null + if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then + gl_cv_cc_winhibit='-w' + else + gl_cv_cc_winhibit=none + fi + rm -f conftest* + ]) + case "$gl_cv_cc_winhibit" in + none) GL_CFLAG_INHIBIT_WARNINGS='' ;; + *) GL_CFLAG_INHIBIT_WARNINGS="$gl_cv_cc_winhibit" ;; + esac + AC_SUBST([GL_CFLAG_INHIBIT_WARNINGS]) +]) + +# gl_CXX_INHIBIT_WARNINGS +# sets and substitutes a variable GL_CXXFLAG_INHIBIT_WARNINGS, to a $(CC) option +# that reverts all preceding -W* options, if available. +AC_DEFUN([gl_CXX_INHIBIT_WARNINGS], +[ + dnl Requires AC_PROG_CXX or gl_PROG_ANSI_CXX. + if test -n "$CXX" && test "$CXX" != no; then + AC_CACHE_CHECK([for C++ compiler option to inhibit all warnings], + [gl_cv_cxx_winhibit], + [rm -f conftest* + echo 'int dummy;' > conftest.cc + AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>conftest1.err]) >/dev/null + AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -w -c conftest.cc 2>conftest2.err]) >/dev/null + if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then + gl_cv_cxx_winhibit='-w' + else + gl_cv_cxx_winhibit=none + fi + rm -f conftest* + ]) + case "$gl_cv_cxx_winhibit" in + none) GL_CXXFLAG_INHIBIT_WARNINGS='' ;; + *) GL_CXXFLAG_INHIBIT_WARNINGS="$gl_cv_cxx_winhibit" ;; + esac + else + GL_CXXFLAG_INHIBIT_WARNINGS='' + fi + AC_SUBST([GL_CXXFLAG_INHIBIT_WARNINGS]) +]) + + # Local Variables: # mode: autoconf # End: commit f68d962ede0cc3d7758d3304e7411a10694acce8 Author: Wilson Snyder Date: Tue Jun 6 21:46:19 2023 -0400 Merge from verilog-mode upstream. * lisp/progmodes/verilog-mode.el (verilog-read-decls): Fix parsing "@ (* )" (#1829). (verilog-indent-ignore-p): Fix indent of comments being wrongly detected as multiline defines. Reported by Gonzalo Larumbe . (verilog-pos-at-end-of-statement): Fix minor bug in `verilog-pos-at-end-of-statement' assuming `verilog-end-of-statement`. Reported by Gonzalo Larumbe . (verilog-in-generate-region-p): Fix indentation of generate blocks omitting keyword. Reported by Gonzalo Larumbe . diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 9199119b602..855ba4b50cf 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -9,7 +9,7 @@ ;; Keywords: languages ;; The "Version" is the date followed by the decimal rendition of the Git ;; commit hex. -;; Version: 2022.12.18.181110314 +;; Version: 2023.06.06.141322628 ;; Yoni Rabkin contacted the maintainer of this ;; file on 19/3/2008, and the maintainer agreed that when a bug is @@ -124,7 +124,7 @@ ;; ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "2022-12-18-acb862a-vpo-GNU" +(defconst verilog-mode-version "2023-06-06-86c6984-vpo-GNU" "Version of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -5004,21 +5004,31 @@ verilog-in-generate-region-p "Return non-nil if in a generate region. More specifically, after a generate and before an endgenerate." (interactive) - (let ((pos (point)) - gen-beg-point gen-end-point) - (save-match-data - (save-excursion - (and (verilog-re-search-backward "\\<\\(generate\\)\\>" nil t) - (forward-word) - (setq gen-beg-point (point)) - (verilog-forward-sexp) - (backward-word) - (setq gen-end-point (point))))) - (if (and gen-beg-point gen-end-point - (>= pos gen-beg-point) - (<= pos gen-end-point)) - t - nil))) + (let ((nest 1)) + (save-excursion + (catch 'done + (while (and + (/= nest 0) + (verilog-re-search-backward + "\\<\\(module\\)\\|\\(connectmodule\\)\\|\\(endmodule\\)\\|\\(generate\\)\\|\\(endgenerate\\)\\|\\(if\\)\\|\\(case\\)\\|\\(for\\)\\>" nil 'move) + (cond + ((match-end 1) ; module - we have crawled out + (throw 'done 1)) + ((match-end 2) ; connectmodule - we have crawled out + (throw 'done 1)) + ((match-end 3) ; endmodule - we were outside of module block + (throw 'done -1)) + ((match-end 4) ; generate + (setq nest (1- nest))) + ((match-end 5) ; endgenerate + (setq nest (1+ nest))) + ((match-end 6) ; if + (setq nest (1- nest))) + ((match-end 7) ; case + (setq nest (1- nest))) + ((match-end 8) ; for + (setq nest (1- nest)))))))) + (= nest 0) )) ; return nest (defun verilog-in-fork-region-p () "Return non-nil if between a fork and join." @@ -6737,7 +6747,8 @@ verilog-col-at-beg-of-statement (defun verilog-pos-at-end-of-statement () "Return point position at the end of current statement." (save-excursion - (verilog-end-of-statement))) + (verilog-end-of-statement) + (point))) (defun verilog-col-at-end-of-statement () "Return current column at the end of current statement." @@ -8038,7 +8049,8 @@ verilog-indent-ignore-p "Return non-nil if current line should ignore indentation." (or (and verilog-indent-ignore-multiline-defines ;; Line with multiline define, ends with "\" or "\" plus trailing whitespace - (or (looking-at ".*\\\\\\s-*$") + (or (save-excursion + (verilog-re-search-forward ".*\\\\\\s-*$" (line-end-position) t)) (save-excursion ; Last line after multiline define (verilog-backward-syntactic-ws) (unless (bobp) @@ -9313,7 +9325,8 @@ verilog-read-decls ((looking-at "(\\*") ;; To advance past either "(*)" or "(* ... *)" don't forward past first * (forward-char 1) - (or (search-forward "*)") + (or (looking-at "\\*\\s-*)") ; (* ) + (search-forward "*)") ; end attribute (error "%s: Unmatched (* *), at char %d" (verilog-point-text) (point)))) ((eq ?\" (following-char)) (or (re-search-forward "[^\\]\"" nil t) ; don't forward-char first, since we look for a non backslash first commit ef8485ad05dd9200b68ea8141fd44c7b976140cd Author: Eli Zaretskii Date: Tue Jun 6 21:27:27 2023 +0300 ; * src/window.c (window_wants_header_line): Shut up bogus GCC warning. diff --git a/src/window.c b/src/window.c index 81578375498..3802efb992a 100644 --- a/src/window.c +++ b/src/window.c @@ -5534,13 +5534,14 @@ window_wants_header_line (struct window *w) = window_parameter (w, Qheader_line_format); struct frame *f = WINDOW_XFRAME (w); + Lisp_Object wbuffer = WINDOW_BUFFER (w); - return (WINDOW_LEAF_P (w) + return (BUFFERP (wbuffer) && !MINI_WINDOW_P (w) && !WINDOW_PSEUDO_P (w) && !EQ (window_header_line_format, Qnone) && (!null_header_line_format (window_header_line_format, f) - || !null_header_line_format (BVAR (XBUFFER (WINDOW_BUFFER (w)), + || !null_header_line_format (BVAR (XBUFFER (wbuffer), header_line_format), f)) && (WINDOW_PIXEL_HEIGHT (w) > (window_wants_mode_line (w) commit 229f0b8dd3b92827b6e0c6fc105508e8b80858f5 Author: Po Lu Date: Tue Jun 6 21:05:13 2023 +0800 ; Fix coding style in just installed change * src/window.c (window_wants_header_line): Fix whitespace. diff --git a/src/window.c b/src/window.c index 7d89885b65f..81578375498 100644 --- a/src/window.c +++ b/src/window.c @@ -5530,10 +5530,10 @@ null_header_line_format (Lisp_Object fmt, struct frame *f) bool window_wants_header_line (struct window *w) { - Lisp_Object window_header_line_format = - window_parameter (w, Qheader_line_format); + Lisp_Object window_header_line_format + = window_parameter (w, Qheader_line_format); - struct frame *f = WINDOW_XFRAME(w); + struct frame *f = WINDOW_XFRAME (w); return (WINDOW_LEAF_P (w) && !MINI_WINDOW_P (w) commit bf28b019a85fcc4e16bc7ecad6304c30e48a3223 Author: Po Lu Date: Tue Jun 6 21:00:44 2023 +0800 Fix problems resulting from modification of the undo list * doc/lispref/text.texi (Atomic Changes): Describe what not to do inside an atomic change group. * lisp/elec-pair.el (electric-pair-inhibit-if-helps-balance): Don't call `delete-char'; that edits the undo list by removing boundary markers. * lisp/subr.el (atomic-change-group, prepare-change-group): Warn against modifying the undo list inside. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index f15b3c33e0c..dac8d0d8ce9 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -6181,6 +6181,17 @@ Atomic Changes will get Emacs confused, so don't let it happen; the first change group you start for any given buffer should be the last one finished. + Emacs keeps track of change groups by assuming that by following +each cdr in @code{buffer-undo-list}, it will eventually arrive at the +cons it was set to at the time @code{prepare-change-group} was called. + + If @code{buffer-undo-list} no longer contains that cons, Emacs will +lose track of any change groups, resulting in an error when the change +group is cancelled. To avoid this, do not call any functions which +may edit the undo list in such a manner, when a change group is +active: notably, ``amalgamating'' commands such as @code{delete-char}, +which call @code{undo-auto-amalgamate}. + @node Change Hooks @section Change Hooks @cindex change hooks diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index b894965eae4..416c95e7a34 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -439,7 +439,9 @@ electric-pair-inhibit-if-helps-balance ;; position some markers. The real fix would be to compute the ;; result without having to modify the buffer at all. (atomic-change-group - (delete-char -1) + ;; Don't use `delete-char'; that may modify the head of the + ;; undo list. + (delete-region (point) (1- (point))) (throw 'done (cond ((eq ?\( syntax) diff --git a/lisp/subr.el b/lisp/subr.el index cef631a69c3..1384215498b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3773,6 +3773,9 @@ atomic-change-group all of its changes to the current buffer are undone. This works regardless of whether undo is enabled in the buffer. +Do not call functions which edit the undo list within BODY; see +`prepare-change-group'. + This mechanism is transparent to ordinary use of undo; if undo is enabled in the buffer and BODY succeeds, the user can undo the change normally." @@ -3839,6 +3842,12 @@ prepare-change-group finish the same group twice. For a simple example of correct use, see the source code of `atomic-change-group'. +As long as this handle is still in use, do not call functions +which edit the undo list: if it no longer contains its current +value, Emacs will not be able to cancel the change group. This +includes any \"amalgamating\" commands, such as `delete-char', +which call `undo-auto-amalgamate'. + The handle records only the specified buffer. To make a multibuffer change group, call this function once for each buffer you want to cover, then use `nconc' to combine the returned values, like this: commit 05c2be28a3e97bd920d0bf8c8b59ec682a420cce Author: Eli Zaretskii Date: Tue Jun 6 15:15:34 2023 +0300 ; Fix last change * src/window.c (window_wants_header_line): Fix whitespace and commentary in last change. (Bug#63825) diff --git a/src/window.c b/src/window.c index 9429679061e..7d89885b65f 100644 --- a/src/window.c +++ b/src/window.c @@ -5475,14 +5475,14 @@ window_wants_mode_line (struct window *w) * null_header_line_format: * * Return non-zero when header line format FMT indicates that the - * header line should not be displayed at all. + * header line should not be displayed at all, for windows on frame F. * * This is when FMT is nil, or if FMT is a cons cell and either its * car is a symbol whose value as a variable is nil or void, or its * car is the symbol ':eval' and its cadr evaluates to nil. */ static bool -null_header_line_format (Lisp_Object fmt, struct frame * f) +null_header_line_format (Lisp_Object fmt, struct frame *f) { Lisp_Object car; Lisp_Object val; @@ -5533,7 +5533,7 @@ window_wants_header_line (struct window *w) Lisp_Object window_header_line_format = window_parameter (w, Qheader_line_format); - struct frame * f = WINDOW_XFRAME(w); + struct frame *f = WINDOW_XFRAME(w); return (WINDOW_LEAF_P (w) && !MINI_WINDOW_P (w) @@ -5541,8 +5541,7 @@ window_wants_header_line (struct window *w) && !EQ (window_header_line_format, Qnone) && (!null_header_line_format (window_header_line_format, f) || !null_header_line_format (BVAR (XBUFFER (WINDOW_BUFFER (w)), - header_line_format), - f)) + header_line_format), f)) && (WINDOW_PIXEL_HEIGHT (w) > (window_wants_mode_line (w) ? 2 * WINDOW_FRAME_LINE_HEIGHT (w) commit 4f66cbbfe520ee31ef26676e09a926217d9736fe Author: Eshel Yaron Date: Sun Jun 4 19:41:20 2023 +0300 Avoid header line with some empty non-nil formats Allow the value of 'header-line-format' to indicate that no header line should be displayed when it trivially yields 'nil', even if it is not plain 'nil'. Previously, any non-nil 'header-line-format' resulted in a (possibly empty) header line. This change adds some flexibility by also taking a non-nil value of 'header-line-format' to mean that no header line should be displayed if it's a list whose 'car' is a symbol and either that symbol is ':eval' and the second list element evaluates to 'nil', or the symbol's value as a variable is 'nil' or void. (Bug#63825) * src/xdisp.c (safe_eval_inhibit_quit): New function. * src/lisp.h (safe_eval_inhibit_quit): Declare it. * src/window.c (null_header_line_format): New function. (window_wants_header_line): Use it. * doc/lispref/modes.texi (Header Line): Update to reflect new conditions for displaying a window's header line. * etc/NEWS: Announce updated treatment of 'header-line-format'. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index c2698da6d99..d2a05fe29e4 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -2597,6 +2597,15 @@ Header Lines line. @end defvar +Emacs displays the header line for a window unless +@code{header-line-format} is either @code{nil}, or it's a list whose +@sc{car} is a symbol, and either that symbol is @code{:eval} and the +second list element evaluates to @code{nil} or the symbol's value as a +variable is @code{nil} or void. Note that there are other possible +values @code{header-line-format} that result in an empty header line +(for example, @code{""}), but all other values tell Emacs to display a +header line, whether or not it is empty. + If @code{display-line-numbers-mode} is turned on in a buffer (@pxref{Display Custom, display-line-numbers-mode,, emacs, The GNU Emacs Manual}), the buffer text is indented on display by the amount diff --git a/etc/NEWS b/etc/NEWS index 910472e5519..ec1b40aa0a7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -451,6 +451,14 @@ hooks named after the feature name, like 'esh-mode-unload-hook'. +++ ** 'copy-tree' now copies records when its optional 2nd argument is non-nil. ++++ +** Certain values of 'header-line-format' now inhibit empty header line. +Emacs now avoids displaying a header line, instead of displaying an +empty one, when 'header-line-format' is a list whose 'car' is a +symbol, and either that symbol is ':eval' and the second element of +the list evaluates to 'nil' or the symbol's value as a variable is +'nil' or void. + * Lisp Changes in Emacs 30.1 diff --git a/src/lisp.h b/src/lisp.h index 2bfcd1a1983..2978de962d9 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4174,6 +4174,7 @@ verify (FLT_RADIX == 2 || FLT_RADIX == 16); extern void syms_of_xdisp (void); extern void init_xdisp (void); extern Lisp_Object safe_eval (Lisp_Object); +extern Lisp_Object safe_eval_inhibit_quit (Lisp_Object); extern bool pos_visible_p (struct window *, ptrdiff_t, int *, int *, int *, int *, int *, int *); diff --git a/src/window.c b/src/window.c index f4e09f49eae..9429679061e 100644 --- a/src/window.c +++ b/src/window.c @@ -5471,6 +5471,48 @@ window_wants_mode_line (struct window *w) } +/** + * null_header_line_format: + * + * Return non-zero when header line format FMT indicates that the + * header line should not be displayed at all. + * + * This is when FMT is nil, or if FMT is a cons cell and either its + * car is a symbol whose value as a variable is nil or void, or its + * car is the symbol ':eval' and its cadr evaluates to nil. + */ +static bool +null_header_line_format (Lisp_Object fmt, struct frame * f) +{ + Lisp_Object car; + Lisp_Object val; + + if (NILP (fmt)) + return true; + + if (CONSP (fmt)) + { + car = XCAR (fmt); + if (SYMBOLP (car)) + { + if (EQ (car, QCeval)) + { + val = safe_eval_inhibit_quit (XCAR (XCDR (fmt))); + if (!FRAME_LIVE_P (f)) + signal_error (":eval deleted the frame being displayed", fmt); + return NILP (val); + } + val = find_symbol_value (car); + return (SYMBOLP (car) + && (EQ (val, Qunbound) + || NILP (val))); + } + } + + return false; +} + + /** * window_wants_header_line: * @@ -5491,12 +5533,16 @@ window_wants_header_line (struct window *w) Lisp_Object window_header_line_format = window_parameter (w, Qheader_line_format); + struct frame * f = WINDOW_XFRAME(w); + return (WINDOW_LEAF_P (w) && !MINI_WINDOW_P (w) && !WINDOW_PSEUDO_P (w) && !EQ (window_header_line_format, Qnone) - && (!NILP (window_header_line_format) - || !NILP (BVAR (XBUFFER (WINDOW_BUFFER (w)), header_line_format))) + && (!null_header_line_format (window_header_line_format, f) + || !null_header_line_format (BVAR (XBUFFER (WINDOW_BUFFER (w)), + header_line_format), + f)) && (WINDOW_PIXEL_HEIGHT (w) > (window_wants_mode_line (w) ? 2 * WINDOW_FRAME_LINE_HEIGHT (w) diff --git a/src/xdisp.c b/src/xdisp.c index a6ec966ea3c..5e25857322f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3074,6 +3074,12 @@ safe__eval (bool inhibit_quit, Lisp_Object sexpr) return safe__call1 (inhibit_quit, Qeval, sexpr); } +Lisp_Object +safe_eval_inhibit_quit (Lisp_Object sexpr) +{ + return safe__eval (true, sexpr); +} + /* Call function FN with two arguments ARG1 and ARG2. Return the result, or nil if something went wrong. */ commit d751915ef4c10f2dc10555c404fac3c981320b4f Author: Sean Whitton Date: Tue Jun 6 12:15:25 2023 +0100 eval-command-interactive-spec: Shorten code * lisp/emacs-lisp/subr-x.el (eval-command-interactive-spec): Don't reimplement checking for an 'interactive-form symbol property. `interactive-form' already does this. Thanks to Stefan Monnier. diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index a7d8f785508..38f85c242c7 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -507,9 +507,7 @@ emacs-etc--hide-local-variables (defun eval-command-interactive-spec (command) "Evaluate COMMAND's interactive form and return resultant list. If COMMAND has no interactive form, return nil." - (advice-eval-interactive-spec - (cadr (or (and (symbolp command) (get command 'interactive-form)) - (interactive-form command))))) + (advice-eval-interactive-spec (cadr (interactive-form command)))) (provide 'subr-x) commit bcc222251e1a750a11e365f2faa641cc56c1169d Author: Andrea Corallo Date: Tue Jun 6 11:27:13 2023 +0200 Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#58314) * lisp/emacs-lisp/comp.el (comp-write-bytecode-file): New function spilling code from `batch-byte+native-compile'. (batch-byte+native-compile): Make use of. * lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load): Produce the elc file and ask to have it loaded. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 8f40f2f40a0..469f921a38e 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4318,6 +4318,26 @@ batch-native-compile else collect (byte-compile-file file)))) +(defun comp-write-bytecode-file (eln-file) + "After native compilation write the bytecode file for ELN-FILE. +Make sure that eln file is younger than byte-compiled one and +return the filename of this last. + +This function can be used only in conjuntion with +`byte+native-compile' `byte-to-native-output-buffer-file' (see +`batch-byte+native-compile')." + (pcase byte-to-native-output-buffer-file + (`(,temp-buffer . ,target-file) + (unwind-protect + (progn + (byte-write-target-file temp-buffer target-file) + ;; Touch the .eln in order to have it older than the + ;; corresponding .elc. + (when (stringp eln-file) + (set-file-times eln-file))) + (kill-buffer temp-buffer)) + target-file))) + ;;;###autoload (defun batch-byte+native-compile () "Like `batch-native-compile', but used for bootstrap. @@ -4333,16 +4353,7 @@ batch-byte+native-compile (let* ((byte+native-compile t) (byte-to-native-output-buffer-file nil) (eln-file (car (batch-native-compile)))) - (pcase byte-to-native-output-buffer-file - (`(,temp-buffer . ,target-file) - (unwind-protect - (progn - (byte-write-target-file temp-buffer target-file) - ;; Touch the .eln in order to have it older than the - ;; corresponding .elc. - (when (stringp eln-file) - (set-file-times eln-file))) - (kill-buffer temp-buffer)))) + (comp-write-bytecode-file eln-file) (setq command-line-args-left (cdr command-line-args-left))))) ;;;###autoload diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 6fbb87fa3a8..956e3d30bce 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -215,6 +215,8 @@ emacs-lisp-byte-compile-and-load (load (byte-compile-dest-file buffer-file-name))) (declare-function native-compile "comp") +(declare-function comp-write-bytecode-file "comp") + (defun emacs-lisp-native-compile-and-load () "Native-compile synchronously the current file (if it has changed). Load the compiled code when finished. @@ -224,8 +226,10 @@ emacs-lisp-native-compile-and-load native compilation." (interactive nil emacs-lisp-mode) (emacs-lisp--before-compile-buffer) - (when-let ((out (native-compile buffer-file-name))) - (load out))) + (let ((byte+native-compile t) + (byte-to-native-output-buffer-file nil)) + (when-let ((eln (native-compile buffer-file-name))) + (load (file-name-sans-extension (comp-write-bytecode-file eln)))))) (defun emacs-lisp-macroexpand () "Macroexpand the form after point. commit 07c8211ca3075d57dc669946fc4670bb94b79983 Author: Theodor Thornhill Date: Tue Jun 6 06:26:43 2023 +0200 Add 'infer' as a keyword to typescript-ts-mode (bug#63880) * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--keywords): New keyword. diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 09e04f0cd0e..1c19a031878 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -128,7 +128,7 @@ typescript-ts-mode--keywords "case" "catch" "class" "const" "continue" "debugger" "declare" "default" "delete" "do" "else" "enum" "export" "extends" "finally" "for" "from" "function" - "get" "if" "implements" "import" "in" "instanceof" "interface" "is" + "get" "if" "implements" "import" "in" "instanceof" "interface" "is" "infer" "keyof" "let" "namespace" "new" "of" "private" "protected" "public" "readonly" "return" "set" "static" "switch" "target" "throw" "try" "type" "typeof" "var" "void" commit 7ca1d782f5910d0c3978c6798a45c6854ec668c7 Author: Michael Albinus Date: Mon Jun 5 17:16:46 2023 +0200 Improve tree-sitter tests on emba * test/infra/Dockerfile.emba (emacs-tree-sitter): Install further grammars. * test/infra/Makefile.in (subdir_template): Special handling of src. (TREE-SITTER-FILES): Add treesit-tests.el. * test/infra/test-jobs.yml: Regenerate. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 4a3138fe685..f5259150518 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -114,13 +114,19 @@ RUN src/emacs -Q --batch \ --eval '(setq \ treesit-extra-load-path (list "/root/.emacs.d/tree-sitter") \ treesit-language-source-alist \ - (quote ((c "https://github.com/tree-sitter/tree-sitter-c") \ + (quote ((bash "https://github.com/tree-sitter/tree-sitter-bash") \ + (c "https://github.com/tree-sitter/tree-sitter-c") \ (cpp "https://github.com/tree-sitter/tree-sitter-cpp") \ + (css "https://github.com/tree-sitter/tree-sitter-css") \ (elixir "https://github.com/elixir-lang/tree-sitter-elixir") \ (go "https://github.com/tree-sitter/tree-sitter-go") \ (gomod "https://github.com/camdencheek/tree-sitter-go-mod") \ (heex "https://github.com/phoenixframework/tree-sitter-heex") \ + (html "https://github.com/tree-sitter/tree-sitter-html") \ (java "https://github.com/tree-sitter/tree-sitter-java") \ + (javascript "https://github.com/tree-sitter/tree-sitter-javascript") \ + (json "https://github.com/tree-sitter/tree-sitter-json") \ + (python "https://github.com/tree-sitter/tree-sitter-python") \ (ruby "https://github.com/tree-sitter/tree-sitter-ruby") \ (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") \ (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))))' \ diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index 1af13a0096a..5f7d6281a7c 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -43,6 +43,10 @@ define subdir_template $(eval ifeq ($(findstring src, $(1)), src) define changes + @echo ' - $(1)/treesit.{h,c}' >>$(FILE) + @echo ' - test/$(1)/treesit-tests.el' >>$(FILE) + @echo ' when: never' >>$(FILE) + @echo ' - changes:' >>$(FILE) @echo ' - $(1)/*.{h,c}' >>$(FILE) endef else ifeq ($(findstring eieio, $(1)), eieio) @@ -100,7 +104,9 @@ define subdir_template $(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir)))) -TREE-SITTER-FILES ?= $(shell cd .. ; find lisp -name "*-ts-mode-tests.el" | sort | sed s/\\.el/.log/) +TREE-SITTER-FILES ?= $(shell cd .. ; \ + find lisp src \( -name "*-ts-mode-tests.el" -o -name "treesit-tests.el" \) | \ + sort | sed s/\\.el/.log/) all: generate-test-jobs diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index 21c19c3043e..b49dd369611 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml @@ -9,6 +9,10 @@ test-lib-src-inotify: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never + - changes: + - lib-src/treesit.{h,c} + - test/lib-src/treesit-tests.el + when: never - changes: - lib-src/*.{h,c} - test/lib-src/*resources/** @@ -560,6 +564,10 @@ test-src-inotify: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never + - changes: + - src/treesit.{h,c} + - test/src/treesit-tests.el + when: never - changes: - src/*.{h,c} - test/src/*resources/** @@ -578,3 +586,4 @@ test-src-inotify: lisp/progmodes/java-ts-mode-tests.log lisp/progmodes/ruby-ts-mode-tests.log lisp/progmodes/typescript-ts-mode-tests.log + src/treesit-tests.log commit 9a28600a97351bccadb3473b0a7829b09b1bc413 Author: Eli Zaretskii Date: Mon Jun 5 15:57:05 2023 +0300 Fix bug with point-adjustment after M-x COMMAND * src/keyboard.c (command_loop_1): Preserve 'last_point_position' across command execution, to avoid bugs in 'adjust_point_for_property' if the command invokes 'recursive-edit'. Reported by Mats Lidell . diff --git a/src/keyboard.c b/src/keyboard.c index 14c55666768..a1cddf9d145 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1436,6 +1436,7 @@ command_loop_1 (void) prev_buffer = current_buffer; prev_modiff = MODIFF; last_point_position = PT; + ptrdiff_t last_pt = PT; /* By default, we adjust point to a boundary of a region that has such a property that should be treated intangible @@ -1513,6 +1514,9 @@ command_loop_1 (void) unbind_to (scount, Qnil); #endif } + /* Restore last PT position value, possibly clobbered by + recursive-edit invoked by the command we just executed. */ + last_point_position = last_pt; kset_last_prefix_arg (current_kboard, Vcurrent_prefix_arg); safe_run_hooks_maybe_narrowed (Qpost_command_hook, commit dd2d8ff2f5cf5f495a793c7db0a168474a339613 Author: Eli Zaretskii Date: Mon Jun 5 14:50:00 2023 +0300 ; * etc/NEWS: Mention the issue with PGTK on WSL (bug#63384). diff --git a/etc/NEWS b/etc/NEWS index 8f518993856..d3146fab8eb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -135,7 +135,7 @@ use this configuration only if you are running a window system other than X that's supported by GDK. Running this configuration on X is known to have problems, such as undesirable frame positioning and various issues with keyboard input of sequences such as 'C-;' and -'C-S-u'. +'C-S-u'. Running this on WSL is also known to have problems. Note that, unlike the X build of Emacs, the PGTK build cannot automatically switch to text-mode interface (thus emulating '-nw') if commit 26ee0ce6f94cdec2b30d9abc9cbd0c7f468a08c1 Author: Michael Albinus Date: Mon Jun 5 13:29:21 2023 +0200 Adapt emba integration * test/infra/Dockerfile.emba (emacs-tree-sitter): Use "/root/.emacs.d/tree-sitter" instead of "/usr/local/lib/tree-sitter". * test/infra/gitlab-ci.yml (.job-template): Run "/bin/bash -xvc". (test-eglot): Revert last change, it doesn't work yet. (test-tree-sitter): Set TEST_HOME instead of LD_LIBRARY_PATH. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 21b69dacacc..4a3138fe685 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -107,12 +107,12 @@ RUN ./configure --with-tree-sitter RUN make bootstrap # Install language grammars. -RUN mkdir /usr/local/lib/tree-sitter +RUN mkdir -p /root/.emacs.d/tree-sitter RUN git config --global http.sslverify "false" # See https://github.com/emacs-tree-sitter/tree-sitter-langs/tree/master/repos RUN src/emacs -Q --batch \ --eval '(setq \ - treesit-extra-load-path (list "/usr/local/lib/tree-sitter") \ + treesit-extra-load-path (list "/root/.emacs.d/tree-sitter") \ treesit-language-source-alist \ (quote ((c "https://github.com/tree-sitter/tree-sitter-c") \ (cpp "https://github.com/tree-sitter/tree-sitter-cpp") \ @@ -125,7 +125,7 @@ RUN src/emacs -Q --batch \ (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") \ (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))))' \ --eval '(dolist (lang (mapcar (quote car) treesit-language-source-alist)) \ - (treesit-install-language-grammar lang "/usr/local/lib/tree-sitter"))' + (treesit-install-language-grammar lang "/root/.emacs.d/tree-sitter"))' FROM emacs-base as emacs-gnustep diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index d5b18674c70..6884c32848e 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -86,7 +86,7 @@ default: # TODO: with make -j4 several of the tests were failing, for # example shadowfile-tests, but passed without it. - 'export PWD=$(pwd)' - - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} -e EMACS_TEST_JUNIT_REPORT=${EMACS_TEST_JUNIT_REPORT} -e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT} -e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE} --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -c "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j4 && make ${make_params}"' + - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} -e EMACS_TEST_JUNIT_REPORT=${EMACS_TEST_JUNIT_REPORT} -e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT} -e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE} --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -xvc "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j4 && make ${make_params}"' after_script: # - docker ps -a # - printenv @@ -265,14 +265,7 @@ test-eglot: variables: target: emacs-eglot # This is needed in order to get a JUnit test report. - make_params: >- - '-k -C test check-expensive - LOGFILES="lisp/progmodes/eglot-tests.log" - TEST_HOME="/tmp" - EMACS_EXTRAOPT="--eval \(package-reinstall\ \(quote\ company\)\) - --eval \(package-reinstall\ \(quote\ yasnippet\)\) - --eval \(use-package\ company\) - --eval \(use-package\ yasnippet\)"' + make_params: '-k -C test check-expensive LOGFILES="lisp/progmodes/eglot-tests.log"' build-image-tree-sitter: stage: platform-images @@ -289,7 +282,7 @@ test-tree-sitter: variables: target: emacs-tree-sitter # This is needed in order to get a JUnit test report. - make_params: '-k -C test check-expensive LD_LIBRARY_PATH=/usr/local/lib/tree-sitter LOGFILES="$tree_sitter_files"' + make_params: '-k -C test check-expensive TEST_HOME=/root LOGFILES="$tree_sitter_files"' build-image-gnustep: stage: platform-images commit a30781399b3ef48150b9cb13cb0aeba7086c2d9e Author: Sean Whitton Date: Sun Jan 15 10:57:30 2023 -0700 * subr-x (eval-command-interactive-spec): New function. diff --git a/etc/NEWS b/etc/NEWS index 9529282f047..910472e5519 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -648,6 +648,11 @@ Since circular alias chains now cannot occur, 'function-alias-p', 'indirect-function' and 'indirect-variable' will never signal an error. Their 'noerror' arguments have no effect and are therefore obsolete. +--- +** New function 'eval-command-interactive-spec' in the subr-x library. +This function evaluates a command's interactive form and returns the +resultant list. + * Changes in Emacs 30.1 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index e457387acc9..e6977f2012a 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -165,6 +165,8 @@ advice--make-docstring (buffer-string)) usage)))) +;; FIXME: How about renaming this to just `eval-interactive-spec'? +;; It's not specific to the advice system. (defun advice-eval-interactive-spec (spec) "Evaluate the interactive spec SPEC." (cond diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 9e906930b92..a7d8f785508 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -504,6 +504,13 @@ emacs-etc--hide-local-variables (progn (forward-line -1) (point)) (point-max))))) +(defun eval-command-interactive-spec (command) + "Evaluate COMMAND's interactive form and return resultant list. +If COMMAND has no interactive form, return nil." + (advice-eval-interactive-spec + (cadr (or (and (symbolp command) (get command 'interactive-form)) + (interactive-form command))))) + (provide 'subr-x) ;;; subr-x.el ends here commit 6058b4559d4b7d42bbcb6da787a95334aa8994ca Author: Mattias Engdegård Date: Sun Jun 4 15:58:44 2023 +0200 Better internal-make-closure optimisation * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Optimise closed-over values in closure creation like any other, which can lead to stack variables being eliminated. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 562f21aa751..f64674d5a6c 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -447,16 +447,10 @@ byte-optimize-form-code-walker . ,(byte-optimize-body exps for-effect))) ;; Needed as long as we run byte-optimize-form after cconv. - (`(internal-make-closure . ,_) - (and (not for-effect) - (progn - ;; Look up free vars and mark them to be kept, so that they - ;; won't be optimized away. - (dolist (var (caddr form)) - (let ((lexvar (assq var byte-optimize--lexvars))) - (when lexvar - (setcar (cdr lexvar) t)))) - form))) + (`(internal-make-closure ,vars ,env . ,rest) + (if for-effect + `(progn ,@(byte-optimize-body env t)) + `(,fn ,vars ,(mapcar #'byte-optimize-form env) . ,rest))) (`((lambda . ,_) . ,_) (let ((newform (macroexp--unfold-lambda form))) commit 5d3d84066fa66b0f16505ee6e77c8c383277869f Author: Andrea Corallo Date: Sun Jun 4 16:43:13 2023 +0200 * lisp/emacs-lisp/comp-cstr.el (cl-macs): Require it. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index c5b96a6b629..e0db82604f2 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -36,6 +36,7 @@ ;;; Code: (require 'cl-lib) +(require 'cl-macs) (defconst comp--typeof-builtin-types (mapcar (lambda (x) (append x '(t))) commit b5f171f98f46ac309e1678b7d1b5ea93f8b4a34d Author: Andrea Corallo Date: Sun Jun 4 16:25:14 2023 +0200 * lisp/emacs-lisp/comp.el (comp-function-type-spec): Improve. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 696ed8d21f9..b65da148787 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4460,9 +4460,11 @@ comp-function-type-spec type-spec ) (when-let ((res (gethash function comp-known-func-cstr-h))) (setf type-spec (comp-cstr-to-type-spec res))) - (unless type-spec - (setf kind 'inferred - type-spec (subr-type (symbol-function function)))) + (let ((f (symbol-function function))) + (when (and (null type-spec) + (subr-native-elisp-p f)) + (setf kind 'inferred + type-spec (subr-type f)))) (when type-spec (cons type-spec kind)))) commit fa8135f8916d6d0beaa945cc28689060f52a1ecf Author: Philip Kaludercic Date: Sun Jun 4 15:21:04 2023 +0200 Revert changes to the order in which package descs are loaded * lisp/emacs-lisp/package.el (package-load-all-descriptors): Remove NOSORT argument to 'directory-files', reverting back to the behaviour as of Emacs 28. (Bug#63757) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 8f266186d5e..43368b59522 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -739,7 +739,7 @@ package-load-all-descriptors updates `package-alist'." (dolist (dir (cons package-user-dir package-directory-list)) (when (file-directory-p dir) - (dolist (pkg-dir (directory-files dir t "\\`[^.]" t)) + (dolist (pkg-dir (directory-files dir t "\\`[^.]")) (when (file-directory-p pkg-dir) (package-load-descriptor pkg-dir)))))) commit 3f9e0281ad2776e3973a3cceda4b16c9925f6673 Author: Eli Zaretskii Date: Sun Jun 4 15:28:25 2023 +0300 ; Minor doc copyedits in comp.el * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix commentary. (comp-function-type-spec): Doc fix. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index e516c8b5eb9..696ed8d21f9 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -277,9 +277,9 @@ comp-post-pass-hooks ;; FIXME this probably should not be here but... good for now. (defconst comp-known-type-specifiers `( - ;; Functions we can trust not to be redefined or if redefined - ;; should expose the same type. The vast majority of these is - ;; either pure or primitive, the original list is the union of + ;; Functions we can trust not to be redefined, or, if redefined, + ;; to expose the same type. The vast majority of these are + ;; either pure or primitive; the original list is the union of ;; pure + side-effect-free-fns + side-effect-and-error-free-fns: (% (function ((or number marker) (or number marker)) number)) (* (function (&rest (or number marker)) number)) @@ -4449,14 +4449,13 @@ native-compile-prune-cache ;;;###autoload (defun comp-function-type-spec (function) - "Given FUNCTION gives its type specifier. -Return a cons with its car being the function specifier and its -cdr being a symbol. - -If the symbol is `inferred' the type specifier is automatically -inferred from the code itself by the native compiler, if it is -`know' the type specifier comes from -`comp-known-type-specifiers'." + "Return the type specifier of FUNCTION. + +This function returns a cons cell whose car is the function +specifier, and cdr is a symbol, either `inferred' or `know'. +If the symbol is `inferred', the type specifier is automatically +inferred from the code itself by the native compiler; if it is +`know', the type specifier comes from `comp-known-type-specifiers'." (let ((kind 'know) type-spec ) (when-let ((res (gethash function comp-known-func-cstr-h))) commit 508005b3cf91b03736adc6f6edfc1cebe22be0df Author: Mattias Engdegård Date: Sun Jun 4 14:09:39 2023 +0200 ; * lisp/emacs-lisp/comp.el (comp-funciton-type-spec): typo diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 86707dd3516..e516c8b5eb9 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4448,7 +4448,7 @@ native-compile-prune-cache (message "Cache cleared")) ;;;###autoload -(defun comp-funciton-type-spec (function) +(defun comp-function-type-spec (function) "Given FUNCTION gives its type specifier. Return a cons with its car being the function specifier and its cdr being a symbol. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index dcf265ea170..b9388b45397 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -711,7 +711,7 @@ help-fns--signature (unless (and (symbolp function) (get function 'reader-construct)) (insert high-usage "\n") - (when-let* ((res (comp-funciton-type-spec function)) + (when-let* ((res (comp-function-type-spec function)) (type-spec (car res)) (kind (cdr res))) (insert (format commit 53dc1f3fe0aa9b932e6413007e7a6d39c00f1721 Author: Andrea Corallo Date: Tue May 30 15:30:11 2023 +0200 Print know function types in C-h f * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Improve comment. (comp-funciton-type-spec): New function. * lisp/help-fns.el (help-fns--signature): Update to make use of `comp-funciton-type-spec'. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index da551ae2fd9..86707dd3516 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -277,10 +277,10 @@ comp-post-pass-hooks ;; FIXME this probably should not be here but... good for now. (defconst comp-known-type-specifiers `( - ;; Functions we can trust not to be or if redefined should expose - ;; the same type. Vast majority of these is either pure or - ;; primitive, the original list is the union of pure + - ;; side-effect-free-fns + side-effect-and-error-free-fns: + ;; Functions we can trust not to be redefined or if redefined + ;; should expose the same type. The vast majority of these is + ;; either pure or primitive, the original list is the union of + ;; pure + side-effect-free-fns + side-effect-and-error-free-fns: (% (function ((or number marker) (or number marker)) number)) (* (function (&rest (or number marker)) number)) (+ (function (&rest (or number marker)) number)) @@ -4447,6 +4447,26 @@ native-compile-prune-cache (delete-directory subdir)))))) (message "Cache cleared")) +;;;###autoload +(defun comp-funciton-type-spec (function) + "Given FUNCTION gives its type specifier. +Return a cons with its car being the function specifier and its +cdr being a symbol. + +If the symbol is `inferred' the type specifier is automatically +inferred from the code itself by the native compiler, if it is +`know' the type specifier comes from +`comp-known-type-specifiers'." + (let ((kind 'know) + type-spec ) + (when-let ((res (gethash function comp-known-func-cstr-h))) + (setf type-spec (comp-cstr-to-type-spec res))) + (unless type-spec + (setf kind 'inferred + type-spec (subr-type (symbol-function function)))) + (when type-spec + (cons type-spec kind)))) + (provide 'comp) ;; LocalWords: limplified limplification limplify Limple LIMPLE libgccjit elc eln diff --git a/lisp/help-fns.el b/lisp/help-fns.el index c4e09e48bea..dcf265ea170 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -711,10 +711,14 @@ help-fns--signature (unless (and (symbolp function) (get function 'reader-construct)) (insert high-usage "\n") - (when (and (featurep 'native-compile) - (subr-native-elisp-p (symbol-function function)) - (subr-type (symbol-function function))) - (insert (format "\nInferred type: %s\n" (subr-type (symbol-function function)))))) + (when-let* ((res (comp-funciton-type-spec function)) + (type-spec (car res)) + (kind (cdr res))) + (insert (format + (if (eq kind 'inferred) + "\nInferred type: %s\n" + "\nType: %s\n") + type-spec)))) (fill-region fill-begin (point)) high-doc))))) commit 9ed24bfb04f5a878689e09914f1c4b28105ac85e Author: Andrea Corallo Date: Sun Jun 4 11:26:22 2023 +0200 * Have `comp-cstr-to-type-spec' handle comp-cstr-f as well * lisp/emacs-lisp/comp-cstr.el (comp--simple-cstr-to-type-spec): New function. (comp-cstr-to-type-spec): Make use of. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 416ca7f11b0..c5b96a6b629 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -1181,8 +1181,8 @@ comp-type-spec-to-cstr :ret (comp-type-spec-to-cstr ret))) (_ (error "Invalid type specifier")))) -(defun comp-cstr-to-type-spec (cstr) - "Given CSTR return its type specifier." +(defun comp--simple-cstr-to-type-spec (cstr) + "Given a non comp-cstr-f CSTR return its type specifier." (let ((valset (comp-cstr-valset cstr)) (typeset (comp-cstr-typeset cstr)) (range (comp-cstr-range cstr)) @@ -1236,6 +1236,20 @@ comp-cstr-to-type-spec `(not ,final) final)))) +(defun comp-cstr-to-type-spec (cstr) + "Given CSTR return its type specifier." + (cl-etypecase cstr + (comp-cstr-f + `(function + ,(mapcar (lambda (x) + (cl-etypecase x + (comp-cstr (comp-cstr-to-type-spec x)) + (symbol x))) + (comp-cstr-f-args cstr)) + ,(comp--simple-cstr-to-type-spec (comp-cstr-f-ret cstr)))) + (comp-cstr + (comp--simple-cstr-to-type-spec cstr)))) + (provide 'comp-cstr) ;;; comp-cstr.el ends here commit ac1532a7c9a32bb84893f7eb291171e01b99068c Author: Andrea Corallo Date: Sun Jun 4 11:07:38 2023 +0200 * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix line lengths diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 0b5682e23b1..da551ae2fd9 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -307,7 +307,8 @@ comp-known-type-specifiers (bignump (function (t) boolean)) (bobp (function () boolean)) (bolp (function () boolean)) - (bool-vector-count-consecutive (function (bool-vector boolean integer) fixnum)) + (bool-vector-count-consecutive + (function (bool-vector boolean integer) fixnum)) (bool-vector-count-population (function (bool-vector) fixnum)) (bool-vector-not (function (bool-vector &optional bool-vector) bool-vector)) (bool-vector-p (function (t) boolean)) @@ -317,10 +318,12 @@ comp-known-type-specifiers (buffer-file-name (function (&optional buffer) (or string null))) (buffer-list (function (&optional frame) list)) (buffer-local-variables (function (&optional buffer) list)) - (buffer-modified-p (function (&optional buffer) (or boolean (member autosaved)))) + (buffer-modified-p + (function (&optional buffer) (or boolean (member autosaved)))) (buffer-size (function (&optional buffer) integer)) (buffer-string (function () string)) - (buffer-substring (function ((or integer marker) (or integer marker)) string)) + (buffer-substring + (function ((or integer marker) (or integer marker)) string)) (bufferp (function (t) boolean)) (byte-code-function-p (function (t) boolean)) (capitalize (function (or integer string) (or integer string))) @@ -340,17 +343,27 @@ comp-known-type-specifiers (characterp (function (t &optional t) boolean)) (charsetp (function (t) boolean)) (commandp (function (t &optional t) boolean)) - (compare-strings (function (string (or integer marker null) (or integer marker null) string (or integer marker null) (or integer marker null) &optional t) (or (member t) fixnum))) + (compare-strings + (function (string (or integer marker null) (or integer marker null) string + (or integer marker null) (or integer marker null) + &optional t) + (or (member t) fixnum))) (concat (function (&rest sequence) string)) (cons (function (t t) cons)) (consp (function (t) boolean)) - (coordinates-in-window-p (function (cons window) (or cons null (member bottom-divider right-divider mode-line header-line tab-line left-fringe right-fringe vertical-line left-margin right-margin)))) + (coordinates-in-window-p + (function (cons window) + (or cons null + (member bottom-divider right-divider mode-line header-line + tab-line left-fringe right-fringe vertical-line + left-margin right-margin)))) (copy-alist (function (list) list)) (copy-marker (function (&optional (or integer marker) boolean) marker)) (copy-sequence (function (sequence) sequence)) (copysign (function (float float) float)) (cos (function (number) float)) - (count-lines (function ((or integer marker) (or integer marker) &optional t) integer)) + (count-lines + (function ((or integer marker) (or integer marker) &optional t) integer)) (current-buffer (function () buffer)) (current-global-map (function () cons)) (current-indentation (function () integer)) @@ -372,7 +385,8 @@ comp-known-type-specifiers (default-boundp (function (symbol) boolean)) (default-value (function (symbol) t)) (degrees-to-radians (function (number) float)) - (documentation (function ((or function symbol subr) &optional t) (or null string))) + (documentation + (function ((or function symbol subr) &optional t) (or null string))) (downcase (function ((or fixnum string)) (or fixnum string))) (elt (function (sequence integer) t)) (encode-char (function (fixnum symbol) (or fixnum null))) @@ -417,7 +431,9 @@ comp-known-type-specifiers (ftruncate (function (float) float)) (get (function (symbol symbol) t)) (get-buffer (function ((or buffer string)) (or buffer null))) - (get-buffer-window (function (&optional (or buffer string) (or symbol (integer 0 0))) (or null window))) + (get-buffer-window + (function (&optional (or buffer string) (or symbol (integer 0 0))) + (or null window))) (get-file-buffer (function (string) (or null buffer))) (get-largest-window (function (&optional t t t) (or window null))) (get-lru-window (function (&optional t t t) (or window null))) @@ -462,7 +478,10 @@ comp-known-type-specifiers (logxor (function (&rest (or integer marker)) integer)) ;; (lsh (function ((integer ,most-negative-fixnum *) integer) integer)) ? (lsh (function (integer integer) integer)) - (make-byte-code (function ((or fixnum list) string vector integer &optional string t &rest t) vector)) + (make-byte-code + (function ((or fixnum list) string vector integer &optional string t + &rest t) + vector)) (make-list (function (integer t) list)) (make-marker (function () marker)) (make-string (function (integer fixnum &optional t) string)) @@ -480,7 +499,9 @@ comp-known-type-specifiers (min (function ((or number marker) &rest (or number marker)) number)) (minibuffer-selected-window (function () (or window null))) (minibuffer-window (function (&optional frame) window)) - (mod (function ((or number marker) (or number marker)) (or (integer 0 *) (float 0 *)))) + (mod + (function ((or number marker) (or number marker)) + (or (integer 0 *) (float 0 *)))) (mouse-movement-p (function (t) boolean)) (multibyte-char-to-unibyte (function (fixnum) fixnum)) (natnump (function (t) boolean)) @@ -544,7 +565,8 @@ comp-known-type-specifiers (string= (function ((or string symbol) (or string symbol)) boolean)) (stringp (function (t) boolean)) (subrp (function (t) boolean)) - (substring (function ((or string vector) &optional integer integer) (or string vector))) + (substring + (function ((or string vector) &optional integer integer) (or string vector))) (sxhash (function (t) integer)) (sxhash-eq (function (t) integer)) (sxhash-eql (function (t) integer)) commit fe91af936d8e0ea976fc29771ccd6b8fa10293c5 Author: Andrea Corallo Date: Sun Jun 4 12:19:09 2023 +0200 * lisp/emacs-lisp/comp.el: Improve 85cb075b1bd. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 43669e5ce5f..0b5682e23b1 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -412,7 +412,7 @@ comp-known-type-specifiers (frame-root-window (function (&optional (or frame window)) window)) (frame-selected-window (function (&optional (or frame window)) window)) (frame-visible-p (function (frame) (or boolean (member icon)))) - (framep (function (t) (or boolean symbol))) + (framep (function (t) symbol)) (fround (function (float) float)) (ftruncate (function (float) float)) (get (function (symbol symbol) t)) commit 85cb075b1bda405967641e53be5178585cbc2216 Author: Andrea Corallo Date: Sun Jun 4 10:58:32 2023 +0200 * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Tweak framep. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 2ea405728a3..43669e5ce5f 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -412,7 +412,7 @@ comp-known-type-specifiers (frame-root-window (function (&optional (or frame window)) window)) (frame-selected-window (function (&optional (or frame window)) window)) (frame-visible-p (function (frame) (or boolean (member icon)))) - (framep (function (t) (or boolean (member x w32 ns pc pgtk haiku)))) + (framep (function (t) (or boolean symbol))) (fround (function (float) float)) (ftruncate (function (float) float)) (get (function (symbol symbol) t)) commit 27fcfa2c0a756bbe94ff0ea6accf12fd45186e5c Author: Eli Zaretskii Date: Sun Jun 4 10:57:07 2023 +0300 ; * etc/NEWS: Improve instructions for grammar libraries. diff --git a/etc/NEWS b/etc/NEWS index 60aa64b5ede..8f518993856 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -65,12 +65,13 @@ cloning its Git repository, compile the files "scanner.c" and "parser.c" (sometimes named "scanner.cc" and "parser.cc") in the "src" subdirectory of the library's source tree using the C or C++ compiler, then link these two files into a shared library named -"libtree-sitter-LANG.so", where LANG is the name of the language -supported by the grammar as it is expected by the Emacs major mode -(for example, "c" for 'c-ts-mode', "cpp" for 'c++-ts-mode', "python" -for 'python-ts-mode', etc.). Then place the shared library you've -built in the same directory where you keep the other shared libraries -used by Emacs, or in the "tree-sitter" subdirectory of your +"libtree-sitter-LANG.so" ("libtree-sitter-LANG.dll" on MS-Windows, +"libtree-sitter-LANG.dylib" on macOS), where LANG is the name of the +language supported by the grammar as it is expected by the Emacs major +mode (for example, "c" for 'c-ts-mode', "cpp" for 'c++-ts-mode', +"python" for 'python-ts-mode', etc.). Then place the shared library +you've built in the same directory where you keep the other shared +libraries used by Emacs, or in the "tree-sitter" subdirectory of your 'user-emacs-directory', or in a directory mentioned in the variable 'treesit-extra-load-path'. @@ -79,6 +80,11 @@ Emacs modes you will use, as Emacs loads these libraries only when the corresponding mode is turned on in some buffer for the first time in an Emacs session. +We generally recommend to use the latest versions of grammar libraries +available from their sites, as these libraries are in constant +development and occasionally add features and fix important bugs to +follow the advances in the programming languages they support. + +++ ** Emacs can be built with built-in support for accessing SQLite databases. This uses the popular sqlite3 library, and can be disabled by using commit 2a84ab905c8009db4d7df7b8f7cfb34c403081c8 Author: Spencer Baugh Date: Fri Jun 2 20:57:32 2023 -0400 Handle point in last file-name component in minibuffer completion This is a followup to commit e338a8ac41d4a9fd798dda90275abe75ac071335 (Handle point not at EOB in minibuffer-choose-completion). That commit added a heuristic, but the heuristic was insufficient: It still had the original wrong behavior when completing the last file-name component (i.e., the completion category is 'file' and there's no slash after point). This patch makes the heuristic cover that case as well. * lisp/minibuffer.el (minibuffer-next-completion) (minibuffer-choose-completion): If in file completion and there's no slash after point, clear what's after point when we complete. (Bug#62700) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 298f3f8728d..a873e5f9747 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4498,8 +4498,9 @@ minibuffer-next-completion (base-suffix (if (eq (alist-get 'category (cdr md)) 'file) (with-current-buffer buf - (buffer-substring (save-excursion (search-forward "/" nil t) (point)) - (point-max))) + (buffer-substring + (save-excursion (or (search-forward "/" nil t) (point-max))) + (point-max))) "")) (completion-base-affixes (list (car completion-base-affixes) base-suffix))) (choose-completion nil t t)))))) @@ -4524,8 +4525,9 @@ minibuffer-choose-completion (let* ((md (completion--field-metadata (minibuffer--completion-prompt-end))) (base-suffix (if (eq (alist-get 'category (cdr md)) 'file) - (buffer-substring (save-excursion (search-forward "/" nil t) (point)) - (point-max)) + (buffer-substring + (save-excursion (or (search-forward "/" nil t) (point-max))) + (point-max)) ""))) (with-minibuffer-completions-window (let ((completion-use-base-affixes t) commit 6847c01568ef09764ee603fda5e20505453e1e10 Author: Michael Albinus Date: Sat Jun 3 18:32:29 2023 +0200 Adapt emba integration * test/infra/Dockerfile.emba (emacs-eglot, emacs-tree-sitter): Don't install gawk. * test/infra/gitlab-ci.yml (test-eglot): Add company and yasnippet. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 325cff6bd26..21b69dacacc 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -68,7 +68,7 @@ FROM debian:sid as emacs-eglot RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \ - libdbus-1-dev libacl1-dev acl git texinfo gawk gdb \ + libdbus-1-dev libacl1-dev acl git texinfo gdb \ && rm -rf /var/lib/apt/lists/* # Install clangd. @@ -91,7 +91,7 @@ FROM debian:sid as emacs-tree-sitter RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \ - libdbus-1-dev libacl1-dev acl git texinfo gawk gdb \ + libdbus-1-dev libacl1-dev acl git texinfo gdb \ && rm -rf /var/lib/apt/lists/* # Install tree-sitter library. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 4317cccf2a7..d5b18674c70 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -265,7 +265,14 @@ test-eglot: variables: target: emacs-eglot # This is needed in order to get a JUnit test report. - make_params: '-k -C test check-expensive LOGFILES="lisp/progmodes/eglot-tests.log"' + make_params: >- + '-k -C test check-expensive + LOGFILES="lisp/progmodes/eglot-tests.log" + TEST_HOME="/tmp" + EMACS_EXTRAOPT="--eval \(package-reinstall\ \(quote\ company\)\) + --eval \(package-reinstall\ \(quote\ yasnippet\)\) + --eval \(use-package\ company\) + --eval \(use-package\ yasnippet\)"' build-image-tree-sitter: stage: platform-images commit 05f25238b7b53ab63b0b0aba455c8063d532a3a8 Merge: 4bc043ff45d 2eadf328d05 Author: Eli Zaretskii Date: Sat Jun 3 19:22:22 2023 +0300 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29 commit 4bc043ff45d4b02c762474791b054cb33972a2d6 Author: Eli Zaretskii Date: Sat Jun 3 19:20:23 2023 +0300 Avoid asking redundant question in emacsbug.el * lisp/mail/emacsbug.el (report-emacs-bug-hook): Don't ask the question about saving email setup if we cannot save it anyway. (Bug#63816) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index f686c04536c..7a66089aec9 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -455,12 +455,16 @@ report-emacs-bug-hook (setq send-mail-function (sendmail-query-user-about-smtp)) (when (derived-mode-p 'message-mode) (setq message-send-mail-function (message-default-send-mail-function)) - (add-hook 'message-sent-hook - (lambda () - (when (y-or-n-p "Save this mail sending choice?") - (customize-save-variable 'send-mail-function - send-mail-function))) - nil t))) + ;; Don't ask the question below if we are going to ignore it in + ;; 'customize-save-variable' anyway. + (unless (or (null user-init-file) + (and (null custom-file) init-file-had-error)) + (add-hook 'message-sent-hook + (lambda () + (when (y-or-n-p "Save this mail sending choice?") + (customize-save-variable 'send-mail-function + send-mail-function))) + nil t)))) (or report-emacs-bug-no-confirmation ;; mailclient.el does not need a valid From (eq send-mail-function 'mailclient-send-it) commit 2eadf328d05edf3304e5101e14b9aa2ac60a211f Author: Michael Albinus Date: Sat Jun 3 17:52:46 2023 +0200 * test/infra/Dockerfile.emba (emacs-base): Don't install gawk. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index b146f5a2c4d..7f12d682a13 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -29,7 +29,7 @@ FROM debian:bullseye as emacs-base RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \ - libdbus-1-dev libacl1-dev acl git texinfo gawk gdb \ + libdbus-1-dev libacl1-dev acl git texinfo gdb \ && rm -rf /var/lib/apt/lists/* FROM emacs-base as emacs-inotify commit 583ba1db7ee31349eeef94f9dcb6e43f860a32eb Author: Dmitry Gutov Date: Sat Jun 3 15:00:41 2023 +0300 typescript-ts-mode: Add a rule for function_signature * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Add a rule for function_signature (bug#63867) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index e30eb880266..09e04f0cd0e 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -173,9 +173,10 @@ typescript-ts-mode--font-lock-settings :feature 'declaration `((function name: (identifier) @font-lock-function-name-face) - (function_declaration name: (identifier) @font-lock-function-name-face) + (function_signature + name: (identifier) @font-lock-function-name-face) (method_definition name: (property_identifier) @font-lock-function-name-face) commit a3459a28e4191b90688fdd0b58d1972af303bc2a Author: Mattias Engdegård Date: Sat Jun 3 12:50:21 2023 +0200 * admin/unidata/emoji-zwj.awk: Avoid sprint buffer overflow Some AWK implementations have a fixed buffer for sprintf; for mawk the default size is 8192 bytes. Hoist a string concatenation from a sprintf call to avoid running into that limit. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00090.html . (cherry picked from commit b5f17fe07c6624380ba8d0c7a400a6b89f225209) diff --git a/admin/unidata/emoji-zwj.awk b/admin/unidata/emoji-zwj.awk index f13f796bcac..4b648aa675e 100644 --- a/admin/unidata/emoji-zwj.awk +++ b/admin/unidata/emoji-zwj.awk @@ -106,7 +106,7 @@ END { for (elt in ch) { - entries = sprintf("%s\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", vec[elt], elt, elt) + entries = vec[elt] sprintf("\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", elt, elt) printf("(#x%s .\n,(eval-when-compile (regexp-opt\n'(\n%s\n))))\n", elt, entries) } print "))" commit b5f17fe07c6624380ba8d0c7a400a6b89f225209 Author: Mattias Engdegård Date: Sat Jun 3 12:50:21 2023 +0200 * admin/unidata/emoji-zwj.awk: Avoid sprint buffer overflow Some AWK implementations have a fixed buffer for sprintf; for mawk the default size is 8192 bytes. Hoist a string concatenation from a sprintf call to avoid running into that limit. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00090.html . diff --git a/admin/unidata/emoji-zwj.awk b/admin/unidata/emoji-zwj.awk index f13f796bcac..4b648aa675e 100644 --- a/admin/unidata/emoji-zwj.awk +++ b/admin/unidata/emoji-zwj.awk @@ -106,7 +106,7 @@ END { for (elt in ch) { - entries = sprintf("%s\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", vec[elt], elt, elt) + entries = vec[elt] sprintf("\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", elt, elt) printf("(#x%s .\n,(eval-when-compile (regexp-opt\n'(\n%s\n))))\n", elt, entries) } print "))" commit 970f94a2dd8bc4be4d71f1075421093ca6f87d28 Merge: 68b87288aa5 ede3535051a Author: Eli Zaretskii Date: Sat Jun 3 05:50:58 2023 -0400 Merge from origin/emacs-29 ede3535051a ; Fix last change 8ec786349e1 Fix apostrophe handling in rust-ts-mode and go-ts-mode (B... 0eba9cf6511 * test/infra/Dockerfile.emba (emacs-base): Install also g... 4897c98b6c4 Fix 'python-util-clone-local-variables' 6b2c8dc9050 Revert "Enhance Python font-lock to support multilines" 348e4504c6d Fix typo in calc.texi 03663b8798a Update to Transient v0.4.1 dc7acb1aafe Avoid errors in 'delete-forward-char' deleting static com... 2f94f6de9d6 Make VS-15 and VS-16 compositions work correctly 753f8aa1f14 Fix project-name for vc-aware backend in non-file buffers 17c7915ab94 ; Fix 'package-install-upgrade-built-in' check for packag... e252ce26eab Add type_predicate 'is' as keyword in typescript-ts-mode ... 0a354d65784 Fix infloop in info-look.el 83b22139e4c Fix several todo-mode.el item editing bugs (bug#63811) ed4cd3eddf7 dockerfile-ts-mode: Prevent empty categories in imenu (Bu... 2e20e318da2 Brush up doc strings and terminology in plstore.el 372bc1278c2 Add internal documentation on plstore.el 23a14e7b902 Add compact_constructor_declaration font-locking to java-... 500abc4dc37 * lisp/tmm.el (tmm-completion-delete-prompt): Add more ch... afc1f329356 Allow to disable the DWIMish behavior of 'x' in package menu 08104c01504 Allow dired to invoke secondary browser a3063f0bc87 Add a binding for enriched-toggle-markup d8ba28fa394 Fix order of tmm-menubar when 'tmm-mid-prompt' is nil # Conflicts: # etc/NEWS commit 68b87288aa54c2ec701fdf4333fc92e32313c83b Merge: 85af52bacd2 53dc7bec830 Author: Eli Zaretskii Date: Sat Jun 3 05:50:51 2023 -0400 ; Merge from origin/emacs-29 The following commit was skipped: 53dc7bec830 Fix regression when saving tramp-default-proxies-alist (D... commit 85af52bacd2f68d7064683d01f7ed5a220ca9640 Merge: 08b9e75c8e4 3f441525679 Author: Eli Zaretskii Date: Sat Jun 3 05:50:49 2023 -0400 Merge from origin/emacs-29 3f441525679 Save the tree-sitter grammar recipe when installing a gra... c0c7b947baf Add instructions and test file for VS-15/VS-16 3be33aff963 A better fix for "Fix cancellation of Wdired" 756244c6963 ; * lisp/minibuffer.el (completions-header-format): Doc fix. 5d844e129ad Fix tmm-menubar when 'tmm-completion-prompt' is nil # Conflicts: # lisp/treesit.el commit 08b9e75c8e448b69df51c396c2da321a6508bdee Merge: 919f3a7aae0 5e7c826bfa5 Author: Eli Zaretskii Date: Sat Jun 3 05:47:29 2023 -0400 ; Merge from origin/emacs-29 The following commit was skipped: 5e7c826bfa5 ; * lisp/progmodes/project.el: avoid warning in loaddefs. commit 919f3a7aae0481bdfe732eb84ded081e0d89e6c1 Merge: f1fd3d26062 95ee5477e16 Author: Eli Zaretskii Date: Sat Jun 3 05:47:29 2023 -0400 Merge from origin/emacs-29 95ee5477e16 ; * src/lread.c (read0, skip_lazy_string): Fix commentary... commit ede3535051a8f3b209b830adcaba9cb1ddf58685 Author: Eli Zaretskii Date: Sat Jun 3 11:34:11 2023 +0300 ; Fix last change * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--syntax-propertize): Doc fix. (Bug#63708) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index 360fcc89491..c3cf8d0cf44 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -350,10 +350,12 @@ rust-ts-mode--defun-name (treesit-node-child-by-field-name node "name") t)))) (defun rust-ts-mode--syntax-propertize (beg end) - "Apply syntax properties to various special characters with + "Apply syntax properties to special characters between BEG and END. + +Apply syntax properties to various special characters with contextual meaning between BEG and END. -' should be treated as string when used for char literals. +The apostrophe \\=' should be treated as string when used for char literals. < and > are usually punctuation, e.g., as greater/less-than. But when used for types, they should be considered pairs. commit 8ec786349e18068bff39b1387bc4a88d62265e34 Author: Йордан Миладинов Date: Fri May 26 17:23:26 2023 +0300 Fix apostrophe handling in rust-ts-mode and go-ts-mode (Bug#63708) * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--syntax-propertize): Treat apostrophes as strings if used to define character literals. Treat LT and GT as pairs if used to define type parameters (formerly they were treated as pairs only for type arguments). * lisp/progmodes/go-ts-mode.el (go-ts-mode--syntax-table): Treat apostrophes as strings if used to define rune literals. Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 4233b115f19..698c6424ea2 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -58,6 +58,7 @@ go-ts-mode--syntax-table (modify-syntax-entry ?< "." table) (modify-syntax-entry ?> "." table) (modify-syntax-entry ?\\ "\\" table) + (modify-syntax-entry ?\' "\"" table) (modify-syntax-entry ?/ ". 124b" table) (modify-syntax-entry ?* ". 23" table) (modify-syntax-entry ?\n "> b" table) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index be06acde3e3..360fcc89491 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -350,7 +350,10 @@ rust-ts-mode--defun-name (treesit-node-child-by-field-name node "name") t)))) (defun rust-ts-mode--syntax-propertize (beg end) - "Apply syntax text property to template delimiters between BEG and END. + "Apply syntax properties to various special characters with +contextual meaning between BEG and END. + +' should be treated as string when used for char literals. < and > are usually punctuation, e.g., as greater/less-than. But when used for types, they should be considered pairs. @@ -359,11 +362,18 @@ rust-ts-mode--syntax-propertize appropriate text property to alter the syntax of template delimiters < and >'s." (goto-char beg) + (while (search-forward "'" end t) + (when (string-equal "char_literal" + (treesit-node-type + (treesit-node-at (match-beginning 0)))) + (put-text-property (match-beginning 0) (match-end 0) + 'syntax-table (string-to-syntax "\"")))) + (goto-char beg) (while (re-search-forward (rx (or "<" ">")) end t) (pcase (treesit-node-type (treesit-node-parent (treesit-node-at (match-beginning 0)))) - ("type_arguments" + ((or "type_arguments" "type_parameters") (put-text-property (match-beginning 0) (match-end 0) 'syntax-table commit f1fd3d2606220ee55046e0adb0cc0688c7327c14 Author: Michael Albinus Date: Sat Jun 3 10:19:02 2023 +0200 Adapt emba integration * admin/notes/emba: Improve docker call. * test/infra/Dockerfile.emba (emacs-eglot, emacs-tree-sitter): Install also gawk. * test/infra/Makefile.in (TREE-SITTER-FILES): New variable. (tree-sitter-files-template): New rule. (.PHONY, generate-test-jobs): Add it to dependencies. * test/infra/gitlab-ci.yml (variables): Disable CI_DEBUG_TRACE. (test-tree-sitter): Extends also .tree-sitter-files-template. Use $tree_sitter_files. * test/infra/test-jobs.yml: Regenerate. diff --git a/admin/notes/emba b/admin/notes/emba index 1f87a99ddc0..cad7a2e121c 100644 --- a/admin/notes/emba +++ b/admin/notes/emba @@ -107,12 +107,11 @@ via "make bootstrap". In order to use the image, start a container like docker run --interactive --tty --env EMACS_EMBA_CI=1 --name emacs-inotify \ - emacs-inotify /bin/sh -i + emacs-inotify /bin/bash -i -In this container, change the current directory to "/checkout". Now -you can apply all commands known for Emacs, like +In this container, your working directory is "/checkout". Now you can +apply all commands known for Emacs, like - cd /checkout make -C test files-tests.log While this container runs, you can also access its filesystem from diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 1969afdd333..c2e3afadb05 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -68,7 +68,7 @@ FROM debian:sid as emacs-eglot RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \ - libdbus-1-dev libacl1-dev acl git texinfo gdb \ + libdbus-1-dev libacl1-dev acl git texinfo gawk gdb \ && rm -rf /var/lib/apt/lists/* # Install clangd. @@ -91,7 +91,7 @@ FROM debian:sid as emacs-tree-sitter RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \ - libdbus-1-dev libacl1-dev acl git texinfo gdb \ + libdbus-1-dev libacl1-dev acl git texinfo gawk gdb \ && rm -rf /var/lib/apt/lists/* # Install tree-sitter library. diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index 5d40698541d..1af13a0096a 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -100,11 +100,20 @@ define subdir_template $(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir)))) +TREE-SITTER-FILES ?= $(shell cd .. ; find lisp -name "*-ts-mode-tests.el" | sort | sed s/\\.el/.log/) + all: generate-test-jobs -.PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) +.PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) tree-sitter-files-template + +generate-test-jobs: $(FILE) $(SUBDIR_TARGETS) tree-sitter-files-template -generate-test-jobs: $(FILE) $(SUBDIR_TARGETS) +tree-sitter-files-template: + @echo >>$(FILE) + @echo '.tree-sitter-files-template:' >>$(FILE) + @echo ' variables:' >>$(FILE) + @echo ' tree_sitter_files: >-' >>$(FILE) + @for name in $(TREE-SITTER-FILES) ; do echo " $${name}" >>$(FILE) ; done $(FILE): $(AM_V_GEN) diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index ce2a92620fb..4317cccf2a7 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -58,7 +58,7 @@ variables: # across multiple builds. BUILD_TAG: ${CI_COMMIT_REF_SLUG} # Disable if you don't need it, it can be a security risk. - CI_DEBUG_TRACE: "true" + # CI_DEBUG_TRACE: "true" default: image: docker:19.03.12 @@ -275,22 +275,14 @@ build-image-tree-sitter: test-tree-sitter: stage: platforms - extends: [.job-template, .test-template, .tree-sitter-template] + extends: [.job-template, .test-template, .tree-sitter-template, .tree-sitter-files-template] needs: - job: build-image-tree-sitter optional: true variables: target: emacs-tree-sitter # This is needed in order to get a JUnit test report. - files: >- - lisp/progmodes/c-ts-mode-tests.log - lisp/progmodes/elixir-ts-mode-tests.log - lisp/progmodes/go-ts-mode-tests.log - lisp/progmodes/heex-ts-mode-tests.log - lisp/progmodes/java-ts-mode-tests.log - lisp/progmodes/ruby-ts-mode-tests.log - lisp/progmodes/typescript-ts-mode-tests.log - make_params: '-k -C test check-expensive LD_LIBRARY_PATH=/usr/local/lib/tree-sitter LOGFILES="$files"' + make_params: '-k -C test check-expensive LD_LIBRARY_PATH=/usr/local/lib/tree-sitter LOGFILES="$tree_sitter_files"' build-image-gnustep: stage: platform-images diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index 4e575d50e9a..21c19c3043e 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml @@ -567,3 +567,14 @@ test-src-inotify: variables: target: emacs-inotify make_params: "-k -C test check-src" + +.tree-sitter-files-template: + variables: + tree_sitter_files: >- + lisp/progmodes/c-ts-mode-tests.log + lisp/progmodes/elixir-ts-mode-tests.log + lisp/progmodes/go-ts-mode-tests.log + lisp/progmodes/heex-ts-mode-tests.log + lisp/progmodes/java-ts-mode-tests.log + lisp/progmodes/ruby-ts-mode-tests.log + lisp/progmodes/typescript-ts-mode-tests.log commit 0eba9cf65119a68596c4bf3689086a517d51ce72 Author: Michael Albinus Date: Sat Jun 3 09:54:52 2023 +0200 * test/infra/Dockerfile.emba (emacs-base): Install also gawk. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 7f12d682a13..b146f5a2c4d 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -29,7 +29,7 @@ FROM debian:bullseye as emacs-base RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \ - libdbus-1-dev libacl1-dev acl git texinfo gdb \ + libdbus-1-dev libacl1-dev acl git texinfo gawk gdb \ && rm -rf /var/lib/apt/lists/* FROM emacs-base as emacs-inotify commit 8d6dd1682e2d42a813f9649e70da7aa7d6a95021 Author: Steven Allen Date: Tue May 16 16:07:36 2023 -0700 Fix use-package :vc keyword when byte-compiled * lisp/use-package/use-package-core.el (use-package-handler/:vc): Return the new 'body'. Otherwise, the entire package declaration gets dropped when byte-compiling. * test/lisp/use-package/use-package-tests.el (use-package-test-handler/:vc-6): test it. diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 0d99e270a3f..e0e16134ed3 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -1619,7 +1619,8 @@ use-package-handler/:vc ;; See `use-package-handler/:ensure' for an explanation. (if (bound-and-true-p byte-compile-current-file) (funcall #'use-package-vc-install arg local-path) ; compile time - (push `(use-package-vc-install ',arg ,local-path) body)))) ; runtime + (push `(use-package-vc-install ',arg ,local-path) body)) ; runtime + body)) (defun use-package-normalize--vc-arg (arg) "Normalize possible arguments to the `:vc' keyword. diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el index c8c20fc51cb..9181a8171a7 100644 --- a/test/lisp/use-package/use-package-tests.el +++ b/test/lisp/use-package/use-package-tests.el @@ -1991,6 +1991,17 @@ use-package-test/:vc-5 (use-package-vc-install '(other-name) ,load-path?) (require 'foo nil nil))))) +(ert-deftest use-package-test-handler/:vc-6 () + (let ((byte-compile-current-file "use-package-core.el") + tried-to-install) + (cl-letf (((symbol-function #'use-package-vc-install) + (lambda (arg &optional local-path) + (setq tried-to-install arg)))) + (should (equal + (use-package-handler/:vc 'foo nil 'some-pkg '(:init (foo)) nil) + '(foo))) + (should (eq tried-to-install 'some-pkg))))) + (ert-deftest use-package-test-normalize/:vc () (should (equal '(foo "version-string") (use-package-normalize/:vc 'foo :vc '("version-string")))) commit 4897c98b6c496801aad2477c289a40a300eee27f Author: Eli Zaretskii Date: Sat Jun 3 10:20:08 2023 +0300 Fix 'python-util-clone-local-variables' * lisp/progmodes/python.el (python-util-clone-local-variables): Avoid signaling an error when a local variable is unbound. Patch by Ernesto Alfonso . (Bug#63818) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 974e07c3c6a..fd196df7550 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6094,7 +6094,8 @@ python-util-clone-local-variables to \"^python-\"." (mapc (lambda (pair) - (and (symbolp (car pair)) + (and (consp pair) + (symbolp (car pair)) (string-match (or regexp "^python-") (symbol-name (car pair))) (set (make-local-variable (car pair)) commit 6b2c8dc9050c5c0514fa404733ce1d4a37d00e39 Author: kobarity Date: Fri Jun 2 22:52:57 2023 +0900 Revert "Enhance Python font-lock to support multilines" This reverts commit 4915ca5dd4245a909c046e6691e8d4a1919890c8. We have found that there are performance issues when editing a large file. The issue can be reproduced as follows: 1. emacs -Q 2. Open large Python file (e.g. turtle.py in Python) 3. Near the top of the buffer, enter open paren and some characters. The above commit extends the region to be font-locked using `python-nav-end-of-statement'. However, if there are unbalanced parens, it may move point to the end of the buffer. This causes almost the entire buffer to be font-locked, which is not acceptable for large files. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index adaeacc2ec1..974e07c3c6a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -415,7 +415,6 @@ python-rx "Python mode specialized rx macro. This variant of `rx' supports common Python named REGEXPS." `(rx-let ((sp-bsnl (or space (and ?\\ ?\n))) - (sp-nl (or space (and (? ?\\) ?\n))) (block-start (seq symbol-start (or "def" "class" "if" "elif" "else" "try" "except" "finally" "for" "while" "with" @@ -650,9 +649,9 @@ python--string-bytes-literal-matcher finally return (and result-valid result)))) (defvar python-font-lock-keywords-level-1 - `((,(python-rx symbol-start "def" (1+ sp-bsnl) (group symbol-name)) + `((,(python-rx symbol-start "def" (1+ space) (group symbol-name)) (1 font-lock-function-name-face)) - (,(python-rx symbol-start "class" (1+ sp-bsnl) (group symbol-name)) + (,(python-rx symbol-start "class" (1+ space) (group symbol-name)) (1 font-lock-type-face))) "Font lock keywords to use in `python-mode' for level 1 decoration. @@ -792,12 +791,12 @@ python-font-lock-keywords-maximum-decoration ;; [*a] = 5, 6 ;; are handled separately below (,(python-font-lock-assignment-matcher - (python-rx (? (or "[" "(") (* sp-nl)) - grouped-assignment-target (* sp-nl) ?, (* sp-nl) - (* assignment-target (* sp-nl) ?, (* sp-nl)) - (? assignment-target (* sp-nl)) - (? ?, (* sp-nl)) - (? (or ")" "]") (* sp-bsnl)) + (python-rx (? (or "[" "(") (* space)) + grouped-assignment-target (* space) ?, (* space) + (* assignment-target (* space) ?, (* space)) + (? assignment-target (* space)) + (? ?, (* space)) + (? (or ")" "]") (* space)) (group assignment-operator))) (1 font-lock-variable-name-face) (2 'font-lock-operator-face) @@ -813,9 +812,9 @@ python-font-lock-keywords-maximum-decoration ;; c: Collection = {1, 2, 3} ;; d: Mapping[int, str] = {1: 'bar', 2: 'baz'} (,(python-font-lock-assignment-matcher - (python-rx (or line-start ?\;) (* sp-bsnl) - grouped-assignment-target (* sp-bsnl) - (? ?: (* sp-bsnl) (+ not-simple-operator) (* sp-bsnl)) + (python-rx (or line-start ?\;) (* space) + grouped-assignment-target (* space) + (? ?: (* space) (+ not-simple-operator) (* space)) (group assignment-operator))) (1 font-lock-variable-name-face) (2 'font-lock-operator-face)) @@ -824,10 +823,10 @@ python-font-lock-keywords-maximum-decoration ;; [a] = 5, ;; [*a] = 5, 6 (,(python-font-lock-assignment-matcher - (python-rx (or line-start ?\; ?=) (* sp-bsnl) - (or "[" "(") (* sp-nl) - grouped-assignment-target (* sp-nl) - (or ")" "]") (* sp-bsnl) + (python-rx (or line-start ?\; ?=) (* space) + (or "[" "(") (* space) + grouped-assignment-target (* space) + (or ")" "]") (* space) (group assignment-operator))) (1 font-lock-variable-name-face) (2 'font-lock-operator-face)) @@ -869,22 +868,6 @@ python-font-lock-keywords Which one will be chosen depends on the value of `font-lock-maximum-decoration'.") -(defvar font-lock-beg) -(defvar font-lock-end) -(defun python-font-lock-extend-region () - "Extend font-lock region to statement boundaries." - (let ((beg font-lock-beg) - (end font-lock-end)) - (goto-char beg) - (python-nav-beginning-of-statement) - (beginning-of-line) - (when (< (point) beg) - (setq font-lock-beg (point))) - (goto-char end) - (python-nav-end-of-statement) - (when (< end (point)) - (setq font-lock-end (point))) - (or (/= beg font-lock-beg) (/= end font-lock-end)))) (defconst python-syntax-propertize-function (syntax-propertize-rules @@ -6709,8 +6692,6 @@ python-mode nil nil nil nil (font-lock-syntactic-face-function . python-font-lock-syntactic-face-function))) - (add-hook 'font-lock-extend-region-functions - #'python-font-lock-extend-region nil t) (setq-local syntax-propertize-function python-syntax-propertize-function) (setq-local imenu-create-index-function diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index cbaf5b698bd..e1b4c0a74c0 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -136,20 +136,6 @@ python-tests-get-buffer-faces while pos collect (cons pos (get-text-property pos 'face)))) -(defun python-tests-assert-faces-after-change (content faces search replace) - "Assert that font faces for CONTENT are equal to FACES after change. -All occurrences of SEARCH are changed to REPLACE." - (python-tests-with-temp-buffer - content - ;; Force enable font-lock mode without jit-lock. - (rename-buffer "*python-font-lock-test*" t) - (let (noninteractive font-lock-support-mode) - (font-lock-mode)) - (while - (re-search-forward search nil t) - (replace-match replace)) - (should (equal faces (python-tests-get-buffer-faces))))) - (defun python-tests-self-insert (char-or-str) "Call `self-insert-command' for chars in CHAR-OR-STR." (let ((chars @@ -297,13 +283,6 @@ python-font-lock-keywords-level-1-2 "def 1func():" '((1 . font-lock-keyword-face) (4)))) -(ert-deftest python-font-lock-keywords-level-1-3 () - (python-tests-assert-faces - "def \\ - func():" - '((1 . font-lock-keyword-face) (4) - (15 . font-lock-function-name-face) (19)))) - (ert-deftest python-font-lock-assignment-statement-1 () (python-tests-assert-faces "a, b, c = 1, 2, 3" @@ -495,129 +474,6 @@ python-font-lock-assignment-statement-18 (136 . font-lock-operator-face) (137) (144 . font-lock-keyword-face) (150)))) -(ert-deftest python-font-lock-assignment-statement-multiline-1 () - (python-tests-assert-faces-after-change - " -[ - a, - b -] # ( - 1, - 2 -) -" - '((1) - (8 . font-lock-variable-name-face) (9) - (15 . font-lock-variable-name-face) (16) - (19 . font-lock-operator-face) (20)) - "#" "=")) - -(ert-deftest python-font-lock-assignment-statement-multiline-2 () - (python-tests-assert-faces-after-change - " -[ - *a -] # 5, 6 -" - '((1) - (8 . font-lock-operator-face) - (9 . font-lock-variable-name-face) (10) - (13 . font-lock-operator-face) (14)) - "#" "=")) - -(ert-deftest python-font-lock-assignment-statement-multiline-3 () - (python-tests-assert-faces-after-change - "a\\ - ,\\ - b\\ - ,\\ - c\\ - #\\ - 1\\ - ,\\ - 2\\ - ,\\ - 3" - '((1 . font-lock-variable-name-face) (2) - (15 . font-lock-variable-name-face) (16) - (29 . font-lock-variable-name-face) (30) - (36 . font-lock-operator-face) (37)) - "#" "=")) - -(ert-deftest python-font-lock-assignment-statement-multiline-4 () - (python-tests-assert-faces-after-change - "a\\ - :\\ - int\\ - #\\ - 5" - '((1 . font-lock-variable-name-face) (2) - (15 . font-lock-builtin-face) (18) - (24 . font-lock-operator-face) (25)) - "#" "=")) - -(ert-deftest python-font-lock-assignment-statement-multiline-5 () - (python-tests-assert-faces-after-change - "(\\ - a\\ -)\\ - #\\ - 5\\ - ;\\ - (\\ - b\\ - )\\ - #\\ - 6" - '((1) - (8 . font-lock-variable-name-face) (9) - (18 . font-lock-operator-face) (19) - (46 . font-lock-variable-name-face) (47) - (60 . font-lock-operator-face) (61)) - "#" "=")) - -(ert-deftest python-font-lock-assignment-statement-multiline-6 () - (python-tests-assert-faces-after-change - "( - a -)\\ - #\\ - 5\\ - ;\\ - ( - b - )\\ - #\\ - 6" - '((1) - (7 . font-lock-variable-name-face) (8) - (16 . font-lock-operator-face) (17) - (43 . font-lock-variable-name-face) (44) - (56 . font-lock-operator-face) (57)) - "#" "=")) - -(ert-deftest python-font-lock-operator-1 () - (python-tests-assert-faces - "1 << 2 ** 3 == +4%-5|~6&7^8%9" - '((1) - (3 . font-lock-operator-face) (5) - (8 . font-lock-operator-face) (10) - (13 . font-lock-operator-face) (15) - (16 . font-lock-operator-face) (17) - (18 . font-lock-operator-face) (20) - (21 . font-lock-operator-face) (23) - (24 . font-lock-operator-face) (25) - (26 . font-lock-operator-face) (27) - (28 . font-lock-operator-face) (29)))) - -(ert-deftest python-font-lock-operator-2 () - "Keyword operators are font-locked as keywords." - (python-tests-assert-faces - "is_ is None" - '((1) - (5 . font-lock-keyword-face) (7) - (8 . font-lock-constant-face)))) - (ert-deftest python-font-lock-escape-sequence-string-newline () (python-tests-assert-faces "'\\n' commit 348e4504c6d5588443809ec28da3c3c693368e16 Author: Eli Zaretskii Date: Sat Jun 3 09:14:44 2023 +0300 Fix typo in calc.texi * doc/misc/calc.texi (Programming Tutorial): Fix a typo. Suggested by Vladimir Nikishkin . diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 4b62eee56e2..3b525996d6f 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -6217,7 +6217,7 @@ Programming Tutorial @cindex Gamma constant, Euler's @cindex Euler's gamma constant (@bullet{}) @strong{Exercise 9.} The @dfn{digamma} function -@texline @math{\psi(z) (``psi'')} +@texline @math{\psi(z)} (``psi'') @infoline @expr{psi(z)} is defined as the derivative of @texline @math{\ln \Gamma(z)}. commit 03663b8798a06bf18ff1e235ac0fb87870f8fe77 Author: Jonas Bernoulli Date: Fri Jun 2 23:26:45 2023 +0200 Update to Transient v0.4.1 diff --git a/doc/misc/transient.texi b/doc/misc/transient.texi index 330fdd1e3a2..be9e8698ab4 100644 --- a/doc/misc/transient.texi +++ b/doc/misc/transient.texi @@ -31,7 +31,7 @@ @finalout @titlepage @title Transient User and Developer Manual -@subtitle for version 0.4.0 +@subtitle for version 0.4.1 @author Jonas Bernoulli @page @vskip 0pt plus 1filll @@ -74,7 +74,7 @@ Top @end quotation @noindent -This manual is for Transient version 0.4.0. +This manual is for Transient version 0.4.1. @insertcopying @end ifnottex @@ -2150,7 +2150,7 @@ Suffix Slots @item @code{always-read} For options, whether to read a value on every invocation. -If this is nil, then options that have a value are simply unset and +If this is @code{nil}, then options that have a value are simply unset and have to be invoked a second time to set a new value. @item diff --git a/lisp/transient.el b/lisp/transient.el index 1d763c4ddeb..048554eee13 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -6,7 +6,7 @@ ;; URL: https://github.com/magit/transient ;; Keywords: extensions -;; Package-Version: 0.4.0 +;; Package-Version: 0.4.1 ;; Package-Requires: ((emacs "26.1")) ;; SPDX-License-Identifier: GPL-3.0-or-later @@ -1643,6 +1643,7 @@ transient-predicate-map "" #'transient--do-stay "" #'transient--do-stay "" #'transient--do-stay + "" #'transient--do-stay "" #'transient--do-minus "" #'transient--do-stay "" #'transient--do-quit-all @@ -3043,10 +3044,12 @@ transient-infix-set (progn (cl-call-next-method obj value) (dolist (arg incomp) - (when-let ((obj (cl-find-if (lambda (obj) - (and (slot-boundp obj 'argument) - (equal (oref obj argument) arg))) - transient--suffixes))) + (when-let ((obj (cl-find-if + (lambda (obj) + (and (slot-exists-p obj 'argument) + (slot-boundp obj 'argument) + (equal (oref obj argument) arg))) + transient--suffixes))) (let ((transient--unset-incompatible nil)) (transient-infix-set obj nil))))) (cl-call-next-method obj value)))) @@ -3253,6 +3256,8 @@ transient--show (with-current-buffer buf (when transient-enable-popup-navigation (setq focus (or (button-get (point) 'command) + (and (not (bobp)) + (button-get (1- (point)) 'command)) (transient--heading-at-point)))) (erase-buffer) (setq window-size-fixed t) @@ -3384,7 +3389,9 @@ transient--insert-group (insert ?\n) (insert (propertize " " 'display `(space :align-to (,(nth (1+ c) cc))))))) - (insert (make-string (max 1 (- (nth c cc) (current-column))) ?\s)) + (when (> c 0) + (insert (make-string (max 1 (- (nth c cc) (current-column))) + ?\s))) (when-let ((cell (nth r (nth c columns)))) (insert cell)) (when (= c (1- cs)) commit dc7acb1aafe9b0b84481ac51a5bd5125d263537e Author: Eli Zaretskii Date: Fri Jun 2 15:42:42 2023 +0300 Avoid errors in 'delete-forward-char' deleting static compositions * lisp/simple.el (delete-forward-char): Fix recognition of static compositions. (Bug#63837) diff --git a/lisp/simple.el b/lisp/simple.el index 3f88fcb8d03..9df5958a168 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1520,7 +1520,8 @@ delete-forward-char (let ((from (car cmp)) (to (cadr cmp))) (cond - ((= (length cmp) 2) ; static composition + ((and (= (length cmp) 3) ; static composition + (booleanp (nth 2 cmp))) to) ;; TO can be at POS, in which case we want ;; to make sure we advance at least by 1 commit 2f94f6de9d64f9fd89284dac171e166e7d721dcd Author: Robert Pluim Date: Fri Jun 2 13:54:56 2023 +0200 Make VS-15 and VS-16 compositions work correctly There is a conflict between forward matching and backward matching composition rules involving the same codepoint, which can cause the backward matching ones not to be invoked. Ensure that VS-15 (U+FE0E) and VS-16 (U+FE0F) are composed by forward matching rules instead in order to avoid this issue. * admin/unidata/emoji-zwj.awk: Add rules for CHAR+VS-15 and CHAR+VS-16. * lisp/composite.el: remove backward matching rule for VS-15. (Bug#63731) diff --git a/admin/unidata/emoji-zwj.awk b/admin/unidata/emoji-zwj.awk index 7d2ff6cb900..f13f796bcac 100644 --- a/admin/unidata/emoji-zwj.awk +++ b/admin/unidata/emoji-zwj.awk @@ -106,7 +106,8 @@ END { for (elt in ch) { - printf("(#x%s .\n,(eval-when-compile (regexp-opt\n'(\n%s\n))))\n", elt, vec[elt]) + entries = sprintf("%s\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", vec[elt], elt, elt) + printf("(#x%s .\n,(eval-when-compile (regexp-opt\n'(\n%s\n))))\n", elt, entries) } print "))" print " (set-char-table-range composition-function-table" diff --git a/lisp/composite.el b/lisp/composite.el index fb8b76114f4..9710c3c371b 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -861,7 +861,7 @@ compose-gstring-for-variation-glyph ;; handled in font_range, we end up choosing the Emoji presentation ;; rather than the Text presentation. (let ((elt '([".." 1 compose-gstring-for-variation-glyph]))) - (set-char-table-range composition-function-table '(#xFE00 . #xFE0E) elt) + (set-char-table-range composition-function-table '(#xFE00 . #xFE0D) elt) (set-char-table-range composition-function-table '(#xE0100 . #xE01EF) elt)) (defun auto-compose-chars (func from to font-object string direction) commit f947a0219bb6e43966e0e4e61ad6a15b0ed13e18 Author: Michael Albinus Date: Fri Jun 2 13:44:00 2023 +0200 Fix tree-sitter tests on emba * test/infra/Makefile.in: Revert tree-sitter relevant changes. * test/infra/gitlab-ci.yml (test-tree-sitter): Remove .tree-sitter-files-template. List files explicitly. * test/infra/test-jobs.yml: Regenerate. diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index 057d44f6539..5d40698541d 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -100,20 +100,11 @@ define subdir_template $(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir)))) -TREE-SITTER-FILES ?= '"'$(shell cd .. ; find lisp -name "*-ts-*.el" | sort | sed s/\\.el/.log/)'"' - all: generate-test-jobs -.PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) tree-sitter-files-template - -generate-test-jobs: $(FILE) $(SUBDIR_TARGETS) tree-sitter-files-template +.PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) -tree-sitter-files-template: - @echo >>$(FILE) - @echo '.tree-sitter-files-template:' >>$(FILE) - @echo ' variables:' >>$(FILE) - @echo ' tree-sitter-files: >-' >>$(FILE) - @for name in $(TREE-SITTER-FILES) ; do echo " $${name}" >>$(FILE) ; done +generate-test-jobs: $(FILE) $(SUBDIR_TARGETS) $(FILE): $(AM_V_GEN) diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 213176bef70..ce2a92620fb 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -275,14 +275,22 @@ build-image-tree-sitter: test-tree-sitter: stage: platforms - extends: [.job-template, .test-template, .tree-sitter-template, .tree-sitter-files-template] + extends: [.job-template, .test-template, .tree-sitter-template] needs: - job: build-image-tree-sitter optional: true variables: target: emacs-tree-sitter # This is needed in order to get a JUnit test report. - make_params: '-k -C test check-expensive LD_LIBRARY_PATH=/usr/local/lib/tree-sitter LOGFILES="$tree-sitter-files"' + files: >- + lisp/progmodes/c-ts-mode-tests.log + lisp/progmodes/elixir-ts-mode-tests.log + lisp/progmodes/go-ts-mode-tests.log + lisp/progmodes/heex-ts-mode-tests.log + lisp/progmodes/java-ts-mode-tests.log + lisp/progmodes/ruby-ts-mode-tests.log + lisp/progmodes/typescript-ts-mode-tests.log + make_params: '-k -C test check-expensive LD_LIBRARY_PATH=/usr/local/lib/tree-sitter LOGFILES="$files"' build-image-gnustep: stage: platform-images diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index 48c5b726f28..4e575d50e9a 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml @@ -567,14 +567,3 @@ test-src-inotify: variables: target: emacs-inotify make_params: "-k -C test check-src" - -.tree-sitter-files-template: - variables: - tree-sitter-files: >- - "lisp/progmodes/c-ts-mode-tests.log - lisp/progmodes/elixir-ts-mode-tests.log - lisp/progmodes/go-ts-mode-tests.log - lisp/progmodes/heex-ts-mode-tests.log - lisp/progmodes/java-ts-mode-tests.log - lisp/progmodes/ruby-ts-mode-tests.log - lisp/progmodes/typescript-ts-mode-tests.log" commit 753f8aa1f14c2ff5d86b086230d600eb9bb5d8bc Author: Dmitry Gutov Date: Fri Jun 2 05:10:15 2023 +0300 Fix project-name for vc-aware backend in non-file buffers * lisp/progmodes/project.el (project-name): Make sure project-vc-name is picked up from dir-locals in all non-file-visiting buffers too (mentioned in bug#63469). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 617ca45ed0d..d482cc24d70 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -805,8 +805,8 @@ project-buffers (push buf bufs))) (nreverse bufs))) -(cl-defmethod project-name ((_project (head vc))) - (or project-vc-name +(cl-defmethod project-name ((project (head vc))) + (or (project--value-in-dir 'project-vc-name (project-root project)) (cl-call-next-method))) commit 9f5ca95ef770fe43aa6700b238361ec76da7f3fa Author: Andrea Corallo Date: Thu Jun 1 15:53:39 2023 +0200 * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix a bunch of diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index b2704ae1446..2ea405728a3 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -317,7 +317,7 @@ comp-known-type-specifiers (buffer-file-name (function (&optional buffer) (or string null))) (buffer-list (function (&optional frame) list)) (buffer-local-variables (function (&optional buffer) list)) - (buffer-modified-p (function (&optional buffer) boolean)) + (buffer-modified-p (function (&optional buffer) (or boolean (member autosaved)))) (buffer-size (function (&optional buffer) integer)) (buffer-string (function () string)) (buffer-substring (function ((or integer marker) (or integer marker)) string)) @@ -344,7 +344,7 @@ comp-known-type-specifiers (concat (function (&rest sequence) string)) (cons (function (t t) cons)) (consp (function (t) boolean)) - (coordinates-in-window-p (function (cons window) boolean)) + (coordinates-in-window-p (function (cons window) (or cons null (member bottom-divider right-divider mode-line header-line tab-line left-fringe right-fringe vertical-line left-margin right-margin)))) (copy-alist (function (list) list)) (copy-marker (function (&optional (or integer marker) boolean) marker)) (copy-sequence (function (sequence) sequence)) @@ -363,7 +363,7 @@ comp-known-type-specifiers (current-time-zone (function (&optional (or number list) (or symbol string cons integer)) cons)) - (custom-variable-p (function (symbol) boolean)) + (custom-variable-p (function (symbol) t)) (decode-char (function (cons t) (or fixnum null))) (decode-time (function (&optional (or number list) (or symbol string cons integer) @@ -385,18 +385,18 @@ comp-known-type-specifiers (error-message-string (function (list) string)) (eventp (function (t) boolean)) (exp (function (number) float)) - (expt (function (number number) float)) + (expt (function (number number) number)) (fboundp (function (symbol) boolean)) (fceiling (function (float) float)) (featurep (function (symbol &optional symbol) boolean)) (ffloor (function (float) float)) (file-directory-p (function (string) boolean)) (file-exists-p (function (string) boolean)) - (file-locked-p (function (string) boolean)) + (file-locked-p (function (string) (or boolean string))) (file-name-absolute-p (function (string) boolean)) (file-newer-than-file-p (function (string string) boolean)) (file-readable-p (function (string) boolean)) - (file-symlink-p (function (string) boolean)) + (file-symlink-p (function (string) (or boolean string))) (file-writable-p (function (string) boolean)) (fixnump (function (t) boolean)) (float (function (number) float)) @@ -411,8 +411,8 @@ comp-known-type-specifiers (frame-first-window (function ((or frame window)) window)) (frame-root-window (function (&optional (or frame window)) window)) (frame-selected-window (function (&optional (or frame window)) window)) - (frame-visible-p (function (frame) boolean)) - (framep (function (t) boolean)) + (frame-visible-p (function (frame) (or boolean (member icon)))) + (framep (function (t) (or boolean (member x w32 ns pc pgtk haiku)))) (fround (function (float) float)) (ftruncate (function (float) float)) (get (function (symbol symbol) t)) @@ -506,7 +506,7 @@ comp-known-type-specifiers (previous-window (function (&optional window t t) window)) (prin1-to-string (function (t &optional t t) string)) (processp (function (t) boolean)) - (proper-list-p (function (t) boolean)) + (proper-list-p (function (t) (or fixnum null))) (propertize (function (string &rest t) string)) (radians-to-degrees (function (number) float)) (rassoc (function (t list) list)) commit 2d6ba3e034ca150d258389624b63a1c227334e81 Author: Michael Albinus Date: Thu Jun 1 15:57:43 2023 +0200 Adapt tree-sitter tests on emba * test/infra/Makefile.in (TREE-SITTER-FILES): Double-quote variable. * test/infra/test-jobs.yml: Regenerate. diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index 7b2c27918a7..057d44f6539 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -100,7 +100,7 @@ define subdir_template $(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir)))) -TREE-SITTER-FILES ?= $(shell cd .. ; find lisp -name "*-ts-*.el" | sort | sed s/\\.el/.log/) +TREE-SITTER-FILES ?= '"'$(shell cd .. ; find lisp -name "*-ts-*.el" | sort | sed s/\\.el/.log/)'"' all: generate-test-jobs diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index 7c26c33f6c6..48c5b726f28 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml @@ -571,10 +571,10 @@ test-src-inotify: .tree-sitter-files-template: variables: tree-sitter-files: >- - lisp/progmodes/c-ts-mode-tests.log + "lisp/progmodes/c-ts-mode-tests.log lisp/progmodes/elixir-ts-mode-tests.log lisp/progmodes/go-ts-mode-tests.log lisp/progmodes/heex-ts-mode-tests.log lisp/progmodes/java-ts-mode-tests.log lisp/progmodes/ruby-ts-mode-tests.log - lisp/progmodes/typescript-ts-mode-tests.log + lisp/progmodes/typescript-ts-mode-tests.log" commit dacc535a80ef284020ca9b0abc7b1c2f3d544d29 Author: Andrea Corallo Date: Thu Jun 1 11:02:01 2023 +0200 * lisp/emacs-lisp/comp.el (comp-jump-table-optimizable): Refactor. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index ec51f805c2b..b2704ae1446 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1723,17 +1723,11 @@ comp-jump-table-optimizable ;; (byte-constant #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (created 126 deleted 126 changed 126)) . 24) ;; (byte-switch) ;; (TAG 126 . 10) - (cl-loop - with labels = (cl-loop for target-label being each hash-value of jmp-table - collect target-label) - with x = (car labels) - for l in (cdr-safe labels) - unless (= l x) - return nil - finally return (pcase (nth (1+ (comp-limplify-pc comp-pass)) - (comp-func-lap comp-func)) - (`(TAG ,label . ,_label-sp) - (= label l))))) + (let ((targets (hash-table-values jmp-table))) + (when (apply #'= targets) + (pcase (nth (1+ (comp-limplify-pc comp-pass)) (comp-func-lap comp-func)) + (`(TAG ,target . ,_label-sp) + (= target (car targets))))))) (defun comp-emit-switch (var last-insn) "Emit a Limple for a lap jump table given VAR and LAST-INSN." commit f8c3d3824df01d70653ffc29ea54d520f7d85b68 Author: Michael Albinus Date: Thu Jun 1 08:47:18 2023 +0200 ; * test/infra/gitlab-ci.yml (variables): Enable CI_DEBUG_TRACE. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index b5b3e6823c7..213176bef70 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -58,7 +58,7 @@ variables: # across multiple builds. BUILD_TAG: ${CI_COMMIT_REF_SLUG} # Disable if you don't need it, it can be a security risk. - # CI_DEBUG_TRACE: "true" + CI_DEBUG_TRACE: "true" default: image: docker:19.03.12 commit 17c7915ab947ebeec6ea5ad3eb4cad1f24d5d4fc Author: Philip Kaludercic Date: Sat May 27 10:13:21 2023 +0200 ; Fix 'package-install-upgrade-built-in' check for package menu * lisp/emacs-lisp/package.el (package-menu--find-upgrades): Use correct check to verify if a built-in packages in the package menu can be upgraded or not. This change improves upon a faulty assumption from ba2c76fa2bc3aabfda7d1d09cc5148f3f9d8e08e. (Bug#63587) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 202aca36f24..8f266186d5e 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -3769,8 +3769,8 @@ package-menu--find-upgrades (and avail-pkg (version-list-< (package-desc-priority-version pkg-desc) (package-desc-priority-version avail-pkg)) - (xor (not package-install-upgrade-built-in) - (package--active-built-in-p pkg-desc)) + (or (not (package--active-built-in-p pkg-desc)) + package-install-upgrade-built-in) (push (cons name avail-pkg) upgrades)))) upgrades)) commit e252ce26eab1e135ed294171b249d6560474bfd1 Author: Theodor Thornhill Date: Wed May 31 20:47:06 2023 +0200 Add type_predicate 'is' as keyword in typescript-ts-mode (bug#63810) * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--keywords): New keyword 'is'. diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 11f20add3ee..e30eb880266 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -128,7 +128,7 @@ typescript-ts-mode--keywords "case" "catch" "class" "const" "continue" "debugger" "declare" "default" "delete" "do" "else" "enum" "export" "extends" "finally" "for" "from" "function" - "get" "if" "implements" "import" "in" "instanceof" "interface" + "get" "if" "implements" "import" "in" "instanceof" "interface" "is" "keyof" "let" "namespace" "new" "of" "private" "protected" "public" "readonly" "return" "set" "static" "switch" "target" "throw" "try" "type" "typeof" "var" "void" commit dc3b3548b7cd2a2170dd24d3cd8199bd9688276f Author: Mattias Engdegård Date: Wed May 31 18:55:03 2023 +0200 * lisp/composite.el (compose-gstring-for-terminal): Fix omitted var. It may not make much of a difference since the code path is probably only taken once for i=0 with no more glyphs in the input, but this change avoids depending on such external invariants and makes the code less mystifying to the reader (bug#63807). diff --git a/lisp/composite.el b/lisp/composite.el index fb8b76114f4..06c7c174163 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -818,7 +818,7 @@ compose-gstring-for-terminal (setq glyph (lgstring-glyph gstring i)) (lglyph-set-char glyph 32) (lglyph-set-width glyph 1) - (setq i (+ 2))) + (setq i (+ i 2))) (let ((from (lglyph-from glyph)) (to (lglyph-to glyph)) (j (1+ i))) commit ddf8587bb542d9826aa7c66e97365923d3f53ea0 Author: Mattias Engdegård Date: Wed May 31 16:34:01 2023 +0200 Disable unused-return-value warning for delq and delete, again * lisp/emacs-lisp/bytecomp.el (important-return-value-fns): Remove `delq` and `delete` since they resulted in false positives that nobody was interested in silencing (bug#61730). diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b7ae45a0610..384a357ee51 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3568,9 +3568,9 @@ byte-compile-form match-data - ;; Adding these functions causes many warnings; - ;; evaluate how many of them are false first. - delq delete + ;; Warning about these functions causes some false positives that are + ;; laborious to eliminate; see bug#61730. + ;;delq delete ;;nconc plist-put ))) (dolist (fn important-return-value-fns) commit 2df7b98de317a7f89d1ec342d79a93dd789c70bc Author: Mattias Engdegård Date: Tue May 30 22:58:26 2023 +0200 * lisp/net/shr.el (shr-dom-max-natural-width): Rewrite muddled code. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 86987807153..9b19a1b3980 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -2530,7 +2530,7 @@ shr-render-td-1 (setq natural-width (or (dom-attr dom 'shr-td-cache-natural) (let ((natural (max (shr-pixel-buffer-width) - (shr-dom-max-natural-width dom 0)))) + (shr-dom-max-natural-width dom)))) (dom-set-attribute dom 'shr-td-cache-natural natural) natural)))) (if (and natural-width @@ -2559,22 +2559,18 @@ shr-render-td-1 (cdr (assq 'color shr-stylesheet)) (cdr (assq 'background-color shr-stylesheet)))))) -(defun shr-dom-max-natural-width (dom max) - (if (eq (dom-tag dom) 'table) - (max max (or - (cl-loop - for line in (dom-attr dom 'shr-suggested-widths) - maximize (+ - shr-table-separator-length - (cl-loop for elem in line - summing - (+ (cdr elem) - (* 2 shr-table-separator-length))))) - 0)) - (dolist (child (dom-children dom)) - (unless (stringp child) - (setq max (max (shr-dom-max-natural-width child max))))) - max)) +(defun shr-dom-max-natural-width (dom) + (or (if (eq (dom-tag dom) 'table) + (cl-loop for line in (dom-attr dom 'shr-suggested-widths) + maximize (+ shr-table-separator-length + (cl-loop for elem in line + summing + (+ (cdr elem) + (* 2 shr-table-separator-length))))) + (cl-loop for child in (dom-children dom) + unless (stringp child) + maximize (shr-dom-max-natural-width child))) + 0)) (defun shr-buffer-width () (goto-char (point-min)) commit 288c48bcd917bbdaa149ad2b4869e274a3bf0e19 Author: Mattias Engdegård Date: Tue May 30 22:54:21 2023 +0200 ; * test/src/comp-tests.el (non-locals): Repair botched test. diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 673a9342f1f..ee6a05582d5 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -305,7 +305,8 @@ non-locals (lambda () (throw 'foo 3))) 3)) (should (= (catch 'foo - (comp-tests-throw-f 3))))) + (comp-tests-throw-f 3)) + 3))) (comp-deftest gc () "Try to do some longer computation to let the GC kick in." commit 0a354d65784e5cd25da408c4b102fb1c15fa7a73 Author: Eli Zaretskii Date: Wed May 31 17:50:53 2023 +0300 Fix infloop in info-look.el * lisp/info-look.el (info-lookup-guess-gdb-script-symbol): Fix infloop when there are no completions. (Bug#63808) diff --git a/lisp/info-look.el b/lisp/info-look.el index 7858ed58774..da45e30cd36 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -733,7 +733,11 @@ info-lookup-guess-gdb-script-symbol (let ((str (string-join str-list " "))) (when (assoc str completions) (throw 'result str)) - (nbutlast str-list))))))) + ;; 'nbutlast' will not destructively set its argument + ;; to nil when the argument is a list of 1 element. + (if (= (length str-list) 1) + (setq str-list nil) + (nbutlast str-list)))))))) (error nil))) ;;;###autoload commit 83b22139e4c2cf5ffb9544dd910319528ed7ebc8 Author: Stephen Berman Date: Wed May 31 16:15:48 2023 +0200 Fix several todo-mode.el item editing bugs (bug#63811) * lisp/calendar/todo-mode.el (todo-insert-item--basic): With insertion type 'here', ensure item is inserted on the todo-mode line where the command was invoked. (todo-edit-item--cat, todo-edit-item--pos): New variables. (todo-edit-item--text): Restrict the scope of nil-valued buffer-read-only to the functions that change buffer text. If user moved point while editing a single-line todo item or a done item comment, or while inserting a done item comment, restore point, and for comments, make sure the done items section is displayed. For multiline items, set the new variables so todo-edit-quit can use them. (todo-edit-quit): Use the values of the new variables to restore point in the todo-mode buffer if it had been moved while editing. (todo-edit-item--header): Avoid clobbering match data when editing a todo item header. diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 671210f3ee8..35cac5d7310 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -1985,7 +1985,13 @@ todo-insert-item--basic (setq done-only t) (todo-toggle-view-done-only)) (if here - (todo-insert-with-overlays new-item) + (progn + ;; Ensure item is inserted where command was invoked. + (unless (= (point) opoint) + (todo-category-number ocat) + (todo-category-select) + (goto-char opoint)) + (todo-insert-with-overlays new-item)) (todo-set-item-priority new-item cat t)) (setq item-added t)) ;; If user cancels before setting priority, restore @@ -2119,6 +2125,9 @@ todo-edit-item ((or marked (todo-item-string)) (todo-edit-item--next-key 'todo arg))))) +(defvar todo-edit-item--cat nil) +(defvar todo-edit-item--pos nil) + (defun todo-edit-item--text (&optional arg) "Function providing the text editing facilities of `todo-edit-item'." (let ((full-item (todo-item-string))) @@ -2127,6 +2136,7 @@ todo-edit-item--text ;; 1+ signals an error, so just make this a noop. (when full-item (let* ((opoint (point)) + (ocat (todo-current-category)) (start (todo-item-start)) (end (save-excursion (todo-item-end))) (item-beg (progn @@ -2151,8 +2161,7 @@ todo-edit-item--text (concat " \\[" (regexp-quote todo-comment-string) ": \\([^]]+\\)\\]") end t))) - (prompt (if comment "Edit comment: " "Enter a comment: ")) - (buffer-read-only nil)) + (prompt (if comment "Edit comment: " "Enter a comment: "))) ;; When there are marked items, user can invoke todo-edit-item ;; even if point is not on an item, but text editing only ;; applies to the item at point. @@ -2170,22 +2179,43 @@ todo-edit-item--text end t) (if comment-delete (when (todo-y-or-n-p "Delete comment? ") - (delete-region (match-beginning 0) (match-end 0))) - (replace-match (save-match-data - (read-string prompt - (cons (match-string 1) 1))) - nil nil nil 1)) + (let ((buffer-read-only nil)) + (delete-region (match-beginning 0) (match-end 0)))) + (let ((buffer-read-only nil)) + (replace-match (save-match-data + (prog1 (let ((buffer-read-only t)) + (read-string + prompt + (cons (match-string 1) 1))) + ;; If user moved point while editing + ;; a comment, restore it and ensure + ;; done items section is displayed. + (unless (= (point) opoint) + (todo-category-number ocat) + (let ((todo-show-with-done t)) + (todo-category-select) + (goto-char opoint))))) + nil nil nil 1))) (if comment-delete (user-error "There is no comment to delete") - (insert " [" todo-comment-string ": " - (prog1 (read-string prompt) - ;; If user moved point during editing, - ;; make sure it moves back. - (goto-char opoint) - (todo-item-end)) - "]"))))) + (let ((buffer-read-only nil)) + (insert " [" todo-comment-string ": " + (prog1 (let ((buffer-read-only t)) + (read-string prompt)) + ;; If user moved point while inserting a + ;; comment, restore it and ensure done items + ;; section is displayed. + (unless (= (point) opoint) + (todo-category-number ocat) + (let ((todo-show-with-done t)) + (todo-category-select) + (goto-char opoint))) + (todo-item-end)) + "]")))))) (multiline (let ((buf todo-edit-buffer)) + (setq todo-edit-item--cat ocat) + (setq todo-edit-item--pos opoint) (set-window-buffer (selected-window) (set-buffer (make-indirect-buffer (buffer-name) buf))) @@ -2208,10 +2238,14 @@ todo-edit-item--text ;; Ensure lines following hard newlines are indented. (setq new (replace-regexp-in-string "\\(\n\\)[^[:blank:]]" "\n\t" new nil nil 1)) - ;; If user moved point during editing, make sure it moves back. - (goto-char opoint) - (todo-remove-item) - (todo-insert-with-overlays new) + ;; If user moved point while editing item, restore it. + (unless (= (point) opoint) + (todo-category-number ocat) + (todo-category-select) + (goto-char opoint)) + (let ((buffer-read-only nil)) + (todo-remove-item) + (todo-insert-with-overlays new)) (move-to-column item-beg))))))))) (defun todo-edit-quit () @@ -2243,6 +2277,9 @@ todo-edit-quit (kill-buffer) (unless (eq (current-buffer) buf) (set-window-buffer (selected-window) (set-buffer buf))) + (todo-category-number todo-edit-item--cat) + (todo-category-select) + (goto-char todo-edit-item--pos) (if transient-mark-mode (deactivate-mark))) ;; We got here via `F e'. (when (todo-check-format) @@ -2315,117 +2352,118 @@ todo-edit-item--header ;; If there are marked items, use only the first to set ;; header changes, and apply these to all marked items. (when first - (cond - ((eq what 'date) - (setq ndate (todo-read-date))) - ((eq what 'calendar) - (setq ndate (save-match-data (todo-set-date-from-calendar)))) - ((eq what 'today) - (setq ndate (calendar-date-string (calendar-current-date) t t))) - ((eq what 'dayname) - (setq ndate (todo-read-dayname))) - ((eq what 'time) - (setq ntime (save-match-data (todo-read-time))) - (when (> (length ntime) 0) - (setq ntime (concat " " ntime)))) - ;; When date string consists only of a day name, - ;; passing other date components is a noop. - ((and odayname (memq what '(year month day)))) - ((eq what 'year) - (setq day oday - monthname omonthname - month omonth - year (cond ((not current-prefix-arg) - (todo-read-date 'year)) - ((string= oyear "*") - (user-error "Cannot increment *")) - (t - (number-to-string (+ yy inc)))))) - ((eq what 'month) - (setf day oday - year oyear - (if (memq 'month calendar-date-display-form) - month - monthname) - (cond ((not current-prefix-arg) - (todo-read-date 'month)) - ((or (string= omonth "*") (= mm 13)) - (user-error "Cannot increment *")) - (t - (let* ((mmo mm) - ;; Change by 12 or more months? - (bigincp (>= (abs inc) 12)) - ;; Month number is in range 1..12. - (mminc (+ mm (% inc 12))) - (mm (% (+ mminc 12) 12)) - ;; 12n mod 12 = 0, so 0 is December. - (mm (if (= mm 0) 12 mm)) - ;; Does change in month cross year? - (mmcmp (cond ((< inc 0) (> mm mmo)) - ((> inc 0) (< mm mmo)))) - (yyadjust (if bigincp - (+ (abs (/ inc 12)) - (if mmcmp 1 0)) - 1))) - ;; Adjust year if necessary. - (setq yy (cond ((and (< inc 0) - (or mmcmp bigincp)) - (- yy yyadjust)) - ((and (> inc 0) - (or mmcmp bigincp)) - (+ yy yyadjust)) - (t yy))) - (setq year (number-to-string yy)) - ;; Return the changed numerical month as - ;; a string or the corresponding month name. - (if omonth - (number-to-string mm) - (aref tma-array (1- mm))))))) - ;; Since the number corresponding to the arbitrary - ;; month name "*" is out of the range of - ;; calendar-last-day-of-month, set it to 1 - ;; (corresponding to January) to allow 31 days. - (let ((mm (if (= mm 13) 1 mm))) - (if (> (string-to-number day) - (calendar-last-day-of-month mm yy)) - (user-error "%s %s does not have %s days" - (aref tmn-array (1- mm)) - (if (= mm 2) yy "") day)))) - ((eq what 'day) - (setq year oyear - month omonth - monthname omonthname - day (cond - ((not current-prefix-arg) - (todo-read-date 'day mm yy)) - ((string= oday "*") - (user-error "Cannot increment *")) - ((or (string= omonth "*") (string= omonthname "*")) - (setq dd (+ dd inc)) - (if (> dd 31) - (user-error - "A month cannot have more than 31 days") - (number-to-string dd))) - ;; Increment or decrement day by INC, - ;; adjusting month and year if necessary - ;; (if year is "*" assume current year to - ;; calculate adjustment). - (t - (let* ((yy (or yy (calendar-extract-year - (calendar-current-date)))) - (date (calendar-gregorian-from-absolute - (+ (calendar-absolute-from-gregorian - (list mm dd yy)) - inc))) - (adjmm (nth 0 date))) - ;; Set year and month(name) to adjusted values. - (unless (string= year "*") - (setq year (number-to-string (nth 2 date)))) - (if month - (setq month (number-to-string adjmm)) - (setq monthname (aref tma-array (1- adjmm)))) - ;; Return changed numerical day as a string. - (number-to-string (nth 1 date))))))))) + (save-match-data + (cond + ((eq what 'date) + (setq ndate (todo-read-date))) + ((eq what 'calendar) + (setq ndate (todo-set-date-from-calendar))) + ((eq what 'today) + (setq ndate (calendar-date-string (calendar-current-date) t t))) + ((eq what 'dayname) + (setq ndate (todo-read-dayname))) + ((eq what 'time) + (setq ntime (todo-read-time)) + (when (> (length ntime) 0) + (setq ntime (concat " " ntime)))) + ;; When date string consists only of a day name, + ;; passing other date components is a noop. + ((and odayname (memq what '(year month day)))) + ((eq what 'year) + (setq day oday + monthname omonthname + month omonth + year (cond ((not current-prefix-arg) + (todo-read-date 'year)) + ((string= oyear "*") + (user-error "Cannot increment *")) + (t + (number-to-string (+ yy inc)))))) + ((eq what 'month) + (setf day oday + year oyear + (if (memq 'month calendar-date-display-form) + month + monthname) + (cond ((not current-prefix-arg) + (todo-read-date 'month)) + ((or (string= omonth "*") (= mm 13)) + (user-error "Cannot increment *")) + (t + (let* ((mmo mm) + ;; Change by 12 or more months? + (bigincp (>= (abs inc) 12)) + ;; Month number is in range 1..12. + (mminc (+ mm (% inc 12))) + (mm (% (+ mminc 12) 12)) + ;; 12n mod 12 = 0, so 0 is December. + (mm (if (= mm 0) 12 mm)) + ;; Does change in month cross year? + (mmcmp (cond ((< inc 0) (> mm mmo)) + ((> inc 0) (< mm mmo)))) + (yyadjust (if bigincp + (+ (abs (/ inc 12)) + (if mmcmp 1 0)) + 1))) + ;; Adjust year if necessary. + (setq yy (cond ((and (< inc 0) + (or mmcmp bigincp)) + (- yy yyadjust)) + ((and (> inc 0) + (or mmcmp bigincp)) + (+ yy yyadjust)) + (t yy))) + (setq year (number-to-string yy)) + ;; Return the changed numerical month as + ;; a string or the corresponding month name. + (if omonth + (number-to-string mm) + (aref tma-array (1- mm))))))) + ;; Since the number corresponding to the arbitrary + ;; month name "*" is out of the range of + ;; calendar-last-day-of-month, set it to 1 + ;; (corresponding to January) to allow 31 days. + (let ((mm (if (= mm 13) 1 mm))) + (if (> (string-to-number day) + (calendar-last-day-of-month mm yy)) + (user-error "%s %s does not have %s days" + (aref tmn-array (1- mm)) + (if (= mm 2) yy "") day)))) + ((eq what 'day) + (setq year oyear + month omonth + monthname omonthname + day (cond + ((not current-prefix-arg) + (todo-read-date 'day mm yy)) + ((string= oday "*") + (user-error "Cannot increment *")) + ((or (string= omonth "*") (string= omonthname "*")) + (setq dd (+ dd inc)) + (if (> dd 31) + (user-error + "A month cannot have more than 31 days") + (number-to-string dd))) + ;; Increment or decrement day by INC, + ;; adjusting month and year if necessary + ;; (if year is "*" assume current year to + ;; calculate adjustment). + (t + (let* ((yy (or yy (calendar-extract-year + (calendar-current-date)))) + (date (calendar-gregorian-from-absolute + (+ (calendar-absolute-from-gregorian + (list mm dd yy)) + inc))) + (adjmm (nth 0 date))) + ;; Set year and month(name) to adjusted values. + (unless (string= year "*") + (setq year (number-to-string (nth 2 date)))) + (if month + (setq month (number-to-string adjmm)) + (setq monthname (aref tma-array (1- adjmm)))) + ;; Return changed numerical day as a string. + (number-to-string (nth 1 date)))))))))) (unless odayname ;; If year, month or day date string components were ;; changed, rebuild the date string. commit ed4cd3eddf7763a70630df8fd238592e6f3b881c Author: Randy Taylor Date: Sat May 27 20:52:37 2023 -0400 dockerfile-ts-mode: Prevent empty categories in imenu (Bug#63759) * lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode--imenu): Don't include empty categories. diff --git a/lisp/progmodes/dockerfile-ts-mode.el b/lisp/progmodes/dockerfile-ts-mode.el index f2f30cf2617..2973b5149db 100644 --- a/lisp/progmodes/dockerfile-ts-mode.el +++ b/lisp/progmodes/dockerfile-ts-mode.el @@ -123,8 +123,9 @@ dockerfile-ts-mode--imenu (let* ((node (treesit-buffer-root-node)) (stage-tree (treesit-induce-sparse-tree node "from_instruction" - nil 1000))) - `(("Stage" . ,(dockerfile-ts-mode--imenu-1 stage-tree))))) + nil 1000)) + (stage-index (dockerfile-ts-mode--imenu-1 stage-tree))) + (when stage-index `(("Stage" . ,stage-index))))) (defun dockerfile-ts-mode--imenu-1 (node) "Helper for `dockerfile-ts-mode--imenu'. commit 65b3d4d120202af252d458759ae244ec7c635c67 Author: Eli Zaretskii Date: Wed May 31 16:13:56 2023 +0300 ; * lisp/misc.el (forward-to-word, backward-to-word): Doc fix. diff --git a/lisp/misc.el b/lisp/misc.el index f97240ed94f..81769696f95 100644 --- a/lisp/misc.el +++ b/lisp/misc.el @@ -167,8 +167,9 @@ upcase-char ;;;###autoload (defun forward-to-word (&optional arg) - "Move forward until encountering the beginning of a word. -With argument, do this that many times." + "Move forward until encountering the beginning of the ARGth word. +ARG defaults to 1. When called interactively, ARG is the prefix +numeric argument." (interactive "^p") (unless arg (setq arg 1)) (or (re-search-forward (if (> arg 0) "\\W\\b" "\\b\\W") nil t arg) @@ -176,8 +177,9 @@ forward-to-word ;;;###autoload (defun backward-to-word (&optional arg) - "Move backward until encountering the end of a word. -With argument, do this that many times." + "Move backward until encountering the end of the ARGth word. +ARG defaults to 1. When called interactively, ARG is the prefix +numeric argument." (interactive "^p") (unless arg (setq arg 1)) (forward-to-word (- arg))) commit 5f6aa5a174cf0ad53b54fa4b043408dbd85531ac Author: Zaz Brown Date: Sat May 20 21:33:51 2023 -0700 Make forward and backward-to-word arg optional * lisp/misc.el (forward-to-word, backward-to-word): Make the argument optional. (Bug#63626) Copyright-paperwork-exempt: yes diff --git a/lisp/misc.el b/lisp/misc.el index ca013d5f72f..f97240ed94f 100644 --- a/lisp/misc.el +++ b/lisp/misc.el @@ -166,18 +166,20 @@ upcase-char (upcase-region (point) (progn (forward-char arg) (point))))) ;;;###autoload -(defun forward-to-word (arg) +(defun forward-to-word (&optional arg) "Move forward until encountering the beginning of a word. With argument, do this that many times." (interactive "^p") + (unless arg (setq arg 1)) (or (re-search-forward (if (> arg 0) "\\W\\b" "\\b\\W") nil t arg) (goto-char (if (> arg 0) (point-max) (point-min))))) ;;;###autoload -(defun backward-to-word (arg) +(defun backward-to-word (&optional arg) "Move backward until encountering the end of a word. With argument, do this that many times." (interactive "^p") + (unless arg (setq arg 1)) (forward-to-word (- arg))) ;;;###autoload commit 2e20e318da23ce74ac6f736b557e10aa402c5cf9 Author: Jens Schmidt Date: Mon May 22 21:47:13 2023 +0200 Brush up doc strings and terminology in plstore.el * lisp/plstore.el (plstore-encoded, plstore-passphrase-callback-function) (plstore--init-from-buffer, plstore-revert, plstore-close) (plstore--merge-secret, plstore--decrypt, plstore--match, plstore-find) (plstore-get, plstore-put, plstore-delete, plstore--insert-buffer) (plstore-save, plstore--encode, plstore--decode) (plstore--write-contents-functions, plstore-mode-decoded) (plstore-mode): Brush up doc strings and documentation in general. Fix terminology, in particular spurious occurences of all uppercase "PLSTORE". (Bug#63627) diff --git a/lisp/plstore.el b/lisp/plstore.el index 1a0dacffb01..d18d461d7d1 100644 --- a/lisp/plstore.el +++ b/lisp/plstore.el @@ -78,7 +78,7 @@ ;; Editing: ;; ;; This file also provides `plstore-mode', a major mode for editing -;; the PLSTORE format file. Visit a non-existing file and put the +;; the plstore format file. Visit a non-existing file and put the ;; following line: ;; ;; (("foo" :host "foo.example.org" :secret-user "user")) @@ -235,10 +235,13 @@ plstore-encrypt-to (put 'plstore-encrypt-to 'permanent-local t) -(defvar plstore-encoded nil) +(defvar plstore-encoded nil + "Non-nil if the current buffer shows the decoded alist.") ; [sic!] (put 'plstore-encoded 'permanent-local t) +;;; EasyPG callback functions. + (defvar plstore-cache-passphrase-for-symmetric-encryption nil) (defvar plstore-passphrase-alist nil) @@ -255,11 +258,11 @@ plstore-passphrase-callback-function (cons entry plstore-passphrase-alist))) (setq passphrase - (read-passwd (format "Passphrase for PLSTORE %s: " + (read-passwd (format "Passphrase for plstore %s: " (plstore--get-buffer plstore)))) (setcdr entry (copy-sequence passphrase)) passphrase))) - (read-passwd (format "Passphrase for PLSTORE %s: " + (read-passwd (format "Passphrase for plstore %s: " (plstore--get-buffer plstore))))) (defun plstore-progress-callback-function (_context _what _char current total @@ -269,6 +272,8 @@ plstore-progress-callback-function (message "%s...%d%%" handback (if (> total 0) (floor (* (/ current (float total)) 100)) 0)))) +;;; Core functions. + (defun plstore--get-buffer (arg) (aref arg 0)) @@ -307,6 +312,7 @@ plstore--make (vector buffer alist encrypted-data secret-alist merged-alist)) (defun plstore--init-from-buffer (plstore) + "Parse current buffer and initialize PLSTORE from it." (goto-char (point-min)) (when (looking-at ";;; public entries") (forward-line) @@ -337,16 +343,20 @@ plstore-open store))) (defun plstore-revert (plstore) - "Replace current data in PLSTORE with the file on disk." + "Replace current data in PLSTORE from its associated file." (with-current-buffer (plstore--get-buffer plstore) (revert-buffer t t) (plstore--init-from-buffer plstore))) (defun plstore-close (plstore) - "Destroy a plstore instance PLSTORE." + "Destroy plstore instance PLSTORE." (kill-buffer (plstore--get-buffer plstore))) (defun plstore--merge-secret (plstore) + "Determine the merged alist of PLSTORE. +Create the merged alist as a copy of the template alist with all +placeholder properties that have corresponding properties in the +secret alist replaced by their plain-text secret properties." (let ((alist (plstore--get-secret-alist plstore)) modified-alist modified-plist @@ -365,19 +375,26 @@ plstore--merge-secret modified-entry (assoc (car entry) modified-alist) modified-plist (cdr modified-entry)) (while plist + ;; Search for a placeholder property in the merged alist + ;; corresponding to the current secret property. (setq placeholder (plist-member modified-plist (intern (concat ":secret-" (substring (symbol-name (car plist)) 1))))) + ;; Replace its name with the real, secret property name. (if placeholder (setcar placeholder (car plist))) + ;; Update its value to the plain-text secret property value. (setq modified-plist (plist-put modified-plist (car plist) (car (cdr plist)))) (setq plist (nthcdr 2 plist))) (setcdr modified-entry modified-plist)))) (defun plstore--decrypt (plstore) + "Decrypt the encrypted data of PLSTORE. +Update its internal alists and other data structures +accordingly." (if (plstore--get-encrypted-data plstore) (let ((context (epg-make-context 'OpenPGP)) plain) @@ -404,6 +421,11 @@ plstore--decrypt (plstore--set-encrypted-data plstore nil)))) (defun plstore--match (entry keys skip-if-secret-found) + "Return whether plist KEYS matches ENTRY. +ENTRY should be a key of the merged alist of a PLSTORE. This +function returns nil if KEYS do not match ENTRY, t if they match, +and symbol `secret' if the secret alist needs to be consulted to +perform a match." (let ((result t) key-name key-value prop-value secret-name) (while keys (setq key-name (car keys) @@ -425,11 +447,10 @@ plstore--match result)) (defun plstore-find (plstore keys) - "Perform search on PLSTORE with KEYS. -KEYS is a plist." + "Return all PLSTORE entries matching plist KEYS." (let (entries alist entry match decrypt plist) - ;; First, go through the merged plist alist and collect entries - ;; matched with keys. + ;; First, go through the merged alist and collect entries matched + ;; by the keys. (setq alist (plstore--get-merged-alist plstore)) (while alist (setq entry (car alist) @@ -445,7 +466,7 @@ plstore-find plist nil)) (setq plist (nthcdr 2 plist))) (setq entries (cons entry entries))))) - ;; Second, decrypt the encrypted plist and try again. + ;; Second, decrypt the plstore and try again. (when decrypt (setq entries nil) (plstore--decrypt plstore) @@ -459,7 +480,8 @@ plstore-find (nreverse entries))) (defun plstore-get (plstore name) - "Get an entry with NAME in PLSTORE." + "Return the entry named NAME in PLSTORE. +Return nil if there is none." (let ((entry (assoc name (plstore--get-merged-alist plstore))) plist) (setq plist (cdr entry)) @@ -473,7 +495,7 @@ plstore-get entry)) (defun plstore-put (plstore name keys secret-keys) - "Put an entry with NAME in PLSTORE. + "Put an entry named NAME in PLSTORE. KEYS is a plist containing non-secret data. SECRET-KEYS is a plist containing secret data." (let (entry @@ -512,7 +534,7 @@ plstore-put (plstore--merge-secret plstore))) (defun plstore-delete (plstore name) - "Delete an entry with NAME from PLSTORE." + "Delete the first entry named NAME from PLSTORE." (let ((entry (assoc name (plstore--get-alist plstore)))) (if entry (plstore--set-alist @@ -531,6 +553,8 @@ plstore-delete (defvar pp-escape-newlines) (defun plstore--insert-buffer (plstore) + "Insert the file representation of PLSTORE at point. +Assumes that PLSTORE has been decrypted." (insert ";;; public entries -*- mode: plstore -*- \n" (pp-to-string (plstore--get-alist plstore))) (if (plstore--get-secret-alist plstore) @@ -565,12 +589,14 @@ plstore--insert-buffer (insert ";;; secret entries\n" (pp-to-string cipher))))) (defun plstore-save (plstore) - "Save the contents of PLSTORE associated with a FILE." + "Save PLSTORE to its associated file." (with-current-buffer (plstore--get-buffer plstore) (erase-buffer) (plstore--insert-buffer plstore) (save-buffer))) +;;; plstore mode. + ;; The functions related to plstore mode unfortunately introduce yet ;; another alist format ("decoded alist"). After executing the "foo", ;; "bar", "baz" example from above the decoded alist of the plstore @@ -587,6 +613,7 @@ plstore-save ;; `plstore-encoded' is non-nil if a buffer shows the decoded form. (defun plstore--encode (plstore) + "Return the printed representation of the decoded alist of PLSTORE." (plstore--decrypt plstore) (let ((merged-alist (plstore--get-merged-alist plstore))) (concat "(" @@ -611,6 +638,9 @@ plstore--encode ")"))) (defun plstore--decode (string) + "Create a plstore instance from STRING. +STRING should be the printed representation of a decoded alist of +some plstore." (let* ((alist (car (read-from-string string))) (pointer alist) secret-alist @@ -618,7 +648,7 @@ plstore--decode entry) (while pointer (unless (stringp (car (car pointer))) - (error "Invalid PLSTORE format %s" string)) + (error "Invalid plstore format %s" string)) (setq plist (cdr (car pointer))) (while plist (when (string-match "\\`:secret-" (symbol-name (car plist))) @@ -638,6 +668,10 @@ plstore--decode (plstore--make nil alist nil secret-alist))) (defun plstore--write-contents-functions () + "Convert the decoded form of a plstore in the current buffer. +Convert it to the regular file representation of a plstore if +needed. This function is used on hook `write-contents-functions' +in plstore mode buffers." (when plstore-encoded (let ((store (plstore--decode (buffer-string))) (file (buffer-file-name))) @@ -675,7 +709,7 @@ plstore-mode-decoded (erase-buffer) (insert (substitute-command-keys "\ -;;; You are looking at the decoded form of the PLSTORE file.\n\ +;;; You are looking at the decoded form of the plstore file.\n\ ;;; To see the original form content, do \\[plstore-mode-toggle-display]\n\n")) (insert (plstore--encode store)) (set-buffer-modified-p nil) @@ -690,7 +724,7 @@ plstore-mode-toggle-display ;;;###autoload (define-derived-mode plstore-mode emacs-lisp-mode "PLSTORE" - "Major mode for editing PLSTORE files." + "Major mode for editing plstore files." (make-local-variable 'plstore-encoded) (add-hook 'write-contents-functions #'plstore--write-contents-functions) (define-key plstore-mode-map "\C-c\C-c" #'plstore-mode-toggle-display) commit 372bc1278c2d7c2440bb3d528f4c4e03402d21b5 Author: Jens Schmidt Date: Sun May 21 21:37:35 2023 +0200 Add internal documentation on plstore.el * lisp/plstore.el: Add internal documentation and some words of warning in the user documentation. (Bug#63627) diff --git a/lisp/plstore.el b/lisp/plstore.el index 0276a752a0f..1a0dacffb01 100644 --- a/lisp/plstore.el +++ b/lisp/plstore.el @@ -24,6 +24,14 @@ ;; Plist based data store providing search and partial encryption. ;; +;; By default, this package uses symmetric encryption, which means +;; that you have to enter the password protecting your store more +;; often than you probably expect to. To use public key encryption +;; with this package, create a GnuPG key and customize user option +;; `plstore-encrypt-to' to use it. You can then configure the GnuPG +;; agent to adjust caching and expiration of the passphrase for your +;; store. +;; ;; Creating: ;; ;; ;; Open a new store associated with ~/.emacs.d/auth.plist. @@ -43,12 +51,16 @@ ;; ;; Kill the buffer visiting ~/.emacs.d/auth.plist. ;; (plstore-close store) ;; +;; Avoid marking one property both as public *and* secret, as the +;; behavior of this package with respect to such duplicate properties +;; is not (yet) defined. +;; ;; Searching: ;; ;; (setq store (plstore-open (expand-file-name "~/.emacs.d/auth.plist"))) ;; ;; ;; As the entry "foo" associated with "foo.example.org" has no -;; ;; secret properties, no need to decryption. +;; ;; secret properties, no need for decryption. ;; (plstore-find store '(:host ("foo.example.org"))) ;; ;; ;; As the entry "bar" associated with "bar.example.org" has a @@ -73,10 +85,112 @@ ;; ;; where the prefixing `:secret-' means the property (without ;; `:secret-' prefix) is marked as secret. Thus, when you save the -;; buffer, the `:secret-user' property is encrypted as `:user'. +;; buffer, the `:secret-user' property is encrypted as `:user'. Do +;; not use a property consisting solely of the prefix, as the behavior +;; of this package with respect to such properties is not (yet) +;; defined. ;; ;; You can toggle the view between encrypted form and the decrypted ;; form with C-c C-c. +;; +;; If you have opened a plstore with `plstore-open' you should not +;; edit its underlying buffer in `plstore-mode' or in any other way at +;; the same time, since your manual changes will be overwritten when +;; `plstore-save' is called on that plstore. +;; +;; Internals: +;; +;; This is information on the internal data structure and functions of +;; this package. None of it should be necessary to actually use it. +;; For easier reading, we usually do not distinguish in this internal +;; documentation between a Lisp object and its printed representation. +;; +;; A plstore corresponds to an alist mapping strings to property +;; lists. Internally, that alist is organized as two alists, one +;; mapping to the non-secret properties and placeholders for the +;; secret properties (called "template alist" with identifier ALIST) +;; and one mapping to the secret properties ("secret alist", +;; SECRET-ALIST). The secret alist is read from and written to file +;; as pgp-encrypted printed representation of the alist ("encrypted +;; data", ENCRYPTED-DATA). +;; +;; During the lifetime of a plstore, a third type of alist may pop up, +;; which maps to the merged non-secret properties and plain-text +;; secret properties ("merged alist", MERGED-ALIST). +;; +;; After executing the "foo", "bar", "baz" example from above the +;; alists described above look like the following: +;; +;; Template Alist: +;; +;; (("foo" :host "foo.example.org" :port 80) +;; ("bar" :secret-user t :host "bar.example.org") +;; ("baz" :secret-password t :host "baz.example.org")) +;; +;; Secret Alist: +;; +;; (("bar" :user "test") +;; ("baz" :password "test")) +;; +;; Merged Alist: +;; +;; (("foo" :host "foo.example.org" :port 80) +;; ("bar" :user "test" :host "bar.example.org") +;; ("baz" :password "test" :host "baz.example.org")) +;; +;; Finally, a plstore requires a buffer ("plstore buffer", BUFFER) for +;; conversion between its Lisp objects and its file representation. +;; It is important to note that this buffer is *not* continuously +;; synchronized as the plstore changes. During the lifetime of a +;; plstore, its buffer is read from in function `plstore-open' and +;; (destructively) written to in `plstore-save', but not touched +;; otherwise. We call the file visited by the plstore buffer the +;; associated file of the plstore. +;; +;; With the identifiers defined above a plstore is a vector with the +;; following elements and accessor functions: +;; +;; [ +;; BUFFER ; plstore--get/set-buffer +;; ALIST ; plstore--get/set-alist +;; ENCRYPTED-DATA ; plstore--get/set-encrypted-data +;; SECRET-ALIST ; plstore--get/set-secret-alist +;; MERGED-ALIST ; plstore--get/set-merged-alist +;; ] +;; +;; When a plstore is created through `plstore-open', its ALIST and +;; ENCRYPTED-DATA are initialized from the contents of BUFFER without +;; any decryption taking place, and MERGED-ALIST is initialized as a +;; copy of ALIST. (Which means that at that stage the merged alist +;; still contains the secret property placeholders!) +;; +;; During on-demand decryption of a plstore through function +;; `plstore--decrypt', SECRET-ALIST is populated from ENCRYPTED-DATA, +;; which is in turn replaced by value nil. (Which further serves as +;; an indicator that the plstore has been decrypted already.) In +;; addition, MERGED-ALIST is recomputed by function +;; `plstore--merge-secret' to replace the secret property placeholders +;; by their plain-text secret property equivalents. +;; +;; The file representation of a plstore consists of two Lisp forms plus +;; markers to introduce them: +;; +;; ;;; public entries +;; ALIST +;; ;;; secret entries +;; ENCRYPTED-DATA +;; +;; Both of these are optional, but the first section must be present +;; if the second one is. If both sections are missing, the plstore is +;; empty. If the second section is missing, it contains only +;; non-secret data. If present, the printed representation of the +;; encrypted data includes the delimiting double quotes. +;; +;; The plstore API (`plstore-open', `plstore-put', etc.) and the +;; plstore mode implemented by `plstore-mode' are orthogonal to each +;; other and should not be mixed up. In particular, encoding and +;; decoding a plstore mode buffer with `plstore-mode-toggle-display' +;; is not related in any way to the state of the plstore buffer. ;;; Code: @@ -457,6 +571,21 @@ plstore-save (plstore--insert-buffer plstore) (save-buffer))) +;; The functions related to plstore mode unfortunately introduce yet +;; another alist format ("decoded alist"). After executing the "foo", +;; "bar", "baz" example from above the decoded alist of the plstore +;; would look like the following: +;; +;; (("foo" :host "foo.example.org" :port 80) +;; ("bar" :secret-user "test" :host "bar.example.org") +;; ("baz" :secret-password "test" :host "baz.example.org")) +;; +;; Even more unfortunately, variable and function names of the +;; following are a bit mixed up IMHO: With the current names, the +;; result of function `plstore--encode' is used to create what is +;; presented as "decoded form of a plstore" to the user. And variable +;; `plstore-encoded' is non-nil if a buffer shows the decoded form. + (defun plstore--encode (plstore) (plstore--decrypt plstore) (let ((merged-alist (plstore--get-merged-alist plstore))) commit 5cace109d2bce98a7d486e44378286031465f40f Author: Michael Albinus Date: Wed May 31 08:45:08 2023 +0200 ; * etc/NEWS: Fix typos. diff --git a/etc/NEWS b/etc/NEWS index 80e997d420f..9529282f047 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -31,7 +31,8 @@ applies, and please also update docstrings as needed. * Changes in Emacs 30.1 ** Help -** 'describe-function' shows function inferred type when available. + +*** 'describe-function' shows function inferred type when available. For native compiled Lisp functions 'describe-function' prints (after the signature) the automatically inferred function type as well. @@ -302,7 +303,7 @@ project, that you can quickly select using 'project-switch-project' --- *** New user option 'package-vc-allow-side-effects'. When non-nil, package specifications with side-effects for building -software will used when building a package. +software will be used when building a package. ** Flymake @@ -344,7 +345,7 @@ This keyword enables the user to install packages using 'package-vc'. *** New commands for reading mailing lists. The new Rmail commands 'rmail-mailing-list-post', 'rmail-mailing-list-unsubscribe', 'rmail-mailing-list-help', and -'rmail-mailing-list-archive allow to, respectively, post to, +'rmail-mailing-list-archive' allow to, respectively, post to, unsubscribe from, request help about, and browse the archives, of the mailing list from which the current email message was delivered. @@ -354,8 +355,8 @@ mailing list from which the current email message was delivered. *** New user option 'dictionary-search-interface'. Controls how the 'dictionary-search' command prompts for and displays dictionary definitions. Customize this user option to 'help' to have -'dictionary-search' display definitions in a *Help* buffer and provide -dictionary-based minibuffer completion for word selection. +'dictionary-search' display definitions in a "*Help*" buffer and +provide dictionary-based minibuffer completion for word selection. --- *** New user option 'dictionary-read-word-prompt'. @@ -370,8 +371,8 @@ displays word definitions. If non-nil, this user option should be set to a function that displays a word definition obtained from a dictionary server. The new function 'dictionary-display-definition-in-help-buffer' can be used to display -the definition in a *Help* buffer, instead of the default *Dictionary* -buffer. +the definition in a "*Help*" buffer, instead of the default +"*Dictionary*" buffer. --- *** New user option 'dictionary-read-word-function'. @@ -391,7 +392,6 @@ name as a string. The new function 'dictionary-completing-read-dictionary' can be used to prompt with completion based on dictionaries that the server supports. - * New Modes and Packages in Emacs 30.1 @@ -455,8 +455,8 @@ hooks named after the feature name, like 'esh-mode-unload-hook'. * Lisp Changes in Emacs 30.1 +++ -** New variable 'safe-local-variable-directories'. -This variable names directories in which Emacs will treat all +** New user option 'safe-local-variable-directories'. +This user option names directories in which Emacs will treat all directory-local variables as safe. ** New variable 'inhibit-auto-fill' to temporarily prevent auto-fill. @@ -592,7 +592,7 @@ some obvious cases. Examples: (aset [3 4] 0 8) (aset "abc" 1 ?d) -Such code may have unpredictable behaviour because the constants are +Such code may have unpredictable behavior because the constants are part of the program, not data structures generated afresh during execution, and the compiler does not expect them to change. commit 3e3c2778704331ee9a48721fe217afe5f8030e52 Author: Michael Albinus Date: Wed May 31 08:44:44 2023 +0200 Improve tree-sitter tests on emba * test/infra/Dockerfile.emba (emacs-tree-sitter): Install only grammars which are needed. * test/infra/Makefile.in (subdir_template): Special handling of progmodes. (TREE-SITTER-FILES): New variable. (tree-sitter-files-template): New rule. (.PHONY, generate-test-jobs): Add it to dependencies. * test/infra/gitlab-ci.yml (.tree-sitter-template): Add test/lisp/progmodes/*-ts-mode-resources/**. (test-tree-sitter): Extends also .tree-sitter-files-template. Use $tree-sitter-files. * test/infra/test-jobs.yml: Regenerate. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 5141c8919b1..1969afdd333 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -114,28 +114,16 @@ RUN src/emacs -Q --batch \ --eval '(setq \ treesit-extra-load-path (list "/usr/local/lib/tree-sitter") \ treesit-language-source-alist \ - (quote ((bash "https://github.com/tree-sitter/tree-sitter-bash") \ - (c "https://github.com/tree-sitter/tree-sitter-c") \ - (cmake "https://github.com/uyha/tree-sitter-cmake") \ + (quote ((c "https://github.com/tree-sitter/tree-sitter-c") \ (cpp "https://github.com/tree-sitter/tree-sitter-cpp") \ - (css "https://github.com/tree-sitter/tree-sitter-css") \ - (elisp "https://github.com/Wilfred/tree-sitter-elisp") \ (elixir "https://github.com/elixir-lang/tree-sitter-elixir") \ - (java "https://github.com/tree-sitter/tree-sitter-java") \ (go "https://github.com/tree-sitter/tree-sitter-go") \ (gomod "https://github.com/camdencheek/tree-sitter-go-mod") \ (heex "https://github.com/phoenixframework/tree-sitter-heex") \ - (html "https://github.com/tree-sitter/tree-sitter-html") \ - (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src") \ - (json "https://github.com/tree-sitter/tree-sitter-json") \ - (make "https://github.com/alemuller/tree-sitter-make") \ - (markdown "https://github.com/ikatyang/tree-sitter-markdown") \ - (python "https://github.com/tree-sitter/tree-sitter-python") \ + (java "https://github.com/tree-sitter/tree-sitter-java") \ (ruby "https://github.com/tree-sitter/tree-sitter-ruby") \ - (toml "https://github.com/tree-sitter/tree-sitter-toml") \ (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") \ - (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") \ - (yaml "https://github.com/ikatyang/tree-sitter-yaml"))))' \ + (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))))' \ --eval '(dolist (lang (mapcar (quote car) treesit-language-source-alist)) \ (treesit-install-language-grammar lang "/usr/local/lib/tree-sitter"))' diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index c6538c093c0..7b2c27918a7 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in @@ -53,6 +53,17 @@ define subdir_template define changes @echo ' - lisp/emacs-lisp/faceup*.el' >>$(FILE) endef + else ifeq ($(findstring progmodes, $(1)), progmodes) + define changes + @echo ' - $(1)/eglot.el' >>$(FILE) + @echo ' - $(1)/*-ts-mode.el' >>$(FILE) + @echo ' - test/$(1)/eglot-tests.el' >>$(FILE) + @echo ' - test/$(1)/*-ts-mode-resources/**' >>$(FILE) + @echo ' - test/$(1)/*-ts-mode-tests.el' >>$(FILE) + @echo ' when: never' >>$(FILE) + @echo ' - changes:' >>$(FILE) + @echo ' - $(1)/*.el' >>$(FILE) + endef else ifeq ($(findstring so-long, $(1)), so-long) define changes @echo ' - lisp/so-long*.el' >>$(FILE) @@ -80,8 +91,8 @@ define subdir_template @echo ' when: never' >>$(FILE) @echo ' - changes:' >>$(FILE) $(changes) - @echo ' - test/$(1)/*.el' >>$(FILE) @echo ' - test/$(1)/*resources/**' >>$(FILE) + @echo ' - test/$(1)/*.el' >>$(FILE) @echo ' variables:' >>$(FILE) @echo ' target: emacs-inotify' >>$(FILE) @echo ' make_params: "-k -C test $(target)"' >>$(FILE) @@ -89,11 +100,20 @@ define subdir_template $(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir)))) +TREE-SITTER-FILES ?= $(shell cd .. ; find lisp -name "*-ts-*.el" | sort | sed s/\\.el/.log/) + all: generate-test-jobs -.PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) +.PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) tree-sitter-files-template + +generate-test-jobs: $(FILE) $(SUBDIR_TARGETS) tree-sitter-files-template -generate-test-jobs: $(FILE) $(SUBDIR_TARGETS) +tree-sitter-files-template: + @echo >>$(FILE) + @echo '.tree-sitter-files-template:' >>$(FILE) + @echo ' variables:' >>$(FILE) + @echo ' tree-sitter-files: >-' >>$(FILE) + @for name in $(TREE-SITTER-FILES) ; do echo " $${name}" >>$(FILE) ; done $(FILE): $(AM_V_GEN) diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 9a862dcba3c..b5b3e6823c7 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -184,6 +184,7 @@ default: - "**.in" - lisp/progmodes/*-ts-mode.el - test/infra/* + - test/lisp/progmodes/*-ts-mode-resources/** - test/lisp/progmodes/*-ts-mode-tests.el .native-comp-template: @@ -274,22 +275,14 @@ build-image-tree-sitter: test-tree-sitter: stage: platforms - extends: [.job-template, .test-template, .tree-sitter-template] + extends: [.job-template, .test-template, .tree-sitter-template, .tree-sitter-files-template] needs: - job: build-image-tree-sitter optional: true variables: target: emacs-tree-sitter # This is needed in order to get a JUnit test report. - files: >- - lisp/progmodes/c-ts-mode-tests.log - lisp/progmodes/elixir-ts-mode-tests.log - lisp/progmodes/go-ts-mode-tests.log - lisp/progmodes/heex-ts-mode-tests.log - lisp/progmodes/java-ts-mode-tests.log - lisp/progmodes/ruby-ts-mode-tests.log - lisp/progmodes/typescript-ts-mode-tests.log - make_params: '-k -C test check-expensive LD_LIBRARY_PATH=/usr/local/lib/tree-sitter LOGFILES="$files"' + make_params: '-k -C test check-expensive LD_LIBRARY_PATH=/usr/local/lib/tree-sitter LOGFILES="$tree-sitter-files"' build-image-gnustep: stage: platform-images diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index 55ce590af89..7c26c33f6c6 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml @@ -11,8 +11,8 @@ test-lib-src-inotify: when: never - changes: - lib-src/*.{h,c} - - test/lib-src/*.el - test/lib-src/*resources/** + - test/lib-src/*.el variables: target: emacs-inotify make_params: "-k -C test check-lib-src" @@ -28,8 +28,8 @@ test-lisp-inotify: when: never - changes: - lisp/*.el - - test/lisp/*.el - test/lisp/*resources/** + - test/lisp/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp" @@ -45,8 +45,8 @@ test-lisp-calc-inotify: when: never - changes: - lisp/calc/*.el - - test/lisp/calc/*.el - test/lisp/calc/*resources/** + - test/lisp/calc/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-calc" @@ -62,8 +62,8 @@ test-lisp-calendar-inotify: when: never - changes: - lisp/calendar/*.el - - test/lisp/calendar/*.el - test/lisp/calendar/*resources/** + - test/lisp/calendar/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-calendar" @@ -79,8 +79,8 @@ test-lisp-cedet-inotify: when: never - changes: - lisp/cedet/*.el - - test/lisp/cedet/*.el - test/lisp/cedet/*resources/** + - test/lisp/cedet/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-cedet" @@ -96,8 +96,8 @@ test-lisp-cedet-semantic-inotify: when: never - changes: - lisp/cedet/semantic/*.el - - test/lisp/cedet/semantic/*.el - test/lisp/cedet/semantic/*resources/** + - test/lisp/cedet/semantic/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-cedet-semantic" @@ -113,8 +113,8 @@ test-lisp-cedet-semantic-bovine-inotify: when: never - changes: - lisp/cedet/semantic/bovine/*.el - - test/lisp/cedet/semantic/bovine/*.el - test/lisp/cedet/semantic/bovine/*resources/** + - test/lisp/cedet/semantic/bovine/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-cedet-semantic-bovine" @@ -130,8 +130,8 @@ test-lisp-cedet-srecode-inotify: when: never - changes: - lisp/cedet/srecode/*.el - - test/lisp/cedet/srecode/*.el - test/lisp/cedet/srecode/*resources/** + - test/lisp/cedet/srecode/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-cedet-srecode" @@ -147,8 +147,8 @@ test-lisp-emacs-lisp-inotify: when: never - changes: - lisp/emacs-lisp/*.el - - test/lisp/emacs-lisp/*.el - test/lisp/emacs-lisp/*resources/** + - test/lisp/emacs-lisp/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-emacs-lisp" @@ -164,8 +164,8 @@ test-lisp-emacs-lisp-eieio-tests-inotify: when: never - changes: - lisp/emacs-lisp/eieio*.el - - test/lisp/emacs-lisp/eieio-tests/*.el - test/lisp/emacs-lisp/eieio-tests/*resources/** + - test/lisp/emacs-lisp/eieio-tests/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-emacs-lisp-eieio-tests" @@ -181,8 +181,8 @@ test-lisp-emacs-lisp-faceup-tests-inotify: when: never - changes: - lisp/emacs-lisp/faceup*.el - - test/lisp/emacs-lisp/faceup-tests/*.el - test/lisp/emacs-lisp/faceup-tests/*resources/** + - test/lisp/emacs-lisp/faceup-tests/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-emacs-lisp-faceup-tests" @@ -198,8 +198,8 @@ test-lisp-emulation-inotify: when: never - changes: - lisp/emulation/*.el - - test/lisp/emulation/*.el - test/lisp/emulation/*resources/** + - test/lisp/emulation/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-emulation" @@ -215,8 +215,8 @@ test-lisp-erc-inotify: when: never - changes: - lisp/erc/*.el - - test/lisp/erc/*.el - test/lisp/erc/*resources/** + - test/lisp/erc/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-erc" @@ -232,8 +232,8 @@ test-lisp-eshell-inotify: when: never - changes: - lisp/eshell/*.el - - test/lisp/eshell/*.el - test/lisp/eshell/*resources/** + - test/lisp/eshell/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-eshell" @@ -249,8 +249,8 @@ test-lisp-gnus-inotify: when: never - changes: - lisp/gnus/*.el - - test/lisp/gnus/*.el - test/lisp/gnus/*resources/** + - test/lisp/gnus/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-gnus" @@ -266,8 +266,8 @@ test-lisp-image-inotify: when: never - changes: - lisp/image/*.el - - test/lisp/image/*.el - test/lisp/image/*resources/** + - test/lisp/image/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-image" @@ -283,8 +283,8 @@ test-lisp-international-inotify: when: never - changes: - lisp/international/*.el - - test/lisp/international/*.el - test/lisp/international/*resources/** + - test/lisp/international/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-international" @@ -300,8 +300,8 @@ test-lisp-mail-inotify: when: never - changes: - lisp/mail/*.el - - test/lisp/mail/*.el - test/lisp/mail/*resources/** + - test/lisp/mail/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-mail" @@ -317,8 +317,8 @@ test-lisp-mh-e-inotify: when: never - changes: - lisp/mh-e/*.el - - test/lisp/mh-e/*.el - test/lisp/mh-e/*resources/** + - test/lisp/mh-e/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-mh-e" @@ -334,8 +334,8 @@ test-lisp-net-inotify: when: never - changes: - lisp/net/*.el - - test/lisp/net/*.el - test/lisp/net/*resources/** + - test/lisp/net/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-net" @@ -351,8 +351,8 @@ test-lisp-nxml-inotify: when: never - changes: - lisp/nxml/*.el - - test/lisp/nxml/*.el - test/lisp/nxml/*resources/** + - test/lisp/nxml/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-nxml" @@ -368,8 +368,8 @@ test-lisp-obsolete-inotify: when: never - changes: - lisp/obsolete/*.el - - test/lisp/obsolete/*.el - test/lisp/obsolete/*resources/** + - test/lisp/obsolete/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-obsolete" @@ -385,8 +385,8 @@ test-lisp-org-inotify: when: never - changes: - lisp/org/*.el - - test/lisp/org/*.el - test/lisp/org/*resources/** + - test/lisp/org/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-org" @@ -402,8 +402,8 @@ test-lisp-play-inotify: when: never - changes: - lisp/play/*.el - - test/lisp/play/*.el - test/lisp/play/*resources/** + - test/lisp/play/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-play" @@ -417,10 +417,17 @@ test-lisp-progmodes-inotify: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never + - changes: + - lisp/progmodes/eglot.el + - lisp/progmodes/*-ts-mode.el + - test/lisp/progmodes/eglot-tests.el + - test/lisp/progmodes/*-ts-mode-resources/** + - test/lisp/progmodes/*-ts-mode-tests.el + when: never - changes: - lisp/progmodes/*.el - - test/lisp/progmodes/*.el - test/lisp/progmodes/*resources/** + - test/lisp/progmodes/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-progmodes" @@ -436,8 +443,8 @@ test-lisp-so-long-tests-inotify: when: never - changes: - lisp/so-long*.el - - test/lisp/so-long-tests/*.el - test/lisp/so-long-tests/*resources/** + - test/lisp/so-long-tests/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-so-long-tests" @@ -453,8 +460,8 @@ test-lisp-term-inotify: when: never - changes: - lisp/term/*.el - - test/lisp/term/*.el - test/lisp/term/*resources/** + - test/lisp/term/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-term" @@ -470,8 +477,8 @@ test-lisp-textmodes-inotify: when: never - changes: - lisp/textmodes/*.el - - test/lisp/textmodes/*.el - test/lisp/textmodes/*resources/** + - test/lisp/textmodes/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-textmodes" @@ -487,8 +494,8 @@ test-lisp-url-inotify: when: never - changes: - lisp/url/*.el - - test/lisp/url/*.el - test/lisp/url/*resources/** + - test/lisp/url/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-url" @@ -504,8 +511,8 @@ test-lisp-use-package-inotify: when: never - changes: - lisp/use-package/*.el - - test/lisp/use-package/*.el - test/lisp/use-package/*resources/** + - test/lisp/use-package/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-use-package" @@ -521,8 +528,8 @@ test-lisp-vc-inotify: when: never - changes: - lisp/vc/*.el - - test/lisp/vc/*.el - test/lisp/vc/*resources/** + - test/lisp/vc/*.el variables: target: emacs-inotify make_params: "-k -C test check-lisp-vc" @@ -538,8 +545,8 @@ test-misc-inotify: when: never - changes: - admin/*.el - - test/misc/*.el - test/misc/*resources/** + - test/misc/*.el variables: target: emacs-inotify make_params: "-k -C test check-misc" @@ -555,8 +562,19 @@ test-src-inotify: when: never - changes: - src/*.{h,c} - - test/src/*.el - test/src/*resources/** + - test/src/*.el variables: target: emacs-inotify make_params: "-k -C test check-src" + +.tree-sitter-files-template: + variables: + tree-sitter-files: >- + lisp/progmodes/c-ts-mode-tests.log + lisp/progmodes/elixir-ts-mode-tests.log + lisp/progmodes/go-ts-mode-tests.log + lisp/progmodes/heex-ts-mode-tests.log + lisp/progmodes/java-ts-mode-tests.log + lisp/progmodes/ruby-ts-mode-tests.log + lisp/progmodes/typescript-ts-mode-tests.log commit ecc1d990d9e9d006838ca514213ea5e46a459363 Author: Andrea Corallo Date: Fri May 19 10:46:41 2023 +0200 'describe-function' shows function inferred type when available * lisp/help-fns.el (help-fns--signature): Print function type for native compiled code. * etc/NEWS: Add entry. diff --git a/etc/NEWS b/etc/NEWS index f5e15175016..80e997d420f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -30,6 +30,11 @@ applies, and please also update docstrings as needed. * Changes in Emacs 30.1 +** Help +** 'describe-function' shows function inferred type when available. +For native compiled Lisp functions 'describe-function' prints (after +the signature) the automatically inferred function type as well. + --- ** New user option 'describe-bindings-outline-rules'. This user option controls outline visibility in the output buffer of diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1966193d1a7..c4e09e48bea 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -710,7 +710,11 @@ help-fns--signature (high-doc (cdr high))) (unless (and (symbolp function) (get function 'reader-construct)) - (insert high-usage "\n")) + (insert high-usage "\n") + (when (and (featurep 'native-compile) + (subr-native-elisp-p (symbol-function function)) + (subr-type (symbol-function function))) + (insert (format "\nInferred type: %s\n" (subr-type (symbol-function function)))))) (fill-region fill-begin (point)) high-doc))))) commit 49c56f333524b2caa34151e44c14ca0dee8d8942 Author: Mattias Engdegård Date: Tue May 30 17:09:45 2023 +0200 Add function declarations * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add get-byte, string-width, unibyte-string, special-variable-p, frexp, buffer-hash, buffer-line-statistics, load-average, md5, secure-hash, string-collate-equalp, string-collate-lessp, string-to-unibyte, string-version-lessp, current-cpu-time. (side-effect-and-error-free-fns): Add equal-including-properties. (pure-fns): Add equal-including-properties, string-version-lessp. * lisp/emacs-lisp/bytecomp.el (important-return-value-fns): Add match-data. * lisp/subr.el (buffer-local-boundp, subr-primitive-p, gensym) (frame-configuration-p, apply-partially, make-composed-keymap) (keymap-canonicalize, listify-key-sequence, event-modifiers) (event-basic-type, mouse-event-p, event-start, event-end) (event-click-count, event-line-count, posnp, posn-window, posn-area) (posn-point, posn-x-y, posn-col-row, posn-actual-col-row) (posn-timestamp, posn-string, posn-image, posn-object) (posn-object-x-y, posn-object-width-height, provided-mode-derived-p) (derived-mode-p, autoloadp, locate-eln-file, symbol-file) (process-lines-handling-status, process-lines) (process-lines-ignore-status, process-get) (copy-overlay, shell-quote-argument, field-at-pos): Add appropriate function declarations. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 8fe5066c49e..562f21aa751 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1685,7 +1685,8 @@ byte-optimize-set category-docstring category-set-mnemonics char-category-set copy-category-table get-unused-category make-category-set ;; character.c - char-width multibyte-char-to-unibyte string unibyte-char-to-multibyte + char-width get-byte multibyte-char-to-unibyte string string-width + unibyte-char-to-multibyte unibyte-string ;; charset.c decode-char encode-char ;; chartab.c @@ -1715,6 +1716,8 @@ byte-optimize-set line-beginning-position line-end-position ngettext pos-bol pos-eol propertize region-beginning region-end string-to-char user-full-name user-login-name + ;; eval.c + special-variable-p ;; fileio.c car-less-than-car directory-name-p file-directory-p file-exists-p file-name-absolute-p file-name-concat file-newer-than-file-p @@ -1723,23 +1726,28 @@ byte-optimize-set file-locked-p ;; floatfns.c abs acos asin atan ceiling copysign cos exp expt fceiling ffloor - float floor fround ftruncate isnan ldexp log logb round sin sqrt tan + float floor frexp fround ftruncate isnan ldexp log logb round + sin sqrt tan truncate ;; fns.c append assq base64-decode-string base64-encode-string base64url-encode-string + buffer-hash buffer-line-statistics compare-strings concat copy-alist copy-hash-table copy-sequence elt featurep get gethash hash-table-count hash-table-rehash-size hash-table-rehash-threshold hash-table-size hash-table-test hash-table-weakness length length< length= length> - line-number-at-pos locale-info make-hash-table + line-number-at-pos load-average locale-info make-hash-table md5 member memq memql nth nthcdr - object-intervals rassoc rassq reverse - string-as-multibyte string-as-unibyte string-bytes string-distance + object-intervals rassoc rassq reverse secure-hash + string-as-multibyte string-as-unibyte string-bytes + string-collate-equalp string-collate-lessp string-distance string-equal string-lessp string-make-multibyte string-make-unibyte - string-search string-to-multibyte substring substring-no-properties + string-search string-to-multibyte string-to-unibyte + string-version-lessp + substring substring-no-properties sxhash-eq sxhash-eql sxhash-equal sxhash-equal-including-properties take vconcat ;; frame.c @@ -1799,6 +1807,7 @@ byte-optimize-set all-threads condition-mutex condition-name mutex-name thread-live-p thread-name ;; timefns.c + current-cpu-time current-time-string current-time-zone decode-time encode-time float-time format-time-string time-add time-convert time-equal-p time-less-p time-subtract @@ -1858,7 +1867,8 @@ byte-optimize-set ;; fileio.c default-file-modes ;; fns.c - eql equal hash-table-p identity proper-list-p safe-length + eql equal equal-including-properties + hash-table-p identity proper-list-p safe-length secure-hash-algorithms ;; frame.c frame-list frame-live-p framep last-nonminibuffer-frame @@ -1936,10 +1946,11 @@ byte-optimize-set isnan ldexp logb round sqrt truncate ;; fns.c assq base64-decode-string base64-encode-string base64url-encode-string - concat elt eql equal hash-table-p identity length length< length= + concat elt eql equal equal-including-properties + hash-table-p identity length length< length= length> member memq memql nth nthcdr proper-list-p rassoc rassq safe-length string-bytes string-distance string-equal string-lessp - string-search take + string-search string-version-lessp take ;; search.c regexp-quote ;; syntax.c diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index aea50fc8e57..b7ae45a0610 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3566,6 +3566,8 @@ byte-compile-form ;; when used on arrays, but most calls pass lists. nreverse sort + match-data + ;; Adding these functions causes many warnings; ;; evaluate how many of them are false first. delq delete diff --git a/lisp/subr.el b/lisp/subr.el index 95d3bc03544..cef631a69c3 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -205,6 +205,7 @@ defvar-local (defun buffer-local-boundp (symbol buffer) "Return non-nil if SYMBOL is bound in BUFFER. Also see `local-variable-p'." + (declare (side-effect-free t)) (condition-case nil (buffer-local-value symbol buffer) (:success t) @@ -298,6 +299,7 @@ unless (defsubst subr-primitive-p (object) "Return t if OBJECT is a built-in primitive function." + (declare (side-effect-free error-free)) (and (subrp object) (not (subr-native-elisp-p object)))) @@ -415,6 +417,7 @@ gensym "Return a new uninterned symbol. The name is made by appending `gensym-counter' to PREFIX. PREFIX is a string, and defaults to \"g\"." + (declare (important-return-value t)) (let ((num (prog1 gensym-counter (setq gensym-counter (1+ gensym-counter))))) (make-symbol (format "%s%d" (or prefix "g") num)))) @@ -497,6 +500,7 @@ frame-configuration-p "Return non-nil if OBJECT seems to be a frame configuration. Any list whose car is `frame-configuration' is assumed to be a frame configuration." + (declare (pure t) (side-effect-free error-free)) (and (consp object) (eq (car object) 'frame-configuration))) @@ -506,6 +510,7 @@ apply-partially The result is a new function which does the same as FUN, except that the first N arguments are fixed at the values with which this function was called." + (declare (side-effect-free error-free)) (lambda (&rest args2) (apply fun (append args args2)))) @@ -1076,6 +1081,7 @@ make-composed-keymap bindings in other keymaps of MAPS. MAPS can be a list of keymaps or a single keymap. PARENT if non-nil should be a keymap." + (declare (side-effect-free t)) `(keymap ,@(if (keymapp maps) (list maps) maps) ,@parent)) @@ -1216,6 +1222,7 @@ keymap-canonicalize should behave identically to a copy of KEYMAP w.r.t `lookup-key' and use in active keymaps and menus. Subkeymaps may be modified but are not canonicalized." + (declare (important-return-value t)) ;; FIXME: Problem with the difference between a nil binding ;; that hides a binding in an inherited map and a nil binding that's ignored ;; to let some further binding visible. Currently a nil binding hides all. @@ -1538,6 +1545,7 @@ listify-key-sequence-1 (defun listify-key-sequence (key) "Convert a key sequence to a list of events." + (declare (side-effect-free t)) (if (vectorp key) (append key nil) (mapcar (lambda (c) @@ -1565,6 +1573,7 @@ event-modifiers that has never been used in an event that has been read as input in the current Emacs session, then this function may fail to include the `click' modifier." + (declare (side-effect-free t)) (unless (stringp event) (let ((type event)) (if (listp type) @@ -1598,6 +1607,7 @@ event-basic-type EVENT may be an event or an event type. If EVENT is a symbol that has never been used in an event that has been read as input in the current Emacs session, then this function may return nil." + (declare (side-effect-free t)) (unless (stringp event) (if (consp event) (setq event (car event))) @@ -1618,6 +1628,7 @@ mouse-movement-p (defun mouse-event-p (object) "Return non-nil if OBJECT is a mouse click event." + (declare (side-effect-free t)) ;; is this really correct? maybe remove mouse-movement? (memq (event-basic-type object) '(mouse-1 mouse-2 mouse-3 mouse-movement))) @@ -1663,6 +1674,7 @@ event-start `posn-timestamp': The time the event occurred, in milliseconds. For more information, see Info node `(elisp)Click Events'." + (declare (side-effect-free t)) (or (and (consp event) (nth 1 event)) (event--posn-at-point))) @@ -1671,17 +1683,20 @@ event-end EVENT should be a click, drag, or key press event. See `event-start' for a description of the value returned." + (declare (side-effect-free t)) (or (and (consp event) (nth (if (consp (nth 2 event)) 2 1) event)) (event--posn-at-point))) (defsubst event-click-count (event) "Return the multi-click count of EVENT, a click or drag event. The return value is a positive integer." + (declare (side-effect-free t)) (if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1)) (defsubst event-line-count (event) "Return the line count of EVENT, a mousewheel event. The return value is a positive integer." + (declare (side-effect-free t)) (if (and (consp event) (integerp (nth 3 event))) (nth 3 event) 1)) ;;;; Extracting fields of the positions in an event. @@ -1691,6 +1706,7 @@ posnp A `posn' object is returned from functions such as `event-start'. If OBJ is a valid `posn' object, but specifies a frame rather than a window, return nil." + (declare (side-effect-free error-free)) ;; FIXME: Correct the behavior of this function so that all valid ;; `posn' objects are recognized, after updating other code that ;; depends on its present behavior. @@ -1704,12 +1720,14 @@ posn-window If POSITION is outside the frame where the event was initiated, return that frame instead. POSITION should be a list of the form returned by the `event-start' and `event-end' functions." + (declare (side-effect-free t)) (nth 0 position)) (defsubst posn-area (position) "Return the window area recorded in POSITION, or nil for the text area. POSITION should be a list of the form returned by the `event-start' and `event-end' functions." + (declare (side-effect-free t)) (let ((area (if (consp (nth 1 position)) (car (nth 1 position)) (nth 1 position)))) @@ -1721,6 +1739,7 @@ posn-point and `event-end' functions. Returns nil if POSITION does not correspond to any buffer location (e.g. a click on a scroll bar)." + (declare (side-effect-free t)) (or (nth 5 position) (let ((pt (nth 1 position))) (or (car-safe pt) @@ -1746,6 +1765,7 @@ posn-x-y The return value has the form (X . Y), where X and Y are given in pixels. POSITION should be a list of the form returned by `event-start' and `event-end'." + (declare (side-effect-free t)) (nth 2 position)) (declare-function scroll-bar-scale "scroll-bar" (num-denom whole)) @@ -1765,6 +1785,7 @@ posn-col-row POSITION should be a list of the form returned by the `event-start' and `event-end' functions." + (declare (side-effect-free t)) (let* ((pair (posn-x-y position)) (frame-or-window (posn-window position)) (frame (if (framep frame-or-window) @@ -1810,12 +1831,14 @@ posn-actual-col-row number of visual columns taken by a TAB or image. If you need the coordinates of POSITION in character units, you should use `posn-col-row', not this function." + (declare (side-effect-free t)) (nth 6 position)) (defsubst posn-timestamp (position) "Return the timestamp of POSITION. POSITION should be a list of the form returned by the `event-start' and `event-end' functions." + (declare (side-effect-free t)) (nth 3 position)) (defun posn-string (position) @@ -1823,6 +1846,7 @@ posn-string Value is a cons (STRING . STRING-POS), or nil if not a string. POSITION should be a list of the form returned by the `event-start' and `event-end' functions." + (declare (side-effect-free t)) (let ((x (nth 4 position))) ;; Apparently this can also be `handle' or `below-handle' (bug#13979). (when (consp x) x))) @@ -1832,6 +1856,7 @@ posn-image Value is a list (image ...), or nil if not an image. POSITION should be a list of the form returned by the `event-start' and `event-end' functions." + (declare (side-effect-free t)) (nth 7 position)) (defsubst posn-object (position) @@ -1840,6 +1865,7 @@ posn-object \(STRING . STRING-POS) for a string object, and nil for a buffer position. POSITION should be a list of the form returned by the `event-start' and `event-end' functions." + (declare (side-effect-free t)) (or (posn-image position) (posn-string position))) (defsubst posn-object-x-y (position) @@ -1848,12 +1874,14 @@ posn-object-x-y given in pixels, and they are relative to the top-left corner of the clicked glyph of object at POSITION. POSITION should be a list of the form returned by `event-start' and `event-end'." + (declare (side-effect-free t)) (nth 8 position)) (defsubst posn-object-width-height (position) "Return the pixel width and height of the object of POSITION. The return value has the form (WIDTH . HEIGHT). POSITION should be a list of the form returned by `event-start' and `event-end'." + (declare (side-effect-free t)) (nth 9 position)) (defun values--store-value (value) @@ -2614,6 +2642,7 @@ provided-mode-derived-p Uses the `derived-mode-parent' property of the symbol to trace backwards. If you just want to check `major-mode', use `derived-mode-p'." ;; If MODE is an alias, then look up the real mode function first. + (declare (side-effect-free t)) (when-let ((alias (symbol-function mode))) (when (symbolp alias) (setq mode alias))) @@ -2628,6 +2657,7 @@ provided-mode-derived-p (defun derived-mode-p (&rest modes) "Non-nil if the current major mode is derived from one of MODES. Uses the `derived-mode-parent' property of the symbol to trace backwards." + (declare (side-effect-free t)) (apply #'provided-mode-derived-p major-mode modes)) (defvar-local major-mode--suspended nil) @@ -2751,6 +2781,7 @@ add-minor-mode (defsubst autoloadp (object) "Non-nil if OBJECT is an autoload." + (declare (side-effect-free error-free)) (eq 'autoload (car-safe object))) ;; (defun autoload-type (object) @@ -2795,6 +2826,7 @@ native-comp-eln-load-path (defun locate-eln-file (eln-file) "Locate a natively-compiled ELN-FILE by searching its load path. This function looks in directories named by `native-comp-eln-load-path'." + (declare (important-return-value t)) (or (locate-file-internal (concat comp-native-version-dir "/" eln-file) native-comp-eln-load-path) (locate-file-internal @@ -2826,6 +2858,7 @@ symbol-file This function only works for symbols defined in Lisp files. For symbols that are defined in C files, use `help-C-file-name' instead." + (declare (important-return-value t)) (if (and (or (null type) (eq type 'defun)) (symbolp symbol) (autoloadp (symbol-function symbol))) @@ -2952,6 +2985,7 @@ process-lines-handling-status program before the output is collected. If STATUS-HANDLER is nil, an error is signaled if the program returns with a non-zero exit status." + (declare (important-return-value t)) (with-temp-buffer (let ((status (apply #'call-process program nil (current-buffer) nil args))) (if status-handler @@ -2972,12 +3006,14 @@ process-lines "Execute PROGRAM with ARGS, returning its output as a list of lines. Signal an error if the program returns with a non-zero exit status. Also see `process-lines-ignore-status'." + (declare (important-return-value t)) (apply #'process-lines-handling-status program nil args)) (defun process-lines-ignore-status (program &rest args) "Execute PROGRAM with ARGS, returning its output as a list of lines. The exit status of the program is ignored. Also see `process-lines'." + (declare (important-return-value t)) (apply #'process-lines-handling-status program #'ignore args)) (defun process-live-p (process) @@ -3006,6 +3042,7 @@ process-kill-buffer-query-function (defun process-get (process propname) "Return the value of PROCESS' PROPNAME property. This is the last value stored with `(process-put PROCESS PROPNAME VALUE)'." + (declare (side-effect-free t)) (plist-get (process-plist process) propname)) (defun process-put (process propname value) @@ -3924,6 +3961,7 @@ momentary-string-display (defun copy-overlay (o) "Return a copy of overlay O." + (declare (important-return-value t)) (let ((o1 (if (overlay-buffer o) (make-overlay (overlay-start o) (overlay-end o) ;; FIXME: there's no easy way to find the @@ -4133,6 +4171,7 @@ shell-quote-argument If the optional POSIX argument is non-nil, ARGUMENT is quoted according to POSIX shell quoting rules, regardless of the system's shell." + (declare (important-return-value t)) (cond ((and (not posix) (eq system-type 'ms-dos)) ;; Quote using double quotes, but escape any existing quotes in @@ -4250,6 +4289,7 @@ compiled-function-p (defun field-at-pos (pos) "Return the field at position POS, taking stickiness etc into account." + (declare (important-return-value t)) (let ((raw-field (get-char-property (field-beginning pos) 'field))) (if (eq raw-field 'boundary) (get-char-property (1- (field-end pos)) 'field) commit 27d68d790f7d600df0918eb9b95b1078fd6185f6 Author: Mattias Engdegård Date: Tue May 30 11:17:10 2023 +0200 ; * admin/cus-test.el (cus-test-apropos): remove TODO (already done) diff --git a/admin/cus-test.el b/admin/cus-test.el index f07019bb52c..c833ddacd84 100644 --- a/admin/cus-test.el +++ b/admin/cus-test.el @@ -221,8 +221,6 @@ cus-test-apropos ;; Check the values (mapc (lambda (value) - ;; TODO for booleans, check for values that can be - ;; evaluated and are not t or nil. Usually a bug. (unless (widget-apply conv :match value) (let ((err (list symbol :type-error value type))) (unless (member err cus-test-errors) commit 845f97d475b2b1f963ab078a11e0baf5388dd5b2 Author: Mattias Engdegård Date: Tue May 30 11:14:01 2023 +0200 ; * admin/admin.el (cusver-scan): remove broken warning The call to `format-message` had no effect in itself, but it turns out that actually emitting the result just results in useless warnings so we remove it entirely. diff --git a/admin/admin.el b/admin/admin.el index 90f810b79c6..1f4c6986b0e 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -1038,8 +1038,7 @@ cusver-scan (and grp (setq grp (car (cdr-safe grp))) ; (quote foo) -> foo (setq ver (assq grp glist)))) - (setq alist (cons (cons var ver) alist)))) - (if form (format-message "Malformed defcustom: `%s'" form))))) + (setq alist (cons (cons var ver) alist))))))) (message "%sdone" m) alist)) commit 9ae212fb1e5ef8cffd10ee174004caabf2027ba3 Author: Mattias Engdegård Date: Tue May 30 10:38:06 2023 +0200 xml.el: remove incorrect and botched attribute whitespace collapse * lisp/xml.el (xml-parse-attlist): Don't attempt to collapse multiple consecutive whitespace characters into a single space, which is wrong to do a this point when attributes must be assumed to be CDATA. The code was actually unintentionally correct since it forgot to use the return value of `replace-regexp-in-string` (bug#63740). diff --git a/lisp/xml.el b/lisp/xml.el index 58d17a4b340..9095653416e 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -669,10 +669,7 @@ xml-parse-attlist (if (assoc name attlist) (error "XML: (Not Well-Formed) Each attribute must be unique within an element")) - ;; Multiple whitespace characters should be replaced with a single one - ;; in the attributes (let ((string (match-string-no-properties 1))) - (replace-regexp-in-string "\\s-\\{2,\\}" " " string) (let ((expansion (xml-substitute-special string))) (unless (stringp expansion) ;; We say this is the constraint. It is actually that commit 6e255ddfffa90d975eec62749c9acd385336f252 Author: Mattias Engdegård Date: Tue May 30 10:23:39 2023 +0200 * test/lisp/dnd-tests.el (dnd-tests-begin-text-drag): Fix typo. diff --git a/test/lisp/dnd-tests.el b/test/lisp/dnd-tests.el index a603f29eb6d..9f97d739cec 100644 --- a/test/lisp/dnd-tests.el +++ b/test/lisp/dnd-tests.el @@ -172,7 +172,7 @@ dnd-tests-begin-text-drag (extracted-1 (dnd-tests-extract-selection-data string-data-1 t)) (extracted (dnd-tests-extract-selection-data string-data t))) (should (and (stringp extracted) (stringp extracted-1))) - (should (equal extracted extracted))) + (should (equal extracted extracted-1))) ;; Now check text/plain. (let ((string-data (dnd-tests-verify-selection-data 'text/plain))) commit ace9f6775580459c35254607d866f3bb22a8c45b Author: Mattias Engdegård Date: Tue May 30 10:04:48 2023 +0200 Avoid using rx `any` for `not-newline` Despite its name, `any` does not match any character (use `anychar` for that) but is an old synonym for `not-newline` and `nonl`, retained for compatibility with the obsolete `sregex` package. (In SRE as defined by SRFI-115, `any` does match any character.) There is also a mild but unnecessary confusion with the more frequently used `any` construct for character alternatives. * lisp/edmacro.el (edmacro-mode-font-lock-keywords): * lisp/erc/erc.el (erc--ensure-url): * lisp/org/org.el (org-fontify-meta-lines-and-blocks-1): * lisp/progmodes/scheme.el (scheme-imenu-generic-expression): * test/lisp/find-cmd-tests.el (find-cmd-test-find-cmd): Replace uses of `any` with `nonl`. diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 8734f7cbebe..69d20d2bad3 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -91,17 +91,17 @@ edmacro-mode-font-lock-keywords `((,(rx bol (group (or "Command" "Key" "Macro") ":")) 0 'edmacro-label) (,(rx bol (group ";; Keyboard Macro Editor. Press ") - (group (*? any)) + (group (*? nonl)) (group " to finish; press ")) (1 'font-lock-comment-face) (2 'help-key-binding) (3 'font-lock-comment-face) - (,(rx (group (*? any)) - (group " to cancel" (* any))) + (,(rx (group (*? nonl)) + (group " to cancel" (* nonl))) nil nil (1 'help-key-binding) (2 'font-lock-comment-face))) - (,(rx (one-or-more ";") (zero-or-more any)) 0 'font-lock-comment-face))) + (,(rx (one-or-more ";") (zero-or-more nonl)) 0 'font-lock-comment-face))) (defvar edmacro-store-hook) (defvar edmacro-finish-hook) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 5a91285c1d1..2c2df81fa6d 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2398,9 +2398,9 @@ erc-after-connect (defun erc--ensure-url (input) (unless (string-match (rx bot "irc" (? "6") (? "s") "://") input) - (when (and (string-match (rx (? (+ any) "@") - (or (group (* (not "[")) ":" (* any)) - (+ any)) + (when (and (string-match (rx (? (+ nonl) "@") + (or (group (* (not "[")) ":" (* nonl)) + (+ nonl)) ":" (+ (not (any ":]"))) eot) input) (match-beginning 1)) diff --git a/lisp/org/org.el b/lisp/org/org.el index e42704778bd..b81630fdc07 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -5374,7 +5374,7 @@ org-fontify-meta-lines-and-blocks-1 (zero-or-more (any " \t")) (group (group (zero-or-more (not (any " \t\n")))) (zero-or-more (any " \t")) - (group (zero-or-more any))))) + (group (zero-or-more nonl))))) limit t) (let ((beg (match-beginning 0)) (end-of-beginline (match-end 0)) @@ -5400,7 +5400,7 @@ org-fontify-meta-lines-and-blocks-1 "#+end" ,(match-string 4) word-end - (zero-or-more any))))) + (zero-or-more nonl))))) ;; We look further than LIMIT on purpose. nil t) ;; We do have a matching #+end line. @@ -5473,7 +5473,7 @@ org-fontify-meta-lines-and-blocks-1 (beginning-of-line) (looking-at (rx (group (zero-or-more (any " \t")) "#+caption" - (optional "[" (zero-or-more any) "]") + (optional "[" (zero-or-more nonl) "]") ":") (zero-or-more (any " \t"))))) (add-text-properties (line-beginning-position) (match-end 1) diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 38cb19f5a12..e6fcc684729 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -155,7 +155,7 @@ scheme-imenu-generic-expression ,(rx bol (zero-or-more space) "(define-module" (one-or-more space) - (group "(" (one-or-more any) ")")) + (group "(" (one-or-more nonl) ")")) 1) ("Macros" ,(rx bol (zero-or-more space) "(" diff --git a/test/lisp/find-cmd-tests.el b/test/lisp/find-cmd-tests.el index a0b9a80ef47..3fbd0fc4ea3 100644 --- a/test/lisp/find-cmd-tests.el +++ b/test/lisp/find-cmd-tests.el @@ -25,7 +25,7 @@ (ert-deftest find-cmd-test-find-cmd () (should (string-match - (rx "find " (+ any) + (rx "find " (+ nonl) " \\( \\( -name .svn -or -name .git -or -name .CVS \\)" " -prune -or -true \\)" " \\( \\( \\(" " -name \\*.pl -or -name \\*.pm -or -name \\*.t \\)" commit 23a14e7b9026a8572fe8ae8759232e08cd37910a Author: Theodor Thornhill Date: Tue May 30 15:29:38 2023 +0200 Add compact_constructor_declaration font-locking to java-ts-mode * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): New pattern. diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index fca00cdce4f..44dfd74cafd 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -226,6 +226,9 @@ java-ts-mode--font-lock-settings (constructor_declaration name: (identifier) @font-lock-type-face) + (compact_constructor_declaration + name: (identifier) @font-lock-type-face) + (field_access object: (identifier) @font-lock-type-face) commit 08291e6f1755837d1cc0d5ac940bd39f7bcadd43 Author: Mattias Engdegård Date: Mon May 29 17:49:48 2023 +0200 Clean up defcustom type quote check * lisp/emacs-lisp/bytecomp.el (byte-compile--suspicious-defcustom-choice): Rename to... (byte-compile--defcustom-type-quoted): ...this and rewrite to make more sense. All callers updated. (byte-compile-nogroup-warn): Better warning message. * test/lisp/emacs-lisp/bytecomp-tests.el (test-bytecomp-defgroup-choice): This never failed because it wasn't actually a test. Turn it into... (bytecomp-test-defcustom-type-quoted): ...this, which is. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index ac040799a22..aea50fc8e57 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1619,21 +1619,20 @@ byte-compile-format-warn (dolist (elt '(format message format-message error)) (put elt 'byte-compile-format-like t)) -(defun byte-compile--suspicious-defcustom-choice (type) - "Say whether defcustom TYPE looks odd." - ;; Check whether there's anything like (choice (const :tag "foo" ;; 'bar)). +(defun byte-compile--defcustom-type-quoted (type) + "Whether defcustom TYPE contains an accidentally quoted value." + ;; Detect mistakes such as (const 'abc). ;; We don't actually follow the syntax for defcustom types, but this ;; should be good enough. - (catch 'found - (if (and (consp type) - (proper-list-p type)) - (if (memq (car type) '(const other)) - (when (assq 'quote type) - (throw 'found t)) - (when (memq t (mapcar #'byte-compile--suspicious-defcustom-choice - type)) - (throw 'found t))) - nil))) + (and (consp type) + (proper-list-p type) + (if (memq (car type) '(const other)) + (assq 'quote type) + (let ((elts (cdr type))) + (while (and elts (not (byte-compile--defcustom-type-quoted + (car elts)))) + (setq elts (cdr elts))) + elts)))) ;; Warn if a custom definition fails to specify :group, or :type. (defun byte-compile-nogroup-warn (form) @@ -1647,10 +1646,10 @@ byte-compile-nogroup-warn (byte-compile-warn-x (cadr name) "defcustom for `%s' fails to specify type" (cadr name))) - ((byte-compile--suspicious-defcustom-choice type) + ((byte-compile--defcustom-type-quoted type) (byte-compile-warn-x (cadr name) - "defcustom for `%s' has syntactically odd type `%s'" + "defcustom for `%s' may have accidentally quoted value in type `%s'" (cadr name) type))))) (if (and (memq (car form) '(custom-declare-face custom-declare-variable)) byte-compile-current-group) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index a8809bda81c..963ea9abe0c 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1799,11 +1799,11 @@ bytecomp-tests-byte-compile--wide-docstring-p/func-arg-list (TEST-IN-COMMENTS t) (TEST-IN-STRINGS t) (TEST-IN-CODE t) \ (FIXTURE-FN \\='#\\='electric-pair-mode))" fill-column))) -(defun test-bytecomp-defgroup-choice () - (should-not (byte-compile--suspicious-defcustom-choice 'integer)) - (should-not (byte-compile--suspicious-defcustom-choice +(ert-deftest bytecomp-test-defcustom-type-quoted () + (should-not (byte-compile--defcustom-type-quoted 'integer)) + (should-not (byte-compile--defcustom-type-quoted '(choice (const :tag "foo" bar)))) - (should (byte-compile--suspicious-defcustom-choice + (should (byte-compile--defcustom-type-quoted '(choice (const :tag "foo" 'bar))))) (ert-deftest bytecomp-function-attributes () commit f8a79c0055f1d60815599af777b5d2c78f9616c3 Author: Michael Albinus Date: Tue May 30 09:46:46 2023 +0200 * test/infra/gitlab-ci.yml (test-tree-sitter): Fix file list. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index aabb50f6aaa..9a862dcba3c 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -283,7 +283,7 @@ test-tree-sitter: # This is needed in order to get a JUnit test report. files: >- lisp/progmodes/c-ts-mode-tests.log - lisp/progmodes/elixir-ts-mode-tests.el + lisp/progmodes/elixir-ts-mode-tests.log lisp/progmodes/go-ts-mode-tests.log lisp/progmodes/heex-ts-mode-tests.log lisp/progmodes/java-ts-mode-tests.log commit cb1ee63e2aea573d67e2d495d6b5937a15bc0368 Author: Protesilaos Stavrou Date: Tue May 30 09:37:24 2023 +0300 Update modus-themes to their version 4.2.0 * doc/misc/modus-themes.org: Update the manual. * etc/themes/modus-operandi-tritanopia-theme.el: * etc/themes/modus-vivendi-tritanopia-theme.el: Add new themes optimized for users with blue-yellow color deficiency (tritanopia). * etc/themes/modus-operandi-deuteranopia-theme.el: * etc/themes/modus-operandi-theme.el: * etc/themes/modus-operandi-tinted-theme.el: * etc/themes/modus-vivendi-deuteranopia-theme.el: * etc/themes/modus-vivendi-theme.el: * etc/themes/modus-vivendi-tinted-theme.el: Update theme files. * etc/themes/modus-themes.el: Update main file to the latest version. * etc/NEWS: Rephrase the announcement about the new Modus themes to also mention the tritanopia-optimized items. Detailed release notes here: . diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 47d3e6c03e3..7809bd03918 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org @@ -4,9 +4,9 @@ #+language: en #+options: ':t toc:nil author:t email:t num:t #+startup: content -#+macro: stable-version 4.1.0 -#+macro: release-date 2023-02-22 -#+macro: development-version 4.2.0-dev +#+macro: stable-version 4.2.0 +#+macro: release-date 2023-05-30 +#+macro: development-version 4.3.0-dev #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ #+macro: space @@texinfo:@: @@ #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ @@ -77,7 +77,7 @@ combinations of background and foreground values. For small sized text, this corresponds to the WCAG AAA standard, which specifies a minimum rate of distance in relative luminance of 7:1. -The Modus themes consist of six themes, divided into three subgroups. +The Modus themes consist of eight themes, divided into four subgroups. - Main themes :: ~modus-operandi~ is the project's main light theme, while ~modus-vivendi~ is its dark counterpart. These two themes are @@ -101,15 +101,23 @@ The Modus themes consist of six themes, divided into three subgroups. users with deueteranopia or deuteranomaly (mostly yellow and blue hues). +- Tritanopia themes :: ~modus-operandi-tritanopia~ and its counterpart + ~modus-vivendi-tritanopia~ are optimized for users with blue-yellow + color deficiency. The idea is the same as with the deuteranopia + variants: color coding relies only on hues that are accessible to + people with tritanopia or tritanomaly, namely, shades of red and + cyan. + To ensure that users have a consistently accessible experience, the themes strive to achieve as close to full face coverage as possible, while still targeting a curated list of well-maintained packages ([[#h:a9c8f29d-7f72-4b54-b74b-ddefe15d6a19][Face coverage]]). -The overarching objective of this project is to always offer accessible -color combinations. There shall never be a compromise on this -principle. If there arises an inescapable trade-off between readability -and stylistic considerations, we will always opt for the former. +The overarching objective of this project is to always offer +accessible color combinations. There shall never be a compromise on +this principle. If there arises an inescapable trade-off between +usability and stylistic considerations, we will always opt for the +former. Starting with version 0.12.0 and onwards, the themes are built into GNU Emacs. @@ -441,6 +449,8 @@ will lead to failures in loading the files. If either or both of those variables need to be changed, their values should be defined before the package declaration of the themes. +[[#h:aabcada6-810d-4eee-b34a-d2a9c301824d][Make the themes look like what the maintainer uses]] + ** Differences between loading and enabling :properties: :custom_id: h:e68560b3-7fb0-42bc-a151-e015948f8a35 @@ -1066,6 +1076,9 @@ palette variable is =THEME-NAME-palette-overrides=, thus yielding: #+vindex: modus-operandi-tinted-palette-overrides + ~modus-operandi-tinted-palette-overrides~ +#+vindex: modus-operandi-tritanopia-palette-overrides ++ ~modus-operandi-tritanopia-palette-overrides~ + #+vindex: modus-vivendi-palette-overrides + ~modus-vivendi-palette-overrides~ @@ -1075,6 +1088,9 @@ palette variable is =THEME-NAME-palette-overrides=, thus yielding: #+vindex: modus-vivendi-tinted-palette-overrides + ~modus-vivendi-tinted-palette-overrides~ +#+vindex: modus-vivendi-tritanopia-palette-overrides ++ ~modus-vivendi-tritanopia-palette-overrides~ + Theme-specific overrides take precedence over the shared ones. It is strongly advised that shared overrides do NOT alter color values, as those will not be appropriate for both dark and light themes. Common @@ -1123,7 +1139,7 @@ For example, the ~modus-operandi-palette~ is like this: #+end_src The ~modus-operandi-palette-overrides~ targets the entries that need -to be changed. For example, to make the main foreground colour a dark +to be changed. For example, to make the main foreground color a dark gray instead of pure black, use a shade of red for comments, and apply a cyan hue to keywords: @@ -1153,15 +1169,30 @@ Named colors can be previewed, such as with the command For a video tutorial that users of all skill levels can approach, watch: https://protesilaos.com/codelog/2022-12-17-modus-themes-v4-demo/. -*** Palette override presets +* Advanced customization +:properties: +:custom_id: h:f4651d55-8c07-46aa-b52b-bed1e53463bb +:end: + +Unlike the predefined customization options which follow a clear pattern +of allowing the user to quickly specify their preference, the themes +also provide a more flexible, albeit difficult, mechanism to control +things with precision ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). + +This section is of interest only to users who are prepared to maintain +their own local tweaks and who are willing to deal with any possible +incompatibilities between versioned releases of the themes. As such, +they are labeled as "do-it-yourself" or "DIY". + +** Palette override presets :PROPERTIES: :CUSTOM_ID: h:b0bc811c-227e-42ec-bf67-15e1f41eb7bc :END: This section shows how to refashion the themes by opting in to the stylistic presets we provide. Those presets override the default -color mappings to amplify or tone down the overall coloration of the -them. +color mappings to amplify, tone down, or refashion the overall +coloration of the themes. To make almost all aspects of the themes less intense, use this: @@ -1187,6 +1218,18 @@ The ~modus-themes-preset-overrides-intense~ makes many background colors accented instead of gray and increases coloration in a number of places. Colors stand out more and are made easier to spot. +#+vindex: modus-themes-preset-overrides-cooler +#+vindex: modus-themes-preset-overrides-warmer +For some stylistic variation try the "cooler" and "warmer" presets: + +#+begin_src emacs-lisp +;; This: +(setq modus-themes-common-palette-overrides modus-themes-preset-overrides-cooler) + +;; Or: +(setq modus-themes-common-palette-overrides modus-themes-preset-overrides-warmer) +#+end_src + Note that the user is not limited to those presets. The system of overrides we provide makes it possible to tweak the value of each individual named color and to change how values are assigned to @@ -1214,7 +1257,7 @@ the general idea (extra space for didactic purposes): ,@modus-themes-preset-overrides-intense)) #+end_src -*** Stylistic variants using palette overrides +** Stylistic variants using palette overrides :PROPERTIES: :CUSTOM_ID: h:df1199d8-eaba-47db-805d-6b568a577bf3 :END: @@ -1226,7 +1269,7 @@ to take effect. To apply overrides at startup simply define them before the call that loads the theme. Remember that we also provide presets that are easier to apply ([[#h:b0bc811c-227e-42ec-bf67-15e1f41eb7bc][Palette override presets]]). -**** Make the mode line borderless +*** Make the mode line borderless :PROPERTIES: :CUSTOM_ID: h:80ddba52-e188-411f-8cc0-480ebd75befe :END: @@ -1263,7 +1306,7 @@ set their color to that of the underlying background. (border-mode-line-inactive bg-mode-line-inactive))) #+end_src -**** Make the active mode line colorful +*** Make the active mode line colorful :PROPERTIES: :CUSTOM_ID: h:e8d781be-eefc-4a81-ac4e-5ed156190df7 :END: @@ -1307,7 +1350,7 @@ have a blue mode line for ~modus-operandi~ and a red one for (border-mode-line-active bg-red-subtle))) #+end_src -**** Make the tab bar more or less colorful +*** Make the tab bar more or less colorful :PROPERTIES: :CUSTOM_ID: h:096658d7-a0bd-4a99-b6dc-9b20a20cda37 :END: @@ -1359,7 +1402,7 @@ manual. (bg-tab-other bg-cyan-subtle))) #+end_src -**** Make the fringe invisible or another color +*** Make the fringe invisible or another color :PROPERTIES: :CUSTOM_ID: h:c312dcac-36b6-4a1f-b1f5-ab1c9abe27b0 :END: @@ -1393,7 +1436,7 @@ or continuation lines. '((fringe bg-blue-nuanced))) #+end_src -**** Make links use subtle or no underlines +*** Make links use subtle or no underlines :PROPERTIES: :CUSTOM_ID: h:6c1d1dea-5cbf-4d92-b7bb-570a7a23ffe9 :END: @@ -1417,7 +1460,7 @@ that underline mappings can read correctly. (underline-link-symbolic unspecified))) #+end_src -**** Make prompts more or less colorful +*** Make prompts more or less colorful :PROPERTIES: :CUSTOM_ID: h:bd75b43a-0bf1-45e7-b8b4-20944ca8b7f8 :END: @@ -1454,7 +1497,7 @@ block we show how to add or remove color from prompts. (bg-prompt bg-yellow-subtle))) ; try to replace "subtle" with "intense" #+end_src -**** Make completion matches more or less colorful +*** Make completion matches more or less colorful :PROPERTIES: :CUSTOM_ID: h:d959f789-0517-4636-8780-18123f936f91 :END: @@ -1541,7 +1584,7 @@ colors to two: The user can mix and match to their liking. -**** Make comments yellow and strings green +*** Make comments yellow and strings green :PROPERTIES: :CUSTOM_ID: h:26f53daa-0065-48dc-88ab-6a718d16cd95 :END: @@ -1584,7 +1627,7 @@ reproduce the effect, but also how to tweak it to one's liking. (string yellow-cooler))) #+end_src -**** Make code syntax use the old alt-syntax style +*** Make code syntax use the old alt-syntax style :PROPERTIES: :CUSTOM_ID: h:c8767172-bf11-4c96-81dc-e736c464fc9c :END: @@ -1669,7 +1712,7 @@ The user can always mix and match styles to their liking. [[#h:943063da-7b27-4ba4-9afe-f8fe77652fd1][Make use of alternative styles for code syntax]]. -**** Make use of alternative styles for code syntax +*** Make use of alternative styles for code syntax :PROPERTIES: :CUSTOM_ID: h:943063da-7b27-4ba4-9afe-f8fe77652fd1 :END: @@ -1760,7 +1803,7 @@ theme palette. (variable cyan-warmer))) #+end_src -**** Make matching parenthesis more or less intense +*** Make matching parenthesis more or less intense :PROPERTIES: :CUSTOM_ID: h:259cf8f5-48ec-4b13-8a69-5d6387094468 :END: @@ -1790,7 +1833,7 @@ to enable underlines for those highlights. (underline-paren-match fg-main))) #+end_src -**** Make box buttons more or less gray +*** Make box buttons more or less gray :PROPERTIES: :CUSTOM_ID: h:4f6b6ca3-f5bb-4830-8312-baa232305360 :END: @@ -1818,7 +1861,7 @@ inactive ones. (fg-button-inactive "gray50"))) #+end_src -**** Make TODO and DONE more or less intense +*** Make TODO and DONE more or less intense :PROPERTIES: :CUSTOM_ID: h:b57bb50b-a863-4ea8-bb38-6de2275fa868 :END: @@ -1858,7 +1901,7 @@ to subdue them. '((prose-done fg-dim))) #+end_src -**** Make headings more or less colorful +*** Make headings more or less colorful :PROPERTIES: :CUSTOM_ID: h:11297984-85ea-4678-abe9-a73aeab4676a :END: @@ -1915,7 +1958,7 @@ match styles at will. (overline-heading-1 border))) #+end_src -**** Make Org agenda more or less colorful +*** Make Org agenda more or less colorful :PROPERTIES: :CUSTOM_ID: h:a5af0452-a50f-481d-bf60-d8143f98105f :END: @@ -1980,7 +2023,25 @@ A third example that makes the agenda more blue: (date-weekend fg-dim))) #+end_src -**** Make inline code in prose use alternative styles +Yet another example that also affects =DONE= and =TODO= keywords: + +#+begin_src emacs-lisp +;; Change dates to a set of more subtle combinations. Deadlines are a +;; shade of magenta, scheduled dates are a shade of green that +;; complements that of the deadlines, weekday headings use the main +;; foreground color while weekends are a shade of gray. The DONE +;; keyword is a faint blue-gray while TODO is yellow. +(setq modus-themes-common-palette-overrides + '((date-deadline magenta-warmer) + (date-scheduled green-cooler) + (date-weekday fg-main) + (date-event fg-dim) + (date-now blue) + (prose-done fg-alt) + (prose-todo yellow))) +#+end_src + +*** Make inline code in prose use alternative styles :PROPERTIES: :CUSTOM_ID: h:bb5b396f-5532-4d52-ab13-149ca24854f1 :END: @@ -2039,7 +2100,7 @@ do not show every possible permutation. (prose-verbatim red-warmer))) #+end_src -**** Make mail citations and headers more or less colorful +*** Make mail citations and headers more or less colorful :PROPERTIES: :CUSTOM_ID: h:7da7a4ad-5d3a-4f11-9796-5a1abed0f0c4 :END: @@ -2108,7 +2169,7 @@ We thus have the following: (mail-other green))) #+end_src -**** Make the region preserve text colors, plus other styles +*** Make the region preserve text colors, plus other styles :PROPERTIES: :CUSTOM_ID: h:c8605d37-66e1-42aa-986e-d7514c3af6fe :END: @@ -2148,7 +2209,7 @@ with an appropriate foreground value. (fg-region fg-main))) #+end_src -**** Make mouse highlights more or less colorful +*** Make mouse highlights more or less colorful :PROPERTIES: :CUSTOM_ID: h:b5cab69d-d7cb-451c-8ff9-1f545ceb6caf :END: @@ -2177,7 +2238,7 @@ mapping that covers mouse hover effects and related highlights: '((bg-hover bg-green-subtle))) #+end_src -**** Make language underlines less colorful +*** Make language underlines less colorful :PROPERTIES: :CUSTOM_ID: h:03dbd5af-6bae-475e-85a2-cec189f69598 :END: @@ -2210,7 +2271,7 @@ by code linters and prose spell checkers. (underline-note green-intense))) #+end_src -**** Make line numbers use alternative styles +*** Make line numbers use alternative styles :PROPERTIES: :CUSTOM_ID: h:b6466f51-cb58-4007-9ebe-53a27af655c7 :END: @@ -2252,7 +2313,7 @@ this section we show how to affect the ~display-line-numbers-mode~. (bg-line-number-active bg-cyan-intense))) #+end_src -**** Make diffs use only a foreground +*** Make diffs use only a foreground :PROPERTIES: :CUSTOM_ID: h:b3761482-bcbf-4990-a41e-4866fb9dad15 :END: @@ -2268,7 +2329,7 @@ adjustments for them by overriding their palettes directly instead of just using the "common" overrides. #+begin_src emacs-lisp -;; Diffs with only foreground colours. Word-wise ("refined") diffs +;; Diffs with only foreground colors. Word-wise ("refined") diffs ;; have a gray background to draw attention to themselves. (setq modus-themes-common-palette-overrides '((bg-added unspecified) @@ -2316,7 +2377,7 @@ just using the "common" overrides. (fg-removed-intense yellow-intense))) #+end_src -**** Make deuteranopia diffs red and blue instead of yellow and blue +*** Make deuteranopia diffs red and blue instead of yellow and blue :PROPERTIES: :CUSTOM_ID: h:16389ea1-4cb6-4b18-9409-384324113541 :END: @@ -2367,20 +2428,110 @@ respectively. This is achieved by overriding the "changed" and (fg-removed-intense "#ff9095"))) #+end_src -* Advanced customization -:properties: -:custom_id: h:f4651d55-8c07-46aa-b52b-bed1e53463bb -:end: +*** Make the themes look like what the maintainer uses +:PROPERTIES: +:CUSTOM_ID: h:aabcada6-810d-4eee-b34a-d2a9c301824d +:END: -Unlike the predefined customization options which follow a clear pattern -of allowing the user to quickly specify their preference, the themes -also provide a more flexible, albeit difficult, mechanism to control -things with precision ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). +Based on what we have learnt from the previous sections of this +manual, here is what Protesilaos uses: -This section is of interest only to users who are prepared to maintain -their own local tweaks and who are willing to deal with any possible -incompatibilities between versioned releases of the themes. As such, -they are labeled as "do-it-yourself" or "DIY". +#+begin_src emacs-lisp +;; Always reload the theme for changes to take effect! + +(setq modus-themes-custom-auto-reload nil + modus-themes-to-toggle '(modus-operandi modus-vivendi) + modus-themes-mixed-fonts t + modus-themes-variable-pitch-ui nil + modus-themes-italic-constructs t + modus-themes-bold-constructs nil + modus-themes-org-blocks nil + modus-themes-completions '((t . (extrabold))) + modus-themes-prompts nil + modus-themes-headings + '((agenda-structure . (variable-pitch light 2.2)) + (agenda-date . (variable-pitch regular 1.3)) + (t . (regular 1.15)))) + +(setq modus-themes-common-palette-overrides + '((cursor magenta-cooler) + ;; Make the fringe invisible. + (fringe unspecified) + ;; Make line numbers less intense and add a shade of cyan + ;; for the current line number. + (fg-line-number-inactive "gray50") + (fg-line-number-active cyan-cooler) + (bg-line-number-inactive unspecified) + (bg-line-number-active unspecified) + ;; Make the current line of `hl-line-mode' a fine shade of + ;; gray (though also see my `lin' package). + (bg-hl-line bg-dim) + ;; Make the region have a cyan-green background with no + ;; specific foreground (use foreground of underlying text). + ;; "bg-sage" refers to Salvia officinalis, else the common + ;; sage. + (bg-region bg-sage) + (fg-region unspecified) + ;; Make matching parentheses a shade of magenta. It + ;; complements the region nicely. + (bg-paren-match bg-magenta-intense) + ;; Make email citations faint and neutral, reducing the + ;; default four colors to two; make mail headers cyan-blue. + (mail-cite-0 fg-dim) + (mail-cite-1 blue-faint) + (mail-cite-2 fg-dim) + (mail-cite-3 blue-faint) + (mail-part cyan-warmer) + (mail-recipient blue-warmer) + (mail-subject magenta-cooler) + (mail-other cyan-warmer) + ;; Change dates to a set of more subtle combinations. + (date-deadline magenta-cooler) + (date-scheduled magenta) + (date-weekday fg-main) + (date-event fg-dim) + (date-now blue-faint) + ;; Make tags (Org) less colorful and tables look the same as + ;; the default foreground. + (prose-done cyan-cooler) + (prose-tag fg-dim) + (prose-table fg-main) + ;; Make headings less colorful (though I never use deeply + ;; nested headings). + (fg-heading-2 blue-faint) + (fg-heading-3 magenta-faint) + (fg-heading-4 blue-faint) + (fg-heading-5 magenta-faint) + (fg-heading-6 blue-faint) + (fg-heading-7 magenta-faint) + (fg-heading-8 blue-faint) + ;; Make the active mode line a fine shade of lavender + ;; (purple) and tone down the gray of the inactive mode + ;; lines. + (bg-mode-line-active bg-lavender) + (border-mode-line-active bg-lavender) + + (bg-mode-line-inactive bg-dim) + (border-mode-line-inactive bg-inactive) + ;; Make the prompts a shade of magenta, to fit in nicely with + ;; the overall blue-cyan-purple style of the other overrides. + ;; Add a nuanced background as well. + (bg-prompt bg-magenta-nuanced) + (fg-prompt magenta-cooler) + ;; Tweak some more constructs for stylistic constistency. + (name blue-warmer) + (identifier magenta-faint) + (keybind magenta-cooler) + (accent-0 magenta-cooler) + (accent-1 cyan-cooler) + (accent-2 blue-warmer) + (accent-3 red-cooler))) + +;; Make the active mode line have a pseudo 3D effect (this assumes +;; you are using the default mode line and not an extra package). +(custom-set-faces + '(mode-line ((t :box (:style released-button))))) +#+end_src ** More accurate colors in terminal emulators :PROPERTIES: @@ -2584,8 +2735,9 @@ for palette overrides. Else it reads only the default palette. [[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]. -With optional =THEME= as a symbol among ~modus-themes-items~, use the -palette of that item. Else use the current Modus theme. +With optional =THEME= as a symbol among ~modus-themes-items~ (alias +~modus-themes-collection~), use the palette of that item. Else use +the current Modus theme. If =COLOR= is not present in the palette, this function returns the ~unspecified~ symbol, which is safe when used as a face attribute's @@ -3479,6 +3631,90 @@ In this document, we cover ~modus-themes-after-load-theme-hook~ though the user can replace it with ~after-enable-theme-hook~ should they need to (provided they understand the implications). +** Use more spacious margins or padding in Emacs frames +:PROPERTIES: +:CUSTOM_ID: h:43bcb5d0-e25f-470f-828c-662cee9e21f1 +:END: + +By default, Emacs frames try to maximize the number of characters that +fit in the current visible portion of the buffer. Users may prefer to +have some extra padding instead. This can make Emacs frames look more +pleasant, but also make it easier to identify the currently active +window. + +The way to implement such padding is two-fold: + +1. In the =early-init.el= file instruct Emacs to use a higher value + for the ~internal-border-width~ of all frames, as well as for the + ~right-divider-width~. The former concerns the outer boundaries of + Emacs frames, while the latter pertains to dividers between Emacs + windows. + +2. Make the relevant faces invisible by changing the value of their + relevant attributes to that of the current theme's main background. + +The parameters of Emacs frames are specified in the variables +~initial-frame-alist~ and ~default-frame-alist~. The "initial frame" +refers to the first frame that appears on Emacs startup. The +"default" refers to the fallback values that apply to all other frames +that Emacs creates (unless those are explicitly overridden by a +bespoke ~make-frame~ call). + +In detail, first we use the same values for the two frame alist variables: + +#+begin_src emacs-lisp +;; This must go in the early-init.el so that it applies to the initial +;; frame. +(dolist (var '(default-frame-alist initial-frame-alist)) + (add-to-list var '(right-divider-width . 20)) + (add-to-list var '(internal-border-width . 20))) +#+end_src + +What the ~dolist~ does is to call ~add-to-list~ for the two variables +we specify there. This economizes on typing. + +Then we define a function that makes the relevant faces invisible. +The reason we do this with a function is so we can hook it to the +"post load" phase of a theme, thus applying the new background value +(otherwise you keep the old background, which likely means that the +faces will no longer be invisible). + +#+begin_src emacs-lisp +(defun my-modus-themes-invisible-dividers () + "Make window dividers invisible. +Add this to the `modus-themes-post-load-hook'." + (let ((bg (face-background 'default))) + (custom-set-faces + `(fringe ((t :background ,bg :foreground ,bg))) + `(window-divider ((t :background ,bg :foreground ,bg))) + `(window-divider-first-pixel ((t :background ,bg :foreground ,bg))) + `(window-divider-last-pixel ((t :background ,bg :foreground ,bg)))))) + +(add-hook 'modus-themes-post-load-hook #'my-modus-themes-invisible-dividers) +#+end_src + +The above will work only for themes that belong to the Modus family. +For users of Emacs version 29 or higher, there exists a theme-agnostic +hook that takes a function with one argument---that of the theme---and +calls in the the "post enable" phase of theme loading. Here is the +above snippet, with the necessary tweaks: + +#+begin_src emacs-lisp +(defun my-modus-themes-invisible-dividers (_theme) + "Make window dividers for THEME invisible." + (let ((bg (face-background 'default))) + (custom-set-faces + `(fringe ((t :background ,bg :foreground ,bg))) + `(window-divider ((t :background ,bg :foreground ,bg))) + `(window-divider-first-pixel ((t :background ,bg :foreground ,bg))) + `(window-divider-last-pixel ((t :background ,bg :foreground ,bg)))))) + +(add-hook 'enable-theme-functions #'my-modus-themes-invisible-dividers) +#+end_src + +Users of older versions of Emacs can read the entry herein about +defining their own theme-agnostic hook ([[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]). + ** Custom hl-todo colors :PROPERTIES: :CUSTOM_ID: h:2ef83a21-2f0a-441e-9634-473feb940743 @@ -3636,7 +3872,7 @@ have lots of extensions, so the "full support" may not be 100% true… + csv-mode + ctrlf + custom (what you get with {{{kbd(M-x customize)}}}) -- dashboard ++ dashboard + deadgrep + deft + devdocs @@ -3651,6 +3887,7 @@ have lots of extensions, so the "full support" may not be 100% true… + dired-narrow + dired-subtree + diredfl ++ disk-usage + display-fill-column-indicator-mode + doom-modeline + ediff @@ -3715,6 +3952,8 @@ have lots of extensions, so the "full support" may not be 100% true… + ivy* + ivy-posframe + jira (org-jira) ++ jit-spell ++ jinx + journalctl-mode + js2-mode + julia @@ -3733,7 +3972,6 @@ have lots of extensions, so the "full support" may not be 100% true… + minimap + mode-line + mood-line -+ moody + mpdel + mu4e + multiple-cursors @@ -3780,6 +4018,7 @@ have lots of extensions, so the "full support" may not be 100% true… + rg (rg.el) + ripgrep + rmail ++ rst-mode + ruler-mode + sesman + shell-script-mode @@ -3969,9 +4208,9 @@ length elsewhere in this manual: ;; Doom should not be implementing such hacks because themes ;; cannot support them: ;; . - `(git-gutter-fr:added ((,c :foreground ,bg-added-intense))) - `(git-gutter-fr:deleted ((,c :foreground ,bg-removed-intense))) - `(git-gutter-fr:modified ((,c :foreground ,bg-changed-intense)))))) + `(git-gutter-fr:added ((,c :foreground ,bg-added-fringe))) + `(git-gutter-fr:deleted ((,c :foreground ,bg-removed-fringe))) + `(git-gutter-fr:modified ((,c :foreground ,bg-changed-fringe)))))) (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) #+end_src @@ -4941,9 +5180,10 @@ themes remains consistent. The former criterion should be crystal clear as it pertains to the scientific foundations of the themes: high legibility and taking care -of the needs of users with red-green color deficiency (deuteranopia) -by avoiding red+green color coding paradigms and/or by providing -yellow+blue variants ([[#h:f0f3dbcb-602d-40cf-b918-8f929c441baf][Overview]]). +of the needs of users with red-green/blue-yellow color deficiency +(deuteranopia and tritanopia) by avoiding red+green color coding +paradigms and/or by providing yellow+blue variants for deuteranopia +and red+cyan for tritanopia ([[#h:f0f3dbcb-602d-40cf-b918-8f929c441baf][Overview]]). The latter criterion is the "je ne sais quoi" of the artistic aspect of the themes, which is partially fleshed out in this manual. @@ -5099,13 +5339,14 @@ The Modus themes are a collective effort. Every bit of work matters. + Contributions to code or documentation :: Aleksei Gusev, Alex Griffin, Anders Johansson, Antonio Ruiz, Basil L.{{{space()}}} Contovounesios, Björn Lindström, Carlo Zancanaro, Christian Tietze, - Daniel Mendler, Eli Zaretskii, Fritz Grabo, Illia Ostapyshyn, Kévin - Le Gouguec, Koen van Greevenbroek, Kostadin Ninev, Madhavan - Krishnan, Manuel Giraud, Markus Beppler, Matthew Stevenson, Mauro - Aranda, Nicolas De Jaeghere, Paul David, Philip Kaludercic, Pierre - Téchoueyres, Rudolf Adamkovič, Sergey Nichiporchik, Stephen Gildea, - Shreyas Ragavan, Stefan Kangas, Utkarsh Singh, Vincent Murphy, - Xinglu Chen, Yuanchen Xie, okamsn. + Daniel Mendler, David Edmondson, Eli Zaretskii, Fritz Grabo, Gautier + Ponsinet, Illia Ostapyshyn, Kévin Le Gouguec, Koen van Greevenbroek, + Kostadin Ninev, Madhavan Krishnan, Manuel Giraud, Markus Beppler, + Matthew Stevenson, Mauro Aranda, Nacho Barrientos, Nicolas De + Jaeghere, Paul David, Philip Kaludercic, Pierre Téchoueyres, Rudolf + Adamkovič, Sergey Nichiporchik, Shreyas Ragavan, Stefan Kangas, + Stephen Gildea, Steve Downey, Tomasz Hołubowicz, Utkarsh Singh, + Vincent Murphy, Xinglu Chen, Yuanchen Xie, okamsn. + Ideas and user feedback :: Aaron Jensen, Adam Porter, Adam Spiers, Adrian Manea, Aleksei Pirogov, Alex Griffin, Alex Koen, Alex @@ -5127,19 +5368,20 @@ The Modus themes are a collective effort. Every bit of work matters. Bestley, Mark Burton, Mark Simpson, Marko Kocic, Markus Beppler, Matt Armstrong, Matthias Fuchs, Mattias Engdegård, Mauro Aranda, Maxime Tréca, Michael Goldenberg, Morgan Smith, Morgan Willcock, - Murilo Pereira, Nicky van Foreest, Nicolas De Jaeghere, Pablo - Stafforini, Paul Poloskov, Pengji Zhang, Pete Kazmier, Peter Wu, - Philip Kaludercic, Pierre Téchoueyres, Przemysław Kryger, Robert - Hepple, Roman Rudakov, Russell Sim, Ryan Phillips, Rytis Paškauskas, - Rudolf Adamkovič, Sam Kleinman, Samuel Culpepper, Saša Janiška, - Shreyas Ragavan, Simon Pugnet, Tassilo Horn, Thanos Apollo, Thibaut - Verron, Thomas Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, - Tomasz Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent - Foley, Zoltan Kiraly. As well as users: Ben, CsBigDataHub1, Emacs - Contrib, Eugene, Fourchaux, Fredrik, Moesasji, Nick, Summer Emacs, - TheBlob42, TitusMu, Trey, bepolymathe, bit9tream, bangedorrunt, - derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, okamsn, - pRot0ta1p, soaringbird, tumashu, wakamenod. + Murilo Pereira, Nicky van Foreest, Nicolas De Jaeghere, Nicolas + Semrau, Oliver Epper, Pablo Stafforini, Paul Poloskov, Pengji Zhang, + Pete Kazmier, Peter Wu, Philip Kaludercic, Pierre Téchoueyres, + Przemysław Kryger, Robert Hepple, Roman Rudakov, Russell Sim, Ryan + Phillips, Rytis Paškauskas, Rudolf Adamkovič, Sam Kleinman, Samuel + Culpepper, Saša Janiška, Shreyas Ragavan, Simon Pugnet, Steve + Downey, Tassilo Horn, Thanos Apollo, Thibaut Verron, Thomas + Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, Tomasz + Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley, + Zoltan Kiraly. As well as users: Ben, CsBigDataHub1, Emacs Contrib, + Eugene, Fourchaux, Fredrik, Moesasji, Nick, Summer Emacs, TheBlob42, + TitusMu, Trey, bepolymathe, bit9tream, bangedorrunt, derek-upham, + doolio, fleimgruber, gitrj95, iSeeU, jixiuf, okamsn, pRot0ta1p, + soaringbird, tumashu, wakamenod. + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core diff --git a/etc/NEWS b/etc/NEWS index 07fc2fab774..f5e15175016 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -407,15 +407,16 @@ A major mode based on the tree-sitter library for editing Elixir files. --- -** The highly accessible Modus themes collection has six items. +** The highly accessible Modus themes collection has eight items. The 'modus-operandi' and 'modus-vivendi' are the main themes that have been part of Emacs since version 28. The former is light, the latter dark. In addition to these, we now have 'modus-operandi-tinted' and 'modus-vivendi-tinted' for easier legibility, as well as -'modus-operandi-deuteranopia' and 'modus-vivendi-deuteranopia' to -cover the needs of users with red-green color deficiency. The Info -manual "(modus-themes) Top" describes the details and showcases all -their customization options. +'modus-operandi-deuteranopia', 'modus-vivendi-deuteranopia', +'modus-operandi-tritanopia', and 'modus-vivendi-tritanopia' to cover +the needs of users with red-green or blue-yellow color deficiency. +The Info manual "(modus-themes) Top" describes the details and +showcases all their customization options. * Incompatible Lisp Changes in Emacs 30.1 diff --git a/etc/themes/modus-operandi-deuteranopia-theme.el b/etc/themes/modus-operandi-deuteranopia-theme.el index fff62e3da9f..5817d8f674c 100644 --- a/etc/themes/modus-operandi-deuteranopia-theme.el +++ b/etc/themes/modus-operandi-deuteranopia-theme.el @@ -1,4 +1,4 @@ -;;; modus-operandi-deuteranopia-theme.el --- Elegant, highly legible and customizable light theme -*- lexical-binding:t -*- +;;; modus-operandi-deuteranopia-theme.el --- Deuteranopia-optimized theme with a white background -*- lexical-binding:t -*- ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. @@ -44,7 +44,7 @@ (require 'modus-themes)) (deftheme modus-operandi-deuteranopia - "Elegant, highly legible and customizable light theme. + "Deuteranopia-optimized theme with a white background. This variant is optimized for users with red-green color deficiency (deuteranopia). It conforms with the highest legibility standard for color contrast between background and @@ -77,9 +77,9 @@ (green-cooler "#00663f") (green-faint "#2a5045") (green-intense "#008900") - (yellow "#7b5000") - (yellow-warmer "#884900") - (yellow-cooler "#7a4f2f") + (yellow "#695500") + (yellow-warmer "#973300") + (yellow-cooler "#77492f") (yellow-faint "#624416") (yellow-intense "#808000") (blue "#0031a9") @@ -139,10 +139,10 @@ ;;; Graphs - (bg-graph-red-0 "#b0b029") + (bg-graph-red-0 "#d0b029") (bg-graph-red-1 "#e0cab4") - (bg-graph-green-0 "#90b7c0") - (bg-graph-green-1 "#a3dfe5") + (bg-graph-green-0 "#8ad080") + (bg-graph-green-1 "#afdfa5") (bg-graph-yellow-0 "#ffcf00") (bg-graph-yellow-1 "#f9ff00") (bg-graph-blue-0 "#7f9fff") @@ -223,17 +223,24 @@ (identifier yellow-faint) (err yellow-warmer) - (warning yellow-cooler) + (warning yellow) (info blue) (underline-err yellow-intense) (underline-warning magenta-faint) (underline-note cyan) + (bg-prominent-err bg-yellow-intense) + (fg-prominent-err fg-main) + (bg-prominent-warning bg-magenta-intense) + (fg-prominent-warning fg-main) + (bg-prominent-note bg-cyan-intense) + (fg-prominent-note fg-main) + ;;;; Code mappings (builtin magenta-warmer) - (comment yellow) + (comment yellow-cooler) (constant blue-cooler) (docstring green-faint) (docmarkup magenta-faint) @@ -278,6 +285,7 @@ (date-event fg-alt) (date-holiday yellow-warmer) (date-now blue-faint) + (date-range fg-alt) (date-scheduled yellow-cooler) (date-weekday cyan) (date-weekend yellow-faint) @@ -307,13 +315,22 @@ (mail-cite-0 blue-warmer) (mail-cite-1 yellow) - (mail-cite-2 blue-cooler) + (mail-cite-2 cyan-faint) (mail-cite-3 yellow-faint) (mail-part blue) (mail-recipient blue) - (mail-subject yellow-warmer) + (mail-subject yellow-cooler) (mail-other cyan-faint) +;;;; Mark mappings + + (bg-mark-delete bg-yellow-subtle) + (fg-mark-delete yellow) + (bg-mark-select bg-cyan-subtle) + (fg-mark-select cyan) + (bg-mark-other bg-magenta-subtle) + (fg-mark-other magenta) + ;;;; Prompt mappings (fg-prompt blue) @@ -344,6 +361,12 @@ (rainbow-7 yellow-faint) (rainbow-8 cyan) +;;;; Space mappings + + (bg-space unspecified) + (fg-space border) + (bg-space-err bg-yellow-intense) + ;;;; Heading mappings (fg-heading-0 cyan-cooler) diff --git a/etc/themes/modus-operandi-theme.el b/etc/themes/modus-operandi-theme.el index 0705f926de6..9a69e3290b7 100644 --- a/etc/themes/modus-operandi-theme.el +++ b/etc/themes/modus-operandi-theme.el @@ -1,4 +1,4 @@ -;;; modus-operandi-theme.el --- Elegant, highly legible and customizable light theme -*- lexical-binding:t -*- +;;; modus-operandi-theme.el --- Elegant, highly legible theme with a white background -*- lexical-binding:t -*- ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. @@ -44,7 +44,7 @@ (require 'modus-themes)) (deftheme modus-operandi - "Elegant, highly legible and customizable light theme. + "Elegant, highly legible theme with a white background. Conforms with the highest legibility standard for color contrast between background and foreground in any given piece of text, which corresponds to a minimum contrast in relative luminance of @@ -139,11 +139,11 @@ (bg-graph-red-0 "#ef7969") (bg-graph-red-1 "#ffaab4") - (bg-graph-green-0 "#4faa09") - (bg-graph-green-1 "#8fef00") + (bg-graph-green-0 "#2fe029") + (bg-graph-green-1 "#75ef30") (bg-graph-yellow-0 "#ffcf00") (bg-graph-yellow-1 "#f9ff00") - (bg-graph-blue-0 "#7090ff") + (bg-graph-blue-0 "#7f90ff") (bg-graph-blue-1 "#9fc6ff") (bg-graph-magenta-0 "#e07fff") (bg-graph-magenta-1 "#fad0ff") @@ -228,6 +228,13 @@ (underline-warning yellow-intense) (underline-note cyan-intense) + (bg-prominent-err bg-red-intense) + (fg-prominent-err fg-main) + (bg-prominent-warning bg-yellow-intense) + (fg-prominent-warning fg-main) + (bg-prominent-note bg-cyan-intense) + (fg-prominent-note fg-main) + ;;;; Code mappings (builtin magenta-warmer) @@ -274,8 +281,9 @@ (date-common cyan) (date-deadline red) (date-event fg-alt) - (date-holiday magenta) + (date-holiday red-cooler) (date-now fg-main) + (date-range fg-alt) (date-scheduled yellow-warmer) (date-weekday cyan) (date-weekend red-faint) @@ -312,6 +320,15 @@ (mail-subject magenta-warmer) (mail-other magenta-faint) +;;;; Mark mappings + + (bg-mark-delete bg-red-subtle) + (fg-mark-delete red) + (bg-mark-select bg-cyan-subtle) + (fg-mark-select cyan) + (bg-mark-other bg-yellow-subtle) + (fg-mark-other yellow) + ;;;; Prompt mappings (fg-prompt cyan-cooler) @@ -342,6 +359,12 @@ (rainbow-7 blue-warmer) (rainbow-8 magenta-warmer) +;;;; Space mappings + + (bg-space unspecified) + (fg-space border) + (bg-space-err bg-red-intense) + ;;;; Heading mappings (fg-heading-0 cyan-cooler) diff --git a/etc/themes/modus-operandi-tinted-theme.el b/etc/themes/modus-operandi-tinted-theme.el index 4bb820cf686..341a7d29e84 100644 --- a/etc/themes/modus-operandi-tinted-theme.el +++ b/etc/themes/modus-operandi-tinted-theme.el @@ -1,4 +1,4 @@ -;;; modus-operandi-tinted-theme.el --- Elegant, highly legible and customizable light theme -*- lexical-binding:t -*- +;;; modus-operandi-tinted-theme.el --- Elegant, highly legible theme with a light ochre background -*- lexical-binding:t -*- ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. @@ -43,7 +43,7 @@ (require 'modus-themes)) (deftheme modus-operandi-tinted - "Elegant, highly legible and customizable light theme. + "Elegant, highly legible theme with a light ochre background. Conforms with the highest legibility standard for color contrast between background and foreground in any given piece of text, which corresponds to a minimum contrast in relative luminance of @@ -138,11 +138,11 @@ (bg-graph-red-0 "#ef7969") (bg-graph-red-1 "#ffaab4") - (bg-graph-green-0 "#4faa09") - (bg-graph-green-1 "#8fef00") + (bg-graph-green-0 "#2fe029") + (bg-graph-green-1 "#75ef30") (bg-graph-yellow-0 "#ffcf00") (bg-graph-yellow-1 "#f9ff00") - (bg-graph-blue-0 "#7090ff") + (bg-graph-blue-0 "#7f90ff") (bg-graph-blue-1 "#9fc6ff") (bg-graph-magenta-0 "#e07fff") (bg-graph-magenta-1 "#fad0ff") @@ -227,6 +227,13 @@ (underline-warning yellow-intense) (underline-note cyan-intense) + (bg-prominent-err bg-red-intense) + (fg-prominent-err fg-main) + (bg-prominent-warning bg-yellow-intense) + (fg-prominent-warning fg-main) + (bg-prominent-note bg-cyan-intense) + (fg-prominent-note fg-main) + ;;;; Code mappings (builtin magenta-warmer) @@ -273,8 +280,9 @@ (date-common cyan) (date-deadline red) (date-event fg-alt) - (date-holiday magenta) + (date-holiday red-cooler) (date-now fg-main) + (date-range fg-alt) (date-scheduled yellow-warmer) (date-weekday cyan) (date-weekend red-faint) @@ -311,6 +319,15 @@ (mail-subject magenta-warmer) (mail-other magenta-faint) +;;;; Mark mappings + + (bg-mark-delete bg-red-subtle) + (fg-mark-delete red) + (bg-mark-select bg-cyan-subtle) + (fg-mark-select cyan) + (bg-mark-other bg-yellow-subtle) + (fg-mark-other yellow) + ;;;; Prompt mappings (fg-prompt cyan-cooler) @@ -341,6 +358,12 @@ (rainbow-7 blue-warmer) (rainbow-8 magenta-warmer) +;;;; Space mappings + + (bg-space unspecified) + (fg-space border) + (bg-space-err bg-red-intense) + ;;;; Heading mappings (fg-heading-0 cyan-cooler) diff --git a/etc/themes/modus-operandi-tritanopia-theme.el b/etc/themes/modus-operandi-tritanopia-theme.el new file mode 100644 index 00000000000..5d143fa7514 --- /dev/null +++ b/etc/themes/modus-operandi-tritanopia-theme.el @@ -0,0 +1,442 @@ +;;; modus-operandi-tritanopia-theme.el --- Tritanopia-optimized theme with a white background -*- lexical-binding:t -*- + +;; Copyright (C) 2019-2023 Free Software Foundation, Inc. + +;; Author: Protesilaos Stavrou +;; Maintainer: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht> +;; URL: https://git.sr.ht/~protesilaos/modus-themes +;; Mailing-List: https://lists.sr.ht/~protesilaos/modus-themes +;; Keywords: faces, theme, accessibility + +;; 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 . + +;;; Commentary: +;; +;; The Modus themes conform with the highest standard for +;; color-contrast accessibility between background and foreground +;; values (WCAG AAA). Please refer to the official Info manual for +;; further documentation (distributed with the themes, or available +;; at: ). + +;;; Code: + + + +(eval-and-compile + (unless (and (fboundp 'require-theme) + load-file-name + (equal (file-name-directory load-file-name) + (expand-file-name "themes/" data-directory)) + (require-theme 'modus-themes t)) + (require 'modus-themes)) + + (deftheme modus-operandi-tritanopia + "Tritanopia-optimized theme with a white background. +This variant is optimized for users with blue-yellow color +deficiency (tritanopia). It conforms with the highest +legibility standard for color contrast between background and +foreground in any given piece of text, which corresponds to a +minimum contrast in relative luminance of 7:1 (WCAG AAA +standard).") + + (defconst modus-operandi-tritanopia-palette + '( +;;; Basic values + + (bg-main "#ffffff") + (bg-dim "#f0f0f0") + (fg-main "#000000") + (fg-dim "#595959") + (fg-alt "#193668") + (bg-active "#c4c4c4") + (bg-inactive "#e0e0e0") + (border "#9f9f9f") + +;;; Common accent foregrounds + + (red "#a60000") + (red-warmer "#b21100") + (red-cooler "#a0132f") + (red-faint "#702000") + (red-intense "#d00000") + (green "#006800") + (green-warmer "#316500") + (green-cooler "#00663f") + (green-faint "#2a5045") + (green-intense "#008900") + (yellow "#695500") + (yellow-warmer "#973300") + (yellow-cooler "#77492f") + (yellow-faint "#624416") + (yellow-intense "#808000") + (blue "#0031a9") + (blue-warmer "#3548cf") + (blue-cooler "#0000b0") + (blue-faint "#003497") + (blue-intense "#0000ff") + (magenta "#721045") + (magenta-warmer "#8f0075") + (magenta-cooler "#531ab6") + (magenta-faint "#7c318f") + (magenta-intense "#cd22bd") + (cyan "#005e8b") + (cyan-warmer "#3f578f") + (cyan-cooler "#005f5f") + (cyan-faint "#004f5f") + (cyan-intense "#008899") + +;;; Uncommon accent foregrounds + + (rust "#8a290f") + (gold "#80601f") + (olive "#56692d") + (slate "#2f3f83") + (indigo "#4a3a8a") + (maroon "#731c52") + (pink "#7b435c") + +;;; Common accent backgrounds + + (bg-red-intense "#ff8f88") + (bg-green-intense "#8adf80") + (bg-yellow-intense "#f3d000") + (bg-blue-intense "#bfc9ff") + (bg-magenta-intense "#dfa0f0") + (bg-cyan-intense "#a4d5f9") + + (bg-red-subtle "#ffcfbf") + (bg-green-subtle "#b3fabf") + (bg-yellow-subtle "#fff576") + (bg-blue-subtle "#ccdfff") + (bg-magenta-subtle "#ffddff") + (bg-cyan-subtle "#bfefff") + + (bg-red-nuanced "#fff1f0") + (bg-green-nuanced "#ecf7ed") + (bg-yellow-nuanced "#fff3da") + (bg-blue-nuanced "#f3f3ff") + (bg-magenta-nuanced "#fdf0ff") + (bg-cyan-nuanced "#ebf6fa") + +;;; Uncommon accent backgrounds + + (bg-ochre "#f0e0cc") + (bg-lavender "#dfdbfa") + (bg-sage "#c0e7d4") + +;;; Graphs + + (bg-graph-red-0 "#ef7969") + (bg-graph-red-1 "#ffaab4") + (bg-graph-green-0 "#70c3b0") + (bg-graph-green-1 "#a3dfe5") + (bg-graph-yellow-0 "#d99f9f") + (bg-graph-yellow-1 "#ffb58f") + (bg-graph-blue-0 "#80a0df") + (bg-graph-blue-1 "#9fcaff") + (bg-graph-magenta-0 "#efafcf") + (bg-graph-magenta-1 "#ffdaef") + (bg-graph-cyan-0 "#7fd3ed") + (bg-graph-cyan-1 "#afefff") + +;;; Special purpose + + (bg-completion "#afdfef") + (bg-hover "#ffafbc") + (bg-hover-secondary "#9fdfff") + (bg-hl-line "#dfeaec") + (bg-region "#bdbdbd") + (fg-region "#000000") + + (bg-char-0 "#ff8a5f") + (bg-char-1 "#bf7aff") + (bg-char-2 "#7fe0e0") + + (bg-mode-line-active "#afe0f2") + (fg-mode-line-active "#0f0f0f") + (border-mode-line-active "#2f4f44") + (bg-mode-line-inactive "#e6e6e6") + (fg-mode-line-inactive "#585858") + (border-mode-line-inactive "#a3a3a3") + + (modeline-err "#8f0000") + (modeline-warning "#6f306f") + (modeline-info "#00445f") + + (bg-tab-bar "#dfdfdf") + (bg-tab-current "#ffffff") + (bg-tab-other "#c2c2c2") + +;;; Diffs + + (bg-added "#b5e7ff") + (bg-added-faint "#c6f6ff") + (bg-added-refine "#9adcef") + (bg-added-fringe "#1782cc") + (fg-added "#005079") + (fg-added-intense "#0043aa") + + (bg-changed "#eecfdf") + (bg-changed-faint "#f0dde5") + (bg-changed-refine "#e0b0d0") + (bg-changed-fringe "#9f6ab0") + (fg-changed "#6f1343") + (fg-changed-intense "#7f0f9f") + + (bg-removed "#ffd8d5") + (bg-removed-faint "#ffe9e9") + (bg-removed-refine "#f3b5af") + (bg-removed-fringe "#d84a4f") + (fg-removed "#8f1313") + (fg-removed-intense "#aa2222") + + (bg-diff-context "#f3f3f3") + +;;; Paren match + + (bg-paren-match "#5fcfff") + (bg-paren-expression "#efd3f5") + (underline-paren-match unspecified) + +;;; Mappings + +;;;; General mappings + + (fringe bg-dim) + (cursor red-intense) + + (keybind red) + (name red-cooler) + (identifier red-faint) + + (err red-warmer) + (warning magenta) + (info cyan) + + (underline-err red-intense) + (underline-warning magenta-intense) + (underline-note cyan-intense) + + (bg-prominent-err bg-red-intense) + (fg-prominent-err fg-main) + (bg-prominent-warning bg-magenta-intense) + (fg-prominent-warning fg-main) + (bg-prominent-note bg-cyan-intense) + (fg-prominent-note fg-main) + +;;;; Code mappings + + (builtin magenta) + (comment red-faint) + (constant green-cooler) + (docstring fg-alt) + (docmarkup magenta-faint) + (fnname cyan-warmer) + (keyword red-cooler) + (preprocessor red-warmer) + (string cyan) + (type blue-warmer) + (variable cyan-cooler) + (rx-construct red) + (rx-backslash magenta) + +;;;; Accent mappings + + (accent-0 cyan) + (accent-1 red-warmer) + (accent-2 cyan-cooler) + (accent-3 magenta) + +;;;; Button mappings + + (fg-button-active fg-main) + (fg-button-inactive fg-dim) + (bg-button-active bg-active) + (bg-button-inactive bg-dim) + +;;;; Completion mappings + + (fg-completion-match-0 cyan) + (fg-completion-match-1 red-warmer) + (fg-completion-match-2 magenta) + (fg-completion-match-3 cyan-cooler) + (bg-completion-match-0 unspecified) + (bg-completion-match-1 unspecified) + (bg-completion-match-2 unspecified) + (bg-completion-match-3 unspecified) + +;;;; Date mappings + + (date-common cyan-cooler) + (date-deadline red) + (date-event fg-alt) + (date-holiday red) + (date-now fg-main) + (date-range fg-alt) + (date-scheduled magenta) + (date-weekday cyan) + (date-weekend red-faint) + +;;;; Line number mappings + + (fg-line-number-inactive fg-dim) + (fg-line-number-active fg-main) + (bg-line-number-inactive bg-dim) + (bg-line-number-active bg-active) + +;;;; Link mappings + + (fg-link cyan) + (bg-link unspecified) + (underline-link cyan) + + (fg-link-symbolic cyan-cooler) + (bg-link-symbolic unspecified) + (underline-link-symbolic cyan-cooler) + + (fg-link-visited magenta) + (bg-link-visited unspecified) + (underline-link-visited magenta) + +;;;; Mail mappings + + (mail-cite-0 cyan-faint) + (mail-cite-1 red-faint) + (mail-cite-2 magenta-warmer) + (mail-cite-3 cyan-warmer) + (mail-part cyan-cooler) + (mail-recipient cyan) + (mail-subject red-cooler) + (mail-other cyan) + +;;;; Mark mappings + + (bg-mark-delete bg-red-subtle) + (fg-mark-delete red) + (bg-mark-select bg-cyan-subtle) + (fg-mark-select cyan) + (bg-mark-other bg-magenta-subtle) + (fg-mark-other magenta) + +;;;; Prompt mappings + + (fg-prompt cyan-cooler) + (bg-prompt unspecified) + +;;;; Prose mappings + + (prose-block fg-dim) + (prose-code cyan) + (prose-done cyan) + (prose-macro red-warmer) + (prose-metadata fg-dim) + (prose-metadata-value fg-alt) + (prose-table fg-alt) + (prose-tag fg-alt) + (prose-todo red) + (prose-verbatim magenta-warmer) + +;;;; Rainbow mappings + + (rainbow-0 cyan) + (rainbow-1 red) + (rainbow-2 cyan-warmer) + (rainbow-3 red-cooler) + (rainbow-4 cyan-cooler) + (rainbow-5 magenta) + (rainbow-6 cyan-faint) + (rainbow-7 magenta-faint) + (rainbow-8 red-faint) + +;;;; Space mappings + + (bg-space unspecified) + (fg-space border) + (bg-space-err bg-red-intense) + +;;;; Heading mappings + + (fg-heading-0 cyan-cooler) + (fg-heading-1 fg-main) + (fg-heading-2 red-faint) + (fg-heading-3 cyan-faint) + (fg-heading-4 magenta) + (fg-heading-5 green-faint) + (fg-heading-6 magenta-faint) + (fg-heading-7 cyan-warmer) + (fg-heading-8 fg-dim) + + (bg-heading-0 unspecified) + (bg-heading-1 unspecified) + (bg-heading-2 unspecified) + (bg-heading-3 unspecified) + (bg-heading-4 unspecified) + (bg-heading-5 unspecified) + (bg-heading-6 unspecified) + (bg-heading-7 unspecified) + (bg-heading-8 unspecified) + + (overline-heading-0 unspecified) + (overline-heading-1 unspecified) + (overline-heading-2 unspecified) + (overline-heading-3 unspecified) + (overline-heading-4 unspecified) + (overline-heading-5 unspecified) + (overline-heading-6 unspecified) + (overline-heading-7 unspecified) + (overline-heading-8 unspecified)) + "The entire palette of the `modus-operandi-tritanopia' theme. + +Named colors have the form (COLOR-NAME HEX-VALUE) with the former +as a symbol and the latter as a string. + +Semantic color mappings have the form (MAPPING-NAME COLOR-NAME) +with both as symbols. The latter is a named color that already +exists in the palette and is associated with a HEX-VALUE.") + + (defcustom modus-operandi-tritanopia-palette-overrides nil + "Overrides for `modus-operandi-tritanopia-palette'. + +Mirror the elements of the aforementioned palette, overriding +their value. + +For overrides that are shared across all of the Modus themes, +refer to `modus-themes-common-palette-overrides'. + +Theme-specific overrides take precedence over shared overrides. +The idea of common overrides is to change semantic color +mappings, such as to make the cursor red. Wherea theme-specific +overrides can also be used to change the value of a named color, +such as what hexadecimal RGB value the red-warmer symbol +represents." + :group 'modus-themes + :package-version '(modus-themes . "4.0.0") + :version "30.1" + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Palette overrides")) + + (modus-themes-theme modus-operandi-tritanopia + modus-operandi-tritanopia-palette + modus-operandi-tritanopia-palette-overrides) + + (provide-theme 'modus-operandi-tritanopia)) + +;;;###theme-autoload +(put 'modus-operandi-tritanopia 'theme-properties '(:background-mode light :kind color-scheme :family modus)) + +;;; modus-operandi-tritanopia-theme.el ends here diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el index 805f25b458f..43c10043bc5 100644 --- a/etc/themes/modus-themes.el +++ b/etc/themes/modus-themes.el @@ -6,7 +6,7 @@ ;; Maintainer: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht> ;; URL: https://git.sr.ht/~protesilaos/modus-themes ;; Mailing-List: https://lists.sr.ht/~protesilaos/modus-themes -;; Version: 4.1.0 +;; Version: 4.2.0 ;; Package-Requires: ((emacs "27.1")) ;; Keywords: faces, theme, accessibility @@ -45,14 +45,15 @@ modus-themes "User options for the Modus themes. The Modus themes conform with the WCAG AAA standard for color contrast between background and foreground combinations (a -minimum contrast of 7:1---the highest standard of its kind). The -themes also strive to empower users with red-green color -deficiency: this is achieved through customization variables that -replace all relevant instances of green with blue, as well as the -overall design of the themes which relies mostly on colors that -cover the blue-cyan-magenta side of the spectrum." +minimum contrast of 7:1---the highest standard of its kind). + +The Modus themes collection includes themes that are optimized +for people with red-green or blue-yellow color +deficiency (deuteranopia or tritanopia, respectively)." :group 'faces :link '(info-link "(modus-themes) Top") + :link '(url-link :tag "Homepage" "https://protesilaos.com/emacs/modus-themes") + :link '(url-link :tag "Sample pictures" "https://protesilaos.com/emacs/modus-themes-pictures") :prefix "modus-themes-" :tag "Modus Themes") @@ -60,6 +61,8 @@ modus-themes-faces "Faces defined by the Modus themes." :group 'modus-themes :link '(info-link "(modus-themes) Top") + :link '(url-link :tag "Homepage" "https://protesilaos.com/emacs/modus-themes") + :link '(url-link :tag "Sample pictures" "https://protesilaos.com/emacs/modus-themes-pictures") :prefix "modus-themes-" :tag "Modus Themes Faces") @@ -128,6 +131,14 @@ modus-themes-faces :version "30.1" :group 'modus-themes-faces)) +(dolist (scope '(note warning error)) + (custom-declare-face + (intern (format "modus-themes-prominent-%s" scope)) + nil (format "Prominent notification of type %s." scope) + :package-version '(modus-themes . "4.2.0") + :version "30.1" + :group 'modus-themes-faces)) + (dolist (scope '(current lazy)) (custom-declare-face (intern (format "modus-themes-search-%s" scope)) @@ -360,10 +371,14 @@ modus-themes-disable-other-themes :type 'boolean :link '(info-link "(modus-themes) Disable other themes")) +(defvaralias 'modus-themes-collection 'modus-themes-items + "Alias of `modus-themes-items'.") + (defconst modus-themes-items '( modus-operandi modus-vivendi modus-operandi-tinted modus-vivendi-tinted - modus-operandi-deuteranopia modus-vivendi-deuteranopia) + modus-operandi-deuteranopia modus-vivendi-deuteranopia + modus-operandi-tritanopia modus-vivendi-tritanopia) "Symbols of the Modus themes.") (defcustom modus-themes-to-toggle '(modus-operandi modus-vivendi) @@ -928,12 +943,17 @@ modus-themes-preset-overrides-faint removed from some contexts, and almost all accent colors are desaturated. +All the preset overrides the themes provide (including this one): + +- `modus-themes-preset-overrides-faint' +- `modus-themes-preset-overrides-intense' +- `modus-themes-preset-overrides-cooler' +- `modus-themes-preset-overrides-warmer' + To set a preset, assign its symbol without a quote as the value of the `modus-themes-common-palette-overrides' or as the value of theme-specific options such as `modus-operandi-palette-overrides'. -Also see `modus-themes-preset-overrides-intense'. - For overriding named colors and/or semantic color mappings read Info node `(modus-themes) Option for palette overrides'.") @@ -957,6 +977,7 @@ modus-themes-preset-overrides-intense (date-event blue) (date-holiday magenta-warmer) (date-now blue-faint) + (date-range blue) (date-scheduled yellow-warmer) (date-weekday fg-main) (date-weekend red-faint) @@ -1016,11 +1037,124 @@ modus-themes-preset-overrides-intense colorful/intense. Many background colors are accented and coloration is increased to pop out more. +All the preset overrides the themes provide (including this one): + +- `modus-themes-preset-overrides-faint' +- `modus-themes-preset-overrides-intense' +- `modus-themes-preset-overrides-cooler' +- `modus-themes-preset-overrides-warmer' + To set a preset, assign its symbol without a quote as the value of the `modus-themes-common-palette-overrides' or as the value of theme-specific options such as `modus-operandi-palette-overrides'. -Also see `modus-themes-preset-overrides-faint'. +For overriding named colors and/or semantic color mappings read +Info node `(modus-themes) Option for palette overrides'.") + +(defvar modus-themes-preset-overrides-cooler + '((fg-prompt blue-cooler) + + (builtin magenta-faint) + (constant blue-cooler) + (fnname cyan-cooler) + (keyword magenta-cooler) + (preprocessor blue) + (string blue-warmer) + (type green-cooler) + (variable cyan) + (rx-construct blue-cooler) + (rx-backslash red) + + (name blue-warmer) + (identifier magenta-faint) + + (date-deadline magenta-cooler) + (date-scheduled yellow-cooler) + (date-weekday blue-faint) + (date-weekend red-faint) + + (mail-cite-0 blue-faint) + (mail-cite-1 cyan-cooler) + (mail-cite-2 magenta-faint) + (mail-cite-3 yellow-cooler) + (mail-part cyan) + (mail-recipient blue-warmer) + (mail-subject magenta-cooler) + (mail-other blue) + + (prose-tag fg-dim) + (prose-verbatim blue-cooler)) + "Preset of palette overrides with cooler colors. + +This changes parts of the palette to use more blue and +blue-tinted colors. + +All the preset overrides the themes provide (including this one): + +- `modus-themes-preset-overrides-faint' +- `modus-themes-preset-overrides-intense' +- `modus-themes-preset-overrides-cooler' +- `modus-themes-preset-overrides-warmer' + +To set a preset, assign its symbol without a quote as the value +of the `modus-themes-common-palette-overrides' or as the value of +theme-specific options such as `modus-operandi-palette-overrides'. + +For overriding named colors and/or semantic color mappings read +Info node `(modus-themes) Option for palette overrides'.") + +(defvar modus-themes-preset-overrides-warmer + '((fg-prompt magenta-warmer) + + (builtin magenta) + (constant blue-warmer) + (fnname magenta-cooler) + (keyword magenta-warmer) + (preprocessor red-cooler) + (string olive) + (type cyan-cooler) + (variable cyan) + (rx-construct blue-cooler) + (rx-backslash red-warmer) + + (name blue-warmer) + (identifier magenta) + (keybind magenta-warmer) + + (accent-0 magenta-warmer) + (accent-1 cyan) + (accent-2 blue-warmer) + (accent-3 red-cooler) + + (date-common cyan-cooler) + (date-holiday magenta-warmer) + + (mail-cite-0 magenta-faint) + (mail-cite-1 cyan-cooler) + (mail-cite-2 green-warmer) + (mail-cite-3 red-faint) + (mail-part cyan) + (mail-recipient magenta) + (mail-subject blue-warmer) + (mail-other magenta-warmer) + + (prose-macro red-cooler) + (prose-tag fg-dim)) + "Preset of palette overrides with warmer colors. + +This changes many parts of the theme to use warmer colors, +including green and yellow. + +All the preset overrides the themes provide (including this one): + +- `modus-themes-preset-overrides-faint' +- `modus-themes-preset-overrides-intense' +- `modus-themes-preset-overrides-cooler' +- `modus-themes-preset-overrides-warmer' + +To set a preset, assign its symbol without a quote as the value +of the `modus-themes-common-palette-overrides' or as the value of +theme-specific options such as `modus-operandi-palette-overrides'. For overriding named colors and/or semantic color mappings read Info node `(modus-themes) Option for palette overrides'.") @@ -1123,10 +1257,13 @@ modus-themes-load-theme `modus-themes-disable-other-themes'. Run the `modus-themes-after-load-theme-hook' as the final step -after loading the THEME." +after loading the THEME. + +Return THEME." (modus-themes--disable-themes) (load-theme theme :no-confirm) - (run-hooks 'modus-themes-after-load-theme-hook)) + (run-hooks 'modus-themes-after-load-theme-hook) + theme) (defun modus-themes--retrieve-palette-value (color palette) "Return COLOR from PALETTE. @@ -1183,14 +1320,19 @@ modus-themes-get-color-value (defvar modus-themes--select-theme-history nil "Minibuffer history of `modus-themes--select-prompt'.") +(defun modus-themes--annotate-theme (theme) + "Return completion annotation for THEME." + (format " -- %s" (car (split-string (get (intern theme) 'theme-documentation) "\\.")))) + (defun modus-themes--select-prompt () "Minibuffer prompt to select a Modus theme." - (intern - (completing-read - "Select Modus theme: " - (modus-themes--list-known-themes) - nil t nil - 'modus-themes--select-theme-history))) + (let ((completion-extra-properties `(:annotation-function ,#'modus-themes--annotate-theme))) + (intern + (completing-read + "Select Modus theme: " + (modus-themes--list-known-themes) + nil t nil + 'modus-themes--select-theme-history)))) ;;;###autoload (defun modus-themes-select (theme) @@ -1278,7 +1420,8 @@ modus-themes--list-colors-prompt-history (defun modus-themes--list-colors-prompt () "Prompt for Modus theme. Helper function for `modus-themes-list-colors'." - (let ((def (format "%s" (modus-themes--current-theme)))) + (let ((def (format "%s" (modus-themes--current-theme))) + (completion-extra-properties `(:annotation-function ,#'modus-themes--annotate-theme))) (completing-read (format "Use palette from theme [%s]: " def) (modus-themes--list-known-themes) nil t nil @@ -1544,9 +1687,9 @@ modus-themes-faces `(modus-themes-intense-cyan ((,c :background ,bg-cyan-intense :foreground ,fg-main))) ;;;;; mark indicators ;; color combinations intended for Dired, Ibuffer, or equivalent - `(modus-themes-mark-alt ((,c :inherit bold :background ,bg-yellow-subtle :foreground ,yellow))) - `(modus-themes-mark-del ((,c :inherit bold :background ,bg-red-subtle :foreground ,red))) - `(modus-themes-mark-sel ((,c :inherit bold :background ,bg-cyan-subtle :foreground ,cyan))) + `(modus-themes-mark-alt ((,c :inherit bold :background ,bg-mark-other :foreground ,fg-mark-other))) + `(modus-themes-mark-del ((,c :inherit bold :background ,bg-mark-delete :foreground ,fg-mark-delete))) + `(modus-themes-mark-sel ((,c :inherit bold :background ,bg-mark-select :foreground ,fg-mark-select))) ;;;;; heading levels ;; styles for regular headings used in Org, Markdown, Info, etc. `(modus-themes-heading-0 ((,c ,@(modus-themes--heading 0 fg-heading-0 bg-heading-0 overline-heading-0)))) @@ -1562,6 +1705,10 @@ modus-themes-faces `(modus-themes-lang-error ((,c :underline (:style wave :color ,underline-err)))) `(modus-themes-lang-note ((,c :underline (:style wave :color ,underline-note)))) `(modus-themes-lang-warning ((,c :underline (:style wave :color ,underline-warning)))) +;;;;; prominent semantic notes + `(modus-themes-prominent-error ((,c :background ,bg-prominent-err :foreground ,fg-prominent-err))) + `(modus-themes-prominent-note ((,c :background ,bg-prominent-note :foreground ,fg-prominent-note))) + `(modus-themes-prominent-warning ((,c :background ,bg-prominent-warning :foreground ,fg-prominent-warning))) ;;;;; markup `(modus-themes-prose-code ((,c :inherit modus-themes-fixed-pitch :foreground ,prose-code))) `(modus-themes-prose-macro ((,c :inherit modus-themes-fixed-pitch :foreground ,prose-macro))) @@ -1581,7 +1728,10 @@ modus-themes-faces `(modus-themes-slant ((,c ,@(modus-themes--slant)))) `(modus-themes-ui-variable-pitch ((,c ,@(modus-themes--variable-pitch-ui)))) ;;;;; other custom faces - `(modus-themes-button ((,c :inherit variable-pitch :box ,border :background ,bg-button-active :foreground ,fg-button-active))) + `(modus-themes-button ((,c :inherit variable-pitch + :box (:line-width 1 :color ,border :style released-button) + :background ,bg-button-active + :foreground ,fg-button-active))) `(modus-themes-key-binding ((,c :inherit (bold modus-themes-fixed-pitch) :foreground ,keybind))) `(modus-themes-prompt ((,c ,@(modus-themes--prompt fg-prompt bg-prompt)))) `(modus-themes-reset-soft ((,c :background ,bg-main :foreground ,fg-main @@ -1592,9 +1742,9 @@ modus-themes-faces `(default ((,c :background ,bg-main :foreground ,fg-main))) `(cursor ((,c :background ,cursor))) `(fringe ((,c :background ,fringe :foreground ,fg-main))) - `(menu ((,c :background ,bg-tab-bar :foreground ,fg-main))) - `(scroll-bar ((,c :background ,fringe :foreground ,fg-dim))) - `(tool-bar ((,c :background ,bg-tab-bar :foreground ,fg-main))) + `(menu ((,c :background ,bg-dim :foreground ,fg-main))) + `(scroll-bar ((,c :background ,bg-dim :foreground ,fg-dim))) + `(tool-bar ((,c :background ,bg-dim :foreground ,fg-main))) `(vertical-border ((,c :foreground ,border))) ;;;;; basic and/or ungrouped styles `(bold ((,c :weight bold))) @@ -1625,8 +1775,8 @@ modus-themes-faces `(minibuffer-prompt ((,c :inherit modus-themes-prompt))) `(mm-command-output ((,c :foreground ,mail-part))) `(mm-uu-extract ((,c :foreground ,mail-part))) - `(next-error ((,c :inherit modus-themes-subtle-red :extend t))) - `(pgtk-im-0 ((,c :inherit modus-themes-intense-cyan))) + `(next-error ((,c :inherit modus-themes-prominent-error :extend t))) + `(pgtk-im-0 ((,c :inherit modus-themes-prominent-note))) `(read-multiple-choice-face ((,c :inherit (bold modus-themes-mark-alt)))) `(rectangle-preview ((,c :inherit secondary-selection))) `(region ((,c :background ,bg-region :foreground ,fg-region))) @@ -1634,7 +1784,7 @@ modus-themes-faces `(separator-line ((,c :underline ,bg-active))) `(shadow ((,c :foreground ,fg-dim))) `(success ((,c :inherit bold :foreground ,info))) - `(trailing-whitespace ((,c :background ,bg-red-intense))) + `(trailing-whitespace ((,c :background ,bg-space-err))) `(warning ((,c :inherit bold :foreground ,warning))) ;;;;; buttons, links, widgets `(button ((,c :background ,bg-link :foreground ,fg-link :underline ,underline-link))) @@ -1738,7 +1888,7 @@ modus-themes-faces `(anzu-match-3 ((,c :inherit modus-themes-subtle-yellow))) `(anzu-mode-line ((,c :inherit bold))) `(anzu-mode-line-no-match ((,c :inherit error))) - `(anzu-replace-highlight ((,c :inherit modus-themes-intense-red :underline t))) + `(anzu-replace-highlight ((,c :inherit modus-themes-prominent-error :underline t))) `(anzu-replace-to ((,c :inherit modus-themes-search-current))) ;;;;; auctex and Tex `(font-latex-bold-face ((,c :inherit bold))) @@ -1775,12 +1925,12 @@ modus-themes-faces `(aw-background-face ((,c :foreground "gray50"))) `(aw-key-face ((,c :inherit modus-themes-key-binding))) `(aw-leading-char-face ((,c :inherit (bold modus-themes-reset-soft) :height 1.5 :foreground ,red-intense))) - `(aw-minibuffer-leading-char-face ((,c :inherit (modus-themes-intense-red bold)))) + `(aw-minibuffer-leading-char-face ((,c :inherit modus-themes-key-binding))) `(aw-mode-line-face ((,c :inherit bold))) ;;;;; binder - `(binder-sidebar-highlight ((,c :inherit modus-themes-subtle-cyan))) + `(binder-sidebar-highlight ((,c :inherit modus-themes-hl-line))) `(binder-sidebar-marked ((,c :inherit modus-themes-mark-sel))) - `(binder-sidebar-missing ((,c :inherit modus-themes-subtle-red))) + `(binder-sidebar-missing ((,c :inherit modus-themes-mark-del))) `(binder-sidebar-tags ((,c :foreground ,variable))) ;;;;; bongo `(bongo-album-title (( ))) @@ -1807,13 +1957,13 @@ modus-themes-faces `(calendar-today ((,c :inherit bold :underline t))) `(calendar-weekday-header ((,c :foreground ,date-weekday))) `(calendar-weekend-header ((,c :foreground ,date-weekend))) - `(diary ((,c :background ,bg-dim :foreground ,accent-0))) - `(diary-anniversary ((,c :foreground ,accent-1))) + `(diary ((,c :foreground ,date-common))) + `(diary-anniversary ((,c :foreground ,date-holiday))) `(diary-time ((,c :foreground ,date-common))) `(holiday ((,c :foreground ,date-holiday))) ;;;;; calibredb ;; NOTE 2022-12-27: Calibredb needs to be reviewed. I had to - ;; change the applicable colours for the transition to + ;; change the applicable colors for the transition to ;; modus-themes version 4, but I cannot test this currently (it ;; depends on an external program). `(calibredb-archive-face ((,c :foreground ,accent-3))) @@ -1890,7 +2040,7 @@ modus-themes-faces ;;;;; clojure-mode `(clojure-keyword-face ((,c :inherit font-lock-builtin-face))) ;;;;; column-enforce-mode - `(column-enforce-face ((,c :inherit modus-themes-intense-yellow))) + `(column-enforce-face ((,c :inherit modus-themes-prominent-error))) ;;;;; company-mode `(company-echo-common ((,c :inherit modus-themes-completion-match-0))) `(company-preview ((,c :background ,bg-dim :foreground ,fg-dim))) @@ -2051,7 +2201,7 @@ modus-themes-faces ;;;;; dired-git-info `(dgi-commit-message-face ((,c :foreground ,docstring))) ;;;;; dired-narrow - `(dired-narrow-blink ((,c :inherit (modus-themes-subtle-cyan bold)))) + `(dired-narrow-blink ((,c :inherit (modus-themes-prominent-warning bold)))) ;;;;; dired-subtree ;; remove backgrounds from dired-subtree faces, else they break ;; dired-{flagged,marked} and any other face that sets a background @@ -2089,6 +2239,12 @@ modus-themes-faces `(diredfl-symlink ((,c :inherit dired-symlink))) `(diredfl-tagged-autofile-name ((,c :inherit (diredfl-autofile-name dired-marked)))) `(diredfl-write-priv ((,c :foreground ,accent-0))) +;;;;; disk-usage + `(disk-usage-inaccessible ((,c :inherit error))) + `(disk-usage-percent ((,c :foreground ,accent-0))) + `(disk-usage-size ((,c :foreground ,accent-1))) + `(disk-usage-symlink ((,c :inherit dired-symlink))) + `(disk-usage-symlink-directory ((,c :inherit dired-symlink))) ;;;;; display-fill-column-indicator-mode `(fill-column-indicator ((,c :height 1 :background ,bg-active :foreground ,bg-active))) ;;;;; doom-modeline @@ -2128,7 +2284,7 @@ modus-themes-faces `(doom-modeline-warning ((,c :inherit warning))) ;;;;; ediff `(ediff-current-diff-A ((,c :background ,bg-removed :foreground ,fg-removed))) - `(ediff-current-diff-Ancestor ((,c :background ,bg-region))) ; TODO 2022-11-29: Needs review + `(ediff-current-diff-Ancestor ((,c :background ,bg-region))) `(ediff-current-diff-B ((,c :background ,bg-added :foreground ,fg-added))) `(ediff-current-diff-C ((,c :background ,bg-changed :foreground ,fg-changed))) `(ediff-even-diff-A ((,c :background ,bg-diff-context))) @@ -2152,6 +2308,7 @@ modus-themes-faces `(ein:notification-tab-normal ((,c :underline t))) ;;;;; eglot `(eglot-mode-line ((,c :inherit modus-themes-bold :foreground ,modeline-info))) + `(eglot-diagnostic-tag-unnecessary-face ((,c :inherit modus-themes-lang-note))) ;;;;; el-search `(el-search-highlight-in-prompt-face ((,c :inherit italic))) `(el-search-match ((,c :inherit modus-themes-search-current))) @@ -2236,7 +2393,7 @@ modus-themes-faces `(erc-button ((,c :inherit button))) `(erc-command-indicator-face ((,c :inherit bold :foreground ,accent-3))) `(erc-current-nick-face ((,c :inherit match))) - `(erc-dangerous-host-face ((,c :inherit modus-themes-intense-red))) + `(erc-dangerous-host-face ((,c :inherit error))) `(erc-direct-msg-face ((,c :inherit shadow))) `(erc-error-face ((,c :inherit error))) `(erc-fool-face ((,c :inherit shadow))) @@ -2254,8 +2411,8 @@ modus-themes-faces `(erc-timestamp-face ((,c :foreground ,date-common))) `(erc-underline-face ((,c :underline t))) ;;;;; ert - `(ert-test-result-expected ((,c :inherit modus-themes-intense-cyan))) - `(ert-test-result-unexpected ((,c :inherit modus-themes-intense-red))) + `(ert-test-result-expected ((,c :inherit modus-themes-prominent-note))) + `(ert-test-result-unexpected ((,c :inherit modus-themes-prominent-error))) ;;;;; eshell `(eshell-ls-archive ((,c :foreground ,accent-2))) `(eshell-ls-backup ((,c :inherit shadow))) @@ -2277,7 +2434,7 @@ modus-themes-faces `(evil-ex-info ((,c :inherit font-lock-type-face))) `(evil-ex-lazy-highlight ((,c :inherit modus-themes-search-lazy))) `(evil-ex-search ((,c :inherit modus-themes-search-current))) - `(evil-ex-substitute-matches ((,c :inherit modus-themes-intense-yellow :underline t))) + `(evil-ex-substitute-matches ((,c :inherit modus-themes-prominent-error :underline t))) `(evil-ex-substitute-replacement ((,c :inherit modus-themes-search-current))) ;;;;; eww `(eww-invalid-certificate ((,c :foreground ,err))) @@ -2292,9 +2449,9 @@ modus-themes-faces `(eyebrowse-mode-line-active ((,c :inherit mode-line-emphasis))) ;;;;; flycheck `(flycheck-error ((,c :inherit modus-themes-lang-error))) - `(flycheck-fringe-error ((,c :inherit modus-themes-intense-red))) - `(flycheck-fringe-info ((,c :inherit modus-themes-intense-cyan))) - `(flycheck-fringe-warning ((,c :inherit modus-themes-intense-yellow))) + `(flycheck-fringe-error ((,c :inherit modus-themes-prominent-error))) + `(flycheck-fringe-info ((,c :inherit modus-themes-prominent-note))) + `(flycheck-fringe-warning ((,c :inherit modus-themes-prominent-warning))) `(flycheck-info ((,c :inherit modus-themes-lang-note))) `(flycheck-warning ((,c :inherit modus-themes-lang-warning))) ;;;;; flycheck-color-mode-line @@ -2310,9 +2467,16 @@ modus-themes-faces `(flycheck-indicator-success ((,c :inherit success))) `(flycheck-indicator-warning ((,c :inherit warning))) ;;;;; flymake + `(flymake-end-of-line-diagnostics-face ((,c :inherit modus-themes-slant :height 0.85 :box ,border))) `(flymake-error ((,c :inherit modus-themes-lang-error))) + `(flymake-error-echo ((,c :inherit error))) + `(flymake-error-echo-at-eol ((,c :inherit flymake-end-of-line-diagnostics-face :foreground ,err))) `(flymake-note ((,c :inherit modus-themes-lang-note))) + `(flymake-note-echo ((,c :inherit success))) + `(flymake-note-echo-at-eol ((,c :inherit flymake-end-of-line-diagnostics-face :foreground ,info))) `(flymake-warning ((,c :inherit modus-themes-lang-warning))) + `(flymake-warning-echo ((,c :inherit warning))) + `(flymake-note-echo-at-eol ((,c :inherit flymake-end-of-line-diagnostics-face :foreground ,warning))) ;;;;; flyspell `(flyspell-duplicate ((,c :inherit modus-themes-lang-warning))) `(flyspell-incorrect ((,c :inherit modus-themes-lang-error))) @@ -2531,16 +2695,16 @@ modus-themes-faces `(ido-subdir ((,c :foreground ,accent-0))) `(ido-virtual ((,c :foreground ,accent-1))) ;;;;; iedit - `(iedit-occurrence ((,c :inherit modus-themes-intense-blue))) - `(iedit-read-only-occurrence ((,c :inherit modus-themes-intense-yellow))) + `(iedit-occurrence ((,c :inherit modus-themes-search-lazy))) + `(iedit-read-only-occurrence ((,c :inherit modus-themes-search-current))) ;;;;; iflipb `(iflipb-current-buffer-face ((,c :inherit bold :foreground ,name))) `(iflipb-other-buffer-face ((,c :inherit shadow))) ;;;;; image-dired - `(image-dired-thumb-flagged ((,c :inherit modus-themes-intense-red))) + `(image-dired-thumb-flagged ((,c :inherit modus-themes-mark-del :box (:line-width -3)))) `(image-dired-thumb-header-file-name ((,c :inherit bold))) `(image-dired-thumb-header-file-size ((,c :foreground ,constant))) - `(image-dired-thumb-mark ((,c :inherit modus-themes-intense-cyan))) + `(image-dired-thumb-mark ((,c :inherit modus-themes-mark-sel :box (:line-width -3)))) ;;;;; imenu-list `(imenu-list-entry-face-0 ((,c :foreground ,fg-heading-0))) `(imenu-list-entry-face-1 ((,c :foreground ,fg-heading-1))) @@ -2564,7 +2728,7 @@ modus-themes-faces `(info-header-xref ((,c :foreground ,fg-link))) `(info-index-match ((,c :inherit match))) `(info-menu-header ((,c :inherit bold))) - `(info-menu-star ((,c :foreground ,red-intense))) + `(info-menu-star ((,c :inherit error))) `(info-node ((,c :inherit bold))) `(info-title-1 ((,c :inherit modus-themes-heading-1))) `(info-title-2 ((,c :inherit modus-themes-heading-2))) @@ -2613,12 +2777,12 @@ modus-themes-faces `(ioccur-title-face ((,c :inherit bold :foreground ,name))) ;;;;; isearch, occur, and the like `(isearch ((,c :inherit modus-themes-search-current))) - `(isearch-fail ((,c :inherit modus-themes-intense-red))) + `(isearch-fail ((,c :inherit modus-themes-prominent-error))) `(isearch-group-1 ((,c :inherit modus-themes-intense-blue))) `(isearch-group-2 ((,c :inherit modus-themes-intense-magenta))) `(lazy-highlight ((,c :inherit modus-themes-search-lazy))) `(match ((,c :background ,bg-magenta-subtle :foreground ,fg-main))) - `(query-replace ((,c :inherit modus-themes-intense-red))) + `(query-replace ((,c :inherit modus-themes-prominent-error))) ;;;;; ivy `(ivy-action ((,c :inherit modus-themes-key-binding))) `(ivy-confirm-face ((,c :inherit success))) @@ -2644,6 +2808,10 @@ modus-themes-faces `(jiralib-link-filter-face ((,c :underline t))) `(jiralib-link-issue-face ((,c :underline t))) `(jiralib-link-project-face ((,c :underline t))) +;;;;; jit-spell + `(jit-spell-misspelling ((,c :inherit modus-themes-lang-error))) +;;;;; jinx + `(jinx-misspelled ((,c :inherit modus-themes-lang-warning))) ;;;;; journalctl-mode `(journalctl-error-face ((,c :inherit error))) `(journalctl-finished-face ((,c :inherit success))) @@ -3044,6 +3212,7 @@ modus-themes-faces `(orderless-match-face-2 ((,c :inherit modus-themes-completion-match-2))) `(orderless-match-face-3 ((,c :inherit modus-themes-completion-match-3))) ;;;;; org + `(org-agenda-calendar-daterange ((,c :foreground ,date-range))) `(org-agenda-calendar-event ((,c :foreground ,date-event))) `(org-agenda-calendar-sexp ((,c :inherit (modus-themes-slant org-agenda-calendar-event)))) `(org-agenda-clocking ((,c :inherit modus-themes-mark-alt))) @@ -3211,6 +3380,24 @@ modus-themes-faces `(persp-face-lighter-nil-persp ((,c :inherit bold))) ;;;;; perspective `(persp-selected-face ((,c :inherit bold :foreground ,name))) +;;;;; proced + `(proced-cpu ((,c :foreground ,keyword))) + `(proced-emacs-pid ((,c :foreground ,identifier :underline t))) + `(proced-executable ((,c :foreground ,name))) + `(proced-interruptible-sleep-status-code ((,c :inherit shadow))) + `(proced-mem ((,c :foreground ,type))) + `(proced-memory-high-usage ((,c :foreground ,err))) + `(proced-memory-low-usage ((,c :foreground ,info))) + `(proced-memory-medium-usage ((,c :foreground ,warning))) + `(proced-pgrp ((,c :inherit proced-pid))) + `(proced-pid ((,c :foreground ,identifier))) + `(proced-ppid ((,c :inherit proced-pid))) + `(proced-run-status-code ((,c :inherit success))) + `(proced-sess ((,c :inherit proced-pid))) + `(proced-session-leader-pid ((,c :inherit bold :foreground ,identifier))) + `(proced-time-colon (( ))) + `(proced-uninterruptible-sleep-status-code ((,c :inherit error))) + `(proced-user (( ))) ;;;;; popup `(popup-face ((,c :background ,bg-inactive :foreground ,fg-main))) `(popup-isearch-match ((,c :inherit modus-themes-search-current))) @@ -3229,13 +3416,13 @@ modus-themes-faces `(powerline-inactive2 ((,c :inherit mode-line-inactive))) ;;;;; powerline-evil `(powerline-evil-base-face ((,c :background ,fg-main :foreground ,bg-main))) - `(powerline-evil-emacs-face ((,c :inherit modus-themes-intense-magenta))) - `(powerline-evil-insert-face ((,c :inherit modus-themes-intense-green))) - `(powerline-evil-motion-face ((,c :inherit modus-themes-intense-blue))) - `(powerline-evil-normal-face ((,c :background ,fg-alt :foreground ,bg-main))) - `(powerline-evil-operator-face ((,c :inherit modus-themes-intense-yellow))) - `(powerline-evil-replace-face ((,c :inherit modus-themes-intense-red))) - `(powerline-evil-visual-face ((,c :inherit modus-themes-intense-cyan))) + `(powerline-evil-emacs-face ((,c :inherit bold :background ,bg-main))) + `(powerline-evil-insert-face ((,c :inherit success :background ,bg-main))) + `(powerline-evil-motion-face ((,c :inherit italic :background ,bg-main))) + `(powerline-evil-normal-face ((,c :background ,bg-main :foreground ,fg-alt))) + `(powerline-evil-operator-face ((,c :inherit warning :background ,bg-main))) + `(powerline-evil-replace-face ((,c :inherit error :background ,bg-main))) + `(powerline-evil-visual-face ((,c :inherit bold :background ,bg-main))) ;;;;; prescient `(prescient-primary-highlight ((,c :inherit modus-themes-completion-match-0))) `(prescient-secondary-highlight ((,c :inherit modus-themes-completion-match-1))) @@ -3258,7 +3445,7 @@ modus-themes-faces `(quick-peek-border-face ((,c :background ,border :height 1))) `(quick-peek-padding-face ((,c :background ,bg-inactive :height 0.15))) ;;;;; rainbow-delimiters - `(rainbow-delimiters-base-error-face ((,c :inherit modus-themes-subtle-red))) + `(rainbow-delimiters-base-error-face ((,c :inherit modus-themes-prominent-error))) `(rainbow-delimiters-base-face ((,c :foreground ,fg-main))) `(rainbow-delimiters-depth-1-face ((,c :foreground ,rainbow-0))) `(rainbow-delimiters-depth-2-face ((,c :foreground ,rainbow-1))) @@ -3269,8 +3456,8 @@ modus-themes-faces `(rainbow-delimiters-depth-7-face ((,c :foreground ,rainbow-6))) `(rainbow-delimiters-depth-8-face ((,c :foreground ,rainbow-7))) `(rainbow-delimiters-depth-9-face ((,c :foreground ,rainbow-8))) - `(rainbow-delimiters-mismatched-face ((,c :inherit (bold modus-themes-intense-yellow)))) - `(rainbow-delimiters-unmatched-face ((,c :inherit (bold modus-themes-intense-red)))) + `(rainbow-delimiters-mismatched-face ((,c :inherit (bold modus-themes-prominent-warning)))) + `(rainbow-delimiters-unmatched-face ((,c :inherit (bold modus-themes-prominent-error)))) ;;;;; rcirc `(rcirc-bright-nick ((,c :inherit bold :foreground ,accent-2))) `(rcirc-dim-nick ((,c :inherit shadow))) @@ -3316,6 +3503,13 @@ modus-themes-faces ;;;;; rmail `(rmail-header-name ((,c :inherit bold))) `(rmail-highlight ((,c :inherit bold :foreground ,mail-other))) +;;;;; rst-mode + `(rst-level-1 ((,c :inherit modus-themes-heading-1))) + `(rst-level-2 ((,c :inherit modus-themes-heading-2))) + `(rst-level-3 ((,c :inherit modus-themes-heading-3))) + `(rst-level-4 ((,c :inherit modus-themes-heading-4))) + `(rst-level-5 ((,c :inherit modus-themes-heading-5))) + `(rst-level-6 ((,c :inherit modus-themes-heading-6))) ;;;;; ruler-mode `(ruler-mode-column-number ((,c :inherit ruler-mode-default))) `(ruler-mode-comment-column ((,c :inherit ruler-mode-default :foreground ,red))) @@ -3342,7 +3536,7 @@ modus-themes-faces ;;;;; show-paren-mode `(show-paren-match ((,c :background ,bg-paren-match :foreground ,fg-main :underline ,underline-paren-match))) `(show-paren-match-expression ((,c :background ,bg-paren-expression))) - `(show-paren-mismatch ((,c :inherit modus-themes-intense-red))) + `(show-paren-mismatch ((,c :inherit modus-themes-prominent-error))) ;;;;; shr `(shr-abbreviation ((,c :inherit modus-themes-lang-note))) `(shr-code ((,c :inherit modus-themes-prose-verbatim))) @@ -3352,7 +3546,7 @@ modus-themes-faces `(shr-h4 ((,c :inherit modus-themes-heading-4))) `(shr-h5 ((,c :inherit modus-themes-heading-5))) `(shr-h6 ((,c :inherit modus-themes-heading-6))) - `(shr-selected-link ((,c :inherit modus-themes-subtle-red))) + `(shr-selected-link ((,c :inherit modus-themes-mark-sel))) ;;;;; side-notes `(side-notes ((,c :background ,bg-dim :foreground ,fg-dim))) ;;;;; sieve-mode @@ -3404,7 +3598,7 @@ modus-themes-faces `(sml/name-filling ((,c :inherit warning))) `(sml/not-modified ((,c :inherit sml/global))) `(sml/numbers-separator ((,c :inherit sml/global))) - `(sml/outside-modified ((,c :inherit modus-themes-intense-red))) + `(sml/outside-modified ((,c :inherit modus-themes-prominent-error))) `(sml/position-percentage ((,c :inherit sml/global))) `(sml/prefix ((,c :foreground ,fg-alt))) `(sml/process ((,c :inherit sml/prefix))) @@ -3418,7 +3612,7 @@ modus-themes-faces ;;;;; smerge `(smerge-base ((,c :inherit diff-changed))) `(smerge-lower ((,c :inherit diff-added))) - `(smerge-markers ((,c :inherit diff-heading))) + `(smerge-markers ((,c :inherit diff-header))) `(smerge-refined-added ((,c :inherit diff-refine-added))) `(smerge-refined-changed (())) `(smerge-refined-removed ((,c :inherit diff-refine-removed))) @@ -3533,7 +3727,7 @@ modus-themes-faces ;; have to do this with `eldoc-highlight-function-argument'. (list 'transient-argument `((,c :inherit (bold modus-themes-mark-alt)))) `(transient-blue ((,c :inherit bold :foreground ,blue))) - `(transient-disabled-suffix ((,c :inherit modus-themes-intense-red))) + `(transient-disabled-suffix ((,c :inherit modus-themes-mark-del))) `(transient-enabled-suffix ((,c :inherit modus-themes-subtle-cyan))) `(transient-heading ((,c :inherit bold :foreground ,fg-main))) `(transient-inactive-argument ((,c :inherit shadow))) @@ -3653,19 +3847,22 @@ modus-themes-faces `(vr/match-1 ((,c :inherit modus-themes-intense-yellow))) `(vr/match-separator-face ((,c :inherit bold :background ,bg-active))) ;;;;; vterm - `(vterm-color-black ((,c :background "gray35" :foreground "gray35"))) - `(vterm-color-blue ((,c :background ,blue :foreground ,blue))) - `(vterm-color-cyan ((,c :background ,cyan :foreground ,cyan))) + `(vterm-color-black ((,c :background "gray35" :foreground "black"))) + `(vterm-color-blue ((,c :background ,blue-warmer :foreground ,blue))) + `(vterm-color-cyan ((,c :background ,cyan-cooler :foreground ,cyan))) `(vterm-color-default ((,c :background ,bg-main :foreground ,fg-main))) - `(vterm-color-green ((,c :background ,green :foreground ,green))) + `(vterm-color-green ((,c :background ,green-cooler :foreground ,green))) `(vterm-color-inverse-video ((,c :background ,bg-main :inverse-video t))) - `(vterm-color-magenta ((,c :background ,magenta :foreground ,magenta))) - `(vterm-color-red ((,c :background ,red :foreground ,red))) + `(vterm-color-magenta ((,c :background ,magenta-cooler :foreground ,magenta))) + `(vterm-color-red ((,c :background ,red-warmer :foreground ,red))) `(vterm-color-underline ((,c :underline t))) - `(vterm-color-white ((,c :background "gray65" :foreground "gray65"))) - `(vterm-color-yellow ((,c :background ,yellow :foreground ,yellow))) + `(vterm-color-white ((,c :background "white" :foreground "gray65"))) + `(vterm-color-yellow ((,c :background ,yellow-warmer :foreground ,yellow))) ;;;;; vundo - `(vundo-highlight ((,c :inherit (bold vundo-node) :foreground ,red-intense))) + `(vundo-default ((,c :inherit shadow))) + `(vundo-highlight ((,c :inherit (bold vundo-node) :foreground ,red))) + `(vundo-last-saved ((,c :inherit (bold vundo-node) :foreground ,blue))) + `(vundo-saved ((,c :inherit vundo-node :foreground ,blue-intense))) ;;;;; wcheck-mode `(wcheck-default-face ((,c :foreground ,red :underline t))) ;;;;; web-mode @@ -3697,7 +3894,7 @@ modus-themes-faces `(web-mode-current-column-highlight-face ((,c :background ,bg-inactive))) `(web-mode-current-element-highlight-face ((,c :inherit modus-themes-cyan-subtle))) `(web-mode-doctype-face ((,c :inherit font-lock-doc-face))) - `(web-mode-error-face ((,c :inherit modus-themes-intense-red))) + `(web-mode-error-face ((,c :inherit error))) `(web-mode-filter-face ((,c :inherit font-lock-function-name-face))) `(web-mode-folded-face ((,c :underline t))) `(web-mode-function-call-face ((,c :inherit font-lock-function-name-face))) @@ -3735,7 +3932,7 @@ modus-themes-faces `(web-mode-type-face ((,c :inherit font-lock-builtin-face))) `(web-mode-underline-face ((,c :underline t))) `(web-mode-variable-name-face ((,c :inherit font-lock-variable-name-face))) - `(web-mode-warning-face ((,c :inherit font-lock-warning-face))) + `(web-mode-warning-face ((,c :inherit warning))) `(web-mode-whitespace-face ((,c :background ,bg-inactive))) ;;;;; wgrep `(wgrep-delete-face ((,c :inherit warning))) @@ -3747,7 +3944,7 @@ modus-themes-faces `(which-func ((,c :inherit bold :foreground ,modeline-info))) ;;;;; which-key `(which-key-command-description-face ((,c :foreground ,fg-main))) - `(which-key-group-description-face ((,c :foreground ,err))) + `(which-key-group-description-face ((,c :foreground ,keyword))) `(which-key-highlighted-command-face ((,c :foreground ,warning :underline t))) `(which-key-key-face ((,c :inherit modus-themes-key-binding))) `(which-key-local-map-description-face ((,c :foreground ,fg-main))) @@ -3755,24 +3952,24 @@ modus-themes-faces `(which-key-separator-face ((,c :inherit shadow))) `(which-key-special-key-face ((,c :inherit error))) ;;;;; whitespace-mode - `(whitespace-big-indent ((,c :inherit modus-themes-subtle-red))) + `(whitespace-big-indent ((,c :background ,bg-space-err))) `(whitespace-empty ((,c :inherit modus-themes-intense-magenta))) - `(whitespace-hspace ((,c :background ,bg-dim :foreground ,fg-dim))) - `(whitespace-indentation ((,c :background ,bg-dim :foreground ,fg-dim))) - `(whitespace-line ((,c :inherit modus-themes-subtle-yellow))) - `(whitespace-newline ((,c :background ,bg-dim :foreground ,fg-dim))) - `(whitespace-space ((,c :background ,bg-dim :foreground ,fg-dim))) + `(whitespace-hspace ((,c :background ,bg-space :foreground ,fg-space))) + `(whitespace-indentation ((,c :background ,bg-space :foreground ,fg-space))) + `(whitespace-line ((,c :background ,bg-space :foreground ,warning))) + `(whitespace-newline ((,c :background ,bg-space :foreground ,fg-space))) + `(whitespace-space ((,c :background ,bg-space :foreground ,fg-space))) `(whitespace-space-after-tab ((,c :inherit modus-themes-subtle-magenta))) `(whitespace-space-before-tab ((,c :inherit modus-themes-subtle-cyan))) - `(whitespace-tab ((,c :background ,bg-dim :foreground ,fg-dim))) - `(whitespace-trailing ((,c :inherit modus-themes-intense-red))) + `(whitespace-tab ((,c :background ,bg-space :foreground ,fg-space))) + `(whitespace-trailing ((,c :background ,bg-space-err))) ;;;;; window-divider-mode `(window-divider ((,c :foreground ,border))) `(window-divider-first-pixel ((,c :foreground ,bg-inactive))) `(window-divider-last-pixel ((,c :foreground ,bg-inactive))) ;;;;; widget `(widget-button ((,c :inherit bold :foreground ,fg-link))) - `(widget-button-pressed ((,c :inherit widget-buton :foreground ,fg-link-visited))) + `(widget-button-pressed ((,c :inherit widget-button :foreground ,fg-link-visited))) `(widget-documentation ((,c :inherit font-lock-doc-face))) `(widget-field ((,c :background ,bg-inactive :foreground ,fg-main :extend nil))) `(widget-inactive ((,c :background ,bg-button-inactive :foreground ,fg-button-inactive))) @@ -3792,7 +3989,7 @@ modus-themes-faces `(xah-elisp-command-face ((,c :inherit font-lock-type-face))) `(xah-elisp-dollar-symbol ((,c :inherit font-lock-variable-name-face))) ;;;;; yaml-mode - `(yaml-tab-face ((,c :inherit modus-themes-intense-red))) + `(yaml-tab-face ((,c :background ,bg-space-err))) ;;;;; yasnippet `(yas-field-highlight-face ((,c :inherit highlight)))) "Face specs for use with `modus-themes-theme'.") @@ -3809,9 +4006,9 @@ modus-themes-custom-variables ;;;; exwm `(exwm-floating-border-color ,border) ;;;; flymake fringe indicators - `(flymake-error-bitmap '(flymake-double-exclamation-mark modus-themes-intense-red)) - `(flymake-warning-bitmap '(exclamation-mark modus-themes-intense-yellow)) - `(flymake-note-bitmap '(exclamation-mark modus-themes-intense-cyan)) + `(flymake-error-bitmap '(flymake-double-exclamation-mark modus-themes-prominent-error)) + `(flymake-warning-bitmap '(exclamation-mark modus-themes-prominent-warning)) + `(flymake-note-bitmap '(exclamation-mark modus-themes-prominent-note)) ;;;; highlight-changes `(highlight-changes-colors nil) `(highlight-changes-face-list '(success warning error bold bold-italic)) diff --git a/etc/themes/modus-vivendi-deuteranopia-theme.el b/etc/themes/modus-vivendi-deuteranopia-theme.el index 57241c59b96..60c3c62b38f 100644 --- a/etc/themes/modus-vivendi-deuteranopia-theme.el +++ b/etc/themes/modus-vivendi-deuteranopia-theme.el @@ -1,4 +1,4 @@ -;;; modus-vivendi-deuteranopia-theme.el --- Elegant, highly legible and customizable dark theme -*- lexical-binding:t -*- +;;; modus-vivendi-deuteranopia-theme.el --- Deuteranopia-optimized theme with a black background -*- lexical-binding:t -*- ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. @@ -43,7 +43,7 @@ (require 'modus-themes)) (deftheme modus-vivendi-deuteranopia - "Elegant, highly legible and customizable dark theme. + "Deuteranopia-optimized theme with a black background. This variant is optimized for users with red-green color deficiency (deuteranopia). It conforms with the highest legibility standard for color contrast between background and @@ -76,9 +76,9 @@ (green-cooler "#00c06f") (green-faint "#88ca9f") (green-intense "#44df44") - (yellow "#d0bc00") - (yellow-warmer "#fec43f") - (yellow-cooler "#dfaf7a") + (yellow "#cabf00") + (yellow-warmer "#ffa00f") + (yellow-cooler "#d8af7a") (yellow-faint "#d2b580") (yellow-intense "#efef00") (blue "#2fafff") @@ -138,13 +138,13 @@ ;;; Graphs - (bg-graph-red-0 "#705c3c") - (bg-graph-red-1 "#504420") - (bg-graph-green-0 "#4f666f") - (bg-graph-green-1 "#204840") + (bg-graph-red-0 "#bf6000") + (bg-graph-red-1 "#733500") + (bg-graph-green-0 "#6fbf8f") + (bg-graph-green-1 "#2f5f4f") (bg-graph-yellow-0 "#c1c00a") - (bg-graph-yellow-1 "#6f6f00") - (bg-graph-blue-0 "#2fafef") + (bg-graph-yellow-1 "#7f6640") + (bg-graph-blue-0 "#0f90ef") (bg-graph-blue-1 "#1f2f8f") (bg-graph-magenta-0 "#7f7f8e") (bg-graph-magenta-1 "#4f4f5f") @@ -222,13 +222,20 @@ (identifier yellow-faint) (err yellow-warmer) - (warning yellow-cooler) + (warning yellow) (info blue) (underline-err yellow-intense) (underline-warning magenta-faint) (underline-note cyan) + (bg-prominent-err bg-yellow-intense) + (fg-prominent-err fg-main) + (bg-prominent-warning bg-magenta-intense) + (fg-prominent-warning fg-main) + (bg-prominent-note bg-cyan-intense) + (fg-prominent-note fg-main) + ;;;; Code mappings (builtin magenta-warmer) @@ -277,6 +284,7 @@ (date-event fg-alt) (date-holiday yellow-warmer) (date-now blue-faint) + (date-range fg-alt) (date-scheduled yellow-cooler) (date-weekday cyan) (date-weekend yellow-faint) @@ -306,13 +314,22 @@ (mail-cite-0 blue-warmer) (mail-cite-1 yellow-cooler) - (mail-cite-2 blue-cooler) + (mail-cite-2 cyan-faint) (mail-cite-3 yellow) (mail-part blue) (mail-recipient blue) (mail-subject yellow-warmer) (mail-other cyan-faint) +;;;; Mark mappings + + (bg-mark-delete bg-yellow-subtle) + (fg-mark-delete yellow) + (bg-mark-select bg-cyan-subtle) + (fg-mark-select cyan) + (bg-mark-other bg-magenta-subtle) + (fg-mark-other magenta-warmer) + ;;;; Prompt mappings (fg-prompt blue) @@ -343,6 +360,12 @@ (rainbow-7 blue-faint) (rainbow-8 magenta-faint) +;;;; Space mappings + + (bg-space unspecified) + (fg-space border) + (bg-space-err bg-yellow-intense) + ;;;; Heading mappings (fg-heading-0 cyan-cooler) diff --git a/etc/themes/modus-vivendi-theme.el b/etc/themes/modus-vivendi-theme.el index 5012f8fb7f8..70dd0f78675 100644 --- a/etc/themes/modus-vivendi-theme.el +++ b/etc/themes/modus-vivendi-theme.el @@ -1,4 +1,4 @@ -;;; modus-vivendi-theme.el --- Elegant, highly legible and customizable dark theme -*- lexical-binding:t -*- +;;; modus-vivendi-theme.el --- Elegant, highly legible theme with a black background -*- lexical-binding:t -*- ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. @@ -43,7 +43,7 @@ (require 'modus-themes)) (deftheme modus-vivendi - "Elegant, highly legible and customizable dark theme. + "Elegant, highly legible theme with a black background. Conforms with the highest legibility standard for color contrast between background and foreground in any given piece of text, which corresponds to a minimum contrast in relative luminance of @@ -138,10 +138,10 @@ (bg-graph-red-0 "#b52c2c") (bg-graph-red-1 "#702020") - (bg-graph-green-0 "#4fd100") + (bg-graph-green-0 "#0fed00") (bg-graph-green-1 "#007800") (bg-graph-yellow-0 "#f1e00a") - (bg-graph-yellow-1 "#b08600") + (bg-graph-yellow-1 "#b08940") (bg-graph-blue-0 "#2fafef") (bg-graph-blue-1 "#1f2f8f") (bg-graph-magenta-0 "#bf94fe") @@ -227,6 +227,13 @@ (underline-warning yellow) (underline-note cyan) + (bg-prominent-err bg-red-intense) + (fg-prominent-err fg-main) + (bg-prominent-warning bg-yellow-intense) + (fg-prominent-warning fg-main) + (bg-prominent-note bg-cyan-intense) + (fg-prominent-note fg-main) + ;;;; Code mappings (builtin magenta-warmer) @@ -273,8 +280,9 @@ (date-common cyan) (date-deadline red) (date-event fg-alt) - (date-holiday magenta) + (date-holiday red-cooler) (date-now fg-main) + (date-range fg-alt) (date-scheduled yellow-warmer) (date-weekday cyan) (date-weekend red-faint) @@ -311,6 +319,15 @@ (mail-subject magenta-warmer) (mail-other magenta-faint) +;;;; Mark mappings + + (bg-mark-delete bg-red-subtle) + (fg-mark-delete red-cooler) + (bg-mark-select bg-cyan-subtle) + (fg-mark-select cyan) + (bg-mark-other bg-yellow-subtle) + (fg-mark-other yellow) + ;;;; Prompt mappings (fg-prompt cyan-cooler) @@ -341,6 +358,12 @@ (rainbow-7 blue-warmer) (rainbow-8 magenta-warmer) +;;;; Space mappings + + (bg-space unspecified) + (fg-space border) + (bg-space-err bg-red-intense) + ;;;; Heading mappings (fg-heading-0 cyan-cooler) diff --git a/etc/themes/modus-vivendi-tinted-theme.el b/etc/themes/modus-vivendi-tinted-theme.el index 79e7fc9e3d8..b6443bdf6cc 100644 --- a/etc/themes/modus-vivendi-tinted-theme.el +++ b/etc/themes/modus-vivendi-tinted-theme.el @@ -1,4 +1,4 @@ -;;; modus-vivendi-tinted-theme.el --- Elegant, highly legible and customizable dark theme -*- lexical-binding:t -*- +;;; modus-vivendi-tinted-theme.el --- Elegant, highly legible theme with a night sky background -*- lexical-binding:t -*- ;; Copyright (C) 2019-2023 Free Software Foundation, Inc. @@ -43,7 +43,7 @@ (require 'modus-themes)) (deftheme modus-vivendi-tinted - "Elegant, highly legible and customizable dark theme. + "Elegant, highly legible theme with a night sky background. Conforms with the highest legibility standard for color contrast between background and foreground in any given piece of text, which corresponds to a minimum contrast in relative luminance of @@ -132,10 +132,10 @@ (bg-graph-red-0 "#b52c2c") (bg-graph-red-1 "#702020") - (bg-graph-green-0 "#4fd100") + (bg-graph-green-0 "#0fed00") (bg-graph-green-1 "#007800") (bg-graph-yellow-0 "#f1e00a") - (bg-graph-yellow-1 "#b08600") + (bg-graph-yellow-1 "#b08940") (bg-graph-blue-0 "#2fafef") (bg-graph-blue-1 "#1f2f8f") (bg-graph-magenta-0 "#bf94fe") @@ -227,6 +227,13 @@ (underline-warning yellow) (underline-note cyan) + (bg-prominent-err bg-red-intense) + (fg-prominent-err fg-main) + (bg-prominent-warning bg-yellow-intense) + (fg-prominent-warning fg-main) + (bg-prominent-note bg-cyan-intense) + (fg-prominent-note fg-main) + ;;;; Code mappings (builtin magenta-warmer) @@ -273,8 +280,9 @@ (date-common cyan) (date-deadline red) (date-event fg-alt) - (date-holiday magenta) + (date-holiday red-cooler) (date-now fg-main) + (date-range fg-alt) (date-scheduled yellow-warmer) (date-weekday cyan) (date-weekend red-faint) @@ -311,10 +319,20 @@ (mail-subject magenta-warmer) (mail-other magenta-faint) +;;;; Mark mappings + + (bg-mark-delete bg-red-subtle) + (fg-mark-delete red-cooler) + (bg-mark-select bg-cyan-subtle) + (fg-mark-select cyan) + (bg-mark-other bg-yellow-subtle) + (fg-mark-other yellow) + ;;;; Prompt mappings (fg-prompt cyan-cooler) (bg-prompt unspecified) + (bg-space-err bg-red-intense) ;;;; Prose mappings @@ -341,6 +359,11 @@ (rainbow-7 blue-warmer) (rainbow-8 magenta-warmer) +;;;; Space mappings + + (bg-space unspecified) + (fg-space border) + ;;;; Heading mappings (fg-heading-0 cyan-cooler) diff --git a/etc/themes/modus-vivendi-tritanopia-theme.el b/etc/themes/modus-vivendi-tritanopia-theme.el new file mode 100644 index 00000000000..0d09989e2a7 --- /dev/null +++ b/etc/themes/modus-vivendi-tritanopia-theme.el @@ -0,0 +1,441 @@ +;;; modus-vivendi-tritanopia-theme.el --- Tritanopia-optimized theme with a black background -*- lexical-binding:t -*- + +;; Copyright (C) 2019-2023 Free Software Foundation, Inc. + +;; Author: Protesilaos Stavrou +;; Maintainer: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht> +;; URL: https://git.sr.ht/~protesilaos/modus-themes +;; Mailing-List: https://lists.sr.ht/~protesilaos/modus-themes + +;; 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 . + +;;; Commentary: +;; +;; The Modus themes conform with the highest standard for +;; color-contrast accessibility between background and foreground +;; values (WCAG AAA). Please refer to the official Info manual for +;; further documentation (distributed with the themes, or available +;; at: ). + +;;; Code: + + + +(eval-and-compile + (unless (and (fboundp 'require-theme) + load-file-name + (equal (file-name-directory load-file-name) + (expand-file-name "themes/" data-directory)) + (require-theme 'modus-themes t)) + (require 'modus-themes)) + + (deftheme modus-vivendi-tritanopia + "Tritanopia-optimized theme with a black background. +This variant is optimized for users with blue-yellow color +deficiency (tritanopia). It conforms with the highest +legibility standard for color contrast between background and +foreground in any given piece of text, which corresponds to a +minimum contrast in relative luminance of 7:1 (WCAG AAA +standard).") + + (defconst modus-vivendi-tritanopia-palette + '( +;;; Basic values + + (bg-main "#000000") + (bg-dim "#1e1e1e") + (fg-main "#ffffff") + (fg-dim "#989898") + (fg-alt "#c6daff") + (bg-active "#535353") + (bg-inactive "#303030") + (border "#646464") + +;;; Common accent foregrounds + + (red "#ff5f59") + (red-warmer "#ff6740") + (red-cooler "#ff6f9f") + (red-faint "#ff9070") + (red-intense "#ff5f5f") + (green "#44bc44") + (green-warmer "#70b900") + (green-cooler "#00c06f") + (green-faint "#88ca9f") + (green-intense "#44df44") + (yellow "#cabf00") + (yellow-warmer "#ffa00f") + (yellow-cooler "#d8af7a") + (yellow-faint "#d2b580") + (yellow-intense "#efef00") + (blue "#2fafff") + (blue-warmer "#79a8ff") + (blue-cooler "#00bcff") + (blue-faint "#82b0ec") + (blue-intense "#338fff") + (magenta "#feacd0") + (magenta-warmer "#f78fe7") + (magenta-cooler "#b6a0ff") + (magenta-faint "#caa6df") + (magenta-intense "#ef7fff") + (cyan "#00d3d0") + (cyan-warmer "#4ae2ff") + (cyan-cooler "#6ae4b9") + (cyan-faint "#7fdbdf") + (cyan-intense "#00eff0") + +;;; Uncommon accent foregrounds + + (rust "#db7b5f") + (gold "#c0965b") + (olive "#9cbd6f") + (slate "#76afbf") + (indigo "#9099d9") + (maroon "#cf7fa7") + (pink "#d09dc0") + +;;; Common accent backgrounds + + (bg-red-intense "#9d1f1f") + (bg-green-intense "#2f822f") + (bg-yellow-intense "#7a6100") + (bg-blue-intense "#1640b0") + (bg-magenta-intense "#7030af") + (bg-cyan-intense "#2266ae") + + (bg-red-subtle "#620f2a") + (bg-green-subtle "#00422a") + (bg-yellow-subtle "#4a4000") + (bg-blue-subtle "#242679") + (bg-magenta-subtle "#552f5f") + (bg-cyan-subtle "#004065") + + (bg-red-nuanced "#2c0614") + (bg-green-nuanced "#001904") + (bg-yellow-nuanced "#221000") + (bg-blue-nuanced "#0f0e39") + (bg-magenta-nuanced "#230631") + (bg-cyan-nuanced "#041529") + +;;; Uncommon accent backgrounds + + (bg-ochre "#442c2f") + (bg-lavender "#38325c") + (bg-sage "#0f3d30") + +;;; Graphs + + (bg-graph-red-0 "#b52c2c") + (bg-graph-red-1 "#702020") + (bg-graph-green-0 "#afd1c0") + (bg-graph-green-1 "#607a8f") + (bg-graph-yellow-0 "#facfd6") + (bg-graph-yellow-1 "#b57b85") + (bg-graph-blue-0 "#4f9fdf") + (bg-graph-blue-1 "#004559") + (bg-graph-magenta-0 "#b6427f") + (bg-graph-magenta-1 "#7f506f") + (bg-graph-cyan-0 "#57dfea") + (bg-graph-cyan-1 "#00808f") + +;;; Special purpose + + (bg-completion "#004253") + (bg-hover "#8e3e3b") + (bg-hover-secondary "#00405f") + (bg-hl-line "#2f3849") + (bg-region "#5a5a5a") + (fg-region "#ffffff") + + (bg-char-0 "#922a00") + (bg-char-1 "#4f3f7f") + (bg-char-2 "#00709f") + + (bg-mode-line-active "#003c52") + (fg-mode-line-active "#f0f0f0") + (border-mode-line-active "#5f8fb4") + (bg-mode-line-inactive "#2d2d2d") + (fg-mode-line-inactive "#969696") + (border-mode-line-inactive "#606060") + + (modeline-err "#ff7fbf") + (modeline-warning "#df9f93") + (modeline-info "#4fcfef") + + (bg-tab-bar "#313131") + (bg-tab-current "#000000") + (bg-tab-other "#545454") + +;;; Diffs + + (bg-added "#004254") + (bg-added-faint "#003042") + (bg-added-refine "#004f7f") + (bg-added-fringe "#008fcf") + (fg-added "#9fdfdf") + (fg-added-intense "#50c0ef") + + (bg-changed "#2f123f") + (bg-changed-faint "#1f022f") + (bg-changed-refine "#3f325f") + (bg-changed-fringe "#7f55a0") + (fg-changed "#e3cfff") + (fg-changed-intense "#cf9fe2") + + (bg-removed "#4f1119") + (bg-removed-faint "#380a0f") + (bg-removed-refine "#781a1f") + (bg-removed-fringe "#b81a1f") + (fg-removed "#ffbfbf") + (fg-removed-intense "#ff9095") + + (bg-diff-context "#1a1a1a") + +;;; Paren match + + (bg-paren-match "#2f7f9f") + (bg-paren-expression "#453040") + (underline-paren-match unspecified) + +;;; Mappings + +;;;; General mappings + + (fringe bg-dim) + (cursor red-intense) + + (keybind red) + (name red-cooler) + (identifier red-faint) + + (err red-warmer) + (warning magenta) + (info cyan) + + (underline-err red-intense) + (underline-warning magenta-intense) + (underline-note cyan-intense) + + (bg-prominent-err bg-red-intense) + (fg-prominent-err fg-main) + (bg-prominent-warning bg-magenta-intense) + (fg-prominent-warning fg-main) + (bg-prominent-note bg-cyan-intense) + (fg-prominent-note fg-main) + +;;;; Code mappings + + (builtin magenta) + (comment red-faint) + (constant green-faint) + (docstring fg-alt) + (docmarkup magenta-faint) + (fnname cyan-warmer) + (keyword red-cooler) + (preprocessor red-warmer) + (string cyan) + (type blue-warmer) + (variable cyan-cooler) + (rx-construct red) + (rx-backslash magenta) + +;;;; Accent mappings + + (accent-0 cyan) + (accent-1 red-warmer) + (accent-2 cyan-cooler) + (accent-3 magenta) + +;;;; Button mappings + + (fg-button-active fg-main) + (fg-button-inactive fg-dim) + (bg-button-active bg-active) + (bg-button-inactive bg-dim) + +;;;; Completion mappings + + (fg-completion-match-0 cyan) + (fg-completion-match-1 red-warmer) + (fg-completion-match-2 magenta) + (fg-completion-match-3 cyan-cooler) + (bg-completion-match-0 unspecified) + (bg-completion-match-1 unspecified) + (bg-completion-match-2 unspecified) + (bg-completion-match-3 unspecified) + +;;;; Date mappings + + (date-common cyan-cooler) + (date-deadline red) + (date-event fg-alt) + (date-holiday red-intense) + (date-now fg-main) + (date-range fg-alt) + (date-scheduled magenta) + (date-weekday cyan) + (date-weekend red-faint) + +;;;; Line number mappings + + (fg-line-number-inactive fg-dim) + (fg-line-number-active fg-main) + (bg-line-number-inactive bg-dim) + (bg-line-number-active bg-active) + +;;;; Link mappings + + (fg-link cyan) + (bg-link unspecified) + (underline-link cyan) + + (fg-link-symbolic cyan-cooler) + (bg-link-symbolic unspecified) + (underline-link-symbolic cyan-cooler) + + (fg-link-visited magenta) + (bg-link-visited unspecified) + (underline-link-visited magenta) + +;;;; Mail mappings + + (mail-cite-0 cyan-faint) + (mail-cite-1 red-faint) + (mail-cite-2 magenta-warmer) + (mail-cite-3 cyan-warmer) + (mail-part cyan-cooler) + (mail-recipient cyan) + (mail-subject red-cooler) + (mail-other cyan) + +;;;; Mark mappings + + (bg-mark-delete bg-red-subtle) + (fg-mark-delete red) + (bg-mark-select bg-cyan-subtle) + (fg-mark-select cyan) + (bg-mark-other bg-magenta-subtle) + (fg-mark-other magenta-warmer) + +;;;; Prompt mappings + + (fg-prompt cyan-cooler) + (bg-prompt unspecified) + +;;;; Prose mappings + + (prose-block fg-dim) + (prose-code cyan) + (prose-done cyan) + (prose-macro red-warmer) + (prose-metadata fg-dim) + (prose-metadata-value fg-alt) + (prose-table fg-alt) + (prose-tag fg-alt) + (prose-todo red) + (prose-verbatim magenta-warmer) + +;;;; Rainbow mappings + + (rainbow-0 cyan) + (rainbow-1 red) + (rainbow-2 cyan-warmer) + (rainbow-3 red-cooler) + (rainbow-4 cyan-cooler) + (rainbow-5 magenta) + (rainbow-6 cyan-faint) + (rainbow-7 magenta-faint) + (rainbow-8 red-faint) + +;;;; Space mappings + + (bg-space unspecified) + (fg-space border) + (bg-space-err bg-red-intense) + +;;;; Heading mappings + + (fg-heading-0 cyan-cooler) + (fg-heading-1 fg-main) + (fg-heading-2 red-faint) + (fg-heading-3 cyan-faint) + (fg-heading-4 magenta) + (fg-heading-5 green-faint) + (fg-heading-6 magenta-faint) + (fg-heading-7 cyan-faint) + (fg-heading-8 fg-dim) + + (bg-heading-0 unspecified) + (bg-heading-1 unspecified) + (bg-heading-2 unspecified) + (bg-heading-3 unspecified) + (bg-heading-4 unspecified) + (bg-heading-5 unspecified) + (bg-heading-6 unspecified) + (bg-heading-7 unspecified) + (bg-heading-8 unspecified) + + (overline-heading-0 unspecified) + (overline-heading-1 unspecified) + (overline-heading-2 unspecified) + (overline-heading-3 unspecified) + (overline-heading-4 unspecified) + (overline-heading-5 unspecified) + (overline-heading-6 unspecified) + (overline-heading-7 unspecified) + (overline-heading-8 unspecified)) + "The entire palette of the `modus-vivendi-tritanopia' theme. + +Named colors have the form (COLOR-NAME HEX-VALUE) with the former +as a symbol and the latter as a string. + +Semantic color mappings have the form (MAPPING-NAME COLOR-NAME) +with both as symbols. The latter is a named color that already +exists in the palette and is associated with a HEX-VALUE.") + + (defcustom modus-vivendi-tritanopia-palette-overrides nil + "Overrides for `modus-vivendi-tritanopia-palette'. + +Mirror the elements of the aforementioned palette, overriding +their value. + +For overrides that are shared across all of the Modus themes, +refer to `modus-themes-common-palette-overrides'. + +Theme-specific overrides take precedence over shared overrides. +The idea of common overrides is to change semantic color +mappings, such as to make the cursor red. Wherea theme-specific +overrides can also be used to change the value of a named color, +such as what hexadecimal RGB value the red-warmer symbol +represents." + :group 'modus-themes + :package-version '(modus-themes . "4.0.0") + :version "30.1" + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Palette overrides")) + + (modus-themes-theme modus-vivendi-tritanopia + modus-vivendi-tritanopia-palette + modus-vivendi-tritanopia-palette-overrides) + + (provide-theme 'modus-vivendi-tritanopia)) + +;;;###theme-autoload +(put 'modus-vivendi-tritanopia 'theme-properties '(:background-mode dark :kind color-scheme :family modus)) + +;;; modus-vivendi-tritanopia-theme.el ends here commit 31a80f61ec03bcbb79720c0dc640272aba160865 Author: F. Jason Park Date: Sun May 28 21:16:39 2023 -0700 Preserve prompt in erc-cmd-CLEAR * etc/ERC-NEWS: Mention behavioral changes to functionality provided by the `truncate' and `log' modules and also the "/CLEAR" command. * lisp/erc/erc-log.el (erc-truncate-buffer-on-save): Deprecate option because three's a crowd, and ERC already has a dedicated module as well as a slash command for this purpose. And although this commit restores functionality, this option has been unusable since at least the release of ERC 5.5, with no known complaints received thus far. Also, the doc string of `erc-save-buffer-in-logs' makes no mention of this feature WRT interactive invocations or otherwise. (erc-log-mode, erc-log-enable, erc-log-disable): Subscribe to new internal hook `erc--pre-clear-functions'. (erc-log--save-in-progress-p): New variable to help restore `erc-truncate-buffer-on-save' and promote code reuse. (erc-logging-enabled): Guard with `erc-log--saved-in-progress-p'. (erc-save-buffer-in-logs): Overload `buffer' parameter to allow various hooks to supply a non-buffer as well. Warn when people use `erc-truncate-buffer-on-save', which is now deprecated. * lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable, erc-stamp-disable): Subscribe to `erc--pre-clear-functions'. (erc-stamp--update-saved-position): New function for updating last-logged marker on `erc-stamp--insert-date-function'. (erc-stamp--reset-on-clear): New function to forget last inserted stamps when truncating. * lisp/erc/erc-truncate.el (erc-truncate-mode, erc-truncate-enable, erc-truncate-disable): Use `erc-insert-done-hook' instead of `erc-insert-post-hook', as implicitly suggested by an ancient comment, which ponders whether truncating the buffer at the insertion phase may be harmful to other hook members. (erc-truncate-buffer-to-size): Set truncation boundary at message break instead of line break. Run `erc--pre-clear-functions'. (erc-truncate-buffer): Save excursion. This should probably be handled by `erc-truncate-buffer-to-size' instead, but that's likelier to cause breakage in third-party code. * lisp/erc/erc.el (erc--pre-clear-functions): New internal hook. (erc-cmd-CLEAR): Run `erc--pre-clear-functions' before clearing, and don't blow away prompt. The latter was a regression caused by 05f6fdb9e78 "Preserve ERC prompt and its bounding markers". * test/lisp/erc/erc-scenarios-log.el: New file. (Bug#60936) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index c7d157eacfb..e9ec9e2caab 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -131,6 +131,17 @@ been restored with a slightly revised role contingent on a few assumptions explained in its doc string. For clarity, it has been renamed 'erc-ensure-target-buffer-on-privmsg'. +** Improved interplay between buffer truncation and message logging. +While most of these improvements are subtle, some affect everyday use. +For example, users of the 'truncate' module may notice that truncation +now happens between messages rather than arbitrary lines. And those +with the default 'erc-insert-timestamp-left-and-right' for their +'erc-insert-timestamp-function' will see date stamps reprinted after +every "/CLEAR" but omitted from any logs. One notable casualty of +these changes has been the deprecation of the ancient option +'erc-truncate-buffer-on-save'. Users of the 'log' module can achieve +the same effect by issuing a "/CLEAR" at the prompt. + ** Miscellaneous UX changes. Some minor quality-of-life niceties have finally made their way to ERC. For example, the function 'erc-echo-timestamp' is now diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 2b58a7c56ed..d3106da4017 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -124,6 +124,7 @@ erc-generate-log-file-name-function (defcustom erc-truncate-buffer-on-save nil "Erase the contents of any ERC (channel, query, server) buffer when it is saved." :type 'boolean) +(make-obsolete 'erc-truncate-buffer-on-save 'erc-cmd-CLEAR "30.1") (defcustom erc-enable-logging t "If non-nil, ERC will log IRC conversations. @@ -230,6 +231,7 @@ log (add-hook 'erc-part-hook #'erc-conditional-save-buffer) ;; append, so that 'erc-initialize-log-marker runs first (add-hook 'erc-connect-pre-hook #'erc-log-setup-logging 'append) + (add-hook 'erc--pre-clear-functions #'erc-save-buffer-in-logs) (dolist (buffer (erc-buffer-list)) (erc-log-setup-logging buffer)) (erc--modify-local-map t "C-c C-l" #'erc-save-buffer-in-logs)) @@ -242,6 +244,7 @@ log (remove-hook 'erc-quit-hook #'erc-conditional-save-queries) (remove-hook 'erc-part-hook #'erc-conditional-save-buffer) (remove-hook 'erc-connect-pre-hook #'erc-log-setup-logging) + (remove-hook 'erc--pre-clear-functions #'erc-save-buffer-in-logs) (dolist (buffer (erc-buffer-list)) (erc-log-disable-logging buffer)) (erc--modify-local-map nil "C-c C-l" #'erc-save-buffer-in-logs))) @@ -301,6 +304,8 @@ erc-log-save-all-buffers (dolist (buffer (erc-buffer-list)) (erc-save-buffer-in-logs buffer))) +(defvar erc-log--save-in-progress-p nil) + ;;;###autoload (defun erc-logging-enabled (&optional buffer) "Return non-nil if logging is enabled for BUFFER. @@ -310,6 +315,7 @@ erc-logging-enabled `erc-enable-logging' returns a non-nil value." (or buffer (setq buffer (current-buffer))) (and erc-log-channels-directory + (not erc-log--save-in-progress-p) (or (functionp erc-log-channels-directory) (erc-directory-writable-p erc-log-channels-directory)) (if (functionp erc-enable-logging) @@ -399,7 +405,7 @@ erc-save-buffer-in-logs You can save every individual message by putting this function on `erc-insert-post-hook'." (interactive) - (or buffer (setq buffer (current-buffer))) + (unless (bufferp buffer) (setq buffer (current-buffer))) (when (erc-logging-enabled buffer) (let ((file (erc-current-logfile buffer)) (coding-system erc-log-file-coding-system)) @@ -423,10 +429,11 @@ erc-save-buffer-in-logs (write-region start end file t 'nomessage)))) (if (and erc-truncate-buffer-on-save (called-interactively-p 'interactive)) - (progn - (let ((inhibit-read-only t)) (erase-buffer)) - (move-marker erc-last-saved-position (point-max)) - (erc-display-prompt)) + (let ((erc-log--save-in-progress-p t)) + (erc-cmd-CLEAR) + (erc-button--display-error-notice-with-keys + (erc-server-buffer) "Option `%s' is deprecated." + " Use /CLEAR instead." 'erc-truncate-buffer-on-save)) (move-marker erc-last-saved-position ;; If we place erc-last-saved-position at ;; erc-insert-marker, because text gets diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 9191bbe5a2a..500f6f3c0c9 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -166,12 +166,14 @@ stamp (add-hook 'erc-insert-modify-hook #'erc-add-timestamp t) (add-hook 'erc-send-modify-hook #'erc-add-timestamp t) (add-hook 'erc-mode-hook #'erc-stamp--recover-on-reconnect) + (add-hook 'erc--pre-clear-functions #'erc-stamp--reset-on-clear) (unless erc--updating-modules-p (erc-buffer-filter #'erc-munge-invisibility-spec))) ((remove-hook 'erc-mode-hook #'erc-munge-invisibility-spec) (remove-hook 'erc-insert-modify-hook #'erc-add-timestamp) (remove-hook 'erc-send-modify-hook #'erc-add-timestamp) (remove-hook 'erc-mode-hook #'erc-stamp--recover-on-reconnect) + (remove-hook 'erc--pre-clear-functions #'erc-stamp--reset-on-clear) (erc-with-all-buffers-of-server nil nil (kill-local-variable 'erc-timestamp-last-inserted) (kill-local-variable 'erc-timestamp-last-inserted-left) @@ -584,6 +586,20 @@ erc-echo-timestamp (defun erc--echo-ts-csf (_window _before dir) (erc-echo-timestamp dir (get-text-property (point) 'erc-timestamp))) +(defun erc-stamp--update-saved-position (&rest _) + (remove-function (local 'erc-stamp--insert-date-function) + #'erc-stamp--update-saved-position) + (move-marker erc-last-saved-position (1- (point)))) + +(defun erc-stamp--reset-on-clear (pos) + "Forget last-inserted stamps when POS is at insert marker." + (when (= pos (1- erc-insert-marker)) + (add-function :after (local 'erc-stamp--insert-date-function) + #'erc-stamp--update-saved-position) + (setq erc-timestamp-last-inserted nil + erc-timestamp-last-inserted-left nil + erc-timestamp-last-inserted-right nil))) + (provide 'erc-stamp) ;;; erc-stamp.el ends here diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el index b8fd4ae2e14..8430a68d92b 100644 --- a/lisp/erc/erc-truncate.el +++ b/lisp/erc/erc-truncate.el @@ -50,9 +50,9 @@ truncate bring any grown Emacs to its knees after a few days worth of tracking heavy-traffic channels." ;;enable - ((add-hook 'erc-insert-post-hook #'erc-truncate-buffer)) + ((add-hook 'erc-insert-done-hook #'erc-truncate-buffer)) ;; disable - ((remove-hook 'erc-insert-post-hook #'erc-truncate-buffer))) + ((remove-hook 'erc-insert-done-hook #'erc-truncate-buffer))) ;;;###autoload (defun erc-truncate-buffer-to-size (size &optional buffer) @@ -75,9 +75,11 @@ erc-truncate-buffer-to-size (save-restriction (widen) (let ((end (- erc-insert-marker size))) - ;; truncate at line boundaries + ;; Truncate at message boundary (formerly line boundary + ;; before 5.6). (goto-char end) - (beginning-of-line) + (goto-char (or (previous-single-property-change (point) 'erc-command) + (pos-bol))) (setq end (point)) ;; try to save the current buffer using ;; `erc-save-buffer-in-logs'. We use this, in case the @@ -91,10 +93,7 @@ erc-truncate-buffer-to-size ;; (not (memq 'erc-save-buffer-in-logs ;; erc-insert-post-hook)) ;; Comments? - (when (and (boundp 'erc-enable-logging) - erc-enable-logging - (erc-logging-enabled buffer)) - (erc-save-buffer-in-logs)) + (run-hook-with-args 'erc--pre-clear-functions end) ;; disable undoing for the truncating (buffer-disable-undo) (let ((inhibit-read-only t)) @@ -103,10 +102,10 @@ erc-truncate-buffer-to-size ;;;###autoload (defun erc-truncate-buffer () - "Truncates the current buffer to `erc-max-buffer-size'. -Meant to be used in hooks, like `erc-insert-post-hook'." + "Truncate current buffer to `erc-max-buffer-size'." (interactive) - (erc-truncate-buffer-to-size erc-max-buffer-size)) + (save-excursion + (erc-truncate-buffer-to-size erc-max-buffer-size))) (provide 'erc-truncate) ;;; erc-truncate.el ends here diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 9c1125a9351..5a91285c1d1 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3436,10 +3436,17 @@ erc--unignore-user (erc-with-server-buffer (setq erc-ignore-list (delete user erc-ignore-list)))))) +(defvar erc--pre-clear-functions nil + "Abnormal hook run when truncating buffers. +Called with position indicating boundary of interval to be excised.") + (defun erc-cmd-CLEAR () "Clear the window content." (let ((inhibit-read-only t)) - (delete-region (point-min) (line-beginning-position))) + (run-hook-with-args 'erc--pre-clear-functions (1- erc-insert-marker)) + ;; Ostensibly, `line-beginning-position' is for use in lisp code. + (delete-region (point-min) (min (line-beginning-position) + (1- erc-insert-marker)))) t) (put 'erc-cmd-CLEAR 'process-not-needed t) diff --git a/test/lisp/erc/erc-scenarios-log.el b/test/lisp/erc/erc-scenarios-log.el new file mode 100644 index 00000000000..c37e6b323aa --- /dev/null +++ b/test/lisp/erc/erc-scenarios-log.el @@ -0,0 +1,207 @@ +;;; erc-scenarios-log.el --- erc-log scenarios -*- lexical-binding: t -*- + +;; Copyright (C) 2023 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 . + +;;; Commentary: + +;;; Code: + +(require 'ert-x) +(eval-and-compile + (let ((load-path (cons (ert-resource-directory) load-path))) + (require 'erc-scenarios-common))) + +(require 'erc-log) +(require 'erc-truncate) + +(defvar erc-timestamp-format-left) + +(ert-deftest erc-scenarios-log--kill-hook () + :tags '(:expensive-test) + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "base/assoc/bouncer-history") + (dumb-server (erc-d-run "localhost" t 'foonet)) + (tempdir (make-temp-file "erc-tests-log." t nil nil)) + (erc-log-channels-directory tempdir) + (erc-modules (cons 'log erc-modules)) + (port (process-contact dumb-server :service)) + (logfile (expand-file-name (format "#chan!tester@127.0.0.1:%d.txt" port) + tempdir)) + (erc-server-flood-penalty 0.1) + (expect (erc-d-t-make-expecter))) + + (ert-info ("Connect to foonet") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "tester" + :password "foonet:changeme" + :full-name "tester") + (should (string= (buffer-name) (format "127.0.0.1:%d" port))) + (funcall expect 5 "foonet"))) + + (with-current-buffer (erc-d-t-wait-for 5 (get-buffer "#chan")) + (funcall expect 10 "was created on") + (funcall expect 10 "please your lordship") + (with-current-buffer "foonet" + (delete-process erc-server-process) + (funcall expect 5 "failed")) + (should-not (file-exists-p logfile)) + (kill-buffer) + (should (file-exists-p logfile))) + + (with-temp-buffer + (insert-file-contents logfile) + (funcall expect 1 "You have joined") + (funcall expect 1 "Playback Complete.") + (funcall expect 1 "please your lordship")) + + (erc-log-mode -1) + (if noninteractive + (delete-directory tempdir :recursive) + (add-hook 'kill-emacs-hook + (lambda () (delete-directory tempdir :recursive)))))) + +;; This shows that, in addition to truncating the buffer, /clear also +;; syncs the log. + +(ert-deftest erc-scenarios-log--clear-stamp () + :tags '(:expensive-test) + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "base/assoc/bouncer-history") + (dumb-server (erc-d-run "localhost" t 'foonet)) + (tempdir (make-temp-file "erc-tests-log." t nil nil)) + (erc-log-channels-directory tempdir) + (erc-modules (cons 'log erc-modules)) + (erc-timestamp-format-left "\n[%a %b %e %Y @@STAMP@@]\n") + (port (process-contact dumb-server :service)) + (logfile (expand-file-name (format "#chan!tester@127.0.0.1:%d.txt" port) + tempdir)) + (erc-server-flood-penalty 0.1) + (expect (erc-d-t-make-expecter))) + + (unless noninteractive + (add-hook 'kill-emacs-hook + (lambda () (delete-directory tempdir :recursive)))) + + (ert-info ("Connect to foonet") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "tester" + :password "foonet:changeme" + :full-name "tester") + (should (string= (buffer-name) (format "127.0.0.1:%d" port))) + (funcall expect 5 "foonet"))) + + (with-current-buffer (erc-d-t-wait-for 5 (get-buffer "#chan")) + (funcall expect 10 "@@STAMP@@") + (funcall expect 10 "Grows, lives") + (should-not (file-exists-p logfile)) + (goto-char (point-max)) + (erc-cmd-CLEAR) + (should (file-exists-p logfile)) + (funcall expect 10 "please your lordship") + (ert-info ("Buffer truncated") + (goto-char (point-min)) + (funcall expect 10 "@@STAMP@@" (point)) ; reset + (funcall expect -0.1 "Grows, lives") + (funcall expect 1 "For these two"))) + + (ert-info ("Current contents saved") + (with-temp-buffer + (insert-file-contents logfile) + (funcall expect 1 "@@STAMP@@") + (funcall expect 1 "You have joined") + (funcall expect 1 "Playback Complete.") + (funcall expect 1 "Grows, lives") + (funcall expect -0.01 "please your lordship"))) + + (ert-info ("Remainder saved, timestamp printed when option non-nil") + (with-current-buffer "foonet" + (delete-process erc-server-process) + (funcall expect 5 "failed")) + (kill-buffer "#chan") + (with-temp-buffer + (insert-file-contents logfile) + (funcall expect 1 "@@STAMP@@") + (funcall expect 1 "Grows, lives") + (funcall expect -0.01 "@@STAMP@@") + (forward-line 1) ; no blank, no timestamp + (should (looking-at (rx " alice: For these two hours,"))) + (funcall expect 1 "please your lordship"))) + + (erc-log-mode -1) + (when noninteractive (delete-directory tempdir :recursive)))) + +(ert-deftest erc-scenarios-log--truncate () + :tags '(:expensive-test) + (erc-scenarios-common-with-cleanup + ((erc-scenarios-common-dialog "base/assoc/bouncer-history") + (dumb-server (erc-d-run "localhost" t 'foonet)) + (tempdir (make-temp-file "erc-tests-log." t nil nil)) + (erc-log-channels-directory tempdir) + (erc-modules (cons 'truncate (cons 'log erc-modules))) + (erc-max-buffer-size 512) + (port (process-contact dumb-server :service)) + (logchan (expand-file-name (format "#chan!tester@127.0.0.1:%d.txt" port) + tempdir)) + (logserv (expand-file-name + (format "127.0.0.1:%d!tester@127.0.0.1:%d.txt" port port) + tempdir)) + (erc-server-flood-penalty 0.1) + (expect (erc-d-t-make-expecter))) + + (unless noninteractive + (add-hook 'kill-emacs-hook + (lambda () (delete-directory tempdir :recursive)))) + + (ert-info ("Connect to foonet") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "tester" + :password "foonet:changeme" + :full-name "tester") + (should (string= (buffer-name) (format "127.0.0.1:%d" port))) + (should-not (file-exists-p logserv)) + (should-not (file-exists-p logchan)) + (funcall expect 10 "*** MAXLIST=beI:60") + (should (= (pos-bol) (point-min))) + (should (file-exists-p logserv)))) + + (ert-info ("Log file ahead of truncation point") + ;; Log contains lines still present in buffer. + (with-temp-buffer + (insert-file-contents logserv) + (funcall expect 10 "*** MAXLIST=beI:60"))) + + (with-current-buffer (erc-d-t-wait-for 5 (get-buffer "#chan")) + (funcall expect 10 "please your lordship") + (should (file-exists-p logchan)) + (funcall expect -0.1 "[07:04:37] alice: Here," (point-min))) + + (ert-info ("Log ahead of truncation point") + (with-temp-buffer + (insert-file-contents logchan) + (funcall expect 1 "You have joined") + (funcall expect 1 "[07:04:37] alice: Here,") + (funcall expect 1 "loathed enemy") + (funcall expect -0.1 "please your lordship"))) + + (erc-log-mode -1) + (when noninteractive (delete-directory tempdir :recursive)))) + +;;; erc-scenarios-log.el ends here commit 4f93c52f7fd1b7c5f75a0d049e5a1015a268265a Author: F. Jason Park Date: Thu May 18 23:47:27 2023 -0700 Recompute erc-prompt when inserting messages * lisp/erc/erc.el (erc--refresh-prompt): New function for redrawing the prompt in a couple select places. (erc-display-line-1, erc-display-msg): Replace the prompt after inserting messages. * test/lisp/erc/erc-tests.el (erc--refresh-prompt): New test. (Bug#60936) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index a84e38e70e5..9c1125a9351 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2805,6 +2805,18 @@ erc--assert-input-bounds (cl-assert (< erc-insert-marker erc-input-marker)) (cl-assert (= (field-end erc-insert-marker) erc-input-marker))))) +(defun erc--refresh-prompt () + "Re-render ERC's prompt when the option `erc-prompt' is a function." + (erc--assert-input-bounds) + (when (functionp erc-prompt) + (save-excursion + (goto-char erc-insert-marker) + ;; Avoid `erc-prompt' (the named function), which appends a + ;; space, and `erc-display-prompt', which propertizes all but + ;; that space. + (insert-and-inherit (funcall erc-prompt)) + (delete-region (point) (1- erc-input-marker))))) + (defun erc-display-line-1 (string buffer) "Display STRING in `erc-mode' BUFFER. Auxiliary function used in `erc-display-line'. The line gets filtered to @@ -2848,7 +2860,7 @@ erc-display-line-1 (when erc-remove-parsed-property (remove-text-properties (point-min) (point-max) '(erc-parsed nil)))) - (erc--assert-input-bounds))))) + (erc--refresh-prompt))))) (run-hooks 'erc-insert-done-hook) (erc-update-undo-list (- (or (marker-position erc-insert-marker) (point-max)) @@ -6470,7 +6482,7 @@ erc-display-msg (narrow-to-region insert-position (point)) (run-hooks 'erc-send-modify-hook) (run-hooks 'erc-send-post-hook)) - (erc--assert-input-bounds))))) + (erc--refresh-prompt))))) (defun erc-command-symbol (command) "Return the ERC command symbol for COMMAND if it exists and is bound." diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index b624186d88d..1c75f35e1b5 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -269,6 +269,105 @@ erc-hide-prompt (kill-buffer "bob") (kill-buffer "ServNet")))) +(ert-deftest erc--refresh-prompt () + (let* ((counter 0) + (erc-prompt (lambda () + (format "%s %d>" + (erc-format-target-and/or-network) + (cl-incf counter)))) + erc-accidental-paste-threshold-seconds + erc-insert-modify-hook + erc--input-review-functions + erc-send-completed-hook) + + (ert-info ("Server buffer") + (with-current-buffer (get-buffer-create "ServNet") + (erc-tests--send-prep) + (goto-char erc-insert-marker) + (should (looking-at-p "ServNet 3>")) + (erc-tests--set-fake-server-process "sleep" "1") + (set-process-sentinel erc-server-process #'ignore) + (setq erc-network 'ServNet + erc-server-current-nick "tester" + erc-networks--id (erc-networks--id-create nil) + erc-server-users (make-hash-table :test 'equal)) + (set-process-query-on-exit-flag erc-server-process nil) + ;; Incoming message redraws prompt + (erc-display-message nil 'notice nil "Welcome") + (should (looking-at-p "ServNet 4>")) + ;; Say something + (save-excursion (goto-char erc-input-marker) + (insert "Howdy") + (erc-send-current-line) + (forward-line -1) + (should (looking-at "No target")) + (forward-line -1) + (should (looking-at " Howdy"))) + (should (looking-at-p "ServNet 6>")) + ;; Space after prompt is unpropertized + (should (get-text-property (1- erc-input-marker) 'erc-prompt)) + (should-not (get-text-property erc-input-marker 'erc-prompt)) + ;; No sign of old prompts + (save-excursion + (goto-char (point-min)) + (should-not (search-forward (rx (any "3-5") ">") nil t))))) + + (ert-info ("Channel buffer") + (with-current-buffer (get-buffer-create "#chan") + (erc-tests--send-prep) + (goto-char erc-insert-marker) + (should (looking-at-p "#chan 9>")) + (setq erc-server-process (buffer-local-value 'erc-server-process + (get-buffer "ServNet")) + erc-networks--id (erc-with-server-buffer erc-networks--id) + erc--target (erc--target-from-string "#chan") + erc-default-recipients (list "#chan") + erc-channel-users (make-hash-table :test 'equal)) + (erc-update-current-channel-member "alice" "alice") + (erc-update-current-channel-member "bob" "bob") + (erc-update-current-channel-member "tester" "tester") + (erc-display-message nil nil (current-buffer) + (erc-format-privmessage "alice" "Hi" nil t)) + (should (looking-at-p "#chan@ServNet 10>")) + (save-excursion (goto-char erc-input-marker) + (insert "Howdy") + (erc-send-current-line) + (forward-line -1) + (should (looking-at " Howdy"))) + (should (looking-at-p "#chan@ServNet 11>")) + (save-excursion (goto-char erc-input-marker) + (insert "/query bob") + (erc-send-current-line)) + ;; Query does not redraw (nor /help, only message input) + (should (looking-at-p "#chan@ServNet 11>")) + ;; No sign of old prompts + (save-excursion + (goto-char (point-min)) + (should-not (search-forward (rx (or "9" "10") ">") nil t))))) + + (ert-info ("Query buffer") + (with-current-buffer (get-buffer "bob") + (goto-char erc-insert-marker) + (should (looking-at-p "bob@ServNet 14>")) + (erc-display-message nil nil (current-buffer) + (erc-format-privmessage "bob" "Hi" nil t)) + (should (looking-at-p "bob@ServNet 15>")) + (save-excursion (goto-char erc-input-marker) + (insert "Howdy") + (erc-send-current-line) + (forward-line -1) + (should (looking-at " Howdy"))) + (should (looking-at-p "bob@ServNet 16>")) + ;; No sign of old prompts + (save-excursion + (goto-char (point-min)) + (should-not (search-forward (rx (or "14" "15") ">") nil t))))) + + (when noninteractive + (kill-buffer "#chan") + (kill-buffer "bob") + (kill-buffer "ServNet")))) + (ert-deftest erc--initialize-markers () (let ((proc (start-process "true" (current-buffer) "true")) erc-modules commit 8bef8a55660906c143c0b3940a3587c064608f9c Author: F. Jason Park Date: Mon May 22 23:42:11 2023 -0700 Simplify erc-tab interface * etc/ERC-NEWS: Improve section mentioning `erc-tab'. * lisp/erc/erc-button.el (erc-button-alist): Restore a commented out version of the "" entry, which was dropped in 5adda2f4683 "Revise FORM-as-function interface in erc-button-alist" for being redundant. This may help unlikely objectors better adapt to the churn. (erc-button-next, erc-button-previous): Don't bother accommodating raw prefix arguments; expect numeric arguments only. * lisp/erc/erc.el (erc-tab): Change interactive spec to lowercase "p". (Bug#60933) diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 5e5779cfcd5..c7d157eacfb 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -216,12 +216,12 @@ changes are encouraged to voice their concerns on the bug list. *** Miscellaneous changes Two helper macros from GNU ELPA's Compat library are now available to third-party modules as 'erc-compat-call' and 'erc-compat-function'. -In the area of buttons, 'Info-goto-node' has been supplanted by plain -old 'info' in 'erc-button-alist', and the bracketed "" -pattern entry has been removed because it was more or less redundant. -And the "TAB" key is now bound to a new command, 'erc-tab', that only -calls 'completion-at-point' when point is in the input area and -module-specific commands, like 'erc-button-next', otherwise. +In 'erc-button-alist', 'Info-goto-node' has been supplanted by plain +old 'info', and the "" entry has been removed because it was +more or less redundant. In all ERC buffers, the "" key is now +bound to a new command, 'erc-tab', that calls 'completion-at-point' +inside the input area and otherwise dispatches module-specific +commands, like 'erc-button-next'. * Changes in ERC 5.5 diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 4307dc3b860..33b93ff6744 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -128,6 +128,7 @@ erc-button-alist ;; things hard to maintain. '((nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0) (erc-button-url-regexp 0 t browse-url-button-open-url 0) + ;; (" ]+\\) *>" 0 t browse-url-button-open-url 1) ;;; ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3) ;; emacs internal ("[`‘]\\([a-zA-Z][-a-zA-Z_0-9!*<=>+]+\\)['’]" @@ -629,15 +630,13 @@ erc-button-next "Go to the ARGth next button." (declare (advertised-calling-convention (arg) "30.1")) (interactive "p") - (setq arg (pcase arg ((pred listp) (prefix-numeric-value arg)) (_ arg))) - (erc--button-next arg)) + (erc--button-next (or arg 1))) (defun erc-button-previous (&optional arg) "Go to ARGth previous button." (declare (advertised-calling-convention (arg) "30.1")) (interactive "p") - (setq arg (pcase arg ((pred listp) (prefix-numeric-value arg)) (_ arg))) - (erc--button-next (- arg))) + (erc--button-next (- (or arg 1)))) (defun erc-button-previous-of-nick (arg) "Go to ARGth previous button for nick at point." diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index aad6f7d9d54..a84e38e70e5 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4773,11 +4773,11 @@ erc--tab-functions "Functions to try when user hits \\`TAB' outside of input area. Called with a numeric prefix arg.") -(defun erc-tab (&optional arg) +(defun erc-tab (arg) "Call `completion-at-point' when typing in the input area. -Otherwise call members of `erc--tab-functions' with raw prefix -ARG until one of them returns non-nil." - (interactive "P") +Otherwise call members of `erc--tab-functions' with a numeric +prefix ARG until one of them returns non-nil." + (interactive "p") (if (>= (point) erc-input-marker) (completion-at-point) (run-hook-with-args-until-success 'erc--tab-functions arg))) commit 8a149966dd50a801abe25e97d446ce363252cdf9 Author: F. Jason Park Date: Mon May 22 21:43:29 2023 -0700 Add command to view ERC-NEWS * etc/ERC-NEWS: Mention `erc-news' command. * lisp/erc/erc.el (erc--news-url, erc--news-temp-file, erc-news): Add new command and supporting variable. diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index d257bdcbf51..5e5779cfcd5 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -136,9 +136,10 @@ Some minor quality-of-life niceties have finally made their way to ERC. For example, the function 'erc-echo-timestamp' is now interactive and can be invoked on any message to view its timestamp in the echo area. The command 'erc-button-previous' now moves to the -beginning instead of the end of buttons. And the 'irccontrols' module -now supports additional colors and special handling for "spoilers" -(hidden text). +beginning instead of the end of buttons. A new command, 'erc-news', +can now be invoked to visit this very file. And the 'irccontrols' +module now supports additional colors and special handling for +"spoilers" (hidden text). ** Changes in the library API. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 0be9eb69432..aad6f7d9d54 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -7428,6 +7428,51 @@ erc-bug (goto-char (point-min)) (insert "X-Debbugs-CC: emacs-erc@gnu.org\n"))) +(defconst erc--news-url + "https://git.savannah.gnu.org/cgit/emacs.git/plain/etc/ERC-NEWS") + +(defvar erc--news-temp-file nil) + +(defun erc-news (arg) + "Show ERC news in a manner similar to `view-emacs-news'. +With ARG, download and display the latest revision, which may +contain more up-to-date information, even for older versions." + (interactive "P") + (find-file + (or (and arg erc--news-temp-file + (time-less-p (current-time) (car erc--news-temp-file)) + (cdr erc--news-temp-file)) + (and arg + (with-current-buffer (url-retrieve-synchronously erc--news-url) + (goto-char (point-min)) + (search-forward "200 OK" (pos-eol)) + (search-forward "\n\n") + (delete-region (point-min) (point)) + (let ((tempfile (make-temp-file "erc-news."))) + (write-region (point-min) (point-max) tempfile) + (kill-buffer) + (cdr (setq erc--news-temp-file + (cons (time-add (current-time) (* 60 60 12)) + tempfile)))))) + (and-let* ((file (or (eval-when-compile (macroexp-file-name)) + (locate-library "erc"))) + (dir (file-name-directory file)) + (adjacent (expand-file-name "ERC-NEWS" dir)) + ((file-exists-p adjacent))) + adjacent) + (expand-file-name "ERC-NEWS" data-directory))) + (when (fboundp 'emacs-news-view-mode) + (emacs-news-view-mode)) + (let ((v (mapcar #'number-to-string + (seq-take-while #'natnump (version-to-list erc-version))))) + (while (and v + (goto-char (point-min)) + (not (search-forward (concat "\014\n* Changes in ERC " + (string-join v ".")) + nil t))) + (setq v (butlast v)))) + (beginning-of-line)) + (defun erc-port-to-string (p) "Convert port P to a string. P may be an integer or a service name." commit 7563bf5704c9288ad79263d97b929a5b53279d44 Author: F. Jason Park Date: Mon May 22 21:43:29 2023 -0700 Document recommended way to use ERC over Tor * doc/misc/erc.texi: Add new SOCKS section to the chapter on Integrations. Also bump version in front matter. * lisp/erc/erc.el (erc-open-socks-tls-stream): New convenience function to connect over Tor via SOCKS proxy. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 1f343fc8529..14c6a457654 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -2,7 +2,7 @@ @c %**start of header @setfilename ../../info/erc.info @settitle ERC Manual -@set ERCVER 5.5 +@set ERCVER 5.6 @set ERCDIST as distributed with Emacs @value{EMACSVER} @include docstyle.texi @syncodeindex fn cp @@ -611,6 +611,7 @@ Advanced Usage Integrations * URL:: Opening IRC URLs in ERC. +* SOCKS:: Connecting to IRC with a SOCKS proxy. * auth-source:: Retrieving auth-source entries with ERC. @end detailmenu @@ -1252,6 +1253,57 @@ Integrations @noindent Users on Emacs 28 and below may need to use @code{browse-url} instead. +@anchor{SOCKS} +@subsection SOCKS +@cindex SOCKS + +People wanting to connect to IRC through a @acronym{SOCKS} proxy are +most likely interested in doing so over @acronym{TOR} (The Onion +Router). If that's @emph{not} you, please adapt these instructions +accordingly. Otherwise, keep in mind that support for Tor is +experimental and thus insufficient for safeguarding a user's identity +and location, especially in the case of targeted individuals. + +ERC's preferred Tor setup works by accessing a local Tor service +through the built-in @file{socks.el} library that ships with Emacs. +Other means of accessing Tor, such as via @command{torsocks}, are not +supported. Before getting started, check that your Tor service is up +and running. You can do that with the following command: + +@example +curl --proxy socks5h://localhost:9050 https://check.torproject.org | \ + grep 'Congratulations' +@end example + +Networks and servers differ in how they expose Tor endpoints. In all +cases, you'll want to first set the option @code{socks-server} to +something appropriate, like @code{("tor" "127.0.0.1" 9050 5)}. For +some networks, setting @code{erc-server-connect-function} to +@code{socks-open-network-stream} might be enough. Others, like +@samp{Libera.Chat}, involve additional setup. At the time of writing, +connecting to @samp{Libera.Chat} requires both @acronym{TLS} and a +non-@samp{PLAIN} @acronym{SASL} mechanism (@pxref{SASL}). One way to +achieve that is by using the @samp{EXTERNAL} mechanism, as shown in +the following example: + +@lisp +(require 'erc) +(require 'socks) + +(let* ((socks-password "") + (socks-server '("tor" "localhost" 9050 5)) + (erc-modules (cons 'sasl erc-modules)) + (erc-sasl-mechanism 'external) + (erc-server-connect-function #'erc-open-socks-tls-stream)) + (erc-tls + :server "libera75jm6of4wxpxt4aynol3xjmbtxgfyjpu34ss4d7r7q2v5zrpyd.onion" + :port 6697 + :nick "jrh" + :user "jrandomhacker" + :full-name "J. Random Hacker" + :client-certificate (list "/home/jrh/key.pem" "/home/jrh/cert.pem"))) +@end lisp + @node auth-source @subsection auth-source @cindex auth-source diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 495e25212ce..0be9eb69432 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -144,6 +144,8 @@ gtk-version-string (declare-function word-at-point "thingatpt" (&optional no-properties)) (autoload 'word-at-point "thingatpt") ; for hl-nicks +(declare-function gnutls-negotiate "gnutls" (&rest rest)) +(declare-function socks-open-network-stream "socks" (name buffer host service)) (declare-function url-host "url-parse" (cl-x)) (declare-function url-password "url-parse" (cl-x)) (declare-function url-portspec "url-parse" (cl-x)) @@ -2598,6 +2600,22 @@ erc-open-tls-stream (setq args `(,name ,buffer ,host ,port ,@p)) (apply #'open-network-stream args))) +(defun erc-open-socks-tls-stream (name buffer host service &rest parameters) + "Connect to an IRC server via SOCKS proxy over TLS. +Bind `erc-server-connect-function' to this function around calls +to `erc-tls'. See `erc-open-network-stream' for the meaning of +NAME and BUFFER. HOST should be a \".onion\" URL, SERVICE a TLS +port number, and PARAMETERS a sequence of key/value pairs, per +`open-network-stream'. See Info node `(erc) SOCKS' for more +info." + (require 'gnutls) + (require 'socks) + (let ((proc (socks-open-network-stream name buffer host service)) + (cert-info (plist-get parameters :client-certificate))) + (gnutls-negotiate :process proc + :hostname host + :keylist (and cert-info (list cert-info))))) + ;;; Displaying error messages (defun erc-error (&rest args) commit 500abc4dc3792d9f5e1bfdbb5e493c8a59889097 Author: Juri Linkov Date: Mon May 29 20:34:53 2023 +0300 * lisp/tmm.el (tmm-completion-delete-prompt): Add more checks (bug#63754). In case when 'completions-header-format' is nil, the first 'mouse-face' property is at the beginning of the buffer. So first use 'get-text-property' at point-min. diff --git a/lisp/tmm.el b/lisp/tmm.el index 88254f0d1b8..a4058594622 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -329,7 +329,8 @@ tmm-completion-delete-prompt (with-current-buffer standard-output (goto-char (point-min)) (let* (;; First candidate: first string with mouse-face - (menu-start-1 (next-single-char-property-change (point) 'mouse-face)) + (menu-start-1 (or (and (get-text-property (point) 'mouse-face) (point)) + (next-single-char-property-change (point) 'mouse-face))) ;; Second candidate: an inactive menu item with tmm-inactive face (tps-result (save-excursion (text-property-search-forward 'face 'tmm-inactive t))) commit fbc96dcc4eadd4cce067ba6d177efc69ed459a27 Author: Andrea Corallo Date: Mon May 29 18:06:33 2023 +0200 Revert "* Nativecomp disable propagation of pre slot access type check..." This reverts commit c8e527cbeeea6be9bb713af33a3f40408b261234 as 56a8d57d032 fixes the root cause. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 937d9fdf926..ec51f805c2b 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2550,19 +2550,19 @@ comp-add-cond-cstrs for insns-seq on (comp-block-insns b) do (pcase insns-seq - ;; (`((set ,(and (pred comp-mvar-p) mvar-tested-copy) - ;; ,(and (pred comp-mvar-p) mvar-tested)) - ;; (set ,(and (pred comp-mvar-p) mvar-1) - ;; (call type-of ,(and (pred comp-mvar-p) mvar-tested-copy))) - ;; (set ,(and (pred comp-mvar-p) mvar-2) - ;; (call symbol-value ,(and (pred comp-cstr-cl-tag-p) mvar-tag))) - ;; (set ,(and (pred comp-mvar-p) mvar-3) - ;; (call memq ,(and (pred comp-mvar-p) mvar-1) ,(and (pred comp-mvar-p) mvar-2))) - ;; (cond-jump ,(and (pred comp-mvar-p) mvar-3) ,(pred comp-mvar-p) ,bb1 ,bb2)) - ;; (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag))) - ;; (comp-block-insns (comp-add-cond-cstrs-target-block b bb2))) - ;; (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag) :neg t)) - ;; (comp-block-insns (comp-add-cond-cstrs-target-block b bb1)))) + (`((set ,(and (pred comp-mvar-p) mvar-tested-copy) + ,(and (pred comp-mvar-p) mvar-tested)) + (set ,(and (pred comp-mvar-p) mvar-1) + (call type-of ,(and (pred comp-mvar-p) mvar-tested-copy))) + (set ,(and (pred comp-mvar-p) mvar-2) + (call symbol-value ,(and (pred comp-cstr-cl-tag-p) mvar-tag))) + (set ,(and (pred comp-mvar-p) mvar-3) + (call memq ,(and (pred comp-mvar-p) mvar-1) ,(and (pred comp-mvar-p) mvar-2))) + (cond-jump ,(and (pred comp-mvar-p) mvar-3) ,(pred comp-mvar-p) ,bb1 ,bb2)) + (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag))) + (comp-block-insns (comp-add-cond-cstrs-target-block b bb2))) + (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag) :neg t)) + (comp-block-insns (comp-add-cond-cstrs-target-block b bb1)))) (`((set ,(and (pred comp-mvar-p) cmp-res) (,(pred comp-call-op-p) ,(and (or (pred comp-equality-fun-p) commit 56a8d57d032c17263ba70139b85c94436e528572 Author: Andrea Corallo Date: Sun May 28 14:49:19 2023 +0200 comp: Recompute type slots after byte compilation for user types * lisp/emacs-lisp/comp-cstr.el (comp--compute-typeof-types) (comp--compute--pred-type-h): New functions. (comp-cstr-ctxt): Make use of. (comp-cstr-ctxt-update-type-slots): New function. * lisp/emacs-lisp/comp.el (comp-spill-lap): Use `comp-cstr-ctxt-update-type-slots'. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index e9132552506..416ca7f11b0 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -102,17 +102,23 @@ comp--all-classes obarray) res)) +(defun comp--compute-typeof-types () + (append comp--typeof-builtin-types + (mapcar #'comp--cl-class-hierarchy (comp--all-classes)))) + +(defun comp--compute--pred-type-h () + (cl-loop with h = (make-hash-table :test #'eq) + for class-name in (comp--all-classes) + for pred = (get class-name 'cl-deftype-satisfies) + when pred + do (puthash pred class-name h) + finally return h)) + (cl-defstruct comp-cstr-ctxt - (typeof-types (append comp--typeof-builtin-types - (mapcar #'comp--cl-class-hierarchy (comp--all-classes))) + (typeof-types (comp--compute-typeof-types) :type list :documentation "Type hierarchy.") - (pred-type-h (cl-loop with h = (make-hash-table :test #'eq) - for class-name in (comp--all-classes) - for pred = (get class-name 'cl-deftype-satisfies) - when pred - do (puthash pred class-name h) - finally return h) + (pred-type-h (comp--compute--pred-type-h) :type hash-table :documentation "Hash pred -> type.") (union-typesets-mem (make-hash-table :test #'equal) :type hash-table @@ -135,6 +141,15 @@ comp-cstr-ctxt :documentation "Serve memoization for `intersection-mem'.")) +(defun comp-cstr-ctxt-update-type-slots (ctxt) + "Update the type related slots of CTXT. +This must run after byte compilation in order to account for user +defined types." + (setf (comp-cstr-ctxt-typeof-types ctxt) + (comp--compute-typeof-types)) + (setf (comp-cstr-ctxt-pred-type-h ctxt) + (comp--compute--pred-type-h))) + (defmacro with-comp-cstr-accessors (&rest body) "Define some quick accessor to reduce code vergosity in BODY." (declare (debug (form body)) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 0556e69051d..937d9fdf926 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1431,11 +1431,13 @@ comp-spill-lap "Byte-compile and spill the LAP representation for INPUT. If INPUT is a symbol, it is the function-name to be compiled. If INPUT is a string, it is the filename to be compiled." - (let ((byte-native-compiling t) - (byte-to-native-lambdas-h (make-hash-table :test #'eq)) - (byte-to-native-top-level-forms ()) - (byte-to-native-plist-environment ())) - (comp-spill-lap-function input))) + (let* ((byte-native-compiling t) + (byte-to-native-lambdas-h (make-hash-table :test #'eq)) + (byte-to-native-top-level-forms ()) + (byte-to-native-plist-environment ()) + (res (comp-spill-lap-function input))) + (comp-cstr-ctxt-update-type-slots comp-ctxt) + res)) ;;; Limplification pass specific code. commit edcdb4c2ecd16e9838f2359ea4f1c66030ffadaf Author: Michael Albinus Date: Mon May 29 17:26:46 2023 +0200 Add tree-sitter tests to emba * admin/notes/emba: Add docker image emacs-tree-sitter. Improve docker call. * test/infra/Dockerfile.emba (emacs-tree-sitter): New image. * test/infra/gitlab-ci.yml (.tree-sitter-template): New template. (build-image-tree-sitter, test-tree-sitter): New jobs. diff --git a/admin/notes/emba b/admin/notes/emba index c88b422a4fa..1f87a99ddc0 100644 --- a/admin/notes/emba +++ b/admin/notes/emba @@ -97,15 +97,16 @@ recent Emacs branch, and apply the command This creates the Debian-based image emacs-inotify, based on the instructions in the file Dockerfile.emba. This image is good for the majority of tests. However, there are also other image build -instructions like emacs-filenotify-gio, emacs-eglot, emacs-gnustep and -emacs-native-comp-speed{0,1,2}. Use the appropriate one. +instructions like emacs-filenotify-gio, emacs-eglot, +emacs-tree-sitter, emacs-gnustep and emacs-native-comp-speed{0,1,2}. +Use the appropriate one. The image contains a directory "/checkout", which is a copy of your local Emacs git repository. Emacs has been built in this directory via "make bootstrap". In order to use the image, start a container like - docker run --interactive --env EMACS_EMBA_CI=1 --name emacs-inotify \ + docker run --interactive --tty --env EMACS_EMBA_CI=1 --name emacs-inotify \ emacs-inotify /bin/sh -i In this container, change the current directory to "/checkout". Now diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 689573236da..5141c8919b1 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -83,6 +83,62 @@ RUN ./autogen.sh autoconf RUN ./configure RUN make bootstrap +# Debian bullseye doesn't provide proper packages. So we use Debian +# sid for this. +FROM debian:sid as emacs-tree-sitter + +# This corresponds to emacs-base. +RUN apt-get update && \ + apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ + libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \ + libdbus-1-dev libacl1-dev acl git texinfo gdb \ + && rm -rf /var/lib/apt/lists/* + +# Install tree-sitter library. +RUN apt-get update && \ + apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ + libtree-sitter0 libtree-sitter-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY . /checkout +WORKDIR /checkout +RUN ./autogen.sh autoconf +RUN ./configure --with-tree-sitter +RUN make bootstrap + +# Install language grammars. +RUN mkdir /usr/local/lib/tree-sitter +RUN git config --global http.sslverify "false" +# See https://github.com/emacs-tree-sitter/tree-sitter-langs/tree/master/repos +RUN src/emacs -Q --batch \ + --eval '(setq \ + treesit-extra-load-path (list "/usr/local/lib/tree-sitter") \ + treesit-language-source-alist \ + (quote ((bash "https://github.com/tree-sitter/tree-sitter-bash") \ + (c "https://github.com/tree-sitter/tree-sitter-c") \ + (cmake "https://github.com/uyha/tree-sitter-cmake") \ + (cpp "https://github.com/tree-sitter/tree-sitter-cpp") \ + (css "https://github.com/tree-sitter/tree-sitter-css") \ + (elisp "https://github.com/Wilfred/tree-sitter-elisp") \ + (elixir "https://github.com/elixir-lang/tree-sitter-elixir") \ + (java "https://github.com/tree-sitter/tree-sitter-java") \ + (go "https://github.com/tree-sitter/tree-sitter-go") \ + (gomod "https://github.com/camdencheek/tree-sitter-go-mod") \ + (heex "https://github.com/phoenixframework/tree-sitter-heex") \ + (html "https://github.com/tree-sitter/tree-sitter-html") \ + (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src") \ + (json "https://github.com/tree-sitter/tree-sitter-json") \ + (make "https://github.com/alemuller/tree-sitter-make") \ + (markdown "https://github.com/ikatyang/tree-sitter-markdown") \ + (python "https://github.com/tree-sitter/tree-sitter-python") \ + (ruby "https://github.com/tree-sitter/tree-sitter-ruby") \ + (toml "https://github.com/tree-sitter/tree-sitter-toml") \ + (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") \ + (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") \ + (yaml "https://github.com/ikatyang/tree-sitter-yaml"))))' \ + --eval '(dolist (lang (mapcar (quote car) treesit-language-source-alist)) \ + (treesit-install-language-grammar lang "/usr/local/lib/tree-sitter"))' + FROM emacs-base as emacs-gnustep RUN apt-get update && \ diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index d1fef0187d4..aabb50f6aaa 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -176,6 +176,16 @@ default: - test/infra/* - test/lisp/progmodes/eglot-tests.el +.tree-sitter-template: + rules: + - if: '$CI_PIPELINE_SOURCE == "web"' + - if: '$CI_PIPELINE_SOURCE == "schedule"' + changes: + - "**.in" + - lisp/progmodes/*-ts-mode.el + - test/infra/* + - test/lisp/progmodes/*-ts-mode-tests.el + .native-comp-template: rules: - if: '$CI_PIPELINE_SOURCE == "web"' @@ -256,6 +266,31 @@ test-eglot: # This is needed in order to get a JUnit test report. make_params: '-k -C test check-expensive LOGFILES="lisp/progmodes/eglot-tests.log"' +build-image-tree-sitter: + stage: platform-images + extends: [.job-template, .build-template, .tree-sitter-template] + variables: + target: emacs-tree-sitter + +test-tree-sitter: + stage: platforms + extends: [.job-template, .test-template, .tree-sitter-template] + needs: + - job: build-image-tree-sitter + optional: true + variables: + target: emacs-tree-sitter + # This is needed in order to get a JUnit test report. + files: >- + lisp/progmodes/c-ts-mode-tests.log + lisp/progmodes/elixir-ts-mode-tests.el + lisp/progmodes/go-ts-mode-tests.log + lisp/progmodes/heex-ts-mode-tests.log + lisp/progmodes/java-ts-mode-tests.log + lisp/progmodes/ruby-ts-mode-tests.log + lisp/progmodes/typescript-ts-mode-tests.log + make_params: '-k -C test check-expensive LD_LIBRARY_PATH=/usr/local/lib/tree-sitter LOGFILES="$files"' + build-image-gnustep: stage: platform-images extends: [.job-template, .build-template, .gnustep-template] commit afc1f329356da167902d86b610023a32943f6cee Author: Eli Zaretskii Date: Mon May 29 16:44:48 2023 +0300 Allow to disable the DWIMish behavior of 'x' in package menu * lisp/emacs-lisp/package.el (package-menu-use-current-if-no-marks): New defcustom. (package-menu-execute): Use it. (Bug#62563) * etc/NEWS: Announce the new option. diff --git a/etc/NEWS b/etc/NEWS index 7785d734a6f..60aa64b5ede 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1886,7 +1886,9 @@ These commands can be useful if the ".elc" files are out of date +++ *** New DWIM action on 'x' in "*Packages*" buffer. If no packages are marked, 'x' will install the package under point if -it isn't already, and remove it if it is installed. +it isn't already, and remove it if it is installed. Customize the new +option 'package-menu-use-current-if-no-marks' to the nil value to get +back the old behavior of signaling an error in that case. +++ *** New command 'package-vc-install'. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 340ca9400fa..202aca36f24 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -3313,6 +3313,18 @@ package-hidden-regexps :version "25.1" :type '(repeat (regexp :tag "Hide packages with name matching"))) +(defcustom package-menu-use-current-if-no-marks t + "Whether \\\\[package-menu-execute] in package menu operates on current package if none are marked. + +If non-nil, and no packages are marked for installation or +deletion, \\\\[package-menu-execute] will operate on the current package at point, +see `package-menu-execute' for details. +The default is t. Set to nil to get back the original behavior +of having `package-menu-execute' signal an error when no packages +are marked for installation or deletion." + :version "29.1" + :type 'boolean) + (defun package-menu--refresh (&optional packages keywords) "Re-populate the `tabulated-list-entries'. PACKAGES should be nil or t, which means to display all known packages. @@ -3943,7 +3955,8 @@ package-menu-execute ;; Nothing marked. (unless (or delete-list install-list) ;; Not on a package line. - (unless (tabulated-list-get-id) + (unless (and (tabulated-list-get-id) + package-menu-use-current-if-no-marks) (user-error "No operations specified")) (let* ((id (tabulated-list-get-id)) (status (package-menu-get-status))) commit 08104c01504f73d1c2fa7df413cad4e988dd5119 Author: Robert Pluim Date: Tue Apr 25 12:28:47 2023 +0200 Allow dired to invoke secondary browser 'browse-url-of-dired-file' always invokes the primary browser, but sometimes it's handy to call a different browser, which is why 'browse-url-secondary-browser-function' exists. * lisp/net/browse-url.el (browse-url-of-dired-file): Call 'browse-url-secondary-browser-function' when invoked with a prefix argument. * etc/NEWS: Announce the change. diff --git a/etc/NEWS b/etc/NEWS index e33e40d9009..7785d734a6f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1692,6 +1692,13 @@ the following to your Init file: *** New command 'dired-do-eww'. This command visits the file on the current line with EWW. +--- +*** 'browse-url-of-dired-file' can now call the secondary browser. +When invoked with a prefix arg, this will now call +'browse-url-secondary-browser-function' instead of the default +browser. 'browse-url-of-dired-file' is bound to 'W' by default in +dired mode. + --- *** New user option 'dired-omit-lines'. This is used by 'dired-omit-mode', and now allows you to hide based on diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 0177d12f236..39513b8f602 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -825,10 +825,17 @@ browse-url-delete-temp-file (&optional localp no-error-if-not-filep)) ;;;###autoload -(defun browse-url-of-dired-file () - "In Dired, ask a WWW browser to display the file named on this line." - (interactive) +(defun browse-url-of-dired-file (&optional secondary) + "In Dired, ask a WWW browser to display the file named on this line. +With prefix arg, use the secondary browser instead (e.g. EWW if +`browse-url-secondary-browser-function' is set to +`eww-browse-url'." + (interactive "P") (let ((tem (dired-get-filename t t)) + (browse-url-browser-function + (if secondary + browse-url-secondary-browser-function + browse-url-browser-function)) ;; Some URL handlers open files in Emacs. We want to always ;; open in a browser, so disable those. (browse-url-default-handlers nil)) commit a3063f0bc873707c167cf51f3eb9c0b1675819e6 Author: Robert Pluim Date: Tue Apr 25 12:27:00 2023 +0200 Add a binding for enriched-toggle-markup * lisp/textmodes/enriched.el (enriched-mode-map): Bind 'enriched-toggle-markup' to 'M-o m'. * etc/NEWS: Announce the change. diff --git a/etc/NEWS b/etc/NEWS index a3457d70340..e33e40d9009 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1769,7 +1769,7 @@ or can take a long time to render. +++ *** New command 'enriched-toggle-markup'. This allows you to see the markup in 'enriched-mode' buffers (e.g., -the "HELLO" file). +the "HELLO" file). Bound to 'M-o m' by default. ** Shell Script Mode diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el index ec3046decd4..92be5a52bf2 100644 --- a/lisp/textmodes/enriched.el +++ b/lisp/textmodes/enriched.el @@ -192,6 +192,7 @@ enriched-mode-map (define-key map "\C-c[" #'set-left-margin) (define-key map "\C-c]" #'set-right-margin) (define-key map "\M-o" #'facemenu-keymap) + (define-key map "\M-om" #'enriched-toggle-markup) map) "Keymap for Enriched mode.") commit d8ba28fa3943b73b748b3f50853031139f23ef9b Author: Eli Zaretskii Date: Mon May 29 15:32:51 2023 +0300 Fix order of tmm-menubar when 'tmm-mid-prompt' is nil * lisp/tmm.el (tmm-prompt): Reverse 'tmm-km-list' when 'tmm-mid-prompt' is nil, to present the menu in the correct order. Suggested by Thiago Melo . diff --git a/lisp/tmm.el b/lisp/tmm.el index 6088961fa4c..88254f0d1b8 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -170,9 +170,11 @@ tmm-prompt (error "Empty menu reached")) (and tmm-km-list (let ((index-of-default 0)) - (if tmm-mid-prompt - (setq tmm-km-list (tmm-add-shortcuts tmm-km-list)) - t) + (setq tmm-km-list + (if tmm-mid-prompt + (tmm-add-shortcuts tmm-km-list) + ;; tmm-add-shortcuts reverses tmm-km-list internally. + (reverse tmm-km-list))) ;; Find the default item's index within the menu bar. ;; We use this to decide the initial minibuffer contents ;; and initial history position. commit 77087eb170f5632c58f0a00143e7289209f78989 Author: Michael Albinus Date: Mon May 29 11:37:33 2023 +0200 Fix regression when saving tramp-default-proxies-alist * lisp/net/tramp.el (tramp-add-hops): Suppress `signal-hook-function'. Save `tramp-default-proxies-alist' only when changed. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ecc950adfde..8c26f533bb8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4851,25 +4851,29 @@ tramp-add-hops "Add ad-hoc proxy definitions to `tramp-default-proxies-alist'." (when-let ((hops (tramp-file-name-hop vec)) (item vec)) - (dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit))) - (let* ((host-port (tramp-file-name-host-port item)) - (user-domain (tramp-file-name-user-domain item)) - (proxy (concat - tramp-prefix-format proxy tramp-postfix-host-format)) - (entry - (list (and (stringp host-port) - (rx bol (literal host-port) eol)) - (and (stringp user-domain) - (rx bol (literal user-domain) eol)) - (propertize proxy 'tramp-ad-hoc t)))) - (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry) - ;; Add the hop. - (add-to-list 'tramp-default-proxies-alist entry) - (setq item (tramp-dissect-file-name proxy)))) - ;; Save the new value. - (when tramp-save-ad-hoc-proxies - (customize-save-variable - 'tramp-default-proxies-alist tramp-default-proxies-alist)))) + (let (signal-hook-function changed) + (dolist + (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit))) + (let* ((host-port (tramp-file-name-host-port item)) + (user-domain (tramp-file-name-user-domain item)) + (proxy (concat + tramp-prefix-format proxy tramp-postfix-host-format)) + (entry + (list (and (stringp host-port) + (rx bol (literal host-port) eol)) + (and (stringp user-domain) + (rx bol (literal user-domain) eol)) + (propertize proxy 'tramp-ad-hoc t)))) + ;; Add the hop. + (unless (member entry tramp-default-proxies-alist) + (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry) + (add-to-list 'tramp-default-proxies-alist entry) + (setq changed t)) + (setq item (tramp-dissect-file-name proxy)))) + ;; Save the new value. + (when (and tramp-save-ad-hoc-proxies changed) + (customize-save-variable + 'tramp-default-proxies-alist tramp-default-proxies-alist))))) (defun tramp-compute-multi-hops (vec) "Expands VEC according to `tramp-default-proxies-alist'." commit 53dc7bec8303584772e0922acb64aa6e1625b556 Author: Michael Albinus Date: Mon May 29 11:22:54 2023 +0200 Fix regression when saving tramp-default-proxies-alist (Do not merge) * lisp/net/tramp.el (tramp-add-hops): Suppress `signal-hook-function'. Save `tramp-default-proxies-alist' only when changed. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9f868ccdaa0..7df455954d8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4624,25 +4624,29 @@ tramp-add-hops "Add ad-hoc proxy definitions to `tramp-default-proxies-alist'." (when-let ((hops (tramp-file-name-hop vec)) (item vec)) - (dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit))) - (let* ((host-port (tramp-file-name-host-port item)) - (user-domain (tramp-file-name-user-domain item)) - (proxy (concat - tramp-prefix-format proxy tramp-postfix-host-format)) - (entry - (list (and (stringp host-port) - (tramp-compat-rx bol (literal host-port) eol)) - (and (stringp user-domain) - (tramp-compat-rx bol (literal user-domain) eol)) - (propertize proxy 'tramp-ad-hoc t)))) - (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry) - ;; Add the hop. - (add-to-list 'tramp-default-proxies-alist entry) - (setq item (tramp-dissect-file-name proxy)))) - ;; Save the new value. - (when tramp-save-ad-hoc-proxies - (customize-save-variable - 'tramp-default-proxies-alist tramp-default-proxies-alist)))) + (let (signal-hook-function changed) + (dolist + (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit))) + (let* ((host-port (tramp-file-name-host-port item)) + (user-domain (tramp-file-name-user-domain item)) + (proxy (concat + tramp-prefix-format proxy tramp-postfix-host-format)) + (entry + (list (and (stringp host-port) + (tramp-compat-rx bol (literal host-port) eol)) + (and (stringp user-domain) + (tramp-compat-rx bol (literal user-domain) eol)) + (propertize proxy 'tramp-ad-hoc t)))) + ;; Add the hop. + (unless (member entry tramp-default-proxies-alist) + (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry) + (add-to-list 'tramp-default-proxies-alist entry) + (setq changed t)) + (setq item (tramp-dissect-file-name proxy)))) + ;; Save the new value. + (when (and tramp-save-ad-hoc-proxies changed) + (customize-save-variable + 'tramp-default-proxies-alist tramp-default-proxies-alist))))) (defun tramp-compute-multi-hops (vec) "Expands VEC according to `tramp-default-proxies-alist'." commit 3f4415256793ea0bdb99f8a67f795e68676b6be1 Author: Yuan Fu Date: Sun May 28 15:31:58 2023 -0700 Save the tree-sitter grammar recipe when installing a grammar Raised in bug#63750, but not the main subject of it. * lisp/treesit.el (treesit-install-language-grammar): Save the recipe to treesit-language-source-alist when installation is successful. diff --git a/lisp/treesit.el b/lisp/treesit.el index d7502560fea..3ec4fbc5c91 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2884,7 +2884,9 @@ treesit-install-language-grammar Interactively, if `treesit-language-source-alist' doesn't already have data for building the grammar for LANG, prompt for its -repository URL and the C/C++ compiler to use. +repository URL and the C/C++ compiler to use. The recipe built +by the prompts are saved for the current session if the +installation is successful and the grammar is loadable. This command requires Git, a C compiler and (sometimes) a C++ compiler, and the linker to be installed and on PATH. It also requires that the @@ -2901,27 +2903,31 @@ treesit-install-language-grammar (treesit--install-language-grammar-build-recipe lang)))) (condition-case err - (apply #'treesit--install-language-grammar-1 - ;; The nil is OUT-DIR. - (cons nil recipe)) + (progn + (apply #'treesit--install-language-grammar-1 + ;; The nil is OUT-DIR. + (cons nil recipe)) + + ;; Check that the installed language grammar is loadable. + (pcase-let ((`(,available . ,err) + (treesit-language-available-p lang t))) + (if (not available) + (display-warning + 'treesit + (format "The installed language grammar for %s cannot be located or has problems (%s): %s" + lang (nth 0 err) + (string-join + (mapcar (lambda (x) (format "%s" x)) + (cdr err)) + " "))) + ;; If success, Save the recipe for the current session. + (setf (alist-get lang treesit-language-source-alist) + recipe)))) (error (display-warning 'treesit (format "Error encountered when installing language grammar: %s" - err))))) - - ;; Check that the installed language grammar is loadable. - (pcase-let ((`(,available . ,err) - (treesit-language-available-p lang t))) - (when (not available) - (display-warning - 'treesit - (format "The installed language grammar for %s cannot be located or has problems (%s): %s" - lang (nth 0 err) - (string-join - (mapcar (lambda (x) (format "%s" x)) - (cdr err)) - " ")))))) + err)))))) (defun treesit--call-process-signal (&rest args) "Run `call-process' with ARGS. commit c0c7b947baf5e086a857055d18dab04ce13d1f6a Author: Robert Pluim Date: Sun May 28 16:36:44 2023 +0200 Add instructions and test file for VS-15/VS-16 * admin/notes/unicode: Add instructions for emoji-variation-sequences.txt * admin/unidata/emoji-variation-sequences.txt: New file, imported from Unicode 15. diff --git a/admin/notes/unicode b/admin/notes/unicode index 0e000365da7..31c850af8fd 100644 --- a/admin/notes/unicode +++ b/admin/notes/unicode @@ -22,6 +22,7 @@ Emacs uses the following files from the Unicode Character Database . confusables.txt . emoji-data.txt . emoji-zwj-sequences.txt + . emoji-variation-sequences.txt . emoji-sequences.txt . BidiCharacterTest.txt @@ -29,7 +30,7 @@ Emacs also uses the file emoji-test.txt which should be imported from the Unicode's Public/emoji/ directory, and IdnaMappingTable.txt from the Public/idna/ directory. -First, the first 14 files, emoji-test.txt and IdnaMappingTable.txt +First, the first 15 files, emoji-test.txt and IdnaMappingTable.txt need to be copied into admin/unidata/, and the file https://www.unicode.org/copyright.html should be copied over copyright.html in admin/unidata (some of them might need trailing @@ -142,6 +143,20 @@ generated for auto-composition-emoji-eligible-codepoints by admin/unidata/emoji-zwj.awk. Note that your emoji font might not have glyphs for the newest codepoints yet. +Visit "emoji-variation-sequences.txt", and run the following lisp +fragment to actually insert the described codepoints, then check that +all the text in parentheses displays correctly (it can be helpful to +have `glyphless-char-display-control' customized to show hex codes for +variation selectors). + +(save-excursion + (goto-char (point-min)) + (while (re-search-forward "^\\([0-9A-Z]+\\) \\([0-9A-Z]+\\).*(\\([^)]+\\))" nil t) + (let ((ch (string-to-number (match-string 1) 16)) + (sel (string-to-number (match-string 2) 16)) + (sp (match-string 3))) + (replace-match (format "%s %c%c " sp ch sel) nil nil nil 3)))) + Finally, etc/NEWS should be updated to announce the support for the new Unicode version. diff --git a/admin/unidata/emoji-variation-sequences.txt b/admin/unidata/emoji-variation-sequences.txt new file mode 100644 index 00000000000..f3396ada19d --- /dev/null +++ b/admin/unidata/emoji-variation-sequences.txt @@ -0,0 +1,723 @@ +# emoji-variation-sequences.txt +# Date: 2022-05-13, 21:54:24 GMT +# © 2022 Unicode®, Inc. +# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. +# For terms of use, see https://www.unicode.org/terms_of_use.html +# +# Emoji Variation Sequences for UTS #51 +# Used with Emoji Version 15.0 and subsequent minor revisions (if any) +# +# For documentation and usage, see https://www.unicode.org/reports/tr51 +# +0023 FE0E ; text style; # (1.1 #︎ ) NUMBER SIGN +0023 FE0F ; emoji style; # (1.1 #️ ) NUMBER SIGN +002A FE0E ; text style; # (1.1 *︎ ) ASTERISK +002A FE0F ; emoji style; # (1.1 *️ ) ASTERISK +0030 FE0E ; text style; # (1.1 0︎ ) DIGIT ZERO +0030 FE0F ; emoji style; # (1.1 0️ ) DIGIT ZERO +0031 FE0E ; text style; # (1.1 1︎ ) DIGIT ONE +0031 FE0F ; emoji style; # (1.1 1️ ) DIGIT ONE +0032 FE0E ; text style; # (1.1 2︎ ) DIGIT TWO +0032 FE0F ; emoji style; # (1.1 2️ ) DIGIT TWO +0033 FE0E ; text style; # (1.1 3︎ ) DIGIT THREE +0033 FE0F ; emoji style; # (1.1 3️ ) DIGIT THREE +0034 FE0E ; text style; # (1.1 4︎ ) DIGIT FOUR +0034 FE0F ; emoji style; # (1.1 4️ ) DIGIT FOUR +0035 FE0E ; text style; # (1.1 5︎ ) DIGIT FIVE +0035 FE0F ; emoji style; # (1.1 5️ ) DIGIT FIVE +0036 FE0E ; text style; # (1.1 6︎ ) DIGIT SIX +0036 FE0F ; emoji style; # (1.1 6️ ) DIGIT SIX +0037 FE0E ; text style; # (1.1 7︎ ) DIGIT SEVEN +0037 FE0F ; emoji style; # (1.1 7️ ) DIGIT SEVEN +0038 FE0E ; text style; # (1.1 8︎ ) DIGIT EIGHT +0038 FE0F ; emoji style; # (1.1 8️ ) DIGIT EIGHT +0039 FE0E ; text style; # (1.1 9︎ ) DIGIT NINE +0039 FE0F ; emoji style; # (1.1 9️ ) DIGIT NINE +00A9 FE0E ; text style; # (1.1 ©︎ ) COPYRIGHT SIGN +00A9 FE0F ; emoji style; # (1.1 ©️ ) COPYRIGHT SIGN +00AE FE0E ; text style; # (1.1 ®︎ ) REGISTERED SIGN +00AE FE0F ; emoji style; # (1.1 ®️ ) REGISTERED SIGN +203C FE0E ; text style; # (1.1 ‼︎ ) DOUBLE EXCLAMATION MARK +203C FE0F ; emoji style; # (1.1 ‼️ ) DOUBLE EXCLAMATION MARK +2049 FE0E ; text style; # (3.0 ⁉︎ ) EXCLAMATION QUESTION MARK +2049 FE0F ; emoji style; # (3.0 ⁉️ ) EXCLAMATION QUESTION MARK +2122 FE0E ; text style; # (1.1 ™︎ ) TRADE MARK SIGN +2122 FE0F ; emoji style; # (1.1 ™️ ) TRADE MARK SIGN +2139 FE0E ; text style; # (3.0 ℹ︎ ) INFORMATION SOURCE +2139 FE0F ; emoji style; # (3.0 ℹ️ ) INFORMATION SOURCE +2194 FE0E ; text style; # (1.1 ↔︎ ) LEFT RIGHT ARROW +2194 FE0F ; emoji style; # (1.1 ↔️ ) LEFT RIGHT ARROW +2195 FE0E ; text style; # (1.1 ↕︎ ) UP DOWN ARROW +2195 FE0F ; emoji style; # (1.1 ↕️ ) UP DOWN ARROW +2196 FE0E ; text style; # (1.1 ↖︎ ) NORTH WEST ARROW +2196 FE0F ; emoji style; # (1.1 ↖️ ) NORTH WEST ARROW +2197 FE0E ; text style; # (1.1 ↗︎ ) NORTH EAST ARROW +2197 FE0F ; emoji style; # (1.1 ↗️ ) NORTH EAST ARROW +2198 FE0E ; text style; # (1.1 ↘︎ ) SOUTH EAST ARROW +2198 FE0F ; emoji style; # (1.1 ↘️ ) SOUTH EAST ARROW +2199 FE0E ; text style; # (1.1 ↙︎ ) SOUTH WEST ARROW +2199 FE0F ; emoji style; # (1.1 ↙️ ) SOUTH WEST ARROW +21A9 FE0E ; text style; # (1.1 ↩︎ ) LEFTWARDS ARROW WITH HOOK +21A9 FE0F ; emoji style; # (1.1 ↩️ ) LEFTWARDS ARROW WITH HOOK +21AA FE0E ; text style; # (1.1 ↪︎ ) RIGHTWARDS ARROW WITH HOOK +21AA FE0F ; emoji style; # (1.1 ↪️ ) RIGHTWARDS ARROW WITH HOOK +231A FE0E ; text style; # (1.1 ⌚︎ ) WATCH +231A FE0F ; emoji style; # (1.1 ⌚️ ) WATCH +231B FE0E ; text style; # (1.1 ⌛︎ ) HOURGLASS +231B FE0F ; emoji style; # (1.1 ⌛️ ) HOURGLASS +2328 FE0E ; text style; # (1.1 ⌨︎ ) KEYBOARD +2328 FE0F ; emoji style; # (1.1 ⌨️ ) KEYBOARD +23CF FE0E ; text style; # (4.0 ⏏︎ ) EJECT SYMBOL +23CF FE0F ; emoji style; # (4.0 ⏏️ ) EJECT SYMBOL +23E9 FE0E ; text style; # (6.0 ⏩︎ ) BLACK RIGHT-POINTING DOUBLE TRIANGLE +23E9 FE0F ; emoji style; # (6.0 ⏩️ ) BLACK RIGHT-POINTING DOUBLE TRIANGLE +23EA FE0E ; text style; # (6.0 ⏪︎ ) BLACK LEFT-POINTING DOUBLE TRIANGLE +23EA FE0F ; emoji style; # (6.0 ⏪️ ) BLACK LEFT-POINTING DOUBLE TRIANGLE +23ED FE0E ; text style; # (6.0 ⏭︎ ) BLACK RIGHT-POINTING DOUBLE TRIANGLE WITH VERTICAL BAR +23ED FE0F ; emoji style; # (6.0 ⏭️ ) BLACK RIGHT-POINTING DOUBLE TRIANGLE WITH VERTICAL BAR +23EE FE0E ; text style; # (6.0 ⏮︎ ) BLACK LEFT-POINTING DOUBLE TRIANGLE WITH VERTICAL BAR +23EE FE0F ; emoji style; # (6.0 ⏮️ ) BLACK LEFT-POINTING DOUBLE TRIANGLE WITH VERTICAL BAR +23EF FE0E ; text style; # (6.0 ⏯︎ ) BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE VERTICAL BAR +23EF FE0F ; emoji style; # (6.0 ⏯️ ) BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE VERTICAL BAR +23F1 FE0E ; text style; # (6.0 ⏱︎ ) STOPWATCH +23F1 FE0F ; emoji style; # (6.0 ⏱️ ) STOPWATCH +23F2 FE0E ; text style; # (6.0 ⏲︎ ) TIMER CLOCK +23F2 FE0F ; emoji style; # (6.0 ⏲️ ) TIMER CLOCK +23F3 FE0E ; text style; # (6.0 ⏳︎ ) HOURGLASS WITH FLOWING SAND +23F3 FE0F ; emoji style; # (6.0 ⏳️ ) HOURGLASS WITH FLOWING SAND +23F8 FE0E ; text style; # (7.0 ⏸︎ ) DOUBLE VERTICAL BAR +23F8 FE0F ; emoji style; # (7.0 ⏸️ ) DOUBLE VERTICAL BAR +23F9 FE0E ; text style; # (7.0 ⏹︎ ) BLACK SQUARE FOR STOP +23F9 FE0F ; emoji style; # (7.0 ⏹️ ) BLACK SQUARE FOR STOP +23FA FE0E ; text style; # (7.0 ⏺︎ ) BLACK CIRCLE FOR RECORD +23FA FE0F ; emoji style; # (7.0 ⏺️ ) BLACK CIRCLE FOR RECORD +24C2 FE0E ; text style; # (1.1 Ⓜ︎ ) CIRCLED LATIN CAPITAL LETTER M +24C2 FE0F ; emoji style; # (1.1 Ⓜ️ ) CIRCLED LATIN CAPITAL LETTER M +25AA FE0E ; text style; # (1.1 ▪︎ ) BLACK SMALL SQUARE +25AA FE0F ; emoji style; # (1.1 ▪️ ) BLACK SMALL SQUARE +25AB FE0E ; text style; # (1.1 ▫︎ ) WHITE SMALL SQUARE +25AB FE0F ; emoji style; # (1.1 ▫️ ) WHITE SMALL SQUARE +25B6 FE0E ; text style; # (1.1 ▶︎ ) BLACK RIGHT-POINTING TRIANGLE +25B6 FE0F ; emoji style; # (1.1 ▶️ ) BLACK RIGHT-POINTING TRIANGLE +25C0 FE0E ; text style; # (1.1 ◀︎ ) BLACK LEFT-POINTING TRIANGLE +25C0 FE0F ; emoji style; # (1.1 ◀️ ) BLACK LEFT-POINTING TRIANGLE +25FB FE0E ; text style; # (3.2 ◻︎ ) WHITE MEDIUM SQUARE +25FB FE0F ; emoji style; # (3.2 ◻️ ) WHITE MEDIUM SQUARE +25FC FE0E ; text style; # (3.2 ◼︎ ) BLACK MEDIUM SQUARE +25FC FE0F ; emoji style; # (3.2 ◼️ ) BLACK MEDIUM SQUARE +25FD FE0E ; text style; # (3.2 ◽︎ ) WHITE MEDIUM SMALL SQUARE +25FD FE0F ; emoji style; # (3.2 ◽️ ) WHITE MEDIUM SMALL SQUARE +25FE FE0E ; text style; # (3.2 ◾︎ ) BLACK MEDIUM SMALL SQUARE +25FE FE0F ; emoji style; # (3.2 ◾️ ) BLACK MEDIUM SMALL SQUARE +2600 FE0E ; text style; # (1.1 ☀︎ ) BLACK SUN WITH RAYS +2600 FE0F ; emoji style; # (1.1 ☀️ ) BLACK SUN WITH RAYS +2601 FE0E ; text style; # (1.1 ☁︎ ) CLOUD +2601 FE0F ; emoji style; # (1.1 ☁️ ) CLOUD +2602 FE0E ; text style; # (1.1 ☂︎ ) UMBRELLA +2602 FE0F ; emoji style; # (1.1 ☂️ ) UMBRELLA +2603 FE0E ; text style; # (1.1 ☃︎ ) SNOWMAN +2603 FE0F ; emoji style; # (1.1 ☃️ ) SNOWMAN +2604 FE0E ; text style; # (1.1 ☄︎ ) COMET +2604 FE0F ; emoji style; # (1.1 ☄️ ) COMET +260E FE0E ; text style; # (1.1 ☎︎ ) BLACK TELEPHONE +260E FE0F ; emoji style; # (1.1 ☎️ ) BLACK TELEPHONE +2611 FE0E ; text style; # (1.1 ☑︎ ) BALLOT BOX WITH CHECK +2611 FE0F ; emoji style; # (1.1 ☑️ ) BALLOT BOX WITH CHECK +2614 FE0E ; text style; # (4.0 ☔︎ ) UMBRELLA WITH RAIN DROPS +2614 FE0F ; emoji style; # (4.0 ☔️ ) UMBRELLA WITH RAIN DROPS +2615 FE0E ; text style; # (4.0 ☕︎ ) HOT BEVERAGE +2615 FE0F ; emoji style; # (4.0 ☕️ ) HOT BEVERAGE +2618 FE0E ; text style; # (4.1 ☘︎ ) SHAMROCK +2618 FE0F ; emoji style; # (4.1 ☘️ ) SHAMROCK +261D FE0E ; text style; # (1.1 ☝︎ ) WHITE UP POINTING INDEX +261D FE0F ; emoji style; # (1.1 ☝️ ) WHITE UP POINTING INDEX +2620 FE0E ; text style; # (1.1 ☠︎ ) SKULL AND CROSSBONES +2620 FE0F ; emoji style; # (1.1 ☠️ ) SKULL AND CROSSBONES +2622 FE0E ; text style; # (1.1 ☢︎ ) RADIOACTIVE SIGN +2622 FE0F ; emoji style; # (1.1 ☢️ ) RADIOACTIVE SIGN +2623 FE0E ; text style; # (1.1 ☣︎ ) BIOHAZARD SIGN +2623 FE0F ; emoji style; # (1.1 ☣️ ) BIOHAZARD SIGN +2626 FE0E ; text style; # (1.1 ☦︎ ) ORTHODOX CROSS +2626 FE0F ; emoji style; # (1.1 ☦️ ) ORTHODOX CROSS +262A FE0E ; text style; # (1.1 ☪︎ ) STAR AND CRESCENT +262A FE0F ; emoji style; # (1.1 ☪️ ) STAR AND CRESCENT +262E FE0E ; text style; # (1.1 ☮︎ ) PEACE SYMBOL +262E FE0F ; emoji style; # (1.1 ☮️ ) PEACE SYMBOL +262F FE0E ; text style; # (1.1 ☯︎ ) YIN YANG +262F FE0F ; emoji style; # (1.1 ☯️ ) YIN YANG +2638 FE0E ; text style; # (1.1 ☸︎ ) WHEEL OF DHARMA +2638 FE0F ; emoji style; # (1.1 ☸️ ) WHEEL OF DHARMA +2639 FE0E ; text style; # (1.1 ☹︎ ) WHITE FROWNING FACE +2639 FE0F ; emoji style; # (1.1 ☹️ ) WHITE FROWNING FACE +263A FE0E ; text style; # (1.1 ☺︎ ) WHITE SMILING FACE +263A FE0F ; emoji style; # (1.1 ☺️ ) WHITE SMILING FACE +2640 FE0E ; text style; # (1.1 ♀︎ ) FEMALE SIGN +2640 FE0F ; emoji style; # (1.1 ♀️ ) FEMALE SIGN +2642 FE0E ; text style; # (1.1 ♂︎ ) MALE SIGN +2642 FE0F ; emoji style; # (1.1 ♂️ ) MALE SIGN +2648 FE0E ; text style; # (1.1 ♈︎ ) ARIES +2648 FE0F ; emoji style; # (1.1 ♈️ ) ARIES +2649 FE0E ; text style; # (1.1 ♉︎ ) TAURUS +2649 FE0F ; emoji style; # (1.1 ♉️ ) TAURUS +264A FE0E ; text style; # (1.1 ♊︎ ) GEMINI +264A FE0F ; emoji style; # (1.1 ♊️ ) GEMINI +264B FE0E ; text style; # (1.1 ♋︎ ) CANCER +264B FE0F ; emoji style; # (1.1 ♋️ ) CANCER +264C FE0E ; text style; # (1.1 ♌︎ ) LEO +264C FE0F ; emoji style; # (1.1 ♌️ ) LEO +264D FE0E ; text style; # (1.1 ♍︎ ) VIRGO +264D FE0F ; emoji style; # (1.1 ♍️ ) VIRGO +264E FE0E ; text style; # (1.1 ♎︎ ) LIBRA +264E FE0F ; emoji style; # (1.1 ♎️ ) LIBRA +264F FE0E ; text style; # (1.1 ♏︎ ) SCORPIUS +264F FE0F ; emoji style; # (1.1 ♏️ ) SCORPIUS +2650 FE0E ; text style; # (1.1 ♐︎ ) SAGITTARIUS +2650 FE0F ; emoji style; # (1.1 ♐️ ) SAGITTARIUS +2651 FE0E ; text style; # (1.1 ♑︎ ) CAPRICORN +2651 FE0F ; emoji style; # (1.1 ♑️ ) CAPRICORN +2652 FE0E ; text style; # (1.1 ♒︎ ) AQUARIUS +2652 FE0F ; emoji style; # (1.1 ♒️ ) AQUARIUS +2653 FE0E ; text style; # (1.1 ♓︎ ) PISCES +2653 FE0F ; emoji style; # (1.1 ♓️ ) PISCES +265F FE0E ; text style; # (1.1 ♟︎ ) BLACK CHESS PAWN +265F FE0F ; emoji style; # (1.1 ♟️ ) BLACK CHESS PAWN +2660 FE0E ; text style; # (1.1 ♠︎ ) BLACK SPADE SUIT +2660 FE0F ; emoji style; # (1.1 ♠️ ) BLACK SPADE SUIT +2663 FE0E ; text style; # (1.1 ♣︎ ) BLACK CLUB SUIT +2663 FE0F ; emoji style; # (1.1 ♣️ ) BLACK CLUB SUIT +2665 FE0E ; text style; # (1.1 ♥︎ ) BLACK HEART SUIT +2665 FE0F ; emoji style; # (1.1 ♥️ ) BLACK HEART SUIT +2666 FE0E ; text style; # (1.1 ♦︎ ) BLACK DIAMOND SUIT +2666 FE0F ; emoji style; # (1.1 ♦️ ) BLACK DIAMOND SUIT +2668 FE0E ; text style; # (1.1 ♨︎ ) HOT SPRINGS +2668 FE0F ; emoji style; # (1.1 ♨️ ) HOT SPRINGS +267B FE0E ; text style; # (3.2 ♻︎ ) BLACK UNIVERSAL RECYCLING SYMBOL +267B FE0F ; emoji style; # (3.2 ♻️ ) BLACK UNIVERSAL RECYCLING SYMBOL +267E FE0E ; text style; # (4.1 ♾︎ ) PERMANENT PAPER SIGN +267E FE0F ; emoji style; # (4.1 ♾️ ) PERMANENT PAPER SIGN +267F FE0E ; text style; # (4.1 ♿︎ ) WHEELCHAIR SYMBOL +267F FE0F ; emoji style; # (4.1 ♿️ ) WHEELCHAIR SYMBOL +2692 FE0E ; text style; # (4.1 ⚒︎ ) HAMMER AND PICK +2692 FE0F ; emoji style; # (4.1 ⚒️ ) HAMMER AND PICK +2693 FE0E ; text style; # (4.1 ⚓︎ ) ANCHOR +2693 FE0F ; emoji style; # (4.1 ⚓️ ) ANCHOR +2694 FE0E ; text style; # (4.1 ⚔︎ ) CROSSED SWORDS +2694 FE0F ; emoji style; # (4.1 ⚔️ ) CROSSED SWORDS +2695 FE0E ; text style; # (4.1 ⚕︎ ) STAFF OF AESCULAPIUS +2695 FE0F ; emoji style; # (4.1 ⚕️ ) STAFF OF AESCULAPIUS +2696 FE0E ; text style; # (4.1 ⚖︎ ) SCALES +2696 FE0F ; emoji style; # (4.1 ⚖️ ) SCALES +2697 FE0E ; text style; # (4.1 ⚗︎ ) ALEMBIC +2697 FE0F ; emoji style; # (4.1 ⚗️ ) ALEMBIC +2699 FE0E ; text style; # (4.1 ⚙︎ ) GEAR +2699 FE0F ; emoji style; # (4.1 ⚙️ ) GEAR +269B FE0E ; text style; # (4.1 ⚛︎ ) ATOM SYMBOL +269B FE0F ; emoji style; # (4.1 ⚛️ ) ATOM SYMBOL +269C FE0E ; text style; # (4.1 ⚜︎ ) FLEUR-DE-LIS +269C FE0F ; emoji style; # (4.1 ⚜️ ) FLEUR-DE-LIS +26A0 FE0E ; text style; # (4.0 ⚠︎ ) WARNING SIGN +26A0 FE0F ; emoji style; # (4.0 ⚠️ ) WARNING SIGN +26A1 FE0E ; text style; # (4.0 ⚡︎ ) HIGH VOLTAGE SIGN +26A1 FE0F ; emoji style; # (4.0 ⚡️ ) HIGH VOLTAGE SIGN +26A7 FE0E ; text style; # (4.1 ⚧︎ ) MALE WITH STROKE AND MALE AND FEMALE SIGN +26A7 FE0F ; emoji style; # (4.1 ⚧️ ) MALE WITH STROKE AND MALE AND FEMALE SIGN +26AA FE0E ; text style; # (4.1 ⚪︎ ) MEDIUM WHITE CIRCLE +26AA FE0F ; emoji style; # (4.1 ⚪️ ) MEDIUM WHITE CIRCLE +26AB FE0E ; text style; # (4.1 ⚫︎ ) MEDIUM BLACK CIRCLE +26AB FE0F ; emoji style; # (4.1 ⚫️ ) MEDIUM BLACK CIRCLE +26B0 FE0E ; text style; # (4.1 ⚰︎ ) COFFIN +26B0 FE0F ; emoji style; # (4.1 ⚰️ ) COFFIN +26B1 FE0E ; text style; # (4.1 ⚱︎ ) FUNERAL URN +26B1 FE0F ; emoji style; # (4.1 ⚱️ ) FUNERAL URN +26BD FE0E ; text style; # (5.2 ⚽︎ ) SOCCER BALL +26BD FE0F ; emoji style; # (5.2 ⚽️ ) SOCCER BALL +26BE FE0E ; text style; # (5.2 ⚾︎ ) BASEBALL +26BE FE0F ; emoji style; # (5.2 ⚾️ ) BASEBALL +26C4 FE0E ; text style; # (5.2 ⛄︎ ) SNOWMAN WITHOUT SNOW +26C4 FE0F ; emoji style; # (5.2 ⛄️ ) SNOWMAN WITHOUT SNOW +26C5 FE0E ; text style; # (5.2 ⛅︎ ) SUN BEHIND CLOUD +26C5 FE0F ; emoji style; # (5.2 ⛅️ ) SUN BEHIND CLOUD +26C8 FE0E ; text style; # (5.2 ⛈︎ ) THUNDER CLOUD AND RAIN +26C8 FE0F ; emoji style; # (5.2 ⛈️ ) THUNDER CLOUD AND RAIN +26CF FE0E ; text style; # (5.2 ⛏︎ ) PICK +26CF FE0F ; emoji style; # (5.2 ⛏️ ) PICK +26D1 FE0E ; text style; # (5.2 ⛑︎ ) HELMET WITH WHITE CROSS +26D1 FE0F ; emoji style; # (5.2 ⛑️ ) HELMET WITH WHITE CROSS +26D3 FE0E ; text style; # (5.2 ⛓︎ ) CHAINS +26D3 FE0F ; emoji style; # (5.2 ⛓️ ) CHAINS +26D4 FE0E ; text style; # (5.2 ⛔︎ ) NO ENTRY +26D4 FE0F ; emoji style; # (5.2 ⛔️ ) NO ENTRY +26E9 FE0E ; text style; # (5.2 ⛩︎ ) SHINTO SHRINE +26E9 FE0F ; emoji style; # (5.2 ⛩️ ) SHINTO SHRINE +26EA FE0E ; text style; # (5.2 ⛪︎ ) CHURCH +26EA FE0F ; emoji style; # (5.2 ⛪️ ) CHURCH +26F0 FE0E ; text style; # (5.2 ⛰︎ ) MOUNTAIN +26F0 FE0F ; emoji style; # (5.2 ⛰️ ) MOUNTAIN +26F1 FE0E ; text style; # (5.2 ⛱︎ ) UMBRELLA ON GROUND +26F1 FE0F ; emoji style; # (5.2 ⛱️ ) UMBRELLA ON GROUND +26F2 FE0E ; text style; # (5.2 ⛲︎ ) FOUNTAIN +26F2 FE0F ; emoji style; # (5.2 ⛲️ ) FOUNTAIN +26F3 FE0E ; text style; # (5.2 ⛳︎ ) FLAG IN HOLE +26F3 FE0F ; emoji style; # (5.2 ⛳️ ) FLAG IN HOLE +26F4 FE0E ; text style; # (5.2 ⛴︎ ) FERRY +26F4 FE0F ; emoji style; # (5.2 ⛴️ ) FERRY +26F5 FE0E ; text style; # (5.2 ⛵︎ ) SAILBOAT +26F5 FE0F ; emoji style; # (5.2 ⛵️ ) SAILBOAT +26F7 FE0E ; text style; # (5.2 ⛷︎ ) SKIER +26F7 FE0F ; emoji style; # (5.2 ⛷️ ) SKIER +26F8 FE0E ; text style; # (5.2 ⛸︎ ) ICE SKATE +26F8 FE0F ; emoji style; # (5.2 ⛸️ ) ICE SKATE +26F9 FE0E ; text style; # (5.2 ⛹︎ ) PERSON WITH BALL +26F9 FE0F ; emoji style; # (5.2 ⛹️ ) PERSON WITH BALL +26FA FE0E ; text style; # (5.2 ⛺︎ ) TENT +26FA FE0F ; emoji style; # (5.2 ⛺️ ) TENT +26FD FE0E ; text style; # (5.2 ⛽︎ ) FUEL PUMP +26FD FE0F ; emoji style; # (5.2 ⛽️ ) FUEL PUMP +2702 FE0E ; text style; # (1.1 ✂︎ ) BLACK SCISSORS +2702 FE0F ; emoji style; # (1.1 ✂️ ) BLACK SCISSORS +2708 FE0E ; text style; # (1.1 ✈︎ ) AIRPLANE +2708 FE0F ; emoji style; # (1.1 ✈️ ) AIRPLANE +2709 FE0E ; text style; # (1.1 ✉︎ ) ENVELOPE +2709 FE0F ; emoji style; # (1.1 ✉️ ) ENVELOPE +270C FE0E ; text style; # (1.1 ✌︎ ) VICTORY HAND +270C FE0F ; emoji style; # (1.1 ✌️ ) VICTORY HAND +270D FE0E ; text style; # (1.1 ✍︎ ) WRITING HAND +270D FE0F ; emoji style; # (1.1 ✍️ ) WRITING HAND +270F FE0E ; text style; # (1.1 ✏︎ ) PENCIL +270F FE0F ; emoji style; # (1.1 ✏️ ) PENCIL +2712 FE0E ; text style; # (1.1 ✒︎ ) BLACK NIB +2712 FE0F ; emoji style; # (1.1 ✒️ ) BLACK NIB +2714 FE0E ; text style; # (1.1 ✔︎ ) HEAVY CHECK MARK +2714 FE0F ; emoji style; # (1.1 ✔️ ) HEAVY CHECK MARK +2716 FE0E ; text style; # (1.1 ✖︎ ) HEAVY MULTIPLICATION X +2716 FE0F ; emoji style; # (1.1 ✖️ ) HEAVY MULTIPLICATION X +271D FE0E ; text style; # (1.1 ✝︎ ) LATIN CROSS +271D FE0F ; emoji style; # (1.1 ✝️ ) LATIN CROSS +2721 FE0E ; text style; # (1.1 ✡︎ ) STAR OF DAVID +2721 FE0F ; emoji style; # (1.1 ✡️ ) STAR OF DAVID +2733 FE0E ; text style; # (1.1 ✳︎ ) EIGHT SPOKED ASTERISK +2733 FE0F ; emoji style; # (1.1 ✳️ ) EIGHT SPOKED ASTERISK +2734 FE0E ; text style; # (1.1 ✴︎ ) EIGHT POINTED BLACK STAR +2734 FE0F ; emoji style; # (1.1 ✴️ ) EIGHT POINTED BLACK STAR +2744 FE0E ; text style; # (1.1 ❄︎ ) SNOWFLAKE +2744 FE0F ; emoji style; # (1.1 ❄️ ) SNOWFLAKE +2747 FE0E ; text style; # (1.1 ❇︎ ) SPARKLE +2747 FE0F ; emoji style; # (1.1 ❇️ ) SPARKLE +2753 FE0E ; text style; # (6.0 ❓︎ ) BLACK QUESTION MARK ORNAMENT +2753 FE0F ; emoji style; # (6.0 ❓️ ) BLACK QUESTION MARK ORNAMENT +2757 FE0E ; text style; # (5.2 ❗︎ ) HEAVY EXCLAMATION MARK SYMBOL +2757 FE0F ; emoji style; # (5.2 ❗️ ) HEAVY EXCLAMATION MARK SYMBOL +2763 FE0E ; text style; # (1.1 ❣︎ ) HEAVY HEART EXCLAMATION MARK ORNAMENT +2763 FE0F ; emoji style; # (1.1 ❣️ ) HEAVY HEART EXCLAMATION MARK ORNAMENT +2764 FE0E ; text style; # (1.1 ❤︎ ) HEAVY BLACK HEART +2764 FE0F ; emoji style; # (1.1 ❤️ ) HEAVY BLACK HEART +27A1 FE0E ; text style; # (1.1 ➡︎ ) BLACK RIGHTWARDS ARROW +27A1 FE0F ; emoji style; # (1.1 ➡️ ) BLACK RIGHTWARDS ARROW +2934 FE0E ; text style; # (3.2 ⤴︎ ) ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS +2934 FE0F ; emoji style; # (3.2 ⤴️ ) ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS +2935 FE0E ; text style; # (3.2 ⤵︎ ) ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS +2935 FE0F ; emoji style; # (3.2 ⤵️ ) ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS +2B05 FE0E ; text style; # (4.0 ⬅︎ ) LEFTWARDS BLACK ARROW +2B05 FE0F ; emoji style; # (4.0 ⬅️ ) LEFTWARDS BLACK ARROW +2B06 FE0E ; text style; # (4.0 ⬆︎ ) UPWARDS BLACK ARROW +2B06 FE0F ; emoji style; # (4.0 ⬆️ ) UPWARDS BLACK ARROW +2B07 FE0E ; text style; # (4.0 ⬇︎ ) DOWNWARDS BLACK ARROW +2B07 FE0F ; emoji style; # (4.0 ⬇️ ) DOWNWARDS BLACK ARROW +2B1B FE0E ; text style; # (5.1 ⬛︎ ) BLACK LARGE SQUARE +2B1B FE0F ; emoji style; # (5.1 ⬛️ ) BLACK LARGE SQUARE +2B1C FE0E ; text style; # (5.1 ⬜︎ ) WHITE LARGE SQUARE +2B1C FE0F ; emoji style; # (5.1 ⬜️ ) WHITE LARGE SQUARE +2B50 FE0E ; text style; # (5.1 ⭐︎ ) WHITE MEDIUM STAR +2B50 FE0F ; emoji style; # (5.1 ⭐️ ) WHITE MEDIUM STAR +2B55 FE0E ; text style; # (5.2 ⭕︎ ) HEAVY LARGE CIRCLE +2B55 FE0F ; emoji style; # (5.2 ⭕️ ) HEAVY LARGE CIRCLE +3030 FE0E ; text style; # (1.1 〰︎ ) WAVY DASH +3030 FE0F ; emoji style; # (1.1 〰️ ) WAVY DASH +303D FE0E ; text style; # (3.2 〽︎ ) PART ALTERNATION MARK +303D FE0F ; emoji style; # (3.2 〽️ ) PART ALTERNATION MARK +3297 FE0E ; text style; # (1.1 ㊗︎ ) CIRCLED IDEOGRAPH CONGRATULATION +3297 FE0F ; emoji style; # (1.1 ㊗️ ) CIRCLED IDEOGRAPH CONGRATULATION +3299 FE0E ; text style; # (1.1 ㊙︎ ) CIRCLED IDEOGRAPH SECRET +3299 FE0F ; emoji style; # (1.1 ㊙️ ) CIRCLED IDEOGRAPH SECRET +1F004 FE0E ; text style; # (5.1 🀄︎ ) MAHJONG TILE RED DRAGON +1F004 FE0F ; emoji style; # (5.1 🀄️ ) MAHJONG TILE RED DRAGON +1F170 FE0E ; text style; # (6.0 🅰︎ ) NEGATIVE SQUARED LATIN CAPITAL LETTER A +1F170 FE0F ; emoji style; # (6.0 🅰️ ) NEGATIVE SQUARED LATIN CAPITAL LETTER A +1F171 FE0E ; text style; # (6.0 🅱︎ ) NEGATIVE SQUARED LATIN CAPITAL LETTER B +1F171 FE0F ; emoji style; # (6.0 🅱️ ) NEGATIVE SQUARED LATIN CAPITAL LETTER B +1F17E FE0E ; text style; # (6.0 🅾︎ ) NEGATIVE SQUARED LATIN CAPITAL LETTER O +1F17E FE0F ; emoji style; # (6.0 🅾️ ) NEGATIVE SQUARED LATIN CAPITAL LETTER O +1F17F FE0E ; text style; # (5.2 🅿︎ ) NEGATIVE SQUARED LATIN CAPITAL LETTER P +1F17F FE0F ; emoji style; # (5.2 🅿️ ) NEGATIVE SQUARED LATIN CAPITAL LETTER P +1F202 FE0E ; text style; # (6.0 🈂︎ ) SQUARED KATAKANA SA +1F202 FE0F ; emoji style; # (6.0 🈂️ ) SQUARED KATAKANA SA +1F21A FE0E ; text style; # (5.2 🈚︎ ) SQUARED CJK UNIFIED IDEOGRAPH-7121 +1F21A FE0F ; emoji style; # (5.2 🈚️ ) SQUARED CJK UNIFIED IDEOGRAPH-7121 +1F22F FE0E ; text style; # (5.2 🈯︎ ) SQUARED CJK UNIFIED IDEOGRAPH-6307 +1F22F FE0F ; emoji style; # (5.2 🈯️ ) SQUARED CJK UNIFIED IDEOGRAPH-6307 +1F237 FE0E ; text style; # (6.0 🈷︎ ) SQUARED CJK UNIFIED IDEOGRAPH-6708 +1F237 FE0F ; emoji style; # (6.0 🈷️ ) SQUARED CJK UNIFIED IDEOGRAPH-6708 +1F30D FE0E ; text style; # (6.0 🌍︎ ) EARTH GLOBE EUROPE-AFRICA +1F30D FE0F ; emoji style; # (6.0 🌍️ ) EARTH GLOBE EUROPE-AFRICA +1F30E FE0E ; text style; # (6.0 🌎︎ ) EARTH GLOBE AMERICAS +1F30E FE0F ; emoji style; # (6.0 🌎️ ) EARTH GLOBE AMERICAS +1F30F FE0E ; text style; # (6.0 🌏︎ ) EARTH GLOBE ASIA-AUSTRALIA +1F30F FE0F ; emoji style; # (6.0 🌏️ ) EARTH GLOBE ASIA-AUSTRALIA +1F315 FE0E ; text style; # (6.0 🌕︎ ) FULL MOON SYMBOL +1F315 FE0F ; emoji style; # (6.0 🌕️ ) FULL MOON SYMBOL +1F31C FE0E ; text style; # (6.0 🌜︎ ) LAST QUARTER MOON WITH FACE +1F31C FE0F ; emoji style; # (6.0 🌜️ ) LAST QUARTER MOON WITH FACE +1F321 FE0E ; text style; # (7.0 🌡︎ ) THERMOMETER +1F321 FE0F ; emoji style; # (7.0 🌡️ ) THERMOMETER +1F324 FE0E ; text style; # (7.0 🌤︎ ) WHITE SUN WITH SMALL CLOUD +1F324 FE0F ; emoji style; # (7.0 🌤️ ) WHITE SUN WITH SMALL CLOUD +1F325 FE0E ; text style; # (7.0 🌥︎ ) WHITE SUN BEHIND CLOUD +1F325 FE0F ; emoji style; # (7.0 🌥️ ) WHITE SUN BEHIND CLOUD +1F326 FE0E ; text style; # (7.0 🌦︎ ) WHITE SUN BEHIND CLOUD WITH RAIN +1F326 FE0F ; emoji style; # (7.0 🌦️ ) WHITE SUN BEHIND CLOUD WITH RAIN +1F327 FE0E ; text style; # (7.0 🌧︎ ) CLOUD WITH RAIN +1F327 FE0F ; emoji style; # (7.0 🌧️ ) CLOUD WITH RAIN +1F328 FE0E ; text style; # (7.0 🌨︎ ) CLOUD WITH SNOW +1F328 FE0F ; emoji style; # (7.0 🌨️ ) CLOUD WITH SNOW +1F329 FE0E ; text style; # (7.0 🌩︎ ) CLOUD WITH LIGHTNING +1F329 FE0F ; emoji style; # (7.0 🌩️ ) CLOUD WITH LIGHTNING +1F32A FE0E ; text style; # (7.0 🌪︎ ) CLOUD WITH TORNADO +1F32A FE0F ; emoji style; # (7.0 🌪️ ) CLOUD WITH TORNADO +1F32B FE0E ; text style; # (7.0 🌫︎ ) FOG +1F32B FE0F ; emoji style; # (7.0 🌫️ ) FOG +1F32C FE0E ; text style; # (7.0 🌬︎ ) WIND BLOWING FACE +1F32C FE0F ; emoji style; # (7.0 🌬️ ) WIND BLOWING FACE +1F336 FE0E ; text style; # (7.0 🌶︎ ) HOT PEPPER +1F336 FE0F ; emoji style; # (7.0 🌶️ ) HOT PEPPER +1F378 FE0E ; text style; # (6.0 🍸︎ ) COCKTAIL GLASS +1F378 FE0F ; emoji style; # (6.0 🍸️ ) COCKTAIL GLASS +1F37D FE0E ; text style; # (7.0 🍽︎ ) FORK AND KNIFE WITH PLATE +1F37D FE0F ; emoji style; # (7.0 🍽️ ) FORK AND KNIFE WITH PLATE +1F393 FE0E ; text style; # (6.0 🎓︎ ) GRADUATION CAP +1F393 FE0F ; emoji style; # (6.0 🎓️ ) GRADUATION CAP +1F396 FE0E ; text style; # (7.0 🎖︎ ) MILITARY MEDAL +1F396 FE0F ; emoji style; # (7.0 🎖️ ) MILITARY MEDAL +1F397 FE0E ; text style; # (7.0 🎗︎ ) REMINDER RIBBON +1F397 FE0F ; emoji style; # (7.0 🎗️ ) REMINDER RIBBON +1F399 FE0E ; text style; # (7.0 🎙︎ ) STUDIO MICROPHONE +1F399 FE0F ; emoji style; # (7.0 🎙️ ) STUDIO MICROPHONE +1F39A FE0E ; text style; # (7.0 🎚︎ ) LEVEL SLIDER +1F39A FE0F ; emoji style; # (7.0 🎚️ ) LEVEL SLIDER +1F39B FE0E ; text style; # (7.0 🎛︎ ) CONTROL KNOBS +1F39B FE0F ; emoji style; # (7.0 🎛️ ) CONTROL KNOBS +1F39E FE0E ; text style; # (7.0 🎞︎ ) FILM FRAMES +1F39E FE0F ; emoji style; # (7.0 🎞️ ) FILM FRAMES +1F39F FE0E ; text style; # (7.0 🎟︎ ) ADMISSION TICKETS +1F39F FE0F ; emoji style; # (7.0 🎟️ ) ADMISSION TICKETS +1F3A7 FE0E ; text style; # (6.0 🎧︎ ) HEADPHONE +1F3A7 FE0F ; emoji style; # (6.0 🎧️ ) HEADPHONE +1F3AC FE0E ; text style; # (6.0 🎬︎ ) CLAPPER BOARD +1F3AC FE0F ; emoji style; # (6.0 🎬️ ) CLAPPER BOARD +1F3AD FE0E ; text style; # (6.0 🎭︎ ) PERFORMING ARTS +1F3AD FE0F ; emoji style; # (6.0 🎭️ ) PERFORMING ARTS +1F3AE FE0E ; text style; # (6.0 🎮︎ ) VIDEO GAME +1F3AE FE0F ; emoji style; # (6.0 🎮️ ) VIDEO GAME +1F3C2 FE0E ; text style; # (6.0 🏂︎ ) SNOWBOARDER +1F3C2 FE0F ; emoji style; # (6.0 🏂️ ) SNOWBOARDER +1F3C4 FE0E ; text style; # (6.0 🏄︎ ) SURFER +1F3C4 FE0F ; emoji style; # (6.0 🏄️ ) SURFER +1F3C6 FE0E ; text style; # (6.0 🏆︎ ) TROPHY +1F3C6 FE0F ; emoji style; # (6.0 🏆️ ) TROPHY +1F3CA FE0E ; text style; # (6.0 🏊︎ ) SWIMMER +1F3CA FE0F ; emoji style; # (6.0 🏊️ ) SWIMMER +1F3CB FE0E ; text style; # (7.0 🏋︎ ) WEIGHT LIFTER +1F3CB FE0F ; emoji style; # (7.0 🏋️ ) WEIGHT LIFTER +1F3CC FE0E ; text style; # (7.0 🏌︎ ) GOLFER +1F3CC FE0F ; emoji style; # (7.0 🏌️ ) GOLFER +1F3CD FE0E ; text style; # (7.0 🏍︎ ) RACING MOTORCYCLE +1F3CD FE0F ; emoji style; # (7.0 🏍️ ) RACING MOTORCYCLE +1F3CE FE0E ; text style; # (7.0 🏎︎ ) RACING CAR +1F3CE FE0F ; emoji style; # (7.0 🏎️ ) RACING CAR +1F3D4 FE0E ; text style; # (7.0 🏔︎ ) SNOW CAPPED MOUNTAIN +1F3D4 FE0F ; emoji style; # (7.0 🏔️ ) SNOW CAPPED MOUNTAIN +1F3D5 FE0E ; text style; # (7.0 🏕︎ ) CAMPING +1F3D5 FE0F ; emoji style; # (7.0 🏕️ ) CAMPING +1F3D6 FE0E ; text style; # (7.0 🏖︎ ) BEACH WITH UMBRELLA +1F3D6 FE0F ; emoji style; # (7.0 🏖️ ) BEACH WITH UMBRELLA +1F3D7 FE0E ; text style; # (7.0 🏗︎ ) BUILDING CONSTRUCTION +1F3D7 FE0F ; emoji style; # (7.0 🏗️ ) BUILDING CONSTRUCTION +1F3D8 FE0E ; text style; # (7.0 🏘︎ ) HOUSE BUILDINGS +1F3D8 FE0F ; emoji style; # (7.0 🏘️ ) HOUSE BUILDINGS +1F3D9 FE0E ; text style; # (7.0 🏙︎ ) CITYSCAPE +1F3D9 FE0F ; emoji style; # (7.0 🏙️ ) CITYSCAPE +1F3DA FE0E ; text style; # (7.0 🏚︎ ) DERELICT HOUSE BUILDING +1F3DA FE0F ; emoji style; # (7.0 🏚️ ) DERELICT HOUSE BUILDING +1F3DB FE0E ; text style; # (7.0 🏛︎ ) CLASSICAL BUILDING +1F3DB FE0F ; emoji style; # (7.0 🏛️ ) CLASSICAL BUILDING +1F3DC FE0E ; text style; # (7.0 🏜︎ ) DESERT +1F3DC FE0F ; emoji style; # (7.0 🏜️ ) DESERT +1F3DD FE0E ; text style; # (7.0 🏝︎ ) DESERT ISLAND +1F3DD FE0F ; emoji style; # (7.0 🏝️ ) DESERT ISLAND +1F3DE FE0E ; text style; # (7.0 🏞︎ ) NATIONAL PARK +1F3DE FE0F ; emoji style; # (7.0 🏞️ ) NATIONAL PARK +1F3DF FE0E ; text style; # (7.0 🏟︎ ) STADIUM +1F3DF FE0F ; emoji style; # (7.0 🏟️ ) STADIUM +1F3E0 FE0E ; text style; # (6.0 🏠︎ ) HOUSE BUILDING +1F3E0 FE0F ; emoji style; # (6.0 🏠️ ) HOUSE BUILDING +1F3ED FE0E ; text style; # (6.0 🏭︎ ) FACTORY +1F3ED FE0F ; emoji style; # (6.0 🏭️ ) FACTORY +1F3F3 FE0E ; text style; # (7.0 🏳︎ ) WAVING WHITE FLAG +1F3F3 FE0F ; emoji style; # (7.0 🏳️ ) WAVING WHITE FLAG +1F3F5 FE0E ; text style; # (7.0 🏵︎ ) ROSETTE +1F3F5 FE0F ; emoji style; # (7.0 🏵️ ) ROSETTE +1F3F7 FE0E ; text style; # (7.0 🏷︎ ) LABEL +1F3F7 FE0F ; emoji style; # (7.0 🏷️ ) LABEL +1F408 FE0E ; text style; # (6.0 🐈︎ ) CAT +1F408 FE0F ; emoji style; # (6.0 🐈️ ) CAT +1F415 FE0E ; text style; # (6.0 🐕︎ ) DOG +1F415 FE0F ; emoji style; # (6.0 🐕️ ) DOG +1F41F FE0E ; text style; # (6.0 🐟︎ ) FISH +1F41F FE0F ; emoji style; # (6.0 🐟️ ) FISH +1F426 FE0E ; text style; # (6.0 🐦︎ ) BIRD +1F426 FE0F ; emoji style; # (6.0 🐦️ ) BIRD +1F43F FE0E ; text style; # (7.0 🐿︎ ) CHIPMUNK +1F43F FE0F ; emoji style; # (7.0 🐿️ ) CHIPMUNK +1F441 FE0E ; text style; # (7.0 👁︎ ) EYE +1F441 FE0F ; emoji style; # (7.0 👁️ ) EYE +1F442 FE0E ; text style; # (6.0 👂︎ ) EAR +1F442 FE0F ; emoji style; # (6.0 👂️ ) EAR +1F446 FE0E ; text style; # (6.0 👆︎ ) WHITE UP POINTING BACKHAND INDEX +1F446 FE0F ; emoji style; # (6.0 👆️ ) WHITE UP POINTING BACKHAND INDEX +1F447 FE0E ; text style; # (6.0 👇︎ ) WHITE DOWN POINTING BACKHAND INDEX +1F447 FE0F ; emoji style; # (6.0 👇️ ) WHITE DOWN POINTING BACKHAND INDEX +1F448 FE0E ; text style; # (6.0 👈︎ ) WHITE LEFT POINTING BACKHAND INDEX +1F448 FE0F ; emoji style; # (6.0 👈️ ) WHITE LEFT POINTING BACKHAND INDEX +1F449 FE0E ; text style; # (6.0 👉︎ ) WHITE RIGHT POINTING BACKHAND INDEX +1F449 FE0F ; emoji style; # (6.0 👉️ ) WHITE RIGHT POINTING BACKHAND INDEX +1F44D FE0E ; text style; # (6.0 👍︎ ) THUMBS UP SIGN +1F44D FE0F ; emoji style; # (6.0 👍️ ) THUMBS UP SIGN +1F44E FE0E ; text style; # (6.0 👎︎ ) THUMBS DOWN SIGN +1F44E FE0F ; emoji style; # (6.0 👎️ ) THUMBS DOWN SIGN +1F453 FE0E ; text style; # (6.0 👓︎ ) EYEGLASSES +1F453 FE0F ; emoji style; # (6.0 👓️ ) EYEGLASSES +1F46A FE0E ; text style; # (6.0 👪︎ ) FAMILY +1F46A FE0F ; emoji style; # (6.0 👪️ ) FAMILY +1F47D FE0E ; text style; # (6.0 👽︎ ) EXTRATERRESTRIAL ALIEN +1F47D FE0F ; emoji style; # (6.0 👽️ ) EXTRATERRESTRIAL ALIEN +1F4A3 FE0E ; text style; # (6.0 💣︎ ) BOMB +1F4A3 FE0F ; emoji style; # (6.0 💣️ ) BOMB +1F4B0 FE0E ; text style; # (6.0 💰︎ ) MONEY BAG +1F4B0 FE0F ; emoji style; # (6.0 💰️ ) MONEY BAG +1F4B3 FE0E ; text style; # (6.0 💳︎ ) CREDIT CARD +1F4B3 FE0F ; emoji style; # (6.0 💳️ ) CREDIT CARD +1F4BB FE0E ; text style; # (6.0 💻︎ ) PERSONAL COMPUTER +1F4BB FE0F ; emoji style; # (6.0 💻️ ) PERSONAL COMPUTER +1F4BF FE0E ; text style; # (6.0 💿︎ ) OPTICAL DISC +1F4BF FE0F ; emoji style; # (6.0 💿️ ) OPTICAL DISC +1F4CB FE0E ; text style; # (6.0 📋︎ ) CLIPBOARD +1F4CB FE0F ; emoji style; # (6.0 📋️ ) CLIPBOARD +1F4DA FE0E ; text style; # (6.0 📚︎ ) BOOKS +1F4DA FE0F ; emoji style; # (6.0 📚️ ) BOOKS +1F4DF FE0E ; text style; # (6.0 📟︎ ) PAGER +1F4DF FE0F ; emoji style; # (6.0 📟️ ) PAGER +1F4E4 FE0E ; text style; # (6.0 📤︎ ) OUTBOX TRAY +1F4E4 FE0F ; emoji style; # (6.0 📤️ ) OUTBOX TRAY +1F4E5 FE0E ; text style; # (6.0 📥︎ ) INBOX TRAY +1F4E5 FE0F ; emoji style; # (6.0 📥️ ) INBOX TRAY +1F4E6 FE0E ; text style; # (6.0 📦︎ ) PACKAGE +1F4E6 FE0F ; emoji style; # (6.0 📦️ ) PACKAGE +1F4EA FE0E ; text style; # (6.0 📪︎ ) CLOSED MAILBOX WITH LOWERED FLAG +1F4EA FE0F ; emoji style; # (6.0 📪️ ) CLOSED MAILBOX WITH LOWERED FLAG +1F4EB FE0E ; text style; # (6.0 📫︎ ) CLOSED MAILBOX WITH RAISED FLAG +1F4EB FE0F ; emoji style; # (6.0 📫️ ) CLOSED MAILBOX WITH RAISED FLAG +1F4EC FE0E ; text style; # (6.0 📬︎ ) OPEN MAILBOX WITH RAISED FLAG +1F4EC FE0F ; emoji style; # (6.0 📬️ ) OPEN MAILBOX WITH RAISED FLAG +1F4ED FE0E ; text style; # (6.0 📭︎ ) OPEN MAILBOX WITH LOWERED FLAG +1F4ED FE0F ; emoji style; # (6.0 📭️ ) OPEN MAILBOX WITH LOWERED FLAG +1F4F7 FE0E ; text style; # (6.0 📷︎ ) CAMERA +1F4F7 FE0F ; emoji style; # (6.0 📷️ ) CAMERA +1F4F9 FE0E ; text style; # (6.0 📹︎ ) VIDEO CAMERA +1F4F9 FE0F ; emoji style; # (6.0 📹️ ) VIDEO CAMERA +1F4FA FE0E ; text style; # (6.0 📺︎ ) TELEVISION +1F4FA FE0F ; emoji style; # (6.0 📺️ ) TELEVISION +1F4FB FE0E ; text style; # (6.0 📻︎ ) RADIO +1F4FB FE0F ; emoji style; # (6.0 📻️ ) RADIO +1F4FD FE0E ; text style; # (7.0 📽︎ ) FILM PROJECTOR +1F4FD FE0F ; emoji style; # (7.0 📽️ ) FILM PROJECTOR +1F508 FE0E ; text style; # (6.0 🔈︎ ) SPEAKER +1F508 FE0F ; emoji style; # (6.0 🔈️ ) SPEAKER +1F50D FE0E ; text style; # (6.0 🔍︎ ) LEFT-POINTING MAGNIFYING GLASS +1F50D FE0F ; emoji style; # (6.0 🔍️ ) LEFT-POINTING MAGNIFYING GLASS +1F512 FE0E ; text style; # (6.0 🔒︎ ) LOCK +1F512 FE0F ; emoji style; # (6.0 🔒️ ) LOCK +1F513 FE0E ; text style; # (6.0 🔓︎ ) OPEN LOCK +1F513 FE0F ; emoji style; # (6.0 🔓️ ) OPEN LOCK +1F549 FE0E ; text style; # (7.0 🕉︎ ) OM SYMBOL +1F549 FE0F ; emoji style; # (7.0 🕉️ ) OM SYMBOL +1F54A FE0E ; text style; # (7.0 🕊︎ ) DOVE OF PEACE +1F54A FE0F ; emoji style; # (7.0 🕊️ ) DOVE OF PEACE +1F550 FE0E ; text style; # (6.0 🕐︎ ) CLOCK FACE ONE OCLOCK +1F550 FE0F ; emoji style; # (6.0 🕐️ ) CLOCK FACE ONE OCLOCK +1F551 FE0E ; text style; # (6.0 🕑︎ ) CLOCK FACE TWO OCLOCK +1F551 FE0F ; emoji style; # (6.0 🕑️ ) CLOCK FACE TWO OCLOCK +1F552 FE0E ; text style; # (6.0 🕒︎ ) CLOCK FACE THREE OCLOCK +1F552 FE0F ; emoji style; # (6.0 🕒️ ) CLOCK FACE THREE OCLOCK +1F553 FE0E ; text style; # (6.0 🕓︎ ) CLOCK FACE FOUR OCLOCK +1F553 FE0F ; emoji style; # (6.0 🕓️ ) CLOCK FACE FOUR OCLOCK +1F554 FE0E ; text style; # (6.0 🕔︎ ) CLOCK FACE FIVE OCLOCK +1F554 FE0F ; emoji style; # (6.0 🕔️ ) CLOCK FACE FIVE OCLOCK +1F555 FE0E ; text style; # (6.0 🕕︎ ) CLOCK FACE SIX OCLOCK +1F555 FE0F ; emoji style; # (6.0 🕕️ ) CLOCK FACE SIX OCLOCK +1F556 FE0E ; text style; # (6.0 🕖︎ ) CLOCK FACE SEVEN OCLOCK +1F556 FE0F ; emoji style; # (6.0 🕖️ ) CLOCK FACE SEVEN OCLOCK +1F557 FE0E ; text style; # (6.0 🕗︎ ) CLOCK FACE EIGHT OCLOCK +1F557 FE0F ; emoji style; # (6.0 🕗️ ) CLOCK FACE EIGHT OCLOCK +1F558 FE0E ; text style; # (6.0 🕘︎ ) CLOCK FACE NINE OCLOCK +1F558 FE0F ; emoji style; # (6.0 🕘️ ) CLOCK FACE NINE OCLOCK +1F559 FE0E ; text style; # (6.0 🕙︎ ) CLOCK FACE TEN OCLOCK +1F559 FE0F ; emoji style; # (6.0 🕙️ ) CLOCK FACE TEN OCLOCK +1F55A FE0E ; text style; # (6.0 🕚︎ ) CLOCK FACE ELEVEN OCLOCK +1F55A FE0F ; emoji style; # (6.0 🕚️ ) CLOCK FACE ELEVEN OCLOCK +1F55B FE0E ; text style; # (6.0 🕛︎ ) CLOCK FACE TWELVE OCLOCK +1F55B FE0F ; emoji style; # (6.0 🕛️ ) CLOCK FACE TWELVE OCLOCK +1F55C FE0E ; text style; # (6.0 🕜︎ ) CLOCK FACE ONE-THIRTY +1F55C FE0F ; emoji style; # (6.0 🕜️ ) CLOCK FACE ONE-THIRTY +1F55D FE0E ; text style; # (6.0 🕝︎ ) CLOCK FACE TWO-THIRTY +1F55D FE0F ; emoji style; # (6.0 🕝️ ) CLOCK FACE TWO-THIRTY +1F55E FE0E ; text style; # (6.0 🕞︎ ) CLOCK FACE THREE-THIRTY +1F55E FE0F ; emoji style; # (6.0 🕞️ ) CLOCK FACE THREE-THIRTY +1F55F FE0E ; text style; # (6.0 🕟︎ ) CLOCK FACE FOUR-THIRTY +1F55F FE0F ; emoji style; # (6.0 🕟️ ) CLOCK FACE FOUR-THIRTY +1F560 FE0E ; text style; # (6.0 🕠︎ ) CLOCK FACE FIVE-THIRTY +1F560 FE0F ; emoji style; # (6.0 🕠️ ) CLOCK FACE FIVE-THIRTY +1F561 FE0E ; text style; # (6.0 🕡︎ ) CLOCK FACE SIX-THIRTY +1F561 FE0F ; emoji style; # (6.0 🕡️ ) CLOCK FACE SIX-THIRTY +1F562 FE0E ; text style; # (6.0 🕢︎ ) CLOCK FACE SEVEN-THIRTY +1F562 FE0F ; emoji style; # (6.0 🕢️ ) CLOCK FACE SEVEN-THIRTY +1F563 FE0E ; text style; # (6.0 🕣︎ ) CLOCK FACE EIGHT-THIRTY +1F563 FE0F ; emoji style; # (6.0 🕣️ ) CLOCK FACE EIGHT-THIRTY +1F564 FE0E ; text style; # (6.0 🕤︎ ) CLOCK FACE NINE-THIRTY +1F564 FE0F ; emoji style; # (6.0 🕤️ ) CLOCK FACE NINE-THIRTY +1F565 FE0E ; text style; # (6.0 🕥︎ ) CLOCK FACE TEN-THIRTY +1F565 FE0F ; emoji style; # (6.0 🕥️ ) CLOCK FACE TEN-THIRTY +1F566 FE0E ; text style; # (6.0 🕦︎ ) CLOCK FACE ELEVEN-THIRTY +1F566 FE0F ; emoji style; # (6.0 🕦️ ) CLOCK FACE ELEVEN-THIRTY +1F567 FE0E ; text style; # (6.0 🕧︎ ) CLOCK FACE TWELVE-THIRTY +1F567 FE0F ; emoji style; # (6.0 🕧️ ) CLOCK FACE TWELVE-THIRTY +1F56F FE0E ; text style; # (7.0 🕯︎ ) CANDLE +1F56F FE0F ; emoji style; # (7.0 🕯️ ) CANDLE +1F570 FE0E ; text style; # (7.0 🕰︎ ) MANTELPIECE CLOCK +1F570 FE0F ; emoji style; # (7.0 🕰️ ) MANTELPIECE CLOCK +1F573 FE0E ; text style; # (7.0 🕳︎ ) HOLE +1F573 FE0F ; emoji style; # (7.0 🕳️ ) HOLE +1F574 FE0E ; text style; # (7.0 🕴︎ ) MAN IN BUSINESS SUIT LEVITATING +1F574 FE0F ; emoji style; # (7.0 🕴️ ) MAN IN BUSINESS SUIT LEVITATING +1F575 FE0E ; text style; # (7.0 🕵︎ ) SLEUTH OR SPY +1F575 FE0F ; emoji style; # (7.0 🕵️ ) SLEUTH OR SPY +1F576 FE0E ; text style; # (7.0 🕶︎ ) DARK SUNGLASSES +1F576 FE0F ; emoji style; # (7.0 🕶️ ) DARK SUNGLASSES +1F577 FE0E ; text style; # (7.0 🕷︎ ) SPIDER +1F577 FE0F ; emoji style; # (7.0 🕷️ ) SPIDER +1F578 FE0E ; text style; # (7.0 🕸︎ ) SPIDER WEB +1F578 FE0F ; emoji style; # (7.0 🕸️ ) SPIDER WEB +1F579 FE0E ; text style; # (7.0 🕹︎ ) JOYSTICK +1F579 FE0F ; emoji style; # (7.0 🕹️ ) JOYSTICK +1F587 FE0E ; text style; # (7.0 🖇︎ ) LINKED PAPERCLIPS +1F587 FE0F ; emoji style; # (7.0 🖇️ ) LINKED PAPERCLIPS +1F58A FE0E ; text style; # (7.0 🖊︎ ) LOWER LEFT BALLPOINT PEN +1F58A FE0F ; emoji style; # (7.0 🖊️ ) LOWER LEFT BALLPOINT PEN +1F58B FE0E ; text style; # (7.0 🖋︎ ) LOWER LEFT FOUNTAIN PEN +1F58B FE0F ; emoji style; # (7.0 🖋️ ) LOWER LEFT FOUNTAIN PEN +1F58C FE0E ; text style; # (7.0 🖌︎ ) LOWER LEFT PAINTBRUSH +1F58C FE0F ; emoji style; # (7.0 🖌️ ) LOWER LEFT PAINTBRUSH +1F58D FE0E ; text style; # (7.0 🖍︎ ) LOWER LEFT CRAYON +1F58D FE0F ; emoji style; # (7.0 🖍️ ) LOWER LEFT CRAYON +1F590 FE0E ; text style; # (7.0 🖐︎ ) RAISED HAND WITH FINGERS SPLAYED +1F590 FE0F ; emoji style; # (7.0 🖐️ ) RAISED HAND WITH FINGERS SPLAYED +1F5A5 FE0E ; text style; # (7.0 🖥︎ ) DESKTOP COMPUTER +1F5A5 FE0F ; emoji style; # (7.0 🖥️ ) DESKTOP COMPUTER +1F5A8 FE0E ; text style; # (7.0 🖨︎ ) PRINTER +1F5A8 FE0F ; emoji style; # (7.0 🖨️ ) PRINTER +1F5B1 FE0E ; text style; # (7.0 🖱︎ ) THREE BUTTON MOUSE +1F5B1 FE0F ; emoji style; # (7.0 🖱️ ) THREE BUTTON MOUSE +1F5B2 FE0E ; text style; # (7.0 🖲︎ ) TRACKBALL +1F5B2 FE0F ; emoji style; # (7.0 🖲️ ) TRACKBALL +1F5BC FE0E ; text style; # (7.0 🖼︎ ) FRAME WITH PICTURE +1F5BC FE0F ; emoji style; # (7.0 🖼️ ) FRAME WITH PICTURE +1F5C2 FE0E ; text style; # (7.0 🗂︎ ) CARD INDEX DIVIDERS +1F5C2 FE0F ; emoji style; # (7.0 🗂️ ) CARD INDEX DIVIDERS +1F5C3 FE0E ; text style; # (7.0 🗃︎ ) CARD FILE BOX +1F5C3 FE0F ; emoji style; # (7.0 🗃️ ) CARD FILE BOX +1F5C4 FE0E ; text style; # (7.0 🗄︎ ) FILE CABINET +1F5C4 FE0F ; emoji style; # (7.0 🗄️ ) FILE CABINET +1F5D1 FE0E ; text style; # (7.0 🗑︎ ) WASTEBASKET +1F5D1 FE0F ; emoji style; # (7.0 🗑️ ) WASTEBASKET +1F5D2 FE0E ; text style; # (7.0 🗒︎ ) SPIRAL NOTE PAD +1F5D2 FE0F ; emoji style; # (7.0 🗒️ ) SPIRAL NOTE PAD +1F5D3 FE0E ; text style; # (7.0 🗓︎ ) SPIRAL CALENDAR PAD +1F5D3 FE0F ; emoji style; # (7.0 🗓️ ) SPIRAL CALENDAR PAD +1F5DC FE0E ; text style; # (7.0 🗜︎ ) COMPRESSION +1F5DC FE0F ; emoji style; # (7.0 🗜️ ) COMPRESSION +1F5DD FE0E ; text style; # (7.0 🗝︎ ) OLD KEY +1F5DD FE0F ; emoji style; # (7.0 🗝️ ) OLD KEY +1F5DE FE0E ; text style; # (7.0 🗞︎ ) ROLLED-UP NEWSPAPER +1F5DE FE0F ; emoji style; # (7.0 🗞️ ) ROLLED-UP NEWSPAPER +1F5E1 FE0E ; text style; # (7.0 🗡︎ ) DAGGER KNIFE +1F5E1 FE0F ; emoji style; # (7.0 🗡️ ) DAGGER KNIFE +1F5E3 FE0E ; text style; # (7.0 🗣︎ ) SPEAKING HEAD IN SILHOUETTE +1F5E3 FE0F ; emoji style; # (7.0 🗣️ ) SPEAKING HEAD IN SILHOUETTE +1F5E8 FE0E ; text style; # (7.0 🗨︎ ) LEFT SPEECH BUBBLE +1F5E8 FE0F ; emoji style; # (7.0 🗨️ ) LEFT SPEECH BUBBLE +1F5EF FE0E ; text style; # (7.0 🗯︎ ) RIGHT ANGER BUBBLE +1F5EF FE0F ; emoji style; # (7.0 🗯️ ) RIGHT ANGER BUBBLE +1F5F3 FE0E ; text style; # (7.0 🗳︎ ) BALLOT BOX WITH BALLOT +1F5F3 FE0F ; emoji style; # (7.0 🗳️ ) BALLOT BOX WITH BALLOT +1F5FA FE0E ; text style; # (7.0 🗺︎ ) WORLD MAP +1F5FA FE0F ; emoji style; # (7.0 🗺️ ) WORLD MAP +1F610 FE0E ; text style; # (6.0 😐︎ ) NEUTRAL FACE +1F610 FE0F ; emoji style; # (6.0 😐️ ) NEUTRAL FACE +1F687 FE0E ; text style; # (6.0 🚇︎ ) METRO +1F687 FE0F ; emoji style; # (6.0 🚇️ ) METRO +1F68D FE0E ; text style; # (6.0 🚍︎ ) ONCOMING BUS +1F68D FE0F ; emoji style; # (6.0 🚍️ ) ONCOMING BUS +1F691 FE0E ; text style; # (6.0 🚑︎ ) AMBULANCE +1F691 FE0F ; emoji style; # (6.0 🚑️ ) AMBULANCE +1F694 FE0E ; text style; # (6.0 🚔︎ ) ONCOMING POLICE CAR +1F694 FE0F ; emoji style; # (6.0 🚔️ ) ONCOMING POLICE CAR +1F698 FE0E ; text style; # (6.0 🚘︎ ) ONCOMING AUTOMOBILE +1F698 FE0F ; emoji style; # (6.0 🚘️ ) ONCOMING AUTOMOBILE +1F6AD FE0E ; text style; # (6.0 🚭︎ ) NO SMOKING SYMBOL +1F6AD FE0F ; emoji style; # (6.0 🚭️ ) NO SMOKING SYMBOL +1F6B2 FE0E ; text style; # (6.0 🚲︎ ) BICYCLE +1F6B2 FE0F ; emoji style; # (6.0 🚲️ ) BICYCLE +1F6B9 FE0E ; text style; # (6.0 🚹︎ ) MENS SYMBOL +1F6B9 FE0F ; emoji style; # (6.0 🚹️ ) MENS SYMBOL +1F6BA FE0E ; text style; # (6.0 🚺︎ ) WOMENS SYMBOL +1F6BA FE0F ; emoji style; # (6.0 🚺️ ) WOMENS SYMBOL +1F6BC FE0E ; text style; # (6.0 🚼︎ ) BABY SYMBOL +1F6BC FE0F ; emoji style; # (6.0 🚼️ ) BABY SYMBOL +1F6CB FE0E ; text style; # (7.0 🛋︎ ) COUCH AND LAMP +1F6CB FE0F ; emoji style; # (7.0 🛋️ ) COUCH AND LAMP +1F6CD FE0E ; text style; # (7.0 🛍︎ ) SHOPPING BAGS +1F6CD FE0F ; emoji style; # (7.0 🛍️ ) SHOPPING BAGS +1F6CE FE0E ; text style; # (7.0 🛎︎ ) BELLHOP BELL +1F6CE FE0F ; emoji style; # (7.0 🛎️ ) BELLHOP BELL +1F6CF FE0E ; text style; # (7.0 🛏︎ ) BED +1F6CF FE0F ; emoji style; # (7.0 🛏️ ) BED +1F6E0 FE0E ; text style; # (7.0 🛠︎ ) HAMMER AND WRENCH +1F6E0 FE0F ; emoji style; # (7.0 🛠️ ) HAMMER AND WRENCH +1F6E1 FE0E ; text style; # (7.0 🛡︎ ) SHIELD +1F6E1 FE0F ; emoji style; # (7.0 🛡️ ) SHIELD +1F6E2 FE0E ; text style; # (7.0 🛢︎ ) OIL DRUM +1F6E2 FE0F ; emoji style; # (7.0 🛢️ ) OIL DRUM +1F6E3 FE0E ; text style; # (7.0 🛣︎ ) MOTORWAY +1F6E3 FE0F ; emoji style; # (7.0 🛣️ ) MOTORWAY +1F6E4 FE0E ; text style; # (7.0 🛤︎ ) RAILWAY TRACK +1F6E4 FE0F ; emoji style; # (7.0 🛤️ ) RAILWAY TRACK +1F6E5 FE0E ; text style; # (7.0 🛥︎ ) MOTOR BOAT +1F6E5 FE0F ; emoji style; # (7.0 🛥️ ) MOTOR BOAT +1F6E9 FE0E ; text style; # (7.0 🛩︎ ) SMALL AIRPLANE +1F6E9 FE0F ; emoji style; # (7.0 🛩️ ) SMALL AIRPLANE +1F6F0 FE0E ; text style; # (7.0 🛰︎ ) SATELLITE +1F6F0 FE0F ; emoji style; # (7.0 🛰️ ) SATELLITE +1F6F3 FE0E ; text style; # (7.0 🛳︎ ) PASSENGER SHIP +1F6F3 FE0F ; emoji style; # (7.0 🛳️ ) PASSENGER SHIP + +#Total sequences: 354 + +#EOF commit c8e527cbeeea6be9bb713af33a3f40408b261234 Author: Andrea Corallo Date: Sun May 28 14:51:58 2023 +0200 * Nativecomp disable propagation of pre slot access type check (bug#63710) * lisp/emacs-lisp/comp.el (comp-add-cond-cstrs): Temporary disable propagation of pre slot access type check. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 8e59c06d40e..0556e69051d 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2548,19 +2548,19 @@ comp-add-cond-cstrs for insns-seq on (comp-block-insns b) do (pcase insns-seq - (`((set ,(and (pred comp-mvar-p) mvar-tested-copy) - ,(and (pred comp-mvar-p) mvar-tested)) - (set ,(and (pred comp-mvar-p) mvar-1) - (call type-of ,(and (pred comp-mvar-p) mvar-tested-copy))) - (set ,(and (pred comp-mvar-p) mvar-2) - (call symbol-value ,(and (pred comp-cstr-cl-tag-p) mvar-tag))) - (set ,(and (pred comp-mvar-p) mvar-3) - (call memq ,(and (pred comp-mvar-p) mvar-1) ,(and (pred comp-mvar-p) mvar-2))) - (cond-jump ,(and (pred comp-mvar-p) mvar-3) ,(pred comp-mvar-p) ,bb1 ,bb2)) - (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag))) - (comp-block-insns (comp-add-cond-cstrs-target-block b bb2))) - (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag) :neg t)) - (comp-block-insns (comp-add-cond-cstrs-target-block b bb1)))) + ;; (`((set ,(and (pred comp-mvar-p) mvar-tested-copy) + ;; ,(and (pred comp-mvar-p) mvar-tested)) + ;; (set ,(and (pred comp-mvar-p) mvar-1) + ;; (call type-of ,(and (pred comp-mvar-p) mvar-tested-copy))) + ;; (set ,(and (pred comp-mvar-p) mvar-2) + ;; (call symbol-value ,(and (pred comp-cstr-cl-tag-p) mvar-tag))) + ;; (set ,(and (pred comp-mvar-p) mvar-3) + ;; (call memq ,(and (pred comp-mvar-p) mvar-1) ,(and (pred comp-mvar-p) mvar-2))) + ;; (cond-jump ,(and (pred comp-mvar-p) mvar-3) ,(pred comp-mvar-p) ,bb1 ,bb2)) + ;; (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag))) + ;; (comp-block-insns (comp-add-cond-cstrs-target-block b bb2))) + ;; (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag) :neg t)) + ;; (comp-block-insns (comp-add-cond-cstrs-target-block b bb1)))) (`((set ,(and (pred comp-mvar-p) cmp-res) (,(pred comp-call-op-p) ,(and (or (pred comp-equality-fun-p) commit e6299d2783f9aef4b0b9105650e06166ea5ed2d6 Author: Laurence Warne Date: Sun May 21 18:59:43 2023 +0100 Fix unstable proced test Fix unstable proced test by omitting the revert parameter in 'proced-update'. This was caused by the process being refined on exiting between the initial 'proced' call and the successive 'proced-update' call. This resulted in proced skipping the refinement in 'proced-update', causing all processes to be shown again and the test to fail. * test/lisp/proced-tests.el (proced-refine-with-update-test): Do not use revert parameter when calling 'proced-update'. diff --git a/test/lisp/proced-tests.el b/test/lisp/proced-tests.el index d69414cf43a..d53f25b00d8 100644 --- a/test/lisp/proced-tests.el +++ b/test/lisp/proced-tests.el @@ -89,14 +89,17 @@ proced-refine-test (forward-line))))) (ert-deftest proced-refine-with-update-test () - :tags '(:unstable) ; There seems to be an update race here. (proced--within-buffer 'medium 'user (proced--move-to-column "PID") (let ((pid (word-at-point))) (proced-refine) - (proced-update t) + ;; Don't use (proced-update t) since this will reset `proced-process-alist' + ;; and it's possible the process refined on would have exited by that + ;; point. In this case proced will skip the refinement and show all + ;; processes again, causing the test to fail. + (proced-update) (while (not (eobp)) (proced--move-to-column "PID") (should (string= pid (word-at-point))) commit 3be33aff9638daf0012e339b19906581befb0247 Author: Michael Heerdegen Date: Sat May 27 02:26:09 2023 +0200 A better fix for "Fix cancellation of Wdired" * lisp/wdired.el (wdired-abort-changes): Call `dired-build-subdir-alist' instead of `dired-revert'. (Bug#63676) diff --git a/lisp/wdired.el b/lisp/wdired.el index 9952da71078..5c745cc9aab 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -470,9 +470,8 @@ wdired-abort-changes (insert wdired--old-content) (goto-char wdired--old-point)) (wdired-change-to-dired-mode) - ;; Make sure the display is in synch, and all the variables are set - ;; correctly. - (dired-revert) + ;; Update markers in `dired-subdir-alist' + (dired-build-subdir-alist) (set-buffer-modified-p nil) (setq buffer-undo-list nil) (message "Changes aborted")) commit 756244c69638bc3562d8cd2c1aa126216e99fb29 Author: Eli Zaretskii Date: Sat May 27 20:20:33 2023 +0300 ; * lisp/minibuffer.el (completions-header-format): Doc fix. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 747c9443afa..298f3f8728d 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2025,11 +2025,14 @@ completions-detailed (defcustom completions-header-format (propertize "%s possible completions:\n" 'face 'shadow) - "Format of completions header. -It may contain one %s to show the total count of completions. -When nil, no header is shown." - :type '(choice (const :tag "No header" nil) - (string :tag "Header format string")) + "If non-nil, the format string for completions heading line. +The heading line is inserted before the completions, and is intended +to summarize the completions. +The format string may include one %s, which will be replaced with +the total count of possible completions. +If this is nil, no heading line will be shown." + :type '(choice (const :tag "No heading line" nil) + (string :tag "Format string for heading line")) :version "29.1") (defun completion--insert-strings (strings &optional group-fun) commit 5d844e129ad5b42b74c363cde50aedc08a96cf39 Author: Eli Zaretskii Date: Sat May 27 20:09:40 2023 +0300 Fix tmm-menubar when 'tmm-completion-prompt' is nil * lisp/tmm.el (tmm-prompt): Handle nil value of 'tmm-mid-prompt'. (tmm-completion-delete-prompt): Don't rely on the exact text of the completion heading line, as it is now a customizable format string, and can be nil, meaning no heading line is inserted at all. Instead, search for the first character of the menu based on text properties used for it. (Bug#63754) diff --git a/lisp/tmm.el b/lisp/tmm.el index 1f9a877c20b..6088961fa4c 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -28,6 +28,7 @@ ;;; Code: (require 'electric) +(require 'text-property-search) (defgroup tmm nil "Text mode access to menu-bar." @@ -192,7 +193,11 @@ tmm-prompt (or (not visible) (eval visible)))))) (setq index-of-default (1+ index-of-default))) (setq tail (cdr tail))))) - (let ((prompt (concat "^." (regexp-quote tmm-mid-prompt)))) + (let ((prompt + (concat "^" + (if (stringp tmm-mid-prompt) + (concat "." + (regexp-quote tmm-mid-prompt)))))) (setq tmm--history (reverse (delq nil (mapcar @@ -320,8 +325,21 @@ tmm-define-keys (defun tmm-completion-delete-prompt () (with-current-buffer standard-output - (goto-char (point-min)) - (delete-region (point) (search-forward "Possible completions are:\n")))) + (goto-char (point-min)) + (let* (;; First candidate: first string with mouse-face + (menu-start-1 (next-single-char-property-change (point) 'mouse-face)) + ;; Second candidate: an inactive menu item with tmm-inactive face + (tps-result (save-excursion + (text-property-search-forward 'face 'tmm-inactive t))) + (menu-start-2 (and tps-result (prop-match-beginning tps-result)))) + (or (and (null menu-start-1) (null menu-start-2)) + (delete-region (point) + ;; Use the smallest position of the two candidates. + (or (and menu-start-1 menu-start-2 + (min menu-start-1 menu-start-2)) + ;; Otherwise use the one that is non-nil. + menu-start-1 + menu-start-2)))))) (defun tmm-remove-inactive-mouse-face () "Remove the mouse-face property from inactive menu items." commit 4289044ccf5a07862234903f09d6eb46ac08a925 Author: Michael Albinus Date: Sat May 27 10:14:50 2023 +0200 Minor Tramp fixes * lisp/net/tramp-sh.el (tramp-sh-handle-process-file): Set `env' explicitly. (tramp-barf-if-no-shell-prompt): Still add optional trailing `ansi-color-control-seq-regexp'. * lisp/net/tramp.el (tramp-make-tramp-file-name): Keep hop while in file name completion. * test/lisp/net/tramp-tests.el (tramp-test26-interactive-file-name-completion): Adapt test. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 25a26d67d6d..fb8112c384d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3127,7 +3127,7 @@ tramp-sh-handle-process-file (if (tramp-compat-string-search "=" elt) (setq env (append env `(,elt))) (setq uenv (cons elt uenv))))) - (setenv-internal env "INSIDE_EMACS" (tramp-inside-emacs) 'keep) + (setq env (setenv-internal env "INSIDE_EMACS" (tramp-inside-emacs) 'keep)) (when env (setq command (format @@ -4316,6 +4316,7 @@ tramp-barf-if-no-shell-prompt proc timeout (rx (| (regexp shell-prompt-pattern) (regexp tramp-shell-prompt-pattern)) + (? (regexp ansi-color-control-seq-regexp)) eos)) (error (delete-process proc) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3ceb20f2634..ecc950adfde 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1802,7 +1802,9 @@ tramp-make-tramp-file-name (when (cadr args) (setq localname (and (stringp (cadr args)) (cadr args)))) (when hop - (setq hop nil) + ;; Keep hop in file name for completion. + (unless minibuffer-completing-file-name + (setq hop nil)) ;; Assure that the hops are in `tramp-default-proxies-alist'. ;; In tramp-archive.el, the slot `hop' is used for the archive ;; file name. @@ -5720,7 +5722,7 @@ tramp-process-one-action ;; Obviously, the output was not complete. (while (tramp-accept-process-output proc)) ;; Remove ANSI control escape sequences. - (with-current-buffer (tramp-get-connection-buffer vec) + (with-current-buffer (tramp-get-connection-buffer vec) (goto-char (point-min)) (while (re-search-forward ansi-color-control-seq-regexp nil t) (replace-match ""))) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index eec4a66a329..017cb73f3bb 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4749,7 +4749,7 @@ tramp-test26-interactive-file-name-completion tramp-prefix-format hop (substring-no-properties method 0 (min 2 (length method)))) - ,(concat tramp-prefix-format method-string) + ,(concat tramp-prefix-format hop method-string) ,method-string))) ;; Complete user name. (unless (tramp-string-empty-or-nil-p user) @@ -4758,7 +4758,7 @@ tramp-test26-interactive-file-name-completion (substring-no-properties user 0 (min 2 (length user)))) ,(concat - tramp-prefix-format method-string user-string) + tramp-prefix-format hop method-string user-string) ,user-string))) ;; Complete host name. (unless (tramp-string-empty-or-nil-p host) @@ -4768,9 +4768,9 @@ tramp-test26-interactive-file-name-completion (substring-no-properties host 0 (min 2 (length host)))) (,(concat - tramp-prefix-format method-string host-string) + tramp-prefix-format hop method-string host-string) ,(concat - tramp-prefix-format method-string + tramp-prefix-format hop method-string user-string host-string)) ,host-string))) ;; Complete user and host name. @@ -4782,7 +4782,7 @@ tramp-test26-interactive-file-name-completion (substring-no-properties host 0 (min 2 (length host)))) ,(concat - tramp-prefix-format method-string + tramp-prefix-format hop method-string user-string host-string) ,host-string))))) commit e77e986a9b7d735c0e39198c8b80a34a29005fc5 Author: Stefan Monnier Date: Fri May 26 12:23:59 2023 -0400 package-tests.el: Add test for last change * test/lisp/emacs-lisp/package-tests.el (package-test-desc-from-buffer): Make sure the absence of the terminating comment does not matter. diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 0016fb586b7..113b4ec12a8 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -219,9 +219,14 @@ package-test--compatible-p (ert-deftest package-test-desc-from-buffer () "Parse an elisp buffer to get a `package-desc' object." - (with-package-test (:basedir (ert-resource-directory) :file "simple-single-1.3.el") - (should (package-test--compatible-p - (package-buffer-info) simple-single-desc 'kind))) + (with-package-test (:basedir (ert-resource-directory) + :file "simple-single-1.3.el") + (let ((pi (package-buffer-info))) + (should (package-test--compatible-p pi simple-single-desc 'kind)) + ;; The terminating line is not mandatory any more. + (re-search-forward "^;;; .* ends here") + (delete-region (match-beginning 0) (point-max)) + (should (equal (package-buffer-info) pi)))) (with-package-test (:basedir (ert-resource-directory) :file "simple-depend-1.0.el") (should (package-test--compatible-p (package-buffer-info) simple-depend-desc 'kind))) commit 321ed8ebae8f84e0f8ae6cf2012f0f8830d9fda9 Author: Stefan Monnier Date: Fri May 26 11:18:49 2023 -0400 * lisp/emacs-lisp/package.el (package-buffer-info): Fix last change The code that follows expects point to be at/near the end of the buffer. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index e906c73ecab..69595601bc8 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1199,7 +1199,7 @@ package-buffer-info ;; the earliest in version 31.1. The idea is to phase out the ;; requirement for a "footer line" without unduly impacting users ;; on earlier Emacs versions. See Bug#26490 for more details. - (unless (search-forward (concat ";;; " file-name ".el ends here") nil t) + (unless (search-forward (concat ";;; " file-name ".el ends here") nil 'move) (lwarn '(package package-format) :warning "Package lacks a terminating comment")) ;; Try to include a trailing newline. commit bb7605c087006b714236165f88341545355d3673 Author: Alan Mackenzie Date: Fri May 26 14:32:07 2023 +0000 Fontify Java constructor names and arglists This fixes bug#63328. * lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): New variable got-stmt-block. After scanning an arglist, set got-arglist to t. When we have as yet no identifier, got-arglist, and scan an open brace, test the "type" for being the name of the enclosing class. (c-directly-in-class-called-p): Test the two names for equality, not merely one being the head of the other. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index d21e082d0b6..66cfd3dee9e 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -10636,6 +10636,10 @@ c-forward-decl-or-cast-1 got-parens ;; True if there is a terminated argument list. got-arglist + ;; True when `got-arglist' and the token after the end of the + ;; arglist is an opening brace. Used only when we have a + ;; suspected typeless function name. + got-stmt-block ;; True if there is an identifier in the declarator. got-identifier ;; True if we find a number where an identifier was expected. @@ -10788,6 +10792,10 @@ c-forward-decl-or-cast-1 (setq got-arglist t)) t) (when (cond + ((and (eq (char-after) ?\() + (c-safe (c-forward-sexp 1) t)) + (when (eq (char-before) ?\)) + (setq got-arglist t))) ((save-match-data (looking-at "\\s(")) (c-safe (c-forward-sexp 1) t)) ((save-match-data @@ -10802,6 +10810,11 @@ c-forward-decl-or-cast-1 (setq got-suffix-after-parens (match-beginning 0))) (setq got-suffix t)))) + ((and got-arglist + (eq (char-after) ?{)) + (setq got-stmt-block t) + nil) + (t ;; No suffix matched. We might have matched the ;; identifier as a type and the open paren of a @@ -10870,9 +10883,17 @@ c-forward-decl-or-cast-1 (not (memq context '(arglist decl)))) (or (and new-style-auto (looking-at c-auto-ops-re)) - (and (or maybe-typeless backup-maybe-typeless) - (not got-prefix) - at-type))) + (and (not got-prefix) + at-type + (or maybe-typeless backup-maybe-typeless + ;; Do we have a (typeless) constructor? + (and got-stmt-block + (save-excursion + (goto-char type-start) + (and + (looking-at c-identifier-key) + (c-directly-in-class-called-p + (match-string 0))))))))) ;; Have found no identifier but `c-typeless-decl-kwds' has ;; matched so we know we're inside a declaration. The ;; preceding type must be the identifier instead. @@ -12554,7 +12575,8 @@ c-directly-in-class-called-p (looking-at c-class-key)) (goto-char (match-end 1)) (c-forward-syntactic-ws) - (looking-at name)))))) + (and (looking-at c-identifier-key) + (string= (match-string 0) name))))))) (defun c-search-uplist-for-classkey (paren-state) ;; Check if the closest containing paren sexp is a declaration commit 5e7c826bfa5cb7459f5b162b498af1c57c4578e6 Author: Mattias Engdegård Date: Fri May 26 14:33:12 2023 +0200 ; * lisp/progmodes/project.el: avoid warning in loaddefs. (cherry picked from commit 1eb5faa26113afe5895955a74594e3d7cf6ffe98) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index e2112276379..617ca45ed0d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -457,7 +457,7 @@ project-vc-extra-root-markers :type '(repeat string) :version "29.1" :package-version '(project . "0.9.0")) -;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (cl-every #'stringp val)))) +;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (not (memq nil (mapcar #'stringp val)))))) ;; FIXME: Using the current approach, major modes are supposed to set ;; this variable to a buffer-local value. So we don't have access to commit 1eb5faa26113afe5895955a74594e3d7cf6ffe98 Author: Mattias Engdegård Date: Fri May 26 14:33:12 2023 +0200 ; * lisp/progmodes/project.el: avoid warning in loaddefs diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 6054f7dc689..41a5c976629 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -468,7 +468,7 @@ project-vc-extra-root-markers :type '(repeat string) :version "29.1" :package-version '(project . "0.9.0")) -;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (cl-every #'stringp val)))) +;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (not (memq nil (mapcar #'stringp val)))))) ;; FIXME: Using the current approach, major modes are supposed to set ;; this variable to a buffer-local value. So we don't have access to commit 95ee5477e1615e07e49e924deda6e5c01efc25f0 Author: Eli Zaretskii Date: Fri May 26 15:11:35 2023 +0300 ; * src/lread.c (read0, skip_lazy_string): Fix commentary again. diff --git a/src/lread.c b/src/lread.c index f8ee4e63e23..c9df72a7306 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3401,7 +3401,7 @@ read_bool_vector (Lisp_Object readcharfun) /* Skip (and optionally remember) a lazily-loaded string preceded by "#@". Return true if this was a normal skip, - false if we read #@00 (which skips to EOB). */ + false if we read #@00 (which skips to EOB/EOF). */ static bool skip_lazy_string (Lisp_Object readcharfun) { @@ -3938,7 +3938,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms) and function definitions that can be loaded lazily. */ if (skip_lazy_string (readcharfun)) goto read_obj; - obj = Qnil; /* #@00 skips to EOB and yields nil. */ + obj = Qnil; /* #@00 skips to EOB/EOF and yields nil. */ break; case '$': commit ef778f5143f04c6b5c0561ad38c04a08bb2cb701 Author: Mattias Engdegård Date: Fri May 26 12:28:15 2023 +0200 Add more function declarations * lisp/subr.el (buffer-narrowed-p, sha1, match-substitute-replacement) (version-to-list, version<, version<=, version=) (function-get, subregexp-context-p, split-string) (combine-and-quote-strings, split-string-and-unquote) (replace-regexp-in-string, syntax-after) (string-trim-left, string-trim): * lisp/emacs-lisp/subr-x.el (hash-table-empty-p, hash-table-keys) (hash-table-values, string-glyph-split) (string-clean-whitespace, string-fill, string-limit) (string-pixel-width): * lisp/env.el (substitute-env-vars, substitute-env-in-file-name) (setenv-internal): * lisp/emacs-lisp/rx.el (rx-to-string): * lisp/emacs-lisp/regexp-opt.el (regexp-opt-depth) (regexp-opt-charset): Add appropriate declarations: pure, side-effect-free, and/or important-return-value. diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index fd9fbbe25a4..39325a3c35e 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -154,6 +154,7 @@ regexp-opt-depth "Return the depth of REGEXP. This means the number of non-shy regexp grouping constructs \(parenthesized expressions) in REGEXP." + (declare (pure t) (side-effect-free t)) (save-match-data ;; Hack to signal an error if REGEXP does not have balanced parentheses. (string-match regexp "") @@ -270,6 +271,7 @@ regexp-opt-charset CHARS should be a list of characters. If CHARS is the empty list, the return value is a regexp that never matches anything." + (declare (pure t) (side-effect-free t)) ;; The basic idea is to find character ranges. Also we take care in the ;; position of character set meta characters in the character set regexp. ;; diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 46f61c26bc4..e82490ffee5 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -1144,6 +1144,7 @@ rx-to-string group. For extending the `rx' notation in FORM, use `rx-define' or `rx-let-eval'." + (declare (important-return-value t)) (let* ((item (rx--translate form)) (exprs (if no-group (car item) diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 947390b3de3..9e906930b92 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -81,18 +81,22 @@ thread-last threading." (declare (indent 0) (debug thread-first)) `(internal--thread-argument nil ,@forms)) + (defsubst hash-table-empty-p (hash-table) "Check whether HASH-TABLE is empty (has 0 elements)." + (declare (side-effect-free t)) (zerop (hash-table-count hash-table))) (defsubst hash-table-keys (hash-table) "Return a list of keys in HASH-TABLE." + (declare (side-effect-free t)) (let ((keys nil)) (maphash (lambda (k _) (push k keys)) hash-table) keys)) (defsubst hash-table-values (hash-table) "Return a list of values in HASH-TABLE." + (declare (side-effect-free t)) (let ((values nil)) (maphash (lambda (_ v) (push v values)) hash-table) values)) @@ -149,6 +153,7 @@ string-clean-whitespace All sequences of whitespaces in STRING are collapsed into a single space character, and leading/trailing whitespace is removed." + (declare (important-return-value t)) (let ((blank "[[:blank:]\r\n]+")) (string-trim (replace-regexp-in-string blank " " string t t) blank blank))) @@ -158,6 +163,7 @@ string-fill Wrapping is done where there is whitespace. If there are individual words in STRING that are longer than LENGTH, the result will have lines that are longer than LENGTH." + (declare (important-return-value t)) (with-temp-buffer (insert string) (goto-char (point-min)) @@ -189,6 +195,7 @@ string-limit When shortening strings for display purposes, `truncate-string-to-width' is almost always a better alternative than this function." + (declare (important-return-value t)) (unless (natnump length) (signal 'wrong-type-argument (list 'natnump length))) (if coding-system @@ -324,6 +331,7 @@ named-let ;;;###autoload (defun string-pixel-width (string) "Return the width of STRING in pixels." + (declare (important-return-value t)) (if (zerop (length string)) 0 ;; Keeping a work buffer around is more efficient than creating a @@ -344,6 +352,7 @@ string-glyph-split if compositions are enabled, each sequence of characters composed on display into a single grapheme cluster is treated as a single indivisible unit." + (declare (side-effect-free t)) (let ((result nil) (start 0) comp) diff --git a/lisp/env.el b/lisp/env.el index faafcb6250f..281934af054 100644 --- a/lisp/env.el +++ b/lisp/env.el @@ -76,6 +76,7 @@ substitute-env-vars left unchanged. Use `$$' to insert a single dollar sign." + (declare (important-return-value t)) (let ((start 0)) (while (string-match env--substitute-vars-regexp string start) (cond ((match-beginning 1) @@ -94,6 +95,7 @@ substitute-env-vars string)) (defun substitute-env-in-file-name (filename) + (declare (important-return-value t)) (substitute-env-vars filename ;; How 'bout we lookup other tables than the env? ;; E.g. we could accept bookmark names as well! @@ -104,6 +106,7 @@ substitute-env-in-file-name (defun setenv-internal (env variable value keep-empty) "Set VARIABLE to VALUE in ENV, adding empty entries if KEEP-EMPTY. Changes ENV by side-effect, and returns its new value." + (declare (important-return-value t)) (let ((pattern (concat "\\`" (regexp-quote variable) "\\(=\\|\\'\\)")) (case-fold-search nil) (scan env) diff --git a/lisp/subr.el b/lisp/subr.el index 7670143c7cd..95d3bc03544 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4006,6 +4006,7 @@ user-emacs-directory (defsubst buffer-narrowed-p () "Return non-nil if the current buffer is narrowed." + (declare (side-effect-free t)) (/= (- (point-max) (point-min)) (buffer-size))) (defmacro with-restriction (start end &rest rest) @@ -4132,7 +4133,7 @@ shell-quote-argument If the optional POSIX argument is non-nil, ARGUMENT is quoted according to POSIX shell quoting rules, regardless of the system's shell." -(cond + (cond ((and (not posix) (eq system-type 'ms-dos)) ;; Quote using double quotes, but escape any existing quotes in ;; the argument with backslashes. @@ -4264,6 +4265,7 @@ sha1 Note that SHA-1 is not collision resistant and should not be used for anything security-related. See `secure-hash' for alternatives." + (declare (side-effect-free t)) (secure-hash 'sha1 object start end binary)) (defun function-get (f prop &optional autoload) @@ -4271,6 +4273,7 @@ function-get If AUTOLOAD is non-nil and F is autoloaded, try to load it in the hope that it will set PROP. If AUTOLOAD is `macro', do it only if it's an autoloaded macro." + (declare (important-return-value t)) (let ((val nil)) (while (and (symbolp f) (null (setq val (get f prop))) @@ -5226,6 +5229,7 @@ match-substitute-replacement are substituted with actual strings matched by the last search. Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the same meaning as for `replace-match'." + (declare (side-effect-free t)) (let ((match (match-string 0 string))) (save-match-data (match-data--translate (- (match-beginning 0))) @@ -5287,6 +5291,7 @@ subregexp-context-p repetition bounds operator `\\=\\{...\\}', or right after a `\\'. If START is non-nil, it should be a position in REGEXP, smaller than POS, and known to be in a subregexp context." + (declare (important-return-value t)) ;; Here's one possible implementation, with the great benefit that it ;; reuses the regexp-matcher's own parser, so it understands all the ;; details of the syntax. A disadvantage is that it needs to match the @@ -5368,6 +5373,7 @@ split-string whitespace, use `(split-string STRING split-string-default-separators)'. Modifies the match data; use `save-match-data' if necessary." + (declare (important-return-value t)) (let* ((keep-nulls (not (if separators omit-nulls t))) (rexp (or separators split-string-default-separators)) (start 0) @@ -5425,6 +5431,7 @@ combine-and-quote-strings Note that this is not intended to protect STRINGS from interpretation by shells, use `shell-quote-argument' for that." + (declare (important-return-value t)) (let* ((sep (or separator " ")) (re (concat "[\\\"]" "\\|" (regexp-quote sep)))) (mapconcat @@ -5439,6 +5446,7 @@ split-string-and-unquote It understands Emacs Lisp quoting within STRING, such that (split-string-and-unquote (combine-and-quote-strings strs)) == strs The SEPARATOR regexp defaults to \"\\s-+\"." + (declare (important-return-value t)) (let ((sep (or separator "\\s-+")) (i (string-search "\"" string))) (if (null i) @@ -5506,6 +5514,7 @@ replace-regexp-in-string and replace a sub-expression, e.g. (replace-regexp-in-string \"\\\\(foo\\\\).*\\\\\\='\" \"bar\" \" foo foo\" nil nil 1) => \" bar foo\"" + (declare (important-return-value t)) ;; To avoid excessive consing from multiple matches in long strings, ;; don't just call `replace-match' continually. Walk down the @@ -5861,6 +5870,7 @@ make-syntax-table (defun syntax-after (pos) "Return the raw syntax descriptor for the char after POS. If POS is outside the buffer's accessible portion, return nil." + (declare (important-return-value t)) (unless (or (< pos (point-min)) (>= pos (point-max))) (let ((st (if parse-sexp-lookup-properties (get-char-property pos 'syntax-table)))) @@ -6675,6 +6685,7 @@ version-to-list \"22.8beta3\" (22 8 -2 3) See documentation for `version-separator' and `version-regexp-alist'." + (declare (side-effect-free t)) (unless (stringp ver) (error "Version must be a string")) ;; Change .x.y to 0.x.y @@ -6805,6 +6816,7 @@ version< string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", which is higher than \"1alpha\", which is higher than \"1snapshot\". Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions." + (declare (side-effect-free t)) (version-list-< (version-to-list v1) (version-to-list v2))) (defun version<= (v1 v2) @@ -6815,6 +6827,7 @@ version<= string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", which is higher than \"1alpha\", which is higher than \"1snapshot\". Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions." + (declare (side-effect-free t)) (version-list-<= (version-to-list v1) (version-to-list v2))) (defun version= (v1 v2) @@ -6825,6 +6838,7 @@ version= string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", which is higher than \"1alpha\", which is higher than \"1snapshot\". Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions." + (declare (side-effect-free t)) (version-list-= (version-to-list v1) (version-to-list v2))) (defvar package--builtin-versions @@ -6947,6 +6961,7 @@ string-trim-left "Trim STRING of leading string matching REGEXP. REGEXP defaults to \"[ \\t\\n\\r]+\"." + (declare (important-return-value t)) (if (string-match (if regexp (concat "\\`\\(?:" regexp "\\)") "\\`[ \t\n\r]+") @@ -6969,6 +6984,7 @@ string-trim "Trim STRING of leading and trailing strings matching TRIM-LEFT and TRIM-RIGHT. TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"." + (declare (important-return-value t)) (string-trim-left (string-trim-right string trim-right) trim-left)) ;; The initial anchoring is for better performance in searching matches. commit 54ac1165bc3f6012201689b7f23d7edba2926f6d Author: Spencer Baugh Date: Wed Apr 19 17:44:54 2023 -0400 Support setting PAGER=cat in comint.el (bug#62958) Paging can be undesirable in comint-derived commands such as async-shell-command and M-x shell. It is a frequent footgun for new Emacs users when they try to run commands which start a pager in such modes. Simply adding (setenv "PAGER" "cat") globally is not correct, since that will break modes like term, which support paging quite well. It's only and exactly the comint-derived modes which don't need paging. * lisp/comint.el (comint-pager): Add. (bug#62958) (comint-exec-1): Use comint-pager to set PAGER. diff --git a/lisp/comint.el b/lisp/comint.el index 77973ab76de..718a972a582 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -258,6 +258,35 @@ comint-input-ring-file-name file) :group 'comint) +(defcustom comint-pager nil + "If non-nil, the program to use for pagination of program output. + +Some programs produce large amounts of output, and have provision for +pagination of their output through a filter program, commonly known as +a \"pager\". The pager limits the amount of output produced and +allows the user to interactively browse the output one page at a time. +Some programs paginate their output by default, by always starting a +pager. The program they use as the pager is specified by the +environment variable PAGER; if that variable is not defined, they use +some fixed default, such as \"less\". + +The interactive browsing aspects of pagination are not needed, and get +in the way, when the output of the program is directed to an Emacs +buffer, so in those cases pagination might need to be disabled. +Disabling pagination means that some programs will produce large +amounts of output, but most such programs have other ways to limit +their output, such as additional arguments or Emacs interfaces. +To disable pagination, this variable's value should be a string that +names a program, such as \"cat\", which passes through all of the +output without any filtering or delays. Comint will then set the +PAGER variable to name that program, when it invokes external +programs." + :version "30.1" + :type '(choice (const :tag "Use default PAGER" nil) + (const :tag "Don't do paging (PAGER=cat)" "cat") + (string :tag "Program name or absolute path of pager")) + :group 'comint) + (defvar comint-input-ring-file-prefix nil "The prefix to skip when parsing the input ring file. This is useful in Zsh when the extended_history option is on.") @@ -865,6 +894,10 @@ comint-exec-1 (nconc (comint-term-environment) (list (format "INSIDE_EMACS=%s,comint" emacs-version)) + (when comint-pager + (if (stringp comint-pager) + (list (format "PAGER=%s" comint-pager)) + (error "comint-pager should be a string: %s" comint-pager))) process-environment)) (default-directory (if (file-accessible-directory-p default-directory) commit e78318ad2e660571100e83bf8c3550d9e3292eab Merge: d1156488660 aa5158630e7 Author: Eli Zaretskii Date: Fri May 26 07:04:03 2023 -0400 Merge from origin/emacs-29 aa5158630e7 Use 'font-lock-extend-region-functions' in python-mode b7b82ecb2b4 Fix python-info-docstring-p f42de74ebea ; * src/lread.c (read0, skip_lazy_string): Fix commentary... b6b384023a9 Fix cancellation of Wdired 916c2a19bde Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... f535c0e49d5 Handle #@00 in new reader in a compatible way (bug#63722) 40a758f5ceb ; Minor fixes in documentation of recently-changed VC com... c0d7447e9dc ; * etc/NEWS: Describe the Cairo XCB option. (Bug#63589) 42052686752 Don't mark selection request events 9f5249d5c8d Disable cairo-xcb support by default e5f42706ce2 * lisp/progmodes/project.el: Move :safe from defcustom to... 3afe4a42e90 * lisp/vc/vc-annotate.el (vc-annotate-mode-menu): Quote v... b62a2b08b80 Add vc-create/switch/print-branch to menu and update docu... d292d282292 Fix rare crashes in 'try_window_reusing_current_matrix' 709d9020021 Make last Tramp change less invasive a72a1f24fcb ; Fix last change. 5c6517a115d ; * lisp/menu-bar.el (popup-menu): Doc fix. 212884f2bfe ; Fix last change. 1b9812af80b ; * etc/PROBLEMS: Document problem with GnuPG 2.4.1. (Bu... 765edc204d4 ; Support SQLite3 extensions on macOS 5aadb87d6f6 Fix 'use-dialog-box-p' and friends # Conflicts: # etc/NEWS commit d11564886607e39a55c293801ab37cde13723024 Merge: eacee3e536e 0abb79ca09a Author: Eli Zaretskii Date: Fri May 26 07:03:56 2023 -0400 ; Merge from origin/emacs-29 The following commit was skipped: 0abb79ca09a Avoid duplicates when adding package dirs to load-path commit eacee3e536e06227b04c3b2f1ab3a1fe831b78dc Merge: d6f717cd1dc 6f6071c5261 Author: Eli Zaretskii Date: Fri May 26 07:03:07 2023 -0400 Merge from origin/emacs-29 6f6071c5261 Avoid duplicate load-path entry when generating package a... 117b29c6f66 ; Improve documentation of Isearch command properties a347b26cba2 Disable loading SQLite3 extensions when SQLite3 version i... fe22bf503fb ; * lisp/progmodes/project.el (project-switch-use-entire-... 64dbbde3b77 Fix visiting HTML files encoded in iso-2022 variants 5c95239aca2 ; Fix markup of some treesit vars in Elisp manual. 6ad041939be Support 'isearch-allow-scroll' in 'pixel-scroll-precision... ecccdc07a09 shr: allow moving between adjacent anchors 504ef25ef36 ; * etc/NEWS: Fix typos. d6fb868cdd3 Fix multihop file name expansion in Tramp dd3e4e14fdc Remove obsolete information from Gnus manual 2a5c946f879 Preserve mark in comint-history-isearch 6b60c8142ea Fix systemd unit completion for old versions of systemd 8c56557cd9d Fix Skeletons menu-bar menu in Python modes 58eb38cfb47 ; * etc/NEWS: missing definite article cf403628692 ; * etc/NEWS: PGTK cannot switch to -new automatically (b... ead3a2abbfc Fix loading SQLite extensions a6bddd17658 ; * etc/NEWS: Fix typos. f49fe936abd * etc/NEWS: Note dotimes loop variable scoping change (bu... cec9333dc52 Fix c-ts-mode--top-level-declarator f571e8f1bb6 Improve c-ts-mode font-lock for function names (bug#63390) 42a28ffdc27 * lisp/tab-bar.el: Don't use 'minibuffer-selected-window'... 8e61d23f71e Split windows horizontally in places that use split to cr... 459d08c7fe7 Fix tree-sitter test (bug#63481) 3bc5efb87e5 ; * lisp/emacs-lisp/benchmark.el (benchmark-progn): Fix d... # Conflicts: # etc/NEWS commit d6f717cd1dc373707440011a1552b78de2654bba Author: Eli Zaretskii Date: Fri May 26 13:20:56 2023 +0300 Fix emacsclient when there are irrecoverable file-visiting errors * lisp/server.el (server-process-filter, server-return-error): Display the error message to be sent to the client as a regular message, to give the user the opportunity to see it. Delete the terminal immediately after sending the error message to the client, to make sure the terminal's modes are restored. (Bug#63629) diff --git a/lisp/server.el b/lisp/server.el index 608e5df3a5b..c3325e5a24c 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1143,8 +1143,18 @@ server-process-filter (process-put proc :authenticated t) (server-log "Authentication successful" proc)) (server-log "Authentication failed" proc) + ;; Display the error as a message and give the user time to see + ;; it, in case the error written by emacsclient to stderr is not + ;; visible for some reason. + (message "Authentication failed") + (sit-for 2) (server-send-string proc (concat "-error " (server-quote-arg "Authentication failed"))) + (unless (eq system-type 'windows-nt) + (let ((terminal (process-get proc 'terminal))) + ;; Only delete the terminal if it is non-nil. + (when (and terminal (eq (terminal-live-p terminal) t)) + (delete-terminal terminal)))) ;; Before calling `delete-process', give emacsclient time to ;; receive the error string and shut down on its own. (sit-for 1) @@ -1462,10 +1472,20 @@ server-execute (defun server-return-error (proc err) (ignore-errors + ;; Display the error as a message and give the user time to see + ;; it, in case the error written by emacsclient to stderr is not + ;; visible for some reason. + (message (error-message-string err)) + (sit-for 2) (server-send-string proc (concat "-error " (server-quote-arg (error-message-string err)))) (server-log (error-message-string err) proc) + (unless (eq system-type 'windows-nt) + (let ((terminal (process-get proc 'terminal))) + ;; Only delete the terminal if it is non-nil. + (when (and terminal (eq (terminal-live-p terminal) t)) + (delete-terminal terminal)))) ;; Before calling `delete-process', give emacsclient time to ;; receive the error string and shut down on its own. (sit-for 5) commit aa5158630e7113a67ae804d4253911028cb8f984 Author: kobarity Date: Wed May 24 22:06:51 2023 +0900 Use 'font-lock-extend-region-functions' in python-mode * lisp/progmodes/python.el (python-font-lock-extend-region): Change arguments and return value for 'font-lock-extend-region-functions'. (python-mode): Change from 'font-lock-extend-after-change-region-function' to 'font-lock-extend-region-functions'. (Bug#63622) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 032a17c52ff..adaeacc2ec1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -869,18 +869,22 @@ python-font-lock-keywords Which one will be chosen depends on the value of `font-lock-maximum-decoration'.") -(defun python-font-lock-extend-region (beg end _old-len) - "Extend font-lock region given by BEG and END to statement boundaries." - (save-excursion - (save-match-data - (goto-char beg) - (python-nav-beginning-of-statement) - (setq beg (point)) - (goto-char end) - (python-nav-end-of-statement) - (setq end (point)) - (cons beg end)))) - +(defvar font-lock-beg) +(defvar font-lock-end) +(defun python-font-lock-extend-region () + "Extend font-lock region to statement boundaries." + (let ((beg font-lock-beg) + (end font-lock-end)) + (goto-char beg) + (python-nav-beginning-of-statement) + (beginning-of-line) + (when (< (point) beg) + (setq font-lock-beg (point))) + (goto-char end) + (python-nav-end-of-statement) + (when (< end (point)) + (setq font-lock-end (point))) + (or (/= beg font-lock-beg) (/= end font-lock-end)))) (defconst python-syntax-propertize-function (syntax-propertize-rules @@ -6704,9 +6708,9 @@ python-mode `(,python-font-lock-keywords nil nil nil nil (font-lock-syntactic-face-function - . python-font-lock-syntactic-face-function) - (font-lock-extend-after-change-region-function - . python-font-lock-extend-region))) + . python-font-lock-syntactic-face-function))) + (add-hook 'font-lock-extend-region-functions + #'python-font-lock-extend-region nil t) (setq-local syntax-propertize-function python-syntax-propertize-function) (setq-local imenu-create-index-function commit b7b82ecb2b4c2ce33c11e5388b692cd403ab55e6 Author: kobarity Date: Wed May 24 22:01:12 2023 +0900 Fix python-info-docstring-p * lisp/progmodes/python.el (python-info-docstring-p): Stop using python-rx string-delimiter. * test/lisp/progmodes/python-tests.el (python-font-lock-escape-sequence-bytes-newline) (python-font-lock-escape-sequence-hex-octal) (python-font-lock-escape-sequence-unicode) (python-font-lock-raw-escape-sequence): Mark as expected failures until another bug in 'python-info-docstring-p' is corrected. (python-info-docstring-p-7): New test. (Bug#63622) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 6fc05b246a6..032a17c52ff 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6018,8 +6018,7 @@ python-info-docstring-p (let ((counter 1) (indentation (current-indentation)) (backward-sexp-point) - (re (concat "[uU]?[rR]?" - (python-rx string-delimiter)))) + (re "[uU]?[rR]?[\"']")) (when (and (not (python-info-assignment-statement-p)) (looking-at-p re) @@ -6040,9 +6039,7 @@ python-info-docstring-p backward-sexp-point)) (setq last-backward-sexp-point backward-sexp-point)) - (looking-at-p - (concat "[uU]?[rR]?" - (python-rx string-delimiter)))))) + (looking-at-p re)))) ;; Previous sexp was a string, restore point. (goto-char backward-sexp-point) (cl-incf counter)) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 50153e66da5..cbaf5b698bd 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -729,6 +729,7 @@ python-font-lock-escape-sequence-multiline-string (845 . font-lock-string-face) (886)))) (ert-deftest python-font-lock-escape-sequence-bytes-newline () + :expected-result :failed (python-tests-assert-faces "b'\\n' b\"\\n\"" @@ -741,6 +742,7 @@ python-font-lock-escape-sequence-bytes-newline (11 . font-lock-doc-face)))) (ert-deftest python-font-lock-escape-sequence-hex-octal () + :expected-result :failed (python-tests-assert-faces "b'\\x12 \\777 \\1\\23' '\\x12 \\777 \\1\\23'" @@ -761,6 +763,7 @@ python-font-lock-escape-sequence-hex-octal (36 . font-lock-doc-face)))) (ert-deftest python-font-lock-escape-sequence-unicode () + :expected-result :failed (python-tests-assert-faces "b'\\u1234 \\U00010348 \\N{Plus-Minus Sign}' '\\u1234 \\U00010348 \\N{Plus-Minus Sign}'" @@ -775,6 +778,7 @@ python-font-lock-escape-sequence-unicode (80 . font-lock-doc-face)))) (ert-deftest python-font-lock-raw-escape-sequence () + :expected-result :failed (python-tests-assert-faces "rb'\\x12 \123 \\n' r'\\x12 \123 \\n \\u1234 \\U00010348 \\N{Plus-Minus Sign}'" @@ -6598,6 +6602,18 @@ python-info-docstring-p-6 (python-tests-look-at "'''Not a method docstring.'''") (should (not (python-info-docstring-p))))) +(ert-deftest python-info-docstring-p-7 () + "Test string in a dictionary." + (python-tests-with-temp-buffer + " +{'Not a docstring': 1} +'Also not a docstring' +" + (python-tests-look-at "Not a docstring") + (should-not (python-info-docstring-p)) + (python-tests-look-at "Also not a docstring") + (should-not (python-info-docstring-p)))) + (ert-deftest python-info-triple-quoted-string-p-1 () "Test triple quoted string." (python-tests-with-temp-buffer commit f42de74ebea14de1d8a69d2b79489814ab711883 Author: Eli Zaretskii Date: Fri May 26 12:30:40 2023 +0300 ; * src/lread.c (read0, skip_lazy_string): Fix commentary wording. diff --git a/src/lread.c b/src/lread.c index 29321263af3..f8ee4e63e23 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3401,7 +3401,7 @@ read_bool_vector (Lisp_Object readcharfun) /* Skip (and optionally remember) a lazily-loaded string preceded by "#@". Return true if this was a normal skip, - false if we read #@00 (which skips to EOF). */ + false if we read #@00 (which skips to EOB). */ static bool skip_lazy_string (Lisp_Object readcharfun) { @@ -3938,7 +3938,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms) and function definitions that can be loaded lazily. */ if (skip_lazy_string (readcharfun)) goto read_obj; - obj = Qnil; /* #@00 skips to EOF and yields nil. */ + obj = Qnil; /* #@00 skips to EOB and yields nil. */ break; case '$': commit b6b384023a97185486ed4d69fb18bcd2d3cf8049 Author: Eli Zaretskii Date: Fri May 26 12:23:19 2023 +0300 Fix cancellation of Wdired * lisp/wdired.el (wdired-abort-changes): Call 'dired-revert'. Patch by Stephen Berman . (Bug#63676) diff --git a/lisp/wdired.el b/lisp/wdired.el index 5572dcb32f3..9952da71078 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -470,6 +470,9 @@ wdired-abort-changes (insert wdired--old-content) (goto-char wdired--old-point)) (wdired-change-to-dired-mode) + ;; Make sure the display is in synch, and all the variables are set + ;; correctly. + (dired-revert) (set-buffer-modified-p nil) (setq buffer-undo-list nil) (message "Changes aborted")) commit 916c2a19bdef7866c7d923cc00ad87346f16226b Merge: 40a758f5ceb f535c0e49d5 Author: Eli Zaretskii Date: Fri May 26 12:20:26 2023 +0300 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29 commit f35648ba0c0f7dac78ea1d1aaad80471238b7ace Author: Eshel Yaron Date: Mon May 15 21:04:21 2023 +0300 Add customization options for dictionary-search Allow users to customize 'dictionary-search' via several new customization options. * lisp/net/dictionary.el (dictionary-define-word) (dictionary-match-word, dictionary-completing-read-word) (dictionary-dictionaries, dictionary-completing-read-dictionary) (dictionary-display-definition-in-help-buffer): New functions. (dictionary-read-word-prompt) (dictionary-display-definition-function) (dictionary-read-word-function) (dictionary-read-dictionary-function) (dictionary-search-interface): New user options. (dictionary-search): Use them. (dictionary-read-dictionary-default) (dictionary-read-word-default): New functions, extracted from 'dictionary-search'. * etc/NEWS: Announce. diff --git a/etc/NEWS b/etc/NEWS index 7729dbc79fa..07fc2fab774 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -342,6 +342,51 @@ The new Rmail commands 'rmail-mailing-list-post', 'rmail-mailing-list-archive allow to, respectively, post to, unsubscribe from, request help about, and browse the archives, of the mailing list from which the current email message was delivered. + +** Dictionary + +--- +*** New user option 'dictionary-search-interface'. +Controls how the 'dictionary-search' command prompts for and displays +dictionary definitions. Customize this user option to 'help' to have +'dictionary-search' display definitions in a *Help* buffer and provide +dictionary-based minibuffer completion for word selection. + +--- +*** New user option 'dictionary-read-word-prompt'. +This allows the user to customize the prompt that is used by +'dictionary-search' when asking for a word to search in the +dictionary. + +--- +*** New user option 'dictionary-display-definition-function'. +This allows the user to customize the way in which 'dictionary-search' +displays word definitions. If non-nil, this user option should be set +to a function that displays a word definition obtained from a +dictionary server. The new function +'dictionary-display-definition-in-help-buffer' can be used to display +the definition in a *Help* buffer, instead of the default *Dictionary* +buffer. + +--- +*** New user option 'dictionary-read-word-function'. +This allows the user to customize the way in which 'dictionary-search' +prompts for a word to search in the dictionary. This user option +should be set to a function that lets the user select a word and +returns it as a string. The new function +'dictionary-completing-read-word' can be used to prompt with +completion based on dictionary matches. + +--- +*** New user option 'dictionary-read-dictionary-function'. +This allows the user to customize the way in which 'dictionary-search' +prompts for a dictionary to search in. This user option should be set +to a function that lets the user select a dictionary and returns its +name as a string. The new function +'dictionary-completing-read-dictionary' can be used to prompt with +completion based on dictionaries that the server supports. + + * New Modes and Packages in Emacs 30.1 diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index ba65225692a..8d81b3ec9d8 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -38,6 +38,8 @@ (require 'custom) (require 'dictionary-connection) (require 'button) +(require 'help-mode) +(require 'external-completion) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Stuff for customizing. @@ -247,6 +249,65 @@ dictionary-coding-systems-for-dictionaries ))) :version "28.1") +(defcustom dictionary-read-word-prompt "Search word" + "Prompt string to use when prompting for a word." + :type 'string + :version "30.1") + +(defcustom dictionary-display-definition-function nil + "Function to use for displaying dictionary definitions. +It is called with three string arguments: the word being defined, +the dictionary name, and the full definition." + :type '(choice (const :tag "Dictionary buffer" nil) + (const :tag "Help buffer" + dictionary-display-definition-in-help-buffer) + (function :tag "Custom function")) + :version "30.1") + +(defcustom dictionary-read-word-function #'dictionary-read-word-default + "Function to use for prompting for a word. +It is called with one string argument, the name of the dictionary to use, and +must return a string." + :type '(choice (const :tag "Default" dictionary-read-word-default) + (const :tag "Dictionary-based completion" + dictionary-completing-read-word) + (function :tag "Custom function")) + :version "30.1") + +(defcustom dictionary-read-dictionary-function + #'dictionary-read-dictionary-default + "Function to use for prompting for a dictionary. +It is called with no arguments and must return a string." + :type '(choice (const :tag "Default" dictionary-read-dictionary-default) + (const :tag "Choose among server-provided dictionaries" + dictionary-completing-read-dictionary) + (function :tag "Custom function")) + :version "30.1") + +(defcustom dictionary-search-interface nil + "Controls how `dictionary-search' prompts for words and displays definitions. + +When set to `help', `dictionary-search' displays definitions in a *Help* buffer, +and provides completion for word selection based on dictionary matches. + +Otherwise, `dictionary-search' displays definitions in a *Dictionary* buffer." + :type '(choice (const :tag "Dictionary buffer" nil) + (const :tag "Help buffer" help)) + :set (lambda (symbol value) + (let ((vals (pcase value + ('help '(dictionary-display-definition-in-help-buffer + dictionary-completing-read-word + dictionary-completing-read-dictionary)) + (_ '(nil + dictionary-read-word-default + dictionary-read-dictionary-default))))) + (seq-setq (dictionary-display-definition-function + dictionary-read-word-function + dictionary-read-dictionary-function) + vals)) + (set-default-toplevel-value symbol value)) + :version "30.1") + (defface dictionary-word-definition-face '((((supports (:family "DejaVu Serif"))) (:family "DejaVu Serif")) @@ -366,6 +427,8 @@ dictionary-word-history '() "History list of searched word.") +(defvar dictionary--last-match nil) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Basic function providing startup actions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1139,6 +1202,20 @@ dictionary-search-default ((car (get-char-property (point) 'data))) (t (current-word t)))) +(defun dictionary-read-dictionary-default () + "Prompt for a dictionary name." + (read-string (if dictionary-default-dictionary + (format "Dictionary (%s): " + dictionary-default-dictionary) + "Dictionary: ") + nil nil dictionary-default-dictionary)) + +(defun dictionary-read-word-default (_dictionary) + "Prompt for a word to search in the dictionary." + (let ((default (dictionary-search-default))) + (read-string (format-prompt dictionary-read-word-prompt default) + nil 'dictionary-word-history default))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; User callable commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1149,23 +1226,22 @@ dictionary-search It presents the selection or word at point as default input and allows editing it." (interactive - (list (let ((default (dictionary-search-default))) - (read-string (format-prompt "Search word" default) - nil 'dictionary-word-history default)) - (if current-prefix-arg - (read-string (if dictionary-default-dictionary - (format "Dictionary (%s): " dictionary-default-dictionary) - "Dictionary: ") - nil nil dictionary-default-dictionary) - dictionary-default-dictionary))) - - ;; if called by pressing the button - (unless word - (setq word (read-string "Search word: " nil 'dictionary-word-history))) - ;; just in case non-interactively called + (let ((dict + (if current-prefix-arg + (funcall dictionary-read-dictionary-function) + dictionary-default-dictionary))) + (list (funcall dictionary-read-word-function dict) dict))) (unless dictionary (setq dictionary dictionary-default-dictionary)) - (dictionary-new-search (cons word dictionary))) + (if dictionary-display-definition-function + (if-let ((definition (dictionary-define-word word dictionary))) + (funcall dictionary-display-definition-function word dictionary definition) + (user-error "No definition found for \"%s\"" word)) + ;; if called by pressing the button + (unless word + (setq word (read-string "Search word: " nil 'dictionary-word-history))) + ;; just in case non-interactively called + (dictionary-new-search (cons word dictionary)))) ;;;###autoload (defun dictionary-lookup-definition () @@ -1386,5 +1462,102 @@ dictionary-context-menu 'dictionary-separator)) menu) +(defun dictionary-define-word (word dictionary) + "Return the definition of WORD in DICTIONARY, or nil if not found." + (dictionary-send-command + (format "define %s \"%s\"" dictionary word)) + (when (and (= (read (dictionary-read-reply)) 150) + (= (read (dictionary-read-reply)) 151)) + (dictionary-read-answer))) + +(defun dictionary-match-word (word &rest _) + "Return dictionary matches for WORD as a list of strings. +Further arguments are currently ignored." + (unless (string-empty-p word) + (if (string= (car dictionary--last-match) word) + (cdr dictionary--last-match) + (dictionary-send-command + (format "match %s %s \"%s\"" + dictionary-default-dictionary + dictionary-default-strategy + word)) + (when (and (= (read (dictionary-read-reply)) 152)) + (with-temp-buffer + (insert (dictionary-read-answer)) + (goto-char (point-min)) + (let ((result nil)) + (while (not (eobp)) + (search-forward " " nil t) + (push (read (current-buffer)) result) + (search-forward "\n" nil t)) + (setq result (reverse result)) + (setq dictionary--last-match (cons word result)) + result)))))) + +(defun dictionary-completing-read-word (dictionary) + "Prompt for a word with completion based on matches in DICTIONARY." + (let* ((completion-ignore-case t) + (dictionary-default-dictionary dictionary) + (word-at-point (thing-at-point 'word t)) + (default (dictionary-match-word word-at-point))) + (completing-read (format-prompt dictionary-read-word-prompt default) + (external-completion-table 'dictionary-definition + #'dictionary-match-word) + nil t nil 'dictionary-word-history default t))) + +(defun dictionary-dictionaries () + "Return the list of dictionaries the server supports." + (dictionary-send-command "show db") + (when (and (= (read (dictionary-read-reply)) 110)) + (with-temp-buffer + (insert (dictionary-read-answer)) + (goto-char (point-min)) + (let ((result '(("!" . "First matching dictionary") + ("*" . "All dictionaries")))) + (while (not (eobp)) + (push (cons (buffer-substring + (search-forward "\n" nil t) + (1- (search-forward " " nil t))) + (read (current-buffer))) + result)) + (reverse result))))) + +(defun dictionary-completing-read-dictionary () + "Prompt for a dictionary the server supports." + (let* ((dicts (dictionary-dictionaries)) + (len (apply #'max (mapcar #'length (mapcar #'car dicts)))) + (completion-extra-properties + (list :annotation-function + (lambda (key) + (concat (make-string (1+ (- len (length key))) ?\s) + (alist-get key dicts nil nil #'string=)))))) + (completing-read (format-prompt "Select dictionary" + dictionary-default-dictionary) + dicts nil t nil nil dictionary-default-dictionary))) + +(define-button-type 'help-word + :supertype 'help-xref + 'help-function 'dictionary-search + 'help-echo "mouse-2, RET: describe this word") + +(defun dictionary-display-definition-in-help-buffer (word dictionary definition) + "Display DEFINITION, the definition of WORD in DICTIONARY." + (let ((help-buffer-under-preparation t)) + (help-setup-xref (list #'dictionary-search word dictionary) + (called-interactively-p 'interactive)) + (with-help-window (help-buffer) + (with-current-buffer (help-buffer) + (insert definition) + ;; Buttonize references to other definitions. These appear as + ;; words enclosed with curly braces. + (goto-char (point-min)) + (while (re-search-forward (rx "{" + (group-n 1 (* (not (any ?})))) + "}") + nil t) + (help-xref-button 1 'help-word + (match-string 1) + dictionary)))))) + (provide 'dictionary) ;;; dictionary.el ends here commit f535c0e49d5e629e60eabe9097b9c674783f9674 Author: Mattias Engdegård Date: Thu May 25 22:28:25 2023 +0200 Handle #@00 in new reader in a compatible way (bug#63722) This was a regression from Emacs 28. * src/lread.c (skip_lazy_string, read0): Make #@00 read as nil, which is a quirk from the old reader that we preserve for compatibility. * test/src/lread-tests.el (lread-skip-to-eof): Verify it. Reported by Richard Newton. diff --git a/src/lread.c b/src/lread.c index 342d367d985..29321263af3 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3400,8 +3400,9 @@ read_bool_vector (Lisp_Object readcharfun) } /* Skip (and optionally remember) a lazily-loaded string - preceded by "#@". */ -static void + preceded by "#@". Return true if this was a normal skip, + false if we read #@00 (which skips to EOF). */ +static bool skip_lazy_string (Lisp_Object readcharfun) { ptrdiff_t nskip = 0; @@ -3427,9 +3428,9 @@ skip_lazy_string (Lisp_Object readcharfun) digits++; if (digits == 2 && nskip == 0) { - /* #@00 means "skip to end" */ + /* #@00 means "read nil and skip to end" */ skip_dyn_eof (readcharfun); - return; + return false; } } @@ -3476,6 +3477,8 @@ skip_lazy_string (Lisp_Object readcharfun) else /* Skip that many bytes. */ skip_dyn_bytes (readcharfun, nskip); + + return true; } /* Given a lazy-loaded string designator VAL, return the actual string. @@ -3933,8 +3936,10 @@ read0 (Lisp_Object readcharfun, bool locate_syms) /* #@NUMBER is used to skip NUMBER following bytes. That's used in .elc files to skip over doc strings and function definitions that can be loaded lazily. */ - skip_lazy_string (readcharfun); - goto read_obj; + if (skip_lazy_string (readcharfun)) + goto read_obj; + obj = Qnil; /* #@00 skips to EOF and yields nil. */ + break; case '$': /* #$ -- reference to lazy-loaded string */ diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 459a06a39b6..7d885abf364 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el @@ -339,4 +339,20 @@ lread-force-load-doc-strings (should (byte-code-function-p f)) (should (equal (aref f 4) "My little\ndoc string\nhere")))))) +(ert-deftest lread-skip-to-eof () + ;; Check the special #@00 syntax that, for compatibility, reads as + ;; nil while absorbing the remainder of the input. + (with-temp-buffer + (insert "#@00 and the rest\n" + "should be ignored) entirely\n") + (goto-char (point-min)) + (should (equal (read (current-buffer)) nil)) + (should (eobp)) + ;; Add an unbalanced bracket to the beginning and try again; + ;; we should get an error. + (goto-char (point-min)) + (insert "( ") + (goto-char (point-min)) + (should-error (read (current-buffer)) :type 'end-of-file))) + ;;; lread-tests.el ends here commit 40a758f5ceb3d46fa3669e2471db1a45a08f3a23 Author: Eli Zaretskii Date: Fri May 26 11:09:14 2023 +0300 ; Minor fixes in documentation of recently-changed VC commands * lisp/vc/vc.el (vc-print-branch-log, vc-create-branch) (vc-create-tag, vc-retrieve-tag, vc-switch-branch): Doc fixes. * lisp/vc/vc-hooks.el (vc-menu-map): Minor wording change in :help text. * doc/emacs/maintaining.texi (VC Change Log, Creating Branches): Minor wording and markup changes. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 06f44a88aab..246e335cfe7 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1071,8 +1071,9 @@ VC Change Log @findex vc-print-branch-log @kbd{C-x v b l @var{branch-name} @key{RET}} (@code{vc-print-branch-log}) displays a @file{*vc-change-log*} buffer showing the history of the -version-controlled directory tree like @code{vc-print-root-log} does, -but in another branch provided as an argument. +version-controlled directory tree, like @code{vc-print-root-log} does, +but it shows the history of a branch other than the current one; it +prompts for the branch whose history to display. @kindex C-x v I @kindex C-x v O @@ -1690,7 +1691,7 @@ Creating Branches @findex vc-create-branch This procedure will not work for distributed version control systems like git or Mercurial. For those systems you should use the command -@code{vc-create-branch} (@kbd{C-x v b c @var{branch-name} @key{RET}}) +@code{vc-create-branch} (@w{@kbd{C-x v b c @var{branch-name} @key{RET}}}) instead. To create a new branch at an older revision (one that is no longer diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index b559a776c09..00a7659209e 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -899,7 +899,7 @@ vc-menu-map :help "Create version tag")) (bindings--define-key map [vc-print-branch-log] '(menu-item "Show Branch History..." vc-print-branch-log - :help "List the change log for a branch")) + :help "List the change log for another branch")) (bindings--define-key map [vc-switch-branch] '(menu-item "Switch Branch..." vc-switch-branch :help "Switch to another branch")) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index ba981545085..1144a23f317 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2504,9 +2504,13 @@ vc-tag-precondition (defun vc-create-tag (dir name branchp) "Descending recursively from DIR, make a tag called NAME. For each registered file, the working revision becomes part of -the named configuration. If the prefix argument BRANCHP is -given, the tag is made as a new branch and the files are -checked out in that new branch." +the configuration identified by the tag. +If BRANCHP is non-nil (interactively, the prefix argument), the +tag NAME is a new branch, and the files are checked out and +updated to reflect their revisions on that branch. +In interactive use, DIR is `default-directory' for repository-granular +VCSes (all the modern decentralized VCSes belong to this group), +otherwise the command will prompt for DIR." (interactive (let ((granularity (vc-call-backend (vc-responsible-backend default-directory) @@ -2529,9 +2533,23 @@ vc-create-tag ;;;###autoload (defun vc-create-branch (dir name) - "Descending recursively from DIR, make a branch called NAME. -After a new branch is made, the files are checked out in that new branch. -Uses `vc-create-tag' with the non-nil arg `branchp'." + "Make a branch called NAME in directory DIR. +After making the new branch, check out the branch, i.e. update the +files in the tree to their revisions on the branch. + +Interactively, prompt for the NAME of the branch. + +With VCSes that maintain version information per file, this command also +prompts for the directory DIR whose files, recursively, will be tagged +with the NAME of new branch. For VCSes that maintain version +information for the entire repository (all the modern decentralized +VCSes belong to this group), DIR is always the `default-directory'. + +Finally, this command might prompt for the branch or tag from which to +start (\"fork\") the new branch, with completion candidates including +all the known branches and tags in the repository. + +This command invokes `vc-create-tag' with the non-nil BRANCHP argument." (interactive (let ((granularity (vc-call-backend (vc-responsible-backend default-directory) @@ -2545,17 +2563,17 @@ vc-create-branch ;;;###autoload (defun vc-retrieve-tag (dir name &optional branchp) - "For each file in or below DIR, retrieve their tagged version NAME. + "For each file in or below DIR, retrieve their version identified by tag NAME. NAME can name a branch, in which case this command will switch to the named branch in the directory DIR. Interactively, prompt for DIR only for VCS that works at file level; -otherwise use the repository root of the current buffer. +otherwise use the root directory of the current buffer's VC tree. If NAME is empty, it refers to the latest revisions of the current branch. If locking is used for the files in DIR, then there must not be any locked files at or below DIR (but if NAME is empty, locked files are allowed and simply skipped). -If the prefix argument BRANCHP is given, switch the branch -and check out the files in that branch. +If BRANCHP is non-nil (interactively, the prefix argument), switch to the +branch and check out and update the files to their version on that branch. This function runs the hook `vc-retrieve-tag-hook' when finished." (interactive (let* ((granularity @@ -2596,7 +2614,12 @@ vc-retrieve-tag ;;;###autoload (defun vc-switch-branch (dir name) "Switch to the branch NAME in the directory DIR. -If NAME is empty, it refers to the latest revisions of the current branch. +If NAME is empty, it refers to the latest revision of the current branch. +Interactively, prompt for DIR only for VCS that works at file level; +otherwise use the root directory of the current buffer's VC tree. +Interactively, prompt for the NAME of the branch. +After switching to the branch, check out and update the files to their +version on that branch. Uses `vc-retrieve-tag' with the non-nil arg `branchp'." (interactive (let* ((granularity @@ -2851,8 +2874,8 @@ vc-print-root-log ;;;###autoload (defun vc-print-branch-log (branch) - "Show the change log for BRANCH in a window. -The command prompts for the branch to log." + "Show the change log for BRANCH in another window. +The command prompts for the branch whose change log to show." (interactive (let* ((backend (vc-responsible-backend default-directory)) (rootdir (vc-call-backend backend 'root default-directory))) commit c0d7447e9dc14cca9a71c8cd4a84573c22108662 Author: Eli Zaretskii Date: Fri May 26 10:07:34 2023 +0300 ; * etc/NEWS: Describe the Cairo XCB option. (Bug#63589) diff --git a/etc/NEWS b/etc/NEWS index a29e0a08cfc..a3457d70340 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -91,24 +91,6 @@ available, and includes support for animated WebP images. To disable WebP support, use the '--without-webp' configure flag. Image specifiers can now use ':type webp'. -+++ -** Emacs has been ported to the Haiku operating system. -The configuration process should automatically detect and build for -Haiku. There is also an optional window-system port to Haiku, which -can be enabled by configuring Emacs with the option '--with-be-app', -which will require the Haiku Application Kit development headers and a -C++ compiler to be present on your system. If Emacs is not built with -the option '--with-be-app', the resulting Emacs will only run in -text-mode terminals. - -To enable Cairo support, ensure that the Cairo and FreeType -development files are present on your system, and configure Emacs with -'--with-be-cairo'. - -Unlike X, there is no compile-time option to enable or disable -double-buffering; it is always enabled. To disable it, change the -frame parameter 'inhibit-double-buffering' instead. - --- ** Emacs now installs the ".pdmp" file using a unique fingerprint in the name. The file is typically installed using a file name akin to @@ -126,6 +108,16 @@ option '--without-xinput2' to disable this support. '(featurep 'xinput2)' can be used to test for the presence of XInput 2 support from Lisp programs. +--- +** Emacs can now be optionally built with the Cairo XCB backend. +Configure Emacs with the '--with-cairo-xcb' option to use the Cairo +XCB backend; the default is not to use it. This backend makes Emacs +moderately faster when running over X connections with high latency, +but is currently known to crash when Emacs repeatedly closes and opens +a display connection to the same terminal; this could happen, for +example, if you repeatedly visit files via emacsclient in a single +client frame, each time deleting the frame with 'C-x C-c'. + +++ ** Emacs now supports being built with pure GTK. To use this option, make sure the GTK 3 (version 3.22.23 or later) and @@ -144,6 +136,24 @@ automatically switch to text-mode interface (thus emulating '-nw') if it cannot determine the default display; it will instead complain and ask you to invoke it with the explicit '-nw' option. ++++ +** Emacs has been ported to the Haiku operating system. +The configuration process should automatically detect and build for +Haiku. There is also an optional window-system port to Haiku, which +can be enabled by configuring Emacs with the option '--with-be-app', +which will require the Haiku Application Kit development headers and a +C++ compiler to be present on your system. If Emacs is not built with +the option '--with-be-app', the resulting Emacs will only run in +text-mode terminals. + +To enable Cairo support, ensure that the Cairo and FreeType +development files are present on your system, and configure Emacs with +'--with-be-cairo'. + +Unlike X, there is no compile-time option to enable or disable +double-buffering; it is always enabled. To disable it, change the +frame parameter 'inhibit-double-buffering' instead. + --- ** Emacs no longer reduces the size of the Japanese dictionary. Building Emacs includes generation of a Japanese dictionary, which is commit 42052686752e399e778d33401dd621afbac0071d Author: Po Lu Date: Fri May 26 08:43:18 2023 +0800 Don't mark selection request events * src/pgtkterm.c (mark_pgtkterm): Prevent crash by not marking selection request events, which don't have Lisp_Object members. diff --git a/src/pgtkterm.c b/src/pgtkterm.c index c00e13550bd..f4b05ef9903 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -376,6 +376,13 @@ mark_pgtkterm (void) for (i = 0; i < n; i++) { union buffered_input_event *ev = &evq->q[i]; + + /* Selection requests don't have Lisp object members. */ + + if (ev->ie.kind == SELECTION_REQUEST_EVENT + || ev->ie.kind == SELECTION_CLEAR_EVENT) + continue; + mark_object (ev->ie.x); mark_object (ev->ie.y); mark_object (ev->ie.frame_or_window); commit 9f5249d5c8d193fc59d09b9003d26d1ed0884f2c Author: Po Lu Date: Fri May 26 08:41:31 2023 +0800 Disable cairo-xcb support by default * INSTALL (--with-cairo-xcb): Document new option. * configure.ac (USE_CAIRO_XCB): Implement new option. diff --git a/INSTALL b/INSTALL index 344ae39f464..2bb8df52dc9 100644 --- a/INSTALL +++ b/INSTALL @@ -394,6 +394,12 @@ typical 32-bit host, Emacs integers have 62 bits instead of 30. Use --with-cairo to compile Emacs with Cairo drawing. +Use --with-cairo-xcb to also utilize the Cairo XCB backend on systems +where it is available. While such a configuration is moderately +faster when running over X connections with high latency, it is likely +to crash when a new frame is created on a display connection opened +after a display connection is closed. + Use --with-modules to build Emacs with support for dynamic modules. This needs a C compiler that supports '__attribute__ ((cleanup (...)))', as in GCC 3.4 and later. diff --git a/configure.ac b/configure.ac index 2c80d4cc9aa..7ded5289d31 100644 --- a/configure.ac +++ b/configure.ac @@ -459,6 +459,7 @@ AC_DEFUN OPTION_DEFAULT_ON([lcms2],[don't compile with Little CMS support]) OPTION_DEFAULT_ON([libsystemd],[don't compile with libsystemd support]) OPTION_DEFAULT_ON([cairo],[don't compile with Cairo drawing]) +OPTION_DEFAULT_OFF([cairo-xcb], [use XCB surfaces for Cairo support]) OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support]) OPTION_DEFAULT_OFF([imagemagick],[compile with ImageMagick image support]) OPTION_DEFAULT_ON([native-image-api], [don't use native image APIs (GDI+ on Windows)]) @@ -3607,14 +3608,14 @@ AC_DEFUN CAIRO_MODULE="cairo >= $CAIRO_REQUIRED" EMACS_CHECK_MODULES([CAIRO], [$CAIRO_MODULE]) if test $HAVE_CAIRO = yes; then - CAIRO_XCB_MODULE="cairo-xcb >= $CAIRO_REQUIRED" - EMACS_CHECK_MODULES([CAIRO_XCB], [$CAIRO_XCB_MODULE]) - if test $HAVE_CAIRO_XCB = yes; then - CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XCB_CFLAGS" - CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XCB_LIBS" - AC_DEFINE([USE_CAIRO_XCB], [1], - [Define to 1 if cairo XCB surfaces are available.]) - fi + AS_IF([test "x$with_cairo_xcb" = "xyes"], [ + CAIRO_XCB_MODULE="cairo-xcb >= $CAIRO_REQUIRED" + EMACS_CHECK_MODULES([CAIRO_XCB], [$CAIRO_XCB_MODULE]) + AS_IF([test "x$HAVE_CAIRO_XCB" = "xyes"], [ + CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XCB_CFLAGS" + CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XCB_LIBS" + AC_DEFINE([USE_CAIRO_XCB], [1], + [Define to 1 if cairo XCB surfaces are available.])])]) AC_DEFINE([USE_CAIRO], [1], [Define to 1 if using cairo.]) CFLAGS="$CFLAGS $CAIRO_CFLAGS" LIBS="$LIBS $CAIRO_LIBS" commit e5f42706ce2fd00d1ac9249a8760a88781f09a2f Author: Juri Linkov Date: Thu May 25 21:40:38 2023 +0300 * lisp/progmodes/project.el: Move :safe from defcustom to autoload (bug#63469) (project-vc-ignores, project-vc-merge-submodules) (project-vc-include-untracked, project-vc-name) (project-vc-extra-root-markers, project-kill-buffers-display-buffer-list): Autoload the line that puts 'safe-local-variable' property on defcustom symbol instead of using the :safe keyword. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 35b57ee4819..e2112276379 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -401,8 +401,8 @@ project-vc (defcustom project-vc-ignores nil "List of patterns to add to `project-ignores'." - :type '(repeat string) - :safe #'listp) + :type '(repeat string)) +;;;###autoload(put 'project-vc-ignores 'safe-local-variable #'listp) (defcustom project-vc-merge-submodules t "Non-nil to consider submodules part of the parent project. @@ -411,14 +411,14 @@ project-vc-merge-submodules you might have to restart Emacs to see the effect." :type 'boolean :version "28.1" - :package-version '(project . "0.2.0") - :safe #'booleanp) + :package-version '(project . "0.2.0")) +;;;###autoload(put 'project-vc-merge-submodules 'safe-local-variable #'booleanp) (defcustom project-vc-include-untracked t "When non-nil, the VC-aware project backend includes untracked files." :type 'boolean - :version "29.1" - :safe #'booleanp) + :version "29.1") +;;;###autoload(put 'project-vc-include-untracked 'safe-local-variable #'booleanp) (defcustom project-vc-name nil "When non-nil, the name of the current VC-aware project. @@ -428,8 +428,8 @@ project-vc-name :type '(choice (const :tag "Default to the base name" nil) (string :tag "Custom name")) :version "29.1" - :package-version '(project . "0.9.0") - :safe #'stringp) + :package-version '(project . "0.9.0")) +;;;###autoload(put 'project-vc-name 'safe-local-variable #'stringp) ;; Not using regexps because these wouldn't work in Git pathspecs, in ;; case we decide we need to be able to list nested projects. @@ -456,8 +456,8 @@ project-vc-extra-root-markers variables, such as `project-vc-ignores' or `project-vc-name'." :type '(repeat string) :version "29.1" - :package-version '(project . "0.9.0") - :safe (lambda (val) (and (listp val) (cl-every #'stringp val)))) + :package-version '(project . "0.9.0")) +;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (cl-every #'stringp val)))) ;; FIXME: Using the current approach, major modes are supposed to set ;; this variable to a buffer-local value. So we don't have access to @@ -1453,8 +1453,8 @@ project-kill-buffers-display-buffer-list :type 'boolean :version "29.1" :group 'project - :package-version '(project . "0.8.2") - :safe #'booleanp) + :package-version '(project . "0.8.2")) +;;;###autoload(put 'project-kill-buffers-display-buffer-list 'safe-local-variable #'booleanp) (defun project--buffer-check (buf conditions) "Check if buffer BUF matches any element of the list CONDITIONS. commit 3afe4a42e90f4eb937b81879548ffbfa7e1f6599 Author: Juri Linkov Date: Thu May 25 21:33:11 2023 +0300 * lisp/vc/vc-annotate.el (vc-annotate-mode-menu): Quote vc-annotate-backend. When unquoted it might get the nil value when vc-annotate.el is loaded in non-vc-controlled buffer (bug#63689). diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index 70057a6aac7..d83660f9d79 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -330,7 +330,7 @@ vc-annotate-mode-menu ["Show changeset diff of revision at line" vc-annotate-show-changeset-diff-revision-at-line :enable - (eq 'repository (vc-call-backend ,vc-annotate-backend 'revision-granularity)) + (eq 'repository (vc-call-backend vc-annotate-backend 'revision-granularity)) :help "Visit the diff of the revision at line from its previous revision"] ["Visit revision at line" vc-annotate-find-revision-at-line :help "Visit the revision identified in the current line"])) commit b62a2b08b80ecf855096daf1e9e84b3f7bc7622a Author: Juri Linkov Date: Thu May 25 21:24:23 2023 +0300 Add vc-create/switch/print-branch to menu and update documentation (bug#63690) * doc/emacs/maintaining.texi (VC Change Log): Add 'C-x v b l' (vc-print-branch-log). (Creating Branches): Add @kindex and @findex for vc-create-branch. (Switching Branches): Add @kindex and @findex for vc-switch-branch. * lisp/vc/vc-hooks.el (vc-menu-map): Add menu items for new commands vc-create-branch and vc-switch-branch, and also vc-print-branch-log. * lisp/vc/vc.el (vc-print-branch-log): Improve docstring. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 7d49e28d11f..06f44a88aab 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -999,6 +999,10 @@ VC Change Log Display the change history for the current repository (@code{vc-print-root-log}). +@item C-x v b l +Display the change history for another branch +(@code{vc-print-branch-log}). + @item C-x v I Display the changes that a ``pull'' operation will retrieve (@code{vc-log-incoming}). @@ -1063,6 +1067,13 @@ VC Change Log @file{*vc-change-log*} buffer to reveal the entire log entry for the revision at point. A second @key{RET} hides it again. +@kindex C-x v b l +@findex vc-print-branch-log + @kbd{C-x v b l @var{branch-name} @key{RET}} (@code{vc-print-branch-log}) +displays a @file{*vc-change-log*} buffer showing the history of the +version-controlled directory tree like @code{vc-print-root-log} does, +but in another branch provided as an argument. + @kindex C-x v I @kindex C-x v O @findex vc-log-incoming @@ -1523,6 +1534,8 @@ Switching Branches Mercurial, command @kbd{hg update} is used to switch to another branch. +@kindex C-x v b s +@findex vc-switch-branch The VC command to switch to another branch in the current directory is @kbd{C-x v b s @var{branch-name} @key{RET}} (@code{vc-switch-branch}). @@ -1673,9 +1686,12 @@ Creating Branches if the current revision is 2.5, the branch ID should be 2.5.1, 2.5.2, and so on, depending on the number of existing branches at that point. +@kindex C-x v b c +@findex vc-create-branch This procedure will not work for distributed version control systems like git or Mercurial. For those systems you should use the command -@code{vc-create-branch} (@kbd{C-x v b c}) instead. +@code{vc-create-branch} (@kbd{C-x v b c @var{branch-name} @key{RET}}) +instead. To create a new branch at an older revision (one that is no longer the head of a branch), first select that revision (@pxref{Switching diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index e242d1e48e2..b559a776c09 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -897,6 +897,15 @@ vc-menu-map (bindings--define-key map [vc-create-tag] '(menu-item "Create Tag" vc-create-tag :help "Create version tag")) + (bindings--define-key map [vc-print-branch-log] + '(menu-item "Show Branch History..." vc-print-branch-log + :help "List the change log for a branch")) + (bindings--define-key map [vc-switch-branch] + '(menu-item "Switch Branch..." vc-switch-branch + :help "Switch to another branch")) + (bindings--define-key map [vc-create-branch] + '(menu-item "Create Branch..." vc-create-branch + :help "Make a new branch")) (bindings--define-key map [separator1] menu-bar-separator) (bindings--define-key map [vc-annotate] '(menu-item "Annotate" vc-annotate diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index c64da1233d1..ba981545085 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2851,7 +2851,8 @@ vc-print-root-log ;;;###autoload (defun vc-print-branch-log (branch) - "Show the change log for BRANCH root in a window." + "Show the change log for BRANCH in a window. +The command prompts for the branch to log." (interactive (let* ((backend (vc-responsible-backend default-directory)) (rootdir (vc-call-backend backend 'root default-directory))) commit d292d282292b8ce1f4e1ba97d0110178153f73c5 Author: Eli Zaretskii Date: Thu May 25 20:50:46 2023 +0300 Fix rare crashes in 'try_window_reusing_current_matrix' * src/xdisp.c (try_window_reusing_current_matrix): Make sure we never use a mode-line glyph row to start displaying scrolled-in rows. (Bug#63711) diff --git a/src/xdisp.c b/src/xdisp.c index aeba47e4c16..2ddfdf0d51b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21081,8 +21081,10 @@ try_window_reusing_current_matrix (struct window *w) pt_row = first_row_to_display; } + if (first_row_to_display->y >= yb) + return false; + /* Start displaying at the start of first_row_to_display. */ - eassert (first_row_to_display->y < yb); init_to_row_start (&it, w, first_row_to_display); nrows_scrolled = (MATRIX_ROW_VPOS (first_reusable_row, w->current_matrix) commit 4b3de748b0b04407d2492500c77905de56de1180 Author: Mattias Engdegård Date: Thu May 25 10:22:54 2023 +0200 ; eieio-test-persist.el: namespace hygiene * test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el (hash-equal): Rename to `eieio-test--hash-equal`. diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el index 4e5d2f36cf8..4f13881dbd4 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el @@ -40,7 +40,7 @@ eieio--attribute-to-initarg (car tuple) nil))) -(defun hash-equal (hash1 hash2) +(defun eieio-test--hash-equal (hash1 hash2) "Compare two hash tables to see whether they are equal." (and (= (hash-table-count hash1) (hash-table-count hash2)) @@ -78,7 +78,7 @@ persist-test-save-and-compare (if initarg-p (unless (cond ((and (hash-table-p origvalue) (hash-table-p fromdiskvalue)) - (hash-equal origvalue fromdiskvalue)) + (eieio-test--hash-equal origvalue fromdiskvalue)) (t (equal origvalue fromdiskvalue))) (error "Slot %S Original Val %S != Persistent Val %S" oneslot origvalue fromdiskvalue)) @@ -87,7 +87,7 @@ persist-test-save-and-compare (diskval fromdiskvalue)) (unless (cond ((and (hash-table-p origval) (hash-table-p diskval)) - (hash-equal origval diskval)) + (eieio-test--hash-equal origval diskval)) (t (equal origval diskval))) (error "Slot %S Persistent Val %S != Default Value %S" oneslot diskval origvalue)))))))) commit 709d9020021eaaf1e1475f61b72b2405f4fd0bb3 Author: Michael Albinus Date: Thu May 25 15:40:45 2023 +0200 Make last Tramp change less invasive * lisp/net/tramp.el (tramp-dissect-file-name): Revert last change. (tramp-handle-file-name-as-directory) (tramp-handle-file-name-directory): Let-bind `tramp-default-proxies-alist'. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index dac2bc8c43c..9f868ccdaa0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1681,9 +1681,8 @@ tramp-dissect-file-name localname (file name on remote host), and hop. Unless NODEFAULT is non-nil, method, user and host are expanded -to their default values. Hop is set to nil if NODEFAULT is non-nil. - -For the other file name parts, no default values are used." +to their default values. For the other file name parts, no +default values are used." (save-match-data (unless (tramp-tramp-file-p name) (tramp-user-error nil "Not a Tramp file name: \"%s\"" name)) @@ -1709,8 +1708,7 @@ tramp-dissect-file-name (when (string-match tramp-postfix-ipv6-regexp host) (setq host (replace-match "" nil t host)))) - (if nodefault - (setq hop nil) + (unless nodefault (when hop (setq v (tramp-dissect-hop-name hop) hop (and hop (tramp-make-tramp-hop-name v)))) @@ -3894,8 +3892,10 @@ tramp-handle-file-modes (defun tramp-handle-file-name-as-directory (file) "Like `file-name-as-directory' for Tramp files." ;; `file-name-as-directory' would be sufficient except localname is - ;; the empty string. - (let ((v (tramp-dissect-file-name file t))) + ;; the empty string. Suppress adding a hop to + ;; `tramp-default-proxies-alist' due to non-expanded default values. + (let ((v (tramp-dissect-file-name file t)) + tramp-default-proxies-alist) ;; Run the command on the localname portion only unless we are in ;; completion mode. (tramp-make-tramp-file-name @@ -3985,8 +3985,10 @@ tramp-handle-file-name-directory "Like `file-name-directory' for Tramp files." ;; Everything except the last filename thing is the directory. We ;; cannot apply `with-parsed-tramp-file-name', because this expands - ;; the remote file name parts. - (let ((v (tramp-dissect-file-name file t))) + ;; the remote file name parts. Suppress adding a hop to + ;; `tramp-default-proxies-alist' due to non-expanded default values. + (let ((v (tramp-dissect-file-name file t)) + tramp-default-proxies-alist) ;; Run the command on the localname portion only. If this returns ;; nil, mark also the localname part of `v' as nil. (tramp-make-tramp-file-name commit bdf852d4bc8931346ba87a71a2d5c08617b26a59 Author: João Távora Date: Thu May 25 14:29:45 2023 +0100 Eglot: fix execution of CodeAction commands Reported in https://github.com/joaotavora/eglot/discussions/1225. * lisp/progmodes/eglot.el (eglot-execute): Fix typo. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index cd5831efc48..0140db0c4b3 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -741,7 +741,7 @@ eglot-execute (((Command)) (eglot--request server :workspace/executeCommand action)) (((CodeAction) edit command) (when edit (eglot--apply-workspace-edit edit)) - (when command (eglot--request server :workspace/executeCommand action)))))) + (when command (eglot--request server :workspace/executeCommand command)))))) (cl-defgeneric eglot-initialization-options (server) "JSON object to send under `initializationOptions'." commit 18d7c955b3f6fd9cac4e1688c481fd4b648e1aa5 Author: Brian Leung Date: Sat May 20 01:43:52 2023 -0700 Eglot: Add nickel-mode configuration * lisp/progmodes/eglot.el (eglot-server-programs): Add nls for nickel-mode. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 8df2e52b0e7..cd5831efc48 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -231,6 +231,7 @@ eglot-server-programs (erlang-mode . ("erlang_ls" "--transport" "stdio")) ((yaml-ts-mode yaml-mode) . ("yaml-language-server" "--stdio")) (nix-mode . ,(eglot-alternatives '("nil" "rnix-lsp"))) + (nickel-mode . ("nls")) (gdscript-mode . ("localhost" 6008)) ((fortran-mode f90-mode) . ("fortls")) (futhark-mode . ("futhark" "lsp")) commit a72a1f24fcb56d1a4e622f189d5a56e84f346097 Author: Eli Zaretskii Date: Thu May 25 08:58:42 2023 +0300 ; Fix last change. diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 88873ce5e24..f6b87d1078d 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1,4 +1,4 @@ -2070;;; menu-bar.el --- define a default menu bar -*- lexical-binding: t; -*- +;;; menu-bar.el --- define a default menu bar -*- lexical-binding: t; -*- ;; Copyright (C) 1993-1995, 2000-2023 Free Software Foundation, Inc. commit 5c6517a115d5523ddde43725b415da52ba6ee64c Author: Eli Zaretskii Date: Thu May 25 08:57:28 2023 +0300 ; * lisp/menu-bar.el (popup-menu): Doc fix. diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index d020cf6e90a..88873ce5e24 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1,4 +1,4 @@ -;;; menu-bar.el --- define a default menu bar -*- lexical-binding: t; -*- +2070;;; menu-bar.el --- define a default menu bar -*- lexical-binding: t; -*- ;; Copyright (C) 1993-1995, 2000-2023 Free Software Foundation, Inc. @@ -2567,10 +2567,11 @@ lookup-key-ignore-too-long binding))) (defun popup-menu (menu &optional position prefix from-menu-bar) - "Popup the given menu and call the selected option. + "Popup MENU and call the selected option. MENU can be a keymap, an easymenu-style menu or a list of keymaps as for `x-popup-menu'. -The menu is shown at the place where POSITION specifies. +The menu is shown at the location specified by POSITION, which +defaults to the place of the mouse click that popped the menu. For the form of POSITION, see `popup-menu-normalize-position'. PREFIX is the prefix argument (if any) to pass to the command. FROM-MENU-BAR, if non-nil, means we are dropping one of menu-bar's menus." commit af4791b5706f494d73fd00c391ff867fb2c5a06d Author: Mattias Engdegård Date: Wed May 24 22:36:19 2023 +0200 Fix apparently wrong `delete` and `delq` value discards (bug#61730) * lisp/startup.el (normal-top-level): Update process-environment in case the DISPLAY variable comes first. Also stop iterating over initial-environment once the first DISPLAY is found. * lisp/allout.el (allout-get-configvar-values): * lisp/org/org.el (org-display-inline-remove-overlay): * lisp/progmodes/gdb-mi.el (gdb-get-location): * lisp/progmodes/idlwave.el (idlwave-convert-xml-clean-routine-aliases) (idlwave-convert-xml-clean-sysvar-aliases): * lisp/textmodes/reftex.el (reftex-ref-style-toggle): Update the base variable after performing a destructive deletion, where it was obvious that this was intended. diff --git a/lisp/allout.el b/lisp/allout.el index be2fd632c69..d3203800168 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -6307,7 +6307,7 @@ allout-get-configvar-values (if (yes-or-no-p (format-message "%s entry `%s' is unbound -- remove it? " configvar-name sym)) - (delq sym (symbol-value configvar-name))) + (set configvar-name (delq sym (symbol-value configvar-name)))) (push (symbol-value sym) got))) (reverse got))) ;;;_ : Topics: diff --git a/lisp/org/org.el b/lisp/org/org.el index d3e14fecec3..e42704778bd 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -16422,7 +16422,7 @@ org-display-inline-image--width (defun org-display-inline-remove-overlay (ov after _beg _end &optional _len) "Remove inline-display overlay if a corresponding region is modified." (when (and ov after) - (delete ov org-inline-image-overlays) + (setq org-inline-image-overlays (delete ov org-inline-image-overlays)) ;; Clear image from cache to avoid image not updating upon ;; changing on disk. See Emacs bug#59902. (when (overlay-get ov 'org-image-overlay) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 260b0270831..4428fa72c78 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -3244,7 +3244,8 @@ gdb-get-location (if (re-search-forward gdb-source-file-regexp nil t) (progn (setq source-file (gdb-mi--c-string-from-string (match-string 1))) - (delete (cons bptno "File not found") gdb-location-alist) + (setq gdb-location-alist + (delete (cons bptno "File not found") gdb-location-alist)) (push (cons bptno source-file) gdb-location-alist)) (gdb-resync) (unless (assoc bptno gdb-location-alist) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index cafd7b95da7..488e6aa3d2d 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -4653,7 +4653,7 @@ idlwave-convert-xml-clean-routine-aliases (setcar alias (car x)) (push alias idlwave-system-routines))) (cl-loop for x in remove-list do - (delq x idlwave-system-routines)))) + (setq idlwave-system-routines (delq x idlwave-system-routines))))) (defun idlwave-convert-xml-clean-sysvar-aliases (aliases) ;; Duplicate and trim original routine aliases from rinfo list @@ -4666,7 +4666,8 @@ idlwave-convert-xml-clean-sysvar-aliases (setcar alias (car x)) (push alias idlwave-system-variables-alist))) (cl-loop for x in remove-list do - (delq x idlwave-system-variables-alist)))) + (setq idlwave-system-variables-alist + (delq x idlwave-system-variables-alist))))) (defun idlwave-xml-create-sysvar-alist (xml-entry) diff --git a/lisp/startup.el b/lisp/startup.el index 9ae53f4e50b..835ad785af1 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -837,12 +837,16 @@ normal-top-level (let ((display (frame-parameter nil 'display))) ;; Be careful which DISPLAY to remove from process-environment: follow ;; the logic of `callproc.c'. - (if (stringp display) (setq display (concat "DISPLAY=" display)) - (dolist (varval initial-environment) - (if (string-match "\\`DISPLAY=" varval) - (setq display varval)))) + (if (stringp display) + (setq display (concat "DISPLAY=" display)) + (let ((env initial-environment)) + (while (and env (or (not (string-match "\\`DISPLAY=" (car env))) + (progn + (setq display (car env)) + nil))) + (setq env (cdr env))))) (when display - (delete display process-environment)))) + (setq process-environment (delete display process-environment))))) (startup--honor-delayed-native-compilations)) ;; Precompute the keyboard equivalents in the menu bar items. diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 57284db36b1..916e0d89a1d 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -477,9 +477,9 @@ reftex-ref-style-toggle changed t) (setq list (delete style list)))) (t - (if (member style list) - (delete style list) - (setq list (append list (list style)))) + (setq list (if (member style list) + (delete style list) + (append list (list style)))) (setq reftex-tables-dirty t changed t))) (when changed commit e3987d7e1a1993eb5ff0ac10b2cffcb92dd2a00c Author: Michael Albinus Date: Wed May 24 20:52:25 2023 +0200 Use `small-temporary-file-directory' in Tramp * lisp/net/tramp-fuse.el (tramp-fuse-mount-point): * lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options): Use `small-temporary-file-directory'. diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el index 5c0bb8e8d96..8626610211a 100644 --- a/lisp/net/tramp-fuse.el +++ b/lisp/net/tramp-fuse.el @@ -149,7 +149,8 @@ tramp-fuse-mount-point (when (tramp-file-name-user vec) (concat (tramp-file-name-user-domain vec) "@")) (tramp-file-name-host-port vec)) - tramp-compat-temporary-file-directory))) + (or small-temporary-file-directory + tramp-compat-temporary-file-directory)))) (defconst tramp-fuse-mount-timeout (eval (car (get 'remote-file-name-inhibit-cache 'standard-value)) t) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 0b3ce07d275..25a26d67d6d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4867,8 +4867,11 @@ tramp-ssh-controlmaster-options (if (eq tramp-use-connection-share 'suppress) "none" ;; Hashed tokens are introduced in OpenSSH 6.7. - (if (tramp-ssh-option-exists-p vec "ControlPath=tramp.%C") - "tramp.%%C" "tramp.%%r@%%h:%%p")) + (expand-file-name + (if (tramp-ssh-option-exists-p vec "ControlPath=tramp.%C") + "tramp.%%C" "tramp.%%r@%%h:%%p") + (or small-temporary-file-directory + tramp-compat-temporary-file-directory))) ;; ControlPersist option is introduced in OpenSSH 5.6. (when (and (not (eq tramp-use-connection-share 'suppress)) commit b2b2be98da5825e6bc130999ffe38f5ed615586a Author: Andrea Corallo Date: Wed May 24 17:05:26 2023 +0200 Fix nativecomp ICE compiling structure related code (bug#63674) * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Define the predicate to be effective at compile time as native comp relies on `cl-typep' that relies o predicates to work. * test/src/comp-resources/comp-test-funcs.el (cl-lib): Require. (comp-test-struct): Define struct. (comp-test-63674-1-f): Add new test. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 6590b1baa1e..0b09cd7d225 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -3093,13 +3093,16 @@ cl-defstruct (cons 'and (cdddr pred-form)) `(,predicate cl-x)))) (when pred-form - (push `(,defsym ,predicate (cl-x) + (push `(eval-and-compile + ;; Define the predicate to be effective at compile time + ;; as native comp relies on `cl-typep' that relies on + ;; predicates to be defined as they are registered in + ;; cl-deftype-satisfies. + (,defsym ,predicate (cl-x) (declare (side-effect-free error-free) (pure t)) ,(if (eq (car pred-form) 'and) (append pred-form '(t)) `(and ,pred-form t))) - forms) - (push `(eval-and-compile (define-symbol-prop ',name 'cl-deftype-satisfies ',predicate)) forms)) (let ((pos 0) (descp descs)) diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el index 73da7182a54..d8c72c1a920 100644 --- a/test/src/comp-resources/comp-test-funcs.el +++ b/test/src/comp-resources/comp-test-funcs.el @@ -23,6 +23,8 @@ ;;; Code: +(require 'cl-lib) + (defvar comp-tests-var1 3) (defun comp-tests-varref-f () @@ -530,6 +532,12 @@ comp-test-62537-2-f (comp-test-62537-1-f)) t) +(cl-defstruct comp-test-struct) + +(defun comp-test-63674-1-f (x) + (or + (if (comp-test-struct-p pkg) x) + t)) ;;;;;;;;;;;;;;;;;;;; commit b513036770499cf7981957d6f5f1626b0b5ef45d Author: Stefan Monnier Date: Wed May 24 09:47:27 2023 -0400 * lisp/loadup.el: Don't accidentally reduce `max-lisp-eval-depth` diff --git a/lisp/loadup.el b/lisp/loadup.el index 7044a629848..532d2ca176d 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -103,7 +103,7 @@ ;; During bootstrapping the byte-compiler is run interpreted ;; when compiling itself, which uses a lot more stack ;; than usual. - (setq max-lisp-eval-depth 3400))) + (setq max-lisp-eval-depth (max max-lisp-eval-depth 3400)))) (if (eq t purify-flag) ;; Hash consing saved around 11% of pure space in my tests. commit 73582ed6d4f227216d4c56c3f5f98c56e48796ca Author: Mattias Engdegård Date: Wed May 24 11:30:53 2023 +0200 Use return values of assq-delete-all and assoc-delete-all * lisp/allout-widgets.el (allout-widgets-mode): * lisp/progmodes/eglot.el (eglot-handle-notification): Update variables with the new value, which was probably the intention here. diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 5e137b21fbb..be9cf06c523 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -613,7 +613,8 @@ allout-widgets-mode #'allout-widgets-post-command-business 'local) (remove-hook 'pre-command-hook #'allout-widgets-pre-command-business 'local) - (assq-delete-all 'allout-widgets-mode-inhibit minor-mode-alist) + (setq minor-mode-alist + (assq-delete-all 'allout-widgets-mode-inhibit minor-mode-alist)) (set-buffer-modified-p was-modified)))) ;;;_ > allout-widgets-mode-off (defun allout-widgets-mode-off () diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index a65795f1dfc..8df2e52b0e7 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2277,7 +2277,9 @@ eglot-handle-notification (buffer (find-buffer-visiting path))) (with-current-buffer buffer (cl-loop - initially (assoc-delete-all path flymake-list-only-diagnostics) + initially + (setq flymake-list-only-diagnostics + (assoc-delete-all path flymake-list-only-diagnostics)) for diag-spec across diagnostics collect (eglot--dbind ((Diagnostic) range code message severity source tags) diag-spec commit 212884f2bfed7f00e58aad183edd20ecc2a23e71 Author: Eli Zaretskii Date: Tue May 23 18:05:07 2023 +0300 ; Fix last change. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 82ab48fa514..5b9b5ee4ead 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -521,7 +521,7 @@ The solution is to use gawk (GNU awk). This is known to happen with GnuPG v2.4.1. The only known workaround is to downgrade to a version of GnuPG older than 2.4.1 (or, in the future, upgrade to a newer version which solves the problem, when such -a fixed version becomes available) +a fixed version becomes available). ** Problems with hostname resolution commit 1b9812af80b6ceec8418636dbf84c0fbcd3ab694 Author: Eli Zaretskii Date: Tue May 23 18:04:24 2023 +0300 ; * etc/PROBLEMS: Document problem with GnuPG 2.4.1. (Bug#63256) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index c0cb5b0d8bb..82ab48fa514 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -516,6 +516,13 @@ directory copy is ineffective. This is due to an arbitrary limit in certain versions of awk. The solution is to use gawk (GNU awk). +*** Saving, via EasyPG, a file encrypted with GnuPG hangs + +This is known to happen with GnuPG v2.4.1. The only known workaround +is to downgrade to a version of GnuPG older than 2.4.1 (or, in the +future, upgrade to a newer version which solves the problem, when such +a fixed version becomes available) + ** Problems with hostname resolution *** Emacs does not know your host's fully-qualified domain name. commit 765edc204d45c0eb6d31e92c661355c1bd7315a9 Author: Eli Zaretskii Date: Tue May 23 17:53:07 2023 +0300 ; Support SQLite3 extensions on macOS * src/sqlite.c (Fsqlite_load_extension): Support *.dylib extensions. (Bug#63653) diff --git a/src/sqlite.c b/src/sqlite.c index 852e3746ef4..fd528f2b0d5 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -730,10 +730,12 @@ DEFUN ("sqlite-load-extension", Fsqlite_load_extension, bool do_allow = false; for (const char **allow = allowlist; *allow; allow++) { - if (strlen (*allow) < strlen (name) - && !strncmp (*allow, name, strlen (*allow)) - && (!strcmp (name + strlen (*allow), ".so") - || !strcasecmp (name + strlen (*allow), ".dll"))) + ptrdiff_t allow_len = strlen (*allow); + if (allow_len < strlen (name) + && !strncmp (*allow, name, allow_len) + && (!strcmp (name + allow_len, ".so") + ||!strcmp (name + allow_len, ".dylib") + || !strcasecmp (name + allow_len, ".dll"))) { do_allow = true; break; commit 5aadb87d6f6e3d9d755d4b6f6d124040c1bcfeee Author: Eli Zaretskii Date: Tue May 23 17:44:23 2023 +0300 Fix 'use-dialog-box-p' and friends * lisp/subr.el (use-dialog-box-p): Use dialog boxes also when invoked from some window-system gesture. (Bug#63655) (y-or-n-p): Fix the description in the doc string of conditions under which a dialog box will be used. * src/fns.c (Fyes_or_no_p): Use the same condition for dialog boxes as in 'use-dialog-box-p'. Fix the description in the doc string of conditions under which a dialog box will be used. * doc/lispref/minibuf.texi (Multiple Queries, Yes-or-No Queries): Fix the description of conditions under which a dialog box will be used. diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index a4916ecda30..9a386ff310d 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -2174,13 +2174,14 @@ Yes-or-No Queries more momentous questions, since it requires three or four characters to answer. - If either of these functions is called in a command that was invoked -using the mouse---more precisely, if @code{last-nonmenu-event} -(@pxref{Command Loop Info}) is either @code{nil} or a list---then it -uses a dialog box or pop-up menu to ask the question. Otherwise, it -uses keyboard input. You can force use either of the mouse or of keyboard -input by binding @code{last-nonmenu-event} to a suitable value around -the call. + If either of these functions is called in a command that was +invoked using the mouse or some other window-system gesture, or in a +command invoked via a menu, then they use a dialog box or pop-up menu +to ask the question if dialog boxes are supported. Otherwise, they +use keyboard input. You can force use either of the mouse or of +keyboard input by binding @code{last-nonmenu-event} to a suitable +value around the call---bind it to @code{t} to force keyboard +interaction, and to a list to force dialog boxes. Both @code{yes-or-no-p} and @code{y-or-n-p} use the minibuffer. @@ -2378,13 +2379,14 @@ Multiple Queries prompting. But if @var{no-cursor-in-echo-area} is non-@code{nil}, it does not do that. -If @code{map-y-or-n-p} is called in a command that was invoked using the -mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command -Loop Info}) is either @code{nil} or a list---then it uses a dialog box -or pop-up menu to ask the question. In this case, it does not use -keyboard input or the echo area. You can force use either of the mouse or -of keyboard input by binding @code{last-nonmenu-event} to a suitable -value around the call. +If @code{map-y-or-n-p} is called in a command that was invoked using +the mouse or some other window-system gesture, or a command invoked +via a menu, then it uses a dialog box or pop-up menu to ask the +question if dialog boxes are supported. In this case, it does not use +keyboard input or the echo area. You can force use either of the +mouse or of keyboard input by binding @code{last-nonmenu-event} to a +suitable value around the call---bind it to @code{t} to force keyboard +interaction, and to a list to force dialog boxes. The return value of @code{map-y-or-n-p} is the number of objects acted on. @end defun diff --git a/lisp/subr.el b/lisp/subr.el index 52227b5261c..950902039b1 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3544,6 +3544,8 @@ use-dialog-box-p "Return non-nil if the current command should prompt the user via a dialog box." (and last-input-event ; not during startup (or (consp last-nonmenu-event) ; invoked by a mouse event + (and (null last-nonmenu-event) + (consp last-input-event)) from--tty-menu-p) ; invoked via TTY menu use-dialog-box)) @@ -3574,8 +3576,9 @@ y-or-n-p responses, perform the requested window recentering or scrolling and ask again. -Under a windowing system a dialog box will be used if `last-nonmenu-event' -is nil and `use-dialog-box' is non-nil. +If dialog boxes are supported, this function will use a dialog box +if `use-dialog-box' is non-nil and the last input event was produced +by a mouse, or by some window-system gesture, or via a menu. By default, this function uses the minibuffer to read the key. If `y-or-n-p-use-read-key' is non-nil, `read-key' is used diff --git a/src/fns.c b/src/fns.c index e8cd6211d6d..2ed62d6e8c6 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3185,16 +3185,21 @@ DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, 1, 0, If the `use-short-answers' variable is non-nil, instead of asking for \"yes\" or \"no\", this function will ask for \"y\" or \"n\". -If dialog boxes are supported, a dialog box will be used -if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) +If dialog boxes are supported, this function will use a dialog box +if `use-dialog-box' is non-nil and the last input event was produced +by a mouse, or by some window-system gesture, or via a menu. */) (Lisp_Object prompt) { - Lisp_Object ans; + Lisp_Object ans, val; CHECK_STRING (prompt); - if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) - && use_dialog_box && ! NILP (last_input_event)) + if (!NILP (last_input_event) + && (CONSP (last_nonmenu_event) + || (NILP (last_nonmenu_event) && CONSP (last_input_event)) + || (val = find_symbol_value (Qfrom__tty_menu_p), + (!NILP (val) && !EQ (val, Qunbound)))) + && use_dialog_box) { Lisp_Object pane, menu, obj; redisplay_preserve_echo_area (4); @@ -6358,4 +6363,5 @@ syms_of_fns (void) defsubr (&Sbuffer_line_statistics); DEFSYM (Qreal_this_command, "real-this-command"); + DEFSYM (Qfrom__tty_menu_p, "from--tty-menu-p"); } commit 9ad997cd68981fe6c6933b6977fdae23e84e6a75 Author: Andrea Corallo Date: Tue May 23 15:13:08 2023 +0200 * test/src/comp-tests.el: Add some ret type tests for non builtin types diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 4682cac450e..673a9342f1f 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -875,6 +875,8 @@ comp-tests-check-ret-type-spec ret-type)))) (cl-eval-when (compile eval load) + (cl-defstruct comp-foo a b) + (cl-defstruct (comp-bar (:include comp-foo)) c) (defconst comp-tests-type-spec-tests ;; Why we quote everything here, you ask? So that values of ;; `most-positive-fixnum' and `most-negative-fixnum', which can be @@ -1404,7 +1406,39 @@ comp-tests-check-ret-type-spec (if (eq x 0) (error "") (1+ x))) - 'number))) + 'number) + + ;; 75 + ((defun comp-tests-ret-type-spec-f () + (make-comp-foo)) + 'comp-foo) + + ;; 76 + ((defun comp-tests-ret-type-spec-f () + (make-comp-bar)) + 'comp-bar) + + ;; 77 + ((defun comp-tests-ret-type-spec-f (x) + (setf (comp-foo-a x) 2) + x) + 'comp-foo) + + ;; 78 + ((defun comp-tests-ret-type-spec-f (x) + (if x + (if (> x 11) + x + (make-comp-foo)) + (make-comp-bar))) + '(or comp-foo float (integer 12 *))) + + ;; 79 + ((defun comp-tests-ret-type-spec-f (x) + (if (comp-foo-p x) + x + (error ""))) + 'comp-foo))) (defun comp-tests-define-type-spec-test (number x) `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) () commit 6c781b5d252057e04c612d0a2e3e10b91a1cfa96 Author: Andrea Corallo Date: Wed May 17 18:00:24 2023 +0200 comp: Propagate pre slot access type check * lisp/loadup.el (max-lisp-eval-depth): Increase `max-lisp-eval-depth' to 3400. * lisp/emacs-lisp/comp.el (comp-add-cond-cstrs): Pattern match pre slot access type check and add constraint. * lisp/emacs-lisp/comp-cstr.el (comp-cstr-cl-tag-p) (comp-cstr-cl-tag): New functions. * lisp/emacs-lisp/comp.el (make-comp-mvar): Add neg parameter. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 35e9ac45919..e9132552506 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -895,6 +895,23 @@ comp-cstr-cons-p (null (neg cstr)) (equal (typeset cstr) '(cons))))) +;; Move to comp.el? +(defsubst comp-cstr-cl-tag-p (cstr) + "Return non-nil if CSTR is a CL tag." + (with-comp-cstr-accessors + (and (null (range cstr)) + (null (neg cstr)) + (null (typeset cstr)) + (length= (valset cstr) 1) + (string-match (rx "cl-struct-" (group-n 1 (1+ not-newline)) "-tags") + (symbol-name (car (valset cstr))))))) + +(defsubst comp-cstr-cl-tag (cstr) + "If CSTR is a CL tag return its tag name." + (with-comp-cstr-accessors + (and (comp-cstr-cl-tag-p cstr) + (intern (match-string 1 (symbol-name (car (valset cstr)))))))) + (defun comp-cstr-= (dst op1 op2) "Constraint OP1 being = OP2 setting the result into DST." (with-comp-cstr-accessors diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index fe72f0e73a4..8e59c06d40e 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1543,7 +1543,7 @@ comp-callref for sp from stack-off collect (comp-slot-n sp)))) -(cl-defun make-comp-mvar (&key slot (constant nil const-vld) type) +(cl-defun make-comp-mvar (&key slot (constant nil const-vld) type neg) "`comp-mvar' initializer." (let ((mvar (make--comp-mvar :slot slot))) (when const-vld @@ -1551,6 +1551,8 @@ make-comp-mvar (setf (comp-cstr-imm mvar) constant)) (when type (setf (comp-mvar-typeset mvar) (list type))) + (when neg + (setf (comp-mvar-neg mvar) t)) mvar)) (defun comp-new-frame (size vsize &optional ssa) @@ -2546,6 +2548,19 @@ comp-add-cond-cstrs for insns-seq on (comp-block-insns b) do (pcase insns-seq + (`((set ,(and (pred comp-mvar-p) mvar-tested-copy) + ,(and (pred comp-mvar-p) mvar-tested)) + (set ,(and (pred comp-mvar-p) mvar-1) + (call type-of ,(and (pred comp-mvar-p) mvar-tested-copy))) + (set ,(and (pred comp-mvar-p) mvar-2) + (call symbol-value ,(and (pred comp-cstr-cl-tag-p) mvar-tag))) + (set ,(and (pred comp-mvar-p) mvar-3) + (call memq ,(and (pred comp-mvar-p) mvar-1) ,(and (pred comp-mvar-p) mvar-2))) + (cond-jump ,(and (pred comp-mvar-p) mvar-3) ,(pred comp-mvar-p) ,bb1 ,bb2)) + (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag))) + (comp-block-insns (comp-add-cond-cstrs-target-block b bb2))) + (push `(assume ,mvar-tested ,(make-comp-mvar :type (comp-cstr-cl-tag mvar-tag) :neg t)) + (comp-block-insns (comp-add-cond-cstrs-target-block b bb1)))) (`((set ,(and (pred comp-mvar-p) cmp-res) (,(pred comp-call-op-p) ,(and (or (pred comp-equality-fun-p) diff --git a/lisp/loadup.el b/lisp/loadup.el index 1cc70348267..7044a629848 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -103,7 +103,7 @@ ;; During bootstrapping the byte-compiler is run interpreted ;; when compiling itself, which uses a lot more stack ;; than usual. - (setq max-lisp-eval-depth 2200))) + (setq max-lisp-eval-depth 3400))) (if (eq t purify-flag) ;; Hash consing saved around 11% of pure space in my tests. commit d03dd07774acfa690e5b63a7dbf81fb319aeedf4 Author: Andrea Corallo Date: Wed Aug 24 23:31:28 2022 +0200 comp: Make use of predicates in propagation for non builtin types * lisp/emacs-lisp/comp-cstr.el (comp-cstr-ctxt): Add `pred-type-h' slot. * lisp/emacs-lisp/comp.el (comp-known-predicate-p) (comp-pred-to-cstr): Update. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 869b0619160..35e9ac45919 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -107,6 +107,14 @@ comp-cstr-ctxt (mapcar #'comp--cl-class-hierarchy (comp--all-classes))) :type list :documentation "Type hierarchy.") + (pred-type-h (cl-loop with h = (make-hash-table :test #'eq) + for class-name in (comp--all-classes) + for pred = (get class-name 'cl-deftype-satisfies) + when pred + do (puthash pred class-name h) + finally return h) + :type hash-table + :documentation "Hash pred -> type.") (union-typesets-mem (make-hash-table :test #'equal) :type hash-table :documentation "Serve memoization for `comp-union-typesets'.") diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 289c5bf2ac4..fe72f0e73a4 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -641,11 +641,14 @@ comp-known-predicates-h (defun comp-known-predicate-p (predicate) "Return t if PREDICATE is known." - (when (gethash predicate comp-known-predicates-h) t)) + (when (or (gethash predicate comp-known-predicates-h) + (gethash predicate (comp-cstr-ctxt-pred-type-h comp-ctxt))) + t)) (defun comp-pred-to-cstr (predicate) "Given PREDICATE, return the corresponding constraint." - (gethash predicate comp-known-predicates-h)) + (or (gethash predicate comp-known-predicates-h) + (gethash predicate (comp-cstr-ctxt-pred-type-h comp-ctxt)))) (defconst comp-symbol-values-optimizable '(most-positive-fixnum most-negative-fixnum) commit f4de81af8fc54ef278cdb76fbc5885ed7d05b2d7 Author: Andrea Corallo Date: Wed Aug 24 18:41:19 2022 +0200 * lisp/emacs-lisp/comp.el (comp-fwprop-call): Extend to understand `record' diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 2e07b0b0e60..289c5bf2ac4 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3198,7 +3198,11 @@ comp-fwprop-call (+ (comp-cstr-add lval args)) (- (comp-cstr-sub lval args)) (1+ (comp-cstr-add lval `(,(car args) ,comp-cstr-one))) - (1- (comp-cstr-sub lval `(,(car args) ,comp-cstr-one)))))) + (1- (comp-cstr-sub lval `(,(car args) ,comp-cstr-one))) + (record (when (comp-cstr-imm-vld-p (car args)) + (comp-cstr-shallow-copy lval + (comp-type-spec-to-cstr + (comp-cstr-imm (car args))))))))) (defun comp-fwprop-insn (insn) "Propagate within INSN." commit 92ccb6ba83076a40f3bfc7906913346a5b3a7a92 Author: Andrea Corallo Date: Wed Aug 24 18:08:37 2022 +0200 comp: Account non builtin types in type hierarchy * lisp/emacs-lisp/cl-macs.el (cl--struct-all-parents): Add comment. * lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class): Likewise. * lisp/emacs-lisp/comp-cstr.el (comp--cl-class-hierarchy) (comp--all-classes): New functions. (comp-cstr-ctxt): Add `typeof-types' field. * lisp/emacs-lisp/comp-cstr.el (comp-supertypes) (comp-union-typesets): Update to use non builtin types. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 8fdafe18c50..6590b1baa1e 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -3249,6 +3249,7 @@ cl-defstruct ;;; Add cl-struct support to pcase +;;In use by comp.el (defun cl--struct-all-parents (class) (when (cl--struct-class-p class) (let ((res ()) diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 5235be52996..f410270d340 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -113,6 +113,7 @@ cl-struct-cl-structure-object-tags (record 'cl-slot-descriptor name initform type props))) +;; In use by comp.el (defun cl--struct-get-class (name) (or (if (not (symbolp name)) name) (cl--find-class name) diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index d4200c16c19..869b0619160 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -86,7 +86,27 @@ comp-cstr-f (ret nil :type (or comp-cstr comp-cstr-f) :documentation "Returned value.")) +(defun comp--cl-class-hierarchy (x) + "Given a class name `x' return its hierarchy." + `(,@(mapcar #'cl--struct-class-name (cl--struct-all-parents + (cl--struct-get-class x))) + atom + t)) + +(defun comp--all-classes () + "Return all non built-in type names currently defined." + (let (res) + (mapatoms (lambda (x) + (when (cl-find-class x) + (push x res))) + obarray) + res)) + (cl-defstruct comp-cstr-ctxt + (typeof-types (append comp--typeof-builtin-types + (mapcar #'comp--cl-class-hierarchy (comp--all-classes))) + :type list + :documentation "Type hierarchy.") (union-typesets-mem (make-hash-table :test #'equal) :type hash-table :documentation "Serve memoization for `comp-union-typesets'.") @@ -230,7 +250,7 @@ comp-supertypes (cl-loop named outer with found = nil - for l in comp--typeof-builtin-types + for l in (comp-cstr-ctxt-typeof-types comp-ctxt) do (cl-loop for x in l for i from (length l) downto 0 @@ -273,7 +293,7 @@ comp-union-typesets (cl-loop with types = (apply #'append typesets) with res = '() - for lane in comp--typeof-builtin-types + for lane in (comp-cstr-ctxt-typeof-types comp-ctxt) do (cl-loop with last = nil for x in lane commit 87da87730f9f69fa29a73ac504b690c40b1bc98f Author: Michael Albinus Date: Tue May 23 15:32:20 2023 +0200 Improve check for ANSI control escape sequences in Tramp * lisp/net/tramp-sh.el (tramp-barf-if-no-shell-prompt): Remove `ansi-color-control-seq-regexp'. * lisp/net/tramp.el (tramp-terminal-type): Fix docstring. (tramp-process-one-action): Delete ANSI control escape sequences in buffer. (Bug#63539) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index d4933ad7ba6..0b3ce07d275 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4316,7 +4316,6 @@ tramp-barf-if-no-shell-prompt proc timeout (rx (| (regexp shell-prompt-pattern) (regexp tramp-shell-prompt-pattern)) - (? (regexp ansi-color-control-seq-regexp)) eos)) (error (delete-process proc) @@ -5294,10 +5293,10 @@ tramp-wait-for-output (tramp-error proc 'file-error "Process `%s' not available, try again" proc)) (with-current-buffer (process-buffer proc) (let* (;; Initially, `tramp-end-of-output' is "#$ ". There might - ;; be leading escape sequences, which must be ignored. - ;; Busyboxes built with the EDITING_ASK_TERMINAL config - ;; option send also escape sequences, which must be - ;; ignored. + ;; be leading ANSI control escape sequences, which must be + ;; ignored. Busyboxes built with the EDITING_ASK_TERMINAL + ;; config option send also ANSI control escape sequences, + ;; which must be ignored. (regexp (rx (* (not (any "#$\n"))) (literal tramp-end-of-output) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index f986d65d944..b27465a98fa 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -697,7 +697,7 @@ tramp-yn-prompt-regexp (defcustom tramp-terminal-type "dumb" "Value of TERM environment variable for logging in to remote host. Because Tramp wants to parse the output of the remote shell, it is easily -confused by ANSI color escape sequences and suchlike. Often, shell init +confused by ANSI control escape sequences and suchlike. Often, shell init files conditionalize this setup based on the TERM environment variable." :group 'tramp :type 'string) @@ -5709,18 +5709,17 @@ tramp-process-one-action "Wait for output from the shell and perform one action. See `tramp-process-actions' for the format of ACTIONS." (let ((case-fold-search t) - (shell-prompt-pattern - (rx (regexp shell-prompt-pattern) - (? (regexp ansi-color-control-seq-regexp)))) - (tramp-shell-prompt-pattern - (rx (regexp tramp-shell-prompt-pattern) - (? (regexp ansi-color-control-seq-regexp)))) tramp-process-action-regexp found todo item pattern action) (while (not found) ;; Reread output once all actions have been performed. ;; Obviously, the output was not complete. (while (tramp-accept-process-output proc)) + ;; Remove ANSI control escape sequences. + (with-current-buffer (tramp-get-connection-buffer vec) + (goto-char (point-min)) + (while (re-search-forward ansi-color-control-seq-regexp nil t) + (replace-match ""))) (setq todo actions) (while todo (setq item (pop todo) @@ -6280,7 +6279,7 @@ tramp-convert-file-attributes (with-tramp-file-property ,vec ,localname "file-attributes" (when-let ((attr ,attr)) (save-match-data - ;; Remove color escape sequences from symlink. + ;; Remove ANSI control escape sequences from symlink. (when (stringp (car attr)) (while (string-match ansi-color-control-seq-regexp (car attr)) (setcar attr (replace-match "" nil nil (car attr))))) commit 1d5b164109b59559d34c545c2a163fa067ca22b2 Author: Robert Pluim Date: Tue May 23 15:01:11 2023 +0200 Stop adding the package directory to the load path The generated autoloads files for packages have been updating the load-path for the last decade. * lisp/emacs-lisp/package.el (package-activate-1): Don't update load-path with package directory. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 78017b77677..3d3158111b2 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -901,8 +901,7 @@ package-activate-1 (when reload (package--reload-previously-loaded pkg-desc)) (with-demoted-errors "Error loading autoloads: %s" - (load (package--autoloads-file-name pkg-desc) nil t)) - (add-to-list 'load-path (directory-file-name pkg-dir))) + (load (package--autoloads-file-name pkg-desc) nil t))) ;; Add info node. (when (file-exists-p (expand-file-name "dir" pkg-dir)) ;; FIXME: not the friendliest, but simple. commit 0abb79ca09a9d0118e2bae7a4d00cd8f8a537795 Author: Stefan Monnier Date: Mon May 22 18:49:26 2023 +0200 Avoid duplicates when adding package dirs to load-path Do not merge to master, we're going to delete this code there. * lisp/emacs-lisp/package.el (package-activate-1): Check if the path we're about to add is already in 'load-path', since package autoload files have been updating 'load-path' for a decade. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 0d90e4a4059..340ca9400fa 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -904,7 +904,12 @@ package-activate-1 (package--reload-previously-loaded pkg-desc)) (with-demoted-errors "Error loading autoloads: %s" (load (package--autoloads-file-name pkg-desc) nil t)) - (add-to-list 'load-path (directory-file-name pkg-dir))) + ;; FIXME: Since 2013 (commit 4fac34cee97a), the autoload files take + ;; care of changing the `load-path', so maybe it's time to + ;; remove this fallback code? + (unless (or (member (file-name-as-directory pkg-dir) load-path) + (member (directory-file-name pkg-dir) load-path)) + (add-to-list 'load-path pkg-dir))) ;; Add info node. (when (file-exists-p (expand-file-name "dir" pkg-dir)) ;; FIXME: not the friendliest, but simple. commit 6f6071c52616cc30bc28083688a3ad8d70ce713e Author: Robert Pluim Date: Mon May 22 15:44:21 2023 +0200 Avoid duplicate load-path entry when generating package autoloads 'file-name-directory' produces a path ending in '/', so that needs to be run through 'directory-file-name' to avoid duplicate entries in 'load-path'. (Bug#63625) * lisp/emacs-lisp/package.el (package-generate-autoloads): Call 'directory-file-name' on the directory of 'load-file-name'. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 293c1c39ca1..0d90e4a4059 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1110,8 +1110,12 @@ package-generate-autoloads ;; Add the directory that will contain the autoload file to ;; the load path. We don't hard-code `pkg-dir', to avoid ;; issues if the package directory is moved around. - (or (and load-file-name (file-name-directory load-file-name)) - (car load-path))))) + ;; `loaddefs-generate' has code to do this for us, but it's + ;; not currently exposed. (Bug#63625) + (or (and load-file-name + (directory-file-name + (file-name-directory load-file-name))) + (car load-path))))) (let ((buf (find-buffer-visiting output-file))) (when buf (kill-buffer buf))) auto-name)) commit 117b29c6f6681e4ae0710a9f90f1b8d274afc7c0 Author: Eli Zaretskii Date: Tue May 23 14:58:39 2023 +0300 ; Improve documentation of Isearch command properties * doc/emacs/display.texi (Scrolling): * doc/emacs/search.texi (Not Exiting Isearch): Improve documentation and indexing of 'scroll-command', 'isearch-scroll', and 'isearch-move' properties. diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 6b2eb014c82..fa8ca4cbf17 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -127,7 +127,10 @@ Scrolling scroll commands documented in this section, as well as scrolling with the mouse wheel (@pxref{Mouse Commands}); in general, it affects any command that has a non-@code{nil} @code{scroll-command} property. -@xref{Property Lists,,, elisp, The Emacs Lisp Reference Manual}. +@xref{Property Lists,,, elisp, The Emacs Lisp Reference Manual}. The +same property also causes Emacs not to exit incremental search when +one of these commands is invoked and @code{isearch-allow-scroll} is +non-@code{nil} (@pxref{Not Exiting Isearch}). @vindex fast-but-imprecise-scrolling Sometimes, particularly when you hold down keys such as @kbd{C-v} diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index fb79fe8f3fc..45378d95f65 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -587,26 +587,30 @@ Not Exiting Isearch @item Scrolling Commands @cindex scrolling commands, during incremental search @vindex isearch-allow-scroll - Normally, scrolling commands exit incremental search. If you change -the variable @code{isearch-allow-scroll} to a non-@code{nil} value, -that enables the use of the scroll-bar, as well as keyboard scrolling -commands like @kbd{C-v}, @kbd{M-v}, and @kbd{C-l} (@pxref{Scrolling}). -This applies only to calling these commands via their bound key -sequences---typing @kbd{M-x} will still exit the search. You can give -prefix arguments to these commands in the usual way. This feature -normally won't let you scroll the current match out of visibility; but -if you customize @code{isearch-allow-scroll} to the special value -@code{unlimited}, that restriction is lifted. - +@cindex @code{scroll-command} property, and incremental search + Normally, scrolling commands exit incremental search. But if you +change the variable @code{isearch-allow-scroll} to a non-@code{nil} +value, that enables the use of the scroll-bar, as well as keyboard +scrolling commands like @kbd{C-v}, @kbd{M-v}, and @kbd{C-l} +(@pxref{Scrolling}), which have a non-@code{nil} @code{scroll-command} +property, without exiting the search. This applies only to calling +these commands via their bound key sequences---typing @kbd{M-x} will +still exit the search. You can give prefix arguments to these +commands in the usual way. This feature normally won't let you scroll +the current match out of visibility; but if you customize +@code{isearch-allow-scroll} to the special value @code{unlimited}, +that restriction is lifted. + +@cindex @code{isearch-scroll} property +@cindex prevent commands from exiting incremental search The @code{isearch-allow-scroll} feature also affects some other commands, such as @kbd{C-x 2} (@code{split-window-below}) and @kbd{C-x ^} (@code{enlarge-window}), which don't exactly scroll but do -affect where the text appears on the screen. It applies to any -command whose name has a non-@code{nil} @code{isearch-scroll} -property. So you can control which commands are affected by changing -these properties. +affect where the text appears on the screen. In fact, it affects +any command that has a non-@code{nil} @code{isearch-scroll} property. +So you can control which commands are affected by changing these +properties. -@cindex prevent commands from exiting incremental search For example, to make @kbd{C-h l} usable within an incremental search in all future Emacs sessions, use @kbd{C-h c} to find what command it runs (@pxref{Key Help}), which is @code{view-lossage}. Then you can @@ -643,6 +647,7 @@ Not Exiting Isearch typing cursor motion commands. It will yank text that ends at the new position after moving point in the current buffer. +@cindex @code{isearch-move} property When @code{isearch-yank-on-move} is @code{t}, you can extend the search string without using the shift key for cursor motion commands, but it applies only for certain motion command that have the commit a347b26cba2124496b1fa5adb75f43c8a05842a6 Author: Eli Zaretskii Date: Tue May 23 14:30:31 2023 +0300 Disable loading SQLite3 extensions when SQLite3 version is too old * src/sqlite.c (HAVE_LOAD_EXTENSION): Define to 1 only if enabling/disabling extension loading is supported as well. (load_dll_functions, Fsqlite_load_extension): Condition on HAVE_LOAD_EXTENSION, not on HAVE_SQLITE3_LOAD_EXTENSION. (Bug#63653) diff --git a/src/sqlite.c b/src/sqlite.c index 77ce61ba657..852e3746ef4 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -32,6 +32,17 @@ Copyright (C) 2021-2023 Free Software Foundation, Inc. #include +/* Support for loading SQLite extensions requires the ability to + enable and disable loading of extensions (by default this is + disabled, and we want to keep it that way). The required macro is + available since SQLite 3.13. */ +# if defined HAVE_SQLITE3_LOAD_EXTENSION && \ + defined SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION +# define HAVE_LOAD_EXTENSION 1 +# else +# define HAVE_LOAD_EXTENSION 0 +# endif + #ifdef WINDOWSNT # include @@ -77,7 +88,7 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_exec, DEF_DLL_FN (SQLITE_API int, sqlite3_prepare_v2, (sqlite3*, const char*, int, sqlite3_stmt**, const char**)); -# ifdef HAVE_SQLITE3_LOAD_EXTENSION +# if HAVE_LOAD_EXTENSION DEF_DLL_FN (SQLITE_API int, sqlite3_load_extension, (sqlite3*, const char*, const char*, char**)); # undef sqlite3_load_extension @@ -175,7 +186,7 @@ load_dll_functions (HMODULE library) LOAD_DLL_FN (library, sqlite3_column_text); LOAD_DLL_FN (library, sqlite3_column_name); LOAD_DLL_FN (library, sqlite3_exec); -# ifdef HAVE_SQLITE3_LOAD_EXTENSION +# if HAVE_LOAD_EXTENSION LOAD_DLL_FN (library, sqlite3_load_extension); LOAD_DLL_FN (library, sqlite3_db_config); # endif @@ -675,7 +686,7 @@ DEFUN ("sqlite-pragma", Fsqlite_pragma, Ssqlite_pragma, 2, 2, 0, SSDATA (concat2 (build_string ("PRAGMA "), pragma))); } -#ifdef HAVE_SQLITE3_LOAD_EXTENSION +#if HAVE_LOAD_EXTENSION DEFUN ("sqlite-load-extension", Fsqlite_load_extension, Ssqlite_load_extension, 2, 2, 0, doc: /* Load an SQlite MODULE into DB. @@ -750,7 +761,7 @@ DEFUN ("sqlite-load-extension", Fsqlite_load_extension, } return Qnil; } -#endif /* HAVE_SQLITE3_LOAD_EXTENSION */ +#endif /* HAVE_LOAD_EXTENSION */ DEFUN ("sqlite-next", Fsqlite_next, Ssqlite_next, 1, 1, 0, doc: /* Return the next result set from SET. @@ -860,7 +871,7 @@ syms_of_sqlite (void) defsubr (&Ssqlite_commit); defsubr (&Ssqlite_rollback); defsubr (&Ssqlite_pragma); -#ifdef HAVE_SQLITE3_LOAD_EXTENSION +#if HAVE_LOAD_EXTENSION defsubr (&Ssqlite_load_extension); #endif defsubr (&Ssqlite_next); commit d4ff1d74209e97730c52ddd50c4d643c79087a33 Author: Spencer Baugh Date: Fri May 12 15:28:06 2023 -0400 Use faster option for running vc-hg status (Bug#63470) In modern Mercurial, removing the "re:" "-I" "." options provides a 10x-20x speedup because it allows the Rust implementation of "hg status" to be used. * lisp/vc/vc-hg.el (vc-hg--program-version): Add. (vc-hg-dir-status-files): Use --config commands.status.relative=1 to make paths relative when available. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 78480fd8062..182d76882bb 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1372,17 +1372,28 @@ vc-hg-after-dir-status ;; Follows vc-exec-after. (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) +(defvar vc-hg--program-version nil) + +(defun vc-hg--program-version () + (or vc-hg--program-version + (setq vc-hg--program-version + (with-temp-buffer + (condition-case _ (vc-hg-command t 0 nil "version") + (error "0") + (:success + (goto-char (point-min)) + (re-search-forward "Mercurial Distributed SCM (version \\([0-9][0-9.]+\\)") + (string-trim-right (match-string 1) "\\."))))))) + (defun vc-hg-dir-status-files (dir files update-function) ;; XXX: We can't pass DIR directly to 'hg status' because that ;; returns all ignored files if FILES is non-nil (bug#22481). (let ((default-directory dir)) - ;; TODO: Use "--config 'status.relative=1'" instead of "re:" - ;; when we're allowed to depend on Mercurial 4.2+ - ;; (it's a bit faster). - (vc-hg-command (current-buffer) 'async files - "status" "re:" "-I" "." - (concat "-mardu" (if files "i")) - "-C")) + (apply #'vc-hg-command (current-buffer) 'async files + "status" (concat "-mardu" (if files "i")) "-C" + (if (version<= "4.2" (vc-hg--program-version)) + '("--config" "commands.status.relative=1") + '("re:" "-I" ".")))) (vc-run-delayed (vc-hg-after-dir-status update-function))) commit fe22bf503fb724816a6c629e2e6d21c1edf8b5f7 Author: Eli Zaretskii Date: Mon May 22 21:31:56 2023 +0300 ; * lisp/progmodes/project.el (project-switch-use-entire-map): Doc fix. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index a18b918db62..35b57ee4819 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1759,11 +1759,12 @@ project-switch-commands (symbol :tag "Single command"))) (defcustom project-switch-use-entire-map nil - "Make `project-switch-project' use entire `project-prefix-map'. + "Whether `project-switch-project' will use the entire `project-prefix-map'. If nil, `project-switch-project' will only recognize commands -listed in `project-switch-commands' and signal an error when -others are invoked. Otherwise, all keys in `project-prefix-map' -are legal even if they aren't listed in the dispatch menu." +listed in `project-switch-commands', and will signal an error +when other commands are invoked. If this is non-nil, all the +keys in `project-prefix-map' are valid even if they aren't +listed in the dispatch menu produced from `project-switch-commands'." :type 'boolean :group 'project :version "28.1") commit 64dbbde3b77c3d81445cd0faa2237fe0997ed741 Author: Eli Zaretskii Date: Mon May 22 21:23:58 2023 +0300 Fix visiting HTML files encoded in iso-2022 variants * lisp/international/mule.el (sgml-xml-auto-coding-function) (sgml-html-meta-auto-coding-function): Handle coding-systems whose coding-system-type is iso-2022. (Bug#63644) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 25b90b49c8f..2b44a2e0645 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -2484,10 +2484,12 @@ sgml-xml-auto-coding-function ;; called as part of visiting a file, as opposed ;; to when saving a buffer to a file. (if (and enable-multibyte-characters - ;; 'charset' will signal an error in - ;; coding-system-equal, since it isn't a - ;; coding-system. So test that up front. + ;; 'charset' and 'iso-2022' will signal + ;; an error in coding-system-equal, since + ;; they aren't coding-systems. So test + ;; that up front. (not (equal sym-type 'charset)) + (not (equal sym-type 'iso-2022)) (coding-system-equal 'utf-8 sym-type) (coding-system-equal 'utf-8 bfcs-type)) buffer-file-coding-system @@ -2540,11 +2542,13 @@ sgml-html-meta-auto-coding-function (bfcs-type (coding-system-type buffer-file-coding-system))) (if (and enable-multibyte-characters - ;; 'charset' will signal an error in - ;; coding-system-equal, since it isn't a - ;; coding-system. So test that up front. + ;; 'charset' and 'iso-2022' will signal an error + ;; in coding-system-equal, since they aren't + ;; coding-systems. So test that up front. (not (equal sym-type 'charset)) (not (equal bfcs-type 'charset)) + (not (equal sym-type 'iso-2022)) + (not (equal bfcs-type 'iso-2022)) (coding-system-equal 'utf-8 sym-type) (coding-system-equal 'utf-8 bfcs-type)) buffer-file-coding-system commit f33b301c29380cb0b295e1343e59c0faaf6ab621 Author: Alan Mackenzie Date: Mon May 22 16:09:07 2023 +0000 Fix syntax bugs involving escaped newlines in comments This fixes bug#63535 * src/syntax.c (forw_comment): take the initial syntax from the argument PREV_SYNTAX rather than checking the buffer position for a backslash. Update the state at each character scanned. (scan_sexps_forward): When the end position is escaped after a call to forw_comment, return this status to the caller. diff --git a/src/syntax.c b/src/syntax.c index 839ab36bb2f..0cac923bba7 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2323,13 +2323,16 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, return 0; } c = FETCH_CHAR_AS_MULTIBYTE (from_byte); + prev_syntax = syntax; syntax = SYNTAX_WITH_FLAGS (c); code = syntax & 0xff; if (code == Sendcomment && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ? (nesting > 0 && --nesting == 0) : nesting < 0) - && !(comment_end_can_be_escaped && char_quoted (from, from_byte))) + && !(comment_end_can_be_escaped + && ((prev_syntax & 0xff) == Sescape + || (prev_syntax & 0xff) == Scharquote))) /* We have encountered a comment end of the same style as the comment sequence which began this comment section. */ @@ -2353,7 +2356,11 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, inc_both (&from, &from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); if (from == stop) continue; /* Failure */ - } + c = FETCH_CHAR_AS_MULTIBYTE (from_byte); + prev_syntax = syntax; + syntax = Smax; + code = syntax; + } inc_both (&from, &from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); @@ -3334,7 +3341,14 @@ #define INC_FROM \ are invalid now. Luckily, the `done' doesn't use them and the INC_FROM sets them to a sane value without looking at them. */ - if (!found) goto done; + if (!found) + { + if ((prev_from_syntax & 0xff) == Sescape + || (prev_from_syntax & 0xff) == Scharquote) + goto endquoted; + else + goto done; + } INC_FROM; state->incomment = 0; state->comstyle = 0; /* reset the comment style */ commit 0cb1d695b429fceb45a11cd7ed73f3bb9ce7002f Author: Mattias Engdegård Date: Mon May 22 16:27:00 2023 +0200 Attempt to speed up filenotify-tests * test/lisp/filenotify-tests.el (file-notify-test04-autorevert): Run with a lower `auto-revert-interval` (1 s) and adjust the a timeout value. This should lower the time for this particular test from 25 to below 10 s. diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 97b7c46c689..0873910ddf9 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -939,10 +939,13 @@ file-notify-test04-autorevert :tags '(:expensive-test) (skip-unless (file-notify--test-local-enabled)) - ;; `auto-revert-buffers' runs every 5". And we must wait, until the - ;; file has been reverted. - (let ((timeout (if (file-remote-p temporary-file-directory) 60 10)) - buf) + ;; Run with shortened `auto-revert-interval' for a faster test. + (let* ((auto-revert-interval 1) + (timeout (if (file-remote-p temporary-file-directory) + 60 ; FIXME: can this be shortened? + (* auto-revert-interval 2.5))) + buf) + (auto-revert-set-timer) (unwind-protect (progn ;; In the remote case, `vc-refresh-state' returns undesired @@ -960,10 +963,9 @@ file-notify-test04-autorevert (sleep-for 1) (auto-revert-mode 1) - ;; `auto-revert-buffers' runs every 5". (with-timeout (timeout (ignore)) (while (null auto-revert-notify-watch-descriptor) - (sleep-for 1))) + (sleep-for 0.2))) ;; `file-notify--test-monitor' needs to know ;; `file-notify--test-desc' in order to compute proper commit 5c95239aca211147ffd93735a11d4908fc8a6d4d Author: Basil L. Contovounesios Date: Mon May 22 15:23:39 2023 +0100 ; Fix markup of some treesit vars in Elisp manual. * doc/lispref/modes.texi (Parser-based Font Lock): (Parser-based Indentation): * doc/lispref/parsing.texi (Multiple Languages): Use @code in place of @var when the argument is not a metavariable. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 00298d88f43..cb491d52c50 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -4073,8 +4073,8 @@ Parser-based Font Lock Although parser-based font lock doesn't share the same customization variables with regexp-based font lock, it uses similar customization -schemes. The tree-sitter counterpart of @var{font-lock-keywords} is -@var{treesit-font-lock-settings}. +schemes. The tree-sitter counterpart of @code{font-lock-keywords} is +@code{treesit-font-lock-settings}. @cindex tree-sitter fontifications, overview @cindex fontifications with tree-sitter, overview @@ -4108,9 +4108,9 @@ Parser-based Font Lock @code{treesit-major-mode-setup}. @defun treesit-font-lock-rules &rest query-specs -This function is used to set @var{treesit-font-lock-settings}. It +This function is used to set @code{treesit-font-lock-settings}. It takes care of compiling queries and other post-processing, and outputs -a value that @var{treesit-font-lock-settings} accepts. Here's an +a value that @code{treesit-font-lock-settings} accepts. Here's an example: @example @@ -4981,7 +4981,7 @@ Parser-based Indentation and the engine takes care of the rest. To enable the parser-based indentation engine, either set -@var{treesit-simple-indent-rules} and call +@code{treesit-simple-indent-rules} and call @code{treesit-major-mode-setup}, or equivalently, set the value of @code{indent-line-function} to @code{treesit-indent}. diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index cba323d3a56..b70f953f8ed 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -1644,9 +1644,9 @@ Multiple Languages @end example @defun treesit-range-rules &rest query-specs -This function is used to set @var{treesit-range-settings}. It -takes care of compiling queries and other post-processing, and outputs -a value that @var{treesit-range-settings} can have. +This function is used to set @code{treesit-range-settings}. It takes +care of compiling queries and other post-processing, and outputs a +value that @code{treesit-range-settings} can have. It takes a series of @var{query-spec}s, where each @var{query-spec} is a @var{query} preceded by zero or more @var{keyword}/@var{value} commit abb11eb3a3c1a8a29a43c584bcaa8917db52a541 Author: Michael Albinus Date: Mon May 22 16:08:23 2023 +0200 Support existing sshfs and rclone mount points in Tramp * lisp/net/tramp-fuse.el (tramp-fuse-mount-point, tramp-fuse-mounted-p): Support existing mount points. diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el index 8112e564a2c..5c0bb8e8d96 100644 --- a/lisp/net/tramp-fuse.el +++ b/lisp/net/tramp-fuse.el @@ -141,7 +141,7 @@ tramp-fuse-mount-spec (defun tramp-fuse-mount-point (vec) "Return local mount point of VEC." - (or (tramp-get-connection-property vec "mount-point") + (or (tramp-get-file-property vec "/" "mount-point") (expand-file-name (concat tramp-temp-name-prefix @@ -173,8 +173,11 @@ tramp-fuse-mounted-p (tramp-set-file-property vec "/" "mounted" (when (string-match - (rx bol (group (literal (tramp-fuse-mount-spec vec))) blank) + (rx bol (group (literal (tramp-fuse-mount-spec vec))) + " on " (group (+ (not blank))) blank) mount) + (tramp-set-file-property + vec "/" "mount-point" (match-string 2 mount)) (match-string 1 mount))))))) (defun tramp-fuse-get-fusermount () commit 6ad041939be794a8e325c23e41262303d288ae93 Author: Eli Zaretskii Date: Mon May 22 14:20:38 2023 +0300 Support 'isearch-allow-scroll' in 'pixel-scroll-precision-mode' * lisp/pixel-scroll.el (pixel-scroll-precision) (pixel-scroll-down, pixel-scroll-up): Put the 'scroll-command' property on these commands. (Bug#63640) diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 487144144f5..5f412bf418a 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -290,6 +290,10 @@ pixel-scroll-down (scroll-down 1) ; relay on robust method (pixel-scroll-pixel-down amt)))))) +;; isearch-scroll support +(put 'pixel-scroll-up 'scroll-command t) +(put 'pixel-scroll-down 'scroll-command t) + (defun pixel-bob-at-top-p (amt) "Return non-nil if window-start is at beginning of the current buffer. Window must be vertically scrolled by not more than AMT pixels." @@ -728,6 +732,9 @@ pixel-scroll-precision (message (error-message-string '(end-of-buffer)))))))))) (mwheel-scroll event nil)))) +;; isearch-scroll support +(put 'pixel-scroll-precision 'scroll-command t) + (defun pixel-scroll-kinetic-state (&optional window) "Return the kinetic scroll state of WINDOW. If WINDOW is nil, return the state of the current window. commit ecccdc07a098351ed3760d7a2099a34175735886 Author: Andreas Schwab Date: Mon May 22 13:08:33 2023 +0200 shr: allow moving between adjacent anchors * lisp/net/shr.el (shr-urlify): Put shr-tab-stop only over first position. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 4e44dfbef03..86987807153 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1215,7 +1215,6 @@ shr-urlify (add-text-properties start (point) (list 'shr-url url - 'shr-tab-stop t 'button t 'category 'shr ; For button.el button buffers. 'help-echo (let ((parsed (url-generic-parse-url @@ -1240,6 +1239,8 @@ shr-urlify ;; Make separate regions not `eq' so that they'll get ;; separate mouse highlights. 'mouse-face (list 'highlight))) + (when (< start (point)) + (add-text-properties start (1+ start) '(shr-tab-stop t))) ;; Don't overwrite any keymaps that are already in the buffer (i.e., ;; image keymaps). (while (and start commit 438b1205c54dbdeff234d14dcf2287cbf6769522 Author: Michael Albinus Date: Mon May 22 12:56:45 2023 +0200 Mark failing filenotify test as :unstable * test/lisp/filenotify-tests.el (file-notify-test04-autorevert-remote): Tag as :unstable. diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index bc094345ffe..97b7c46c689 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -1032,7 +1032,7 @@ file-notify-test04-autorevert (file-notify--test-cleanup)))) (file-notify--deftest-remote file-notify-test04-autorevert - "Check autorevert via file notification for remote files.") + "Check autorevert via file notification for remote files." t) (ert-deftest file-notify-test05-file-validity () "Check `file-notify-valid-p' for files." commit 504ef25ef3616d9ea2845d4d040a533ee70309cf Author: Michael Albinus Date: Mon May 22 12:20:44 2023 +0200 ; * etc/NEWS: Fix typos. diff --git a/etc/NEWS b/etc/NEWS index ad6dffae844..a29e0a08cfc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -140,9 +140,9 @@ various issues with keyboard input of sequences such as 'C-;' and 'C-S-u'. Note that, unlike the X build of Emacs, the PGTK build cannot -automatically switch to text-mode interface (thus emulating -nw) if it -cannot determine the default display; it will instead complain and ask -you to invoke it with the explicit -nw option. +automatically switch to text-mode interface (thus emulating '-nw') if +it cannot determine the default display; it will instead complain and +ask you to invoke it with the explicit '-nw' option. --- ** Emacs no longer reduces the size of the Japanese dictionary. commit d6fb868cdd33af642ff50c62d526d6b4cb44b6b6 Author: Michael Albinus Date: Mon May 22 12:20:27 2023 +0200 Fix multihop file name expansion in Tramp * lisp/net/tramp.el (tramp-dissect-file-name): Set hop to nil if NODEFAULT. (Bug#63578) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index df2f0850b83..dac2bc8c43c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1681,8 +1681,9 @@ tramp-dissect-file-name localname (file name on remote host), and hop. Unless NODEFAULT is non-nil, method, user and host are expanded -to their default values. For the other file name parts, no -default values are used." +to their default values. Hop is set to nil if NODEFAULT is non-nil. + +For the other file name parts, no default values are used." (save-match-data (unless (tramp-tramp-file-p name) (tramp-user-error nil "Not a Tramp file name: \"%s\"" name)) @@ -1708,7 +1709,8 @@ tramp-dissect-file-name (when (string-match tramp-postfix-ipv6-regexp host) (setq host (replace-match "" nil t host)))) - (unless nodefault + (if nodefault + (setq hop nil) (when hop (setq v (tramp-dissect-hop-name hop) hop (and hop (tramp-make-tramp-hop-name v)))) commit 6f940c6a1183dd1660f35e6c82d33183a6892cb4 Author: Po Lu Date: Mon May 22 11:52:33 2023 +0800 Plug various leaks and fix input method initialization * src/image.c (free_bitmap_record): Free bm->name correctly even if the display connection has been closed. * src/xfns.c (x_window): Use dpyinfo-specific `use_xim' flag. * src/xterm.c (use_xim): Remove global variable. (xim_destroy_callback): Free `xim_styles' if present, and set it to NULL to be on the safe side. (xim_open_dpy): Consult dpyinfo->use_xim instead. Don't leak `xim_styles' if an IM was previously opened. (xim_initialize): Use dpyinfo-specific `use_xim' flag. (xim_close_dpy): Check if `dpyinfo->xim_callback_data' is set before unregistering the instantiation callback. (x_term_init): Determine whether or not to use XIM for each display opened, instead of using the resources of the last display opened to toggle a global flag. (x_delete_terminal): Always call `image_destroy_all_bitmaps' and `xim_close_dpy'. Free storage used to hold bitmap records. * src/xterm.h (struct x_display_info): New field `use_xim'. diff --git a/src/image.c b/src/image.c index 87a0c1ca497..c9420b48f4a 100644 --- a/src/image.c +++ b/src/image.c @@ -842,9 +842,17 @@ image_create_bitmap_from_file (struct frame *f, Lisp_Object file) free_bitmap_record (Display_Info *dpyinfo, Bitmap_Record *bm) { #ifdef HAVE_X_WINDOWS - XFreePixmap (dpyinfo->display, bm->pixmap); - if (bm->have_mask) - XFreePixmap (dpyinfo->display, bm->mask); + /* Free the pixmap and mask. Only do this if DPYINFO->display is + still set, which may not be the case if the connection has + already been closed in response to an IO error. */ + + if (dpyinfo->display) + { + XFreePixmap (dpyinfo->display, bm->pixmap); + if (bm->have_mask) + XFreePixmap (dpyinfo->display, bm->mask); + } + #ifdef USE_CAIRO if (bm->stipple) cairo_pattern_destroy (bm->stipple); diff --git a/src/xfns.c b/src/xfns.c index 9e004f6a678..234a48c908f 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4252,9 +4252,9 @@ x_window (struct frame *f, long window_prompting) #ifdef HAVE_X_I18N FRAME_XIC (f) = NULL; - if (use_xim) + if (FRAME_DISPLAY_INFO (f)->use_xim) create_frame_xic (f); -#endif +#endif /* HAVE_X_I18N */ f->output_data.x->wm_hints.input = True; f->output_data.x->wm_hints.flags |= InputHint; @@ -4355,32 +4355,32 @@ x_window (struct frame *f) #ifdef HAVE_X_I18N FRAME_XIC (f) = NULL; - if (use_xim) - { - block_input (); - create_frame_xic (f); - if (FRAME_XIC (f)) - { - /* XIM server might require some X events. */ - unsigned long fevent = NoEventMask; - XGetICValues (FRAME_XIC (f), XNFilterEvents, &fevent, NULL); + if (FRAME_DISPLAY_INFO (f)->use_xim) + { + block_input (); + create_frame_xic (f); + if (FRAME_XIC (f)) + { + /* XIM server might require some X events. */ + unsigned long fevent = NoEventMask; + XGetICValues (FRAME_XIC (f), XNFilterEvents, &fevent, NULL); - if (fevent != NoEventMask) - { - XSetWindowAttributes attributes; - XWindowAttributes wattr; - unsigned long attribute_mask; - - XGetWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - &wattr); - attributes.event_mask = wattr.your_event_mask | fevent; - attribute_mask = CWEventMask; - XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - attribute_mask, &attributes); - } - } - unblock_input (); - } + if (fevent != NoEventMask) + { + XSetWindowAttributes attributes; + XWindowAttributes wattr; + unsigned long attribute_mask; + + XGetWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + &wattr); + attributes.event_mask = wattr.your_event_mask | fevent; + attribute_mask = CWEventMask; + XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + attribute_mask, &attributes); + } + } + unblock_input (); + } #endif append_wm_protocols (FRAME_DISPLAY_INFO (f), f); @@ -4427,7 +4427,7 @@ x_window (struct frame *f) initial_set_up_x_back_buffer (f); #ifdef HAVE_X_I18N - if (use_xim) + if (FRAME_DISPLAY_INFO (f)->use_xim) { create_frame_xic (f); if (FRAME_XIC (f)) diff --git a/src/xterm.c b/src/xterm.c index 15bd9f98d17..0450230efe6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -798,13 +798,6 @@ #define XtNinitialState "initialState" #define USE_CAIRO_XCB_SURFACE #endif -/* Default to using XIM if available. */ -#ifdef USE_XIM -bool use_xim = true; -#else -bool use_xim = false; /* configure --without-xim */ -#endif - #if XCB_SHAPE_MAJOR_VERSION > 1 \ || (XCB_SHAPE_MAJOR_VERSION == 1 && \ XCB_SHAPE_MINOR_VERSION >= 1) @@ -26666,7 +26659,12 @@ xim_destroy_callback (XIM xim, XPointer client_data, XPointer call_data) /* No need to call XCloseIM. */ dpyinfo->xim = NULL; - XFree (dpyinfo->xim_styles); + + /* Also free IM values; those are allocated separately upon + XGetIMValues. */ + if (dpyinfo->xim_styles) + XFree (dpyinfo->xim_styles); + dpyinfo->xim_styles = NULL; unblock_input (); } @@ -26684,10 +26682,20 @@ xim_open_dpy (struct x_display_info *dpyinfo, char *resource_name) XIM xim; const char *locale; - if (use_xim) + if (dpyinfo->use_xim) { if (dpyinfo->xim) - XCloseIM (dpyinfo->xim); + { + XCloseIM (dpyinfo->xim); + + /* Free values left over from the last time the IM + connection was established. */ + + if (dpyinfo->xim_styles) + XFree (dpyinfo->xim_styles); + dpyinfo->xim_styles = NULL; + } + xim = XOpenIM (dpyinfo->display, dpyinfo->rdb, resource_name, emacs_class); dpyinfo->xim = xim; @@ -26716,7 +26724,6 @@ xim_open_dpy (struct x_display_info *dpyinfo, char *resource_name) build_string (locale)); } } - else #endif /* HAVE_XIM */ dpyinfo->xim = NULL; @@ -26785,7 +26792,7 @@ xim_initialize (struct x_display_info *dpyinfo, char *resource_name) { dpyinfo->xim = NULL; #ifdef HAVE_XIM - if (use_xim) + if (dpyinfo->use_xim) { #ifdef HAVE_X11R6_XIM struct xim_inst_t *xim_inst = xmalloc (sizeof *xim_inst); @@ -26794,15 +26801,19 @@ xim_initialize (struct x_display_info *dpyinfo, char *resource_name) dpyinfo->xim_callback_data = xim_inst; xim_inst->dpyinfo = dpyinfo; xim_inst->resource_name = xstrdup (resource_name); - ret = XRegisterIMInstantiateCallback - (dpyinfo->display, dpyinfo->rdb, xim_inst->resource_name, - emacs_class, xim_instantiate_callback, - /* This is XPointer in XFree86 but (XPointer *) on Tru64, at - least, but the configure test doesn't work because - xim_instantiate_callback can either be XIMProc or - XIDProc, so just cast to void *. */ - (void *) xim_inst); - eassert (ret == True); + + /* The last argument is XPointer in XFree86 but (XPointer *) on + Tru64, at least, but the configure test doesn't work because + xim_instantiate_callback can either be XIMProc or XIDProc, so + just cast to void *. */ + + ret = XRegisterIMInstantiateCallback (dpyinfo->display, + dpyinfo->rdb, + xim_inst->resource_name, + emacs_class, + xim_instantiate_callback, + (void *) xim_inst); + eassert (ret); #else /* not HAVE_X11R6_XIM */ xim_open_dpy (dpyinfo, resource_name); #endif /* not HAVE_X11R6_XIM */ @@ -26811,32 +26822,56 @@ xim_initialize (struct x_display_info *dpyinfo, char *resource_name) } -/* Close the connection to the XIM server on display DPYINFO. */ +/* Close the connection to the XIM server on display DPYINFO. + Unregister any IM instantiation callback previously installed, + close the connection to the IM server if possible, and free any + retrieved IM values. */ static void xim_close_dpy (struct x_display_info *dpyinfo) { #ifdef HAVE_XIM - if (use_xim) - { #ifdef HAVE_X11R6_XIM - struct xim_inst_t *xim_inst = dpyinfo->xim_callback_data; + struct xim_inst_t *xim_inst; + Bool rc; + + /* If dpyinfo->xim_callback_data is not set, then IM support wasn't + initialized, which can happen if Xlib doesn't understand the C + locale being used. */ + + if (dpyinfo->xim_callback_data) + { + xim_inst = dpyinfo->xim_callback_data; if (dpyinfo->display) { - Bool ret = XUnregisterIMInstantiateCallback - (dpyinfo->display, dpyinfo->rdb, xim_inst->resource_name, - emacs_class, xim_instantiate_callback, (void *) xim_inst); - eassert (ret == True); + rc = XUnregisterIMInstantiateCallback (dpyinfo->display, + dpyinfo->rdb, + xim_inst->resource_name, + emacs_class, + xim_instantiate_callback, + (void *) xim_inst); + eassert (rc); } + xfree (xim_inst->resource_name); xfree (xim_inst); -#endif /* HAVE_X11R6_XIM */ - if (dpyinfo->display) - XCloseIM (dpyinfo->xim); - dpyinfo->xim = NULL; - XFree (dpyinfo->xim_styles); } +#endif /* HAVE_X11R6_XIM */ + + /* Now close the connection to the input method server. This may + access the display connection, and isn't safe if the display has + already been closed. */ + + if (dpyinfo->display && dpyinfo->xim) + XCloseIM (dpyinfo->xim); + dpyinfo->xim = NULL; + + /* Free the list of XIM styles retrieved. */ + + if (dpyinfo->xim_styles) + XFree (dpyinfo->xim_styles); + dpyinfo->xim_styles = NULL; #endif /* HAVE_XIM */ } @@ -30766,14 +30801,6 @@ #define NUM_ARGV 10 dpyinfo->fixes_pointer_blanking = (egetenv ("EMACS_XFIXES") != NULL); #endif -#ifdef HAVE_X_I18N - /* Avoid initializing input methods if the X library does not - support Emacs's locale. When the current locale is not - supported, decoding input method strings becomes undefined. */ - if (XSupportsLocale ()) - xim_initialize (dpyinfo, resource_name); -#endif - xsettings_initialize (dpyinfo); /* This is only needed for distinguishing keyboard and process input. */ @@ -30832,25 +30859,33 @@ #define NUM_ARGV 10 XSynchronize (dpyinfo->display, True); } +#ifdef HAVE_X_I18N { AUTO_STRING (useXIM, "useXIM"); AUTO_STRING (UseXIM, "UseXIM"); Lisp_Object value = gui_display_get_resource (dpyinfo, useXIM, UseXIM, Qnil, Qnil); + + /* `USE_XIM' controls whether Emacs should use X input methods by + default, not whether or not XIM is available. */ + #ifdef USE_XIM + dpyinfo->use_xim = true; + if (STRINGP (value) && (!strcmp (SSDATA (value), "false") || !strcmp (SSDATA (value), "off"))) - use_xim = false; -#else + dpyinfo->use_xim = false; +#else /* !USE_XIM */ + dpyinfo->use_xim = false; + if (STRINGP (value) && (!strcmp (SSDATA (value), "true") || !strcmp (SSDATA (value), "on"))) - use_xim = true; -#endif + dpyinfo->use_xim = true; +#endif /* USE_XIM */ } -#ifdef HAVE_X_I18N { AUTO_STRING (inputStyle, "inputStyle"); AUTO_STRING (InputStyle, "InputStyle"); @@ -30872,10 +30907,19 @@ #define NUM_ARGV 10 #ifdef USE_GTK else if (!strcmp (SSDATA (value), "native")) dpyinfo->prefer_native_input = true; -#endif +#endif /* HAVE_GTK */ } } -#endif + + /* Now that defaults have been set up, initialize input method + support. */ + + /* Avoid initializing input methods if the X library does not + support Emacs's locale. When the current locale is not + supported, decoding input method strings becomes undefined. */ + if (XSupportsLocale ()) + xim_initialize (dpyinfo, resource_name); +#endif /* HAVE_X_I18N */ #ifdef HAVE_X_SM /* Only do this for the very first display in the Emacs session. @@ -31268,14 +31312,22 @@ x_delete_terminal (struct terminal *terminal) #ifdef HAVE_X_I18N /* We must close our connection to the XIM server before closing the X display. */ - if (dpyinfo->xim) - xim_close_dpy (dpyinfo); + xim_close_dpy (dpyinfo); #endif + /* Destroy all bitmap images created on the display. */ + image_destroy_all_bitmaps (dpyinfo); + + /* Free the storage allocated to hold bitmap records. */ + xfree (dpyinfo->bitmaps); + + /* In case someone decides to use `bitmaps' again... */ + dpyinfo->bitmaps = NULL; + dpyinfo->bitmaps_last = 0; + /* Normally, the display is available... */ if (dpyinfo->display) { - image_destroy_all_bitmaps (dpyinfo); XSetCloseDownMode (dpyinfo->display, DestroyAll); /* Delete the scratch cursor GC, should it exist. */ diff --git a/src/xterm.h b/src/xterm.h index 28ae00ca190..34a713ea2ca 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -649,7 +649,11 @@ #define X_INVALID_WINDOW 0xffffffff /* The named coding system to use for this input method. */ Lisp_Object xim_coding; -#endif + + /* Whether or not X input methods should be used on this + display. */ + bool use_xim; +#endif /* HAVE_X_I18N */ /* A cache mapping color names to RGB values. */ struct color_name_cache_entry **color_names; @@ -922,11 +926,6 @@ #define X_INVALID_WINDOW 0xffffffff #endif }; -#ifdef HAVE_X_I18N -/* Whether or not to use XIM if we have it. */ -extern bool use_xim; -#endif - #ifdef HAVE_XINPUT2 /* Defined in xmenu.c. */ extern int popup_activated_flag; commit c297b828bb716885f92d3117c2abbb1ff21dbb08 Author: F. Jason Park Date: Thu May 18 23:47:27 2023 -0700 Fix custom type of erc-autojoin-channels-alist * lisp/erc/erc-join.el (erc-autojoin-channels-alist): In ERC 5.4, the type of this option changed to accept symbols signifying IRC network names. However, the option's definition was not updated to reflect that. See commit 9bb8d90cddf "Allow irc network symbols in erc-autojoin-channels-alist". diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 17104da1a8b..45cfd565f89 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -78,10 +78,11 @@ erc-autojoin-channels-alist again when you get disconnected. When you restart Emacs, however, those changes are lost, and the customization you saved the last time is used again." - :type '(repeat (cons :tag "Server" - (regexp :tag "Name") - (repeat :tag "Channels" - (string :tag "Name"))))) + :type '(alist :options (Libera.Chat) + :key-type (choice :tag "Server" + (symbol :tag "Network") + (regexp :tag "Host or domain")) + :value-type (repeat :tag "Channels" (string :tag "Name")))) (defcustom erc-autojoin-timing 'connect "When ERC should attempt to autojoin a channel. commit 8120f5156ccfa0e4992685a05abcb4838d76fb8a Author: F. Jason Park Date: Thu May 18 23:47:27 2023 -0700 ; Silence byte compiler in erc-netsplit-JOIN * etc/ERC-NEWS: Partially revert edit from c9f1ad2a870 "Revive option erc-query-on-unjoined-chan-privmsg". * lisp/erc/erc-netsplit.el (erc-netsplit-JOIN): Silence byte compiler warning re ignored return value from `delete' when removing nicks. Could probably suppress rather than reconstitute since the CAR of an `erc-netsplit-list' entry originates from the trailing "reason" param of the instigating "QUIT" command and should look something like "irc.example.org chat.example.org", which cannot be confused for a nickname. * test/lisp/erc/resources/erc-scenarios-common.el: Fix wording in Commentary. diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 1aa445c5b9c..d257bdcbf51 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -366,8 +366,8 @@ In an effort to help further tame ERC's complexity, the variable 'erc-default-recipients' is now expected to hold but a single target. As a consequence, functions like 'erc-add-default-channel' that imagine an alternate, aspirational model of buffer-target relations -have been deprecated. Grep for their names in ChangeLog.4 for -details. +have been deprecated. For specifics, see entries in Emacs' +ChangeLog.4 from around June 30, 2022. A number of less consequential deprecations also debut in this release. For example, the function 'erc-auto-query' was deemed too diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index f3572014f27..5dd11ab1869 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -117,7 +117,9 @@ erc-netsplit-JOIN parsed 'notice (process-buffer proc) 'netjoin-done ?s (car elt)) (setq erc-netsplit-list (delq elt erc-netsplit-list))) - (delete nick elt)) + ;; Avoid `ignored-return-value' warning for `delete'. + (let ((tail (nthcdr 2 elt))) ; (t n1 ... nN) + (setcdr tail (delete nick (cdr tail))))) (setq no-next-hook t)))) no-next-hook)) diff --git a/test/lisp/erc/resources/erc-scenarios-common.el b/test/lisp/erc/resources/erc-scenarios-common.el index f259c88594b..32e7556d602 100644 --- a/test/lisp/erc/resources/erc-scenarios-common.el +++ b/test/lisp/erc/resources/erc-scenarios-common.el @@ -51,7 +51,7 @@ ;; argument, a `let*'-style VAR-LIST. Relying on such a macro is ;; unfortunate because in many ways it actually hampers readability by ;; favoring magic over verbosity. But without it (or something -;; similar), any failing test would cause all subsequent tests in this +;; similar), any failing test would cause all subsequent tests in a ;; file to fail like dominoes (making all but the first backtrace ;; useless). ;; commit 71622d70e8bd0f4289df098a8d9b3ab06f4bdcc0 Author: Eli Zaretskii Date: Sun May 21 13:57:14 2023 +0300 New Rmail commands for reading mailing-lists * lisp/mail/rmail.el (rmail--mailing-list-message): New internal function. (rmail-mailing-list-help, rmail-mailing-list-post) (rmail-mailing-list-unsubscribe, rmail-mailing-list-archive): New commands. (rmail-mode-map): Add menu items for the new commands. * etc/NEWS: Announce the new Rmail commands. diff --git a/etc/NEWS b/etc/NEWS index 04ef976a8d1..7729dbc79fa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -333,6 +333,15 @@ instead of: *** New ':vc' keyword. This keyword enables the user to install packages using 'package-vc'. +** Rmail + +--- +*** New commands for reading mailing lists. +The new Rmail commands 'rmail-mailing-list-post', +'rmail-mailing-list-unsubscribe', 'rmail-mailing-list-help', and +'rmail-mailing-list-archive allow to, respectively, post to, +unsubscribe from, request help about, and browse the archives, of the +mailing list from which the current email message was delivered. * New Modes and Packages in Emacs 30.1 diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index d07a1fda901..872299c2415 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -40,6 +40,7 @@ (require 'mail-utils) (require 'rfc2047) (require 'auth-source) +(require 'rfc6068) (declare-function compilation--message->loc "compile" (cl-x) t) (declare-function epa--find-coding-system-for-mime-charset "epa" (mime-charset)) @@ -1120,10 +1121,36 @@ rmail-mode-map (define-key map [menu-bar mail] (cons "Mail" (make-sparse-keymap "Mail"))) + (define-key map [menu-bar mail mailing-list] + (cons "Mailing List" (make-sparse-keymap "Mailing List"))) + + (define-key map [menu-bar mail mailing-list list-help] + '(menu-item "Mailing List Help" rmail-mailing-list-help + :enable (rmail-get-header "List-Help") + :help "Compose email requesting help about this mailing list")) + + (define-key map [menu-bar mail mailing-list list-archive] + '(menu-item "Mailing List Archive" rmail-mailing-list-archive + :enable (rmail-get-header "List-Archive") + :help "Browse the archive of this mailing list")) + + (define-key map [menu-bar mail mailing-list list-unsubscribe] + '(menu-item "Unsubscribe From List" rmail-mailing-list-unsubscribe + :enable (rmail-get-header "List-Unsubscribe") + :help "Compose email to unsubscribe from this mailing list")) + + (define-key map [menu-bar mail mailing-list list-post] + '(menu-item "Post To List" rmail-mailing-list-post + :enable (rmail-get-header "List-Post") + :help "Compose email to post to this mailing list")) + + (define-key map [menu-bar mail lambda1] + '("----")) + (define-key map [menu-bar mail rmail-get-new-mail] '("Get New Mail" . rmail-get-new-mail)) - (define-key map [menu-bar mail lambda] + (define-key map [menu-bar mail lambda2] '("----")) (define-key map [menu-bar mail continue] @@ -4765,6 +4792,69 @@ rmail-after-save-hook (setq buffer-file-coding-system rmail-message-encoding)))) (add-hook 'after-save-hook 'rmail-after-save-hook) + +;;; Mailing list support +(defun rmail--mailing-list-message (which) + "Send a message to mailing list whose purpose is identified by WHICH. +WHICH is a symbol, one of `help', `unsubscribe', or `post'." + (let ((header + (cond ((eq which 'help) "List-Help") + ((eq which 'unsubscribe) "List-Unsubscribe") + ((eq which 'post) "List-Post"))) + (msg + (cond ((eq which 'post) + "Write Subject and body, then type \\[%s] to send the message.") + (t + "Type \\[%s] to send the message."))) + address header-list to subject) + (setq address (rmail-get-header header)) + (cond ((and address (string-match "<\\(mailto:[^>]*\\)>" address)) + (setq address (match-string 1 address)) + (setq header-list (rfc6068-parse-mailto-url address) + to (cdr (assoc-string "To" header-list t)) + subject (or (cdr (assoc-string "Subject" header-list t)) "")) + (rmail-start-mail nil to subject nil nil rmail-buffer) + (message (substitute-command-keys + (format msg (get mail-user-agent 'sendfunc))))) + (t + (user-error "This message does not specify \"%s\" address" + header))))) + +(defun rmail-mailing-list-help () + "Send Help request to the mailing list which delivered the current message. +This command starts composing an email message to the mailing list +requesting help about the list. When the message is ready, send it +as usual, via your MUA's send-email command." + (interactive nil rmail-mode) + (rmail--mailing-list-message 'help)) + +(defun rmail-mailing-list-post () + "Post a message to the mailing list which delivered the current message. +This command starts composing an email message to the mailing list. +Fill the Subject and the body of the message. When the message is +ready, send it as usual, via your MUA's send-email command." + (interactive nil rmail-mode) + (rmail--mailing-list-message 'post)) + +(defun rmail-mailing-list-unsubscribe () + "Send unsubscribe request to the mailing list which delivered current message. +This command starts composing an email message to the mailing list +requesting to unsubscribe you from the list. When the message is +ready, send it as usual, via your MUA's send-email command." + (interactive nil rmail-mode) + (rmail--mailing-list-message 'unsubscribe)) + +(defun rmail-mailing-list-archive () + "Browse the archive of the mailing list which delivered the current message." + (interactive nil rmail-mode) + (let* ((header (rmail-get-header "List-Archive")) + (url (and (stringp header) + (string-match " *<\\([^>]*\\)>" header) + (match-string 1 header)))) + (if url + (browse-url url) + (user-error + "This message does not specify a valid \"List-Archive\" URL")))) (provide 'rmail) commit dd3e4e14fdc516c7c0f3668601b0b0703b304251 Author: Jens Schmidt Date: Sat May 20 23:46:42 2023 +0200 Remove obsolete information from Gnus manual The Gnus manual was still referencing long-removed external marks in section "Archiving Mails". Without external marks, that section is almost pointless, so remove it completely. * doc/misc/gnus.texi (Archiving Mail): Remove section. (Top, Browsing the Web): Remove references to "Archiving Mail". (Bug#63497) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index f0d3c75d055..d77d4be1bee 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -713,7 +713,6 @@ Top Browsing the Web -* Archiving Mail:: * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. @@ -17244,7 +17243,6 @@ Browsing the Web interfaces to these sources. @menu -* Archiving Mail:: * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. @end menu @@ -17261,29 +17259,6 @@ Browsing the Web Unplugged}) handle downloading articles, and then you can read them at leisure from your local disk. No more World Wide Wait for you. -@node Archiving Mail -@subsection Archiving Mail -@cindex archiving mail -@cindex backup of mail - -Some of the back ends, notably @code{nnml}, @code{nnfolder}, and -@code{nnmaildir}, now actually store the article marks with each group. -For these servers, archiving and restoring a group while preserving -marks is fairly simple. - -(Preserving the group level and group parameters as well still -requires ritual dancing and sacrifices to the @file{.newsrc.eld} deity -though.) - -To archive an entire @code{nnml}, @code{nnfolder}, or @code{nnmaildir} -server, take a recursive copy of the server directory. There is no need -to shut down Gnus, so archiving may be invoked by @code{cron} or -similar. You restore the data by restoring the directory tree, and -adding a server definition pointing to that directory in Gnus. The -@ref{Article Backlog}, @ref{Asynchronous Fetching} and other things -might interfere with overwriting data, so you may want to shut down Gnus -before you restore the data. - @node Web Searches @subsection Web Searches @cindex nnweb commit 2a5c946f8793d712c8739629d1bfdb14146c69cf Author: Jens Schmidt Date: Sat May 20 23:03:29 2023 +0200 Preserve mark in comint-history-isearch This preserves mark in `comint-history-isearch-backward' and friends, which tend to set the mark on completion of the isearch to unexpected positions. * lisp/comint.el (comint-history-isearch-end): Set `isearch-opoint' to point. (Bug#63616) diff --git a/lisp/comint.el b/lisp/comint.el index 682b555a33c..328b073dc8a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1542,6 +1542,8 @@ comint-history-isearch-end (setq isearch-message-function nil) (setq isearch-wrap-function nil) (setq isearch-push-state-function nil) + ;; Force isearch to not change mark. + (setq isearch-opoint (point)) (kill-local-variable 'isearch-lazy-count) (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t) (unless isearch-suspended commit f8cdb9e05067fba5dee193ac604e75a67a7ff2c9 Author: Mattias Engdegård Date: Sat May 20 20:34:55 2023 +0200 Declare more mutating functions * lisp/emacs-lisp/bytecomp.el (mutating-fns): Add assoc-delete-all, assq-delete-all and rassq-delete-all. * lisp/emacs-lisp/shortdoc.el (alist, list): Don't mutate constants in examples illustrating use of assoc-delete-all, assq-delete-all and rassq-delete-all. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b8d7b63a81a..ac040799a22 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3590,6 +3590,7 @@ byte-compile-form (delq 2) (delete 2) (delete-dups 1) (delete-consecutive-dups 1) (plist-put 1) + (assoc-delete-all 2) (assq-delete-all 2) (rassq-delete-all 2) (fillarray 1) (store-substring 1) (clear-string 1) diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 1e8ab4ad46d..8c44a4fb0a0 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -137,11 +137,11 @@ alist :eval (assoc-string "foo" '(("foo" . "bar") ("zot" "baz")))) "Manipulating Alists" (assoc-delete-all - :eval (assoc-delete-all "foo" '(("foo" . "bar") ("zot" . "baz")) #'equal)) + :eval (assoc-delete-all "b" (list '("a" . a) '("b" . b) '("b" . c)))) (assq-delete-all - :eval (assq-delete-all 'foo '((foo . bar) (zot . baz)))) + :eval (assq-delete-all 2 (list '(1 . a) '(2 . b) '(2 . c)))) (rassq-delete-all - :eval (rassq-delete-all 'bar '((foo . bar) (zot . baz)))) + :eval (rassq-delete-all 'b (list '(1 . a) '(2 . b) '(2 . c)))) (alist-get :eval (let ((foo '((bar . baz)))) (setf (alist-get 'bar foo) 'zot) @@ -705,10 +705,12 @@ list :eval (assoc-default 2 '((1 . a) (2 . b) #'=))) (copy-alist :eval (copy-alist '((1 . a) (2 . b)))) - (assq-delete-all - :eval (assq-delete-all 2 (list '(1 . a) '(2 . b) '(2 . c)))) (assoc-delete-all :eval (assoc-delete-all "b" (list '("a" . a) '("b" . b) '("b" . c)))) + (assq-delete-all + :eval (assq-delete-all 2 (list '(1 . a) '(2 . b) '(2 . c)))) + (rassq-delete-all + :eval (rassq-delete-all 'b (list '(1 . a) '(2 . b) '(2 . c)))) "Property Lists" (plist-get :eval (plist-get '(a 1 b 2 c 3) 'b)) commit 88d1e9b436c8778c90b7a57a152aee8071ac77b9 Author: Mattias Engdegård Date: Sat May 20 18:24:53 2023 +0200 Declare more functions as having important-return-value * lisp/subr.el (assoc-delete-all, assq-delete-all, rassq-delete-all) (alist-get): Declare as important-return-value. * lisp/emacs-lisp/bytecomp.el (important-return-value-fns): Add `assoc-string`. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index deda4573229..b8d7b63a81a 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3561,7 +3561,7 @@ byte-compile-form ;; These functions are side-effect-free except for the ;; behaviour of functions passed as argument. mapcar mapcan mapconcat - assoc plist-get plist-member + assoc assoc-string plist-get plist-member ;; It's safe to ignore the value of `sort' and `nreverse' ;; when used on arrays, but most calls pass lists. diff --git a/lisp/subr.el b/lisp/subr.el index 8759c095f1a..f367095ad27 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -893,6 +893,7 @@ assoc-delete-all Compare keys with TEST. Defaults to `equal'. Return the modified alist. Elements of ALIST that are not conses are ignored." + (declare (important-return-value t)) (unless test (setq test #'equal)) (while (and (consp (car alist)) (funcall test (caar alist) key)) @@ -909,12 +910,14 @@ assq-delete-all "Delete from ALIST all elements whose car is `eq' to KEY. Return the modified alist. Elements of ALIST that are not conses are ignored." + (declare (important-return-value t)) (assoc-delete-all key alist #'eq)) (defun rassq-delete-all (value alist) "Delete from ALIST all elements whose cdr is `eq' to VALUE. Return the modified alist. Elements of ALIST that are not conses are ignored." + (declare (important-return-value t)) (while (and (consp (car alist)) (eq (cdr (car alist)) value)) (setq alist (cdr alist))) @@ -957,6 +960,7 @@ alist-get (setf (alist-get \\='b foo nil \\='remove) nil) foo => ((a . 1))" + (declare (important-return-value t)) (ignore remove) ;;Silence byte-compiler. (let ((x (if (not testfn) (assq key alist) commit 5d15818b94c1f6fd46f30154240942b3991492a4 Author: Mattias Engdegård Date: Sat May 20 12:06:46 2023 +0200 Minor optimisation of string-trim-left and string-trim-right * lisp/subr.el (string-trim-left, string-trim-right): Use a constant string when no REGEXP argument is given. diff --git a/lisp/subr.el b/lisp/subr.el index 5a641965659..8759c095f1a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6940,7 +6940,10 @@ string-trim-left "Trim STRING of leading string matching REGEXP. REGEXP defaults to \"[ \\t\\n\\r]+\"." - (if (string-match (concat "\\`\\(?:" (or regexp "[ \t\n\r]+") "\\)") string) + (if (string-match (if regexp + (concat "\\`\\(?:" regexp "\\)") + "\\`[ \t\n\r]+") + string) (substring string (match-end 0)) string)) @@ -6949,7 +6952,9 @@ string-trim-right REGEXP defaults to \"[ \\t\\n\\r]+\"." (declare (side-effect-free t)) - (let ((i (string-match-p (concat "\\(?:" (or regexp "[ \t\n\r]+") "\\)\\'") + (let ((i (string-match-p (if regexp + (concat "\\(?:" regexp "\\)\\'") + "[ \t\n\r]+\\'") string))) (if i (substring string 0 i) string))) commit 6b60c8142ea10b774cd01db39f803f806df5fc5b Author: Liu Hui Date: Wed May 17 16:39:18 2023 +0800 Fix systemd unit completion for old versions of systemd * lisp/pcmpl-linux.el (pcmpl-linux--systemd-units): Use '--no-legend' for compatibility with older versions of systemctl. (Bug#63411) diff --git a/lisp/pcmpl-linux.el b/lisp/pcmpl-linux.el index 082072d87d2..589b4799c8d 100644 --- a/lisp/pcmpl-linux.el +++ b/lisp/pcmpl-linux.el @@ -119,7 +119,8 @@ pcmpl-linux--systemd-units (with-temp-buffer (apply #'call-process "systemctl" nil '(t nil) nil - "list-units" "--full" "--legend=no" "--plain" args) + ;; "--legend=no" doesn't exist before systemd v248 + "list-units" "--full" "--no-legend" "--plain" args) (goto-char (point-min)) (let (result) (while (re-search-forward (rx bol (group (+ (not space))) commit 8c56557cd9dff754b7f28f5fb919ca3b2c58ebf3 Author: Eli Zaretskii Date: Sat May 20 17:56:40 2023 +0300 Fix Skeletons menu-bar menu in Python modes * lisp/progmodes/python.el (python-mode, python-ts-mode): Call 'python-skeleton-add-menu-items' here, not in 'python-base-mode', since the "Python" menu is not yet set up in the latter. (Bug#63598) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f810f1e2164..6fc05b246a6 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6694,8 +6694,6 @@ python-base-mode (setq-local prettify-symbols-alist python-prettify-symbols-alist) - (python-skeleton-add-menu-items) - (make-local-variable 'python-shell-internal-buffer) (add-hook 'flymake-diagnostic-functions #'python-flymake nil t)) @@ -6719,6 +6717,8 @@ python-mode (add-hook 'which-func-functions #'python-info-current-defun nil t) + (python-skeleton-add-menu-items) + (when python-indent-guess-indent-offset (python-indent-guess-indent-offset))) @@ -6745,6 +6745,8 @@ python-ts-mode #'python--treesit-defun-name) (treesit-major-mode-setup) + (python-skeleton-add-menu-items) + (when python-indent-guess-indent-offset (python-indent-guess-indent-offset)) commit d8d3d78e58ccf7c961d40f539a5a9773b6668030 Author: Eli Zaretskii Date: Sat May 20 17:26:52 2023 +0300 Fix async invocations in Dired with 'fish' shell * lisp/dired-aux.el (dired-shell-stuff-it): Separate '&' and ';' by blanks, for the sake of shells such as 'fish'. Suggested by Lycomedes 1814 . diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 96ac9da4508..a07406e4c0d 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -957,7 +957,7 @@ dired-shell-stuff-it ;; "&" instead. (cmd-sep (if (and (or (not w32-shell) file-remote) (not parallel-in-background)) - ";" "&")) + "; " "& ")) (stuff-it (if (dired--star-or-qmark-p command nil 'keep) (lambda (x) @@ -988,7 +988,7 @@ dired-shell-stuff-it ;; Add 'wait' to force those POSIX shells to wait until ;; all commands finish. (or (and parallel-in-background (not w32-shell) - " &wait") + " & wait") ""))) (t (let ((files (mapconcat #'shell-quote-argument @@ -1000,9 +1000,9 @@ dired-shell-stuff-it ;; Be consistent in how we treat inputs to commands -- do ;; the same here as in the `on-each' case. (if (and in-background (not w32-shell)) - " &wait" + " & wait" ""))))) - (or (and in-background "&") + (or (and in-background "& ") "")))) ;; This is an extra function so that it can be redefined by ange-ftp. commit 58eb38cfb47b9802581ff55117510186bcc53b67 Author: Mattias Engdegård Date: Sat May 20 15:04:06 2023 +0200 ; * etc/NEWS: missing definite article diff --git a/etc/NEWS b/etc/NEWS index 8bd8c5714c0..ad6dffae844 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3877,7 +3877,7 @@ The following generalized variables have been made obsolete: 'window-height', 'window-width', and 'x-get-secondary-selection'. --- -** The 'dotimes' loop variable can no longer be manipulated in loop body. +** The 'dotimes' loop variable can no longer be manipulated in the loop body. Previously, the 'dotimes' loop counter could be modified inside the loop body, but only in code using dynamic binding. Now the behavior is the same as when using lexical binding: changes to the loop commit cf403628692392bde0a00d9d8db6c13544f68441 Author: Eli Zaretskii Date: Sat May 20 15:53:21 2023 +0300 ; * etc/NEWS: PGTK cannot switch to -new automatically (bug#6355). diff --git a/etc/NEWS b/etc/NEWS index 379ddbde072..8bd8c5714c0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -139,6 +139,11 @@ known to have problems, such as undesirable frame positioning and various issues with keyboard input of sequences such as 'C-;' and 'C-S-u'. +Note that, unlike the X build of Emacs, the PGTK build cannot +automatically switch to text-mode interface (thus emulating -nw) if it +cannot determine the default display; it will instead complain and ask +you to invoke it with the explicit -nw option. + --- ** Emacs no longer reduces the size of the Japanese dictionary. Building Emacs includes generation of a Japanese dictionary, which is commit ead3a2abbfc347b0f562c1e051b370a0617ee8aa Author: Eli Zaretskii Date: Sat May 20 15:43:44 2023 +0300 Fix loading SQLite extensions * src/sqlite.c (sqlite3_db_config) [WINDOWSNT]: Load from the DLL. (Fsqlite_load_extension): Use 'sqlite3_db_config' to enable and disable loading of extensions. Add a few free extensions to the allow-list. Fix testing for the ".dll" extension. (Bug#63590) * test/src/sqlite-tests.el (sqlite-load-extension): Fix the test to require successful load if the extension does exist. diff --git a/src/sqlite.c b/src/sqlite.c index 0361514766a..77ce61ba657 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -23,6 +23,8 @@ Copyright (C) 2021-2023 Free Software Foundation, Inc. https://github.com/syohex/emacs-sqlite3 */ #include + +#include #include "lisp.h" #include "coding.h" @@ -80,6 +82,9 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_load_extension, (sqlite3*, const char*, const char*, char**)); # undef sqlite3_load_extension # define sqlite3_load_extension fn_sqlite3_load_extension +DEF_DLL_FN (SQLITE_API int, sqlite3_db_config, (sqlite3*, int, ...)); +# undef sqlite3_db_config +# define sqlite3_db_config fn_sqlite3_db_config # endif # undef sqlite3_finalize @@ -172,6 +177,7 @@ load_dll_functions (HMODULE library) LOAD_DLL_FN (library, sqlite3_exec); # ifdef HAVE_SQLITE3_LOAD_EXTENSION LOAD_DLL_FN (library, sqlite3_load_extension); + LOAD_DLL_FN (library, sqlite3_db_config); # endif LOAD_DLL_FN (library, sqlite3_prepare_v2); return true; @@ -684,9 +690,28 @@ DEFUN ("sqlite-load-extension", Fsqlite_load_extension, CHECK_STRING (module); /* Add names of useful and free modules here. */ - const char *allowlist[3] = { "pcre", "csvtable", NULL }; + const char *allowlist[] = { + "base64", + "cksumvfs", + "compress", + "csv", + "csvtable", + "fts3", + "icu", + "pcre", + "percentile", + "regexp", + "rot13", + "rtree", + "sha1", + "uuid", + "vfslog", + "zipfile", + NULL + }; char *name = SSDATA (Ffile_name_nondirectory (module)); - /* Possibly skip past a common prefix. */ + /* Possibly skip past a common prefix (libsqlite3_mod_ is used by + Debian, see https://packages.debian.org/source/sid/sqliteodbc). */ const char *prefix = "libsqlite3_mod_"; if (!strncmp (name, prefix, strlen (prefix))) name += strlen (prefix); @@ -697,7 +722,7 @@ DEFUN ("sqlite-load-extension", Fsqlite_load_extension, if (strlen (*allow) < strlen (name) && !strncmp (*allow, name, strlen (*allow)) && (!strcmp (name + strlen (*allow), ".so") - || !strcmp (name + strlen (*allow), ".DLL"))) + || !strcasecmp (name + strlen (*allow), ".dll"))) { do_allow = true; break; @@ -707,12 +732,22 @@ DEFUN ("sqlite-load-extension", Fsqlite_load_extension, if (!do_allow) xsignal1 (Qsqlite_error, build_string ("Module name not on allowlist")); - int result = sqlite3_load_extension - (XSQLITE (db)->db, - SSDATA (ENCODE_FILE (Fexpand_file_name (module, Qnil))), - NULL, NULL); - if (result == SQLITE_OK) - return Qt; + /* Expand all Lisp data explicitly, so as to avoid signaling an + error while extension loading is enabled -- we don't want to + "leak" this outside this function. */ + sqlite3 *sdb = XSQLITE (db)->db; + char *ext_fn = SSDATA (ENCODE_FILE (Fexpand_file_name (module, Qnil))); + /* Temporarily enable loading extensions via the C API. */ + int result = sqlite3_db_config (sdb, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, + NULL); + if (result == SQLITE_OK) + { + result = sqlite3_load_extension (sdb, ext_fn, NULL, NULL); + /* Disable loading extensions via C API. */ + sqlite3_db_config (sdb, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 0, NULL); + if (result == SQLITE_OK) + return Qt; + } return Qnil; } #endif /* HAVE_SQLITE3_LOAD_EXTENSION */ diff --git a/test/src/sqlite-tests.el b/test/src/sqlite-tests.el index 460651def78..f7144c15887 100644 --- a/test/src/sqlite-tests.el +++ b/test/src/sqlite-tests.el @@ -197,10 +197,13 @@ sqlite-load-extension (sqlite-load-extension db "/usr/lib/sqlite3/")) (should-error (sqlite-load-extension db "/usr/lib/sqlite3")) - (should - (memq - (sqlite-load-extension db "/usr/lib/sqlite3/pcre.so") - '(nil t))) + (if (eq system-type 'windows-nt) + (should + (eq (sqlite-load-extension db "/usr/lib/sqlite3/pcre.dll") + (file-readable-p "/usr/lib/sqlite3/pcre.dll"))) + (should + (eq (sqlite-load-extension db "/usr/lib/sqlite3/pcre.so") + (file-readable-p "/usr/lib/sqlite3/pcre.so")))) (should-error (sqlite-load-extension @@ -211,11 +214,13 @@ sqlite-load-extension (should-error (sqlite-load-extension db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable")) - (should - (memq - (sqlite-load-extension - db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so") - '(nil t))))) + (if (eq system-type 'windows-nt) + (should + (eq (sqlite-load-extension db "/usr/lib/sqlite3/csvtable.dll") + (file-readable-p "/usr/lib/sqlite3/csvtable.dll"))) + (should + (eq (sqlite-load-extension db "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so") + (file-readable-p "/usr/lib/x86_64-linux-gnu/libsqlite3_mod_csvtable.so")))))) (ert-deftest sqlite-blob () (skip-unless (sqlite-available-p)) commit a6bddd176582f8bea79ec77e1e27bb583a6ef0b5 Author: Michael Albinus Date: Sat May 20 14:00:56 2023 +0200 ; * etc/NEWS: Fix typos. diff --git a/etc/NEWS b/etc/NEWS index cdad1796e77..379ddbde072 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1844,10 +1844,10 @@ this includes "binary" buffers like 'archive-mode' and 'image-mode'. +++ *** New command 'package-upgrade'. -This command allows you to upgrade packages without using 'M-x -list-packages'. A package that comes with the Emacs distribution can -only be upgraded after you install, once, a newer version from ELPA -via the package-menu displayed by 'list-packages'. +This command allows you to upgrade packages without using 'list-packages'. +A package that comes with the Emacs distribution can only be upgraded +after you install, once, a newer version from ELPA via the +package-menu displayed by 'list-packages'. +++ *** New command 'package-upgrade-all'. @@ -1908,10 +1908,10 @@ enabled. In addition, when this option is non-nil, built-in packages for which a new version is available in archives can be upgraded via the package -menu produced by 'M-x list-packages'. If you do set this option -non-nil, we recommend not to use the 'U' command, but instead to use -'/ u' to show the packages which can be upgraded, and then decide -which ones of them you actually want to update from the archives. +menu produced by 'list-packages'. If you do set this option non-nil, +we recommend not to use the 'U' command, but instead to use '/ u' to +show the packages which can be upgraded, and then decide which ones of +them you actually want to update from the archives. If you customize this option, we recommend you place its non-default setting in your early-init file. @@ -3872,11 +3872,11 @@ The following generalized variables have been made obsolete: 'window-height', 'window-width', and 'x-get-secondary-selection'. --- -** The 'dotimes' loop variable can no longer be manipulated in loop body +** The 'dotimes' loop variable can no longer be manipulated in loop body. Previously, the 'dotimes' loop counter could be modified inside the -loop body, but only in code using dynamic binding. Now the behaviour +loop body, but only in code using dynamic binding. Now the behavior is the same as when using lexical binding: changes to the loop -variable has no effect on subsequent iterations. That is, +variable have no effect on subsequent iterations. That is, (dotimes (i 10) (print i) commit 870a078c06102e763d57366c123980545e245d9e Author: Michael Albinus Date: Sat May 20 12:13:09 2023 +0200 Improve handling of ANSI control sequences in Tramp * lisp/net/tramp-compat.el (ansi-color): Require. * lisp/net/tramp-sh.el (tramp-display-escape-sequence-regexp) (tramp-device-escape-sequence-regexp): Delete. (tramp-sh-handle-insert-directory, tramp-barf-if-no-shell-prompt) (tramp-wait-for-output): Use `ansi-color-control-seq-regexp'. * lisp/net/tramp.el (tramp-shell-prompt-pattern): Remove escape characters. (tramp-process-one-action, tramp-convert-file-attributes): Use `ansi-color-control-seq-regexp'. (Bug#63539) * test/lisp/net/tramp-tests.el (tramp-display-escape-sequence-regexp): Dont't declare. (tramp-test28-process-file, tramp-test32-shell-command): Use `ansi-color-control-seq-regexp'. (tramp-test45-asynchronous-requests): Adapt test. diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 43544ae327e..40ea47ede40 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -29,6 +29,7 @@ ;;; Code: +(require 'ansi-color) (require 'auth-source) (require 'format-spec) (require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 49e6d2d7aa9..d4933ad7ba6 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -80,13 +80,6 @@ tramp-histfile-override (const :tag "Unset HISTFILE" t) (string :tag "Redirect to a file"))) -;;;###tramp-autoload -(defconst tramp-display-escape-sequence-regexp (rx "\e" (+ (any ";[" digit)) "m") - "Terminal control escape sequences for display attributes.") - -(defconst tramp-device-escape-sequence-regexp (rx "\e" (+ (any "[" digit)) "n") - "Terminal control escape sequences for device status.") - ;; ksh on OpenBSD 4.5 requires that $PS1 contains a `#' character for ;; root users. It uses the `$' character for other users. In order ;; to guarantee a proper prompt, we use "#$ " for the prompt. @@ -2654,7 +2647,7 @@ tramp-sh-handle-insert-directory (unless (tramp-compat-string-search "color" (tramp-get-connection-property v "ls" "")) (goto-char (point-min)) - (while (re-search-forward tramp-display-escape-sequence-regexp nil t) + (while (re-search-forward ansi-color-control-seq-regexp nil t) (replace-match ""))) ;; Now decode what read if necessary. Stolen from `insert-directory'. @@ -4323,6 +4316,7 @@ tramp-barf-if-no-shell-prompt proc timeout (rx (| (regexp shell-prompt-pattern) (regexp tramp-shell-prompt-pattern)) + (? (regexp ansi-color-control-seq-regexp)) eos)) (error (delete-process proc) @@ -4831,6 +4825,7 @@ tramp-ssh-option-exists-p "Check, whether local ssh OPTION is applicable." ;; We don't want to cache it persistently. (with-tramp-connection-property nil option + ;; "ssh -G" is introduced in OpenSSH 6.7. ;; We use a non-existing IP address for check, in order to avoid ;; useless connections, and DNS timeouts. (zerop @@ -5306,7 +5301,7 @@ tramp-wait-for-output (regexp (rx (* (not (any "#$\n"))) (literal tramp-end-of-output) - (? (regexp tramp-device-escape-sequence-regexp)) + (? (regexp ansi-color-control-seq-regexp)) (? "\r") eol)) ;; Sometimes, the commands do not return a newline but a ;; null byte before the shell prompt, for example "git diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 910d534330c..f986d65d944 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -624,9 +624,7 @@ tramp-shell-prompt-pattern ;; connection initialization; Tramp redefines the prompt afterwards. (rx (| bol "\r") (* (not (any "\n#$%>]"))) - (? "#") (any "#$%>]") (* blank) - ;; Escape characters. - (* "[" (* (any ";" digit)) alpha (* blank))) + (? "#") (any "#$%>]") (* blank)) "Regexp to match prompts from remote shell. Normally, Tramp expects you to configure `shell-prompt-pattern' correctly, but sometimes it happens that you are connecting to a @@ -5711,6 +5709,12 @@ tramp-process-one-action "Wait for output from the shell and perform one action. See `tramp-process-actions' for the format of ACTIONS." (let ((case-fold-search t) + (shell-prompt-pattern + (rx (regexp shell-prompt-pattern) + (? (regexp ansi-color-control-seq-regexp)))) + (tramp-shell-prompt-pattern + (rx (regexp tramp-shell-prompt-pattern) + (? (regexp ansi-color-control-seq-regexp)))) tramp-process-action-regexp found todo item pattern action) (while (not found) @@ -5721,7 +5725,7 @@ tramp-process-one-action (while todo (setq item (pop todo) tramp-process-action-regexp (symbol-value (nth 0 item)) - pattern (format "\\(%s\\)\\'" tramp-process-action-regexp) + pattern (rx (group (regexp tramp-process-action-regexp)) eos) action (nth 1 item)) (tramp-message vec 5 "Looking for regexp \"%s\" from remote shell" pattern) @@ -6278,8 +6282,7 @@ tramp-convert-file-attributes (save-match-data ;; Remove color escape sequences from symlink. (when (stringp (car attr)) - (while (string-match - tramp-display-escape-sequence-regexp (car attr)) + (while (string-match ansi-color-control-seq-regexp (car attr)) (setcar attr (replace-match "" nil nil (car attr))))) ;; Convert uid and gid. Use `tramp-unknown-id-integer' ;; as indication of unusable value. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 6c773908e26..eec4a66a329 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -66,7 +66,6 @@ (defvar ange-ftp-make-backup-files) (defvar tramp-connection-properties) (defvar tramp-copy-size-limit) -(defvar tramp-display-escape-sequence-regexp) (defvar tramp-fuse-remove-hidden-files) (defvar tramp-fuse-unmount-on-cleanup) (defvar tramp-inline-compress-start-size) @@ -4941,8 +4940,7 @@ tramp-test28-process-file (if (bufferp destination) destination (current-buffer)) ;; "ls" could produce colorized output. (goto-char (point-min)) - (while (re-search-forward - tramp-display-escape-sequence-regexp nil t) + (while (re-search-forward ansi-color-control-seq-regexp nil t) (replace-match "" nil nil)) (should (string-equal (if destination (format "%s\n" fnnd) "") @@ -4956,8 +4954,7 @@ tramp-test28-process-file (if (bufferp destination) destination (current-buffer)) ;; "ls" could produce colorized output. (goto-char (point-min)) - (while (re-search-forward - tramp-display-escape-sequence-regexp nil t) + (while (re-search-forward ansi-color-control-seq-regexp nil t) (replace-match "" nil nil)) (should (string-equal @@ -5671,8 +5668,7 @@ tramp-test32-shell-command (current-buffer)) ;; "ls" could produce colorized output. (goto-char (point-min)) - (while - (re-search-forward tramp-display-escape-sequence-regexp nil t) + (while (re-search-forward ansi-color-control-seq-regexp nil t) (replace-match "" nil nil)) (should (string-equal @@ -7589,34 +7585,37 @@ tramp-test45-asynchronous-requests ;; Send a string to the processes. Use a random order of ;; the buffers. Mix with regular operation. - (let ((buffers (copy-sequence buffers))) + (let ((buffers (copy-sequence buffers)) + buf) (while buffers - (let* ((buf (seq-random-elt buffers)) - (proc (get-buffer-process buf)) - (file (process-get proc 'foo)) - (count (process-get proc 'bar))) - (tramp--test-message - "Start action %d %s %s" count buf (current-time-string)) - ;; Regular operation prior process action. - (dired-uncache file) - (if (= count 0) - (should-not (file-attributes file)) - (should (file-attributes file))) - ;; Send string to process. - (process-send-string proc (format "%s\n" (buffer-name buf))) - (while (accept-process-output nil 0)) - (tramp--test-message - "Continue action %d %s %s" count buf (current-time-string)) - ;; Regular operation post process action. - (dired-uncache file) - (if (= count 2) - (should-not (file-attributes file)) - (should (file-attributes file))) - (tramp--test-message - "Stop action %d %s %s" count buf (current-time-string)) - (process-put proc 'bar (1+ count)) - (unless (process-live-p proc) - (setq buffers (delq buf buffers)))))) + (setq buf (seq-random-elt buffers)) + (if-let ((proc (get-buffer-process buf)) + (file (process-get proc 'foo)) + (count (process-get proc 'bar))) + (progn + (tramp--test-message + "Start action %d %s %s" count buf (current-time-string)) + ;; Regular operation prior process action. + (dired-uncache file) + (if (= count 0) + (should-not (file-attributes file)) + (should (file-attributes file))) + ;; Send string to process. + (process-send-string proc (format "%s\n" (buffer-name buf))) + (while (accept-process-output nil 0)) + (tramp--test-message + "Continue action %d %s %s" count buf (current-time-string)) + ;; Regular operation post process action. + (dired-uncache file) + (if (= count 2) + (should-not (file-attributes file)) + (should (file-attributes file))) + (tramp--test-message + "Stop action %d %s %s" count buf (current-time-string)) + (process-put proc 'bar (1+ count)) + (unless (process-live-p proc) + (setq buffers (delq buf buffers)))) + (setq buffers (delq buf buffers))))) ;; Checks. All process output shall exist in the ;; respective buffers. All created files shall be commit 0de472e04fb29581e8302b60fafc707b18d7cbf3 Author: Mattias Engdegård Date: Thu May 18 17:33:15 2023 +0200 Use `delq` return value (bug#61730) * lisp/calc/calc-graph.el (calc-graph-compute-2d): * lisp/calendar/appt.el (appt-activate): * lisp/progmodes/cc-styles.el (c-make-styles-buffer-local): Make use of what `delq` returns, to stave off possible mistakes or at least make clear that there isn't any. diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 3de761e19f8..1b9d25daf3b 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -598,9 +598,10 @@ calc-graph-compute-2d (math-build-var-name (car math-arglist)) '(var DUMMY var-DUMMY))))) (setq calc-graph-ycache (assoc calc-graph-yvalue calc-graph-data-cache)) - (delq calc-graph-ycache calc-graph-data-cache) - (nconc calc-graph-data-cache - (list (or calc-graph-ycache (setq calc-graph-ycache (list calc-graph-yvalue))))) + (setq calc-graph-data-cache + (nconc (delq calc-graph-ycache calc-graph-data-cache) + (list (or calc-graph-ycache + (setq calc-graph-ycache (list calc-graph-yvalue)))))) (if (and (not (setq calc-graph-xvec (eq (car-safe calc-graph-xvalue) 'vec))) calc-graph-refine (cdr (cdr calc-graph-ycache))) (calc-graph-refine-2d) diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index 49597739446..11beee94e64 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -707,7 +707,7 @@ appt-activate (not appt-active))) (remove-hook 'write-file-functions #'appt-update-list) (or global-mode-string (setq global-mode-string '(""))) - (delq 'appt-mode-string global-mode-string) + (setq global-mode-string (delq 'appt-mode-string global-mode-string)) (when appt-timer (cancel-timer appt-timer) (setq appt-timer nil)) diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index fc4f723915c..e412a52cfb8 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -658,8 +658,9 @@ c-make-styles-buffer-local (let ((func (if this-buf-only-p 'make-local-variable 'make-variable-buffer-local)) - (varsyms (cons 'c-indentation-style (copy-alist c-style-variables)))) - (delq 'c-special-indent-hook varsyms) + (varsyms (cons 'c-indentation-style + (delq 'c-special-indent-hook + (copy-alist c-style-variables))))) (mapc func varsyms) ;; Hooks must be handled specially (if this-buf-only-p commit f49fe936abd48f7458596893d25e3300f59508be Author: Mattias Engdegård Date: Sat May 20 10:50:25 2023 +0200 * etc/NEWS: Note dotimes loop variable scoping change (bug#63586) diff --git a/etc/NEWS b/etc/NEWS index fa428d9c790..cdad1796e77 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3871,6 +3871,19 @@ The following generalized variables have been made obsolete: 'standard-case-table', 'syntax-table', 'visited-file-modtime', 'window-height', 'window-width', and 'x-get-secondary-selection'. +--- +** The 'dotimes' loop variable can no longer be manipulated in loop body +Previously, the 'dotimes' loop counter could be modified inside the +loop body, but only in code using dynamic binding. Now the behaviour +is the same as when using lexical binding: changes to the loop +variable has no effect on subsequent iterations. That is, + + (dotimes (i 10) + (print i) + (setq i (+ i 6))) + +now always prints the numbers 0 .. 9. + * Lisp Changes in Emacs 29.1 commit cec9333dc5292f9aca2642209617310a64570763 Author: Yuan Fu Date: Sat May 20 00:45:39 2023 -0700 Fix c-ts-mode--top-level-declarator * lisp/progmodes/c-ts-mode.el: (c-ts-mode--top-level-declarator): Don't use treesit-node-match-p. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 7a57d5adeb1..c6cb9520e58 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -767,7 +767,7 @@ c-ts-mode--top-level-declarator ;; more cases. (let* ((parent (treesit-node-parent node)) (grandparent (treesit-node-parent parent))) - (and (treesit-node-match-p parent "ERROR") + (and (equal (treesit-node-type parent) "ERROR") (null grandparent)))) (defun c-ts-mode--fontify-variable (node override start end &rest _) commit f571e8f1bb678c52839180e450c2415b31a70516 Author: Yuan Fu Date: Fri May 19 16:09:17 2023 -0700 Improve c-ts-mode font-lock for function names (bug#63390) When a function definition has preproc directives in its body, it can't correctly parse into a function_definition. This fix tries to recognize this case and highlight the function_declarator correctly. * lisp/progmodes/c-ts-mode.el: (c-ts-mode--font-lock-settings): New rule. (c-ts-mode--top-level-declarator): New function. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index b042782efa7..7a57d5adeb1 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -627,6 +627,13 @@ c-ts-mode--font-lock-settings (function_definition declarator: (_) @c-ts-mode--fontify-declarator) + ;; When a function definition has preproc directives in its body, + ;; it can't correctly parse into a function_definition. We still + ;; want to highlight the function_declarator correctly, hence + ;; this rule. See bug#63390 for more detail. + ((function_declarator) @c-ts-mode--fontify-declarator + (:pred c-ts-mode--top-level-declarator + @c-ts-mode--fontify-declarator)) (parameter_declaration declarator: (_) @c-ts-mode--fontify-declarator) @@ -750,6 +757,19 @@ c-ts-mode--fontify-declarator (treesit-node-start identifier) (treesit-node-end identifier) face override start end)))) +(defun c-ts-mode--top-level-declarator (node) + "Return non-nil if NODE is a top-level function_declarator." + ;; These criterion are observed in + ;; xterm.c:x_draw_glyphless_glyph_string_foreground on emacs-29 + ;; branch, described in bug#63390. They might not cover all cases + ;; where a function_declarator is at top-level, outside of a + ;; function_definition. We might need to amend them as we discover + ;; more cases. + (let* ((parent (treesit-node-parent node)) + (grandparent (treesit-node-parent parent))) + (and (treesit-node-match-p parent "ERROR") + (null grandparent)))) + (defun c-ts-mode--fontify-variable (node override start end &rest _) "Fontify an identifier node if it is a variable. Don't fontify if it is a function identifier. For NODE, commit 42a28ffdc27498b66904c3d49e2f000a9b4690ca Author: Juri Linkov Date: Fri May 19 21:14:16 2023 +0300 * lisp/tab-bar.el: Don't use 'minibuffer-selected-window' (bug#62427). (tab-bar-select-tab, tab-bar-new-tab-to): Use 'window-minibuffer-p' instead of 'minibuffer-selected-window'. And switch to 'get-mru-window' instead of 'minibuffer-selected-window'. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 73f2ff77c50..dc9ea63c490 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1319,8 +1319,8 @@ tab-bar-select-tab (ws ;; `window-state-put' fails when called in the minibuffer - (when (minibuffer-selected-window) - (select-window (minibuffer-selected-window))) + (when (window-minibuffer-p) + (select-window (get-mru-window))) (window-state-put ws nil 'safe))) ;; Select the minibuffer when it was active before switching tabs @@ -1331,8 +1331,8 @@ tab-bar-select-tab ;; another tab, then after going back to the first tab, it has ;; such inconsistent state that the current buffer is the minibuffer, ;; but its window is not active. So try to undo this mess. - (when (and (minibufferp) (not (active-minibuffer-window))) - (other-window 1)) + (when (and (window-minibuffer-p) (not (active-minibuffer-window))) + (select-window (get-mru-window))) (when tab-bar-history-mode (setq tab-bar-history-omit t)) @@ -1550,8 +1550,8 @@ tab-bar-new-tab-to (when tab-bar-new-tab-choice ;; Handle the case when it's called in the active minibuffer. - (when (minibuffer-selected-window) - (select-window (minibuffer-selected-window))) + (when (window-minibuffer-p) + (select-window (get-mru-window))) (let ((ignore-window-parameters t) (window--sides-inhibit-check t)) (if (eq tab-bar-new-tab-choice 'clone) commit 8e61d23f71e75225e1e48a572db76c2845a4201a Author: Juri Linkov Date: Fri May 19 21:04:50 2023 +0300 Split windows horizontally in places that use split to create a new window. * lisp/tab-bar.el (tab-bar-new-tab-to): * lisp/window.el (window-state-put): To create a new window, split horizontally instead of vertically. Use 'window-safe-min-width' for the SIZE arg of 'split-window'. (bug#62592) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index ab428b81631..73f2ff77c50 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1568,7 +1568,8 @@ tab-bar-new-tab-to (window-state-put (window-state-get))) ;; Create a new window to get rid of old window parameters ;; (e.g. prev/next buffers) of old window. - (split-window) (delete-window)))) + (split-window nil window-safe-min-width t) + (delete-window)))) (let ((buffer (if (and (functionp tab-bar-new-tab-choice) diff --git a/lisp/window.el b/lisp/window.el index 016d53ffbdd..a11b1a51f8f 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6382,7 +6382,7 @@ window-state-put (selected-window))) (delete-other-windows-internal window root) ;; Create a new window to replace the existing one. - (setq window (prog1 (split-window window) + (setq window (prog1 (split-window window window-safe-min-width t) (delete-window window))))) (set-window-dedicated-p window nil) commit bd6bba4780dcfdec97ab5e6469f7777c4b2a1b0d Author: Mattias Engdegård Date: Fri May 19 12:32:28 2023 +0200 Improved copy-tree documentation and test (bug#63509) * etc/NEWS: Move entry since it's an incompatible change. * lisp/emacs-lisp/shortdoc.el (vector): Make the example relevant. * lisp/subr.el (copy-tree): Rename second argument, since 'vector-like' is a term with a specific meaning in Emacs but not the one intended here. * doc/lispref/lists.texi (Building Lists): Rename second argument, and make it clear that the input must be acyclic. * doc/lispref/records.texi (Record Functions): Be more precise: `copy-sequence` is used to copy records, `copy-tree` copies trees made of records etc. * test/lisp/subr-tests.el (subr--copy-tree): Extend and strengthen the test considerably, using the print-circle trick to detect structure sharing precisely. diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 16ed0358974..6a00f2887e7 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -696,7 +696,7 @@ Building Lists resulting list. Instead, the sequence becomes the final @sc{cdr}, like any other non-list final argument. -@defun copy-tree tree &optional vector-like-p +@defun copy-tree tree &optional vectors-and-records This function returns a copy of the tree @var{tree}. If @var{tree} is a cons cell, this makes a new cons cell with the same @sc{car} and @sc{cdr}, then recursively copies the @sc{car} and @sc{cdr} in the @@ -704,9 +704,9 @@ Building Lists Normally, when @var{tree} is anything other than a cons cell, @code{copy-tree} simply returns @var{tree}. However, if -@var{vector-like-p} is non-@code{nil}, it copies vectors and records -too (and operates recursively on their elements). This function -cannot cope with circular lists. +@var{vectors-and-records} is non-@code{nil}, it copies vectors and records +too (and operates recursively on their elements). The @var{tree} +argument must not contain cycles. @end defun @defun flatten-tree tree diff --git a/doc/lispref/records.texi b/doc/lispref/records.texi index ebc4569c388..287ad869297 100644 --- a/doc/lispref/records.texi +++ b/doc/lispref/records.texi @@ -81,8 +81,9 @@ Record Functions @end example @end defun -To copy records, use @code{copy-tree} with its optional second argument -non-@code{nil}. @xref{Building Lists, copy-tree}. +To copy trees consisting of records, vectors and conses (lists), use +@code{copy-tree} with its optional second argument non-@code{nil}. +@xref{Building Lists, copy-tree}. @node Backward Compatibility @section Backward Compatibility diff --git a/etc/NEWS b/etc/NEWS index f1fb70c5fc6..04ef976a8d1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -388,6 +388,9 @@ These hooks were named incorrectly, and so they never actually ran when unloading the correspending feature. Instead, you should use hooks named after the feature name, like 'esh-mode-unload-hook'. ++++ +** 'copy-tree' now copies records when its optional 2nd argument is non-nil. + * Lisp Changes in Emacs 30.1 @@ -585,9 +588,6 @@ Since circular alias chains now cannot occur, 'function-alias-p', 'indirect-function' and 'indirect-variable' will never signal an error. Their 'noerror' arguments have no effect and are therefore obsolete. -+++ -** 'copy-tree' now copies records when its optional 2nd argument is non-nil. - * Changes in Emacs 30.1 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 6580e0e4e0c..1e8ab4ad46d 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -834,7 +834,7 @@ vector :eval (seq-subseq [1 2 3 4 5] 1 3) :eval (seq-subseq [1 2 3 4 5] 1)) (copy-tree - :eval (copy-tree [1 2 3 4])) + :eval (copy-tree [1 (2 3) [4 5]] t)) "Mapping Over Vectors" (mapcar :eval (mapcar #'identity [1 2 3])) diff --git a/lisp/subr.el b/lisp/subr.el index 83735933963..5a641965659 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -824,26 +824,31 @@ number-sequence next (+ from (* n inc))))) (nreverse seq)))) -(defun copy-tree (tree &optional vector-like-p) +(defun copy-tree (tree &optional vectors-and-records) "Make a copy of TREE. If TREE is a cons cell, this recursively copies both its car and its cdr. -Contrast to `copy-sequence', which copies only along the cdrs. With second -argument VECTOR-LIKE-P, this copies vectors and records as well as conses." +Contrast to `copy-sequence', which copies only along the cdrs. +With the second argument VECTORS-AND-RECORDS non-nil, this +traverses and copies vectors and records as well as conses." (declare (side-effect-free error-free)) (if (consp tree) (let (result) (while (consp tree) (let ((newcar (car tree))) - (if (or (consp (car tree)) (and vector-like-p (or (vectorp (car tree)) (recordp (car tree))))) - (setq newcar (copy-tree (car tree) vector-like-p))) + (if (or (consp (car tree)) + (and vectors-and-records + (or (vectorp (car tree)) (recordp (car tree))))) + (setq newcar (copy-tree (car tree) vectors-and-records))) (push newcar result)) (setq tree (cdr tree))) (nconc (nreverse result) - (if (and vector-like-p (or (vectorp tree) (recordp tree))) (copy-tree tree vector-like-p) tree))) - (if (and vector-like-p (or (vectorp tree) (recordp tree))) + (if (and vectors-and-records (or (vectorp tree) (recordp tree))) + (copy-tree tree vectors-and-records) + tree))) + (if (and vectors-and-records (or (vectorp tree) (recordp tree))) (let ((i (length (setq tree (copy-sequence tree))))) (while (>= (setq i (1- i)) 0) - (aset tree i (copy-tree (aref tree i) vector-like-p))) + (aset tree i (copy-tree (aref tree i) vectors-and-records))) tree) tree))) diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 4ebb68556be..1c220b1da18 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -1207,35 +1207,54 @@ subr--delete-consecutive-dups (should (eq a a-dedup)))) (ert-deftest subr--copy-tree () - (should (eq (copy-tree nil) nil)) - (let* ((a (list (list "a") "b" (list "c") "g")) - (copy1 (copy-tree a)) - (copy2 (copy-tree a t))) - (should (equal a copy1)) - (should (equal a copy2)) - (should-not (eq a copy1)) - (should-not (eq a copy2))) - (let* ((a (list (list "a") "b" (list "c" (record 'foo "d")) (list ["e" "f"]) "g")) - (copy1 (copy-tree a)) - (copy2 (copy-tree a t))) - (should (equal a copy1)) - (should (equal a copy2)) - (should-not (eq a copy1)) - (should-not (eq a copy2))) - (let* ((a (record 'foo "a" (record 'bar "b"))) - (copy1 (copy-tree a)) - (copy2 (copy-tree a t))) - (should (equal a copy1)) - (should (equal a copy2)) - (should (eq a copy1)) - (should-not (eq a copy2))) - (let* ((a ["a" "b" ["c" ["d"]]]) - (copy1 (copy-tree a)) - (copy2 (copy-tree a t))) - (should (equal a copy1)) - (should (equal a copy2)) - (should (eq a copy1)) - (should-not (eq a copy2)))) + ;; Check that values other than conses, vectors and records are + ;; neither copied nor traversed. + (let ((s (propertize "abc" 'prop (list 11 12))) + (h (make-hash-table :test #'equal))) + (puthash (list 1 2) (list 3 4) h) + (dolist (x (list nil 'a "abc" s h)) + (should (eq (copy-tree x) x)) + (should (eq (copy-tree x t) x)))) + + ;; Use the printer to detect common parts of Lisp values. + (let ((print-circle t)) + (cl-labels ((prn3 (x y z) (prin1-to-string (list x y z))) + (cat3 (x y z) (concat "(" x " " y " " z ")"))) + (let ((x '(a (b ((c) . d) e) (f)))) + (should (equal (prn3 x (copy-tree x) (copy-tree x t)) + (cat3 "(a (b ((c) . d) e) (f))" + "(a (b ((c) . d) e) (f))" + "(a (b ((c) . d) e) (f))")))) + (let ((x '(a [b (c d)] #s(e (f [g]))))) + (should (equal (prn3 x (copy-tree x) (copy-tree x t)) + (cat3 "(a #1=[b (c d)] #2=#s(e (f [g])))" + "(a #1# #2#)" + "(a [b (c d)] #s(e (f [g])))")))) + (let ((x [a (b #s(c d))])) + (should (equal (prn3 x (copy-tree x) (copy-tree x t)) + (cat3 "#1=[a (b #s(c d))]" + "#1#" + "[a (b #s(c d))]")))) + (let ((x #s(a (b [c d])))) + (should (equal (prn3 x (copy-tree x) (copy-tree x t)) + (cat3 "#1=#s(a (b [c d]))" + "#1#" + "#s(a (b [c d]))")))) + ;; Check cdr recursion. + (let ((x '(a b . [(c . #s(d))]))) + (should (equal (prn3 x (copy-tree x) (copy-tree x t)) + (cat3 "(a b . #1=[(c . #s(d))])" + "(a b . #1#)" + "(a b . [(c . #s(d))])")))) + ;; Check that we can copy DAGs (the result is a tree). + (let ((x (list '(a b) nil [c d] nil #s(e f) nil))) + (setf (nth 1 x) (nth 0 x)) + (setf (nth 3 x) (nth 2 x)) + (setf (nth 5 x) (nth 4 x)) + (should (equal (prn3 x (copy-tree x) (copy-tree x t)) + (cat3 "(#1=(a b) #1# #2=[c d] #2# #3=#s(e f) #3#)" + "((a b) (a b) #2# #2# #3# #3#)" + "((a b) (a b) [c d] [c d] #s(e f) #s(e f))"))))))) (provide 'subr-tests) ;;; subr-tests.el ends here commit 156973639cc57dec47705f76f63c2ef3dc00a61d Author: Yuan Fu Date: Fri May 19 00:15:21 2023 -0700 Implement treesit-forward-sexp correctly (bug#63487) * lisp/treesit.el (treesit-forward-sexp): Signal scan-error when we can't move across sexps further. diff --git a/lisp/treesit.el b/lisp/treesit.el index 49eeba64a14..cc7ec977851 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1791,12 +1791,28 @@ treesit-sexp-type-regexp (defun treesit-forward-sexp (&optional arg) "Tree-sitter implementation for `forward-sexp-function'. -ARG is described in the docstring of `forward-sexp-function'." + +ARG is described in the docstring of `forward-sexp-function'. If +there are no further sexps to move across, signal `scan-error' +like `forward-sexp' does. If point is already at top-level, +return nil without moving point." (interactive "^p") - (or arg (setq arg 1)) - (funcall - (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing) - treesit-sexp-type-regexp (abs arg) 'restricted)) + (let ((arg (or arg 1)) + (pred treesit-sexp-type-regexp)) + (or (if (> arg 0) + (treesit-end-of-thing pred (abs arg) 'restricted) + (treesit-beginning-of-thing pred (abs arg) 'restricted)) + ;; If we couldn't move, we should signal an error and report + ;; the obstacle, like `forward-sexp' does. If we couldn't + ;; find a parent, we simply return nil without moving point, + ;; then functions like `up-list' will signal "at top level". + (when-let* ((parent (nth 2 (treesit--things-around (point) pred))) + (boundary (if (> arg 0) + (treesit-node-child parent -1) + (treesit-node-child parent 0)))) + (signal 'scan-error (list "No more sexp to move across" + (treesit-node-start boundary) + (treesit-node-end boundary))))))) (defun treesit-transpose-sexps (&optional arg) "Tree-sitter `transpose-sexps' function. commit 7ef20e0c81147bcbca0f5cc3fabc9bef5f6c3539 Author: Eli Zaretskii Date: Fri May 19 09:05:45 2023 +0300 Minor fixes of last change * etc/NEWS: * doc/lispref/records.texi (Record Functions): Improve wording. (Bug#63509) diff --git a/doc/lispref/records.texi b/doc/lispref/records.texi index d2c80a27f98..ebc4569c388 100644 --- a/doc/lispref/records.texi +++ b/doc/lispref/records.texi @@ -81,8 +81,8 @@ Record Functions @end example @end defun -@code{copy-tree} works with records when its optional second argument -is non-@code{nil} (@pxref{Building Lists}). +To copy records, use @code{copy-tree} with its optional second argument +non-@code{nil}. @xref{Building Lists, copy-tree}. @node Backward Compatibility @section Backward Compatibility diff --git a/etc/NEWS b/etc/NEWS index c5063a718b9..f1fb70c5fc6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -586,7 +586,7 @@ Since circular alias chains now cannot occur, 'function-alias-p', Their 'noerror' arguments have no effect and are therefore obsolete. +++ -** 'copy-tree' now copies records when its optional argument is non-nil. +** 'copy-tree' now copies records when its optional 2nd argument is non-nil. * Changes in Emacs 30.1 on Non-Free Operating Systems commit 3a1285caba9cd25abaddbc541e3217e2559d79ab Author: Joseph Turner Date: Sun May 14 21:02:15 2023 -0700 Make 'copy-tree' work with records * doc/lispref/lists.texi (Building Cons Cells and Lists): Document new behavior of 'copy-tree'. * doc/lispref/records.texi (Record Functions): Cross-reference to lists.texi. * etc/NEWS: Mention change. (Bug#63509) * lisp/emacs-lisp/shortdoc.el: Add 'copy-tree' example to vector group. * lisp/subr.el (copy-tree): Recurse into records as well as vectors when optional second argument is non-nil. Rename second argument from VECP to VECTOR-LIKE-P. * test/lisp/subr-tests.el: Test new behavior. diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 22a5f7f1239..16ed0358974 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -696,16 +696,17 @@ Building Lists resulting list. Instead, the sequence becomes the final @sc{cdr}, like any other non-list final argument. -@defun copy-tree tree &optional vecp +@defun copy-tree tree &optional vector-like-p This function returns a copy of the tree @var{tree}. If @var{tree} is a cons cell, this makes a new cons cell with the same @sc{car} and @sc{cdr}, then recursively copies the @sc{car} and @sc{cdr} in the same way. Normally, when @var{tree} is anything other than a cons cell, -@code{copy-tree} simply returns @var{tree}. However, if @var{vecp} is -non-@code{nil}, it copies vectors too (and operates recursively on -their elements). This function cannot cope with circular lists. +@code{copy-tree} simply returns @var{tree}. However, if +@var{vector-like-p} is non-@code{nil}, it copies vectors and records +too (and operates recursively on their elements). This function +cannot cope with circular lists. @end defun @defun flatten-tree tree diff --git a/doc/lispref/records.texi b/doc/lispref/records.texi index 26c6f30a6b5..d2c80a27f98 100644 --- a/doc/lispref/records.texi +++ b/doc/lispref/records.texi @@ -81,6 +81,9 @@ Record Functions @end example @end defun +@code{copy-tree} works with records when its optional second argument +is non-@code{nil} (@pxref{Building Lists}). + @node Backward Compatibility @section Backward Compatibility diff --git a/etc/NEWS b/etc/NEWS index ce865c9904d..c5063a718b9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -585,6 +585,9 @@ Since circular alias chains now cannot occur, 'function-alias-p', 'indirect-function' and 'indirect-variable' will never signal an error. Their 'noerror' arguments have no effect and are therefore obsolete. ++++ +** 'copy-tree' now copies records when its optional argument is non-nil. + * Changes in Emacs 30.1 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 9a6f5dd12ce..6580e0e4e0c 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -833,6 +833,8 @@ vector (seq-subseq :eval (seq-subseq [1 2 3 4 5] 1 3) :eval (seq-subseq [1 2 3 4 5] 1)) + (copy-tree + :eval (copy-tree [1 2 3 4])) "Mapping Over Vectors" (mapcar :eval (mapcar #'identity [1 2 3])) diff --git a/lisp/subr.el b/lisp/subr.el index 03d3324f3d8..83735933963 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -824,26 +824,26 @@ number-sequence next (+ from (* n inc))))) (nreverse seq)))) -(defun copy-tree (tree &optional vecp) +(defun copy-tree (tree &optional vector-like-p) "Make a copy of TREE. If TREE is a cons cell, this recursively copies both its car and its cdr. Contrast to `copy-sequence', which copies only along the cdrs. With second -argument VECP, this copies vectors as well as conses." +argument VECTOR-LIKE-P, this copies vectors and records as well as conses." (declare (side-effect-free error-free)) (if (consp tree) (let (result) (while (consp tree) (let ((newcar (car tree))) - (if (or (consp (car tree)) (and vecp (vectorp (car tree)))) - (setq newcar (copy-tree (car tree) vecp))) + (if (or (consp (car tree)) (and vector-like-p (or (vectorp (car tree)) (recordp (car tree))))) + (setq newcar (copy-tree (car tree) vector-like-p))) (push newcar result)) (setq tree (cdr tree))) (nconc (nreverse result) - (if (and vecp (vectorp tree)) (copy-tree tree vecp) tree))) - (if (and vecp (vectorp tree)) + (if (and vector-like-p (or (vectorp tree) (recordp tree))) (copy-tree tree vector-like-p) tree))) + (if (and vector-like-p (or (vectorp tree) (recordp tree))) (let ((i (length (setq tree (copy-sequence tree))))) (while (>= (setq i (1- i)) 0) - (aset tree i (copy-tree (aref tree i) vecp))) + (aset tree i (copy-tree (aref tree i) vector-like-p))) tree) tree))) diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 8f46c2af136..4ebb68556be 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -1206,5 +1206,36 @@ subr--delete-consecutive-dups (should (equal a-dedup '("a" "b" "a" "b" "c"))) (should (eq a a-dedup)))) +(ert-deftest subr--copy-tree () + (should (eq (copy-tree nil) nil)) + (let* ((a (list (list "a") "b" (list "c") "g")) + (copy1 (copy-tree a)) + (copy2 (copy-tree a t))) + (should (equal a copy1)) + (should (equal a copy2)) + (should-not (eq a copy1)) + (should-not (eq a copy2))) + (let* ((a (list (list "a") "b" (list "c" (record 'foo "d")) (list ["e" "f"]) "g")) + (copy1 (copy-tree a)) + (copy2 (copy-tree a t))) + (should (equal a copy1)) + (should (equal a copy2)) + (should-not (eq a copy1)) + (should-not (eq a copy2))) + (let* ((a (record 'foo "a" (record 'bar "b"))) + (copy1 (copy-tree a)) + (copy2 (copy-tree a t))) + (should (equal a copy1)) + (should (equal a copy2)) + (should (eq a copy1)) + (should-not (eq a copy2))) + (let* ((a ["a" "b" ["c" ["d"]]]) + (copy1 (copy-tree a)) + (copy2 (copy-tree a t))) + (should (equal a copy1)) + (should (equal a copy2)) + (should (eq a copy1)) + (should-not (eq a copy2)))) + (provide 'subr-tests) ;;; subr-tests.el ends here commit 459d08c7fe7f723b3cefe71fa50bbe4481f66995 Author: Yuan Fu Date: Thu May 18 14:44:26 2023 -0700 Fix tree-sitter test (bug#63481) * test/src/treesit-tests.el (treesit-basic-parsing): Latest json parser doesn't return an error on empty buffer or multiple objects anymore [1]. https://github.com/tree-sitter/tree-sitter-json/commit/40a81c01a40ac48744e0c8ccabbaba1920441199 diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 468cd221ef9..fef603840f9 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -66,7 +66,7 @@ treesit-basic-parsing (should (equal (treesit-node-string (treesit-parser-root-node parser)) - "(ERROR)")) + "(document)")) (insert "[1,2,3]") (should commit 8c9377b6c4e907e65712fbf0ba0cf90f51da5ef6 Author: Mattias Engdegård Date: Thu May 18 17:22:41 2023 +0200 Try declaring `delq` and `delete` important-return-value (bug#61730) * lisp/emacs-lisp/bytecomp.el (important-return-value-fns): Add (uncomment) `delq` and `delete`. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index a192d599d1d..deda4573229 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3569,7 +3569,7 @@ byte-compile-form ;; Adding these functions causes many warnings; ;; evaluate how many of them are false first. - ;;delq delete + delq delete ;;nconc plist-put ))) (dolist (fn important-return-value-fns) commit 3bc5efb87e5ac9b7068e71307466b2d0220e92fb Author: Eli Zaretskii Date: Thu May 18 17:20:36 2023 +0300 ; * lisp/emacs-lisp/benchmark.el (benchmark-progn): Fix declare form. diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el index dc7889c40a0..e50b8524f29 100644 --- a/lisp/emacs-lisp/benchmark.el +++ b/lisp/emacs-lisp/benchmark.el @@ -152,7 +152,7 @@ benchmark (defmacro benchmark-progn (&rest body) "Evaluate BODY and message the time taken. The return value is the value of the final form in BODY." - (declare (debug body) (indent 0)) + (declare (debug t) (indent 0)) (let ((value (make-symbol "value")) (start (make-symbol "start")) (gcs (make-symbol "gcs")) commit d1404d3a11999a41b1147698479e858b1a3b6353 Author: Basil L. Contovounesios Date: Wed May 17 13:53:09 2023 +0100 Simplify python.el completion-predicate * lisp/progmodes/python.el: (python-skeleton-define): Use command-modes as a shorthand for completion-predicate (bug#63552). (python--completion-predicate, python-shell--completion-predicate): Remove accordingly; no longer used. (python-define-auxiliary-skeleton): Prefer function-put over put. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0ddce92b21e..4f57eda3cfc 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5029,11 +5029,6 @@ 'python-mode-skeleton-abbrev-table (not (python-syntax-comment-or-string-p)) python-skeleton-autoinsert))) -(defun python--completion-predicate (_ buffer) - (provided-mode-derived-p - (buffer-local-value 'major-mode buffer) - 'python-base-mode)) - (defmacro python-skeleton-define (name doc &rest skel) "Define a `python-mode' skeleton using NAME DOC and SKEL. The skeleton will be bound to python-skeleton-NAME and will @@ -5042,7 +5037,7 @@ python-skeleton-define (let* ((name (symbol-name name)) (function-name (intern (concat "python-skeleton-" name)))) `(progn - (put ',function-name 'completion-predicate #'python--completion-predicate) + (function-put ',function-name 'command-modes '(python-base-mode)) (define-abbrev python-mode-skeleton-abbrev-table ,name "" ',function-name :system t) (setq python-skeleton-available @@ -5069,7 +5064,7 @@ python-define-auxiliary-skeleton `(< ,(format "%s:" name) \n \n > _ \n))) `(progn - (put ',function-name 'completion-predicate #'ignore) + (function-put ',function-name 'completion-predicate #'ignore) (define-skeleton ,function-name ,(or doc (format "Auxiliary skeleton for %s statement." name)) @@ -6817,7 +6812,7 @@ python-ts-mode (add-to-list 'interpreter-mode-alist '("python[0-9.]*" . python-ts-mode)))) ;;; Completion predicates for M-x -;; Commands that only make sense when editing Python code +;; Commands that only make sense when editing Python code. (dolist (sym '(python-add-import python-check python-fill-paragraph @@ -6851,12 +6846,7 @@ python-ts-mode python-shell-send-defun python-shell-send-statement python-sort-imports)) - (put sym 'completion-predicate #'python--completion-predicate)) - -(defun python-shell--completion-predicate (_ buffer) - (provided-mode-derived-p - (buffer-local-value 'major-mode buffer) - 'python-base-mode 'inferior-python-mode)) + (function-put sym 'command-modes '(python-base-mode))) ;; Commands that only make sense in the Python shell or when editing ;; Python code. @@ -6871,8 +6861,8 @@ python-shell--completion-predicate python-shell-font-lock-turn-off python-shell-font-lock-turn-on python-shell-package-enable - python-shell-completion-complete-or-indent )) - (put sym 'completion-predicate #'python-shell--completion-predicate)) + python-shell-completion-complete-or-indent)) + (function-put sym 'command-modes '(python-base-mode inferior-python-mode))) (provide 'python) commit f518543aa4ed00f91842dc5a58cc90a320e3e2e5 Merge: 92a00de5c59 f8d9e40d2c1 Author: Eli Zaretskii Date: Thu May 18 07:49:49 2023 -0400 Merge from origin/emacs-29 f8d9e40d2c1 Attempt to fix redisplay problems on macOS 4daa6f70497 ; * lisp/simple.el (async-shell-command): Add commentary ... dc1a437d460 Clarify misleading comment in isearch.el af3b0dc53ff Improve documentation of package-menu commands d879847cd4d Fix M-x completion-predicate under python-ts-mode 1e57b2b4c79 * Account for `byte-compile-warnings' during native compi... b5bfd808c6b Avoid duplicate VC packages in 'package-selected-packages' c18f9f155f6 * lisp/tab-bar.el (tab-bar-new-tab-to): Set 'window-side'... 33485fe8f74 ; Better warning message when loading tree-sitter fails 95a724abaac Update to Org 9.6.6 c665ca79ff4 ; * admin/make-tarball.txt: Minor copyedits. 3aef46e466f Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ... 229af8e4b31 ; * lisp/progmodes/csharp-mode.el (csharp-ts-mode--defun-... commit 92a00de5c59c6a694e9c0c7b1b5b43a2e2d75726 Merge: d4295285d75 88ca37b8589 Author: Eli Zaretskii Date: Thu May 18 07:49:49 2023 -0400 ; Merge from origin/emacs-29 The following commits were skipped: 88ca37b8589 ; Regenerate files for emacs-29.0.91 4627ede36b1 ; * lisp/ldefs-boot.el: Regenerate for emacs-29.0.91. c90d47619e6 Bump Emacs version for next pretest commit d4295285d7551387630f902fb3ba89c4e4c2886b Merge: 0b722a74a56 229af8e4b31 Author: Eli Zaretskii Date: Thu May 18 07:49:49 2023 -0400 Merge from origin/emacs-29 229af8e4b31 ; * lisp/progmodes/csharp-mode.el (csharp-ts-mode--defun-... ce7d18cbc07 ; Minor fixes in ELisp manual 5c8864fab4f ; * lisp/simple.el (async-shell-command): Doc fix. (Bug#... b96dc472bcb Ignore current-prefix-arg in async-shell-command 1e6a7594361 Fix building of VC package manuals with relative includes 61659f36c88 Another fix for VHDL mode highlighting commit f8d9e40d2c1d127a125adc097d985a0b6964a86c Author: Aaron Jensen Date: Thu May 18 14:20:18 2023 +0300 Attempt to fix redisplay problems on macOS * src/nsterm.m (ns_scroll_run): Attempt to fix redisplay artifacts. (Bug#63187) diff --git a/src/nsterm.m b/src/nsterm.m index c26528e0154..c809c0b824a 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2704,11 +2704,12 @@ Hide the window (X11 semantics) { NSRect srcRect = NSMakeRect (x, from_y, width, height); NSPoint dest = NSMakePoint (x, to_y); + NSRect destRect = NSMakeRect (x, from_y, width, height); EmacsView *view = FRAME_NS_VIEW (f); [view copyRect:srcRect to:dest]; #ifdef NS_IMPL_COCOA - [view setNeedsDisplayInRect:srcRect]; + [view setNeedsDisplayInRect:destRect]; #endif } commit 4daa6f70497f90fa2640ab9d10b29ad2ace1991b Author: Eli Zaretskii Date: Thu May 18 14:03:10 2023 +0300 ; * lisp/simple.el (async-shell-command): Add commentary about 3rd arg. diff --git a/lisp/simple.el b/lisp/simple.el index 0138556787b..3f88fcb8d03 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4454,6 +4454,10 @@ shell-command-set-point-after-cmd '(nil (inhibit-switch-frame . t))))) (set-window-point win pos))))))))) +;; Implementation note: the next function intentionally tries to use +;; the same signature as 'shell-command', although the 3rd arg is +;; currently ignored, to allow us to implement support for specifying +;; ERROR-BUFFER in the future. (defun async-shell-command (command &optional output-buffer error-buffer) "Execute string COMMAND asynchronously in background. commit dc1a437d460d5e100563eb7dde3e0fdc0e8e53d9 Author: Jens Schmidt Date: Tue May 16 23:31:19 2023 +0200 Clarify misleading comment in isearch.el Clarify a misleading comment in isearch.el as to whether frame events should exit an isearch or not (Bug#62032, Bug#41338 for background information). * lisp/isearch.el (isearch-mode-map): Replace the misleading comment. (Bug#62032) Copyright-paperwork-exempt: yes diff --git a/lisp/isearch.el b/lisp/isearch.el index 094e02d605e..3d2bbda4975 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -633,9 +633,9 @@ isearch-mode-map (define-key map "\M-\t" 'isearch-complete) - ;; Pass frame events transparently so they won't exit the search. - ;; In particular, if we have more than one display open, then a - ;; switch-frame might be generated by someone typing at another keyboard. + ;; Frame events should exit the search, because such frame events + ;; as `switch-frame’ and `delete-frame’ change the current buffer. + ;; See Bug#41338 for details. (define-key map [switch-frame] nil) (define-key map [delete-frame] nil) (define-key map [iconify-frame] nil) commit 0b722a74a56d24710cceab33287d1e2040eeb19f Author: Mattias Engdegård Date: Thu May 18 09:49:53 2023 +0200 * lisp/erc/erc-fill.el (erc-fill-spaced-commands): Fix typing errors The type (set integer symbol) matches a list of at most one integer and one symbol, not multiple distinct symbols. diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 074e789f719..718e51a058c 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -125,10 +125,10 @@ erc-fill-line-spacing :type '(choice (const nil) number)) (defcustom erc-fill-spaced-commands '(PRIVMSG NOTICE) - "Types of mesages to add space between on graphical displays. + "Types of messages to add space between on graphical displays. Only considered when `erc-fill-line-spacing' is non-nil." :package-version '(ERC . "5.6") ; FIXME sync on release - :type '(set integer symbol)) + :type '(repeat (choice integer symbol))) (defvar-local erc-fill--function nil "Internal copy of `erc-fill-function'. commit af3b0dc53ff6a5ddc891873a689a4ba0fb8872c3 Author: Eli Zaretskii Date: Thu May 18 09:41:59 2023 +0300 Improve documentation of package-menu commands * doc/emacs/package.texi (Package Menu): Document that some package-menu filters accept lists of values interactively. * lisp/emacs-lisp/package.el (package-menu-execute) (package-menu-hide-package, package-menu-describe-package) (package-menu-mark-delete, package-menu-mark-install) (package-menu-mark-unmark, package-menu-backup-unmark) (package-menu-quick-help, package-menu-get-status) (package-menu--find-upgrades, package-menu-mark-upgrades) (package-menu-filter-by-archive) (package-menu-filter-by-description) (package-menu-filter-by-keyword) (package-menu-filter-by-name-or-description) (package-menu-filter-by-name, package-menu-filter-by-status) (package-menu-filter-by-version, package-menu-filter-marked) (package-menu-describe-package): Doc fixes. diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 6722185cb20..0be60b2b70b 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -207,7 +207,8 @@ Package Menu @findex package-menu-filter-by-archive Filter package list by archive (@code{package-menu-filter-by-archive}). This prompts for a package archive (e.g., @samp{gnu}), then shows only -packages from that archive. +packages from that archive. You can specify several archives by +typing their names separated by commas. @item / d @kindex / d @r{(Package Menu)} @@ -222,7 +223,8 @@ Package Menu @findex package-menu-filter-by-keyword Filter package list by keyword (@code{package-menu-filter-by-keyword}). This prompts for a keyword (e.g., @samp{games}), then shows only -packages with that keyword. +packages with that keyword. You can specify several keywords by +typing them separated by commas. @item / N @kindex / N @r{(Package Menu)} @@ -243,16 +245,19 @@ Package Menu @kindex / s @r{(Package Menu)} @findex package-menu-filter-by-status Filter package list by status (@code{package-menu-filter-by-status}). -This prompts for one or more statuses (e.g., @samp{available}), then -shows only packages with matching status. +This prompts for one or more statuses (e.g., @samp{available}, +@pxref{Package Statuses}), then shows only packages with matching +status. You can specify several status values by typing them +separated by commas. @item / v @kindex / v @r{(Package Menu)} @findex package-menu-filter-by-version Filter package list by version (@code{package-menu-filter-by-version}). -This prompts first for one of the qualifiers @samp{<}, @samp{>} or -@samp{=}, and then a package version, and shows packages that has a -lower, equal or higher version than the one specified. +This prompts first for one of the comparison symbols @samp{<}, +@samp{>} or @samp{=} and for a version string, and then shows packages +whose versions are correspondingly lower, equal or higher than the +version you typed. @item / m @kindex / m @r{(Package Menu)} diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c684840ab7e..293c1c39ca1 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -3588,7 +3588,8 @@ package-menu-hide-package `package-hidden-regexps' and saved for future sessions. To unhide a package, type -`\\[customize-variable] RET package-hidden-regexps'. +`\\[customize-variable] RET package-hidden-regexps', and then modify +the regexp such that it no longer matches the package's name. Type \\[package-menu-toggle-hiding] to toggle package hiding." (declare (interactive-only "change `package-hidden-regexps' instead.")) @@ -3615,7 +3616,9 @@ package-menu-hide-package (defun package-menu-describe-package (&optional button) "Describe the current package. -If optional arg BUTTON is non-nil, describe its associated package." +The current package is the package at point. +If optional arg BUTTON is non-nil, describe its associated +package(s); this is always nil in interactive invocations." (interactive nil package-menu-mode) (let ((pkg-desc (if button (button-get button 'package-desc) (tabulated-list-get-id)))) @@ -3625,7 +3628,8 @@ package-menu-describe-package ;; fixme numeric argument (defun package-menu-mark-delete (&optional _num) - "Mark a package for deletion and move to the next line." + "Mark the current package for deletion and move to the next line. +The current package is the package at point." (interactive "p" package-menu-mode) (package--ensure-package-menu-mode) (if (member (package-menu-get-status) @@ -3634,7 +3638,8 @@ package-menu-mark-delete (forward-line))) (defun package-menu-mark-install (&optional _num) - "Mark a package for installation and move to the next line." + "Mark the current package for installation and move to the next line. +The current package is the package at point." (interactive "p" package-menu-mode) (package--ensure-package-menu-mode) (if (member (package-menu-get-status) '("available" "avail-obso" "new" "dependency")) @@ -3642,13 +3647,14 @@ package-menu-mark-install (forward-line))) (defun package-menu-mark-unmark (&optional _num) - "Clear any marks on a package and move to the next line." + "Clear any marks on the current package and move to the next line. +The current package is the package at point." (interactive "p" package-menu-mode) (package--ensure-package-menu-mode) (tabulated-list-put-tag " " t)) (defun package-menu-backup-unmark () - "Back up one line and clear any marks on that package." + "Back up one line and clear any marks on that line's package." (interactive nil package-menu-mode) (package--ensure-package-menu-mode) (forward-line -1) @@ -3686,15 +3692,15 @@ package--prettify-quick-help-key (package--prettify-quick-help-key (cons desc 0)))) (defun package-menu-quick-help () - "Show short key binding help for `package-menu-mode'. -The full list of keys can be viewed with \\[describe-mode]." + "Show short help for key bindings in `package-menu-mode'. +You can view the full list of keys with \\[describe-mode]." (interactive nil package-menu-mode) (package--ensure-package-menu-mode) (message (mapconcat #'package--prettify-quick-help-key package--quick-help-keys "\n"))) (defun package-menu-get-status () - "Return status text of package at point in Package Menu." + "Return status description of package at point in Package Menu." (package--ensure-package-menu-mode) (let* ((id (tabulated-list-get-id)) (entry (and id (assoc id tabulated-list-entries)))) @@ -3723,8 +3729,8 @@ package-desc-priority-version (defun package-menu--find-upgrades () "In Package Menu, return an alist of packages that can be upgraded. The alist has the same form as `package-alist', namely a list -of (PKG . DESCS), but where DESCS is the `package-desc' object -corresponding to the newer version." +of elements of the form (PKG . DESCS), but where DESCS is the `package-desc' +object corresponding to the newer version." (let (installed available upgrades) ;; Build list of installed/available packages in this buffer. (dolist (entry tabulated-list-entries) @@ -3775,10 +3781,10 @@ package-menu--mark-upgrades-1 (defun package-menu-mark-upgrades () "Mark all upgradable packages in the Package Menu. -For each installed package with a newer version available, place -an (I)nstall flag on the available version and a (D)elete flag on -the installed version. A subsequent \\[package-menu-execute] -call will upgrade the package. +For each installed package for which a newer version is available, +place an (I)nstall flag on the available version and a (D)elete flag +on the installed version. A subsequent \\[package-menu-execute] command will upgrade +the marked packages. If there's an async refresh operation in progress, the flags will be placed as part of `package-menu--post-refresh' instead of @@ -3897,17 +3903,19 @@ package--update-selected-packages (package--save-selected-packages package-selected-packages))) (defun package-menu-execute (&optional noquery) - "Perform marked Package Menu actions. + "Perform Package Menu actions on marked packages. Packages marked for installation are downloaded and installed, packages marked for deletion are removed, and packages marked for upgrading are downloaded and upgraded. If no packages are marked, the action taken depends on the state -of the package under point. If it's not already installed, this -command will install the package, and if it's installed, it will -delete the package. +of the current package, the one at point. If it's not already +installed, this command will install the package; if it's installed, +the command will delete the package. -Optional argument NOQUERY non-nil means do not ask the user to confirm." +Optional argument NOQUERY non-nil means do not ask the user to +confirm the installations/deletions; this is always nil in interactive +invocations." (interactive nil package-menu-mode) (package--ensure-package-menu-mode) (let (install-list delete-list cmd pkg-desc) @@ -4158,13 +4166,12 @@ package-menu--filter-by (defun package-menu-filter-by-archive (archive) "Filter the \"*Packages*\" buffer by ARCHIVE. Display only packages from package archive ARCHIVE. +ARCHIVE can be the name of a single archive (a string), or +a list of archive names. If ARCHIVE is nil or an empty +string, show all packages. -When called interactively, prompt for ARCHIVE, which can be a -comma-separated string. If ARCHIVE is empty, show all packages. - -When called from Lisp, ARCHIVE can be a string or a list of -strings. If ARCHIVE is nil or the empty string, show all -packages." +When called interactively, prompt for ARCHIVE. To specify +several archives, type their names separated by commas." (interactive (list (completing-read-multiple "Filter by archive (comma separated): " (mapcar #'car package-archives))) @@ -4180,9 +4187,9 @@ package-menu-filter-by-archive (concat "archive:" (string-join archives ","))))) (defun package-menu-filter-by-description (description) - "Filter the \"*Packages*\" buffer by DESCRIPTION regexp. -Display only packages with a description that matches regexp -DESCRIPTION. + "Filter the \"*Packages*\" buffer by the regexp DESCRIPTION. +Display only packages whose description matches the regexp +given as DESCRIPTION. When called interactively, prompt for DESCRIPTION. @@ -4199,14 +4206,16 @@ package-menu-filter-by-description (defun package-menu-filter-by-keyword (keyword) "Filter the \"*Packages*\" buffer by KEYWORD. -Display only packages with specified KEYWORD. +Display only packages whose keywords match the specified KEYWORD. +KEYWORD can be a string or a list of strings. If KEYWORD is nil +or the empty string, show all packages. -When called interactively, prompt for KEYWORD, which can be a -comma-separated string. If KEYWORD is empty, show all packages. +In addition to package keywords, KEYWORD can include the name(s) +of archive(s) and the package status, such as \"available\" +or \"built-in\" or \"obsolete\". -When called from Lisp, KEYWORD can be a string or a list of -strings. If KEYWORD is nil or the empty string, show all -packages." +When called interactively, prompt for KEYWORD. To specify several +keywords, type them separated by commas." (interactive (list (completing-read-multiple "Keywords (comma separated): " (package-all-keywords))) @@ -4224,8 +4233,8 @@ package-menu-filter-by-keyword 'package-menu-filter #'package-menu-filter-by-keyword "27.1") (defun package-menu-filter-by-name-or-description (name-or-description) - "Filter the \"*Packages*\" buffer by NAME-OR-DESCRIPTION regexp. -Display only packages with a name-or-description that matches regexp + "Filter the \"*Packages*\" buffer by the regexp NAME-OR-DESCRIPTION. +Display only packages whose name or description matches the regexp NAME-OR-DESCRIPTION. When called interactively, prompt for NAME-OR-DESCRIPTION. @@ -4246,8 +4255,8 @@ package-menu-filter-by-name-or-description (format "name-or-desc:%s" name-or-description)))) (defun package-menu-filter-by-name (name) - "Filter the \"*Packages*\" buffer by NAME regexp. -Display only packages with name that matches regexp NAME. + "Filter the \"*Packages*\" buffer by the regexp NAME. +Display only packages whose name matches the regexp NAME. When called interactively, prompt for NAME. @@ -4265,13 +4274,11 @@ package-menu-filter-by-name (defun package-menu-filter-by-status (status) "Filter the \"*Packages*\" buffer by STATUS. Display only packages with specified STATUS. +STATUS can be a single status, a string, or a list of strings. +If STATUS is nil or the empty string, show all packages. -When called interactively, prompt for STATUS, which can be a -comma-separated string. If STATUS is empty, show all packages. - -When called from Lisp, STATUS can be a string or a list of -strings. If STATUS is nil or the empty string, show all -packages." +When called interactively, prompt for STATUS. To specify +several possible status values, type them seperated by commas." (interactive (list (completing-read "Filter by status: " '("avail-obso" "available" @@ -4300,12 +4307,12 @@ package-menu-filter-by-status (defun package-menu-filter-by-version (version predicate) "Filter the \"*Packages*\" buffer by VERSION and PREDICATE. -Display only packages with a matching version. +Display only packages whose version satisfies the condition +defined by VERSION and PREDICATE. -When called interactively, prompt for one of the qualifiers `<', -`>' or `=', and a package version. Show only packages that has a -lower (`<'), equal (`=') or higher (`>') version than the -specified one. +When called interactively, prompt for one of the comparison operators +`<', `>' or `=', and for a version. Show only packages whose version +is lower (`<'), equal (`=') or higher (`>') than the specified VERSION. When called from Lisp, VERSION should be a version string and PREDICATE should be the symbol `=', `<' or `>'. @@ -4343,7 +4350,8 @@ package-menu-filter-by-version (format "versions:%s%s" predicate version))))) (defun package-menu-filter-marked () - "Filter \"*Packages*\" buffer by non-empty upgrade mark. + "Filter \"*Packages*\" buffer by non-empty mark. +Show only the packages that have been marked for installation or deletion. Unlike other filters, this leaves the marks intact." (interactive nil package-menu-mode) (package--ensure-package-menu-mode) commit d879847cd4daaeef792384475dd31a3dcfc14184 Author: Basil L. Contovounesios Date: Wed May 17 13:48:09 2023 +0100 Fix M-x completion-predicate under python-ts-mode * lisp/progmodes/python.el (python--completion-predicate) (python-shell--completion-predicate): Filter M-x completion based on python-base-mode instead of python-mode. This allows for python-ts-mode as well (bug#63552). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index bbabce80b4d..f810f1e2164 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4967,7 +4967,7 @@ 'python-mode-skeleton-abbrev-table (defun python--completion-predicate (_ buffer) (provided-mode-derived-p (buffer-local-value 'major-mode buffer) - 'python-mode)) + 'python-base-mode)) (defmacro python-skeleton-define (name doc &rest skel) "Define a `python-mode' skeleton using NAME DOC and SKEL. @@ -6791,7 +6791,7 @@ python-ts-mode (defun python-shell--completion-predicate (_ buffer) (provided-mode-derived-p (buffer-local-value 'major-mode buffer) - 'python-mode 'inferior-python-mode)) + 'python-base-mode 'inferior-python-mode)) ;; Commands that only make sense in the Python shell or when editing ;; Python code. commit 1e57b2b4c79ada7592c0a7e3f700e7c30dd76a4b Author: Andrea Corallo Date: Wed May 10 13:50:51 2023 +0200 * Account for `byte-compile-warnings' during native compilation (bug#63302). * lisp/emacs-lisp/comp.el (comp-final, comp-run-async-workers): Forward `byte-compile-warnings' to child processes. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index e97832455b9..8f40f2f40a0 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3724,6 +3724,7 @@ comp-final ',native-comp-compiler-options native-comp-driver-options ',native-comp-driver-options + byte-compile-warnings ',byte-compile-warnings load-path ',load-path) ,native-comp-async-env-modifier-form (message "Compiling %s..." ',output) @@ -3996,6 +3997,7 @@ comp-run-async-workers native-comp-driver-options load-path backtrace-line-length + byte-compile-warnings ;; package-load-list ;; package-user-dir ;; package-directory-list commit b5bfd808c6b40f47fdef8eb9986bc3127ca63c12 Author: Philip Kaludercic Date: Sun May 14 21:22:59 2023 +0200 Avoid duplicate VC packages in 'package-selected-packages' * lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Check if 'package-selected-packages' already contains the package name. (bug#63338) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 1fcc30595da..17e93c430c9 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -506,9 +506,11 @@ package-vc--unpack-1 (package--reload-previously-loaded new-desc))) ;; Mark package as selected - (package--save-selected-packages - (cons (package-desc-name pkg-desc) - package-selected-packages)) + (let ((name (package-desc-name pkg-desc))) + (unless (memq name package-selected-packages) + (package--save-selected-packages + (cons name package-selected-packages)))) + (package--quickstart-maybe-refresh) ;; Confirm that the installation was successful commit c18f9f155f6a7522bb4052a6b227b8a06ce38764 Author: Juri Linkov Date: Mon May 15 20:32:04 2023 +0300 * lisp/tab-bar.el (tab-bar-new-tab-to): Set 'window-side' to nil (bug#62427). This is still needed for the case when tab-bar-new-tab-choice is 'window'. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index c7983146bf9..ab428b81631 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1563,7 +1563,9 @@ tab-bar-new-tab-to (delete-other-windows) (if (eq tab-bar-new-tab-choice 'window) ;; Create new unique window from remaining window - (window-state-put (window-state-get)) + (progn + (set-window-parameter nil 'window-side nil) + (window-state-put (window-state-get))) ;; Create a new window to get rid of old window parameters ;; (e.g. prev/next buffers) of old window. (split-window) (delete-window)))) commit 33485fe8f74af0df458453c89afe4846ccd8e7e5 Author: Eli Zaretskii Date: Mon May 15 18:39:49 2023 +0300 ; Better warning message when loading tree-sitter fails * lisp/treesit.el (treesit-ready-p): Improve diagnostics on MS-Windows when the tree-sitter library cannot be loaded at run time. diff --git a/lisp/treesit.el b/lisp/treesit.el index 147b052d287..d7502560fea 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2300,7 +2300,10 @@ treesit-ready-p ;; Check for each condition and set MSG. (catch 'term (when (not (treesit-available-p)) - (setq msg "tree-sitter library is not compiled with Emacs") + (setq msg (if (fboundp 'treesit-node-p) + ;; Windows loads tree-sitter dynakically. + "tree-sitter library is not available or failed to load" + "Emacs is not compiled with tree-sitter library")) (throw 'term nil)) (when (> (position-bytes (max (point-min) (1- (point-max)))) treesit-max-buffer-size) commit 95a724abaaca40e3fbad69593cb9fab39a249742 Author: Kyle Meyer Date: Sun May 14 21:04:37 2023 -0400 Update to Org 9.6.6 diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 6ee77758e06..07463ee6a33 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.6.5} +\def\orgversionnumber{9.6.6} \def\versionyear{2023} % latest update \input emacsver.tex diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index f9daf3f14d8..d7fe14cd5e1 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -3062,57 +3062,58 @@ org-clock-update-time-maybe Otherwise, return nil." (interactive) (let ((origin (point))) ;; `save-excursion' may not work when deleting. - (save-excursion - (beginning-of-line 1) - (skip-chars-forward " \t") - (when (looking-at org-clock-string) - (let ((re (concat "[ \t]*" org-clock-string - " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]" - "\\([ \t]*=>.*\\)?\\)?")) - ts te h m s neg) - (cond - ((not (looking-at re)) - nil) - ((not (match-end 2)) - (when (and (equal (marker-buffer org-clock-marker) (current-buffer)) - (> org-clock-marker (point)) - (<= org-clock-marker (line-end-position))) - ;; The clock is running here - (setq org-clock-start-time - (org-time-string-to-time (match-string 1))) - (org-clock-update-mode-line))) - (t - ;; Prevent recursive call from `org-timestamp-change'. - (cl-letf (((symbol-function 'org-clock-update-time-maybe) #'ignore)) - ;; Update timestamps. - (save-excursion - (goto-char (match-beginning 1)) ; opening timestamp - (save-match-data (org-timestamp-change 0 'day))) - ;; Refresh match data. - (looking-at re) - (save-excursion - (goto-char (match-beginning 3)) ; closing timestamp - (save-match-data (org-timestamp-change 0 'day)))) - ;; Refresh match data. - (looking-at re) - (and (match-end 4) (delete-region (match-beginning 4) (match-end 4))) - (end-of-line 1) - (setq ts (match-string 1) - te (match-string 3)) - (setq s (- (org-time-string-to-seconds te) - (org-time-string-to-seconds ts)) - neg (< s 0) - s (abs s) - h (floor (/ s 3600)) - s (- s (* 3600 h)) - m (floor (/ s 60)) - s (- s (* 60 s))) - (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m)) - t))))) - ;; Move back to initial position, but never beyond updated - ;; clock. - (unless (< (point) origin) - (goto-char origin)))) + (prog1 + (save-excursion + (beginning-of-line 1) + (skip-chars-forward " \t") + (when (looking-at org-clock-string) + (let ((re (concat "[ \t]*" org-clock-string + " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]" + "\\([ \t]*=>.*\\)?\\)?")) + ts te h m s neg) + (cond + ((not (looking-at re)) + nil) + ((not (match-end 2)) + (when (and (equal (marker-buffer org-clock-marker) (current-buffer)) + (> org-clock-marker (point)) + (<= org-clock-marker (line-end-position))) + ;; The clock is running here + (setq org-clock-start-time + (org-time-string-to-time (match-string 1))) + (org-clock-update-mode-line))) + (t + ;; Prevent recursive call from `org-timestamp-change'. + (cl-letf (((symbol-function 'org-clock-update-time-maybe) #'ignore)) + ;; Update timestamps. + (save-excursion + (goto-char (match-beginning 1)) ; opening timestamp + (save-match-data (org-timestamp-change 0 'day))) + ;; Refresh match data. + (looking-at re) + (save-excursion + (goto-char (match-beginning 3)) ; closing timestamp + (save-match-data (org-timestamp-change 0 'day)))) + ;; Refresh match data. + (looking-at re) + (and (match-end 4) (delete-region (match-beginning 4) (match-end 4))) + (end-of-line 1) + (setq ts (match-string 1) + te (match-string 3)) + (setq s (- (org-time-string-to-seconds te) + (org-time-string-to-seconds ts)) + neg (< s 0) + s (abs s) + h (floor (/ s 3600)) + s (- s (* 3600 h)) + m (floor (/ s 60)) + s (- s (* 60 s))) + (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m)) + t))))) + ;; Move back to initial position, but never beyond updated + ;; clock. + (unless (< (point) origin) + (goto-char origin))))) (defun org-clock-save () "Persist various clock-related data to disk. diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index ef61dc9cbd6..8d93af2c20d 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.6.5")) + (let ((org-release "9.6.6")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.6.5-3-g2993f4")) + (let ((org-git-version "release_9.6.6")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index f4aa28cc486..d3e14fecec3 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; URL: https://orgmode.org ;; Package-Requires: ((emacs "26.1")) -;; Version: 9.6.5 +;; Version: 9.6.6 ;; This file is part of GNU Emacs. ;; commit c665ca79ff47f7c2c0b0625069f4caa69162f1db Author: Eli Zaretskii Date: Sun May 14 16:11:44 2023 +0300 ; * admin/make-tarball.txt: Minor copyedits. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 00516a0edd7..1cc97c883af 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -75,9 +75,10 @@ General steps (for each step, check for possible errors): For the first pretest of a new major release, consider starting a new top-level ChangeLog.N file if the last versioned ChangeLog.N file is too large. A good point to start a new ChangeLog.N file - is when the last one gets larger than 1.5 MiB. If so, start a new - one by bumping N, and also update the line in top-level - Makefile.in which says + is when the last one gets larger than 5 MiB, or when you make the + first pretest of a new major release, whichever happens later. If + so, start a new ChangeLog.N file by bumping N, and also update the + line in top-level Makefile.in which says CHANGELOG_HISTORY_INDEX_MAX = N commit 3aef46e466fd8e9032fe6565ea030653b1ec0cff (tag: refs/tags/emacs-29.0.91) Merge: 88ca37b8589 229af8e4b31 Author: Eli Zaretskii Date: Sun May 14 08:02:15 2023 -0400 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29 commit 88ca37b858921d7b3ba11bc93080f66bdca614dc Author: Eli Zaretskii Date: Sun May 14 07:58:30 2023 -0400 ; Regenerate files for emacs-29.0.91 * ChangeLog.4: * etc/AUTHORS: Regenerate. diff --git a/ChangeLog.4 b/ChangeLog.4 index 106444e41a7..2ce1351286e 100644 --- a/ChangeLog.4 +++ b/ChangeLog.4 @@ -1,3 +1,1335 @@ +2023-05-14 Gabriel do Nascimento Ribeiro + + Ignore current-prefix-arg in async-shell-command + + * lisp/simple.el (async-shell-command): Ignore current-prefix-arg and + always pass nil to second argument of `shell-command'. (Bug#63432) + +2023-05-13 Joseph Turner + + Fix building of VC package manuals with relative includes + + * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation): + Invoke makeinfo with -I to ensure the package directory is always + consulted for @include statements. (Bug#63337) + +2023-05-13 Cyril Arnould (tiny change) + + Another fix for VHDL mode highlighting + + * lisp/progmodes/vhdl-mode.el (vhdl-version): Bump to 3.38.5. + (vhdl-compiler-alist): Fix the regexps and the doc string. + +2023-05-13 Eli Zaretskii + + Fix auto-filling in Texinfo mode + + This fixes auto-filling in Texinfo buffers. It was broken by the + fix to bug#49558, which made M-q fill over-long @noindent lines by + refraining from customizing 'paragraph-separate' in Texinfo mode. + The underlying problem here is that 'auto-fill-mode' doesn't call + mode-specific filling functions, but does its job by itself, and + depends on 'forward-paragraph' to find the beginning of the + paragraph as appropriate for calculation of 'fill-prefix', and a + different value of 'paragraph-separate' broke that. As a side + effect, the change below also changes paragraph-movement commands + in Texinfo back to how they behaved prior to that bugfix, but I + don't see why the paragraph-movement behavior introduced by that + fix made more sense. Try to move through a series of + @-directives, like a paragraph preceded by several @cindex + entries, and you will see the inconsistencies. In any case, the + adverse effects of that fix on auto-filling is unacceptable. + + * lisp/textmodes/texinfo.el (fill-paragraph-separate): New + variable. + (texinfo-mode): Set 'fill-paragraph-separate' to the default value + of 'paragraph-separate'. Customize 'paragraph-separate' to the + Texinfo-specific value, as it was before commit dde591571abf. + (texinfo--fill-paragraph): Bind 'paragraph-separate' to the value + of 'fill-paragraph-separate', to keep 'M-q' happy. + +2023-05-12 Gregory Heytings + + Merge branch 'scratch/long-lines-cleanup' into 'emacs-29' + +2023-05-12 Gregory Heytings + + Add an assertion in, and a commentary for, 'get_nearby_bol_pos' + + * src/xdisp.c: + (get_nearby_bol_pos): Document the function, and add an assertion + on its return value. + +2023-05-12 Gregory Heytings + + Fix the return type of 'labeled_restrictions_get_bound' + + * src/editfns.c: + (labeled_restrictions_get_bound): Return a Lisp_Object instead of + a pointer to a struct Lisp_Marker. + (unwind_reset_outermost_restriction, reset_outermost_restrictions) + (Fwiden, Fnarrow_to_region): Adapt to the new return type. + +2023-05-12 Eli Zaretskii + + Fix mouse highlight with some fonts in Cairo builds + + * src/ftcrfont.c (ftcrfont_draw): Don't set the + 'background_filled_p' flag of the glyph string. (Bug#63271) + +2023-05-12 Philip Kaludercic + + Ensure that package menu respects 'package-install-upgrade-built-in' + + * lisp/emacs-lisp/package.el (package-menu--find-upgrades): Check if + built-in packages can be upgraded if + 'package-install-upgrade-built-in' is non-nil. + +2023-05-12 Philip Kaludercic + + Ensure that EXTRA-DATA are always written when generating autoloads + + * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Handle + edge-case where no autoloads are found. (Bug#63260) + +2023-05-11 Jonas Bernoulli + + Update to Transient v0.4.0 + + Or strictly speaking v0.4.0-1-g428576a4.) + +2023-05-11 Eli Zaretskii + + Revert "Don't have nntp-report signal an error" + + This reverts commit 032969e8c65ba1ccda8466f6c61f20e0c7293ebf. + The commit is being reverted because it caused bug#62845. + +2023-05-10 Alan Mackenzie + + Make c-emacs-features use the proper binding of parse-sexp-lookup-properties + + This is relevant for bug #58558, although it does not fix it. Due to a wrong + ordering of with-current-buffer and a let form, the function overwrote the + global value of parse-sexp-lookup-properties and two other variables. + + * lisp/progmodes/cc-defs.el (c-emacs-features): Change the nesting of + with-current-buffer and let so that the let bindings get used. + +2023-05-09 Stefan Monnier + + with-display-message: Workaround for bug#63253 + + Running arbitrary ELisp code from an atimer is still dangerous, + at least because the regexp engine is not-reentrant, so let's patch up + the case we bumped into. There are probably many other such holes :-( + + * src/alloc.c (garbage_collection_inhibited): Make it non-static. + + * src/xdisp.c (garbage_collection_inhibited): Declare it. + (set_message, clear_message): Use it as a proxy for "we're in + a dangerous context like within `probably_quit`". + +2023-05-09 João Távora + + Fido-mode: never shadow 'external' completion style + + As explained in the manual (20.7.2 Fast minibuffer selection) + 'fido-mode' and 'fido-vertical-mode' give priority the "flex" + completion style. + + In fact, bug#62015 was recently fixed in commit because that priority + was not taking place correctly and some completions were missed. + + However, an exception must be made for the 'external' completion + style. + + That style, made available by the lisp/external-completion.el library, + is specifically designed to work with backends that provide only a + partial view of all completions. If we allow 'flex' to step in front + of 'external' it could mean that 'flex' matches something and + 'external' isn't triggered as it probably should. + + To reproduce have the rust-mode ELPA package and the rust-analyzer LSP + server handy. Then: + + emacs -Q -f package-initialize main.rs + + Where main.rs is this content: + + fn foo1() {} fn foo2() {} fn foo3() {} + fn foobar1() {} fn foobar2() {} fn foobar3() {} + + The rust-analyzer server can be quickly configured to return only 3 + workspace symbols max, so evaluate: + + (setq-default eglot-workspace-configuration + '(:rust-analyzer + (:workspace (:symbol (:search (:limit 3)))))) + + Now start M-x eglot and M-x fido-vertical-mode and type C-u M-. to + find an arbitrary symbol in this one-file project. + + Type 'f'. You will see the three foo's are listed, correctly. + + Now type '3'. You will only see "foo3". + + But that's wrong because "foobar3" was available, if only the server + had been asked for it. This commit fixes the situation and no + completions are lost. + + As an unfortunate side-effect of this commit, the fontification of + completions-common-part on the matches is lost, but that is not worse + than missing out on completions and there are better ways to recover + the fontification anyway (in external-completion.el). + + See also: + https://github.com/joaotavora/eglot/discussions/1219#discussioncomment-5818336 + + * lisp/icomplete.el (icomplete--fido-ccd): Do not touch entries + with 'external in them. + + Do not merge to master. + Backport: + + (cherry picked from commit 0e8d8a72284f6b3aaa1bbce73d41c7d84bbc4d3c) + +2023-05-09 Eli Zaretskii + + Avoid crashes in --without-all build trying to scale non-ASCII char + + * src/fontset.c (face_for_char): Display a non-ASCII character as + glyphless if the ASCII face has no fontset. (Bug#63283) + +2023-05-09 Eli Zaretskii + + Improve instructions for dealing with Emacs crashes + + * doc/emacs/trouble.texi (Crashing): Show the variant of the + 'addr2line' command for MS-Windows. + +2023-05-08 Mohsen Banan + + Improved transliterations + improved bidi insertion support for Farsi + + * lisp/leim/quail/persian.el ("farsi-transliterate-banan"): + Improve and add transliterations. (Bug#63361) + +2023-05-08 Alan Third + + Fix crash when creating a child frame in NS (bug#63107) + + * src/nsterm.m ([EmacsView initFrameFromEmacs:]): Have a second go at + creating the toolbar. + ([EmacsWindow createToolbar:]): If there is already a toolbar or the + EmacsView's layer is not an EmacsLayer, then do nothing. + + (cherry picked from commit 3adc1e7f37901235bda83ea65a90644b7b0a8dbf) + +2023-05-07 Andrew G Cohen + + Fix outgoing mime type regression (Bug#62815) + + * lisp/net/mailcap.el (mailcap-mime-extensions, + mailcap-parse-mimetype-file, mailcap-mime-types): Don't regexp-quote + mimetypes in a context where they should be strings. + (mailcap--regexp-quote-type): Remove. + + (cherry picked from commit 605414d018da47f99dec5019142f584b6eb174c8) + +2023-05-07 Nicholas Vollmer + + define-minor-mode: sanitize mode function messages + + * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Ensure mode's + pretty name is not interprted as a message formatting string, + e.g., if the mode name contains a '%'. (Bug#63343) + +2023-05-07 Eli Zaretskii + + Fix beginning/end-of-defun with tree-sitter + + * lisp/treesit.el (treesit-beginning-of-defun) + (treesit-end-of-defun): Push mark, as other beginning/end-of-defun + functions do. + +2023-05-06 Theodor Thornhill + + Fix indent for enums in csharp-mode + + * lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Check for + keywords containing 'enum' on the line before an opening bracket, and + make it behave like a class-open token. + +2023-05-06 Eli Zaretskii + + Teach c-ts-mode about the 'restrict' keyword + + * lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Add + "restrict" and "_Atomic" type qualifiers. (Bug#63323) + +2023-05-06 Eli Zaretskii + + * lisp/x-dnd.el (x-dnd-after-move-frame): Skip dead frames. (Bug#63312) + +2023-05-06 Eli Zaretskii + + Fix doc strings of 'mark-sexp' and 'mark-word' + + * lisp/emacs-lisp/lisp.el (mark-sexp): + * lisp/simple.el (mark-word): Clarify the doc strings in various + usage cases. (Bug#62892) + +2023-05-05 Dmitry Gutov + + (package-upgrade): Don't remove the package from 'package-selected-packages' + + * lisp/emacs-lisp/package.el (package-upgrade): + Don't remove the package from 'package-selected-packages', fixing + the problem described in https://debbugs.gnu.org/62720#718. + +2023-05-05 João Távora + + Eglot: re-rename eglot-upgrade to eglot-upgrade-eglot + + * doc/misc/eglot.texi (Getting the latest version): Mention + eglot-upgrade-eglot. + + * etc/EGLOT-NEWS: Mention eglot-upgrade-eglot. + + * lisp/progmodes/eglot.el (eglot-upgrade-eglot): Rename from + eglot-update. + (eglot-update): New compatibility alias. + +2023-05-05 Eli Zaretskii + + Fix arguments of xml.c functions as displayed in Help buffers + + * lisp/subr.el (libxml-parse-xml-region) + (libxml-parse-html-region): Adjust advertised-calling-convention + to the changes in commit cc33c6cf3a. (Bug#63291) + +2023-05-05 Po Lu + + More fixes for NetBSD/vax + + * src/sysdep.c (init_signals) [__vax__]: Treat SIGILL + as a floating point error on VAXen. + Otherwise, (log 0.0) crashes Emacs. + +2023-05-05 Cyril Arnould (tiny change) + + Improve VHDL mode highlighting + + * lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist): Differentiate + between ModelSim errors, warnings, and notes when highlighting + them. Add a new entry for Xilinx Vivado. (Bug#63251) + +2023-05-04 Po Lu + + Clarify documentation wrt floating point division by zero and NaN + + * doc/lispref/numbers.texi (Float Basics) + (Arithmetic Operations): Document what happens on a VAX. + Tested on NetBSD 9.3. + +2023-05-04 Robert Pluim + + Make loaddefs-generate slightly more tolerant + + There are packages in the wild, such as vlf-20191126.2250, which have + entries that are not terminated by three ';', but by two. Tolerate + such entries. + + * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Search for two + ';' as a delimiter, not three. (Bug#63236) + +2023-05-04 Philip Kaludercic + + Fix order of rcirc-connect arguments + + * lisp/net/rcirc.el (rcirc): Pass SERVER-ALIAS before CLIENT-CERT. + (rcirc-connect): Take SERVER-ALIAS before CLIENT-CERT. + + This is necessary for the 'rcirc-reconnect' trick to work that applies + the contents of 'rcirc-connection-info' to 'rcirc-connect', otherwise + the server alias gets lost as certfp information. + + This addresses a change made in b79cb838a477ee5a5c3660e81264991ff833a82f. + +2023-05-04 Thuna (tiny change) + + Fix rcirc messages printing in the wrong place + + * lisp/net/rcirc.el (rcirc-send-message): Print the message before + sending it to the server. + (rcirc-print): Get the time with subsecond precision. + * lisp/calendar/parse-time.el (parse-time-string + parse-iso8601-time-string): Accept optional second FORM arguments, + with the same meaning as in `decode-time'. Mention as such in the + docstring. (Bug#59501) + +2023-05-04 Philip Kaludercic + + Prevent unnecessary modifications of 'package-vc-selected-packages' + + * lisp/emacs-lisp/package-vc.el (package-vc--unpack): Handle the + structure of correctly, not as an alist but a list of alists. + (package-vc--archive-spec-alist, package-vc--archive-spec-alists, + package-vc--desc->spec, package-vc--read-archive-data, + package-vc--download-and-read-archives, package-vc--unpack): Rename + 'package-vc--archive-spec-alist' to 'package-vc--archive-spec-alists'. + +2023-05-03 Dmitry Gutov + + Rename eglot-update to eglot-upgrade + + * doc/misc/eglot.texi (Getting the latest version): + Update the reference. + + * lisp/progmodes/eglot.el (eglot-upgrade): Rename from + 'eglot-update', as discussed on emacs-devel, in line with + 'package-upgrade'. + +2023-05-03 Randy Taylor + + go-ts-mode: Use iota query only if supported (Bug#63086) + + iota query support was added on January 5, 2022. To support older + versions of the tree-sitter-go grammar (like the latest tagged version, + v0.19.1, which was released on March 3, 2021), check if the query is + supported before trying to use it. + + * lisp/progmodes/go-ts-mode.el (go-ts-mode--iota-query-supported-p): New + function. + (go-ts-mode--font-lock-settings): Use it. + +2023-05-03 Dmitry Gutov + + (rng-complete-tag): Add the (ignored) argument to the :company-kind function + + * lisp/nxml/rng-nxml.el (rng-complete-tag): Add the (ignored) + argument to the :company-kind function. Fixes the "Wrong number + of arguments" error reported at + https://github.com/company-mode/company-mode/issues/1386. + +2023-05-03 Jonas Bernoulli + + Update to Transient v0.3.7-219-g3ded15b + +2023-05-03 Po Lu + + Fix inserting selection data into Mozilla programs + + * lisp/select.el (xselect-convert-to-text-uri-list): Don't + return any value when converting non-DND selections to this + drag-and-drop target. + + Reported by Tobias Bading . + +2023-05-03 Thuna (tiny change) + + Recognize defstruct slot names in various eieio functions + + * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Set + each slot's name's 'slot-name' property so that + 'eieio--known-slot-name-p' can recognize them. (Bug#62959) + +2023-05-02 Thuna (tiny change) + + Use 'calendar-buffer' instead of fixed string + + * test/lisp/calendar/cal-julian-tests.el (with-cal-julian-test): + Use 'calendar-buffer' instead of a literal fixed name. + (Bug#61546) + +2023-05-02 Spencer Baugh + + Handle point not at EOB in minibuffer-choose-completion + + Without this change, only the minibuffer contents before point + are cleared when a completion is chosen, which results in stray + text when point is in the middle of the minibuffer. + + After this change, we heuristically decide either to clear the + whole buffer or only part of it, taking into account the + location of point. + + This is a backport for the Emacs 29 release branch of a simpler + fix in minibuffer-completion-help. + + * lisp/minibuffer.el (minibuffer-next-completion): + (minibuffer-choose-completion): + Recalculate completion-base-affixes with point. (Bug#62700) + +2023-05-02 Spencer Baugh + + Note that Emacs pauses when handling sentinel errors + + Noting this behavior and variable here makes it easier to + understand the behavior of Emacs when a sentinel has an error. + + * doc/lispref/processes.texi (Filter Functions): Note that Emacs + pauses when handling sentinel errors. + (Sentinels): Note that Emacs pauses when handling sentinel errors. + (Bug#63096) + +2023-05-01 Eli Zaretskii + + Fix vertical-motion when tab-line is displayed in a window + + * src/xdisp.c (try_window, try_window_id): Account for tab-line, + if present, when converting scroll-margin at the top of the window + to vertical pixel coordinate. (Bug#63201) + +2023-04-30 Kyle Meyer + + Update to Org 9.6.5-3-g2993f4 + +2023-04-30 Philip Kaludercic + + Prevent generating empty autoload files + + * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Remove + optimisation that would mistakenly discard old loaddefs in case a file + was not modified by EXTRA-DATA is non-nil. (Bug#62734) + +2023-04-30 Stefan Monnier + + * lisp/org/org-macs.el (org--inhibit-version-check): Fix docstring + + Also, add an explanation to the docstring for what the version + check is about. + +2023-04-30 Eli Zaretskii + + Fix redisplay of mode line after its format changes from nil + + * src/dispnew.c (update_window): Make sure a mode-line's row of + the current glyph matrix is disabled when the mode line is not + being displayed. (Bug#63186) + +2023-04-30 Michael Albinus + + Fix c-ts-mode--emacs-c-range-query + + * lisp/progmodes/c-ts-mode.el (c-ts-mode--emacs-c-range-query): + Check for (treesit-available-p). + +2023-04-30 Eli Zaretskii + + Improve documentation of warnings + + * doc/lispref/control.texi (Errors): + * doc/lispref/os.texi (Startup Summary): + * doc/lispref/display.texi (Warning Basics, Warning Variables) + (Warning Options, Delayed Warnings): Improve documentation of + warnings. Document the automatic delaying of warnings during + startup. (Bug#63181) + +2023-04-29 Yuan Fu + + Fix FOR_EACH_TAIL fontification (bug#62951) + + Fix the fontification inconsistency between different FOR_EACH_TAIL's. + See the comment for more explanation. Also enable the emacs-devel + feature automatically when c-ts-mode-emacs-sources-support is on. + + * lisp/progmodes/c-ts-mode.el: + (c-ts-mode--for-each-tail-regexp): Move up. + (c-ts-mode--font-lock-settings): New font-lock rule for FOR_EACH_TAIL. + (c-ts-mode--fontify-for-each-tail): New function. + (c-ts-mode): Automatically enable emacs-devel feature. + +2023-04-29 Eli Zaretskii + + Fix documentation of libxml-parse-* functions + + * doc/lispref/text.texi (Parsing HTML/XML): + * src/xml.c (Flibxml_parse_html_region, Flibxml_parse_xml_region): + Update the documentation regarding the use of BASE-URL argument. + (Bug#63125) + +2023-04-28 Theodor Thornhill + + Skip over whitespace in annotation-top-cont check (bug#63141) + + * lisp/progmodes/csharp-mode.el (csharp-guess-basic-syntax): Make sure + we skip over whitespace when looking for the next '['. + +2023-04-28 Ruijie Yu + + Update zh-CN tutorial translation + + * etc/tutorials/TUTORIAL.cn (INTRO): Additions from English + version; say "interrupt" not "quit" a partially-entered command; + fixed minor inconsistency (English says partially-entered command, + Chinese used to say partially-executed command -- they are + different); converted half-width square brackets containing + translators' notes into full-width ones for consistency. + (BASIC CURSOR CONTROL): mention that a word boundary for Chinese + can also be space; fixed incorrect terminology (keyboard vs + terminal); retain English term "terminal"; retain English term + "prefix argument"; "most commands _interpret_ prefix args as + repeat-count", not "explain"; ensure space is added on both ends + of an English word. + (WINDOWS): Clarify it is the digit 1 in C-x 1. + (INSERTING AND DELETING): Mention the term "continuation line" and + retain its English term, because this term is mentioned again + later in the tutorial; avoid saying the name of "\\"; add + description for "electric" and a rough translation; sync English + for prefix argument for DEL and C-d; ensure that translators' + notes are marked explicitly so; add indentation to the instruction + about continuation lines; additional translations such as + mentioning C--, etc. + (FILES): Re-pluralize the heading; space around English words; + describe what C-g cancels (the command) when entering file name; + replace "search for" with "find"; minor rephrasing; explicit + translator notes; fixed the write-file message to no longer + contain ellipses (see src/fileio.c:5541). + (BUFFERS): Re-pluralize the heading; mention that C-x C-b also + shows buffer name; C-x s only looks for file-visiting buffers. + (EXTENDING THE COMMAND SET): Include C-x s and C-x b in list of + learned commands. + (MODE LINE): Remove the dashes in description on the point + location. + (MULTIPLE WINDOWS): Mention the difference between frame + and window; also add translator notes pointing to end of + tutorial which contains a terminology list. + (MULTIPLE FRAMES): Change the M-x commands to keybinds C-x 5 2 and + C-x 5 0 to sync with English. + (GETTING MORE HELP): Change C-h f to C-h x, to sync with English. + (INSTALLING PACKAGES): Rephrase "available packages", used to say + lit., "existing", now says lit., "installable"; consistently + translate the term "package", and retain its English name. + (TRANSLATION): Add my name as co-maintainer of this file. + + * etc/tutorials/TUTORIAL.translators (TUTORIAL.cn): Add my name + as co-maintainer for TUTORIAL.cn. + +2023-04-28 Eli Zaretskii + + Fix eglot.texi + + * doc/misc/eglot.texi (Troubleshooting Eglot): Add missing @menu. + (Performance, Getting the latest version): Improve wording and + indexing, add cross-references. + +2023-04-27 Po Lu + + Fix two crashes upon startup + + * src/image.c (image_create_bitmap_from_data) + (image_create_bitmap_from_file): Specify a Window or a Pixmap + describing the screen, not a back buffer drawable which may not exist. + Otherwise, Emacs crashes on startup when a bitmap icon is in use. + +2023-04-27 João Távora + + Eglot: explain how to update Eglot in manual (bug#62720) + + * lisp/progmodes/eglot.el (eglot-update): New command. + + * doc/misc/eglot.texi (Troubleshooting): Rework. + +2023-04-27 João Távora + + Eglot: fix edge case when deleting inlay hint overlays + + When asked to update hints in a region (FROM TO), + eglot--update-hints-1 first deletes the existing hints. It must + however take care to delete all overlays that logically belong to the + region, even if they don't physically belong to it, e.g. inlay + overlays spanning (FROM-1 FROM) and having a 'after-string' property. + + * lisp/progmodes/eglot.el (eglot--update-hints-1): Fix edge case. + +2023-04-27 Dmitry Gutov + + package-upgrade[-all]: Expand docstrings to note the current limitation + + * lisp/emacs-lisp/package.el (package-upgrade, package-upgrade-all): + Expand docstrings to note the current limitation (bug#62720). + +2023-04-27 Dmitry Gutov + + Rename all functions called package-*-update-* to package-*-upgrade-* + + * lisp/emacs-lisp/package-vc.el (package-vc-upgrade-all): + Rename from 'package-vc-update-all'. + (package-vc-upgrade): Rename from 'package-vc-update'. + + * lisp/emacs-lisp/package.el (package-upgrade): + Rename from 'package-update' (bug#62750). + (package--upgradeable-packages): + Rename from 'package--updateable-packages'. + (package-upgrade-all): Rename from 'package-update-all'. + +2023-04-27 Yuan Fu + + Fix FOR_EACH_TAIL in c-ts-mode (bug#62951) + + * lisp/progmodes/c-ts-mode.el + (c-ts-mode--indent-styles): New indent rule. + + (c-ts-mode--for-each-tail-regexp) + (c-ts-mode--for-each-tail-body-matcher) + (c-ts-mode--emacs-c-range-query) + (c-ts-mode--for-each-tail-ranges) + (c-ts-mode--reverse-ranges) + (c-ts-mode--emacs-set-ranges): New functions and variables. + + (c-ts-mode): Create a emacs-c parser. More setup for Emacs source + support. + + * lisp/treesit.el (treesit-query-range): Ignore underscore-prefixed + capture names. + +2023-04-27 Eli Zaretskii + + * Makefile.in (distclean): Remove the 'native-lisp' directory. + +2023-04-27 Eli Zaretskii + + Improve greek-ibycus4 input method + + * lisp/leim/quail/greek.el ("greek-ibycus4"): Add another sequence + for CAPITAL LETTER RHO WITH DASIA. (Bug#63104) + +2023-04-26 F. Jason Park + + Explain ERC 5.5 regressions in new version 5.5.0.29.1 + + * doc/misc/erc.texi: Bump version to 5.5.0.29.1. + * etc/ERC-NEWS: Don't hype bugged option `erc-reconnect-display'. + * lisp/erc/erc-dcc.el (erc-dcc-do-GET-command): Add comment explaining + parsing bug in ERC 5.5 (bug#62444). + * lisp/erc/erc-networks.el (erc-networks-on-MOTD-end): Mention known + /MOTD bug in error notice so people don't waste energy reporting + it (bug#62151). + * lisp/erc/erc.el: Change Version header to 5.5.0.29.1. Don't bother + updating the `customize-package-emacs-version-alist' entry + because no option defaults are affected. + (erc-version): Change version to 5.5.0.29.1. + (erc-reconnect-display, erc-query-on-unjoined-chan-privmsg): Add + warning to doc strings and `custom-set' functions. It's believed that + these bugs degrade the user experience significantly enough to warrant + such mentions (bug#62833). + (erc-query): Fix erroneous redirect string in deprecation spec. + Do not merge to master. + +2023-04-26 F. Jason Park + + * doc/misc/erc.texi: Elaborate on upgrading via ELPA. + +2023-04-26 Robert Pluim + + Improve outline-default-state docstring + + * lisp/outline.el (outline-default-state): Explain which functions are + available to affect heading visibility. + +2023-04-26 Eli Zaretskii + + Document problems with /bin/sh on Solaris 10 + + * etc/PROBLEMS (Solaris): Document problems with '/bin/sh'. + Suggested by Paul Eggert . (Bug#63067) + +2023-04-25 Eli Zaretskii + + Followup to addition of TUTORIAL.fa + + * etc/NEWS: Announce addition of TUTORIAL.fa. + + * etc/tutorials/TUTORIAL.translators (TUTORIAL.fa): New entry. + + * lisp/language/misc-lang.el ("Persian"): Add tutorial property. + +2023-04-25 Mohsen Banan + + Add Farsi/Persian translation of the tutorial + + * etc/tutorials/TUTORIAL.fa: New file. + + * lisp/language/misc-lang.el (arabic-shaper-ZWNJ-handling): Fix + typo in doc string. + +2023-04-25 Eli Zaretskii + + Add Mongolian language environments + + * lisp/language/misc-lang.el ("Mongolian-traditional"): + * lisp/language/cyrillic.el ("Mongolian-cyrillic"): New + language environments. + + * etc/HELLO: Add Mongolian Traditional. + * etc/NEWS: Announce the new language environments. + + (Bug#63028) + +2023-04-25 Eli Zaretskii + + Document the 'end-session' event on MS-Windows + + * doc/lispref/commands.texi (Misc Events): Document the + 'end-session' event. (Bug#63058) + +2023-04-24 Kyle Meyer + + Update to Org 9.6.4-9-g8eb209 + +2023-04-24 Eli Zaretskii + + Don't support versioned grammar libraries on MS-Windows + + * src/treesit.c (treesit_load_language_push_for_each_suffix): + Don't append ".0.0" on WINDOWSNT. + +2023-04-24 Yuan Fu + + Accept versioned tree-sitter language grammar files + + By discussion on emacs-devel, titled "Versioned Tree-sitter parser + libraries". + + * src/treesit.c (Vtreesit_str_dot_0): New variable. + (treesit_load_language_push_for_each_suffix): Additionally look for + lib_base_name.0 and lib_base_name.0.0. + (syms_of_treesit): Initialize Vtreesit_str_dot_0. + +2023-04-24 Benson Chu (tiny change) + + tab-bar-new-tab: inhibit side-window checks + + Previously, calling 'tab-bar-new-tab-to' only removed the + 'window-side' property on the currently selected window, + and then a call to 'delete-other-windows' was made to + ensure that the selected window was the only window. + We can skip this check by shadowing 'window--sides-inhibit-check' + to t. + * lisp/tab-bar.el (tab-bar-new-tab-to): Inhibit side-window checks. + (Bug#62427) + +2023-04-24 Michael Albinus + + * etc/NEWS: Fix outline level. (Bug#63042) + + Fix typos. + +2023-04-23 Eli Zaretskii + + Fix rendering of Traditional Mongolian script + + * lisp/international/characters.el: Set punctuation syntax for Po + characters from the Mongolian block + * lisp/international/fontset.el (setup-default-fontset): Add + fontset setting for Traditional Mongolic. + * lisp/language/misc-lang.el (composition-function-table): Add + rules for Traditional Mongolic. (Bug#63028) + +2023-04-22 Eli Zaretskii + + Fix line-number-at-pos when POSITION is out of narrowing + + * src/fns.c (Fline_number_at_pos): Don't signal an error when + ABSOLUTE is nil and POSITION is outside of the narrowing, like the + original Lisp implementation did. Minor speedup by using the byte + position where it is available from the get-go. (Bug#62857) + +2023-04-22 Eli Zaretskii + + Fix exiting Emacs after saving a tutorial + + * lisp/tutorial.el (tutorial--starting-point): Make it + permanent-local, so that saving the tutorial to some file doesn't + kill this buffer-local variable. Otherwise, trying to exit Emacs + after saving the tutorial will signal an error, because + 'tutorial--starting-point' is void. (Bug#37326) + +2023-04-22 Eli Zaretskii + + Add indentation style setting for c-ts-mode in .dir-locals.el + + * lisp/progmodes/c-ts-mode.el (c-ts-indent-style-safep): New + predicate. + (c-ts-mode-indent-style): Use it to test the value for being safe. + + * .dir-locals.el (c-ts-mode): Set 'c-ts-mode-indent-style' to 'gnu'. + +2023-04-20 Nicolas Martyanoff + + sql: add missing postgresql types + + * lisp/progmodes/sql.el: Add multiple missing PostgreSQL types: bigserial, + smallserial, macaddr8, jsonb, jsonpath, built-in range types, object + identifier types (oid & co). + +2023-04-19 Eli Zaretskii + + Fix display of menu-bar bindings of commands in *Help* buffers + + * lisp/help-fns.el (help-fns--insert-menu-bindings): Propertize + with 'help-key-binding' face only the menu items, not the arrows + between successive items. This is because 'char-displayable-p' is + unreliable when we propertize the character with an arbitrary + face: that face could specify a font which doesn't support the + character after all, while 'char-displayable-p' assumes there are + no restrictions on fonts that can be used for displaying the + character. Also, make the code more efficient by avoiding the + call to 'char-displayable-p' inside the loop. + +2023-04-19 Spencer Baugh + + Improve Completion Example section in the Emacs manual + + This can be a useful substitute for full-on fuzzy completion, as + provided by other completion styles and completion packages. + * doc/emacs/mini.texi (Completion Example): Give an example of + completion with point not at end of minibuffer. Also, use + @kbd{@key{TAB}} when telling the user to hit TAB. (Bug#62836) + +2023-04-19 Robert Pluim + + Improve 'message-server-alist' docstring + + * lisp/gnus/message.el (message-server-alist): Fix typo and clarify + what happens if there is already an X-Message-SMTP-Method header. + +2023-04-19 Robert Pluim + + Add index entry for fallback modes + + * doc/emacs/custom.texi (Specifying File Variables): Add index for + 'fallback modes'. + +2023-04-18 Dmitry Gutov + + xref-search-program-alist: Fix searching larger file lists on MS Windows + + * lisp/progmodes/xref.el (xref-search-program-alist): + Add '-s 10000' to xargs' options when on Windows or DOS. + Apparently the xargs port doesn't currently know how to obey the + system-wide limits (https://debbugs.gnu.org/bug=61667#521). + +2023-04-18 Shynur (tiny change) + + Fix typo and inaccuracy in the ELisp Reference manual + + * doc/lispref/loading.texi (Dynamic Modules): Fix a typo. + * doc/lispref/customize.texi (Group Definitions): Faces are also + in the 'custom-group' property of a customization group. + (Bug#62887) + +2023-04-18 Eli Zaretskii + + Fix description of lexical environment's internals + + * doc/lispref/variables.texi (Lexical Binding): Update the + description of how the lexical environment is represented + internally. (Bug#62840) + +2023-04-16 Kyle Meyer + + Update to Org 9.6.4-2-g0f6ae7 + +2023-04-16 Eli Zaretskii + + Documentation copyedits for 'package-install-upgrade-built-in' etc + + * etc/NEWS: More details about the new option + 'package-install-upgrade-built-in'. + + * lisp/emacs-lisp/package.el (package-install-upgrade-built-in) + (package--active-built-in-p, package-install): Doc fixes. + (Bug#62720) + +2023-04-16 Philip Kaludercic + + Allow upgrading built-in packages with 'package-install' + + * etc/NEWS: Mention the change + * lisp/emacs-lisp/package.el (package--upgradable-built-in-p): Add new + predicate. + (package-install-upgrade-built-in): Add new user option to enable + feature. + (package-install): Respect new user option. + +2023-04-16 Eli Zaretskii + + Minor changes in c-ts-mode.el's support of DEFUNs + + * lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-DEFUN): Renamed + from 'c-ts-mode--fontify-defun'; all callers changed. + (c-ts-mode-emacs-sources-support): Renamed from + 'c-ts-mode-emacs-devel' and made into a defcustom; all users + changed. + (c-ts-mode--emacs-defun-p, c-ts-mode--emacs-defun-at-point) + (c-ts-mode--emacs-current-defun-name): Doc fixes. (Bug#62825) + +2023-04-16 Eli Zaretskii + + Fix strike-through attribute support on TTY frames + + * src/term.c (init_tty): Fix setting the strike-through capability + with "smxx". (Bug#62265) + +2023-04-16 Eli Zaretskii + + Avoid crashes in 'describe-keymap' due to shadowing + + * src/keymap.c (describe_vector): Handle shadowing by something + other than a symbol. (Bug#62867) + +2023-04-15 Andreas Schwab + + Make image-map bindings available on image links + + * lisp/net/shr.el (shr-map): Move shr-browse-image to "M-i". + * lisp/net/eww.el (eww-image-link-keymap): Use shr-image-map. + +2023-04-15 Alan Mackenzie + + * CONTRIBUTE: Fix a typo + +2023-04-15 Jostein Kjønigsen + + Add to Eglot support for additional language-servers. + + * lisp/progmodes/eglot.el (eglot-server-programs): Add + 'vscode-markdown-language-server' for Markdown and + 'dot-language-server' for GraphViz. (Bug#62844) + +2023-04-14 Yuan Fu + + Partial support for DEFUN in c-ts-mode (bug#62825) + + The DEFUN is hard to incorporate because it's made of two nodes rather + than one, and most tree-sitter functionalities assume a defun is one + node. I fixed the indent-defun and add-log functionality, but + beginning/end-of-defun and imenu still don't recognize DEFUN. + + * lisp/progmodes/c-ts-mode.el (c-ts-mode-emacs-devel): New variable. + (c-ts-mode--defun-name): Support DEFUN. + (c-ts-mode--defun-valid-p): Support DEFUN. + (c-ts-mode--emacs-defun-p) + (c-ts-mode--emacs-defun-at-point): New functions. + (c-ts-mode-indent-defun): Use c-ts-mode--emacs-defun-at-point. + (c-ts-mode--emacs-current-defun-name): New function. + (c-ts-mode, c++-ts-mode): Optionally setup custom defun-name function. + +2023-04-14 Eli Zaretskii + + Fix style and unwinding code in treesit.c + + This was supposed to be a cherry-pick from master, but + isn't, due to the unnecessary rush to fix master without + cleaning up the mess first and without separating changes + that can and cannot be backported. + * src/treesit.c (treesit_traverse_cleanup_cursor): Fix indentation + style. + (Ftreesit_search_subtree, Ftreesit_search_forward) + (Ftreesit_induce_sparse_tree): Fix specpdl unwinding. (Bug#62823) + Do not merge to master. + +2023-04-14 Yuan Fu + + Catch signals produced by PRED in tree-sitter search functions + + Earlier we switched to using cursors rather than nodes to traverse the + parse tree. Because cursors need cleanup, we have to catch signals + thrown by the predicate functions and free the cursor. Failing to do + this will result in leaking the cursor whenever the predicate function + signals in a search function. This change fixes the leak. + * src/treesit.c (treesit_traverse_cleanup_cursor): New function. + (Ftreesit_search_subtree) + (Ftreesit_search_forward) + (Ftreesit_induce_sparse_tree): Catch signals. (Bug#62823) + + (cherry picked from commit a5eb9f6ad4e6f5a2819b540a477f1e889f6ef355) + +2023-04-13 Eli Zaretskii + + Fix compilation of w32.c with old MinGW system headers + + * src/w32.c (CONSOLE_FONT_INFO): Make sure the definition is not + visible for MinGW versions whose w32api's version is before 5.2.0. + (Bug#52792) + +2023-04-12 Dmitry Gutov + + ruby-add-log-current-method: Reduce the use of 'nreverse' + + * lisp/progmodes/ruby-mode.el (ruby-add-log-current-method): + Reduce the use of 'nreverse' (bug#62761). + + * test/lisp/progmodes/ruby-mode-tests.el + (ruby-add-log-current-method-singleton-referencing-outer): + New test. + +2023-04-12 Visuwesh + + Fix detection of WebP images by their signature + + * lisp/image.el (image-type-header-regexps): The 4 characters + between "RIFF" and "WEBP" in WebP images can also be newlines. + (Bug#62790) + +2023-04-12 Earl Hyatt + + Add more documentation for the keys of `package-vc-selected-packages`. + + * doc/emacs/package.texi (Specifying Package Sources): List the + accepted keys in a new subsection of Fetching Package Sources. + + * lisp/emacs-lisp/package-vc.el (package-vc-selected-packages): + Mention the `:doc` key. Add the `:doc` key to the Customize form, + mention the new Info node, correct "TexInfo" to "Texinfo", avoid + Git-specific terms for the description of `:branch`, mention guessing + `:vc-backend` based on the URL. + +2023-04-11 Dmitry Gutov + + vc-checkout: Try to use the vc-dir's backend first + + * lisp/vc/vc.el (vc-checkout): Try to use the vc-dir's backend + before looking for the file's one. The latter doesn't work when + the file doesn't exist on disk yet (bug#62674). + +2023-04-11 Eli Zaretskii + + Improve documentation related to 'ispell-complete-word' + + * lisp/textmodes/ispell.el (ispell-alternate-dictionary) + (ispell-complete-word-dict, ispell-complete-word): Doc fixes. + (Bug#62775) + +2023-04-11 Po Lu + + * configure.ac: Add -lbsd on Haiku. + +2023-04-11 Eli Zaretskii + + Add menu to 'c-ts-mode' and 'c++-ts-mode' + + * lisp/progmodes/c-ts-mode.el (c-ts-mode-menu): New menu. + +2023-04-11 Mattias Engdegård + + Update manual about `sort` + + * doc/lispref/sequences.texi (Sequence Functions): + Remove inaccurate and over-specific claims about how `sort` works for + lists: there is no guarantee that it doesn't modify the `car` fields + of the input list (which is precisely what it does at this time). + + (cherry picked from commit c753a9592345e2084d69e9e2cc458c16db2e4141) + +2023-04-11 Eli Zaretskii + + Fix wallpaper-tests on MS-Windows + + * test/lisp/image/wallpaper-tests.el (wallpaper--find-setter) + (wallpaper--find-setter/call-predicate) + (wallpaper--find-setter/set-current-setter) + (wallpaper-set/calls-init-action) + (wallpaper-set/calls-wallpaper-set-function) + (wallpaper-set/runs-command, wallpaper-set/runs-command/detach): + Skip these tests if native functions are used for changing + wallpaper. These tests are irrelevant in that case. + +2023-04-11 Basil L. Contovounesios + + Fix a couple of eglot-tests + + * test/lisp/progmodes/eglot-tests.el + (eglot-test-rust-analyzer-watches-files): Bump timeout. + (eglot-test-json-basic): Check for yas-minor-mode before using it, + like other tests do (bug#61637). + +2023-04-10 Eli Zaretskii + + Fix visiting RPM files + + We cannot call 'sh-set-shell' inside 'sh-base-mode', since various + settings of 'sh-mode', in particular the syntax table, is not yet + set. Likewise with various hooks: since 'sh-base-mode' is not a + mode any file should be visited with, it makes no sense to set up + stuff like 'hack-local-variables-hook' in 'sh-base-mode'; it + should be set in the descendant modes instead. + * lisp/progmodes/sh-script.el (sh-base-mode): Move the call to + 'sh-set-shell' from here... + (sh-mode): ...to here... + (bash-ts-mode): ...with a copy here. (Bug#62748) + +2023-04-10 Basil L. Contovounesios + + Fix ff-quiet-mode doc + + * lisp/find-file.el (ff-quiet-mode, ff-find-other-file): Say that + ff-quiet-mode disables tracing, not the inverse. + +2023-04-01 Gregory Heytings + + Another final fix to last changes + + * src/xdisp.c (get_small_narrowing_begv): Refine the value of 'bol_pos'. + +2023-04-01 Gregory Heytings + + Three final fixes to last changes + + * src/xdisp.c (get_nearby_bol_pos): Initialize 'bol' to BEGV - 1 + instead of 0 (which fixes cursor motion commands in the presence + of a narrowing), adapt the return condition accordingly, and do + not restart the loop when BEGV has been reached. + (get_small_narrowing_begv): Use correct type. + +2023-04-01 Gregory Heytings + + Two further fixes to last changes + + * src/xdisp.c (get_narrowed_width): Use FRAME_WINDOW_P instead of + Fterminal_live_p. Also take WINDOW_LEFT_FRINGE_WIDTH into + account. + +2023-04-01 Gregory Heytings + + Improve and fix last changes + + * src/xdisp.c (get_narrowed_width): Use WINDOW_RIGHT_FRINGE_WIDTH, + which works both for character-only terminals and for GUI frames + without fringes. + (get_nearby_bol_pos): Instead of searching for BOL in + [pos-500000..pos], gradually extend the region, starting with + [pos-500..pos]. This is much faster in buffers with some long + lines in the middle of lots of short lines. + +2023-03-29 Gregory Heytings + + Fix cursor motion in character-only terminals + + * src/xdisp.c (get_narrowed_width): Subtract 1 from + window_body_width to account for the '\' line wrapping indication. + +2023-03-28 Gregory Heytings + + Make get_medium_narrowing_begv/zv static + + * src/xdisp.c (get_medium_narrowing_begv): + (get_medium_narrowing_zv): Make these two functions static, they + are only used in xdisp.c. + + * src/dispextern.h: Remove the prototypes. + +2023-03-28 Gregory Heytings + + Improve accuracy of cursor motion commands in long lines + + * src/xdisp.c (get_nearby_bol_pos): New function. + (get_small_narrowing_begv): Use it. This makes cursor motion + commands much more accurate in the first 500K characters of each + long line. + +2023-03-28 Gregory Heytings + + Remove labeled restrictions before calling Fwiden + + * src/editfns.c (labeled_restrictions_remove_in_current_buffer): + New function. + + * src/lisp.h: Make it externally visible. + + * src/xdisp.c (display_count_lines_logically): + * src/lread.c (readevalloop): + * src/indent.c (line_number_display_width): + * src/fileio.c (write_region): + * src/callproc.c (Fcall_process_region): + * src/buffer.c (Ferase_buffer): Use it. + +2023-03-28 Gregory Heytings + + Code cleanup for long line optimizations + + This commit does not change any code, it merely renames functions + and clarifies the documentation, to make the code hopefully easier + to grasp. + + * src/dispextern.h (struct it): Rename the 'narrowed_begv', + 'narrowed_zv', 'locked_narrowing_begv', 'locked_narrowing_zv' to + 'medium_narrowing_begv', 'medium_narrowing_zv', + 'large_narrowing_begv', 'large_narrowing_zv'. Clarify the + comments. + Update the prototypes of the functions renamed in xdisp.c. + + * src/lisp.h: Update the prototypes of the functions renamed in + editfns.c. Remove the prototype of + 'safe_run_hooks_maybe_narrowed', which is used only in keyboard.c. + + * src/xdisp.c + (get_small_narrowing_begv): Renamed from + 'get_closer_narrowed_begv'. + (get_medium_narrowing_begv): Renamed from 'get_narrowed_begv'. + (get_medium_narrowing_zv): Renamed from 'get_narrowed_zv'. + (get_large_narrowing_begv): Renamed from 'get_locked_narrowing_begv'. + (get_large_narrowing_zv): Renamed from 'get_locked_narrowing_zv'. + (SET_WITH_NARROWED_BEGV): Use the new field names. + (handle_fontified_prop): Use the new function and new field names. + (back_to_previous_line_start): Use the new field name. + (back_to_previous_visible_line_start): Use the new field name. + (reseat): Use the new function and new field names. + (get_visually_first_element): Use the new field name. + (move_it_vertically_backward): Use the new function name. + (redisplay_internal): Use the new function name. + Also add a large comment to explain how Emacs deals with long lines. + + * src/keyboard.c: + (safe_run_hooks_maybe_narrowed): Use the new function names from + xdisp.c and editfns.c. Make the function static, and add a + prototype. + + * src/editfns.c: + (labeled_restrictions): Renamed from 'narrowing_locks'. + (labeled_restrictions_add): Renamed from 'narrowing_locks_add'. + (labeled_restrictions_remove): Renamed from + 'narrowing_locks_remove'. + (labeled_restrictions_get_bound): Renamed from + 'narrowing_lock_get_bound'. + (labeled_restrictions_peek_label): Renamed from + 'narrowing_lock_peek_tag'. + (labeled_restrictions_push): Renamed from 'narrowing_lock_push'. + (labeled_restrictions_pop): Renamed from 'narrowing_lock_pop'. + (unwind_reset_outermost_restriction): Renamed from + 'unwind_reset_outermost_narrowing'. + (reset_outermost_restrictions): Renamed from + 'reset_outermost_narrowings'. + (labeled_restrictions_save): Renamed from 'narrowing_locks_save'. + (labeled_restrictions_restore): Renamed from + 'narrowing_locks_restore'. + (unwind_labeled_narrow_to_region): Renamed from + 'unwind_narrow_to_region_locked'. + (labeled_narrow_to_region): Renamed from + 'narrow_to_region_locked'. + (Finternal__label_restriction): Renamed from + 'Finternal__lock_narrowing'. + (Finternal__unlabel_restriction): Renamed from + 'Finternal__unlock_narrowing'. + (Fwiden): Use the new function names. + (Fnarrow_to_region): Use the new function names. + (save_restriction_save): Use the new function names. + (syms_of_editfns): Use the new function names. + : Renamed from 'outermost-narrowing'. + + * lisp/subr.el (internal--with-restriction): Use the new internal + function name. + (internal--without-restriction): Use the new internal function + name. + + * src/composite.c (composition_compute_stop_pos): + (find_automatic_composition): Use the new function name. + + * doc/lispref/positions.texi (Narrowing): Add index entry. + 2023-04-10 Eli Zaretskii * lisp/ldefs-boot.el: Regenerate. @@ -114322,7 +115654,7 @@ This file records repository revisions from commit f2ae39829812098d8269eafbc0fcb98959ee5bb7 (exclusive) to -commit 5e039d5a6e99d8380044f410673b8ee51dbc1711 (inclusive). +commit ce7d18cbc07886b0d62110a6d26e25271017cd2a (inclusive). See ChangeLog.3 for earlier changes. ;; Local Variables: diff --git a/etc/AUTHORS b/etc/AUTHORS index 3bffc9355e4..05c6ac03bac 100644 --- a/etc/AUTHORS +++ b/etc/AUTHORS @@ -114,7 +114,7 @@ and co-wrote cc-align.el cc-cmds.el cc-defs.el cc-engine.el cc-fonts.el and changed cc-mode.texi bytecomp.el minibuf.c window.c edebug.el follow.el lisp.h display.texi eval.c keyboard.c subr.el frame.c lread.c syntax.texi xdisp.c progmodes/compile.el programs.texi font-lock.el - modes.texi window.el windows.texi and 189 other files + modes.texi window.el windows.texi and 190 other files Alan Modra: changed unexelf.c @@ -389,7 +389,7 @@ and changed nnir.el gnus-sum.el nnimap.el gnus-group.el gnus.texi gnus-msg.el gnus-int.el gnus-search.el auth-source.el gnus-art.el gnus-cache.el gnus.el nnheader.el nnspool.el deps.mk dns.el fns-tests.el fns.c gnus-agent.el gnus-cloud.el gnus-registry.el - and 13 other files + and 14 other files Andrew Hall: changed paren.el @@ -580,7 +580,7 @@ Basil L. Contovounesios: changed simple.el subr.el message.el eww.el custom.el bibtex.el text.texi gnus-sum.el modes.texi customize.texi files.texi gnus-group.el gnus-win.el gravatar.el internals.texi json.el map.el shr.el subr-tests.el window.c battery-tests.el - and 322 other files + and 324 other files Bastian Beischer: changed semantic/complete.el calc-yank.el include.el mru-bookmark.el refs.el senator.el @@ -634,7 +634,7 @@ Ben Menasha: changed nnmh.el Ben North: changed outline.el buffer.c fill.el isearch.el lisp-mode.el paren.el w32term.c xfaces.c -Benson Chu: changed font-lock.el +Benson Chu: changed font-lock.el tab-bar.el Bernhard Herzog: changed vc-hg.el menu.c xsmfns.c @@ -1078,6 +1078,8 @@ Craig McDaniel: changed sheap.c Craig Tanis: changed ox-latex.el +Cyril Arnould: changed vhdl-mode.el + Daiki Ueno: wrote epa-dired.el epa-file.el epa-hook.el epa-mail.el epa.el epg-config.el epg.el pgg-def.el pgg-gpg.el pgg-parse.el pgg-pgp.el pgg-pgp5.el pgg.el plstore.el sasl.el starttls.el @@ -1557,10 +1559,10 @@ Dmitry Gorbik: changed org.el Dmitry Gutov: wrote elisp-mode-tests.el jit-lock-tests.el json-tests.el vc-hg-tests.el xref-tests.el and changed xref.el ruby-mode.el project.el vc-git.el ruby-ts-mode.el - elisp-mode.el etags.el ruby-mode-tests.el js.el vc.el vc-hg.el - package.el symref/grep.el dired-aux.el ruby-ts-mode-tests.el simple.el + elisp-mode.el etags.el ruby-mode-tests.el js.el vc.el package.el + vc-hg.el symref/grep.el dired-aux.el ruby-ts-mode-tests.el simple.el progmodes/python.el treesit.el log-edit.el ruby-ts.rb rust-ts-mode.el - and 155 other files + and 157 other files Dmitry Kurochkin: changed isearch.el @@ -1601,8 +1603,8 @@ Duncan Findlay: changed frame.el keyboard.c xterm.el Earl Hyatt: changed autotype.texi ffap.el seq-tests.el sequences.texi windows.texi control.texi cus-edit.el eshell.texi hi-lock.el misc.texi - pcase-tests.el pcase.el replace.el search.texi seq.el tab-bar.el - texinfo.el + package-vc.el package.texi pcase-tests.el pcase.el replace.el + search.texi seq.el tab-bar.el texinfo.el E. Choroba: changed cperl-mode.el simple.el @@ -1658,10 +1660,10 @@ Eli Zaretskii: wrote [bidirectional display in xdisp.c] [tty menus in term.c] abbrev-tests.el bidi.c biditest.el cham.el chartab-tests.el coding-tests.el etags-tests.el rxvt.el tty-colors.el and co-wrote help-tests.el -and changed xdisp.c display.texi w32.c msdos.c w32fns.c simple.el +and changed xdisp.c display.texi w32.c msdos.c simple.el w32fns.c files.el fileio.c keyboard.c emacs.c text.texi w32term.c dispnew.c configure.ac frames.texi w32proc.c files.texi xfaces.c window.c - dispextern.h lisp.h and 1324 other files + dispextern.h lisp.h and 1327 other files Eliza Velasquez: changed server.el @@ -1917,7 +1919,7 @@ Filipp Gunbin: changed ldap.el compilation.txt progmodes/compile.el eudc.texi and 19 other files F. Jason Park: changed erc.el erc-backend.el erc-tests.el foonet.eld - erc.texi erc-networks.el erc-compat.el erc-dcc.el erc-sasl.el + erc.texi erc-networks.el erc-dcc.el erc-compat.el erc-sasl.el barnet.eld erc-scenarios-misc.el erc-services.el erc-common.el erc-networks-tests.el erc-scenarios-base-reconnect.el erc-scenarios-common.el socks-tests.el auth-source-pass-tests.el @@ -2026,7 +2028,7 @@ Gabriel Do Nascimento Ribeiro: changed remember.el mb-depth.el repeat.el tab-bar.el tab-line.el bookmark.el cmuscheme.el comint.el dired-tests.el dired.el esh-mode.el etags.el faces.el gnus-sum.el goto-addr.el hl-line.el ibuf-ext.el idlwave.el inf-lisp.el mh-gnus.el - mh-letter.el and 16 other files + mh-letter.el and 17 other files Gaby Launay: changed auth-source-pass.el @@ -2171,8 +2173,8 @@ Gregory Chernov: changed nnslashdot.el Gregory Heytings: changed xdisp.c editfns.c keyboard.c buffer.c subr.el dispextern.h lisp.h buffer.h display.texi efaq.texi files.el isearch.el - minibuffer.el Makefile.in bytecode.c bytecomp.el composite.c emake - positions.texi help-fns.el mailcap.el and 76 other files + minibuffer.el Makefile.in bytecode.c composite.c positions.texi + bytecomp.el emake help-fns.el lread.c and 78 other files Grégory Mounié: changed display.texi hi-lock.el man.el xfns.c @@ -2810,7 +2812,7 @@ João Távora: wrote eglot-tests.el eglot.el elec-pair.el electric-tests.el flymake-cc.el jsonrpc-tests.el jsonrpc.el message-tests.el shorthands.el and changed flymake.el icomplete.el README.md eldoc.el minibuffer.el - flymake-proc.el elisp-mode.el flymake.texi EGLOT-NEWS flymake-tests.el + flymake-proc.el EGLOT-NEWS elisp-mode.el flymake.texi flymake-tests.el eglot.texi flymake-elisp.el electric.el elisp-mode-tests.el lread.c Makefile flymake-ui.el progmodes/python.el text.texi xref.el json-tests.el and 64 other files @@ -3038,6 +3040,8 @@ and changed xterm.c xfns.c keyboard.c screen.c dispnew.c xdisp.c window.c Joseph M. Kelsey: changed fileio.c skeleton.el +Joseph Turner: changed package-vc.el + Josh Elsasser: changed eglot.el README.md configure.ac Josh Feinstein: changed erc-join.el erc.el @@ -3053,7 +3057,7 @@ Joshua Datko: changed fortune.el Joshua Varner: changed intro.texi Jostein Kjønigsen: changed csharp-mode.el typescript-ts-mode.el js.el - progmodes/compile.el eglot.el json-ts-mode.el nxml-mode.el treesit.el + eglot.el progmodes/compile.el json-ts-mode.el nxml-mode.el treesit.el Jouni K. Seppänen: changed gnus.texi nnimap.el mm-url.el @@ -4004,7 +4008,7 @@ and changed tramp.texi tramp-adb.el trampver.el trampver.texi dbusbind.c files.el ange-ftp.el files.texi file-notify-tests.el dbus.texi gitlab-ci.yml autorevert.el tramp-fish.el kqueue.c os.texi Dockerfile.emba tramp-gw.el test/Makefile.in README shell.el - tramp-imap.el and 307 other files + tramp-imap.el and 308 other files Michael Ben-Gershon: changed acorn.h configure.ac riscix1-1.h riscix1-2.h unexec.c @@ -4242,7 +4246,7 @@ Miyashita Hisashi: changed ccl.c coding.c coding.h mule-cmds.el Miyoshi Masanori: changed mouse.el smtpmail.el xdisp.c Mohsen Banan: wrote persian.el -and changed loadup.el +and changed TUTORIAL.fa loadup.el misc-lang.el Mohsin Kaleem: changed eglot.el @@ -4267,11 +4271,11 @@ Muchenxuan Tong: changed org-agenda.el org-mobile.el org-timer.el Murata Shuuichirou: changed coding.c -M Visuwesh: changed dired-aux.el ind-util.el quail/indian.el delsel.el - eww.el find-dired.el image.el mailcap.el mouse.el arc-mode.el comint.el - doc-view.el emacsbug.el gnus-group.el gnus-srvr.el gnus-sum.el gnus.el - help-fns.el image-crop.el language/indian.el mark.texi - and 9 other files +M Visuwesh: changed dired-aux.el image.el ind-util.el quail/indian.el + delsel.el eww.el find-dired.el mailcap.el mouse.el arc-mode.el + comint.el doc-view.el emacsbug.el gnus-group.el gnus-srvr.el + gnus-sum.el gnus.el help-fns.el image-crop.el language/indian.el + mark.texi and 9 other files Myles English: changed org-clock.el @@ -4340,7 +4344,7 @@ Nicholas Maniscalco: changed term.el Nicholas Strauss: changed lunar.el -Nicholas Vollmer: changed emacs.1.in +Nicholas Vollmer: changed emacs.1.in easy-mmode.el Nick Alcock: changed control.texi customize.texi display.texi files.el frames.texi gnus.el keymaps.texi modes.texi nonascii.texi syntax.texi @@ -4390,7 +4394,7 @@ and changed org-list.el org.el ox-html.el org-footnote.el ox-texinfo.el Nicolas Graner: changed eww.el message.el -Nicolas Martyanoff: changed em-cmpl.el lisp-mode.el +Nicolas Martyanoff: changed em-cmpl.el lisp-mode.el sql.el Nicolas Petton: wrote map-tests.el map.el seq-tests.el seq.el thunk-tests.el thunk.el url-handlers-tests.el @@ -4761,9 +4765,9 @@ and changed org-irc.el Philip Kaludercic: wrote epa-ks.el package-vc.el and changed rcirc.el package.el rcirc.texi vc-git.el vc.el package.texi - project.el message.el simple.el subr.el vc-hg.el .dir-locals.el - custom.el gravatar.el outline.el vc-svn.el vc/vc-bzr.el windmove.el - window.el bytecomp.el custom.texi and 65 other files + project.el message.el loaddefs-gen.el simple.el subr.el vc-hg.el + .dir-locals.el custom.el gravatar.el outline.el vc-svn.el vc/vc-bzr.el + windmove.el window.el bytecomp.el and 65 other files Philipp Edelmann: changed eglot.el @@ -4853,7 +4857,7 @@ Po Lu: changed xterm.c haikuterm.c haiku_support.cc xfns.c xterm.h xwidget.c haiku_support.h haikufns.c nsterm.m pgtkterm.c pixel-scroll.el gtkutil.c haiku-win.el x-dnd.el frames.texi haikuselect.c xselect.c xwidget.el keyboard.c haikuterm.h xmenu.c - and 199 other files + and 200 other files Pontus Michael: changed simple.el @@ -4933,7 +4937,7 @@ Randall Smith: changed dired.el Randal Schwartz: wrote pp.el Randy Taylor: changed build.sh eglot.el batch.sh rust-ts-mode.el - dockerfile-ts-mode.el c-ts-mode.el go-ts-mode.el cmake-ts-mode.el + dockerfile-ts-mode.el go-ts-mode.el c-ts-mode.el cmake-ts-mode.el cus-theme.el font-lock.el java-ts-mode.el js.el json-ts-mode.el modes.texi progmodes/python.el project.el sh-script.el typescript-ts-mode.el yaml-ts-mode.el @@ -5083,7 +5087,7 @@ and changed configure.ac process.c blocks.awk keymap.el font.c network-stream-tests.el processes.texi custom.texi ftfont.c gtkutil.c process-tests.el vc-git.el emoji-zwj.awk terminal.c unicode char-fold.el gnutls.el keymaps.texi network-stream.el nsm.el nsterm.m - and 187 other files + and 188 other files Robert Thorpe: changed cus-start.el indent.el rmail.texi @@ -5163,6 +5167,8 @@ and changed files.el scheme.el Rudolf Schlatte: changed README.md eglot.el +Ruijie Yu: changed TUTORIAL.cn + Rui-Tao Dong: changed nnweb.el Rune Kleveland: changed xfns.c @@ -5478,7 +5484,8 @@ Skip Collins: changed w32fns.c w32term.c w32term.h Sławomir Nowaczyk: changed emacs.py progmodes/python.el TUTORIAL.pl flyspell.el ls-lisp.el w32proc.c -Spencer Baugh: changed data-tests.el alloc.c autorevert.el +Spencer Baugh: changed data-tests.el alloc.c autorevert.el mini.texi + minibuffer.el processes.texi Spencer Thomas: changed dabbrev.el emacsclient.c gnus.texi server.el unexcoff.c @@ -5521,7 +5528,7 @@ Stefan Monnier: wrote bibtex-style.el bytecomp-tests.el smie.el subword-tests.el vc-mtn.el and co-wrote font-lock.el gitmerge.el pcvs.el and changed subr.el simple.el keyboard.c bytecomp.el cl-macs.el files.el - lisp.h vc.el xdisp.c eval.c alloc.c buffer.c sh-script.el + lisp.h vc.el xdisp.c alloc.c eval.c buffer.c sh-script.el progmodes/compile.el tex-mode.el keymap.c window.c help-fns.el lread.c lisp-mode.el newcomment.el and 1660 other files @@ -5769,7 +5776,7 @@ Thamer Mahmoud: changed arabic.el Theodore Jump: changed makefile.nt makefile.def w32-win.el w32faces.c Theodor Thornhill: changed typescript-ts-mode.el java-ts-mode.el - c-ts-mode.el eglot.el js.el css-mode.el project.el csharp-mode.el + c-ts-mode.el eglot.el js.el csharp-mode.el css-mode.el project.el json-ts-mode.el treesit.el c-ts-common.el eglot-tests.el EGLOT-NEWS README.md c-ts-mode-tests.el compile-tests.el indent-bsd.erts indent.erts maintaining.texi mwheel.el ruby-ts-mode.el commit 4627ede36b12414ce89aa08773387e972e192f87 Author: Eli Zaretskii Date: Sun May 14 07:57:52 2023 -0400 ; * lisp/ldefs-boot.el: Regenerate for emacs-29.0.91. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 15308c298f8..9e1adab3192 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -9232,6 +9232,7 @@ "edt-vt100" ;;; Generated autoloads from progmodes/eglot.el +(push (purecopy '(eglot 1 12 29)) package--builtin-versions) (autoload 'eglot "eglot" "\ Start LSP server in support of PROJECT's buffers under MANAGED-MAJOR-MODE. @@ -9274,6 +9275,11 @@ "edt-vt100" (fn MANAGED-MAJOR-MODE PROJECT CLASS CONTACT LANGUAGE-ID &optional INTERACTIVE)" t) (autoload 'eglot-ensure "eglot" "\ Start Eglot session for current buffer if there isn't one.") +(autoload 'eglot-upgrade-eglot "eglot" "\ +Update Eglot to latest version. + +(fn &rest _)" t) +(define-obsolete-function-alias 'eglot-update 'eglot-upgrade-eglot "29.1") (put 'eglot-workspace-configuration 'safe-local-variable 'listp) (put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t) (defun eglot--debbugs-or-github-bug-uri nil (format (if (string= (match-string 2) "github") "https://github.com/joaotavora/eglot/issues/%s" "https://debbugs.gnu.org/%s") (match-string 3))) @@ -10196,7 +10202,7 @@ "epg-config" ;;; Generated autoloads from erc/erc.el -(push (purecopy '(erc 5 5)) package--builtin-versions) +(push (purecopy '(erc 5 5 0 29 1)) package--builtin-versions) (autoload 'erc-select-read-args "erc" "\ Prompt the user for values of nick, server, port, and password.") (autoload 'erc "erc" "\ @@ -12339,7 +12345,7 @@ 'ff-find-related-file If non-nil, always attempt to create the other file if it was not found. - `ff-quiet-mode' - If non-nil, traces which directories are being searched. + If non-nil, does not trace which directories are being searched. - `ff-special-constructs' A list of regular expressions specifying how to recognize special @@ -18522,6 +18528,11 @@ ispell-html-skip-alists Standard ispell choices are then available. +This command uses a word-list file specified +by `ispell-alternate-dictionary' or by `ispell-complete-word-dict'; +if none of those name an existing word-list file, this command +signals an error. + (fn &optional INTERIOR-FRAG)" t) (autoload 'ispell-complete-word-interior-frag "ispell" "\ Completes word matching character sequence inside a word." t) @@ -22454,7 +22465,7 @@ "opascal" ;;; Generated autoloads from org/org.el -(push (purecopy '(org 9 6 3)) package--builtin-versions) +(push (purecopy '(org 9 6 5)) package--builtin-versions) (autoload 'org-babel-do-load-languages "org" "\ Load the languages defined in `org-babel-load-languages'. @@ -23446,8 +23457,7 @@ package-activate-all (autoload 'package-install "package" "\ Install the package PKG. PKG can be a `package-desc' or a symbol naming one of the -available packages in an archive in `package-archives'. When -called interactively, prompt for the package name. +available packages in an archive in `package-archives'. Mark the installed package as selected by adding it to `package-selected-packages'. @@ -23459,16 +23469,30 @@ package-activate-all If PKG is a `package-desc' and it is already installed, don't try to install it but still mark it as selected. +If the command is invoked with a prefix argument, it will allow +upgrading of built-in packages, as if `package-install-upgrade-built-in' +had been enabled. + (fn PKG &optional DONT-SELECT)" t) -(autoload 'package-update "package" "\ -Update package NAME if a newer version exists. +(autoload 'package-upgrade "package" "\ +Upgrade package NAME if a newer version exists. + +Currently, packages which are part of the Emacs distribution +cannot be upgraded that way. To enable upgrades of such a +package using this command, first upgrade the package to a +newer version from ELPA by using `\\\\[package-menu-mark-install]' after `\\[list-packages]'. (fn NAME)" t) -(autoload 'package-update-all "package" "\ +(autoload 'package-upgrade-all "package" "\ Refresh package list and upgrade all packages. -If QUERY, ask the user before updating packages. When called +If QUERY, ask the user before upgrading packages. When called interactively, QUERY is always true. +Currently, packages which are part of the Emacs distribution are +not upgraded by this command. To enable upgrading such a package +using this command, first upgrade the package to a newer version +from ELPA by using `\\\\[package-menu-mark-install]' after `\\[list-packages]'. + (fn &optional QUERY)" t) (autoload 'package-install-from-buffer "package" "\ Install a package from the current buffer. @@ -23548,10 +23572,10 @@ "package" (autoload 'package-vc-install-selected-packages "package-vc" "\ Ensure packages specified in `package-vc-selected-packages' are installed." t) -(autoload 'package-vc-update-all "package-vc" "\ -Attempt to update all installed VC packages." t) -(autoload 'package-vc-update "package-vc" "\ -Attempt to update the package PKG-DESC. +(autoload 'package-vc-upgrade-all "package-vc" "\ +Attempt to upgrade all installed VC packages." t) +(autoload 'package-vc-upgrade "package-vc" "\ +Attempt to upgrade the package PKG-DESC. (fn PKG-DESC)" t) (autoload 'package-vc-install "package-vc" "\ @@ -23567,11 +23591,13 @@ "package" symbol whose name is the package name, and the URL for the package will be taken from the package's metadata. -By default, this function installs the last version of the package -available from its repository, but if REV is given and non-nil, it -specifies the revision to install. If REV has the special value -`:last-release' (interactively, the prefix argument), that stands -for the last released version of the package. +By default, this function installs the last revision of the +package available from its repository. If REV is a string, it +describes the revision to install, as interpreted by the VC +backend. The special value `:last-release' (interactively, the +prefix argument), will use the commit of the latest release, if +it exists. The last release is the latest revision which changed +the \"Version:\" header of the package's main Lisp file. Optional argument BACKEND specifies the VC backend to use for cloning the package's repository; this is only possible if NAME-OR-URL is a URL, @@ -23608,7 +23634,7 @@ "package" cookies, re-compiling Emacs Lisp files, building and installing any documentation, downloading any missing dependencies. This command does not fetch new revisions from a remote server. That -is the responsibility of `package-vc-update'. Interactively, +is the responsibility of `package-vc-upgrade'. Interactively, prompt for the name of the package to rebuild. (fn PKG-DESC)" t) @@ -23663,7 +23689,9 @@ "page-ext" any unknown values other than DST are returned as nil, and an unknown DST value is returned as -1. -(fn STRING)") +See `decode-time' for the meaning of FORM. + +(fn STRING &optional FORM)") (register-definition-prefixes "parse-time" '("parse-")) @@ -26020,7 +26048,7 @@ 'irc `rcirc-server-alist'. STARTUP-CHANNELS is a list of channels that are joined after authentication. -(fn SERVER &optional PORT NICK USER-NAME FULL-NAME STARTUP-CHANNELS PASSWORD ENCRYPTION CERTFP SERVER-ALIAS)") +(fn SERVER &optional PORT NICK USER-NAME FULL-NAME STARTUP-CHANNELS PASSWORD ENCRYPTION SERVER-ALIAS CERTFP)") (defvar rcirc-track-minor-mode nil "\ Non-nil if Rcirc-Track minor mode is enabled. See the `rcirc-track-minor-mode' command @@ -31769,7 +31797,7 @@ texinfo-close-quote value of `texinfo-mode-hook'. (fn)" t) -(register-definition-prefixes "texinfo" '("texinfo-")) +(register-definition-prefixes "texinfo" '("fill-paragraph-separate" "texinfo-")) ;;; Generated autoloads from textmodes/texnfo-upd.el @@ -37150,10 +37178,9 @@ "zone" (provide 'loaddefs) ;; Local Variables: -;; no-byte-compile: t ;; version-control: never ;; no-update-autoloads: t -;; no-native-compile: t +;; no-byte-compile: t ;; coding: utf-8-emacs-unix ;; End: commit c90d47619e67bccbf92dc5e153002771c0ae90e3 Author: Eli Zaretskii Date: Sun May 14 07:32:21 2023 -0400 Bump Emacs version for next pretest * README: * configure.ac: * nt/README.W32: * msdos/sed2v2.inp: Bump Emacs version to 29.0.91. diff --git a/README b/README index 64f45764d6d..fda74c12925 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Copyright (C) 2001-2023 Free Software Foundation, Inc. See the end of the file for license conditions. -This directory tree holds version 29.0.90 of GNU Emacs, the extensible, +This directory tree holds version 29.0.91 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. The file INSTALL in this directory says how to build and install GNU diff --git a/configure.ac b/configure.ac index 1fbe7435b22..2c80d4cc9aa 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AC_PREREQ([2.65]) dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el. -AC_INIT([GNU Emacs], [29.0.90], [bug-gnu-emacs@gnu.org], [], +AC_INIT([GNU Emacs], [29.0.91], [bug-gnu-emacs@gnu.org], [], [https://www.gnu.org/software/emacs/]) dnl Set emacs_config_options to the options of 'configure', quoted for the shell, diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index 9b68359e034..e950d6f23ac 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -67,7 +67,7 @@ /^#undef PACKAGE_NAME/s/^.*$/#define PACKAGE_NAME ""/ /^#undef PACKAGE_STRING/s/^.*$/#define PACKAGE_STRING ""/ /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/ -/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "29.0.90"/ +/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "29.0.91"/ /^#undef SYSTEM_TYPE/s/^.*$/#define SYSTEM_TYPE "ms-dos"/ /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/ /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/ diff --git a/nt/README.W32 b/nt/README.W32 index 5a674bf2a4e..288e1e398a5 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -1,7 +1,7 @@ Copyright (C) 2001-2023 Free Software Foundation, Inc. See the end of the file for license conditions. - Emacs version 29.0.90 for MS-Windows + Emacs version 29.0.91 for MS-Windows This README file describes how to set up and run a precompiled distribution of the latest version of GNU Emacs for MS-Windows. You commit 229af8e4b319d44228dbeef1ce4347e2890f03fb Author: Mattias Engdegård Date: Sun May 14 11:33:04 2023 +0200 ; * lisp/progmodes/csharp-mode.el (csharp-ts-mode--defun-name): typo diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 869a207c567..00587a8a515 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -920,7 +920,6 @@ csharp-ts-mode--defun-name "struct_declaration" "enum_declaration" "interface_declaration" - "class_declaration" "class_declaration") (treesit-node-text (treesit-node-child-by-field-name commit ce7d18cbc07886b0d62110a6d26e25271017cd2a Author: Eli Zaretskii Date: Sun May 14 10:26:03 2023 +0300 ; Minor fixes in ELisp manual * doc/lispref/functions.texi (Declare Form): Improve indexing. (Obsolete Functions): Add cross-reference. ` diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 4ab7a194eb0..fc902a70bf0 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -2360,6 +2360,11 @@ Obsolete Functions (set-advertised-calling-convention 'sit-for '(seconds &optional nodisp) "22.1") @end example + +@noindent +The alternative to using this function is the +@code{advertised-calling-convention} @code{declare} spec, see +@ref{Declare Form}. @end defun @node Inline Functions @@ -2536,6 +2541,7 @@ Declare Form following effects: @table @code +@cindex @code{advertised-calling-convention} (@code{declare} spec) @item (advertised-calling-convention @var{signature} @var{when}) This acts like a call to @code{set-advertised-calling-convention} (@pxref{Obsolete Functions}); @var{signature} specifies the correct @@ -2561,6 +2567,7 @@ Declare Form Set the function's @code{interactive-only} property to @var{value}. @xref{The interactive-only property}. +@cindex @code{obsolete} (@code{declare} spec) @item (obsolete @var{current-name} @var{when}) Mark the function or macro as obsolete, similar to a call to @code{make-obsolete} (@pxref{Obsolete Functions}). @var{current-name} commit 5c8864fab4fd445144eb9ba845e02230302819dc Author: Eli Zaretskii Date: Sun May 14 10:13:39 2023 +0300 ; * lisp/simple.el (async-shell-command): Doc fix. (Bug#63432) diff --git a/lisp/simple.el b/lisp/simple.el index c3d0726f91b..0138556787b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4460,11 +4460,13 @@ async-shell-command Like `shell-command', but adds `&' at the end of COMMAND to execute it asynchronously. -The output appears in the buffer whose name is stored in the -variable `shell-command-buffer-name-async'. That buffer is in -shell mode. +The output appears in OUTPUT-BUFFER, which could be a buffer or +the name of a buffer, and defaults to `shell-command-buffer-name-async' +if nil or omitted. That buffer is in shell mode. Note that, unlike +with `shell-command', OUTPUT-BUFFER can only be a buffer, a buffer's +name (a string), or nil. -You can configure `async-shell-command-buffer' to specify what to do +You can customize `async-shell-command-buffer' to specify what to do when the buffer specified by `shell-command-buffer-name-async' is already taken by another running shell command. @@ -4473,6 +4475,10 @@ async-shell-command `display-buffer-no-window' for the buffer given by `shell-command-buffer-name-async'. +Optional argument ERROR-BUFFER is for backward compatibility; it +is ignored, and error output of the async command is always +mingled with its regular output. + In Elisp, you will often be better served by calling `start-process' directly, since it offers more control and does not impose the use of a shell (with its need to quote arguments)." @@ -4491,6 +4497,9 @@ async-shell-command (dired-get-filename nil t))))) (and filename (file-relative-name filename)))) nil + ;; FIXME: the following argument is always ignored by 'shell-commnd', + ;; when the command is invoked asynchronously, except, perhaps, when + ;; 'default-directory' is remote. shell-command-default-error-buffer)) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) commit b96dc472bcba9a484d8151cec61752464f599ad2 Author: Gabriel do Nascimento Ribeiro Date: Sat May 13 20:31:24 2023 -0300 Ignore current-prefix-arg in async-shell-command * lisp/simple.el (async-shell-command): Ignore current-prefix-arg and always pass nil to second argument of `shell-command'. (Bug#63432) diff --git a/lisp/simple.el b/lisp/simple.el index 959e28c7b75..c3d0726f91b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4490,7 +4490,7 @@ async-shell-command ((eq major-mode 'dired-mode) (dired-get-filename nil t))))) (and filename (file-relative-name filename)))) - current-prefix-arg + nil shell-command-default-error-buffer)) (unless (string-match "&[ \t]*\\'" command) (setq command (concat command " &"))) commit 1e6a7594361fa4d60c0d73450e45475593d93696 Author: Joseph Turner Date: Sat May 6 14:49:43 2023 -0700 Fix building of VC package manuals with relative includes * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation): Invoke makeinfo with -I to ensure the package directory is always consulted for @include statements. (Bug#63337) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 85193dd7a30..1fcc30595da 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -347,6 +347,7 @@ package-vc--build-documentation otherwise it's assumed to be an Info file." (let* ((pkg-name (package-desc-name pkg-desc)) (default-directory (package-desc-dir pkg-desc)) + (docs-directory (expand-file-name (file-name-directory file))) (output (expand-file-name (format "%s.info" pkg-name))) clean-up) (when (string-match-p "\\.org\\'" file) @@ -361,7 +362,9 @@ package-vc--build-documentation (erase-buffer) (cond ((/= 0 (call-process "makeinfo" nil t nil - "--no-split" file "-o" output)) + "-I" docs-directory + "--no-split" file + "-o" output)) (message "Failed to build manual %s, see buffer %S" file (buffer-name))) ((/= 0 (call-process "install-info" nil t nil commit 61659f36c884fb89f265271e5b118addf7497689 Author: Cyril Arnould Date: Wed May 10 07:26:52 2023 +0000 Another fix for VHDL mode highlighting * lisp/progmodes/vhdl-mode.el (vhdl-version): Bump to 3.38.5. (vhdl-compiler-alist): Fix the regexps and the doc string. Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index ee0ec63b6bc..77d862f1a17 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -16,7 +16,7 @@ ;; Reto also said in Apr 2021 that he preferred to keep the XEmacs ;; compatibility code. -(defconst vhdl-version "3.38.1" +(defconst vhdl-version "3.38.5" "VHDL Mode version number.") (defconst vhdl-time-stamp "2015-03-12" @@ -229,20 +229,20 @@ vhdl-compiler-alist ;; [Error] Assignment error: variable is illegal target of signal assignment ("ADVance MS" "vacom" "-work \\1" "make" "-f \\1" nil "valib \\1; vamap \\2 \\1" "./" "work/" "Makefile" "adms" - ("^\\s-+\\([0-9]+\\):\\s-+" nil 1 nil) ("^Compiling file \\(.+\\)" 1) + ("^\\s-+\\([0-9]+\\):\\s-+" nil 1 nil nil) ("^Compiling file \\(.+\\)" 1) ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif" "PACK/\\1.vif" "BODY/\\1.vif" upcase)) ;; Aldec ;; COMP96 ERROR COMP96_0018: "Identifier expected." "test.vhd" 66 3 ("Aldec" "vcom" "-work \\1" "make" "-f \\1" nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "aldec" - ("^.* ERROR [^:]+: \".*\" \"\\([^ \t\n]+\\)\" \\([0-9]+\\) \\([0-9]+\\)" 1 2 3) ("" 0) + ("^.* ERROR [^:]+: \".*\" \"\\([^ \t\n]+\\)\" \\([0-9]+\\) \\([0-9]+\\)" 1 2 3 nil) ("" 0) nil) ;; Cadence Leapfrog: cv -file test.vhd ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared ("Cadence Leapfrog" "cv" "-work \\1 -file" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "leapfrog" - ("^duluth: \\*E,[0-9]+ (\\([^ \t\n]+\\),\\([0-9]+\\)):" 1 2 nil) ("" 0) + ("^duluth: \\*E,[0-9]+ (\\([^ \t\n]+\\),\\([0-9]+\\)):" 1 2 nil nil) ("" 0) ("\\1/entity" "\\2/\\1" "\\1/configuration" "\\1/package" "\\1/body" downcase)) ;; Cadence Affirma NC vhdl: ncvhdl test.vhd @@ -250,7 +250,7 @@ vhdl-compiler-alist ;; (PLL_400X_TOP) is not declared [10.3]. ("Cadence NC" "ncvhdl" "-work \\1" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "ncvhdl" - ("^ncvhdl_p: \\*E,\\w+ (\\([^ \t\n]+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) + ("^ncvhdl_p: \\*E,\\w+ (\\([^ \t\n]+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3 nil) ("" 0) ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db" "\\1/package/pc.db" "\\1/body/pc.db" downcase)) ;; ghdl vhdl @@ -258,21 +258,21 @@ vhdl-compiler-alist ;; bad_counter.vhdl:13:14: operator "=" is overloaded ("GHDL" "ghdl" "-i --workdir=\\1 --ieee=synopsys -fexplicit " "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "ghdl" - ("^ghdl_p: \\*E,\\w+ (\\([^ \t\n]+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) + ("^ghdl_p: \\*E,\\w+ (\\([^ \t\n]+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3 nil) ("" 0) ("\\1/entity" "\\2/\\1" "\\1/configuration" "\\1/package" "\\1/body" downcase)) ;; IBM Compiler ;; 00 COACHDL* | [CCHDL-1]: File: adder.vhd, line.column: 120.6 ("IBM Compiler" "g2tvc" "-src" "precomp" "\\1" nil "mkdir \\1" "./" "work/" "Makefile" "ibm" - ("^[0-9]+ COACHDL.*: File: \\([^ \t\n]+\\), *line.column: \\([0-9]+\\).\\([0-9]+\\)" 1 2 3) (" " 0) + ("^[0-9]+ COACHDL.*: File: \\([^ \t\n]+\\), *line.column: \\([0-9]+\\).\\([0-9]+\\)" 1 2 3 nil) (" " 0) nil) ;; Ikos Voyager: analyze test.vhd ;; analyze test.vhd ;; E L4/C5: this library unit is inaccessible ("Ikos" "analyze" "-l \\1" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "ikos" - ("^E L\\([0-9]+\\)/C\\([0-9]+\\):" nil 1 2) + ("^E L\\([0-9]+\\)/C\\([0-9]+\\):" nil 1 2 nil) ("^analyze +\\(.+ +\\)*\\(.+\\)$" 2) nil) ;; ModelSim, Model Technology: vcom test.vhd @@ -294,7 +294,7 @@ vhdl-compiler-alist ;; test.vhd:34: error message ("LEDA ProVHDL" "provhdl" "-w \\1 -f" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "provhdl" - ("^\\([^ \t\n:]+\\):\\([0-9]+\\): " 1 2 nil) ("" 0) + ("^\\([^ \t\n:]+\\):\\([0-9]+\\): " 1 2 nil nil) ("" 0) ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif" "PACK/\\1.vif" "BODY/BODY-\\1.vif" upcase)) ;; Quartus compiler @@ -305,21 +305,21 @@ vhdl-compiler-alist ;; Warning: VHDL Process Statement warning at dvi2sdi_tst.vhd(172): ... ("Quartus" "make" "-work \\1" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "quartus" - ("^\\(Error\\|Warning\\): .* \\([^ \t\n]+\\)(\\([0-9]+\\))" 2 3 nil) ("" 0) + ("^\\(Error\\|Warning\\): .* \\([^ \t\n]+\\)(\\([0-9]+\\))" 2 3 nil nil) ("" 0) nil) ;; QuickHDL, Mentor Graphics: qvhcom test.vhd ;; ERROR: test.vhd(24): near "dnd": expecting: END ;; WARNING[4]: test.vhd(30): A space is required between ... ("QuickHDL" "qvhcom" "-work \\1" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "quickhdl" - ("^\\(ERROR\\|WARNING\\)[^:]*: \\([^ \t\n]+\\)(\\([0-9]+\\)):" 2 3 nil) ("" 0) + ("^\\(ERROR\\|WARNING\\)[^:]*: \\([^ \t\n]+\\)(\\([0-9]+\\)):" 2 3 nil nil) ("" 0) ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" "\\1/_primary.dat" "\\1/body.dat" downcase)) ;; Savant: scram -publish-cc test.vhd ;; test.vhd:87: _set_passed_through_out_port(IIR_Boolean) not defined for ("Savant" "scram" "-publish-cc -design-library-name \\1" "make" "-f \\1" nil "mkdir \\1" "./" "work._savant_lib/" "Makefile" "savant" - ("^\\([^ \t\n:]+\\):\\([0-9]+\\): " 1 2 nil) ("" 0) + ("^\\([^ \t\n:]+\\):\\([0-9]+\\): " 1 2 nil nil) ("" 0) ("\\1_entity.vhdl" "\\2_secondary_units._savant_lib/\\2_\\1.vhdl" "\\1_config.vhdl" "\\1_package.vhdl" "\\1_secondary_units._savant_lib/\\1_package_body.vhdl" downcase)) @@ -327,39 +327,39 @@ vhdl-compiler-alist ;; Error: CSVHDL0002: test.vhd: (line 97): Invalid prefix ("Simili" "vhdlp" "-work \\1" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "simili" - ("^\\(Error\\|Warning\\): \\w+: \\([^ \t\n]+\\): (line \\([0-9]+\\)): " 2 3 nil) ("" 0) + ("^\\(Error\\|Warning\\): \\w+: \\([^ \t\n]+\\): (line \\([0-9]+\\)): " 2 3 nil nil) ("" 0) ("\\1/prim.var" "\\2/_\\1.var" "\\1/prim.var" "\\1/prim.var" "\\1/_body.var" downcase)) ;; Speedwave (Innoveda): analyze -libfile vsslib.ini -src test.vhd ;; ERROR[11]::File test.vhd Line 100: Use of undeclared identifier ("Speedwave" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "speedwave" - ("^ *ERROR\\[[0-9]+]::File \\([^ \t\n]+\\) Line \\([0-9]+\\):" 1 2 nil) ("" 0) + ("^ *ERROR\\[[0-9]+]::File \\([^ \t\n]+\\) Line \\([0-9]+\\):" 1 2 nil nil) ("" 0) nil) ;; Synopsys, VHDL Analyzer (sim): vhdlan -nc test.vhd ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context. ("Synopsys" "vhdlan" "-nc -work \\1" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "synopsys" - ("^\\*\\*Error: vhdlan,[0-9]+ \\([^ \t\n]+\\)(\\([0-9]+\\)):" 1 2 nil) ("" 0) + ("^\\*\\*Error: vhdlan,[0-9]+ \\([^ \t\n]+\\)(\\([0-9]+\\)):" 1 2 nil nil) ("" 0) ("\\1.sim" "\\2__\\1.sim" "\\1.sim" "\\1.sim" "\\1__.sim" upcase)) ;; Synopsys, VHDL Analyzer (syn): vhdlan -nc -spc test.vhd ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context. ("Synopsys Design Compiler" "vhdlan" "-nc -spc -work \\1" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "synopsys_dc" - ("^\\*\\*Error: vhdlan,[0-9]+ \\([^ \t\n]+\\)(\\([0-9]+\\)):" 1 2 nil) ("" 0) + ("^\\*\\*Error: vhdlan,[0-9]+ \\([^ \t\n]+\\)(\\([0-9]+\\)):" 1 2 nil nil) ("" 0) ("\\1.syn" "\\2__\\1.syn" "\\1.syn" "\\1.syn" "\\1__.syn" upcase)) ;; Synplify: ;; @W:"test.vhd":57:8:57:9|Optimizing register bit count_x(5) to a constant 0 ("Synplify" "n/a" "n/a" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "synplify" - ("^@[EWN]:\"\\([^ \t\n]+\\)\":\\([0-9]+\\):\\([0-9]+\\):" 1 2 3) ("" 0) + ("^@[EWN]:\"\\([^ \t\n]+\\)\":\\([0-9]+\\):\\([0-9]+\\):" 1 2 3 nil) ("" 0) nil) ;; Vantage: analyze -libfile vsslib.ini -src test.vhd ;; Compiling "test.vhd" line 1... ;; **Error: LINE 49 *** No aggregate value is valid in this context. ("Vantage" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "vantage" - ("^\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" nil 1 nil) + ("^\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" nil 1 nil nil) ("^ *Compiling \"\\(.+\\)\" " 1) nil) ;; VeriBest: vc vhdl test.vhd @@ -369,26 +369,26 @@ vhdl-compiler-alist ;; [Error] Name BITA is unknown ("VeriBest" "vc" "vhdl" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "veribest" - ("^ +\\([0-9]+\\): +[^ ]" nil 1 nil) ("" 0) + ("^ +\\([0-9]+\\): +[^ ]" nil 1 nil nil) ("" 0) nil) ;; Viewlogic: analyze -libfile vsslib.ini -src test.vhd ;; Compiling "test.vhd" line 1... ;; **Error: LINE 49 *** No aggregate value is valid in this context. ("Viewlogic" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "viewlogic" - ("^\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" nil 1 nil) + ("^\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" nil 1 nil nil) ("^ *Compiling \"\\(.+\\)\" " 1) nil) ;; Xilinx XST: ;; ERROR:HDLParsers:164 - "test.vhd" Line 3. parse error ("Xilinx XST" "xflow" "" "make" "-f \\1" nil "mkdir \\1" "./" "work/" "Makefile" "xilinx" - ("^ERROR:HDLParsers:[0-9]+ - \"\\([^ \t\n]+\\)\" Line \\([0-9]+\\)\\." 1 2 nil) ("" 0) + ("^ERROR:HDLParsers:[0-9]+ - \"\\([^ \t\n]+\\)\" Line \\([0-9]+\\)\\." 1 2 nil nil) ("" 0) nil) ;; Xilinx Vivado: ;; ERROR: [VRFC 10-1412] syntax error near o_idle [test.vhd:23] ("Xilinx Vivado" "xvhdl" "" "make" "-f \\1" - nil "mkdir \\1" "./" "work" "Makefile" "vivado" + nil "mkdir \\1" "./" "work/" "Makefile" "vivado" ("^\\(?:\\(?1:ERROR\\)\\|\\(?2:WARNING\\)\\|\\(?3:INFO\\)\\): \\(.+\\) \\[\\(?4:[^ \t\n]+\\):\\(?5:[0-9]+\\)\\]" 4 5 nil (2 . 3)) ("" 0) ("\\1/entity" "\\2/\\1" "\\1/configuration" "\\1/package" "\\1/body" downcase)) @@ -414,6 +414,13 @@ vhdl-compiler-alist File subexp index: index of subexpression that matches the file name Line subexp index: index of subexpression that matches the line number Column subexp idx: index of subexpression that matches the column number + Type subexp : message type, can be nil for a real error, 1 for warning + or 0 for info. Type can also be detected using the form + (WARNING . INFO). In that case this will be equivalent to + 1 if the WARNING’th subexpression matched or else + equivalent to 0 if the INFO’th subexpression matched, or + else equivalent to nil if neither of them matched. See + also `compilation-error-regexp-alist'. File message: Regexp : regular expression to match a file name message File subexp index: index of subexpression that matches the file name @@ -483,7 +490,14 @@ vhdl-compiler-alist (integer :tag "Line subexp index") (choice :tag "Column subexp " (integer :tag "Index") - (const :tag "No column number" nil))) + (const :tag "No column number" nil)) + (choice :tag "Type " + (const :tag "Info" 0) + (const :tag "Warning" 1) + (const :tag "Error" nil) + (cons :tag "Type detection" + (natnum :tag "Warning subexp index") + (natnum :tag "Info subexp index ")))) (list :tag "File message" :indent 4 (regexp :tag "Regexp ") (integer :tag "File subexp index"))