help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Advice Required


From: Gian Uberto Lauri
Subject: Advice Required
Date: Mon, 27 Oct 2014 10:56:16 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]