From cb6c7d8b3feeb869dc7218f9686461d2ede3aaac Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 14 Feb 2015 02:12:47 -0500 Subject: backward-slurp-word: Fix whitespace check Don't fail when there is no description and the slurped word isn't separated by a non-word character. --- org-link-edit.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'org-link-edit.el') diff --git a/org-link-edit.el b/org-link-edit.el index 3df5a0f..180e289 100644 --- a/org-link-edit.el +++ b/org-link-edit.el @@ -166,9 +166,9 @@ words." (user-error "Not enough words before the link")) (point))) (let ((slurped (buffer-substring-no-properties (point) beg))) - (when (= (length desc) 0) - (setq slurped (progn (string-match "\\(.*\\w\\)\\W*$" slurped) - (match-string 1 slurped)))) + (when (and (= (length desc) 0) + (string-match "\\(.*\\w\\)\\W*$" slurped)) + (setq slurped (match-string 1 slurped))) (setq slurped (replace-regexp-in-string "\n" " " slurped)) (setq desc (concat slurped desc) beg (- beg (length slurped))) -- cgit v1.2.3