emacs

how to copy hyperlinks to 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

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.

thanks


Solution

  • 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:

    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.

    UPDATE:

    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.