[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/idris-mode 17d9b1593f 07/14: Make hole-list buffer derived
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/idris-mode 17d9b1593f 07/14: Make hole-list buffer derived from special-mode |
Date: |
Thu, 1 Dec 2022 08:02:54 -0500 (EST) |
branch: elpa/idris-mode
commit 17d9b1593f0b5e4559d5f0ee9b145df6da2c6a4a
Author: Marek L <nospam.keram@gmail.com>
Commit: Marek L <nospam.keram@gmail.com>
Make hole-list buffer derived from special-mode
Why:
This will reduce work we need to do ourself.
(Setting the buffer as read only and adding `q` for quit the buffer)
> Special mode is a basic major mode for buffers containing text that is
> produced specially by Emacs, rather than directly from a file.
>
> Special mode sets the buffer to read-only.
> Its keymap defines several common bindings,
> including q for quit-window and g for revert-buffer.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Major-Modes.html#index-special_002dmode
amend-wip
---
idris-hole-list.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/idris-hole-list.el b/idris-hole-list.el
index 0a77ce3ab5..9b0035b4d3 100644
--- a/idris-hole-list.el
+++ b/idris-hole-list.el
@@ -42,7 +42,6 @@
(defvar idris-hole-list-mode-map
(let ((map (make-keymap)))
(suppress-keymap map)
- (define-key map (kbd "q") 'idris-hole-list-quit)
(define-key map (kbd "RET")
'idris-compiler-notes-default-action-or-show-details)
(define-key map (kbd "<mouse-2>")
'idris-compiler-notes-default-action-or-show-details/mouse)
;;; Allow buttons to be clicked with the left mouse button in the hole list
@@ -63,12 +62,16 @@
["Customize idris-hole-list-mode" (customize-group 'idris-hole-list) t]
["Customize fonts and colors" (customize-group 'idris-faces) t]))
-(define-derived-mode idris-hole-list-mode fundamental-mode "Idris Holes"
- "Major mode used for transient Idris hole list buffers
- \\{idris-hole-list-mode-map}
-Invoces `idris-hole-list-mode-hook'."
+(define-derived-mode idris-hole-list-mode special-mode "Idris Holes"
+ "Major mode used for transient Idris hole list buffers.
+\\{idris-hole-list-mode-map}
+Invokes `idris-hole-list-mode-hook'."
(setq-local prop-menu-item-functions '(idris-context-menu-items)))
+;; TODO: Auto detect mode for idris holes buffer instead of
+;; invoking `idris-hole-list-mode' in `idris-hole-list-show'
+;; (push '("#\\*idris-holes\\*$" . idris-hole-list-mode) auto-mode-alist)
+
(defun idris-hole-list-buffer ()
"Return the Idris hole buffer, creating one if there is not one"
(get-buffer-create idris-hole-list-buffer-name))
@@ -81,9 +84,9 @@ Invoces `idris-hole-list-mode-hook'."
(progn (message "No holes found!")
(idris-hole-list-quit))
(with-current-buffer (idris-hole-list-buffer)
+ (idris-hole-list-mode)
(setq buffer-read-only nil)
(erase-buffer)
- (idris-hole-list-mode)
(insert (propertize "Holes" 'face 'idris-info-title-face) "\n\n")
(when idris-show-help-text
(insert "This buffer displays the unsolved holes from the
currently-loaded code. ")
- [nongnu] elpa/idris-mode b35ac9740e 10/14: Use `idris-process-buffer-name` instead of `(idris-buffer-name :process)`, (continued)
- [nongnu] elpa/idris-mode b35ac9740e 10/14: Use `idris-process-buffer-name` instead of `(idris-buffer-name :process)`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode fbe5e363c4 11/14: Use `idris-connection-buffer-name` instead of `(idris-buffer-name :connection)`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 38f2839b58 08/14: Use `let ((buffer-read-only nil)` instead of `setq ..`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 1382948269 01/14: Consider - as operator in idris-thing-at-point, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode e8109f9ac0 04/14: Remove Idris event logging from `make test3`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 0093e0b42c 13/14: Merge pull request #576 from keram/hole-list, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode d08fd3ec78 14/14: Merge pull request #569 from keram/idris2-mode-issues-16, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode f3a032c194 03/14: Add test for `idris-add-clause`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 391963a94c 09/14: Use `idris-repl-buffer-name` instead of `(idris-buffer-name :repl)`, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 2c1329b086 06/14: Use `idris-notes-buffer-name` in idris-commands.el, ELPA Syncer, 2022/12/01
- [nongnu] elpa/idris-mode 17d9b1593f 07/14: Make hole-list buffer derived from special-mode,
ELPA Syncer <=
- [nongnu] elpa/idris-mode 195b432903 12/14: Merge pull request #574 from keram/minor-internal-impro, ELPA Syncer, 2022/12/01