GNU bug report logs - #23098
25.0.92; (recenter -1) can leave point in the middle of the window

Previous Next

Package: emacs;

Reported by: Jorgen Schaefer <jorgen.schaefer <at> gmail.com>

Date: Wed, 23 Mar 2016 18:41:01 UTC

Severity: normal

Found in version 25.0.92

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>, John Wiegley <jwiegley <at> gmail.com>
Cc: Jorgen Schäfer <jorgen.schaefer <at> gmail.com>, 23098 <at> debbugs.gnu.org
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.)




This bug report was last modified 9 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.