[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to tell that buffer is not modifed?
From: |
Jean Louis |
Subject: |
How to tell that buffer is not modifed? |
Date: |
Thu, 25 Mar 2021 11:53:36 +0300 |
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
- How to tell that buffer is not modifed?,
Jean Louis <=