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

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

bug#20600: 24.5.3: add-hook - wrong arguments error


From: Andreas Röhler
Subject: bug#20600: 24.5.3: add-hook - wrong arguments error
Date: Mon, 18 May 2015 07:34:42 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

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)

reply via email to

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