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

Trim trailing spaces

Expand Messages
  • Rick Owen
    Is there a command (or a macro) that could trim trailing trailing spaces upon file-save? Thanks, Rick.
    Message 1 of 4 , Aug 25, 2006
    • 0 Attachment
      Is there a command (or a macro) that could trim trailing trailing spaces upon file-save?

      Thanks,
      Rick.
       


    • Bruno Sabin
      Rick, you can call the clean macro before saving (Esc-x clean). If you *need* it to be called on every single save, you will possibly want to create your own
      Message 2 of 4 , Aug 25, 2006
      • 0 Attachment
        Rick, you can call the "clean" macro before saving (Esc-x clean).

        If you *need* it to be called on every single save, you will possibly
        want to create your own mini-macro (say save-clean) which will call
        "clean" and "save-buffer" and rebind the C-x C-s key (global-bind-key
        save-clean "C-x C-s").

        --
        bruno

        Rick Owen said the following on 25/08/06 16:57:
        > Is there a command (or a macro) that could trim trailing trailing
        > spaces upon file-save?
        >
        > Thanks,
        > Rick.
        >
        >
        >
        >
      • Rick Owen
        Bruno, Thank you. That was exactly the help I needed. Rick. ... From: Bruno Sabin To: jasspa@yahoogroups.com Sent: Friday, August 25, 2006
        Message 3 of 4 , Aug 25, 2006
        • 0 Attachment
          Bruno,

          Thank you.  That was exactly the help I needed.

          Rick.

          ----- Original Message ----
          From: Bruno Sabin <bsabin@...>
          To: jasspa@yahoogroups.com
          Sent: Friday, August 25, 2006 10:29:38 AM
          Subject: Re: [jasspa] Trim trailing spaces

          Rick, you can call the "clean" macro before saving (Esc-x clean).

          If you *need* it to be called on every single save, you will possibly
          want to create your own mini-macro (say save-clean) which will call
          "clean" and "save-buffer" and rebind the C-x C-s key (global-bind- key
          save-clean "C-x C-s").

          --
          bruno

          Rick Owen said the following on 25/08/06 16:57:

          > Is there a command (or a macro) that could trim trailing trailing
          > spaces upon file-save?
          >
          > Thanks,
          > Rick.
          >
          >
          >
          >


        • Jon Green
          ... I agree with Bruno, clean is better called now an again rather than unnecessarily on every save. My favourite is spotless rather than the regular
          Message 4 of 4 , Sep 4, 2006
          • 0 Attachment
            Bruno Sabin wrote:
            > Rick, you can call the "clean" macro before saving (Esc-x clean).
            >
            > If you *need* it to be called on every single save, you will possibly
            > want to create your own mini-macro (say save-clean) which will call
            > "clean" and "save-buffer" and rebind the C-x C-s key (global-bind-key
            > save-clean "C-x C-s").
            >

            I agree with Bruno, 'clean' is better called now an again rather than
            unnecessarily on every save. My favourite is "spotless" rather than the
            regular "clean" which is defined as follows:-

            ; spotless; Perform a clean and remove any multi-blank lines.
            define-macro spotless
            -1 clean
            !emacro

            This removes trailing spaces and deletes multiple blank lines (2 or more
            blank lines are reduced to a single blank line). You will find this in
            the "jasspa/contrib/" directory in the example "user.emf" file and will
            have to add it to your own macro file to use it. There is also
            "super-delete" in this file which I use all of the time and am lost without.

            Jon.


            > --
            > bruno
            >
            > Rick Owen said the following on 25/08/06 16:57:
            >> Is there a command (or a macro) that could trim trailing trailing
            >> spaces upon file-save?
            >>
            >> Thanks,
            >> Rick.
          Your message has been successfully submitted and would be delivered to recipients shortly.