linux - 多缓冲区可以有自己的 etags 标记堆栈吗?

标签 linux emacs etag

似乎 etags 使用全局标记堆栈。

当我打开两个使用相同 TAGS 的缓冲区时,我在一个缓冲区 (A) 中执行 find-tags 操作,然后在另一个缓冲区中执行 find-tags 操作缓冲区(B)。我切换回之前的缓冲区 (A) 并执行 pop-tag-mark 操作。它将跳回缓冲区 B 的前一个标记!

有什么办法可以解决这个问题吗?

最佳答案

首先,这完全是设计使然。如果您在文件中跳转,imenu 更合适。

现在让我们尝试修改设计:

(defun my-pop-tag-mark (arg)
  "call `pop-tag-mark' without argument.

Pop to the next mark in the current buffer wit C-u prefix."
  (interactive "P")
  (when (consp arg)
    (let ((buf (current-buffer))
          index)
      (loop for marker in (ring-elements find-tag-marker-ring)
            for i from 0 below (ring-length find-tag-marker-ring)
            do (when (eq (setq temp (marker-buffer marker))
                         (current-buffer))
                 (setq index i)
                 (return)))
      (if index
          (ring-insert find-tag-marker-ring (ring-remove find-tag-marker-ring index))
        (error "no marker found in current buffer."))))
  (pop-tag-mark))

关于linux - 多缓冲区可以有自己的 etags 标记堆栈吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9694682/

相关文章:

emacs - 如何使用align.el和 `align-current`轻松对齐let表单

emacs - 如何在Emacs term-mode中阻止npm的彩色输出看起来难看?

android - 改造 ETAG 和缓存

node.js - Express.js 的自定义计算 Etag

linux - spin_lock 和 spin_unlock 是否会影响单 cpu 机器上 SMP 内核的性能?

linux - 尝试在 Ubuntu 上运行 .net Core HelloWorld 控制台应用程序

c - 是否可以在线程中使用退出?

shell - 是否可以从 emacs 向 xterm 发送 'cd' 命令?

node.js - etag 中的 W/in 从哪里出现?

Linux 64-abi,调用约定