[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22743: 25.0.91: set-quit-char does not work if emacs lacks a control

From: Duncan Burke
Subject: bug#22743: 25.0.91: set-quit-char does not work if emacs lacks a controlling tty
Date: Sat, 20 Feb 2016 16:31:54 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

I have heavily customised keybindings on a dvorak layout and this necessitates
rebinding quit away from its default value of C-g.

I have rebound C-g in keymaps where it is already defined (such as global-map,
minibuffer-local-map and query-replace-map), and have found this to work in
most cases with one major issue in flyspell-mode.

flyspell-post-command-hook calls flyspell-check-word-p, which calls sit-for,
which ultimately calls read_char in keyboard.c.

quit_char in keyboard.c is by default set to ?\C-g and as a consequence in
flyspell-mode if C-g is pressed immediately after entering some text a quit is
signalled rather than running the command bound to C-g.

set-quit-char should be able to change quit_char to my desired value of ?\C-p,
however I run emacs in a graphical window and set-quit-char silently does
nothing if emacs does not have a controlling tty.

To reproduce this issue in emacs with emacs -Q in a graphical

(define-key global-map [?\C-g] 'backward-delete-char)
(define-key global-map [?\C-p] 'keyboard-quit)
(set-quit-char ?\C-p)

;; observe that quit_char is unchanged from original value of ?\C-g

By running flyspell mode, typing something and pressing C-g it can be observed
that backward-delete-char is not run as would be expected.

I have attached a patch that changes the behaviour of set-quit-char so that
quit_char is set even if emacs does not have a controlling tty.

Attachment: 0001-Fix-set-quit-char-when-there-s-no-controlling-tty.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]