Question about calling OS functions from lisp
robert delius royar
xemacs at frinabulax.org
Mon Nov 8 05:32:13 EST 2004
Mon, 8 Nov 2004 (10:02 +0900 UTC) Stephen J. Turnbull wrote:
>>>>>> "robert" == robert delius royar <xemacs at frinabulax.org> writes:
>
> robert> I am working on an OS-specific (Mac OS X) method to use
> robert> drag and drop via gnuclient/gnuserv.
>
> I can't make head or tail of what you're talking about. Last I heard
> you were using X over Mac OS X, so it doesn't make sense that XEmacs
> would be talking directly to the OS; DND is a desktop function so it
> should be mediated by the GUI server, namely X. I'm sure there are
> other ways to do it, but if you're going to try to make an end run
> around X, you're going to have to be a lot more clear about what
> you're doing before I can help. Maybe there are others who know more,
> but since they haven't responded yet....
I am currently able to drag a file's icon onto the XEmacs icon on the Mac
desktop and have XEmacs startup opening the file. I have been able to do
this using two different methods, and AppleScript application bundle, and a
Platypus application bundle. The latter is a "better" solution for XEmacs
because it does not need to wait for program output[1].
I also have an icon on my desktop labeled "GNUclient." When I drop a file
icon on it, the running XEmacs process (running under X) gets the file and
opens a gnuclient buffer.
All this works fine. What doesn't work is that when I use the GNUclient
option, the XEmacs window does not get raised to the top of the OS window
stack. Apple has a developer's doc about how to fix this. I have it
working for Pine startup because I added a few lines of code that get called
from its main() function. This is the code that tells the underlying Carbon
layer "Hey watch for requests for me" and the underlying Cocoa layer "Raise
my application's windows to the front, and give this window focus." The
docs that describe this are on the Apple developers' site named
"X11CallCarbonAndCocoa".
So I need to know how to get a lisp function to call an internal C funtion
that can interface to the standard Apple Frameworks. It only needs to be
told some process stuff that are available to XEmacs already. I don't know
how to add such an object file into XEmacs--the way I added it to my
compilation of the Pine program. I thought perhaps a separate, loadable,
module would be the best way to go, but I do not know how to piece that
together either.
By the way GIMP for OS X works in a similar way. But it appears to be
accomplishing its raise and focus through a means different from the way
Apple describes it should be done--perhaps through GTK2.
[1]. Applescript wants a timeout, which means when gnuclient is the
communication channel, you have to limit the session time.
--
Dr. Robert Delius Royar Associate Professor of English
Morehead State University Morehead, Kentucky
More information about the XEmacs-Beta
mailing list