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

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

bug#12492: Acknowledgement (24.2.50; Open vc-dir buffer easier and faste


From: Juri Linkov
Subject: bug#12492: Acknowledgement (24.2.50; Open vc-dir buffer easier and faster)
Date: Fri, 28 Jun 2019 00:16:57 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> +;;;###autoload
>> +(defun vc-root-dir ()
>> +  "Show the VC status of the current buffer's repository.
>> +If the buffer is not visiting a version controlled file, or if
>> +the backend does not support function `root', prompt for
>> +directory.  See `vc-dir' for more details."
>
> I think this sounds like a useful command -- whenever I'm not vc-dir-in
> in the top level of the repo, I'm doing something wrong (and just
> committing bits of the changes I meant to do).
>
> I made my own command to do this, but I think it would be generally
> useful.

I made my own too:

  (defun vc-dir-in-project-root ()
    "Run `vc-dir' in project root directory."
    (interactive)
    (let* ((project (project-current))
           (root (and project (car (project-roots project)))))
      (vc-dir (or (and root (file-directory-p root) root) default-directory))))

not sure if it should rely on `vc-root-dir' instead
(I mean the already existing function `vc-root-dir'
that returns the root dir).

>> -    (define-key map "d" 'vc-dir)
>> +    (define-key map "d" 'vc-root-dir)
>
> But this would probably be very controversial.  `C-x v /' is a nice
> binding, though...

I'd prefer an option whose customization would allow `C-x v d'
to always use the root.





reply via email to

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