[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy a link + hyperlink & text

From: Emanuel Berg
Subject: Re: copy a link + hyperlink & text
Date: Fri, 03 Jun 2016 23:32:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Sharon Kimble <address@hidden>

> How can I copy a link with the text and the
> hyperlink all at once from either emacs w3m
> or from gnus please? Preferably all with one
> keypress? It will be pasted into a org-mode
> document as its destination.

I have a DWIM function to do that. If point is
at a link, it gets (kills) the link's
destination (the URL). If there is a literal
URL at point, it gets that. If nothing, it gets
the URL of the current w3m buffer.

For Gnus - perhaps it works there as well! (the
literal stuff) - otherwise it is a good idea to

    (defun w3m-kill-url-dwim ()
      (let ((anchor-url (w3m-anchor)))
        (if anchor-url (kill-new anchor-url)
          (let ((literal-url (thing-at-point 'url)))
            (if literal-url (kill-new literal-url)
              (kill-new w3m-current-url) ))))
      (message "killed: %s" (current-kill 0)) )

Code in context:

Bind it to "s" and "u":

Don't thank me - I'll send an invoice :)

underground experts united ....
Emacs Gnus Blogomatic .........
                   - so far: 45 Blogomatic articles -                   

reply via email to

[Prev in Thread] Current Thread [Next in Thread]