unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Advice Required
@ 2014-10-27  9:56 Gian Uberto Lauri
  2014-10-27 12:45 ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Gian Uberto Lauri @ 2014-10-27  9:56 UTC (permalink / raw)
  To: help-gnu-emacs

Hello everybody!

I would like to store a ediff-session specific value somewhere, this
value come s to the ediff session via a wrapping function that is
called with emacsclient --eval.

I thought to make the variable buffer specific on the ediff control
panel buffer. Is it a good solution ?

Thank you in advance for your suggestions.

For those curious about what I am doing:

I set up a couple of scripts that let me use Emacs to solve conflicts
with SVN with the use of the --eval option of emacsclient.

After finding some guys suggesting ediff-merge-files-with-ancestor
(but apparently failing to overcoming the non blocking behaviour of
the function) I wrote a first set of shell scripts that used a named
pipe to attain the desired blocking behaviour. The key is advice
ediff-quit so that a shell command is invoked to put a character in
the pipe, thus un-blocking a pending read (all shell commands).

It works this way:

- the calling script launches ediff and then attempts to read from a
  named pipe and blocks until input is available

- the advice after ediff-quit sends a character to the named pipe and
  un-blocks the read operation

The next step was to write a couple of command around a semaphore, and
this would change nothing - except showing myself how fast I could be
in writing these code snippets.

What I really want is the ability of run several blocking diff at the
same time. One way to differentiate the various instance is the id of
the process used to block the script that launched the emacs diff
function.

I would like to get this architecture:

- the calling scripts spawns a command in the background, does the
  ediff launching emacsclient invocation and then waits on the command
  in background.  Such a command creates a named semaphore whose name
  depends on the user and its process IDs and waits on that semaphore.

  The semaphore-creating-pid is available to the calling script (the
  $! variable) and is used as a parameter of a suitable wrapper
  function for ediff or ediff-merge-files-with-ancestor.

  This pid will be passed to the signaling program so that the
  semaphore name can be computed.

- the signaling program computes the semaphore name and signals it
  unblocking the semaphore-creating process and the script that
  is waiting after launching it.

-- 
 /\           ___                                    Ubuntu: ancient
/___/\_|_|\_|__|___Gian Uberto Lauri_____               African word
  //--\| | \|  |   Integralista GNUslamico            meaning "I can
\/                 coltivatore diretto di software       not install
     già sistemista a tempo (altrui) perso...                Debian"

Warning: gnome-config-daemon considered more dangerous than GOTO



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

end of thread, other threads:[~2014-10-27 15:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27  9:56 Advice Required Gian Uberto Lauri
2014-10-27 12:45 ` Stefan Monnier
2014-10-27 13:25   ` Gian Uberto Lauri
2014-10-27 13:54     ` Stefan Monnier
2014-10-27 14:11       ` Gian Uberto Lauri
2014-10-27 15:03         ` Stefan Monnier
2014-10-27 15:11           ` Gian Uberto Lauri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).