Ar an t-ochtú lá de mí Eanair, scríobh Greg Klanderman:
So I pretty regularly have frames open on multiple X displays (my
xemacs at work has frames open there as well as on my home computer),
and the biggest problem is that the DISPLAY environment variable
passed to sub-processes is always the one xemacs inherited from the
shell when it was started, rather than the one associated with the
currently selected device.
It looks like this could be fixed deep down in child_setup in
callproc.c, somewhere in the middle (in Fstart_process_internal in
process.c or maybe unix_create_process in process-unix.c) or even in
lisp by binding process-environment appropriately around the calls to
start-process-internal in start-process and call-process-internal.
Can someone give me guidance on how best to approach this?
This should do it, in your ~/.xemacs/init.el:
(add-hook 'select-frame-hook
(lexical-let
((original-display (getenv "DISPLAY")))
#'(lambda ()
(let ((print-readably nil)
console-details)
(setq console-details
(prin1-to-string
(device-console (frame-device (selected-frame)))))
(if (string-match "#<x-console on
\"\\([^\"]+\\)"
console-details)
(setenv "DISPLAY" (match-string 1 console-details))
(setenv "DISPLAY" original-display))))))
Unfortunately, there’s no nicer way to get the string display name that a
given console thinks it’s connected to. Maybe we should change that.
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghe, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta