Skip to content

haskell-present does not follow its doc string #607

Closed
@geraldus

Description

@geraldus

This is what doc string of haskell-present states:

Present CODE in a popup buffer suffixed with NAME and set
SESSION as the current haskell-session.

However, there is nothing related to SESSION arg in function body [1]:

(defun haskell-present (name session code)
  "Present CODE in a popup buffer suffixed with NAME and set
SESSION as the current haskell-session."
  (let* ((name (format "*Haskell Presentation%s*" name))
         (buffer (get-buffer-create name)))
    (with-current-buffer buffer
      (haskell-presentation-mode)
      (if (boundp 'shm-display-quarantine)
          (set (make-local-variable 'shm-display-quarantine) nil))
      (let ((buffer-read-only nil))
        (erase-buffer)
        (insert (propertize "-- Hit `q' to close this window.\n\n"
                            'face
                            'font-lock-comment-face))
        (let ((point (point)))
          (insert code "\n\n")
          (font-lock-fontify-region point (point))
          (goto-char point))))
    (if (eq major-mode 'haskell-presentation-mode)
        (switch-to-buffer buffer)
      (pop-to-buffer buffer))))

However, haskell-process-do-simple-echo does session assignment, which is not documented [2]:

(haskell-session-assign
  (haskell-process-session (car state)))

Am I missing something?

[1] https://github.com/haskell/haskell-mode/blob/master/haskell-presentation-mode.el#L38-L58
[2] https://github.com/haskell/haskell-mode/blob/master/haskell-interactive-mode.el#L1119-L1120

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions