Commit 42b1fc29 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(add-log-current-defun) <lisp>:

If element 1 of the defun is a list, use first symbol
within it (the car of the car.... of it).
parent bfce6476
......@@ -491,18 +491,22 @@ Has a preference of looking backwards."
(or (eobp) (forward-char 1))
(beginning-of-defun)
;; Make sure we are really inside the defun found, not after it.
(if (and (looking-at "\\s(")
(progn (end-of-defun)
(< location (point)))
(progn (forward-sexp -1)
(>= location (point))))
(progn
(if (looking-at "\\s(")
(forward-char 1))
(forward-sexp 1)
(skip-chars-forward " '")
(buffer-substring (point)
(progn (forward-sexp 1) (point))))))
(when (and (looking-at "\\s(")
(progn (end-of-defun)
(< location (point)))
(progn (forward-sexp -1)
(>= location (point))))
(if (looking-at "\\s(")
(forward-char 1))
;; Skip the defining construct name, typically "defun"
;; or "defvar".
(forward-sexp 1)
;; The second element is usually a symbol being defined.
;; If it is not, use the first symbol in it.
(skip-chars-forward " '(")
(buffer-substring (point)
(progn (forward-sexp 1)
(point)))))
((and (memq major-mode add-log-c-like-modes)
(save-excursion
(beginning-of-line)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment