diff options
| author | john muhl | 2025-03-20 09:31:04 -0500 |
|---|---|---|
| committer | Po Lu | 2025-08-25 09:59:04 +0800 |
| commit | 3fa5aa47bef85fef2a10c756bbad129863ca4990 (patch) | |
| tree | 7c3d15dc4798bb7e294ea4928e943b29c7b3d21b | |
| parent | 0b1b96778171e5753ce8906caae3611e554d00d4 (diff) | |
| download | emacs-3fa5aa47bef85fef2a10c756bbad129863ca4990.tar.gz emacs-3fa5aa47bef85fef2a10c756bbad129863ca4990.zip | |
Use easy-menu in 'lua-mode'
* lisp/progmodes/lua-mode.el (lua-mode-menu): Delete.
(lua-mode-map): Use 'easy-menu-define'.
| -rw-r--r-- | lisp/progmodes/lua-mode.el | 54 |
1 files changed, 17 insertions, 37 deletions
diff --git a/lisp/progmodes/lua-mode.el b/lisp/progmodes/lua-mode.el index f74ebd823bb..dd1243a93b0 100644 --- a/lisp/progmodes/lua-mode.el +++ b/lisp/progmodes/lua-mode.el | |||
| @@ -243,9 +243,6 @@ Should be a list of strings." | |||
| 243 | (let ((val (eval sym))) | 243 | (let ((val (eval sym))) |
| 244 | (if val (single-key-description (eval sym)) "")))) | 244 | (if val (single-key-description (eval sym)) "")))) |
| 245 | 245 | ||
| 246 | (defvar lua-mode-menu (make-sparse-keymap "Lua") | ||
| 247 | "Keymap for lua-mode's menu.") | ||
| 248 | |||
| 249 | (defvar lua-prefix-mode-map | 246 | (defvar lua-prefix-mode-map |
| 250 | (eval-when-compile | 247 | (eval-when-compile |
| 251 | (let ((result-map (make-sparse-keymap))) | 248 | (let ((result-map (make-sparse-keymap))) |
| @@ -271,7 +268,6 @@ If the latter is nil, the keymap translates into `lua-mode-map' verbatim.") | |||
| 271 | (char-to-string electric-char)) | 268 | (char-to-string electric-char)) |
| 272 | #'lua-electric-match)) | 269 | #'lua-electric-match)) |
| 273 | lua--electric-indent-chars)) | 270 | lua--electric-indent-chars)) |
| 274 | (define-key result-map [menu-bar lua-mode] (cons "Lua" lua-mode-menu)) | ||
| 275 | (define-key result-map [remap backward-up-list] 'lua-backward-up-list) | 271 | (define-key result-map [remap backward-up-list] 'lua-backward-up-list) |
| 276 | 272 | ||
| 277 | ;; handle prefix-keyed bindings: | 273 | ;; handle prefix-keyed bindings: |
| @@ -2130,39 +2126,23 @@ member of `flymake-diagnostic-functions'." | |||
| 2130 | 2126 | ||
| 2131 | ;; menu bar | 2127 | ;; menu bar |
| 2132 | 2128 | ||
| 2133 | (define-key lua-mode-menu [restart-with-whole-file] | 2129 | (easy-menu-define lua-mode-menu lua-mode-map |
| 2134 | '("Restart With Whole File" . lua-restart-with-whole-file)) | 2130 | "Menu bar entry for `lua-mode'." |
| 2135 | (define-key lua-mode-menu [kill-process] | 2131 | `("Lua" |
| 2136 | '("Kill Process" . lua-kill-process)) | 2132 | ["Search Documentation" lua-search-documentation] |
| 2137 | 2133 | ["Send Buffer" lua-send-buffer] | |
| 2138 | (define-key lua-mode-menu [hide-process-buffer] | 2134 | ["Send Proc" lua-send-proc] |
| 2139 | '("Hide Process Buffer" . lua-hide-process-buffer)) | 2135 | ["Send Region" lua-send-region] |
| 2140 | (define-key lua-mode-menu [show-process-buffer] | 2136 | ["Send Current Line" lua-send-current-line] |
| 2141 | '("Show Process Buffer" . lua-show-process-buffer)) | 2137 | ["Set Lua-Region Start" lua-set-lua-region-start] |
| 2142 | 2138 | ["Set Lua-Region End" lua-set-lua-region-end] | |
| 2143 | (define-key lua-mode-menu [end-of-proc] | 2139 | ["Send Lua-Region" lua-send-lua-region] |
| 2144 | '("End Of Proc" . lua-end-of-proc)) | 2140 | ["Beginning Of Proc" lua-beginning-of-proc] |
| 2145 | (define-key lua-mode-menu [beginning-of-proc] | 2141 | ["End Of Proc" lua-end-of-proc] |
| 2146 | '("Beginning Of Proc" . lua-beginning-of-proc)) | 2142 | ["Show Process Buffer" lua-show-process-buffer] |
| 2147 | 2143 | ["Hide Process Buffer" lua-hide-process-buffer] | |
| 2148 | (define-key lua-mode-menu [send-lua-region] | 2144 | ["Kill Process" lua-kill-process] |
| 2149 | '("Send Lua-Region" . lua-send-lua-region)) | 2145 | ["Restart With Whole File" lua-restart-with-whole-file])) |
| 2150 | (define-key lua-mode-menu [set-lua-region-end] | ||
| 2151 | '("Set Lua-Region End" . lua-set-lua-region-end)) | ||
| 2152 | (define-key lua-mode-menu [set-lua-region-start] | ||
| 2153 | '("Set Lua-Region Start" . lua-set-lua-region-start)) | ||
| 2154 | |||
| 2155 | (define-key lua-mode-menu [send-current-line] | ||
| 2156 | '("Send Current Line" . lua-send-current-line)) | ||
| 2157 | (define-key lua-mode-menu [send-region] | ||
| 2158 | '("Send Region" . lua-send-region)) | ||
| 2159 | (define-key lua-mode-menu [send-proc] | ||
| 2160 | '("Send Proc" . lua-send-proc)) | ||
| 2161 | (define-key lua-mode-menu [send-buffer] | ||
| 2162 | '("Send Buffer" . lua-send-buffer)) | ||
| 2163 | (define-key lua-mode-menu [search-documentation] | ||
| 2164 | '("Search Documentation" . lua-search-documentation)) | ||
| 2165 | |||
| 2166 | 2146 | ||
| 2167 | (provide 'lua-mode) | 2147 | (provide 'lua-mode) |
| 2168 | 2148 | ||