home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / emacs / help / 5117 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  1.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!agate.berkeley.edu!dodd
  2. From: dodd@mycenae.cchem.berkeley.edu (Lawrence R. Dodd)
  3. Newsgroups: gnu.emacs.help
  4. Subject: elisp question regarding setq-default and major modes
  5. Date: 17 Dec 92 12:19:02
  6. Organization: Dept of Chemical Engineering, Polytechnic Univ, NY, USA
  7. Lines: 26
  8. Message-ID: <DODD.92Dec17121902@mycenae.cchem.berkeley.edu>
  9. NNTP-Posting-Host: mycenae.cchem.berkeley.edu
  10. Summary: regarding setq-default usage when starting major modes
  11. Keywords: elisp, setq-default, major modes, kill-all-local-variables
  12.  
  13.  
  14. I have some questions regarding using set-default to set buffer local
  15. variables when changing major modes.
  16.  
  17. (1) when a major mode is started, I believe that kill-all-local-variables is
  18.     called. Is it true that all buffer local variables then revert to their
  19.     default values?
  20.  
  21. (2) can one define a default value for a variable to be the result of a
  22.     conditional? for example,
  23.  
  24.     (setq-default this-is-my-variable
  25.           (if table-tennis (foobar) '("%b")))
  26.  
  27.     where `foobar' returns a string.  does this set the value of
  28.     `this-is-my-variable' to the string returned by `foobar' or to "%b" based
  29.     on the value of `table-tennis'?
  30.  
  31. (3) finally, would the above setq-default be evaluated each time a new major
  32.     mode is started?
  33.  
  34. thanks in advance. please respond via e-mail. if there is much interest I will
  35. post a summary.
  36.  
  37.  Larry
  38.  dodd@roebling.poly.edu
  39.