aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Volpiatto2023-12-02 09:04:03 +0100
committerThierry Volpiatto2023-12-02 09:04:03 +0100
commit74a5ec0e1e05b78e5fb86c0c1a8ac6737bf4e2d6 (patch)
treed578387d0f07fb8f2ceff6063a9e59c71776a577
parenteec1142acdde9d10781c781e7890c2d26f7e6b2d (diff)
parentcd6e66f955d20d31686a617ed8a5cd043585c71f (diff)
downloademacs-74a5ec0e1e05b78e5fb86c0c1a8ac6737bf4e2d6.tar.gz
emacs-74a5ec0e1e05b78e5fb86c0c1a8ac6737bf4e2d6.zip
Merge branch 'register_preview'
-rw-r--r--doc/emacs/regs.texi5
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/register.el5
-rw-r--r--test/lisp/register-tests.el43
4 files changed, 10 insertions, 48 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.
16we will denote by @var{r}; @var{r} can be a letter (such as @samp{a}) 16we will denote by @var{r}; @var{r} can be a letter (such as @samp{a})
17or a number (such as @samp{1}); case matters, so register @samp{a} is 17or a number (such as @samp{1}); case matters, so register @samp{a} is
18not the same as register @samp{A}. You can also set a register in 18not the same as register @samp{A}. You can also set a register in
19non-alphanumeric characters, for instance @samp{*} or @samp{C-d}. 19non-alphanumeric characters, for instance @samp{C-d} by using for
20Note, it's not possible to set a register in @samp{C-g} or @samp{ESC}, 20example @key{C-q} @samp{C-d}.
21because these keys are reserved for quitting (@pxref{Quitting}).
22 21
23@findex view-register 22@findex view-register
24 A register can store a position, a piece of text, a rectangle, a 23 A register can store a position, a piece of text, a rectangle, a
diff --git a/etc/NEWS b/etc/NEWS
index db8a47fd739..da00ea9dbda 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1140,6 +1140,11 @@ showcases all their customization options.
1140 1140
1141* Incompatible Lisp Changes in Emacs 30.1 1141* Incompatible Lisp Changes in Emacs 30.1
1142 1142
1143---
1144** 'register-preview-delay' is no longer used.
1145Register preview is no more delayed. If you want to disable it use
1146'register-use-preview' instead with a boolean value.
1147
1143+++ 1148+++
1144** 'M-TAB' now invokes 'completion-at-point' also in Text mode. 1149** 'M-TAB' now invokes 'completion-at-point' also in Text mode.
1145Text mode no longer binds 'M-TAB' to 'ispell-complete-word', and 1150Text mode no longer binds 'M-TAB' to 'ispell-complete-word', and
diff --git a/lisp/register.el b/lisp/register.el
index 61bef503f91..46ec38821e5 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -93,7 +93,6 @@ of the marked text."
93 :type '(choice (const :tag "None" nil) 93 :type '(choice (const :tag "None" nil)
94 (character :tag "Use register" :value ?+))) 94 (character :tag "Use register" :value ?+)))
95 95
96;; FIXME: This is no more needed, remove it.
97(defcustom register-preview-delay 1 96(defcustom register-preview-delay 1
98 "If non-nil, time to wait in seconds before popping up register preview window. 97 "If non-nil, time to wait in seconds before popping up register preview window.
99If nil, do not show register previews, unless `help-char' (or a member of 98If 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
101 :version "24.4" 100 :version "24.4"
102 :type '(choice number (const :tag "No preview unless requested" nil)) 101 :type '(choice number (const :tag "No preview unless requested" nil))
103 :group 'register) 102 :group 'register)
103(make-obsolete-variable 'register-preview-delay "No longer used." "30.1")
104 104
105(defcustom register-preview-default-keys (mapcar #'string (number-sequence ?a ?z)) 105(defcustom register-preview-default-keys (mapcar #'string (number-sequence ?a ?z))
106 "Default keys for setting a new register." 106 "Default keys for setting a new register."
@@ -131,7 +131,8 @@ See the documentation of the variable `register-alist' for possible VALUEs."
131(defun register-preview-default (r) 131(defun register-preview-default (r)
132 "Function that is the default value of the variable `register-preview-function'." 132 "Function that is the default value of the variable `register-preview-function'."
133 (format "%s: %s\n" 133 (format "%s: %s\n"
134 (single-key-description (car r)) 134 (propertize (string (car r))
135 'display (single-key-description (car r)))
135 (register-describe-oneline (car r)))) 136 (register-describe-oneline (car r))))
136 137
137(defvar register-preview-function #'register-preview-default 138(defvar register-preview-function #'register-preview-default
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 @@
1;;; register-tests.el --- tests for register.el -*- lexical-binding: t-*-
2
3;; Copyright (C) 2017-2023 Free Software Foundation, Inc.
4
5;; Author: Tino Calancha <tino.calancha@gmail.com>
6;; Keywords:
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25
26;;; Code:
27(require 'ert)
28(require 'cl-lib)
29
30(ert-deftest register-test-bug27634 ()
31 "Test for https://debbugs.gnu.org/27634 ."
32 (dolist (event (list ?\C-g 'escape ?\C-\[))
33 (cl-letf (((symbol-function 'read-key) #'ignore)
34 (last-input-event event)
35 (register-alist nil))
36 (should (equal 'quit
37 (condition-case err
38 (call-interactively 'point-to-register)
39 (quit (car err)))))
40 (should-not register-alist))))
41
42(provide 'register-tests)
43;;; register-tests.el ends here