unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Duncan Burke <duncankburke@gmail.com>
Cc: 22743@debbugs.gnu.org
Subject: bug#22743: 25.0.91: set-quit-char does not work if emacs lacks a controlling tty
Date: Sat, 20 Feb 2016 11:40:13 +0200	[thread overview]
Message-ID: <83mvqvpvnm.fsf@gnu.org> (raw)
In-Reply-To: <56C7FA4A.1030605@gmail.com> (message from Duncan Burke on Sat, 20 Feb 2016 16:31:54 +1100)

> From: Duncan Burke <duncankburke@gmail.com>
> Date: Sat, 20 Feb 2016 16:31:54 +1100
> 
> 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.

That's documented in the doc string of set-quit-char, so this is by
design.  On a TTY, C-g triggers a signal, and Emacs uses a system API
to change the character which does that.  But on GUI frames, this is
not possible.

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

I don't think this patch will work reliably, because the parts of code
you changed are not the whole picture.  C-g is supported implicitly
and explicitly in many more places.  Grep the Lisp sources for C-g to
see that.

FWIW, my NSHO is that we should deprecate set-quit-char and remove it
in a future Emacs version.  It is no longer reasonable to have a
feature that only works on text terminals.





  parent reply	other threads:[~2016-02-20  9:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-20  5:31 bug#22743: 25.0.91: set-quit-char does not work if emacs lacks a controlling tty Duncan Burke
2016-02-20  8:04 ` John Wiegley
2016-02-20 11:48   ` Duncan Burke
2016-02-20  9:40 ` Eli Zaretskii [this message]
2016-02-20 11:37   ` Duncan Burke
2016-02-20 20:36   ` Glenn Morris
2016-02-20 20:44     ` Eli Zaretskii
2016-02-20 20:49       ` Glenn Morris
2016-02-20 21:04         ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83mvqvpvnm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22743@debbugs.gnu.org \
    --cc=duncankburke@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).