From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: buffer-read-only is always t at text-mode-hook time
Date: Mon, 16 Aug 2004 10:22:31 -0600 [thread overview]
Message-ID: <4120DF47.5000708@yahoo.com> (raw)
In-Reply-To: mailman.1298.1092602041.2011.bug-gnu-emacs@gnu.org
Dan Jacobson wrote:
> Some might want to know of spelling problems they can't fix---but
> never mind that---larger problem:
>
> $ cat .emacs
> (setq default-major-mode 'text-mode);adding this line makes the below useless!
> (add-hook
> 'text-mode-hook
> (lambda ()
> (or buffer-read-only (turn-on-auto-fill))
> (and (not buffer-read-only)(> 88888 (buffer-size))(flyspell-mode 1))))
> $ emacs -nw --no-site-file /usr/share/emacs/21.3/etc/DOC-21.3.1
> And what do you know, despite my best efforts, there I am staring at
> "(Text Fly Fill)" in the modeline.
That is a problem. It arises because default-major-mode is called 1
of 2 ways: either by set-buffer-major-mode (before the file's contents
have been inserted) or by normal-mode (but only if called with a nil
FIND-FILE argument, which usually doesn't happen since after-find-file
specifies it as t).
I don't know how that could be fixed without moving the call to
set-buffer-major-mode into or after find-file-no-select-1 (which
inserts the file contents into the buffer). If that's not feasible,
should the interaction between default-major-mode and the mode's hook
functions be documented?
--
Kevin Rodgers
next prev parent reply other threads:[~2004-08-16 16:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-10 3:40 buffer-read-only is always t at text-mode-hook time Dan Jacobson
[not found] ` <E1Buzoi-00078M-CW@fencepost.gnu.org>
2004-08-13 20:05 ` Dan Jacobson
[not found] ` <E1Bw9P8-0000Tg-Br@fencepost.gnu.org>
2004-08-15 2:50 ` Dan Jacobson
[not found] ` <mailman.1298.1092602041.2011.bug-gnu-emacs@gnu.org>
2004-08-16 16:22 ` Kevin Rodgers [this message]
2004-08-18 1:34 ` Richard Stallman
[not found] ` <mailman.1089.1092431153.2011.bug-gnu-emacs@gnu.org>
2004-08-13 22:13 ` Kevin Rodgers
2004-09-03 21:26 ` mention other ways than add-hook also Dan Jacobson
[not found] ` <E1C3ilv-0002xz-GA@fencepost.gnu.org>
2004-09-05 1:52 ` Dan Jacobson
[not found] <mailman.715.1092171969.2011.bug-gnu-emacs@gnu.org>
2004-08-11 15:33 ` buffer-read-only is always t at text-mode-hook time Kevin Rodgers
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4120DF47.5000708@yahoo.com \
--to=ihs_4664@yahoo.com \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.