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

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

Re: autoinfo.el --- show automatic information for the current selection


From: S . P . Tseng
Subject: Re: autoinfo.el --- show automatic information for the current selection
Date: Tue, 06 May 2008 14:31:55 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

"address@hidden" <address@hidden> writes:

> Here's a proof-of-concept implementation a little idea of mine for
> effortless information lookup. No hotkeys and stuff needed.
>
> Screenshot: http://img152.imageshack.us/my.php?image=autoinfopk2.jpg
>
> Code: http://www.emacswiki.org/cgi-bin/wiki/autoinfo.el

That's useful.
;; It can display unicode with `w3m-decode-entities-string'.
(defun autoinfo-handle-google-response (status)
  "Handle response returned by Google."
  (message "")
  (let ((response (buffer-string)))
    (funcall autoinfo-show-result-function
             (if (string-match "Definitions of.*?\\(<li>.*?\\)<br>" response)
                 (let ((results (match-string 1 response)))
                   (concat "Definitions by Google:\n"
                   (w3m-decode-entities-string
                         (replace-regexp-in-string "<li>" "\n- " results))))

                 "No definition found"))))


-- 
The opposite of love is not hate;
the opposite of love is solitude.


reply via email to

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