aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2013-10-06 02:40:16 +0300
committerDmitry Gutov2013-10-06 02:40:16 +0300
commitda9ea6d9803d6a12f93ed7b2effd85e254b390e8 (patch)
tree937ff4f01786045c293cd2bc65ef763c4801ee82
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
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/newcomment.el13
3 files changed, 19 insertions, 6 deletions
diff --git a/etc/NEWS b/etc/NEWS
index e26d18c93ed..4539f5f00d1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -157,6 +157,9 @@ some enhancements, like the ability to restore deleted frames. Command
157** The command `quail-help' is deleted. Use `C-h C-\' 157** The command `quail-help' is deleted. Use `C-h C-\'
158(`describe-input-method') instead. 158(`describe-input-method') instead.
159 159
160** The default value of `comment-use-global-state' is changed to t,
161and this variable has been marked obsolete.
162
160 163
161* Editing Changes in Emacs 24.4 164* Editing Changes in Emacs 24.4
162 165
@@ -214,7 +217,7 @@ You can use the new function `remember-store-in-files' within the
214See `remember-data-directory' and `remember-directory-file-name-format' 217See `remember-data-directory' and `remember-directory-file-name-format'
215for new options related to this function. 218for new options related to this function.
216 219
217** More packages look for ~/.emacs.d/<foo> additionally to ~/.<foo>. 220* More packages look for ~/.emacs.d/<foo> additionally to ~/.<foo>.
218Affected files: 221Affected files:
219~/.emacs.d/timelog replaces ~/.timelog 222~/.emacs.d/timelog replaces ~/.timelog
220~/.emacs.d/vip replaces ~/.vip 223~/.emacs.d/vip replaces ~/.vip
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))