unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: 63469@debbugs.gnu.org
Subject: bug#63469: 29.0.90; project.el doesn't add menu-bar entries
Date: Mon, 15 May 2023 14:11:08 -0400	[thread overview]
Message-ID: <ier353xqxc3.fsf@janestreet.com> (raw)
In-Reply-To: <iercz35fnkw.fsf@janestreet.com> (Spencer Baugh's message of "Fri, 12 May 2023 13:48:15 -0400")

[-- 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


  parent reply	other threads:[~2023-05-15 18:11 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

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

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

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

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

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

  git send-email \
    --in-reply-to=ier353xqxc3.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=63469@debbugs.gnu.org \
    /path/to/YOUR_REPLY

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

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

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

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