all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to tell that buffer is not modifed?
@ 2021-03-25  8:53 Jean Louis
  2021-03-25  9:31 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Louis @ 2021-03-25  8:53 UTC (permalink / raw)
  To: Help GNU Emacs

I would like to tell programmatically that buffer is not modified even
though it is modified.

I am inserting the database entry into the buffer, but because
`set-auto-mode' works only on buffers with associated file names, I am
assocating a file name with revision number. This association makes
buffer look modified and killing buffer asks for saving. I would like
to tell that buffer is not modified, as the information arrived from
database and it is anyway in a read only mode.

    (switch-to-buffer (get-buffer-create buffer))
    (setq-local buffer-file-name filename-revised)
    (read-only-mode 0)
    (insert body)
    (goto-char 1)
    (set-auto-mode)
    (read-only-mode 1)))

Jean



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-25  9:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-25  8:53 How to tell that buffer is not modifed? Jean Louis
2021-03-25  9:31 ` Eli Zaretskii
2021-03-25  9:59   ` Jean Louis

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.