Skip to main content

Questions tagged [buffer-modified]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
70 views

Make Emacs re-check a buffer's modified state?

I've got a file open in Emacs, with unsaved changes. I run a function in Emacs which first writes the current changes to a separate temporary file, then delegates to an interactive shell command which ...
mtraceur's user avatar
  • 356
0 votes
0 answers
43 views

How to detect modified buffer in the mode-line, skipping special buffers?

I'm trying to have my mode-line to display a "(modified)" string instead of the * mark. To do that, I make a test with buffer-modified-p but this seems to be always true for "special" buffers as well (...
Nicolas Rougier's user avatar
2 votes
2 answers
397 views

Resolving the conflict when the file on disk has been changed

When a file changes on disk while you're editing in Emacs, how to merge both sets of changes into the file?
Nova's user avatar
  • 1,119
4 votes
1 answer
74 views

Prevent specific parts of buffer from being editable

I wonder if it is possible to prevent specific parts of a buffer from being editable. For example, when I have outlined my document in an org-mode file, I would like to prevent any accidental changes ...
Singulaere Entitaet's user avatar
0 votes
1 answer
254 views

Using `with-silent-modifications` when modifying the buffer and undoing those modifications without using `undo`

I wrote a wrapper for the existing export function. My wrapper adds an appropriate bibliography: link, calls the original export function and then removes the bibliography: link. In summary, the ...
AlwaysLearning's user avatar
8 votes
1 answer
3k views

automatically update buffers when focusing if file changed

When programming, I often switch from emacs to Xcode and viceversa. When I switch to Xcode, it automatically updates the current file when I focus Xcode window, if it detects that there are some ...
Nisba's user avatar
  • 905
1 vote
1 answer
71 views

preventing save prompt for temp files

I often open temp files and I don't care about saving the contents when I modify the buffer. How can I tell Emacs to ignore buffer changes when the filename matches a pattern, so that I don't get ...
jdigital's user avatar
  • 125
1 vote
1 answer
45 views

CSharp files modified on open

When I open files that default to csharp-mode, they always start modified. This is only occurring for csharp-mode. save-buffers-kill-emacs with the d option (view changes in this buffer) shows ...
Stewart Smith's user avatar
8 votes
1 answer
164 views

How to perform a modifying action without modifying buffer?

I want to add properties to text (make it read-only temporarily) and I don't want “modification-status” change. In general, how do I perform some modifying action without Emacs noticing it?
Mark Karpov's user avatar
  • 4,963
2 votes
1 answer
469 views

How to chain after-change-hook functions?

I am trying to convert markdown to html and then use impatient-mode to display it live on browser on the fly. Impatient mode uses after-change-hook to detect changes in html. I am using after-change-...
Chillar Anand's user avatar
38 votes
3 answers
8k views

How can I see the changes made to a modified buffer since the last save?

Given a modified buffer, how can I diff it with the file backing it on disk to see what I've changed?
nosefrog's user avatar
  • 825
3 votes
2 answers
182 views

After (set-buffer-modified-p nil), the first undo command doesn't set the buffer modified flag to true

If I modify a buffer and then save it, the buffer modified flag resets and the subsequent undo commands set the buffer modified flag to true. However if I use (set-buffer-modified-p nil), the flag ...
elvengadoribazar's user avatar
12 votes
3 answers
890 views

How to modify a buffer without undo noticing?

Q: How do I insert/modify text in a buffer without undo noticing? Here's the use case. I have a comment block at the start of every file that, among other things, updates a timestamp for the most ...
Dan's user avatar
  • 33.1k
9 votes
1 answer
1k views

How to hook into buffer modified state?

Such as in the built-in variable mode-line-modified which displays an asterisk in the mode line if the buffer is modified. Specifically, I want to turn hl-line-mode off when the buffer is modified ...
nanny's user avatar
  • 5,756