unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: pmlists@free.fr (Peter Münster)
To: help-gnu-emacs@gnu.org
Subject: Re: help reading assembly code
Date: Thu, 27 Oct 2011 00:10:55 +0200	[thread overview]
Message-ID: <87aa8n1k0g.fsf@micropit.couberia.bzh> (raw)
In-Reply-To: 87pqhm8tev.fsf@gmail.com

On Mon, Oct 24 2011, Andrea Crotti wrote:

> For example it would be nice to have some function which shows me a
> reference documentation given the operator.

Hello,

If you know how to build the right url to the documentation of a given
operator, you can just replace the google url with the right one in the
following code:

--8<---------------cut here---------------start------------->8---
(defun pm/region-or-word (prompt)
  "Read a string from the minibuffer, prompting with PROMPT.
If `transient-mark-mode' is non-nil and the mark is active,
it defaults to the current region, else to the word at or before
point. This function returns a list (string) for use in `interactive'."
  (list (read-string prompt (or (and transient-mark-mode mark-active
                                     (buffer-substring-no-properties
                                      (region-beginning) (region-end)))
				(current-word)))))

(defun pm/google (string)
  "Ask a WWW browser to google string.
Prompts for a string, defaulting to the active region or the current word at
or before point."
  (interactive (pm/region-or-word "Google: "))
  (browse-url (concat "http://google.com/search?num=100&q=" string)))
--8<---------------cut here---------------end--------------->8---

-- 
           Peter




  reply	other threads:[~2011-10-26 22:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 12:29 help reading assembly code Andrea Crotti
2011-10-26 22:10 ` Peter Münster [this message]
     [not found] <mailman.947.1319459367.15868.help-gnu-emacs@gnu.org>
2011-10-24 20:38 ` Pascal J. Bourguignon
2011-10-25  2:25   ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2011-10-25 15:43 Buchs, Kevin
2011-10-26 14:35 ` Andrea Crotti

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87aa8n1k0g.fsf@micropit.couberia.bzh \
    --to=pmlists@free.fr \
    --cc=help-gnu-emacs@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 read-only IMAP folder(s) and NNTP newsgroup(s).