Yuki-Inoue / elisp-format

Originally from EmacsWiki
https://www.emacswiki.org/emacs/elisp-format.el
GNU General Public License v3.0
16 stars 3 forks source link

Adds trailing whitespace to wrapped expressions #2

Open andersk opened 6 years ago

andersk commented 6 years ago

For example,

-(defun elisp-format-string-length ()⏎
+(defun elisp-format-string-length () ⏎
   "Return string length."⏎
-  (- (elisp-format-string-end-position)⏎
+  (- (elisp-format-string-end-position) ⏎
      (elisp-format-string-beg-position)))⏎

If you run elisp-format on itself and git diff, you’ll see many more examples of this.

(I’m using Emacs 26.1 on Ubuntu 18.04.)

tonight-halfmoon commented 4 years ago

This is a solution:

 (add-hook 'before-save-hook (lambda()
                                (elisp-format-buffer)
                                (whitespace-cleanup)) t t) 
Yuki-Inoue commented 4 years ago

Sorry late reply. Recently, I don't write elisp codes...

If someone can make PR, then I can verify, and accept.