From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Is Emacs very alive, active and improving? Date: Thu, 29 Aug 2013 05:06:47 +0200 Organization: Aioe.org NNTP Server Message-ID: <87y57lmbz3.fsf@nl106-137-194.student.uu.se> References: <87r4ddo4yp.fsf@nl106-137-194.student.uu.se> <874na9nr1y.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1377745940 25743 80.91.229.3 (29 Aug 2013 03:12:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Aug 2013 03:12:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 29 05:12:24 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VEsej-0003PQ-Qp for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Aug 2013 05:12:21 +0200 Original-Received: from localhost ([::1]:39590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEsej-00034r-Cb for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Aug 2013 23:12:21 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: VVbyYd/iFZoeWNmD9i++cQ.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:knVvCIVGMR9AvP0ra8LUN6UP3MI= Original-Xref: usenet.stanford.edu gnu.emacs.help:200885 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93153 Archived-At: Emanuel Berg writes: > I wrote something cool recently to make Wikipedia searches from > Emacs. It is actually only the last couple of lines that do it - > the rest is just fancy stuff - it will default to the region, if > there is one, or the word at point, and it will show it if it > isn't too long, etc. Anyhow: Made some improvements. First, it is not "search", it is "show". Second, now it doesn't show "(nil)" in the PS when there isn't a default (neither region or word at point). (defun wiki-article (str) "Show the Wikipedia article STR, the \"printable\" version." (interactive (let*((default-search (if (region-active-p) (region-to-string) (thing-at-point 'word) )) (max-len 20) (peek (if (> (length default-search) max-len) (format "%s..." (substring default-search 0 max-len) ) default-search) ) (ps " article")) (list (read-string (if peek (format "%s (%s): " ps peek) (format "%s: " ps)) nil nil default-search )))) (w3m-new-tab) (w3m (format "https://en.wikipedia.org/w/index.php?title=%s\&printable=yes" str) )) -- Emanuel Berg - programmer (hire me! CV below) computer projects: http://user.it.uu.se/~embe8573 internet activity: http://home.student.uu.se/embe8573