GNU bug report logs - #20600
24.5.3: add-hook - wrong arguments error

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Mon, 18 May 2015 05:35:02 UTC

Severity: wishlist

Tags: notabug, wontfix

Found in version 24.5.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5.3: add-hook - wrong arguments error
Date: Mon, 18 May 2015 07:34:42 +0200
[Message part 1 (text/plain, inline)]
||after-change-functions|  wrongly accepts functions with three args only
 
Issue is explained in docstring of workaround below.
If the function to be hooked in --save-buffer-- doesn't require args, add-hook resp. after-change-functions should not.

(defun my-instant-save-buffer (eins zwei drei)
  "To be hooked into list `after-change-functions'

`after-change-functions' expects functions receiving three arguments.
Arguments are ignored here, but slots needed by add-hook"
  (save-buffer))

(add-hook 'after-change-functions 'my-instant-save-buffer)|

[Message part 2 (text/html, inline)]

This bug report was last modified 10 years and 10 days ago.

Previous Next


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