all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27634: 25.2.1; C-g does not quit register-read-with-preview
@ 2017-07-10  3:58 Paul Rankin
  2017-07-10  6:33 ` Tino Calancha
  2017-07-21  3:47 ` Allen Li
  0 siblings, 2 replies; 18+ messages in thread
From: Paul Rankin @ 2017-07-10  3:58 UTC (permalink / raw)
  To: 27634

When saving to a register C-g does not quit but instead saves to the register "C-g".

To reproduce:

1. $ emacs -Q
2. M-x point-to-register [C-x r SPC]
3. C-g

Expected results:

C-g should call keyboard-quit and escape point-to-register

Actual results:

Point marker is saved to register "C-g".

This runs counter to expected behaviour with both quitting from saving a register, and in quitting from recalling a register, e.g. by attempting to quit from saving a point to register in buffer-A with C-g, when the user then attempts to keyboard-quit from jump-to-register [C-x r j C-g] he/she will be returned to point in buffer-A.

The root of the problem appears to be that register-read-with-preview only tests input with characterp:

(characterp ?^G) -> t

This appears to conflict with the Emacs manual entry on registers, which states that registers can be a letters or numbers:

> Each register has a name that consists of a single character, which
> we will denote by R; R can be a letter (such as ‘a’) or a number (such
> as ‘1’); case matters, so register ‘a’ is not the same as register ‘A’.

(info "(emacs) Registers")

I have worked around this with the following patch to register.el.gz:

@@ -164,7 +164,7 @@
 		       help-chars)
 	    (unless (get-buffer-window buffer)
 	      (register-preview buffer 'show-empty)))
-	  (if (characterp last-input-event) last-input-event
+	  (if (< 31 last-input-event 127) last-input-event
 	    (error "Non-character input-event")))
       (and (timerp timer) (cancel-timer timer))
       (let ((w (get-buffer-window buffer)))

However, I think this will not work on international keyboards and so is probably a poor fix.

Configuration:

GNU Emacs 25.2.1 (x86_64-apple-darwin16.6.0, NS appkit-1504.83 Version 10.12.5 (Build 16F73)) of 2017-06-06
macOS 10.12.5 (16F73)

MacBook Pro (Retina, 15-inch, Mid 2014)
2.2 GHz Intel Core i7
16 GB 1600 MHz DDR3
Intel Iris Pro 1536 MB

--
www.paulwrankin.com





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-07-25  2:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-10  3:58 bug#27634: 25.2.1; C-g does not quit register-read-with-preview Paul Rankin
2017-07-10  6:33 ` Tino Calancha
2017-07-10  7:20   ` Paul Rankin
2017-07-10  7:59     ` Tino Calancha
2017-07-10 17:06     ` Eli Zaretskii
2017-07-11  4:14       ` Paul Rankin
2017-07-11  4:48         ` Tino Calancha
2017-07-11  5:07           ` Paul Rankin
2017-07-11  5:50             ` Tino Calancha
2017-07-11  7:20               ` Andreas Schwab
2017-07-11 14:36         ` Eli Zaretskii
2017-07-12  2:12           ` Paul Rankin
2017-07-10 19:01   ` Andreas Schwab
2017-07-21  3:47 ` Allen Li
2017-07-21  6:19   ` Tino Calancha
2017-07-21  8:40     ` Eli Zaretskii
2017-07-21  8:55       ` Tino Calancha
2017-07-25  2:45         ` Tino Calancha

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.