chore[client]: improve emacs repolist
Some checks failed
Build and Deploy / build (push) Has been cancelled
Flake check / Check flake (push) Has been cancelled
Build and Deploy / deploy (push) Has been cancelled

This commit is contained in:
Leon Schwarzäugl 2026-03-05 23:14:13 +01:00
parent 05548fdfcb
commit b1b2fc68a3
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
2 changed files with 41 additions and 14 deletions

View file

@ -32138,17 +32138,30 @@ At work and when working on private projects, I often have to jump between sever
We set a keybinding to this in [[#h:2b827c27-0de7-45ed-9d9e-6c511e2c6bb5][Custom Keybindings]].
#+begin_src emacs-lisp
(declare-function consult--read "consult")
(defun swarsel/consult-magit-repos ()
(interactive)
(require 'magit)
(let* ((repos (magit-list-repos))
(repo (consult--read repos
:prompt "Magit repo: "
:require-match t
:history 'my/consult-magit-repos-history
:sort t)))
(magit-status repo)))
(let ((repos (magit-list-repos)))
(unless repos
(user-error "No repositories found in `magit-repository-directories'"))
(let ((repo
(if (or (fboundp 'consult--read)
(require 'consult nil t))
(consult--read repos
:prompt "Magit repo: "
:require-match t
:history 'my/consult-magit-repos-history
:sort t)
(completing-read "Magit repo: "
repos
nil
t
nil
'my/consult-magit-repos-history))))
(when (and repo (> (length repo) 0))
(magit-status repo)))))
#+end_src
**** org-mode: General setup

View file

@ -162,16 +162,30 @@ create a new one."
(define-key minibuffer-local-filename-completion-map
[C-backspace] #'up-directory)
(declare-function consult--read "consult")
(defun swarsel/consult-magit-repos ()
(interactive)
(require 'magit)
(let* ((repos (magit-list-repos))
(repo (consult--read repos
:prompt "Magit repo: "
:require-match t
:history 'my/consult-magit-repos-history
:sort t)))
(magit-status repo)))
(let ((repos (magit-list-repos)))
(unless repos
(user-error "No repositories found in `magit-repository-directories'"))
(let ((repo
(if (or (fboundp 'consult--read)
(require 'consult nil t))
(consult--read repos
:prompt "Magit repo: "
:require-match t
:history 'my/consult-magit-repos-history
:sort t)
(completing-read "Magit repo: "
repos
nil
t
nil
'my/consult-magit-repos-history))))
(when (and repo (> (length repo) 0))
(magit-status repo)))))
(defun swarsel/org-mode-setup ()
(variable-pitch-mode 1)