Skip to content

Commit

Permalink
Comment corrections and two functions reordered
Browse files Browse the repository at this point in the history
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 ()
  • Loading branch information
duianto authored and TheBB committed Aug 5, 2016
1 parent 4233ffa commit e51a89a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core/templates/.spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 9 additions & 10 deletions layers/+distributions/spacemacs-base/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -93,19 +93,17 @@ 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
(defun spacemacs/evil-insert-line-above (count)
"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-below))))
(dotimes (_ count) (save-excursion (evil-insert-newline-above))))

;; 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
(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-above))))
(dotimes (_ count) (save-excursion (evil-insert-newline-below))))

(defun spacemacs/evil-goto-next-line-and-indent (&optional count)
(interactive "p")
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit e51a89a

Please sign in to comment.