Subject: bug#69566: Context menu for project

From: Juri Linkov <[email-masked]>
Date: Tue, 05 Mar 2024 18:54:16 +0200

Tags: patch

diff --git a/lisp/mouse.el b/lisp/mouse.el
index d1b06c2040d..d5c33828846 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -393,6 +393,7 @@ context-menu-functions
                   (function-item context-menu-local)
                   (function-item context-menu-minor)
                   (function-item context-menu-buffers)
+                  (function-item context-menu-project)
                   (function-item context-menu-vc)
                   (function-item context-menu-ffap)
                   (function-item hi-lock-context-menu)
@@ -527,6 +534,12 @@ context-menu-buffers
               (mouse-buffer-menu-keymap))
   menu)
 
+(defun context-menu-project (menu _click)
+  "Populate MENU with project commands."
+  (define-key-after menu [separator-project] menu-bar-separator)
+  (define-key-after menu [project-menu] (bound-and-true-p project-menu-entry))
+  menu)
+
 (defun context-menu-vc (menu _click)
   "Populate MENU with Version Control commands."
   (define-key-after menu [separator-vc] menu-bar-separator)