Loading ...
Sorry, an error occurred while loading the content.

1696Re: [jasspa] Execution of macro right before save of file

Expand Messages
  • Meino Christian Cramer
    Nov 6, 2005
    • 0 Attachment
      From: Steven Phillips <bill@...>
      Subject: Re: [jasspa] Execution of macro right before save of file
      Date: Tue, 1 Nov 2005 23:01:00 +0000

      Hi Steve,

      I have "tuned" your macro and wrote a similiar piece of code
      to be executed when pressing "C-x C-c" -- unfortunately I got "problems" ;)

      These are my current definitions

      define-macro my-save-buffer
      !force clean
      @# save-buffer @mna
      !emacro
      global-bind-key my-save-buffer "C-x C-s"

      define-macro my-save-buffers-exit-emacs
      !force clean
      @# save-buffers-exit-emacs @mna
      !emacro
      global-bind-key my-save-buffers-exit-emacs "C-x C-c"


      1.) When loading a file, which has blanks before $, I get asked "save
      buffer?" even when nothing was changed myself. It would
      be nice, if this question could be skipped when the "clean"
      command was the only one, which changes the buffer...
      2.) When loading binary files by accident or intentionally, the macro
      should *not* clean anything...

      I would be very happy for any hint to achieve this...

      Happy MicroEmacsing!
      Meino


      > There is no built in mechanism at present although I can see a need of one.
      > With the current release the best (and only) solution I can think of is to
      > rebind the keys you use to save the buffer to a macro which first cleans the
      > buffer, e.g.:
      >
      > define-macro my-save-buffer
      > clean
      > @# save-buffer @mna
      > !emacro
      > global-bind-key my-save-buffer "C-x C-s"
      >
      > (Note I have not tested this macro!)
      >
      > Steve
      >
    • Show all 7 messages in this topic