I've installed p4.el (v10.6) onto Emacs (v21.3.1) on
RHEL3. My display is kind of small (1024x768, I
think). When I pick the "P4" menu, not all of the menu
items are displayed (the last is "Set P4 Notification
List". Long menus in Emacs is not a good idea -- it
would be better to break it up into multi-level menus.
Logged In: YES
user_id=177297
Maybe I'll try hacking the easy-menu-define to see if that
would collapse the menu size.
Logged In: YES
user_id=402463
Using newer versions of emacs, easymenu.el is standard, so
you can simplify the menu logic and take advantage of more
easymenu functionality to solve your problem. The following
is my current menu design. Just replace the corresponding
section of p4.el with this:
(eval-and-compile
(defvar p4-menu-def
'(
["Add to Depot" p4-add
:active (and (p4-buffer-file-name) (not p4-mode))
:help "Open the current buffer's file for adding to
the depot"]
["Edit" p4-edit
:active (and (p4-buffer-file-name-2) (or (not p4-mode)
buffer-read-only))
:help "Open the current buffer's file for editing"]
["Reopen" p4-reopen
:active (and (p4-buffer-file-name-2) (or (not p4-mode)
(not buffer-read-only)))
:help "Reopen the current buffer's file; prompts to
allow specifying changelist number (default is the default
changelist)"]
["Revert" p4-revert
:active (and (p4-buffer-file-name-2) (or (not p4-mode)
(not buffer-read-only)))
:help "Revert the current buffer's file to the
depot's version; the buffer becomes read only"]
["Delete from Depot" p4-delete
:active (and (p4-buffer-file-name-2) (or (not p4-mode)
buffer-read-only))
:help "Open the current buffer's file for deletion
from the depot"]
"--"
["Submit Changes" p4-submit
:active t
:help "Submit pending changes to the depot"]
["Integrate" p4-integ
:active t
:help "Schedule integrations from one file to another"]
["Resolve Conflicts" p4-resolve
:active t
:help "Resolve conflicts found when trying to submit
changes"]
"--"
["Sync with Depot" p4-sync
:active t
:help "Synchronize the client workspace with the
files in the depot"]
("Differences"
["Diff Current" p4-diff
:active t
:help "Display the differences between the current buffer
and the depot version of the file"]
["Diff 2 Depot Versions" p4-diff2
:active (p4-buffer-file-name-2)
:help "Display the differences between two depot versions
of a file"]
["Diff All Opened Files" p4-diff-all-opened
:active t
:help "Display the differences between depot and client
workspace files for all open files"]
"--"
["Diff Current with Ediff" p4-ediff
:active (and (p4-buffer-file-name) (not buffer-read-only)
p4-mode)
:help "Compare the depot and client workspace files using
ediff"]
["Diff 2 Versions with Ediff" p4-ediff2
:active (p4-buffer-file-name-2)
:help "Compare two depot file versions using ediff"])
["Show Opened Files" p4-opened
:active t
:help "Display a list of files opened for a pending
changelist"]
["Changes" p4-changes
:active t]
["Describe Change" p4-describe
:active t
:help "Diplay a changelist description"]
["Filelog" p4-filelog
:active (p4-buffer-file-name-2)
:help "Display the revision history of a file or files"]
"--"
["Print" p4-print
:active (p4-buffer-file-name-2)
:help "Display a depot file in a buffer"]
["Print with Revision History" p4-blame
:active (p4-buffer-file-name-2)
:help "Display a depot file, with its revision
history, in a buffer"]
["Find File using Depot Spec" p4-depot-find-file
:active p4-do-find-file
:help ""]
["Rename Depot File" p4-rename
:active (and (p4-buffer-file-name-2) (or (not p4-mode)
buffer-read-only))
:help "Rename the current buffer's file in the depot"]
"--"
("Specifications"
["Edit a Branch Specification" p4-branch
:active t
:help "Display a branch specification form"]
["Edit a Label Specification" p4-label
:active t
:help "Display a label specification form"]
["Edit a Client Specification" p4-client
:active t
:help "Display the current client workspace specification
form"]
["Edit a User Specification" p4-user
:active t
:help "Display the current user's specification form"])
("Settings"
["Set $P4CONFIG" p4-set-client-config
:active p4-do-find-file
:help "Prompt for a new value for $P4CONFIG"]
["Get Current $P4CONFIG" p4-get-client-config
:active p4-do-find-file
:help "Display the current value of $P4CONFIG"]
["Set $P4CLIENT" p4-set-client-name
:active p4-do-find-file
:help "Prompt for a new value for $P4CLIENT"]
["Get Current $P4CLIENT" p4-get-client-name
:active p4-do-find-file
:help "Display the current value of $P4CLIENT"]
["Set $P4PORT" p4-set-p4-port
:active p4-do-find-file
:help "Prompt for a new value for $P4PORT"]
["Get Current $P4PORT" p4-get-p4-port
:active p4-do-find-file
:help "Display the current value of $P4PORT"]
"--"
["Disable P4 VC Check" p4-toggle-vc-mode-off
:active p4-do-find-file
:help "Disable checking files against the P4 server"]
["Enable P4 VC Check" p4-toggle-vc-mode-on
:active (not p4-do-find-file)
:help "Enable checking files against the P4 server"]
"--"
("Notification"
["Notify Users" p4-notify
:active p4-notify
:help "Prompt for a list of user to notify via e-mail"]
["Set P4 Notification List" p4-set-notify-list
:active p4-mode
:help "Prompt for the new value of $P4NOTIFY"]
["Get P4 Notification List" p4-get-notify-list
:active p4-notify
:help "Display the value of $P4NOTIFY"]))
("Other"
["Show Version" p4-emacs-version
:active t
:help "Show the version of p4.el"]
["Visit p4 on the Internet" p4-browse-web-page
:active t
:help "Browse the p4.el web page"]
["Report a Bug in p4.el" p4-bug-report
:active t
:help "Create a mail message for you to complete to report
a bug"])
"--"
["Set Command Arguments..." universal-argument
:active t
:help "Use this to set an argument for a command that
doesn't prompt for one"]
["Describe Key Bindings" p4-describe-bindings
:active t
:help "Display a list of p4 key bindings"])
"The P4 menu definition")
(cond (p4-running-xemacs
;; Menu Support for XEmacs
(require 'easymenu)
(defun p4-mode-menu (modestr)
(cons modestr p4-menu-def)))
(p4-running-emacs
;; Menu support for Emacs
(or (lookup-key global-map [menu-bar])
(define-key global-map [menu-bar] (make-sparse-keymap
"menu-bar")))
(defvar menu-bar-p4-menu (easy-menu-create-menu "P4"
p4-menu-def))
(setq menu-bar-final-items (cons 'p4-menu
menu-bar-final-items))
(define-key global-map [menu-bar p4-menu]
(cons "P4" menu-bar-p4-menu))))
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Logged In: YES
user_id=402463
Originator: NO
The next release pushes more into submenus -- perhaps too much. Check this when I post a release candidate.