aboutsummaryrefslogtreecommitdiff
path: root/org-link-edit.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-02-14 18:15:42 -0500
committerKyle Meyer <kyle@kyleam.com>2015-02-14 18:15:42 -0500
commit2e0805f31aac5ce33127797967bf02a8e18d8655 (patch)
tree026fe14e632ed795601214c403f315a62b507326 /org-link-edit.el
parent4f40284b0d37d4b58fe725ff259417bde1578148 (diff)
downloadorg-link-edit-2e0805f31aac5ce33127797967bf02a8e18d8655.tar.gz
split-{first,last}-words: Use Org syntax table
Fix the test that should have caught this.
Diffstat (limited to 'org-link-edit.el')
-rw-r--r--org-link-edit.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/org-link-edit.el b/org-link-edit.el
index b670f29..f99dac3 100644
--- a/org-link-edit.el
+++ b/org-link-edit.el
@@ -187,11 +187,12 @@ of STRING. If the number of words in STRING is fewer than N,
(with-temp-buffer
(insert string)
(goto-char (point-min))
- (let ((within-bound (forward-word n)))
- (skip-syntax-forward "^\w")
- (cons (buffer-substring 1 (point))
- (and within-bound
- (buffer-substring (point) (point-max)))))))
+ (with-syntax-table org-mode-syntax-table
+ (let ((within-bound (forward-word n)))
+ (skip-syntax-forward "^w")
+ (cons (buffer-substring 1 (point))
+ (and within-bound
+ (buffer-substring (point) (point-max))))))))
(defun org-link-edit--split-last-words (string n)
"Split STRING into (other . N last words) cons cell.
@@ -203,11 +204,12 @@ of STRING. If the number of words in STRING is fewer than N,
(with-temp-buffer
(insert string)
(goto-char (point-max))
- (let ((within-bound (forward-word (- n))))
- (skip-syntax-backward "^\w")
- (cons (and within-bound
- (buffer-substring 1 (point)))
- (buffer-substring (point) (point-max))))))
+ (with-syntax-table org-mode-syntax-table
+ (let ((within-bound (forward-word (- n))))
+ (skip-syntax-backward "^w")
+ (cons (and within-bound
+ (buffer-substring 1 (point)))
+ (buffer-substring (point) (point-max)))))))
;;;###autoload
(defun org-link-edit-forward-barf-word (&optional n)