* Emacs 24.5 and external-abook
@ 2015-05-22 23:16 Thomas S. Dye
2015-05-26 15:00 ` Nicolas Richard
0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2015-05-22 23:16 UTC (permalink / raw
To: help-gnu-emacs
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'
then I get what looks like a reasonable response:
kmu@tsdye.com\"Krickette Murabayashi\"
Apologies if this is the wrong place to be asking this question. Any
and all help much appreciated.
All the best,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs 24.5 and external-abook
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
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Richard @ 2015-05-26 15:00 UTC (permalink / raw
To: Thomas S. Dye; +Cc: help-gnu-emacs
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 ?
--
Nicolas Richard
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs 24.5 and external-abook
2015-05-26 15:00 ` Nicolas Richard
@ 2015-06-08 21:43 ` Thomas S. Dye
2015-06-09 17:32 ` Nicolas Richard
0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2015-06-08 21:43 UTC (permalink / raw
To: Nicolas Richard; +Cc: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs 24.5 and external-abook
2015-06-08 21:43 ` Thomas S. Dye
@ 2015-06-09 17:32 ` Nicolas Richard
2015-06-09 19:44 ` Thomas S. Dye
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Richard @ 2015-06-09 17:32 UTC (permalink / raw
To: Thomas S. Dye; +Cc: help-gnu-emacs
tsd@tsdye.com (Thomas S. Dye) writes:
> 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".
Reasonable expectation, indeed.
Could you try
(shell-command-to-string "contacts -lSf '%we\\\"%n\\\"' 'Krickette'")
and (in emacs)
M-! contacts -lSf '%we\"%n\"' 'Krickette'
then, in a shell :
contacts -lSf '%we\"%n\"' 'Krickette'
(perhaps try the above both in a M-x shell and outside emacs).
And see what they return ?
Nico.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs 24.5 and external-abook
2015-06-09 17:32 ` Nicolas Richard
@ 2015-06-09 19:44 ` Thomas S. Dye
2015-06-09 19:48 ` Nicolas Richard
0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2015-06-09 19:44 UTC (permalink / raw
To: Nicolas Richard; +Cc: help-gnu-emacs
Nicolas Richard <youngfrog@members.fsf.org> writes:
> tsd@tsdye.com (Thomas S. Dye) writes:
>> 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".
>
> Reasonable expectation, indeed.
>
> Could you try
> (shell-command-to-string "contacts -lSf '%we\\\"%n\\\"' 'Krickette'")
,----------------------------------------------------------------------
| (shell-command-to-string "contacts -lSf '%we\\\"%n\\\"' 'Krickette'")
| "error: no one found
| "
`----------------------------------------------------------------------
> and (in emacs)
> M-! contacts -lSf '%we\"%n\"' 'Krickette'
,--------------------
| error: no one found
`--------------------
> then, in a shell :
> contacts -lSf '%we\"%n\"' 'Krickette'
> (perhaps try the above both in a M-x shell and outside emacs).
M-x shell
,------------------------------------------------
| Reading ~/.bashrc
| bash-3.2$ contacts -lSf '%we\"%n\"' 'Krickette'
| error: no one found
`------------------------------------------------
Outside emacs
,---------------------------------------------------
| Last login: Mon Jun 8 16:04:33 on ttys000
| Reading ~/.bash_profile
| Reading ~/.bashrc
| manifi:~ dk$ contacts -lSf '%we\"%n\"' 'Krickette'
| WORK\"NAME\"
| kmu@tsdye.com\"Krickette Murabayashi\"
`---------------------------------------------------
In summary, no contacts from any of the paths through emacs.
Thanks,
Tom
--
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs 24.5 and external-abook
2015-06-09 19:44 ` Thomas S. Dye
@ 2015-06-09 19:48 ` Nicolas Richard
2015-06-09 20:05 ` Thomas S. Dye
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Richard @ 2015-06-09 19:48 UTC (permalink / raw
To: Thomas S. Dye; +Cc: help-gnu-emacs
tsd@tsdye.com (Thomas S. Dye) writes:
> M-x shell
> ,------------------------------------------------
> | Reading ~/.bashrc
> | bash-3.2$ contacts -lSf '%we\"%n\"' 'Krickette'
> | error: no one found
> `------------------------------------------------
>
> Outside emacs
> ,---------------------------------------------------
> | Last login: Mon Jun 8 16:04:33 on ttys000
> | Reading ~/.bash_profile
> | Reading ~/.bashrc
> | manifi:~ dk$ contacts -lSf '%we\"%n\"' 'Krickette'
> | WORK\"NAME\"
> | kmu@tsdye.com\"Krickette Murabayashi\"
> `---------------------------------------------------
>
> In summary, no contacts from any of the paths through emacs.
There's an obvious difference (thanks to whoever decided to explicitly
state which config files are read by bash, here !), can it explain the
difference in behaviour ? i.e. if you source ~/.bash_profile from M-x
shell before querying, does it get the desired result ?
--
Nico.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs 24.5 and external-abook
2015-06-09 19:48 ` Nicolas Richard
@ 2015-06-09 20:05 ` Thomas S. Dye
2015-06-10 5:20 ` Nicolas Richard
0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2015-06-09 20:05 UTC (permalink / raw
To: Nicolas Richard; +Cc: help-gnu-emacs
Nicolas Richard <youngfrog@members.fsf.org> writes:
> tsd@tsdye.com (Thomas S. Dye) writes:
>> M-x shell
>> ,------------------------------------------------
>> | Reading ~/.bashrc
>> | bash-3.2$ contacts -lSf '%we\"%n\"' 'Krickette'
>> | error: no one found
>> `------------------------------------------------
>>
>> Outside emacs
>> ,---------------------------------------------------
>> | Last login: Mon Jun 8 16:04:33 on ttys000
>> | Reading ~/.bash_profile
>> | Reading ~/.bashrc
>> | manifi:~ dk$ contacts -lSf '%we\"%n\"' 'Krickette'
>> | WORK\"NAME\"
>> | kmu@tsdye.com\"Krickette Murabayashi\"
>> `---------------------------------------------------
>>
>> In summary, no contacts from any of the paths through emacs.
>
> There's an obvious difference (thanks to whoever decided to explicitly
> state which config files are read by bash, here !), can it explain the
> difference in behaviour ? i.e. if you source ~/.bash_profile from M-x
> shell before querying, does it get the desired result ?
No, it gets the same result.
,------------------------------------------------
| Reading ~/.bashrc
| bash-3.2$ source ~/.bash_profile
| Reading ~/.bash_profile
| Reading ~/.bashrc
| bash-3.2$ contacts -lSf '%we\"%n\"' 'Krickette'
| error: no one found
`------------------------------------------------
Tom
--
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs 24.5 and external-abook
2015-06-09 20:05 ` Thomas S. Dye
@ 2015-06-10 5:20 ` Nicolas Richard
0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Richard @ 2015-06-10 5:20 UTC (permalink / raw
To: Thomas S. Dye; +Cc: help-gnu-emacs
tsd@tsdye.com (Thomas S. Dye) writes:
> No, it gets the same result.
Ok.
A few random questions because I don't really know : does the program
rely on an environment variable ? On dbus ? Do you still have your older
emacs to test whether it still works there ?
--
Nico.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-06-10 5:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.