From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Klaus Zeitler Newsgroups: gmane.emacs.bugs Subject: ediff-select-hook is called twice when a difference is selected Date: Wed, 6 Aug 2003 10:25:29 +0200 (MEST) Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <200308060825.h768PTK21636@sfsw51.de.lucent.com> NNTP-Posting-Host: deer.gmane.org X-Trace: main.gmane.org 1060158772 11575 80.91.224.253 (6 Aug 2003 08:32:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2003 08:32:52 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 06 10:33:13 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19kJjM-0000wT-00 for ; Wed, 06 Aug 2003 10:33:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19kJe0-0004Ha-U4 for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2003 04:27:40 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19kJdn-0004Cp-24 for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2003 04:27:27 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19kJdG-00040M-Cd for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2003 04:27:25 -0400 Original-Received: from [192.11.222.163] (helo=ihemail2.firewall.lucent.com) by monty-python.gnu.org with esmtp (Exim 4.20) id 19kJc1-0003l2-Go for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2003 04:25:37 -0400 Original-Received: from nbgif1.de.lucent.com (h135-248-192-26.lucent.com [135.248.192.26]) by ihemail2.firewall.lucent.com (Switch-2.2.0/Switch-2.2.0) with ESMTP id h768PWD05182 for ; Wed, 6 Aug 2003 03:25:33 -0500 (CDT) Original-Received: from sfsws1.de.lucent.com (sfsws1 [135.248.217.84]) by nbgif1.de.lucent.com (8.8.8/8.8.5) with ESMTP id KAA20607 for ; Wed, 6 Aug 2003 10:25:31 +0200 (MEST) Original-Received: from sfsw51.de.lucent.com (sfsw51 [135.248.216.225]) by sfsws1.de.lucent.com (8.11.7+Sun/8.8.5) with ESMTP id h768PTV24481 for ; Wed, 6 Aug 2003 10:25:30 +0200 (MEST) Original-Received: (from kzeitler@localhost) by sfsw51.de.lucent.com (8.11.7+Sun/8.8.8) id h768PTK21636; Wed, 6 Aug 2003 10:25:29 +0200 (MEST) Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list 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 Xref: main.gmane.org gmane.emacs.bugs:5487 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:5487 This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English, because the Emacs maintainers do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. In GNU Emacs 21.3.1 (sparc-sun-solaris2.8, Motif Version 2.1.0) of 2003-07-10 on sfsws4 configured using `configure --with-gcc --prefix=/vol/freeware/SunOS-5.8/emacs/21.3 --sharedstatedir=/vol/freeware/SunOS-5.8/emacs/21.3/share --with-x-toolkit=motif --x-includes=/usr/openwin/include:/usr/local/gnu/include --x-libraries=/usr/openwin/lib:/usr/local/gnu/lib --with-pop' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: C locale-coding-system: nil default-enable-multibyte-characters: t Please describe exactly what actions triggered the bug and the precise symptoms of the bug: I've tried to use ediff-select-hook to execute some specific action when I select a new difference. When I select the next/previous difference ediff-select-hook is called twice, AFAICT it seems as if it's called in ediff-unselect-and-select-difference for the new and the old diff. The following code snippet executed in *scratch* buffer --- snip --- (setq select-calls 0) (defun ediff-test-select-hook () (setq select-calls (1+ select-calls)) (message "ediff-test-select-hook called %d times" select-calls)) (add-hook 'ediff-select-hook 'ediff-test-select-hook) --- snip --- shows after next/previous-difference in *Messages* buffer: ediff-test-select-hook called 1 times ediff-test-select-hook called 2 times I got around this by modifying (in ediff-unselect-and-select-difference): (or (eq flag 'unselect-only) (ediff-select-difference n)) to: (or (eq flag 'unselect-only) (let (ediff-select-hook) (ediff-select-difference n))) that may not be a good solution, but it works for me Recent input: C-j C-j C-j x e d i f f - f i l SPC t s t / e d 1 2 n q y C-x b * M SPC Recent messages: Buffer A: Processing difference region 0 of 1 Buffer B: Processing difference region 0 of 1 Processing difference regions ... done Refining difference region 1 ... [2 times] ediff-test-select-hook called 1 times ediff-test-select-hook called 2 times [2 times] Loading emacsbug...done Loading view...done