代码之家  ›  专栏  ›  技术社区  ›  Techniquab

找不到Magit定义弹出选项

  •  0
  • Techniquab  · 技术社区  · 7 年前

    在某个时刻,我设法为magit pull弹出窗口添加了一个选项。

    这一行最后出现在我的.emacs中(我认为在某个时刻起作用):

    (magit-define-popup-option 'magit-pull-popup
      ?s "recurse submodules" "--recurse-submodules=yes")
    

    现在我得到:

    eval: Symbol’s function definition is void: magit-define-popup-option
    

    我觉得电话是正确的,根据: https://github.com/magit/magit/wiki/Additional-proposed-infix-arguments-and-suffix-commands

    (magit-define-popup-option 'magit-commit-popup
      ?D "Override the author date" "--date=" #'read-from-minibuffer)
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   phils    7 年前

    在定义函数之前不能调用它。

    (with-eval-after-load "magit-commit"
      (magit-define-popup-option 'magit-commit-popup
        ?D "Override the author date" "--date=" #'read-from-minibuffer))
    

    N.B. "magit-popup" 是定义 magit-define-popup-option 函数,但我假设您只想在 "magit-commit" 已加载(此时已定义您特别感兴趣的弹出窗口)。