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.
This commit is contained in:
parent
961f994b14
commit
53334042b5
|
@ -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)
|
||||
|
|
|
@ -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))))))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue