This commit is contained in:
Jean-Philippe Bernardy 2015-11-09 21:29:34 +01:00
parent 40fab18e95
commit 5455990575

View file

@ -143,18 +143,19 @@ NOTE: Do not run for every cursor."
(yank))
(defun boon-need-space ()
"Is it necessary to insert a space here to separate words?"
(and (looking-at "\\sw\\|\\s(") (looking-back "\\sw\\|\\s)")))
(defun boon-splice-with-spaces ()
"Yank, replacing the region if it is active, and fix the
surroundings so that they become nicely spaced."
"Yank, replacing the region if it is active.
Fix the surroundings so that they become nicely spaced."
(interactive)
(boon-extract-region)
(yank)
(when (boon-need-space) (insert " "))
(save-excursion
(goto-char (mark))
(when (boon-need-space))))
(when (boon-need-space) (insert " "))))
(defun boon-line-prefix ()
"Return the text between beginning of line and position."
@ -172,7 +173,7 @@ surroundings so that they become nicely spaced."
"Return non-nil if the point is at the current line indentation; or to the right."
(or (eolp)
(and (not (boon-at-indent-p))
(string-blank-p (boon-line-prefix))))))
(string-blank-p (boon-line-prefix)))))
(defun boon-at-indent-p ()
"Return non-nil if the point is at the current line indentation."