commit 94380420e2cba7e2821b22fd8a46cd5b04c985ef (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Fri Sep 23 09:36:24 2022 +0300 Support Noto Emoji font as fallback The black-and-white emoji font is back under active development, see https://github.com/googlefonts/noto-emoji. So this adds that font as fallback for systems that don't have the capability of using color fonts. * lisp/international/fontset.el (setup-default-fontset): Support black-and-white Noto Emoji font as fallback for Emoji display. diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 4e44de27ce..99c7848704 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -982,7 +982,11 @@ (set-fontset-font "fontset-default" symbol-subgroup "-*-fixed-medium-*-*-*-*-*-*-*-*-*-iso10646-1" nil 'prepend)) - ;; This sets up the Emoji codepoints to use prettier fonts. + ;; This sets up the Emoji codepoints to use prettier fonts: + ;; this is fallback, if they don't have color Emoji capabilities... + (set-fontset-font "fontset-default" 'emoji + '("Noto Emoji" . "iso10646-1") nil 'prepend) + ;; ...and this is if they do (set-fontset-font "fontset-default" 'emoji '("Noto Color Emoji" . "iso10646-1") nil 'prepend) commit 8238d87e15e2b2b730b6290965d14787650a15af Author: Stefan Kangas Date: Fri Sep 23 05:40:42 2022 +0200 ; * lisp/image/wallpaper.el: Fix last commit. diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el index effa25b180..31091a6002 100644 --- a/lisp/image/wallpaper.el +++ b/lisp/image/wallpaper.el @@ -105,10 +105,11 @@ In each of the command line arguments, \"%f\", \"%h\" and \"%w\" will be replaced as described in `wallpaper-command-args'.") (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) - (or (member (downcase (env "DESKTOP_SESSION")) - '("gnome" "gnome" "gnome-wayland" "gnome-xorg" - "unity" "ubuntu" "pantheon" "budgie-desktop" - "pop")) + (or (and (getenv "DESKTOP_SESSION") + (member (downcase (getenv "DESKTOP_SESSION")) + '("gnome" "gnome" "gnome-wayland" "gnome-xorg" + "unity" "ubuntu" "pantheon" "budgie-desktop" + "pop"))) (member "GNOME" (xdg-current-desktop)) (member "Budgie" (xdg-current-desktop)) (member "GNOME-Classic" (xdg-current-desktop)))) @@ -117,24 +118,28 @@ will be replaced as described in `wallpaper-command-args'.") (member "KDE" (xdg-current-desktop))) (cl-defmethod wallpaper--check-command ((_type (eql 'xfconf-query))) - (or (member (lowercase (env "DESKTOP_SESSION")) - '("xubuntu" "ubuntustudio")) + (or (and (getenv "DESKTOP_SESSION") + (member (downcase (getenv "DESKTOP_SESSION")) + '("xubuntu" "ubuntustudio"))) (member "XFCE" (xdg-current-desktop)))) (cl-defmethod wallpaper--check-command ((_type (eql 'pcmanf))) (member "LXDE" (xdg-current-desktop))) (cl-defmethod wallpaper--check-command ((_type (eql 'pcmanf-qt))) - (or (member (lowercase (env "DESKTOP_SESSION")) + (or (member (and (getenv "DESKTOP_SESSION") + (downcase (getenv "DESKTOP_SESSION"))) '("lubuntu" "lxqt")) (member "LXQt" (xdg-current-desktop)))) ;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) -;; (or (equal "mate" (lowercase (env "DESKTOP_SESSION"))) +;; (or (and (getenv "DESKTOP_SESSION") +;; (equal "mate" (downcase (getenv "DESKTOP_SESSION")))) ;; (member "MATE" (xdg-current-desktop)))) ;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) -;; (or (equal "cinnamon" (lowercase (env "DESKTOP_SESSION"))) +;; (or (equal "cinnamon" (and (getenv "DESKTOP_SESSION") +;; (downcase (getenv "DESKTOP_SESSION")))) ;; (member "X-Cinnamon" (xdg-current-desktop)))) ;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) commit f25f4699d760c5409a1571dcfdf4ed0fdac9e0ec Author: Stefan Kangas Date: Fri Sep 23 03:24:13 2022 +0200 Support several new DEs in wallpaper.el * lisp/image/wallpaper.el (wallpaper--default-commands) (wallpaper--check-command, wallpaper-command): Add support for Unity, Pantheon, Budgie, LXQt, and LXDE. Also add support for Lubuntu, Xubuntu, and Pop!_OS. diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el index ff47d37e3a..effa25b180 100644 --- a/lisp/image/wallpaper.el +++ b/lisp/image/wallpaper.el @@ -62,6 +62,16 @@ ;; XFCE ("xfconf-query" "-c" "xfce4-desktop" "-p" "/backdrop/screen0/monitoreDP/workspace0/last-image" "-s" "%f") + ;; LXDE + ("pcmanfm" "--set-wallpaper=%f") + ;; LXQt + ("pcmanfm-qt" "--set-wallpaper=%f") ; "--wallpaper-mode=MODE" + ;; ;; Mate + ;; ("gsettings" "set" "org.mate.background" "picture-filename" "%f") + ;; ;; Cinnamon + ;; ("gsettings" "set" "org.cinnamon.desktop.background" "picture-uri" "file://%f") + ;; ;; Deepin + ;; ("gsettings" "set" "com.deepin.wrap.gnome.desktop.background" "picture-uri" "file://%f") ;; Sway (Wayland) ("swaybg" "-o" "*" "-i" "%f" "-m" "fill") ;; Wayland General @@ -95,13 +105,40 @@ In each of the command line arguments, \"%f\", \"%h\" and \"%w\" will be replaced as described in `wallpaper-command-args'.") (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) - (member "GNOME" (xdg-current-desktop))) + (or (member (downcase (env "DESKTOP_SESSION")) + '("gnome" "gnome" "gnome-wayland" "gnome-xorg" + "unity" "ubuntu" "pantheon" "budgie-desktop" + "pop")) + (member "GNOME" (xdg-current-desktop)) + (member "Budgie" (xdg-current-desktop)) + (member "GNOME-Classic" (xdg-current-desktop)))) (cl-defmethod wallpaper--check-command ((_type (eql 'plasma-apply-wallpaperimage))) (member "KDE" (xdg-current-desktop))) (cl-defmethod wallpaper--check-command ((_type (eql 'xfconf-query))) - (member "XFCE" (xdg-current-desktop))) + (or (member (lowercase (env "DESKTOP_SESSION")) + '("xubuntu" "ubuntustudio")) + (member "XFCE" (xdg-current-desktop)))) + +(cl-defmethod wallpaper--check-command ((_type (eql 'pcmanf))) + (member "LXDE" (xdg-current-desktop))) + +(cl-defmethod wallpaper--check-command ((_type (eql 'pcmanf-qt))) + (or (member (lowercase (env "DESKTOP_SESSION")) + '("lubuntu" "lxqt")) + (member "LXQt" (xdg-current-desktop)))) + +;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) +;; (or (equal "mate" (lowercase (env "DESKTOP_SESSION"))) +;; (member "MATE" (xdg-current-desktop)))) + +;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) +;; (or (equal "cinnamon" (lowercase (env "DESKTOP_SESSION"))) +;; (member "X-Cinnamon" (xdg-current-desktop)))) + +;; (cl-defmethod wallpaper--check-command ((_type (eql 'gsettings))) +;; (member "Deepin" (xdg-current-desktop))) (cl-defmethod wallpaper--check-command ((_type (eql 'swaybg))) (and (getenv "WAYLAND_DISPLAY") @@ -163,6 +200,8 @@ systems, where a native API is used instead." (const :tag "gsettings (GNOME)" "gsettings") (const :tag "plasma-apply-wallpaperimage (KDE Plasma)" "plasma-apply-wallpaperimage") (const :tag "xfconf-query (XFCE)" "xfconf-query") + (const :tag "pcmanf (LXDE)" "pcmanf") + (const :tag "pcmanf-qt (LXQt)" "pcmanf-qt") (const :tag "swaybg (Wayland/Sway)" "swaybg") (const :tag "wbg (Wayland)" "wbg") (const :tag "gm (X Window System)" "gm") commit 4de526edb73637c47c62d31c7fa429fa72dce19e Author: Stefan Kangas Date: Thu Sep 22 21:52:15 2022 +0200 image-dired: Obsolete two unused functions * lisp/image/image-dired-util.el (image-dired-display-window) (image-dired-associated-dired-buffer-window): Make obsolete; they are currently unused. diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index dcf0b22cfe..8d77a97dc4 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -127,6 +127,10 @@ See also `image-dired-thumbnail-storage'." (defun image-dired-display-window () "Return window where `image-dired-display-image-buffer' is visible." + ;; This is obsolete as it is currently unused. Once the window + ;; handling gets a rethink, there may or may not be a need to + ;; un-obsolete it again. + (declare (obsolete nil "29.1")) (get-window-with-predicate (lambda (window) (equal (buffer-name (window-buffer window)) image-dired-display-image-buffer)) @@ -141,6 +145,10 @@ See also `image-dired-thumbnail-storage'." (defun image-dired-associated-dired-buffer-window () "Return window where associated Dired buffer is visible." + ;; This is obsolete as it is currently unused. Once the window + ;; handling gets a rethink, there may or may not be a need to + ;; un-obsolete it again. + (declare (obsolete nil "29.1")) (let (buf) (if (image-dired-image-at-point-p) (progn commit 587b2c8dd1d7126c429aa499fa4b89f39440161e Author: Gregory Heytings Date: Thu Sep 22 23:54:57 2022 +0200 ; * Makefile.in: Make install depend on actual-all. Fixes bug#57959. diff --git a/Makefile.in b/Makefile.in index 4968b710a5..c6a2e50959 100644 --- a/Makefile.in +++ b/Makefile.in @@ -582,7 +582,7 @@ $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4 ## don't have to duplicate the list of utilities to install in ## this Makefile as well. -install: all install-arch-indep install-etcdoc install-arch-dep install-$(NTDIR) blessmail install-eln install-gsettings-schemas +install: actual-all install-arch-indep install-etcdoc install-arch-dep install-$(NTDIR) blessmail install-eln install-gsettings-schemas @true ## Ensure that $subdir contains a subdirs.el file. commit e4964de952a8246307faaf9875d2c278f42c53fc Author: Mattias EngdegÄrd Date: Thu Sep 22 14:15:56 2022 +0200 Don't rewrite `set` to `setq` of lexical variables Only perform the rewrite (set 'VAR X) -> (setq VAR X) for dynamic variables, as `set` isn't supposed to affect lexical vars (and never does so when interpreted). * lisp/emacs-lisp/byte-opt.el (byte-optimize-set): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--xx): New. (bytecomp-tests--test-cases): Add test cases. * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el: Remove obsolete test. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 0d5f8c26eb..4ef9cb0a1e 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1531,15 +1531,16 @@ See Info node `(elisp) Integer Basics'." (put 'set 'byte-optimizer #'byte-optimize-set) (defun byte-optimize-set (form) - (let ((var (car-safe (cdr-safe form)))) - (cond - ((and (eq (car-safe var) 'quote) (consp (cdr var))) - `(setq ,(cadr var) ,@(cddr form))) - ((and (eq (car-safe var) 'make-local-variable) - (eq (car-safe (setq var (car-safe (cdr var)))) 'quote) - (consp (cdr var))) - `(progn ,(cadr form) (setq ,(cadr var) ,@(cddr form)))) - (t form)))) + (pcase (cdr form) + ;; Make sure we only turn `set' into `setq' for dynamic variables. + (`((quote ,(and var (guard (and (symbolp var) + (not (macroexp--const-symbol-p var)) + (not (assq var byte-optimize--lexvars)))))) + ,newval) + `(setq ,var ,newval)) + (`(,(and ml `(make-local-variable ,(and v `(quote ,_)))) ,newval) + `(progn ,ml (,(car form) ,v ,newval))) + (_ form))) ;; enumerating those functions which need not be called if the returned ;; value is not used. That is, something like diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el deleted file mode 100644 index 0c76c4d388..0000000000 --- a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el +++ /dev/null @@ -1,3 +0,0 @@ -;;; -*- lexical-binding: t -*- -(defun foo () - (set '(a) nil)) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 1ca44dc7a4..e7c308213e 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -59,6 +59,8 @@ inner loops respectively." (setq i (1- i))) res)) +(defvar bytecomp-tests--xx nil) + (defconst bytecomp-tests--test-cases '( ;; some functional tests @@ -692,6 +694,16 @@ inner loops respectively." (f (lambda () (let ((y x)) (list y 3 y))))) (funcall f)) + + ;; Test rewriting of `set' to `setq' (only done on dynamic variables). + (let ((xx 1)) (set 'xx 2) xx) + (let ((bytecomp-tests--xx 1)) + (set 'bytecomp-tests--xx 2) + bytecomp-tests--xx) + (let ((aaa 1)) (set (make-local-variable 'aaa) 2) aaa) + (let ((bytecomp-tests--xx 1)) + (set (make-local-variable 'bytecomp-tests--xx) 2) + bytecomp-tests--xx) ) "List of expressions for cross-testing interpreted and compiled code.") @@ -953,9 +965,6 @@ byte-compiled. Run with dynamic binding." (bytecomp--define-warning-file-test "warn-variable-set-constant.el" "attempt to set constant") -(bytecomp--define-warning-file-test "warn-variable-set-nonvariable.el" - "variable reference to nonvariable") - (bytecomp--define-warning-file-test "warn-variable-setq-nonvariable.el" "attempt to set non-variable") commit e9f42b1cba08c3a20db86d8a98f7e9cfe22569d7 Author: Stefan Kangas Date: Thu Sep 22 14:29:39 2022 +0200 image-dired: Improve minor mode docstring * lisp/image/image-dired-dired.el (image-dired-minor-mode): Improve docstring. diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dired.el index ed7b892bca..73434c6062 100644 --- a/lisp/image/image-dired-dired.el +++ b/lisp/image/image-dired-dired.el @@ -238,9 +238,39 @@ With prefix argument, move ARG lines." ;;;###autoload (define-minor-mode image-dired-minor-mode - "Setup easy-to-use keybindings for the commands to be used in Dired mode. - -\\{image-dired-minor-mode-map}" + "Setup easy-to-use keybindings for Image-Dired in Dired mode. + +This minor mode adds these additional bindings: +\\ + \\[image-dired-next-line-and-display] Move to next line and display \ +thumbnail image. + \\[image-dired-previous-line-and-display] Move to previous line \ +and display thumbnail image. + \\[image-dired-mark-and-display-next] Mark current file and display \ +next thumbnail image. + \\[image-dired-jump-thumbnail-buffer] Jump to thumbnail buffer. + +For reference, these are the default Image-Dired bindings that +are always available in Dired: +\\ + \\[image-dired-display-thumbs] Display thumbnails of all marked files. + \\[image-dired-tag-files] Tag marked file(s). + \\[image-dired-delete-tag] Remove tag for selected file(s). + \\[image-dired-jump-thumbnail-buffer] Jump to thumbnail buffer. + \\[image-dired-dired-display-image] Display current image file. + \\[image-dired-dired-display-external] Display file at point \ +using an external viewer. + \\[image-dired-display-thumbs-append] Append thumbnails to \ +thumbnail buffer. + \\[image-dired-display-thumb] Display thumbnails of all marked files. + \\[image-dired-dired-comment-files] Add comment to current or \ +marked files in Dired. + \\[image-dired-mark-tagged-files] Use REGEXP to mark files with \ +matching tag. + \\[image-dired-dired-toggle-marked-thumbs] Toggle thumbnails in \ +front of file names. + \\[image-dired-dired-edit-comment-and-tags] Edit comment and tags \ +of marked images." :keymap image-dired-minor-mode-map) (declare-function clear-image-cache "image.c" (&optional filter)) commit b9c06cf94a1f97ac84a787a9b215c5429e50986a Author: Stefan Kangas Date: Thu Sep 22 14:28:35 2022 +0200 image-dired: Remove redundant keybindings * lisp/image/image-dired-dired.el (image-dired-minor-mode-map): Don't redundantly bind keys that are already bound in dired. diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dired.el index 8c50691f2e..ed7b892bca 100644 --- a/lisp/image/image-dired-dired.el +++ b/lisp/image/image-dired-dired.el @@ -202,19 +202,10 @@ With prefix argument, move ARG lines." :doc "Keymap for `image-dired-minor-mode'." " " #'image-dired-dired-previous-line " " #'image-dired-dired-next-line - "C-S-n" #'image-dired-next-line-and-display "C-S-p" #'image-dired-previous-line-and-display "C-S-m" #'image-dired-mark-and-display-next - - "C-t d" #'image-dired-display-thumbs - "" #'image-dired-jump-thumbnail-buffer - "C-t i" #'image-dired-dired-display-image - "C-t x" #'image-dired-dired-display-external - "C-t a" #'image-dired-display-thumbs-append - "C-t ." #'image-dired-display-thumb - "C-t c" #'image-dired-dired-comment-files - "C-t f" #'image-dired-mark-tagged-files) + "" #'image-dired-jump-thumbnail-buffer) (easy-menu-define image-dired-minor-mode-menu image-dired-minor-mode-map "Menu for `image-dired-minor-mode'." commit fdfd7ef6f383391b24c296ba6217abcffd5c4586 Author: Stefan Kangas Date: Thu Sep 22 14:17:08 2022 +0200 Fix failing image-dired test * test/lisp/image/image-dired-util-tests.el (ert-x, xdg): Require. (image-dired-thumb-name/): Delete test. (image-dired-thumb-name/standard) (image-dired-thumb-name/image-dired) (image-dired-thumb-name/per-directory): New tests. diff --git a/test/lisp/image/image-dired-util-tests.el b/test/lisp/image/image-dired-util-tests.el index 547e391401..39862fc6fa 100644 --- a/test/lisp/image/image-dired-util-tests.el +++ b/test/lisp/image/image-dired-util-tests.el @@ -20,21 +20,35 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'image-dired) (require 'image-dired-util) +(require 'xdg) -(ert-deftest image-dired-thumb-name () +(ert-deftest image-dired-thumb-name/standard () (let ((image-dired-thumbnail-storage 'standard)) (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) - (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) - "4abfc97f9a5d3c4c519bfb23e4da8b90.png"))) - (let ((image-dired-thumbnail-storage 'image-dired)) - (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) - (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) - "foo_5baffb8d7984b3088db58efd7d8909c5.thumb.jpg"))) + (should (string-search (xdg-cache-home) + (image-dired-thumb-name "foo.jpg"))) + (should (string-match (rx (in "0-9a-f") ".png") + (image-dired-thumb-name "foo.jpg"))))) + +(ert-deftest image-dired-thumb-name/image-dired () + ;; Avoid trying to create `image-dired-dir'. + (ert-with-temp-directory dir + (let ((image-dired-dir dir) + (image-dired-thumbnail-storage 'image-dired)) + (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) + (should (equal (file-name-nondirectory + ;; The checksum is based on the directory name. + (image-dired-thumb-name "/some/path/foo.jpg")) + "foo_45fff7fcc4a0945679b7b11dec36a82d.thumb.jpg"))))) + +(ert-deftest image-dired-thumb-name/per-directory () (let ((image-dired-thumbnail-storage 'per-directory)) (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) - (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) + (should (equal (file-name-nondirectory + (image-dired-thumb-name "foo.jpg")) "foo.thumb.jpg")))) ;;; image-dired-util-tests.el ends here commit f43914b4d036ada1842e533cda34bc4379f47a26 Author: Stefan Kangas Date: Thu Sep 22 13:56:31 2022 +0200 Add X-Hashcash to the end of mail headers * lisp/mail/hashcash.el (mail-add-payment): Move headers to the end of the headers. diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el index 626949b663..5136e11c89 100644 --- a/lisp/mail/hashcash.el +++ b/lisp/mail/hashcash.el @@ -308,6 +308,7 @@ Set ASYNC to t to start asynchronous calculation. (See (save-excursion (save-restriction (message-narrow-to-headers) + (goto-char (point-max)) (let ((to (hashcash-strip-quoted-names (mail-fetch-field "To" nil t))) (cc (hashcash-strip-quoted-names (mail-fetch-field "Cc" nil t))) (ng (hashcash-strip-quoted-names (mail-fetch-field "Newsgroups" commit 5ee3990de69f95cd0e44a900b27a69f046a41c27 Author: Stefan Kangas Date: Thu Sep 22 13:46:45 2022 +0200 ; * lisp/mail/hashcash.el: Remove redundant :group args. diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el index eebb140088..626949b663 100644 --- a/lisp/mail/hashcash.el +++ b/lisp/mail/hashcash.el @@ -57,8 +57,7 @@ "The default number of bits to pay to unknown users. If this is zero, no payment header will be generated. See `hashcash-payment-alist'." - :type 'natnum - :group 'hashcash) + :type 'natnum) (defcustom hashcash-payment-alist '() "An association list mapping email addresses to payment amounts. @@ -72,46 +71,39 @@ present, is the string to be hashed; if not present ADDR will be used." (list :tag "Replace hash input" (string :name "Address") (string :name "Hash input") - (integer :name "Amount")))) - :group 'hashcash) + (integer :name "Amount"))))) (defcustom hashcash-default-accept-payment 20 "The default minimum number of bits to accept on incoming payments." - :type 'natnum - :group 'hashcash) + :type 'natnum) (defcustom hashcash-accept-resources `((,user-mail-address nil)) "An association list mapping hashcash resources to payment amounts. Resources named here are to be accepted in incoming payments. If the corresponding AMOUNT is NIL, the value of `hashcash-default-accept-payment' is used instead." - :type 'alist - :group 'hashcash) + :type 'alist) (define-obsolete-variable-alias 'hashcash-path 'hashcash-program "24.4") (defcustom hashcash-program "hashcash" "The name of the hashcash executable. If this is not in your PATH, specify an absolute file name." - :type '(choice (const nil) file) - :group 'hashcash) + :type '(choice (const nil) file)) (defcustom hashcash-extra-generate-parameters '("-Z2") "A list of parameter strings passed to `hashcash-program' when minting. For example, on very old hardware, you may want to set this to (\"-Z0\") to disable compression." :type '(repeat string) - :version "29.1" - :group 'hashcash) + :version "29.1") (defcustom hashcash-double-spend-database "hashcash.db" "The name of the double-spending database file." - :type 'file - :group 'hashcash) + :type 'file) (defcustom hashcash-in-news nil "Specifies whether or not hashcash payments should be made to newsgroups." - :type 'boolean - :group 'hashcash) + :type 'boolean) (defvar hashcash-process-alist nil "Alist of asynchronous hashcash processes and buffers.") commit 4cb53c0528aad73ac001a5d0b4ae336b8ec65408 Author: Michael Albinus Date: Thu Sep 22 13:14:46 2022 +0200 Improve don't save bookmark context from encrypted files * etc/NEWS: Mention 'bookmark-inhibit-context-functions'. Fix typos. * lisp/bookmark.el (bookmark-inhibit-context-functions): New defcustom. (bookmark-make-record): Use it. * lisp/auth-source-pass.el (auth-source-pass-file-name-p): * lisp/auth-source.el (auth-source-file-name-p): New defuns. Add them to `bookmark-inhibit-context-functions'. * lisp/epa-hook.el (epa-file-name-p): * lisp/net/tramp-crypt.el (tramp-crypt-file-name-p): Add them to `bookmark-inhibit-context-functions'. diff --git a/etc/NEWS b/etc/NEWS index 398cc2598e..7a573b5e83 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -183,7 +183,10 @@ of 'user-emacs-directory'. +++ *** Bookmarks no longer include context for encrypted files. If you're visiting an encrypted file, setting a bookmark no longer -includes excerpts from that buffer in the bookmarks file. +includes excerpts from that buffer in the bookmarks file. This is +implemented by the new hook 'bookmark-inhibit-context-functions', +where packages can register a function which returns non-nil for file +names to be excluded from adding such excerpts. --- *** 'show-paren-mode' is now disabled in 'special-mode' buffers. @@ -391,8 +394,8 @@ are also obsolete. --- ** The linum.el library is now obsolete. -We recommend using either the built-in `display-line-numbers-mode', or -the `nlinum' package from GNU ELPA instead. The former has better +We recommend using either the built-in 'display-line-numbers-mode', or +the 'nlinum' package from GNU ELPA instead. The former has better performance, but the latter is closer to a drop-in replacement. --- @@ -1529,7 +1532,7 @@ uses the 'key-parse' syntax. It replaces the old 'kmacro-lambda-form' (which is now declared obsolete). --- -** 'savehist.el' can now truncate variables that are too long. +** savehist.el can now truncate variables that are too long. An element of 'savehist-additional-variables' can now be of the form '(VARIABLE . MAX-ELTS)', which means to truncate the VARIABLE's value to at most MAX-ELTS elements (if the value is a list) before saving the @@ -2155,7 +2158,7 @@ nil to disable this confirmation completely. *** 'image-dired-thumb-size' increased to 128. --- -*** 'image-dired-thumb-(height|width)' are now obsolete. +*** 'image-dired-thumb-{height,width}' are now obsolete. Customize 'image-dired-thumb-size' instead, which will set both the height and width. @@ -2469,9 +2472,9 @@ Enabling this minor mode turns on hiding header material, like 'elide-head' does; disabling it shows the header. The commands 'elide-head' and 'elide-head-show' are now obsolete. -*** New package 'osc'. +*** New package osc.el. Support for OSC ("Operating System Command") escape sequences has been -extracted from 'comint.el' in order to provide interpretation of OSC +extracted from comint.el in order to provide interpretation of OSC sequences in compilation buffers. Adding the new function 'osc-compilation-filter' to @@ -2482,7 +2485,6 @@ filtered out. The list of handlers (already covering OSC 7 and 8) has been extended with a handler for OSC 2, the command to set a window title. - +++ *** New user option 'project-vc-include-untracked'. If non-nil, files untracked by a VCS are considered to be part of @@ -2612,12 +2614,12 @@ in-memory format is now by using ':data-width' and ':data-height'. ** "loaddefs.el" generation has been reimplemented. The various "loaddefs.el" files in the Emacs tree (which contain information about autoloads, built-in packages and package prefixes) -used to be generated by functions in "autoloads.el". These are now -generated by "loaddefs-gen.el" instead. This leads to functionally -equivalent loaddef files, but they do not use exactly the same syntax, -so using 'M-x update-file-autoloads' no longer works. (This didn't -work well in most files in the past, either, but it will now signal an -error in any file.) +used to be generated by functions in autoloads.el. These are now +generated by loaddefs-gen.el instead. This leads to functionally +equivalent "loaddef.el" files, but they do not use exactly the same +syntax, so using 'M-x update-file-autoloads' no longer works. (This +didn't work well in most files in the past, either, but it will now +signal an error in any file.) In addition, files are scanned in a slightly different way. Previously ';;;###' specs inside a top-level form (i.e., something diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el index 86e0b48a79..0955e2ed07 100644 --- a/lisp/auth-source-pass.el +++ b/lisp/auth-source-pass.el @@ -319,6 +319,16 @@ then NAME & USER, then NAME & PORT, then just NAME." (list (format "%s" name))))) +(defun auth-source-pass-file-name-p (file) + "Say whether FILE is used by `auth-source-pass'." + (and (stringp file) (stringp auth-source-pass-filename) + (string-equal + (expand-file-name file) (expand-file-name auth-source-pass-filename)))) + +(with-eval-after-load 'bookmark + (add-hook 'bookmark-inhibit-context-functions + #'auth-source-pass-file-name-p)) + (provide 'auth-source-pass) ;;; auth-source-pass.el ends here diff --git a/lisp/auth-source.el b/lisp/auth-source.el index c79e5b81f7..feefd391a8 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -522,6 +522,21 @@ parameters." ;; (mapcar #'auth-source-backend-parse auth-sources) +(defun auth-source-file-name-p (file) + "Say whether FILE is used by `auth-sources'." + (let* ((backends (mapcar #'auth-source-backend-parse auth-sources)) + (files + (mapcar (lambda (x) + (when (member (slot-value x 'type) '(json netrc plstore)) + (slot-value x 'source))) + backends))) + (member (expand-file-name file) + (mapcar #'expand-file-name (remq nil files))))) + +(with-eval-after-load 'bookmark + (add-hook 'bookmark-inhibit-context-functions + #'auth-source-file-name-p)) + (cl-defun auth-source-search (&rest spec &key max require create delete &allow-other-keys) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index f150a24bbf..0384812d3f 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -592,6 +592,14 @@ NAME is a suggested name for the constructed bookmark. It can be nil in which case a default heuristic will be used. The function can also equivalently just return ALIST without NAME.") +(defcustom bookmark-inhibit-context-functions nil + "List of functions to call before making a bookmark record. +The functions take `buffer-file-name' as argument. If any of +these functions returns non-nil, the bookmark does not record +context strings from the current buffer." + :type 'hook + :version "29.1") + (defun bookmark-make-record () "Return a new bookmark record (NAME . ALIST) for the current location." (let* ((bookmark-search-size @@ -599,10 +607,8 @@ equivalently just return ALIST without NAME.") ;; don't include any context in the bookmark file, because ;; that would leak (possibly secret) data. (if (and buffer-file-name - (or (and (fboundp 'epa-file-name-p) - (epa-file-name-p buffer-file-name)) - (and (fboundp 'tramp-crypt-file-name-p) - (tramp-crypt-file-name-p buffer-file-name)))) + (not (run-hook-with-args-until-success + 'bookmark-inhibit-context-functions buffer-file-name))) 0 bookmark-search-size)) (record (funcall bookmark-make-record-function))) diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el index 70c3030881..386bd73964 100644 --- a/lisp/epa-hook.el +++ b/lisp/epa-hook.el @@ -92,6 +92,10 @@ interface, update `file-name-handler-alist'." "Say whether FILE is handled by `epa-file'." (and auto-encryption-mode (string-match-p epa-file-name-regexp file))) +(with-eval-after-load 'bookmark + (add-hook 'bookmark-inhibit-context-functions + #'epa-file-name-p)) + (define-minor-mode auto-encryption-mode "Toggle automatic file encryption/decryption (Auto Encryption mode)." :global t :init-value t :group 'epa-file :version "23.1" diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index d556c87606..16c4049a68 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -852,6 +852,14 @@ WILDCARD is not supported." (tramp-compat-funcall 'unlock-file (tramp-crypt-encrypt-file-name filename)))) +(with-eval-after-load 'bookmark + (add-hook 'bookmark-inhibit-context-functions + #'tramp-crypt-file-name-p) + (add-hook 'tramp-crypt-unload-hook + (lambda () + (remove-hook 'bookmark-inhibit-context-functions + #'tramp-crypt-file-name-p)))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-crypt 'force))) commit 9369e4242fa51d53b05ce95842f124522289d8a3 Author: Po Lu Date: Thu Sep 22 17:06:36 2022 +0800 Work around rare crash when turning scroll wheel * src/xterm.c (handle_one_xevent): Don't allow devices to be added twice handling hierarcy events. diff --git a/src/xterm.c b/src/xterm.c index 97c070736c..6860ef2080 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23000,24 +23000,36 @@ handle_one_xevent (struct x_display_info *dpyinfo, any_changed = true; } - x_catch_errors (dpyinfo->display); - info = XIQueryDevice (dpyinfo->display, hev->info[i].deviceid, - &ndevices); - x_uncatch_errors (); - - if (info && info->enabled) + /* Under unknown circumstances, multiple + XIDeviceEnabled events are sent at once, + causing the device to be duplicated. Check + that the device doesn't exist before adding + it. */ + + if (!xi_device_from_id (dpyinfo, + hev->info[i].deviceid)) { - dpyinfo->devices - = xrealloc (dpyinfo->devices, (sizeof *dpyinfo->devices - * ++dpyinfo->num_devices)); - memset (dpyinfo->devices + dpyinfo->num_devices - 1, - 0, sizeof *dpyinfo->devices); - device = &dpyinfo->devices[dpyinfo->num_devices - 1]; - xi_populate_device_from_info (device, info); - } + x_catch_errors (dpyinfo->display); + info = XIQueryDevice (dpyinfo->display, + hev->info[i].deviceid, + &ndevices); + x_uncatch_errors (); - if (info) - XIFreeDeviceInfo (info); + if (info && info->enabled) + { + dpyinfo->devices + = xrealloc (dpyinfo->devices, + (sizeof *dpyinfo->devices + * ++dpyinfo->num_devices)); + memset (dpyinfo->devices + dpyinfo->num_devices - 1, + 0, sizeof *dpyinfo->devices); + device = &dpyinfo->devices[dpyinfo->num_devices - 1]; + xi_populate_device_from_info (device, info); + } + + if (info) + XIFreeDeviceInfo (info); + } } else if (hev->info[i].flags & XIDeviceDisabled) disabled[n_disabled++] = hev->info[i].deviceid;