Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Hadron <hadronquark@gmail.com>
To: info-gnus-english@gnu.org
Subject: Re: How to copy URL's to clipboard?
Date: Sun, 15 Jul 2007 19:16:56 +0200	[thread overview]
Message-ID: <87lkdhegdz.fsf@gmail.com> (raw)
In-Reply-To: <b4m3aztylqo.fsf@jpl.org>

Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>>> Katsumi Yamaoka wrote:
>
>> For such a link expressed with a plain text, you can bind the
>> same key to just the function `browse-url-firefox'.  For example:
>
> I forgot to write the way to map the `vv' key to `browse-url-firefox'
> also in emacs-w3m buffers.  Here it is:
>
> (define-key w3m-mode-map "v" (make-sparse-keymap))
> (define-key w3m-mode-map "vb" 'w3m-bookmark-view)
> (define-key w3m-mode-map "vv"
>   (lambda nil
>     (interactive)
>     (let* ((w3m-content-type-alist (copy-sequence w3m-content-type-alist))
> 	   (html (cdr (assoc "text/html" w3m-content-type-alist))))
>       (setq w3m-content-type-alist (delq html w3m-content-type-alist))
>       (setq html (copy-sequence html))
>       ;; Make sure to use Firefox.
>       (setcar (nthcdr 2 html) 'browse-url-firefox)
>       (push html w3m-content-type-alist)
>       (w3m-external-view-this-url))))
>
> This should be added to your ~/.emacs-w3m.el file, not anywhere else.
> Note that it remaps the key for the `w3m-bookmark-view' command into
> `vb'.  I think customizing too much the keymap is not a good idea,
> though.  In emacs-w3m buffers, you can use the `M' command instead.

I got what I wanted with this:

,----
| (defun my-w3m-view-this-url()
|   (interactive)
|   (let ((w3m-goto-article-function 'browse-url))
|     (w3m-safe-view-this-url)))
| 
| (global-set-key (quote [f4]) 'browse-url)
| (define-key w3m-mode-map [f4] 'my-w3m-view-this-url)
`----

      reply	other threads:[~2007-07-15 17:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 13:13 Svend Tollak Munkejord
2007-07-10 22:16 ` Katsumi Yamaoka
2007-07-11  6:51   ` Svend Tollak Munkejord
2007-07-11 15:31   ` Hadron
2007-07-11 22:49     ` Katsumi Yamaoka
2007-07-12  9:34       ` Hadron
2007-07-12 11:18         ` Katsumi Yamaoka
2007-07-12 12:33           ` Hadron
2007-07-12 23:24             ` Katsumi Yamaoka
2007-07-13  4:24               ` Katsumi Yamaoka
2007-07-15 17:16                 ` Hadron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lkdhegdz.fsf@gmail.com \
    --to=hadronquark@gmail.com \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).