haskell / haskell/haskell-mode

Refactor haskell-session-interactive-buffer so that it does not call switch-to-buffer-other-window

Open
#806 0 comments 0 reactions 0 assignees View on GitHub
well-defined-task
Dominant language
Emacs Lisp
Stars
1.4k
Forks
354
Avg merge
5d 10h
Merged PRs (30d)
2

Description

Currently `haskell-session-interactive-buffer` calls `switch-to-buffer-other-window` and that is on the wrong level of abstraction. Callers of `haskell-session-interactive-buffer` should be refactored to call `switch-to-buffer-other-window` when it is needed. It is expected that most places will not need this call. `haskell-session-interactive-buffer` should not call `switch-to-buffer-other-window`.

These are call sites that need to be looked through if `switch-to-buffer-other-window` is needed:
- [ ] ghci-script-mode.el:60: (let ((buffer (haskell-session-interactive-buffer (haskell-session)))
- [ ] haskell-interactive-mode.el:308: (haskell-session-interactive-buffer session)
- [ ] haskell-interactive-mode.el:330: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell-interactive-mode.el:368: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell-interactive-mode.el:394: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell-interactive-mode.el:480: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell-interactive-mode.el:505: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell-interactive-mode.el:515:(defun haskell-session-interactive-buffer (s)
- [ ] haskell-interactive-mode.el:949: (with-current-buffer (haskell-session-interactive-buffer (haskell-interactive-session))
- [ ] haskell-interactive-mode.el:991: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell-interactive-mode.el:1054: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell-interactive-mode.el:1093: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell-menu.el:155: (switch-to-buffer (haskell-session-interactive-buffer session))))
- [ ] haskell-repl.el:111: (with-current-buffer (haskell-session-interactive-buffer session)
- [ ] haskell.el:141: (kill-buffer (haskell-session-interactive-buffer session)))
- [ ] haskell.el:199: (buffer (haskell-session-interactive-buffer (haskell-session))))
- [ ] haskell.el:269: (haskell-session-interactive-buffer (haskell-session)))
- [ ] haskell.el:286: (with-current-buffer (haskell-session-interactive-buffer (haskell-session))
- [ ] haskell.el:376: (buffer (haskell-session-interactive-buffer session)))

Contributor guide

Open the contributing guide

Research direction

Start with haskell-interactive-mode.el:515, where haskell-session-interactive-buffer is defined, then inspect the listed call sites in ghci-script-mode.el, haskell-interactive-mode.el, haskell-menu.el, haskell-repl.el, and haskell.el. Determine which callers need switch-to-buffer-other-window and verify that the helper no longer performs that UI operation while required callers still switch buffers.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, emacs-lisp
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.