Questions tagged [buffer-modified]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
51 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?
4
votes
1answer
53 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 ...
0
votes
1answer
59 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 ...
3
votes
1answer
1k 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 ...
1
vote
1answer
45 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 ...
1
vote
1answer
36 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 ...
8
votes
1answer
141 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?
2
votes
1answer
301 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-...
19
votes
2answers
4k 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?
3
votes
2answers
109 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 ...
10
votes
3answers
616 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 ...
8
votes
1answer
636 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 ...