GNU bug report logs - #56820
outline-minor-mode replacing the first character with an arrow

Previous Next

Package: emacs;

Reported by: Yilkal Argaw <yilkalargawworkneh <at> gmail.com>

Date: Fri, 29 Jul 2022 10:40:02 UTC

Severity: normal

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #44 received at 56820 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Yilkal Argaw <yilkalargawworkneh <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 56820 <at> debbugs.gnu.org
Subject: Re: bug#56820: outline-minor-mode replacing the first character
 with an arrow
Date: Wed, 31 Aug 2022 19:20:23 +0300
> Thanks  that fixed the default behaviour but
> outline-minor-mode-use-buttons option still has a weird bug because
> when you use it with modes like python-mode and ruby-mode it replaces
> the first character of the outline-regep which for the aforementioned
> modes is strings like "module", "class", "def" etc... so when it
> replaces the first character it renders the buffer unreadable. So it
> might be better to insert the arrows in front of the first character
> instead of replacing the first character.

This patch could help to alleviate the problem by keeping
the first character displayed on the outline button:

```
diff --git a/lisp/outline.el b/lisp/outline.el
index 857ac9562f..498ea6fad4 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1006,7 +1018,8 @@ outline--make-button-overlay
         (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 (plist-get icon 'string))
+      (overlay-put o 'display (concat (plist-get icon 'string)
+                                      (string (char-after (point)))))
       (overlay-put o 'face (plist-get icon 'face)))
     o))
 
```




This bug report was last modified 2 years and 258 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.