From: Juri Linkov Date: Mon, 7 Nov 2022 08:14:45 +0000 (+0200) Subject: * lisp/outline.el (outline-minor-mode): Ensure margins are either 0 or 1. X-Git-Tag: emacs-29.0.90~1616^2~251 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=236703ca05382c9cdf4ce6a2dd2b3244c20d564d;p=emacs.git * lisp/outline.el (outline-minor-mode): Ensure margins are either 0 or 1. This check is necessary to make it idempotent to multiple calls. --- diff --git a/lisp/outline.el b/lisp/outline.el index ef5249a146c..a646f71db8b 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -507,7 +507,9 @@ See the command `outline-mode' for more information on this mode." (when (eq (current-bidi-paragraph-direction) 'right-to-left) (setq-local outline--use-rtl t)) (setq-local outline--button-icons (outline--create-button-icons)) - (when (eq outline-minor-mode-use-buttons 'in-margins) + (when (and (eq outline-minor-mode-use-buttons 'in-margins) + (> 1 (if outline--use-rtl right-margin-width + left-margin-width))) (if outline--use-rtl (setq-local right-margin-width (1+ right-margin-width)) (setq-local left-margin-width (1+ left-margin-width))) @@ -542,7 +544,9 @@ See the command `outline-mode' for more information on this mode." (remove-overlays nil nil 'outline-highlight t)) (when outline-minor-mode-use-buttons (remove-overlays nil nil 'outline-button t) - (when (eq outline-minor-mode-use-buttons 'in-margins) + (when (and (eq outline-minor-mode-use-buttons 'in-margins) + (< 0 (if outline--use-rtl right-margin-width + left-margin-width))) (if outline--use-rtl (setq-local right-margin-width (1- right-margin-width)) (setq-local left-margin-width (1- left-margin-width)))