From: Juri Linkov Date: Thu, 15 Sep 2022 16:30:17 +0000 (+0300) Subject: Fix outline image icon display (bug#57813) X-Git-Tag: emacs-29.0.90~1856^2~483 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=471414fe6ba8e9c9d755a83e7feddcdd5a45456a;p=emacs.git Fix outline image icon display (bug#57813) * lisp/outline.el (outline--make-button-overlay): Don't overwrite image display with string display when image exists. (outline--fix-up-all-buttons): Optimize. --- diff --git a/lisp/outline.el b/lisp/outline.el index b19e0cf8119..c9d1a4ac64b 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1003,11 +1003,11 @@ If non-nil, EVENT should be a mouse event." ;; movement commands work more logically. (when (derived-mode-p 'special-mode) (put-text-property (point) (1+ (point)) 'face (plist-get icon 'face))) - (when-let ((image (plist-get icon 'image))) - (overlay-put o 'display image)) - (overlay-put o 'display (concat (plist-get icon 'string) - (string (char-after (point))))) - (overlay-put o 'face (plist-get icon 'face))) + (if-let ((image (plist-get icon 'image))) + (overlay-put o 'display image) + (overlay-put o 'display (concat (plist-get icon 'string) + (string (char-after (point))))) + (overlay-put o 'face (plist-get icon 'face)))) o)) (defun outline--insert-open-button () @@ -1041,11 +1041,11 @@ If non-nil, EVENT should be a mouse event." "" #'outline-show-subtree)))))) (defun outline--fix-up-all-buttons (&optional from to) - (when from - (save-excursion - (goto-char from) - (setq from (line-beginning-position)))) (when (outline--use-buttons-p) + (when from + (save-excursion + (goto-char from) + (setq from (line-beginning-position)))) (outline-map-region (lambda () ;; `outline--cycle-state' will fail if we're in a totally