1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-07 04:10:27 -08:00

Merge branch 'register_preview'

This commit is contained in:
Thierry Volpiatto 2023-12-02 09:04:03 +01:00
commit 74a5ec0e1e
No known key found for this signature in database
GPG key ID: 08FDB07A7433A7F2
4 changed files with 10 additions and 48 deletions

View file

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

View file

@ -1140,6 +1140,11 @@ showcases all their customization options.
* 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

View file

@ -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."
@ -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-function'."
(format "%s: %s\n"
(single-key-description (car r))
(propertize (string (car r))
'display (single-key-description (car r)))
(register-describe-oneline (car r))))
(defvar register-preview-function #'register-preview-default

View file

@ -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:
;;; 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