1

For Ediff's wide display feature I like to use my own ediff-make-wide-display function. Ediff has a variable for this: ediff-make-wide-display-function. However when I write:

(defun my-ediff-make-wide-display ()
   ...)

(setq ediff-make-wide-display-function #'my-ediff-make-wide-display)

my definition doesn't seem to get used when I toggle the display to wide view. I guess the reason is that ediff-make-wide-display-function is defined as a local variable (via ediff-defvar-local), and my setq call sets the variable somewhere else...

So to which buffers is the definition local and how can I set it for all of these buffers?

2

I think you've diagnosed the issue correctly, and you can either:

  1. Use ediff-mode-hook to set the buffer-local value.
  2. Use setq-default to set the default value.

Offhand I think #2 seems like the best option.

3
  • Using setq-default works perfectly. Thanks. - Just out of curiosity, what would I need to use in ediff-mode-hook? setq-local?
    – halloleo
    Nov 30 '21 at 5:36
  • You can do, but because this variable "Automatically becomes permanently buffer-local when set" you could also just use setq. (The "permanently" isn't important here, but means it also survives changes to the major mode.)
    – phils
    Nov 30 '21 at 8:42
  • Makes sense. Thanks.
    – halloleo
    Nov 30 '21 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.