[OS X TeX] emacs and Applescript

Peter Dyballa Peter_Dyballa at Web.DE
Sun Dec 19 11:01:08 EST 2004


Am 19.12.2004 um 03:14 schrieb Claus Gerhardt:

> tell emacs to save the file

	save-some-buffers is an interactive compiled Lisp function in `files'.
	It is bound to C-x s.
	(save-some-buffers &optional ARG PRED)
	
	Save some modified file-visiting buffers.  Asks user about each one.
	You can answer `y' to save, `n' not to save, `C-r' to look at the
	buffer in question with `view-buffer' before deciding or `d' to
	view the differences using `diff-buffer-to-file'.
	
	Optional argument (the prefix) non-nil means save all with no 
questions.
	Optional second argument PRED determines which buffers are considered:
	If PRED is nil, all the file-visiting buffers are considered.
	If PRED is t, then certain non-file buffers will also be considered.
	If PRED is a zero-argument function, it indicates for each buffer 
whether
	to consider it or not when called with that buffer current.
	
	See `save-some-buffers-action-alist' if you want to
	change the additional actions you can take on files.

So (save-some-buffers t) would be sufficient.

Emacs too can be a server, you start this with (server-start). A little 
programme, emacsclient, accepts orders and delivers them to Emacs. 
"Orders" can be a filename, or it can be some Emacs Lisp (Elisp) code. 
In the last manner the invocation would be 'emacsclient --eval (or 
simply -e) <code>'. If you invoke emacsclient with -n (or --no-wait) it 
quits at once without waiting for an OK from Emacs or its user.

There is a man page for emacsclient too.

	server-start is an interactive autoloaded Lisp function in `server'.
	(server-start &optional LEAVE-DEAD)
	
	Allow this Emacs process to be a server for client processes.
	This starts a server communications subprocess through which
	client "editors" can send your editing commands to this Emacs job.
	To use the server, set up the program `emacsclient' in the
	Emacs distribution as your standard "editor".
	
	Prefix arg means just kill any existing server communications 
subprocess.


--
Greetings

   Pete

"There's no place like 127.0.0.1"
                      origin unknown

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list