]> 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>
Fri, 22 May 2020 09:43:02 +0000 (09:43 +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 fd7750b0d82fd2f1d3e5c11b4b54cbf72490c697..066bec60091341b74053509d87fcea59da501099 100644 (file)
@@ -770,7 +770,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)