I'd like to play with the bare comint as I've unsuccessfully attempted to
start jconsole directly in emacs without going through "cmd".  However,
when I tried to run your example, it complained about "ctl-l-map" not being
defined.  I found a definition of something with the same name here -
http://pastebin.com/0qdgEC9t - but don't know if this is the same as yours.

Anyway, when I use this "ctl-l-map" and your code, then run "(cmd)", I get
a dead buffer "*cmd*": when I hit enter, I get the message "Output file
descriptor of cmd is closed", though it does tell me I have a running
process when I kill it.  I guess I'm confused at what point "jconsole"
comes into it as I don't see it referenced anywhere.

I'm using emacs v. 23.1.50.1 .

On a note related to an earlier post in which I mentioned the advantage of
running under "eshell" was that it properly handles an interactive "mysql"
session from the command line: it turns out I was mistaken.  The key is to
invoke mysql with the "-n" option; the "-f" option is also handy to prevent
exiting upon error.  This works from the cmd shell as well as from eshell.



On Wed, Mar 12, 2014 at 7:06 AM, Joe Bogner <[email protected]> wrote:

> Moved from programming...
>
> On Tue, Mar 11, 2014 at 5:55 PM, Devon McCormick <[email protected]>
> wrote:
> > Good to know.  I've been using the emacs shell a little bit lately but it
> > looks like I have to re-do some of my common utilities to get them to
> work
> > with it.  For instance, I have this defined
> > (define-key global-map "\C-c\C-y" 'comint-previous-input)
> > to re-do my most recent input but I guess it fails under the emacs shell
> > because it's not "comint"?
>
> (define-key global-map "\C-c\C-y" 'comint-previous-input) works for me
> in a *shell* buffer. I can hit C-c C-y to get the previous input
>
>
> I tinkered with this earlier on -- just creating a bare comint buffer.
> Instead of invoking cmd, it could invoke jconsole directly to skip the
> step of starting jconsole manually.
>
> (defun cmd()
>   (interactive)
>   (make-comint-in-buffer "cmd" nil "cmd" nil)
>   (switch-to-buffer "*cmd*"))
>
> (defun cmd-send-region (start end)
>   (interactive "r")
>   (comint-send-region (get-buffer-process "*cmd*") start end))
>
>
> ;;send the current paragraph to the cmd buffer
> (define-key ctl-l-map "p"  '(lambda () (interactive) (save-excursion
> (mark-paragraph) (cmd-send-region (region-beginning) (region-end)))))
>
> ;;send the current marked region to the cmd buffer
> (define-key ctl-l-map "r"  '(lambda () (interactive) (save-excursion
> (cmd-send-region (region-beginning) (region-end)))))
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to