Questions tagged [comint-mode]

Comint mode is a package that defines a general command-interpreter-in-a-buffer. The idea is that you can build specific process-in-a-buffer modes on top of comint mode – e.g., lisp, shell, scheme, T, soar, …. This way, all these specific packages share a common base functionality, and a common set of bindings, which makes them easier to use (and saves code, implementation time, etc., etc.).

16 questions
43
votes
1 answer

Emacs Inferior Python shell shows the send message with each python-shell-send-region command

I am using the Python inferior shell on OS X (El Capitan) and every time I send a piece of code to the Python process (using C-c C-r which is bound to python-shell-send-region) I get a message like this in the Python shell: >>> import codecs, os; …
s.yadegari
  • 603
  • 6
  • 9
4
votes
1 answer

Get result back from comint-redirect-send-command

I want to read the output of a buffer after process started by comint finishes. (comint-redirect-send-command-to-process command-string ;; tested to work in the commint buffer output-buffer-name ;; random text …
Karl
  • 427
  • 4
  • 15
4
votes
1 answer

Why emacs comint mode doesn't process string as shell?

For example I have following command to run my project: java -cp "lib/*:src:resources" clojure.main -m etl-proxy.proxy.core So I try to create comint buffer with following command: (progn (kill-all-local-variables) (erase-buffer) …
proofit404
  • 281
  • 1
  • 13
3
votes
1 answer

Avoid accidental execution in comint mode

Sometimes when in comint mode the point is anywhere in the buffer and I press Return by mistake. This sends the text at point to the underlying process, which can be really dangerous. Often this text contains many lines and, by chance or not, one of…
memeplex
  • 2,297
  • 27
  • 26
2
votes
2 answers

How do I add auto-completion to my custom comint mode in Emacs?

I'm writing a comint mode for a legacy command-line tool. I'd like to add basic auto-completion to it. Suppose I have the following list of keywords used by the tool: (defconst my-keywords '("export" "extract" "display")) How would I add…
kotchwane
  • 2,082
  • 1
  • 19
  • 24
2
votes
2 answers

Emacs shell-mode: Prevent RET sending input from anywhere

As the documentation says that RET will comint-send-input anywhere in a shell mode. The issue is that if you by mistake hit enter on any line and you are not at a prompt it will execute the whole random text until the next prompt. How can I prevent…
Yuki
  • 3,857
  • 5
  • 25
  • 43
2
votes
1 answer

Silently send command to comint without printing prompt

I want to send a command to a comint shell-mode without it printing an additional prompt. I'm trying to use the comint-redirect-* API, but I am still getting an additional prompt. What would be an easy way to either avoid the prompt printing…
Rorschach
  • 31,301
  • 5
  • 78
  • 129
2
votes
2 answers

Limiting length of ENSIME server buffer; hook for this buffer

I want to limit the length of the *inferior-ensime-server-...* buffer to a few thousand lines. This looks promising, from https://stackoverflow.com/a/11255400/1007926, but does not work in this case: (add-hook 'compilation-filter-hook…
Peter Becich
  • 989
  • 3
  • 14
  • 30
2
votes
3 answers

How do I define commands to run upon starting sql-mode?

I use Sql-mode to connect to an Oracle database. The default settings for linesize and pagesize, and colsep are not ideal, so I'd like to have Emacs automatically run the following commands upon connecting to my databases: SET COLSEP "|" SET…
Babu
  • 159
  • 6
2
votes
1 answer

Refresh *R dired* buffer after executing command in inferior ESS process

I'd like to advise the inferior-ess-send-input interactive function to call my function which refreshes the *R dired* buffer automatically. I've tried using after and around as classes. For example: (defadvice inferior-ess-send-input (around…
wdkrnls
  • 4,548
  • 7
  • 36
  • 64
2
votes
2 answers

Emacs Comint History: Search Rather Than Navigate One By One

I would like to, after switching to the buffer where I usually run commands, navigate the history by searching it, rather than navigate one-command-at-a-time at the end of the buffer (e.g. C-p). Basically I would like to "Reverse I-search" the…
PascalVKooten
  • 20,643
  • 17
  • 103
  • 160
2
votes
2 answers

Executing python script with arguments within comint-mode in emacs

I am writing a comint-mode for a python script. The script can be launched with : /usr/bin/python3.3 tool-name arg0 I am using comint-mode since this call will ask in the prompt some information before running. If I create : (defun create-app () …
Quanteek
  • 254
  • 2
  • 11
1
vote
1 answer

In emacs, what is the best way to run an external program in another window that can be closed by a single key command after executing program exits?

I have some elisp that runs an external 'npm' command. (defun npm-mode-npm-run () "Run the 'npm run' command on a project script." (interactive) (let ((command (completing-read "Run command: "…
Allen Gooch
  • 403
  • 1
  • 3
  • 13
0
votes
0 answers

Long output lines in Emacs shell buffer (comint-mode) cause "stack overflow in regexp matcher"

Occasionally some process will output a very long line in an Emacs shell buffer (e.g. a multi-kilobyte Java class path). This frequently leads to a "stack overflow in regexp matcher" error, leaving the whole Emacs session unresponsive. Which regexp…
kevin cline
  • 2,608
  • 2
  • 25
  • 38
0
votes
1 answer

Pop last command from comint-input-history

How to programmatically pop the last command from comint-input-history? I tried something like (pop (cdr (cdr comint-input-ring))) but that does not work. It seems to be an array, but I'm also stuck with (aref (cdr (cdr comint-input-ring)) 0)
PascalVKooten
  • 20,643
  • 17
  • 103
  • 160
1
2