[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs 24.5 and external-abook
From: |
Thomas S. Dye |
Subject: |
Re: Emacs 24.5 and external-abook |
Date: |
Mon, 08 Jun 2015 11:43:37 -1000 |
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
- Re: Emacs 24.5 and external-abook,
Thomas S. Dye <=