help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: help reading assembly code


From: Peter Münster
Subject: Re: help reading assembly code
Date: Thu, 27 Oct 2011 00:10:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

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 via email to

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