unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Arash Esbati <arash@gnu.org>
To: 51606@debbugs.gnu.org
Subject: bug#51606: 29.0.50; [PATCH] Show offscreen context with properties
Date: Fri, 05 Nov 2021 10:40:47 +0100	[thread overview]
Message-ID: <86y263hrds.fsf@gnu.org> (raw)

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





             reply	other threads:[~2021-11-05  9:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05  9:40 Arash Esbati [this message]
2021-11-05 12:02 ` bug#51606: 29.0.50; [PATCH] Show offscreen context with properties 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y263hrds.fsf@gnu.org \
    --to=arash@gnu.org \
    --cc=51606@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).