emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/progmodes cc-cmds.el


From: Alan Mackenzie
Subject: [Emacs-diffs] emacs/lisp/progmodes cc-cmds.el
Date: Fri, 13 Feb 2009 14:54:28 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Alan Mackenzie <acmacm> 09/02/13 14:54:28

Modified files:
        lisp/progmodes : cc-cmds.el 

Log message:
        (c-defun-name): Widen, to allow it to work in narrowed buffers.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/cc-cmds.el?cvsroot=emacs&r1=1.81&r2=1.82

Patches:
Index: cc-cmds.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-cmds.el,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- cc-cmds.el  25 Jan 2009 21:31:49 -0000      1.81
+++ cc-cmds.el  13 Feb 2009 14:54:27 -0000      1.82
@@ -1687,6 +1687,8 @@
       (beginning-of-defun-function end-of-defun-function
        where pos name-end)
 
+    (save-restriction
+      (widen)
     (save-excursion
       ;; Move back out of any macro/comment/string we happen to be in.
       (c-beginning-of-macro)
@@ -1748,7 +1750,7 @@
              (c-backward-syntactic-ws))
            (setq name-end (point))
            (c-backward-token-2)
-           (buffer-substring-no-properties (point) name-end))))))))
+             (buffer-substring-no-properties (point) name-end)))))))))
 
 (defun c-declaration-limits (near)
   ;; Return a cons of the beginning and end positions of the current




reply via email to

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