all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ediff-select-hook is called twice when a difference is selected
@ 2003-08-06  8:25 Klaus Zeitler
  0 siblings, 0 replies; only message in thread
From: Klaus Zeitler @ 2003-08-06  8:25 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-06  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-06  8:25 ediff-select-hook is called twice when a difference is selected Klaus Zeitler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.