bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ediff-select-hook is called twice when a difference is selected


From: Klaus Zeitler
Subject: ediff-select-hook is called twice when a difference is selected
Date: Wed, 6 Aug 2003 10:25:29 +0200 (MEST)

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:
<down-mouse-1> <mouse-movement> <mouse-1> <down-mouse-2> 
<mouse-2> <up> <up> <up> <up> <up> <up> <left> C-j 
<down> <down> <down> <down> <down> <left> C-j <down> 
<down> <down> <left> C-j <escape> x e d i f f - f i 
l SPC <return> t s t / e d 1 <return> <up> <backspace> 
2 <return> n q y C-x b * M SPC <return> <help-echo> 
<help-echo> <help-echo> <help-echo> <menu-bar> <help-menu> 
<report-emacs-bug>

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]