all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie<none@example.invalid>
Subject: Re: Loading files at startup (desktop) and revert-buffer leave buffers **.
Date: Mon, 25 Nov 2002 22:45:57 +0000	[thread overview]
Message-ID: <579ura.v5.ln@acm.acm> (raw)
In-Reply-To: 3DE257B6.6040700@ihs.com

Kevin Rodgers <kevinr@ihs.com> wrote on Mon, 25 Nov 2002 10:02:46 -0700:

> Changing Text Properties
> ------------------------

>     The primitives for changing properties apply to a specified range of
> text.  The function `set-text-properties' (see end of section) sets the
> entire property list of the text in that range; more often, it is
> useful to add, change, or delete just certain properties specified by
> name.

>     Since text properties are considered part of the buffer's
> contents,....

This rather begs the question I was asking.  _Why_ should text properties
be considered part of the buffer's contents?  This isn't a rhetorical
question.  The way it is at the moment has sent at least one elisp
programmer (me) into a 4-month long confusion.  In the end, I had to
enclose t-p changes inside a macro which restores the buffer-modified
flag at the end.  font-lock, and its various ancillary modes, does the
same.  This is a big hassle.

Eli has pointed out a mode (enriched-mode), where t-p changes _are_
reflected in the eventual file contents, but I suspect this is a rare
thing in elisp code.

> .... and can affect how the buffer looks on the screen, any change in
> the text properties is considered a buffer modification.  Buffer text
> property changes are undoable (*note Undo::.).

Handy thing, that undo!

It seems to me that one should only be prompted to save a buffer to a
file (e.g. on C-x C-s, or C-x k) when one has changed the substance of
that buffer, not merely the way it has been displayed.  What is the
rationale behind prompting a user to save a "changed" file, merely
because he has changed its display within emacs to yellow letters, for
example?  The same goes for the two stars displayed on the mode-line.

Maybe there should be two distinct change flags.  A "user" change flag
when essential changes are made to the buffer, and an "internal" change
flag, to be used for buffer changes which can have no effect outside of
emacs. 

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

  reply	other threads:[~2002-11-25 22:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <j7phha.ab.ln@acm.acm>
2002-11-23 15:27 ` Loading files at startup (desktop) and revert-buffer leave buffers ** Alan Mackenzie
2002-11-24  6:01   ` Eli Zaretskii
2002-11-25 17:02   ` Kevin Rodgers
2002-11-25 22:45     ` Alan Mackenzie [this message]
2002-11-27  6:20       ` Eli Zaretskii
     [not found] <mailman.1038117744.12302.help-gnu-emacs@gnu.org>
2002-11-24 23:02 ` Alan Mackenzie
2002-11-25  6:22   ` Eli Zaretskii
     [not found] <mailman.1038205410.31195.help-gnu-emacs@gnu.org>
2002-11-25 23:26 ` Alan Mackenzie
2002-11-27  6:14   ` Eli Zaretskii
2002-11-27  6:52   ` Miles Bader

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=579ura.v5.ln@acm.acm \
    --to=none@example.invalid \
    /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.