[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66317: Project mode-line
From: |
Eshel Yaron |
Subject: |
bug#66317: Project mode-line |
Date: |
Tue, 03 Oct 2023 10:07:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi,
Juri Linkov <juri@linkov.net> writes:
> Here is the implementation of the mode-line project indicator prepended
> before the vc indicator with the project menu discussed in bug#63469:
>
> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
> index 2e6ae89a443..8798feb2c56 100644
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -2010,5 +2102,20 @@ project-uniquify-dirname-transform
> (file-relative-name dirname root))))
> dirname))
>
> +;;; Project mode-line
> +
> +(let ((form '(:eval (when-let (project (project-current))
> + (concat " "
> + (propertize
> + (project-name project)
> + 'mouse-face 'mode-line-highlight
> + 'local-map
> + (make-mode-line-mouse-map
> + 'down-mouse-1
> + `(menu-item "Project"
> + ,menu-bar-project-menu))))))))
> + (when-let (pos (seq-position mode-line-format '(vc-mode vc-mode)))
> + (cl-pushnew form (nthcdr pos mode-line-format))))
> +
> (provide 'project)
> ;;; project.el ends here
This looks nice (I actually have something similar in my
`mode-line-format` already), but I think that modifying
`mode-line-format` when project.el is loaded is a bit problematic.
Perhaps a better alternative would be to define a variable that holds
this mode-line construct, along with an autoloaded function that people
can call from their init files to actually add this construct to
`mode-line-format`. WDYT?
Best,
Eshel
- bug#66317: Project mode-line, Juri Linkov, 2023/10/03
- bug#66317: Project mode-line,
Eshel Yaron <=
- bug#66317: Project mode-line, Dmitry Gutov, 2023/10/03
- bug#66317: Project mode-line, Juri Linkov, 2023/10/03
- bug#66317: Project mode-line, Dmitry Gutov, 2023/10/03
- bug#66317: Project mode-line, Juri Linkov, 2023/10/03
- bug#66317: Project mode-line, Dmitry Gutov, 2023/10/03
- bug#66317: Project mode-line, Eli Zaretskii, 2023/10/03
- bug#66317: Project mode-line, Juri Linkov, 2023/10/04
- bug#66317: Project mode-line, Eshel Yaron, 2023/10/04
- bug#66317: Project mode-line, Juri Linkov, 2023/10/04
- bug#66317: Project mode-line, Spencer Baugh, 2023/10/05