[gnu.emacs.bug] setting the modification-flag

peck@sun.com (Jeff Peck) (09/20/89)

Sometimes i really want to write the buffer to a file, even if
it is not obviously modified.  Maybe i have just visited a new file
and want to save it with 0 length.  On some days I would use "xDEL"
(ie insert a char and delete it), but that mucks up the Undo record.
This simple, upward compatible change to "not-modified" does the trick.

in files.el:
(defun not-modified (&optional arg)
  "Mark current buffer as unmodified, not needing to be saved.
With prefix arg, mark buffer as modified, so save-buffer {\\[save-buffer]} will work."
  (interactive "P")
  (message (if arg "Modification-flag set"
	       "Modification-flag cleared"))
  (set-buffer-modified-p arg))