New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-log-current-defun doesn't work with Go code #253

Open
zvbuhl opened this Issue Jul 24, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@zvbuhl

zvbuhl commented Jul 24, 2018

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.

@zvbuhl zvbuhl changed the title from magit-log-trace-definition doesn't work with Go code to add-log-current-defun doesn't work with Go code Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment