diff options
| author | Alan Mackenzie | 2012-01-11 22:21:44 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2012-01-11 22:21:44 +0000 |
| commit | 2cc769a8c3b869fdeedd470501ab8d93c2182554 (patch) | |
| tree | c7d51338ff5cdc6c6443faa8999e0f2329a9e85a | |
| parent | e71f5d99fe97bb132f16571764213601e3160eb6 (diff) | |
| download | emacs-2cc769a8c3b869fdeedd470501ab8d93c2182554.tar.gz emacs-2cc769a8c3b869fdeedd470501ab8d93c2182554.zip | |
Fix Emacs bug #10463 - put `widen's around the critical spots.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 19 |
2 files changed, 19 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 90a2070c87c..4f81fdab8e4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-01-11 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | Fix Emacs bug #10463 - put `widen's around the critical spots. | ||
| 4 | |||
| 5 | * progmodes/cc-engine.el (c-in-literal, c-literal-limits): put a | ||
| 6 | widen around each invocation of c-state-pp-to-literal. Remove an | ||
| 7 | unused let variable. | ||
| 8 | |||
| 1 | 2012-01-11 Glenn Morris <rgm@gnu.org> | 9 | 2012-01-11 Glenn Morris <rgm@gnu.org> |
| 2 | 10 | ||
| 3 | * dired-aux.el (dired-do-shell-command): Fix */? logic. (Bug#6561) | 11 | * dired-aux.el (dired-do-shell-command): Fix */? logic. (Bug#6561) |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 392e5d1c37c..2e0294341da 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -4211,12 +4211,14 @@ The last point calculated is cached if the cache is enabled, i.e. if | |||
| 4211 | 4211 | ||
| 4212 | Note that this function might do hidden buffer changes. See the | 4212 | Note that this function might do hidden buffer changes. See the |
| 4213 | comment at the start of cc-engine.el for more info." | 4213 | comment at the start of cc-engine.el for more info." |
| 4214 | (let* ((safe-place (c-state-safe-place (point))) | 4214 | (save-restriction |
| 4215 | (lit (c-state-pp-to-literal safe-place (point)))) | 4215 | (widen) |
| 4216 | (or (cadr lit) | 4216 | (let* ((safe-place (c-state-safe-place (point))) |
| 4217 | (and detect-cpp | 4217 | (lit (c-state-pp-to-literal safe-place (point)))) |
| 4218 | (save-excursion (c-beginning-of-macro)) | 4218 | (or (cadr lit) |
| 4219 | 'pound)))) | 4219 | (and detect-cpp |
| 4220 | (save-excursion (c-beginning-of-macro)) | ||
| 4221 | 'pound))))) | ||
| 4220 | 4222 | ||
| 4221 | (defun c-literal-limits (&optional lim near not-in-delimiter) | 4223 | (defun c-literal-limits (&optional lim near not-in-delimiter) |
| 4222 | "Return a cons of the beginning and end positions of the comment or | 4224 | "Return a cons of the beginning and end positions of the comment or |
| @@ -4236,9 +4238,10 @@ comment at the start of cc-engine.el for more info." | |||
| 4236 | (save-excursion | 4238 | (save-excursion |
| 4237 | (let* ((pos (point)) | 4239 | (let* ((pos (point)) |
| 4238 | (lim (or lim (c-state-safe-place pos))) | 4240 | (lim (or lim (c-state-safe-place pos))) |
| 4239 | (pp-to-lit (c-state-pp-to-literal lim pos)) | 4241 | (pp-to-lit (save-restriction |
| 4242 | (widen) | ||
| 4243 | (c-state-pp-to-literal lim pos))) | ||
| 4240 | (state (car pp-to-lit)) | 4244 | (state (car pp-to-lit)) |
| 4241 | (lit-type (cadr pp-to-lit)) | ||
| 4242 | (lit-limits (car (cddr pp-to-lit)))) | 4245 | (lit-limits (car (cddr pp-to-lit)))) |
| 4243 | 4246 | ||
| 4244 | (cond | 4247 | (cond |