[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hook doesn't run as expected, if buffer mode is set from major-mode
From: |
Michael Heerdegen |
Subject: |
Re: Hook doesn't run as expected, if buffer mode is set from major-mode |
Date: |
Sat, 09 Jan 2016 00:32:03 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Rolf Ade <rolf@pointsman.de> writes:
> Is it me, doing something wrong or stupid? If not, what's the
> rationale behind this behavior?
Though it's better to set `default-major-mode' and use (goto-char
(point-max)) instead of `end-of-buffer' (which sets the mark) - it
should work as you expect. But it doesn't.
I tried to edebug `set-auto-mode' - this is where the point is
apparently set to the buffer's beginning. But the point seems to be
changed magically right after the beginning without any code involved.
Either some hook is doing that, or this is some internal thing at the C
level (bug?).
In a different trial, I traced `goto-char' and `point-min'. But every
of these calls was inside a `save-excursion'.
So, from the Lisp level, it's a miracle.
Michael.
- Hook doesn't run as expected, if buffer mode is set from major-mode, Rolf Ade, 2016/01/08
- Message not available
- Re: Hook doesn't run as expected, if buffer mode is set from major-mode, Rolf Ade, 2016/01/08
- RE: Hook doesn't run as expected, if buffer mode is set from major-mode, Drew Adams, 2016/01/08
- Re: Hook doesn't run as expected, if buffer mode is set from major-mode, Michael Heerdegen, 2016/01/08
- Message not available
- Re: Hook doesn't run as expected, if buffer mode is set from major-mode, Rolf Ade, 2016/01/09
- Re: Hook doesn't run as expected, if buffer mode is set from major-mode, Michael Heerdegen, 2016/01/09