[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: window-modified-p

At 12:50 PM 3/21/94 -0500, Christopher Fry wrote:
>In a Fred window, when you insert/delete a char,
>the Save menu item under the File menu gets enabled and
>a little mark gets put in the window title. [nice feature!]
>I can delcare the window to not be modified with:
>Is there a way that I can explcitly declare the window to be modified?
>Can I find out, programmatically, if a window is "modified" ?

WINDOW-NEEDS-SAVING-P will return true if the window is modified.

To mark a window as modified using only documented MCL functions,
insert/delete a char:

(defun window-set-modified (w)
  (let ((buf (fred-buffer w)))
    (buffer-insert buf #\a 0)
    (buffer-delete buf 0 1))
  (fred-update w))

You can use undocumented internals and do it as follows:

(defun window-set-modified (w)
  (setf (slot-value w 'ccl::file-modcnt) -1)
  (fred-update w))