help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why emacsclient -e "(current-word nil t)" does not print ?


From: Anselm Helbig
Subject: Re: Why emacsclient -e "(current-word nil t)" does not print ?
Date: Wed, 22 Jul 2009 08:35:20 +0200

> NOW. Maybe having two choices is ok. Because if I really want to
> integrate everything, "get word from screen" should be my choice, not
> selection ang prompt. Thanks for you help!

So I understand that you really require to call your code from outside
of emacs. When you're not in emacs, there's AFAIK no way to tell which
buffer is "current". You may have many buffers, and also any number of
frames and windows. This code takes the buffer that the first window
of the currently selected frame is pointing to, which will probably do
what you want: 

  (with-current-buffer (window-buffer (frame-first-window)) (current-word nil 
t))

HTH, 

Anselm


-- 
Anselm Helbig 
mailto:anselm.helbig+news2009@googlemail.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]