From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tsd@tsdye.com (Thomas S. Dye) Newsgroups: gmane.emacs.help Subject: Re: Emacs 24.5 and external-abook Date: Mon, 08 Jun 2015 11:43:37 -1000 Message-ID: References: <87k2vvxu1j.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433799861 10375 80.91.229.3 (8 Jun 2015 21:44:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Jun 2015 21:44:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Nicolas Richard Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 08 23:44:10 2015 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 1Z24q0-0005tn-ED for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Jun 2015 23:44:08 +0200 Original-Received: from localhost ([::1]:60349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z24pz-0002ID-AM for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Jun 2015 17:44:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z24po-0002I6-BZ for help-gnu-emacs@gnu.org; Mon, 08 Jun 2015 17:43:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z24pl-0002mX-GR for help-gnu-emacs@gnu.org; Mon, 08 Jun 2015 17:43:56 -0400 Original-Received: from gproxy8-pub.mail.unifiedlayer.com ([67.222.33.93]:60378) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Z24pl-0002lw-9Y for help-gnu-emacs@gnu.org; Mon, 08 Jun 2015 17:43:53 -0400 Original-Received: (qmail 31167 invoked by uid 0); 8 Jun 2015 21:43:48 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy8.mail.unifiedlayer.com with SMTP; 8 Jun 2015 21:43:48 -0000 Original-Received: from box472.bluehost.com ([74.220.219.72]) by cmgw4 with id e3cW1q0021aK6lW013cZTc; Mon, 08 Jun 2015 21:36:37 -0600 X-Authority-Analysis: v=2.1 cv=D8zUdJhj c=1 sm=1 tr=0 a=gGnFYiqMEzpiCoLqAtcLRw==:117 a=gGnFYiqMEzpiCoLqAtcLRw==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=vuRWWKdDAAAA:8 a=3XNfdKDVc2EA:10 a=fTkRPNI21DsA:10 a=XAFQembCKUMA:10 a=RrUB_x_o4qy5kfyOsBAA:9 a=16L7eXbh5h8cgt4K:21 a=IWOYtjh1DRl-cybV:21 Original-Received: from [72.253.144.27] (port=52624 helo=manifi) by box472.bluehost.com with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1Z24pY-0001j0-RV; Mon, 08 Jun 2015 15:43:41 -0600 In-Reply-To: <87k2vvxu1j.fsf@yahoo.fr> (Nicolas Richard's message of "Tue, 26 May 2015 17:00:56 +0200") X-Identified-User: {2627:box472.bluehost.com:tsdyetwo:tsdye2.com} {sentby:smtp auth 72.253.144.27 authed with tsd+tsdye2.com} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.33.93 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:104861 Archived-At: Nicolas Richard writes: > tsd@tsdye.com (Thomas S. Dye) writes: > >> Aloha all, >> >> I recently upgraded to Emacs 24.5 and this apparently broke >> external-abook for me. >> >> If I look for my employee, Krickette, then (format >> external-abook-command query) returns this: >> >> #("contacts -lSf '%we \"%n\"' 'Krickette'" 26 35 (face message-header-to >> fontified t)) >> >> Then, (shell-command-to-string) returns: >> >> "error: no one found >> " >> >> However, if I execute the string part of the sequence on the command line: >> >> contacts -lSf '%we\"%n\"' 'Krickette' > > I don't have or use external-abook, but I notice that what you executed > above isn't the same as the return value you gave before, which was (I > remove one level of quoting) : > contacts -lSf '%we "%n"' 'Krickette' > > The differences are : > - the space after %we, and > - the escaped vs unescaped double-quote marks. > > Could this be relevant to your problem ? I don't think so, all the variants yield a result on the command line. A mystery to me is the return from (shell-command-to-string), which is called by (external-abook-search). I'm expecting the result of (shell-command-to-string) to reflect output I get on the command line, not "error: no one found". Here is a backtrace: Debugger entered--Lisp error: (error "Not enough arguments for format string") format("%s <%s>" "error: no one found") apply(format "%s <%s>" "error: no one found") (if (null address) nil (apply (quote format) "%s <%s>" address)) external-abook-make-string(("error: no one found")) (cond ((null results) nil) ((= 1 (length results)) (external-abook-make-string (car results))) (t (let* ((completions (mapcar (quote external-abook-make-string) results))) (external-abook-completing-read "Select Name: " completions)))) external-abook-single-result((("error: no one found"))) (let* ((bounds (external-abook-bounds)) (query (and bounds (buffer-substring (car bounds) (cdr bounds)))) (results (and query (external-abook-search query))) (email (external-abook-single-result results))) (if email (progn (delete-region (car bounds) (cdr bounds)) (insert email)) (message "No match."))) external-abook-try-expand() call-interactively(external-abook-try-expand nil nil) command-execute(external-abook-try-expand) -- Thomas S. Dye http://www.tsdye.com