home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / emacs / 3469 < prev    next >
Encoding:
Text File  |  1992-11-06  |  2.0 KB  |  52 lines

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!hal.com!olivea!charnel!rat!usc!sdd.hp.com!swrinde!emory!ogicse!news.u.washington.edu!news.u.washington.edu!ethanb
  2. From: ethanb@ptolemy.astro.washington.edu (Ethan Bradford)
  3. Newsgroups: comp.emacs
  4. Subject: Re: Getting buffers saved automatically
  5. Message-ID: <ETHANB.92Nov5161815@ptolemy.astro.washington.edu>
  6. Date: 6 Nov 92 00:18:15 GMT
  7. References: <1992Nov3.031152.1436@ccu1.aukuni.ac.nz>
  8. Sender: news@u.washington.edu (USENET News System)
  9. Organization: U. of Washington
  10. Lines: 38
  11. In-Reply-To: russells@ccu1.aukuni.ac.nz's message of Tue, 3 Nov 1992 03:11:52 GMT
  12. To: russells@ccu1.aukuni.ac.nz (Russell Street)
  13.  
  14. Contrary to your complaint, I find that with your function as defined,
  15. save-some-buffers will save all the buffers, but compile will crash
  16. because it does not have an argument.  If redefined as follows, your
  17. command works for me.
  18.  
  19.     (defun mycompile()
  20.         "Save any unsaved buffers automatically and then invoke compile"
  21.         (interactive)
  22.         (save-some-buffers t)
  23.         (compile compile-command)
  24.     )
  25.     (define-key esc-map "`" 'mycompile)
  26.  
  27. If you want to be queried for the compile command string, replace 
  28.   (compile compile-command)
  29. with
  30.   (call-interactively 'compile)
  31.  
  32.  
  33. In article <1992Nov3.031152.1436@ccu1.aukuni.ac.nz> russells@ccu1.aukuni.ac.nz (Russell Street) writes:
  34.  
  35.    I would like to bind ESC-` to 'compile' (which I have done)
  36.    but would also like it to save all dirty buffers before invoking
  37.    compile. i.e., I would like to run "save-some-buffers" with a
  38.    numeric argument before running compile.
  39.  
  40.    I have worked out that if I put this sort of thing in my ~/.emacs file
  41.    will ask me to save the buffers first -- before compile calls
  42.    save-some-buffers :( -- but I can't get it to automagically save the 
  43.    buffers.
  44.  
  45.    (defun mycompile()
  46.        "Save any unsaved buffers automatically and then invoke compile"
  47.        (interactive)
  48.        (save-some-buffers t)
  49.        (compile)
  50.    )
  51.    (define-key esc-map "`" 'mycompile)
  52.