-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interactive-Haskell multiline support #1353
Comments
Shouldn't λ Prelude ¬
λ > let a =
λ | [0..100]
λ |
a :: (Enum t, Num t) => [t]
(0.00 secs, 0 bytes)
λ Prelude ¬
λ > a
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
92, 93, 94, 95, 96, 97, 98, 99, 100]
it :: (Enum t, Num t) => [t]
(0.01 secs, 0 bytes)
λ Prelude ¬
λ > But it break |
Are you using the latest snapshot release? The way |
Try to install recent version, got error: if [ ! -d $(dirname build-24.5.2/build-flag) ]; then mkdir $(dirname build-24.5.2/build-flag); fi
/run/current-system/sw/bin/emacs --eval "(add-to-list 'load-path (expand-file-name \"tests/compat\") 'append)" --eval "(when (boundp 'load-prefer-newer) (setq load-prefer-newer t))" --batch -Q -L . --eval '(setq byte-compile-error-on-warn t)' \
--eval "(defun byte-compile-dest-file (filename) \
(concat (file-name-directory filename) \"build-\" emacs-version \"/\" \
(file-name-nondirectory filename) \"c\"))'" \
-f batch-byte-compile haskell-font-lock.el haskell-customize.el haskell-completions.el haskell-checkers.el haskell-session.el haskell-string.el haskell-repl.el highlight-uses-mode.el haskell-process.el haskell-collapse.el inf-haskell.el haskell-presentation-mode.el haskell-unicode-input-method.el haskell-mode.el haskell-load.el ghci-script-mode.el ghc-core.el w3m-haddock.el haskell-move-nested.el haskell-debug.el haskell-navigate-imports.el haskell-menu.el haskell-interactive-mode.el haskell.el haskell-cabal.el haskell-compile.el haskell-sandbox.el haskell-ghc-support.el haskell-doc.el haskell-compat.el haskell-align-imports.el haskell-commands.el haskell-indent.el haskell-decl-scan.el haskell-modules.el haskell-hoogle.el haskell-indentation.el haskell-complete-module.el haskell-utils.el haskell-c2hs.el haskell-lexeme.el haskell-sort-imports.el
In toplevel form:
haskell-font-lock.el:445:1:Warning: Unused lexical argument `args'
haskell-font-lock.el:445:1:Warning: Unused lexical argument `fmt'
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-font-lock.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-customize.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-completions.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-checkers.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-session.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-string.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-repl.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/highlight-uses-mode.elc
In toplevel form:
haskell-process.el:488:1:Warning: Unused lexical argument `e'
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-process.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-collapse.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/inf-haskell.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-presentation-mode.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-unicode-input-method.elc
In toplevel form:
haskell-mode.el:1171:1:Error: the function `haskell-mode-stylish-buffer' is not known to be defined.
In toplevel form:
haskell-load.el:93:1:Warning: Unused lexical argument `e'
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-load.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/ghci-script-mode.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/ghc-core.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/w3m-haddock.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-move-nested.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-debug.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-navigate-imports.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-menu.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-interactive-mode.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-cabal.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-compile.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-sandbox.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-ghc-support.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-doc.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-compat.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-align-imports.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-commands.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-indent.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-decl-scan.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-modules.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-hoogle.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-indentation.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-complete-module.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-utils.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-c2hs.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-lexeme.elc
Wrote /home/netsu/.emacs.d/el-get/haskell-mode/build-24.5.2/haskell-sort-imports.elc
Makefile:60: recipe for target 'build-24.5.2/build-flag' failed
make: *** [build-24.5.2/build-flag] Error 1 Debugger entered--Lisp error: (error "el-get: make el-get could not build haskell-mode [make EMACS=/run/current-system/sw/bin/emacs all]")
signal(error ("el-get: make el-get could not build haskell-mode [make EMACS=/run/current-system/sw/bin/emacs all]"))
error("el-get: %s %s" "make" "el-get could not build haskell-mode [make EMACS=/run/current-system/sw/bin/emacs all]")
byte-code("�\203\314��@��A�\306 \307\"�\306 \310\"�\306 \311\"�\312
!\205\"�\313
!�@\306 \314\"�A\306 \315\"\211�B\203=�\316\306 \317\"!\202A�\306 \317\"�C�B\203R�\320\321\306 \322\"\"\202V�\306 \322\"�D\323 \324�E#�F\306 \325\"�G�\203r�\326\327�!!\202t��H�H�C\204��\330\331!\210�F\203R�\332\333�\"\210�B\203\222�\334\202\223�\335�I�G\205\235�\336\337!\211�J\205\312��J\340\341\342!!�K�L\343\216r�Kq\210\344�G!c)r�Kq\210\345\346\211�L\346\347%\210,�M\350\351\f\"�M\352�I�C�J
\353�D&��N\306 \354\"�(\306 \355\"�O�P\203\375�\350\356r
q\210\357 )\"\210�N\347=\203
�\350\360�(\"\210\202��\361\362
\"\210\330\363\f�O#\210�J\203$�\364�J!\210
\203,�\313
!\210\n\203A�\365�Q\\�Q\366�R\n�S#)\202M�\367�S!\205M��S�R!.�\202\311�\332\370�\"\210�B\203`�\371\202a�\372�I\346�T\352�I\f
�C�D%�U\373\374 \"\210\375�U\376�V#\210\375�U\377�R#\210\375�U\201W��S#\210\375�U\201X�\n#\210�G\203\261�\201Y��U\344�G!\"\210\201Z��U!\210\201[��U\201\\�\"\210�A\205\310�\201]��U�A\"+.
\207\367�S!\205\330��S�R!\207" [commands c next cdir cname cbuf plist-get :default-directory :command-name :buffer-name get-buffer kill-buffer :process-filter :shell el-get-shell-quote-program :program mapcar el-get-maybe-shell-quote-argument :args el-get-plist-get-with-default :sync :stdin file-name-as-directory expand-file-name error "el-get: :program argument cannot be nil" el-get-verbose-message "Running commands synchronously: %S" call-process-shell-command call-process make-temp-file "el-get" get-buffer-create generate-new-buffer-name " *temp file*" ((byte-code "\301�!\203\n�\302�!\210\301\207" [temp-buffer buffer-name kill-buffer] 2)) el-get-print-to-string write-region nil 0 message "el-get is waiting for %S to complete" apply t :message :error "%S" buffer-string "el-get: %s" set-window-buffer ...] 8)
el-get-start-process-list(haskell-mode ((:command-name "make" :buffer-name "*el-get-build: haskell-mode*" :default-directory "/home/netsu/.emacs.d/el-get/haskell-mode/" :shell t :sync sync :program "/run/current-system/sw/bin/make" :args ("EMACS=/run/current-system/sw/bin/emacs" "all") :message "el-get-build haskell-mode: make EMACS=/run/current-system/sw/bin/emacs all ok." :error "el-get could not build haskell-mode [make EMACS=/run/current-system/sw/bin/emacs all]")) (lambda (package) (el-get-install-or-init-info package (quote build)) (funcall (lambda (package) (let ((bytecomp-files (when el-get-byte-compile (el-get-assemble-files-for-byte-compilation package)))) (el-get-start-process-list package (list (el-get-byte-compile-process package "*el-get-build: haskell-mode*" "/home/netsu/.emacs.d/el-get/haskell-mode/" sync bytecomp-files)) (function el-get-post-install-build)))) package)))
el-get-build(haskell-mode (("make" "EMACS=/run/current-system/sw/bin/emacs" "all")) nil sync el-get-post-install-build)
el-get-post-install(haskell-mode)
byte-code("�\203\314��@��A�\306 \307\"�\306 \310\"�\306 \311\"�\312
!\205\"�\313
!�@\306 \314\"�A\306 \315\"\211�B\203=�\316\306 \317\"!\202A�\306 \317\"�C�B\203R�\320\321\306 \322\"\"\202V�\306 \322\"�D\323 \324�E#�F\306 \325\"�G�\203r�\326\327�!!\202t��H�H�C\204��\330\331!\210�F\203R�\332\333�\"\210�B\203\222�\334\202\223�\335�I�G\205\235�\336\337!\211�J\205\312��J\340\341\342!!�K�L\343\216r�Kq\210\344�G!c)r�Kq\210\345\346\211�L\346\347%\210,�M\350\351\f\"�M\352�I�C�J
\353�D&��N\306 \354\"�(\306 \355\"�O�P\203\375�\350\356r
q\210\357 )\"\210�N\347=\203
�\350\360�(\"\210\202��\361\362
\"\210\330\363\f�O#\210�J\203$�\364�J!\210
\203,�\313
!\210\n\203A�\365�Q\\�Q\366�R\n�S#)\202M�\367�S!\205M��S�R!.�\202\311�\332\370�\"\210�B\203`�\371\202a�\372�I\346�T\352�I\f
�C�D%�U\373\374 \"\210\375�U\376�V#\210\375�U\377�R#\210\375�U\201W��S#\210\375�U\201X�\n#\210�G\203\261�\201Y��U\344�G!\"\210\201Z��U!\210\201[��U\201\\�\"\210�A\205\310�\201]��U�A\"+.
\207\367�S!\205\330��S�R!\207" [commands c next cdir cname cbuf plist-get :default-directory :command-name :buffer-name get-buffer kill-buffer :process-filter :shell el-get-shell-quote-program :program mapcar el-get-maybe-shell-quote-argument :args el-get-plist-get-with-default :sync :stdin file-name-as-directory expand-file-name error "el-get: :program argument cannot be nil" el-get-verbose-message "Running commands synchronously: %S" call-process-shell-command call-process make-temp-file "el-get" get-buffer-create generate-new-buffer-name " *temp file*" ((byte-code "\301�!\203\n�\302�!\210\301\207" [temp-buffer buffer-name kill-buffer] 2)) el-get-print-to-string write-region nil 0 message "el-get is waiting for %S to complete" apply t :message :error "%S" buffer-string "el-get: %s" set-window-buffer ...] 8)
el-get-start-process-list(haskell-mode (nil (:command-name "*git submodule update*" :buffer-name "*git clone haskell-mode*" :default-directory "/home/netsu/.emacs.d/el-get/haskell-mode/" :program "/nix/var/nix/profiles/default/bin/git" :args ("--no-pager" "submodule" "update" "--init" "--recursive") :message "git submodule update ok" :error "Could not update git submodules")) el-get-post-install)
byte-code("�\203\314��@��A�\306 \307\"�\306 \310\"�\306 \311\"�\312
!\205\"�\313
!�@\306 \314\"�A\306 \315\"\211�B\203=�\316\306 \317\"!\202A�\306 \317\"�C�B\203R�\320\321\306 \322\"\"\202V�\306 \322\"�D\323 \324�E#�F\306 \325\"�G�\203r�\326\327�!!\202t��H�H�C\204��\330\331!\210�F\203R�\332\333�\"\210�B\203\222�\334\202\223�\335�I�G\205\235�\336\337!\211�J\205\312��J\340\341\342!!�K�L\343\216r�Kq\210\344�G!c)r�Kq\210\345\346\211�L\346\347%\210,�M\350\351\f\"�M\352�I�C�J
\353�D&��N\306 \354\"�(\306 \355\"�O�P\203\375�\350\356r
q\210\357 )\"\210�N\347=\203
�\350\360�(\"\210\202��\361\362
\"\210\330\363\f�O#\210�J\203$�\364�J!\210
\203,�\313
!\210\n\203A�\365�Q\\�Q\366�R\n�S#)\202M�\367�S!\205M��S�R!.�\202\311�\332\370�\"\210�B\203`�\371\202a�\372�I\346�T\352�I\f
�C�D%�U\373\374 \"\210\375�U\376�V#\210\375�U\377�R#\210\375�U\201W��S#\210\375�U\201X�\n#\210�G\203\261�\201Y��U\344�G!\"\210\201Z��U!\210\201[��U\201\\�\"\210�A\205\310�\201]��U�A\"+.
\207\367�S!\205\330��S�R!\207" [commands c next cdir cname cbuf plist-get :default-directory :command-name :buffer-name get-buffer kill-buffer :process-filter :shell el-get-shell-quote-program :program mapcar el-get-maybe-shell-quote-argument :args el-get-plist-get-with-default :sync :stdin file-name-as-directory expand-file-name error "el-get: :program argument cannot be nil" el-get-verbose-message "Running commands synchronously: %S" call-process-shell-command call-process make-temp-file "el-get" get-buffer-create generate-new-buffer-name " *temp file*" ((byte-code "\301�!\203\n�\302�!\210\301\207" [temp-buffer buffer-name kill-buffer] 2)) el-get-print-to-string write-region nil 0 message "el-get is waiting for %S to complete" apply t :message :error "%S" buffer-string "el-get: %s" set-window-buffer ...] 8)
el-get-start-process-list(haskell-mode ((:command-name "*git clone haskell-mode*" :buffer-name "*git clone haskell-mode*" :default-directory "/home/netsu/.emacs.d/el-get" :program "/nix/var/nix/profiles/default/bin/git" :args ("--no-pager" "clone" "--depth" "1" "https://github.com/haskell/haskell-mode.git" "haskell-mode") :message "Package haskell-mode installed." :error "Could not install package haskell-mode.") nil (:command-name "*git submodule update*" :buffer-name "*git clone haskell-mode*" :default-directory "/home/netsu/.emacs.d/el-get/haskell-mode/" :program "/nix/var/nix/profiles/default/bin/git" :args ("--no-pager" "submodule" "update" "--init" "--recursive") :message "git submodule update ok" :error "Could not update git submodules")) el-get-post-install)
el-get-git-clone(haskell-mode "https://github.com/haskell/haskell-mode.git" el-get-post-install)
el-get-github-clone(haskell-mode nil el-get-post-install)
el-get-do-install(haskell-mode)
el-get-init-and-install((f s dash xclip xterm-keybinder myrth-theme emacs-jabber sx know-your-http-well jquery-doc flymd magit git-gutter+ git-gutter-fringe+ helm-ls-git helm-git-grep git-timemachine smartparens smart-newline anzu auto-indent-mode clean-aindent col-highlight highline lacarte pp-c-l textmate undo-tree whole-line-or-region yasnippet yasnippets helm auto-complete ac-capf goto-last-change phi-search highlight-indentation helm-c-yasnippet helm-descbinds helm-cmd-t helm-swoop helm-ispell helm-ag helm-ack smooth-scrolling inertial-scroll jump-char projectile helm-projectile ag ...))
el-get(sync (f s dash xclip xterm-keybinder myrth-theme emacs-jabber sx know-your-http-well jquery-doc flymd magit git-gutter+ git-gutter-fringe+ helm-ls-git helm-git-grep git-timemachine smartparens smart-newline anzu auto-indent-mode clean-aindent col-highlight highline lacarte pp-c-l textmate undo-tree whole-line-or-region yasnippet yasnippets helm auto-complete ac-capf goto-last-change phi-search highlight-indentation helm-c-yasnippet helm-descbinds helm-cmd-t helm-swoop helm-ispell helm-ag helm-ack smooth-scrolling inertial-scroll jump-char projectile helm-projectile ag ...))
(let ((emacs-lisp-mode-hook nil) (el-get-git-shallow-clone t) (el-get-user-package-directory (concat (file-name-as-directory user-emacs-directory) "inits"))) (el-get (quote sync) el-get-packages))
el-get-sync()
(progn (el-get-sync) (el-get-clean))
(if (require (quote el-get) nil (quote noerror)) (progn (el-get-sync) (el-get-clean)) (save-current-buffer (set-buffer (url-retrieve-synchronously "https://raw.github.com/dimitri/el-get/master/el-get-install.el")) (let (el-get-master-branch el-get-install-skip-emacswiki-recipes) (goto-char (point-max)) (eval-print-last-sexp))))
eval-buffer(#<buffer *load*-88152> nil "/home/netsu/.emacs.d/site-lisp/getelget.el" nil t) ; Reading at buffer position 2565
load-with-code-conversion("/home/netsu/.emacs.d/site-lisp/getelget.el" "/home/netsu/.emacs.d/site-lisp/getelget.el" nil t)
require(getelget)
eval-buffer(#<buffer *load*-999585> nil "/home/netsu/.emacs.d/site-lisp/plugins.el" nil t) ; Reading at buffer position 13239
load-with-code-conversion("/home/netsu/.emacs.d/site-lisp/plugins.el" "/home/netsu/.emacs.d/site-lisp/plugins.el" nil t)
require(plugins)
eval-buffer(#<buffer *load*> nil "/home/netsu/.emacs.d/init.el" nil t) ; Reading at buffer position 726
load-with-code-conversion("/home/netsu/.emacs.d/init.el" "/home/netsu/.emacs.d/init.el" t t)
load("/home/netsu/.emacs.d/init" t t)
#[0 "�\205\262� \306=\203��\307�\310Q\202;� \311=\204��\307�\312Q\202;�\313\307\314\315#\203*�\316\202;�\313\307\314\317#\203:�\320\nB�\321\202;�\316\322�\323�\322\211#\210�\322=\203a�\324\325\326\307�\327Q!\"\323�\322\211#\210�\322=\203`���\210�\203\243�\330�!\331\232\203\243�\332�!\211\333P\334�!\203}�\211\202\210�\334�!\203\207��\202\210�\314\262��\203\241�\335��\"\203\237�\336\337��#\210\340\341!\210��\266�\f?\205\260�\314�\323\342\322\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
command-line()
normal-top-level() |
haskell-mode.el:1171:1:Error: the function `haskell-mode-stylish-buffer' is not known to be defined. |
You should put |
I'm not really familiar with # FIX: byte-compile haskell-mode.el after all
ELFILES := $(filter-out haskell-mode.el,$(ELFILES))
ELFILES += haskell-mode.el |
@fice-t thanks, now multiline really works fine :D however I have been forced to fork repository to be able to install it. |
Okay, I see: there's Like :set prompt FunnyPrint.prompt "λ " "%s" " ¬\nλ > "
:set prompt2 FunnyPrint.prompt2 "λ" "" " | " I see, with Oh, and I miss proper UTF8 output in strings. E.g. in my Prelude> let
Prelude| a = ["Привет","мир", "!"]
Prelude|
a :: Data.String.IsString t => [t]
(0.00 secs, 0 bytes)
Prelude> a
["\1055\1088\1080\1074\1077\1090","\1084\1080\1088","!"]
it :: Data.String.IsString t => [t]
(0.00 secs, 0 bytes)
Prelude> :color
λ Prelude ¬
λ > let
λ | a = ["Привет","мир", "!"]
λ |
a :: Data.String.IsString t => [t]
(0.00 secs, 0 bytes)
λ Prelude ¬
λ > a
["Привет", "мир", "!"]
it :: Data.String.IsString t => [t]
(0.00 secs, 0 bytes)
λ Prelude ¬
λ > |
About the errors, that makes sense as byte compiler warnings are set to give About Can you see if commenting out the 2 lines containing About UTF-8, I think that's just a GHCi problem with About |
There's not only warnings, but error in Makefile. Yes, @fice-t I can enable both, About UTF: in |
@fice-t ok, according to your explanation, I put But see, what I currently have: |
I mean:
However, all of that expected. |
Feature requests:
|
Oh, by the way, I shouldn't set |
So the escape codes only appear on the first prompt after
Can you eval the below (after everything is loaded) and see if this helps? It's just a new (setq haskell-dont-show-prompt t)
(defun haskell-interactive-mode-prompt (&optional session)
"Show a prompt at the end of the REPL buffer.
If SESSION is non-nil, use the REPL buffer associated with
SESSION, otherwise operate on the current buffer."
(with-current-buffer (if session
(haskell-session-interactive-buffer session)
(current-buffer))
(goto-char (point-max))
(unless haskell-dont-show-prompt
(let ((prompt (propertize haskell-interactive-prompt
'font-lock-face 'haskell-interactive-face-prompt
'prompt t
'read-only t
'rear-nonsticky t)))
;; At the time of writing, front-stickying the first char gives an error
;; Has unfortunate side-effect of being able to insert before the prompt
(insert (substring prompt 0 1)
(propertize (substring prompt 1)
'front-sticky t))))
(let ((marker (setq-local haskell-interactive-mode-prompt-start (make-marker))))
(set-marker marker (point)))
(when haskell-interactive-mode-scroll-to-bottom
(haskell-interactive-mode-scroll-to-bottom))))
Most likely because haskell-doc expects the regular prompt. I'm not sure how much life haskell-doc has left, so maybe when someone rewrites it the situation there will be better.
Does just |
Yes, but if I enable colors in elisp
|
Does it do all of your colouring, or do you get additional colours with Anyway, try this and see if it helps: (defun haskell-interactive-mode-eval-as-mode (session text)
"Insert TEXT font-locked according to `haskell-interactive-mode-eval-mode'."
(with-current-buffer (haskell-session-interactive-buffer session)
(let ((inhibit-read-only t))
(delete-region (1+ haskell-interactive-mode-prompt-start) (point))
(goto-char (point-max))
(let ((start (point)))
(insert (ansi-color-apply (haskell-fontify-as-mode text
haskell-interactive-mode-eval-mode)))
(when haskell-interactive-mode-collapse
(haskell-collapse start (point)))))))
Did you try the code snippet in my last post? If that works for you in |
If I firstly run this code, than start But if I firstly start UPD: you see |
@fice-t ,
Looks much better, but |
Yes, I saw that. It's an easy fix I can do if this all works out.
Also see if it works with a non-empty input. Though things like |
@fice-t many thanks for your attention to this small feature. I'll be really enjoyable if it will be implemented. |
I like colorful output too (: |
I've gotten mostly everything, but I can't find an easy way to get the value of the user's prompt from GHCi. Is there a way to bind the output of ":show"? Parsing the result on the Emacs side before everything is set up doesn't seem to work. |
@fice-t I see at least 2 workarounds:
|
@fice-t in GHCi |
@fice-t oh, I misunderstood the question. Hm, what about deal with |
not works like expected :( |
@fice-t or you can try handle it just with markers (not really good solution for compatibility with plain shell) like |
I got another compatibiliti issue with λ > :search state
Searching for: �[0;1mstate�[0m
Control.Monad.Trans.State.Lazy �[0;1m�[0;1;4mstate�[0;1m�[0m :: (Monad m) => (s -> (a, s)) -> StateT s m a
Control.Monad.Trans.State.Strict �[0;1m�[0;1;4mstate�[0;1m�[0m :: (Monad m) => (s -> (a, s)) -> StateT s m a
Control.Monad.Trans.RWS.Lazy �[0;1m�[0;1;4mstate�[0;1m�[0m :: (Monoid w, Monad m) => (s -> (a, s)) -> RWST r w s m a
Control.Monad.Trans.RWS.Strict �[0;1m�[0;1;4mstate�[0;1m�[0m :: (Monoid w, Monad m) => (s -> (a, s)) -> RWST r w s m a
Control.Monad.State.Class �[0;1m�[0;1;4mstate�[0;1m�[0m :: MonadState s m => (s -> (a, s)) -> m a
Control.Monad.State.Lazy �[0;1m�[0;1;4mstate�[0;1m�[0m :: MonadState s m => (s -> (a, s)) -> m a
Control.Monad.State.Strict �[0;1m�[0;1;4mstate�[0;1m�[0m :: MonadState s m => (s -> (a, s)) -> m a |
The issue I'm having is that the process hangs when I attempt to get any information from the process before changing
This is actually what I got working yesterday, but I felt that it would be best to use whatever users have in their
The issue is that I can't change |
Oh, I have same without Try turn of e.g. |
@fice-t Anyway, properly color prompt may be configured only by code (because depend on terminfo, which different e.g. in |
But if user don't have colored prompt, just predefined, e.g. 2-lined (with |
If there was going to be a variable needed to customize the prompt, then it could just use |
By default,
Interactive-Haskell
changeprompt
, but notprompt2
, so it looks strange, when try to use multiline input:The text was updated successfully, but these errors were encountered: