commit fad3665069740e002fcb7f9313f9eeec81ad9a0c (HEAD, refs/remotes/origin/master) Merge: 48cc5c0604c 94e70ed4261 Author: Stefan Kangas Date: Thu Feb 23 06:30:16 2023 +0100 Merge from origin/emacs-29 94e70ed4261 ; * lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area)... 1841299a11d Eglot: implement inlay hints (bug#61412, bug#61066) 28ed0d1840f Eglot: run eglot-managed-mode-hook after LSP didOpen 7ad5d9babed Eglot: restore eldoc-documentation-functions on shutdown 711a775ba76 Eglot: simplify capability-checking code ea7251ad6df Eglot: go back to setting eldoc-documentation-strategy again 6016f1982d3 ; * etc/NEWS: Fix typo again d411b4d1fd3 ; * etc/NEWS (C-x v !): Additional text. a0b67252346 ; * doc/emacs/vc1-xtra.texi (Preparing Patches): Wording ... 43c4dd6f962 ; * doc/emacs/anti.texi (Antinews): Adjust to latest chan... 20c654b6f8f Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ... 177d0cf2a9a ; * etc/NEWS: Fix typos. db7096a532c Yield to erc-move-to-prompt before unhiding prompt db21c84bc94 ; Improve doc string of 'C-q' a6be0be1db6 ; Clarify "kill files" in Gnus manual d816429e2f2 * lisp/progmodes/python.el (python--import-sources): Fix ... 1f4886fdb09 Do not error out on non image file (bug#61639) 003759a6dca Explain effect of variable-pitch fonts on fill-column ba91a76659b Avoid division by zero in get_narrowed_* functions fb5dbf6de73 ; Fix documentation of 'icon-title-format'. 48c9a507713 * etc/NEWS: Mention new buffer display action alist entries 4dc1f2b9a01 ; * src/xterm.c (x_update_end): Condition on HAVE_XDBE f1c83898060 Fix build --without-xdbe ef38774c02c Improve dnd-direct-save-remote-files docstring cf53e62a791 Add 'process-status' to process shortdoc 68df9e5953c * lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename)... 06ba9484166 Improve text about deleting windows 1976ca1634d Make 'emacs-news-cycle-tag' work at all levels # Conflicts: # etc/NEWS commit 94e70ed4261dbfcef679697dfa0dc2348a90dbdc (refs/remotes/origin/emacs-29) Author: Yuan Fu Date: Wed Feb 22 17:55:30 2023 -0800 ; * lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Fix typo. diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 3f5cf0ad0dc..83948ad00d4 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -570,7 +570,7 @@ eldoc-display-in-echo-area Honor `eldoc-echo-area-use-multiline-p' and `eldoc-echo-area-prefer-doc-buffer'." (cond - (;; Check if he wave permission to mess with echo area at all. For + (;; Check if we have permission to mess with echo area at all. For ;; example, if this-command is non-nil while running via an idle ;; timer, we're still in the middle of executing a command, e.g. a ;; query-replace where it would be annoying to overwrite the echo commit 1841299a11dfcd875bdbdb75d1fc56d996a727f7 Author: João Távora Date: Tue Feb 21 14:14:05 2023 +0000 Eglot: implement inlay hints (bug#61412, bug#61066) Inlay hints are small text annotations to specific parts of the whole buffer, not unlike diagnostics, but designed to help readability instead of indicating problems. For example, a C++ LSP server can serve hints about positional parameter names in function calls and a variable's automatically deduced type. Emacs can display these hints in many little 0-length overlays with an 'before-string property, thus helping the user remember those types and parameter names. Since inlay hints are potentially a large amount of data to request from the LSP server, the implementation strives to be as parsimonious as possible with these requests. So, by default, inlay hints are only requested for the visible portions of the buffer across windows showing this buffer. This is done by leveraging the 'window-scroll-functions' variable, making for a reasonably complex implementation involving per-window timers. When scrolling a window, it may take a short amount of time for inlay hints to "pop in". The new user variable 'eglot-lazy-inlay-hints' can be used to exert some control over this. Specifically, if the variable's value is set to 'nil', then inlay hints are greedily fetched for the whole buffer every time a change occurs. This is a much simpler mode of operation which may avoid problems, but is also likely much slower in large buffers. Also, because the inlay feature is probably visually suprising to some, it is turned OFF by default, which is not the usual practice of Eglot (at least not when the necessary infrastructure is present). This decision may be changed soon. Here's a good one-liner for enabling it by default in every Eglot-managed buffer: (add-hook 'eglot-managed-mode-hook #'eglot-inlay-hints-mode) I haven't tested inlay hints extensively across many LSP servers, so I would appreciate any testing, both for functional edge cases and regarding performance. There are possibly more optimization oportunities in the "lazy" mode of operation, like more aggressively deleting buffer overlays that are not in visible parts of the buffer. Though I ended up writing this one from scratch, I want to thank Dimitry Bolopopsky and Chinmay Dala for suggestions and early patches. * lisp/progmodes/eglot.el (eglot--lsp-interface-alist): Define InlayHint. (eglot-client-capabilities): Announce 'inlayHint' capability. (eglot-ignored-server-capabilities): Add :inlayHintProvider. (eglot--document-changed-hook): New helper hook. (eglot--after-change): Use it. (eglot-inlay-hint-face, eglot-type-hint-face) (eglot-parameter-hint-face): New faces. (eglot--update-hints-1, eglot--inlay-hints-after-scroll) (eglot--inlay-hints-fully, eglot--inlay-hints-lazily): New helpers. (eglot-lazy-inlay-hints): New user variable. (eglot-inlay-hints-mode): New minor mode. (eglot--maybe-activate-editing-mode): Try to activate eglot-inlay-hints-mode. (eglot--before-change): Remove overlays immediately in the area being changed. (eglot--managed-mode-off): Remove overlays. * doc/misc/eglot.texi (Eglot Features): Mention inlay hints. (Eglot Variables): Mention eglot-lazy-inlay-hints. diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 56151b5482f..38c6adaf131 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -502,6 +502,15 @@ Eglot Features of code applicable actions at point. @end table +@item M-x eglot-inlay-hints-mode +This command toggles LSP ``inlay hints'' on and off for the current +buffer. Inlay hints are small text annotations to specific parts of +the whole buffer, not unlike diagnostics, but designed to help +readability instead of indicating problems. For example, a C++ LSP +server can serve hints about positional parameter names in function +calls and a variable's automatically deduced type. Inlay hints help +the user not have to remember these things by heart. + @end itemize Not all servers support the full set of LSP capabilities, but most of @@ -874,6 +883,14 @@ Eglot Variables (define-key eglot-mode-map (kbd "") 'xref-find-definitions) @end lisp +@item eglot-lazy-inlay-hints +This variable controls the operation and performance of LSP Inlay +Hints (@pxref{Eglot Features}). If non-@code{nil}, it specifies how +much time to wait after a window is displayed or scrolled before +requesting hints for that visible portion of a given buffer. If +@code{nil}, inlay hints are always requested for the whole buffer, +even for parts of it not currently visible. + @end vtable Additional variables, which are relevant for customizing the server diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 8b0caf41ad7..df755dfa43a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -47,9 +47,10 @@ ;; definition-chasing, Flymake for diagnostics, Eldoc for at-point ;; documentation, etc. Eglot's job is generally *not* to provide ;; such a UI itself, though a small number of simple -;; counter-examples do exist, for example in the `eglot-rename' -;; command. When a new UI is evidently needed, consider adding a -;; new package to Emacs, or extending an existing one. +;; counter-examples do exist, e.g. in the `eglot-rename' command or +;; the `eglot-inlay-hints-mode' minor mode. When a new UI is +;; evidently needed, consider adding a new package to Emacs, or +;; extending an existing one. ;; ;; * Eglot was designed to function with just the UI facilities found ;; in the latest Emacs core, as long as those facilities are also @@ -483,7 +484,9 @@ eglot--executable-find (VersionedTextDocumentIdentifier (:uri :version) ()) (WorkDoneProgress (:kind) (:title :message :percentage :cancellable)) (WorkspaceEdit () (:changes :documentChanges)) - (WorkspaceSymbol (:name :kind) (:containerName :location :data))) + (WorkspaceSymbol (:name :kind) (:containerName :location :data)) + (InlayHint (:position :label) (:kind :textEdits :tooltip :paddingLeft + :paddingRight :data))) "Alist (INTERFACE-NAME . INTERFACE) of known external LSP interfaces. INTERFACE-NAME is a symbol designated by the spec as @@ -803,6 +806,7 @@ eglot-client-capabilities :formatting `(:dynamicRegistration :json-false) :rangeFormatting `(:dynamicRegistration :json-false) :rename `(:dynamicRegistration :json-false) + :inlayHint `(:dynamicRegistration :json-false) :publishDiagnostics (list :relatedInformation :json-false ;; TODO: We can support :codeDescription after ;; adding an appropriate UI to @@ -1625,7 +1629,8 @@ eglot-ignored-server-capabilities (const :tag "Highlight links in document" :documentLinkProvider) (const :tag "Decorate color references" :colorProvider) (const :tag "Fold regions of buffer" :foldingRangeProvider) - (const :tag "Execute custom commands" :executeCommandProvider))) + (const :tag "Execute custom commands" :executeCommandProvider) + (const :tag "Inlay hints" :inlayHintProvider))) (defun eglot--server-capable (&rest feats) "Determine if current server is capable of FEATS." @@ -1818,6 +1823,7 @@ eglot--managed-mode (defun eglot--managed-mode-off () "Turn off `eglot--managed-mode' unconditionally." + (remove-overlays nil nil 'eglot--overlay t) (eglot--managed-mode -1)) (defun eglot-current-server () @@ -2285,6 +2291,7 @@ eglot--change-idle-timer (defun eglot--before-change (beg end) "Hook onto `before-change-functions' with BEG and END." + (remove-overlays beg end 'eglot--overlay t) (when (listp eglot--recent-changes) ;; Records BEG and END, crucially convert them into LSP ;; (line/char) positions before that information is lost (because @@ -2297,6 +2304,9 @@ eglot--before-change (,end . ,(copy-marker end t))) eglot--recent-changes))) +(defvar eglot--document-changed-hook '(eglot--signal-textDocument/didChange) + "Internal hook for doing things when the document changes.") + (defun eglot--after-change (beg end pre-change-length) "Hook onto `after-change-functions'. Records BEG, END and PRE-CHANGE-LENGTH locally." @@ -2337,7 +2347,7 @@ eglot--after-change eglot-send-changes-idle-time nil (lambda () (eglot--when-live-buffer buf (when eglot--managed-mode - (eglot--signal-textDocument/didChange) + (run-hooks 'eglot--document-changed-hook) (setq eglot--change-idle-timer nil)))))))) ;; HACK! Launching a deferred sync request with outstanding changes is a @@ -3464,6 +3474,129 @@ eglot-list-connections (revert-buffer) (pop-to-buffer (current-buffer))))) + +;;; Inlay hints +(defface eglot-inlay-hint-face '((t (:height 0.8 :inherit shadow))) + "Face used for inlay hint overlays.") + +(defface eglot-type-hint-face '((t (:inherit eglot-inlay-hint-face))) + "Face used for type inlay hint overlays.") + +(defface eglot-parameter-hint-face '((t (:inherit eglot-inlay-hint-face))) + "Face used for parameter inlay hint overlays.") + +(defcustom eglot-lazy-inlay-hints 0.3 + "If non-nil, restrict LSP inlay hints to visible portion of buffer. + +Value is number specifying how many seconds to wait after a +window has been (re)scrolled before requesting new inlay hints +for the visible region of the window being manipulated. + +If nil, then inlay hints are requested for the entire buffer. + +This value is only meaningful if the minor mode +`eglot-inlay-hints-mode' is true. +" + :type 'number + :version "29.1") + +(defun eglot--inlay-hints-fully () + (eglot--widening (eglot--update-hints-1 (point-min) (point-max)))) + +(cl-defun eglot--inlay-hints-lazily (&optional (buffer (current-buffer))) + (eglot--when-live-buffer buffer + (when eglot--managed-mode + (dolist (window (get-buffer-window-list nil nil 'visible)) + (eglot--update-hints-1 (window-start window) (window-end window)))))) + +(defun eglot--update-hints-1 (from to) + "Request LSP inlay hints and annotate current buffer from FROM to TO." + (let* ((buf (current-buffer)) + (paint-hint + (eglot--lambda ((InlayHint) position kind label paddingLeft paddingRight) + (goto-char (eglot--lsp-position-to-point position)) + (let ((ov (make-overlay (point) (point))) + (left-pad (and paddingLeft (not (memq (char-before) '(32 9))))) + (right-pad (and paddingRight (not (memq (char-after) '(32 9))))) + (text (if (stringp label) label (plist-get label :value)))) + (overlay-put ov 'before-string + (propertize + (concat (and left-pad " ") text (and right-pad " ")) + 'face (pcase kind + (1 'eglot-type-hint-face) + (2 'eglot-parameter-hint-face) + (_ 'eglot-inlay-hint-face)))) + (overlay-put ov 'eglot--inlay-hint t) + (overlay-put ov 'eglot--overlay t))))) + (jsonrpc-async-request + (eglot--current-server-or-lose) + :textDocument/inlayHint + (list :textDocument (eglot--TextDocumentIdentifier) + :range (list :start (eglot--pos-to-lsp-position from) + :end (eglot--pos-to-lsp-position to))) + :success-fn (lambda (hints) + (eglot--when-live-buffer buf + (eglot--widening + (remove-overlays from to 'eglot--inlay-hint t) + (mapc paint-hint hints)))) + :deferred 'eglot--update-hints-1))) + +(defun eglot--inlay-hints-after-scroll (window display-start) + (cl-macrolet ((wsetq (sym val) `(set-window-parameter window ',sym ,val)) + (wgetq (sym) `(window-parameter window ',sym))) + (let ((buf (window-buffer window)) + (timer (wgetq eglot--inlay-hints-timer)) + (last-display-start (wgetq eglot--last-inlay-hint-display-start))) + (when (and eglot-lazy-inlay-hints + ;; FIXME: If `window' is _not_ the selected window, + ;; then for some unknown reason probably related to + ;; the overlays added later to the buffer, the scroll + ;; function will be called indefinitely. Not sure if + ;; an Emacs bug, but prevent useless duplicate calls + ;; by saving and examining `display-start' fixes it. + (not (eql last-display-start display-start))) + (when timer (cancel-timer timer)) + (wsetq eglot--last-inlay-hint-display-start + display-start) + (wsetq eglot--inlay-hints-timer + (run-at-time + eglot-lazy-inlay-hints + nil (lambda () + (eglot--when-live-buffer buf + (when (eq buf (window-buffer window)) + (eglot--update-hints-1 (window-start window) + (window-end window)) + (wsetq eglot--inlay-hints-timer nil)))))))))) + +(define-minor-mode eglot-inlay-hints-mode + "Minor mode annotating buffer with LSP inlay hints." + :global nil + (cond (eglot-inlay-hints-mode + (cond + ((not (eglot--server-capable :inlayHintProvider)) + (eglot--warn + "No :inlayHintProvider support. Inlay hints will not work.")) + (eglot-lazy-inlay-hints + (add-hook 'eglot--document-changed-hook + #'eglot--inlay-hints-lazily t t) + (add-hook 'window-scroll-functions + #'eglot--inlay-hints-after-scroll nil t) + ;; Maybe there isn't a window yet for current buffer, + ;; so `run-at-time' ensures this runs after redisplay. + (run-at-time 0 nil #'eglot--inlay-hints-lazily)) + (t + (add-hook 'eglot--document-changed-hook + #'eglot--inlay-hints-fully nil t) + (eglot--inlay-hints-fully)))) + (t + (remove-hook 'eglot--document-changed-hook + #'eglot--inlay-hints-lazily t) + (remove-hook 'eglot--document-changed-hook + #'eglot--inlay-hints-fully t) + (remove-hook 'window-scroll-functions + #'eglot--inlay-hints-after-scroll t) + (remove-overlays nil nil 'eglot--inlay-hint t)))) + ;;; Hacks ;;; commit 28ed0d1840f94ba52b8b60bfbf222493fee2a3ea Author: João Távora Date: Wed Feb 22 18:44:39 2023 +0000 Eglot: run eglot-managed-mode-hook after LSP didOpen This allows using the hook for interacting with the LSP server using the current buffer as the subject of that interaction ("document" in LSP parlance). * lisp/progmodes/eglot.el (eglot--maybe-activate-editing-mode): Run eglot-managed-mode-hook here. (eglot--managed-mode): Not here. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 3daca24a586..8b0caf41ad7 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1814,9 +1814,7 @@ eglot--managed-mode (delq (current-buffer) (eglot--managed-buffers server))) (when (and eglot-autoshutdown (null (eglot--managed-buffers server))) - (eglot-shutdown server)))))) - ;; Note: the public hook runs before the internal eglot--managed-mode-hook. - (run-hooks 'eglot-managed-mode-hook)) + (eglot-shutdown server))))))) (defun eglot--managed-mode-off () "Turn off `eglot--managed-mode' unconditionally." @@ -1858,7 +1856,10 @@ eglot--maybe-activate-editing-mode (when (and buffer-file-name (eglot-current-server)) (setq eglot--diagnostics nil) (eglot--managed-mode) - (eglot--signal-textDocument/didOpen)))) + (eglot--signal-textDocument/didOpen) + ;; Run user hook after 'textDocument/didOpen' so server knows + ;; about the buffer. + (run-hooks 'eglot-managed-mode-hook)))) (add-hook 'find-file-hook 'eglot--maybe-activate-editing-mode) (add-hook 'after-change-major-mode-hook 'eglot--maybe-activate-editing-mode) commit 7ad5d9babed68ddb8cc4bdf7571fdf10e44e1bae Author: João Távora Date: Wed Feb 22 18:50:46 2023 +0000 Eglot: restore eldoc-documentation-functions on shutdown * lisp/progmodes/eglot.el (eglot--managed-mode): Restore eldoc-documentation-functions when shutting down eglot. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index f528b334c12..3daca24a586 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1799,6 +1799,8 @@ eglot--managed-mode (remove-hook 'change-major-mode-hook #'eglot--managed-mode-off t) (remove-hook 'post-self-insert-hook 'eglot--post-self-insert-hook t) (remove-hook 'pre-command-hook 'eglot--pre-command-hook t) + (remove-hook 'eldoc-documentation-functions #'eglot-hover-eldoc-function t) + (remove-hook 'eldoc-documentation-functions #'eglot-signature-eldoc-function t) (cl-loop for (var . saved-binding) in eglot--saved-bindings do (set (make-local-variable var) saved-binding)) (remove-function (local 'imenu-create-index-function) #'eglot-imenu) commit 711a775ba761e2838a6f73bf4b3119f0fe412841 Author: João Távora Date: Tue Feb 21 13:59:04 2023 +0000 Eglot: simplify capability-checking code * lisp/progmodes/eglot.el (eglot--server-capable-or-lose): New helper. (eglot--signal-textDocument/willSave) (eglot--signal-textDocument/didSave): Tweak docstring. (eglot--workspace-symbols, xref-backend-identifier-at-point) (eglot-format, eglot-completion-at-point, eglot-rename) (eglot-code-actions): Use new eglot--server-capable-or-lose. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 54f44d41b0d..f528b334c12 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1641,6 +1641,14 @@ eglot--server-capable if (not (listp (cadr probe))) do (cl-return (if more nil (cadr probe))) finally (cl-return (or (cadr probe) t))))) +(defun eglot--server-capable-or-lose (&rest feats) + "Like `eglot--server-capable', but maybe error out." + (let ((retval (apply #'eglot--server-capable feats))) + (unless retval + (eglot--error "Unsupported or ignored LSP capability `%s'" + (mapconcat #'symbol-name feats " "))) + retval)) + (defun eglot--range-region (range &optional markers) "Return region (BEG . END) that represents LSP RANGE. If optional MARKERS, make markers." @@ -2484,7 +2492,7 @@ eglot--signal-textDocument/didClose :textDocument/didClose `(:textDocument ,(eglot--TextDocumentIdentifier))))) (defun eglot--signal-textDocument/willSave () - "Send textDocument/willSave to server." + "Maybe send textDocument/willSave to server." (let ((server (eglot--current-server-or-lose)) (params `(:reason 1 :textDocument ,(eglot--TextDocumentIdentifier)))) (when (eglot--server-capable :textDocumentSync :willSave) @@ -2496,7 +2504,7 @@ eglot--signal-textDocument/willSave :timeout 0.5)))))) (defun eglot--signal-textDocument/didSave () - "Send textDocument/didSave to server." + "Maybe send textDocument/didSave to server." (eglot--signal-textDocument/didChange) (when (eglot--server-capable :textDocumentSync :save) (jsonrpc-notify @@ -2593,8 +2601,7 @@ eglot--workspace-symbols "Ask for :workspace/symbol on PAT, return list of formatted strings. If BUFFER, switch to it before." (with-current-buffer (or buffer (current-buffer)) - (unless (eglot--server-capable :workspaceSymbolProvider) - (eglot--error "This LSP server isn't a :workspaceSymbolProvider")) + (eglot--server-capable-or-lose :workspaceSymbolProvider) (mapcar (lambda (wss) (eglot--dbind ((WorkspaceSymbol) name containerName kind) wss @@ -2656,13 +2663,12 @@ eglot--lsp-xref-refs (cl-defun eglot--lsp-xrefs-for-method (method &key extra-params capability) "Make `xref''s for METHOD, EXTRA-PARAMS, check CAPABILITY." - (unless (eglot--server-capable - (or capability - (intern - (format ":%sProvider" - (cadr (split-string (symbol-name method) - "/")))))) - (eglot--error "Sorry, this server doesn't do %s" method)) + (eglot--server-capable-or-lose + (or capability + (intern + (format ":%sProvider" + (cadr (split-string (symbol-name method) + "/")))))) (let ((response (jsonrpc-request (eglot--current-server-or-lose) @@ -2759,8 +2765,7 @@ eglot-format :end (eglot--pos-to-lsp-position end))))) (t '(:textDocument/formatting :documentFormattingProvider nil))))) - (unless (eglot--server-capable cap) - (eglot--error "Server can't format!")) + (eglot--server-capable-or-lose cap) (eglot--apply-text-edits (jsonrpc-request (eglot--current-server-or-lose) @@ -3203,8 +3208,7 @@ eglot-rename "unknown symbol")) nil nil nil nil (symbol-name (symbol-at-point))))) - (unless (eglot--server-capable :renameProvider) - (eglot--error "Server can't rename!")) + (eglot--server-capable-or-lose :renameProvider) (eglot--apply-workspace-edit (jsonrpc-request (eglot--current-server-or-lose) :textDocument/rename `(,@(eglot--TextDocumentPositionParams) @@ -3231,9 +3235,7 @@ eglot-code-actions '("quickfix" "refactor.extract" "refactor.inline" "refactor.rewrite" "source.organizeImports"))) t)) - (unless (or (not interactive) - (eglot--server-capable :codeActionProvider)) - (eglot--error "Server can't execute code actions!")) + (eglot--server-capable-or-lose :codeActionProvider) (let* ((server (eglot--current-server-or-lose)) (actions (jsonrpc-request commit ea7251ad6dfe3cfbdcea221a67c7b7d4fcbfebfa Author: João Távora Date: Wed Feb 22 18:05:00 2023 +0000 Eglot: go back to setting eldoc-documentation-strategy again This commits reverts part of commit e83c78b8c7784254c2c6f043530ab325c2fa7f16 Author: João Távora Date: Mon Feb 20 22:43:50 2023 +0000 Eglot: respect user's Eldoc configuration by default In that commit, I did what many longstanding issues and users were suggesting and removed Eglot's override of two Eldoc user configuration varibles. I verified that Eglot's behaviour would stay mostly unaltered but my tests were very incomplete. In short there is no way that Eglot can work acceptably with the default setting of 'eldoc-documentation-strategy', which is 'eldoc-documentation-default'. So it must be changed, either globally or locally in Eglot's minor mode. This is true for any situation where both synchronous and asynchronous documentation sources are present. In Eglot's case there are two asynchronous sources which have more importance than the synchronous source. So any other strategy except the 'eldoc-documentation-default' makes sense. * lisp/progmodes/eglot.el (eglot--managed-mode): Set eldoc-documentation-strategy to eldoc-documentation-compose. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index abc090aea51..54f44d41b0d 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1764,6 +1764,8 @@ eglot--managed-mode (eglot--setq-saving flymake-diagnostic-functions '(eglot-flymake-backend)) (eglot--setq-saving company-backends '(company-capf)) (eglot--setq-saving company-tooltip-align-annotations t) + (eglot--setq-saving eldoc-documentation-strategy + #'eldoc-documentation-compose) (unless (eglot--stay-out-of-p 'imenu) (add-function :before-until (local 'imenu-create-index-function) #'eglot-imenu)) commit 48cc5c0604cea2e6344fe3f7604f9d2881d898bf Author: Protesilaos Stavrou Date: Wed Feb 22 20:00:13 2023 +0200 Update Modus themes to version 4.1.0 * doc/misc/modus-themes.org: Update the manual. * etc/themes/modus-operandi-deuteranopia-theme.el: * etc/themes/modus-operandi-theme.el: * etc/themes/modus-operandi-tinted-theme.el: * etc/themes/modus-vivendi-deuteranopia-theme.el: * etc/themes/modus-vivendi-theme.el: * etc/themes/modus-vivendi-tinted-theme.el: Update theme files. * etc/themes/modus-themes.el: Update main file to the latest version. Detailed release notes here: . diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 1273fd8a3ad..47d3e6c03e3 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.0.0 -#+macro: release-date 2023-01-01 -#+macro: development-version 4.1.0-dev +#+macro: stable-version 4.1.0 +#+macro: release-date 2023-02-22 +#+macro: development-version 4.2.0-dev #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ #+macro: space @@texinfo:@: @@ #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ @@ -155,8 +155,8 @@ Emacs and of the themes across the years. :end: In the following example, we are assuming that your Emacs files are -stored in =~/.emacs.d= and that you want to place the Modus themes in -=~/.emacs.d/modus-themes=. +stored in {{{file(~/.emacs.d)}}} and that you want to place the Modus +themes in {{{file(~/.emacs.d/modus-themes)}}}. 1. Get the source and store it in the desired path by running the following in the command line shell: @@ -230,17 +230,17 @@ They are now ready to be used: [[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable :custom_id: h:e6268471-e847-4c9d-998f-49a83257b7f1 :end: -From time to time, we receive bug reports pertaining to errors with byte -compilation. These seldom have to do with faulty code in the themes: it -might be a shortcoming of =package.el=, some regression in the current -development target of Emacs, a misconfiguration in an otherwise exotic -setup, and the like. +From time to time, we receive bug reports pertaining to errors with +byte compilation. These seldom have to do with faulty code in the +themes: it might be a shortcoming of {{{file(package.el)}}}, some +regression in the current development target of Emacs, a +misconfiguration in an otherwise exotic setup, and the like. The common solution with a stable version of Emacs is to: -1. Delete the =modus-themes= package. +1. Delete the ~modus-themes~ package. 2. Close the current Emacs session. -3. Install the =modus-themes= again. +3. Install the ~modus-themes~ again. For those building Emacs directly from source, the solution may involve reverting to an earlier commit in emacs.git. @@ -265,7 +265,7 @@ wrong. NOTE that Emacs can load multiple themes, which typically produces undesirable results and undoes the work of the designer. Use the ~disable-theme~ command if you are trying other themes beside the -Modus collection. +Modus collection ([[#h:adb0c49a-f1f9-4690-868b-013a080eed68][Option for disabling other themes while loading Modus]]). Users of the built-in themes cannot ~require~ the package as usual because there is no package to speak of. Instead, things are simpler @@ -292,17 +292,18 @@ One can activate a theme with something like the following expression, replacing ~modus-operandi~ with their preferred Modus theme: #+begin_src emacs-lisp -(load-theme 'modus-operandi :no-confim) +(load-theme 'modus-operandi :no-confirm) #+end_src Changes to the available customization options must always be evaluated before loading a theme ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). Reload a theme for new changes to take effect. -This is how a basic setup could look like: +This is how a basic setup could look like ([[#h:b66b128d-54a4-4265-b59f-4d1ea2feb073][The require-theme for built-in Emacs themes]]): #+begin_src emacs-lisp ;;; For the built-in themes which cannot use `require'. +(require-theme 'modus-themes) ;; Add all your customizations prior to loading the themes. (setq modus-themes-italic-constructs t @@ -326,13 +327,41 @@ This is how a basic setup could look like: modus-themes-bold-constructs nil) ;; Load the theme of your choice. -(load-theme 'modus-operandi :no-confim) +(load-theme 'modus-operandi :no-confirm) (define-key global-map (kbd "") #'modus-themes-toggle) #+end_src [[#h:e979734c-a9e1-4373-9365-0f2cd36107b8][Sample configuration with and without use-package]]. +** The ~require-theme~ for built-in Emacs themes +:PROPERTIES: +:CUSTOM_ID: h:b66b128d-54a4-4265-b59f-4d1ea2feb073 +:END: + +The version of the Modus themes that is included in Emacs CANNOT use +the standard ~require~. This is because the built-in themes are not +included in the ~load-path~ (not my decision). The ~require-theme~ +function must be used in this case as a replacement. For example: + +#+begin_src emacs-lisp +(require-theme 'modus-themes) + +;; All customizations here +(setq modus-themes-bold-constructs t + modus-themes-italic-constructs t) + +;; Maybe define some palette overrides, such as by using our presets +(setq modus-themes-common-palette-overrides + modus-themes-preset-overrides-intense) + +;; Load the theme of choice (built-in themes are always "safe" so they +;; do not need the `no-require' argument of `load-theme'). +(load-theme 'modus-operandi) + +(define-key global-map (kbd "") #'modus-themes-toggle) +#+end_src + ** Sample configuration with and without use-package :properties: :custom_id: h:e979734c-a9e1-4373-9365-0f2cd36107b8 @@ -349,54 +378,57 @@ package configurations in their setup. We use this as an example: #+begin_src emacs-lisp ;;; For the built-in themes which cannot use `require'. (use-package emacs - :init + :config + (require-theme 'modus-themes) ; `require-theme' is ONLY for the built-in Modus themes + ;; Add all your customizations prior to loading the themes (setq modus-themes-italic-constructs t modus-themes-bold-constructs nil) - :config + + ;; Maybe define some palette overrides, such as by using our presets + (setq modus-themes-common-palette-overrides + modus-themes-preset-overrides-intense) + ;; Load the theme of your choice. (load-theme 'modus-operandi) - :bind ("" . modus-themes-toggle)) + + (define-key global-map (kbd "") #'modus-themes-toggle)) ;;; For packaged versions which must use `require'. (use-package modus-themes - :ensure - :init + :ensure t + :config ;; Add all your customizations prior to loading the themes (setq modus-themes-italic-constructs t modus-themes-bold-constructs nil) - :config + + ;; Maybe define some palette overrides, such as by using our presets + (setq modus-themes-common-palette-overrides + modus-themes-preset-overrides-intense) + ;; Load the theme of your choice. - (load-theme 'modus-operandi :no-confim) - :bind ("" . modus-themes-toggle)) + (load-theme 'modus-operandi) + + (define-key global-map (kbd "") #'modus-themes-toggle)) #+end_src The same without ~use-package~: #+begin_src emacs-lisp -;;; For the built-in themes which cannot use `require': -;; Add all your customizations prior to loading the themes -(setq modus-themes-italic-constructs t - modus-themes-bold-constructs nil) - -;; Load the theme of your choice: -(load-theme 'modus-operandi) ;; OR (load-theme 'modus-vivendi) - -(define-key global-map (kbd "") #'modus-themes-toggle) - - - -;;; For packaged versions which must use `require': -(require 'modus-themes) +(require 'modus-themes) ; OR for the built-in themes: (require-theme 'modus-themes) ;; Add all your customizations prior to loading the themes (setq modus-themes-italic-constructs t modus-themes-bold-constructs nil) +;; Maybe define some palette overrides, such as by using our presets +(setq modus-themes-common-palette-overrides + modus-themes-preset-overrides-intense) + ;; Load the theme of your choice: -(load-theme 'modus-operandi :no-confim) ;; OR (load-theme 'modus-vivendi :no-confim) +(load-theme 'modus-operandi :no-confirm) (define-key global-map (kbd "") #'modus-themes-toggle) #+end_src @@ -482,6 +514,7 @@ reloaded for changes to take effect. modus-themes-mixed-fonts t modus-themes-variable-pitch-ui nil modus-themes-custom-auto-reload t + modus-themes-disable-other-themes t ;; Options for `modus-themes-prompts' are either nil (the ;; default), or a list of properties that may include any of those @@ -545,6 +578,38 @@ UI or related functions such as ~customize-set-variable~ and ~setopt~ With a nil value, changes to user options have no further consequences: the user must manually reload the theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). +** Option for disabling other themes while loading Modus +:properties: +:alt_title: Disable other themes +:description: Determine whether loading a Modus themes disables all others +:custom_id: h:adb0c49a-f1f9-4690-868b-013a080eed68 +:end: +#+vindex: modus-themes-disable-other-themes + +Brief: Disable all other themes when loading a Modus theme. + +Symbol: ~modus-themes-disable-other-themes~ (=boolean= type) + +Possible values: + +1. ~nil~ +2. ~t~ (default) + +When the value is non-nil, the commands ~modus-themes-toggle~ and +~modus-themes-select~, as well as the ~modus-themes-load-theme~ +function, will disable all other themes while loading the specified +Modus theme. This is done to ensure that Emacs does not blend two or +more themes: such blends lead to awkward results that undermine the +work of the designer. + +When the value is nil, the aforementioned commands and function will +only disable other themes within the Modus collection. + +This option is provided because Emacs themes are not necessarily +limited to colors/faces: they can consist of an arbitrary set of +customizations. Users who use such customization bundles must set +this variable to a nil value. + ** Option for more bold constructs :properties: :alt_title: Bold constructs @@ -707,14 +772,14 @@ Brief: Set the overall style of completion framework interfaces. Symbol: ~modus-themes-completions~ (=alist= type properties) This affects Company, Corfu, Flx, Icomplete/Fido, Ido, Ivy, Orderless, -Vertico. The value is an alist of expressions, each of which takes -the form of =(KEY . LIST-OF-PROPERTIES)=. =KEY= is a symbol, while -=PROPERTIES= is a list. Here is a sample, followed by a description -of the particularities: +Vertico, and the standard =*Completions*= buffer. The value is an +alist of expressions, each of which takes the form of =(KEY . LIST-OF-PROPERTIES)=. +=KEY= is a symbol, while =PROPERTIES= is a list. Here is a sample, +followed by a description of the particularities: #+begin_src emacs-lisp (setq modus-themes-completions - '((matches . (extrabold background)) + '((matches . (extrabold underline)) (selection . (semibold italic)))) #+end_src @@ -984,8 +1049,6 @@ values and semantic color mappings: given named color from the palette, like =(heading-2 yellow-faint)=. Both elements of the list are symbols, though the ~cadr~ (value) can be a string that specifies a color, such as =(heading-2 "#354fcf")=. - Semantic color mappings cannot be recursive: their value must be - either a named color or a hexadecimal RGB value. #+vindex: modus-themes-common-palette-overrides Both of those subsets can be overridden, thus refashioning the theme. @@ -1186,9 +1249,18 @@ set their color to that of the underlying background. ;; common overrides are best used for changes to semantic color ;; mappings, as we show below. +;; Remove the border (setq modus-themes-common-palette-overrides '((border-mode-line-active unspecified) (border-mode-line-inactive unspecified))) + +;; Keep the border but make it the same color as the background of the +;; mode line (thus appearing borderless). The difference with the +;; above is that this version is a bit thicker because the border are +;; still there. +(setq modus-themes-common-palette-overrides + '((border-mode-line-active bg-mode-line-active) + (border-mode-line-inactive bg-mode-line-inactive))) #+end_src **** Make the active mode line colorful @@ -1218,7 +1290,7 @@ have a blue mode line for ~modus-operandi~ and a red one for ;; Blue background, neutral foreground, intense blue border (setq modus-themes-common-palette-overrides - '((bg-mode-line-active bg-blue) + '((bg-mode-line-active bg-blue-intense) (fg-mode-line-active fg-main) (border-mode-line-active blue-intense))) @@ -1235,6 +1307,58 @@ have a blue mode line for ~modus-operandi~ and a red one for (border-mode-line-active bg-red-subtle))) #+end_src +**** Make the tab bar more or less colorful +:PROPERTIES: +:CUSTOM_ID: h:096658d7-a0bd-4a99-b6dc-9b20a20cda37 +: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 we show how to affect the colors of the built-in ~tab-bar-mode~ +and ~tab-line-mode~. + +For consistent theme-wide results, consider changing the mode line, +fringes, and line numbers. These are shown in other sections of this +manual. + +#+begin_src emacs-lisp +;; These overrides are common to all Modus themes. We also provide +;; theme-specific options, such as `modus-operandi-palette-overrides'. +;; +;; In general, the theme-specific overrides are better for overriding +;; color values, such as redefining what `blue-faint' looks like. The +;; common overrides are best used for changes to semantic color +;; mappings, as we show below. + + +;; Make the `tab-bar-mode' mode subtle while keepings its original +;; gray aesthetic. +(setq modus-themes-common-palette-overrides + '((bg-tab-bar bg-main) + (bg-tab-current bg-active) + (bg-tab-other bg-dim))) + +;; Like the above, but the current tab has a colorful background and +;; the inactive tabs have a slightly more noticeable gray background. +(setq modus-themes-common-palette-overrides + '((bg-tab-bar bg-main) + (bg-tab-current bg-cyan-intense) + (bg-tab-other bg-inactive))) + +;; Make the tabs colorful, using a monochromatic pattern (e.g. shades +;; of cyan). +(setq modus-themes-common-palette-overrides + '((bg-tab-bar bg-cyan-nuanced) + (bg-tab-current bg-cyan-intense) + (bg-tab-other bg-cyan-subtle))) + +;; Like the above, but with a dichromatic pattern (cyan and magenta). +(setq modus-themes-common-palette-overrides + '((bg-tab-bar bg-cyan-nuanced) + (bg-tab-current bg-magenta-intense) + (bg-tab-other bg-cyan-subtle))) +#+end_src + **** Make the fringe invisible or another color :PROPERTIES: :CUSTOM_ID: h:c312dcac-36b6-4a1f-b1f5-ab1c9abe27b0 @@ -1352,7 +1476,8 @@ three different degrees of intensity. ;; mappings, as we show below. ;; Add a nuanced background color to completion matches, while keeping -;; their foreground intact. +;; their foreground intact (foregrounds do not need to be specified in +;; this case, but we do it for didactic purposes). (setq modus-themes-common-palette-overrides '((fg-completion-match-0 blue) (fg-completion-match-1 magenta-warmer) @@ -1893,9 +2018,8 @@ do not show every possible permutation. (prose-todo red) (prose-verbatim magenta-warmer))) -;; Make code block delimiters use a shade of red, tone down -;; =verbatim=, ~code~, and {{{macro}}}, and amplify the style of -;; property drawers +;; Make code block delimiters use a shade of red, tone down verbatim, +;; code, and macro, and amplify the style of property drawers (setq modus-themes-common-palette-overrides '((prose-block red-faint) (prose-code fg-dim) @@ -1995,6 +2119,8 @@ Here we show how to make the region respect the underlying text colors or how to make the background more/less intense while combining it with an appropriate foreground value. +[[#h:a5140c9c-18b2-45db-8021-38d0b5074116][Do not extend the region background]]. + #+begin_src emacs-lisp ;; These overrides are common to all Modus themes. We also provide ;; theme-specific options, such as `modus-operandi-palette-overrides'. @@ -2126,6 +2252,121 @@ this section we show how to affect the ~display-line-numbers-mode~. (bg-line-number-active bg-cyan-intense))) #+end_src +**** Make diffs use only a foreground +:PROPERTIES: +:CUSTOM_ID: h:b3761482-bcbf-4990-a41e-4866fb9dad15 +: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]]). In +this section we show how to change diff buffers (e.g. in ~magit~) to +only use color-coded text without any added background. What we +basically do is to disable the applicable backgrounds and then +intensify the foregrounds. Since the deuteranopia-optimized themes do +not use the red-green color coding, we make an extra set of +adjustments for them by overriding their palettes directly instead of +just using the "common" overrides. + +#+begin_src emacs-lisp +;; Diffs with only foreground colours. Word-wise ("refined") diffs +;; have a gray background to draw attention to themselves. +(setq modus-themes-common-palette-overrides + '((bg-added unspecified) + (bg-added-faint unspecified) + (bg-added-refine bg-inactive) + (fg-added green) + (fg-added-intense green-intense) + + (bg-changed unspecified) + (bg-changed-faint unspecified) + (bg-changed-refine bg-inactive) + (fg-changed yellow) + (fg-changed-intense yellow-intense) + + (bg-removed unspecified) + (bg-removed-faint unspecified) + (bg-removed-refine bg-inactive) + (fg-removed red) + (fg-removed-intense red-intense) + + (bg-diff-context unspecified))) + +;; Because deuteranopia cannot use the typical red-yellow-green +;; combination, we need to arrange for a yellow-purple-blue sequence. +;; Notice that the above covers the "common" overrides, so we do not +;; need to reproduce the whole list of them. +(setq modus-operandi-deuteranopia-palette-overrides + '((fg-added blue) + (fg-added-intense blue-intense) + + (fg-changed magenta-cooler) + (fg-changed-intense magenta-intense) + + (fg-removed yellow-warmer) + (fg-removed-intense yellow-intense))) + +(setq modus-vivendi-deuteranopia-palette-overrides + '((fg-added blue) + (fg-added-intense blue-intense) + + (fg-changed magenta-cooler) + (fg-changed-intense magenta-intense) + + (fg-removed yellow) + (fg-removed-intense yellow-intense))) +#+end_src + +**** Make deuteranopia diffs red and blue instead of yellow and blue +:PROPERTIES: +:CUSTOM_ID: h:16389ea1-4cb6-4b18-9409-384324113541 +: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]]). In +this section we show how to implement a red+blue color coding for +diffs in the themes ~modus-operandi-deuteranopia~ and +~modus-vivendi-deuteranopia~. As those themes are optimized for users +with red-green color deficiency, they do not use the typical red+green +color coding for diffs, defaulting instead to yellow+blue which are +discernible. Users with deuteranomaly or, generally, those who like a +different aesthetic, can use the following to make diffs use the +red+yellow+blue color coding for removed, changed, and added lines +respectively. This is achieved by overriding the "changed" and +"removed" entries to use the colors of regular ~modus-operandi~ and +~modus-vivendi~. + +#+begin_src emacs-lisp +(setq modus-operandi-deuteranopia-palette-overrides + '((bg-changed "#ffdfa9") + (bg-changed-faint "#ffefbf") + (bg-changed-refine "#fac090") + (bg-changed-fringe "#d7c20a") + (fg-changed "#553d00") + (fg-changed-intense "#655000") + + (bg-removed "#ffd8d5") + (bg-removed-faint "#ffe9e9") + (bg-removed-refine "#f3b5af") + (bg-removed-fringe "#d84a4f") + (fg-removed "#8f1313") + (fg-removed-intense "#aa2222"))) + +(setq modus-vivendi-deuteranopia-palette-overrides + '((bg-changed "#363300") + (bg-changed-faint "#2a1f00") + (bg-changed-refine "#4a4a00") + (bg-changed-fringe "#8a7a00") + (fg-changed "#efef80") + (fg-changed-intense "#c0b05f") + + (bg-removed "#4f1119") + (bg-removed-faint "#380a0f") + (bg-removed-refine "#781a1f") + (bg-removed-fringe "#b81a1f") + (fg-removed "#ffbfbf") + (fg-removed-intense "#ff9095"))) +#+end_src + * Advanced customization :properties: :custom_id: h:f4651d55-8c07-46aa-b52b-bed1e53463bb @@ -2248,22 +2489,25 @@ xterm*color15: #ffffff #+cindex: Preview named colors or semantic color mappings #+findex: modus-themes-list-colors +The command ~modus-themes-list-colors~ uses minibuffer completion to +select an item from the Modus themes and then produces a buffer with +previews of its color palette entries. The buffer has a naming scheme +that reflects the given choice, like =modus-operandi-list-colors= for +the ~modus-operandi~ theme. + #+findex: modus-themes-list-colors-current -The command ~modus-themes-list-colors~ prompts for a choice between -=modus-operandi= and =modus-vivendi= to produce a help buffer that -shows a preview of the named colors in the given theme's palette. The -command ~modus-themes-list-colors-current~ skips the prompt, using the -current Modus theme. +The command ~modus-themes-list-colors-current~ skips the minibuffer +selection process and just produces a preview for the current Modus +theme. When called with a prefix argument (=C-u= with the default key bindings), these commands will show a preview of the palette's -semantic color mappings instead of the named colors. - -In this context, "named colors" are entries that associate a symbol to -a string color value, such as =(blue-warmer "#354fcf")=. Whereas -"semantic color mappings" associate a named color to a symbol, like -=(string blue-warmer)=, thus making the theme render all string -constructs in the =blue-warmer= color value ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). +semantic color mappings instead of the named colors. In this context, +"named colors" are entries that associate a symbol to a string color +value, such as =(blue-warmer "#354fcf")=. Whereas "semantic color +mappings" associate a named color to a symbol, like =(string +blue-warmer)=, thus making the theme render all string constructs in +the =blue-warmer= color value ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). #+findex: modus-themes-preview-colors #+findex: modus-themes-preview-colors-current @@ -2314,12 +2558,70 @@ equivalent the themes provide. For a more elaborate design, it is better to inspect the source code of ~modus-themes-toggle~ and relevant functions. +** Get a single color from the palette +:PROPERTIES: +:CUSTOM_ID: h:1cc552c1-5f5f-4a56-ae78-7b69e8512c4e +:END: + +[[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. + +#+findex: modus-themes-get-color-value +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=. + +=COLOR= is a symbol that represents a named color entry in the +palette. + +[[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Preview theme colors]]. + +If the value is the name of another color entry in the palette (so a +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. + +[[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]. + +With optional =THEME= as a symbol among ~modus-themes-items~, use the +palette of that item. Else use the current Modus theme. + +If =COLOR= is not present in the palette, this function returns the +~unspecified~ symbol, which is safe when used as a face attribute's +value. + +An example with ~modus-operandi~ to show how this function behaves +with/without overrides and when recursive mappings are introduced. + +#+begin_src emacs-lisp +;; Here we show the recursion of palette mappings. In general, it is +;; better for the user to specify named colors to avoid possible +;; confusion with their configuration, though those still work as +;; expected. +(setq modus-themes-common-palette-overrides + '((cursor red) + (fg-mode-line-active cursor) + (border-mode-line-active fg-mode-line-active))) + +;; Ignore the overrides and get the original value. +(modus-themes-get-color-value 'border-mode-line-active) +;; => "#5a5a5a" + +;; Read from the overrides and deal with any recursion to find the +;; underlying value. +(modus-themes-get-color-value 'border-mode-line-active :overrides) +;; => "#a60000" +#+end_src + ** Use theme colors in code with modus-themes-with-colors :properties: :custom_id: h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae :end: #+cindex: Use colors from the palette anywhere +[[#h:1cc552c1-5f5f-4a56-ae78-7b69e8512c4e][Get a single color from the palette]]. + Note that users most probably do not need the following. Just rely on the comprehensive overrides we provide ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). @@ -2354,6 +2656,32 @@ We provide commands to inspect those ([[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d] Others sections in this manual show how to use the aforementioned macro ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]). +Because the ~modus-themes-with-colors~ will most likely be used to +customize faces, note that any function that calls it must be run at +startup after the theme loads. The same function must also be +assigned to the ~modus-themes-after-load-theme-hook~ for its effects +to persist and be updated when switching between Modus themes (e.g. to +update the exact value of =blue-warmer= when toggling between +~modus-operandi~ to ~modus-vivendi~. + +** Do not extend the region background +:PROPERTIES: +:CUSTOM_ID: h:a5140c9c-18b2-45db-8021-38d0b5074116 +:END: + +By the default, the background of the ~region~ face extends from the +end of the line to the edge of the window. To limit it to the end of +the line, we need to override the face's =:extend= attribute. Adding +this to the Emacs configuration file will suffice: + +#+begin_src emacs-lisp +;; Do not extend `region' background past the end of the line. +(custom-set-faces + '(region ((t :extend nil)))) +#+end_src + +[[#h:c8605d37-66e1-42aa-986e-d7514c3af6fe][Make the region preserve text colors, plus other styles]]. + ** Add padding to mode line :PROPERTIES: :CUSTOM_ID: h:5a0c58cc-f97f-429c-be08-927b9fbb0a9c @@ -2981,9 +3309,9 @@ While we do provide ~modus-themes-toggle~ to manually switch between the themes, users may also set up their system to perform such a task automatically at sunrise and sunset. -This can be accomplished by specifying the coordinates of one's location -using the built-in {{{file(solar.el)}}} and then configuring the =circadian= -package: +This can be accomplished by specifying the coordinates of one's +location using the built-in {{{file(solar.el)}}} and then configuring +the ~circadian~ package: #+begin_src emacs-lisp (use-package solar ; built-in @@ -2992,7 +3320,7 @@ package: calendar-longitude 33.36)) (use-package circadian ; you need to install this - :ensure + :ensure t :after solar :config (setq circadian-themes '((:sunrise . modus-operandi) @@ -3022,9 +3350,10 @@ To remap the buffer's backdrop, we start with a function like this one: #+begin_src emacs-lisp (defun my-pdf-tools-backdrop () - (face-remap-add-relative - 'default - `(:background ,(modus-themes-color 'bg-alt)))) + (modus-themes-with-colors + (face-remap-add-relative + 'default + `(:background ,bg-dim)))) (add-hook 'pdf-tools-enabled-hook #'my-pdf-tools-backdrop) #+end_src @@ -3043,9 +3372,10 @@ at something like the following, which builds on the above example: #+begin_src emacs-lisp (defun my-pdf-tools-backdrop () - (face-remap-add-relative - 'default - `(:background ,(modus-themes-color 'bg-alt)))) + (modus-themes-with-colors + (face-remap-add-relative + 'default + `(:background ,bg-dim)))) (defun my-pdf-tools-midnight-mode-toggle () (when (derived-mode-p 'pdf-view-mode) @@ -3154,11 +3484,12 @@ need to (provided they understand the implications). :CUSTOM_ID: h:2ef83a21-2f0a-441e-9634-473feb940743 :END: -The =hl-todo= package provides the user option ~hl-todo-keyword-faces~: -it specifies a pair of keyword and corresponding color value. The Modus -themes configure that option in the interest of legibility. While this -works for our purposes, users may still prefer to apply their custom -values, in which case the following approach is necessary: +The ~hl-todo~ package provides the user option +~hl-todo-keyword-faces~: it specifies a pair of keyword and +corresponding color value. The Modus themes configure that option in +the interest of legibility. While this works for our purposes, users +may still prefer to apply their custom values, in which case the +following approach is necessary: #+begin_src emacs-lisp (defun my-modus-themes-hl-todo-faces () @@ -3192,7 +3523,7 @@ otherwise the defaults are not always legible. :CUSTOM_ID: h:439c9e46-52e2-46be-b1dc-85841dd99671 :END: -The =solaire-mode= package dims the background of what it considers +The ~solaire-mode~ package dims the background of what it considers ancillary "UI" buffers, such as the minibuffer and Dired buffers. The Modus themes used to support Solaire on the premise that the user was (i) opting in to it, (ii) understood why certain buffers were more gray, @@ -3222,7 +3553,7 @@ arrangement that compromises on our accessibility standards and/or hinders our efforts to provide the best possible experience while using the Modus themes. -As such, =solaire-mode= is not---and will not be---supported by the +As such, ~solaire-mode~ is not---and will not be---supported by the Modus themes (or any other of my themes, for that matter). Users who want it must style the faces manually. Below is some sample code, based on what we cover at length elsewhere in this manual: @@ -3305,6 +3636,7 @@ have lots of extensions, so the "full support" may not be 100% true… + csv-mode + ctrlf + custom (what you get with {{{kbd(M-x customize)}}}) +- dashboard + deadgrep + deft + devdocs @@ -3612,11 +3944,12 @@ anew. :CUSTOM_ID: h:a195e37c-e58c-4148-b254-8ba1ed8a731a :END: -The =git-gutter= and =git-gutter-fr= packages default to drawing bitmaps -for the indicators they display (e.g. bitmap of a plus sign for added -lines). In Doom Emacs, these bitmaps are replaced with contiguous lines -which may look nicer, but require a change to the foreground of the -relevant faces to yield the desired color combinations. +The ~git-gutter~ and ~git-gutter-fr~ packages default to drawing +bitmaps for the indicators they display (e.g. bitmap of a plus sign +for added lines). In Doom Emacs, these bitmaps are replaced with +contiguous lines which may look nicer, but require a change to the +foreground of the relevant faces to yield the desired color +combinations. Since this is Doom-specific, we urge users to apply changes in their local setup. Below is some sample code, based on what we cover at @@ -3668,7 +4001,7 @@ If the above does not work, try this instead: :END: Depending on your build of Emacs and/or the environment it runs in, -multiline comments in PHP with the =php-mode= package use the +multiline comments in PHP with the ~php-mode~ package use the ~font-lock-doc-face~ instead of ~font-lock-comment-face~. This seems to make all comments use the appropriate face: @@ -3797,10 +4130,10 @@ For example: :CUSTOM_ID: h:24bab397-dcb2-421d-aa6e-ec5bd622b913 :END: -The =highlight-parentheses= package provides contextual coloration of +The ~highlight-parentheses~ package provides contextual coloration of surrounding parentheses, highlighting only those which are around the -point. The package expects users to customize the applicable colors on -their own by configuring certain variables. +point. The package expects users to customize the applicable colors +on their own by configuring certain variables. To make the Modus themes work as expected with this, we need to use some of the techniques that are discussed at length in the various @@ -3984,10 +4317,11 @@ implements an alternative to the typical coloration of code. Instead of highlighting the syntactic constructs, it applies color to different levels of depth in the code structure. -As =prism.el= offers a broad range of customizations, we cannot style -it directly at the theme level: that would run contrary to the spirit -of the package. Instead, we may offer preset color schemes. Those -should offer a starting point for users to adapt to their needs. +As {{{file(prism.el)}}} offers a broad range of customizations, we +cannot style it directly at the theme level: that would run contrary +to the spirit of the package. Instead, we may offer preset color +schemes. Those should offer a starting point for users to adapt to +their needs. In the following code snippets, we employ the ~modus-themes-with-colors~ macro: [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. @@ -4146,10 +4480,10 @@ Consult the doc string of ~shr-use-colors~. :end: #+cindex: Fonts in EWW, Elfeed, Ement, and SHR -By default, packages that build on top of the Simple HTML Remember (=shr=) -use proportionately spaced fonts. This is controlled by the user option -~shr-use-fonts~, which is set to non-~nil~ by default. To use the standard -font instead, set that variable to nil. +By default, packages that build on top of the Simple HTML Remember +(~shr~) use proportionately spaced fonts. This is controlled by the +user option ~shr-use-fonts~, which is set to non-~nil~ by default. To +use the standard font instead, set that variable to nil. [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. @@ -4166,9 +4500,10 @@ This is a non-exhaustive list. :custom_id: h:8e636056-356c-4ca7-bc78-ebe61031f585 :end: -The =ement.el= library by Adam Porter (also known as "alphapapa") defaults -to a method of colorizing usernames in a rainbow style. This is -controlled by the user option ~ement-room-prism~ and can be disabled with: +The {{{file(ement.el)}}} library by Adam Porter (also known as +"alphapapa") defaults to a method of colorizing usernames in a rainbow +style. This is controlled by the user option ~ement-room-prism~ and +can be disabled with: #+begin_src emacs-lisp (setq ement-room-prism nil) @@ -4182,7 +4517,7 @@ slightly below our nominal target. Try this instead: (setq ement-room-prism-minimum-contrast 7) #+end_src -With regard to fonts, Ement depends on =shr= ([[#h:e6c5451f-6763-4be7-8fdb-b4706a422a4c][Note on SHR fonts]]). +With regard to fonts, Ement depends on ~shr~ ([[#h:e6c5451f-6763-4be7-8fdb-b4706a422a4c][Note on SHR fonts]]). Since we are here, here is an excerpt from Ement's source code: @@ -4271,7 +4606,7 @@ those buttons. Disabling the logo fixes the problem: The built-in ~goto-address-mode~ uses heuristics to identify URLs and email addresses in the current buffer. It then applies a face to them -to change their style. Some packages, such as =notmuch=, use this +to change their style. Some packages, such as ~notmuch~, use this minor-mode automatically. The faces are not declared with ~defface~, meaning that it is better @@ -4768,41 +5103,43 @@ The Modus themes are a collective effort. Every bit of work matters. Le Gouguec, Koen van Greevenbroek, Kostadin Ninev, Madhavan Krishnan, Manuel Giraud, Markus Beppler, Matthew Stevenson, Mauro Aranda, Nicolas De Jaeghere, Paul David, Philip Kaludercic, Pierre - Téchoueyres, Rudolf Adamkovič, Stephen Gildea, Shreyas Ragavan, - Stefan Kangas, Utkarsh Singh, Vincent Murphy, Xinglu Chen, Yuanchen - Xie, okamsn. + Téchoueyres, Rudolf Adamkovič, Sergey Nichiporchik, Stephen Gildea, + Shreyas Ragavan, Stefan Kangas, Utkarsh Singh, Vincent Murphy, + Xinglu Chen, Yuanchen Xie, okamsn. + Ideas and user feedback :: Aaron Jensen, Adam Porter, Adam Spiers, Adrian Manea, Aleksei Pirogov, Alex Griffin, Alex Koen, Alex Peitsinis, Alexey Shmalko, Alok Singh, Anders Johansson, André Alexandre Gomes, Andrew Tropin, Antonio Hernández Blas, Arif Rezai, - Augusto Stoffel, Basil L.{{{space()}}} Contovounesios, Burgess - Chang, Charlotte Van Petegem, Christian Tietze, 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, - Iris Garcia, Ivan Popovych, James Ferguson, Jeremy Friesen, Jerry - Zhang, Johannes Grødem, John Haman, 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, Len - Trigg, Lennart C. Karssen, Luis Miguel Castañeda, Magne Hov, Manuel - Uberti, Mark Bestley, Mark Burton, Mark Simpson, Markus Beppler, + Augusto Stoffel, Basil L.{{{space()}}} Contovounesios, Bernd + Rellermeyer, Burgess Chang, Charlotte Van Petegem, Christian Tietze, + 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, + 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, Len Trigg, Lennart C. 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, Pablo Stafforini, Paul Poloskov, Pengji Zhang, Pete Kazmier, Peter Wu, Philip Kaludercic, Pierre Téchoueyres, Przemysław Kryger, Robert - Hepple, Roman Rudakov, Ryan Phillips, Rytis Paškauskas, Rudolf - Adamkovič, Sam Kleinman, Samuel Culpepper, Saša Janiška, Shreyas - Ragavan, Simon Pugnet, Tassilo Horn, Thibaut Verron, Thomas - Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, Tomasz - Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley. As - well as users: Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, - Fredrik, Moesasji, Nick, Summer Emacs, TheBlob42, Trey, bepolymathe, - bit9tream, derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, - okamsn, pRot0ta1p, soaringbird, tumashu, wakamenod. + Hepple, Roman Rudakov, Russell Sim, Ryan Phillips, Rytis Paškauskas, + Rudolf Adamkovič, Sam Kleinman, Samuel Culpepper, Saša Janiška, + Shreyas Ragavan, Simon Pugnet, Tassilo Horn, Thanos Apollo, Thibaut + Verron, Thomas Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, + Tomasz Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent + Foley, Zoltan Kiraly. As well as users: Ben, CsBigDataHub1, Emacs + Contrib, Eugene, Fourchaux, Fredrik, Moesasji, Nick, Summer Emacs, + TheBlob42, TitusMu, Trey, bepolymathe, bit9tream, bangedorrunt, + derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, okamsn, + pRot0ta1p, soaringbird, tumashu, wakamenod. + 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 2bee995c570..fff62e3da9f 100644 --- a/etc/themes/modus-operandi-deuteranopia-theme.el +++ b/etc/themes/modus-operandi-deuteranopia-theme.el @@ -83,7 +83,7 @@ (yellow-faint "#624416") (yellow-intense "#808000") (blue "#0031a9") - (blue-warmer "#354fcf") + (blue-warmer "#3548cf") (blue-cooler "#0000b0") (blue-faint "#003497") (blue-intense "#0000ff") @@ -157,7 +157,7 @@ (bg-completion "#c0deff") (bg-hover "#97dfed") (bg-hover-secondary "#f5d0a0") - (bg-hl-line "#d0d6ec") + (bg-hl-line "#dae5ec") (bg-region "#bdbdbd") (fg-region "#000000") @@ -182,26 +182,28 @@ ;;; Diffs - (bg-added "#d5d5ff") + (bg-added "#d5d7ff") (bg-added-faint "#e6e6ff") - (bg-added-refine "#b5b5ef") - (bg-added-intense "#579acc") - (fg-added "#333399") - (fg-added-intense "#3333cc") + (bg-added-refine "#babcef") + (bg-added-fringe "#275acc") + (fg-added "#303099") + (fg-added-intense "#0303cc") (bg-changed "#eecfdf") (bg-changed-faint "#f0dde5") (bg-changed-refine "#e0b0d0") - (bg-changed-intense "#9f7abf") + (bg-changed-fringe "#9f6ab0") (fg-changed "#6f1343") - (fg-changed-intense "#7f1f5f") + (fg-changed-intense "#7f0f9f") - (bg-removed "#fff585") - (bg-removed-faint "#f2f2bb") - (bg-removed-refine "#f0e068") - (bg-removed-intense "#d7c20a") + (bg-removed "#f4f099") + (bg-removed-faint "#f6f6b7") + (bg-removed-refine "#f0e56f") + (bg-removed-fringe "#c0b200") (fg-removed "#553d00") - (fg-removed-intense "#655000") + (fg-removed-intense "#7f6f00") + + (bg-diff-context "#f3f3f3") ;;; Paren match @@ -380,10 +382,7 @@ 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. - -Semantic color mappings cannot be recursive: their value must be -either COLOR-NAME or HEX-VALUE.") +exists in the palette and is associated with a HEX-VALUE.") (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 09ca8888073..0705f926de6 100644 --- a/etc/themes/modus-operandi-theme.el +++ b/etc/themes/modus-operandi-theme.el @@ -81,7 +81,7 @@ (yellow-faint "#624416") (yellow-intense "#808000") (blue "#0031a9") - (blue-warmer "#354fcf") + (blue-warmer "#3548cf") (blue-cooler "#0000b0") (blue-faint "#003497") (blue-intense "#0000ff") @@ -155,7 +155,7 @@ (bg-completion "#c0deff") (bg-hover "#94d4ff") (bg-hover-secondary "#f5d0a0") - (bg-hl-line "#d0d6ec") + (bg-hl-line "#dae5ec") (bg-region "#bdbdbd") (fg-region "#000000") @@ -183,24 +183,26 @@ (bg-added "#c1f2d1") (bg-added-faint "#d8f8e1") (bg-added-refine "#aee5be") - (bg-added-intense "#8cca8c") + (bg-added-fringe "#6cc06c") (fg-added "#005000") (fg-added-intense "#006700") (bg-changed "#ffdfa9") (bg-changed-faint "#ffefbf") (bg-changed-refine "#fac090") - (bg-changed-intense "#d7c20a") + (bg-changed-fringe "#d7c20a") (fg-changed "#553d00") (fg-changed-intense "#655000") (bg-removed "#ffd8d5") (bg-removed-faint "#ffe9e9") (bg-removed-refine "#f3b5af") - (bg-removed-intense "#d84a4f") + (bg-removed-fringe "#d84a4f") (fg-removed "#8f1313") (fg-removed-intense "#aa2222") + (bg-diff-context "#f3f3f3") + ;;; Paren match (bg-paren-match "#5fcfff") @@ -378,10 +380,7 @@ 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. - -Semantic color mappings cannot be recursive: their value must be -either COLOR-NAME or HEX-VALUE.") +exists in the palette and is associated with a HEX-VALUE.") (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 52024ceee95..4bb820cf686 100644 --- a/etc/themes/modus-operandi-tinted-theme.el +++ b/etc/themes/modus-operandi-tinted-theme.el @@ -80,7 +80,7 @@ (yellow-faint "#624416") (yellow-intense "#808000") (blue "#0031a9") - (blue-warmer "#354fcf") + (blue-warmer "#3548cf") (blue-cooler "#0000b0") (blue-faint "#003497") (blue-intense "#0000ff") @@ -121,12 +121,12 @@ (bg-magenta-subtle "#ffddff") (bg-cyan-subtle "#bfefff") - (bg-red-nuanced "#fff1f0") - (bg-green-nuanced "#ecf7ed") - (bg-yellow-nuanced "#fff3da") - (bg-blue-nuanced "#f3f3ff") - (bg-magenta-nuanced "#fdf0ff") - (bg-cyan-nuanced "#ebf6fa") + (bg-red-nuanced "#ffe8f0") + (bg-green-nuanced "#e0f5e0") + (bg-yellow-nuanced "#f9ead0") + (bg-blue-nuanced "#ebebff") + (bg-magenta-nuanced "#f6e7ff") + (bg-cyan-nuanced "#e1f3fc") ;;; Uncommon accent backgrounds @@ -182,24 +182,26 @@ (bg-added "#c3ebc1") (bg-added-faint "#dcf8d1") (bg-added-refine "#acd6a5") - (bg-added-intense "#8cca8c") + (bg-added-fringe "#6cc06c") (fg-added "#005000") (fg-added-intense "#006700") (bg-changed "#ffdfa9") (bg-changed-faint "#ffefbf") (bg-changed-refine "#fac090") - (bg-changed-intense "#d7c20a") + (bg-changed-fringe "#c0b200") (fg-changed "#553d00") (fg-changed-intense "#655000") (bg-removed "#f4d0cf") (bg-removed-faint "#ffe9e5") (bg-removed-refine "#f3b5a7") - (bg-removed-intense "#d84a4f") + (bg-removed-fringe "#d84a4f") (fg-removed "#8f1313") (fg-removed-intense "#aa2222") + (bg-diff-context "#efe9df") + ;;; Paren match (bg-paren-match "#7fdfcf") @@ -377,10 +379,7 @@ 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. - -Semantic color mappings cannot be recursive: their value must be -either COLOR-NAME or HEX-VALUE.") +exists in the palette and is associated with a HEX-VALUE.") (defcustom modus-operandi-tinted-palette-overrides nil "Overrides for `modus-operandi-tinted-palette'. diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el index f4f33aa36e0..805f25b458f 100644 --- a/etc/themes/modus-themes.el +++ b/etc/themes/modus-themes.el @@ -6,7 +6,7 @@ ;; Maintainer: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht> ;; URL: https://git.sr.ht/~protesilaos/modus-themes ;; Mailing-List: https://lists.sr.ht/~protesilaos/modus-themes -;; Version: 4.0.1 +;; Version: 4.1.0 ;; Package-Requires: ((emacs "27.1")) ;; Keywords: faces, theme, accessibility @@ -88,6 +88,14 @@ modus-themes-faces :version "30.1" :group 'modus-themes-faces)) +(dolist (color '(red green yellow blue magenta cyan)) + (custom-declare-face + (intern (format "modus-themes-nuanced-%s" color)) + nil (format "Nuanced %s background." color) + :package-version '(modus-themes . "4.1.0") + :version "30.1" + :group 'modus-themes-faces)) + (dolist (color '(red green yellow blue magenta cyan)) (custom-declare-face (intern (format "modus-themes-subtle-%s" color)) @@ -329,6 +337,29 @@ modus-themes--set-option (theme (modus-themes--current-theme))) (modus-themes-load-theme theme)))) +(defcustom modus-themes-disable-other-themes t + "Disable all other themes when loading a Modus theme. + +When the value is non-nil, the commands `modus-themes-toggle' and +`modus-themes-select', as well as the `modus-themes-load-theme' +function, will disable all other themes while loading the +specified Modus theme. This is done to ensure that Emacs does +not blend two or more themes: such blends lead to awkward results +that undermine the work of the designer. + +When the value is nil, the aforementioned commands and function +will only disable other themes within the Modus collection. + +This option is provided because Emacs themes are not necessarily +limited to colors/faces: they can consist of an arbitrary set of +customizations. Users who use such customization bundles must +set this variable to a nil value." + :group 'modus-themes + :package-version '(modus-themes . "4.1.0") + :version "30.1" + :type 'boolean + :link '(info-link "(modus-themes) Disable other themes")) + (defconst modus-themes-items '( modus-operandi modus-vivendi modus-operandi-tinted modus-vivendi-tinted @@ -615,13 +646,14 @@ modus-themes-completions "Control the style of completion user interfaces. This affects Company, Corfu, Flx, Icomplete/Fido, Ido, Ivy, -Orderless, Vertico. The value is an alist of expressions, each -of which takes the form of (KEY . LIST-OF-PROPERTIES). KEY is a -symbol, while PROPERTIES is a list. Here is a sample, followed -by a description of the particularities: +Orderless, Vertico, and the standard *Completions* buffer. The +value is an alist of expressions, each of which takes the form +of (KEY . LIST-OF-PROPERTIES). KEY is a symbol, while PROPERTIES +is a list. Here is a sample, followed by a description of the +particularities: (setq modus-themes-completions - (quote ((matches . (extrabold background)) + (quote ((matches . (extrabold underline)) (selection . (semibold italic))))) The `matches' key refers to the highlighted characters that @@ -682,6 +714,12 @@ modus-themes-completions (cons :tag "Selection" (const selection) (set :tag "Style of selection" :greedy t + ,modus-themes--weight-widget + (const :tag "Italic font (oblique or slanted forms)" italic) + (const :tag "Underline" underline))) + (cons :tag "Fallback for both matches and selection" + (const t) + (set :tag "Style of both matches and selection" :greedy t ,modus-themes--weight-widget (const :tag "Italic font (oblique or slanted forms)" italic) (const :tag "Underline" underline)))) @@ -759,7 +797,25 @@ modus-themes-common-palette-overrides :group 'modus-themes :package-version '(modus-themes . "4.0.0") :version "30.1" - :type '(repeat (list symbol (choice symbol string))) ; TODO 2022-12-18: Refine overrides' :type + :type '(repeat (list symbol (choice symbol string))) + ;; ;; NOTE 2023-01-07: The following is a functioning version of the + ;; ;; intended :type. However, I think the Custom UI is really + ;; ;; awkward for this specific case. Maybe the generic type I have + ;; ;; above is better, as it encourages the user to write out the + ;; ;; code and read the manual. Counter-arguments are welcome. + ;; + ;; :type `(repeat (list (radio :tag "Palette key to override" + ;; ,@(mapcar (lambda (x) + ;; (list 'const x)) + ;; (mapcar #'car (modus-themes--current-theme-palette)))) + ;; (choice :tag "Value to assign" :value unspecified + ;; (const :tag "`unspecified' (remove the original color)" unspecified) + ;; (string :tag "String with color name (e.g. \"gray50\") or hex RGB (e.g. \"#123456\")" + ;; :match-inline (color-supported-p val)) + ;; (radio :tag "Palette key to map to" + ;; ,@(mapcar (lambda (x) + ;; (list 'const x)) + ;; (mapcar #'car (modus-themes--current-theme-palette))))))) :set #'modus-themes--set-option :initialize #'custom-initialize-default :link '(info-link "(modus-themes) Palette overrides")) @@ -1020,7 +1076,8 @@ modus-themes--list-known-themes (defun modus-themes--current-theme () "Return first enabled Modus theme." - (car (modus-themes--list-enabled-themes))) + (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. @@ -1052,13 +1109,71 @@ modus-themes--current-theme-palette (modus-themes--palette-value theme)) (user-error "No enabled Modus theme could be found"))) +(defun modus-themes--disable-themes () + "Disable themes per `modus-themes-disable-other-themes'." + (mapc #'disable-theme + (if modus-themes-disable-other-themes + custom-enabled-themes + (modus-themes--list-known-themes)))) + (defun modus-themes-load-theme (theme) - "Load THEME while disabling other Modus themes. -Run `modus-themes-after-load-theme-hook'." - (mapc #'disable-theme (modus-themes--list-known-themes)) + "Load THEME while disabling other themes. + +Which themes are disabled is determined by the user option +`modus-themes-disable-other-themes'. + +Run the `modus-themes-after-load-theme-hook' as the final step +after loading the THEME." + (modus-themes--disable-themes) (load-theme theme :no-confirm) (run-hooks 'modus-themes-after-load-theme-hook)) +(defun modus-themes--retrieve-palette-value (color palette) + "Return COLOR from PALETTE. +Use recursion until COLOR is retrieved as a string. Refrain from +doing so if the value of COLOR is not a key in the PALETTE. + +Return `unspecified' if the value of COLOR cannot be determined. +This symbol is accepted by faces and is thus harmless. + +This function is used in the macros `modus-themes-theme', +`modus-themes-with-colors'." + (let ((value (car (alist-get color palette)))) + (cond + ((or (stringp value) + (eq value 'unspecified)) + value) + ((and (symbolp value) + (memq value (mapcar #'car palette))) + (modus-themes--retrieve-palette-value value palette)) + (t + 'unspecified)))) + +(defun modus-themes-get-color-value (color &optional overrides theme) + "Return color value of named COLOR for current Modus theme. + +COLOR is a symbol that represents a named color entry in the +palette. + +If the value is the name of another color entry in the +palette (so a mapping), recur until you find the underlying color +value. + +With optional OVERRIDES as a non-nil value, account for palette +overrides. Else use the default palette. + +With optional THEME as a symbol among `modus-themes-items', use +the palette of that item. Else use the current Modus theme. + +If COLOR is not present in the palette, return the `unspecified' +symbol, which is safe when used as a face attribute's value." + (if-let* ((palette (if theme + (modus-themes--palette-value theme overrides) + (modus-themes--current-theme-palette overrides))) + (value (modus-themes--retrieve-palette-value color palette))) + value + 'unspecified)) + ;;;; Commands (make-obsolete 'modus-themes-load-themes nil "4.0.0") @@ -1080,7 +1195,8 @@ modus-themes--select-prompt ;;;###autoload (defun modus-themes-select (theme) "Load a Modus THEME using minibuffer completion. -Run `modus-themes-after-load-theme-hook' after loading the theme." +Run `modus-themes-after-load-theme-hook' after loading the theme. +Disable other themes per `modus-themes-disable-other-themes'." (interactive (list (modus-themes--select-prompt))) (modus-themes-load-theme theme)) @@ -1100,7 +1216,8 @@ modus-themes-toggle prompt with completion for a theme among our collection (this is practically the same as the `modus-themes-select' command). -Run `modus-themes-after-load-theme-hook' after loading the theme." +Run `modus-themes-after-load-theme-hook' after loading the theme. +Disable other themes per `modus-themes-disable-other-themes'." (interactive) (if-let* ((themes (modus-themes--toggle-theme-p)) (one (car themes)) @@ -1114,15 +1231,12 @@ modus-themes--list-colors-render "Render colors in BUFFER from THEME for `modus-themes-list-colors'. Optional MAPPINGS changes the output to only list the semantic color mappings of the palette, instead of its named colors." - (let* ((current (modus-themes--palette-value theme :overrides)) + (let* ((current-palette (modus-themes--palette-value theme mappings)) (palette (if mappings (seq-remove (lambda (cell) - (or (stringp (cadr cell)) - (eq (cadr cell) 'unspecified))) - current) - (seq-remove (lambda (cell) - (symbolp (cadr cell))) - current))) + (stringp (cadr cell))) + current-palette) + current-palette)) (current-buffer buffer) (current-theme theme)) (with-help-window buffer @@ -1136,28 +1250,27 @@ modus-themes--list-colors-render (insert " ") (dolist (cell palette) (let* ((name (car cell)) - (color (cadr cell)) - (mapping (if mappings - (cadr (seq-find (lambda (c) - (eq (car c) color)) - current)) - color)) - (fg (readable-foreground-color mapping)) - (pad (make-string 5 ?\s))) + (color (modus-themes-get-color-value name mappings theme)) + (pad (make-string 10 ?\s)) + (fg (if (eq color 'unspecified) + (progn + (readable-foreground-color (modus-themes-get-color-value 'bg-main nil theme)) + (setq pad (make-string 6 ?\s))) + (readable-foreground-color color)))) (let ((old-point (point))) - (insert (format "%s %s" mapping pad)) - (put-text-property old-point (point) 'face `( :foreground ,mapping))) + (insert (format "%s %s" color pad)) + (put-text-property old-point (point) 'face `( :foreground ,color))) (let ((old-point (point))) - (insert (format " %s %s %s\n" mapping pad name)) + (insert (format " %s %s %s\n" color pad name)) (put-text-property old-point (point) - 'face `( :background ,mapping + 'face `( :background ,color :foreground ,fg :extend t))) ;; We need this to properly render the last line. (insert " "))) (setq-local revert-buffer-function (lambda (_ignore-auto _noconfirm) - (modus-themes--list-colors-render current-buffer current-theme))))))) + (modus-themes--list-colors-render current-buffer current-theme mappings))))))) (defvar modus-themes--list-colors-prompt-history '() "Minibuffer history for `modus-themes--list-colors-prompt'.") @@ -1319,7 +1432,7 @@ modus-themes--org-block (eq modus-themes-org-blocks 'greyscale)))) (list :inherit 'modus-themes-fixed-pitch :background (if gray bg 'unspecified) - :foreground fg + :foreground (if gray 'unspecified fg) :extend (if gray t 'unspecified)))) (defun modus-themes--completion-line (bg) @@ -1408,6 +1521,13 @@ modus-themes-faces `(modus-themes-fg-cyan-cooler ((,c :foreground ,cyan-cooler))) `(modus-themes-fg-cyan-faint ((,c :foreground ,cyan-faint))) `(modus-themes-fg-cyan-intense ((,c :foreground ,cyan-intense))) +;;;;; nuanced colored backgrounds + `(modus-themes-nuanced-red ((,c :background ,bg-red-nuanced :extend t))) + `(modus-themes-nuanced-green ((,c :background ,bg-green-nuanced :extend t))) + `(modus-themes-nuanced-yellow ((,c :background ,bg-yellow-nuanced :extend t))) + `(modus-themes-nuanced-blue ((,c :background ,bg-blue-nuanced :extend t))) + `(modus-themes-nuanced-magenta ((,c :background ,bg-magenta-nuanced :extend t))) + `(modus-themes-nuanced-cyan ((,c :background ,bg-cyan-nuanced :extend t))) ;;;;; subtle colored backgrounds `(modus-themes-subtle-red ((,c :background ,bg-red-subtle :foreground ,fg-main))) `(modus-themes-subtle-green ((,c :background ,bg-green-subtle :foreground ,fg-main))) @@ -1494,6 +1614,7 @@ modus-themes-faces `(header-line-highlight ((,c :inherit highlight))) `(help-argument-name ((,c :inherit modus-themes-slant :foreground ,variable))) `(help-key-binding ((,c :inherit modus-themes-key-binding))) + `(highlight ((,c :background ,bg-hover :foreground ,fg-main))) `(homoglyph ((,c :foreground ,warning))) `(ibuffer-locked-buffer ((,c :foreground ,warning))) `(icon-button ((,c :inherit modus-themes-button))) @@ -1509,7 +1630,7 @@ modus-themes-faces `(read-multiple-choice-face ((,c :inherit (bold modus-themes-mark-alt)))) `(rectangle-preview ((,c :inherit secondary-selection))) `(region ((,c :background ,bg-region :foreground ,fg-region))) - `(secondary-selection ((,c :background ,bg-hover-secondary))) + `(secondary-selection ((,c :background ,bg-hover-secondary :foreground ,fg-main))) `(separator-line ((,c :underline ,bg-active))) `(shadow ((,c :foreground ,fg-dim))) `(success ((,c :inherit bold :foreground ,info))) @@ -1519,7 +1640,7 @@ modus-themes-faces `(button ((,c :background ,bg-link :foreground ,fg-link :underline ,underline-link))) `(link ((,c :inherit button))) `(link-visited ((,c :background ,bg-link-visited :foreground ,fg-link-visited :underline ,underline-link-visited))) - `(tooltip ((,c :background ,bg-active))) + `(tooltip ((,c :background ,bg-active :foreground ,fg-main))) ;;;;; agda2-mode `(agda2-highlight-bound-variable-face ((,c :inherit font-lock-variable-name-face))) `(agda2-highlight-catchall-clause-face ((,c :background ,bg-inactive))) @@ -1778,7 +1899,7 @@ modus-themes-faces `(company-scrollbar-bg ((,c :background ,bg-active))) `(company-scrollbar-fg ((,c :background ,fg-main))) `(company-template-field ((,c :background ,bg-active))) - `(company-tooltip ((,c :background ,bg-inactive))) + `(company-tooltip ((,c :background ,bg-dim))) `(company-tooltip-annotation ((,c :inherit completions-annotations))) `(company-tooltip-common ((,c :inherit company-echo-common))) `(company-tooltip-deprecated ((,c :inherit company-tooltip :strike-through t))) @@ -1796,16 +1917,18 @@ modus-themes-faces `(compilation-mode-line-exit ((,c :inherit bold))) `(compilation-mode-line-fail ((,c :inherit bold :foreground ,modeline-err))) `(compilation-mode-line-run ((,c :inherit bold :foreground ,modeline-warning))) - `(compilation-warning ((,c :inherit warning))) + `(compilation-warning ((,c :inherit modus-themes-bold :foreground ,warning))) ;;;;; completions `(completions-annotations ((,c :inherit modus-themes-slant :foreground ,docstring))) `(completions-common-part ((,c :inherit modus-themes-completion-match-0))) `(completions-first-difference ((,c :inherit modus-themes-completion-match-1))) ;;;;; consult `(consult-async-split ((,c :inherit error))) + `(consult-file ((,c :inherit modus-themes-bold :foreground ,info))) `(consult-key ((,c :inherit modus-themes-key-binding))) `(consult-imenu-prefix ((,c :inherit shadow))) `(consult-line-number ((,c :inherit shadow))) + `(consult-line-number-prefix ((,c :inherit shadow))) ;;;;; corfu `(corfu-current ((,c :inherit modus-themes-completion-selected))) `(corfu-bar ((,c :background ,fg-dim))) @@ -1838,7 +1961,7 @@ modus-themes-faces `(csv-separator-face ((,c :foreground ,red-intense))) ;;;;; ctrlf `(ctrlf-highlight-active ((,c :inherit modus-themes-search-current))) - `(ctrlf-highlight-line ((,c :inherit highlight))) + `(ctrlf-highlight-line ((,c :background ,bg-hl-line :extend t))) `(ctrlf-highlight-passive ((,c :inherit modus-themes-search-lazy))) ;;;;; custom (M-x customize) `(custom-button ((,c :inherit modus-themes-button))) @@ -1858,6 +1981,9 @@ modus-themes-faces `(custom-group-tag ((,c :inherit bold :foreground ,builtin))) `(custom-group-tag-1 ((,c :inherit bold :foreground ,constant))) `(custom-variable-tag ((,c :inherit bold :foreground ,variable))) +;;;;; dashboard + `(dashboard-heading ((,c :foreground ,name))) + `(dashboard-items-face (( ))) ; use the underlying style of all-the-icons ;;;;; deadgrep `(deadgrep-filename-face ((,c :inherit bold :foreground ,name))) `(deadgrep-match-face ((,c :inherit match))) @@ -1879,18 +2005,18 @@ modus-themes-faces `(dictionary-word-definition-face (( ))) `(dictionary-word-entry-face ((,c :inherit font-lock-comment-face))) ;;;;; diff-hl - `(diff-hl-change ((,c :background ,bg-changed-intense))) - `(diff-hl-delete ((,c :background ,bg-removed-intense))) - `(diff-hl-insert ((,c :background ,bg-added-intense))) + `(diff-hl-change ((,c :background ,bg-changed-fringe))) + `(diff-hl-delete ((,c :background ,bg-removed-fringe))) + `(diff-hl-insert ((,c :background ,bg-added-fringe))) `(diff-hl-reverted-hunk-highlight ((,c :background ,fg-main :foreground ,bg-main))) ;;;;; diff-mode - `(diff-added ((,c :background ,bg-added))) - `(diff-changed ((,c :background ,bg-changed :extend t))) + `(diff-added ((,c :background ,bg-added :foreground ,fg-added))) + `(diff-changed ((,c :background ,bg-changed :foreground ,fg-changed :extend t))) `(diff-changed-unspecified ((,c :inherit diff-changed))) - `(diff-removed ((,c :background ,bg-removed))) - `(diff-refine-added ((,c :background ,bg-added-refine))) - `(diff-refine-changed ((,c :background ,bg-changed-refine))) - `(diff-refine-removed ((,c :background ,bg-removed-refine))) + `(diff-removed ((,c :background ,bg-removed :foreground ,fg-removed))) + `(diff-refine-added ((,c :background ,bg-added-refine :foreground ,fg-added))) + `(diff-refine-changed ((,c :background ,bg-changed-refine :foreground ,fg-changed))) + `(diff-refine-removed ((,c :background ,bg-removed-refine :foreground ,fg-removed))) `(diff-indicator-added ((,c :inherit diff-added :foreground ,fg-added-intense))) `(diff-indicator-changed ((,c :inherit diff-changed :foreground ,fg-changed-intense))) `(diff-indicator-removed ((,c :inherit diff-removed :foreground ,fg-removed-intense))) @@ -2001,18 +2127,18 @@ modus-themes-faces `(doom-modeline-urgent ((,c :inherit bold-italic :foreground ,modeline-err))) `(doom-modeline-warning ((,c :inherit warning))) ;;;;; ediff - `(ediff-current-diff-A ((,c :inherit diff-removed))) + `(ediff-current-diff-A ((,c :background ,bg-removed :foreground ,fg-removed))) `(ediff-current-diff-Ancestor ((,c :background ,bg-region))) ; TODO 2022-11-29: Needs review - `(ediff-current-diff-B ((,c :inherit diff-added))) - `(ediff-current-diff-C ((,c :inherit diff-changed))) - `(ediff-even-diff-A ((,c :background ,bg-dim))) - `(ediff-even-diff-Ancestor ((,c :background ,bg-dim))) - `(ediff-even-diff-B ((,c :background ,bg-dim))) - `(ediff-even-diff-C ((,c :background ,bg-dim))) - `(ediff-fine-diff-A ((,c :inherit diff-refine-removed))) - `(ediff-fine-diff-Ancestor ((,c :inherit diff-refine-cyan))) - `(ediff-fine-diff-B ((,c :inherit diff-refine-added))) - `(ediff-fine-diff-C ((,c :inherit diff-refine-changed))) + `(ediff-current-diff-B ((,c :background ,bg-added :foreground ,fg-added))) + `(ediff-current-diff-C ((,c :background ,bg-changed :foreground ,fg-changed))) + `(ediff-even-diff-A ((,c :background ,bg-diff-context))) + `(ediff-even-diff-Ancestor ((,c :background ,bg-diff-context))) + `(ediff-even-diff-B ((,c :background ,bg-diff-context))) + `(ediff-even-diff-C ((,c :background ,bg-diff-context))) + `(ediff-fine-diff-A ((,c :background ,bg-removed-refine :foreground ,fg-removed))) + `(ediff-fine-diff-Ancestor ((,c :inherit modus-themes-subtle-cyan))) + `(ediff-fine-diff-B ((,c :background ,bg-added-refine :foreground ,fg-added))) + `(ediff-fine-diff-C ((,c :background ,bg-changed-refine :foreground ,fg-changed))) `(ediff-odd-diff-A ((,c :inherit ediff-even-diff-A))) `(ediff-odd-diff-Ancestor ((,c :inherit ediff-even-diff-Ancestor))) `(ediff-odd-diff-B ((,c :inherit ediff-even-diff-B))) @@ -2025,7 +2151,7 @@ modus-themes-faces `(ein:markdowncell-input-area-face (( ))) `(ein:notification-tab-normal ((,c :underline t))) ;;;;; eglot - `(eglot-mode-line ((,c :inherit bold :foreground ,modeline-info))) + `(eglot-mode-line ((,c :inherit modus-themes-bold :foreground ,modeline-info))) ;;;;; el-search `(el-search-highlight-in-prompt-face ((,c :inherit italic))) `(el-search-match ((,c :inherit modus-themes-search-current))) @@ -2236,15 +2362,15 @@ modus-themes-faces `(git-commit-overlong-summary ((,c :inherit warning))) `(git-commit-summary ((,c :inherit bold :foreground ,blue))) ;;;;; git-gutter - `(git-gutter:added ((,c :background ,bg-added-intense))) - `(git-gutter:deleted ((,c :background ,bg-removed-intense))) - `(git-gutter:modified ((,c :background ,bg-changed-intense))) + `(git-gutter:added ((,c :background ,bg-added-fringe))) + `(git-gutter:deleted ((,c :background ,bg-removed-fringe))) + `(git-gutter:modified ((,c :background ,bg-changed-fringe))) `(git-gutter:separator ((,c :inherit modus-themes-intense-cyan))) `(git-gutter:unchanged ((,c :inherit modus-themes-intense-magenta))) ;;;;; git-gutter-fr - `(git-gutter-fr:added ((,c :background ,bg-added-intense))) - `(git-gutter-fr:deleted ((,c :background ,bg-removed-intense))) - `(git-gutter-fr:modified ((,c :background ,bg-changed-intense))) + `(git-gutter-fr:added ((,c :background ,bg-added-fringe))) + `(git-gutter-fr:deleted ((,c :background ,bg-removed-fringe))) + `(git-gutter-fr:modified ((,c :background ,bg-changed-fringe))) ;;;;; git-rebase `(git-rebase-comment-hash ((,c :inherit (bold font-lock-comment-face) :foreground ,identifier))) `(git-rebase-comment-heading ((,c :inherit (bold font-lock-comment-face)))) @@ -2377,7 +2503,6 @@ modus-themes-faces :background "white" :foreground "#af6400" :inverse-video t) (((class color) (min-colors 88) (background dark)) :background "black" :foreground "#faea00" :inverse-video t))) - `(highlight ((,c :background ,bg-hover))) `(highlight-changes ((,c :foreground ,warning :underline nil))) `(highlight-changes-delete ((,c :foreground ,err :underline t))) `(hl-line ((,c :background ,bg-hl-line :extend t))) @@ -2551,8 +2676,8 @@ modus-themes-faces `(kaocha-runner-success-face ((,c :inherit success))) `(kaocha-runner-warning-face ((,c :inherit warning))) ;;;;; keycast - `(keycast-command ((,c :inherit bold :foreground ,keybind))) - `(keycast-key ((,c :background ,keybind :foreground ,bg-main :box ,keybind))) + `(keycast-command ((,c :inherit bold))) + `(keycast-key ((,c :background ,keybind :foreground ,bg-main))) ;;;;; ledger-mode `(ledger-font-auto-xact-face ((,c :inherit font-lock-builtin-face))) `(ledger-font-account-name-face ((,c :foreground ,name))) @@ -2563,7 +2688,7 @@ modus-themes-faces `(ledger-font-payee-cleared-face ((,c :inherit success))) `(ledger-font-payee-pending-face ((,c :inherit warning))) `(ledger-font-payee-uncleared-face ((,c :inherit error))) - `(ledger-font-xact-highlight-face ((,c :inherit highlight))) + `(ledger-font-xact-highlight-face ((,c :background ,bg-hl-line :extend t))) ;;;;; leerzeichen `(leerzeichen ((,c :background ,bg-inactive))) ;;;;; line numbers (display-line-numbers-mode and global variant) @@ -2595,7 +2720,7 @@ modus-themes-faces `(magit-diff-base ((,c :background ,bg-changed-faint :foreground ,fg-changed))) `(magit-diff-base-highlight ((,c :background ,bg-changed :foreground ,fg-changed))) `(magit-diff-context ((,c :inherit shadow))) - `(magit-diff-context-highlight ((,c :background ,bg-dim))) + `(magit-diff-context-highlight ((,c :background ,bg-diff-context))) `(magit-diff-file-heading ((,c :inherit bold :foreground ,accent-0))) `(magit-diff-file-heading-highlight ((,c :inherit magit-diff-file-heading :background ,bg-inactive))) `(magit-diff-file-heading-selection ((,c :inherit bold :background ,bg-hover-secondary))) @@ -2668,7 +2793,7 @@ modus-themes-faces `(marginalia-archive ((,c :foreground ,accent-0))) `(marginalia-char ((,c :foreground ,accent-2))) `(marginalia-date ((,c :foreground ,date-common))) - `(marginalia-documentation ((,c :inherit italic :foreground ,docstring))) + `(marginalia-documentation ((,c :inherit modus-themes-slant :foreground ,docstring))) `(marginalia-file-name (( ))) `(marginalia-file-owner ((,c :inherit shadow))) `(marginalia-file-priv-dir ((,c :foreground ,accent-0))) @@ -2720,7 +2845,7 @@ modus-themes-faces `(markdown-table-face ((,c :inherit modus-themes-fixed-pitch :foreground ,prose-table))) `(markdown-url-face ((,c :foreground ,fg-alt))) ;;;;; markup-faces (`adoc-mode') - `(markup-attribute-face ((,c :inherit (italic markup-meta-face)))) + `(markup-attribute-face ((,c :inherit (modus-themes-slant markup-meta-face)))) `(markup-bold-face ((,c :inherit bold))) `(markup-code-face ((,c :foreground ,prose-code))) `(markup-comment-face ((,c :inherit font-lock-comment-face))) @@ -2809,7 +2934,7 @@ modus-themes-faces `(mu4e-footer-face ((,c :inherit italic :foreground ,fg-alt))) `(mu4e-forwarded-face ((,c :inherit italic :foreground ,info))) `(mu4e-header-face ((,c :inherit shadow))) - `(mu4e-header-highlight-face ((,c :inherit highlight))) + `(mu4e-header-highlight-face ((,c :background ,bg-hl-line :extend t))) `(mu4e-header-key-face ((,c :inherit message-header-name))) `(mu4e-header-marks-face ((,c :inherit mu4e-special-header-value-face))) `(mu4e-header-title-face ((,c :foreground ,fg-alt))) @@ -2920,7 +3045,7 @@ modus-themes-faces `(orderless-match-face-3 ((,c :inherit modus-themes-completion-match-3))) ;;;;; org `(org-agenda-calendar-event ((,c :foreground ,date-event))) - `(org-agenda-calendar-sexp ((,c :inherit (italic org-agenda-calendar-event)))) + `(org-agenda-calendar-sexp ((,c :inherit (modus-themes-slant org-agenda-calendar-event)))) `(org-agenda-clocking ((,c :inherit modus-themes-mark-alt))) `(org-agenda-column-dateline ((,c :background ,bg-inactive))) `(org-agenda-current-time ((,c :foreground ,date-now))) @@ -2964,7 +3089,7 @@ modus-themes-faces `(org-headline-todo ((,c :inherit org-todo))) `(org-hide ((,c :foreground ,bg-main))) `(org-indent ((,c :inherit (fixed-pitch org-hide)))) - `(org-imminent-deadline ((,c :inherit bold :foreground ,date-deadline))) + `(org-imminent-deadline ((,c :inherit modus-themes-bold :foreground ,date-deadline))) `(org-latex-and-related ((,c :foreground ,type))) `(org-level-1 ((,c :inherit modus-themes-heading-1))) `(org-level-2 ((,c :inherit modus-themes-heading-2))) @@ -2985,7 +3110,7 @@ modus-themes-faces `(org-quote ((,c :inherit org-block))) `(org-scheduled ((,c :foreground ,date-scheduled))) `(org-scheduled-previously ((,c :inherit org-scheduled))) - `(org-scheduled-today ((,c :inherit (bold org-scheduled)))) + `(org-scheduled-today ((,c :inherit (modus-themes-bold org-scheduled)))) `(org-sexp-date ((,c :foreground ,date-common))) `(org-special-keyword ((,c :inherit org-drawer))) `(org-table ((,c :inherit modus-themes-fixed-pitch :foreground ,prose-table))) @@ -3007,8 +3132,8 @@ modus-themes-faces `(org-habit-clear-future-face ((,c :background ,bg-graph-blue-1))) `(org-habit-overdue-face ((,c :background ,bg-graph-red-0))) `(org-habit-overdue-future-face ((,c :background ,bg-graph-red-1))) - `(org-habit-ready-face ((,c :background ,bg-graph-blue-0 :foreground "black"))) ; fg is special case - `(org-habit-ready-future-face ((,c :background ,bg-graph-blue-1))) + `(org-habit-ready-face ((,c :background ,bg-graph-green-0 :foreground "black"))) ; fg is special case + `(org-habit-ready-future-face ((,c :background ,bg-graph-green-1))) ;;;;; org-journal `(org-journal-calendar-entry-face ((,c :inherit modus-themes-slant :foreground ,date-common))) `(org-journal-calendar-scheduled-face ((,c :inherit (modus-themes-slant org-scheduled)))) @@ -3097,7 +3222,7 @@ modus-themes-faces `(popup-tip-face ((,c :inherit modus-themes-intense-yellow))) ;;;;; powerline `(powerline-active0 ((,c :background ,fg-dim :foreground ,bg-main))) - `(powerline-active1 ((,c :inherit mode-line-active))) + `(powerline-active1 ((,c :inherit mode-line))) `(powerline-active2 ((,c :inherit mode-line-inactive))) `(powerline-inactive0 ((,c :background ,bg-active :foreground ,fg-dim))) `(powerline-inactive1 ((,c :background ,bg-main :foreground ,fg-dim))) @@ -3320,7 +3445,7 @@ modus-themes-faces `(swiper-background-match-face-2 ((,c :inherit modus-themes-completion-match-0))) `(swiper-background-match-face-3 ((,c :inherit modus-themes-completion-match-1))) `(swiper-background-match-face-4 ((,c :inherit modus-themes-completion-match-2))) - `(swiper-line-face ((,c :inherit highlight))) + `(swiper-line-face ((,c :background ,bg-hl-line :extend t))) `(swiper-match-face-1 (( ))) `(swiper-match-face-2 ((,c :inherit modus-themes-completion-match-0))) `(swiper-match-face-3 ((,c :inherit modus-themes-completion-match-1))) @@ -3753,24 +3878,24 @@ modus-themes-custom-variables (if (or (eq modus-themes-org-blocks 'tinted-background) (eq modus-themes-org-blocks 'rainbow)) `(org-src-block-faces - `(("emacs-lisp" (:inherit modus-themes-subtle-magenta :extend t)) - ("elisp" (:inherit modus-themes-subtle-magenta :extend t)) - ("clojure" (:inherit modus-themes-subtle-magenta :extend t)) - ("clojurescript" (:inherit modus-themes-subtle-magenta :extend t)) - ("c" (:inherit modus-themes-subtle-blue :extend t)) - ("c++" (:inherit modus-themes-subtle-blue :extend t)) - ("sh" (:inherit modus-themes-subtle-green :extend t)) - ("shell" (:inherit modus-themes-subtle-green :extend t)) - ("html" (:inherit modus-themes-subtle-yellow :extend t)) - ("xml" (:inherit modus-themes-subtle-yellow :extend t)) - ("css" (:inherit modus-themes-subtle-red :extend t)) - ("scss" (:inherit modus-themes-subtle-red :extend t)) - ("python" (:inherit modus-themes-subtle-green :extend t)) - ("ipython" (:inherit modus-themes-subtle-magenta :extend t)) - ("r" (:inherit modus-themes-subtle-cyan :extend t)) - ("yaml" (:inherit modus-themes-subtle-cyan :extend t)) - ("conf" (:inherit modus-themes-subtle-cyan :extend t)) - ("docker" (:inherit modus-themes-subtle-cyan :extend t)))) + `(("emacs-lisp" modus-themes-nuanced-magenta) + ("elisp" modus-themes-nuanced-magenta) + ("clojure" modus-themes-nuanced-magenta) + ("clojurescript" modus-themes-nuanced-magenta) + ("c" modus-themes-nuanced-blue) + ("c++" modus-themes-nuanced-blue) + ("sh" modus-themes-nuanced-green) + ("shell" modus-themes-nuanced-green) + ("html" modus-themes-nuanced-yellow) + ("xml" modus-themes-nuanced-yellow) + ("css" modus-themes-nuanced-red) + ("scss" modus-themes-nuanced-red) + ("python" modus-themes-nuanced-green) + ("ipython" modus-themes-nuanced-magenta) + ("r" modus-themes-nuanced-cyan) + ("yaml" modus-themes-nuanced-cyan) + ("conf" modus-themes-nuanced-cyan) + ("docker" modus-themes-nuanced-cyan))) `(org-src-block-faces '()))) "Custom variables for `modus-themes-theme'.") @@ -3792,14 +3917,10 @@ modus-themes-theme (let ((sym (gensym)) (colors (mapcar #'car (symbol-value palette)))) `(let* ((c '((class color) (min-colors 256))) - (,sym (append ,overrides modus-themes-common-palette-overrides ,palette)) + (,sym (modus-themes--palette-value ',name ',overrides)) ,@(mapcar (lambda (color) (list color - `(let* ((value (car (alist-get ',color ,sym)))) - (if (or (stringp value) - (eq value 'unspecified)) - value - (car (alist-get value ,sym)))))) + `(modus-themes--retrieve-palette-value ',color ,sym))) colors)) (ignore c ,@colors) ; Silence unused variable warnings (custom-theme-set-faces ',name ,@modus-themes-faces) @@ -3821,11 +3942,7 @@ modus-themes-with-colors (,sym (modus-themes--current-theme-palette :overrides)) ,@(mapcar (lambda (color) (list color - `(let* ((value (car (alist-get ',color ,sym)))) - (if (or (stringp value) - (eq value 'unspecified)) - value - (car (alist-get value ,sym)))))) + `(modus-themes--retrieve-palette-value ',color ,sym))) colors)) (ignore c ,@colors) ; Silence unused variable warnings ,@body))) diff --git a/etc/themes/modus-vivendi-deuteranopia-theme.el b/etc/themes/modus-vivendi-deuteranopia-theme.el index 2c3ecd72a03..57241c59b96 100644 --- a/etc/themes/modus-vivendi-deuteranopia-theme.el +++ b/etc/themes/modus-vivendi-deuteranopia-theme.el @@ -184,23 +184,25 @@ (bg-added "#003066") (bg-added-faint "#001a4f") (bg-added-refine "#0f4a77") - (bg-added-intense "#0f4fbf") + (bg-added-fringe "#006fff") (fg-added "#c4d5ff") - (fg-added-intense "#a0afff") + (fg-added-intense "#8080ff") (bg-changed "#2f123f") (bg-changed-faint "#1f022f") (bg-changed-refine "#3f325f") - (bg-changed-intense "#7f42af") + (bg-changed-fringe "#7f55a0") (fg-changed "#e3cfff") - (fg-changed-intense "#c0a4ff") + (fg-changed-intense "#cf9fe2") (bg-removed "#3d3d00") (bg-removed-faint "#281f00") (bg-removed-refine "#515100") - (bg-removed-intense "#dfd23a") + (bg-removed-fringe "#d0c03f") (fg-removed "#d4d48f") - (fg-removed-intense "#c0b05f") + (fg-removed-intense "#d0b05f") + + (bg-diff-context "#1a1a1a") ;;; Paren match @@ -379,10 +381,7 @@ 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. - -Semantic color mappings cannot be recursive: their value must be -either COLOR-NAME or HEX-VALUE.") +exists in the palette and is associated with a HEX-VALUE.") (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 d2ec3fd2753..5012f8fb7f8 100644 --- a/etc/themes/modus-vivendi-theme.el +++ b/etc/themes/modus-vivendi-theme.el @@ -182,24 +182,26 @@ (bg-added "#00381f") (bg-added-faint "#002910") (bg-added-refine "#034f2f") - (bg-added-intense "#237f3f") + (bg-added-fringe "#237f3f") (fg-added "#a0e0a0") (fg-added-intense "#80e080") (bg-changed "#363300") (bg-changed-faint "#2a1f00") (bg-changed-refine "#4a4a00") - (bg-changed-intense "#8a7a00") + (bg-changed-fringe "#8a7a00") (fg-changed "#efef80") (fg-changed-intense "#c0b05f") (bg-removed "#4f1119") (bg-removed-faint "#380a0f") (bg-removed-refine "#781a1f") - (bg-removed-intense "#b81a1f") + (bg-removed-fringe "#b81a1f") (fg-removed "#ffbfbf") (fg-removed-intense "#ff9095") + (bg-diff-context "#1a1a1a") + ;;; Paren match (bg-paren-match "#2f7f9f") @@ -377,10 +379,7 @@ 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. - -Semantic color mappings cannot be recursive: their value must be -either COLOR-NAME or HEX-VALUE.") +exists in the palette and is associated with a HEX-VALUE.") (defcustom modus-vivendi-palette-overrides nil diff --git a/etc/themes/modus-vivendi-tinted-theme.el b/etc/themes/modus-vivendi-tinted-theme.el index 001a8470986..79e7fc9e3d8 100644 --- a/etc/themes/modus-vivendi-tinted-theme.el +++ b/etc/themes/modus-vivendi-tinted-theme.el @@ -121,12 +121,12 @@ (bg-magenta-subtle "#552f5f") (bg-cyan-subtle "#004065") - (bg-red-nuanced "#2c0614") - (bg-green-nuanced "#001904") - (bg-yellow-nuanced "#221000") - (bg-blue-nuanced "#0f0e39") - (bg-magenta-nuanced "#230631") - (bg-cyan-nuanced "#041529") + (bg-red-nuanced "#350f14") + (bg-green-nuanced "#002718") + (bg-yellow-nuanced "#2c1f00") + (bg-blue-nuanced "#131c4d") + (bg-magenta-nuanced "#2f133f") + (bg-cyan-nuanced "#04253f") ;;; Graphs @@ -176,24 +176,26 @@ (bg-added "#003a2f") (bg-added-faint "#002922") (bg-added-refine "#035542") - (bg-added-intense "#237f4f") + (bg-added-fringe "#23884f") (fg-added "#a0e0a0") (fg-added-intense "#80e080") (bg-changed "#363300") (bg-changed-faint "#2a1f00") (bg-changed-refine "#4a4a00") - (bg-changed-intense "#8a7a00") + (bg-changed-fringe "#8f7a30") (fg-changed "#efef80") (fg-changed-intense "#c0b05f") (bg-removed "#4f1127") (bg-removed-faint "#380a19") (bg-removed-refine "#781a3a") - (bg-removed-intense "#b81a26") + (bg-removed-fringe "#b81a26") (fg-removed "#ffbfbf") (fg-removed-intense "#ff9095") + (bg-diff-context "#1a1f30") + ;;; Uncommon accent backgrounds (bg-ochre "#442c2f") @@ -377,10 +379,7 @@ 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. - -Semantic color mappings cannot be recursive: their value must be -either COLOR-NAME or HEX-VALUE.") +exists in the palette and is associated with a HEX-VALUE.") (defcustom modus-vivendi-tinted-palette-overrides nil "Overrides for `modus-vivendi-tinted-palette'. commit 6016f1982d34a88f626c9fcbeef51040d39d5f9f Author: Martin Rudalics Date: Wed Feb 22 18:48:33 2023 +0100 ; * etc/NEWS: Fix typo again diff --git a/etc/NEWS b/etc/NEWS index 4511f8e20f8..7f84d548149 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1177,7 +1177,7 @@ height use 'window-height' and 'body-lines', respectively. +++ *** 'display-buffer' provides more options for using an existing window. -The display buffer action functions 'display-buffer-reuse-window' and +The display buffer action functions 'display-buffer-use-some-window' and 'display-buffer-use-least-recent-window' now honor the action alist entry 'window-min-height' as well as the entries listed below to make the display of several buffers in a row more amenable. commit d411b4d1fd368bfe9dc72db7864d4c7d99babb18 Author: Sean Whitton Date: Wed Feb 22 10:17:08 2023 -0700 ; * etc/NEWS (C-x v !): Additional text. diff --git a/etc/NEWS b/etc/NEWS index 72f46a6ce59..4511f8e20f8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2168,6 +2168,10 @@ before execution. For example, in a Git repository, you can produce a log of more than one branch by typing 'C-x v ! C-x v b l' and then appending additional branch names to the 'git log' command. +The intention is that this command can be used to access a wide +variety of version control system-specific functionality from VC +without complexifying either the VC command set or the backend API. + --- *** 'C-x v v' in a diffs buffer allows to commit only some of the changes. This command is intended to allow you to commit only some of the commit a0b67252346c64ee188eec909a653dbc14cb5652 Author: Sean Whitton Date: Wed Feb 22 10:10:04 2023 -0700 ; * doc/emacs/vc1-xtra.texi (Preparing Patches): Wording tweaks. diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index 22b415613cb..3785e565676 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -288,16 +288,16 @@ Preparing Patches @findex vc-prepare-patch When collaborating on projects it is common to send patches via email, -to share changes. If you wish to do this using VC, you can use the +to share changes. You can do this using VC with the @code{vc-prepare-patch} command. This will prompt you for the revisions you wish to share, and which destination email address(es) -to use. The revisions are separated using commas (or whatever was -configured by @var{crm-separator}). The command will then prepare +to use. Separate the revisions using the value of +@var{crm-separator}, commas by default. The command will then prepare those revisions using your @abbr{MUA, Mail User Agent} for you to review and send. When invoked interactively in a Log View buffer with marked revisions, -these revisions will be used. +those marked revisions will be used. @vindex vc-prepare-patches-separately Depending on the value of the user option commit 170b419df0db761de4120e7e86d80bc430249015 Author: Mattias Engdegård Date: Wed Feb 22 14:13:07 2023 +0100 Declare `indirect-function` to be side-effect-free and error-free * lisp/emacs-lisp/byte-opt.el (side-effect-and-error-free-fns): Add `indirect-function` which is now error-free. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index a9630b6f7c2..456ec06a141 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1711,7 +1711,7 @@ byte-optimize-set eobp eolp eq equal floatp following-char framep hash-table-p - identity integerp integer-or-marker-p + identity indirect-function integerp integer-or-marker-p invocation-directory invocation-name keymapp keywordp list listp commit 43c4dd6f962df22507c41ea0ad20b58b5644becd Author: Eli Zaretskii Date: Wed Feb 22 17:40:00 2023 +0200 ; * doc/emacs/anti.texi (Antinews): Adjust to latest changes. diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi index c46110a530d..b25d8a8e3cc 100644 --- a/doc/emacs/anti.texi +++ b/doc/emacs/anti.texi @@ -69,13 +69,14 @@ Antinews @item In line with simplifying and eventually removing the native-compilation option, we've deleted the -@code{inhibit-automatic-native-compilation} variable and its support -code. This greatly simplifies how native compilation works and makes -your configure-time decision regarding native compilation in Emacs -clear-cut: either Emacs always compiles Lisp to native code before -using it, or it never does so; no more half measures and special -exceptions. For similar reasons, @code{native-compile-prune-cache} -and @code{startup-redirect-eln-cache} features are no longer part of +@option{--with-native-compilation=aot} configure-time option. This +greatly simplifies how native compilation works and makes your +configure-time decision regarding native compilation in Emacs +clear-cut: either Emacs compiles non-preloaded Lisp packages to native +code only before using it, or it never uses native compilation at all; +no more half measures and special exceptions. For similar reasons, +@code{native-compile-prune-cache} and +@code{startup-redirect-eln-cache} features are no longer part of Emacs. @item commit 20c654b6f8fa24ff458e09a1eb101ba198e671f8 Merge: 177d0cf2a9a db7096a532c Author: Michael Albinus Date: Wed Feb 22 15:35:48 2023 +0100 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs into emacs-29 commit 177d0cf2a9a4467c8106426e3f80395cc02d8ab5 Author: Michael Albinus Date: Wed Feb 22 15:35:03 2023 +0100 ; * etc/NEWS: Fix typos. diff --git a/etc/NEWS b/etc/NEWS index 8e406128357..72f46a6ce59 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1177,7 +1177,7 @@ height use 'window-height' and 'body-lines', respectively. +++ *** 'display-buffer' provides more options for using an existing window. -The display buffer action functions 'display-buffer-use-window' and +The display buffer action functions 'display-buffer-reuse-window' and 'display-buffer-use-least-recent-window' now honor the action alist entry 'window-min-height' as well as the entries listed below to make the display of several buffers in a row more amenable. commit db7096a532ca031687f9411df621900e869e9e98 Author: F. Jason Park Date: Wed Feb 22 06:24:17 2023 -0800 Yield to erc-move-to-prompt before unhiding prompt * lisp/erc/erc-backend.el (erc--hide-prompt): Change hook depth from 0 to 91 to allow the `move-to-prompt' module to do its thing. This feature was added by bug#54826 and first appeared in Emacs 29. * lisp/erc/erc-common.el (erc-server-user): Remove erroneous comment. The `buffers' field is a list of buffers. * test/lisp/erc/erc-tests.el (erc-hide-prompt): Use `erc--target' instead of `erc-default-recipients' because this is new code. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index cf0b734bd28..567443f5329 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -883,24 +883,22 @@ erc--unhide-prompt-on-self-insert (erc--unhide-prompt))) (defun erc--hide-prompt (proc) - (erc-with-all-buffers-of-server - proc nil ; sorta wish this was indent 2 - (when (and erc-hide-prompt - (or (eq erc-hide-prompt t) - ;; FIXME use `erc--target' after bug#48598 - (memq (if (erc-default-target) - (if (erc-channel-p (car erc-default-recipients)) - 'channel - 'query) - 'server) - erc-hide-prompt)) - (marker-position erc-insert-marker) - (marker-position erc-input-marker) - (get-text-property erc-insert-marker 'erc-prompt)) - (with-silent-modifications - (add-text-properties erc-insert-marker (1- erc-input-marker) - `(display ,erc-prompt-hidden))) - (add-hook 'pre-command-hook #'erc--unhide-prompt-on-self-insert 0 t)))) + (erc-with-all-buffers-of-server proc nil + (when (and erc-hide-prompt + (or (eq erc-hide-prompt t) + (memq (if erc--target + (if (erc--target-channel-p erc--target) + 'channel + 'query) + 'server) + erc-hide-prompt)) + (marker-position erc-insert-marker) + (marker-position erc-input-marker) + (get-text-property erc-insert-marker 'erc-prompt)) + (with-silent-modifications + (add-text-properties erc-insert-marker (1- erc-input-marker) + `(display ,erc-prompt-hidden))) + (add-hook 'pre-command-hook #'erc--unhide-prompt-on-self-insert 91 t)))) (defun erc-process-sentinel (cproc event) "Sentinel function for ERC process." diff --git a/lisp/erc/erc-common.el b/lisp/erc/erc-common.el index 994555acecf..0279b0a0bc4 100644 --- a/lisp/erc/erc-common.el +++ b/lisp/erc/erc-common.el @@ -48,9 +48,6 @@ erc-input ;; User data nickname host login full-name info ;; Buffers - ;; - ;; This is an alist of the form (BUFFER . CHANNEL-DATA), where - ;; CHANNEL-DATA is either nil or an erc-channel-user struct. (buffers nil)) (cl-defstruct (erc-channel-user (:type vector) :named) diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index 40a2d2de657..d6c63934163 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -147,7 +147,7 @@ erc-hide-prompt (should (looking-at-p (regexp-quote erc-prompt))) (setq erc-server-process (buffer-local-value 'erc-server-process (get-buffer "ServNet")) - erc-default-recipients '("#chan"))) + erc--target (erc--target-from-string "#chan"))) (with-current-buffer (get-buffer-create "bob") (erc-tests--send-prep) @@ -155,7 +155,7 @@ erc-hide-prompt (should (looking-at-p (regexp-quote erc-prompt))) (setq erc-server-process (buffer-local-value 'erc-server-process (get-buffer "ServNet")) - erc-default-recipients '("bob"))) + erc--target (erc--target-from-string "bob"))) (ert-info ("Value: t (default)") (should (eq erc-hide-prompt t)) commit db21c84bc9458a1ebaf93a4ff5d289ff96ddd33d Author: Eli Zaretskii Date: Wed Feb 22 16:24:59 2023 +0200 ; Improve doc string of 'C-q' * lisp/simple.el (read-quoted-char-radix, quoted-insert): Doc fix. diff --git a/lisp/simple.el b/lisp/simple.el index 5f23910efc6..b6efb06fc27 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -937,7 +937,7 @@ reindent-then-newline-and-indent (defcustom read-quoted-char-radix 8 "Radix for \\[quoted-insert] and other uses of `read-quoted-char'. -Legitimate radix values are 8, 10 and 16." +Supported radix values are 8, 10 and 16." :type '(choice (const 8) (const 10) (const 16)) :group 'editing-basics) @@ -1012,21 +1012,25 @@ quoted-insert This is useful for inserting control characters. With argument, insert ARG copies of the character. -If the first character you type after this command is an octal digit, -you should type a sequence of octal digits that specify a character code. -Any nondigit terminates the sequence. If the terminator is a RET, -it is discarded; any other terminator is used itself as input. +If the first character you type is an octal digit, the sequence of +one or more octal digits you type is interpreted to specify a +character code. Any character that is not an octal digit terminates +the sequence. If the terminator is a RET, it is discarded; any +other terminator is used itself as input and is inserted. + The variable `read-quoted-char-radix' specifies the radix for this feature; -set it to 10 or 16 to use decimal or hex instead of octal. +set it to 10 or 16 to use decimal or hex instead of octal. If you change +the radix, the characters interpreted as specifying a character code +change accordingly: 0 to 9 for decimal, 0 to F for hex. In overwrite mode, this function inserts the character anyway, and -does not handle octal digits specially. This means that if you use -overwrite as your normal editing mode, you can use this function to -insert characters when necessary. +does not handle octal (or decimal or hex) digits specially. This means +that if you use overwrite mode as your normal editing mode, you can use +this function to insert characters when necessary. In binary overwrite mode, this function does overwrite, and octal -digits are interpreted as a character code. This is intended to be -useful for editing binary files." +(or decimal or hex) digits are interpreted as a character code. This +is intended to be useful for editing binary files." (interactive "*p") (let* ((char ;; Avoid "obsolete" warnings for translation-table-for-input. commit a6be0be1db64fc5ab5863ffaf4a37fe2bcc6fe98 Author: Eli Zaretskii Date: Wed Feb 22 15:40:26 2023 +0200 ; Clarify "kill files" in Gnus manual * doc/misc/gnus.texi (Scoring): Make the reference to kill files less vague. (Bug#61325) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 486171a080a..d513726979b 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -19808,10 +19808,11 @@ Scoring @chapter Scoring @cindex scoring -Other people use @dfn{kill files}, but we here at Gnus Towers like -scoring better than killing, so we'd rather switch than fight. They do -something completely different as well, so sit up straight and pay -attention! +Other people use @dfn{kill files} (@pxref{Kill Files}, but we here at +Gnus Towers like scoring better than killing, so we'd rather switch +than fight. Scoring and score files processing are more powerful and +faster than processing of kill files. Scoring also does something +completely different as well, so sit up straight and pay attention! @vindex gnus-summary-mark-below All articles have a default score (@code{gnus-summary-default-score}), commit d816429e2f26731b790be77b8a8a5ce5261832ed Author: Augusto Stoffel Date: Mon Feb 20 10:49:22 2023 +0100 * lisp/progmodes/python.el (python--import-sources): Fix regexp (bug#61648) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0d714c31e9e..eab5e70af33 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6376,7 +6376,7 @@ python--import-sources "List files containing Python imports that may be useful in the current buffer." (if-let (((featurep 'project)) ;For compatibility with Emacs < 26 (proj (project-current))) - (seq-filter (lambda (s) (string-match-p "\\.py[ciw]?\\'" s)) + (seq-filter (lambda (s) (string-match-p "\\.py[iwx]?\\'" s)) (project-files proj)) (list default-directory))) commit 1f4886fdb09ad6eba5b24bc5032fa650da3a7fcd Author: Manuel Giraud Date: Sun Feb 19 21:03:57 2023 +0100 Do not error out on non image file (bug#61639) * lisp/image/image-dired.el (image-dired-display-thumbs): Do not insert non image file and do not display image-dired buffer if it is empty. diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 11632e7f28e..8e2a75a418f 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -585,13 +585,15 @@ image-dired-display-thumbs (erase-buffer)) (goto-char (point-max))) (dolist (file files) - (let ((thumb (image-dired--get-create-thumbnail-file file))) + (when (string-match-p (image-dired--file-name-regexp) file) (image-dired-insert-thumbnail - thumb file dired-buf + (image-dired--get-create-thumbnail-file file) file dired-buf (cl-incf image-dired--number-of-thumbnails))))) - (if do-not-pop - (display-buffer buf) - (pop-to-buffer buf)) + (if (> image-dired--number-of-thumbnails 0) + (if do-not-pop + (display-buffer buf) + (pop-to-buffer buf)) + (message "No images selected")) (image-dired--line-up-with-method) (image-dired--update-header-line)))) commit 003759a6dca730df6fae6c9bc8d4a47761b10014 Author: Eli Zaretskii Date: Wed Feb 22 15:16:25 2023 +0200 Explain effect of variable-pitch fonts on fill-column * doc/emacs/text.texi (Fill Commands): * doc/emacs/display.texi (Displaying Boundaries): * lisp/display-fill-column-indicator.el (display-fill-column-indicator-mode): Document caveats of using variable-pitch fonts with 'fill-column' and its indicator. (Bug#61677) diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index a86c12a0db7..7ec843180b8 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1402,7 +1402,11 @@ Displaying Boundaries functionality especially in @code{prog-mode} and its descendants (@pxref{Major Modes}) to indicate the position of a specific column that has some special meaning for formatting the source code of a -program. +program. This assumes the buffer uses a fixed-pitch font, where all +the characters (with the possible exception of double-width +characters) have the same width on display. If the buffer uses +variable-pitch fonts, the fill-column indicators on different lines +might appear unaligned. To activate the fill-column indication display, use the minor modes @code{display-fill-@-column-indicator-mode} and diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 3cc5f10582a..7037c8c943a 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -619,7 +619,12 @@ Fill Commands is to use the command @kbd{C-x f} (@code{set-fill-column}). With a numeric argument, it uses that as the new fill column. With just @kbd{C-u} as argument, it sets @code{fill-column} to the current -horizontal position of point. +horizontal position of point. Note that, by its very nature, +@code{fill-column} is measured in column units; the actual position of +that column on a graphical display depends on the font being used. In +particular, using variable-pitch fonts will cause the +@code{fill-column} occupy different horizontal positions on display in +different lines. @cindex centering @findex center-line diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index 7ad09de0765..45bdca2f5a5 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -53,6 +53,9 @@ display-fill-column-indicator-mode character for the indicator setting `display-fill-column-indicator-character'. The globalized version is `global-display-fill-column-indicator-mode', which see. +This minor mode assumes the buffer uses a fixed-pitch font; if you +use variable-pitch fonts, the indicators on different lines might +not appear aligned. See Info node `Displaying Boundaries' for details." :lighter nil (if display-fill-column-indicator-mode commit ba91a76659b911f90914a61a2f2d5c0073a8890a Author: Eli Zaretskii Date: Wed Feb 22 14:55:05 2023 +0200 Avoid division by zero in get_narrowed_* functions * src/xdisp.c (get_narrowed_width, get_narrowed_len): Return at least 1 as the value. (Bug#61704) diff --git a/src/xdisp.c b/src/xdisp.c index f5d54974b13..b64f1d35cbc 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3498,18 +3498,18 @@ init_iterator (struct it *it, struct window *w, static int get_narrowed_width (struct window *w) { - int fact; /* In a character-only terminal, only one font size is used, so we can use a smaller factor. */ - fact = EQ (Fterminal_live_p (Qnil), Qt) ? 2 : 3; - return fact * window_body_width (w, WINDOW_BODY_IN_CANONICAL_CHARS); + int fact = EQ (Fterminal_live_p (Qnil), Qt) ? 2 : 3; + int width = window_body_width (w, WINDOW_BODY_IN_CANONICAL_CHARS); + return fact * max (1, width); } static int get_narrowed_len (struct window *w) { - return get_narrowed_width (w) * - window_body_height (w, WINDOW_BODY_IN_CANONICAL_CHARS); + int height = window_body_height (w, WINDOW_BODY_IN_CANONICAL_CHARS); + return get_narrowed_width (w) * max (1, height); } ptrdiff_t commit 37e5d0cd853f9d1c3d024da5381311a0c0be978f Author: Mattias Engdegård Date: Wed Feb 22 12:55:45 2023 +0100 Use delete-char instead of backward-delete-char * lisp/bs.el (bs-delete): * lisp/dired-aux.el (dired-show-file-type): * lisp/emulation/viper-cmd.el (viper-insert-prev-from-insertion-ring): * lisp/man.el (Man-fontify-manpage, Man-cleanup-manpage): * lisp/net/mailcap.el (mailcap-parse-mailcap): * lisp/progmodes/antlr-mode.el (antlr-insert-makefile-rules): * lisp/textmodes/reftex-ref.el (reftex-reference): * lisp/vc/emerge.el: * lisp/woman.el (woman-man-buffer): * test/src/fns-tests.el (fns-tests-hash-buffer): Replace some calls to backward-delete-char with delete-char (negating the argument) since the former is intended for interactive use. This silences most of the interactive-only warnings. diff --git a/lisp/bs.el b/lisp/bs.el index 5f31530f068..70868591196 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -933,7 +933,7 @@ bs-delete (end-of-line) (if (eobp) (point) (1+ (point))))) (when (eobp) - (backward-delete-char 1) + (delete-char -1) (beginning-of-line) (recenter -1)) (bs--set-window-height))) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index c390017e190..6cb097f6bb3 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3730,7 +3730,7 @@ dired-show-file-type (process-file "file" nil t t "-L" "--" file) (process-file "file" nil t t "--" file)) (when (bolp) - (backward-delete-char 1)) + (delete-char -1)) (message "%s" (buffer-string))))) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 8cf81c33b5b..ee96d8efac6 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -1711,8 +1711,8 @@ viper-insert-prev-from-insertion-ring (if (eq viper-current-state 'replace-state) (undo 1) (if viper-last-inserted-string-from-insertion-ring - (backward-delete-char - (length viper-last-inserted-string-from-insertion-ring)))) + (delete-char + (- (length viper-last-inserted-string-from-insertion-ring))))) ) ;;first search through insertion history (setq viper-temp-insertion-ring (ring-copy viper-insertion-ring))) diff --git a/lisp/man.el b/lisp/man.el index 286edf9314e..9f75c07c791 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1262,21 +1262,21 @@ Man-fontify-manpage (progn (goto-char (point-min)) (while (and (search-forward "__\b\b" nil t) (not (eobp))) - (backward-delete-char 4) + (delete-char -4) (put-text-property (point) (1+ (point)) 'font-lock-face 'Man-underline)) (goto-char (point-min)) (while (search-forward "\b\b__" nil t) - (backward-delete-char 4) + (delete-char -4) (put-text-property (1- (point)) (point) 'font-lock-face 'Man-underline)))) (goto-char (point-min)) (while (and (search-forward "_\b" nil t) (not (eobp))) - (backward-delete-char 2) + (delete-char -2) (put-text-property (point) (1+ (point)) 'font-lock-face 'Man-underline)) (goto-char (point-min)) (while (search-forward "\b_" nil t) - (backward-delete-char 2) + (delete-char -2) (put-text-property (1- (point)) (point) 'font-lock-face 'Man-underline)) (goto-char (point-min)) (while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t) @@ -1294,7 +1294,7 @@ Man-fontify-manpage ;; condense it to a shorter line interspersed with ^H. Remove ^H with ;; their preceding chars (but don't put Man-overstrike). (Bug#5566) (goto-char (point-min)) - (while (re-search-forward ".\b" nil t) (backward-delete-char 2)) + (while (re-search-forward ".\b" nil t) (delete-char -2)) (goto-char (point-min)) ;; Try to recognize common forms of cross references. (Man-highlight-references) @@ -1375,9 +1375,9 @@ Man-cleanup-manpage (if (or interactive (not Man-sed-script)) (progn (goto-char (point-min)) - (while (search-forward "_\b" nil t) (backward-delete-char 2)) + (while (search-forward "_\b" nil t) (delete-char -2)) (goto-char (point-min)) - (while (search-forward "\b_" nil t) (backward-delete-char 2)) + (while (search-forward "\b_" nil t) (delete-char -2)) (goto-char (point-min)) (while (re-search-forward "\\(.\\)\\(\b\\1\\)+" nil t) (replace-match "\\1")) @@ -1392,7 +1392,7 @@ Man-cleanup-manpage ;; condense it to a shorter line interspersed with ^H. Remove ^H with ;; their preceding chars (but don't put Man-overstrike). (Bug#5566) (goto-char (point-min)) - (while (re-search-forward ".\b" nil t) (backward-delete-char 2)) + (while (re-search-forward ".\b" nil t) (delete-char -2)) (Man-softhyphen-to-minus)) (defun Man-bgproc-filter (process string) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index 722e98be2fc..10c5a7744c1 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -510,7 +510,7 @@ mailcap-parse-mailcap (skip-chars-forward "^;\n") ;; skip \; (while (eq (char-before) ?\\) - (backward-delete-char 1) + (delete-char -1) (forward-char) (skip-chars-forward "^;\n")) (if (eq (or (char-after save-pos) 0) ?') diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 7574ef86a6e..a54df19425a 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -2147,7 +2147,7 @@ antlr-insert-makefile-rules (antlr-makefile-insert-variable i " $(" ")")) (insert "\n" (car antlr-makefile-specification)))) (if (string-equal (car antlr-makefile-specification) "\n") - (backward-delete-char 1)) + (delete-char -1)) (when with-error (goto-char (point-min)) (insert antlr-help-unknown-file-text)) diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index 7315c1e1e74..da0779c8e8d 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el @@ -495,7 +495,7 @@ reftex-reference sep1 (cdr (assoc sep reftex-multiref-punctuation)) labels (cdr labels)) (when cut - (backward-delete-char cut) + (delete-char (- cut)) (setq cut nil)) ;; remove ~ if we do already have a space diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el index de09be80e7c..e95742b304a 100644 --- a/lisp/vc/emerge.el +++ b/lisp/vc/emerge.el @@ -1299,7 +1299,7 @@ emerge-merge-directories (setq ancestor-dir-files (cdr ancestor-dir-files)))) (if output-dir (insert "output=" output-dir f "\t")) - (backward-delete-char 1) + (delete-char -1) (insert "\n"))))) ;;; Common setup routines diff --git a/lisp/woman.el b/lisp/woman.el index 92cd425d32f..24f23c8e8f0 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1690,11 +1690,11 @@ woman-man-buffer (progn (goto-char (point-min)) (while (search-forward "__\b\b" nil t) - (backward-delete-char 4) + (delete-char -4) (woman-set-face (point) (1+ (point)) 'woman-italic)) (goto-char (point-min)) (while (search-forward "\b\b__" nil t) - (backward-delete-char 4) + (delete-char -4) (woman-set-face (1- (point)) (point) 'woman-italic)))) ;; Interpret overprinting to indicate bold face: diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index e0d6c96b360..0321b92d0bc 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -622,7 +622,7 @@ fns-tests-hash-buffer (insert "foo") (goto-char 2) (insert " ") - (backward-delete-char 1) + (delete-char -1) (buffer-hash)) (sha1 "foo")))) commit fb5dbf6de73fa034338448f1029c55f85d1078b4 Author: Eli Zaretskii Date: Tue Feb 21 22:06:30 2023 +0200 ; Fix documentation of 'icon-title-format'. diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 638b759ff13..e0766ad0b43 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -2653,8 +2653,9 @@ Frame Titles avoids problems with some window managers and desktop environments, where a change in a frame's title (when a frame is iconified) is interpreted as a request to raise the frame and/or give it input -focus. The default is a string identical to the default value of -@code{frame-title-format}. +focus. It is also useful if you want the frame's title to be the same +no matter if the frame is iconified or not. The default value is a +string identical to the default value of @code{frame-title-format}. @end defvar @defvar multiple-frames diff --git a/etc/NEWS b/etc/NEWS index 48f743fc9da..8e406128357 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1221,7 +1221,8 @@ the corresponding deleted frame. That value means to use 'frame-title-format' for iconified frames. This is useful with some window managers and desktop environments which treat changes in frame's title as requests to raise the frame -and/or give it input focus. +and/or give it input focus, or if you want the frame's title to be the +same no matter if the frame is iconified or not. ** Tab Bars and Tab Lines commit 48c9a50771383f08593ddc41db4f42bc633a7e56 Author: Martin Rudalics Date: Tue Feb 21 18:49:04 2023 +0100 * etc/NEWS: Mention new buffer display action alist entries diff --git a/etc/NEWS b/etc/NEWS index 0106953c1e0..48f743fc9da 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1175,6 +1175,33 @@ For example, a 'display-buffer-alist' entry of will make the body of the chosen window 40 columns wide. For the height use 'window-height' and 'body-lines', respectively. ++++ +*** 'display-buffer' provides more options for using an existing window. +The display buffer action functions 'display-buffer-use-window' and +'display-buffer-use-least-recent-window' now honor the action alist +entry 'window-min-height' as well as the entries listed below to make +the display of several buffers in a row more amenable. + ++++ +*** New buffer display action alist entry 'lru-frames'. +This allows to specify which frames 'display-buffer' should consider +when using a window that shows another buffer. + ++++ +*** New buffer display action alist entry 'lru-time'. +'display-buffer' will ignore windows with a use time higher than that +when using a window that shows another buffer. + ++++ +*** New buffer display action alist entry 'bump-use-time'. +This has 'display-buffer' bump the use time of any window it returns, +making it a less likely candidate for displaying another buffer. + ++++ +*** New buffer display action alist entry 'window-min-width'. +This allows to specify a minimum width of the window used to display a +buffer. + --- *** You can customize on which window 'scroll-other-window' operates. This is controlled by the new 'other-window-scroll-default' variable. commit 4dc1f2b9a01e35633acb7d01ec177e896b3b49c6 Author: Robert Pluim Date: Tue Feb 21 18:05:32 2023 +0100 ; * src/xterm.c (x_update_end): Condition on HAVE_XDBE diff --git a/src/xterm.c b/src/xterm.c index 14c7f89b6ec..e981a36fa9c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7360,8 +7360,10 @@ x_update_end (struct frame *f) MOUSE_HL_INFO (f)->mouse_face_defer = false; #ifdef USE_CAIRO +# ifdef HAVE_XDBE if (!FRAME_X_DOUBLE_BUFFERED_P (f) && FRAME_CR_CONTEXT (f)) cairo_surface_flush (cairo_get_target (FRAME_CR_CONTEXT (f))); +# endif #endif /* If double buffering is disabled, finish the update here. commit f1c838980601f05479bf29502c04fc5c38339c97 Author: Eli Zaretskii Date: Tue Feb 21 18:15:35 2023 +0200 Fix build --without-xdbe * src/xterm.c (x_end_cr_clip, handle_one_xevent): Condition double-buffering code on HAVE_XDBE. (Bug#61667) diff --git a/src/xterm.c b/src/xterm.c index 6a4b84babe4..14c7f89b6ec 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5830,8 +5830,10 @@ x_begin_cr_clip (struct frame *f, GC gc) x_end_cr_clip (struct frame *f) { cairo_restore (FRAME_CR_CONTEXT (f)); +#ifdef HAVE_XDBE if (FRAME_X_DOUBLE_BUFFERED_P (f)) x_mark_frame_dirty (f); +#endif } void @@ -20900,8 +20902,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, x_flush (WINDOW_XFRAME (XWINDOW (bar->window))); } +#ifdef HAVE_XDBE if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) x_drop_xrender_surfaces (f); +#endif goto OTHER; } commit ef38774c02c3dd0fde6cc67e2105fb2d86f6a49c Author: Robert Pluim Date: Tue Feb 21 16:55:21 2023 +0100 Improve dnd-direct-save-remote-files docstring * lisp/dnd.el (dnd-direct-save-remote-files): Reword. diff --git a/lisp/dnd.el b/lisp/dnd.el index 3abb108a4a7..67907ec403e 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -108,11 +108,11 @@ dnd-indicate-insertion-point (defcustom dnd-direct-save-remote-files 'x "Whether or not to perform a direct save of remote files. -This is compatible with less programs, but means dropped files +This is compatible with fewer programs, but means dropped files will be saved with their actual file names, and not a temporary file name provided by TRAMP. -This defaults to `x', which means only to drop that way on X +This defaults to `x', which means to save that way only on X Windows." :type '(choice (const :tag "Only use direct save on X Windows" x) (const :tag "Use direct save everywhere" t) commit cf53e62a791a7585fe83e1752f205317a037df4c Author: Robert Pluim Date: Tue Feb 21 16:45:21 2023 +0100 Add 'process-status' to process shortdoc * lisp/emacs-lisp/shortdoc.el (process): Add 'process-status'. diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index ed4e205d204..c49960c2ee6 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -1167,6 +1167,9 @@ process :eg-result-string "#") (processp :eval (processp t)) + (process-status + :no-eval (process-status process) + :eg-result exit) (delete-process :no-value (delete-process process)) (kill-process commit 68df9e5953c881d390fdb14fc774c3cd45060ba4 Author: Andrea Corallo Date: Tue Feb 21 14:58:28 2023 +0100 * lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Improve 5d0b45cd67b diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index a0b18ea864f..046d169f00f 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3812,10 +3812,8 @@ comp--trampoline-abs-filename ;; Default to some temporary directory if no better option was ;; found. finally (cl-return - (expand-file-name - (make-temp-file (file-name-sans-extension rel-filename) 0 ".eln" - nil) - temporary-file-directory)))) + (make-temp-file (file-name-sans-extension rel-filename) nil ".eln" + nil)))) (defun comp-trampoline-compile (subr-name) "Synthesize compile and return a trampoline for SUBR-NAME." commit 06ba9484166a57bf7f307d6e847e1c0bd725950f Author: Robert Pluim Date: Tue Feb 21 16:35:25 2023 +0100 Improve text about deleting windows * doc/emacs/windows.texi (Change Window): Improve grammar around 'delete-window-choose-selected'. diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 239b5b2956b..e4abdef76be 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -310,8 +310,8 @@ Change Window minibuffer window, even if that is active at the time). Deleting the window has no effect on the buffer it used to display; the buffer continues to exist, and you can still switch to it with @kbd{C-x b}. -The option @code{delete-window-choose-selected} allows to choose which -window becomes the new selected window instead (@pxref{Deleting +The option @code{delete-window-choose-selected} controls which +window is chosen as the new selected window instead (@pxref{Deleting Windows,,, elisp, The Emacs Lisp Reference Manual}). @findex kill-buffer-and-window commit 1976ca1634d8c53a980299cb08778830cc7d90cf Author: Robert Pluim Date: Tue Feb 21 15:20:56 2023 +0100 Make 'emacs-news-cycle-tag' work at all levels * lisp/textmodes/emacs-news-mode.el (emacs-news-cycle-tag): Search for a heading starting with 2 or more '*' rather than exactly 3. * test/lisp/textmodes/emacs-news-mode-resources/cycle-tag.erts (Point-Char): Add tests for 2 and 4 '*' levels. diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index c5e7b8f4bc6..773b07764aa 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -195,7 +195,9 @@ emacs-news-cycle-tag (goto-char (line-beginning-position)) (cond ((or (looking-at (rx bol (or "---" "+++") eol))) (forward-line 2)) - ((or (looking-at (rx bol "*** "))) + ((or (looking-at (rx bol "**" + (zero-or-more "*") + " "))) (forward-line 1))) (outline-previous-visible-heading 1) (forward-line -1) diff --git a/test/lisp/textmodes/emacs-news-mode-resources/cycle-tag.erts b/test/lisp/textmodes/emacs-news-mode-resources/cycle-tag.erts index 63c3b1b7d8a..c3d32f6f05c 100644 --- a/test/lisp/textmodes/emacs-news-mode-resources/cycle-tag.erts +++ b/test/lisp/textmodes/emacs-news-mode-resources/cycle-tag.erts @@ -129,3 +129,92 @@ The corresponding key "% Y" is now bound by default in Dired. Before, that binding was only available if the 'dired-x' package was loaded. =-=-= + +Name: tag7-2level +Point-Char: | + +=-= ++++ +** 'dired-do-relsymlink-regexp' moved from dired-x to dired. +The corresponding key "% Y" is now bound by default in Dired. + +|+++ +** 'M-G' is now bound to 'dired-goto-subdir'. +Before, that binding was only available if the 'dired-x' package was +loaded. +=-= ++++ +** 'dired-do-relsymlink-regexp' moved from dired-x to dired. +The corresponding key "% Y" is now bound by default in Dired. + +|** 'M-G' is now bound to 'dired-goto-subdir'. +Before, that binding was only available if the 'dired-x' package was +loaded. +=-=-= + +Name: tag8-2level +Point-Char: | + +=-= ++++ +** 'dired-do-relsymlink-regexp' moved from dired-x to dired. +The corresponding key "% Y" is now bound by default in Dired. + ++++ +|** 'M-G' is now bound to 'dired-goto-subdir'. +Before, that binding was only available if the 'dired-x' package was +loaded. +=-= ++++ +** 'dired-do-relsymlink-regexp' moved from dired-x to dired. +The corresponding key "% Y" is now bound by default in Dired. + +|** 'M-G' is now bound to 'dired-goto-subdir'. +Before, that binding was only available if the 'dired-x' package was +loaded. +=-=-= + +Name: tag9-2level-notag +Point-Char: | + +=-= ++++ +** 'dired-do-relsymlink-regexp' moved from dired-x to dired. +The corresponding key "% Y" is now bound by default in Dired. + +|** 'M-G' is now bound to 'dired-goto-subdir'. +Before, that binding was only available if the 'dired-x' package was +loaded. +=-= ++++ +** 'dired-do-relsymlink-regexp' moved from dired-x to dired. +The corresponding key "% Y" is now bound by default in Dired. + +--- +|** 'M-G' is now bound to 'dired-goto-subdir'. +Before, that binding was only available if the 'dired-x' package was +loaded. +=-=-= + + +Name: tag10-4level +Point-Char: | + +=-= ++++ +**** 'dired-do-relsymlink-regexp' moved from dired-x to dired. +The corresponding key "% Y" is now bound by default in Dired. + +|**** 'M-G' is now bound to 'dired-goto-subdir'. +Before, that binding was only available if the 'dired-x' package was +loaded. +=-= ++++ +**** 'dired-do-relsymlink-regexp' moved from dired-x to dired. +The corresponding key "% Y" is now bound by default in Dired. + +--- +|**** 'M-G' is now bound to 'dired-goto-subdir'. +Before, that binding was only available if the 'dired-x' package was +loaded. +=-=-=