emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/idris-mode 888bf9614f 04/18: Make notes buffer special and


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode 888bf9614f 04/18: Make notes buffer special and make the show function similar to holes one
Date: Thu, 8 Dec 2022 05:59:07 -0500 (EST)

branch: elpa/idris-mode
commit 888bf9614fc550e556e2b8d2658f2bda387f2728
Author: Marek L <nospam.keram@gmail.com>
Commit: Marek L <nospam.keram@gmail.com>

    Make notes buffer special and make the show function similar to holes one
---
 idris-warnings-tree.el | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/idris-warnings-tree.el b/idris-warnings-tree.el
index 21adeb8dfd..9749e254f1 100644
--- a/idris-warnings-tree.el
+++ b/idris-warnings-tree.el
@@ -37,24 +37,23 @@
 
 (defun idris-compiler-notes-list-show (notes)
   (with-current-buffer (get-buffer-create idris-notes-buffer-name)
-      (idris-compiler-notes-mode)
-      (setq buffer-read-only nil)
-      (erase-buffer)
-      (when notes
-        (let ((root (idris-compiler-notes-to-tree notes)))
-          (idris-tree-insert root "")
-          (insert "\n")
-          (message "Press q to close, return or mouse on error to navigate to 
source")
-          (setq buffer-read-only t)
-          (goto-char (point-min))
-          notes
-          (display-buffer idris-notes-buffer-name)))))
+    (idris-compiler-notes-mode)
+    (if (null notes)
+        nil
+      (let ((buffer-read-only nil)
+            (root (idris-compiler-notes-to-tree notes)))
+        (erase-buffer)
+        (idris-tree-insert root "")
+        (insert "\n\n")
+        (message "Press q to close, return or mouse on error to navigate to 
source")
+        (goto-char (point-min))
+        (display-buffer idris-notes-buffer-name)))))
 
 (defun idris-list-compiler-notes ()
   "Show the compiler notes in tree view."
   (interactive)
   (with-temp-message "Preparing compiler note tree..."
-    (idris-complier-notes-list-show (reverse idris-raw-warnings))))
+    (idris-compiler-notes-list-show (reverse idris-raw-warnings))))
 
 (defvar idris-tree-printer 'idris-tree-default-printer)
 
@@ -81,7 +80,6 @@
 
 (defvar idris-compiler-notes-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "q") 'idris-notes-quit)
     ;;; Allow buttons to be clicked with the left mouse button in the compiler 
notes
     (define-key map [follow-link] 'mouse-face)
     (cl-loop for keyer
@@ -102,9 +100,10 @@
   (interactive)
   (idris-kill-buffer idris-notes-buffer-name))
 
-(define-derived-mode idris-compiler-notes-mode fundamental-mode 
"Compiler-Notes"
-  "Idris compiler notes
-     \\{idris-compiler-notes-mode-map}
+
+(define-derived-mode idris-compiler-notes-mode special-mode "Compiler-Notes"
+  "Major mode for displaying Idris compiler notes.
+\\{idris-compiler-notes-mode-map}
 Invokes `idris-compiler-notes-mode-hook'."
   (setq-local prop-menu-item-functions '(idris-context-menu-items)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]