如何在点击shell/elisp类型的link时,不要弹出确认窗口.
默认情况下,调用`org-open-at-point’打开shell/elisp link时会弹出确认窗口,太麻烦.
好在org提供了`org-confirm-shell-link-not-regexp’和`org-confirm-elisp-link-not-regexp’两个变量用于指定打开那些shell/elisp link时不用确认直接打开.
例如,下面的代码表示所有的elisp link都不需要确认就直接打开,所有以mstsc开头的shell link也不需要确认就可以直接打开.
(setq org-confirm-elisp-link-not-regexp ".")
(setq org-confirm-shell-link-not-regexp "^mstsc")
调用`org-open-at-point’还可能打开新的org shell output buffer,可以加个advise忽略它
(defun org-open-at-point-without-shell-output-buffer-advise (ori_fn &rest args)
""
(save-window-excursion
(apply ori_fn args)))
(advice-add 'org-open-at-point :around #'org-open-at-point-without-shell-output-buffer-advise)
本文详细介绍了如何通过设置变量`org-confirm-elisp-link-not-regexp’和`org-confirm-shell-link-not-regexp’来避免在点击shell/elisp链接时弹出确认窗口,并提供了一个自定义函数`org-open-at-point-without-shell-output-buffer-advise’来进一步优化此过程。

被折叠的 条评论
为什么被折叠?



