commit 46f3452b30f39a69f610faab58c1490b34dd367d (HEAD, refs/remotes/origin/master) Author: Mattias Engdegård Date: Sun Aug 18 14:20:36 2024 +0200 Simplify and speed up make-hash-table argument parsing * src/fns.c (get_key_arg): Remove. (Fmake_hash_table): Traverse argument list once only. Don't allocate a helper array. Use faster comparisons. diff --git a/src/fns.c b/src/fns.c index 80794bc73a0..80ae554c86e 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4637,30 +4637,6 @@ next_almost_prime (EMACS_INT n) return n; } - -/* Find KEY in ARGS which has size NARGS. Don't consider indices for - which USED[I] is non-zero. If found at index I in ARGS, set - USED[I] and USED[I + 1] to 1, and return I + 1. Otherwise return - 0. This function is used to extract a keyword/argument pair from - a DEFUN parameter list. */ - -static ptrdiff_t -get_key_arg (Lisp_Object key, ptrdiff_t nargs, Lisp_Object *args, char *used) -{ - ptrdiff_t i; - - for (i = 1; i < nargs; i++) - if (!used[i - 1] && EQ (args[i - 1], key)) - { - used[i - 1] = 1; - used[i] = 1; - return i; - } - - return 0; -} - - /* Return a Lisp vector which has the same contents as VEC but has at least INCR_MIN more entries, where INCR_MIN is positive. If NITEMS_MAX is not -1, do not grow the vector to be any larger @@ -5762,32 +5738,43 @@ and ignored. usage: (make-hash-table &rest KEYWORD-ARGS) */) (ptrdiff_t nargs, Lisp_Object *args) { - USE_SAFE_ALLOCA; + Lisp_Object test_arg = Qnil; + Lisp_Object weakness_arg = Qnil; + Lisp_Object size_arg = Qnil; + Lisp_Object purecopy_arg = Qnil; + + if (nargs & 1) + error ("Odd number of arguments"); + while (nargs >= 2) + { + Lisp_Object arg = maybe_remove_pos_from_symbol (args[--nargs]); + Lisp_Object kw = maybe_remove_pos_from_symbol (args[--nargs]); + if (BASE_EQ (kw, QCtest)) + test_arg = arg; + else if (BASE_EQ (kw, QCweakness)) + weakness_arg = arg; + else if (BASE_EQ (kw, QCsize)) + size_arg = arg; + else if (BASE_EQ (kw, QCpurecopy)) + purecopy_arg = arg; + else if (BASE_EQ (kw, QCrehash_threshold) || BASE_EQ (kw, QCrehash_size)) + ; /* ignore obsolete keyword arguments */ + else + signal_error ("Invalid keyword argument", kw); + } - /* The vector `used' is used to keep track of arguments that - have been consumed. */ - char *used = SAFE_ALLOCA (nargs * sizeof *used); - memset (used, 0, nargs * sizeof *used); - - /* See if there's a `:test TEST' among the arguments. */ - ptrdiff_t i = get_key_arg (QCtest, nargs, args, used); - Lisp_Object test = i ? maybe_remove_pos_from_symbol (args[i]) : Qeql; - const struct hash_table_test *testdesc; - if (BASE_EQ (test, Qeq)) - testdesc = &hashtest_eq; - else if (BASE_EQ (test, Qeql)) - testdesc = &hashtest_eql; - else if (BASE_EQ (test, Qequal)) - testdesc = &hashtest_equal; + const struct hash_table_test *test; + if (NILP (test_arg) || BASE_EQ (test_arg, Qeql)) + test = &hashtest_eql; + else if (BASE_EQ (test_arg, Qeq)) + test = &hashtest_eq; + else if (BASE_EQ (test_arg, Qequal)) + test = &hashtest_equal; else - testdesc = get_hash_table_user_test (test); - - /* See if there's a `:purecopy PURECOPY' argument. */ - i = get_key_arg (QCpurecopy, nargs, args, used); - bool purecopy = i && !NILP (args[i]); - /* See if there's a `:size SIZE' argument. */ - i = get_key_arg (QCsize, nargs, args, used); - Lisp_Object size_arg = i ? args[i] : Qnil; + test = get_hash_table_user_test (test_arg); + + bool purecopy = !NILP (purecopy_arg); + EMACS_INT size; if (NILP (size_arg)) size = DEFAULT_HASH_SIZE; @@ -5796,36 +5783,21 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) else signal_error ("Invalid hash table size", size_arg); - /* Look for `:weakness WEAK'. */ - i = get_key_arg (QCweakness, nargs, args, used); - Lisp_Object weakness = i ? args[i] : Qnil; hash_table_weakness_t weak; - if (NILP (weakness)) + if (NILP (weakness_arg)) weak = Weak_None; - else if (EQ (weakness, Qkey)) + else if (BASE_EQ (weakness_arg, Qkey)) weak = Weak_Key; - else if (EQ (weakness, Qvalue)) + else if (BASE_EQ (weakness_arg, Qvalue)) weak = Weak_Value; - else if (EQ (weakness, Qkey_or_value)) + else if (BASE_EQ (weakness_arg, Qkey_or_value)) weak = Weak_Key_Or_Value; - else if (EQ (weakness, Qt) || EQ (weakness, Qkey_and_value)) + else if (BASE_EQ (weakness_arg, Qt) || BASE_EQ (weakness_arg, Qkey_and_value)) weak = Weak_Key_And_Value; else - signal_error ("Invalid hash table weakness", weakness); + signal_error ("Invalid hash table weakness", weakness_arg); - /* Now, all args should have been used up, or there's a problem. */ - for (i = 0; i < nargs; ++i) - if (!used[i]) - { - /* Ignore obsolete arguments. */ - if (EQ (args[i], QCrehash_threshold) || EQ (args[i], QCrehash_size)) - i++; - else - signal_error ("Invalid argument list", args[i]); - } - - SAFE_FREE (); - return make_hash_table (testdesc, size, weak, purecopy); + return make_hash_table (test, size, weak, purecopy); } commit 5d0e5f086505848631f9f79926b526597fc60688 Author: Eshel Yaron Date: Wed Aug 21 11:25:17 2024 +0200 ; Inhibit completion preview in read-only buffers * lisp/completion-preview.el (completion-preview--post-command): Avoid showing completion preview if buffer is read-only. diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index 0e32beef5d0..d989eda7020 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -467,7 +467,8 @@ point, otherwise hide it." ;; preview, don't do anything. (unless internal-p (if (and (completion-preview-require-certain-commands) - (completion-preview-require-minimum-symbol-length)) + (completion-preview-require-minimum-symbol-length) + (not buffer-read-only)) (completion-preview--show) (completion-preview-active-mode -1))))) commit bd647f361415d6c06913e4fa11a1a7ab6ab4ce02 Author: Martin Rudalics Date: Wed Aug 21 10:54:53 2024 +0200 Fix two issues with 'window-deletable-p' * lisp/window.el (window-deletable-functions): Clarify doc-string. (window-deletable-p): Handle check whether WINDOW's frame can be deleted via new function 'frame-deletable-p' (a comparison with the frame returned by 'next-frame' fails in too many cases). Do not try to run 'window-deletable-functions' in WINDOW's buffer when WINDOW is internal. * lisp/frame.el (frame-deletable-p): New function. * doc/lispref/frames.texi (Deleting Frames): Describe new function 'frame-deletable-p'. * etc/NEWS: Mention 'frame-deletable-p'. diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 8744687a531..0d3b9e0c33d 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -2760,6 +2760,43 @@ With the prefix argument @var{iconify}, the frames are iconified rather than deleted. @end deffn +The following function checks whether a frame can be safely deleted. It +is useful to avoid that a subsequent call of @code{delete-frame} throws +an error. + +@defun frame-deletable-p &optional frame +This function returns non-@code{nil} if the frame specified by +@var{frame} can be safely deleted. @var{frame} must be a live frame and +defaults to the selected frame. + +A frame cannot be safely deleted in the following cases: + +@itemize @bullet +@item +It is the only visible or iconified frame (@pxref{Visibility of +Frames}). + +@item +It hosts the active minibuffer window and minibuffer windows do not +follow the selected frame (@pxref{Basic Minibuffer,,, emacs}). + +@item +All other visible or iconified frames are either child frames +(@pxref{Child Frames}) or have a non-@code{nil} @code{delete-before} +parameter. + +@item +The frame or one of its descendants hosts the minibuffer window of a +frame that is not a descendant of the frame (@pxref{Child Frames}). +@end itemize + +These conditions cover most cases where @code{delete-frame} might fail +when called from top-level. They do not catch some special cases like, +for example, deleting a frame during a drag-and-drop operation +(@pxref{Drag and Drop}). In any such case, it will be better to wrap +the @code{delete-frame} call in a @code{condition-case} form. +@end defun + @node Finding All Frames @section Finding All Frames diff --git a/etc/NEWS b/etc/NEWS index c5e3bb5a6c3..9a9b6ead241 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -65,8 +65,8 @@ window used already has a 'quit-restore' parameter. Its presence gives operations more intuitively. +++ -*** 'quit-restore-window' now handles the values 'killing' and 'burying' -for its BURY-OR-KILL argument just like 'kill' and 'bury' but assumes +*** 'quit-restore-window' handles new values for BURY-OR-KILL argument. +The values 'killing' and 'burying' are like 'kill' and 'bury' but assume that the actual killing or burying of the buffer is done by the caller. +++ @@ -74,6 +74,13 @@ that the actual killing or burying of the buffer is done by the caller. With this option set, 'quit-restore-window' will delete its window more aggressively rather than switching to some other buffer in it. +** Frames + ++++ +*** New function 'frame-deletable-p'. +Calling this function before 'delete-frame' is useful to avoid that the +latter throws an error when the argument frame cannot be deleted. + ** Tab Bars and Tab Lines --- diff --git a/lisp/frame.el b/lisp/frame.el index 64f0d054df8..1b5aa8cff08 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -115,6 +115,74 @@ appended when the minibuffer frame is created." (sexp :tag "Value"))) :group 'frames) +(defun frame-deletable-p (&optional frame) + "Return non-nil if specified FRAME can be safely deleted. +FRAME must be a live frame and defaults to the selected frame. + +FRAME cannot be safely deleted in the following cases: + +- FRAME is the only visible or iconified frame. + +- FRAME hosts the active minibuffer window that does not follow the + selected frame. + +- All other visible or iconified frames are either child frames or have + a non-nil `delete-before' parameter. + +- FRAME or one of its descendants hosts the minibuffer window of a frame + that is not a descendant of FRAME. + +This covers most cases where `delete-frame' might fail when called from +top-level. It does not catch some special cases like, for example, +deleting a frame during a drag-and-drop operation. In any such case, it +will be better to wrap the `delete-frame' call in a `condition-case' +form." + (setq frame (window-normalize-frame frame)) + (let ((active-minibuffer-window (active-minibuffer-window)) + deletable) + (catch 'deletable + (when (and active-minibuffer-window + (eq (window-frame active-minibuffer-window) frame) + (not (eq (default-toplevel-value + 'minibuffer-follows-selected-frame) + t))) + (setq deletable nil) + (throw 'deletable nil)) + + (let ((frames (delq frame (frame-list)))) + (dolist (other frames) + ;; A suitable "other" frame must be either visible or + ;; iconified. Child frames and frames with a non-nil + ;; 'delete-before' parameter do not qualify as other frame - + ;; either of these will depend on a "suitable" frame found in + ;; this loop. + (unless (or (frame-parent other) + (frame-parameter other 'delete-before) + (not (frame-visible-p other))) + (setq deletable t)) + + ;; Some frame not descending from FRAME may use the minibuffer + ;; window of FRAME or the minibuffer window of a frame + ;; descending from FRAME. + (when (let* ((minibuffer-window (minibuffer-window other)) + (minibuffer-frame + (and minibuffer-window + (window-frame minibuffer-window)))) + (and minibuffer-frame + ;; If the other frame is a descendant of + ;; FRAME, it will be deleted together with + ;; FRAME ... + (not (frame-ancestor-p frame other)) + ;; ... but otherwise the other frame must + ;; neither use FRAME nor any descendant of + ;; it as minibuffer frame. + (or (eq minibuffer-frame frame) + (frame-ancestor-p frame minibuffer-frame)))) + (setq deletable nil) + (throw 'deletable nil)))) + + deletable))) + (defun handle-delete-frame (event) "Handle delete-frame events from the X server." (interactive "e") diff --git a/lisp/window.el b/lisp/window.el index 75c3b29b5dd..f4226fa4428 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4109,8 +4109,8 @@ and no others." The value should be a list of functions that take two arguments. The first argument is the window about to be deleted. The second argument if non-nil, means that the window is the only window on its frame and -should be deleted together with its frame. The window's buffer is -current when running this hook. +should be deleted together with its frame. If the window is live, its +buffer is current when running this hook. If any of these functions returns nil, the window will not be deleted and another buffer will be shown in it. This hook is run implicitly by @@ -4147,23 +4147,13 @@ returns nil." ;; WINDOW's frame can be deleted only if there are other frames ;; on the same terminal, and it does not contain the active ;; minibuffer. - (unless (or (eq frame (next-frame frame 0)) - ;; We can delete our frame only if no other frame - ;; currently uses our minibuffer window. - (catch 'other - (dolist (other (frame-list)) - (when (and (not (eq other frame)) - (eq (window-frame (minibuffer-window other)) - frame)) - (throw 'other t)))) - (let ((minibuf (active-minibuffer-window))) - (and minibuf (eq frame (window-frame minibuf)) - (not (eq (default-toplevel-value - 'minibuffer-follows-selected-frame) - t)))) + (unless (or (not (frame-deletable-p (window-frame window))) (or no-run - (not (with-current-buffer (window-buffer window) - (run-hook-with-args-until-failure + (if (window-live-p window) + (not (with-current-buffer (window-buffer window) + (run-hook-with-args-until-failure + 'window-deletable-functions window t))) + (not (run-hook-with-args-until-failure 'window-deletable-functions window t))))) 'frame)) ((window-minibuffer-p window) @@ -4173,7 +4163,10 @@ returns nil." ((and (or ignore-window-parameters (not (eq window (window-main-window frame)))) (or no-run - (with-current-buffer (window-buffer window) + (if (window-live-p window) + (with-current-buffer (window-buffer window) + (run-hook-with-args-until-failure + 'window-deletable-functions window nil)) (run-hook-with-args-until-failure 'window-deletable-functions window nil)))) ;; Otherwise, WINDOW can be deleted unless it is the main window commit 0b7f649614d8eb7694e98372dea7b7e01f090265 Author: Michael Albinus Date: Wed Aug 21 10:46:20 2024 +0200 Fix a Tramp bug when running several asynchronous processes * lisp/net/tramp-cache.el (tramp-get-hash-table): Add ;;;###tramp-autoload cookie. * lisp/net/tramp.el (tramp-file-name-handler): Flush connection properties "process-name" and "process-buffer". * test/lisp/net/tramp-tests.el (tramp--test-deftest-direct-async-process): Skip when underlying TEST has taken too much time. (tramp--test-with-proper-process-name-and-buffer): Remove. (tramp-test45-asynchronous-requests): Remove callees. diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 85a318b8a93..c50fbdad5f1 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -122,6 +122,7 @@ details see the info pages." (defconst tramp-cache-undefined 'undef "The symbol marking undefined hash keys and values.") +;;;###tramp-autoload (defun tramp-get-hash-table (key) "Return the hash table for KEY. If it doesn't exist yet, it is created and initialized with diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index 1031e71a994..d9667ebfa5a 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -254,10 +254,10 @@ arguments to pass to the OPERATION." (let ((coding-system-for-read 'utf-8-dos)) ; Is this correct? (setq command - (format - "cd %s && exec %s" - (tramp-unquote-shell-quote-argument localname) - (mapconcat #'tramp-shell-quote-argument (cons program args) " "))) + (format + "cd %s && exec %s" + (tramp-unquote-shell-quote-argument localname) + (mapconcat #'tramp-shell-quote-argument (cons program args) " "))) (when input (setq command (format "%s <%s" command input))) (when stderr (setq command (format "%s 2>%s" command stderr))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5d6ab3991df..4510b7659cf 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2473,6 +2473,10 @@ Fall back to normal file name handler if no Tramp file name handler exists." (autoload-do-load sf foreign))) (with-tramp-debug-message v (format "Running `%S'" (cons operation args)) + ;; We flush connection properties + ;; "process-name" and "process-buffer", + ;; because the operations shall be applied + ;; in the main connection process. ;; If `non-essential' is non-nil, Tramp shall ;; not open a new connection. ;; If Tramp detects that it shouldn't continue @@ -2481,10 +2485,14 @@ Fall back to normal file name handler if no Tramp file name handler exists." ;; tries to open the same connection twice in ;; a short time frame. ;; In both cases, we try the default handler then. - (setq result - (catch 'non-essential - (catch 'suppress - (apply foreign operation args))))) + (with-tramp-saved-connection-properties + v '("process-name" "process-buffer") + (tramp-flush-connection-property v "process-name") + (tramp-flush-connection-property v "process-buffer") + (setq result + (catch 'non-essential + (catch 'suppress + (apply foreign operation args)))))) (cond ((eq result 'non-essential) (tramp-message diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 7673ee88569..598fa49deb3 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -5404,6 +5404,8 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." direct-async-process-profile) connection-local-criteria-alist))) (skip-unless (tramp-direct-async-process-p)) + (when-let ((result (ert-test-most-recent-result ert-test))) + (skip-unless (< (ert-test-result-duration result) 300))) ;; We do expect an established connection already, ;; `file-truename' does it by side-effect. Suppress ;; `tramp--test-enabled', in order to keep the connection. @@ -7679,39 +7681,6 @@ should all return proper values." (defconst tramp--test-asynchronous-requests-timeout 300 "Timeout for `tramp-test45-asynchronous-requests'.") -(defmacro tramp--test-with-proper-process-name-and-buffer (proc &rest body) - "Set \"process-name\" and \"process-buffer\" connection properties. -The values are derived from PROC. Run BODY. -This is needed in timer functions as well as process filters and sentinels." - ;; FIXME: For tramp-sshfs.el, `processp' does not work. - (declare (indent 1) (debug (processp body))) - `(let* ((v (tramp-get-connection-property ,proc "vector")) - (pname (tramp-get-connection-property v "process-name")) - (pbuffer (tramp-get-connection-property v "process-buffer"))) - (tramp--test-message - "tramp--test-with-proper-process-name-and-buffer before %s %s" - (tramp-get-connection-property v "process-name") - (tramp-get-connection-property v "process-buffer")) - (if (process-name ,proc) - (tramp-set-connection-property v "process-name" (process-name ,proc)) - (tramp-flush-connection-property v "process-name")) - (if (process-buffer ,proc) - (tramp-set-connection-property - v "process-buffer" (process-buffer ,proc)) - (tramp-flush-connection-property v "process-buffer")) - (tramp--test-message - "tramp--test-with-proper-process-name-and-buffer changed %s %s" - (tramp-get-connection-property v "process-name") - (tramp-get-connection-property v "process-buffer")) - (unwind-protect - (progn ,@body) - (if pname - (tramp-set-connection-property v "process-name" pname) - (tramp-flush-connection-property v "process-name")) - (if pbuffer - (tramp-set-connection-property v "process-buffer" pbuffer) - (tramp-flush-connection-property v "process-buffer"))))) - ;; This test is inspired by Bug#16928. (ert-deftest tramp-test45-asynchronous-requests () "Check parallel asynchronous requests. @@ -7781,29 +7750,27 @@ process sentinels. They shall not disturb each other." (run-at-time 0 timer-repeat (lambda () - (tramp--test-with-proper-process-name-and-buffer - (get-buffer-process (tramp-get-buffer tramp-test-vec)) - (when (> (- (time-to-seconds) (time-to-seconds timer-start)) - tramp--test-asynchronous-requests-timeout) - (tramp--test-timeout-handler)) - (when buffers - (let ((time (float-time)) - (default-directory tmp-name) - (file (buffer-name (seq-random-elt buffers)))) - (tramp--test-message - "Start timer %s %s" file (current-time-string)) - (dired-uncache file) - (tramp--test-message - "Continue timer %s %s" file (file-attributes file)) - (vc-registered file) + (when (> (- (time-to-seconds) (time-to-seconds timer-start)) + tramp--test-asynchronous-requests-timeout) + (tramp--test-timeout-handler)) + (when buffers + (let ((time (float-time)) + (default-directory tmp-name) + (file (buffer-name (seq-random-elt buffers)))) + (tramp--test-message + "Start timer %s %s" file (current-time-string)) + (dired-uncache file) + (tramp--test-message + "Continue timer %s %s" file (file-attributes file)) + (vc-registered file) + (tramp--test-message + "Stop timer %s %s" file (current-time-string)) + ;; Adjust timer if it takes too much time. + (when (> (- (float-time) time) timer-repeat) + (setq timer-repeat (* 1.1 (- (float-time) time))) + (setf (timer--repeat-delay timer) timer-repeat) (tramp--test-message - "Stop timer %s %s" file (current-time-string)) - ;; Adjust timer if it takes too much time. - (when (> (- (float-time) time) timer-repeat) - (setq timer-repeat (* 1.1 (- (float-time) time))) - (setf (timer--repeat-delay timer) timer-repeat) - (tramp--test-message - "Increase timer %s" timer-repeat)))))))) + "Increase timer %s" timer-repeat))))))) ;; Create temporary buffers. The number of buffers ;; corresponds to the number of processes; it could be @@ -7830,23 +7797,21 @@ process sentinels. They shall not disturb each other." (set-process-filter proc (lambda (proc string) - (tramp--test-with-proper-process-name-and-buffer proc - (tramp--test-message - "Process filter %s %s %s" - proc string (current-time-string)) - (with-current-buffer (process-buffer proc) - (insert string)) - (when (< (process-get proc 'bar) 2) - (dired-uncache (process-get proc 'foo)) - (should (file-attributes (process-get proc 'foo))))))) + (tramp--test-message + "Process filter %s %s %s" + proc string (current-time-string)) + (with-current-buffer (process-buffer proc) + (insert string)) + (when (< (process-get proc 'bar) 2) + (dired-uncache (process-get proc 'foo)) + (should (file-attributes (process-get proc 'foo)))))) ;; Add process sentinel. It shall not perform remote ;; operations, triggering Tramp processes. This blocks. (set-process-sentinel proc (lambda (proc _state) - (tramp--test-with-proper-process-name-and-buffer proc - (tramp--test-message - "Process sentinel %s %s" proc (current-time-string))))) + (tramp--test-message + "Process sentinel %s %s" proc (current-time-string)))) (tramp--test-message "Process started %s" proc))) ;; Send a string to the processes. Use a random order of commit 3efb89ddb9633569a1ef3a4a7ffad0ce68e1ef29 Author: Protesilaos Stavrou Date: Wed Aug 21 11:07:47 2024 +0300 Update to modus-themes version 4.5.0 * doc/misc/modus-themes.org (COPYING): Update the version headers. (Option to extend the palette): Document new user options. (Full support for packages or face groups): Document more packages that are explicitly supported by the themes. (Acknowledgements): Update the list of people who have contributed to the project in one way or another. * etc/themes/modus-operandi-deuteranopia-theme.el: * etc/themes/modus-operandi-deuteranopia-theme.el: * etc/themes/modus-operandi-tinted-theme.el: * etc/themes/modus-operandi-tritanopia-theme.el: * etc/themes/modus-vivendi-deuteranopia-theme.el: * etc/themes/modus-vivendi-theme.el: * etc/themes/modus-vivendi-tinted-theme.el: * etc/themes/modus-vivendi-tritanopia-theme.el: Update the palette of each theme and include the new user option to extend its palette. * etc/themes/modus-themes.el: Cover more faces and include user option for common extension to all theme palettes. Detailed release notes: . diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 70ba8cdc02f..c02da3fbad1 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.4.0 -#+macro: release-date 2024-03-17 -#+macro: development-version 4.5.0-dev +#+macro: stable-version 4.5.0 +#+macro: release-date 2024-08-21 +#+macro: development-version 4.6.0-dev #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ #+macro: space @@texinfo:@: @@ #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ @@ -50,7 +50,7 @@ Current development target is {{{development-version}}}. :custom_id: h:b14c3fcb-13dd-4144-9d92-2c58b3ed16d3 :end: -Copyright (C) 2020-2024 Free Software Foundation, Inc. +Copyright (C) 2020-2023 Free Software Foundation, Inc. #+begin_quote Permission is granted to copy, distribute and/or modify this document @@ -88,7 +88,7 @@ The Modus themes consist of eight themes, divided into four subgroups. are variants of the two main themes. They slightly tone down the intensity of the background and provide a bit more color variety. ~modus-operandi-tinted~ has a set of base tones that are shades of - light ocher (earthly colors), while ~modus-vivendi-tinted~ gives a + light ochre (earthly colors), while ~modus-vivendi-tinted~ gives a night sky impression. - Deuteranopia themes :: ~modus-operandi-deuteranopia~ and its @@ -144,7 +144,7 @@ and covers everything that goes into every tagged release of the themes. :end: The Modus themes are distributed with Emacs starting with version 28.1. -On older versions of Emacs, they can be installed using Emacs's package +On older versions of Emacs, they can be installed using Emacs' package manager or manually from their code repository. There also exist packages for distributions of GNU/Linux. @@ -486,7 +486,7 @@ The reason we recommend ~load-theme~ instead of the other option of ~enable-theme~ is that the former does a kind of "reset" on the face specs. It quite literally loads (or reloads) the theme. Whereas the ~enable-theme~ function simply puts an already loaded theme to the top -of the list of enabled items, reusing whatever state was last loaded. +of the list of enabled items, re-using whatever state was last loaded. As such, ~load-theme~ reads all customizations that may happen during any given Emacs session: even after the initial setup of a theme. @@ -1190,6 +1190,92 @@ 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/. +** Option to extend the palette +:PROPERTIES: +:ALT_TITLE: Palette extension +:DESCRIPTION: Define new colors and use them like the original ones +:CUSTOM_ID: h:287fb971-a866-4d88-9993-56e902dd63c4 +:END: + +It is possible to extend the palette of each theme. For example, the +user may define their own =cherry= color with a value of =#a0134f= and +then apply it as an override ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). Those +colors may also be used in custom code that leverages either the +~modus-themes-with-colors~ macro or the function +~modus-themes-get-color-value~. + +The palette extension can be done in the form of a common set of +definitions that are shared among the themes or on a per-theme basis. + +#+vindex: modus-themes-common-palette-user +The common values are stored in the user option ~modus-themes-common-palette-user~. +As for per-theme variables, we have the following user options: + +#+vindex: modus-operandi-palette-user +- ~modus-operandi-palette-user~ + +#+vindex: modus-operandi-tinted-palette-user +- ~modus-operandi-tinted-palette-user~ + +#+vindex: modus-operandi-deuteranopia-palette-user +- ~modus-operandi-deuteranopia-palette-user~ + +#+vindex: modus-operandi-tritanopia-palette-user +- ~modus-operandi-tritanopia-palette-user~ + +#+vindex: modus-vivendi-palette-user +- ~modus-vivendi-palette-user~ + +#+vindex: modus-vivendi-tinted-palette-user +- ~modus-vivendi-tinted-palette-user~ + +#+vindex: modus-vivendi-deuteranopia-palette-user +- ~modus-vivendi-deuteranopia-palette-user~ + +#+vindex: modus-vivendi-tritanopia-palette-user +- ~modus-vivendi-tritanopia-palette-user~ + +Examples demonstrating how to use the aforementioned: + +#+begin_src emacs-lisp +;;; Common customizations + +;; Define two new colors in the common "user" palette of all the Modus themes. +(setq modus-themes-common-palette-user + '((cherry "#a0134f") + (plum "#6f459a"))) + +;; Use them in the overrides. +(setq modus-themes-common-palette-overrides + '((cursor cherry) + (string plum))) + +;;; Per-theme customizations + +;; Define two new colors in the "user" palette of `modus-operandi'. +;; Other themes will not use these. +(setq modus-operandi-palette-user + '((cherry "#a0134f") + (plum "#6f459a"))) + +;; Use them in the overrides. +(setq modus-operandi-palette-overrides + '((cursor cherry) + (string plum))) + + +;; Tweaks on a per-theme basis give the user maximum flexibility. For +;; example, they can have the above for `modus-operandi' while they use +;; these for `modus-vivendi': +(setq modus-vivendi-palette-user + '((apricot "#dfb350") + (kiwi "#80d458"))) + +(setq modus-vivendi-palette-overrides + '((cursor apricot) + (string kiwi))) +#+end_src + * Preview theme colors :properties: :custom_id: h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d @@ -1237,7 +1323,7 @@ and ==*modus-operandi-list-mappings*= for the semantic color mappings. :END: The Modus themes provide the means to access the palette of (i) the -active theme or (ii) any theme in the Modus collection. These are +active theme or (ii) any theme in the Modus collection. These are useful for Do-It-Yourself customizations ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]), though it can also be helpful in other cases, such as to reuse a color value in some other application. @@ -1251,9 +1337,9 @@ value in some other application. :END: #+findex: modus-themes-get-color-value -The function ~modus-themes-get-color-value~ can be called from Lisp to -return the value of a color from the active Modus theme palette. It -takea a =COLOR= argument and an optional =OVERRIDES=. It also accepts +The fuction ~modus-themes-get-color-value~ can be called from Lisp to +return the value of a color from the active Modus theme palette. It +takea a =COLOR= argument and an optional =OVERRIDES=. It also accepts a third =THEME= argument, to get the color from the given theme. =COLOR= is a symbol that represents a named color entry in the @@ -1264,7 +1350,7 @@ mapping), this function recurs until it finds the underlying color value. With an optional =OVERRIDES= argument as a non-~nil~ value, it -accounts for palette overrides. Else it reads only the default palette +accounts for palette overrides. Else it reads only the default palette ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]) With an optional =THEME= as a symbol among the ~modus-themes-items~ @@ -1309,12 +1395,12 @@ with/without overrides and when recursive mappings are introduced. #+findex: modus-themes-with-colors Advanced users may want to apply many colors from the palette of the -active Modus theme in their custom code. In such a case, retrieving +active Modus theme in their custom code. In such a case, retrieving each value with the function ~modus-themes-get-color-value~ is -inefficient ([[#h:1cc552c1-5f5f-4a56-ae78-7b69e8512c4e][Get a single color from the palette]]). The Lisp macro -~modus-themes-with-colors~ provides the requisite functionality. It +inefficient ([[#h:1cc552c1-5f5f-4a56-ae78-7b69e8512c4e][Get a single color from the palette]]). The Lisp macro +~modus-themes-with-colors~ provides the requisite functionality. It supplies the current theme's palette to the code called from inside of -it. For example: +it. For example: #+begin_src emacs-lisp (modus-themes-with-colors @@ -1323,9 +1409,9 @@ it. For example: #+end_src The above return value is for ~modus-operandi~ when that is the active -theme. Switching to another theme and evaluating this code anew will +theme. Switching to another theme and evaluating this code anew will return the relevant results for that theme (remember that since -version 4, the Modus themes consist of many items ([[#h:f0f3dbcb-602d-40cf-b918-8f929c441baf][Overview]])). The +version 4, the Modus themes consist of many items ([[#h:f0f3dbcb-602d-40cf-b918-8f929c441baf][Overview]])). The same with ~modus-vivendi~ as the active theme: #+begin_src emacs-lisp @@ -1340,7 +1426,7 @@ like =blue-warmer= and (ii) semantic color mappings like =warning=. We provide commands to inspect those ([[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Preview theme colors]]). Others sections in this manual show how to use the aforementioned -macro ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]). In practice, the use of a hook will +macro ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]). In practice, the use of a hook will also be needed ([[#h:d87673fe-2ce1-4c80-a4b8-be36ca9f2d24][DIY Use a hook at the post-load-theme phase]]). * Advanced customization @@ -1355,7 +1441,7 @@ mechanism to control things with precision ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd 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, +incompatibilities between versioned releases of the themes. As such, they are labeled as "do-it-yourself" or "DIY". ** DIY Palette override presets @@ -2076,14 +2162,14 @@ Reload the theme for changes to take effect. :end: This is one of our practical examples to override the semantic colors -of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). Here +of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). Here we show how to change the presentation of Org blocks (and other such blocks like Markdown fenced code sections, though the exact presentation depends on each major mode). The default style of Org blocks is a subtle gray background for the contents and for the delimiter lines (the =#+begin_= and =#+end_= -parts). The text of the delimiter lines is a subtle gray foreground +parts). The text of the delimiter lines is a subtle gray foreground color. [[#h:bb5b396f-5532-4d52-ab13-149ca24854f1][Make inline code in prose use alternative styles]]. @@ -2123,8 +2209,8 @@ color. #+end_src The previous examples differentiate the delimiter lines from the -block's contents. Though we can mimic the default aesthetic of a -uniform background, while changing the applicable colors. Here are +block's contents. Though we can mimic the default aesthetic of a +uniform background, while changing the applicable colors. Here are some nice combinations: #+begin_src emacs-lisp @@ -2152,7 +2238,7 @@ some nice combinations: Finally, the following makes code blocks have no distinct background. The minimal styles are applied to the delimiter lines, which only use -a subtle gray foreground. This was the default for the Modus themes up +a subtle gray foreground. This was the default for the Modus themes up until version 4.3.0. #+begin_src emacs-lisp @@ -2162,7 +2248,7 @@ until version 4.3.0. ;; was the default in versions of the Modus themes before 4.4.0 (setq modus-themes-common-palette-overrides '((bg-prose-block-contents unspecified) - (bg-prose-block-delimiter unspecified) + (bg-prose-block-delimiter unspeficied) (fg-prose-block-delimiter fg-dim))) #+end_src @@ -2806,7 +2892,7 @@ above: The reason we no longer provide this option is because it depends on a non-~nil~ value for ~x-underline-at-descent-line~. That variable affects ALL underlines, including those of links. The effect is -intrusive and looks awkward in prose. +intrusive and looks awkard in prose. As such, the Modus themes no longer provide that option but instead offer this piece of documentation to make the user fully aware of the @@ -2821,7 +2907,7 @@ Reload the theme for changes to take effect. #+cindex: Remapping faces There are cases where we need to change the buffer-local attributes of a -face. This might be because we have our own minor mode that reuses a +face. This might be because we have our own minor mode that re-uses a face for a particular purpose, such as a line selection tool that activates ~hl-line-mode~, but we wish to keep it distinct from other buffers. This is where ~face-remap-add-relative~ can be applied and may @@ -3160,7 +3246,7 @@ specification of that variable looks like this: With the exception of ~org-verbatim~ and ~org-code~ faces, everything else uses the corresponding type of emphasis: a bold typographic weight, or -italicized, underlined, and struck through text. +italicised, underlined, and struck through text. The best way for users to add some extra attributes, such as a foreground color, is to define their own faces and assign them to the @@ -3280,11 +3366,11 @@ invoke {{{kbd(M-x org-mode-restart)}}}. In versions of the Modus themes before =4.4.0= there was an option to change the coloration of Org source blocks so that certain languages -would have a distinctly colored background. This was not flexible +would have a distinctly colored background. This was not flexible enough, because (i) we cannot cover all languages effectively and (ii) the user had no choice over the =language --> color= mapping. -As such, the old user option is no more. Users can use the following +As such, the old user option is no more. Users can use the following to achieve what they want: [ All this is done by setting the Org user option ~org-src-block-faces~, @@ -3323,9 +3409,9 @@ to achieve what they want: [[#h:d87673fe-2ce1-4c80-a4b8-be36ca9f2d24][DIY Use a hook at the post-load-theme phase]]. Note that the ~org-src-block-faces~ accepts a named face, as shown -above, as well as a list of face attributes. The latter approach is +above, as well as a list of face attributes. The latter approach is not good enough because it hardcodes values in such a way that an -~org-mode-restart~ is necessary. Whereas the indirection of the named +~org-mode-restart~ is necessary. Whereas the indirection of the named face lets the theme change the values while Org buffers continue to show the right colors. @@ -3638,7 +3724,7 @@ Add this to the `modus-themes-post-load-hook'." 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 "post enable" phase of theme loading. Here is the +calls in the the "post enable" phase of theme loading. Here is the above snippet, with the necessary tweaks: #+begin_src emacs-lisp @@ -3768,7 +3854,7 @@ Reload the theme for changes to take effect. :END: Many of the Do-It-Yourself (DIY) snippets provided herein make use of -a hook to apply the desired changes. In most examples, this hook is +a hook to apply the desired changes. In most examples, this hook is the ~modus-themes-after-load-theme-hook~ (alias ~modus-themes-post-load-hook~). This hook is provided by the Modus themes and is called at the end of one the following: @@ -3786,7 +3872,7 @@ one the following: Users who switch between themes that are not limited to the Modus collection cannot benefit from the aforementioned hook: it only works -with the Modus themes. A theme-agnostic hook is needed in such a case. +with the Modus themes. A theme-agnostic hook is needed in such a case. Before Emacs 29, this had to be set up manually ([[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][DIY A theme-agnostic hook for theme loading]]). Starting with Emacs 29, the special hook ~enable-theme-functions~ works with anything that uses the basic ~enable-theme~ function. @@ -3799,7 +3885,7 @@ the way it is done with every hook: #+end_src Functions added to ~enable-theme-functions~ accept a single =THEME= -argument. The examples shown in this manual use the pattern =(&rest +argument. The examples shown in this manual use the pattern =(&rest _)=, which is how a function accepts one or more arguments but declares it will not use them (in plain terms, the code works with or without ~enable-theme-functions~). @@ -3809,7 +3895,7 @@ without ~enable-theme-functions~). :custom_id: h:86f6906b-f090-46cc-9816-1fe8aeb38776 :end: -[ NOTE: The following is for versions of Emacs before 29. For Emacs 29 +[ NOTE: The following is for versions of Emacs before 29. For Emacs 29 or higher, users can rely on the built-in ~enable-theme-functions~ ([[#h:d87673fe-2ce1-4c80-a4b8-be36ca9f2d24][Using a hook at the post-load-theme phase]]). ] @@ -4002,6 +4088,7 @@ have lots of extensions, so the "full support" may not be 100% true… + isearch, occur, etc. + ivy* + ivy-posframe ++ jabber + japanese-holidays + jira (org-jira) + jit-spell @@ -4011,6 +4098,7 @@ have lots of extensions, so the "full support" may not be 100% true… + julia + kaocha-runner + keycast ++ kmacro-menu + ledger-mode + leerzeichen + line numbers (~display-line-numbers-mode~ and global variant) @@ -4020,6 +4108,7 @@ have lots of extensions, so the "full support" may not be 100% true… + marginalia + markdown-mode + markup-faces (~adoc-mode~) ++ mb-depth + mct + messages + minimap @@ -4115,8 +4204,10 @@ have lots of extensions, so the "full support" may not be 100% true… + vertico + vertico-quick + vimish-fold ++ viper + visible-mark + visual-regexp ++ vtable + vterm + vundo + wcheck-mode @@ -4126,6 +4217,7 @@ have lots of extensions, so the "full support" may not be 100% true… + which-key + whitespace-mode + window-divider-mode ++ window-tool-bar + writegood-mode + woman + xah-elisp-mode @@ -4442,7 +4534,7 @@ advanced customization options of the themes. [[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]. In the following example, we are assuming that the user wants to (i) -reuse color variables provided by the themes, (ii) be able to retain +re-use color variables provided by the themes, (ii) be able to retain their tweaks while switching between ~modus-operandi~ and ~modus-vivendi~, and (iii) have the option to highlight either the foreground of the parentheses or the background as well. @@ -4462,7 +4554,7 @@ Then we can update our preference with this: (setq my-highlight-parentheses-use-background nil) #+end_src -To reuse colors from the themes, we must wrap our code in the +To re-use colors from the themes, we must wrap our code in the ~modus-themes-with-colors~ macro. Our implementation must interface with the variables ~highlight-parentheses-background-colors~ and/or ~highlight-parentheses-colors~. @@ -4769,7 +4861,7 @@ and/or mode line setup. :custom_id: h:4cc767dc-ffef-4c5c-9f10-82eb7b8921bf :end: -Emacs's HTML rendering library ({{{file(shr.el)}}}) may need explicit +Emacs' HTML rendering library ({{{file(shr.el)}}}) may need explicit configuration to respect the theme's colors instead of whatever specifications the webpage provides. @@ -5074,7 +5166,7 @@ more effective than trying to do the same with either red or blue (the latter is the least effective in that regard). When we need to work with several colors, it is always better to have -sufficient maneuvering space, especially since we cannot pick arbitrary +sufficient manoeuvring space, especially since we cannot pick arbitrary colors but only those that satisfy the accessibility objectives of the themes. @@ -5128,7 +5220,7 @@ each of the three channels of light (red, green, blue). For example: : xrandr --output LVDS1 --brightness 1.0 --gamma 0.76:0.75:0.68 Typography is another variable. Some font families are blurry at small -point sizes. Others may have a regular weight that is lighter (thinner) +point sizes. Others may have a regular weight that is lighter (thiner) than that of their peers which may, under certain circumstances, cause a halo effect around each glyph. @@ -5180,7 +5272,7 @@ it is already understood that one must follow the indicator or headline to view its contents and (ii) underlining everything would make the interface virtually unusable. -Again, one must exercise judgment in order to avoid discrimination, +Again, one must exercise judgement in order to avoid discrimination, where "discrimination" refers to: + The treatment of substantially different magnitudes as if they were of @@ -5254,7 +5346,7 @@ the themes, which is partially fleshed out in this manual. With regard to the artistic aspect (where "art" qua skill may amount to an imprecise science), there is no hard-and-fast rule in effect as it -requires one to exercise discretion and make decisions based on +requires one to exercize discretion and make decisions based on context-dependent information or constraints. As is true with most things in life, when in doubt, do not cling on to the letter of the law but try to understand its spirit. @@ -5402,14 +5494,15 @@ The Modus themes are a collective effort. Every bit of work matters. Griffin, Anders Johansson, Antonio Ruiz, Basil L.{{{space()}}} Contovounesios, Björn Lindström, Carlo Zancanaro, Christian Tietze, 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, Niall Dooley, - Nicolas De Jaeghere, Paul David, Philip Kaludercic, Pierre - Téchoueyres, Rudolf Adamkovič, Sergey Nichiporchik, Shreyas Ragavan, - Stefan Kangas, Stephen Berman, Stephen Gildea, Steve Downey, Tomasz - Hołubowicz, Utkarsh Singh, Vincent Murphy, Xinglu Chen, Yuanchen - Xie, fluentpwn, okamsn. + Ponsinet, Illia Ostapyshyn, Jared Finder, Kévin Le Gouguec, Koen van + Greevenbroek, Kostadin Ninev, Madhavan Krishnan, Manuel Giraud, + Markus Beppler, Matthew Stevenson, Mauro Aranda, Nacho Barrientos, + Niall Dooley, Nicolas De Jaeghere, Paul David, Pavel Novichkov, + Philip Kaludercic, Pierre Téchoueyres, Rudolf Adamkovič, Sergey + Nichiporchik, Shreyas Ragavan, Stefan Kangas, Stephen Berman, + Stephen Gildea, Steve Downey, Thanos Apollo, Tomasz Hołubowicz, + Utkarsh Singh, Vincent Murphy, Xinglu Chen, Yuanchen Xie, fluentpwn, + okamsn. + Ideas and user feedback :: Aaron Jensen, Adam Porter, Adam Spiers, Adrian Manea, Aleksei Pirogov, Alex Griffin, Alex Koen, Alex @@ -5420,32 +5513,32 @@ The Modus themes are a collective effort. Every bit of work matters. Christopher Dimech, Christopher League, Damien Cassou, Daniel Mendler, Dario Gjorgjevski, David Edmondson, Davor Rotim, Divan Santana, Eliraz Kedmi, Emanuele Michele Alberto Monterosso, Farasha - Euker, Feng Shu, Gautier Ponsinet, Gerry Agbobada, Gianluca Recchia, - Gonçalo Marrafa, Guilherme Semente, Gustavo Barros, Hörmetjan - Yiltiz, Ilja Kocken, Imran Khan, Iris Garcia, Ivan Popovych, James - Ferguson, Jeremy Friesen, Jerry Zhang, Johannes Grødem, John Haman, - John Wick, Jonas Collberg, Jorge Morais, Joshua O'Connor, Julio C. - Villasante, Kenta Usami, Kevin Fleming, Kévin Le Gouguec, Kevin - Kainan Li, Kostadin Ninev, Laith Bahodi, Lasse Lindner, Len Trigg, - Lennart C.{{{space()}}} Karssen, Luis Miguel Castañeda, Magne Hov, Manuel Giraud, - Manuel Uberti, Mark 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, - Nicolas Semrau, Olaf Meeuwissen, 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, ltmsyvag, okamsn, pRot0ta1p, soaringbird, tumashu, - wakamenod. + Euker, Feng Shu, Filippo Argiolas, Gautier Ponsinet, Gerry Agbobada, + Gianluca Recchia, Gonçalo Marrafa, Guilherme Semente, Gustavo + Barros, Hörmetjan Yiltiz, Ilja Kocken, Imran Khan, Iris Garcia, Ivan + Popovych, James Ferguson, Jeremy Friesen, Jerry Zhang, Johannes + Grødem, John Haman, John Wick, Jonas Collberg, Jorge Morais, Joshua + O'Connor, Julio C. Villasante, Kenta Usami, Kevin Fleming, Kévin Le + Gouguec, Kevin Kainan Li, Kostadin Ninev, Laith Bahodi, Lasse + Lindner, Len Trigg, Lennart C.{{{space()}}} Karssen, Luis Miguel + Castañeda, Magne Hov, Manuel Giraud, Manuel Uberti, Mark 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, Nicolas Semrau, + Olaf Meeuwissen, 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, ZharMeny, bepolymathe, bit9tream, bangedorrunt, + derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, ltmsyvag, + okamsn, pRot0ta1p, shipmints, soaringbird, tumashu, wakamenod. + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core diff --git a/etc/themes/modus-operandi-deuteranopia-theme.el b/etc/themes/modus-operandi-deuteranopia-theme.el index 42479965300..485a71e19b5 100644 --- a/etc/themes/modus-operandi-deuteranopia-theme.el +++ b/etc/themes/modus-operandi-deuteranopia-theme.el @@ -134,22 +134,30 @@ standard)." (bg-magenta-nuanced "#f8e6f5") (bg-cyan-nuanced "#e0f2fa") -;;; Uncommon accent backgrounds +;;; Uncommon accent background and foreground pairs + + (bg-clay "#f1c8b5") + (fg-clay "#63192a") + + (bg-ochre "#f0e3c0") + (fg-ochre "#573a30") + + (bg-lavender "#dfcdfa") + (fg-lavender "#443379") - (bg-ochre "#f0e0cc") - (bg-lavender "#dfdbfa") (bg-sage "#c0e7d4") + (fg-sage "#124b41") ;;; Graphs (bg-graph-red-0 "#d0b029") (bg-graph-red-1 "#e0cab4") - (bg-graph-green-0 "#8ad080") + (bg-graph-green-0 "#8ac050") (bg-graph-green-1 "#afdfa5") (bg-graph-yellow-0 "#ffcf00") (bg-graph-yellow-1 "#f9ff00") (bg-graph-blue-0 "#7f9fff") - (bg-graph-blue-1 "#9fc6ff") + (bg-graph-blue-1 "#afd0ff") (bg-graph-magenta-0 "#b0b0d0") (bg-graph-magenta-1 "#d0dfdf") (bg-graph-cyan-0 "#6faad9") @@ -248,19 +256,24 @@ standard)." ;;;; Code mappings + (bracket fg-main) (builtin magenta-warmer) (comment yellow-cooler) (constant blue-cooler) - (docstring green-faint) + (delimiter fg-main) (docmarkup magenta-faint) + (docstring green-faint) (fnname magenta) (keyword magenta-cooler) + (number fg-main) + (operator fg-main) (preprocessor red-cooler) + (punctuation fg-main) + (rx-backslash blue-cooler) + (rx-construct yellow-cooler) (string blue-warmer) (type cyan-cooler) (variable cyan) - (rx-construct yellow-cooler) - (rx-backslash blue-cooler) ;;;; Accent mappings @@ -483,6 +496,19 @@ 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-deuteranopia-palette-user nil + "Like the `modus-operandi-deuteranopia-palette' for user-defined entries. +This is meant to extend the palette with custom named colors and/or +semantic palette mappings. Those may then be used in combination with +palette overrides (also see `modus-themes-common-palette-overrides' and +`modus-operandi-deuteranopia-palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Option to extend the palette for use with overrides")) + (defcustom modus-operandi-deuteranopia-palette-overrides nil "Overrides for `modus-operandi-deuteranopia-palette'. diff --git a/etc/themes/modus-operandi-theme.el b/etc/themes/modus-operandi-theme.el index fb2ff99a74b..6fd2ddd57de 100644 --- a/etc/themes/modus-operandi-theme.el +++ b/etc/themes/modus-operandi-theme.el @@ -132,22 +132,30 @@ which corresponds to a minimum contrast in relative luminance of (bg-magenta-nuanced "#f8e6f5") (bg-cyan-nuanced "#e0f2fa") -;;; Uncommon accent backgrounds +;;; Uncommon accent background and foreground pairs + + (bg-clay "#f1c8b5") + (fg-clay "#63192a") + + (bg-ochre "#f0e3c0") + (fg-ochre "#573a30") + + (bg-lavender "#dfcdfa") + (fg-lavender "#443379") - (bg-ochre "#f0e0cc") - (bg-lavender "#dfdbfa") (bg-sage "#c0e7d4") + (fg-sage "#124b41") ;;; Graphs (bg-graph-red-0 "#ef7969") (bg-graph-red-1 "#ffaab4") - (bg-graph-green-0 "#2fe029") + (bg-graph-green-0 "#45c050") (bg-graph-green-1 "#75ef30") (bg-graph-yellow-0 "#ffcf00") (bg-graph-yellow-1 "#f9ff00") (bg-graph-blue-0 "#7f90ff") - (bg-graph-blue-1 "#9fc6ff") + (bg-graph-blue-1 "#a6c0ff") (bg-graph-magenta-0 "#e07fff") (bg-graph-magenta-1 "#fad0ff") (bg-graph-cyan-0 "#70d3f0") @@ -246,19 +254,24 @@ which corresponds to a minimum contrast in relative luminance of ;;;; Code mappings + (bracket fg-main) (builtin magenta-warmer) (comment fg-dim) (constant blue-cooler) - (docstring green-faint) + (delimiter fg-main) (docmarkup magenta-faint) + (docstring green-faint) (fnname magenta) (keyword magenta-cooler) + (number fg-main) + (operator fg-main) (preprocessor red-cooler) + (punctuation fg-main) + (rx-backslash magenta) + (rx-construct green-cooler) (string blue-warmer) (type cyan-cooler) (variable cyan) - (rx-construct green-cooler) - (rx-backslash magenta) ;;;; Accent mappings @@ -481,6 +494,19 @@ 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-palette-user nil + "Like the `modus-operandi-palette' for user-defined entries. +This is meant to extend the palette with custom named colors and/or +semantic palette mappings. Those may then be used in combination with +palette overrides (also see `modus-themes-common-palette-overrides' and +`modus-operandi-palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Option to extend the palette for use with overrides")) + (defcustom modus-operandi-palette-overrides nil "Overrides for `modus-operandi-palette'. diff --git a/etc/themes/modus-operandi-tinted-theme.el b/etc/themes/modus-operandi-tinted-theme.el index d906715e44c..c901e834d15 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 theme with a light ocher background -*- lexical-binding:t -*- +;;; modus-operandi-tinted-theme.el --- Elegant, highly legible theme with a light ochre background -*- lexical-binding:t -*- ;; Copyright (C) 2019-2024 Free Software Foundation, Inc. @@ -44,7 +44,7 @@ ;;;###theme-autoload (deftheme modus-operandi-tinted - "Elegant, highly legible theme with a light ocher background. + "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 @@ -132,22 +132,30 @@ which corresponds to a minimum contrast in relative luminance of (bg-magenta-nuanced "#f8e6f5") (bg-cyan-nuanced "#e0f2fa") -;;; Uncommon accent backgrounds +;;; Uncommon accent background and foreground pairs + + (bg-clay "#f1c8b5") + (fg-clay "#63192a") + + (bg-ochre "#f0e3c0") + (fg-ochre "#573a30") + + (bg-lavender "#dfcdfa") + (fg-lavender "#443379") - (bg-ochre "#f0e0cc") - (bg-lavender "#dfdbfa") (bg-sage "#c0e7d4") + (fg-sage "#124b41") ;;; Graphs (bg-graph-red-0 "#ef7969") (bg-graph-red-1 "#ffaab4") - (bg-graph-green-0 "#2fe029") + (bg-graph-green-0 "#45c050") (bg-graph-green-1 "#75ef30") (bg-graph-yellow-0 "#ffcf00") (bg-graph-yellow-1 "#f9ff00") (bg-graph-blue-0 "#7f90ff") - (bg-graph-blue-1 "#9fc6ff") + (bg-graph-blue-1 "#a6c0ff") (bg-graph-magenta-0 "#e07fff") (bg-graph-magenta-1 "#fad0ff") (bg-graph-cyan-0 "#70d3f0") @@ -246,19 +254,24 @@ which corresponds to a minimum contrast in relative luminance of ;;;; Code mappings + (bracket fg-main) (builtin magenta-warmer) (comment red-faint) (constant blue-cooler) - (docstring green-faint) + (delimiter fg-main) (docmarkup magenta-faint) + (docstring green-faint) (fnname magenta) (keyword magenta-cooler) + (number fg-main) + (operator fg-main) (preprocessor red-cooler) + (punctuation fg-main) + (rx-backslash magenta) + (rx-construct green-cooler) (string blue-warmer) (type cyan-cooler) (variable cyan) - (rx-construct green-cooler) - (rx-backslash magenta) ;;;; Accent mappings @@ -481,6 +494,19 @@ 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-tinted-palette-user nil + "Like the `modus-operandi-tinted-palette' for user-defined entries. +This is meant to extend the palette with custom named colors and/or +semantic palette mappings. Those may then be used in combination with +palette overrides (also see `modus-themes-common-palette-overrides' and +`modus-operandi-tinted-palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Option to extend the palette for use with overrides")) + (defcustom modus-operandi-tinted-palette-overrides nil "Overrides for `modus-operandi-tinted-palette'. diff --git a/etc/themes/modus-operandi-tritanopia-theme.el b/etc/themes/modus-operandi-tritanopia-theme.el index 56be8329784..ae62198c4ed 100644 --- a/etc/themes/modus-operandi-tritanopia-theme.el +++ b/etc/themes/modus-operandi-tritanopia-theme.el @@ -134,22 +134,30 @@ standard)." (bg-magenta-nuanced "#f8e6f5") (bg-cyan-nuanced "#e0f2fa") -;;; Uncommon accent backgrounds +;;; Uncommon accent background and foreground pairs + + (bg-clay "#f1c8b5") + (fg-clay "#63192a") + + (bg-ochre "#f0e3c0") + (fg-ochre "#573a30") + + (bg-lavender "#dfcdfa") + (fg-lavender "#443379") - (bg-ochre "#f0e0cc") - (bg-lavender "#dfdbfa") (bg-sage "#c0e7d4") + (fg-sage "#124b41") ;;; Graphs (bg-graph-red-0 "#ef7969") (bg-graph-red-1 "#ffaab4") - (bg-graph-green-0 "#70c3b0") - (bg-graph-green-1 "#a3dfe5") + (bg-graph-green-0 "#68c0a0") + (bg-graph-green-1 "#a5dfd0") (bg-graph-yellow-0 "#d99f9f") (bg-graph-yellow-1 "#ffb58f") (bg-graph-blue-0 "#80a0df") - (bg-graph-blue-1 "#9fcaff") + (bg-graph-blue-1 "#a8cfff") (bg-graph-magenta-0 "#efafcf") (bg-graph-magenta-1 "#ffdaef") (bg-graph-cyan-0 "#7fd3ed") @@ -248,19 +256,24 @@ standard)." ;;;; Code mappings + (bracket fg-main) (builtin magenta) (comment red-faint) (constant green-cooler) - (docstring fg-alt) + (delimiter fg-main) (docmarkup magenta-faint) + (docstring fg-alt) (fnname cyan-warmer) (keyword red-cooler) + (number fg-main) + (operator fg-main) (preprocessor red-warmer) + (punctuation fg-main) + (rx-backslash magenta) + (rx-construct red) (string cyan) (type blue-warmer) (variable cyan-cooler) - (rx-construct red) - (rx-backslash magenta) ;;;; Accent mappings @@ -483,6 +496,19 @@ 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-user nil + "Like the `modus-operandi-tritanopia-palette' for user-defined entries. +This is meant to extend the palette with custom named colors and/or +semantic palette mappings. Those may then be used in combination with +palette overrides (also see `modus-themes-common-palette-overrides' and +`modus-operandi-tritanopia-palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Option to extend the palette for use with overrides")) + (defcustom modus-operandi-tritanopia-palette-overrides nil "Overrides for `modus-operandi-tritanopia-palette'. diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el index b8be7f07a57..7950a3da39d 100644 --- a/etc/themes/modus-themes.el +++ b/etc/themes/modus-themes.el @@ -5,7 +5,7 @@ ;; Author: Protesilaos Stavrou ;; Maintainer: Protesilaos Stavrou ;; URL: https://github.com/protesilaos/modus-themes -;; Version: 4.4.0 +;; Version: 4.5.0 ;; Package-Requires: ((emacs "27.1")) ;; Keywords: faces, theme, accessibility @@ -641,6 +641,20 @@ In user configuration files the form may look like this: :initialize #'custom-initialize-default :link '(info-link "(modus-themes) Command prompts")) + +(defcustom modus-themes-common-palette-user nil + "Common user-defined colors to extend all the themes' palettes. +This is meant to extend the palette of the active Modus theme with +custom named colors and/or semantic palette mappings. Those may then be +used in combination with palette overrides (see +`modus-themes-common-palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Extend the palette for use with overrides")) + (defcustom modus-themes-common-palette-overrides nil "Set palette overrides for all the Modus themes. @@ -1068,22 +1082,22 @@ C1 and C2 are color values written in hexadecimal RGB." (car (or (modus-themes--list-enabled-themes) (modus-themes--list-known-themes)))) -(defun modus-themes--palette-symbol (theme &optional overrides) - "Return THEME palette as a symbol. -With optional OVERRIDES, return THEME palette overrides as a -symbol." - (when-let ((suffix (cond - ((and theme overrides) - "palette-overrides") - (theme - "palette")))) - (intern (format "%s-%s" theme suffix)))) +(defun modus-themes--palette-symbol (theme &optional suffix) + "Return THEME palette as a symbol of the form THEME-palette. +With optional SUFFIX, return THEME-palette-SUFFIX as a symbol." + (when theme + (intern + (if suffix + (format "%s-palette-%s" theme suffix) + (format "%s-palette" theme))))) (defun modus-themes--palette-value (theme &optional overrides) "Return palette value of THEME with optional OVERRIDES." - (let ((base-value (symbol-value (modus-themes--palette-symbol theme)))) + (let* ((core-palette (symbol-value (modus-themes--palette-symbol theme))) + (user-palette (symbol-value (modus-themes--palette-symbol theme "user"))) + (base-value (append user-palette modus-themes-common-palette-user core-palette))) (if overrides - (append (symbol-value (modus-themes--palette-symbol theme :overrides)) + (append (symbol-value (modus-themes--palette-symbol theme "overrides")) modus-themes-common-palette-overrides base-value) base-value))) @@ -1389,7 +1403,7 @@ color that is combined with FG-FOR-BG." :foreground fg :weight ;; If we have `bold' specifically, we inherit the face of - ;; the same name. This allows the user to customize that + ;; the same name. This allows the user to customise that ;; face, such as to change its font family. (if (and weight (not (eq weight 'bold))) weight @@ -1621,7 +1635,7 @@ FG and BG are the main colors." `(comint-highlight-prompt ((,c :inherit modus-themes-prompt))) `(confusingly-reordered ((,c :inherit modus-themes-lang-error))) `(edmacro-label ((,c :inherit bold :foreground ,accent-0))) - `(elisp-shorthand-font-lock-face ((,c :inherit font-lock-variable-name-face))) + `(elisp-shorthand-font-lock-face ((,c :inherit (italic font-lock-preprocessor-face)))) `(error ((,c :inherit bold :foreground ,err))) `(escape-glyph ((,c :foreground ,err))) `(file-name-shadow ((,c :inherit shadow))) @@ -1650,6 +1664,10 @@ FG and BG are the main colors." `(shadow ((,c :foreground ,fg-dim))) `(success ((,c :inherit bold :foreground ,info))) `(trailing-whitespace ((,c :background ,bg-space-err))) + ;; NOTE 2024-06-22: I use `list' here to suppress a bogus warning + ;; from the compiler: it says I should depend on Emacs 29 to use + ;; vtable. + (list 'vtable `((,c :inherit modus-themes-fixed-pitch))) `(warning ((,c :inherit bold :foreground ,warning))) ;;;;; buttons, links, widgets `(button ((,c :background ,bg-link :foreground ,fg-link :underline ,underline-link))) @@ -1768,7 +1786,7 @@ FG and BG are the main colors." `(font-latex-italic-face ((,c :inherit italic))) `(font-latex-math-face ((,c :inherit font-lock-constant-face))) `(font-latex-script-char-face ((,c :inherit font-lock-builtin-face))) - `(font-latex-sectioning-5-face ((,c :inherit (bold modus-themes-variable-pitch) :foreground ,fg-alt))) + `(font-latex-sectioning-5-face ((,c :inherit bold :foreground ,fg-alt))) `(font-latex-sedate-face ((,c :inherit font-lock-keyword-face))) `(font-latex-slide-title-face ((,c :inherit modus-themes-heading-1))) `(font-latex-string-face ((,c :inherit font-lock-string-face))) @@ -2175,7 +2193,7 @@ FG and BG are the main colors." `(doom-modeline-evil-visual-state ((,c :inherit warning))) `(doom-modeline-info ((,c :inherit success))) `(doom-modeline-input-method (( ))) - `(doom-modeline-lsp-error ((,c :inherit bold-italic))) + `(doom-modeline-lsp-error ((,c :inherit bold))) `(doom-modeline-lsp-running (( ))) `(doom-modeline-lsp-success ((,c :inherit success))) `(doom-modeline-lsp-warning ((,c :inherit warning))) @@ -2186,7 +2204,7 @@ FG and BG are the main colors." `(doom-modeline-repl-success ((,c :inherit success))) `(doom-modeline-repl-warning ((,c :inherit warning))) `(doom-modeline-time (( ))) - `(doom-modeline-urgent ((,c :inherit bold-italic :foreground ,modeline-err))) + `(doom-modeline-urgent ((,c :inherit bold :foreground ,modeline-err))) `(doom-modeline-warning ((,c :inherit warning))) ;;;;; ediff `(ediff-current-diff-A ((,c :background ,bg-removed :foreground ,fg-removed))) @@ -2400,16 +2418,21 @@ FG and BG are the main colors." ;;;;; fold-this `(fold-this-overlay ((,c :background ,bg-inactive))) ;;;;; font-lock + `(font-lock-bracket-face ((,c :foreground ,bracket))) `(font-lock-builtin-face ((,c :inherit modus-themes-bold :foreground ,builtin))) `(font-lock-comment-delimiter-face ((,c :inherit font-lock-comment-face))) `(font-lock-comment-face ((,c :inherit modus-themes-slant :foreground ,comment))) `(font-lock-constant-face ((,c :foreground ,constant))) + `(font-lock-delimiter-face ((,c :foreground ,delimiter))) `(font-lock-doc-face ((,c :inherit modus-themes-slant :foreground ,docstring))) `(font-lock-doc-markup-face ((,c :inherit modus-themes-slant :foreground ,docmarkup))) `(font-lock-function-name-face ((,c :foreground ,fnname))) `(font-lock-keyword-face ((,c :inherit modus-themes-bold :foreground ,keyword))) `(font-lock-negation-char-face ((,c :inherit error))) + `(font-lock-number-face ((,c :foreground ,number))) + `(font-lock-operator-face ((,c :foreground ,operator))) `(font-lock-preprocessor-face ((,c :foreground ,preprocessor))) + `(font-lock-punctuation-face ((,c :foreground ,punctuation))) `(font-lock-regexp-grouping-backslash ((,c :inherit modus-themes-bold :foreground ,rx-backslash))) `(font-lock-regexp-grouping-construct ((,c :inherit modus-themes-bold :foreground ,rx-construct))) `(font-lock-string-face ((,c :foreground ,string))) @@ -2712,6 +2735,24 @@ FG and BG are the main colors." ;;;;; ivy-posframe `(ivy-posframe-border ((,c :background ,border))) `(ivy-posframe-cursor ((,c :background ,fg-main :foreground ,bg-main))) +;;;;; jabber + `(jabber-activity-face ((,c :foreground ,modeline-info))) + `(jabber-roster-user-away ((,c :foreground ,red-faint))) + `(jabber-roster-user-xa ((,c :foreground ,magenta :italic t))) + `(jabber-roster-user-dnd ((,c :foreground ,red :bold t))) + `(jabber-roster-user-chatty ((,c :foreground ,cyan-intense))) + `(jabber-roster-user-error ((,c :inherit error))) + `(jabber-roster-user-offline ((,c :foreground ,fg-dim :italic t))) + `(jabber-roster-user-online ((,c :foreground ,cyan :weight bold))) + `(jabber-chat-prompt-foreign ((,c :foreground ,red :weight bold))) + `(jabber-chat-prompt-system ((,c :foreground ,green))) + `(jabber-chat-prompt-local ((,c :foreground ,cyan))) + `(jabber-chat-error ((,c :inherit error))) + `(jabber-activity-personal-face ((,c :foreground ,blue-intense))) + `(jabber-rare-time-face ((,c :foreground ,green-faint :underline t))) + `(jabber-title-small ((,c :weight bold :height 1.0 :foreground ,fg-heading-3))) + `(jabber-title-medium ((,c :weight bold :width expanded :height 2.0 :foreground ,fg-heading-2))) + `(jabber-title-large ((,c :weight bold :width ultra-expanded :height 3.0 :foreground ,fg-heading-1))) ;;;;; japanese-holidays `(japanese-holiday-saturday ((,c :foreground ,date-holiday-other))) ;;;;; jira (org-jira) @@ -2761,6 +2802,10 @@ FG and BG are the main colors." ;;;;; keycast `(keycast-command ((,c :inherit bold))) `(keycast-key ((,c :inherit modus-themes-bold :background ,keybind :foreground ,bg-main))) +;;;;; kmacro-menu + `(kmacro-menu-mark ((,c :inherit bold))) + `(kmacro-menu-marked ((,c :inherit modus-themes-mark-sel))) + `(kmacro-menu-flagged ((,c :inherit modus-themes-mark-del))) ;;;;; ledger-mode `(ledger-font-auto-xact-face ((,c :inherit font-lock-builtin-face))) `(ledger-font-account-name-face ((,c :foreground ,name))) @@ -2958,6 +3003,8 @@ FG and BG are the main colors." `(markup-title-4-face ((,c :inherit modus-themes-heading-5))) `(markup-title-5-face ((,c :inherit modus-themes-heading-6))) `(markup-verbatim-face ((,c :inherit modus-themes-prose-verbatim))) +;;;;; mbdepth + `(minibuffer-depth-indicator ((,c :inherit modus-themes-mark-alt))) ;;;;; mct `(mct-highlight-candidate ((,c :inherit modus-themes-completion-selected))) ;;;;; messages @@ -3132,7 +3179,8 @@ FG and BG are the main colors." `(notmuch-tag-unread ((,c :foreground ,accent-1))) `(notmuch-tree-match-author-face ((,c :inherit notmuch-search-matching-authors))) `(notmuch-tree-match-date-face ((,c :inherit notmuch-search-date))) - `(notmuch-tree-match-face ((,c :foreground ,fg-main))) + `(notmuch-tree-match-face ((,c :foreground ,fg-dim))) + `(notmuch-tree-match-subject-face ((,c :foreground ,fg-main))) `(notmuch-tree-match-tag-face ((,c :inherit notmuch-tag-face))) `(notmuch-tree-no-match-face ((,c :inherit shadow))) `(notmuch-tree-no-match-date-face ((,c :inherit shadow))) @@ -3668,9 +3716,9 @@ FG and BG are the main colors." `(telega-username ((,c :foreground ,cyan-cooler))) `(telega-webpage-chat-link ((,c :background ,bg-inactive))) `(telega-webpage-fixed ((,c :inherit modus-themes-fixed-pitch :height 0.85))) - `(telega-webpage-header ((,c :inherit modus-themes-variable-pitch :height 1.3))) + `(telega-webpage-header ((,c :height 1.3))) `(telega-webpage-preformatted ((,c :inherit modus-themes-fixed-pitch :background ,bg-inactive))) - `(telega-webpage-subheader ((,c :inherit modus-themes-variable-pitch :height 1.15))) + `(telega-webpage-subheader ((,c :height 1.15))) ;;;;; terraform-mode `(terraform--resource-name-face ((,c :foreground ,keyword))) `(terraform--resource-type-face ((,c :foreground ,type))) @@ -3815,6 +3863,12 @@ FG and BG are the main colors." `(vimish-fold-fringe ((,c :foreground ,cyan))) `(vimish-fold-mouse-face ((,c :inherit modus-themes-intense-blue))) `(vimish-fold-overlay ((,c :background ,bg-inactive))) +;;;;; viper + `(viper-search ((,c :inherit modus-themes-search-current))) + `(viper-replace-overlay ((,c :inherit modus-themes-search-replace))) + `(viper-minibuffer-emacs (( ))) + `(viper-minibuffer-insert (( ))) + `(viper-minibuffer-vi (( ))) ;;;;; visible-mark `(visible-mark-active ((,c :background ,bg-blue-intense))) `(visible-mark-face1 ((,c :background ,bg-cyan-intense))) @@ -3877,7 +3931,7 @@ FG and BG are the main colors." `(web-mode-css-string-face ((,c :inherit web-mode-string-face))) `(web-mode-css-variable-face ((,c :inherit font-lock-variable-name-face))) `(web-mode-current-column-highlight-face ((,c :background ,bg-inactive))) - `(web-mode-current-element-highlight-face ((,c :inherit modus-themes-cyan-subtle))) + `(web-mode-current-element-highlight-face ((,c :inherit modus-themes-subtle-cyan))) `(web-mode-doctype-face ((,c :inherit font-lock-doc-face))) `(web-mode-error-face ((,c :inherit error))) `(web-mode-filter-face ((,c :inherit font-lock-function-name-face))) @@ -3952,6 +4006,10 @@ FG and BG are the main colors." `(window-divider ((,c :foreground ,border))) `(window-divider-first-pixel ((,c :foreground ,bg-inactive))) `(window-divider-last-pixel ((,c :foreground ,bg-inactive))) +;;;;; window-tool-bar-mode + `(window-tool-bar-button ((,c :inherit modus-themes-button))) + `(window-tool-bar-button-hover ((,c :inherit (highlight modus-themes-button)))) + `(window-tool-bar-button-disabled ((,c :inherit modus-themes-button :background ,bg-button-inactive :foreground ,fg-button-inactive))) ;;;;; widget `(widget-button ((,c :inherit bold :foreground ,fg-link))) `(widget-button-pressed ((,c :inherit widget-button :foreground ,fg-link-visited))) @@ -4079,6 +4137,10 @@ FG and BG are the main colors." ,fg-term-magenta ,fg-term-cyan ,fg-term-white]) +;;;; viper + `(viper-replace-overlay-cursor-color ,err) + `(viper-insert-state-cursor-color ,info) + `(viper-emacs-state-cursor-color ,fg-main) ;;;; xterm-color `(xterm-color-names [,fg-term-black diff --git a/etc/themes/modus-vivendi-deuteranopia-theme.el b/etc/themes/modus-vivendi-deuteranopia-theme.el index d721dba09a9..815e2403e13 100644 --- a/etc/themes/modus-vivendi-deuteranopia-theme.el +++ b/etc/themes/modus-vivendi-deuteranopia-theme.el @@ -134,11 +134,19 @@ standard)." (bg-magenta-nuanced "#2f0c3f") (bg-cyan-nuanced "#042837") -;;; Uncommon accent backgrounds +;;; Uncommon accent background and foreground pairs + + (bg-clay "#49191a") + (fg-clay "#f1b090") + + (bg-ochre "#462f20") + (fg-ochre "#e0d09c") - (bg-ochre "#442c2f") (bg-lavender "#38325c") - (bg-sage "#0f3d30") + (fg-lavender "#dfc0f0") + + (bg-sage "#143e32") + (fg-sage "#c3e7d4") ;;; Graphs @@ -248,19 +256,24 @@ standard)." ;;;; Code mappings + (bracket fg-main) (builtin magenta-warmer) (comment yellow-cooler) (constant blue-cooler) - (docstring cyan-faint) + (delimiter fg-main) (docmarkup magenta-faint) + (docstring cyan-faint) (fnname magenta) (keyword magenta-cooler) + (number fg-main) + (operator fg-main) (preprocessor red-cooler) + (punctuation fg-main) + (rx-backslash blue-cooler) + (rx-construct yellow-cooler) (string blue-warmer) (type cyan-cooler) (variable cyan) - (rx-construct yellow-cooler) - (rx-backslash blue-cooler) ;;;; Accent mappings @@ -483,6 +496,19 @@ 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-deuteranopia-palette-user nil + "Like the `modus-vivendi-deuteranopia-palette' for user-defined entries. +This is meant to extend the palette with custom named colors and/or +semantic palette mappings. Those may then be used in combination with +palette overrides (also see `modus-themes-common-palette-overrides' and +`modus-vivendi-deuteranopia-palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Option to extend the palette for use with overrides")) + (defcustom modus-vivendi-deuteranopia-palette-overrides nil "Overrides for `modus-vivendi-deuteranopia-palette'. diff --git a/etc/themes/modus-vivendi-theme.el b/etc/themes/modus-vivendi-theme.el index 8b822974c15..8f56d0ca78e 100644 --- a/etc/themes/modus-vivendi-theme.el +++ b/etc/themes/modus-vivendi-theme.el @@ -132,11 +132,19 @@ which corresponds to a minimum contrast in relative luminance of (bg-magenta-nuanced "#2f0c3f") (bg-cyan-nuanced "#042837") -;;; Uncommon accent backgrounds +;;; Uncommon accent background and foreground pairs + + (bg-clay "#49191a") + (fg-clay "#f1b090") + + (bg-ochre "#462f20") + (fg-ochre "#e0d09c") - (bg-ochre "#442c2f") (bg-lavender "#38325c") - (bg-sage "#0f3d30") + (fg-lavender "#dfc0f0") + + (bg-sage "#143e32") + (fg-sage "#c3e7d4") ;;; Graphs @@ -246,19 +254,24 @@ which corresponds to a minimum contrast in relative luminance of ;;;; Code mappings + (bracket fg-main) (builtin magenta-warmer) (comment fg-dim) (constant blue-cooler) - (docstring cyan-faint) + (delimiter fg-main) (docmarkup magenta-faint) + (docstring cyan-faint) (fnname magenta) (keyword magenta-cooler) + (number fg-main) + (operator fg-main) (preprocessor red-cooler) + (punctuation fg-main) + (rx-backslash magenta) + (rx-construct green-cooler) (string blue-warmer) (type cyan-cooler) (variable cyan) - (rx-construct green-cooler) - (rx-backslash magenta) ;;;; Accent mappings @@ -481,6 +494,19 @@ 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-palette-user nil + "Like the `modus-vivendi--palette' for user-defined entries. +This is meant to extend the palette with custom named colors and/or +semantic palette mappings. Those may then be used in combination with +palette overrides (also see `modus-themes-common-palette-overrides' and +`modus-vivendi--palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Option to extend the palette for use with overrides")) + (defcustom modus-vivendi-palette-overrides nil "Overrides for `modus-vivendi-palette'. diff --git a/etc/themes/modus-vivendi-tinted-theme.el b/etc/themes/modus-vivendi-tinted-theme.el index 5aa44304ee9..55c1cd7d2d1 100644 --- a/etc/themes/modus-vivendi-tinted-theme.el +++ b/etc/themes/modus-vivendi-tinted-theme.el @@ -132,11 +132,19 @@ which corresponds to a minimum contrast in relative luminance of (bg-magenta-nuanced "#2f0c3f") (bg-cyan-nuanced "#042837") -;;; Uncommon accent backgrounds +;;; Uncommon accent background and foreground pairs + + (bg-clay "#49191a") + (fg-clay "#f1b090") + + (bg-ochre "#462f20") + (fg-ochre "#e0d09c") - (bg-ochre "#442c2f") (bg-lavender "#38325c") - (bg-sage "#0f3d30") + (fg-lavender "#dfc0f0") + + (bg-sage "#143e32") + (fg-sage "#c3e7d4") ;;; Graphs @@ -246,19 +254,24 @@ which corresponds to a minimum contrast in relative luminance of ;;;; Code mappings + (bracket fg-main) (builtin magenta-warmer) (comment red-faint) (constant blue-cooler) - (docstring cyan-faint) + (delimiter fg-main) (docmarkup magenta-faint) + (docstring cyan-faint) (fnname magenta) (keyword magenta-cooler) + (number fg-main) + (operator fg-main) (preprocessor red-cooler) + (punctuation fg-main) + (rx-backslash magenta) + (rx-construct green-cooler) (string blue-warmer) (type cyan-cooler) (variable cyan) - (rx-construct green-cooler) - (rx-backslash magenta) ;;;; Accent mappings @@ -481,6 +494,19 @@ 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-tinted-palette-user nil + "Like the `modus-vivendi-tinted-palette' for user-defined entries. +This is meant to extend the palette with custom named colors and/or +semantic palette mappings. Those may then be used in combination with +palette overrides (also see `modus-themes-common-palette-overrides' and +`modus-vivendi-tinted-palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Option to extend the palette for use with overrides")) + (defcustom modus-vivendi-tinted-palette-overrides nil "Overrides for `modus-vivendi-tinted-palette'. diff --git a/etc/themes/modus-vivendi-tritanopia-theme.el b/etc/themes/modus-vivendi-tritanopia-theme.el index 2327a1e9c97..f1bd65e97bc 100644 --- a/etc/themes/modus-vivendi-tritanopia-theme.el +++ b/etc/themes/modus-vivendi-tritanopia-theme.el @@ -134,11 +134,19 @@ standard)." (bg-magenta-nuanced "#2f0c3f") (bg-cyan-nuanced "#042837") -;;; Uncommon accent backgrounds +;;; Uncommon accent background and foreground pairs + + (bg-clay "#49191a") + (fg-clay "#f1b090") + + (bg-ochre "#462f20") + (fg-ochre "#e0d09c") - (bg-ochre "#442c2f") (bg-lavender "#38325c") - (bg-sage "#0f3d30") + (fg-lavender "#dfc0f0") + + (bg-sage "#143e32") + (fg-sage "#c3e7d4") ;;; Graphs @@ -248,19 +256,24 @@ standard)." ;;;; Code mappings + (bracket fg-main) (builtin magenta) (comment red-faint) (constant green-faint) - (docstring fg-alt) + (delimiter fg-main) (docmarkup magenta-faint) + (docstring fg-alt) (fnname cyan-warmer) (keyword red-cooler) + (number fg-main) + (operator fg-main) (preprocessor red-warmer) + (punctuation fg-main) + (rx-backslash magenta) + (rx-construct red) (string cyan) (type blue-warmer) (variable cyan-cooler) - (rx-construct red) - (rx-backslash magenta) ;;;; Accent mappings @@ -483,6 +496,19 @@ 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-user nil + "Like the `modus-vivendi-tritanopia-palette' for user-defined entries. +This is meant to extend the palette with custom named colors and/or +semantic palette mappings. Those may then be used in combination with +palette overrides (also see `modus-themes-common-palette-overrides' and +`modus-vivendi-tritanopia-palette-overrides')." + :group 'modus-themes + :package-version '(modus-themes . "4.5.0") + :type '(repeat (list symbol (choice symbol string))) + :set #'modus-themes--set-option + :initialize #'custom-initialize-default + :link '(info-link "(modus-themes) Option to extend the palette for use with overrides")) + (defcustom modus-vivendi-tritanopia-palette-overrides nil "Overrides for `modus-vivendi-tritanopia-palette'. commit 53ea5f1df411aa349fb99d6b444d433a42ded594 Author: Kévin Le Gouguec Date: Wed Aug 21 08:45:00 2024 +0200 Restore vc-git helper function (bug#68183) * lisp/vc/vc-git.el (vc-git--cmds-in-progress): Restore; it was removed in a previous refactoring patch, but we may still find use for it. (vc-git-dir--in-progress-headers): Use it. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 4d631c7e032..dedf6fdd219 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -748,8 +748,8 @@ or an empty string if none." (and tracking (fmt "Tracking" tracking)) (and remote-url (fmt "Remote" remote-url))))))) -(defun vc-git-dir--in-progress-headers () - "Return headers for Git commands in progress in this worktree." +(defun vc-git--cmds-in-progress () + "Return a list of Git commands in progress in this worktree." (let ((gitdir (vc-git--git-path)) cmds) ;; See contrib/completion/git-prompt.sh in git.git. @@ -765,6 +765,11 @@ or an empty string if none." (push 'merge cmds)) (when (file-exists-p (expand-file-name "BISECT_START" gitdir)) (push 'bisect cmds)) + cmds)) + +(defun vc-git-dir--in-progress-headers () + "Return headers for Git commands in progress in this worktree." + (let ((cmds (vc-git--cmds-in-progress))) (cl-flet ((fmt (cmd name) (when (memq cmd cmds) ;; For now just a heading, key bindings can be added commit 88ac5d03586a81cc8644e75adbdb3cab9b56a1b9 Author: Kévin Le Gouguec Date: Sun Jun 9 19:41:41 2024 +0200 Split vc-git-dir-extra-headers into more manageable chunks The current code requires a lot of eyeballing back-and-forth to: - check where variables are actually used, what impact changing them can have: in actuality, there are three distinct "groups" of headers we compute, each with their own independent state; - understand formatting details such as "who's in charge of the newlines". To solve both issues, split that function into smaller ones, each handling a "group" of headers. The only expected "functional" change is that, by propertizing "\nHeader: " strings, the original code sometimes applied the vc-dir-header face to the newline preceding a header; the new code applies no faces to these newlines. This change would be visible to users with themes adding an :extended background to vc-dir-header. In practice, no in-tree theme is impacted. For bug#68183. * lisp/vc/vc-git.el (vc-git-dir--branch-headers): New function to compute "Branch", "Tracking" and "Remote". (vc-git--cmds-in-progress): Rename to... (vc-git-dir--in-progress-headers): ... this, and compute headers. (vc-git-dir--stash-headers): New function to compute the "Stash" header. (vc-git-dir-extra-headers): Boil down to just setting default-directory and assembling the headers from these new helpers. (vc-git--out-match): New function to call 'git' and capture specific bits of output. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index e8257c5dbd0..4d631c7e032 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -717,6 +717,63 @@ or an empty string if none." :files files :update-function update-function))) +(defun vc-git-dir--branch-headers () + "Return headers for branch-related information." + (let ((branch (vc-git--out-match + '("symbolic-ref" "HEAD") + "^\\(refs/heads/\\)?\\(.+\\)$" 2)) + tracking remote-url) + (if branch + (when-let ((branch-merge + (vc-git--out-match + `("config" ,(concat "branch." branch ".merge")) + "^\\(refs/heads/\\)?\\(.+\\)$" 2)) + (branch-remote + (vc-git--out-match + `("config" ,(concat "branch." branch ".remote")) + "\\([^\n]+\\)" 1))) + (if (string= branch-remote ".") + (setq tracking branch-merge + remote-url "none (tracking local branch)") + (setq tracking (concat branch-remote "/" branch-merge) + remote-url (vc-git-repository-url + default-directory branch-remote)))) + (setq branch "none (detached HEAD)")) + (cl-flet ((fmt (key value) + (concat + (propertize (format "% -11s: " key) 'face 'vc-dir-header) + (propertize value 'face 'vc-dir-header-value)))) + (remove nil (list + (fmt "Branch" branch) + (and tracking (fmt "Tracking" tracking)) + (and remote-url (fmt "Remote" remote-url))))))) + +(defun vc-git-dir--in-progress-headers () + "Return headers for Git commands in progress in this worktree." + (let ((gitdir (vc-git--git-path)) + cmds) + ;; See contrib/completion/git-prompt.sh in git.git. + (when (or (file-directory-p + (expand-file-name "rebase-merge" gitdir)) + (file-exists-p + (expand-file-name "rebase-apply/rebasing" gitdir))) + (push 'rebase cmds)) + (when (file-exists-p + (expand-file-name "rebase-apply/applying" gitdir)) + (push 'am cmds)) + (when (file-exists-p (expand-file-name "MERGE_HEAD" gitdir)) + (push 'merge cmds)) + (when (file-exists-p (expand-file-name "BISECT_START" gitdir)) + (push 'bisect cmds)) + (cl-flet ((fmt (cmd name) + (when (memq cmd cmds) + ;; For now just a heading, key bindings can be added + ;; later for various bisect actions. + (propertize (format "% -11s: in progress" name) + 'face 'vc-dir-status-warning)))) + (remove nil (list (fmt 'bisect "Bisect") + (fmt 'rebase "Rebase")))))) + (defvar-keymap vc-git-stash-shared-map "S" #'vc-git-stash-snapshot "C" #'vc-git-stash) @@ -797,130 +854,75 @@ or an empty string if none." :help "Show the contents of the current stash")) map)) -(defun vc-git--cmds-in-progress () - "Return a list of Git commands in progress in this worktree." - (let ((gitdir (vc-git--git-path)) - cmds) - ;; See contrib/completion/git-prompt.sh in git.git. - (when (or (file-directory-p - (expand-file-name "rebase-merge" gitdir)) - (file-exists-p - (expand-file-name "rebase-apply/rebasing" gitdir))) - (push 'rebase cmds)) - (when (file-exists-p - (expand-file-name "rebase-apply/applying" gitdir)) - (push 'am cmds)) - (when (file-exists-p (expand-file-name "MERGE_HEAD" gitdir)) - (push 'merge cmds)) - (when (file-exists-p (expand-file-name "BISECT_START" gitdir)) - (push 'bisect cmds)) - cmds)) +(defun vc-git-dir--stash-headers () + "Return headers describing the current stashes." + (list + (concat + (propertize "Stash : " 'face 'vc-dir-header) + (if-let ((stash-list (vc-git-stash-list))) + (let* ((len (length stash-list)) + (limit + (if (integerp vc-git-show-stash) + (min vc-git-show-stash len) + len)) + (shown-stashes (cl-subseq stash-list 0 limit)) + (hidden-stashes (cl-subseq stash-list limit)) + (all-hideable (or (eq vc-git-show-stash t) + (<= len vc-git-show-stash)))) + (concat + ;; Button to toggle visibility. + (if all-hideable + (vc-git-make-stash-button nil limit limit) + (vc-git-make-stash-button t vc-git-show-stash len)) + ;; Stash list. + (when shown-stashes + (concat + (propertize "\n" + 'vc-git-hideable all-hideable) + (mapconcat + (lambda (x) + (propertize x + 'face 'vc-dir-header-value + 'mouse-face 'highlight + 'vc-git-hideable all-hideable + 'help-echo vc-git-stash-list-help + 'keymap vc-git-stash-map)) + shown-stashes + (propertize "\n" + 'vc-git-hideable all-hideable)))) + (when hidden-stashes + (concat + (propertize "\n" + 'invisible t + 'vc-git-hideable t) + (mapconcat + (lambda (x) + (propertize x + 'face 'vc-dir-header-value + 'mouse-face 'highlight + 'invisible t + 'vc-git-hideable t + 'help-echo vc-git-stash-list-help + 'keymap vc-git-stash-map)) + hidden-stashes + (propertize "\n" + 'invisible t + 'vc-git-hideable t)))))) + (propertize "Nothing stashed" + 'help-echo vc-git-stash-shared-help + 'keymap vc-git-stash-shared-map + 'face 'vc-dir-header-value))))) (defun vc-git-dir-extra-headers (dir) - (let ((str (vc-git--out-str "symbolic-ref" "HEAD")) - (stash-list (vc-git-stash-list)) - (default-directory dir) - (in-progress (vc-git--cmds-in-progress)) - - branch remote-url stash-button stash-string tracking-branch) - (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str) - (progn - (setq branch (match-string 2 str)) - (let ((remote (vc-git--out-str - "config" (concat "branch." branch ".remote"))) - (merge (vc-git--out-str - "config" (concat "branch." branch ".merge")))) - (when (string-match "\\([^\n]+\\)" remote) - (setq remote (match-string 1 remote))) - (when (string-match "^\\(refs/heads/\\)?\\(.+\\)$" merge) - (setq tracking-branch (match-string 2 merge))) - (pcase remote - ("." - (setq remote-url "none (tracking local branch)")) - ((pred (not string-empty-p)) - (setq - remote-url (vc-git-repository-url dir remote) - tracking-branch (concat remote "/" tracking-branch)))))) - (setq branch "none (detached HEAD)")) - (when stash-list - (let* ((len (length stash-list)) - (limit - (if (integerp vc-git-show-stash) - (min vc-git-show-stash len) - len)) - (shown-stashes (cl-subseq stash-list 0 limit)) - (hidden-stashes (cl-subseq stash-list limit)) - (all-hideable (or (eq vc-git-show-stash t) - (<= len vc-git-show-stash)))) - (setq stash-button (if all-hideable - (vc-git-make-stash-button nil limit limit) - (vc-git-make-stash-button t vc-git-show-stash len)) - stash-string - (concat - (when shown-stashes - (concat - (propertize "\n" - 'vc-git-hideable all-hideable) - (mapconcat - (lambda (x) - (propertize x - 'face 'vc-dir-header-value - 'mouse-face 'highlight - 'vc-git-hideable all-hideable - 'help-echo vc-git-stash-list-help - 'keymap vc-git-stash-map)) - shown-stashes - (propertize "\n" - 'vc-git-hideable all-hideable)))) - (when hidden-stashes - (concat - (propertize "\n" - 'invisible t - 'vc-git-hideable t) - (mapconcat - (lambda (x) - (propertize x - 'face 'vc-dir-header-value - 'mouse-face 'highlight - 'invisible t - 'vc-git-hideable t - 'help-echo vc-git-stash-list-help - 'keymap vc-git-stash-map)) - hidden-stashes - (propertize "\n" - 'invisible t - 'vc-git-hideable t)))))))) - (concat - (propertize "Branch : " 'face 'vc-dir-header) - (propertize branch - 'face 'vc-dir-header-value) - (when tracking-branch - (concat - "\n" - (propertize "Tracking : " 'face 'vc-dir-header) - (propertize tracking-branch 'face 'vc-dir-header-value))) - (when remote-url - (concat - "\n" - (propertize "Remote : " 'face 'vc-dir-header) - (propertize remote-url - 'face 'vc-dir-header-value))) - ;; For now just a heading, key bindings can be added later for various bisect actions - (when (memq 'bisect in-progress) - (propertize "\nBisect : in progress" 'face 'vc-dir-status-warning)) - (when (memq 'rebase in-progress) - (propertize "\nRebase : in progress" 'face 'vc-dir-status-warning)) - (if stash-list - (concat - (propertize "\nStash : " 'face 'vc-dir-header) - stash-button - stash-string) - (concat - (propertize "\nStash : " 'face 'vc-dir-header) - (propertize "Nothing stashed" - 'help-echo vc-git-stash-shared-help - 'keymap vc-git-stash-shared-map - 'face 'vc-dir-header-value)))))) + (let ((default-directory dir)) + (string-join + (append + ;; Each helper returns a list of headers. Each header must be a + ;; propertized string with no final newline. + (vc-git-dir--branch-headers) + (vc-git-dir--in-progress-headers) + (vc-git-dir--stash-headers)) + "\n"))) (defun vc-git-branches () "Return the existing branches, as a list of strings. @@ -2246,6 +2248,13 @@ The exit status is ignored." (with-current-buffer standard-output (apply #'vc-git--out-ok command args)))) +(defun vc-git--out-match (args regexp group) + "Run `git ARGS...' and return match for group number GROUP of REGEXP. +Return nil if the output does not match. The exit status is ignored." + (let ((out (apply #'vc-git--out-str args))) + (when (string-match regexp out) + (match-string group out)))) + (defun vc-git--run-command-string (file &rest args) "Run a git command on FILE and return its output as string. FILE can be nil." commit 2f710af5bf303b5d0ed7a7f70e058e1eab281b8d Author: Kévin Le Gouguec Date: Sun Jul 7 12:16:12 2024 +0200 Test more vc-dir scenarios with Git (bug#68183) * test/lisp/vc/vc-git-tests.el (vc-git-test-dir-track-local-branch): Remove in favor of new test. (vc-git-test--start-branch): New helper to get a repository going. (vc-git-test--dir-headers): New helper to get a list of headers in the current vc-dir buffer. (vc-git-test-dir-branch-headers): New test, exercising the original bug recipe plus more common scenarios. diff --git a/test/lisp/vc/vc-git-tests.el b/test/lisp/vc/vc-git-tests.el index f15a0f52e8c..2dbf5a8df12 100644 --- a/test/lisp/vc/vc-git-tests.el +++ b/test/lisp/vc/vc-git-tests.el @@ -26,6 +26,7 @@ (require 'ert-x) (require 'vc) +(require 'vc-dir) (require 'vc-git) (ert-deftest vc-git-test-program-version-general () @@ -108,24 +109,85 @@ allow `git commit' to determine identities for authors and committers." (apply 'vc-git-command t 0 nil args) (buffer-string))) -(ert-deftest vc-git-test-dir-track-local-branch () - "Test that `vc-dir' works when tracking local branches. Bug#68183." +(defun vc-git-test--start-branch () + "Get a branch started in a freshly initialized repository. + +This returns the name of the current branch, so that tests can remain +agnostic of init.defaultbranch." + (write-region "hello" nil "README") + (vc-git-test--run "add" "README") + (vc-git-test--run "commit" "-mFirst") + (string-trim (vc-git-test--run "branch" "--show-current"))) + +(defun vc-git-test--dir-headers (headers) + "Return an alist of header values for the current `vc-dir' buffer. + +HEADERS should be a list of (NAME ...) strings. This function will +return a list of (NAME . VALUE) pairs, where VALUE is nil if the header +is absent." + ;; FIXME: to reproduce interactive sessions faithfully, we would need + ;; to wait for the dir-status-files process to terminate; have not + ;; found a reliable way to do this. As a workaround, kill pending + ;; processes and revert the `vc-dir' buffer. + (vc-dir-kill-dir-status-process) + (revert-buffer) + (mapcar + (lambda (header) + (let* ((pattern + (rx bol + (literal header) (* space) ": " (group (+ nonl)) + eol)) + (value (and (goto-char (point-min)) + (re-search-forward pattern nil t) + (match-string 1)))) + (cons header value))) + headers)) + +(ert-deftest vc-git-test-dir-branch-headers () + "Check that `vc-dir' shows expected branch-related headers." (skip-unless (executable-find vc-git-program)) - (vc-git-test--with-repo repo - ;; Create an initial commit to get a branch started. - (write-region "hello" nil "README") - (vc-git-test--run "add" "README") - (vc-git-test--run "commit" "-mFirst") - ;; Get current branch name lazily, to remain agnostic of - ;; init.defaultbranch. - (let ((upstream-branch - (string-trim (vc-git-test--run "branch" "--show-current")))) - (vc-git-test--run "checkout" "--track" "-b" "hack" upstream-branch) - (vc-dir default-directory) - (pcase-dolist (`(,header ,value) - `(("Branch" "hack") - ("Tracking" ,upstream-branch))) - (goto-char (point-min)) - (re-search-forward (format "^%s *: %s$" header value)))))) + ;; Create a repository that will serve as the "remote". + (vc-git-test--with-repo origin-repo + (let ((main-branch (vc-git-test--start-branch))) + ;; 'git clone' this repository and test things in this clone. + (ert-with-temp-directory clone-repo + (vc-git-test--run "clone" origin-repo clone-repo) + (vc-dir clone-repo) + (should + (equal + (vc-git-test--dir-headers + '("Branch" "Tracking" "Remote")) + `(("Branch" . ,main-branch) + ("Tracking" . ,(concat "origin/" main-branch)) + ("Remote" . ,origin-repo)))) + ;; Checkout a new branch: no tracking information. + (vc-git-test--run "checkout" "-b" "feature/foo" main-branch) + (should + (equal + (vc-git-test--dir-headers + '("Branch" "Tracking" "Remote")) + '(("Branch" . "feature/foo") + ("Tracking" . nil) + ("Remote" . nil)))) + ;; Push with '--set-upstream origin': tracking information + ;; should be updated. + (vc-git-test--run "push" "--set-upstream" "origin" "feature/foo") + (should + (equal + (vc-git-test--dir-headers + '("Branch" "Tracking" "Remote")) + `(("Branch" . "feature/foo") + ("Tracking" . "origin/feature/foo") + ("Remote" . ,origin-repo)))) + ;; Checkout a new branch tracking the _local_ main branch. + ;; Bug#68183. + (vc-git-test--run "checkout" "-b" "feature/bar" "--track" main-branch) + (should + (equal + (vc-git-test--dir-headers + '("Branch" "Tracking" "Remote")) + `(("Branch" . "feature/bar") + ("Tracking" . ,main-branch) + ("Remote" . "none (tracking local branch)")))))))) ;;; vc-git-tests.el ends here commit a2684967270387d2e7ec79de148f04b7f54f2260 Merge: e1ee82f7387 3419e7ea522 Author: Po Lu Date: Tue Aug 20 21:57:25 2024 +0800 Merge from savannah/emacs-30 3419e7ea522 Correct Android failure to open an old CJK font 45ae4de0e7c * lisp/help-fns.el (help-definition-prefixes): Don't dele... fc7581ae2ee ; Fix documentation of secure-hash functions 21be5cadaf1 ; * lisp/subr.el (sha1): Fix typo in docstring. 8715619d485 ; * etc/NEWS: Fix wording of last change. 023d387a7bd Update to Org 9.7.10 b54e8b3741b ; * etc/NEWS: Announce 'shr-fill-text'. acfd91bc0c7 ; * lisp/emacs-lisp/compat.el: Fix header style. 55337dc36a2 * test/infra/gitlab-ci.yml (.tree-sitter-template): Adapt... d8e9eb73c2b Bump use-package version for Emacs 30.1 4d9d3fec1b9 * Makefile.in (CHANGELOG_HISTORY_INDEX_MAX): Bump. 502285e84aa ; * admin/make-tarball.txt: Some clarifications. commit e1ee82f7387fa4e8c2d2bc096eae393298906329 Merge: 43616499016 9e7c2d3816e Author: Po Lu Date: Tue Aug 20 21:57:25 2024 +0800 ; Merge from savannah/emacs-30 The following commit was skipped: 9e7c2d3816e Avoid rare crashes due to clobbering of input events commit 4361649901667b4efe89e560c36f3047634de8ec Merge: 5e940a353e3 d6726e6dfc7 Author: Po Lu Date: Tue Aug 20 21:57:25 2024 +0800 Merge from savannah/emacs-30 d6726e6dfc7 Further fix of reading and writing profiler data 30b2fae77b7 * Makefile.in (PREFERRED_BRANCH): Update to emacs-30. 5397808e5bc ; Eliminate more C++ comments 1463434907e ; Eliminate C++ comments and typo commit 3419e7ea522462c47a5ab4389a879d8b7c14452b Author: Po Lu Date: Tue Aug 20 21:56:41 2024 +0800 Correct Android failure to open an old CJK font * src/sfnt.c (sfnt_read_cmap_format_2): Properly compute subtable count, and append the empty table at position 0. (sfnt_lookup_glyph_2): Update commentary. diff --git a/src/sfnt.c b/src/sfnt.c index 1ed492b7506..02b8a33041c 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -383,15 +383,18 @@ sfnt_read_cmap_format_2 (int fd, for (i = 0; i < 256; ++i) { + /* Values in sub_header_keys are actually offsets from the end of + that array. Since the language of the spec is such as to imply + that they must be divisible by eight, divide them by the + same. */ sfnt_swap16 (&format2->sub_header_keys[i]); if (format2->sub_header_keys[i] > nsub) - nsub = format2->sub_header_keys[i]; + nsub = format2->sub_header_keys[i] / 8; } - if (!nsub) - /* If there are no subheaders, then things are finished. */ - return format2; + /* There always exists a subheader at index zero. */ + nsub ++; /* Otherwise, read the rest of the variable length data to the end of format2. */ @@ -1108,9 +1111,11 @@ sfnt_lookup_glyph_2 (sfnt_char character, && j <= ((int) subheader->first_code + (int) subheader->entry_count)) { - /* id_range_offset is actually the number of bytes past - itself containing the uint16_t ``slice''. It is possibly - unaligned. */ + /* id_range_offset is actually the number of bytes past itself + containing the uint16_t ``slice''. Whether this may be + unaligned is not stated in the specification, but I doubt + it, for that would render values meaningless if the array + were byte swapped when read. */ slice = (unsigned char *) &subheader->id_range_offset; slice += subheader->id_range_offset; slice += (j - subheader->first_code) * sizeof (uint16_t); commit 45ae4de0e7ce99c88c62f940f605bca693b8e33f Author: Stefan Monnier Date: Tue Aug 20 08:09:54 2024 -0400 * lisp/help-fns.el (help-definition-prefixes): Don't delete the hashtable Fixes bug#72511. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1ffe1b16588..c03593bcb69 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -85,14 +85,14 @@ current help buffer.") (defun help-definition-prefixes () "Return the up-to-date radix-tree form of `definition-prefixes'." - (when (> (hash-table-count definition-prefixes) 0) + (when (and (null help-definition-prefixes) + (> (hash-table-count definition-prefixes) 0)) (maphash (lambda (prefix files) (let ((old (radix-tree-lookup help-definition-prefixes prefix))) (setq help-definition-prefixes (radix-tree-insert help-definition-prefixes prefix (append old files))))) - definition-prefixes) - (clrhash definition-prefixes)) + definition-prefixes)) help-definition-prefixes) (defun help--loaded-p (file) commit 5e940a353e37a4867758d13a32928ed18fc437dc Author: Stefan Kangas Date: Tue Aug 20 01:59:55 2024 +0200 ; Fix :version tags diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index e26c3dcd879..2d37a93a7cf 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -119,7 +119,7 @@ nothing at all to happen, even if the rest of the `use-package' declaration is incorrect." :type '(repeat symbol) :group 'use-package - :version "30.1") + :version "31.1") (defcustom use-package-deferring-keywords '(:bind-keymap @@ -225,7 +225,7 @@ attempted." (choice :tag "Default value" sexp function) (choice :tag "Enable if non-nil" sexp function))) :group 'use-package - :version "30.1") + :version "31.1") (defcustom use-package-merge-key-alist '((:if . (lambda (new old) `(and ,new ,old))) commit 8f4ad4d72676e9b721ce83bbd00ac73ad3edf770 Author: Stefan Kangas Date: Tue Aug 20 01:45:57 2024 +0200 Delete defgroup use-package-ensure * lisp/use-package/use-package-core.el (use-package-ensure): Delete defgroup. (use-package-always-ensure, use-package-always-pin) (use-package-ensure-function): Move defcustoms from above deleted defgroup to the 'use-package' defgroup. diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index e5925a294d1..e26c3dcd879 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -65,12 +65,6 @@ :link '(custom-manual "(use-package) Top") :version "29.1") -(defgroup use-package-ensure nil - "Support for :ensure and :pin keywords in `use-package' declarations." - :group 'use-package - :link '(custom-manual "(use-package) Installing packages") - :version "29.1") - (defconst use-package-version "2.4.5" "This version of `use-package'.") @@ -381,14 +375,12 @@ stability issues." "Treat every package as though it had specified using `:ensure SEXP'. See also `use-package-defaults', which uses this value." :type 'sexp - :group 'use-package-ensure :version "29.1") (defcustom use-package-always-pin nil "Treat every package as though it had specified using `:pin SYM'. See also `use-package-defaults', which uses this value." :type 'symbol - :group 'use-package-ensure :version "29.1") (defcustom use-package-ensure-function 'use-package-ensure-elpa @@ -407,7 +399,6 @@ This function should return non-nil if the package is installed. The default value uses package.el to install the package." :type '(choice (const :tag "package.el" use-package-ensure-elpa) (function :tag "Custom")) - :group 'use-package-ensure :version "29.1") (defvar use-package-statistics (make-hash-table)) commit 644d2a8331670cc8068c914d86993a17d0efbc96 Author: Stefan Kangas Date: Sun Aug 18 13:10:19 2024 +0200 Fix early use of use-package-always-ensure * lisp/use-package/use-package-core.el: * lisp/use-package/use-package-delight.el: * lisp/use-package/use-package-diminish.el: * lisp/use-package/use-package-ensure.el: Move add-to-list for 'use-package-keywords' and 'use-package-defaults' from here... * lisp/use-package/use-package-core.el (use-package-ensure) (use-package-keywords): ...to the default definition here. * lisp/use-package/use-package-ensure.el (use-package-ensure): Move this defgroup... (use-package-always-ensure) (use-package-always-pin, use-package-ensure-function): ...and these defcustoms from here... * lisp/use-package/use-package-core.el (use-package-ensure) (use-package-always-ensure, use-package-always-pin) (use-package-ensure-function): ...to here. (Bug#72453) diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 8c3241d5ee0..e5925a294d1 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -65,6 +65,12 @@ :link '(custom-manual "(use-package) Top") :version "29.1") +(defgroup use-package-ensure nil + "Support for :ensure and :pin keywords in `use-package' declarations." + :group 'use-package + :link '(custom-manual "(use-package) Installing packages") + :version "29.1") + (defconst use-package-version "2.4.5" "This version of `use-package'.") @@ -76,6 +82,10 @@ :functions :preface :if :when :unless + :ensure + :pin + :delight + :diminish :vc :no-require :catch @@ -114,7 +124,8 @@ Note that `:disabled' is special in this list, as it causes nothing at all to happen, even if the rest of the `use-package' declaration is incorrect." :type '(repeat symbol) - :group 'use-package) + :group 'use-package + :version "30.1") (defcustom use-package-deferring-keywords '(:bind-keymap @@ -189,7 +200,12 @@ See also `use-package-defaults', which uses this value." (lambda (name args) (and use-package-always-demand (not (plist-member args :defer)) - (not (plist-member args :demand)))))) + (not (plist-member args :demand))))) + (:ensure (list use-package-always-ensure) + (lambda (name args) + (and use-package-always-ensure + (not (plist-member args :load-path))))) + (:pin use-package-always-pin use-package-always-pin)) "Default values for specified `use-package' keywords. Each entry in the alist is a list of three elements: The first element is the `use-package' keyword. @@ -214,7 +230,8 @@ attempted." (list (symbol :tag "Keyword") (choice :tag "Default value" sexp function) (choice :tag "Enable if non-nil" sexp function))) - :group 'use-package) + :group 'use-package + :version "30.1") (defcustom use-package-merge-key-alist '((:if . (lambda (new old) `(and ,new ,old))) @@ -360,6 +377,39 @@ stability issues." :version "30.1" :group 'use-package) +(defcustom use-package-always-ensure nil + "Treat every package as though it had specified using `:ensure SEXP'. +See also `use-package-defaults', which uses this value." + :type 'sexp + :group 'use-package-ensure + :version "29.1") + +(defcustom use-package-always-pin nil + "Treat every package as though it had specified using `:pin SYM'. +See also `use-package-defaults', which uses this value." + :type 'symbol + :group 'use-package-ensure + :version "29.1") + +(defcustom use-package-ensure-function 'use-package-ensure-elpa + "Function that ensures a package is installed. +This function is called with three arguments: the name of the +package declared in the `use-package' form; the arguments passed +to all `:ensure' keywords (always a list, even if only one); and +the current `state' plist created by previous handlers. + +Note that this function is called whenever `:ensure' is provided, +even if it is nil. It is up to the function to decide on the +semantics of the various values for `:ensure'. + +This function should return non-nil if the package is installed. + +The default value uses package.el to install the package." + :type '(choice (const :tag "package.el" use-package-ensure-elpa) + (function :tag "Custom")) + :group 'use-package-ensure + :version "29.1") + (defvar use-package-statistics (make-hash-table)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/use-package/use-package-delight.el b/lisp/use-package/use-package-delight.el index c458d263cf0..c67e2aa6320 100644 --- a/lisp/use-package/use-package-delight.el +++ b/lisp/use-package/use-package-delight.el @@ -81,8 +81,6 @@ `((if (fboundp 'delight) (delight '(,@args))))))) -(add-to-list 'use-package-keywords :delight t) - (provide 'use-package-delight) ;;; use-package-delight.el ends here diff --git a/lisp/use-package/use-package-diminish.el b/lisp/use-package/use-package-diminish.el index 79421a0e273..0be2ba688a0 100644 --- a/lisp/use-package/use-package-diminish.el +++ b/lisp/use-package/use-package-diminish.el @@ -70,8 +70,6 @@ arg) body))) -(add-to-list 'use-package-keywords :diminish t) - (provide 'use-package-diminish) ;;; use-package-diminish.el ends here diff --git a/lisp/use-package/use-package-ensure.el b/lisp/use-package/use-package-ensure.el index 5f75b6b59ea..82ab3256ef0 100644 --- a/lisp/use-package/use-package-ensure.el +++ b/lisp/use-package/use-package-ensure.el @@ -32,46 +32,10 @@ (require 'cl-lib) (require 'use-package-core) -(defgroup use-package-ensure nil - "Support for :ensure and :pin keywords in `use-package' declarations." - :group 'use-package - :link '(custom-manual "(use-package) Installing packages") - :version "29.1") - (eval-when-compile (declare-function package-installed-p "package") (declare-function package-read-all-archive-contents "package" ())) -(defcustom use-package-always-ensure nil - "Treat every package as though it had specified using `:ensure SEXP'. -See also `use-package-defaults', which uses this value." - :type 'sexp - :group 'use-package-ensure) - -(defcustom use-package-always-pin nil - "Treat every package as though it had specified using `:pin SYM'. -See also `use-package-defaults', which uses this value." - :type 'symbol - :group 'use-package-ensure) - -(defcustom use-package-ensure-function 'use-package-ensure-elpa - "Function that ensures a package is installed. -This function is called with three arguments: the name of the -package declared in the `use-package' form; the arguments passed -to all `:ensure' keywords (always a list, even if only one); and -the current `state' plist created by previous handlers. - -Note that this function is called whenever `:ensure' is provided, -even if it is nil. It is up to the function to decide on the -semantics of the various values for `:ensure'. - -This function should return non-nil if the package is installed. - -The default value uses package.el to install the package." - :type '(choice (const :tag "package.el" use-package-ensure-elpa) - (function :tag "Custom")) - :group 'use-package-ensure) - ;;;; :pin (defun use-package-normalize/:pin (_name keyword args) @@ -196,18 +160,6 @@ manually updated package." body)) body)) -(add-to-list 'use-package-defaults - '(:ensure (list use-package-always-ensure) - (lambda (name args) - (and use-package-always-ensure - (not (plist-member args :load-path))))) t) - -(add-to-list 'use-package-defaults - '(:pin use-package-always-pin use-package-always-pin) t) - -(add-to-list 'use-package-keywords :ensure) -(add-to-list 'use-package-keywords :pin) - (provide 'use-package-ensure) ;;; use-package-ensure.el ends here commit bcfab1e88b7b559c7ba79ef526529ef7622c8138 Author: Stefan Kangas Date: Tue Aug 20 01:40:26 2024 +0200 Mark tex-dvi-view-command as :risky * lisp/textmodes/tex-mode.el (tex-dvi-view-command): Mark as :risky. diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 97c950267c6..4bc2c840cdb 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -210,6 +210,7 @@ otherwise, the file name, preceded by a space, is added at the end. If the value is a form, it is evaluated to get the command to use." :type '(choice (const nil) string sexp) + :risky t :group 'tex-view) ;;;###autoload commit 845d22652d08f998863134334f7de617c50a10b2 Author: Paul Eggert Date: Mon Aug 19 11:44:44 2024 -0700 Remove stray obsolete comment about ‘volatile’ * src/lisp.h: Remove comment about ‘volatile’ that was mistakenly left behind when 2013-10-03T04:58:56!monnier@iro.umontreal.ca (adf2aa61404305e58e71cde0193bb650aff2c4b3) removed all the volatile members of struct handler. diff --git a/src/lisp.h b/src/lisp.h index c8c6854f5f5..8921244315d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3851,9 +3851,6 @@ record_in_backtrace (Lisp_Object function, Lisp_Object *args, ptrdiff_t nargs) All the other members are concerned with restoring the interpreter state. - Members are volatile if their values need to survive _longjmp when - a 'struct handler' is a local variable. - When running the HANDLER of a 'handler-bind', we need to temporarily "mute" the CONDITION_CASEs and HANDLERs that are "below" the current handler, but without hiding any CATCHERs. We do that by commit 60da504cf7ca2c95ab4e3bea10875271b15a5a45 Author: Juri Linkov Date: Mon Aug 19 19:56:31 2024 +0300 * lisp/tab-bar.el: Improve tab-bar-auto-width-predicate-default (bug#71883). (tab-bar--auto-width-faces-default): New variable with the value from the default value of tab-bar-auto-width-faces. (tab-bar-auto-width-faces): Set the default value to tab-bar--auto-width-faces-default. (tab-bar-auto-width-predicate-default): For backwards-compatibility use the old logic of checking tab-bar-auto-width-faces when its value was changed. Otherwise, check for a symbol, but remove "current-group" from the list of symbols. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 6133915b591..734058175cf 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1238,18 +1238,24 @@ which see. It's not recommended to change this value since with larger values, the tab bar might wrap to the second line when it shouldn't.") -(defvar tab-bar-auto-width-faces +(defconst tab-bar--auto-width-faces-default '( tab-bar-tab tab-bar-tab-inactive tab-bar-tab-ungrouped - tab-bar-tab-group-inactive) + tab-bar-tab-group-inactive)) + +(defvar tab-bar-auto-width-faces + tab-bar--auto-width-faces-default "Resize tabs only with these faces.") (defun tab-bar-auto-width-predicate-default (item) "Accepts tab ITEM and returns non-nil for tabs and tab groups." - (string-match-p - ;; (rx bos (or "current-tab" "current-group" "tab-" "group-")) - "\\`\\(?:current-\\(?:group\\|tab\\)\\|\\(?:group\\|tab\\)-\\)" - (symbol-name (nth 0 item)))) + (if (eq tab-bar-auto-width-faces tab-bar--auto-width-faces-default) + (string-match-p + ;; (rx bos (or "current-tab" "tab-" "group-")) + "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)" + (symbol-name (nth 0 item))) + (memq (get-text-property 0 'face (nth 2 item)) + tab-bar-auto-width-faces))) (defvar tab-bar-auto-width-functions '(tab-bar-auto-width-predicate-default) "List of functions for `tab-bar-auto-width' to call with a tab ITEM. commit 9ed761a793f0f11ffea1d2cfa9b7ff38a58d3fe1 Author: Joseph Turner Date: Mon Jul 15 21:55:35 2024 -0700 Add abnormal hook to determine which tabs to auto-widen * lisp/tab-bar.el (tab-bar-auto-width-predicate-default): Default value for tab-bar-auto-width-functions. (tab-bar-auto-width-functions): New abnormal hook. (tab-bar-auto-width): Run new abnormal hook until success instead of comparing text properties. diff --git a/etc/NEWS b/etc/NEWS index de1d92764f0..2ddbab29528 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -74,6 +74,12 @@ that the actual killing or burying of the buffer is done by the caller. With this option set, 'quit-restore-window' will delete its window more aggressively rather than switching to some other buffer in it. +** Tab Bars and Tab Lines + +--- +*** New abnormal hook 'tab-bar-auto-width-functions'. +This hook allows you to control which tab-bar tabs are auto-resized. + * Editing Changes in Emacs 31.1 diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 8164ec51498..6133915b591 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1244,6 +1244,18 @@ tab bar might wrap to the second line when it shouldn't.") tab-bar-tab-group-inactive) "Resize tabs only with these faces.") +(defun tab-bar-auto-width-predicate-default (item) + "Accepts tab ITEM and returns non-nil for tabs and tab groups." + (string-match-p + ;; (rx bos (or "current-tab" "current-group" "tab-" "group-")) + "\\`\\(?:current-\\(?:group\\|tab\\)\\|\\(?:group\\|tab\\)-\\)" + (symbol-name (nth 0 item)))) + +(defvar tab-bar-auto-width-functions '(tab-bar-auto-width-predicate-default) + "List of functions for `tab-bar-auto-width' to call with a tab ITEM. +If any of these functions returns non-nil for a given tab ITEM, that +tab's width will be auto-sized.") + (defvar tab-bar--auto-width-hash nil "Memoization table for `tab-bar-auto-width'.") @@ -1272,8 +1284,7 @@ be scaled for display on the current frame." (width 0)) ;; resize tab names to this width (dolist (item items) (when (and (eq (nth 1 item) 'menu-item) (stringp (nth 2 item))) - (if (memq (get-text-property 0 'face (nth 2 item)) - tab-bar-auto-width-faces) + (if (run-hook-with-args-until-success 'tab-bar-auto-width-functions item) (push item tabs) (unless (eq (nth 0 item) 'align-right) (setq non-tabs (concat non-tabs (nth 2 item))))))) commit fc7581ae2ee9db1e3189b76c66be9cd13f72f004 Author: Eli Zaretskii Date: Mon Aug 19 17:51:50 2024 +0300 ; Fix documentation of secure-hash functions * src/fns.c (Fsecure_hash): * doc/lispref/text.texi (Checksum/Hash): * lisp/subr.el (sha1): Fix documentation wrt to the number of bytes 'secure-hash' and its variants return when BINARY is non-nil. Reported by Pip Cet . diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 196fe89a092..278b53d7f65 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -4992,22 +4992,22 @@ of the returned string depends on @var{algorithm}: @itemize @item -For @code{md5}: 32 characters (32 bytes if @var{binary} is +For @code{md5}: 32 characters (16 bytes if @var{binary} is non-@code{nil}). @item -For @code{sha1}: 40 characters (40 bytes if @var{binary} is +For @code{sha1}: 40 characters (20 bytes if @var{binary} is non-@code{nil}). @item -For @code{sha224}: 56 characters (56 bytes if @var{binary} is +For @code{sha224}: 56 characters (28 bytes if @var{binary} is non-@code{nil}). @item -For @code{sha256}: 64 characters (64 bytes if @var{binary} is +For @code{sha256}: 64 characters (32 bytes if @var{binary} is non-@code{nil}). @item -For @code{sha384}: 96 characters (96 bytes if @var{binary} is +For @code{sha384}: 96 characters (48 bytes if @var{binary} is non-@code{nil}). @item -For @code{sha512}: 128 characters (128 bytes if @var{binary} is +For @code{sha512}: 128 characters (64 bytes if @var{binary} is non-@code{nil}). @end itemize @@ -5062,7 +5062,7 @@ This function is equivalent to calling @code{secure-hash} like this: @end lisp It returns a 40-character string if @var{binary} is @code{nil}, or a -40-byte unibyte string otherwise. +20-byte unibyte string otherwise. @end defun @node Suspicious Text diff --git a/lisp/subr.el b/lisp/subr.el index a8e3df14cd3..28ba30f584e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4481,7 +4481,7 @@ Otherwise, return nil." "Return the SHA-1 (Secure Hash Algorithm) of an OBJECT. OBJECT is either a string or a buffer. Optional arguments START and END are character positions specifying which portion of OBJECT for -computing the hash. If BINARY is non-nil, return a 40-byte unibyte +computing the hash. If BINARY is non-nil, return a 20-byte unibyte string; otherwise return a 40-character string. Note that SHA-1 is not collision resistant and should not be used diff --git a/src/fns.c b/src/fns.c index cb3e25811ea..6133c20573a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -6402,7 +6402,9 @@ whole OBJECT. The full list of algorithms can be obtained with `secure-hash-algorithms'. -If BINARY is non-nil, returns a string in binary form. +If BINARY is non-nil, returns a string in binary form. In this case, +the function returns a unibyte string whose length is half the number +of characters it returns when BINARY is nil. Note that MD5 and SHA-1 are not collision resistant and should not be used for anything security-related. For these applications, use one commit 21be5cadaf1e43cf886f38cb14fa25b96d8b551d Author: Ulrich Müller Date: Mon Aug 19 15:49:47 2024 +0200 ; * lisp/subr.el (sha1): Fix typo in docstring. diff --git a/lisp/subr.el b/lisp/subr.el index 31c53a6455b..a8e3df14cd3 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4482,7 +4482,7 @@ Otherwise, return nil." OBJECT is either a string or a buffer. Optional arguments START and END are character positions specifying which portion of OBJECT for computing the hash. If BINARY is non-nil, return a 40-byte unibyte -string; otherwise returna 40-character string. +string; otherwise return a 40-character string. Note that SHA-1 is not collision resistant and should not be used for anything security-related. See `secure-hash' for commit 8715619d485d9da0f7bb056bf390d2f45d4d806c Author: Michael Albinus Date: Mon Aug 19 09:37:55 2024 +0200 ; * etc/NEWS: Fix wording of last change. diff --git a/etc/NEWS b/etc/NEWS index a75d1b44b90..98eca7b8061 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1409,7 +1409,7 @@ for setting the remote 'PATH' environment variable. ** SHR --- -*** New option 'shr-fill-text'. +*** New user option 'shr-fill-text'. When 'shr-fill-text' is non-nil (the default), SHR will fill text according to the width of the window. If you customize it to nil, SHR will leave the text as-is; in that case, EWW will automatically enable commit 023d387a7bd41298a5c294ce163a49ba55b31ef5 Author: Kyle Meyer Date: Sun Aug 18 20:54:39 2024 -0400 Update to Org 9.7.10 diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index b112e957d1d..65e9caa26d2 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.7.9} +\def\orgversionnumber{9.7.10} \def\versionyear{2024} % latest update \input emacsver.tex diff --git a/lisp/org/org-persist.el b/lisp/org/org-persist.el index 8b0d9b110f9..7fa836d0d7a 100644 --- a/lisp/org/org-persist.el +++ b/lisp/org/org-persist.el @@ -448,6 +448,8 @@ FORMAT and ARGS are passed to `message'." buffer-or-file (error-message-string err))) nil))))) +;; FIXME: `pp' is very slow when writing even moderately large datasets +;; We should probably drop it or find some fast formatter. (defun org-persist--write-elisp-file (file data &optional no-circular pp) "Write elisp DATA to FILE." ;; Fsync slightly reduces the chance of an incomplete filesystem @@ -898,7 +900,7 @@ Otherwise, return t." (let ((index-file (org-file-name-concat org-persist-directory org-persist-index-file))) (org-persist--merge-index-with-disk) - (org-persist--write-elisp-file index-file org-persist--index t t) + (org-persist--write-elisp-file index-file org-persist--index t) (setq org-persist--index-age (file-attribute-modification-time (file-attributes index-file))) index-file))) diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index d5a434e805d..989fadf69fa 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.7.9")) + (let ((org-release "9.7.10")) 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.7.9")) + (let ((org-git-version "release_9.7.10")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 0b3566121d9..26812bbfb29 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.7.9 +;; Version: 9.7.10 ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el index d1687cf5a80..446698758c4 100644 --- a/lisp/org/ox-html.el +++ b/lisp/org/ox-html.el @@ -2351,7 +2351,7 @@ is the language used for CODE, as a string, or nil." ((not (progn (require 'htmlize nil t) (fboundp 'htmlize-region-for-paste))) ;; Emit a warning. - (warn "Cannot fontify source block (htmlize.el >= 1.34 required)") + (warn "Cannot fontify source block (htmlize.el >= 1.34 required). Falling back to plain text. (see `org-html-htmlize-output-type')") (org-html-encode-plain-text code)) (t ;; Map language diff --git a/lisp/org/ox.el b/lisp/org/ox.el index 75839e6c88a..1024bdc4bae 100644 --- a/lisp/org/ox.el +++ b/lisp/org/ox.el @@ -81,6 +81,7 @@ (require 'ol) (require 'org-element) (require 'org-macro) +(require 'org-attach) ; org-attach adds staff to `org-export-before-parsing-functions' (require 'tabulated-list) (declare-function org-src-coderef-format "org-src" (&optional element)) commit a876c4d7a17df152e3e78800c76ddf158f632ee5 Author: Jim Porter Date: Sun Aug 4 19:37:00 2024 -0700 Improve SHR/EWW support for 'visual-wrap-prefix-mode' * lisp/visual-wrap.el (visual-wrap--apply-to-line): Use 'add-display-text-property' so we don't clobber other display properties. (visual-wrap--content-prefix): Remove special-case for spaces-only indent prefix; this was an attempt to be helpful for variable-pitch fonts, but in practice just interferes with matters. This case now falls back to the one immediately following it (return the string of spaces). Use 'string-pixel-width' instead of 'string-width'. * lisp/net/shr.el (shr-indent): Set 'shr-prefix-length' here to help keep track of the prefixes of nestedly-indented elements. Set the specified space width in terms of the default width of the current face. * lisp/net/shr.el (shr-adaptive-fill-function): Use 'shr-prefix-length' as set above to return a fill prefix. * lisp/net/eww.el (eww-render): Enable 'visual-wrap-prefix-mode' alongside of 'visual-line-mode'. (eww-mode): Set 'adaptive-fill-function' to 'shr-adaptive-fill-function'. * etc/NEWS: Announce this change (bug#72485). diff --git a/etc/NEWS b/etc/NEWS index 8cd21f5fb74..de1d92764f0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -144,6 +144,17 @@ Advanced" node in the EWW manual. By customizing 'shr-image-zoom-levels', you can change the list of zoom levels that SHR cycles through when calling 'shr-zoom-image'. +** EWW + +--- +*** EWW now enables 'visual-wrap-prefix-mode' when 'shr-fill-text' is nil. +By default, 'shr-fill-text' is t, and EWW fills the text according to +the width of the window. If you customize 'shr-fill-text' to nil, EWW +will now automatically turn on 'visual-wrap-prefix-mode' in addition to +'visual-line-mode', so that long lines are wrapped at word boundaries +near window edge and the continuation lines are indented using prefixes +computed from surrounding context. + ** Go-ts mode +++ diff --git a/lisp/net/eww.el b/lisp/net/eww.el index b2e1c5a72e5..b5d2f20781a 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -709,7 +709,8 @@ The renaming scheme is performed in accordance with (and last-coding-system-used (set-buffer-file-coding-system last-coding-system-used)) (unless shr-fill-text - (visual-line-mode)) + (visual-line-mode) + (visual-wrap-prefix-mode)) (run-hooks 'eww-after-render-hook) ;; Enable undo again so that undo works in text input ;; boxes. @@ -1336,6 +1337,8 @@ within text input fields." ;; desktop support (setq-local desktop-save-buffer #'eww-desktop-misc-data) (setq truncate-lines t) + ;; visual-wrap-prefix-mode support + (setq-local adaptive-fill-function #'shr-adaptive-fill-function) ;; thingatpt support (setq-local thing-at-point-provider-alist (cons '(url . eww--url-at-point) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index d3c48b34428..b9ac9f0c8c0 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -938,6 +938,11 @@ When `shr-fill-text' is nil, only indent." (when (looking-at " $") (delete-region (point) (line-end-position))))))) +(defun shr-adaptive-fill-function () + "Return a fill prefix for the paragraph at point." + (when-let ((prefix (get-text-property (point) 'shr-prefix-length))) + (buffer-substring (point) (+ (point) prefix)))) + (defun shr-parse-base (url) ;; Always chop off anchors. (when (string-match "#.*" url) @@ -1041,11 +1046,24 @@ When `shr-fill-text' is nil, only indent." (defun shr-indent () (when (> shr-indentation 0) - (if (not shr-use-fonts) - (insert-char ?\s shr-indentation) - (insert ?\s) - (put-text-property (1- (point)) (point) - 'display `(space :width (,shr-indentation)))))) + (let ((start (point)) + (prefix (or (get-text-property (point) 'shr-prefix-length) 0))) + (if (not shr-use-fonts) + (insert-char ?\s shr-indentation) + (insert ?\s) + (put-text-property + (1- (point)) (point) 'display + ;; Set the specified space width in terms of the default width + ;; of the current face, like (N . width). That way, the + ;; indentation is calculated correctly when using + ;; `text-scale-adjust'. + `(space :width (,(if-let ((font (font-at (1- (point)))) + (info (query-font font))) + (/ (float shr-indentation) (aref info 7)) + shr-indentation) + . width)))) + (put-text-property start (+ (point) prefix) + 'shr-prefix-length (+ prefix (- (point) start)))))) (defun shr-fontize-dom (dom &rest types) (let ((start (point))) diff --git a/lisp/visual-wrap.el b/lisp/visual-wrap.el index 16d330c2a93..902a9e41c5e 100644 --- a/lisp/visual-wrap.el +++ b/lisp/visual-wrap.el @@ -126,10 +126,10 @@ extra indent = 2 ;; of the line though! (`fill-match-adaptive-prefix' could ;; potentially return a prefix longer than the current line in ;; the buffer.) - (put-text-property + (add-display-text-property position (min (+ position (length first-line-prefix)) (line-end-position)) - 'display `(min-width ((,next-line-prefix . width))))) + 'min-width `((,next-line-prefix . width)))) (setq next-line-prefix (visual-wrap--adjust-prefix next-line-prefix)) (put-text-property position (line-end-position) 'wrap-prefix @@ -147,12 +147,6 @@ PREFIX was empty." (cond ((string= prefix "") nil) - ((string-match (rx bos (+ blank) eos) prefix) - ;; If the first-line prefix is all spaces, return its width in - ;; characters. This way, we can set the prefix for all lines to use - ;; the canonical-width of the font, which helps for variable-pitch - ;; fonts where space characters are usually quite narrow. - (string-width prefix)) ((or (and adaptive-fill-first-line-regexp (string-match adaptive-fill-first-line-regexp prefix)) (and comment-start-skip @@ -175,7 +169,11 @@ PREFIX was empty." (max (string-width prefix) (ceiling (string-pixel-width prefix (current-buffer)) (aref info 7))) - (string-width prefix))))) + ;; We couldn't get the font, so we're in a terminal and + ;; `string-pixel-width' is really returning the number of columns. + ;; (This is different from `string-width', since that doesn't + ;; respect specified spaces.) + (string-pixel-width prefix))))) (defun visual-wrap-fill-context-prefix (beg end) "Compute visual wrap prefix from text between BEG and END. commit b54e8b3741bed4d81bd8840c5f6904f605f5f9fa Author: Jim Porter Date: Sun Aug 18 14:33:43 2024 -0700 ; * etc/NEWS: Announce 'shr-fill-text'. diff --git a/etc/NEWS b/etc/NEWS index 90e3a42beb1..a75d1b44b90 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1406,6 +1406,16 @@ manual "(tramp) Improving performance of asynchronous remote processes". When a direct asynchronous process is invoked, it uses 'tramp-remote-path' for setting the remote 'PATH' environment variable. +** SHR + +--- +*** New option 'shr-fill-text'. +When 'shr-fill-text' is non-nil (the default), SHR will fill text +according to the width of the window. If you customize it to nil, SHR +will leave the text as-is; in that case, EWW will automatically enable +'visual-line-mode' when displaying a page so that long lines are +visually wrapped at word boundaries. + ** EWW --- commit acfd91bc0c73c540c76672a86a85b5b551601c06 Author: Andrea Corallo Date: Sun Aug 18 11:12:08 2024 +0200 ; * lisp/emacs-lisp/compat.el: Fix header style. diff --git a/lisp/emacs-lisp/compat.el b/lisp/emacs-lisp/compat.el index f7037dc4101..7f95702286a 100644 --- a/lisp/emacs-lisp/compat.el +++ b/lisp/emacs-lisp/compat.el @@ -2,13 +2,11 @@ ;; Copyright (C) 2021-2024 Free Software Foundation, Inc. -;; Author: \ -;; Philip Kaludercic , \ -;; Daniel Mendler -;; Maintainer: \ -;; Daniel Mendler , \ -;; Compat Development <~pkal/compat-devel@lists.sr.ht>, -;; emacs-devel@gnu.org +;; Author: Philip Kaludercic , +;; Daniel Mendler +;; Maintainers: Daniel Mendler , +;; Compat Development <~pkal/compat-devel@lists.sr.ht>, +;; emacs-devel@gnu.org ;; URL: https://github.com/emacs-compat/compat ;; Keywords: lisp, maint commit 55337dc36a20ea3dc805116411cf436551bc3566 Author: Michael Albinus Date: Sun Aug 18 11:29:05 2024 +0200 * test/infra/gitlab-ci.yml (.tree-sitter-template): Adapt changes. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 24bb179af54..e16dcd54a45 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -192,10 +192,13 @@ default: - lisp/textmodes/*-ts-mode.el - src/treesit.{h,c} - test/infra/* + - test/lisp/align-resources/** - test/lisp/align-tests.el - test/lisp/progmodes/*-ts-mode-resources/** - test/lisp/progmodes/*-ts-mode-tests.el + - test/lisp/progmodes/csharp-mode-resources/** - test/lisp/progmodes/csharp-mode-tests.el + - test/lisp/progmodes/js-resources/** - test/lisp/progmodes/js-tests.el - test/lisp/progmodes/python-tests.el - test/lisp/textmodes/*-ts-mode-resources/** commit d8e9eb73c2b5f93adf3ae29d1349ce2161e23cb4 Author: Stefan Kangas Date: Sun Aug 18 11:18:04 2024 +0200 Bump use-package version for Emacs 30.1 * lisp/use-package/use-package.el: Bump version to 2.4.6. diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index fc5c994a5f9..fd2496651df 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -5,7 +5,7 @@ ;; Author: John Wiegley ;; Maintainer: John Wiegley ;; Created: 17 Jun 2012 -;; Version: 2.4.5 +;; Version: 2.4.6 ;; Package-Requires: ((emacs "24.3") (bind-key "2.4")) ;; Keywords: dotemacs startup speed config package extensions ;; URL: https://github.com/jwiegley/use-package commit 754d83d981f7ba28a05b5ce37307ead4596ec95f Author: Eli Zaretskii Date: Sun Aug 18 11:59:28 2024 +0300 Fix finding tags by 'etags' in Java source code * lib-src/etags.c (C_entries): A comma is not special inside class parameters <..>. (Bug#72402) (hash, in_word_set): Regenerated after adding "@SuppressWarnings" to wordlist[]. This avoids missing tags preceded by "@SuppressWarnings". diff --git a/lib-src/etags.c b/lib-src/etags.c index edadbc25901..4684ca82935 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -2633,6 +2633,7 @@ SYSCALL, 0, st_C_gnumacro ENTRY, 0, st_C_gnumacro PSEUDO, 0, st_C_gnumacro ENUM_BF, 0, st_C_enum_bf +@SuppressWarnings, (C_JAVA & ~C_PLPL), st_C_attribute # These are defined inside C functions, so currently they are not met. # EXFUN used in glibc, DEFVAR_* in emacs. #EXFUN, 0, st_C_gnumacro @@ -2644,44 +2645,44 @@ and replace lines between %< and %> with its output, then: - make in_word_set static and not inline - remove any 'register' qualifications from variable decls. */ /*%<*/ -/* C code produced by gperf version 3.0.1 */ -/* Command-line: gperf -m 5 */ +/* ANSI-C code produced by gperf version 3.1 */ +/* Command-line: gperf -m 5 gperf.inp */ /* Computed positions: -k'2-3' */ struct C_stab_entry { const char *name; int c_ext; enum sym_type type; }; -/* maximum key range = 34, duplicates = 0 */ +/* maximum key range = 36, duplicates = 0 */ static int hash (const char *str, int len) { static char const asso_values[] = { - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 3, - 27, 36, 36, 36, 36, 36, 36, 36, 26, 36, - 36, 36, 36, 25, 0, 0, 36, 36, 36, 0, - 36, 36, 36, 36, 36, 1, 36, 16, 36, 6, - 23, 0, 0, 36, 22, 0, 36, 36, 5, 0, - 0, 15, 1, 36, 6, 36, 8, 19, 36, 16, - 4, 5, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36 + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 29, + 3, 38, 38, 38, 38, 38, 38, 38, 23, 38, + 38, 38, 38, 0, 5, 4, 38, 38, 38, 24, + 38, 38, 38, 38, 38, 1, 38, 16, 38, 6, + 23, 0, 0, 38, 22, 0, 38, 38, 5, 0, + 0, 15, 1, 38, 6, 38, 8, 19, 38, 16, + 4, 5, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38 }; int hval = len; @@ -2702,18 +2703,18 @@ in_word_set (const char *str, ptrdiff_t len) { enum { - TOTAL_KEYWORDS = 34, + TOTAL_KEYWORDS = 35, MIN_WORD_LENGTH = 2, - MAX_WORD_LENGTH = 15, + MAX_WORD_LENGTH = 17, MIN_HASH_VALUE = 2, - MAX_HASH_VALUE = 35 + MAX_HASH_VALUE = 37 }; static struct C_stab_entry wordlist[] = { {""}, {""}, {"if", 0, st_C_ignore}, - {"GTY", 0, st_C_attribute}, + {""}, {"@end", 0, st_C_objend}, {"union", 0, st_C_struct}, {"define", 0, st_C_define}, @@ -2741,10 +2742,12 @@ in_word_set (const char *str, ptrdiff_t len) {"undef", 0, st_C_define}, {"package", (C_JAVA & ~C_PLPL), st_C_ignore}, {"__attribute__", 0, st_C_attribute}, - {"ENTRY", 0, st_C_gnumacro}, {"SYSCALL", 0, st_C_gnumacro}, + {"GTY", 0, st_C_attribute}, + {"ENTRY", 0, st_C_gnumacro}, {"ENUM_BF", 0, st_C_enum_bf}, {"PSEUDO", 0, st_C_gnumacro}, + {"@SuppressWarnings", (C_JAVA & ~C_PLPL), st_C_attribute}, {"DEFUN", 0, st_C_gnumacro} }; @@ -3012,7 +3015,6 @@ consider_token (char *str, /* IN: token pointer */ static ptrdiff_t structbracelev; static enum sym_type toktype; - toktype = C_symtype (str, len, *c_extp); /* @@ -4016,7 +4018,9 @@ C_entries (int c_ext, /* extension of C */ default: fvdef = fvnone; } - if (structdef == stagseen) + if (structdef == stagseen + /* class Foo... */ + && !(cjava && templatelev > 0)) structdef = snone; break; case ']': commit 4d9d3fec1b93698cc6dc014246fa6d3f5b4bb717 Author: Andrea Corallo Date: Sat Aug 17 18:42:43 2024 +0200 * Makefile.in (CHANGELOG_HISTORY_INDEX_MAX): Bump. diff --git a/Makefile.in b/Makefile.in index 1964fbbf8a9..7a20b0f24d7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1303,7 +1303,7 @@ emacslog = build-aux/gitlog-to-emacslog # The ChangeLog history files are called ChangeLog.1, ChangeLog.2, ..., # ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX). $(CHANGELOG_N) stands for # the newest (highest-numbered) ChangeLog history file. -CHANGELOG_HISTORY_INDEX_MAX = 3 +CHANGELOG_HISTORY_INDEX_MAX = 4 CHANGELOG_N = ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX) # Convert git commit log to ChangeLog file. make-dist uses this. commit 502285e84aaac4b6939d5f4e27351dd0e01498ed Author: Eli Zaretskii Date: Sun Aug 18 07:56:57 2024 +0300 ; * admin/make-tarball.txt: Some clarifications. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 15342319829..1b6d9744ecc 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -95,11 +95,14 @@ General steps (for each step, check for possible errors): CHANGELOG_HISTORY_INDEX_MAX = N by incrementing the value of N by 1; then regenerate Makefile. - After bumping N, you need to actually create and commit - ChangeLog.N with the updated N, otherwise "M-x authors" below will - fail. The easiest way of creating the new ChangeLog.N is to - rename the file ChangeLog (without the .N suffix) left over from - the last major release (it is usually unversioned) and commit it. + After bumping N, you need to actually create and commit ChangeLog.N + with the updated N, otherwise "M-x authors" below will fail. The + easiest way of creating the new ChangeLog.N is to rename the file + ChangeLog (without the .N suffix) left over from the last release + (it is usually unversioned) and commit it, together with the + modified Makefile.in. If you don't have the unversioned ChangeLog + file from the last release, you can take it from the release + tarball. Now: commit 135da3556bb34bb20a01e02b30bc949c1a45b6cd Author: Jim Porter Date: Sat Aug 17 13:21:00 2024 -0700 Be more careful about aligning prefix lines in 'visual-wrap-prefix-mode' * lisp/visual-wrap.el (visual-wrap--apply-to-line): Ensure we don't apply the 'min-width' property across multiple lines (bug#72681). diff --git a/lisp/visual-wrap.el b/lisp/visual-wrap.el index cac3bc767b8..16d330c2a93 100644 --- a/lisp/visual-wrap.el +++ b/lisp/visual-wrap.el @@ -121,9 +121,15 @@ extra indent = 2 (next-line-prefix (visual-wrap--content-prefix first-line-prefix position))) (when (numberp next-line-prefix) + ;; Set a minimum width for the prefix so it lines up correctly + ;; with subsequent lines. Make sure not to do this past the end + ;; of the line though! (`fill-match-adaptive-prefix' could + ;; potentially return a prefix longer than the current line in + ;; the buffer.) (put-text-property - position (+ position (length first-line-prefix)) 'display - `(min-width ((,next-line-prefix . width))))) + position (min (+ position (length first-line-prefix)) + (line-end-position)) + 'display `(min-width ((,next-line-prefix . width))))) (setq next-line-prefix (visual-wrap--adjust-prefix next-line-prefix)) (put-text-property position (line-end-position) 'wrap-prefix commit 9e7c2d3816ec3e1247b1bd3cfcafc60a84b0f5ec Author: Eli Zaretskii Date: Sat Aug 17 21:35:08 2024 +0300 Avoid rare crashes due to clobbering of input events * src/keyboard.c (read_char): Declare C 'volatile', to prevent clobbering it by setjmp/longjmp. Do not merge to master. (Bug#71744) diff --git a/src/keyboard.c b/src/keyboard.c index c75e80d2a05..e7b0af9f63c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2522,7 +2522,7 @@ read_char (int commandflag, Lisp_Object map, Lisp_Object prev_event, bool *used_mouse_menu, struct timespec *end_time) { - Lisp_Object c; + volatile Lisp_Object c; sys_jmp_buf local_getcjmp; sys_jmp_buf save_jump; Lisp_Object tem, save; commit 4f1987cf77bc8e0f0180a665b3cab732021e25ab Author: Paul Eggert Date: Sat Aug 17 11:09:17 2024 -0700 Pacify GCC 14 on recent read_char change * src/keyboard.c (read_char): Initialize c_volatile before calling setjmp. Although not necessary for correctness, and not needed for gcc 14.2.1 20240801 (Red Hat 14.2.1-1) on x86-64 when built with --enable-gcc-warnings, some GCC 14 x86-64 configurations issue a false positive without this change. Problem reported by Andrea Corallo in: https://lists.gnu.org/r/emacs-devel/2024-08/msg00620.html and fix suggested by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2024-08/msg00627.html diff --git a/src/keyboard.c b/src/keyboard.c index 0d3506bc59b..0992fab653b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2752,7 +2752,7 @@ read_char (int commandflag, Lisp_Object map, it *must not* be in effect when we call redisplay. */ specpdl_ref jmpcount = SPECPDL_INDEX (); - Lisp_Object volatile c_volatile; + Lisp_Object volatile c_volatile = c; if (sys_setjmp (local_getcjmp)) { c = c_volatile; @@ -2800,7 +2800,6 @@ read_char (int commandflag, Lisp_Object map, goto non_reread; } - c_volatile = c; #if GCC_LINT && __GNUC__ && !__clang__ /* This useless assignment pacifies GCC 14.2.1 x86-64 . */ commit d6726e6dfc7f0a5133a0489bcdc21f10844692f2 Author: Stefan Monnier Date: Sat Aug 17 13:35:07 2024 -0400 Further fix of reading and writing profiler data * lisp/profiler.el (profiler-report-make-entry-part): Print strings as-is. (Bug#72559) diff --git a/lisp/profiler.el b/lisp/profiler.el index a5d62e20e3a..34e4d7032df 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -452,6 +452,11 @@ Do not touch this variable directly.") (let ((string (cond ((eq entry t) "Others") + ;; When we save profile data into a file, the function + ;; objects are replaced with their "names". When we see + ;; a string here, that's presumably why, so just print + ;; it as-is. + ((stringp entry) entry) (t (propertize (help-fns-function-name entry) ;; Override the `button-map' which ;; otherwise adds RET, mouse-1, and TAB commit 30b2fae77b7c9e03b64ea36ee327d380f94123b3 Author: Andrea Corallo Date: Sat Aug 17 18:25:46 2024 +0200 * Makefile.in (PREFERRED_BRANCH): Update to emacs-30. diff --git a/Makefile.in b/Makefile.in index 20394cb333d..1964fbbf8a9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1313,7 +1313,7 @@ ChangeLog: ./$(emacslog) -o $(CHANGELOG) -n $(CHANGELOG_HISTORY_INDEX_MAX) # Check that we are in a good state for changing history. -PREFERRED_BRANCH = emacs-28 +PREFERRED_BRANCH = emacs-30 preferred-branch-is-current: git branch | grep -q '^\* $(PREFERRED_BRANCH)$$' unchanged-history-files: commit 5397808e5bc314ca7ff6a707c153e59cf141008b Author: Po Lu Date: Sat Aug 17 22:03:55 2024 +0800 ; Eliminate more C++ comments * lib-src/movemail.c: * nt/preprep.c (main): * src/unexw32.c (unexec): Convert C++-style comments to C. diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 407f95e4541..49c4bcf72db 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -97,7 +97,7 @@ along with GNU Emacs. If not, see . */ [18-Feb-97 andrewi] I now believe my comment above to be incorrect, since it was based on a misunderstanding of how locking calls are implemented and used on Unix. */ -//#define DISABLE_DIRECT_ACCESS +/* #define DISABLE_DIRECT_ACCESS */ #include #endif /* WINDOWSNT */ diff --git a/nt/preprep.c b/nt/preprep.c index d1c4f2136cc..4b6fc8112bb 100644 --- a/nt/preprep.c +++ b/nt/preprep.c @@ -804,14 +804,14 @@ main (int argc, char **argv) nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); nt_header->OptionalHeader.CheckSum = 0; -// nt_header->FileHeader.TimeDateStamp = time (NULL); -// dos_header->e_cp = size / 512; -// nt_header->OptionalHeader.SizeOfImage = size; + /* nt_header->FileHeader.TimeDateStamp = time (NULL); */ + /* dos_header->e_cp = size / 512; */ + /* nt_header->OptionalHeader.SizeOfImage = size; */ pfnCheckSumMappedFile = (void *) GetProcAddress (hImagehelp, "CheckSumMappedFile"); if (pfnCheckSumMappedFile) { -// nt_header->FileHeader.TimeDateStamp = time (NULL); + /* nt_header->FileHeader.TimeDateStamp = time (NULL); */ pfnCheckSumMappedFile (out_file.file_base, out_file.size, &headersum, diff --git a/src/unexw32.c b/src/unexw32.c index d8329be522d..f0a910781cc 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -660,14 +660,14 @@ unexec (const char *new_name, const char *old_name) nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); nt_header->OptionalHeader.CheckSum = 0; -// nt_header->FileHeader.TimeDateStamp = time (NULL); -// dos_header->e_cp = size / 512; -// nt_header->OptionalHeader.SizeOfImage = size; + /* nt_header->FileHeader.TimeDateStamp = time (NULL); */ + /* dos_header->e_cp = size / 512; */ + /* nt_header->OptionalHeader.SizeOfImage = size; */ pfnCheckSumMappedFile = (void *) GetProcAddress (hImagehelp, "CheckSumMappedFile"); if (pfnCheckSumMappedFile) { -// nt_header->FileHeader.TimeDateStamp = time (NULL); + /* nt_header->FileHeader.TimeDateStamp = time (NULL); */ pfnCheckSumMappedFile (out_file.file_base, out_file.size, &headersum, commit 1463434907eeccd077f5d3c00309d1e75c7d63f4 Author: Po Lu Date: Sat Aug 17 22:01:03 2024 +0800 ; Eliminate C++ comments and typo * lib-src/etags.c (Rust_entries): Eliminate C++ comments and typo. diff --git a/lib-src/etags.c b/lib-src/etags.c index 03bc55de03d..cbd5fed5e24 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -5144,10 +5144,10 @@ Rust_entries (FILE *inf) cp = skip_spaces(cp); name = cp; - // Skip 'pub' keyworld + /* Skip 'pub' keyword. */ (void)LOOKING_AT (cp, "pub"); - // Look for define + /* Look for define. */ if ((is_func = LOOKING_AT (cp, "fn")) || LOOKING_AT (cp, "enum") || LOOKING_AT (cp, "struct") commit c4beb9a4bdade735e4841dcbe0140e8c0b3efd8a Merge: 142e5c66f3a 8d5f88d326b Author: Po Lu Date: Sat Aug 17 21:53:50 2024 +0800 ; Merge from savannah/emacs-30 The following commit was skipped: 8d5f88d326b Backport ed305c4b98cda5c6d479310e4ba350a17d901e75 to emac... commit 142e5c66f3a380ace7d70784b24ec171c410c3f1 Merge: 7811a7d38bb 6a512ab032e Author: Po Lu Date: Sat Aug 17 21:53:50 2024 +0800 Merge from savannah/emacs-30 6a512ab032e Fix a typo in Eglot manual 7b752a93a46 Fix dumping of Lisp profiles bfe07eca598 Fix 'apropos-library' for 'define-symbol-props' 5c1bd991396 Fix 'forward-comment' in 'toml-ts-mode' e966dd5ee2c Document spell-checking of multiple languages 8a072d1f05b Apply --display kluge for PGTK too commit 8d5f88d326b409651b0ebd6275b881d500090ea5 Author: Po Lu Date: Sat Aug 17 16:19:06 2024 +0800 Backport ed305c4b98cda5c6d479310e4ba350a17d901e75 to emacs-30 * src/xterm.c (x_construct_mouse_click): `||' → `|'. Typo found by clang 18.1.6 -Wbool-operation. Do not merge to master. diff --git a/src/xterm.c b/src/xterm.c index 215a3ed3bbe..fd3e58f85f6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14699,7 +14699,7 @@ x_construct_mouse_click (struct input_event *result, result->kind = (event->type != ButtonRelease ? NO_EVENT : wheel & 2 ? HORIZ_WHEEL_EVENT : WHEEL_EVENT); result->code = 0; /* Not used. */ - result->modifiers &= ~(up_modifier || down_modifier); + result->modifiers &= ~(up_modifier | down_modifier); result->modifiers |= wheel & 1 ? up_modifier : down_modifier; } } commit 6a512ab032e960cb027cd2d80b09fb909640f1c5 Author: Eli Zaretskii Date: Sat Aug 17 13:07:56 2024 +0300 Fix a typo in Eglot manual * doc/misc/eglot.texi (Eglot and Buffers): Fix typo. Patch by david edmonds . (Bug#72634) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index ba7aeb448e5..fb5b618bd84 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -600,7 +600,7 @@ user, but automatically, as the result of starting an Eglot session for the buffer. However, this minor mode provides a hook variable @code{eglot-managed-mode-hook} that can be used to customize the Eglot management of the buffer. This hook is run both when the minor mode -is turned on and when it's turned off; use the variable +is turned on and when it's turned off; use the function @code{eglot-managed-p} to tell if current buffer is still being managed or not. When Eglot stops managing the buffer, this minor mode is turned off, and all the settings that Eglot changed are restored to commit 7b752a93a46bca1ec11f00a47a85aebcecb69980 Author: Stefan Monnier Date: Wed Aug 14 08:48:43 2024 -0400 Fix dumping of Lisp profiles * lisp/profiler.el (profiler-fixup-entry): New function. (profiler-fixup-backtrace): Use it. (Bug#72559) diff --git a/lisp/profiler.el b/lisp/profiler.el index eb72f128c07..a5d62e20e3a 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -103,8 +103,13 @@ ;;; Backtraces +(defun profiler-fixup-entry (entry) + (if (symbolp entry) + entry + (substring-no-properties (help-fns-function-name entry)))) + (defun profiler-fixup-backtrace (backtrace) - (apply #'vector (mapcar #'help-fns-function-name backtrace))) + (apply #'vector (mapcar #'profiler-fixup-entry backtrace))) ;;; Logs commit bfe07eca5981fe80ddc8a54b18dd9340ad5ec2be Author: Stefan Monnier Date: Wed Aug 14 08:47:40 2024 -0400 Fix 'apropos-library' for 'define-symbol-props' * lisp/apropos.el (apropos-library): Sanitize data to avoid signaling errors when 'define-symbol-props' is seen. (Bug#72616) diff --git a/lisp/apropos.el b/lisp/apropos.el index 6c6cd0b593d..0655fecd0e8 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -734,7 +734,10 @@ the output includes key-bindings of commands." ;; FIXME: Print information about each individual method: both ;; its docstring and specializers (bug#21422). ('cl-defmethod (push (cadr x) provides)) - (_ (push (or (cdr-safe x) x) symbols)))) + ;; FIXME: Add extension point (bug#72616). + (_ (let ((sym (or (cdr-safe x) x))) + (and sym (symbolp sym) + (push sym symbols)))))) (let ((apropos-pattern "") ;Dummy binding for apropos-symbols-internal. (text (concat commit 5c1bd991396ff92cf0b81996f63c378c115f5b86 Author: Eli Zaretskii Date: Sat Aug 17 12:29:31 2024 +0300 Fix 'forward-comment' in 'toml-ts-mode' * lisp/textmodes/toml-ts-mode.el (toml-ts-mode--syntax-table): Fix syntax of newline. Patch from Jostein Kjønigsen . (Bug#72489) diff --git a/lisp/textmodes/toml-ts-mode.el b/lisp/textmodes/toml-ts-mode.el index 1b621032f8a..3c4533a7fea 100644 --- a/lisp/textmodes/toml-ts-mode.el +++ b/lisp/textmodes/toml-ts-mode.el @@ -50,7 +50,7 @@ (modify-syntax-entry ?= "." table) (modify-syntax-entry ?\' "\"" table) (modify-syntax-entry ?# "<" table) - (modify-syntax-entry ?\n "> b" table) + (modify-syntax-entry ?\n ">" table) (modify-syntax-entry ?\^m "> b" table) table) "Syntax table for `toml-ts-mode'.") commit 7811a7d38bb7cb303dc66efa02eb95e75a03f39d Author: Spencer Baugh Date: Tue Aug 6 12:39:37 2024 -0400 Stop subprocesses from using inherited or default PAGER At startup, set PAGER to "cat" so that any inherited or default value of PAGER does not affect subprocesses of Emacs. Pagers generally won't work when a subprocess runs under Emacs. Users can use 'comint-pager' (or other customizations) to tell subprocesses to use a different specific pager. * lisp/startup.el (normal-top-level): Set PAGER to 'cat', if 'cat' is available. (Bug#72426) diff --git a/lisp/startup.el b/lisp/startup.el index f18795ae6ac..738eec772ec 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -854,6 +854,12 @@ It is the default value of the variable `top-level'." ;; We are careful to do it late (after term-setup-hook), although the ;; new multi-tty code does not use $TERM any more there anyway. (setenv "TERM" "dumb") + ;; Similarly, a subprocess should not try to invoke a pager, as most + ;; pagers will fail in a dumb terminal. Many programs default to + ;; using "less" when PAGER is unset, so set PAGER to "cat"; using cat + ;; as a pager is equivalent to not using a pager at all. + (when (executable-find "cat") + (setenv "PAGER" "cat")) ;; Remove DISPLAY from the process-environment as well. This allows ;; `callproc.c' to give it a useful adaptive default which is either ;; the value of the `display' frame-parameter or the DISPLAY value commit e966dd5ee2c20e3579e490d05a1eb31b3272db45 Author: Eli Zaretskii Date: Sat Aug 17 11:44:35 2024 +0300 Document spell-checking of multiple languages * doc/emacs/fixit.texi (Spelling): Document spell-checking multi-lingual text with Hunspell. diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index af9ca5fcdf6..32763a09dd1 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -450,6 +450,30 @@ dictionary is specified by the variable spelling program looks for a personal dictionary in a default location, which is specific to each spell-checker. +@cindex spell-checking different languages +@cindex language for spell-checking + Usually, a dictionary used by a spell-checker is for a specific +language. The default language is determined from your system's +environment and locale. Both the standard dictionary and your personal +dictionary should be changed if you want to spell-check text in a +different language. You can use the @code{ispell-change-dictionary} +command for that. + +@cindex spell-checking multi-lingual text +@findex ispell-hunspell-add-multi-dic + Hunspell is special in that it supports spell-checking using several +different dictionaries in parallel. To use this feature, invoke the +@kbd{M-x ispell-hunspell-add-multi-dic} command before you start using +Hunspell for a particular combination of dictionaries. This command +prompts for the dictionary combination, which should be a +comma-separated list of language-specific dictionary names, such as +@samp{en_US,de_DE,ru_RU}. Thereafter, you can spell-check text which +mixes these languages without changing the dictionaries each time. +(Caveat: when several languages use the same script, it is possible that +a word that is mis-spelled in one language is found as a valid spelling +in the dictionary of another language; in that case, the mis-spelled +word might be missed.) + @vindex ispell-complete-word-dict A separate dictionary is used for word completion. The variable @code{ispell-complete-word-dict} specifies the file name of this commit ebac13844294483f708bb92699ee7da7a1b2db21 Author: Arash Esbati Date: Tue Jul 23 22:40:41 2024 +0200 Delete matching of whitespace in ispell's LaTeX env names * lisp/textmodes/ispell.el (ispell-begin-tex-skip-regexp): Remove matching of arbitrary whitespaces in LaTeX environment names when wrapping them inside \begin{}. (bug#72262) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 667da10d7a3..99f9e10a5a8 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3320,9 +3320,7 @@ Generated from `ispell-tex-skip-alists'." "\\|" ;; keys wrapped in begin{} (mapconcat (lambda (lst) - (concat "\\\\begin[ \t\n]*{[ \t\n]*" - (car lst) - "[ \t\n]*}")) + (concat "\\\\begin[ \t\n]*{" (car lst) "}")) (car (cdr ispell-tex-skip-alists)) "\\|"))) commit 8a072d1f05befb302a2107c44b935af7a69ad0d3 Author: Peter Oliver Date: Sun Jul 14 21:50:33 2024 +0100 Apply --display kluge for PGTK too * src/emacs.c (main): The --display option needs the same handling with the PGTK backend as it does with the X11 backends. (Bug#72118) diff --git a/src/emacs.c b/src/emacs.c index 3017063bec4..82f8fa8d9f7 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -194,7 +194,7 @@ bool inhibit_window_system; data on the first attempt to change it inside asynchronous code. */ bool running_asynch_code; -#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) +#if defined (HAVE_X_WINDOWS) || defined (HAVE_PGTK) || defined (HAVE_NS) /* If true, -d was specified, meaning we're using some window system. */ bool display_arg; #endif @@ -2085,7 +2085,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem { int count_before = skip_args; -#ifdef HAVE_X_WINDOWS +#if defined (HAVE_X_WINDOWS) || defined (HAVE_PGTK) char *displayname = 0; /* Skip any number of -d options, but only use the last one. */ diff --git a/src/lisp.h b/src/lisp.h index 59d8e497f13..5d04b57549d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -5181,7 +5181,7 @@ extern void syms_of_frame (void); extern char **initial_argv; extern int initial_argc; extern char const *emacs_wd; -#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) +#if defined (HAVE_X_WINDOWS) || defined (HAVE_PGTK) || defined (HAVE_NS) extern bool display_arg; #endif extern Lisp_Object decode_env_path (const char *, const char *, bool); commit c70ac0fef12f5c84b2a62a4a8b1bdf78f69300ee Author: Eli Zaretskii Date: Sat Aug 17 11:01:12 2024 +0300 Fix script for characters in 3300..3357 range * admin/unidata/blocks.awk: The characters in the 3300..3357 range are Katakana according to Unicode's Scripts.txt. diff --git a/admin/unidata/blocks.awk b/admin/unidata/blocks.awk index 122164ce5b6..40cefe0d563 100755 --- a/admin/unidata/blocks.awk +++ b/admin/unidata/blocks.awk @@ -146,6 +146,19 @@ FILENAME ~ "Blocks.txt" && /^[0-9A-F]/ { end[i] = fix_end[e] ? fix_end[e]: e name[i] = $0 + # Hard-coded splits that must be processed before name2alias and + # before combining same-named adjacent ranges. + if (start[i] == "3300") # See Scripts.txt + { + end[i] = "3357" + name[i] = "Katakana" + alt[i] = "kana" + i++ + start[i] = "3358" + end[i] = "33FF" + name[i] = "CJK Compatibility" + } + alt[i] = name2alias(name[i]) if (!alt[i])