From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Viper doesn't properly handle C-h k for mouse clicks Date: Sat, 17 Mar 2007 16:32:47 -0400 Message-ID: <87vegz391s.fsf_-_@stupidchicken.com> References: <87r6s3zp63.fsf@stupidchicken.com> <85r6s3jsib.fsf@lola.goethe.zz> <45EC8CB5.60307@gmail.com> <87zm6rmjc1.fsf@stupidchicken.com> <45EC9B1B.6050006@gmail.com> <87ps7nxqmu.fsf@stupidchicken.com> <45EDEFD2.300@gmail.com> <45EEA997.6030108@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1174163671 32263 80.91.229.12 (17 Mar 2007 20:34:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 17 Mar 2007 20:34:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Kifer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 17 21:34:23 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HSfbY-0003LK-Ea for ged-emacs-devel@m.gmane.org; Sat, 17 Mar 2007 21:34:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HSfcp-0000zP-1N for ged-emacs-devel@m.gmane.org; Sat, 17 Mar 2007 15:35:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HSfbY-0008UG-ET for emacs-devel@gnu.org; Sat, 17 Mar 2007 16:34:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HSfbY-0008U4-0T for emacs-devel@gnu.org; Sat, 17 Mar 2007 15:34:20 -0500 Original-Received: from south-station-annex.mit.edu ([18.72.1.2]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HSfaH-0006wm-Al for emacs-devel@gnu.org; Sat, 17 Mar 2007 16:33:01 -0400 Original-Received: from central-city-carrier-station.mit.edu (CENTRAL-CITY-CARRIER-STATION.MIT.EDU [18.7.7.72]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id l2HKWs26000445; Sat, 17 Mar 2007 15:32:54 -0500 (EST) Original-Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by central-city-carrier-station.mit.edu (8.13.6/8.9.2) with ESMTP id l2HKWnww008460; Sat, 17 Mar 2007 16:32:50 -0400 (EDT) Original-Received: from localhost (SYDNEYPACIFIC-SIX-FOURTEEN.MIT.EDU [18.95.7.103]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id l2HKWlkH024542; Sat, 17 Mar 2007 16:32:47 -0400 (EDT) Original-Received: from cyd by localhost with local (Exim 3.36 #1 (Debian)) id 1HSfa3-0005Mu-00; Sat, 17 Mar 2007 16:32:47 -0400 In-Reply-To: <45EEA997.6030108@gmail.com> (Lennart Borgman's message of "Wed\, 07 Mar 2007 13\:01\:27 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) X-Scanned-By: MIMEDefang 2.42 X-Spam-Score: -2.599 X-detected-kernel: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68030 Archived-At: "Lennart Borgman (gmail)" writes: > I am little bit ashamed to say that it seems to be some problem with > Viper. I will contact Michael Kifer. The problem, despite the original bug report, has nothing to do with text properties. With viper on, do C-h k and click anywhere with the mouse. You will see that only the down-mouse binding gets reported; in comparison, when viper is off, the up-mouse binding also gets reported. The problem is that viper handles describe-key using advice. In viper.el:1028, we find the following code: (defadvice describe-key (before viper-describe-key-ad protect activate) "Force to read key via `viper-read-key-sequence'." (interactive (list (viper-read-key-sequence "Describe key: ")))) This changes the interactive form of describe-key. Unfortunately, the real interactive form of describe-key isn't read-key-sequence---it's a complicated 35-line-long Lisp function, whose goal is (among other things) to capture the up-events corresponding to down-mouse events! If viper really has to use advice, it's better to use around-advice: instead of changing describe-key's interactive spec, allow describe-key's interactive spec parse the mouse events, then change the KEY argument *afterwards*. (In the long run, I think we should change viper to avoid using advice, but I don't think it's feasible in the Emacs 22 time frame; OTOH, this would be a significant change.)