From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Thierry Volpiatto <thievol@posteo.net>
Newsgroups: gmane.emacs.bugs
Subject: bug#66394: 29.1; Make register-read-with-preview more useful
Date: Sat, 02 Dec 2023 05:51:45 +0000
Message-ID: <87cyvpf8y6.fsf@posteo.net>
References: <87il7ib6cu.fsf@posteo.net> <87y1fwtyrl.fsf@posteo.net>
 <87y1fut1wp.fsf@web.de> <87ttqgpjiz.fsf@posteo.net>
 <87wmvbibpr.fsf@web.de> <877cnb2n63.fsf@posteo.net>
 <8734xyc8z0.fsf@web.de> <87zg05rewi.fsf@posteo.net>
 <87ttqcg8gw.fsf@web.de> <87h6mcr8ol.fsf@posteo.net>
 <87r0l73029.fsf@web.de> <877cmdx8ud.fsf@posteo.net>
 <jwvjzqcxrnq.fsf-monnier+emacs@gnu.org> <87sf50s1gh.fsf@posteo.net>
 <83o7ficesp.fsf@gnu.org> <878r6leh9d.fsf@posteo.net>
 <83il5pbnmh.fsf@gnu.org> <87zfz1cz7s.fsf@posteo.net>
 <83bkbc7j1o.fsf@gnu.org> <8734wov2wv.fsf@posteo.net>
 <83v89j6arv.fsf@gnu.org>
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="8047"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: michael_heerdegen@web.de, 66394@debbugs.gnu.org, monnier@iro.umontreal.ca,
 stefankangas@gmail.com
To: Eli Zaretskii <eliz@gnu.org>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 02 06:53:07 2023
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1r9Iw7-0001uB-B9
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Dec 2023 06:53:07 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1r9Ivv-0002uP-Cg; Sat, 02 Dec 2023 00:52:55 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1r9Ivt-0002sz-OE
 for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 00:52:53 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1r9Ivt-0001sO-FM
 for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 00:52:53 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1r9Iw2-0004WI-Ia
 for bug-gnu-emacs@gnu.org; Sat, 02 Dec 2023 00:53:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Thierry Volpiatto <thievol@posteo.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sat, 02 Dec 2023 05:53:02 +0000
Resent-Message-ID: <handler.66394.B66394.170149633317313@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 66394
X-GNU-PR-Package: emacs
Original-Received: via spool by 66394-submit@debbugs.gnu.org id=B66394.170149633317313
 (code B ref 66394); Sat, 02 Dec 2023 05:53:02 +0000
Original-Received: (at 66394) by debbugs.gnu.org; 2 Dec 2023 05:52:13 +0000
Original-Received: from localhost ([127.0.0.1]:56517 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1r9IvE-0004VB-JM
 for submit@debbugs.gnu.org; Sat, 02 Dec 2023 00:52:13 -0500
Original-Received: from mout01.posteo.de ([185.67.36.65]:57273)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <thievol@posteo.net>) id 1r9Iv9-0004Ub-8b
 for 66394@debbugs.gnu.org; Sat, 02 Dec 2023 00:52:11 -0500
Original-Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 2CE3E240027
 for <66394@debbugs.gnu.org>; Sat,  2 Dec 2023 06:51:52 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1701496312; bh=Dgu3l8Oy4iQKqUIzwG7pUGwlmAoekqZog1e5BohZAm8=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Autocrypt:OpenPGP:
 From;
 b=csLF9uOt3FHlAPXIm4m6W77rFxUdbtjur1KocTNp2PsK+ikfZ695kfiYt4YatkCTz
 ue/ndukTMNafPBdZkT1BmxkCzcMUQTsknlw9RUmMYUAiNUEIBPnYbonPA+TwVptzER
 8TtzdUi6VaL7KQsJk+ytQnlIF5sg+8AyRNdRJ67DxKESnfPbgQDrtOuiDO6OV3rpdS
 CCIKDLQnHelCa58d193UsbsRqAcmR/Ubi/V1N6wlFkRoEzFui1M63Jd30zP90+cYAd
 Y0OECIpKPfBkJ7AmqVakNQjraSbEm22PA1HUtiPg1qvQNIPoZMcyKaGY6ziJf+7JcT
 3s5B55LchapyA==
Original-Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4ShzZr4BVMz6twf;
 Sat,  2 Dec 2023 06:51:48 +0100 (CET)
In-Reply-To: <83v89j6arv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Nov
 2023 08:00:20 +0200 (1 day, 23 hours, 41 minutes ago)")
Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual;
 keydata=xsDNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA
 edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p
 kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb
 tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ
 GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC
 WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha
 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA
 Ac0SdGhpZXZvbEBwb3N0ZW8ubmV0wsEOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA
 FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8h
 Bp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslx
 hU46VSz1Z83NwIG3mpdYNV5WUTUdgzxExHTNTFCd7NKv0nlHKQaA 
OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:275351
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/275351>

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@gnu.org> writes:

> Anyway, I trust you to do what is needed here, I just want the test
> suite to keep running successfully, and I don't have time to work on
> this myself.  TIA.

Here again the patchs (0002 with a little modification).
Let me know if I can commit them.

Thanks.

=2D-=20
Thierry

--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Make-register-preview-delay-obsolete.patch
Content-Transfer-Encoding: quoted-printable

From=203df81fb5dc5809cab7843e5358c17d0039b55eb1 Mon Sep 17 00:00:00 2001
From: Thierry Volpiatto <thievol@posteo.net>
Date: Thu, 30 Nov 2023 08:03:45 +0100
Subject: [PATCH 1/4] Make register-preview-delay obsolete

* etc/NEWS: Update.
* lisp/register.el (register-preview-delay): Make it obsolete.
=2D--
 etc/NEWS         | 5 +++++
 lisp/register.el | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 6661ac70e1b..bab3529339f 100644
=2D-- a/etc/NEWS
+++ b/etc/NEWS
@@ -1138,6 +1138,11 @@ showcases all their customization options.
 
 * Incompatible Lisp Changes in Emacs 30.1
=20
+---
+** 'register-preview-delay' is no longer used.
+Register preview is no more delayed.  If you want to disable it use
+'register-use-preview' instead with a boolean value.
+
 +++
 ** 'M-TAB' now invokes 'completion-at-point' also in Text mode.
 Text mode no longer binds 'M-TAB' to 'ispell-complete-word', and
diff --git a/lisp/register.el b/lisp/register.el
index 61bef503f91..88d0e8e1d10 100644
=2D-- a/lisp/register.el
+++ b/lisp/register.el
@@ -93,7 +93,6 @@ of the marked text."
   :type '(choice (const :tag "None" nil)
 		 (character :tag "Use register" :value ?+)))
=20
=2D;; FIXME: This is no more needed, remove it.
 (defcustom register-preview-delay 1
   "If non-nil, time to wait in seconds before popping up register preview =
window.
 If nil, do not show register previews, unless `help-char' (or a member of
@@ -101,6 +100,7 @@ If nil, do not show register previews, unless `help-cha=
r' (or a member of
   :version "24.4"
   :type '(choice number (const :tag "No preview unless requested" nil))
   :group 'register)
+(make-obsolete-variable 'register-preview-delay "No longer used." "30.1")
=20
 (defcustom register-preview-default-keys (mapcar #'string (number-sequence=
 ?a ?z))
   "Default keys for setting a new register."
=2D-=20
2.34.1


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0002-Fix-register-preview-default.patch
Content-Transfer-Encoding: quoted-printable

From=200fa70dad21d3475d3a5dae54a09d8a9e60b668ae Mon Sep 17 00:00:00 2001
From: Thierry Volpiatto <thievol@posteo.net>
Date: Thu, 30 Nov 2023 10:38:52 +0100
Subject: [PATCH 2/4] Fix register-preview-default

We need to print the string representation (one char) of an eventual
key description e.g. "^X" instead of "C-x".
However the key description is still displayed in a display property.

* lisp/register.el (register-preview-default): Use `string' to print regist=
er.
=2D--
 lisp/register.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/register.el b/lisp/register.el
index 88d0e8e1d10..46ec38821e5 100644
=2D-- a/lisp/register.el
+++ b/lisp/register.el
@@ -131,7 +131,8 @@ See the documentation of the variable `register-alist' =
for possible VALUEs."
 (defun register-preview-default (r)
   "Function that is the default value of the variable `register-preview-fu=
nction'."
   (format "%s: %s\n"
=2D	  (single-key-description (car r))
+	  (propertize (string (car r))
+                      'display (single-key-description (car r)))
 	  (register-describe-oneline (car r))))
=20
 (defvar register-preview-function #'register-preview-default
=2D-=20
2.34.1


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment; filename=0003-Update-register-manual.patch
Content-Transfer-Encoding: quoted-printable

From=20408126b6d56a0cc36f621348212e16d0715fd671 Mon Sep 17 00:00:00 2001
From: Thierry Volpiatto <thievol@posteo.net>
Date: Thu, 30 Nov 2023 10:53:46 +0100
Subject: [PATCH 3/4] Update register manual

doc/emacs/regs.texi: Do it.
=2D--
 doc/emacs/regs.texi | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi
index e52f68dd18e..5e5b7ae2b16 100644
=2D-- a/doc/emacs/regs.texi
+++ b/doc/emacs/regs.texi
@@ -16,9 +16,8 @@ jump back to that position once or many times.
 we will denote by @var{r}; @var{r} can be a letter (such as @samp{a})
 or a number (such as @samp{1}); case matters, so register @samp{a} is
 not the same as register @samp{A}.  You can also set a register in
=2Dnon-alphanumeric characters, for instance @samp{*} or @samp{C-d}.
=2DNote, it's not possible to set a register in @samp{C-g} or @samp{ESC},
=2Dbecause these keys are reserved for quitting (@pxref{Quitting}).
+non-alphanumeric characters, for instance @samp{C-d} by using for
+example @key{C-q} @samp{C-d}.
=20
 @findex view-register
   A register can store a position, a piece of text, a rectangle, a
=2D-=20
2.34.1


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0004-Delete-register-tests.el-now-no-more-needed.patch
Content-Transfer-Encoding: quoted-printable

From=20cd6e66f955d20d31686a617ed8a5cd043585c71f Mon Sep 17 00:00:00 2001
From: Thierry Volpiatto <thievol@posteo.net>
Date: Thu, 30 Nov 2023 11:04:47 +0100
Subject: [PATCH 4/4] Delete register-tests.el now no more needed

* register-tests.el: Deleted file.
=2D--
 test/lisp/register-tests.el | 43 -------------------------------------
 1 file changed, 43 deletions(-)
 delete mode 100644 test/lisp/register-tests.el

diff --git a/test/lisp/register-tests.el b/test/lisp/register-tests.el
deleted file mode 100644
index 6283d1c31e0..00000000000
=2D-- a/test/lisp/register-tests.el
+++ /dev/null
@@ -1,43 +0,0 @@
=2D;;; register-tests.el --- tests for register.el  -*- lexical-binding: t-=
*-
=2D
=2D;; Copyright (C) 2017-2023 Free Software Foundation, Inc.
=2D
=2D;; Author: Tino Calancha <tino.calancha@gmail.com>
=2D;; Keywords:
=2D
=2D;; This file is part of GNU Emacs.
=2D
=2D;; GNU Emacs is free software: you can redistribute it and/or modify
=2D;; it under the terms of the GNU General Public License as published by
=2D;; the Free Software Foundation, either version 3 of the License, or
=2D;; (at your option) any later version.
=2D
=2D;; GNU Emacs is distributed in the hope that it will be useful,
=2D;; but WITHOUT ANY WARRANTY; without even the implied warranty of
=2D;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
=2D;; GNU General Public License for more details.
=2D
=2D;; You should have received a copy of the GNU General Public License
=2D;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
=2D
=2D;;; Commentary:
=2D
=2D
=2D;;; Code:
=2D(require 'ert)
=2D(require 'cl-lib)
=2D
=2D(ert-deftest register-test-bug27634 ()
=2D  "Test for https://debbugs.gnu.org/27634 ."
=2D  (dolist (event (list ?\C-g 'escape ?\C-\[))
=2D    (cl-letf (((symbol-function 'read-key) #'ignore)
=2D              (last-input-event event)
=2D              (register-alist nil))
=2D      (should (equal 'quit
=2D                     (condition-case err
=2D                         (call-interactively 'point-to-register)
=2D                       (quit (car err)))))
=2D      (should-not register-alist))))
=2D
=2D(provide 'register-tests)
=2D;;; register-tests.el ends here
=2D-=20
2.34.1


--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmVqxfETHHRoaWV2b2xA
cG9zdGVvLm5ldAAKCRAOxW0UHRbvk86tC/sEH+j9/019WSX601UxQ4z8RCtSiWyn
WCqTqvfTEzv/VesjkOAeR/9SwSy9Has3FrSHlhtaHa3QcqMqhX7o4zFpap1VHU3x
5jyXLT57ZbPLTmqpp3VuzXT2j8X6m7XsMIVJGE2+23b1RZ6m9J1EQcUQrfvgh2Kw
jqkJ2J65S5dbZ3aEYdi/lVXEyiuLvGMhFXVJkf8+X4uDqdQsU34mITeXsGZ+Xj8L
/eBiTFl8xNafxdfIt8ax8dwHLzFiu6C7LYCTN4fhxW3mU6G9rkurMDHRBvvlH9Ya
4hWy83EwEkTBL4VynZDXXPNRu8+tAV0UZfwsgd0hdS7DIzkUFEKK2UAAHli6niTy
Gwpiv66ZxaJ71IZuQ8O6KKhjQYSxcMdlU9OGfKInkXmD3DzuJ+v0i0rHO+Y8ltyb
dtcPjAxGEEbplvzOJSTRjzA8LsXPZH6p3pAuKNVO8jvBLx+uNXPedgPE4mGrHeod
nhCvfvfHm9bpoy5VpQ3LX788Uv0WGAp8BYQ=
=p4JO
-----END PGP SIGNATURE-----
--==-=-=--