diff options
| author | Dmitry Gutov | 2013-10-06 02:40:16 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2013-10-06 02:40:16 +0300 |
| commit | da9ea6d9803d6a12f93ed7b2effd85e254b390e8 (patch) | |
| tree | 937ff4f01786045c293cd2bc65ef763c4801ee82 | |
| parent | 34d1a1337df479908d6a7076a35d693050ae518d (diff) | |
| download | emacs-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/NEWS | 5 | ||||
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/newcomment.el | 13 |
3 files changed, 19 insertions, 6 deletions
| @@ -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, | ||
| 161 | and 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 | |||
| 214 | See `remember-data-directory' and `remember-directory-file-name-format' | 217 | See `remember-data-directory' and `remember-directory-file-name-format' |
| 215 | for new options related to this function. | 218 | for 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>. |
| 218 | Affected files: | 221 | Affected 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 @@ | |||
| 1 | 2013-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 | |||
| 1 | 2013-10-05 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2013-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. |
| 440 | More specifically, it means that `syntax-ppss' is used to find out whether | 440 | More specifically, it means that `syntax-ppss' is used to find out whether |
| 441 | point is within a string or not. Major modes whose syntax is faithfully | 441 | point is within a string or not. Major modes whose syntax is not faithfully |
| 442 | described by the syntax-tables can set this to non-nil so comment markers | 442 | described by the syntax-tables (or where `font-lock-syntax-table' is radically |
| 443 | in strings will not confuse Emacs.") | 443 | different from the main syntax table) can set this to nil, |
| 444 | then `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. |
| 516 | Returns nil if not inside a comment, else moves point and returns | 519 | Returns nil if not inside a comment, else moves point and returns |
| 517 | the same as `comment-search-backward'." | 520 | the 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)) |