Skip to content

Calling hgtk from emacs

Even though has nice integration with different VersionControlSystems (I’ve been using Subversion and Mercurial with Emacs) – I sometimes like to get out of Emacs and use the GUI that comes with the different systems.

Following is some EmacsLisp that calls the graphical frontend to – hgtk – with the directory of the file the current buffer visits:

[codesyntax lang=““] (defun mercurial-open-hgtk-commit-with-dir-of-visited-file () „Opens ‚hgtk commit‘ with the directory of the file visited by the current buffer.“ (interactive) (let* ((dir (file-name-directory (buffer-file-name))) (cmd (format „hgtk commit \“%s\“ &“ dir))) (message cmd) ;;http://osdir.com/ml/help-gnu-emacs-gnu/2009-07/msg00247.html (call-process-shell-command cmd nil 0))) (defun mercurial-open-hgtk-log-with-visited-file () „Opens ‚hgtk log‘ with the directory of the file visited by the current buffer.“ (interactive) (let* ((file (buffer-file-name)) (cmd (format „hgtk log \“%s\“ &“ file))) (message cmd) ;;http://osdir.com/ml/help-gnu-emacs-gnu/2009-07/msg00247.html (call-process-shell-command cmd nil 0))) (defalias ‚hg ‚mercurial-open-hgtk-commit-with-dir-of-visited-file) (defalias ‚hg-log ‚mercurial-open-hgtk-log-with-visited-file) [/codesyntax]

Post a Comment

Your email is never published nor shared. Required fields are marked *