* bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
@ 2021-11-05 9:40 Arash Esbati
2021-11-05 12:02 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Arash Esbati @ 2021-11-05 9:40 UTC (permalink / raw)
To: 51606
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
2021-11-05 9:40 bug#51606: 29.0.50; [PATCH] Show offscreen context with properties Arash Esbati
@ 2021-11-05 12:02 ` Eli Zaretskii
2021-11-05 12:57 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-11-05 12:02 UTC (permalink / raw)
To: Arash Esbati, Daniel Martín; +Cc: 51606
> From: Arash Esbati <arash@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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
2021-11-05 12:02 ` Eli Zaretskii
@ 2021-11-05 12:57 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-05 14:01 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-05 12:57 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Arash Esbati, 51606
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Arash Esbati <arash@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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
2021-11-05 12:57 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-05 14:01 ` Eli Zaretskii
2021-11-26 19:01 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-11-05 14:01 UTC (permalink / raw)
To: Daniel Martín, Richard Stallman; +Cc: arash, 51606
> From: Daniel Martín <mardani29@yahoo.es>
> Cc: Arash Esbati <arash@gnu.org>, 51606@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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
2021-11-05 14:01 ` Eli Zaretskii
@ 2021-11-26 19:01 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-29 11:03 ` Arash Esbati
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-26 19:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: arash, Richard Stallman, 51606
Eli Zaretskii <eliz@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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
2021-11-26 19:01 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-29 11:03 ` Arash Esbati
2022-01-15 13:16 ` Lars Ingebrigtsen
0 siblings, 1 reply; 7+ messages in thread
From: Arash Esbati @ 2021-11-29 11:03 UTC (permalink / raw)
To: Daniel Martín; +Cc: Richard Stallman, 51606
Daniel Martín <mardani29@yahoo.es> writes:
> Eli Zaretskii <eliz@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
2021-11-29 11:03 ` Arash Esbati
@ 2022-01-15 13:16 ` Lars Ingebrigtsen
0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-15 13:16 UTC (permalink / raw)
To: Arash Esbati; +Cc: Daniel Martín, 51606, Richard Stallman
Arash Esbati <arash@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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-01-15 13:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-05 9:40 bug#51606: 29.0.50; [PATCH] Show offscreen context with properties Arash Esbati
2021-11-05 12:02 ` Eli Zaretskii
2021-11-05 12:57 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-05 14:01 ` Eli Zaretskii
2021-11-26 19:01 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-29 11:03 ` Arash Esbati
2022-01-15 13:16 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.