emacs-devel
[Top][All Lists]
Advanced

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

hg-histedit, how to pass shell involvement, to the lisp code?


From: Uwe Brauer
Subject: hg-histedit, how to pass shell involvement, to the lisp code?
Date: Wed, 09 Oct 2024 21:36:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi

In mercurial the command histedit, allows, well to rewrite history, (log
messages etc).

The emacs pkg hg-histedit (pkg seems abandoned) now allows one to use
this command entirely within emacs, the relevant code lines are

(defcustom hg-histedit-executable "hg"    


And the crucial lines in the main function


(let ((output-buffer (generate-new-buffer " *hg-histedit*"))
          (commands (if changeset
                        `(,hg-histedit-executable "histedit" "--rev" ,changeset)
                      `(,hg-histedit-executable "histedit"))))

However when run it this way, the editing takes place in /tmp (which is the
default for mercurial) and not in the directory of the repository in
question.

>From the command line this can be changed by 

    1. Bash TMP=$(hg root) hg histedit (or  TMP="$(hg root)" hg histedit

    2. Tcsh set TMP=`hg root`; hg histedit $argv

Then histedit runs in the directory of said repository.

Now my question is: how can I modify the lisp code to have this behavior
I just described?

The only kludge I found was to write a trivial shell script say
myhghistedit.sh
and change 
(defcustom hg-histedit-executable "myhghistedit.sh"    

But how can I do this in lisp?

Regards

Uwe Brauer 

-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 





reply via email to

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