From: tsd@tsdye.com (Thomas S. Dye)
To: Nicolas Richard <theonewiththeevillook@yahoo.fr>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Emacs 24.5 and external-abook
Date: Mon, 08 Jun 2015 11:43:37 -1000 [thread overview]
Message-ID: <m28ubtq3jq.fsf@tsdye.com> (raw)
In-Reply-To: <87k2vvxu1j.fsf@yahoo.fr> (Nicolas Richard's message of "Tue, 26 May 2015 17:00:56 +0200")
Nicolas Richard <theonewiththeevillook@yahoo.fr> 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
next prev parent reply other threads:[~2015-06-08 21:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 23:16 Emacs 24.5 and external-abook Thomas S. Dye
2015-05-26 15:00 ` Nicolas Richard
2015-06-08 21:43 ` Thomas S. Dye [this message]
2015-06-09 17:32 ` Nicolas Richard
2015-06-09 19:44 ` Thomas S. Dye
2015-06-09 19:48 ` Nicolas Richard
2015-06-09 20:05 ` Thomas S. Dye
2015-06-10 5:20 ` Nicolas Richard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m28ubtq3jq.fsf@tsdye.com \
--to=tsd@tsdye.com \
--cc=help-gnu-emacs@gnu.org \
--cc=theonewiththeevillook@yahoo.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.