I would like to write helper functions in elisp for putting dotfiles under version control using YADM.

From their documentation I learned that I could call up the magit status buffer for the YADM directory like so:

(defun yadm-status ()
    (magit-status "/yadm::"))

I would like to write a similar function which takes a file I'm visiting, adds it to this repo, and opens a magit-status buffer.

Perhaps calling magit-mode-setup after setting the a variable representing that repo?

My elisp is very basic and I don't know how to read the internals of magit.

  • Question needs clarification, I do understand that you want to add the visited file to yamd repo, then showing the yamd git repo in magit, but it doesn't look too clear. If it's all I'd say that you only need to issue the appropiate yamd command before magit-status and it'll be done. – Muihlinn Dec 27 '20 at 9:45
  • yadm recommends using Tramp to interact with magit, but that is also software I am unfamiliar with. I will keep researching these three software elements until I can write a clear question that expresses where my workflow is currently falling short. – tom Dec 29 '20 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.