From: Jean Louis <bugs@gnu.support>
To: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: How to tell that buffer is not modifed?
Date: Thu, 25 Mar 2021 11:53:36 +0300 [thread overview]
Message-ID: <courier.00000000605C4F99.0000436F@stw1.rcdrun.com> (raw)
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
next reply other threads:[~2021-03-25 8:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-25 8:53 Jean Louis [this message]
2021-03-25 9:31 ` How to tell that buffer is not modifed? Eli Zaretskii
2021-03-25 9:59 ` Jean Louis
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=courier.00000000605C4F99.0000436F@stw1.rcdrun.com \
--to=bugs@gnu.support \
--cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).