branch: externals/ergoemacs-mode commit 1ef93b5a4ec816bdf2a51cc6283a035a1efb082a Author: Matthew Fidler <514778+mattfid...@users.noreply.github.com> Commit: Matthew Fidler <514778+mattfid...@users.noreply.github.com>
Add major modes menu again --- ergoemacs-lib.el | 25 +++++++++++++++++++++++++ ergoemacs-themes.el | 9 +++++++++ 2 files changed, 34 insertions(+) diff --git a/ergoemacs-lib.el b/ergoemacs-lib.el index c23aad2..36dc9b4 100644 --- a/ergoemacs-lib.el +++ b/ergoemacs-lib.el @@ -104,6 +104,31 @@ Tries to get the value from `ergoemacs-mode-names'. If not guess the language n (defvar ergoemacs-menu--get-major-modes nil "List of major-modes known to `ergoemacs-mode'.") +(defcustom ergoemacs-excluded-major-modes + '(conf-colon-mode + conf-xdefaults-mode conf-space-mode conf-javaprop-mode + conf-ppd-mode mail-mode + ebrowse-tree-mode diff-mode fundamental-mode emacs-lisp-byte-code-mode + R-transcript-mode S-transcript-mode XLS-mode tar-mode + git-commit-mode git-rebase-mode image-mode + archive-mode ses-mode) + "List of major modes excluded from ergoemacs' Languages menu." + :type '(repeat (symbol :tag "Excluded Major Mode")) + :group 'ergoemacs-mode) + +(defcustom ergoemacs-mode-names + '((conf-mode "Settings") + (ses-mode "Emacs Spreadsheet") + (m2-mode "Modula-2") + (snmpv2-mode "SNMPv2 MIBs") + (snmp-mode "SKMP MIBs")) + "Menu name for ergoemacs' Languages menu." + :type '(repeat + (list + (symbol :tag "Major Mode Name") + (text :tag "Alternative Description:"))) + :group 'ergoemacs-mode) + (defun ergoemacs-menu--get-major-modes () "Gets a list of language modes known to `ergoemacs-mode'. This gets all major modes known from the variables: diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el index c8a2965..a35a946 100644 --- a/ergoemacs-themes.el +++ b/ergoemacs-themes.el @@ -1028,6 +1028,13 @@ These keys do not depend on the layout." (:toggle . global-linum-mode)))) 'search)) + +(defun ergoemacs-set-menu-bar-major-modes () + "Major Modes Menu" + (define-key-after (current-global-map) [menu-bar major-modes-menu] + (cons "Major-Modes" (ergoemacs-menu--get-major-modes)) + 'view)) + (defun ergoemacs-set-menu-bar-help () "Help menu." (global-set-key [menu-bar help-menu] @@ -1311,6 +1318,7 @@ In a terminal, this can be either arrow keys (e.g. meta+O A == <up>) or regular (ergoemacs-set-quit) (ergoemacs-set-menu-bar-help) (ergoemacs-set-menu-bar-view) + (ergoemacs-set-menu-bar-major-modes) (ergoemacs-set-menu-bar-search) (ergoemacs-set-menu-bar-edit) (ergoemacs-set-menu-bar-file)) @@ -1347,6 +1355,7 @@ In a terminal, this can be either arrow keys (e.g. meta+O A == <up>) or regular (ergoemacs-set-menu-bar-view) (ergoemacs-set-menu-bar-search) (ergoemacs-set-menu-bar-edit) + (ergoemacs-set-menu-bar-major-modes) (ergoemacs-set-menu-bar-file)) (defvar org-mode-map )