From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: Small enhancement for add-log.el
Date: Fri, 08 Oct 2004 10:54:47 +0200 [thread overview]
Message-ID: <m3brfdfv3c.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <200410072307.i97N7s307908@raven.dms.auburn.edu> (Luc Teirlinck's message of "Thu, 7 Oct 2004 18:07:54 -0500 (CDT)")
Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> Kim Storm wrote:
>
> When I look through ChangeLog files, I often type `q' to quit --
> but instead a q is inserted into the buffer.
>
> What about the following change [I know it's a hack] which kills the
> buffer if you type `q' in an unmodified ChangeLog buffer.
>
> I do not have this tendency myself and I believe that this is just a
> personal idiosyncrasy. I believe the probability of doing that would
> be a lot bigger when editing etc/NEWS, because there everything looks
> exactly like if you had done `C-h n'. Even for etc/NEWS, I would not
> recommend your solution.
I originally tried to use first-change-hook to disable the 'q' command,
but it turns out that if you have font-lock in a buffer, first-change-hook
is useless, as the fontification adds text properties, and that is
seen as a modification of the buffer (even when the buffer modification
flag is restored).
I then tried to use buffer-modified-tick, but that has the same problem.
Is there some way to implement a first-user-change-hook ?
>
> I have other idiosyncrasies myself. In a buffer visiting a file, I
> often type `^', expecting to visit the file's directory in Dired
> (because I think of `^' as going up in the directory tree). I just
> erase the `^' and do `C-x d'. I am not going to suggest to rebind `^'
> in file visiting buffers, to fit that habit of mine.
Still, it should be possible to have a sort of "pseudo-view-minor-mode"
which works like view mode until you make some "real change" to a file.
>
> It should be pretty safe, as the buffer is modified after C-x 4 a
> and similar commands.
>
> But it is no longer modified after you save your changes without being
> completely through editing. (I often do that.)
I don't like that either -- but (buffer-modified-p) was the only
method I could find since first-change-hook doesn't work.
But maybe I could use an after-save-hook to inhibit the feature once
a modified buffer has been saved once.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
next prev parent reply other threads:[~2004-10-08 8:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-07 22:06 Small enhancement for add-log.el Kim F. Storm
2004-10-07 22:21 ` David Kastrup
2004-10-07 23:00 ` Kim F. Storm
2004-10-08 12:25 ` Kai Grossjohann
2004-10-07 23:07 ` Luc Teirlinck
2004-10-08 8:54 ` Kim F. Storm [this message]
2004-10-08 13:01 ` Luc Teirlinck
2004-10-08 13:44 ` Kim F. Storm
2004-10-08 22:45 ` Luc Teirlinck
2004-10-11 22:23 ` Kim F. Storm
2004-10-12 14:28 ` Juri Linkov
2004-10-12 14:40 ` Stefan Monnier
2004-10-08 13:19 ` Stefan
2004-10-08 13:54 ` Kim F. Storm
2004-10-09 15:44 ` Richard Stallman
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=m3brfdfv3c.fsf@kfs-l.imdomain.dk \
--to=storm@cua.dk \
--cc=emacs-devel@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.
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.