我想在 org-mode 源代码块的源代码注释中插入一个链接。例如:
#+BEGIN_SRC emacs-lisp
;this is the comment part, I want to insert a clickable link here.
#+END_SRC
我试过
src_org{[[link][description]]}
,但这不起作用。
最佳答案
组织模式可点击链接通常使用 C-c C-o
激活。 ( org-open-at-point
) 或用鼠标单击链接 ( org-open-at-mouse
)。请注意,这两个命令都不是特定于 URL 的;像大多数 Org 一样,它们的功能取决于它们的使用上下文。在代码块内,这些命令执行代码块。src_<language>{}
内联代码块语法不能用于将 Org 代码嵌入代码块中。
一种解决方法是使用 browse-url
虽然点位于您要访问的 URL 上:
;; Does something interesting, see http://google.com/
;; ^^^^^^^^^^^^^^^^^^
;; With point at any of these positions
当然,您可以将此命令绑定(bind)到您想要的任何键。
来自
C-h f browse-url
:Ask a WWW browser to load URL.
Prompts for a URL, defaulting to the URL at or before point. Variable
browse-url-browser-function
says which browser to use. If the URL is a mailto: URL, consultbrowse-url-mailto-function
first, if that exists.
关于emacs - 源代码块中的组织模式插入链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21275584/