diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-08-24 21:14:26 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-08-24 21:15:00 +0200 |
commit | 302fdfd2b00d783c360cf687f3ad5fd43dafdd4c (patch) | |
tree | 5dc1f3487aca705d79793f2c990ea5f7c9a208a3 | |
parent | dcdc141331e79fb35a7c843ca9d2bf74a6327aaa (diff) | |
download | org-mode-302fdfd2b00d783c360cf687f3ad5fd43dafdd4c.tar.gz |
Fix bug in comment-dwin when at a keyword
* lisp/org.el (org-mode): Set back comment-start-skip so comment-dwin
can tell a keyword from a comment.
* testing/lisp/test-org.el: Add test.
-rw-r--r-- | lisp/org.el | 1 | ||||
-rw-r--r-- | testing/lisp/test-org.el | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el index a6aef6e..7165937 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5091,6 +5091,7 @@ The following commands are available: ;; Comments (org-set-local 'comment-use-syntax nil) (org-set-local 'comment-start "# ") + (org-set-local 'comment-start-skip "^\\s-*#\\(?: \\|$\\)") (org-set-local 'comment-insert-comment-function 'org-insert-comment) (org-set-local 'comment-region-function 'org-comment-or-uncomment-region) (org-set-local 'uncomment-region-function 'org-comment-or-uncomment-region) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index a289cbf..fdfd4ca 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -332,7 +332,13 @@ http://article.gmane.org/gmane.emacs.orgmode/21459/" (push-mark (point) t t) (goto-char (point-max)) (call-interactively 'comment-dwim) - (buffer-string)))))) + (buffer-string))))) + ;; In front of a keyword without region, insert a new comment. + (should + (equal "# \n#+KEYWORD: value" + (org-test-with-temp-text "#+KEYWORD: value" + (progn (call-interactively 'comment-dwim) + (buffer-string)))))) |