commit 77fb8a16120a03227a8851ef23bb0293f6a11d2d (HEAD, refs/remotes/origin/master) Author: Sean Whitton Date: Fri Sep 23 10:43:31 2022 -0700 vc-git--pushpull: Restore handling of vc-git-program * lisp/vc/vc-git.el (vc-git--pushpull): Restore handling of vc-git-program before recent change: respect a buffer-local value of vc-git-program, and don't ignore user edits to the git program name when PROMPT. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2228cf8665..3816d323e6 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1096,22 +1096,25 @@ It is based on `log-edit-mode', and has Git-specific extensions." If PROMPT is non-nil, prompt for the Git command to run." (let* ((root (vc-git-root default-directory)) (buffer (format "*vc-git : %s*" (expand-file-name root))) + (git-program vc-git-program) ;; TODO if pushing, prompt if no default push location - cf bzr. (vc-want-edit-command-p prompt)) (require 'vc-dispatcher) (when vc-want-edit-command-p (with-current-buffer (get-buffer-create buffer) (add-hook 'vc-pre-command-functions - (pcase-lambda (_ _ `(,new-command . ,new-args)) - (setq command new-command extra-args new-args)) + (lambda (&rest args) + (setq git-program (car args) + command (caaddr args) + extra-args (cdaddr args))) nil t))) (apply #'vc-do-async-command - buffer root vc-git-program command extra-args) + buffer root git-program command extra-args) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git) (setq-local compile-command - (concat vc-git-program " " command " " + (concat git-program " " command " " (mapconcat #'identity extra-args " "))) (setq-local compilation-directory root) ;; Either set `compilation-buffer-name-function' locally to nil commit 40bc027bf44e540fdf702bb56f139a7d95ee55c0 Author: Stefan Monnier Date: Fri Sep 23 17:42:55 2022 -0400 * lisp/emacs-lisp/eieio.el (defclass): Fix bug#51068 Accept (defclass (.. ..)) without having to wrap the slot name within parentheses. diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 984166b593..a6c900a335 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -136,6 +136,7 @@ and reference them using the function `class-option'." (accessors ())) ;; Collect the accessors we need to define. + (setq slots (mapcar (lambda (x) (if (consp x) x (list x))) slots)) (pcase-dolist (`(,sname . ,soptions) slots) (let* ((acces (plist-get soptions :accessor)) (initarg (plist-get soptions :initarg)) commit 759d1145e2cb04fde83cf721d3d1fd0644e9c8f1 Author: Stefan Kangas Date: Fri Sep 23 23:12:10 2022 +0200 image-dired: Rewrite and extend slideshow feature * lisp/image/image-dired.el (image-dired--slideshow-start-timer) (image-dired--slideshow-stop-timer) (image-dired--slideshow-show-message): New functions. (image-dired--slideshow-current-delay): New variable. (image-dired--slideshow-initial): Delete variable. (image-dired-slideshow-start): Simplify and ensure we display the image at start. * lisp/image/image-dired.el (image-dired--slideshow-stop): Add support for pausing, and going backwards and forwards during slideshow. diff --git a/etc/NEWS b/etc/NEWS index 63c4ec79d2..34025ff83d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2083,7 +2083,9 @@ thumbnail buffer. It is bound to 'W' by default. --- *** 'image-dired-slideshow-start' is now bound to 'S'. -It is bound in both the thumbnail and display buffer. +It is bound in both the thumbnail and display buffer, and no longer +prompts for a timeout; use a numerical prefix (e.g. 'C-u 8 S') to set +the timeout. --- *** New user option 'image-dired-marking-shows-next'. diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 41decbd341..43faccad1e 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -972,48 +972,80 @@ This is used by `image-dired-slideshow-start'." (defvar image-dired--slideshow-timer nil "Slideshow timer.") -(defvar image-dired--slideshow-initial nil) +(defvar image-dired--slideshow-current-delay image-dired-slideshow-delay) (defun image-dired--slideshow-step () - "Step to next image in a slideshow." + "Step to the next image in a slideshow." (if-let ((buf (get-buffer image-dired-thumbnail-buffer))) (with-current-buffer buf (image-dired-display-next-thumbnail-original)) (image-dired--slideshow-stop))) +(defun image-dired--slideshow-start-timer () + (image-dired--slideshow-stop-timer) + (setq image-dired--slideshow-timer + (run-with-timer image-dired--slideshow-current-delay + image-dired--slideshow-current-delay + 'image-dired--slideshow-step))) + +(defun image-dired--slideshow-stop-timer () + (when image-dired--slideshow-timer + (cancel-timer image-dired--slideshow-timer) + (setq image-dired--slideshow-timer nil))) + (defun image-dired-slideshow-start (&optional arg) - "Start a slideshow, waiting `image-dired-slideshow-delay' between images. + "Start a slideshow, waiting `image-dired-slideshow-delay' seconds between images. With prefix argument ARG, wait that many seconds before going to the next image. With a negative prefix argument, prompt user for the delay." (interactive "P" image-dired-thumbnail-mode image-dired-display-image-mode) - (let ((delay (if (not arg) - image-dired-slideshow-delay - (if (> arg 0) - arg - (string-to-number - (let ((delay (number-to-string image-dired-slideshow-delay))) - (read-string - (format-prompt "Delay, in seconds. Decimals are accepted" delay)) - delay)))))) - (setq image-dired--slideshow-timer - (run-with-timer - 0 delay - 'image-dired--slideshow-step)) - (add-hook 'post-command-hook 'image-dired--slideshow-stop) - (setq image-dired--slideshow-initial t) - (message "Running slideshow; use any command to stop"))) + (let ((delay + (cond ((not arg) + image-dired-slideshow-delay) + ((> arg 0) + arg) + ((<= arg 0) + (string-to-number + (let ((delay (number-to-string image-dired-slideshow-delay))) + (read-string + (format-prompt "Delay, in seconds. Decimals are accepted" + delay)) + delay)))))) + (image-dired-display-thumbnail-original-image) + (setq image-dired--slideshow-current-delay delay) + (add-hook 'post-command-hook 'image-dired--slideshow-stop))) + +(defun image-dired--slideshow-show-message (&optional suffix) + "Helper function for `image-dired--slideshow-stop'." + (message (substitute-command-keys + (format + (concat + "\\[image-dired-display-next-thumbnail-original] next, " + "\\[image-dired-display-previous-thumbnail-original] previous, " + "\\[image-dired-display-thumbnail-original-image] pause/unpause, " + "any other command to stop%s") + (or suffix ""))))) (defun image-dired--slideshow-stop () - "Cancel slideshow." - ;; Make sure we don't immediately stop after - ;; `image-dired-slideshow-start'. - (unless image-dired--slideshow-initial - (remove-hook 'post-command-hook 'image-dired--slideshow-stop) - (cancel-timer image-dired--slideshow-timer)) - (setq image-dired--slideshow-initial nil)) + "Cancel the currently active slideshow." + (cond + ((memq this-command + '( image-dired-slideshow-start + image-dired-display-next-thumbnail-original + image-dired-display-previous-thumbnail-original)) + (image-dired--slideshow-start-timer) + (image-dired--slideshow-show-message)) + ((eq this-command 'image-dired-display-thumbnail-original-image) + (let ((pause image-dired--slideshow-timer)) + (if pause + (image-dired--slideshow-stop-timer) + (image-dired--slideshow-start-timer)) + (image-dired--slideshow-show-message (and pause " [PAUSED]")))) + (t + (image-dired--slideshow-stop-timer) + (remove-hook 'post-command-hook 'image-dired--slideshow-stop)))) ;;; Thumbnail mode (cont. 3) commit e6f1ad6474d3352125b53a90bb259997ecd1fc5d Author: Stefan Kangas Date: Fri Sep 23 20:18:17 2022 +0200 image-dired: Mark two slideshow defuns as internal * lisp/image/image-dired.el (image-dired--slideshow-step) (image-dired--slideshow-stop): Rename from 'image-dired--slideshow-step' and 'image-dired--slideshow-stop'. Update callers and make old names into obsolete aliases. diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index c074f3312d..41decbd341 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -974,12 +974,12 @@ This is used by `image-dired-slideshow-start'." (defvar image-dired--slideshow-initial nil) -(defun image-dired-slideshow-step () +(defun image-dired--slideshow-step () "Step to next image in a slideshow." (if-let ((buf (get-buffer image-dired-thumbnail-buffer))) (with-current-buffer buf (image-dired-display-next-thumbnail-original)) - (image-dired-slideshow-stop))) + (image-dired--slideshow-stop))) (defun image-dired-slideshow-start (&optional arg) "Start a slideshow, waiting `image-dired-slideshow-delay' between images. @@ -1001,17 +1001,17 @@ With a negative prefix argument, prompt user for the delay." (setq image-dired--slideshow-timer (run-with-timer 0 delay - 'image-dired-slideshow-step)) - (add-hook 'post-command-hook 'image-dired-slideshow-stop) + 'image-dired--slideshow-step)) + (add-hook 'post-command-hook 'image-dired--slideshow-stop) (setq image-dired--slideshow-initial t) (message "Running slideshow; use any command to stop"))) -(defun image-dired-slideshow-stop () +(defun image-dired--slideshow-stop () "Cancel slideshow." ;; Make sure we don't immediately stop after ;; `image-dired-slideshow-start'. (unless image-dired--slideshow-initial - (remove-hook 'post-command-hook 'image-dired-slideshow-stop) + (remove-hook 'post-command-hook 'image-dired--slideshow-stop) (cancel-timer image-dired--slideshow-timer)) (setq image-dired--slideshow-initial nil)) @@ -1826,6 +1826,8 @@ when using per-directory thumbnail file storage")) (insert " \n") (insert "")))) +(define-obsolete-function-alias 'image-dired-slideshow-step #'image-dired--slideshow-step "29.1") +(define-obsolete-function-alias 'image-dired-slideshow-stop #'image-dired--slideshow-stop "29.1") (define-obsolete-function-alias 'image-dired-create-display-image-buffer #'ignore "29.1") (define-obsolete-function-alias 'image-dired-create-gallery-lists commit c244d4af57deb96ce399c70c2781c54e14e1f0bd Author: Stefan Monnier Date: Fri Sep 23 16:36:16 2022 -0400 cconv.el: Fix interactive closure bug#51695 Make cconv.el detect when a closure's interactive form needs to capture variables from the context and tweak the code accordingly if so. * lisp/emacs-lisp/cconv.el (cconv--interactive-form-funs): New var. (cconv-convert): Handle the case where the interactive form captures vars from the surrounding context. Remove left over handling of `declare` which was already removed from the cconv-analyze` phase. (cconv-analyze-form): Adjust analysis of interactive forms accordingly. * lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): New type and function. * lisp/simple.el (function-documentation, oclosure-interactive-form): Add methods for it. * test/lisp/emacs-lisp/cconv-tests.el (cconv-tests-interactive-closure-bug51695): New test. diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index 7f95fa94fa..23d0f12194 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -137,6 +137,11 @@ is less than this number.") ;; Alist associating to each function body the list of its free variables. ) +(defvar cconv--interactive-form-funs + ;; Table used to hold the functions we create internally for + ;; interactive forms. + (make-hash-table :test #'eq :weakness 'key)) + ;;;###autoload (defun cconv-closure-convert (form) "Main entry point for closure conversion. @@ -503,9 +508,23 @@ places where they originally did not directly appear." cond-forms))) (`(function (lambda ,args . ,body) . ,_) - (let ((docstring (if (eq :documentation (car-safe (car body))) - (cconv-convert (cadr (pop body)) env extend)))) - (cconv--convert-function args body env form docstring))) + (let* ((docstring (if (eq :documentation (car-safe (car body))) + (cconv-convert (cadr (pop body)) env extend))) + (bf (if (stringp (car body)) (cdr body) body)) + (if (when (eq 'interactive (car-safe (car bf))) + (gethash form cconv--interactive-form-funs))) + (cif (when if (cconv-convert if env extend))) + (_ (pcase cif + (`#'(lambda () ,form) (setf (cadr (car bf)) form) (setq cif nil)) + ('nil nil) + ;; The interactive form needs special treatment, so the form + ;; inside the `interactive' won't be used any further. + (_ (setf (cadr (car bf)) nil)))) + (cf (cconv--convert-function args body env form docstring))) + (if (not cif) + ;; Normal case, the interactive form needs no special treatment. + cf + `(cconv--interactive-helper ,cf ,cif)))) (`(internal-make-closure . ,_) (byte-compile-report-error @@ -589,12 +608,12 @@ places where they originally did not directly appear." (cconv-convert arg env extend)) (cons fun args))))))) - (`(interactive . ,forms) - `(,(car form) . ,(mapcar (lambda (form) - (cconv-convert form nil nil)) - forms))) + ;; The form (if any) is converted beforehand as part of the `lambda' case. + (`(interactive . ,_) form) - (`(declare . ,_) form) ;The args don't contain code. + ;; `declare' should now be macro-expanded away (and if they're not, we're + ;; in trouble because they *can* contain code nowadays). + ;; (`(declare . ,_) form) ;The args don't contain code. (`(oclosure--fix-type (ignore . ,vars) ,exp) (dolist (var vars) @@ -739,6 +758,13 @@ This function does not return anything but instead fills the (`(function (lambda ,vrs . ,body-forms)) (when (eq :documentation (car-safe (car body-forms))) (cconv-analyze-form (cadr (pop body-forms)) env)) + (let ((bf (if (stringp (car body-forms)) (cdr body-forms) body-forms))) + (when (eq 'interactive (car-safe (car bf))) + (let ((if (cadr (car bf)))) + (unless (macroexp-const-p if) ;Optimize this common case. + (let ((f `#'(lambda () ,if))) + (setf (gethash form cconv--interactive-form-funs) f) + (cconv-analyze-form f env)))))) (cconv--analyze-function vrs body-forms env form)) (`(setq ,var ,expr) @@ -803,13 +829,8 @@ This function does not return anything but instead fills the (cconv-analyze-form fun env))) (dolist (form args) (cconv-analyze-form form env))) - (`(interactive . ,forms) - ;; These appear within the function body but they don't have access - ;; to the function's arguments. - ;; We could extend this to allow interactive specs to refer to - ;; variables in the function's enclosing environment, but it doesn't - ;; seem worth the trouble. - (dolist (form forms) (cconv-analyze-form form nil))) + ;; The form (if any) is converted beforehand as part of the `lambda' case. + (`(interactive . ,_) nil) ;; `declare' should now be macro-expanded away (and if they're not, we're ;; in trouble because they *can* contain code nowadays). diff --git a/lisp/emacs-lisp/oclosure.el b/lisp/emacs-lisp/oclosure.el index 9775e8cc65..c77ac151d7 100644 --- a/lisp/emacs-lisp/oclosure.el +++ b/lisp/emacs-lisp/oclosure.el @@ -557,6 +557,21 @@ This has 2 uses: (oclosure-define (save-some-buffers-function (:predicate save-some-buffers-function--p))) +;; This OClosure type is used internally by `cconv.el' to handle +;; the case where we need to build a closure whose `interactive' spec +;; captures variables from the context. +;; It arguably belongs with `cconv.el' but is needed at runtime, +;; so we placed it here. +(oclosure-define (cconv--interactive-helper) fun if) +(defun cconv--interactive-helper (fun if) + "Add interactive \"form\" IF to FUN. +Returns a new command that otherwise behaves like FUN. +IF should actually not be a form but a function of no arguments." + (oclosure-lambda (cconv--interactive-helper (fun fun) (if if)) + (&rest args) + (apply (if (called-interactively-p 'any) + #'funcall-interactively #'funcall) + fun args))) (provide 'oclosure) ;;; oclosure.el ends here diff --git a/lisp/simple.el b/lisp/simple.el index aed1547b15..10a610e0c6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2653,6 +2653,9 @@ function as needed." (cl-defmethod function-documentation ((function accessor)) (oclosure--accessor-docstring function)) ;; FIXME: η-reduce! +(cl-defmethod function-documentation ((f cconv--interactive-helper)) + (function-documentation (cconv--interactive-helper--fun f))) + ;; This should be in `oclosure.el' but that file is loaded before `cl-generic'. (cl-defgeneric oclosure-interactive-form (_function) "Return the interactive form of FUNCTION or nil if none. @@ -2664,6 +2667,9 @@ instead." ;; (interactive-form function) nil) +(cl-defmethod oclosure-interactive-form ((f cconv--interactive-helper)) + `(interactive (funcall ',(cconv--interactive-helper--if f)))) + (defun command-execute (cmd &optional record-flag keys special) ;; BEWARE: Called directly from the C code. "Execute CMD as an editor command. diff --git a/test/lisp/emacs-lisp/cconv-tests.el b/test/lisp/emacs-lisp/cconv-tests.el index 9904c6a969..37470f863f 100644 --- a/test/lisp/emacs-lisp/cconv-tests.el +++ b/test/lisp/emacs-lisp/cconv-tests.el @@ -347,5 +347,15 @@ (list x (funcall g closed-x) (funcall h closed-x)))))))) ) +(ert-deftest cconv-tests-interactive-closure-bug51695 () + (let ((f (let ((d 51695)) + (lambda (data) + (interactive (progn (setq d (1+ d)) (list d))) + (list (called-interactively-p 'any) data))))) + (should (equal (list (call-interactively f) + (funcall f 51695) + (call-interactively f)) + '((t 51696) (nil 51695) (t 51697)))))) + (provide 'cconv-tests) ;;; cconv-tests.el ends here commit 41d39ffc3269db33f35541c94ebf109ffb50681e Author: Visuwesh Date: Fri Sep 23 18:21:55 2022 +0200 Make Gnus respect mode-line-buffer-identification-keymap * lisp/gnus/gnus-group.el (gnus-group-set-mode-line): Use 'propertized-buffer-identification' to buttonise and fontify the buffer name. * lisp/gnus/gnus-sum.el (gnus-set-mode-line): * lisp/gnus/gnus.el (gnus-mode-line-buffer-identification): Adjust calls to above. * lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Add missing 'gnus-modeline-buffer-identification' call (bug#57977). diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index fcad601d0c..d1098be6fd 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1717,9 +1717,7 @@ already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated." (setq mode-string (substring mode-string 0 (- max-len 4)))) (prog1 (setq mode-line-buffer-identification - (gnus-mode-line-buffer-identification - (list (propertize mode-string - 'face 'mode-line-buffer-id)))) + (gnus-mode-line-buffer-identification (list mode-string))) (set-buffer-modified-p modified)))))) (defun gnus-group-group-name () diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index e659a648e1..315381a6dd 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -829,9 +829,10 @@ claim them." (erase-buffer)) (gnus-browse-mode) (setq mode-line-buffer-identification - (list - (format - "Gnus: %%b {%s:%s}" (car method) (cadr method)))) + (gnus-mode-line-buffer-identification + (list + (format + "Gnus: %%b {%s:%s}" (car method) (cadr method))))) (let ((buffer-read-only nil) name (prefix (let ((gnus-select-method orig-select-method)) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index dde60caee7..107ad8fd4a 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -6207,8 +6207,7 @@ If WHERE is `summary', the summary mode line format will be used." ;; Update the mode line. (setq mode-line-buffer-identification (gnus-mode-line-buffer-identification - (list (propertize mode-string - 'face 'mode-line-buffer-id)))) + (list mode-string))) (set-buffer-modified-p t)))) (defun gnus-create-xref-hashtb (from-newsgroup headers unreads) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 0afd873a5d..3a7edf9e08 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -310,12 +310,15 @@ be set in `.emacs' instead." :type 'boolean) (defun gnus-mode-line-buffer-identification (line) - (let ((str (car-safe line))) + (let* ((str (car-safe line)) + (str (if (stringp str) + (car (propertized-buffer-identification str)) + str))) (if (or (not (fboundp 'find-image)) (not (display-graphic-p)) (not (stringp str)) (not (string-match "^Gnus:" str))) - line + (list str) (let ((load-path (append (mm-image-load-path) load-path))) ;; Add the Gnus logo. (add-text-properties commit cf27fe0238f88e2aee972334be75962f438cfa94 Author: Visuwesh Date: Fri Sep 23 18:11:25 2022 +0200 Make bounding box of 'image-crop' more noticeable * lisp/image/image-crop.el (image-crop--crop-image-1): Darken the selected region to make the bounding-box more noticable in images which are mostly white (bug#58004). diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el index 61ed7e1db1..7fbbf85f93 100644 --- a/lisp/image/image-crop.el +++ b/lisp/image/image-crop.el @@ -357,18 +357,10 @@ After cropping an image, you can save it by `M-x image-save' or ((memq (car event) '(mouse-1 drag-mouse-1)) (setq state 'move-unclick prompt (format "Click to move for %s" op))))))))) - do (svg-line svg (cl-getf area :left) (cl-getf area :top) - (cl-getf area :right) (cl-getf area :top) - :id "top-line" :stroke-color "white") - (svg-line svg (cl-getf area :left) (cl-getf area :bottom) - (cl-getf area :right) (cl-getf area :bottom) - :id "bottom-line" :stroke-color "white") - (svg-line svg (cl-getf area :left) (cl-getf area :top) - (cl-getf area :left) (cl-getf area :bottom) - :id "left-line" :stroke-color "white") - (svg-line svg (cl-getf area :right) (cl-getf area :top) - (cl-getf area :right) (cl-getf area :bottom) - :id "right-line" :stroke-color "white") + do (svg-rectangle svg (cl-getf area :left) (cl-getf area :top) + (image-crop--width area) (image-crop--height area) + :stroke-color "red" :stroke-width 2 + :fill-opacity 0.3 :fill "black" :id "rect") while (not (member event '(return ?q))) finally (return (and (eq event 'return) area))))) commit 75b3f4d0ac00bf47459629615ab2246c8a34b4c6 Author: Lars Ingebrigtsen Date: Fri Sep 23 18:06:38 2022 +0200 Don't overwrite cus-load dependencies * lisp/cus-dep.el (custom-make-dependencies): Don't overwrite elements added by packages (bug#58015). diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index bb07a0694a..163a2da1f1 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -175,7 +175,10 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (prin1 (sort found #'string<)))) alist)))))) (dolist (e (sort alist (lambda (e1 e2) (string< (car e1) (car e2))))) - (insert "(put '" (car e) " 'custom-loads '" (cdr e) ")\n"))) + ;; Don't overwrite elements added by packages. + (insert "(put '" (car e) + " 'custom-loads (append '" (cdr e) + " (get '" (car e) " 'custom-loads)))\n"))) (insert "\ ;; The remainder of this file is for handling :version. commit 212e94c3f445ebe1388f6fab134133ebad9316d0 Author: Lars Ingebrigtsen Date: Fri Sep 23 17:58:41 2022 +0200 Make loaddefs-gen register parent :groups from defcustom * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload): Also register parent :groups from `defgroup' entries (bug#58015). diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 5819a26eb5..095d6b14e6 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -287,10 +287,14 @@ expression, in which case we want to handle forms differently." ;; In Emacs this is normally handled separately by cus-dep.el, but for ;; third party packages, it can be convenient to explicitly autoload ;; a group. - (let ((groupname (nth 1 form))) + (let ((groupname (nth 1 form)) + (parent (eval (plist-get form :group) t))) `(let ((loads (get ',groupname 'custom-loads))) (if (member ',file loads) nil - (put ',groupname 'custom-loads (cons ',file loads)))))) + (put ',groupname 'custom-loads (cons ',file loads)) + ,@(when parent + `((put ',parent 'custom-loads + (cons ',groupname (get ',parent 'custom-loads))))))))) ;; When processing a macro expansion, any expression ;; before a :autoload-end should be included. These are typically (put commit 419b873f3998c32493e8ec8d18571868613e6315 Author: kobarity Date: Fri Sep 23 17:39:53 2022 +0200 Fix syntax check in python-info-looking-at-beginning-of-defun * lisp/progmodes/python.el (python-info-looking-at-beginning-of-defun): Check syntax after moving to the beginning of line. * test/lisp/progmodes/python-tests.el (python-nav-beginning-of-defun-6) (python-end-of-defun-1, python-info-looking-at-beginning-of-defun-3): New tests (bug#58023). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d5ff059cc8..80c5b31b6e 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5505,11 +5505,11 @@ operator." "Check if point is at `beginning-of-defun' using SYNTAX-PPSS. When CHECK-STATEMENT is non-nil, the current statement is checked instead of the current physical line." - (and (not (python-syntax-context-type (or syntax-ppss (syntax-ppss)))) - (save-excursion - (when check-statement - (python-nav-beginning-of-statement)) - (beginning-of-line 1) + (save-excursion + (when check-statement + (python-nav-beginning-of-statement)) + (beginning-of-line 1) + (and (not (python-syntax-context-type (or syntax-ppss (syntax-ppss)))) (looking-at python-nav-beginning-of-defun-regexp)))) (defun python-info-looking-at-beginning-of-block () diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 20a7a0132a..fdaedb5fd7 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -2342,6 +2342,21 @@ class C: (beginning-of-line) (point)))))) +(ert-deftest python-nav-beginning-of-defun-6 () + (python-tests-with-temp-buffer + " +class C: + def foo(self): + pass +" + (python-tests-look-at "self") + (should (= (save-excursion + (python-nav-beginning-of-defun) + (point)) + (save-excursion + (beginning-of-line) + (point)))))) + (ert-deftest python-nav-end-of-defun-1 () (python-tests-with-temp-buffer " @@ -2472,6 +2487,26 @@ def \\ (save-excursion (point-max)))))) +(ert-deftest python-end-of-defun-1 () + (python-tests-with-temp-buffer + " +class C: + def a(self + ): + pass + + def b(self): + pass +" + (should (= (save-excursion + (python-tests-look-at "def a") + (end-of-defun) + (point)) + (save-excursion + (python-tests-look-at "def b") + (forward-line -1) + (point)))))) + (ert-deftest python-nav-backward-defun-1 () (python-tests-with-temp-buffer " @@ -5734,6 +5769,19 @@ def \\ (should (not (python-info-looking-at-beginning-of-defun))) (should (not (python-info-looking-at-beginning-of-defun nil t))))) +(ert-deftest python-info-looking-at-beginning-of-defun-3 () + (python-tests-with-temp-buffer + " +def foo(arg=\"default\"): # Comment + pass +" + (python-tests-look-at "arg") + (should (python-info-looking-at-beginning-of-defun)) + (python-tests-look-at "default") + (should (python-info-looking-at-beginning-of-defun)) + (python-tests-look-at "Comment") + (should (python-info-looking-at-beginning-of-defun)))) + (ert-deftest python-info-looking-at-beginning-of-block-1 () (python-tests-with-temp-buffer " commit 6fb4f4ad80a660200365b57f22b3912e59ffe9dd Author: Lars Ingebrigtsen Date: Fri Sep 23 17:34:46 2022 +0200 Inhibit image-crop when there's overlays * lisp/image/image-crop.el (image-crop): Don't mess with overlays, because they're a pain to reconstruct (bug#58027). diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el index 8ec4679b9b..61ed7e1db1 100644 --- a/lisp/image/image-crop.el +++ b/lisp/image/image-crop.el @@ -143,6 +143,8 @@ After cropping an image, you can save it by `M-x image-save' or (let ((image (get-text-property (point) 'display))) (unless (imagep image) (user-error "No image under point")) + (when (overlays-at (point)) + (user-error "Can't edit images that have overlays")) ;; We replace the image under point with an SVG image that looks ;; just like that image. That allows us to draw lines over it. ;; At the end, we replace that SVG with a cropped version of the commit f13300e84aecb89626eec6d62ce651270619a3e3 Author: Lars Ingebrigtsen Date: Fri Sep 23 17:31:23 2022 +0200 Delete the correct region after cropping an image * lisp/image/image-crop.el (image-crop): Delete the correct region after editing (bug#58027). diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el index d17c2ae389..8ec4679b9b 100644 --- a/lisp/image/image-crop.el +++ b/lisp/image/image-crop.el @@ -176,7 +176,7 @@ After cropping an image, you can save it by `M-x image-save' or (point-max))))) (text (buffer-substring image-start image-end)) (inhibit-read-only t) - orig-data) + orig-data svg-end) (with-temp-buffer (set-buffer-multibyte nil) (if (null data) @@ -196,6 +196,7 @@ After cropping an image, you can save it by `M-x image-save' or (with-buffer-unmodified-if-unchanged (delete-region image-start image-end) (svg-insert-image svg) + (setq svg-end (point)) (let ((area (condition-case _ (save-excursion (forward-line 1) @@ -205,7 +206,7 @@ After cropping an image, you can save it by `M-x image-save' or (message (substitute-command-keys "Type \\[image-save] to save %s image to file") (if cut "cut" "cropped")) - (delete-region (pos-bol) (pos-eol)) + (delete-region image-start svg-end) (if area (image-crop--crop-image-update area orig-data size type cut text) commit 9f4ec56d83ecb16e1add2840678befd1a27258e8 Author: Stefan Kangas Date: Fri Sep 23 17:22:47 2022 +0200 image-dired: Disable 'image-map' in thumbnail buffer These bindings are more likely to mess up the buffer than to be helpful here; image manipulation is better done in the display buffer. * lisp/image/image-dired.el (image-dired-insert-thumbnail): Disable `image-map' in thumbnail buffer. diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 30cd83871b..c074f3312d 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -408,6 +408,8 @@ Add text properties ORIGINAL-FILE-NAME and ASSOCIATED-DIRED-BUFFER." (add-text-properties beg end (list 'image-dired-thumbnail t + ;; Disable `image-map' on thumbnails. + 'keymap nil 'original-file-name original-file-name 'associated-dired-buffer associated-dired-buffer 'tags (image-dired-list-tags original-file-name) commit 92ce1d3fda4d892468d579e5d9cb3165677745ed Author: Stefan Kangas Date: Fri Sep 23 17:10:15 2022 +0200 Update manual for recent image-dired changes * doc/emacs/dired.texi (Image-Dired): Update to reflect recent changes. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 33e9270d42..3dc6f724de 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -1641,7 +1641,7 @@ or through an external viewer. This is different from Image mode To enter Image-Dired, mark the image files you want to look at in the Dired buffer, using @kbd{m} as usual. Then type @kbd{C-t d} (@code{image-dired-display-thumbs}). This creates and switches to a -buffer containing image-dired, corresponding to the marked files. +buffer containing Image-Dired, corresponding to the marked files. You can also enter Image-Dired directly by typing @kbd{M-x image-dired}. This prompts for a directory; specify one that has @@ -1660,10 +1660,9 @@ display the next image. Typing @key{DEL} the previous thumbnail and displays that instead. @vindex image-dired-external-viewer - To view the image in its original size, either provide a prefix -argument (@kbd{C-u}) before pressing @key{RET}, or type -@kbd{C-@key{RET}} (@code{image-dired-thumbnail-display-external}) to -display the image in an external viewer. You must first configure + Type @kbd{C-@key{RET}} +(@code{image-dired-thumbnail-display-external}) to display the image +in an external viewer. You must first configure @code{image-dired-external-viewer}. You can delete images through Image-Dired also. Type @kbd{d} @@ -1674,9 +1673,9 @@ image from the thumbnail buffer with @kbd{C-d} More advanced features include @dfn{image tags}, which are metadata used to categorize image files. The tags are stored in a plain text -file configured by @code{image-dired-db-file}. +file configured by @code{image-dired-tags-db-file}. - To tag image files, mark them in the dired buffer (you can also mark + To tag image files, mark them in the Dired buffer (you can also mark files in Dired from the thumbnail buffer by typing @kbd{m}) and type @kbd{C-t t} (@code{image-dired-tag-files}). This reads the tag name in the minibuffer. To mark files having a certain tag, type @kbd{C-t f} diff --git a/etc/NEWS b/etc/NEWS index d7a6cc60eb..63c4ec79d2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2157,7 +2157,7 @@ nil to disable this confirmation completely. --- *** 'image-dired-thumb-size' increased to 128. ---- ++++ *** 'image-dired-db-file' renamed to 'image-dired-tags-db-file'. --- commit c9c1d8e54d9898868793ca6265ed9280b729fc86 Author: Mattias Engdegård Date: Fri Sep 23 16:12:29 2022 +0200 * lisp/files.el (risky-local-variable): Remove max-specpdl-size. diff --git a/lisp/files.el b/lisp/files.el index 0f2d3ca4b9..7fde8720fa 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3593,7 +3593,6 @@ asking you for confirmation." inhibit-quit load-path max-lisp-eval-depth - max-specpdl-size minor-mode-map-alist minor-mode-overriding-map-alist mode-line-format commit 47b986d4882c0f105fc2129fd06b3f7b48e7ea55 Author: Mattias Engdegård Date: Fri Sep 23 15:26:13 2022 +0200 Remove max-specpdl-size overrun test * test/src/eval-tests.el (eval-tests--exceed-specbind-limit) (eval-exceed-specbind-with-signal-hook): Remove test that is no longer useful, since there is no longer any specpdl limit to overrun. (The test still passed but vacuously so, by hitting the max-lisp-eval-depth limit instead.) This silences an obsoletion warning. diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index 1b2ad99360..bb2f04e8ee 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el @@ -108,26 +108,6 @@ Bug#24912." (should-error (eval (cons 'cond clauses) nil)) (should-error (eval (cons 'cond clauses) t)))) -(defun eval-tests--exceed-specbind-limit () - (defvar eval-tests--var1) - (defvar eval-tests--var2) - ;; Bind two variables, to make extra sure we hit the - ;; `max-specpdl-size' limit before the `max-lisp-eval-depth' limit. - (let ((eval-tests--var1 1) - (eval-tests--var2 2)) - ;; Recurse until we hit the limit. - (eval-tests--exceed-specbind-limit))) - -(ert-deftest eval-exceed-specbind-with-signal-hook () - "Test for Bug#30481. -Check that Emacs doesn't crash when exceeding specbind limit with -`signal-hook-function' bound. NOTE: Without the fix for -Bug#30481, this test can appear to pass, but cause a -crash/abort/malloc assert failure on the next test." - (let ((max-specpdl-size (/ max-lisp-eval-depth 2)) - (signal-hook-function #'ignore)) - (should-error (eval-tests--exceed-specbind-limit)))) - (ert-deftest defvar/bug31072 () "Check that Bug#31072 is fixed." (should-error (eval '(defvar 1) t) :type 'wrong-type-argument)) commit c53f5a2176c9c67e0d1dbc7315c79eb070deaee2 Author: Stefan Kangas Date: Fri Sep 23 16:08:03 2022 +0200 ; Fix :type of image-dired-thumbnail-storage * lisp/image/image-dired.el (image-dired-thumbnail-storage): Fix :type for recent change. diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 11427a84aa..30cd83871b 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -199,7 +199,7 @@ format, as mandated by that standard, and otherwise as JPEG. For more information on the Thumbnail Managing Standard, see: https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html" :type '(choice :tag "How to store thumbnail files" - (const :tag "Use image-dired-dir" use-image-dired-dir) + (const :tag "Use image-dired-dir" image-dired) (const :tag "Thumbnail Managing Standard (normal 128x128)" standard) (const :tag "Thumbnail Managing Standard (large 256x256)" commit ea0dfb173c66b546b8ab39569dc731d061be9ad5 Author: Michael Albinus Date: Fri Sep 23 16:07:07 2022 +0200 * lisp/bookmark.el (bookmark-make-record): Fix thinko. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 0384812d3f..a4d4237151 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -607,8 +607,8 @@ context strings from the current buffer." ;; don't include any context in the bookmark file, because ;; that would leak (possibly secret) data. (if (and buffer-file-name - (not (run-hook-with-args-until-success - 'bookmark-inhibit-context-functions buffer-file-name))) + (run-hook-with-args-until-success + 'bookmark-inhibit-context-functions buffer-file-name)) 0 bookmark-search-size)) (record (funcall bookmark-make-record-function))) commit 8557ecca5363e9b99371d2a3459da654d4d32fc1 Author: Stefan Kangas Date: Fri Sep 23 15:14:17 2022 +0200 ; Fix warnings in --without-x build * lisp/image/image-crop.el (image-scaling-factor) (image-property, image-size, imagep): * test/src/image-tests.el (image-size, image-mask-p) (image-metadata): Declare. diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el index 39c5757636..d17c2ae389 100644 --- a/lisp/image/image-crop.el +++ b/lisp/image/image-crop.el @@ -31,6 +31,11 @@ (require 'text-property-search) (eval-when-compile (require 'subr-x)) +(defvar image-scaling-factor) +(declare-function image-property "image.el" (image property)) +(declare-function image-size "image.c" (spec &optional pixels frame)) +(declare-function imagep "image.c" (spec)) + (defgroup image-crop () "Image cropping." :group 'image) diff --git a/test/src/image-tests.el b/test/src/image-tests.el index bf79faca52..d1a4dad37b 100644 --- a/test/src/image-tests.el +++ b/test/src/image-tests.el @@ -23,6 +23,10 @@ (require 'ert) +(declare-function image-size "image.c" (spec &optional pixels frame)) +(declare-function image-mask-p "image.c" (spec &optional frame)) +(declare-function image-metadata "image.c" (spec &optional frame)) + (defconst image-tests--images `((gif . ,(expand-file-name "test/data/image/black.gif" source-directory)) commit b306bc5e6deab0a4c1afdd70efd33c0cdf23745f Author: Stefan Kangas Date: Fri Sep 23 15:10:33 2022 +0200 Improve prompt of 'image-dired' command * lisp/image/image-dired.el (image-dired-show-all-from-dir): Improve prompt. diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 1b8b1f1df7..11427a84aa 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -553,7 +553,7 @@ If the number of image files in DIR exceeds `image-dired-show-all-from-dir-max-files', ask for confirmation before creating the thumbnail buffer. If that variable is nil, never ask for confirmation." - (interactive "DImage-Dired: ") + (interactive "DImage-Dired (directory): ") (dired dir) (dired-mark-files-regexp (image-dired--file-name-regexp)) (let ((files (dired-get-marked-files nil nil nil t))) commit 651c8ab5c5a994fe56d8af0249cc2f61c8198cae Author: Stefan Kangas Date: Fri Sep 23 15:01:36 2022 +0200 Rename 'image-dired-db-file' to 'image-dired-tags-db-file' * lisp/image/image-dired.el (image-dired-tags-db-file): Rename from 'image-dired-db-file'. Update all uses and make old name into an obsolete variable alias. diff --git a/etc/NEWS b/etc/NEWS index 7a573b5e83..d7a6cc60eb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2157,6 +2157,9 @@ nil to disable this confirmation completely. --- *** 'image-dired-thumb-size' increased to 128. +--- +*** 'image-dired-db-file' renamed to 'image-dired-tags-db-file'. + --- *** 'image-dired-thumb-{height,width}' are now obsolete. Customize 'image-dired-thumb-size' instead, which will set both the diff --git a/lisp/image/image-dired-tags.el b/lisp/image/image-dired-tags.el index e97bf70e89..7a837875ce 100644 --- a/lisp/image/image-dired-tags.el +++ b/lisp/image/image-dired-tags.el @@ -35,34 +35,34 @@ (defvar image-dired-dir) (defvar image-dired-thumbnail-storage) -(defvar image-dired-db-file) +(defvar image-dired-tags-db-file) (defmacro image-dired--with-db-file (&rest body) - "Run BODY in a temp buffer containing `image-dired-db-file'. + "Run BODY in a temp buffer containing `image-dired-tags-db-file'. Return the last form in BODY." (declare (indent 0) (debug t)) `(with-temp-buffer - (if (file-exists-p image-dired-db-file) - (insert-file-contents image-dired-db-file)) + (if (file-exists-p image-dired-tags-db-file) + (insert-file-contents image-dired-tags-db-file)) ,@body)) (defun image-dired-sane-db-file () - "Check if `image-dired-db-file' exists. + "Check if `image-dired-tags-db-file' exists. If not, try to create it (including any parent directories). Signal error if there are problems creating it." - (or (file-exists-p image-dired-db-file) + (or (file-exists-p image-dired-tags-db-file) (let (dir buf) (unless (file-directory-p (setq dir (file-name-directory - image-dired-db-file))) + image-dired-tags-db-file))) (with-file-modes #o700 (make-directory dir t))) (with-current-buffer (setq buf (create-file-buffer - image-dired-db-file)) + image-dired-tags-db-file)) (with-file-modes #o600 - (write-file image-dired-db-file))) + (write-file image-dired-tags-db-file))) (kill-buffer buf) - (file-exists-p image-dired-db-file)) - (error "Could not create %s" image-dired-db-file))) + (file-exists-p image-dired-tags-db-file)) + (error "Could not create %s" image-dired-tags-db-file))) (defvar image-dired-tag-history nil "Variable holding the tag history.") @@ -74,7 +74,7 @@ FILE-TAGS is an alist in the following form: (image-dired-sane-db-file) (let (end file tag) (image-dired--with-db-file - (setq buffer-file-name image-dired-db-file) + (setq buffer-file-name image-dired-tags-db-file) (dolist (elt file-tags) (setq file (car elt) tag (cdr elt)) @@ -94,7 +94,7 @@ FILE-TAGS is an alist in the following form: "For all FILES, remove TAG from the image database." (image-dired-sane-db-file) (image-dired--with-db-file - (setq buffer-file-name image-dired-db-file) + (setq buffer-file-name image-dired-tags-db-file) (let (end) (unless (listp files) (if (stringp files) @@ -194,7 +194,7 @@ FILE-COMMENTS is an alist on the following form: (image-dired-sane-db-file) (let (end comment-beg-pos comment-end-pos file comment) (image-dired--with-db-file - (setq buffer-file-name image-dired-db-file) + (setq buffer-file-name image-dired-tags-db-file) (dolist (elt file-comments) (setq file (car elt) comment (cdr elt)) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index bcff62484f..1b8b1f1df7 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -98,7 +98,7 @@ ;; option `image-dired-thumbnail-storage'. ;; ;; * WARNING: The "database" format used might be changed so keep a -;; backup of `image-dired-db-file' when testing new versions. +;; backup of `image-dired-tags-db-file' when testing new versions. ;; ;; TODO ;; ==== @@ -211,7 +211,9 @@ https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html (const :tag "Per-directory" per-directory)) :version "29.1") -(defcustom image-dired-db-file +(define-obsolete-variable-alias 'image-dired-db-file + 'image-dired-tags-db-file "29.1") +(defcustom image-dired-tags-db-file (expand-file-name ".image-dired_db" image-dired-dir) "Database file where file names and their associated tags are stored." :type 'file) commit 7aa771a4824c389c114796e3f318f9f5809f9c5f Merge: e359df4217 60ac12d21f Author: Stefan Kangas Date: Fri Sep 23 14:56:54 2022 +0200 Merge from origin/emacs-28 60ac12d21f Fix shaping with bitmap-only fonts on HarfBuzz 5.2.0 (Bug#... 9f65e52362 ; Minor copyedits of elisp.texi commit e359df4217a392bb3185ff7449656c0a8953a6f4 Author: Po Lu Date: Fri Sep 23 20:41:24 2022 +0800 Fix more toolkit scroll bar window protection issues * src/xterm.c (handle_one_xevent): Ignore outdated scroll bar events. (x_free_frame_resources): Clear protected windows and invalidate previous scroll bar events. * src/xterm.h (struct x_display_info): New field `first_valid_scroll_bar_req'. diff --git a/src/xterm.c b/src/xterm.c index 6860ef2080..2d366e5511 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -18109,7 +18109,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, /* Unprotect the first window to be sent in a ClientMessage event, since it is now on the stack and thereby subject to garbage collection. */ - x_unprotect_window_for_callback (dpyinfo); + if (event->xclient.serial + >= dpyinfo->first_valid_scroll_bar_req) + x_unprotect_window_for_callback (dpyinfo); *finish = X_EVENT_GOTO_OUT; goto done; @@ -18121,7 +18123,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, /* Unprotect the first window to be sent in a ClientMessage event, since it is now on the stack and thereby subject to garbage collection. */ - x_unprotect_window_for_callback (dpyinfo); + if (event->xclient.serial + >= dpyinfo->first_valid_scroll_bar_req) + x_unprotect_window_for_callback (dpyinfo); *finish = X_EVENT_GOTO_OUT; goto done; @@ -27339,6 +27343,16 @@ x_free_frame_resources (struct frame *f) #if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK && defined HAVE_CLOCK_GETTIME x_sync_free_fences (f); #endif + +#ifdef USE_TOOLKIT_SCROLL_BARS + /* Since the frame was destroyed, we can no longer guarantee + that scroll bar events will be received. Clear + protected_windows, and ignore any preceding scroll bar events + that happen to still be deliverable. */ + dpyinfo->n_protected_windows = 0; + dpyinfo->first_valid_scroll_bar_req + = XNextRequest (dpyinfo->display); +#endif } #ifdef HAVE_GTK3 diff --git a/src/xterm.h b/src/xterm.h index d6ff15e40f..d1671621c7 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -839,6 +839,15 @@ struct x_display_info server_time_monotonic_p will be true). */ int_fast64_t server_time_offset; #endif + +#if defined USE_TOOLKIT_SCROLL_BARS + /* Serial number of the first scroll bar event to start listening + to. This is necessary because protected_windows is display + local, but the destruction of a frame's edit window may cause + event windows to vanish before they are delivered, leading to + windows remaining protected indefinitely. */ + unsigned long first_valid_scroll_bar_req; +#endif }; #ifdef HAVE_X_I18N commit 8892abbaf92ebd2e8f968fe86270fba08bf1d07a Author: Stefan Kangas Date: Fri Sep 23 11:50:28 2022 +0200 Autoload wallpaper-set * lisp/image/wallpaper.el (wallpaper-set): Autoload. * lisp/image-mode.el (wallpaper): * lisp/image/image-dired.el (wallpaper): * lisp/thumbs.el (wallpaper): Don't require. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index a4c292f2b6..eee4be6a10 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -45,7 +45,6 @@ (require 'image) (require 'exif) (require 'dired) -(require 'wallpaper) (eval-when-compile (require 'cl-lib)) ;;; Image mode window-info management. diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 41ed05f191..bcff62484f 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -133,7 +133,6 @@ (require 'dired) (require 'image-mode) -(require 'wallpaper) (require 'widget) (require 'xdg) diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el index 31091a6002..aea13227a8 100644 --- a/lisp/image/wallpaper.el +++ b/lisp/image/wallpaper.el @@ -279,6 +279,7 @@ See also `wallpaper-default-width'.") (declare-function w32-set-wallpaper "w32fns.c") (declare-function haiku-set-wallpaper "term/haiku-win.el") +;;;###autoload (defun wallpaper-set (file) "Set the desktop background to FILE in a graphical environment. diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 0c5307f8de..a9ff9f5ebc 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -54,7 +54,6 @@ ;;; Code: (require 'dired) -(require 'wallpaper) (require 'cl-lib) ; for cl-gensym ;; CUSTOMIZATIONS commit 60ac12d21f9b5a97c33efc639c8204c39367292b Author: YAMAMOTO Mitsuharu Date: Fri Sep 23 14:17:12 2022 +0900 Fix shaping with bitmap-only fonts on HarfBuzz 5.2.0 (Bug#57976) * src/ftcrfont.c (ftcrhbfont_begin_hb_font): Undo last change for HarfBuzz 5.2.0. diff --git a/src/ftcrfont.c b/src/ftcrfont.c index d5d3e440af..97b68ac013 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -570,8 +570,12 @@ ftcrhbfont_begin_hb_font (struct font *font, double *position_unit) hb_font_t *hb_font = fthbfont_begin_hb_font (font, position_unit); /* HarfBuzz 5 correctly scales bitmap-only fonts without position unit adjustment. - (https://github.com/harfbuzz/harfbuzz/issues/489) */ - if (!hb_version_atleast (5, 0, 0) + (https://github.com/harfbuzz/harfbuzz/issues/489) + + Update: HarfBuzz 5.2.0 no longer does this for an hb_font_t font + object created from a given FT_Face. + (https://github.com/harfbuzz/harfbuzz/issues/3788) */ + if ((hb_version_atleast (5, 2, 0) || !hb_version_atleast (5, 0, 0)) && ftcrfont_info->bitmap_position_unit) *position_unit = ftcrfont_info->bitmap_position_unit; commit 9f65e523623be48016a1ae9b72d9b1e1a827d1c6 Author: Eli Zaretskii Date: Thu Sep 22 19:43:15 2022 +0300 ; Minor copyedits of elisp.texi * doc/lispref/variables.texi (Setting Generalized Variables): Improve wording. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index b9f50ecc6a..c8107d58cd 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2570,15 +2570,15 @@ is a set of forms that can be generalized variables in Lisp. The @code{setf} macro is the most basic way to operate on generalized variables. The @code{setf} form is like @code{setq}, except that it -accepts arbitrary place forms on the left side rather than just -symbols. For example, @code{(setf (car a) b)} sets the car of -@code{a} to @code{b}, doing the same operation as @code{(setcar a b)}, -but without you having to use two separate functions for setting and -accessing this type of place. +accepts arbitrary place forms in the first (left) argument of each +pair rather than just symbols. For example, @code{(setf (car a) b)} +sets the car of @code{a} to @code{b}, doing the same operation as +@code{(setcar a b)}, but without you having to use two separate +functions for setting and accessing this type of place. @defmac setf [place form]@dots{} -This macro evaluates @var{form} and stores it in @var{place}, which -must be a valid generalized variable form. If there are several +This macro evaluates @var{form} and stores its value in @var{place}, +which must be a valid generalized variable form. If there are several @var{place} and @var{form} pairs, the assignments are done sequentially just as with @code{setq}. @code{setf} returns the value of the last @var{form}.