From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wang Lei Newsgroups: gmane.emacs.help Subject: Re: Why emacsclient -e "(current-word nil t)" does not print ? Date: Tue, 21 Jul 2009 21:01:08 +0800 Message-ID: References: <87r5waa3t8.fsf@galatea.local> <7cskgqjm0s.fsf@pbourguignon.anevia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1248181798 24386 80.91.229.12 (21 Jul 2009 13:09:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jul 2009 13:09:58 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Pascal J. Bourguignon" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 21 15:09:51 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 1MTF6N-0006gF-5I for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jul 2009 15:09:51 +0200 Original-Received: from localhost ([127.0.0.1]:37390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTF6M-0001jA-KN for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Jul 2009 09:09:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTEy3-0005Fb-Fn for help-gnu-emacs@gnu.org; Tue, 21 Jul 2009 09:01:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTExy-0005D4-99 for help-gnu-emacs@gnu.org; Tue, 21 Jul 2009 09:01:14 -0400 Original-Received: from [199.232.76.173] (port=45607 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTExy-0005Cy-4I for help-gnu-emacs@gnu.org; Tue, 21 Jul 2009 09:01:10 -0400 Original-Received: from mail-qy0-f183.google.com ([209.85.221.183]:65374) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MTExx-0006AV-Me for help-gnu-emacs@gnu.org; Tue, 21 Jul 2009 09:01:09 -0400 Original-Received: by qyk13 with SMTP id 13so2482335qyk.14 for ; Tue, 21 Jul 2009 06:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=skNEzkaZDb7qobhDwJx/hLh/Rachim1yfGJ5urqW2ko=; b=uD2DMunxWgCeharcNWXjA8+Vsz7spbu7dJ4JftOEnjFg4KbEsX7cRhzelcLBFcZdZo xPUFi21Gpl4hsGWvMWCNNsHtkj3nXo6pqgfz/d7UWqZkgx1ME0frhg3J8VkZP096cGQ9 Oy/zevZVmbo/DtYK4KkBFwHTbtbbvf42Gy56Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Ua3Xi1TCWvgsCHHhEnGZ7XvEZsi8/w7wGNUTQkIT8rE0yuNiKgNSnmTXHIOZ72WPbW /zdVToHCWzJ6DjHrpcZTHgKtVUAozU1ubXMd9Xu6JsYABexSmK7nfdCkkv6dY+2/moOO hRDzD5LupmonxcMy/s3K1P7HTUyj6YWS7RUcI= Original-Received: by 10.220.81.69 with SMTP id w5mr7529307vck.23.1248181268130; Tue, 21 Jul 2009 06:01:08 -0700 (PDT) In-Reply-To: <7cskgqjm0s.fsf@pbourguignon.anevia.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:66303 Archived-At: On 7/21/09, Pascal J. Bourguignon wrote: > Wang Lei writes: > >> On 7/21/09, Pascal J. Bourguignon wrote: >>> Wang Lei writes: >>> >>>> Hi, all. >>>> >>>> I'm doing a piece of code. What needs get the output of >>>> emacsclient -e "(current-word nil t)" >>>> >>>> and send it to an external command. But there was NO output. I don't >>>> understand. >>>> >>>> Could someone explain that? >>> >>> That's because -e prints the result only when it's not nil. >>> Try: >>> >>> emacsclient -e "(or (current-word nil t) :nil)" >>> >> Actually, what am i interested is the "current word", in this line, >> it's should print 't'. In emacs it does print 't'. But with >> emacsclient, nothing. >> >> Is this normal? > > Perhaps. I cannot parse your sentence starting with "Actually". > I mean "in fact", sorry for my poor english. ;) > Did you read what I wrote above? I won't repeat it. > Yes, I read and tried. It return :nil. > > > Otherwise, if you use emacsclient from within emacs (eg. from the M-x > shell) you will obviously get different results. Once you hit RET, > emacs changes the position of the cursor, so the current word is not > the same as when you hit RET, and current-word will return nil. > Yes. Maybe this is the reason, or maybe as Miles Bader said, it is in the *server* buffer and it is empty. Anyway, it proves what i have thought is wrong. > And I don't see how current-word could return t. At best, it could > return "t", if you had the cursor on a single letter 't'. > I meaned, in emacs C-x C-e, it returns "t". > > -- > __Pascal Bourguignon__ > Thanks for all your helps and patience! -- Regards Lei