From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#56820: outline-minor-mode replacing the first character with an arrow Date: Wed, 31 Aug 2022 19:20:23 +0300 Organization: LINKOV.NET Message-ID: <86wnaojst4.fsf@mail.linkov.net> References: <87ilngmaei.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30890"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 56820@debbugs.gnu.org To: Yilkal Argaw Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 31 18:26:04 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oTQXT-0007uZ-Uu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 18:26:03 +0200 Original-Received: from localhost ([::1]:55138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTQXS-0006Dr-RM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 12:26:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTQTa-0002Uj-ID for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 12:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTQTa-0000dm-8M for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 12:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTQTZ-0001Dl-Ne for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 12:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Aug 2022 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56820 X-GNU-PR-Package: emacs Original-Received: via spool by 56820-submit@debbugs.gnu.org id=B56820.16619629034668 (code B ref 56820); Wed, 31 Aug 2022 16:22:01 +0000 Original-Received: (at 56820) by debbugs.gnu.org; 31 Aug 2022 16:21:43 +0000 Original-Received: from localhost ([127.0.0.1]:40310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTQTG-0001DE-Sx for submit@debbugs.gnu.org; Wed, 31 Aug 2022 12:21:43 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:60379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTQTE-0001Cy-HF for 56820@debbugs.gnu.org; Wed, 31 Aug 2022 12:21:41 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 636AF40008; Wed, 31 Aug 2022 16:21:32 +0000 (UTC) In-Reply-To: (Yilkal Argaw's message of "Sat, 30 Jul 2022 06:27:27 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241205 Archived-At: > 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)) ```