* bug#63469: 29.0.90; project.el doesn't add menu-bar entries @ 2023-05-12 17:48 Spencer Baugh 2023-05-12 19:09 ` Eli Zaretskii ` (3 more replies) 0 siblings, 4 replies; 70+ messages in thread From: Spencer Baugh @ 2023-05-12 17:48 UTC (permalink / raw) To: 63469 The project.el commands are very useful and are increasingly core to Emacs. They are even included in the quick-help window. I think they are valuable for new users to learn. However, there are no menu bar entries for project.el commands. Perhaps we should add some? Some proposed additions: - File, "Open File In Project", project-find-file - Edit -> Search, "Search Files In Project", project-find-regexp - Edit -> Replace, "Replace Regexp In Project", project-query-replace-regexp - Tools -> Shell Commands, "Run Shell Interactively In Project", project-shell - Buffers, "Select Buffer In Project", project-switch-to-buffer These menu items could be set to only appear when the current buffer is in a project, or they could just always appear. I think it would be better for them to always appear, personally. In GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-05-09 built on igm-qws-u22796a Repository revision: 65c4a24aa0fc672bbf11e0c5187c6a29931b4363 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: CentOS Linux 7 (Core) Configured using: 'configure --with-x-toolkit=lucid --with-gif=ifavailable' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Debbugs Minor modes in effect: header-line-indent-mode: t jane-fe-minor-mode: t editorconfig-mode: t which-function-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t server-mode: t windmove-mode: t savehist-mode: t save-place-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/project hides /home/sbaugh/.emacs.d/elpa/project-0.9.8/project /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/xref hides /home/sbaugh/.emacs.d/elpa/xref-1.6.3/xref /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/csharp-mode hides /home/sbaugh/src/emacs/emacs-29/lisp/progmodes/csharp-mode /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/xref hides /home/sbaugh/src/emacs/emacs-29/lisp/progmodes/xref /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/project hides /home/sbaugh/src/emacs/emacs-29/lisp/progmodes/project /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/eldoc hides /home/sbaugh/src/emacs/emacs-29/lisp/emacs-lisp/eldoc /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/auctex/lpath hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/dictionary/lpath /home/sbaugh/src/emacs/emacs-29/lisp/net/dictionary hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/dictionary/dictionary /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/caml-font hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/ocaml/caml-font /home/sbaugh/src/emacs/emacs-29/lisp/org/org-version hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-version /home/sbaugh/src/emacs/emacs-29/lisp/org/org-loaddefs hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-loaddefs /home/sbaugh/src/emacs/emacs-29/lisp/org/org-keys hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-keys /home/sbaugh/src/emacs/emacs-29/lisp/org/ol hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-perl hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-perl /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-core hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-core /home/sbaugh/src/emacs/emacs-29/lisp/org/ox hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-rmail hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-rmail /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-octave hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-octave /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-comint hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-comint /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-w3m hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-w3m /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-org /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-texinfo hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-texinfo /home/sbaugh/src/emacs/emacs-29/lisp/org/org-inlinetask hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-inlinetask /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-mhe hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-mhe /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-ocaml hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ocaml /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-clojure hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-clojure /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-publish hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-publish /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-irc hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-irc /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-calc hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-calc /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-odt hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-odt /home/sbaugh/src/emacs/emacs-29/lisp/org/org-id hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-id /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-gnus hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-gnus /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-matlab hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-matlab /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-icalendar hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-icalendar /home/sbaugh/src/emacs/emacs-29/lisp/org/org-footnote hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-footnote /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-bibtex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-bibtex /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-lisp hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lisp /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-C hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-C /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-org /home/sbaugh/src/emacs/emacs-29/lisp/org/org-indent hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-indent /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-info hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-info /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-maxima hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-maxima /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-awk hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-awk /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-man hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-man /home/sbaugh/src/emacs/emacs-29/lisp/org/org-goto hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-goto /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-md hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-md /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-eshell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-eshell /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-lua hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lua /home/sbaugh/src/emacs/emacs-29/lisp/org/org-habit hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-habit /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-R hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-R /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-eww hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-eww /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-makefile hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-makefile /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-latex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-latex /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-docview hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-docview /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-lob hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lob /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-beamer hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-beamer /home/sbaugh/src/emacs/emacs-29/lisp/org/org-faces hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-faces /home/sbaugh/src/emacs/emacs-29/lisp/org/ob hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-html hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-html /home/sbaugh/src/emacs/emacs-29/lisp/org/org-feed hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-feed /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-bbdb hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ol-bbdb /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-lilypond hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-lilypond /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-ascii hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ox-ascii /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-latex hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-latex /home/sbaugh/src/emacs/emacs-29/lisp/org/org hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-tangle hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-tangle /home/sbaugh/src/emacs/emacs-29/lisp/org/org-tempo hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-tempo /home/sbaugh/src/emacs/emacs-29/lisp/org/org-duration hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-duration /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-sqlite hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sqlite /home/sbaugh/src/emacs/emacs-29/lisp/org/org-entities hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-entities /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-table hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-table /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-js hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-js /home/sbaugh/src/emacs/emacs-29/lisp/org/org-table hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-table /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-sql hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sql /home/sbaugh/src/emacs/emacs-29/lisp/org/org-timer hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-timer /home/sbaugh/src/emacs/emacs-29/lisp/org/org-element hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-element /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-java hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-java /home/sbaugh/src/emacs/emacs-29/lisp/org/org-ctags hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-ctags /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-shell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-shell /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-groovy hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-groovy /home/sbaugh/src/emacs/emacs-29/lisp/org/org-src hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-src /home/sbaugh/src/emacs/emacs-29/lisp/org/org-datetree hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-datetree /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-haskell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-haskell /home/sbaugh/src/emacs/emacs-29/lisp/org/org-plot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-plot /home/sbaugh/src/emacs/emacs-29/lisp/org/org-compat hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-compat /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-screen hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-screen /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-fortran hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-fortran /home/sbaugh/src/emacs/emacs-29/lisp/org/org-protocol hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-protocol /home/sbaugh/src/emacs/emacs-29/lisp/org/org-crypt hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-crypt /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-sed hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sed /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-gnuplot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-gnuplot /home/sbaugh/src/emacs/emacs-29/lisp/org/org-pcomplete hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-pcomplete /home/sbaugh/src/emacs/emacs-29/lisp/org/org-colview hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-colview /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-scheme hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-scheme /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-forth hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-forth /home/sbaugh/src/emacs/emacs-29/lisp/org/org-num hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-num /home/sbaugh/src/emacs/emacs-29/lisp/org/org-clock hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-clock /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-exp hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-exp /home/sbaugh/src/emacs/emacs-29/lisp/org/org-mouse hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-mouse /home/sbaugh/src/emacs/emacs-29/lisp/org/org-capture hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-capture /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-sass hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-sass /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-eval hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-eval /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-ref hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ref /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-emacs-lisp hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-emacs-lisp /home/sbaugh/src/emacs/emacs-29/lisp/org/org-mobile hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-mobile /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-ruby hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ruby /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-eshell hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-eshell /home/sbaugh/src/emacs/emacs-29/lisp/org/org-lint hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-lint /home/sbaugh/src/emacs/emacs-29/lisp/org/org-agenda hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-agenda /home/sbaugh/src/emacs/emacs-29/lisp/org/org-macro hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-macro /home/sbaugh/src/emacs/emacs-29/lisp/org/org-attach-git hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-attach-git /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-processing hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-processing /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-css hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-css /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-dot hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-dot /home/sbaugh/src/emacs/emacs-29/lisp/org/org-list hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-list /home/sbaugh/src/emacs/emacs-29/lisp/org/org-macs hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-macs /home/sbaugh/src/emacs/emacs-29/lisp/org/org-attach hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-attach /home/sbaugh/src/emacs/emacs-29/lisp/org/org-archive hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/org-archive /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-python hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-python /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-plantuml hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-plantuml /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-ditaa hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/lisp/ob-ditaa /home/sbaugh/src/emacs/emacs-29/lisp/org/ob-julia hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/contrib/lisp/ob-julia /home/sbaugh/src/emacs/emacs-29/lisp/org/ol-man hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/contrib/lisp/ol-man /home/sbaugh/src/emacs/emacs-29/lisp/org/ox-koma-letter hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/org/contrib/lisp/ox-koma-letter /home/sbaugh/.emacs.d/elpa/dash-2.19.1/dash hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/dash/dash /home/sbaugh/.emacs.d/elpa/dash-2.19.1/dash-functional hides /usr/local/home/sbaugh/workspaces/fe-47828/+share+/app/emacs/elisp/contrib/dash/dash-functional Features: (shadow emacsbug gnus-fun reposition pcmpl-git em-unix em-term term ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-extpipe em-cmpl em-dirs esh-var em-basic em-banner em-alias esh-mode eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util lisp-mnt cus-edit cus-start cus-load completion conf-mode mode-local package-x proced calc calc-loaddefs calc-macs info-look hl-line tabify cal-iso org-datetree timezone org-capture emacs-news-mode emoji-labels emoji multisession sqlite rect mule-util ibuffer ibuffer-loaddefs man goto-addr vc-dir pulse org-element org-persist org-id org-refile avl-tree generator oc-basic ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview doc-view jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi magit-patch magit-imenu git-rebase face-remap flow-fill cl-print qp sort smiley gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check gnus-async gnus-bcklg gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-ml gnus-msg disp-table nndoc gnus-cache gnus-dup gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader range wid-edit mm-archive gnutls url-http-ntlm ntlm hmac-md5 hex-util md4 network-stream url-cache display-line-numbers debbugs-gnu debbugs-compat debbugs soap-client url-http url-gw nsm rng-xsd rng-dt rng-util xsd-regexp xml sh-script treesit misc dabbrev shortdoc help-fns radix-tree executable find-dired grep misearch multi-isearch bug-reference vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view vc-fe vc vc-dispatcher dired-aux vc-hg tramp tramp-loaddefs trampver tramp-integration tramp-compat parse-time iso8601 ls-lisp jane-merlin merlin-imenu merlin-xref merlin-cap merlin jane-async-merlin jane-completion jane-common jane-project xref files-x jane-fe-menu ecaml_plugin linum view gopcaml magit-bookmark bookmark image+ advice image-file image-converter editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch whitespace jane-auto-modes vba-mode markdown-mode color jane jane-micro-features jane-diff unified-test-mode shell-file core core-buffer core-error core-util ert pp ewoc debug backtrace jane-sexp jane-ocaml jane-tuareg-theme tuareg tuareg-compat tuareg-opam skeleton flymake-proc flymake warnings smie caml-types caml-help caml-emacs find-file compile jane-cr jane-align jane-deprecated jane-smerge gnu-elpa-keyring-update jane-ocp-indent ocp-indent cl jane-util page-ext dired-x magit-extras project magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff diff-mode git-commit log-edit message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell server magit-mode transient edmacro kmacro magit-git magit-section magit-utils crm dash cl-extra help-mode windmove org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities time-date noutline outline icons ob-emacs-lisp ob-core ob-eval org-cycle org-table ol rx org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs format-spec gdb-mi bindat gud easy-mmode comint ansi-osc ansi-color ring ffap thingatpt vundo pcase cyberpunk-theme savehist saveplace project-autoloads vundo-autoloads magit-autoloads xref-autoloads csv-mode-autoloads magit-section-autoloads cyberpunk-theme-autoloads url-http-ntlm-autoloads url-auth git-commit-autoloads with-editor-autoloads finder-inf info dash-autoloads vc-hgcmd-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 2234155 565776) (symbols 48 54789 58) (strings 32 299384 119240) (string-bytes 1 11967634) (vectors 16 139996) (vector-slots 8 4948009 292456) (floats 8 3298 2024) (intervals 56 249713 3212) (buffers 976 319) (heap 1024 956749 66571)) ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-12 17:48 bug#63469: 29.0.90; project.el doesn't add menu-bar entries Spencer Baugh @ 2023-05-12 19:09 ` Eli Zaretskii 2023-05-12 19:25 ` Dmitry Gutov 2023-05-15 16:49 ` Juri Linkov ` (2 subsequent siblings) 3 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-12 19:09 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469 > From: Spencer Baugh <sbaugh@janestreet.com> > Date: Fri, 12 May 2023 13:48:15 -0400 > > Some proposed additions: > - File, "Open File In Project", > project-find-file > - Edit -> Search, "Search Files In Project", > project-find-regexp > - Edit -> Replace, "Replace Regexp In Project", > project-query-replace-regexp > - Tools -> Shell Commands, "Run Shell Interactively In Project", > project-shell > - Buffers, "Select Buffer In Project", > project-switch-to-buffer SGTM, thanks. > These menu items could be set to only appear when the current buffer is > in a project, or they could just always appear. I think it would be > better for them to always appear, personally. Maybe they should be disabled when the current is not in a project? ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-12 19:09 ` Eli Zaretskii @ 2023-05-12 19:25 ` Dmitry Gutov 0 siblings, 0 replies; 70+ messages in thread From: Dmitry Gutov @ 2023-05-12 19:25 UTC (permalink / raw) To: Eli Zaretskii, Spencer Baugh; +Cc: 63469 On 12/05/2023 22:09, Eli Zaretskii wrote: >> These menu items could be set to only appear when the current buffer is >> in a project, or they could just always appear. I think it would be >> better for them to always appear, personally. > Maybe they should be disabled when the current is not in a project? Calling (project-current) might not be the best idea after every user command: e.g. it might not be cached, and sometimes not very fast (e.g. over Tramp). The current design work off the idea of calling it only when the user explicitly calls a related command. All project-* commands fall back to prompting for project directory, so it shouldn't hurt to enable those menu entries unconditionally. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-12 17:48 bug#63469: 29.0.90; project.el doesn't add menu-bar entries Spencer Baugh 2023-05-12 19:09 ` Eli Zaretskii @ 2023-05-15 16:49 ` Juri Linkov 2023-05-15 18:15 ` Spencer Baugh 2023-05-15 18:19 ` Eli Zaretskii 2023-05-15 18:11 ` Spencer Baugh 2023-06-28 0:54 ` Spencer Baugh 3 siblings, 2 replies; 70+ messages in thread From: Juri Linkov @ 2023-05-15 16:49 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469 > Some proposed additions: > - File, "Open File In Project", > project-find-file > - Edit -> Search, "Search Files In Project", > project-find-regexp > - Edit -> Replace, "Replace Regexp In Project", > project-query-replace-regexp > - Tools -> Shell Commands, "Run Shell Interactively In Project", > project-shell > - Buffers, "Select Buffer In Project", > project-switch-to-buffer OTOH, when project menu entries are grouped under a single submenu, it would easier to use them, including context menus, etc. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-15 16:49 ` Juri Linkov @ 2023-05-15 18:15 ` Spencer Baugh 2023-05-15 18:19 ` Eli Zaretskii 1 sibling, 0 replies; 70+ messages in thread From: Spencer Baugh @ 2023-05-15 18:15 UTC (permalink / raw) To: Juri Linkov; +Cc: 63469 Juri Linkov <juri@linkov.net> writes: >> Some proposed additions: >> - File, "Open File In Project", >> project-find-file >> - Edit -> Search, "Search Files In Project", >> project-find-regexp >> - Edit -> Replace, "Replace Regexp In Project", >> project-query-replace-regexp >> - Tools -> Shell Commands, "Run Shell Interactively In Project", >> project-shell >> - Buffers, "Select Buffer In Project", >> project-switch-to-buffer > > OTOH, when project menu entries are grouped under a single submenu, > it would easier to use them, including context menus, etc. Both approaches have their own merits. Putting the project commands next to the non-project equivalents in the menus makes them easier to find for users who don't already know about them, which I think is one of the main points of the menu bar. And, considering that both approaches have their own merits, I'll note that we already one "single submenu" for project commands: The C-x p prefix, which groups all the project commands together, and that's what an experienced user is likely to use. Taking the other approach in the menu bar lets us get the best of both words. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-15 16:49 ` Juri Linkov 2023-05-15 18:15 ` Spencer Baugh @ 2023-05-15 18:19 ` Eli Zaretskii 1 sibling, 0 replies; 70+ messages in thread From: Eli Zaretskii @ 2023-05-15 18:19 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, 63469 > Cc: 63469@debbugs.gnu.org > From: Juri Linkov <juri@linkov.net> > Date: Mon, 15 May 2023 19:49:11 +0300 > > > Some proposed additions: > > - File, "Open File In Project", > > project-find-file > > - Edit -> Search, "Search Files In Project", > > project-find-regexp > > - Edit -> Replace, "Replace Regexp In Project", > > project-query-replace-regexp > > - Tools -> Shell Commands, "Run Shell Interactively In Project", > > project-shell > > - Buffers, "Select Buffer In Project", > > project-switch-to-buffer > > OTOH, when project menu entries are grouped under a single submenu, > it would easier to use them, including context menus, etc. These are not exclusive alternatives, we could have both a separate menu and individual items in other menus. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-12 17:48 bug#63469: 29.0.90; project.el doesn't add menu-bar entries Spencer Baugh 2023-05-12 19:09 ` Eli Zaretskii 2023-05-15 16:49 ` Juri Linkov @ 2023-05-15 18:11 ` Spencer Baugh 2023-05-15 18:37 ` Eli Zaretskii 2023-06-28 0:54 ` Spencer Baugh 3 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-05-15 18:11 UTC (permalink / raw) To: 63469 [-- Attachment #1: Type: text/plain, Size: 262 bytes --] The attached patch resolves this. There's also a slight tweak to the text of the menu entry for "Compile" to make it clearer that "compile" runs in CWD, where as "project-compile" runs on the current project. Otherwise I think it would be slightly confusing. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Add-project-command-entries-to-the-menu-bar.patch --] [-- Type: text/x-patch, Size: 5391 bytes --] From bd5d6d53da5e26cfd7fd40bcd0219ece5fd5b702 Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@janestreet.com> Date: Mon, 15 May 2023 14:01:32 -0400 Subject: [PATCH] Add project command entries to the menu-bar * lisp/menu-bar.el (menu-bar-file-menu): Add project-dired and project-find-file entries. (menu-bar-search-menu): Add project-find-regexp entry. (menu-bar-replace-menu): Add project-query-replace regexp entry. (menu-bar-shell-commands-menu): Add project-shell entry. (menu-bar-buffers-menu-command-entries): Add project-switch-to-buffer and project-list-buffer entries. (menu-bar-tools-menu): Add project-compile entry and change text for compile entry. --- lisp/menu-bar.el | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index d020cf6e90a..e5784519c49 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -219,10 +219,18 @@ menu-bar-file-menu '(menu-item "Insert File..." insert-file :enable (menu-bar-non-minibuffer-window-p) :help "Insert another file into current buffer")) + (bindings--define-key menu [project-dired] + '(menu-item "Open Root Directory Of Project..." project-dired + :enable (menu-bar-non-minibuffer-window-p) + :help "Read the root directory of the current project, to operate on its files")) (bindings--define-key menu [dired] '(menu-item "Open Directory..." dired :enable (menu-bar-non-minibuffer-window-p) :help "Read a directory, to operate on its files")) + (bindings--define-key menu [project-open-file] + '(menu-item "Open File In Project..." project-find-file + :enable (menu-bar-non-minibuffer-window-p) + :help "Read an existing file in the current project into an Emacs buffer")) (bindings--define-key menu [open-file] '(menu-item "Open File..." menu-find-file-existing :enable (menu-bar-non-minibuffer-window-p) @@ -347,6 +355,9 @@ menu-bar-search-menu (bindings--define-key menu [tags-srch] '(menu-item "Search Tagged Files..." tags-search :help "Search for a regexp in all tagged files")) + (bindings--define-key menu [project-search] + '(menu-item "Search in Project Files..." project-find-regexp + :help "Search for a regexp in files of the current project")) (bindings--define-key menu [separator-tag-search] menu-bar-separator) (bindings--define-key menu [repeat-search-back] @@ -395,6 +406,9 @@ menu-bar-replace-menu :enable (and (featurep 'fileloop) (not (eq fileloop--operate-function 'ignore))) :help "Continue last tags replace operation")) + (bindings--define-key menu [project-replace] + '(menu-item "Replace in Project Files..." project-query-replace-regexp + :help "Interactively replace a regexp in files of the current project")) (bindings--define-key menu [tags-repl] '(menu-item "Replace in Tagged Files..." tags-query-replace :help "Interactively replace a regexp in all tagged files")) @@ -1746,6 +1760,10 @@ menu-bar-encryption-decryption-menu (defvar menu-bar-shell-commands-menu (let ((menu (make-sparse-keymap "Shell Commands"))) + (bindings--define-key menu [project-interactive-shell] + '(menu-item "Run Shell Interactively In Project" project-shell + :help "Run a subshell interactively, in the current project")) + (bindings--define-key menu [interactive-shell] '(menu-item "Run Shell Interactively" shell :help "Run a subshell interactively")) @@ -1860,9 +1878,13 @@ menu-bar-tools-menu (bindings--define-key menu [gdb] '(menu-item "Debugger (GDB)..." gdb :help "Debug a program from within Emacs with GDB")) + (bindings--define-key menu [project-compile] + '(menu-item "Compile Project..." project-compile + :help "Invoke compiler or Make for current project, view compilation errors")) + (bindings--define-key menu [compile] - '(menu-item "Compile..." compile - :help "Invoke compiler or Make, view compilation errors")) + '(menu-item "Compile Current Directory..." compile + :help "Invoke compiler or Make in current directory, view compilation errors")) (bindings--define-key menu [shell-commands] `(menu-item "Shell Commands" @@ -2347,7 +2369,17 @@ menu-bar-buffers-menu-command-entries 'menu-item "List All Buffers" 'list-buffers - :help "Pop up a window listing all Emacs buffers")) + :help "Pop up a window listing all Emacs buffers") + (list 'select-buffer-in-project + 'menu-item + "Select Buffer In Project..." + 'project-switch-to-buffer + :help "Prompt for a buffer name in the current project, and select that buffer in the current window") + (list 'list-buffers-in-project + 'menu-item + "List Buffers In Project..." + 'project-list-buffers + :help "Pop up a window listing all Emacs buffers in the current project")) "Entries to be included at the end of the \"Buffers\" menu.") (defvar menu-bar-select-buffer-function 'switch-to-buffer -- 2.30.2 ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-15 18:11 ` Spencer Baugh @ 2023-05-15 18:37 ` Eli Zaretskii 2023-05-15 18:46 ` Spencer Baugh 0 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-15 18:37 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469 > From: Spencer Baugh <sbaugh@janestreet.com> > Date: Mon, 15 May 2023 14:11:08 -0400 > > The attached patch resolves this. There's also a slight tweak to the > text of the menu entry for "Compile" to make it clearer that "compile" > runs in CWD, where as "project-compile" runs on the current project. > Otherwise I think it would be slightly confusing. Thanks. > (defvar menu-bar-shell-commands-menu > (let ((menu (make-sparse-keymap "Shell Commands"))) > + (bindings--define-key menu [project-interactive-shell] > + '(menu-item "Run Shell Interactively In Project" project-shell > + :help "Run a subshell interactively, in the current project")) What does it mean to "run a shell in the current project"? A shell doesn't run in a project. Maybe you meant in the project's root directory? > + (bindings--define-key menu [project-compile] > + '(menu-item "Compile Project..." project-compile > + :help "Invoke compiler or Make for current project, view compilation errors")) This tool-tip text is too long. Maybe drop the "compilation" part. > + '(menu-item "Compile Current Directory..." compile > + :help "Invoke compiler or Make in current directory, view compilation errors")) What is a "current directory" when you are talking about Emacs? > + (list 'select-buffer-in-project > + 'menu-item > + "Select Buffer In Project..." > + 'project-switch-to-buffer > + :help "Prompt for a buffer name in the current project, and select that buffer in the current window") This tool-tip text is _way_ too long. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-15 18:37 ` Eli Zaretskii @ 2023-05-15 18:46 ` Spencer Baugh 2023-05-16 16:09 ` Eli Zaretskii 0 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-05-15 18:46 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 63469 [-- Attachment #1: Type: text/plain, Size: 1990 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> From: Spencer Baugh <sbaugh@janestreet.com> >> Date: Mon, 15 May 2023 14:11:08 -0400 >> >> The attached patch resolves this. There's also a slight tweak to the >> text of the menu entry for "Compile" to make it clearer that "compile" >> runs in CWD, where as "project-compile" runs on the current project. >> Otherwise I think it would be slightly confusing. > > Thanks. > >> (defvar menu-bar-shell-commands-menu >> (let ((menu (make-sparse-keymap "Shell Commands"))) >> + (bindings--define-key menu [project-interactive-shell] >> + '(menu-item "Run Shell Interactively In Project" project-shell >> + :help "Run a subshell interactively, in the current project")) > > What does it mean to "run a shell in the current project"? A shell > doesn't run in a project. Maybe you meant in the project's root > directory? Yes, changed to "In Project Root". >> + (bindings--define-key menu [project-compile] >> + '(menu-item "Compile Project..." project-compile >> + :help "Invoke compiler or Make for current project, view compilation errors")) > > This tool-tip text is too long. Maybe drop the "compilation" part. Dropped. >> + '(menu-item "Compile Current Directory..." compile >> + :help "Invoke compiler or Make in current directory, view compilation errors")) > > What is a "current directory" when you are talking about Emacs? I usually think of the default-directory of the current buffer as the "current directory". But maybe that's not the terminology we want to use? How about "Compile Buffer" with help text "[...] in directory of current buffer [...]"? >> + (list 'select-buffer-in-project >> + 'menu-item >> + "Select Buffer In Project..." >> + 'project-switch-to-buffer >> + :help "Prompt for a buffer name in the current project, and select that buffer in the current window") > > This tool-tip text is _way_ too long. Shrunk. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Add-project-command-entries-to-the-menu-bar.patch --] [-- Type: text/x-patch, Size: 5223 bytes --] From ac0e09e9a33fc6235d1638df4f1e5ede7d9dbd32 Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@janestreet.com> Date: Mon, 15 May 2023 14:01:32 -0400 Subject: [PATCH] Add project command entries to the menu-bar * lisp/menu-bar.el (menu-bar-file-menu): Add project-dired and project-find-file entries. (menu-bar-search-menu): Add project-find-regexp entry. (menu-bar-replace-menu): Add project-query-replace regexp entry. (menu-bar-shell-commands-menu): Add project-shell entry. (menu-bar-buffers-menu-command-entries): Add project-switch-to-buffer and project-list-buffer entries. (menu-bar-tools-menu): Add project-compile entry and change text for compile entry. --- lisp/menu-bar.el | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index d020cf6e90a..1f66ea85ecd 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -219,10 +219,18 @@ menu-bar-file-menu '(menu-item "Insert File..." insert-file :enable (menu-bar-non-minibuffer-window-p) :help "Insert another file into current buffer")) + (bindings--define-key menu [project-dired] + '(menu-item "Open Root Directory Of Project..." project-dired + :enable (menu-bar-non-minibuffer-window-p) + :help "Read the root directory of the current project, to operate on its files")) (bindings--define-key menu [dired] '(menu-item "Open Directory..." dired :enable (menu-bar-non-minibuffer-window-p) :help "Read a directory, to operate on its files")) + (bindings--define-key menu [project-open-file] + '(menu-item "Open File In Project..." project-find-file + :enable (menu-bar-non-minibuffer-window-p) + :help "Read an existing file in the current project into an Emacs buffer")) (bindings--define-key menu [open-file] '(menu-item "Open File..." menu-find-file-existing :enable (menu-bar-non-minibuffer-window-p) @@ -347,6 +355,9 @@ menu-bar-search-menu (bindings--define-key menu [tags-srch] '(menu-item "Search Tagged Files..." tags-search :help "Search for a regexp in all tagged files")) + (bindings--define-key menu [project-search] + '(menu-item "Search in Project Files..." project-find-regexp + :help "Search for a regexp in files of the current project")) (bindings--define-key menu [separator-tag-search] menu-bar-separator) (bindings--define-key menu [repeat-search-back] @@ -398,6 +409,9 @@ menu-bar-replace-menu (bindings--define-key menu [tags-repl] '(menu-item "Replace in Tagged Files..." tags-query-replace :help "Interactively replace a regexp in all tagged files")) + (bindings--define-key menu [project-replace] + '(menu-item "Replace in Project Files..." project-query-replace-regexp + :help "Interactively replace a regexp in files of the current project")) (bindings--define-key menu [separator-replace-tags] menu-bar-separator) @@ -1746,6 +1760,10 @@ menu-bar-encryption-decryption-menu (defvar menu-bar-shell-commands-menu (let ((menu (make-sparse-keymap "Shell Commands"))) + (bindings--define-key menu [project-interactive-shell] + '(menu-item "Run Shell Interactively In Project Root" project-shell + :help "Run a subshell interactively, in the current project")) + (bindings--define-key menu [interactive-shell] '(menu-item "Run Shell Interactively" shell :help "Run a subshell interactively")) @@ -1860,9 +1878,13 @@ menu-bar-tools-menu (bindings--define-key menu [gdb] '(menu-item "Debugger (GDB)..." gdb :help "Debug a program from within Emacs with GDB")) + (bindings--define-key menu [project-compile] + '(menu-item "Compile Project..." project-compile + :help "Invoke compiler or Make for current project, view errors")) + (bindings--define-key menu [compile] - '(menu-item "Compile..." compile - :help "Invoke compiler or Make, view compilation errors")) + '(menu-item "Compile Buffer..." compile + :help "Invoke compiler or Make in directory of this buffer, view errors")) (bindings--define-key menu [shell-commands] `(menu-item "Shell Commands" @@ -2347,7 +2369,17 @@ menu-bar-buffers-menu-command-entries 'menu-item "List All Buffers" 'list-buffers - :help "Pop up a window listing all Emacs buffers")) + :help "Pop up a window listing all Emacs buffers") + (list 'select-buffer-in-project + 'menu-item + "Select Buffer In Project..." + 'project-switch-to-buffer + :help "Prompt for a buffer in the current project, and switch to it") + (list 'list-buffers-in-project + 'menu-item + "List Buffers In Project..." + 'project-list-buffers + :help "Pop up a window listing all Emacs buffers in the current project")) "Entries to be included at the end of the \"Buffers\" menu.") (defvar menu-bar-select-buffer-function 'switch-to-buffer -- 2.30.2 ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-15 18:46 ` Spencer Baugh @ 2023-05-16 16:09 ` Eli Zaretskii 2023-05-16 17:09 ` Spencer Baugh 0 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-16 16:09 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469 > From: Spencer Baugh <sbaugh@janestreet.com> > Cc: 63469@debbugs.gnu.org > Date: Mon, 15 May 2023 14:46:19 -0400 > > >> + '(menu-item "Compile Current Directory..." compile > >> + :help "Invoke compiler or Make in current directory, view compilation errors")) > > > > What is a "current directory" when you are talking about Emacs? > > I usually think of the default-directory of the current buffer as the > "current directory". But maybe that's not the terminology we want to > use? How about "Compile Buffer" with help text "[...] in directory of > current buffer [...]"? I'd suggest Invoke compiler or Make in current buffer's directory, view errors ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-16 16:09 ` Eli Zaretskii @ 2023-05-16 17:09 ` Spencer Baugh 2023-05-17 11:30 ` Eli Zaretskii 0 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-05-16 17:09 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 63469 [-- Attachment #1: Type: text/plain, Size: 50 bytes --] Also with the bug number in the commit message. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Add-project-command-entries-to-the-menu-bar.patch --] [-- Type: text/x-patch, Size: 5347 bytes --] From 6cbc09fbdeeb12b039c1b3bca391c1b3acb9232a Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@janestreet.com> Date: Mon, 15 May 2023 14:01:32 -0400 Subject: [PATCH] Add project command entries to the menu-bar This will make it easier for new users to learn these increasingly important and useful commands. (Bug#63469) * lisp/menu-bar.el (menu-bar-file-menu): Add project-dired and project-find-file entries. (menu-bar-search-menu): Add project-find-regexp entry. (menu-bar-replace-menu): Add project-query-replace regexp entry. (menu-bar-shell-commands-menu): Add project-shell entry. (menu-bar-buffers-menu-command-entries): Add project-switch-to-buffer and project-list-buffer entries. (menu-bar-tools-menu): Add project-compile entry and change text for compile entry. --- lisp/menu-bar.el | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index d020cf6e90a..ae806dadbd1 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -219,10 +219,18 @@ menu-bar-file-menu '(menu-item "Insert File..." insert-file :enable (menu-bar-non-minibuffer-window-p) :help "Insert another file into current buffer")) + (bindings--define-key menu [project-dired] + '(menu-item "Open Root Directory Of Project..." project-dired + :enable (menu-bar-non-minibuffer-window-p) + :help "Read the root directory of the current project, to operate on its files")) (bindings--define-key menu [dired] '(menu-item "Open Directory..." dired :enable (menu-bar-non-minibuffer-window-p) :help "Read a directory, to operate on its files")) + (bindings--define-key menu [project-open-file] + '(menu-item "Open File In Project..." project-find-file + :enable (menu-bar-non-minibuffer-window-p) + :help "Read an existing file in the current project into an Emacs buffer")) (bindings--define-key menu [open-file] '(menu-item "Open File..." menu-find-file-existing :enable (menu-bar-non-minibuffer-window-p) @@ -347,6 +355,9 @@ menu-bar-search-menu (bindings--define-key menu [tags-srch] '(menu-item "Search Tagged Files..." tags-search :help "Search for a regexp in all tagged files")) + (bindings--define-key menu [project-search] + '(menu-item "Search in Project Files..." project-find-regexp + :help "Search for a regexp in files of the current project")) (bindings--define-key menu [separator-tag-search] menu-bar-separator) (bindings--define-key menu [repeat-search-back] @@ -398,6 +409,9 @@ menu-bar-replace-menu (bindings--define-key menu [tags-repl] '(menu-item "Replace in Tagged Files..." tags-query-replace :help "Interactively replace a regexp in all tagged files")) + (bindings--define-key menu [project-replace] + '(menu-item "Replace in Project Files..." project-query-replace-regexp + :help "Interactively replace a regexp in files of the current project")) (bindings--define-key menu [separator-replace-tags] menu-bar-separator) @@ -1746,6 +1760,10 @@ menu-bar-encryption-decryption-menu (defvar menu-bar-shell-commands-menu (let ((menu (make-sparse-keymap "Shell Commands"))) + (bindings--define-key menu [project-interactive-shell] + '(menu-item "Run Shell Interactively In Project Root" project-shell + :help "Run a subshell interactively, in the current project")) + (bindings--define-key menu [interactive-shell] '(menu-item "Run Shell Interactively" shell :help "Run a subshell interactively")) @@ -1860,9 +1878,13 @@ menu-bar-tools-menu (bindings--define-key menu [gdb] '(menu-item "Debugger (GDB)..." gdb :help "Debug a program from within Emacs with GDB")) + (bindings--define-key menu [project-compile] + '(menu-item "Compile Project..." project-compile + :help "Invoke compiler or Make for current project, view errors")) + (bindings--define-key menu [compile] - '(menu-item "Compile..." compile - :help "Invoke compiler or Make, view compilation errors")) + '(menu-item "Compile Buffer Directory..." compile + :help "Invoke compiler or Make in current buffer's directory, view errors")) (bindings--define-key menu [shell-commands] `(menu-item "Shell Commands" @@ -2347,7 +2369,17 @@ menu-bar-buffers-menu-command-entries 'menu-item "List All Buffers" 'list-buffers - :help "Pop up a window listing all Emacs buffers")) + :help "Pop up a window listing all Emacs buffers") + (list 'select-buffer-in-project + 'menu-item + "Select Buffer In Project..." + 'project-switch-to-buffer + :help "Prompt for a buffer in the current project, and switch to it") + (list 'list-buffers-in-project + 'menu-item + "List Buffers In Project..." + 'project-list-buffers + :help "Pop up a window listing all Emacs buffers in the current project")) "Entries to be included at the end of the \"Buffers\" menu.") (defvar menu-bar-select-buffer-function 'switch-to-buffer -- 2.30.2 ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-16 17:09 ` Spencer Baugh @ 2023-05-17 11:30 ` Eli Zaretskii 2023-05-17 14:50 ` Spencer Baugh 2023-05-18 6:53 ` Dmitry Gutov 0 siblings, 2 replies; 70+ messages in thread From: Eli Zaretskii @ 2023-05-17 11:30 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469 > From: Spencer Baugh <sbaugh@janestreet.com> > Cc: 63469@debbugs.gnu.org > Date: Tue, 16 May 2023 13:09:56 -0400 > > Also with the bug number in the commit message. Thanks. This LGTM, but what about Juri's suggestion to have a separate Project menu under Tools, with all these as its items? ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-17 11:30 ` Eli Zaretskii @ 2023-05-17 14:50 ` Spencer Baugh 2023-05-18 6:53 ` Dmitry Gutov 1 sibling, 0 replies; 70+ messages in thread From: Spencer Baugh @ 2023-05-17 14:50 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 63469 [-- Attachment #1: Type: text/plain, Size: 376 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> From: Spencer Baugh <sbaugh@janestreet.com> >> Cc: 63469@debbugs.gnu.org >> Date: Tue, 16 May 2023 13:09:56 -0400 >> >> Also with the bug number in the commit message. > > Thanks. This LGTM, but what about Juri's suggestion to have a > separate Project menu under Tools, with all these as its items? Sounds reasonable to me, added. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Add-project-command-entries-to-the-menu-bar.patch --] [-- Type: text/x-patch, Size: 9558 bytes --] From 1f7e2b3f4fca80ed4a8958bc28501a2a75e4547d Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@janestreet.com> Date: Mon, 15 May 2023 14:01:32 -0400 Subject: [PATCH] Add project command entries to the menu-bar This will make it easier for new users to learn these increasingly important and useful commands. (Bug#63469) * lisp/menu-bar.el (menu-bar-file-menu): Add project-dired and project-find-file entries. (menu-bar-search-menu): Add project-find-regexp entry. (menu-bar-replace-menu): Add project-query-replace regexp entry. (menu-bar-shell-commands-menu): Add project-shell entry. (menu-bar-buffers-menu-command-entries): Add project-switch-to-buffer and project-list-buffer entries. (menu-bar-project-menu): Add. (menu-bar-tools-menu): Add "Project" submenu, and also project-compile entry and change text for compile entry. --- lisp/menu-bar.el | 66 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index d020cf6e90a..bf3548bcf47 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -219,10 +219,18 @@ menu-bar-file-menu '(menu-item "Insert File..." insert-file :enable (menu-bar-non-minibuffer-window-p) :help "Insert another file into current buffer")) + (bindings--define-key menu [project-dired] + '(menu-item "Open Root Directory Of Project..." project-dired + :enable (menu-bar-non-minibuffer-window-p) + :help "Read the root directory of the current project, to operate on its files")) (bindings--define-key menu [dired] '(menu-item "Open Directory..." dired :enable (menu-bar-non-minibuffer-window-p) :help "Read a directory, to operate on its files")) + (bindings--define-key menu [project-open-file] + '(menu-item "Open File In Project..." project-find-file + :enable (menu-bar-non-minibuffer-window-p) + :help "Read an existing file in the current project into an Emacs buffer")) (bindings--define-key menu [open-file] '(menu-item "Open File..." menu-find-file-existing :enable (menu-bar-non-minibuffer-window-p) @@ -347,6 +355,9 @@ menu-bar-search-menu (bindings--define-key menu [tags-srch] '(menu-item "Search Tagged Files..." tags-search :help "Search for a regexp in all tagged files")) + (bindings--define-key menu [project-search] + '(menu-item "Search in Project Files..." project-find-regexp + :help "Search for a regexp in files of the current project")) (bindings--define-key menu [separator-tag-search] menu-bar-separator) (bindings--define-key menu [repeat-search-back] @@ -398,6 +409,9 @@ menu-bar-replace-menu (bindings--define-key menu [tags-repl] '(menu-item "Replace in Tagged Files..." tags-query-replace :help "Interactively replace a regexp in all tagged files")) + (bindings--define-key menu [project-replace] + '(menu-item "Replace in Project Files..." project-query-replace-regexp + :help "Interactively replace a regexp in files of the current project")) (bindings--define-key menu [separator-replace-tags] menu-bar-separator) @@ -1746,6 +1760,10 @@ menu-bar-encryption-decryption-menu (defvar menu-bar-shell-commands-menu (let ((menu (make-sparse-keymap "Shell Commands"))) + (bindings--define-key menu [project-interactive-shell] + '(menu-item "Run Shell Interactively In Project Root" project-shell + :help "Run a subshell interactively, in the current project")) + (bindings--define-key menu [interactive-shell] '(menu-item "Run Shell Interactively" shell :help "Run a subshell interactively")) @@ -1765,6 +1783,31 @@ menu-bar-shell-commands-menu menu)) +(defvar menu-bar-project-menu + (let ((menu (make-sparse-keymap "Project"))) + (bindings--define-key menu [project-execute-extended-command] '(menu-item "Execute Extended Command..." project-execute-extended-command :help "Execute an extended command in project root")) + (bindings--define-key menu [project-query-replace-regexp] '(menu-item "Query Replace Regexp..." project-query-replace-regexp :help "Interactively replace a regexp in files of the current project")) + (bindings--define-key menu [project-or-external-find-regexp] '(menu-item "Find Regexp Including External Roots..." project-or-external-find-regexp :help "Search for a regexp in files of the current project or external files")) + (bindings--define-key menu [project-find-regexp] '(menu-item "Find Regexp..." project-find-regexp :help "Search for a regexp in files of the current project")) + (bindings--define-key menu [separator-project-search] menu-bar-separator) + (bindings--define-key menu [project-kill-buffers] '(menu-item "Kill Buffers..." project-kill-buffers :help "Kill the buffers belonging to the current project")) + (bindings--define-key menu [project-list-buffers] '(menu-item "List Buffers..." project-list-buffers :help "Pop up a window listing all Emacs buffers in the current project")) + (bindings--define-key menu [project-switch-to-buffer] '(menu-item "Switch To Buffer..." project-switch-to-buffer :help "Prompt for a buffer in the current project, and switch to it")) + (bindings--define-key menu [separator-project-buffers] menu-bar-separator) + (bindings--define-key menu [project-async-shell-command] '(menu-item "Async Shell Command..." project-async-shell-command :help "Invoke a shell command in project root asynchronously in background")) + (bindings--define-key menu [project-shell-command] '(menu-item "Shell Command..." project-shell-command :help "Invoke a shell command in project root and catch its output")) + (bindings--define-key menu [project-eshell] '(menu-item "Run Eshell In Project Root..." project-eshell :help "Run eshell for the current project")) + (bindings--define-key menu [project-shell] '(menu-item "Run Shell Interactively In Project Root" project-shell :help "Run a subshell interactively, in the current project")) + (bindings--define-key menu [project-compile] '(menu-item "Compile..." project-compile :help "Invoke compiler or Make for current project, view errors")) + (bindings--define-key menu [separator-project-programs] menu-bar-separator) + (bindings--define-key menu [project-switch-project] '(menu-item "Switch Project..." project-switch-project :help "Switch to another project and then run a command")) + (bindings--define-key menu [project-vc-dir] '(menu-item "VC Dir..." project-vc-dir :help "Show the VC status of the project repository")) + (bindings--define-key menu [project-dired] '(menu-item "Open Root Directory Of Project..." project-dired :help "Read the root directory of the current project, to operate on its files")) + (bindings--define-key menu [project-find-dir] '(menu-item "Open Directory..." project-find-dir :help "Open an existing directory in the current project")) + (bindings--define-key menu [project-or-external-find-file] '(menu-item "Open File Including External Roots..." project-or-external-find-file :help "Open an existing file in the current project or its external roots")) + (bindings--define-key menu [project-open-file] '(menu-item "Open File..." project-find-file :help "Open an existing file in the current project")) + menu)) + (defun menu-bar-read-mail () "Read mail using `read-mail-command'." (interactive) @@ -1851,6 +1894,9 @@ menu-bar-tools-menu '(menu-item "Language Server Support (Eglot)" eglot :help "Start language server suitable for this buffer's major-mode")) + (bindings--define-key menu [project] + `(menu-item "Project" ,menu-bar-project-menu)) + (bindings--define-key menu [ede] '(menu-item "Project Support (EDE)" global-ede-mode @@ -1860,9 +1906,13 @@ menu-bar-tools-menu (bindings--define-key menu [gdb] '(menu-item "Debugger (GDB)..." gdb :help "Debug a program from within Emacs with GDB")) + (bindings--define-key menu [project-compile] + '(menu-item "Compile Project..." project-compile + :help "Invoke compiler or Make for current project, view errors")) + (bindings--define-key menu [compile] - '(menu-item "Compile..." compile - :help "Invoke compiler or Make, view compilation errors")) + '(menu-item "Compile Buffer Directory..." compile + :help "Invoke compiler or Make in current buffer's directory, view errors")) (bindings--define-key menu [shell-commands] `(menu-item "Shell Commands" @@ -2347,7 +2397,17 @@ menu-bar-buffers-menu-command-entries 'menu-item "List All Buffers" 'list-buffers - :help "Pop up a window listing all Emacs buffers")) + :help "Pop up a window listing all Emacs buffers") + (list 'select-buffer-in-project + 'menu-item + "Select Buffer In Project..." + 'project-switch-to-buffer + :help "Prompt for a buffer in the current project, and switch to it") + (list 'list-buffers-in-project + 'menu-item + "List Buffers In Project..." + 'project-list-buffers + :help "Pop up a window listing all Emacs buffers in the current project")) "Entries to be included at the end of the \"Buffers\" menu.") (defvar menu-bar-select-buffer-function 'switch-to-buffer -- 2.30.2 ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-17 11:30 ` Eli Zaretskii 2023-05-17 14:50 ` Spencer Baugh @ 2023-05-18 6:53 ` Dmitry Gutov 2023-05-18 7:01 ` Eli Zaretskii 1 sibling, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-18 6:53 UTC (permalink / raw) To: Eli Zaretskii, Spencer Baugh; +Cc: 63469 On 17/05/2023 14:30, Eli Zaretskii wrote: >> From: Spencer Baugh<sbaugh@janestreet.com> >> Cc:63469@debbugs.gnu.org >> Date: Tue, 16 May 2023 13:09:56 -0400 >> >> Also with the bug number in the commit message. > Thanks. This LGTM, but what about Juri's suggestion to have a > separate Project menu under Tools, with all these as its items? I think there should be either one or another. Or there will be too much of them. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 6:53 ` Dmitry Gutov @ 2023-05-18 7:01 ` Eli Zaretskii 2023-05-18 9:49 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-18 7:01 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, 63469 > Date: Thu, 18 May 2023 09:53:52 +0300 > Cc: 63469@debbugs.gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 17/05/2023 14:30, Eli Zaretskii wrote: > >> From: Spencer Baugh<sbaugh@janestreet.com> > >> Cc:63469@debbugs.gnu.org > >> Date: Tue, 16 May 2023 13:09:56 -0400 > >> > >> Also with the bug number in the commit message. > > Thanks. This LGTM, but what about Juri's suggestion to have a > > separate Project menu under Tools, with all these as its items? > > I think there should be either one or another. Or there will be too much > of them. Why? what's wrong with having both? these menu items aren't visible unless someone actually drops down their parent menu. So they don't seem to be able to cause any excessive display clutter. The advantage of having both is that these items will be more discoverable, and support both discovery through the related functionality and through Package itself. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 7:01 ` Eli Zaretskii @ 2023-05-18 9:49 ` Dmitry Gutov 2023-05-18 10:23 ` Eli Zaretskii 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-18 9:49 UTC (permalink / raw) To: Eli Zaretskii; +Cc: sbaugh, 63469 On 18/05/2023 10:01, Eli Zaretskii wrote: >> Date: Thu, 18 May 2023 09:53:52 +0300 >> Cc: 63469@debbugs.gnu.org >> From: Dmitry Gutov <dmitry@gutov.dev> >> >> On 17/05/2023 14:30, Eli Zaretskii wrote: >>>> From: Spencer Baugh<sbaugh@janestreet.com> >>>> Cc:63469@debbugs.gnu.org >>>> Date: Tue, 16 May 2023 13:09:56 -0400 >>>> >>>> Also with the bug number in the commit message. >>> Thanks. This LGTM, but what about Juri's suggestion to have a >>> separate Project menu under Tools, with all these as its items? >> >> I think there should be either one or another. Or there will be too much >> of them. > > Why? what's wrong with having both? I think this will be the only example of menu entries present in several submenus, won't it? > these menu items aren't visible unless someone actually drops down > their parent menu. So they don't seem to be able to cause any > excessive display clutter. The same argument could be made that, if you're not using the menu at all (I don't), then there is no problem. > The advantage of having both is that these items will be more > discoverable, and support both discovery through the related > functionality and through Package itself. My objection is not a strong one. If people really find it useful to have both, so be it. But is sounds like an overkill. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 9:49 ` Dmitry Gutov @ 2023-05-18 10:23 ` Eli Zaretskii 2023-05-18 14:30 ` Spencer Baugh 0 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-18 10:23 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, 63469 > Date: Thu, 18 May 2023 12:49:48 +0300 > Cc: sbaugh@janestreet.com, 63469@debbugs.gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > >> I think there should be either one or another. Or there will be too much > >> of them. > > > > Why? what's wrong with having both? > > I think this will be the only example of menu entries present in several > submenus, won't it? I think so, yes. But that's not a disadvantage, either. > > The advantage of having both is that these items will be more > > discoverable, and support both discovery through the related > > functionality and through Package itself. > > My objection is not a strong one. If people really find it useful to > have both, so be it. But is sounds like an overkill. Many people think menu bar in Emacs are overkill (and turn it off), but we disagree and provide the menu bar anyway. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 10:23 ` Eli Zaretskii @ 2023-05-18 14:30 ` Spencer Baugh 2023-05-18 15:15 ` Eli Zaretskii 0 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-05-18 14:30 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Dmitry Gutov, 63469 Eli Zaretskii <eliz@gnu.org> writes: >> Date: Thu, 18 May 2023 12:49:48 +0300 >> Cc: sbaugh@janestreet.com, 63469@debbugs.gnu.org >> From: Dmitry Gutov <dmitry@gutov.dev> >> >> >> I think there should be either one or another. Or there will be too much >> >> of them. >> > >> > Why? what's wrong with having both? >> >> I think this will be the only example of menu entries present in several >> submenus, won't it? > > I think so, yes. But that's not a disadvantage, either. > >> > The advantage of having both is that these items will be more >> > discoverable, and support both discovery through the related >> > functionality and through Package itself. >> >> My objection is not a strong one. If people really find it useful to >> have both, so be it. But is sounds like an overkill. > > Many people think menu bar in Emacs are overkill (and turn it off), > but we disagree and provide the menu bar anyway. We could add the split menu items first and add the consolidated menu later if there is demand. No reason that we have to settle the question on whether to also have a consolidated menu now, if we're already in agreement to at least have split menu items. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 14:30 ` Spencer Baugh @ 2023-05-18 15:15 ` Eli Zaretskii 2023-05-18 15:57 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-18 15:15 UTC (permalink / raw) To: Spencer Baugh; +Cc: dmitry, 63469 > From: Spencer Baugh <sbaugh@janestreet.com> > Cc: Dmitry Gutov <dmitry@gutov.dev>, 63469@debbugs.gnu.org > Date: Thu, 18 May 2023 10:30:59 -0400 > > We could add the split menu items first and add the consolidated menu > later if there is demand. Didn't Juri ask for it already? ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 15:15 ` Eli Zaretskii @ 2023-05-18 15:57 ` Juri Linkov 2023-05-18 16:06 ` Eli Zaretskii ` (2 more replies) 0 siblings, 3 replies; 70+ messages in thread From: Juri Linkov @ 2023-05-18 15:57 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Spencer Baugh, 63469, dmitry >> We could add the split menu items first and add the consolidated menu >> later if there is demand. > > Didn't Juri ask for it already? When I said that a separate submenu might be useful, I meant a minor-mode submenu as used for other context submenus in 'context-menu-minor'. Is it possible to enable some formal minor mode in project-visited buffers? Then a minor-mode menu with project items could be associated with such minor mode and displayed at the end of the global menu and in context menus. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 15:57 ` Juri Linkov @ 2023-05-18 16:06 ` Eli Zaretskii 2023-05-18 19:34 ` Dmitry Gutov 2023-05-19 14:42 ` Spencer Baugh 2 siblings, 0 replies; 70+ messages in thread From: Eli Zaretskii @ 2023-05-18 16:06 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, 63469, dmitry > From: Juri Linkov <juri@linkov.net> > Cc: Spencer Baugh <sbaugh@janestreet.com>, dmitry@gutov.dev, > 63469@debbugs.gnu.org > Date: Thu, 18 May 2023 18:57:48 +0300 > > >> We could add the split menu items first and add the consolidated menu > >> later if there is demand. > > > > Didn't Juri ask for it already? > > When I said that a separate submenu might be useful, I meant a minor-mode > submenu as used for other context submenus in 'context-menu-minor'. > > Is it possible to enable some formal minor mode in project-visited > buffers? Then a minor-mode menu with project items could be associated > with such minor mode and displayed at the end of the global menu > and in context menus. I don't understand why would we need a minor mode to show a menu on the menu bar. The menu items are all related to popular project.el commands, so they should be visible regardless of any modes, IMO. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 15:57 ` Juri Linkov 2023-05-18 16:06 ` Eli Zaretskii @ 2023-05-18 19:34 ` Dmitry Gutov 2023-05-19 6:56 ` Juri Linkov 2023-05-19 14:42 ` Spencer Baugh 2 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-18 19:34 UTC (permalink / raw) To: Juri Linkov, Eli Zaretskii; +Cc: Spencer Baugh, 63469 On 18/05/2023 18:57, Juri Linkov wrote: > Is it possible to enable some formal minor mode in project-visited > buffers? Calculating whether a known project is associated with the buffer, we'd need to find it. Doing that can take non-negligible amount of time, e.g. in remote buffers, so we only do that on-demand, not in find-file-hook. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 19:34 ` Dmitry Gutov @ 2023-05-19 6:56 ` Juri Linkov 2023-05-19 10:44 ` Eli Zaretskii 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-19 6:56 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Spencer Baugh, Eli Zaretskii, 63469 >> Is it possible to enable some formal minor mode in project-visited >> buffers? > > Calculating whether a known project is associated with the buffer, we'd > need to find it. > > Doing that can take non-negligible amount of time, e.g. in remote buffers, > so we only do that on-demand, not in find-file-hook. This mode is intended for anyone who wants to show the menu only in project-supported buffers. To do this, they need to enable `global-project-mode': ```patch diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 7c51778d5d4..e6dc7aea9ca 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1883,5 +1883,30 @@ project-switch-project (let ((project-current-directory-override dir)) (call-interactively command)))) +(easy-menu-define project-mode-menu project-prefix-map + "Menu for `project-mode' buffers." + '("Project" + ["List buffers" project-list-buffers + :help "List project buffers"] + ;; ... + )) + +;;;###autoload +(define-minor-mode project-mode + "Toggle display of project menu in the project-aware buffers." + :lighter " Pro" + :keymap (define-keymap "<menu-bar>" project-mode-menu)) + +(defun project-mode--turn-on () + "Turn on `project-mode' in all pertinent buffers." + (when (project-current) + (project-mode 1))) + +;;;###autoload +(define-globalized-minor-mode global-project-mode + project-mode project-mode--turn-on + :group 'project + :version "30.1") + (provide 'project) ;;; project.el ends here ``` ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-19 6:56 ` Juri Linkov @ 2023-05-19 10:44 ` Eli Zaretskii 2023-05-19 17:46 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-19 10:44 UTC (permalink / raw) To: Juri Linkov; +Cc: dmitry, 63469, sbaugh > From: Juri Linkov <juri@linkov.net> > Cc: Eli Zaretskii <eliz@gnu.org>, Spencer Baugh <sbaugh@janestreet.com>, > 63469@debbugs.gnu.org > Date: Fri, 19 May 2023 09:56:31 +0300 > > This mode is intended for anyone who wants to show the menu > only in project-supported buffers. To do this, they need to > enable `global-project-mode': > > ```patch > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index 7c51778d5d4..e6dc7aea9ca 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -1883,5 +1883,30 @@ project-switch-project > (let ((project-current-directory-override dir)) > (call-interactively command)))) > > +(easy-menu-define project-mode-menu project-prefix-map > + "Menu for `project-mode' buffers." > + '("Project" > + ["List buffers" project-list-buffers > + :help "List project buffers"] > + ;; ... > + )) > + > +;;;###autoload > +(define-minor-mode project-mode > + "Toggle display of project menu in the project-aware buffers." > + :lighter " Pro" > + :keymap (define-keymap "<menu-bar>" project-mode-menu)) If this mode is only for showing the menu, then at least the mode's name should reflect that. And once again: I don't think I see the justification to have a minor mode whose only job is to show a menu-bar menu. I'm not even sure why we need to have a project-mode at all: AFAIU the project.el features are always available, so no mode is needed. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-19 10:44 ` Eli Zaretskii @ 2023-05-19 17:46 ` Juri Linkov 2023-05-19 18:28 ` Eli Zaretskii 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-19 17:46 UTC (permalink / raw) To: Eli Zaretskii; +Cc: dmitry, 63469, sbaugh >> +(define-minor-mode project-mode >> + "Toggle display of project menu in the project-aware buffers." >> + :lighter " Pro" >> + :keymap (define-keymap "<menu-bar>" project-mode-menu)) > > If this mode is only for showing the menu, then at least the mode's > name should reflect that. It can be used for anything. For example, to display the project name on the mode-line. (Then better to cache the project name in a new buffer-local variable.) ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-19 17:46 ` Juri Linkov @ 2023-05-19 18:28 ` Eli Zaretskii 2023-05-22 17:48 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-19 18:28 UTC (permalink / raw) To: Juri Linkov; +Cc: dmitry, 63469, sbaugh > From: Juri Linkov <juri@linkov.net> > Cc: dmitry@gutov.dev, sbaugh@janestreet.com, 63469@debbugs.gnu.org > Date: Fri, 19 May 2023 20:46:55 +0300 > > >> +(define-minor-mode project-mode > >> + "Toggle display of project menu in the project-aware buffers." > >> + :lighter " Pro" > >> + :keymap (define-keymap "<menu-bar>" project-mode-menu)) > > > > If this mode is only for showing the menu, then at least the mode's > > name should reflect that. > > It can be used for anything. For example, to display the project name > on the mode-line. (Then better to cache the project name in a new > buffer-local variable.) I don't see anything but the menu in the patch you suggested. I understand that in principle we could do many things there, but if you are proposing a real patch, not just an initial idea, please show all of the code you want to include in this mode. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-19 18:28 ` Eli Zaretskii @ 2023-05-22 17:48 ` Juri Linkov 2023-05-22 18:20 ` Eli Zaretskii 2023-05-22 19:59 ` Dmitry Gutov 0 siblings, 2 replies; 70+ messages in thread From: Juri Linkov @ 2023-05-22 17:48 UTC (permalink / raw) To: Eli Zaretskii; +Cc: dmitry, 63469, sbaugh [-- Attachment #1: Type: text/plain, Size: 1261 bytes --] >> >> +(define-minor-mode project-mode >> >> + "Toggle display of project menu in the project-aware buffers." >> >> + :lighter " Pro" >> >> + :keymap (define-keymap "<menu-bar>" project-mode-menu)) >> > >> > If this mode is only for showing the menu, then at least the mode's >> > name should reflect that. >> >> It can be used for anything. For example, to display the project name >> on the mode-line. (Then better to cache the project name in a new >> buffer-local variable.) > > I don't see anything but the menu in the patch you suggested. I > understand that in principle we could do many things there, but if you > are proposing a real patch, not just an initial idea, please show all > of the code you want to include in this mode. Actually I miss this feature very much. There is already the mode-line indication with the VC system name and the VC branch name, but no indication with a project name, so similar files in different projects all are showing the same "Git-master". Now here is the implementation of 'project-mode' based on 'vc-mode', and 'project-menu-entry' based on 'vc-menu-entry' that shows a project name alongside of vc info, and the mouse click opens the project menu using 'menu-bar-project-menu' implemented by Spencer. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: project-mode-line.patch --] [-- Type: text/x-diff, Size: 2343 bytes --] diff --git a/lisp/bindings.el b/lisp/bindings.el index c77b64c05da..ba9f44b920c 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -616,6 +616,7 @@ mode-line-end-spaces " " 'mode-line-position '(vc-mode vc-mode) + '(project-mode project-name) " " 'mode-line-modes 'mode-line-misc-info diff --git a/lisp/desktop.el b/lisp/desktop.el index 6aacb85c12c..6198441d788 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -547,6 +547,7 @@ desktop-minor-mode-table '((defining-kbd-macro nil) (isearch-mode nil) (vc-mode nil) + (project-mode nil) (vc-dir-mode nil) (erc-track-minor-mode nil) (savehist-mode nil)) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 7c51778d5d4..06bd0d09b8e 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1883,5 +1908,47 @@ project-switch-project (let ((project-current-directory-override dir)) (call-interactively command)))) +;;; Project mode + +;; Tell Emacs about this new kind of minor mode +(add-to-list 'minor-mode-alist '(project-mode project-name)) + +(defvar project-name nil + "The project name of the current buffer when it belongs to a project.") + +;;;###autoload +(put 'project-name 'risky-local-variable t) +(put 'project-name 'permanent-local t) + +(defvar project-menu-entry + `(menu-item ,(purecopy "Project") ,menu-bar-project-menu)) + +(defconst project-mode-line-map + (let ((map (make-sparse-keymap))) + (define-key map [mode-line down-mouse-1] project-menu-entry) + map)) + +;;;###autoload +(define-minor-mode project-mode + "Toggle display of project menu in the project-aware buffers." + (if project-mode + (setq-local project-name (concat + " " + (propertize + (project-name (project-current)) + 'mouse-face 'mode-line-highlight + 'local-map project-mode-line-map))))) + +(defun project-mode--turn-on () + "Turn on `project-mode' in all pertinent buffers." + (when (project-current) + (project-mode 1))) + +;;;###autoload +(define-globalized-minor-mode global-project-mode + project-mode project-mode--turn-on + :group 'project + :version "30.1") + (provide 'project) ;;; project.el ends here ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 17:48 ` Juri Linkov @ 2023-05-22 18:20 ` Eli Zaretskii 2023-05-22 19:49 ` Spencer Baugh 2023-05-23 6:49 ` Juri Linkov 2023-05-22 19:59 ` Dmitry Gutov 1 sibling, 2 replies; 70+ messages in thread From: Eli Zaretskii @ 2023-05-22 18:20 UTC (permalink / raw) To: Juri Linkov; +Cc: dmitry, 63469, sbaugh > From: Juri Linkov <juri@linkov.net> > Cc: dmitry@gutov.dev, sbaugh@janestreet.com, 63469@debbugs.gnu.org > Date: Mon, 22 May 2023 20:48:08 +0300 > > >> It can be used for anything. For example, to display the project name > >> on the mode-line. (Then better to cache the project name in a new > >> buffer-local variable.) > > > > I don't see anything but the menu in the patch you suggested. I > > understand that in principle we could do many things there, but if you > > are proposing a real patch, not just an initial idea, please show all > > of the code you want to include in this mode. > > Actually I miss this feature very much. There is already the mode-line > indication with the VC system name and the VC branch name, but > no indication with a project name, so similar files > in different projects all are showing the same "Git-master". We can show this on the mode line always, whenever there's a project. No need for a minor mode. > Now here is the implementation of 'project-mode' based on 'vc-mode', > and 'project-menu-entry' based on 'vc-menu-entry' that shows > a project name alongside of vc info, and the mouse click opens > the project menu using 'menu-bar-project-menu' implemented by Spencer. I still don't understand why this has to be a minor mode. Both mode-line indication and the menu bar can show this stuff regardless of any mode. It sounds like this mode is an unnecessary complication. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 18:20 ` Eli Zaretskii @ 2023-05-22 19:49 ` Spencer Baugh 2023-05-22 19:54 ` Dmitry Gutov 2023-05-23 6:52 ` Juri Linkov 2023-05-23 6:49 ` Juri Linkov 1 sibling, 2 replies; 70+ messages in thread From: Spencer Baugh @ 2023-05-22 19:49 UTC (permalink / raw) To: Eli Zaretskii; +Cc: dmitry, 63469, Juri Linkov Eli Zaretskii <eliz@gnu.org> writes: >> From: Juri Linkov <juri@linkov.net> >> Cc: dmitry@gutov.dev, sbaugh@janestreet.com, 63469@debbugs.gnu.org >> Date: Mon, 22 May 2023 20:48:08 +0300 >> >> >> It can be used for anything. For example, to display the project name >> >> on the mode-line. (Then better to cache the project name in a new >> >> buffer-local variable.) >> > >> > I don't see anything but the menu in the patch you suggested. I >> > understand that in principle we could do many things there, but if you >> > are proposing a real patch, not just an initial idea, please show all >> > of the code you want to include in this mode. >> >> Actually I miss this feature very much. There is already the mode-line >> indication with the VC system name and the VC branch name, but >> no indication with a project name, so similar files >> in different projects all are showing the same "Git-master". > > We can show this on the mode line always, whenever there's a project. > No need for a minor mode. This might get crowded when there's also the VC modeline indicator. Still, I would like this feature. And actually, the mention of VC makes me realize: We already do something expensive by default for every new buffer: Query the VC state. So maybe it's not so bad to run project-current every time we make a new buffer? Or at least, in the exact same situations that we query the VC state? Maybe we can even implement some sharing between the project-current lookup and the VC state query, for the vc project backend? >> Now here is the implementation of 'project-mode' based on 'vc-mode', >> and 'project-menu-entry' based on 'vc-menu-entry' that shows >> a project name alongside of vc info, and the mouse click opens >> the project menu using 'menu-bar-project-menu' implemented by Spencer. > > I still don't understand why this has to be a minor mode. Both > mode-line indication and the menu bar can show this stuff regardless > of any mode. It sounds like this mode is an unnecessary complication. (I personally agree that this should be always on, with perhaps a user option to turn it off.) ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 19:49 ` Spencer Baugh @ 2023-05-22 19:54 ` Dmitry Gutov 2023-05-22 21:20 ` Spencer Baugh 2023-05-23 6:52 ` Juri Linkov 1 sibling, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-22 19:54 UTC (permalink / raw) To: Spencer Baugh, Eli Zaretskii; +Cc: 63469, Juri Linkov On 22/05/2023 22:49, Spencer Baugh wrote: > And actually, the mention of VC makes > me realize: We already do something expensive by default for every new > buffer: Query the VC state. So maybe it's not so bad to run > project-current every time we make a new buffer? Or at least, in the > exact same situations that we query the VC state? Maybe we can even > implement some sharing between the project-current lookup and the VC > state query, for the vc project backend? The VC project backend is not the only backend out there. Others' performance characteristics may well be different. Further, its root-finding logic is different from VC. We also cannot simply see which backend the current file is registered at because project-vc has different options which affect how the root is determined. Long story short, we won't be able to simply reuse VC's cached info. > (I personally agree that this should be always on, with perhaps a user option to turn it off.) I'm fairly sure not everybody will like the additional delay when visiting files over Tramp. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 19:54 ` Dmitry Gutov @ 2023-05-22 21:20 ` Spencer Baugh 2023-05-22 21:30 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-05-22 21:20 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Eli Zaretskii, Juri Linkov, 63469 Dmitry Gutov <dmitry@gutov.dev> writes: > On 22/05/2023 22:49, Spencer Baugh wrote: >> And actually, the mention of VC makes >> me realize: We already do something expensive by default for every new >> buffer: Query the VC state. So maybe it's not so bad to run >> project-current every time we make a new buffer? Or at least, in the >> exact same situations that we query the VC state? Maybe we can even >> implement some sharing between the project-current lookup and the VC >> state query, for the vc project backend? > > The VC project backend is not the only backend out there. Others' > performance characteristics may well be different. > > Further, its root-finding logic is different from VC. We also cannot > simply see which backend the current file is registered at because > project-vc has different options which affect how the root is > determined. > > Long story short, we won't be able to simply reuse VC's cached info. I assume you've already considered this thoroughly, but could we just get rid of all those differences/merge them into vc? For example, I wonder if we could teach vc to have an option like project-vc-merge-submodules... or at least, teach vc to discover the parent project. That could maybe be useful in vc... >> (I personally agree that this should be always on, with perhaps a user > option to turn it off.) > > I'm fairly sure not everybody will like the additional delay when > visiting files over Tramp. We could simply not run it automatically for files on TRAMP. Do we run the vc find-file hook for files on TRAMP? Maybe we shouldn't... ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 21:20 ` Spencer Baugh @ 2023-05-22 21:30 ` Dmitry Gutov 2023-05-23 13:57 ` Michael Albinus 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-22 21:30 UTC (permalink / raw) To: Spencer Baugh; +Cc: Eli Zaretskii, Juri Linkov, 63469 On 23/05/2023 00:20, Spencer Baugh wrote: >> The VC project backend is not the only backend out there. Others' >> performance characteristics may well be different. >> >> Further, its root-finding logic is different from VC. We also cannot >> simply see which backend the current file is registered at because >> project-vc has different options which affect how the root is >> determined. >> >> Long story short, we won't be able to simply reuse VC's cached info. > > I assume you've already considered this thoroughly, but could we just > get rid of all those differences/merge them into vc? For example, I > wonder if we could teach vc to have an option like > project-vc-merge-submodules... or at least, teach vc to discover the > parent project. That could maybe be useful in vc... I haven't spent much time on that question, to be honest. But offhand I could say that those options won't necessarily make sense for VC. What would it mean for it to "discover parent project"? VC doesn't deal with projects, it deals with repositories. And altering what repository root it finds (or making the logic customizable) can have adverse effects. E.g. we have an option like project-vc-merge-submodules which moves the project root to the top repository. But as far as VC goes, it needs to be able to check in changes inside submodules. One of the steps in vc-git-checkin is to change default-directory to the return value of vc-git-root, to have the command called there. Similarly, I'm not sure what kind of effect would be appropriate for project-vc-extra-root-markers to have on VC functionality. >>> (I personally agree that this should be always on, with perhaps a user >> option to turn it off.) >> >> I'm fairly sure not everybody will like the additional delay when >> visiting files over Tramp. > > We could simply not run it automatically for files on TRAMP. Do we run > the vc find-file hook for files on TRAMP? Maybe we shouldn't... I thought there was some advice for vc-refresh-state somewhere, but I can't find it now. If you have time, you're welcome to look around. Tramp often disables certain costly features (or Emacs packages provide options disable such features, when used remotely). This will need to be taken into account somehow. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 21:30 ` Dmitry Gutov @ 2023-05-23 13:57 ` Michael Albinus 2023-05-24 1:07 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Michael Albinus @ 2023-05-23 13:57 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Spencer Baugh, Eli Zaretskii, 63469, Juri Linkov Dmitry Gutov <dmitry@gutov.dev> writes: Hi Dmitry, > Tramp often disables certain costly features (or Emacs packages > provide options disable such features, when used remotely). This will > need to be taken into account somehow. Tramp is a library, and as such it is stupid. It shouldn't have an opinion what's best suited for anybody. IOW, it doesn't enables/disables features on its own. There are configuration knobs Tramp follows, that's all. Best regards, Michael. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-23 13:57 ` Michael Albinus @ 2023-05-24 1:07 ` Dmitry Gutov 2023-05-24 8:38 ` Michael Albinus 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-24 1:07 UTC (permalink / raw) To: Michael Albinus; +Cc: Spencer Baugh, Eli Zaretskii, 63469, Juri Linkov Hi Michael, On 23/05/2023 16:57, Michael Albinus wrote: >> Tramp often disables certain costly features (or Emacs packages >> provide options disable such features, when used remotely). This will >> need to be taken into account somehow. > Tramp is a library, and as such it is stupid. It shouldn't have an > opinion what's best suited for anybody. > > IOW, it doesn't enables/disables features on its own. There are > configuration knobs Tramp follows, that's all. You can say that, but it's a relatively minor distinction. My point way, one should be on the lookout for potential performance problems. For example, we have the user option called enable-remote-dir-locals, which you added yourself. We might add a somewhat similar setting, though it's not obvious what to call it. Or, perhaps better, the user option which governs the addition of the new logic (off by default) would have a separate value which would mean "enable in remote buffers too". ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-24 1:07 ` Dmitry Gutov @ 2023-05-24 8:38 ` Michael Albinus 0 siblings, 0 replies; 70+ messages in thread From: Michael Albinus @ 2023-05-24 8:38 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Spencer Baugh, Eli Zaretskii, 63469, Juri Linkov Dmitry Gutov <dmitry@gutov.dev> writes: > Hi Michael, Hi Dmitry, >>> Tramp often disables certain costly features (or Emacs packages >>> provide options disable such features, when used remotely). This will >>> need to be taken into account somehow. >> Tramp is a library, and as such it is stupid. It shouldn't have an >> opinion what's best suited for anybody. >> IOW, it doesn't enables/disables features on its own. There are >> configuration knobs Tramp follows, that's all. > > You can say that, but it's a relatively minor distinction. My point > way, one should be on the lookout for potential performance problems. We don't disagree :-) I just wanted to clarify the point. > For example, we have the user option called enable-remote-dir-locals, > which you added yourself. We might add a somewhat similar setting, > though it's not obvious what to call it. Or, perhaps better, the user > option which governs the addition of the new logic (off by default) > would have a separate value which would mean "enable in remote buffers > too". Although I've added the user option, it isn't something restricted to Tramp internals. If you want to use it in a broader sense (meaning more different values), that's possible of course. We must respect backward compatibility, of course. Best regards, Michael. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 19:49 ` Spencer Baugh 2023-05-22 19:54 ` Dmitry Gutov @ 2023-05-23 6:52 ` Juri Linkov 2023-05-23 11:17 ` Eli Zaretskii 2023-05-24 1:10 ` Dmitry Gutov 1 sibling, 2 replies; 70+ messages in thread From: Juri Linkov @ 2023-05-23 6:52 UTC (permalink / raw) To: Spencer Baugh; +Cc: dmitry, Eli Zaretskii, 63469 >>> Actually I miss this feature very much. There is already the mode-line >>> indication with the VC system name and the VC branch name, but >>> no indication with a project name, so similar files >>> in different projects all are showing the same "Git-master". >> >> We can show this on the mode line always, whenever there's a project. >> No need for a minor mode. > > This might get crowded when there's also the VC modeline indicator. To get it less crowded the VC modeline indicator could be shorter. For most projects there is no need to show the backend name all the time. So instead of "Git-emacs-29" better to add a user option to be able to keep only the branch name, i.e. in 'vc-default-mode-line-string' such hard-coded string should be customizable: (concat backend-name "-" rev)) > Still, I would like this feature. And actually, the mention of VC makes > me realize: We already do something expensive by default for every new > buffer: Query the VC state. So maybe it's not so bad to run > project-current every time we make a new buffer? Or at least, in the > exact same situations that we query the VC state? Maybe we can even > implement some sharing between the project-current lookup and the VC > state query, for the vc project backend? Sharing between vc and project would be nice. If possible, this will allow a shorter modeline indicator that will combine vc and project like --- project-branch --- where the project name replaces the vc-backend name. > (I personally agree that this should be always on, with perhaps a user > option to turn it off.) Probably a boolean option would be simpler for users than such line: (assq-delete-all 'project-mode mode-line-format) ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-23 6:52 ` Juri Linkov @ 2023-05-23 11:17 ` Eli Zaretskii 2023-05-23 18:08 ` Juri Linkov 2023-05-24 1:10 ` Dmitry Gutov 1 sibling, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-05-23 11:17 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, 63469, dmitry > From: Juri Linkov <juri@linkov.net> > Cc: Eli Zaretskii <eliz@gnu.org>, dmitry@gutov.dev, 63469@debbugs.gnu.org > Date: Tue, 23 May 2023 09:52:13 +0300 > > > This might get crowded when there's also the VC modeline indicator. > > To get it less crowded the VC modeline indicator could be shorter. > For most projects there is no need to show the backend name all the time. > So instead of "Git-emacs-29" better to add a user option to be able > to keep only the branch name, i.e. in 'vc-default-mode-line-string' > such hard-coded string should be customizable: Maybe the customizable user option should leave to the user whether to show the VC info, the project info, or both? ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-23 11:17 ` Eli Zaretskii @ 2023-05-23 18:08 ` Juri Linkov 0 siblings, 0 replies; 70+ messages in thread From: Juri Linkov @ 2023-05-23 18:08 UTC (permalink / raw) To: Eli Zaretskii; +Cc: sbaugh, 63469, dmitry >> For most projects there is no need to show the backend name all the time. >> So instead of "Git-emacs-29" better to add a user option to be able >> to keep only the branch name, i.e. in 'vc-default-mode-line-string' >> such hard-coded string should be customizable: > > Maybe the customizable user option should leave to the user whether to > show the VC info, the project info, or both? One possibility is to allow more values for the existing user option 'vc-display-status'. Currently it's boolean, so even doesn't allow disabling display of the backend name on the mode line. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-23 6:52 ` Juri Linkov 2023-05-23 11:17 ` Eli Zaretskii @ 2023-05-24 1:10 ` Dmitry Gutov 2023-05-24 6:25 ` Juri Linkov 1 sibling, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-24 1:10 UTC (permalink / raw) To: Juri Linkov, Spencer Baugh; +Cc: Eli Zaretskii, 63469 On 23/05/2023 09:52, Juri Linkov wrote: >> Still, I would like this feature. And actually, the mention of VC makes >> me realize: We already do something expensive by default for every new >> buffer: Query the VC state. So maybe it's not so bad to run >> project-current every time we make a new buffer? Or at least, in the >> exact same situations that we query the VC state? Maybe we can even >> implement some sharing between the project-current lookup and the VC >> state query, for the vc project backend? > Sharing between vc and project would be nice. If possible, this will > allow a shorter modeline indicator that will combine vc and project like > > --- project-branch --- > > where the project name replaces the vc-backend name. That indeed sounds like something that should require specific configuration. There can be projects without a branch, or branches without "current project". Or situations like the project root is not the vc root. E.g. when the current buffer is in a submodule (so the current branch is submodule's), and the project pertains to the parent repository. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-24 1:10 ` Dmitry Gutov @ 2023-05-24 6:25 ` Juri Linkov 2023-05-25 1:15 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-24 6:25 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Spencer Baugh, Eli Zaretskii, 63469 >> Sharing between vc and project would be nice. If possible, this will >> allow a shorter modeline indicator that will combine vc and project like >> --- project-branch --- >> where the project name replaces the vc-backend name. > > That indeed sounds like something that should require specific > configuration. There can be projects without a branch, or branches without > "current project". > > Or situations like the project root is not the vc root. E.g. when the > current buffer is in a submodule (so the current branch is submodule's), > and the project pertains to the parent repository. The idea is simple: just to replace the backend name by the project name when the project and its name are non-nil. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-24 6:25 ` Juri Linkov @ 2023-05-25 1:15 ` Dmitry Gutov 2023-05-25 6:35 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-25 1:15 UTC (permalink / raw) To: Juri Linkov; +Cc: Spencer Baugh, Eli Zaretskii, 63469 On 24/05/2023 09:25, Juri Linkov wrote: >>> Sharing between vc and project would be nice. If possible, this will >>> allow a shorter modeline indicator that will combine vc and project like >>> --- project-branch --- >>> where the project name replaces the vc-backend name. >> That indeed sounds like something that should require specific >> configuration. There can be projects without a branch, or branches without >> "current project". >> >> Or situations like the project root is not the vc root. E.g. when the >> current buffer is in a submodule (so the current branch is submodule's), >> and the project pertains to the parent repository. > The idea is simple: just to replace the backend name by the project name > when the project and its name are non-nil. I'm not sure the effect will be clear enough and appreciated by all of our users. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-25 1:15 ` Dmitry Gutov @ 2023-05-25 6:35 ` Juri Linkov 2023-05-25 16:17 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-25 6:35 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Spencer Baugh, Eli Zaretskii, 63469 >>>> Sharing between vc and project would be nice. If possible, this will >>>> allow a shorter modeline indicator that will combine vc and project like >>>> --- project-branch --- >>>> where the project name replaces the vc-backend name. >>> That indeed sounds like something that should require specific >>> configuration. There can be projects without a branch, or branches without >>> "current project". >>> >>> Or situations like the project root is not the vc root. E.g. when the >>> current buffer is in a submodule (so the current branch is submodule's), >>> and the project pertains to the parent repository. >> The idea is simple: just to replace the backend name by the project name >> when the project and its name are non-nil. > > I'm not sure the effect will be clear enough and appreciated by all of our > users. This is intended only after customization like this that shows the backend by default: (defcustom vc-mode-line-format '(backend status revision) "What items to display on the mode line. Possible values: `project' - the current project name; `backend' - backend name; `status' - a character that denotes the vc status; `revision' - revision number and/or lock status; `commit' - commit name; `commit-abbr' - abbreviated commit name; `branch' - branch name; `separator' - a string between items. See more at Info node (emacs) VC Mode Line." :type '(repeat (choice (const :tag "Project name" project) (const :tag "Backend name" backend) (const :tag "Status character" status) (const :tag "Revision number/Lock status" revision) (const :tag "Commit name" commit) (const :tag "Abbreviated commit name" commit-abbr) (const :tag "Branch name" branch) (function :tag "Custom function") (string :tag "Separator"))) :version "30.1" :group 'vc) ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-25 6:35 ` Juri Linkov @ 2023-05-25 16:17 ` Dmitry Gutov 0 siblings, 0 replies; 70+ messages in thread From: Dmitry Gutov @ 2023-05-25 16:17 UTC (permalink / raw) To: Juri Linkov; +Cc: Spencer Baugh, Eli Zaretskii, 63469 On 25/05/2023 09:35, Juri Linkov wrote: >>>>> Sharing between vc and project would be nice. If possible, this will >>>>> allow a shorter modeline indicator that will combine vc and project like >>>>> --- project-branch --- >>>>> where the project name replaces the vc-backend name. >>>> That indeed sounds like something that should require specific >>>> configuration. There can be projects without a branch, or branches without >>>> "current project". >>>> >>>> Or situations like the project root is not the vc root. E.g. when the >>>> current buffer is in a submodule (so the current branch is submodule's), >>>> and the project pertains to the parent repository. >>> The idea is simple: just to replace the backend name by the project name >>> when the project and its name are non-nil. >> I'm not sure the effect will be clear enough and appreciated by all of our >> users. > This is intended only after customization like this that shows the backend > by default: > > (defcustom vc-mode-line-format '(backend status revision) > "What items to display on the mode line. > Possible values: > `project' - the current project name; > `backend' - backend name; > `status' - a character that denotes the vc status; > `revision' - revision number and/or lock status; > `commit' - commit name; > `commit-abbr' - abbreviated commit name; > `branch' - branch name; > `separator' - a string between items. > See more at Info node (emacs) VC Mode Line." > :type '(repeat > (choice > (const :tag "Project name" project) > (const :tag "Backend name" backend) > (const :tag "Status character" status) > (const :tag "Revision number/Lock status" revision) > (const :tag "Commit name" commit) > (const :tag "Abbreviated commit name" commit-abbr) > (const :tag "Branch name" branch) > (function :tag "Custom function") > (string :tag "Separator"))) > :version "30.1" > :group 'vc) It's not quite ideal, since there are projects without VCS and VC without projects (as mentioned previously), but it sounds like a worthy experiment. Especially since the new behavior will be optional. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 18:20 ` Eli Zaretskii 2023-05-22 19:49 ` Spencer Baugh @ 2023-05-23 6:49 ` Juri Linkov 1 sibling, 0 replies; 70+ messages in thread From: Juri Linkov @ 2023-05-23 6:49 UTC (permalink / raw) To: Eli Zaretskii; +Cc: dmitry, 63469, sbaugh >> Actually I miss this feature very much. There is already the mode-line >> indication with the VC system name and the VC branch name, but >> no indication with a project name, so similar files >> in different projects all are showing the same "Git-master". > > We can show this on the mode line always, whenever there's a project. > No need for a minor mode. Agreed. >> Now here is the implementation of 'project-mode' based on 'vc-mode', >> and 'project-menu-entry' based on 'vc-menu-entry' that shows >> a project name alongside of vc info, and the mouse click opens >> the project menu using 'menu-bar-project-menu' implemented by Spencer. > > I still don't understand why this has to be a minor mode. Both > mode-line indication and the menu bar can show this stuff regardless > of any mode. It sounds like this mode is an unnecessary complication. Agreed as well. The existing variable 'vc-mode' is not a minor mode. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 17:48 ` Juri Linkov 2023-05-22 18:20 ` Eli Zaretskii @ 2023-05-22 19:59 ` Dmitry Gutov 2023-05-23 6:46 ` Juri Linkov 1 sibling, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-22 19:59 UTC (permalink / raw) To: Juri Linkov, Eli Zaretskii; +Cc: sbaugh, 63469 On 22/05/2023 20:48, Juri Linkov wrote: > +;;;###autoload > +(define-minor-mode project-mode > + "Toggle display of project menu in the project-aware buffers." > + (if project-mode > + (setq-local project-name (concat > + " " > + (propertize > + (project-name (project-current)) > + 'mouse-face 'mode-line-highlight > + 'local-map project-mode-line-map))))) At the very least, this will need some better name, because project features don't need any mode to be turned on to be used. project-menu-mode? Next, I'm not quite sure about the caching of project-name. There is no scenario when it will be invalidated, right? Try simply calling (project-name (project-current t)) every time, see how the performance is. Or, more thoroughly, copy the if-let logic from project-prefixed-buffer-name. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-22 19:59 ` Dmitry Gutov @ 2023-05-23 6:46 ` Juri Linkov 2023-05-23 18:11 ` Juri Linkov 2023-05-24 1:00 ` Dmitry Gutov 0 siblings, 2 replies; 70+ messages in thread From: Juri Linkov @ 2023-05-23 6:46 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, Eli Zaretskii, 63469 >> +(define-minor-mode project-mode >> + "Toggle display of project menu in the project-aware buffers." >> + (if project-mode >> + (setq-local project-name (concat >> + " " >> + (propertize >> + (project-name (project-current)) >> + 'mouse-face 'mode-line-highlight >> + 'local-map project-mode-line-map))))) > > At the very least, this will need some better name, because project > features don't need any mode to be turned on to be used. > > project-menu-mode? 'project-mode' will be more like 'vc-mode' that actually is not a minor mode. I don't know why it was named 'vc-mode'. > Next, I'm not quite sure about the caching of project-name. There is no > scenario when it will be invalidated, right? I can't imagine such scenario. > Try simply calling (project-name (project-current t)) every time, see how > the performance is. Or, more thoroughly, copy the if-let logic from > project-prefixed-buffer-name. Ok, will try. BTW, there is another problem: by default 'project-name' is defined as (file-name-nondirectory (directory-file-name (project-root project))). But then project name often is the same for different projects because the directory name is the same for the same repository. For example, in a subtree: emacs-master/emacs/... emacs-29/emacs/... emacs-28/emacs/... All project names are the same 'emacs'. How would it be possible to customize project names? Trying to get a parent dir might be too unreliable. So probably the only way is to define the name manually. Maybe in .dir-locals.el. Actually this works: ((nil . ((project-vc-name . "emacs-29")))) Not sure why non-VC projects can't be named the same way. Also noticed that project-vc-name is not marked as safe, so always asks a confirmation. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-23 6:46 ` Juri Linkov @ 2023-05-23 18:11 ` Juri Linkov 2023-05-24 1:03 ` Dmitry Gutov 2023-05-24 1:00 ` Dmitry Gutov 1 sibling, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-23 18:11 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, Eli Zaretskii, 63469 > BTW, there is another problem: by default 'project-name' is defined as > (file-name-nondirectory (directory-file-name (project-root project))). > But then project name often is the same for different projects > because the directory name is the same for the same repository. > For example, in a subtree: > > emacs-master/emacs/... > emacs-29/emacs/... > emacs-28/emacs/... > > All project names are the same 'emacs'. How would it be possible to > customize project names? Trying to get a parent dir might be too > unreliable. So probably the only way is to define the name manually. > Maybe in .dir-locals.el. Actually this works: > > ((nil . ((project-vc-name . "emacs-29")))) > > Not sure why non-VC projects can't be named the same way. And indeed this is a real problem: in file buffers there is one project name that comes from project-vc-name, and in non-file buffers another project name deduced from dirs. This distinction became visible while testing project-mode on the mode-line. > Also noticed that project-vc-name is not marked as safe, > so always asks a confirmation. This problem exists only until project.el is loaded. So maybe the 'safe' cookie should be in ###autoload. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-23 18:11 ` Juri Linkov @ 2023-05-24 1:03 ` Dmitry Gutov 2023-05-24 6:29 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-24 1:03 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, Eli Zaretskii, 63469 On 23/05/2023 21:11, Juri Linkov wrote: >> BTW, there is another problem: by default 'project-name' is defined as >> (file-name-nondirectory (directory-file-name (project-root project))). >> But then project name often is the same for different projects >> because the directory name is the same for the same repository. >> For example, in a subtree: >> >> emacs-master/emacs/... >> emacs-29/emacs/... >> emacs-28/emacs/... >> >> All project names are the same 'emacs'. How would it be possible to >> customize project names? Trying to get a parent dir might be too >> unreliable. So probably the only way is to define the name manually. >> Maybe in .dir-locals.el. Actually this works: >> >> ((nil . ((project-vc-name . "emacs-29")))) >> >> Not sure why non-VC projects can't be named the same way. > > And indeed this is a real problem: in file buffers there is > one project name that comes from project-vc-name, and in > non-file buffers another project name deduced from dirs. Are you saying that non-file buffers don't obey the value of project-vc-name set in parent dir's dir-locals.el? > This distinction became visible while testing project-mode > on the mode-line. > >> Also noticed that project-vc-name is not marked as safe, >> so always asks a confirmation. > > This problem exists only until project.el is loaded. > So maybe the 'safe' cookie should be in ###autoload. Possibly. Would that mean that all :safe attribute assignments should be moved outside of defcustom forms, though? There is a whole bunch of them in project.el alone, most of them are expected to be settable from .dir-locals.el (that's the only point of this attribute). ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-24 1:03 ` Dmitry Gutov @ 2023-05-24 6:29 ` Juri Linkov 2023-05-25 1:14 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-24 6:29 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, Eli Zaretskii, 63469 >>> Maybe in .dir-locals.el. Actually this works: >>> >>> ((nil . ((project-vc-name . "emacs-29")))) >>> >>> Not sure why non-VC projects can't be named the same way. >> And indeed this is a real problem: in file buffers there is >> one project name that comes from project-vc-name, and in >> non-file buffers another project name deduced from dirs. > > Are you saying that non-file buffers don't obey the value of > project-vc-name set in parent dir's dir-locals.el? Exactly. I see no way to set the same project name both for non-file and file buffers. >> This distinction became visible while testing project-mode >> on the mode-line. >> >>> Also noticed that project-vc-name is not marked as safe, >>> so always asks a confirmation. >> This problem exists only until project.el is loaded. >> So maybe the 'safe' cookie should be in ###autoload. > > Possibly. Would that mean that all :safe attribute assignments should be > moved outside of defcustom forms, though? > > There is a whole bunch of them in project.el alone, most of them are > expected to be settable from .dir-locals.el (that's the only point of this > attribute). I tried out other defcustoms, and indeed all they require confirmation: project-vc-ignores, project-vc-merge-submodules, project-vc-include-untracked, project-vc-name, project-vc-extra-root-markers, project-kill-buffers-display-buffer-list. The standard solution is just to use e.g.: ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-24 6:29 ` Juri Linkov @ 2023-05-25 1:14 ` Dmitry Gutov 2023-05-25 6:29 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-25 1:14 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, Eli Zaretskii, 63469 On 24/05/2023 09:29, Juri Linkov wrote: >>>> Maybe in .dir-locals.el. Actually this works: >>>> >>>> ((nil . ((project-vc-name . "emacs-29")))) >>>> >>>> Not sure why non-VC projects can't be named the same way. >>> And indeed this is a real problem: in file buffers there is >>> one project name that comes from project-vc-name, and in >>> non-file buffers another project name deduced from dirs. >> >> Are you saying that non-file buffers don't obey the value of >> project-vc-name set in parent dir's dir-locals.el? > > Exactly. I see no way to set the same project name both for > non-file and file buffers. Please try the patch below. It might have non-negligible effect on performance though. Please try and report back. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 7c51778d5d4..1494665d565 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -816,8 +816,8 @@ project-buffers (push buf bufs))) (nreverse bufs))) -(cl-defmethod project-name ((_project (head vc))) - (or project-vc-name +(cl-defmethod project-name ((project (head vc))) + (or (project--value-in-dir 'project-vc-name (project-root project)) (cl-call-next-method))) >>> This distinction became visible while testing project-mode >>> on the mode-line. >>> >>>> Also noticed that project-vc-name is not marked as safe, >>>> so always asks a confirmation. >>> This problem exists only until project.el is loaded. >>> So maybe the 'safe' cookie should be in ###autoload. >> >> Possibly. Would that mean that all :safe attribute assignments should be >> moved outside of defcustom forms, though? >> >> There is a whole bunch of them in project.el alone, most of them are >> expected to be settable from .dir-locals.el (that's the only point of this >> attribute). > > I tried out other defcustoms, and indeed all they require confirmation: > project-vc-ignores, project-vc-merge-submodules, > project-vc-include-untracked, project-vc-name, > project-vc-extra-root-markers, project-kill-buffers-display-buffer-list. > > The standard solution is just to use e.g.: > > ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) Huh, so the attribute :safe only makes proper sense for preloaded packages and autoloaded defcustom forms (which are discouraged anyway). Do you want to write a patch for all those vars in project.el? It will probably make sense to push it to emacs-29. ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-25 1:14 ` Dmitry Gutov @ 2023-05-25 6:29 ` Juri Linkov 2023-05-25 16:14 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-25 6:29 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, Eli Zaretskii, 63469 [-- Attachment #1: Type: text/plain, Size: 1253 bytes --] >> I see no way to set the same project name both for >> non-file and file buffers. > > Please try the patch below. It might have non-negligible effect on > performance though. Please try and report back. > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index 7c51778d5d4..1494665d565 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -816,8 +816,8 @@ project-buffers > (push buf bufs))) > (nreverse bufs))) > > -(cl-defmethod project-name ((_project (head vc))) > - (or project-vc-name > +(cl-defmethod project-name ((project (head vc))) > + (or (project--value-in-dir 'project-vc-name (project-root project)) > (cl-call-next-method))) Thanks, I confirm this uses project-vc-name from dir-locals in non-file buffers. >> The standard solution is just to use e.g.: >> ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) > > Huh, so the attribute :safe only makes proper sense for preloaded packages > and autoloaded defcustom forms (which are discouraged anyway). > > Do you want to write a patch for all those vars in project.el? It will > probably make sense to push it to emacs-29. With this patch the problem is solved. I can push it to emacs-29. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: project-autoload-safe.patch --] [-- Type: text/x-diff, Size: 2728 bytes --] diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 7c51778d5d4..8b5a1abf900 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -412,8 +412,8 @@ project-vc (defcustom project-vc-ignores nil "List of patterns to add to `project-ignores'." - :type '(repeat string) - :safe #'listp) + :type '(repeat string)) +;;;###autoload(put 'project-vc-ignores 'safe-local-variable #'listp) (defcustom project-vc-merge-submodules t "Non-nil to consider submodules part of the parent project. @@ -422,14 +422,14 @@ project-vc-merge-submodules you might have to restart Emacs to see the effect." :type 'boolean :version "28.1" - :package-version '(project . "0.2.0") - :safe #'booleanp) + :package-version '(project . "0.2.0")) +;;;###autoload(put 'project-vc-merge-submodules 'safe-local-variable #'booleanp) (defcustom project-vc-include-untracked t "When non-nil, the VC-aware project backend includes untracked files." :type 'boolean - :version "29.1" - :safe #'booleanp) + :version "29.1") +;;;###autoload(put 'project-vc-include-untracked 'safe-local-variable #'booleanp) (defcustom project-vc-name nil "When non-nil, the name of the current VC-aware project. @@ -439,8 +439,8 @@ project-vc-name :type '(choice (const :tag "Default to the base name" nil) (string :tag "Custom name")) :version "29.1" - :package-version '(project . "0.9.0") - :safe #'stringp) + :package-version '(project . "0.9.0")) +;;;###autoload(put 'project-vc-name 'safe-local-variable #'stringp) ;; Not using regexps because these wouldn't work in Git pathspecs, in ;; case we decide we need to be able to list nested projects. @@ -467,8 +467,8 @@ project-vc-extra-root-markers variables, such as `project-vc-ignores' or `project-vc-name'." :type '(repeat string) :version "29.1" - :package-version '(project . "0.9.0") - :safe (lambda (val) (and (listp val) (cl-every #'stringp val)))) + :package-version '(project . "0.9.0")) +;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (cl-every #'stringp val)))) ;; FIXME: Using the current approach, major modes are supposed to set ;; this variable to a buffer-local value. So we don't have access to @@ -1476,8 +1476,8 @@ project-kill-buffers-display-buffer-list :type 'boolean :version "29.1" :group 'project - :package-version '(project . "0.8.2") - :safe #'booleanp) + :package-version '(project . "0.8.2")) +;;;###autoload(put 'project-kill-buffers-display-buffer-list 'safe-local-variable #'booleanp) (defun project--buffer-check (buf conditions) "Check if buffer BUF matches any element of the list CONDITIONS. ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-25 6:29 ` Juri Linkov @ 2023-05-25 16:14 ` Dmitry Gutov 2023-05-25 18:41 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-25 16:14 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, Eli Zaretskii, 63469 On 25/05/2023 09:29, Juri Linkov wrote: >>> I see no way to set the same project name both for >>> non-file and file buffers. >> >> Please try the patch below. It might have non-negligible effect on >> performance though. Please try and report back. >> >> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >> index 7c51778d5d4..1494665d565 100644 >> --- a/lisp/progmodes/project.el >> +++ b/lisp/progmodes/project.el >> @@ -816,8 +816,8 @@ project-buffers >> (push buf bufs))) >> (nreverse bufs))) >> >> -(cl-defmethod project-name ((_project (head vc))) >> - (or project-vc-name >> +(cl-defmethod project-name ((project (head vc))) >> + (or (project--value-in-dir 'project-vc-name (project-root project)) >> (cl-call-next-method))) > > Thanks, I confirm this uses project-vc-name from dir-locals in non-file buffers. If you had a chance to verify that the performance is good enough (for using the result in the mode-line), that would be great. Either way... >>> The standard solution is just to use e.g.: >>> ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) >> >> Huh, so the attribute :safe only makes proper sense for preloaded packages >> and autoloaded defcustom forms (which are discouraged anyway). >> >> Do you want to write a patch for all those vars in project.el? It will >> probably make sense to push it to emacs-29. > > With this patch the problem is solved. I can push it to emacs-29. ...this patch LGTM too. Please go ahead and install it, or even both patches. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-25 16:14 ` Dmitry Gutov @ 2023-05-25 18:41 ` Juri Linkov 2023-05-25 22:19 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-25 18:41 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, Eli Zaretskii, 63469 >>> -(cl-defmethod project-name ((_project (head vc))) >>> - (or project-vc-name >>> +(cl-defmethod project-name ((project (head vc))) >>> + (or (project--value-in-dir 'project-vc-name (project-root project)) >>> (cl-call-next-method))) >> Thanks, I confirm this uses project-vc-name from dir-locals in non-file >> buffers. > > If you had a chance to verify that the performance is good enough (for > using the result in the mode-line), that would be great. > > Either way... > >>>> ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) >>> >>> Huh, so the attribute :safe only makes proper sense for preloaded packages >>> and autoloaded defcustom forms (which are discouraged anyway). >>> >>> Do you want to write a patch for all those vars in project.el? It will >>> probably make sense to push it to emacs-29. >> With this patch the problem is solved. I can push it to emacs-29. > > ...this patch LGTM too. Please go ahead and install it, or even both > patches. I pushed ###autoload to emacs-29. But not sure about your patch since currently I have no idea how to verify its performance. Maybe it should be pushed to master so that everyone can test it? ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-25 18:41 ` Juri Linkov @ 2023-05-25 22:19 ` Dmitry Gutov 2023-05-30 17:51 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-05-25 22:19 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, Eli Zaretskii, 63469 On 25/05/2023 21:41, Juri Linkov wrote: >>>> -(cl-defmethod project-name ((_project (head vc))) >>>> - (or project-vc-name >>>> +(cl-defmethod project-name ((project (head vc))) >>>> + (or (project--value-in-dir 'project-vc-name (project-root project)) >>>> (cl-call-next-method))) >>> Thanks, I confirm this uses project-vc-name from dir-locals in non-file >>> buffers. >> If you had a chance to verify that the performance is good enough (for >> using the result in the mode-line), that would be great. >> >> Either way... >> >>>>> ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) >>>> Huh, so the attribute :safe only makes proper sense for preloaded packages >>>> and autoloaded defcustom forms (which are discouraged anyway). >>>> >>>> Do you want to write a patch for all those vars in project.el? It will >>>> probably make sense to push it to emacs-29. >>> With this patch the problem is solved. I can push it to emacs-29. >> ...this patch LGTM too. Please go ahead and install it, or even both >> patches. > I pushed ###autoload to emacs-29. Thanks! > But not sure about your patch > since currently I have no idea how to verify its performance. > Maybe it should be pushed to master so that everyone can test it? I think the performance requirements for 'project-name' are currently rather modest: the name is only used when selecting the project (in a custom config) and when generating some buffer names. For that, the new logic should be fine. With your feature, however, project-name could be called during redisplay, and that might require better performance. So I thought you would test it together with the patch for your feature request. But I suppose if you're not working on it right this moment, I could push the patch to emacs-29, and then we could refine the performance (if necessary) on master. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-25 22:19 ` Dmitry Gutov @ 2023-05-30 17:51 ` Juri Linkov 2023-06-02 2:11 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-05-30 17:51 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, Eli Zaretskii, 63469 >> But not sure about your patch >> since currently I have no idea how to verify its performance. >> Maybe it should be pushed to master so that everyone can test it? > > I think the performance requirements for 'project-name' are currently > rather modest: the name is only used when selecting the project (in > a custom config) and when generating some buffer names. For that, the new > logic should be fine. > > With your feature, however, project-name could be called during redisplay, > and that might require better performance. So I thought you would test it > together with the patch for your feature request. > > But I suppose if you're not working on it right this moment, I could push > the patch to emacs-29, and then we could refine the performance (if > necessary) on master. I don't know when I'll finish the feature of displaying a project name on the mode-line. So maybe better to push your patch to emacs-29 now? ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-30 17:51 ` Juri Linkov @ 2023-06-02 2:11 ` Dmitry Gutov 2023-06-02 6:37 ` Juri Linkov 0 siblings, 1 reply; 70+ messages in thread From: Dmitry Gutov @ 2023-06-02 2:11 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, Eli Zaretskii, 63469 On 30/05/2023 20:51, Juri Linkov wrote: >>> But not sure about your patch >>> since currently I have no idea how to verify its performance. >>> Maybe it should be pushed to master so that everyone can test it? >> I think the performance requirements for 'project-name' are currently >> rather modest: the name is only used when selecting the project (in >> a custom config) and when generating some buffer names. For that, the new >> logic should be fine. >> >> With your feature, however, project-name could be called during redisplay, >> and that might require better performance. So I thought you would test it >> together with the patch for your feature request. >> >> But I suppose if you're not working on it right this moment, I could push >> the patch to emacs-29, and then we could refine the performance (if >> necessary) on master. > I don't know when I'll finish the feature of displaying a project name > on the mode-line. So maybe better to push your patch to emacs-29 now? All right, pushed now. Thanks for reporting this. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-02 2:11 ` Dmitry Gutov @ 2023-06-02 6:37 ` Juri Linkov 2023-06-03 1:36 ` Dmitry Gutov 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-06-02 6:37 UTC (permalink / raw) To: Dmitry Gutov; +Cc: sbaugh, Eli Zaretskii, 63469 >>>> But not sure about your patch >>>> since currently I have no idea how to verify its performance. >>>> Maybe it should be pushed to master so that everyone can test it? >>> I think the performance requirements for 'project-name' are currently >>> rather modest: the name is only used when selecting the project (in >>> a custom config) and when generating some buffer names. For that, the new >>> logic should be fine. >>> >>> With your feature, however, project-name could be called during redisplay, >>> and that might require better performance. So I thought you would test it >>> together with the patch for your feature request. >>> >>> But I suppose if you're not working on it right this moment, I could push >>> the patch to emacs-29, and then we could refine the performance (if >>> necessary) on master. >> I don't know when I'll finish the feature of displaying a project name >> on the mode-line. So maybe better to push your patch to emacs-29 now? > > All right, pushed now. Thanks for reporting this. Sorry that I noticed this only now, but would such optimization make sense? Instead of (cl-defmethod project-name ((project (head vc))) (or (project--value-in-dir 'project-vc-name (project-root project)) (cl-call-next-method))) first check if .dir-local.el already assigned a buffer-local value before trying to get it from the root: (cl-defmethod project-name ((project (head vc))) (or project-vc-name (project--value-in-dir 'project-vc-name (project-root project)) (cl-call-next-method))) ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-02 6:37 ` Juri Linkov @ 2023-06-03 1:36 ` Dmitry Gutov 0 siblings, 0 replies; 70+ messages in thread From: Dmitry Gutov @ 2023-06-03 1:36 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, Eli Zaretskii, 63469 On 02/06/2023 09:37, Juri Linkov wrote: > Sorry that I noticed this only now, but would such optimization make sense? > Instead of > > (cl-defmethod project-name ((project (head vc))) > (or (project--value-in-dir 'project-vc-name (project-root project)) > (cl-call-next-method))) > > first check if .dir-local.el already assigned a buffer-local value > before trying to get it from the root: > > (cl-defmethod project-name ((project (head vc))) > (or project-vc-name > (project--value-in-dir 'project-vc-name (project-root project)) > (cl-call-next-method))) It might, but this way you lose one of the niceties of relying on 'project--value-in-dir': an edit to .dir-locals.el takes effect automatically in all related buffers, without having to revert them. It might not be too important, of course. Another thing, though, is that will do nothing about the worst case: when project-vc-name has not been customized or set locally. So if project--value-in-dir doesn't work fast enough for some particular purpose (such as using project name in the mode-line), it will remain a problem for many buffers anyway. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-23 6:46 ` Juri Linkov 2023-05-23 18:11 ` Juri Linkov @ 2023-05-24 1:00 ` Dmitry Gutov 1 sibling, 0 replies; 70+ messages in thread From: Dmitry Gutov @ 2023-05-24 1:00 UTC (permalink / raw) To: Juri Linkov; +Cc: sbaugh, Eli Zaretskii, 63469 On 23/05/2023 09:46, Juri Linkov wrote: >>> +(define-minor-mode project-mode >>> + "Toggle display of project menu in the project-aware buffers." >>> + (if project-mode >>> + (setq-local project-name (concat >>> + " " >>> + (propertize >>> + (project-name (project-current)) >>> + 'mouse-face 'mode-line-highlight >>> + 'local-map project-mode-line-map))))) >> >> At the very least, this will need some better name, because project >> features don't need any mode to be turned on to be used. >> >> project-menu-mode? > > 'project-mode' will be more like 'vc-mode' that actually is not a minor mode. > I don't know why it was named 'vc-mode'. vc-mode is not a mode at all: you can't choose to enable or disable it. >> Next, I'm not quite sure about the caching of project-name. There is no >> scenario when it will be invalidated, right? > > I can't imagine such scenario. Any scenario where the user assigns of changes the name, e.g. by changing the value of project-vc-name. >> Try simply calling (project-name (project-current t)) every time, see how >> the performance is. Or, more thoroughly, copy the if-let logic from >> project-prefixed-buffer-name. > > Ok, will try. > > BTW, there is another problem: by default 'project-name' is defined as > (file-name-nondirectory (directory-file-name (project-root project))). > But then project name often is the same for different projects > because the directory name is the same for the same repository. > For example, in a subtree: > > emacs-master/emacs/... > emacs-29/emacs/... > emacs-28/emacs/... > > All project names are the same 'emacs'. How would it be possible to > customize project names? Trying to get a parent dir might be too > unreliable. So probably the only way is to define the name manually. > Maybe in .dir-locals.el. Actually this works: > > ((nil . ((project-vc-name . "emacs-29")))) > > Not sure why non-VC projects can't be named the same way. They can -- using whatever way the respective backend provides. > Also noticed that project-vc-name is not marked as safe, > so always asks a confirmation. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-18 15:57 ` Juri Linkov 2023-05-18 16:06 ` Eli Zaretskii 2023-05-18 19:34 ` Dmitry Gutov @ 2023-05-19 14:42 ` Spencer Baugh 2023-05-19 17:41 ` Juri Linkov 2 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-05-19 14:42 UTC (permalink / raw) To: Juri Linkov; +Cc: dmitry, Eli Zaretskii, 63469 Extra idea: Maybe we could have a submenu which lists all the projects, and then has a subsubmenu to run commands in the context of that project? This could replace the current menu entry for project-switch-project. So for example, if I have an emacs-29 project: Tools -> Project -> emacs-29 -> Open File... Tools -> Project -> emacs-29 -> Dired (maybe the menu entries could be named with project-name, as I have here, so they're shorter) ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-19 14:42 ` Spencer Baugh @ 2023-05-19 17:41 ` Juri Linkov 0 siblings, 0 replies; 70+ messages in thread From: Juri Linkov @ 2023-05-19 17:41 UTC (permalink / raw) To: Spencer Baugh; +Cc: dmitry, Eli Zaretskii, 63469 > Extra idea: Maybe we could have a submenu which lists all the projects, > and then has a subsubmenu to run commands in the context of that > project? This could replace the current menu entry for > project-switch-project. > > So for example, if I have an emacs-29 project: > > Tools -> Project -> emacs-29 -> Open File... > Tools -> Project -> emacs-29 -> Dired > > (maybe the menu entries could be named with project-name, as I have > here, so they're shorter) OT1H, it would be simpler to switch projects. OTOH, the menus will be quite long. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-05-12 17:48 bug#63469: 29.0.90; project.el doesn't add menu-bar entries Spencer Baugh ` (2 preceding siblings ...) 2023-05-15 18:11 ` Spencer Baugh @ 2023-06-28 0:54 ` Spencer Baugh 2023-06-28 6:52 ` Juri Linkov 3 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-06-28 0:54 UTC (permalink / raw) To: 63469 At this point, does anyone object to my patch adding menu-bar items for project.el, spread throughout the appropriate menus? We could also add a project-minor-mode at some point, but I think these global menu-bar items can be added regardless of that. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-28 0:54 ` Spencer Baugh @ 2023-06-28 6:52 ` Juri Linkov 2023-06-29 15:30 ` Spencer Baugh 0 siblings, 1 reply; 70+ messages in thread From: Juri Linkov @ 2023-06-28 6:52 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469 > At this point, does anyone object to my patch adding menu-bar items for > project.el, spread throughout the appropriate menus? We could also add > a project-minor-mode at some point, but I think these global menu-bar > items can be added regardless of that. My suggestion was to have a submenu with all project commands somewhere, and this will be implemented with a new option vc-mode-line-format. So maybe your patch could be pushed to master now with both parts: where project menu items are scattered throughout all menus, and also where they are in one submenu that will be used later on the mode-line and in the context menus of project buffers. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-28 6:52 ` Juri Linkov @ 2023-06-29 15:30 ` Spencer Baugh 2023-06-29 17:31 ` Juri Linkov 2023-06-29 18:03 ` Eli Zaretskii 0 siblings, 2 replies; 70+ messages in thread From: Spencer Baugh @ 2023-06-29 15:30 UTC (permalink / raw) To: Juri Linkov; +Cc: 63469 [-- Attachment #1: Type: text/plain, Size: 741 bytes --] Juri Linkov <juri@linkov.net> writes: >> At this point, does anyone object to my patch adding menu-bar items for >> project.el, spread throughout the appropriate menus? We could also add >> a project-minor-mode at some point, but I think these global menu-bar >> items can be added regardless of that. > > My suggestion was to have a submenu with all project commands somewhere, > and this will be implemented with a new option vc-mode-line-format. > > So maybe your patch could be pushed to master now with both parts: > where project menu items are scattered throughout all menus, > and also where they are in one submenu that will be used later > on the mode-line and in the context menus of project buffers. OK, here is such a patch: [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Add-project-command-entries-to-the-menu-bar.patch --] [-- Type: text/x-patch, Size: 9558 bytes --] From e26f5bbf57575321cda7e7633e8960ab543cf69d Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@janestreet.com> Date: Mon, 15 May 2023 14:01:32 -0400 Subject: [PATCH] Add project command entries to the menu-bar This will make it easier for new users to learn these increasingly important and useful commands. (Bug#63469) * lisp/menu-bar.el (menu-bar-file-menu): Add project-dired and project-find-file entries. (menu-bar-search-menu): Add project-find-regexp entry. (menu-bar-replace-menu): Add project-query-replace regexp entry. (menu-bar-shell-commands-menu): Add project-shell entry. (menu-bar-buffers-menu-command-entries): Add project-switch-to-buffer and project-list-buffer entries. (menu-bar-project-menu): Add. (menu-bar-tools-menu): Add "Project" submenu, and also project-compile entry and change text for compile entry. --- lisp/menu-bar.el | 66 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index d020cf6e90a..bf3548bcf47 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -219,10 +219,18 @@ menu-bar-file-menu '(menu-item "Insert File..." insert-file :enable (menu-bar-non-minibuffer-window-p) :help "Insert another file into current buffer")) + (bindings--define-key menu [project-dired] + '(menu-item "Open Root Directory Of Project..." project-dired + :enable (menu-bar-non-minibuffer-window-p) + :help "Read the root directory of the current project, to operate on its files")) (bindings--define-key menu [dired] '(menu-item "Open Directory..." dired :enable (menu-bar-non-minibuffer-window-p) :help "Read a directory, to operate on its files")) + (bindings--define-key menu [project-open-file] + '(menu-item "Open File In Project..." project-find-file + :enable (menu-bar-non-minibuffer-window-p) + :help "Read an existing file in the current project into an Emacs buffer")) (bindings--define-key menu [open-file] '(menu-item "Open File..." menu-find-file-existing :enable (menu-bar-non-minibuffer-window-p) @@ -347,6 +355,9 @@ menu-bar-search-menu (bindings--define-key menu [tags-srch] '(menu-item "Search Tagged Files..." tags-search :help "Search for a regexp in all tagged files")) + (bindings--define-key menu [project-search] + '(menu-item "Search in Project Files..." project-find-regexp + :help "Search for a regexp in files of the current project")) (bindings--define-key menu [separator-tag-search] menu-bar-separator) (bindings--define-key menu [repeat-search-back] @@ -398,6 +409,9 @@ menu-bar-replace-menu (bindings--define-key menu [tags-repl] '(menu-item "Replace in Tagged Files..." tags-query-replace :help "Interactively replace a regexp in all tagged files")) + (bindings--define-key menu [project-replace] + '(menu-item "Replace in Project Files..." project-query-replace-regexp + :help "Interactively replace a regexp in files of the current project")) (bindings--define-key menu [separator-replace-tags] menu-bar-separator) @@ -1746,6 +1760,10 @@ menu-bar-encryption-decryption-menu (defvar menu-bar-shell-commands-menu (let ((menu (make-sparse-keymap "Shell Commands"))) + (bindings--define-key menu [project-interactive-shell] + '(menu-item "Run Shell Interactively In Project Root" project-shell + :help "Run a subshell interactively, in the current project")) + (bindings--define-key menu [interactive-shell] '(menu-item "Run Shell Interactively" shell :help "Run a subshell interactively")) @@ -1765,6 +1783,31 @@ menu-bar-shell-commands-menu menu)) +(defvar menu-bar-project-menu + (let ((menu (make-sparse-keymap "Project"))) + (bindings--define-key menu [project-execute-extended-command] '(menu-item "Execute Extended Command..." project-execute-extended-command :help "Execute an extended command in project root")) + (bindings--define-key menu [project-query-replace-regexp] '(menu-item "Query Replace Regexp..." project-query-replace-regexp :help "Interactively replace a regexp in files of the current project")) + (bindings--define-key menu [project-or-external-find-regexp] '(menu-item "Find Regexp Including External Roots..." project-or-external-find-regexp :help "Search for a regexp in files of the current project or external files")) + (bindings--define-key menu [project-find-regexp] '(menu-item "Find Regexp..." project-find-regexp :help "Search for a regexp in files of the current project")) + (bindings--define-key menu [separator-project-search] menu-bar-separator) + (bindings--define-key menu [project-kill-buffers] '(menu-item "Kill Buffers..." project-kill-buffers :help "Kill the buffers belonging to the current project")) + (bindings--define-key menu [project-list-buffers] '(menu-item "List Buffers..." project-list-buffers :help "Pop up a window listing all Emacs buffers in the current project")) + (bindings--define-key menu [project-switch-to-buffer] '(menu-item "Switch To Buffer..." project-switch-to-buffer :help "Prompt for a buffer in the current project, and switch to it")) + (bindings--define-key menu [separator-project-buffers] menu-bar-separator) + (bindings--define-key menu [project-async-shell-command] '(menu-item "Async Shell Command..." project-async-shell-command :help "Invoke a shell command in project root asynchronously in background")) + (bindings--define-key menu [project-shell-command] '(menu-item "Shell Command..." project-shell-command :help "Invoke a shell command in project root and catch its output")) + (bindings--define-key menu [project-eshell] '(menu-item "Run Eshell In Project Root..." project-eshell :help "Run eshell for the current project")) + (bindings--define-key menu [project-shell] '(menu-item "Run Shell Interactively In Project Root" project-shell :help "Run a subshell interactively, in the current project")) + (bindings--define-key menu [project-compile] '(menu-item "Compile..." project-compile :help "Invoke compiler or Make for current project, view errors")) + (bindings--define-key menu [separator-project-programs] menu-bar-separator) + (bindings--define-key menu [project-switch-project] '(menu-item "Switch Project..." project-switch-project :help "Switch to another project and then run a command")) + (bindings--define-key menu [project-vc-dir] '(menu-item "VC Dir..." project-vc-dir :help "Show the VC status of the project repository")) + (bindings--define-key menu [project-dired] '(menu-item "Open Root Directory Of Project..." project-dired :help "Read the root directory of the current project, to operate on its files")) + (bindings--define-key menu [project-find-dir] '(menu-item "Open Directory..." project-find-dir :help "Open an existing directory in the current project")) + (bindings--define-key menu [project-or-external-find-file] '(menu-item "Open File Including External Roots..." project-or-external-find-file :help "Open an existing file in the current project or its external roots")) + (bindings--define-key menu [project-open-file] '(menu-item "Open File..." project-find-file :help "Open an existing file in the current project")) + menu)) + (defun menu-bar-read-mail () "Read mail using `read-mail-command'." (interactive) @@ -1851,6 +1894,9 @@ menu-bar-tools-menu '(menu-item "Language Server Support (Eglot)" eglot :help "Start language server suitable for this buffer's major-mode")) + (bindings--define-key menu [project] + `(menu-item "Project" ,menu-bar-project-menu)) + (bindings--define-key menu [ede] '(menu-item "Project Support (EDE)" global-ede-mode @@ -1860,9 +1906,13 @@ menu-bar-tools-menu (bindings--define-key menu [gdb] '(menu-item "Debugger (GDB)..." gdb :help "Debug a program from within Emacs with GDB")) + (bindings--define-key menu [project-compile] + '(menu-item "Compile Project..." project-compile + :help "Invoke compiler or Make for current project, view errors")) + (bindings--define-key menu [compile] - '(menu-item "Compile..." compile - :help "Invoke compiler or Make, view compilation errors")) + '(menu-item "Compile Buffer Directory..." compile + :help "Invoke compiler or Make in current buffer's directory, view errors")) (bindings--define-key menu [shell-commands] `(menu-item "Shell Commands" @@ -2347,7 +2397,17 @@ menu-bar-buffers-menu-command-entries 'menu-item "List All Buffers" 'list-buffers - :help "Pop up a window listing all Emacs buffers")) + :help "Pop up a window listing all Emacs buffers") + (list 'select-buffer-in-project + 'menu-item + "Select Buffer In Project..." + 'project-switch-to-buffer + :help "Prompt for a buffer in the current project, and switch to it") + (list 'list-buffers-in-project + 'menu-item + "List Buffers In Project..." + 'project-list-buffers + :help "Pop up a window listing all Emacs buffers in the current project")) "Entries to be included at the end of the \"Buffers\" menu.") (defvar menu-bar-select-buffer-function 'switch-to-buffer -- 2.39.3 ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-29 15:30 ` Spencer Baugh @ 2023-06-29 17:31 ` Juri Linkov 2023-06-29 18:03 ` Eli Zaretskii 1 sibling, 0 replies; 70+ messages in thread From: Juri Linkov @ 2023-06-29 17:31 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469 > OK, here is such a patch: Thanks, one comment: > + (bindings--define-key menu [project-dired] > + '(menu-item "Open Root Directory Of Project..." project-dired > + :enable (menu-bar-non-minibuffer-window-p) > + :help "Read the root directory of the current project, to operate on its files")) There is an ellipsis at the end of the menu item that indicates that the command reads a directory from the minibuffer. So maybe a better command would be 'project-find-dir' that reads a directory like its counterpart 'project-find-file' reads a file: > (bindings--define-key menu [dired] > '(menu-item "Open Directory..." dired > :enable (menu-bar-non-minibuffer-window-p) > :help "Read a directory, to operate on its files")) > + (bindings--define-key menu [project-open-file] > + '(menu-item "Open File In Project..." project-find-file > + :enable (menu-bar-non-minibuffer-window-p) > + :help "Read an existing file in the current project into an Emacs buffer")) > (bindings--define-key menu [open-file] > '(menu-item "Open File..." menu-find-file-existing > :enable (menu-bar-non-minibuffer-window-p) > @@ -1746,6 +1760,10 @@ menu-bar-encryption-decryption-menu > > (defvar menu-bar-shell-commands-menu > (let ((menu (make-sparse-keymap "Shell Commands"))) > + (bindings--define-key menu [project-interactive-shell] > + '(menu-item "Run Shell Interactively In Project Root" project-shell This will make the menu item too wide. Would it be possible to omit the word "Interactively". I don't know why it's used in "Run Shell Interactively", but "Run Shell In Project Root" looks much nicer. > (bindings--define-key menu [interactive-shell] > '(menu-item "Run Shell Interactively" shell > :help "Run a subshell interactively")) > (bindings--define-key menu [compile] > - '(menu-item "Compile..." compile > - :help "Invoke compiler or Make, view compilation errors")) > + '(menu-item "Compile Buffer Directory..." compile > + :help "Invoke compiler or Make in current buffer's directory, view errors")) I think the text of the menu item "Compile Buffer Directory..." is too hard to understand. Probably better to retain the old text. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-29 15:30 ` Spencer Baugh 2023-06-29 17:31 ` Juri Linkov @ 2023-06-29 18:03 ` Eli Zaretskii 2023-06-29 19:22 ` Spencer Baugh 1 sibling, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-06-29 18:03 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469, juri > Cc: 63469@debbugs.gnu.org > From: Spencer Baugh <sbaugh@janestreet.com> > Date: Thu, 29 Jun 2023 11:30:06 -0400 > > > So maybe your patch could be pushed to master now with both parts: > > where project menu items are scattered throughout all menus, > > and also where they are in one submenu that will be used later > > on the mode-line and in the context menus of project buffers. > > OK, here is such a patch: Thanks. Some of the menu items are too long, please consider making them shorter, even if that obfuscates them a bit (you can always clarify in the help-echo string). ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-29 18:03 ` Eli Zaretskii @ 2023-06-29 19:22 ` Spencer Baugh 2023-06-30 5:32 ` Eli Zaretskii 0 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-06-29 19:22 UTC (permalink / raw) To: Eli Zaretskii; +Cc: juri, 63469 [-- Attachment #1: Type: text/plain, Size: 706 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> Cc: 63469@debbugs.gnu.org >> From: Spencer Baugh <sbaugh@janestreet.com> >> Date: Thu, 29 Jun 2023 11:30:06 -0400 >> >> > So maybe your patch could be pushed to master now with both parts: >> > where project menu items are scattered throughout all menus, >> > and also where they are in one submenu that will be used later >> > on the mode-line and in the context menus of project buffers. >> >> OK, here is such a patch: > > Thanks. Some of the menu items are too long, please consider making > them shorter, even if that obfuscates them a bit (you can always > clarify in the help-echo string). OK, fixed both your and Juri's comments in the following patch. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Add-project-command-entries-to-the-menu-bar.patch --] [-- Type: text/x-patch, Size: 9533 bytes --] From 35e6a2eb2b914f2294e798aa999972e5fb05baa2 Mon Sep 17 00:00:00 2001 From: Spencer Baugh <sbaugh@janestreet.com> Date: Mon, 15 May 2023 14:01:32 -0400 Subject: [PATCH] Add project command entries to the menu-bar This will make it easier for new users to learn these increasingly important and useful commands. (Bug#63469) * lisp/menu-bar.el (menu-bar-file-menu): Add project-dired and project-find-file entries. (menu-bar-search-menu): Add project-find-regexp entry. (menu-bar-replace-menu): Add project-query-replace regexp entry. (menu-bar-shell-commands-menu): Add project-shell entry. (menu-bar-buffers-menu-command-entries): Add project-switch-to-buffer and project-list-buffer entries. (menu-bar-project-menu): Add. (menu-bar-tools-menu): Add "Project" submenu, and also project-compile entry and change text for compile entry. --- lisp/menu-bar.el | 66 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index d020cf6e90a..6772928add5 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -219,10 +219,18 @@ menu-bar-file-menu '(menu-item "Insert File..." insert-file :enable (menu-bar-non-minibuffer-window-p) :help "Insert another file into current buffer")) + (bindings--define-key menu [project-dired] + '(menu-item "Open Project Directory" project-dired + :enable (menu-bar-non-minibuffer-window-p) + :help "Read the root directory of the current project, to operate on its files")) (bindings--define-key menu [dired] '(menu-item "Open Directory..." dired :enable (menu-bar-non-minibuffer-window-p) :help "Read a directory, to operate on its files")) + (bindings--define-key menu [project-open-file] + '(menu-item "Open File In Project..." project-find-file + :enable (menu-bar-non-minibuffer-window-p) + :help "Read an existing file in the current project into an Emacs buffer")) (bindings--define-key menu [open-file] '(menu-item "Open File..." menu-find-file-existing :enable (menu-bar-non-minibuffer-window-p) @@ -347,6 +355,9 @@ menu-bar-search-menu (bindings--define-key menu [tags-srch] '(menu-item "Search Tagged Files..." tags-search :help "Search for a regexp in all tagged files")) + (bindings--define-key menu [project-search] + '(menu-item "Search in Project Files..." project-find-regexp + :help "Search for a regexp in files of the current project")) (bindings--define-key menu [separator-tag-search] menu-bar-separator) (bindings--define-key menu [repeat-search-back] @@ -398,6 +409,9 @@ menu-bar-replace-menu (bindings--define-key menu [tags-repl] '(menu-item "Replace in Tagged Files..." tags-query-replace :help "Interactively replace a regexp in all tagged files")) + (bindings--define-key menu [project-replace] + '(menu-item "Replace in Project Files..." project-query-replace-regexp + :help "Interactively replace a regexp in files of the current project")) (bindings--define-key menu [separator-replace-tags] menu-bar-separator) @@ -1746,8 +1760,12 @@ menu-bar-encryption-decryption-menu (defvar menu-bar-shell-commands-menu (let ((menu (make-sparse-keymap "Shell Commands"))) + (bindings--define-key menu [project-interactive-shell] + '(menu-item "Run Shell In Project" project-shell + :help "Run a subshell interactively, in the current project's root directory")) + (bindings--define-key menu [interactive-shell] - '(menu-item "Run Shell Interactively" shell + '(menu-item "Run Shell" shell :help "Run a subshell interactively")) (bindings--define-key menu [async-shell-command] @@ -1765,6 +1783,31 @@ menu-bar-shell-commands-menu menu)) +(defvar menu-bar-project-menu + (let ((menu (make-sparse-keymap "Project"))) + (bindings--define-key menu [project-execute-extended-command] '(menu-item "Execute Extended Command..." project-execute-extended-command :help "Execute an extended command in project root")) + (bindings--define-key menu [project-query-replace-regexp] '(menu-item "Query Replace Regexp..." project-query-replace-regexp :help "Interactively replace a regexp in files of the current project")) + (bindings--define-key menu [project-or-external-find-regexp] '(menu-item "Find Regexp Including External Roots..." project-or-external-find-regexp :help "Search for a regexp in files of the current project or external files")) + (bindings--define-key menu [project-find-regexp] '(menu-item "Find Regexp..." project-find-regexp :help "Search for a regexp in files of the current project")) + (bindings--define-key menu [separator-project-search] menu-bar-separator) + (bindings--define-key menu [project-kill-buffers] '(menu-item "Kill Buffers..." project-kill-buffers :help "Kill the buffers belonging to the current project")) + (bindings--define-key menu [project-list-buffers] '(menu-item "List Buffers..." project-list-buffers :help "Pop up a window listing all Emacs buffers in the current project")) + (bindings--define-key menu [project-switch-to-buffer] '(menu-item "Switch To Buffer..." project-switch-to-buffer :help "Prompt for a buffer in the current project, and switch to it")) + (bindings--define-key menu [separator-project-buffers] menu-bar-separator) + (bindings--define-key menu [project-async-shell-command] '(menu-item "Async Shell Command..." project-async-shell-command :help "Invoke a shell command in project root asynchronously in background")) + (bindings--define-key menu [project-shell-command] '(menu-item "Shell Command..." project-shell-command :help "Invoke a shell command in project root and catch its output")) + (bindings--define-key menu [project-eshell] '(menu-item "Run Eshell" project-eshell :help "Run eshell for the current project")) + (bindings--define-key menu [project-shell] '(menu-item "Run Shell" project-shell :help "Run a subshell interactively, in the current project's root directory")) + (bindings--define-key menu [project-compile] '(menu-item "Compile..." project-compile :help "Invoke compiler or Make for current project, view errors")) + (bindings--define-key menu [separator-project-programs] menu-bar-separator) + (bindings--define-key menu [project-switch-project] '(menu-item "Switch Project..." project-switch-project :help "Switch to another project and then run a command")) + (bindings--define-key menu [project-vc-dir] '(menu-item "VC Dir..." project-vc-dir :help "Show the VC status of the project repository")) + (bindings--define-key menu [project-dired] '(menu-item "Open Project Root" project-dired :help "Read the root directory of the current project, to operate on its files")) + (bindings--define-key menu [project-find-dir] '(menu-item "Open Directory..." project-find-dir :help "Open an existing directory in the current project")) + (bindings--define-key menu [project-or-external-find-file] '(menu-item "Open File Including External Roots..." project-or-external-find-file :help "Open an existing file in the current project or its external roots")) + (bindings--define-key menu [project-open-file] '(menu-item "Open File..." project-find-file :help "Open an existing file in the current project")) + menu)) + (defun menu-bar-read-mail () "Read mail using `read-mail-command'." (interactive) @@ -1851,6 +1894,9 @@ menu-bar-tools-menu '(menu-item "Language Server Support (Eglot)" eglot :help "Start language server suitable for this buffer's major-mode")) + (bindings--define-key menu [project] + `(menu-item "Project" ,menu-bar-project-menu)) + (bindings--define-key menu [ede] '(menu-item "Project Support (EDE)" global-ede-mode @@ -1860,9 +1906,13 @@ menu-bar-tools-menu (bindings--define-key menu [gdb] '(menu-item "Debugger (GDB)..." gdb :help "Debug a program from within Emacs with GDB")) + (bindings--define-key menu [project-compile] + '(menu-item "Compile Project..." project-compile + :help "Invoke compiler or Make for current project, view errors")) + (bindings--define-key menu [compile] '(menu-item "Compile..." compile - :help "Invoke compiler or Make, view compilation errors")) + :help "Invoke compiler or Make in current buffer's directory, view errors")) (bindings--define-key menu [shell-commands] `(menu-item "Shell Commands" @@ -2347,7 +2397,17 @@ menu-bar-buffers-menu-command-entries 'menu-item "List All Buffers" 'list-buffers - :help "Pop up a window listing all Emacs buffers")) + :help "Pop up a window listing all Emacs buffers") + (list 'select-buffer-in-project + 'menu-item + "Select Buffer In Project..." + 'project-switch-to-buffer + :help "Prompt for a buffer in the current project, and switch to it") + (list 'list-buffers-in-project + 'menu-item + "List Buffers In Project..." + 'project-list-buffers + :help "Pop up a window listing all Emacs buffers in the current project")) "Entries to be included at the end of the \"Buffers\" menu.") (defvar menu-bar-select-buffer-function 'switch-to-buffer -- 2.39.3 ^ permalink raw reply related [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-29 19:22 ` Spencer Baugh @ 2023-06-30 5:32 ` Eli Zaretskii 2023-06-30 15:55 ` Spencer Baugh 0 siblings, 1 reply; 70+ messages in thread From: Eli Zaretskii @ 2023-06-30 5:32 UTC (permalink / raw) To: Spencer Baugh; +Cc: juri, 63469 > From: Spencer Baugh <sbaugh@janestreet.com> > Cc: 63469@debbugs.gnu.org, juri@linkov.net > Date: Thu, 29 Jun 2023 15:22:51 -0400 > > > Thanks. Some of the menu items are too long, please consider making > > them shorter, even if that obfuscates them a bit (you can always > > clarify in the help-echo string). > > OK, fixed both your and Juri's comments in the following patch. Thanks, LGTM. Is this for master or for the released branch? ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-30 5:32 ` Eli Zaretskii @ 2023-06-30 15:55 ` Spencer Baugh 2023-07-01 9:44 ` Eli Zaretskii 0 siblings, 1 reply; 70+ messages in thread From: Spencer Baugh @ 2023-06-30 15:55 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 63469, juri Eli Zaretskii <eliz@gnu.org> writes: >> From: Spencer Baugh <sbaugh@janestreet.com> >> Cc: 63469@debbugs.gnu.org, juri@linkov.net >> Date: Thu, 29 Jun 2023 15:22:51 -0400 >> >> > Thanks. Some of the menu items are too long, please consider making >> > them shorter, even if that obfuscates them a bit (you can always >> > clarify in the help-echo string). >> >> OK, fixed both your and Juri's comments in the following patch. > > Thanks, LGTM. Is this for master or for the released branch? For emacs-29 if that's OK. The same patch also applies cleanly to master. ^ permalink raw reply [flat|nested] 70+ messages in thread
* bug#63469: 29.0.90; project.el doesn't add menu-bar entries 2023-06-30 15:55 ` Spencer Baugh @ 2023-07-01 9:44 ` Eli Zaretskii 0 siblings, 0 replies; 70+ messages in thread From: Eli Zaretskii @ 2023-07-01 9:44 UTC (permalink / raw) To: Spencer Baugh; +Cc: 63469-done, juri > From: Spencer Baugh <sbaugh@janestreet.com> > Cc: juri@linkov.net, 63469@debbugs.gnu.org > Date: Fri, 30 Jun 2023 11:55:41 -0400 > > Eli Zaretskii <eliz@gnu.org> writes: > >> From: Spencer Baugh <sbaugh@janestreet.com> > >> Cc: 63469@debbugs.gnu.org, juri@linkov.net > >> Date: Thu, 29 Jun 2023 15:22:51 -0400 > >> > >> > Thanks. Some of the menu items are too long, please consider making > >> > them shorter, even if that obfuscates them a bit (you can always > >> > clarify in the help-echo string). > >> > >> OK, fixed both your and Juri's comments in the following patch. > > > > Thanks, LGTM. Is this for master or for the released branch? > > For emacs-29 if that's OK. The same patch also applies cleanly to > master. Thanks, installed on emacs-29 with some minor changes, and closing the bug. ^ permalink raw reply [flat|nested] 70+ messages in thread
end of thread, other threads:[~2023-07-01 9:44 UTC | newest] Thread overview: 70+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-05-12 17:48 bug#63469: 29.0.90; project.el doesn't add menu-bar entries Spencer Baugh 2023-05-12 19:09 ` Eli Zaretskii 2023-05-12 19:25 ` Dmitry Gutov 2023-05-15 16:49 ` Juri Linkov 2023-05-15 18:15 ` Spencer Baugh 2023-05-15 18:19 ` Eli Zaretskii 2023-05-15 18:11 ` Spencer Baugh 2023-05-15 18:37 ` Eli Zaretskii 2023-05-15 18:46 ` Spencer Baugh 2023-05-16 16:09 ` Eli Zaretskii 2023-05-16 17:09 ` Spencer Baugh 2023-05-17 11:30 ` Eli Zaretskii 2023-05-17 14:50 ` Spencer Baugh 2023-05-18 6:53 ` Dmitry Gutov 2023-05-18 7:01 ` Eli Zaretskii 2023-05-18 9:49 ` Dmitry Gutov 2023-05-18 10:23 ` Eli Zaretskii 2023-05-18 14:30 ` Spencer Baugh 2023-05-18 15:15 ` Eli Zaretskii 2023-05-18 15:57 ` Juri Linkov 2023-05-18 16:06 ` Eli Zaretskii 2023-05-18 19:34 ` Dmitry Gutov 2023-05-19 6:56 ` Juri Linkov 2023-05-19 10:44 ` Eli Zaretskii 2023-05-19 17:46 ` Juri Linkov 2023-05-19 18:28 ` Eli Zaretskii 2023-05-22 17:48 ` Juri Linkov 2023-05-22 18:20 ` Eli Zaretskii 2023-05-22 19:49 ` Spencer Baugh 2023-05-22 19:54 ` Dmitry Gutov 2023-05-22 21:20 ` Spencer Baugh 2023-05-22 21:30 ` Dmitry Gutov 2023-05-23 13:57 ` Michael Albinus 2023-05-24 1:07 ` Dmitry Gutov 2023-05-24 8:38 ` Michael Albinus 2023-05-23 6:52 ` Juri Linkov 2023-05-23 11:17 ` Eli Zaretskii 2023-05-23 18:08 ` Juri Linkov 2023-05-24 1:10 ` Dmitry Gutov 2023-05-24 6:25 ` Juri Linkov 2023-05-25 1:15 ` Dmitry Gutov 2023-05-25 6:35 ` Juri Linkov 2023-05-25 16:17 ` Dmitry Gutov 2023-05-23 6:49 ` Juri Linkov 2023-05-22 19:59 ` Dmitry Gutov 2023-05-23 6:46 ` Juri Linkov 2023-05-23 18:11 ` Juri Linkov 2023-05-24 1:03 ` Dmitry Gutov 2023-05-24 6:29 ` Juri Linkov 2023-05-25 1:14 ` Dmitry Gutov 2023-05-25 6:29 ` Juri Linkov 2023-05-25 16:14 ` Dmitry Gutov 2023-05-25 18:41 ` Juri Linkov 2023-05-25 22:19 ` Dmitry Gutov 2023-05-30 17:51 ` Juri Linkov 2023-06-02 2:11 ` Dmitry Gutov 2023-06-02 6:37 ` Juri Linkov 2023-06-03 1:36 ` Dmitry Gutov 2023-05-24 1:00 ` Dmitry Gutov 2023-05-19 14:42 ` Spencer Baugh 2023-05-19 17:41 ` Juri Linkov 2023-06-28 0:54 ` Spencer Baugh 2023-06-28 6:52 ` Juri Linkov 2023-06-29 15:30 ` Spencer Baugh 2023-06-29 17:31 ` Juri Linkov 2023-06-29 18:03 ` Eli Zaretskii 2023-06-29 19:22 ` Spencer Baugh 2023-06-30 5:32 ` Eli Zaretskii 2023-06-30 15:55 ` Spencer Baugh 2023-07-01 9:44 ` Eli Zaretskii
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.