all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Klaus Zeitler <kzeitler@lucent.com>
Subject: ediff-select-hook is called twice when a difference is selected
Date: Wed, 6 Aug 2003 10:25:29 +0200 (MEST)	[thread overview]
Message-ID: <200308060825.h768PTK21636@sfsw51.de.lucent.com> (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

                 reply	other threads:[~2003-08-06  8:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200308060825.h768PTK21636@sfsw51.de.lucent.com \
    --to=kzeitler@lucent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.