From e51a89a5e539555db1c743ee4e04546b00461b25 Mon Sep 17 00:00:00 2001 From: duianto Date: Sun, 31 Jul 2016 11:47:27 +0200 Subject: [PATCH] Comment corrections and two functions reordered Misspellings: "beginnign" changed to "beginning", "Insert one of several lines" changed to "Insert one or several lines" in two functions, "identation" changed to "indentation", Missing comment copied from the function that inserts a line in the opposite direction: (defun spacemacs/insert-line-below-no-indent (count) "Insert a new line below with no indentation." and renamed the direction, resulting in: "Insert a new line above with no indentation." Duplicate comments removed, the comments inside the functions, are better explanations of what the function does. Functions reordered: The functions: (defun spacemacs/evil-insert-line-below (count) and (defun spacemacs/evil-insert-line-above (count) were written in a illogical order, the "above" function should be written before the "below" function, with this change, the function order will match other functions with "above" and "below" in their names, for example these: (defun spacemacs/insert-line-above-no-indent (count) https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bdistributions/spacemacs-base/funcs.el#L535 (defun spacemacs/insert-line-below-no-indent (count) https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bdistributions/spacemacs-base/funcs.el#L549 evil-commands.el line 2205: (defun evil-open-above (count) line 2219: (defun evil-open-below (count) line 2310: (defun evil-copy-from-above (arg) line 2326: (defun evil-copy-from-below (arg) evil-common.el line 1892: (defun evil-insert-newline-above () line 1901: (defun evil-insert-newline-below () --- core/templates/.spacemacs.template | 4 ++-- layers/+distributions/spacemacs-base/funcs.el | 21 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/core/templates/.spacemacs.template b/core/templates/.spacemacs.template index 6847f09dd..42d99768e 100644 --- a/core/templates/.spacemacs.template +++ b/core/templates/.spacemacs.template @@ -107,8 +107,8 @@ values." ;; by your Emacs build. ;; If the value is nil then no banner is displayed. (default 'official) dotspacemacs-startup-banner 'official - ;; List of items to show in startup buffer or an association list of of - ;; the form `(list-type . list-size)`. If nil it is disabled. + ;; List of items to show in startup buffer or an association list of + ;; the form `(list-type . list-size)`. If nil then it is disabled. ;; Possible values for list-type are: ;; `recents' `bookmarks' `projects' `agenda' `todos'." dotspacemacs-startup-lists '((recents . 5) diff --git a/layers/+distributions/spacemacs-base/funcs.el b/layers/+distributions/spacemacs-base/funcs.el index be94f28a9..642918d47 100644 --- a/layers/+distributions/spacemacs-base/funcs.el +++ b/layers/+distributions/spacemacs-base/funcs.el @@ -82,7 +82,7 @@ auto-indent." (sp-newline)) (defun spacemacs/push-mark-and-goto-beginning-of-line () - "Push a mark at current location and go to the beginnign of the line." + "Push a mark at current location and go to the beginning of the line." (interactive) (push-mark (point)) (evil-beginning-of-line)) @@ -93,20 +93,18 @@ auto-indent." (push-mark (point)) (evil-end-of-line)) -;; insert one or several line below without changing current evil state -(defun spacemacs/evil-insert-line-below (count) - "Insert one of several lines below the current point's line without changing -the current state and point position." - (interactive "p") - (dotimes (_ count) (save-excursion (evil-insert-newline-below)))) - -;; insert one or several line above without changing current evil state (defun spacemacs/evil-insert-line-above (count) - "Insert one of several lines above the current point's line without changing + "Insert one or several lines above the current point's line without changing the current state and point position." (interactive "p") (dotimes (_ count) (save-excursion (evil-insert-newline-above)))) +(defun spacemacs/evil-insert-line-below (count) + "Insert one or several lines below the current point's line without changing +the current state and point position." + (interactive "p") + (dotimes (_ count) (save-excursion (evil-insert-newline-below)))) + (defun spacemacs/evil-goto-next-line-and-indent (&optional count) (interactive "p") (let ((counter (or count 1))) @@ -531,6 +529,7 @@ Useful for making the home buffer the only visible buffer in the frame." (delete-other-windows)) (defun spacemacs/insert-line-above-no-indent (count) + "Insert a new line above with no indentation." (interactive "p") (let ((p (+ (point) count))) (save-excursion @@ -545,7 +544,7 @@ Useful for making the home buffer the only visible buffer in the frame." (goto-char p))) (defun spacemacs/insert-line-below-no-indent (count) - "Insert a new line below with no identation." + "Insert a new line below with no indentation." (interactive "p") (save-excursion (evil-move-end-of-line)