unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 66317@debbugs.gnu.org
Subject: bug#66317: Project mode-line
Date: Tue, 03 Oct 2023 10:07:00 +0200	[thread overview]
Message-ID: <m1cyxwp1sr.fsf@re-byods-145-109-60-14.wireless.uva.nl> (raw)
In-Reply-To: <86jzs4ntxb.fsf@mail.linkov.net> (Juri Linkov's message of "Tue,  03 Oct 2023 09:29:23 +0300")

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





  reply	other threads:[~2023-10-03  8:07 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03  6:29 bug#66317: Project mode-line Juri Linkov
2023-10-03  8:07 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-10-03 16:24   ` Dmitry Gutov
2023-10-03 17:11   ` Juri Linkov
2023-10-03 17:51     ` Dmitry Gutov
2023-10-03 17:58       ` Juri Linkov
2023-10-03 18:04         ` Dmitry Gutov
2023-10-03 18:17         ` Eli Zaretskii
2023-10-04  6:18           ` Juri Linkov
2023-10-04  7:15             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-04 17:06               ` Juri Linkov
2023-10-05 20:03                 ` Spencer Baugh
2023-10-05 20:16                   ` Dmitry Gutov
2023-10-06  6:46                   ` Juri Linkov
2023-10-09 18:45                 ` Juri Linkov
2023-10-09 18:57                   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-10  6:56                     ` Juri Linkov
2023-10-10 11:46                       ` Dmitry Gutov
2023-10-11  6:27                         ` Juri Linkov
2023-10-04  7:43             ` Eli Zaretskii
2023-10-04 14:34               ` Dmitry Gutov
2023-10-04 17:04               ` Juri Linkov
2023-10-05 20:23             ` Dmitry Gutov
2023-10-06  4:50               ` Eli Zaretskii
2023-10-06  6:44                 ` Juri Linkov
2023-10-06 10:20                   ` Dmitry Gutov
2023-10-09 18:10                     ` Juri Linkov
2023-10-09 18:22                       ` Dmitry Gutov
2023-10-09 18:48                         ` Juri Linkov
2023-10-09 18:52                           ` Dmitry Gutov
2023-10-10  6:50                             ` Juri Linkov
2023-10-10  7:10                               ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-10  7:18                                 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-10 10:45                                 ` Dmitry Gutov
2023-10-10 11:34                                   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-10 11:42                                     ` Dmitry Gutov
2023-10-20  9:01             ` Ihor Radchenko
2023-10-20 15:52               ` Dmitry Gutov
2023-10-31  7:34                 ` Juri Linkov
2023-11-01  2:03                   ` Dmitry Gutov
2023-11-01  7:32                     ` Juri Linkov
2023-10-03 12:06 ` Stefan Kangas
2023-10-15 22:42 ` sbaugh
2023-10-16  0:57   ` Dmitry Gutov
2023-10-16 17:01     ` Juri Linkov
2023-10-16 19:12       ` Eli Zaretskii
2023-10-18 17:20         ` Juri Linkov
2023-10-18 18:41           ` Dmitry Gutov
2023-10-19  6:40             ` Juri Linkov
2023-10-19 11:23               ` Dmitry Gutov
2023-10-23 17:23                 ` Juri Linkov
2023-10-24 23:48                   ` Dmitry Gutov
2023-10-18 18:55       ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1cyxwp1sr.fsf@re-byods-145-109-60-14.wireless.uva.nl \
    --to=bug-gnu-emacs@gnu.org \
    --cc=66317@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).