From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83mvqvpvnm.fsf@gnu.org> References: <56C7FA4A.1030605@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1455961282 30061 80.91.229.3 (20 Feb 2016 09:41:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Feb 2016 09:41:22 +0000 (UTC) Cc: 22743@debbugs.gnu.org To: Duncan Burke Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 20 10:41:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aX42J-0004RI-4w for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Feb 2016 10:41:11 +0100 Original-Received: from localhost ([::1]:59571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX42H-0004Zm-Sx for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Feb 2016 04:41:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX42E-0004ZJ-0t for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2016 04:41:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aX42A-00054C-Qs for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2016 04:41:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX42A-00053h-Ml for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2016 04:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aX42A-0007Db-G2 for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2016 04:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Feb 2016 09:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22743 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22743-submit@debbugs.gnu.org id=B22743.145596123927709 (code B ref 22743); Sat, 20 Feb 2016 09:41:02 +0000 Original-Received: (at 22743) by debbugs.gnu.org; 20 Feb 2016 09:40:39 +0000 Original-Received: from localhost ([127.0.0.1]:34584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aX41n-0007Cr-Kw for submit@debbugs.gnu.org; Sat, 20 Feb 2016 04:40:39 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60918) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aX41l-0007Cd-Qz for 22743@debbugs.gnu.org; Sat, 20 Feb 2016 04:40:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aX41d-0004uc-LO for 22743@debbugs.gnu.org; Sat, 20 Feb 2016 04:40:32 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX41d-0004uY-Hp; Sat, 20 Feb 2016 04:40:29 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1183 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aX41c-0000EG-OY; Sat, 20 Feb 2016 04:40:29 -0500 In-reply-to: <56C7FA4A.1030605@gmail.com> (message from Duncan Burke on Sat, 20 Feb 2016 16:31:54 +1100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113347 Archived-At: > From: Duncan Burke > 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.