You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add-log-current-defun doesn't know how Go code is formatted. Fortunately, there's a variable add-log-current-defun-function, which can be used to integrate with Go mode:
(defun go-current-def-name ()
"Return the name of the function at point, or nil."
(save-excursion
(go-goto-function-name)
;; get the next word
(buffer-substring-no-properties (point)
(progn (forward-sexp 1)
(point)))))
(add-hook 'go-mode-hook (lambda ()
(setq add-log-current-defun-function #'go-current-def-name)))
It'd be great to have this (or something slightly smarter) added to Go mode.
The text was updated successfully, but these errors were encountered:
robert-uhl
changed the title
magit-log-trace-definition doesn't work with Go code
add-log-current-defun doesn't work with Go code
Jul 25, 2018
Interesting. It does look like most progmodes set the add-log-current-defun-function. Are you depending on this behavior for (add-change-log-entry) or for something else?
add-log-current-defun
doesn't know how Go code is formatted. Fortunately, there's a variableadd-log-current-defun-function
, which can be used to integrate with Go mode:It'd be great to have this (or something slightly smarter) added to Go mode.
The text was updated successfully, but these errors were encountered: