home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / emacs / help / 5450 next >
Encoding:
Text File  |  1993-01-21  |  1.5 KB  |  35 lines

  1. Xref: sparky gnu.emacs.help:5450 comp.emacs:4038
  2. Newsgroups: gnu.emacs.help,comp.emacs
  3. Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!att!att!dptg!ulysses!allegra!princeton!csservices!mic
  4. From: mic@cs.princeton.edu (Michelangelo Grigni)
  5. Subject: Re: model for .emacs file
  6. In-Reply-To: h.b.furuseth@usit.uio.no's message of 19 Jan 93 13:23:19 GMT
  7. Message-ID: <1993Jan19.221800.21090@csservices.Princeton.EDU>
  8. Lines: 17
  9. Sender: news@csservices.Princeton.EDU (USENET News System)
  10. Organization: Princeton Department of Computer Science
  11. References: <1993Jan12.154544.17064@fuug.fi> <4fJ4tnu00VpGMiuQx_@andrew.cmu.edu>
  12.     <1j6s13INN67t@life.ai.mit.edu> <MJB.93Jan16222231@oak44.doc.ic.ac.uk>
  13.     <DODD.93Jan17095633@mycenae.cchem.berkeley.edu>
  14.     <NICKEL.93Jan18194816@tempest.cs.tu-berlin.de>
  15.     <H.B.FURUSETH.93Jan19142319@gandalf.uio.no>
  16. Date: Tue, 19 Jan 1993 22:18:00 GMT
  17.  
  18. ["Local Variables" method elided]
  19.  
  20. Instead of making a special case for .emacs.el, you can auto-recompile
  21. all of your emacs-lisp files, e.g.:
  22.  
  23. (define-key emacs-lisp-mode-map "\C-X\C-S" 'save-compile-buffer)
  24. (defun save-compile-buffer (&optional prefix)
  25.   "Save current buffer, byte-compile the file if a compiled version exists.
  26. A single prefix prevents compiling, a double prefix forces compiling."
  27.   (interactive "p")
  28.   (save-buffer)
  29.   (if (or (equal prefix 16)
  30.       (and (not (equal prefix 4))
  31.            (file-exists-p (concat (buffer-file-name) "c"))))
  32.       (progn
  33.     (sit-for 0) ; redisplays status line
  34.     (byte-compile-file (buffer-file-name)))))
  35.