Add docstring to align-repeat-x commands

Update 'spacemacs|create-align-repeat-x macro to add a docstring to created
functions. The docstring refers the user to the macro, providing a link to
the source code.
This commit is contained in:
Troy Pracy 2017-08-29 13:33:26 +10:00 committed by duianto
parent ae51fd7a77
commit 3c67ba94f3
2 changed files with 10 additions and 5 deletions

View file

@ -933,6 +933,8 @@ Other:
spacemacs/window-split-triple-columns spacemacs/window-split-triple-columns
spacemacs/window-split-grid) spacemacs/window-split-grid)
(thanks to Thanh Vuong) (thanks to Thanh Vuong)
- Added a link to =spacemacs|create-align-repeat-x= in the docstring for
=align-repeat-= commands (thanks to Troy Pracy)
- Fixed: - Fixed:
- Fixed ~h~ key binding in compilation and grep buffers - Fixed ~h~ key binding in compilation and grep buffers
(thanks to Sylvain Benner) (thanks to Sylvain Benner)

View file

@ -1132,11 +1132,14 @@ the right."
nil)) nil))
(defmacro spacemacs|create-align-repeat-x (name regexp &optional justify-right default-after) (defmacro spacemacs|create-align-repeat-x (name regexp &optional justify-right default-after)
(let ((new-func (intern (concat "spacemacs/align-repeat-" name)))) (let* ((new-func (intern (concat "spacemacs/align-repeat-" name)))
`(defun ,new-func (start end switch) (new-func-defn
(interactive "r\nP") `(defun ,new-func (start end switch)
(let ((after (not (eq (if switch t nil) (if ,default-after t nil))))) (interactive "r\nP")
(spacemacs/align-repeat start end ,regexp ,justify-right after))))) (let ((after (not (eq (if switch t nil) (if ,default-after t nil)))))
(spacemacs/align-repeat start end ,regexp ,justify-right after)))))
(put new-func 'function-documentation "Created by `spacemacs|create-align-repeat-x'.")
new-func-defn))
(spacemacs|create-align-repeat-x "comma" "," nil t) (spacemacs|create-align-repeat-x "comma" "," nil t)
(spacemacs|create-align-repeat-x "semicolon" ";" nil t) (spacemacs|create-align-repeat-x "semicolon" ";" nil t)