From unknown Sun Jun 22 11:43:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51242: [PATCH] New option show-paren-context-when-offscreen Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Oct 2021 18:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 51242@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163441036019812 (code B ref -1); Sat, 16 Oct 2021 18:53:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Oct 2021 18:52:40 +0000 Received: from localhost ([127.0.0.1]:43058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbonP-00059U-AE for submit@debbugs.gnu.org; Sat, 16 Oct 2021 14:52:39 -0400 Received: from lists.gnu.org ([209.51.188.17]:35134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbonN-00059N-Us for submit@debbugs.gnu.org; Sat, 16 Oct 2021 14:52:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbonK-0002wE-Ar for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2021 14:52:37 -0400 Received: from sonic303-21.consmr.mail.ir2.yahoo.com ([77.238.178.202]:37566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbonH-00053s-7R for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2021 14:52:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1634410347; bh=98QtKgyfs5rv9Nbbi/l7lI1nw5SHK/SvyEkpdUBHozo=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=A/hG+sIg+6O4C7hw5mgRLpGk3VQoop7m8zrRdnVHjX2xkTOVEVLsc1TY1sn+HwMbmgcM2ATz+Nd+HbXNc1lOFfbvvyIyQQFOVHyakfOKCwrbkVBVi5F2Q8SrJCOMm8FJKUVliKCkd9cZ/p4l5eiJFWIgeRlWcNyR08TA4BZa/sYGZhtwZCUAEtaPK72cRp4YGyaSnqJw0xh3N9rslsJ06y3WPaikQIbvv99nLHLVtOZmTOjJj105k+oCQtxb0xP8zURPKjFt5CVbQ38qcVqfzIbZEhhLHcI6ujDNj4P2gxZfFf5c2oVt3QltBfM2/45iKXnPJuIvAwG6SLmNu/VPUA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634410347; bh=y16qjEYBWnbg2CDzeOiz0XfwrDURAA/h1oETOwxC5FZ=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=FxEtefsYNcFLrOuv06x6WAx8lMF3rAhib/2grWI+q2CkRj0avWNs5j2fwqloTTiBkJChX1VOxvf902B/885zD7nUF7aOWQHnuZ8QSoAc7QqIs0AGe58XKYSuM8nbh+I96yIZA5kiD5IACDA8i+7D5SvUPvcgRmNK1VAdmlqwILog7zXavEDHgd7lS3XRzP0uVLfocj3YFg6AVt+8jSmrdZtfPRWrnZr2z5MW3MlKvSpyflZca4BKq/U6pebz2BtTDmfrYsDnwgERroCObojWGXH1B0jOOTY3rMtNl6jj1cW5uQQ7jsjxxY8R7GQFX5OKaC0ci1JhqW70I/QTMa6czQ== X-YMail-OSG: 1jotRiUVM1ktdmEk6qzaBpXWrgMOyiofJbnOAdYWJ3KhB69HSYhXmmoJqFoWAI. ZrEhVkwgt.qe4ViRBjE0wRu2axhM4Jlqhi77qmrIWLAVBfstzeo5t4k17p5wIajDCDNTGdZk5jEW rMxtJBchgaC2BHFYN74_609VxDar_t.yNezdFU2ycJz3KBORsvzvO_4CslFBZ18gqcXgj.gJnLwQ FBW8Yjb24J9pSxTsYlHSpdXsim5zRf8syJMgPBziLWCaQDl2mGqVc_cFsw4qk3dLR9.oGy7z4E5D QeE3KWJ_7U_33lU.KnOzWVunhV4Z2sGOLXJRLRfZha3P3KwyWrQ9iH4PZ7wg2E8mVJpeo9LwqTr3 RqxLyZaPjEdw3WOHCB36x2Z2lL2C.aymL8GFu634kOMqkAzgAultYF2Ci8Dd6KuGRuk4xAnLj0vH SdD39iqTbQmaM1weQ2WxhCtYkI9Z4r7mUOH.fhfezYTqpxiBHBtCYw04gELXaHPMjqSEKumwdwoT UpPwLyKIwJlCyIAIymJyurtAiLtFTeD5UpZc7ZqxWlmWD.Jpmx6iHbUR8kdJ4jpnfkbPD54lRHql JGHo1vLpZoIte2cleeUsT754vNmTPYA0ll0xScXsCfjdiJBq6RkAvX.kT_iDCzNNb8r3hcsozyGV bUSk7cGoJy_fniIRsd4rv3Qshr43WDgiXmqh0.tAEq37DyuMSBs_e.Xr_0hEAnM6e23TKBBjqi2d V5E6H64UPPRVzEoH2mfbsm6R1vcSWvlIINZ93iv8jUV7A8FIkHWhzBdim.t_cGs12PCVfkG4OIjJ KDoRwCg2A8K1blnwjVxVrlp.tvm803Bcz7EuZT6PGtdt6ffrvYumCH1qQmhRe64mo_AiNdjfSXNZ Es7WUnfIP2CfWj5eN_00jHoI8XZZE5Te4gsezSSSvIaPNsRnJLHqnkT0fCbns5ay0LUHbWMlaapJ aau508aLRK6LtGdSwppS1Ya0FzY.CoTIlSlxzpQXQUGoDj5b0oHjQ_tK5qj6LEI6f8BDLe2PoD2_ I4szj2XU8iQLr7pnl7lt0Ax6Ns4WLyelwuuiuvydzThNCylVz9UYi5hNQ.N318x1rc1A7dMH8Dmb Ec3Ugo4W3KH5I1I2H18PbSuxqyPiWQbLFT7h6vJ8NfZQT_BVhedfj264jLz2h2Hq2IjUfNaY4WGH groag4pQLN2FzmW6n3cR38b1oBjz88AffdHyMAEnGlJaB5HbT1BjxVzLEQdaf_BRC19JObgRwP0Z 4BkYz5C6CZqcWKGUIZT_9hJlTya96BFayyK3D6TdKhjV2hV2c82FhAc.5UpUZwi3ijaGBJTBEcOZ aWx558hryAv2s3Swokpj6f3cTR3F3LvMXcJuCfsmnmwKUXFZusYYhimw28kYBHDwmNR1bK2fWQYr kGHo04V23ZWkpXfJNU02IXKIqLXHTrgUAfehSfNbG1FGga5F8bJmNljY2I8yXnCACMhYdYIaEUcV Lkmmk6tm8LMZ6G0EK3USwC_4gDtwCqp0yjBI3yaj2UYZpH9eHxGw4QbkJ4aqzGyn.4lzde6Cd_FK XJ3szdi61WxJGByG0t_wVN70vipKrt1NWn7.JWtpEvULV5hNKcON4EaZQtw5MosVe5mMsheeRGsZ bISsjChqX6qKT3hTYsIBEleHDcMUg778R6e570uI4BBAQla_STFXmeJJcIT8yaYEA9i7petal.Ch peKAxheb6C9FWciKNpkSwSChmdv5JcdBAlVitqfH1ECZzCsu7tjhI5YQoKTLoXWaV8g7c4SvwC3n M_IUUGwpwGPv30aHeqGWiZo2fwsO9xvrT3ljRaWU7ZYLanrqMuwZFO_2.oaxQmnwH4eclkEFdVmp DkxjrGqJSOpgu2arBOrY5ReplUYd8FYinPQDw6ZX39EvU6bCYMP2Sb7lsPOFFZPY_2qrDqd4YMkP DYZ1gfyXYYWao.0O7ocq3uJsMyImb3jHAcU9TY0zr726iLoUv2DuizUqxB_E96UJENqQLFH.8HJC CEKvremuZNb_wFtB0cfpGARD5fQwkXK4cqG844Eh15cwaIFAUk.sUnJgjNchG2oMiFJrMa17vp1j bEGt_EVJpzK2oBwvK26xeTquAboq9PW4Iz3zOLIQP3JkHYNF0_4RYnjTITw81lc50m.Hyjjd.tvo tKxRwgD8FMMGhQRobt3n21wXS.3cC8gQQVPSTd_oB2M1.f_5ecyy2efMMAz0x X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Sat, 16 Oct 2021 18:52:27 +0000 Received: by kubenode532.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID e9f2b79dddcc33b93f70d67a6609efc4; Sat, 16 Oct 2021 18:52:24 +0000 (UTC) From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Date: Sat, 16 Oct 2021 20:52:23 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" References: X-Mailer: WebService/1.1.19116 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 11561 Received-SPF: pass client-ip=77.238.178.202; envelope-from=mardani29@yahoo.es; helo=sonic303-21.consmr.mail.ir2.yahoo.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Now that show-paren-mode is enabled by default, I've implemented a new customization option for Emacs 29. When the attached patch is installed, if show-paren-context-when-offscreen is t, when you move the point to a closing delimiter, if the opening delimiter is offscreen, the line where the opening line is will appear in the echo area. This gives you context about what a delimiter is closing without having to move the point or reinsert it. There is similar functionality in popular IDEs. The feature is implemented by first extracting some code from simple.el to reuse it from simple.el and paren.el. The rest of the implementation is simple. I think it plays well with eldoc, blink-matching-paren, and the rest of the show-paren-mode options. I hope you find this feature useful. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-option-show-paren-context-when-offscreen.patch >From 6a3cf53c6afeed80a450faba0f66ff5f968142d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 16 Oct 2021 20:24:19 +0200 Subject: [PATCH] New option show-paren-context-when-offscreen * lisp/simple.el (blink-paren-open-paren-line-string): Extract functionality that shows the open paren line in the echo area into its own function, to reuse it from paren.el. (blink-matching-open): Use blink-paren-open-paren-line-string. * lisp/paren.el (show-paren-context-when-offscreen): New option show-paren-context-when-offscreen. (show-paren-function): Implement it using blink-paren-open-paren-line-string. * lisp/emacs-lisp/eldoc.el (eldoc-display-message-no-interference-p): Make sure the feature works well with eldoc. * test/lisp/paren-tests.el (paren-tests-open-paren-line): Test blink-paren-open-paren-line-string. * doc/emacs/programs.texi (Matching): Update the documentation. * etc/NEWS: And announce the new feature. --- doc/emacs/programs.texi | 9 +++++ etc/NEWS | 8 +++++ lisp/emacs-lisp/eldoc.el | 9 ++++- lisp/paren.el | 21 ++++++++++++ lisp/simple.el | 71 +++++++++++++++++++++------------------- test/lisp/paren-tests.el | 31 ++++++++++++++++++ 6 files changed, 114 insertions(+), 35 deletions(-) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 51a48df2e2..0056906e1f 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -868,6 +868,15 @@ Matching line and there is a paren at the first or last non-whitespace position on the line, or when point is at the end of a line and there is a paren at the last non-whitespace position on the line. + +@item +@vindex show-paren-context-when-offscreen +@code{show-paren-context-when-offscreen}, when non-@code{nil}, shows +some context in the echo area when point is in a closing delimiter and +the opening delimiter is offscreen. The context is usually the line +that contains the opening delimiter, except if the opening delimiter +is on its own line, in which case the context includes the previous +nonblank line. @end itemize @cindex Electric Pair mode diff --git a/etc/NEWS b/etc/NEWS index 2c09d24dde..5313e8e7ca 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -86,6 +86,14 @@ effectively dragged. Customize this option to limit the amount of entries in the menu "Edit->Paste from Kill Menu". The default is 60. +** show-paren-mode + ++++ +*** New user option 'show-paren-context-when-offscreen'. +When non-nil, if the point is in a closing delimiter and the opening +delimiter is offscreen, shows some context around the opening +delimiter in the echo area. + * Changes in Specialized Modes and Packages in Emacs 29.1 diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index a1c3c3268f..b30d3fc30f 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -380,7 +380,14 @@ eldoc-display-message-p ;; it undesirable to print eldoc messages right this instant. (defun eldoc-display-message-no-interference-p () "Return nil if displaying a message would cause interference." - (not (or executing-kbd-macro (bound-and-true-p edebug-active)))) + (not (or executing-kbd-macro + (bound-and-true-p edebug-active) + ;; The following configuration shows "Matches..." in the + ;; echo area when point is after a closing bracket, which + ;; conflicts with eldoc. + (and show-paren-context-when-offscreen + (not (pos-visible-in-window-p + (overlay-end show-paren--overlay))))))) (defvar eldoc-documentation-functions nil diff --git a/lisp/paren.el b/lisp/paren.el index ce6aa9ae13..7e7cf6c262 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -88,6 +88,14 @@ show-paren-highlight-openparen its position." :type 'boolean) +(defcustom show-paren-context-when-offscreen nil + "If non-nil, show context in the echo area when the openparen is offscreen. +The context is usually the line that contains the openparen, +except if the openparen is on its own line, in which case the +context includes the previous nonblank line." + :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) @@ -312,6 +320,19 @@ show-paren-function (current-buffer)) (move-overlay show-paren--overlay there-beg there-end (current-buffer))) + ;; If `show-paren-open-line-when-offscreen' is t and point + ;; is at a close paren, show the line that contains the + ;; openparen in the echo area. + (let ((openparen (min here-beg there-beg))) + (if (and show-paren-context-when-offscreen + (< there-beg here-beg) + (not (pos-visible-in-window-p openparen))) + (let ((open-paren-line-string + (blink-paren-open-paren-line-string openparen)) + (message-log-max nil)) + (minibuffer-message + "Matches %s" + (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)))))) diff --git a/lisp/simple.el b/lisp/simple.el index c7bb928cd7..4f711d60ea 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8577,40 +8577,43 @@ blink-matching-open (current-buffer)) (sit-for blink-matching-delay)) (delete-overlay blink-matching--overlay))))) - (t - (let ((open-paren-line-string - (save-excursion - (goto-char blinkpos) - ;; Show what precedes the open in its line, if anything. - (cond - ((save-excursion (skip-chars-backward " \t") (not (bolp))) - (buffer-substring (line-beginning-position) - (1+ blinkpos))) - ;; Show what follows the open in its line, if anything. - ((save-excursion - (forward-char 1) - (skip-chars-forward " \t") - (not (eolp))) - (buffer-substring blinkpos - (line-end-position))) - ;; Otherwise show the previous nonblank line, - ;; if there is one. - ((save-excursion (skip-chars-backward "\n \t") (not (bobp))) - (concat - (buffer-substring (progn - (skip-chars-backward "\n \t") - (line-beginning-position)) - (progn (end-of-line) - (skip-chars-backward " \t") - (point))) - ;; Replace the newline and other whitespace with `...'. - "..." - (buffer-substring blinkpos (1+ blinkpos)))) - ;; There is nothing to show except the char itself. - (t (buffer-substring blinkpos (1+ blinkpos))))))) - (minibuffer-message - "Matches %s" - (substring-no-properties open-paren-line-string)))))))) + ((not show-paren-context-when-offscreen) + (minibuffer-message + "Matches %s" + (substring-no-properties + (blink-paren-open-paren-line-string blinkpos)))))))) + +(defun blink-paren-open-paren-line-string (pos) + "Return the line string that contains the openparen at POS." + (save-excursion + (goto-char pos) + ;; Show what precedes the open in its line, if anything. + (cond + ((save-excursion (skip-chars-backward " \t") (not (bolp))) + (buffer-substring (line-beginning-position) + (1+ pos))) + ;; Show what follows the open in its line, if anything. + ((save-excursion + (forward-char 1) + (skip-chars-forward " \t") + (not (eolp))) + (buffer-substring pos + (line-end-position))) + ;; Otherwise show the previous nonblank line, + ;; if there is one. + ((save-excursion (skip-chars-backward "\n \t") (not (bobp))) + (concat + (buffer-substring (progn + (skip-chars-backward "\n \t") + (line-beginning-position)) + (progn (end-of-line) + (skip-chars-backward " \t") + (point))) + ;; Replace the newline and other whitespace with `...'. + "..." + (buffer-substring pos (1+ pos)))) + ;; There is nothing to show except the char itself. + (t (buffer-substring pos (1+ pos)))))) (defvar blink-paren-function 'blink-matching-open "Function called, if non-nil, whenever a close parenthesis is inserted. diff --git a/test/lisp/paren-tests.el b/test/lisp/paren-tests.el index c4bec5d86d..11249ee9bc 100644 --- a/test/lisp/paren-tests.el +++ b/test/lisp/paren-tests.el @@ -117,5 +117,36 @@ paren-tests-default (- (point-max) 1) (point-max) nil))))) +(ert-deftest paren-tests-open-paren-line () + (cl-flet ((open-paren-line () + (let* ((data (show-paren--default)) + (here-beg (nth 0 data)) + (there-beg (nth 2 data))) + (blink-paren-open-paren-line-string + (min here-beg there-beg))))) + ;; Lisp-like + (with-temp-buffer + (insert "(defun foo () + (dummy))") + (goto-char (point-max)) + (should (string= "(defun foo ()" (open-paren-line)))) + + ;; C-like + (with-temp-buffer + (insert "int foo() { + int blah; + }") + (goto-char (point-max)) + (should (string= "int foo() {" (open-paren-line)))) + + ;; C-like with hanging { + (with-temp-buffer + (insert "int foo() + { + int blah; + }") + (goto-char (point-max)) + (should (string= "int foo()...{" (open-paren-line)))))) + (provide 'paren-tests) ;;; paren-tests.el ends here -- 2.31.0 --=-=-=-- From unknown Sun Jun 22 11:43:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51242: [PATCH] New option show-paren-context-when-offscreen Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Oct 2021 07:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Cc: 51242@debbugs.gnu.org Received: via spool by 51242-submit@debbugs.gnu.org id=B51242.163454209920820 (code B ref 51242); Mon, 18 Oct 2021 07:29:02 +0000 Received: (at 51242) by debbugs.gnu.org; 18 Oct 2021 07:28:19 +0000 Received: from localhost ([127.0.0.1]:45776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcN4F-0005Pj-Cu for submit@debbugs.gnu.org; Mon, 18 Oct 2021 03:28:19 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcN4E-0005PV-3J for 51242@debbugs.gnu.org; Mon, 18 Oct 2021 03:28:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VCfEXUawVCWWv6cJ1cuIXLh7dwTk8n7ZsZg6cNn2r7w=; b=HsFMvUtykgMALzOWuaMhLWDKgp YbKZ/0SddOnk+SMqTfz2GgO4oI2EPR4oDIzVL4/B/GQQBswfwlgty0cWjaLATX/O2i1/5n+tp/xXM pLg9SI+h0kHFSR2TFiUcxpGNaG4QIKSQEDFdwIl2hhBhUlN8M8uijGLI87G0ZhVWWnHU=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcN45-0000Tt-SB; Mon, 18 Oct 2021 09:28:12 +0200 From: Lars Ingebrigtsen References: X-Now-Playing: Brokeback's _Looks At The Bird_: "=?UTF-8?Q?Lup=C3=A9?=" Date: Mon, 18 Oct 2021 09:28:09 +0200 In-Reply-To: ("Daniel =?UTF-8?Q?Mart=C3=ADn?="'s message of "Sat, 16 Oct 2021 20:52:23 +0200") Message-ID: <87fssyn65y.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Daniel =?UTF-8?Q?Mart=C3=ADn?= writes: > When the attached patch is installed, if > show-paren-context-when-offscreen is t, when you move the point to a > closing delimiter, if the opening delimiter is offscreen, the line where > the openi [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Daniel Mart=C3=ADn writes: > When the attached patch is installed, if > show-paren-context-when-offscreen is t, when you move the point to a > closing delimiter, if the opening delimiter is offscreen, the line where > the opening line is will appear in the echo area. This gives you > context about what a delimiter is closing without having to move the > point or reinsert it. There is similar functionality in popular IDEs. I think that's really cool, so I've pushed this to Emacs 29. One possible tweak: > + (minibuffer-message > + "Matches %s" > + (substring-no-properties open-paren-line-string))))) Would it make sense to retain the text properties, so that you get the fontification in the echo area, too? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 18 03:28:25 2021 Received: (at control) by debbugs.gnu.org; 18 Oct 2021 07:28:25 +0000 Received: from localhost ([127.0.0.1]:45779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcN4K-0005Q1-KT for submit@debbugs.gnu.org; Mon, 18 Oct 2021 03:28:25 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcN4J-0005Pc-Bc for control@debbugs.gnu.org; Mon, 18 Oct 2021 03:28:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qms7rWq+mgiqOBj0KguuasP3WupNSPxcEV/xdj769ZQ=; b=suILoxnAPuNAc0CrMfC5hVYfBO Ga2gykHKObJhKmnGpS1uw282st0bg5kaLqJOy5RivxmfXY7fpGMDy8ceL6uQ2WYd0NTnRHaXKXmhl QKJNXqYWUJz7EGZzuus7aVl8nBs5wQ11oEHUnjcgibfVzWzUZwc8k05Zxsku6qMQgwCc=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcN4B-0000U1-T9 for control@debbugs.gnu.org; Mon, 18 Oct 2021 09:28:17 +0200 Date: Mon, 18 Oct 2021 09:28:15 +0200 Message-Id: <87ee8in65s.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #51242 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 51242 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 51242 29.1 quit