From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Roland Winkler" Newsgroups: gmane.emacs.bugs Subject: bug#11983: 24.1; Electric-command-loop broken? Date: Wed, 18 Jul 2012 15:54:45 -0500 Message-ID: <87pq7s6b8q.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1342644964 32457 80.91.229.3 (18 Jul 2012 20:56:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Jul 2012 20:56:04 +0000 (UTC) To: 11983@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 18 22:56:03 2012 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 1SrbHu-0006yX-76 for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Jul 2012 22:56:02 +0200 Original-Received: from localhost ([::1]:44901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrbHt-0001bk-F2 for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Jul 2012 16:56:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrbHq-0001W2-Fd for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 16:55:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrbHm-00056E-TI for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 16:55:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrbHm-00056A-PR for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 16:55:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SrbNi-0008Vz-0N for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 17:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Roland Winkler" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jul 2012 21:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11983 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134264526232659 (code B ref -1); Wed, 18 Jul 2012 21:02:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Jul 2012 21:01:02 +0000 Original-Received: from localhost ([127.0.0.1]:49015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrbMj-0008UX-Sb for submit@debbugs.gnu.org; Wed, 18 Jul 2012 17:01:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60181) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrbMi-0008UK-K6 for submit@debbugs.gnu.org; Wed, 18 Jul 2012 17:01:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrbGl-0004Rv-Aq for submit@debbugs.gnu.org; Wed, 18 Jul 2012 16:54:53 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:54304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrbGl-0004Rj-7i for submit@debbugs.gnu.org; Wed, 18 Jul 2012 16:54:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrbGk-0001Pl-6F for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 16:54:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrbGj-0004RO-2l for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 16:54:50 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:47873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrbGi-0004RK-Vb for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 16:54:49 -0400 Original-Received: from dhcp207152.uni-regensburg.de ([132.199.207.152]:55282 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SrbGi-0007ZL-Cs for bug-gnu-emacs@gnu.org; Wed, 18 Jul 2012 16:54:48 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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:62130 Archived-At: I am trying to understand Electric-command-loop in electric.el (this is used by BBDB 3): Two things: - The code contains a hard-coded (setq universal-argument-num-events 0) Apparently this is never reset, so exiting Electric-command-loop leaves behind this binding. - The doc string says ;; Given third argument non-nil, it ;; INHIBITS quitting unless the user types C-g at toplevel. This is ;; so user can do things like C-u C-g and not get thrown out. Yet it appears to me, that even for C-u C-g the user gets thrown out. Here is a slightly simplified version of the code from Electric-command-loop It does not distinguish between C-g and C-u C-g. Unfortunately, this hackery goes beyond my understanding of Emacs internals. (catch 'return-tag (let (cmd (inhibit-quit t)) (while t (setq cmd (read-key-sequence "Prompt: ")) (setq last-command-event (aref cmd (1- (length cmd))) this-command (key-binding cmd t) cmd this-command) ;; This makes universal-argument-other-key work. (setq universal-argument-num-events 0) (if (or (prog1 quit-flag (setq quit-flag nil)) (eq last-input-event ?\C-g)) (progn (setq unread-command-events nil prefix-arg nil) ;; If it wasn't canceling a prefix character, then quit. (if (or (= (length (this-command-keys)) 1) (not inhibit-quit)) ; safety (throw 'return-tag (this-command-keys)) (setq cmd nil)))) (setq current-prefix-arg prefix-arg) (condition-case nil (progn (command-execute cmd) (setq last-command this-command)) (error nil))))) In GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2012-06-10 on regnitz Windowing system distributor `The X.Org Foundation', version 11.0.10706000