Skip to content

Conversation

@keram
Copy link
Contributor

@keram keram commented Nov 16, 2025

This revisits #148 and improves the user experience when Idris does not report any errors.

Previously in such case the user is left with empty buffer in some of the windows. After this change if there is nothing to display the window the notes either display previous buffer or it is closed completely if notes buffer was the only buffer displayed in it.

Example:

  • single window

output-2025-11-16-00:31:14

  • two existing windows

output-2025-11-16-00:31:54


(defvar idris-tree-printer 'idris-tree-default-printer)

(defun idris-compiler-notes-list-show (notes)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering renaming this function as it handles full life cycle of the notes not just showing them.

(when window (quit-window nil window))
(idris-tree-insert root "")
(insert "\n\n")
(message "Press q to close, return or mouse on error to navigate to source")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is "never" shown as it is quickly superseded by 2 another messages.
Messages in messages buffer.

...
Preparing compiler note tree...
Press q to close, return or mouse on error to navigate to source
Wrote /idris/idris2/src/Idris/Parser.idr
Evaluation returned an error: Error(s) building file src/Idris/Parser.idr.

Will remove it as part of separate MR

@keram
Copy link
Contributor Author

keram commented Nov 16, 2025

I'm also not convinced about this code

        ;; Clear the contents of the compiler notes buffer, if it exists
        (when (get-buffer idris-notes-buffer-name)
          (with-current-buffer idris-notes-buffer-name
            (let ((inhibit-read-only t)) (erase-buffer))))

in idris-load-file which was solution to #123 as it adds extra responsibilities to this function and there may be better ways to notify user about changes in the notes buffer.
(mode line change, fringe colour change etc.)

This revisits idris-hackers#148
and improves the user experience when Idris does not report any errors.

Previously in such case the user is left with empty buffer in some of the windows.
After this change if there is nothing to display the window
the notes either display previous buffer or it is closed completely if notes
buffer was the only buffer displayed in it.
@keram keram force-pushed the notes-buffer-impro branch from e924176 to 39c6e03 Compare November 17, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant