emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106849: Merge.


From: Alan Mackenzie
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106849: Merge.
Date: Wed, 11 Jan 2012 22:32:50 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106849 [merge]
committer: Alan Mackenzie <address@hidden>
branch nick: trunk
timestamp: Wed 2012-01-11 22:32:50 +0000
message:
  Merge.
modified:
  lisp/ChangeLog
  lisp/progmodes/cc-engine.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-01-11 06:53:12 +0000
+++ b/lisp/ChangeLog    2012-01-11 22:21:44 +0000
@@ -1,3 +1,11 @@
+2012-01-11  Alan Mackenzie  <address@hidden>
+
+       Fix Emacs bug #10463 - put `widen's around the critical spots.
+
+        * progmodes/cc-engine.el (c-in-literal, c-literal-limits): put a
+       widen around each invocation of c-state-pp-to-literal.  Remove an
+       unused let variable.
+
 2012-01-11  Glenn Morris  <address@hidden>
 
        * dired-aux.el (dired-do-shell-command): Fix */? logic.  (Bug#6561)

=== modified file 'lisp/progmodes/cc-engine.el'
--- a/lisp/progmodes/cc-engine.el       2012-01-05 09:46:05 +0000
+++ b/lisp/progmodes/cc-engine.el       2012-01-11 22:21:44 +0000
@@ -4211,12 +4211,14 @@
 
 Note that this function might do hidden buffer changes.  See the
 comment at the start of cc-engine.el for more info."
-  (let* ((safe-place (c-state-safe-place (point)))
-        (lit (c-state-pp-to-literal safe-place (point))))
-    (or (cadr lit)
-       (and detect-cpp
-            (save-excursion (c-beginning-of-macro))
-            'pound))))
+  (save-restriction
+    (widen)
+    (let* ((safe-place (c-state-safe-place (point)))
+          (lit (c-state-pp-to-literal safe-place (point))))
+      (or (cadr lit)
+         (and detect-cpp
+              (save-excursion (c-beginning-of-macro))
+              'pound)))))
 
 (defun c-literal-limits (&optional lim near not-in-delimiter)
   "Return a cons of the beginning and end positions of the comment or
@@ -4236,9 +4238,10 @@
   (save-excursion
     (let* ((pos (point))
           (lim (or lim (c-state-safe-place pos)))
-          (pp-to-lit (c-state-pp-to-literal lim pos))
+          (pp-to-lit (save-restriction
+                       (widen)
+                       (c-state-pp-to-literal lim pos)))
           (state (car pp-to-lit))
-          (lit-type (cadr pp-to-lit))
           (lit-limits (car (cddr pp-to-lit))))
 
       (cond


reply via email to

[Prev in Thread] Current Thread [Next in Thread]