all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to set 'buffer-save-without-query' from external program?
@ 2012-11-09 17:02 Thorsten Jolitz
  2012-11-09 17:09 ` Drew Adams
       [not found] ` <mailman.12642.1352481549.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Thorsten Jolitz @ 2012-11-09 17:02 UTC (permalink / raw)
  To: help-gnu-emacs


Hi List, 

I open an emacs buffer for editing from an external program and face
three problems related with Emacs querying for user input: 

1. User-query "Revert the buffer"? 

This could be solved by setting a regexp to identify the buffer-name in
in customizable variable:

,---------------------
| revert-without-query
`---------------------

2. User-query "Save before exiting the buffer" (with C-x # or
   server-edit)?

I could not find a variable that allowed to specifiy this behaviour only
for certain files matching a regexp like above. I found the buffer-local
variable 'buffer-save-without-query' though and try to set it to non-nil
from the external program: 

,--------------------------------------------------
| # set input channel to file *F already opened
| # in an Emacsclient buffer
| (in "*F"
|    # try to set variable via call to 
|    # Emacsclient
|    (call 'emacsclient
|       "-s" "emacs1"
|       "-e" "(setq buffer-save-without-query t)" ) ...
`--------------------------------------------------

But this doesn't work, I'm still queried if I want to save the buffer on
exit, and C-h v in the *F buffer shows

,---------------------------------------------------------------
| buffer-save-without-query is a variable defined in `files.el'.
| Its value is nil
`---------------------------------------------------------------

How could I 'design' an external call to emacsclient that actually sets
this variable for the buffer editing the file that is used as input
channel by the external program?

1. Unwanted change in buffer focus after exiting

When I confirm the save-query and Emacsclient exits after 'server-edit
C-x #', the focus is returned to another Emacsclient window, and in that
window the visible buffer changes to the buffer I used to start the
client with, i.e. when I started the other Emacsclient with 

,---------------------------------------
| emacsclient -s emacs1 -c "~/notes.org"
`---------------------------------------

then the visible buffer is changed to notes.org, although I might have
been editing another buffer. 

How can I suppress this behaviour? The best solution would be if the
focus would return to the commandline of the external program that
called (and then closed) an emacsclient instance for editing, and not to
another open emacsclient window.

-- 
cheers,
Thorsten





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-11-09 20:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09 17:02 How to set 'buffer-save-without-query' from external program? Thorsten Jolitz
2012-11-09 17:09 ` Drew Adams
2012-11-09 17:13   ` Thorsten Jolitz
2012-11-09 17:18     ` Drew Adams
2012-11-09 17:32       ` Thorsten Jolitz
2012-11-09 17:34         ` Drew Adams
     [not found] ` <mailman.12642.1352481549.855.help-gnu-emacs@gnu.org>
2012-11-09 18:53   ` Barry Margolin
2012-11-09 19:13     ` Thorsten Jolitz
2012-11-09 20:11       ` Thorsten Jolitz

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.