emacs - 源代码块中的组织模式插入链接

标签 emacs publish org-mode

我想在 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, consult browse-url-mailto-function first, if that exists.

关于emacs - 源代码块中的组织模式插入链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21275584/

相关文章:

azure - 从 azure pipelines 构建的 setup.exe 每次运行都会提示 .NET Framework 4.7.2

emacs - 使用 ox-publish 导出,无法将变量分配给关键字

emacs - Org-Mode Babel,代码块 : Can I set defaults? 的开关

emacs 术语模式无法识别命令

Emacs:在 Dropbox 目录中使用 init.el 启动 Emacs

android - 我可以在发布后更改应用程序的屏幕截图吗?

asp.net-mvc - 发布 .NET Core 应用程序时出现错误 "Could not find a part of the path"

emacs - 从组织模式导出工作量和时钟总和?

emacs - transient 标记模式永久开启

emacs - SLIME、SBCL 和 EMACS 设置未产生预期的输出