From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Loading files at startup (desktop) and revert-buffer leave buffers **. Date: Mon, 25 Nov 2002 08:22:09 +0200 (IST) Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1038205617 23379 80.91.224.249 (25 Nov 2002 06:26:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 25 Nov 2002 06:26:57 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18GChq-00064t-00 for ; Mon, 25 Nov 2002 07:26:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18GCeZ-000891-00; Mon, 25 Nov 2002 01:23:31 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18GCdK-0006hb-00 for help-gnu-emacs@gnu.org; Mon, 25 Nov 2002 01:22:14 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18GCdI-0006fN-00 for help-gnu-emacs@gnu.org; Mon, 25 Nov 2002 01:22:14 -0500 Original-Received: from is.elta.co.il ([199.203.121.2]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18GCdG-0006Zf-00 for help-gnu-emacs@gnu.org; Mon, 25 Nov 2002 01:22:11 -0500 Original-Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id IAA10338 for ; Mon, 25 Nov 2002 08:22:09 +0200 (IST) X-Sender: eliz@is Original-To: help-gnu-emacs@gnu.org In-Reply-To: Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:3954 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3954 On Sun, 24 Nov 2002, Alan Mackenzie wrote: > > Text properties are considered an integral part of the buffer's text > > because you want them to be copied together with that text. Thus, any > > change in text properties causes the buffer to be marked as modified. > > Hmm... That still doesn't make much sense to me. What does it mean for > a buffer to be marked as modified? It surely means "The buffer isn't the > same as the file it was loaded from any more.". No, it means the text in the buffer has changed in some way. For example, copying the text into a string will yield a different string. If the buffer is in Enriched mode, saving it after changing text properties will actually change the file on disk. In other words, the connection with the file the buffer is visiting is not the only one. There are other examples of this in Emacs. For starters, a buffer does not need to be visiting a file. More to the point, text is decoded when it's read from file, so in general the buffer _never_ holds the same stuff as the file. As another example, "C-x RET f" also marks the buffer modified, although it does nothing to the buffer contents. Etc., etc. > I think the principal use of text properties is for font-locking. That's a wrong assumption, actually. Perhaps that's why you have a difficulty to accept the fact that Emacs marks the buffer modified when text properties change. Please read the chapter in the ELisp manual that describes text properties and see how many non-face-related properties are there. > Are there any uses of text properties where > applying them to an otherwise unmodified buffer would necessitate the > buffer being saved to its file? See the example of Enriched mode above. > Ah, overlays. What are they? The elisp manual just says "they're a bit > like text properties in some ways, but otherwise totally different.". > Other than the fact that they don't set the buffer-changed flag, I can't > see any uses for them distinct from those of text properties. The main differences is exactly what bothered you: overlays aren't considered part of the text, only a display feature.