aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Gutov2013-10-06 02:40:16 +0300
committerDmitry Gutov2013-10-06 02:40:16 +0300
commitda9ea6d9803d6a12f93ed7b2effd85e254b390e8 (patch)
tree937ff4f01786045c293cd2bc65ef763c4801ee82 /lisp
parent34d1a1337df479908d6a7076a35d693050ae518d (diff)
downloademacs-da9ea6d9803d6a12f93ed7b2effd85e254b390e8.tar.gz
emacs-da9ea6d9803d6a12f93ed7b2effd85e254b390e8.zip
* lisp/newcomment.el (comment-use-global-state): Change default value
to t, mark obsolete. (comment-beginning): In addition to `comment-to-syntax', check the value of `comment-use-global-state'. Fixes: debbugs:15251
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/newcomment.el13
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a7fbec849b5..24011e3584c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12013-10-05 Dmitry Gutov <dgutov@yandex.ru>
2
3 * newcomment.el (comment-use-global-state): Change default value
4 to t, mark obsolete (Bug#15251).
5 (comment-beginning): In addition to `comment-to-syntax', check the
6 value of `comment-use-global-state'.
7
12013-10-05 Stefan Monnier <monnier@iro.umontreal.ca> 82013-10-05 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * progmodes/ruby-mode.el (ruby-use-smie): Change default. 10 * progmodes/ruby-mode.el (ruby-use-smie): Change default.
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 3702b55f0aa..251c1605345 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -435,12 +435,15 @@ If UNP is non-nil, unquote nested comment markers."
435;;;; Navigation 435;;;; Navigation
436;;;; 436;;;;
437 437
438(defvar comment-use-global-state nil 438(defvar comment-use-global-state t
439 "Non-nil means that the global syntactic context is used. 439 "Non-nil means that the global syntactic context is used.
440More specifically, it means that `syntax-ppss' is used to find out whether 440More specifically, it means that `syntax-ppss' is used to find out whether
441point is within a string or not. Major modes whose syntax is faithfully 441point is within a string or not. Major modes whose syntax is not faithfully
442described by the syntax-tables can set this to non-nil so comment markers 442described by the syntax-tables (or where `font-lock-syntax-table' is radically
443in strings will not confuse Emacs.") 443different from the main syntax table) can set this to nil,
444then `syntax-ppss' cache won't be used in comment-related routines.")
445
446(make-obsolete-variable 'comment-use-global-state 'comment-use-syntax "24.4")
444 447
445(defun comment-search-forward (limit &optional noerror) 448(defun comment-search-forward (limit &optional noerror)
446 "Find a comment start between point and LIMIT. 449 "Find a comment start between point and LIMIT.
@@ -515,7 +518,7 @@ Ensure that `comment-normalize-vars' has been called before you use this."
515 "Find the beginning of the enclosing comment. 518 "Find the beginning of the enclosing comment.
516Returns nil if not inside a comment, else moves point and returns 519Returns nil if not inside a comment, else moves point and returns
517the same as `comment-search-backward'." 520the same as `comment-search-backward'."
518 (if comment-use-syntax 521 (if (and comment-use-syntax comment-use-global-state)
519 (let ((state (syntax-ppss))) 522 (let ((state (syntax-ppss)))
520 (when (nth 4 state) 523 (when (nth 4 state)
521 (goto-char (nth 8 state)) 524 (goto-char (nth 8 state))