all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Comint and windows
@ 2015-11-05  8:12 Sam Halliday
  2015-11-05 16:22 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sam Halliday @ 2015-11-05  8:12 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

I've been forced to use Windows at work and I'm finding some of my modes don't work.

One mode that is not working for me is sbt-mode:

https://github.com/hvesalai/sbt-mode/issues/33

It is a pretty standard implementation of a major mode that talks to an external process via comint. But it looks like commands typed in emacs are not being sent to the process.

Are there any known gotchas with writing these sorts of modes to run on windows?

Best regards, Sam


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comint and windows
  2015-11-05  8:12 Comint and windows Sam Halliday
@ 2015-11-05 16:22 ` Eli Zaretskii
  2015-11-05 18:26 ` Jeffrey DeLeo
       [not found] ` <mailman.1777.1446740565.7904.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2015-11-05 16:22 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 5 Nov 2015 00:12:51 -0800 (PST)
> From: Sam Halliday <sam.halliday@gmail.com>
> 
> I've been forced to use Windows at work and I'm finding some of my modes don't work.
> 
> One mode that is not working for me is sbt-mode:
> 
> https://github.com/hvesalai/sbt-mode/issues/33
> 
> It is a pretty standard implementation of a major mode that talks to an external process via comint. But it looks like commands typed in emacs are not being sent to the process.
> 
> Are there any known gotchas with writing these sorts of modes to run on windows?

Yes.  It's likely a buffering issue.  Windows doesn't have pty's, so
communications with subprocesses is via pipes, which fail the isatty
test, and so the subprocess most probably buffers its standard
streams because it doesn't sense that they are connected to a terminal
device.

Try invoking the subprocess in a way that disables buffering of
stdin/stdout on the subprocess's side.  It could be some command-line
switch or maybe some command you need to invoke immediately after
invoking the subprocess.  (If there's no such option, ask the
developers to provide one, or hack the code yourself.)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comint and windows
  2015-11-05  8:12 Comint and windows Sam Halliday
  2015-11-05 16:22 ` Eli Zaretskii
@ 2015-11-05 18:26 ` Jeffrey DeLeo
  2015-11-06 13:04   ` Filipp Gunbin
       [not found] ` <mailman.1777.1446740565.7904.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 6+ messages in thread
From: Jeffrey DeLeo @ 2015-11-05 18:26 UTC (permalink / raw)
  To: help-gnu-emacs

I used to use emacs regularly on Windows, along with cygwin. I no longer
do. I did use shell and other processes successfully, this is from my
.emacs on Windows. I can't say what is relevant anymore, though.

#+BEGIN_SRC emacs-lisp

  (defun my-shell-setup ()
         "For Cygwin bash under Emacs 20"
         (setq comint-scroll-show-maximum-output 'this)
         (make-variable-buffer-local 'comint-completion-addsuffix))

  (setq shell-file-name "bash")
  (setenv "SHELL" shell-file-name) 

  (setq explicit-shell-file-name shell-file-name) 
  (setq explicit-shell-args '("--login" "-i"))
  (setq shell-command-switch "-ic")
  (setq explicit-bash-args '("--noediting"))
  (setq comint-completion-addsuffix t)
  ;(setq comint-process-echoes t) ;; reported that this is no longer needed
  (setq comint-eol-on-send t)
  (setq w32-quote-process-args ?\")

  (setq shell-mode-hook 'my-shell-setup)

  ;; Prevent issues with the Windows null device (NUL)
  ;; when using cygwin find with rgrep.
  (defadvice grep-compute-defaults (around grep-compute-defaults-advice-null-device)
    "Use cygwin's /dev/null as the null-device."
    (let ((null-device "/dev/null"))
  	ad-do-it))
  (ad-activate 'grep-compute-defaults)
#+END_SRC


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comint and windows
  2015-11-05 18:26 ` Jeffrey DeLeo
@ 2015-11-06 13:04   ` Filipp Gunbin
  2015-11-06 15:49     ` Jeffrey DeLeo
  0 siblings, 1 reply; 6+ messages in thread
From: Filipp Gunbin @ 2015-11-06 13:04 UTC (permalink / raw)
  To: Jeffrey DeLeo; +Cc: help-gnu-emacs

On 05/11/2015 10:26 -0800, Jeffrey DeLeo wrote:

> I used to use emacs regularly on Windows, along with cygwin. I no longer
> do. I did use shell and other processes successfully, this is from my
> .emacs on Windows. I can't say what is relevant anymore, though.

It would be helpful to mention what Emacs you used - native or Cygwin
version.

I've used Cygwin Emacs for some years, there was no need for such setup
(except, maybe, for `w32-quote-process-args' - I don't know its meaning
and it's absent on Macos, where I am currently).

Filipp



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comint and windows
  2015-11-06 13:04   ` Filipp Gunbin
@ 2015-11-06 15:49     ` Jeffrey DeLeo
  0 siblings, 0 replies; 6+ messages in thread
From: Jeffrey DeLeo @ 2015-11-06 15:49 UTC (permalink / raw)
  To: help-gnu-emacs

Filipp Gunbin <fgunbin@fastmail.fm> writes:

> It would be helpful to mention what Emacs you used - native or Cygwin
> version.

Good point - I was using native Windows emacs.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Comint and windows
       [not found] ` <mailman.1777.1446740565.7904.help-gnu-emacs@gnu.org>
@ 2015-11-07 17:21   ` Sam Halliday
  0 siblings, 0 replies; 6+ messages in thread
From: Sam Halliday @ 2015-11-07 17:21 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks Eli, that was exactly it! It was possible to tell the subprogram (a Java app that uses jline) to not buffer and everything started to work.

On Thursday, 5 November 2015 16:22:48 UTC, Eli Zaretskii  wrote:
> > Date: Thu, 5 Nov 2015 00:12:51 -0800 (PST)
> > From: Sam Halliday <sam.halliday@gmail.com>
> > 
> > I've been forced to use Windows at work and I'm finding some of my modes don't work.
> > 
> > One mode that is not working for me is sbt-mode:
> > 
> > https://github.com/hvesalai/sbt-mode/issues/33
> > 
> > It is a pretty standard implementation of a major mode that talks to an external process via comint. But it looks like commands typed in emacs are not being sent to the process.
> > 
> > Are there any known gotchas with writing these sorts of modes to run on windows?
> 
> Yes.  It's likely a buffering issue.  Windows doesn't have pty's, so
> communications with subprocesses is via pipes, which fail the isatty
> test, and so the subprocess most probably buffers its standard
> streams because it doesn't sense that they are connected to a terminal
> device.
> 
> Try invoking the subprocess in a way that disables buffering of
> stdin/stdout on the subprocess's side.  It could be some command-line
> switch or maybe some command you need to invoke immediately after
> invoking the subprocess.  (If there's no such option, ask the
> developers to provide one, or hack the code yourself.)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-07 17:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05  8:12 Comint and windows Sam Halliday
2015-11-05 16:22 ` Eli Zaretskii
2015-11-05 18:26 ` Jeffrey DeLeo
2015-11-06 13:04   ` Filipp Gunbin
2015-11-06 15:49     ` Jeffrey DeLeo
     [not found] ` <mailman.1777.1446740565.7904.help-gnu-emacs@gnu.org>
2015-11-07 17:21   ` Sam Halliday

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.