Perforce 和 Emacs

发布于 2024-09-16 02:03:03 字数 807 浏览 5 评论 0原文

我希望设置 emacs 以允许我使用 perforce 而不必使用 p4v。

我查看了 emacs wiki 并搜索了 网站但似乎只有两个选项 - 两个其中相当旧。第一个选项是 p4.el,最后更新于 2004 年。第二个选项是 与 emacs VC 组件的集成,最后更新于 2007 年 8 月。

上面的第二个链接来自 SO 似乎建议使用 p4.el。这仍然是推荐的建议吗?有人可以分享任何提示或技巧吗?

非常感谢任何帮助\建议。

克里斯

I'm looking to setup emacs to allow me to use perforce without having to use p4v.

I've had a look at the emacs wiki and a search on the site but there only seems to be two options out there - both of which are pretty old. First option is p4.el which was last updated in 2004. The second option is the integration with emacs VC component, last updated in August 2007.

The second link above from SO seems to suggest using p4.el. Is that still the recommended advice? Does anyone have any tips or tricks they can share?

Any help \ advice much appreciated.

Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吃素的狼 2024-09-23 02:03:03

是的,p4.el 仍然是将 perforce 集成到 emacs 的推荐方法。它实施得很好,这解释了为什么它自 2004 年以来就没有更新过。

我定制了一些东西,主要是添加和禁用一些快捷方式。

我还添加了从 emacs 调用一些 p4v 命令的可能性

(defun invoke-p4v-cmd (cmd)
  (let ((file (if (equal major-mode 'dired-mode)
                  (dired-get-file-for-visit)
                (buffer-file-name))))
    (when file
      (shell-command (concat "\"c:/Program Files/Perforce/p4v.exe\" -cmd \"" cmd " " file "\" &")))))

(defun op:p4v-timelapse ()
  "show revision tree"
  (interactive)
  (invoke-p4v-cmd "annotate"))

(define-key p4-prefix-map "T" 'op:p4v-timelapse)


(defun op:p4v-tree ()
  "show revision tree"
  (interactive)
  (invoke-p4v-cmd "tree"))

(define-key p4-prefix-map "g" 'op:p4v-tree)

(defun op:p4v-history ()
  "Show history"
  (interactive)
  (invoke-p4v-cmd "history"))

(define-key p4-prefix-map "x" 'op:p4v-history)

Yes, p4.el is still a recommended way to integrate perforce into emacs. It was well implemented which explains why it hasn't been updated since 2004.

I customized a couple of things, mostly to add and disable some shortcuts.

I added a possibility to call some p4v commands from emacs as well

(defun invoke-p4v-cmd (cmd)
  (let ((file (if (equal major-mode 'dired-mode)
                  (dired-get-file-for-visit)
                (buffer-file-name))))
    (when file
      (shell-command (concat "\"c:/Program Files/Perforce/p4v.exe\" -cmd \"" cmd " " file "\" &")))))

(defun op:p4v-timelapse ()
  "show revision tree"
  (interactive)
  (invoke-p4v-cmd "annotate"))

(define-key p4-prefix-map "T" 'op:p4v-timelapse)


(defun op:p4v-tree ()
  "show revision tree"
  (interactive)
  (invoke-p4v-cmd "tree"))

(define-key p4-prefix-map "g" 'op:p4v-tree)

(defun op:p4v-history ()
  "Show history"
  (interactive)
  (invoke-p4v-cmd "history"))

(define-key p4-prefix-map "x" 'op:p4v-history)
缘字诀 2024-09-23 02:03:03

我在 https 上启动了 p4.el 的新分支://github.com/gareth-rees/p4.el,如果您是一个勇敢的 Emacs 用户并且不介意偶尔出现的错误,您可能会想尝试一下。 (向我发送包含错误修复的拉取请求!)我一直致力于在 Perforce 服务器可能间歇性可用的情况下(例如通过移动数据连接工作时)的响应能力。特别是,我已将大部分用户操作设为异步,因此工作很少会因等待 Perforce 服务器响应而被阻塞。

我还添加了对新 Perforce 功能(例如 p4 statusp4 annotate)的支持,修复错误并实现代码现代化。 这是一个关于我迄今为止所取得的成就的博客。

I've started a new fork of p4.el at https://github.com/gareth-rees/p4.el, and if you're a brave Emacs user who doesn't mind the occasional bug, you might want to give it a go. (Send me pull requests with your bug fixes!) I've been working on responsiveness in situations where the Perforce server might be intermittently available, such as when working over a mobile data connection. In particular, I've made the majority of user operations asynchronous, so that work is rarely blocked waiting for the Perforce server to respond.

I'm also adding support for new Perforce features like p4 status and p4 annotate, fixing bugs, and modernizing the code. Here's a blog about what I've achieved so far.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文