[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: window-modified-p
- To: cfry@harlequin.com (Christopher Fry), info-mcl@cambridge.apple.com
- Subject: Re: window-modified-p
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Mon, 21 Mar 1994 13:17:33 -0600
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:
>window-set-not-modified
>
>Is there a way that I can explcitly declare the window to be modified?
>Can I find out, programmatically, if a window is "modified" ?
>
>
>CFry
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))