简体   繁体   English

Emacs,快速跳转和运行模式:导航过程中点未更新

[英]Emacs, quick-jump and go-mode: point not updated during navigation

I want to combine the go-mode godef-jump with quick-jump, such that I drop a marker both before and after the jump. 我想将go-mode godef-jump与quick-jump结合使用,以便在跳转之前和之后都放一个标记。

(defun my-go-quick-jump-push-def-hook (pnt)
  (interactive "d")
  (message "%s %d" (buffer-name) pnt)
  (quick-jump-push-marker)
  (godef-jump pnt)
  (quick-jump-push-marker)
  (message "%s %d" (buffer-name) (point))
)

(defun my-go-mode-hook ()
  (local-set-key (kbd "M-.") 'my-go-quick-jump-push-def-hook)
)

However, the message calls indicate that the buffer has not been updated after the call to godef-jump completes, and nor does (point) give a different value from pnt . 但是, message调用指示对godef-jump的调用完成后,缓冲区尚未更新,并且(point)也没有提供与pnt不同的值。 But godef-jump does complete and does change the buffer where necessary. 但是godef-jump确实完成了,并且确实在必要时更改了缓冲区。 So something's up with the evaluation order that I can't figure out - it's almost like the actual navigation is going on lazily. 因此,我无法弄清楚评估顺序的问题-就像实际的导航正在缓慢进行一样。 Is this expected or is this something odd that go-mode is doing? 这是预期的还是go-mode所做的事情有些奇怪?

go-mode is at https://github.com/dominikh/go-mode.el/blob/master/go-mode.el , quick-jump is at http://www.emacswiki.org/emacs/quick-jump.el go-mode位于https://github.com/dominikh/go-mode.el/blob/master/go-mode.el ,快速跳转位于http://www.emacswiki.org/emacs/quick- jump.el

Many thanks. 非常感谢。

Update: this problem seems to only happen when the jump is to a different buffer. 更新:这个问题似乎仅在跳转到另一个缓冲区时才会发生。 I don't know enough about with-current-buffer (used in godef--find-file-line-column ) to understand what's going wrong - my reading of the docs is that with-current-buffer shouldn't cause that buffer to be activated at all once the body completes, so I'm at a loss to understand why godef-jump works at all... 我对with-current-buffer不太了解(用于godef--find-file-line-column ),以了解出了什么问题-我阅读的文档是with-current-buffer不应导致该缓冲区一旦身体完成就被激活,所以我茫然地理解为什么godef-jump起作用...

Answering my own question, basically, see the PR I made, and the discussion: https://github.com/dominikh/go-mode.el/pull/85 基本上回答我自己的问题,请参阅我进行的PR和讨论: https : //github.com/dominikh/go-mode.el/pull/85

The problem was specific to go-mode, and has now been fixed there. 该问题特定于运行模式,现在已在此处解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM