emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/progmodes/cc-cmds.el,v


From: Alan Mackenzie
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/cc-cmds.el,v
Date: Fri, 17 Oct 2008 20:24:46 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Alan Mackenzie <acmacm> 08/10/17 20:24:45

Index: cc-cmds.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-cmds.el,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- cc-cmds.el  13 Oct 2008 18:34:05 -0000      1.74
+++ cc-cmds.el  17 Oct 2008 20:24:45 -0000      1.75
@@ -1704,17 +1704,16 @@
 
        ;; Pick out the defun name, according to the type of defun.
        (cond
+         ;; struct, union, enum, or similar:
         ((and (looking-at c-type-prefix-key)
               (progn (c-forward-token-2 2) ; over "struct foo "
-                     (eq (char-after) ?\{)))
-         ;; struct, union, enum, or similar:
-         (c-backward-syntactic-ws)
-         (setq name-end (point))
-         (buffer-substring-no-properties
-          (progn
-            (c-backward-token-2 2)
-            (point))
-          name-end))
+                     (or (eq (char-after) ?\{)
+                         (looking-at c-symbol-key)))) ; "struct foo bar ..."
+         (save-match-data (c-forward-token-2))
+         (when (eq (char-after) ?\{)
+           (c-backward-token-2)
+           (looking-at c-symbol-key))
+         (match-string-no-properties 0))
 
         ((looking-at "DEFUN\\_>")
          ;; DEFUN ("file-name-directory", Ffile_name_directory, 
Sfile_name_directory, ...) ==> Ffile_name_directory




reply via email to

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