all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thievol@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael_heerdegen@web.de, 66394@debbugs.gnu.org,
	monnier@iro.umontreal.ca, stefankangas@gmail.com
Subject: bug#66394: 29.1; Make register-read-with-preview more useful
Date: Thu, 30 Nov 2023 10:21:39 +0000	[thread overview]
Message-ID: <87sf4nv8wc.fsf@posteo.net> (raw)
In-Reply-To: <83v89j6arv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Nov 2023 08:00:20 +0200 (3 hours, 56 minutes, 56 seconds ago)")


[-- Attachment #1.1: Type: text/plain, Size: 2322 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Thierry Volpiatto <thievol@posteo.net>
>> Cc: monnier@iro.umontreal.ca,  michael_heerdegen@web.de,
>>   stefankangas@gmail.com,  66394@debbugs.gnu.org
>> Date: Wed, 29 Nov 2023 18:18:40 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > The response "a" to the "Point to register:" question is something I
>> > needed to type;
>> 
>> Of course we are using now read-from-minibuffer and the test is related
>> to read-key not quitting with C-g
>> 
>> > previously the test never asked any questions (and it shouldn't,
>> > AFAIU).
>> 
>> Yes, it shouldn't, but now we are using a real minibuffer, is this test
>> really needed?
>> It is like if you had to make tests in all functions using
>> read-from-minibuffer to check if it quit properly with C-g (it does of course).
>
> Can we have a similar issue with read-from-minibuffer?  Not with C-g,
> but with some other invalid input, like some function key or non-ASCII
> character or invalid character codepoint?

No, because unlike read-key, read-from-minibuffer doesn't read these
keys and exit immediately.  For example we can now set a register to C-g
by using "C-q C-g" but hitting directly C-g will quit minibuffer (as
expected), BTW I have updated the manual, see the attached patchs.  I
have also fixed register-preview-default accordingly so that it print
the register as a string but not a key representation e.g. "^X" instead
of "C-x" (if one find this ugly we could use "C-x" as a display property
of "^X").

> If this cannot happen, then perhaps the whole test file should be
> removed?

I think it can be removed, yes (done in patch below).

> 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.

Ok, can you review (and merge if ok) following patchs.

>> ALSO: I intentionally leave register-preview-delay defcustom with a FIXME
>> comment, do you want to remove it? It is not used anymore now AFAIK.
>
> This should be declared obsolete, with an explanation that it is no
> longer used, and a note about that should be added to NEWS, in the
> incompatible changes section.  Then we can remove the FIXME.

done.

Thanks.

-- 
Thierry

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Make-register-preview-delay-obsolete.patch --]
[-- Type: text/x-diff, Size: 1914 bytes --]

From 3df81fb5dc5809cab7843e5358c17d0039b55eb1 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.
---
 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
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1138,6 +1138,11 @@ showcases all their customization options.
 \f
 * Incompatible Lisp Changes in Emacs 30.1
 
+---
+** '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
--- 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 ?+)))
 
-;; 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-char' (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")
 
 (defcustom register-preview-default-keys (mapcar #'string (number-sequence ?a ?z))
   "Default keys for setting a new register."
-- 
2.34.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-Fix-register-preview-default.patch --]
[-- Type: text/x-diff, Size: 1054 bytes --]

From bcf7bd8feb05914e6000b572c3e75664a9090c1a 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".

* lisp/register.el (register-preview-default): Use `string' to print register.
---
 lisp/register.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/register.el b/lisp/register.el
index 88d0e8e1d10..9b457e716f2 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -131,7 +131,7 @@ 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-function'."
   (format "%s: %s\n"
-	  (single-key-description (car r))
+	  (string (car r))
 	  (register-describe-oneline (car r))))
 
 (defvar register-preview-function #'register-preview-default
-- 
2.34.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.4: 0003-Update-register-manual.patch --]
[-- Type: text/x-diff, Size: 1169 bytes --]

From 93c07593bac8d7f0428a92502ee5de8def128c5c 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.
---
 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
--- 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
-non-alphanumeric characters, for instance @samp{*} or @samp{C-d}.
-Note, it's not possible to set a register in @samp{C-g} or @samp{ESC},
-because 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}.
 
 @findex view-register
   A register can store a position, a piece of text, a rectangle, a
-- 
2.34.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.5: 0004-Delete-register-tests.el-now-no-more-needed.patch --]
[-- Type: text/x-diff, Size: 2187 bytes --]

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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

  reply	other threads:[~2023-11-30 10:21 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-07 19:03 bug#66394: 29.1; Make register-read-with-preview more useful Thierry Volpiatto
2023-10-08  6:45 ` bug#66394: [RE] " Thierry Volpiatto
2023-10-12  6:43 ` Thierry Volpiatto
2023-10-14  2:04   ` Richard Stallman
2023-10-14  5:59     ` Thierry Volpiatto
2023-10-16  2:04       ` Richard Stallman
2023-10-15  7:56     ` Thierry Volpiatto
2023-10-15  8:18       ` Stefan Kangas
2023-10-15 10:05         ` Thierry Volpiatto
2023-10-15 12:55           ` Stefan Kangas
2023-11-18 18:39             ` Thierry Volpiatto
2023-10-19  2:42 ` bug#66394: 29.1; " Michael Heerdegen
2023-10-19  6:16   ` Thierry Volpiatto
2023-10-20  5:00     ` Michael Heerdegen
2023-10-20  5:49       ` Thierry Volpiatto
2023-10-21  1:09         ` Michael Heerdegen
2023-10-21  3:34           ` Thierry Volpiatto
2023-10-23  4:09             ` Michael Heerdegen
2023-10-23  5:14               ` Thierry Volpiatto
2023-10-24  3:42                 ` Michael Heerdegen
2023-10-24  3:54                   ` Michael Heerdegen
2023-10-24  5:30                   ` Thierry Volpiatto
2023-10-25  3:54                     ` Michael Heerdegen
2023-10-24  7:19               ` Thierry Volpiatto
2023-10-25  4:10                 ` Michael Heerdegen
2023-10-25  6:38                   ` Thierry Volpiatto
2023-10-26  4:18                     ` Michael Heerdegen
2023-10-26  6:17                       ` Thierry Volpiatto
2023-10-27  1:27                         ` Michael Heerdegen
2023-10-27  4:24                           ` Thierry Volpiatto
2023-11-03  4:58                             ` Michael Heerdegen
2023-11-19 19:37                               ` Thierry Volpiatto
2023-11-20  6:00                               ` Thierry Volpiatto
2023-11-20 17:33                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-20 18:51                                   ` Thierry Volpiatto
2023-11-25 10:23                                     ` Eli Zaretskii
2023-11-25 19:59                                       ` Thierry Volpiatto
2023-11-25 20:10                                         ` Eli Zaretskii
2023-11-25 21:14                                           ` Thierry Volpiatto
2023-11-26 10:38                                             ` Eli Zaretskii
2023-11-26 16:46                                               ` Thierry Volpiatto
2023-11-29 14:04                                             ` Eli Zaretskii
2023-11-29 18:18                                               ` Thierry Volpiatto
2023-11-30  6:00                                                 ` Eli Zaretskii
2023-11-30 10:21                                                   ` Thierry Volpiatto [this message]
2023-12-02  5:51                                                   ` Thierry Volpiatto
2023-12-02  7:50                                                     ` Eli Zaretskii
2023-12-02  8:08                                                       ` Thierry Volpiatto
2023-12-03 14:35                                                       ` Thierry Volpiatto
2023-12-03 15:05                                                         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-03 16:48                                                           ` Thierry Volpiatto
2023-12-03 18:29                                                             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-03 18:39                                                               ` Eli Zaretskii
2023-12-03 21:23                                                                 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-04  7:30                                                                   ` Thierry Volpiatto
2023-12-04  7:57                                                                     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-11  6:55                                                                 ` Thierry Volpiatto
2023-12-11  9:30                                                       ` Thierry Volpiatto
2023-12-11  9:58                                                         ` Thierry Volpiatto
2023-12-11 12:30                                                         ` Eli Zaretskii
2023-12-11 13:10                                                           ` Thierry Volpiatto
2023-12-11 17:32                                                             ` Thierry Volpiatto
2023-12-11 23:36                                                               ` Dmitry Gutov
2023-12-12  6:29                                                                 ` Thierry Volpiatto
2023-12-12  9:31                                                                   ` Thierry Volpiatto
2023-12-12 10:16                                                                     ` Thierry Volpiatto
2023-12-12 16:44                                                                       ` Thierry Volpiatto
2023-12-14  1:46                                                                       ` Dmitry Gutov
2023-12-14  5:34                                                                         ` Thierry Volpiatto
2023-12-14  7:38                                                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-14  8:24                                                                             ` Eli Zaretskii
2023-12-14  7:44                                                                           ` Eli Zaretskii
2023-12-14 15:50                                                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-14 17:58                                                                               ` Thierry Volpiatto
2023-12-14 19:19                                                                                 ` Andreas Schwab
2023-12-14 20:29                                                                               ` Stefan Kangas
2023-12-15 14:45                                                                                 ` Thierry Volpiatto
2023-12-15 15:18                                                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-15 18:36                                                                                     ` Thierry Volpiatto
2023-12-15 23:30                                                                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-16 13:18                                                                                         ` Thierry Volpiatto
2023-12-16 15:31                                                                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-16 20:39                                                                                             ` Thierry Volpiatto
2023-12-17 23:20                                                                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-18  5:15                                                                                                 ` Thierry Volpiatto
2023-12-18 13:20                                                                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-18 18:11                                                                                                     ` Thierry Volpiatto
2023-12-18 18:22                                                                                                     ` Dmitry Gutov
2023-12-18  6:18                                                                                                 ` Thierry Volpiatto
2023-12-19 17:40                                                                                             ` Thierry Volpiatto
2023-12-19 17:47                                                                                               ` Thierry Volpiatto
2023-12-20 12:05                                                                                               ` Eli Zaretskii
2023-12-20 17:23                                                                                                 ` Thierry Volpiatto
2023-12-21 11:47                                                                                                   ` Eli Zaretskii
2023-12-21 18:04                                                                                                     ` Thierry Volpiatto
2023-12-23 10:49                                                                                                       ` Eli Zaretskii
2023-12-16 15:07                                                                                   ` Dmitry Gutov
2023-12-16 20:20                                                                                     ` Thierry Volpiatto
2023-12-16 23:28                                                                                       ` Dmitry Gutov
2023-12-14  2:10                                                                     ` Dmitry Gutov
2023-12-14  5:30                                                                       ` Thierry Volpiatto
2023-12-14 19:39                                                                   ` Stefan Kangas
2023-12-12  6:06                                                         ` Alfred M. Szmidt
2023-12-12  9:37                                                         ` Steve Perry via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-12 12:15                                                           ` Eli Zaretskii
2023-12-12 17:58                                                             ` Steve Perry via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-25 21:38                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-02  9:24                                 ` Bastien
2023-12-02  9:52                                   ` Thierry Volpiatto
2023-12-02 10:37                                     ` Bastien Guerry
2023-12-02 10:54                                       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-02 11:55                                       ` Thierry Volpiatto
2023-12-02 12:43                                         ` Thierry Volpiatto
2023-12-02 13:02                                           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-02 13:50                                           ` Bastien Guerry
2023-12-02 15:01                                             ` Thierry Volpiatto
2023-12-05  7:34 ` Tino Calancha
2023-12-05  7:38 ` Tino Calancha
2023-12-05  7:43 ` Tino Calancha
2023-12-12  5:46 ` Pedro Andres Aranda Gutierrez
2023-12-12 12:01   ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=87sf4nv8wc.fsf@posteo.net \
    --to=thievol@posteo.net \
    --cc=66394@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefankangas@gmail.com \
    /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 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.