Path: utzoo!attcan!uunet!ogicse!uwm.edu!lll-winken!sun-barr!newstop!sun!amdahl!JUTS!kpc00 From: kpc00@ccc.amdahl.com (Kimball P Collins) Newsgroups: comp.emacs Subject: Re: %% vs. @@ Message-ID: <8fbY022v01fw01@JUTS.ccc.amdahl.com> Date: 28 Jun 90 04:03:49 GMT References: <87.P022y01JM01@JUTS.ccc.amdahl.com> <1990Jun27.145013.29422@talos.pm.com> Reply-To: kpc00@JUTS.uts.amdahl.com (Kimball P Collins) Organization: Amdahl Corporation, Sunnyvale CA Lines: 32 In article <1990Jun27.145013.29422@talos.pm.com> kjones@talos.pm.com (Kyle Jones) writes: >You'll need to do a bit more than just toggle buffer-offer-save. >Emacs will ask to save any buffer that has a filename associated >with it (via buffer-file-name). So your toggle function will >need to set/reset the value of buffer-file-name for file buffers. Quite right. I ended up writing (toggle-buffer-saveable) (perhaps "-saveability" would be a better name since there is no associated Boolean variable). I did not implement an alist to be able to restore the original file name since it would potentially get messy when set-visited-file-name or rename-buffer happen before one toggles saveability back on, etc. A Boolean variable for saveability in emacs might be a nice change to have for version 19. > >Try this: > >(setq-default mode-line-modified > (cons '(buffer-file-name "----" > (buffer-offer-save "----" "--@@")) > mode-line-modified)) Thanks very much. The above setq-default seems to work fine, but I wonder about the purpose of purecopy in the loaddefs.el defconst for this variable. Can it be set without overwriting memory anyplace? Would it be beneficial to defconst the variable again? -- Neither representing Amdahl nor necessarily myself.