]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Fix bug #39972, by fixing c-display-defun-name for nested defuns
authorAlan Mackenzie <acm@muc.de>
Wed, 20 May 2020 19:02:26 +0000 (19:02 +0000)
committerAlan Mackenzie <acm@muc.de>
Wed, 20 May 2020 19:05:14 +0000 (19:05 +0000)
* lisp/progmodes/cc-mode.el (c-common-init): Build
add-log-current-defun-function out of c-defun-name-and-limits instead of the
former c-defun-name.

lisp/progmodes/cc-mode.el

index d822788bee27d20c9bc355dce40177d3bac89449..b3b2374805db45caf8d754b19859231be51aa913 100644 (file)
@@ -795,7 +795,7 @@ compatible with old code; callers should always specify it."
   (set (make-local-variable 'outline-level) 'c-outline-level)
   (set (make-local-variable 'add-log-current-defun-function)
        (lambda ()
-        (or (c-cpp-define-name) (c-defun-name))))
+        (or (c-cpp-define-name) (car (c-defun-name-and-limits nil)))))
   (let ((rfn (assq mode c-require-final-newline)))
     (when rfn
       (if (boundp 'mode-require-final-newline)