如何将超链接复制到emacs? [英] how to copy hyperlinks to emacs?

查看:133
本文介绍了如何将超链接复制到emacs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将超链接的文本从外部文件(例如word(.doc)文件)复制到具有超链接的Emacs?如果我将100个超链接的文章从单词复制到Emacs,并且必须重新输入每个超链接可能非常烦人。

Is it possible to copy a text with hyperlink from external files (e.g., word(.doc) file) to Emacs with hyperlink preserved? it could be very annoying if I copy an articles with 100 hyperlinks from word to Emacs and have to re-input each hyperlink

这样的功能似乎从香草Emacs中无法使用,我对Emacs很新,所以我希望有人能提出一个简单的功能来实现。

Such function seems to be unavailable from the vanilla Emacs, and I am pretty new to Emacs, so I wish somebody here can come up with a simple function to enable that.

谢谢

推荐答案

为了使超链接正常工作实际的超链接被隐藏,here一词被强调/突出显示,并且可以通过鼠标或键盘快捷键和/或 Mx 函数调用可点击,在emac中需要使用其中一种模式它支持这样的行为:

In order for the hyperlink to work (meaning the actual hyperlink is hidden and the word "here" is emphasized/highlighted and is "clickable" by either mouse or keyboard shortcut and/or M-x function call) in emacs you need to use one of the modes which support such a behavior:


  • 组织模式,这是一种主要模式,并且具有大量功能的非常实质的软件包。创建一个文件,使用 .org 扩展名,将链接的URL复制到那里,并变成活。您可以通过在光标位于链接上单击 C-c C-l 来编辑它,以便隐藏该URL,然后确认该URL并添加描述 - 此处。之后,该URL被隐藏,并且这里被突出显示并可点击。

  • Org mode which is a major mode and a very substantial package with a ton of functionality. Create a file with .org extension, copy the link's url there and it becomes "live". You can edit it to hide the url by clicking C-cC-l while your cursor is on the link, then confirm the url and add description - the "here" word. After that the url becomes hidden and "here" becomes highlighted and clickable.

其中一个维基模式,有主要和次要模式(所以你可以尝试使用具有各种主要模式的文件中的功能)。请参阅链接了解详情。

One of the Wiki modes, there are both major and minor modes (so you can try using the functionality in files having various major modes). Please consult the link for details.

如果您不想使用其他软件包,这里是关于如何使任意文本可点击的文档,但您需要对一些精灵编程感到舒适。

If you would rather not use additional packages, here is the documentation on how to make arbitrary text clickable but you would need to be comfortable with some elisp programming.

更新:

我看到你需要大量导入urs emacs的。问题是不完整的支持多格式剪贴板内容(例如,当您从网络浏览器复制时)创建的内容在emacs中。根据 http://www.mail-archive.com /help-emacs-windows@gnu.org/msg03026.html 不支持HTML内容,所以它被粘贴到emacs作为纯文本。我看到的唯一方法是在浏览器中打开页面源,将其保存到文件中,使用xsltproc或其他任何方式提取url列表(如果需要的话),并将url转换为org-mode样式链接xsltproc或emacs regex search / replace)。不幸的是,没有我知道的html到org转换器。

I see that you need the bulk import of urs to emacs. The problem is with incomplete support of the multi-format clipboard content (which is created, for instance, when you copying from a web browser) in emacs. According to http://www.mail-archive.com/help-emacs-windows@gnu.org/msg03026.html there is no support for HTML content so it gets pasted to emacs as plain text. The only way I see is to open the page source in the browser, save it to file, extract list of urls (and surrounding text if you needed it) using xsltproc or whatever and convert the urls to org-mode style links (also with xsltproc or emacs regex search/replace). Unfortunately there is no html-to-org converter that I know of.

这篇关于如何将超链接复制到emacs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆