Comments (4)
Can you contribute a patch that works and checks for Windows? I don't have Windows.
The whole thing is sent to the GHCi process. :
is how you give commands to GHCi. :!
is one of the commands, it's for running shell commands. :!ls
gives a list of the current dir.
from haskell-mode.
I have haskell-process-generate-tags
working on Windows, but not with haskell-process-send-string
. I have to use shell-command
, *. For some reason start-process
, or call-process
(btw, which is the best in this case?)haskell-process-send-string
simply does nothing when I use it with the powershell command.
Symptom with haskell-process-send-string
: :!dir
works correctly in the Haskell-mode REPL, but :!powershell ls
freezes the REPL after it's done printing out the directory. Something similar happens with winghci, but I'm able to press enter after :!powershell ls
finished its output, and then I get back to the REPL prompt. This doesn't happen if I open ghci from cmd.exe.
I'm assuming this means powershell is expecting input after it finishes its command (the -NonInteractive flag doesn't help).
* I was mistaken.
from haskell-mode.
(defun haskell-process-generate-tags (&optional and-then-find-this-tag)
"Regenerate the TAGS table."
(interactive)
(let ((process (haskell-process)))
(haskell-process-queue-command
process
(haskell-command-make
(cons process and-then-find-this-tag)
(lambda (state)
(if (eq system-type 'windows-nt)
(shell-command
(format "powershell -Command \"& { cd %s ; hasktags -e -x (ls -fi *.hs -exclude \\\"#*#\\\" -name -r) }\""
(haskell-session-cabal-dir (haskell-process-session (car state)))))
(haskell-process-send-string
(car state)
(format ":!cd %s && %s | %s | %s"
(haskell-session-cabal-dir (haskell-process-session (car state)))
"find . -name '*.hs*'"
"grep -v '#'" ; To avoid Emacs back-up files. Yeah.
"xargs hasktags -e -x"))))
nil
(lambda (state response)
(when (cdr state)
(let ((tags-file-name
(haskell-session-tags-filename (haskell-process-session (car state)))))
(find-tag (cdr state))))
(haskell-mode-message-line "Tags generated."))))))
Is what the code looks like using shell-command, if anyone is interested. Maybe someone else can figure out how to get it working with haskell-process-send-string (or I'll try if I get around to learning elisp).
from haskell-mode.
Will merge a pull request if one is made.
from haskell-mode.
Related Issues (20)
- tree-sitter HOT 1
- add topics HOT 1
- Feature request: "cabal repl" with file target HOT 1
- Haskell repl freezes when I run getChar HOT 1
- string-trim-left redefinition vs quasi-quote tests in emacs 29.1 HOT 3
- Should `haskell-cabal` mode derive from `prog-mode`? HOT 4
- Color escape sequences from `cabal repl` causing garbled output (Cabal 3.10.1.0) HOT 3
- `deriving someStrategy ...` breaks indentation in the rest of the file
- flymake-allowed-file-name-masks is void HOT 3
- haskell-cabal: bad indentation with redundant leading comma
- error "Marker does not point anywhere"
- Symbol's value as variable is void: flymake-allowed-file-name-masks HOT 6
- An interface for hoogle HOT 5
- Add {-# LANGUAGE Data #-} to the top of the file? (y or n) HOT 2
- Loading a file under test-suite fails when importing library
- Parse error for Haskell sections
- Is cabal repl TARGET possible on starting ghci?
- automatically change session target based on buffer
- haskell mode doesn't use completion-at-point for tab HOT 1
- Monthly updates and future progress HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haskell-mode.