elisp-format icon indicating copy to clipboard operation
elisp-format copied to clipboard

Adds trailing whitespace to wrapped expressions

Open andersk opened this issue 6 years ago • 2 comments

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.)

andersk avatar Jun 05 '18 10:06 andersk

This is a solution:

 (add-hook 'before-save-hook (lambda()
                                (elisp-format-buffer)
                                (whitespace-cleanup)) t t) 

tonight-halfmoon avatar Jan 04 '20 00:01 tonight-halfmoon

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

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

Yuki-Inoue avatar Mar 19 '20 01:03 Yuki-Inoue