Philipp Stephani
2016-10-25 11:37:50 UTC
Hi,
if you start a current Emacs with emacs -Q and then run
(with-temp-buffer
(let ((calls 0)
(prog-mode-hook prog-mode-hook))
(add-hook 'prog-mode-hook (lambda () (cl-incf calls)))
(java-mode)
(cl-assert (= calls 1))))
the assertion succeeds (i.e. doesn't trigger). However, when I tried this
with the CC-Mode from Sourceforge, it didn't work. I downloaded
http://downloads.sourceforge.net/project/cc-mode/cc-mode/5.33/cc-mode-5.33.tar.gz
and unpacked it into a temporary directory (/tmp/cc-mode-5.33). After
starting Emacs with emacs -Q -L /tmp/cc-mode-5.33 and running above code,
the assertion triggers because prog-mode-hook hasn't been called. I've
tried this before and after compiling the CC-Mode files in
/tmp/cc-mode-5.33, the result is the same. Am I doing something wrong, or
is this a new bug?
Thanks,
Philipp
if you start a current Emacs with emacs -Q and then run
(with-temp-buffer
(let ((calls 0)
(prog-mode-hook prog-mode-hook))
(add-hook 'prog-mode-hook (lambda () (cl-incf calls)))
(java-mode)
(cl-assert (= calls 1))))
the assertion succeeds (i.e. doesn't trigger). However, when I tried this
with the CC-Mode from Sourceforge, it didn't work. I downloaded
http://downloads.sourceforge.net/project/cc-mode/cc-mode/5.33/cc-mode-5.33.tar.gz
and unpacked it into a temporary directory (/tmp/cc-mode-5.33). After
starting Emacs with emacs -Q -L /tmp/cc-mode-5.33 and running above code,
the assertion triggers because prog-mode-hook hasn't been called. I've
tried this before and after compiling the CC-Mode files in
/tmp/cc-mode-5.33, the result is the same. Am I doing something wrong, or
is this a new bug?
Thanks,
Philipp