GNU bug report logs - #51606
29.0.50; [PATCH] Show offscreen context with properties

Previous Next

Package: emacs;

Reported by: Arash Esbati <arash <at> gnu.org>

Date: Fri, 5 Nov 2021 09:42:02 UTC

Severity: normal

Tags: moreinfo, patch

Found in version 29.0.50

Fixed in version 29.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51606 in the body.
You can then email your comments to 51606 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51606; Package emacs. (Fri, 05 Nov 2021 09:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arash Esbati <arash <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 05 Nov 2021 09:42:02 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: emacs-bugs <bug-gnu-emacs <at> gnu.org>
Subject: 29.0.50; [PATCH] Show offscreen context with properties
Date: Fri, 05 Nov 2021 10:40:47 +0100
Hi all,

paren.el now can show the context in minibuffer when
`show-paren-context-when-offscreen' is non-nil (introduced in this
change 9f505c476e).  Is it possible to extend this that text properties
are not stripped?  I'm thinking about something like this:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/paren.el b/lisp/paren.el
index 7e7cf6c262..d0330f2f6a 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -96,6 +96,14 @@ show-paren-context-when-offscreen
   :type 'boolean
   :version "29.1")

+(defcustom show-paren-context-when-offscreen-with-properties nil
+  "If non-nil, show the offscreen context in the echo area with properties.
+It is complementary to `show-paren-context-when-offscreen' and is
+taken into account when `show-paren-context-when-offscreen' is
+non-nil."
+  :type 'boolean
+  :version "29.1")
+
 (defvar show-paren--idle-timer nil)
 (defvar show-paren--overlay
   (let ((ol (make-overlay (point) (point) nil t))) (delete-overlay ol) ol)
@@ -332,7 +340,9 @@ show-paren-function
                       (message-log-max nil))
                   (minibuffer-message
                    "Matches %s"
-                   (substring-no-properties open-paren-line-string)))))
+                   (if show-paren-context-when-offscreen-with-properties
+                       open-paren-line-string
+                     (substring-no-properties open-paren-line-string))))))
           ;; Always set the overlay face, since it varies.
           (overlay-put show-paren--overlay 'priority show-paren-priority)
           (overlay-put show-paren--overlay 'face face))))))
--8<---------------cut here---------------end--------------->8---

Any comments welcome.  I will prepare a proper format-patch (incl. update of
programs.texi) once this is accepted.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51606; Package emacs. (Fri, 05 Nov 2021 12:04:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Arash Esbati <arash <at> gnu.org>, Daniel Martín
 <mardani29 <at> yahoo.es>
Cc: 51606 <at> debbugs.gnu.org
Subject: Re: bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
Date: Fri, 05 Nov 2021 14:02:50 +0200
> From: Arash Esbati <arash <at> gnu.org>
> Date: Fri, 05 Nov 2021 10:40:47 +0100
> 
> paren.el now can show the context in minibuffer when
> `show-paren-context-when-offscreen' is non-nil (introduced in this
> change 9f505c476e).  Is it possible to extend this that text properties
> are not stripped?  I'm thinking about something like this:

Why do we remove the properties in the first place?  Daniel, any
special reasons?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51606; Package emacs. (Fri, 05 Nov 2021 12:58:01 GMT) Full text and rfc822 format available.

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

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Arash Esbati <arash <at> gnu.org>, 51606 <at> debbugs.gnu.org
Subject: Re: bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
Date: Fri, 05 Nov 2021 13:57:08 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Arash Esbati <arash <at> gnu.org>
>> Date: Fri, 05 Nov 2021 10:40:47 +0100
>> 
>> paren.el now can show the context in minibuffer when
>> `show-paren-context-when-offscreen' is non-nil (introduced in this
>> change 9f505c476e).  Is it possible to extend this that text properties
>> are not stripped?  I'm thinking about something like this:
>
> Why do we remove the properties in the first place?  Daniel, any
> special reasons?

No reason other than being cautious and "follow the traditional behavior
of blink-matching-open".  The code that I extracted from
blink-matching-open to reuse it for show-paren-mode removed the text
properties (see
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/simple.el?h=emacs-28#n8608).
If I'm not mistaken, this was apparently introduced in 2005 by Richard
Stallman
(https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-28&id=1d0e3fc84f058248515f242c0484a0dabfac95aa),
but I don't know the reasons for the change.  Perhaps it didn't look
good on some TTY frames?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51606; Package emacs. (Fri, 05 Nov 2021 14:02:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Martín <mardani29 <at> yahoo.es>,
 Richard Stallman <rms <at> gnu.org>
Cc: arash <at> gnu.org, 51606 <at> debbugs.gnu.org
Subject: Re: bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
Date: Fri, 05 Nov 2021 16:01:07 +0200
> From: Daniel Martín <mardani29 <at> yahoo.es>
> Cc: Arash Esbati <arash <at> gnu.org>,  51606 <at> debbugs.gnu.org
> Date: Fri, 05 Nov 2021 13:57:08 +0100
> 
> >> paren.el now can show the context in minibuffer when
> >> `show-paren-context-when-offscreen' is non-nil (introduced in this
> >> change 9f505c476e).  Is it possible to extend this that text properties
> >> are not stripped?  I'm thinking about something like this:
> >
> > Why do we remove the properties in the first place?  Daniel, any
> > special reasons?
> 
> No reason other than being cautious and "follow the traditional behavior
> of blink-matching-open".  The code that I extracted from
> blink-matching-open to reuse it for show-paren-mode removed the text
> properties (see
> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/simple.el?h=emacs-28#n8608).
> If I'm not mistaken, this was apparently introduced in 2005 by Richard
> Stallman
> (https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-28&id=1d0e3fc84f058248515f242c0484a0dabfac95aa),
> but I don't know the reasons for the change.  Perhaps it didn't look
> good on some TTY frames?

I'd be surprised.

Richard, do you remember why you removed text properties from the
blink-matching-open text it shows in the echo-area?




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 05 Nov 2021 23:22:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51606; Package emacs. (Fri, 26 Nov 2021 19:02:01 GMT) Full text and rfc822 format available.

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

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: arash <at> gnu.org, Richard Stallman <rms <at> gnu.org>, 51606 <at> debbugs.gnu.org
Subject: Re: bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
Date: Fri, 26 Nov 2021 20:01:28 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> >
>> > Why do we remove the properties in the first place?  Daniel, any
>> > special reasons?
>> 
>> No reason other than being cautious and "follow the traditional behavior
>> of blink-matching-open".  The code that I extracted from
>> blink-matching-open to reuse it for show-paren-mode removed the text
>> properties (see
>> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/simple.el?h=emacs-28#n8608).
>> If I'm not mistaken, this was apparently introduced in 2005 by Richard
>> Stallman
>> (https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-28&id=1d0e3fc84f058248515f242c0484a0dabfac95aa),
>> but I don't know the reasons for the change.  Perhaps it didn't look
>> good on some TTY frames?
>
> I'd be surprised.
>
> Richard, do you remember why you removed text properties from the
> blink-matching-open text it shows in the echo-area?

BTW, the patch looks good to me.  But if keeping the text properties is
not a problem, I'd do that unconditionally, without adding another
customization option.  WDYT?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51606; Package emacs. (Mon, 29 Nov 2021 11:05:02 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Richard Stallman <rms <at> gnu.org>,
 51606 <at> debbugs.gnu.org
Subject: Re: bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
Date: Mon, 29 Nov 2021 12:03:35 +0100
Daniel Martín <mardani29 <at> yahoo.es> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> I'd be surprised.
>>
>> Richard, do you remember why you removed text properties from the
>> blink-matching-open text it shows in the echo-area?
>
> BTW, the patch looks good to me.  But if keeping the text properties is
> not a problem, I'd do that unconditionally, without adding another
> customization option.  WDYT?

My vote is to drop my patch and keep the properties.  Emacs 29 dev cycle
is not old, we can apply my patch or revert the change if complaints
arrive.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51606; Package emacs. (Sat, 15 Jan 2022 13:17:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 51606 <at> debbugs.gnu.org,
 Richard Stallman <rms <at> gnu.org>,
 Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
Date: Sat, 15 Jan 2022 14:16:13 +0100
Arash Esbati <arash <at> gnu.org> writes:

> My vote is to drop my patch and keep the properties. 

OK; now done in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 51606 <at> debbugs.gnu.org and Arash Esbati <arash <at> gnu.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 15 Jan 2022 13:17:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 13 Feb 2022 12:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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