From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Re: Why emacsclient -e "(current-word nil t)" does not print ? Date: Wed, 22 Jul 2009 09:19:38 +0300 Organization: A noiseless patient Spider Message-ID: <87iqhlxmrp.fsf@iki.fi> References: <87r5waa3t8.fsf@galatea.local> <7cskgqjm0s.fsf@pbourguignon.informatimago.com> <7ck522jh0n.fsf@pbourguignon.informatimago.com> <7cy6qihxdo.fsf@pbourguignon.anevia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248244854 11928 80.91.229.12 (22 Jul 2009 06:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jul 2009 06:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 22 08:40:47 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MTVVL-0005Ix-VI for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Jul 2009 08:40:44 +0200 Original-Received: from localhost ([127.0.0.1]:33882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTVVL-0004CW-8x for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Jul 2009 02:40:43 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.esat.net!feeder.news.heanet.ie!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 20 Original-X-Trace: news.eternal-september.org U2FsdGVkX18Mfi5COuKj1Je8zlasyfbKV9MOFJr7pivs5+c09QIZNGAH8Cjz6QRDOJDH7iGuSQPaXHzP8IMBgwJT6eOZtvs86ZLJFguuZaoHD11HJNeLHYmMsjs1QYbkN0NYMI6IvXEpc71ZGKNBQg== Original-X-Complaints-To: abuse@eternal-september.org Original-NNTP-Posting-Date: Wed, 22 Jul 2009 06:26:14 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/YwbsqtIFtDyUmPgEwHvki7TEeUkcgl7B3PlulYMw+GQ== Cancel-Lock: sha1:59b8LFxBmD3gOtZzsQ3fmtDfdR0= sha1:vXnwKNtUN4awka9jDiXlN28zsVU= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:171144 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66334 Archived-At: On 2009-07-22 13:14 (+0800), Wang Lei wrote: > On 7/21/09, Pascal J. Bourguignon wrote: >> Wang Lei writes: >>> Here, I wanted to say I have tried to write a external program, that >>> gets the emacs' current word with emacsclient and send it to sdcv to >>> search. This is part of the whole function, the rest is to get it >>> from selection or prompt for. But now, it looks like i can not >>> integrate the emacs-part. >> >> (You could, but you must know what buffer you want.) > Actually, I don't know. I want the program can get any word in any > application to search. In applications like browser you have to rely > selection, but in emacs "mark" or "current-word" should be better. How about using the selected window? Its buffer can be obtained with Emacs client: emacsclient -e '(with-current-buffer (window-buffer (selected-window)) (current-word))'