From: Alan Mackenzie Date: Wed, 20 May 2020 19:02:26 +0000 (+0000) Subject: CC Mode: Fix bug #39972, by fixing c-display-defun-name for nested defuns X-Git-Tag: emacs-28.0.90~7309 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5989432d15feb4439e759d2c0e28233ca22a7604;p=emacs.git CC Mode: Fix bug #39972, by fixing c-display-defun-name for nested defuns * 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. --- diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index d822788bee2..b3b2374805d 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -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)