From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#9146: M-x broken in console mode with viper (always gives: "viper bell")) Date: Mon, 27 Feb 2012 18:12:43 +0800 Message-ID: <87ehtg7ffo.fsf@gnu.org> References: <877h7ar3ug.fsf@usha.takhisis.invalid> <20110928072531.GA12901@upsilon.cc> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1330337612 15815 80.91.229.3 (27 Feb 2012 10:13:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2012 10:13:32 +0000 (UTC) Cc: Michael Kifer , 9146@debbugs.gnu.org To: Stefano Zacchiroli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 27 11:13:25 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 1S1xa9-00054h-1L for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2012 11:13:25 +0100 Original-Received: from localhost ([::1]:52229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1xa8-00055m-0e for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Feb 2012 05:13:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1xa0-00055f-W9 for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2012 05:13:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1xZw-0004Gl-Dn for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2012 05:13:16 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1xZw-0004Gh-A2 for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2012 05:13:12 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S1xcg-0007zf-7f for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2012 05:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Feb 2012 10:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9146 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9146-submit@debbugs.gnu.org id=B9146.133033774530705 (code B ref 9146); Mon, 27 Feb 2012 10:16:02 +0000 Original-Received: (at 9146) by debbugs.gnu.org; 27 Feb 2012 10:15:45 +0000 Original-Received: from localhost ([127.0.0.1]:59021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1xcP-0007zB-FI for submit@debbugs.gnu.org; Mon, 27 Feb 2012 05:15:45 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:44901) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1xcN-0007z4-CJ for 9146@debbugs.gnu.org; Mon, 27 Feb 2012 05:15:44 -0500 Original-Received: from [155.69.19.41] (port=52751 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S1xZb-0001KN-3x; Mon, 27 Feb 2012 05:12:51 -0500 In-Reply-To: (Stefan Monnier's message of "Fri, 04 Nov 2011 18:43:44 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) 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:57281 Archived-At: Stefan Monnier writes: > IOW viper-intercept-ESC-key needs to be changed to call key-binding in > a context where Viper's minor-mode map(s) have been temporarily disabled > so the ESC binding to viper-intercept-ESC-key doesn't hide the thing > we're looking for. Since no one else has stepped up to the plate, I took a crack at this. Stefano, could you test if the following patch does the right thing? *** lisp/emulation/viper-cmd.el 2012-01-19 07:21:25 +0000 --- lisp/emulation/viper-cmd.el 2012-02-27 10:10:42 +0000 *************** *** 1086,1093 **** (defun viper-intercept-ESC-key () "Function that implements ESC key in Viper emulation of Vi." (interactive) ! (let ((cmd (or (key-binding (viper-envelop-ESC-key)) ! (lambda () (interactive) (error "Viper bell"))))) ;; call the actual function to execute ESC (if no other symbols followed) ;; or the key bound to the ESC sequence (if the sequence was issued --- 1086,1098 ---- (defun viper-intercept-ESC-key () "Function that implements ESC key in Viper emulation of Vi." (interactive) ! (let* ((event (viper-envelop-ESC-key)) ! (cmd (cond ((equal event viper-ESC-key) ! 'viper-intercept-ESC-key) ! ((let ((emulation-mode-map-alists nil)) ! (key-binding event))) ! (t ! (error "Viper bell"))))) ;; call the actual function to execute ESC (if no other symbols followed) ;; or the key bound to the ESC sequence (if the sequence was issued