all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: PJ Weisberg <pj@irregularexpressions.net>
To: help-gnu-emacs@gnu.org, jidanni@jidanni.org
Subject: Re: shortest amount of keystrokes to see URL in an external browser
Date: Fri, 24 Jun 2011 18:15:11 -0700	[thread overview]
Message-ID: <BANLkTi=xAfvckQL26w7RNVasGuhuWR-XzA@mail.gmail.com> (raw)
In-Reply-To: <87wrgau6bx.fsf@jidanni.org>

On Fri, Jun 24, 2011 at 5:01 PM,  <jidanni@jidanni.org> wrote:
>>>>>> "PW" == PJ Weisberg <pj@irregularexpressions.net> writes:
> PW> If you got as far as looking at the code for `find-file-at-point',
> PW> perhaps it occurred to you to customize `ffap-url-fetcher' to
> PW> `browse-url-firefox'?  :-)
> Yes I do similar things in http://jidanni.org/comp/configuration/.emacs
> I'm just wanting a way to have an external browser function be at the
> most just one more keystroke than the internal browser function.
>
> I.e., I want C-x C-f to call the internal browser function,
> and      C-u C-x C-f to call the external browser function.
> Or some other key
>             C-? C-? to call the external browser function.
> And with the massive complication of also wanting the power of FFAP,
> it is not kid stuff, but also not senior stuff, or senior stiff, which
> is where I'm headed...

It sounds like you don't want to "re-engineer" the whole thing; you
just want to appropriate the prefix argument for your own purposes.
Exactly like `find-file-at-point' does to `ffap-file-finder'. ;-)

So, along those lines, something like:

(defun my-ffap (&optional filename)
  (interactive)
  (let ((ffap-url-fetcher (if current-prefix-arg
                              #'browse-url-firefox
                            ffap-url-fetcher))
        (current-prefix-arg nil))
    (find-file-at-point filename)))

should do the trick.



  reply	other threads:[~2011-06-25  1:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.102.1308507902.785.help-gnu-emacs@gnu.org>
2011-06-24 23:14 ` shortest amount of keystrokes to see URL in an external browser jidanni
2011-06-24 23:34   ` PJ Weisberg
2011-06-25  0:01     ` jidanni
2011-06-25  1:15       ` PJ Weisberg [this message]
2011-06-25  2:44         ` jidanni
2011-06-24 23:15 ` jidanni
2011-06-24 23:36   ` Richard Riley
2011-06-19 11:12 jidanni
2011-06-19 18:24 ` Eric Abrahamsen

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='BANLkTi=xAfvckQL26w7RNVasGuhuWR-XzA@mail.gmail.com' \
    --to=pj@irregularexpressions.net \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jidanni@jidanni.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.