alt.religion.emacs-working_from_home_with_emacsclient_make-frame-on-display

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



From: Matan Ninio <emacs@cs.ng.ninio.org>
Subject: Re: Microwave Day (1982)
Newsgroups: alt.religion.emacs
Date: 22 Mar 2004 19:58:55 +0200
Organization: The Israel Inter-University Computation Center

Arjan Bos <Arjan.Bos@nospam.ISeeYou.nl> writes:

> Matan Ninio wrote:
> > (see for link below for some details
> > http://lists.tunes.org/archives/cybernethics/2001-January.txt
> > oka@ping.uio.no writes:
> > 
> >>make cake
> > wrong microwave  :-)
> 
> wrong too:
> M-x make-cake :-)

what about
M-x make-cake-in-oven :-P

BTW, I'm now using gnuserv and a small gnuclien script (called gemacs)
to work from home:

#! /bin/csh -f

~/bin/gnudoit  '(make-frame-on-display "'$DISPLAY'")'


this way, when my home machine is disconnected after the cat pulls the
wire out of the wall (again), all I need to do is connect via ssh, set
the display and say "dear emacs, please come over".  works like a
charm.  Also solved the problem of my #1 emacs killer - C-M-backspace
(which does not invoke backward-kill-sexp, but rather
"annoyingly-kill-X").  Now, as long as I have an additional working
frame, this is no more the a minor announce.

And this is where I need help.  I really want to run emacs as a server
 - so it will not really need an X display to work, but would be willing
to open a frames.  

Any Ideas?

===
From: Istvan Marko <mi-usenet@imarko.dhs.org>
Subject: make-frame, not cake
Newsgroups: alt.religion.emacs
Date: Mon, 22 Mar 2004 20:59:20 -0800
Organization: Posted via Supernews, http://www.supernews.com

Matan Ninio <emacs@cs.ng.ninio.org> writes:

> BTW, I'm now using gnuserv and a small gnuclien script (called gemacs)
> to work from home:
>
> #! /bin/csh -f
>
> ~/bin/gnudoit  '(make-frame-on-display "'$DISPLAY'")'

Same here! Except that these days I use server.el that comes with more
recent (CVS) versions of Emacs:

emacsclient -e "(make-frame-on-display \"$DISPLAY\")"

Combine this with the multi-tty[1] branch for true bliss. You can have
your beloved Emacs[2] pop up an X frame or a tty frame (for the times
when you are on a slow connection) anytime, anywhere[3].

Also, I wrote a little Common Lisp/CLX[4] program[5] to turn on X
backing store for all Emacs windows, helpful if you are in the habit
of switching virtual desktops a lot. You need Option "backingstore" in
the Device section of your XF86Config to make use of it.

> Also solved the problem of my #1 emacs killer - C-M-backspace
> (which does not invoke backward-kill-sexp, but rather
> "annoyingly-kill-X").  

/etc/X11/XF86Config:
...
Section "ServerFlags"
	Option "DontZap"  "true"
EndSection
...

> And this is where I need help.  I really want to run emacs as a server
> - so it will not really need an X display to work, but would be willing
> to open a frames.  

I don't know of a way to do this at the moment but you could just run
a frame on an Xvfb or Xvnc display. Or with the multi-tty Emacs run a
tty under "screen".

[1] multi-tty: http://lorentey.web.elte.hu/project/emacs.html

[2] XEmacs users had this capability for a long time.

[3] Including your PDA. It's quite usable on the Zaurus, connecting
    via WLAN or a GPRS phone.

[4] CLX is so much easier than Xlib

[5] 
[2. text/plain; backing.lisp]...


#! /usr/local/bin/clisp -K full

(require 'clx)

(defun flatten (l)
  (cond ((null l) l)
	((atom (car l))
	 (cons (car l)
	       (flatten (cdr l))))
	(t (append (flatten (car l))
		   (flatten (cdr l))))))

(defun recursive-query-tree (win)
  (cons win (mapcar #'recursive-query-tree (remove nil (xlib:query-tree win)))))

(defun find-all-emacs-windows (display)
  (let*
      ((screen (car (xlib:display-roots display)))
       (root (xlib:screen-root screen)))
    (remove-if-not
     (lambda (w) (string=
		  (cadr (multiple-value-list (xlib:get-wm-class w)))
		  "Emacs"))
     (flatten (recursive-query-tree root)))))
	  
(defun back-all-emacs-windows ()
  (let
      ((display
	#+sbcl (xlib:open-default-display)
	#+clisp (xlib:open-display "")))
    (dolist
	(w (find-all-emacs-windows display))
      (setf (xlib:window-backing-store w) :always)
      (xlib:window-backing-store w))
    (xlib:close-display display)))

(back-all-emacs-windows)

===

From: Tom Alsberg <alsbergt@zoopee.org>
Subject: Re: make-frame, not cake
Newsgroups: alt.religion.emacs
Followup-To: Tom Alsberg <alsbergt@cs.huji.ac.il>
Date: Fri, 30 Apr 2004 19:38:31 GMT
Reply-To: Tom Alsberg <alsbergt@cs.huji.ac.il>
Organization: Verio

In article <m3brmob1lj.fsf_-_@zsu.sush.org>, Istvan Marko wrote:
> Same here! Except that these days I use server.el that comes with more
> recent (CVS) versions of Emacs:
> 
> emacsclient -e "(make-frame-on-display \"$DISPLAY\")"

Is there some easy way to have emacsclient open up a frame and
execute some command/function (specifically find-file) from it?

Currently I use some script which eventually, given no exceptional
condition (no DISPLAY, unable to connect to gnuserv, unable to start
Emacs with gnuserv, etc.) ends up doing "gnuclient <file>" if a file
was specified, which opens up a frame with that file, and if a file
isn't specified, just open a frame.  I would like to be able to do
that with server.el and emacsclient as well...

> Combine this with the multi-tty[1] branch for true bliss. You can have
> your beloved Emacs[2] pop up an X frame or a tty frame (for the times
> when you are on a slow connection) anytime, anywhere[3].

Cool.  Yesterday I was building Emacs 21.3 at home, and have spent
about an hour and a half hacking the C sources of Emacs to get rid of
those fringes (some of the display/frame/xterm/lwlib code there is
confusing).  Now I tried applying this multi-tty patch, and it didn't
compile with it, so I'll see what to do...

><snip />
> /etc/X11/XF86Config:
> ...
> Section "ServerFlags"
> 	Option "DontZap"  "true"
> EndSection
> ...

Happened to me quite some times already too...  But I actually need
this Zap possibility - I only wish I could map it to some more
esoteric key combination (I like the combination of
Control+Alt+Shift+F12+Keypad-Divide in IRIX).  Using Xkb I can add
another key combination that will do that, but it won't stop
Control+Alt+Backspace from doing it (and DontZap would cause the Xkb
thingy not to work either).

> I don't know of a way to do this at the moment but you could just run
> a frame on an Xvfb or Xvnc display.

Matan, I told you Xvfb might be a good solution...

> Or with the multi-tty Emacs run a tty under "screen".

I wished for that possibility (a la XEmacs) long ago already.

===

From: Istvan Marko <mi-usenet@imarko.dhs.org>
Subject: Re: make-frame, not cake
Newsgroups: alt.religion.emacs
Date: Sat, 01 May 2004 12:34:27 -0700
Organization: Posted via Supernews, http://www.supernews.com

Tom Alsberg <alsbergt@zoopee.org> writes:

> In article <m3brmob1lj.fsf_-_@zsu.sush.org>, Istvan Marko wrote:
>> Same here! Except that these days I use server.el that comes with more
>> recent (CVS) versions of Emacs:
>> 
>> emacsclient -e "(make-frame-on-display \"$DISPLAY\")"
>
> Is there some easy way to have emacsclient open up a frame and
> execute some command/function (specifically find-file) from it?

With recent emacs--multi-tty versions this is the default
behavior. Just "emacsclient" will pop-up a new X frame (so the
make-frame-on-display stuff above is not needed) and
"emacsclient <filename>" will open the file in a new frame.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu