From: Juri Linkov Date: Tue, 18 Oct 2022 18:05:15 +0000 (+0300) Subject: * lisp/outline.el: Use one character wide strings for margins (bug#57813) X-Git-Tag: emacs-29.0.90~1616^2~548 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a9f183c760082af5978a8f76df60ca507cb39fea;p=emacs.git * lisp/outline.el: Use one character wide strings for margins (bug#57813) (outline-open-in-margins, outline-close-in-margins) (outline-close-rtl-in-margins): Add 1-char emoji, symbol, text for margins that are 1-column wide. (outline-minor-mode): Force display of margins only for the selected buffer. --- diff --git a/lisp/outline.el b/lisp/outline.el index b87d3ac5e7f..0d0974b5a95 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -339,17 +339,26 @@ Note that this feature is meant to be used in editing buffers." :version "29.1") (define-icon outline-open-in-margins outline-open - '((image "outline-open.svg" "outline-open.pbm" :height 10)) + '((image "outline-open.svg" "outline-open.pbm" :height 10) + (emoji "🔽") + (symbol "▼") + (text "v")) "Icon used for buttons for opened sections in margins." :version "29.1") (define-icon outline-close-in-margins outline-close - '((image "outline-open.svg" "outline-open.pbm" :height 10 :rotation -90)) + '((image "outline-open.svg" "outline-open.pbm" :height 10 :rotation -90) + (emoji "▶️") + (symbol "▶") + (text ">")) "Icon used for buttons for closed sections in margins." :version "29.1") (define-icon outline-close-rtl-in-margins outline-close-rtl - '((image "outline-open.svg" "outline-open.pbm" :height 10 :rotation 90)) + '((image "outline-open.svg" "outline-open.pbm" :height 10 :rotation 90) + (emoji "◀️") + (symbol "◀") + (text "<")) "Right-to-left icon used for closed sections in margins." :version "29.1") @@ -513,7 +522,8 @@ See the command `outline-mode' for more information on this mode." (setq-local left-margin-width (1+ left-margin-width))) (setq-local fringes-outside-margins t) ;; Force display of margins - (set-window-buffer nil (window-buffer))) + (when (eq (current-buffer) (window-buffer)) + (set-window-buffer nil (window-buffer)))) (when (or outline--use-buttons outline--use-margins) (add-hook 'after-change-functions #'outline--fix-buttons-after-change nil t)) @@ -551,7 +561,8 @@ See the command `outline-mode' for more information on this mode." (setq-local left-margin-width (1- left-margin-width))) (setq-local fringes-outside-margins nil) ;; Force removal of margins - (set-window-buffer nil (window-buffer))))) + (when (eq (current-buffer) (window-buffer)) + (set-window-buffer nil (window-buffer)))))) (defvar-local outline-heading-alist () "Alist associating a heading for every possible level.