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

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

bug#23098: 25.0.92; (recenter -1) can leave point in the middle of the w


From: Drew Adams
Subject: bug#23098: 25.0.92; (recenter -1) can leave point in the middle of the window
Date: Sun, 27 Mar 2016 08:07:24 -0700 (PDT)

> >   (add-to-list
> >    'erc-mode-hook
> >    #'(lambda () (set (make-local-variable 'scroll-conservatively) 100)))
> 
> You should use add-hook for hook variables.

Also (nits):

1. No need to use #' with lambdas (no advantage in a context that
   expects a function).

2. It is generally a good idea to use a named function (not a
   lambda) on a hook.  For one thing, removing it is easier and
   more robust (`remove-hook') - no worries about differences in
   whitespace etc.

3. Emacs now has `setq-local': `(setq-local VAR VALUE)'.  (I too
   use `(set (make-local-variable VAR) VALUE)', but mainly because
   I usually need code that works also for older Emacs versions.)





reply via email to

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