From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
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 [thread overview]
Message-ID: <87wprjhclo.fsf@web.de> (raw)
In-Reply-To: 87h9in4zee.fsf@linux-qg7d.fritz.box
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.
next prev parent reply other threads:[~2016-01-08 23:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-08 19:58 Hook doesn't run as expected, if buffer mode is set from major-mode Rolf Ade
2016-01-08 21:20 ` Drew Adams
2016-01-08 23:32 ` Michael Heerdegen [this message]
[not found] ` <mailman.1999.1452288065.843.help-gnu-emacs@gnu.org>
2016-01-09 0:15 ` Rolf Ade
2016-01-09 2:07 ` Drew Adams
[not found] ` <mailman.2004.1452295936.843.help-gnu-emacs@gnu.org>
2016-01-09 0:36 ` Rolf Ade
2016-01-09 2:09 ` Drew Adams
2016-01-09 2:19 ` Michael Heerdegen
[not found] ` <mailman.2012.1452305981.843.help-gnu-emacs@gnu.org>
2016-01-09 22:14 ` Rolf Ade
2016-01-10 4:29 ` Michael Heerdegen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wprjhclo.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).