Sorry, ctrl-l-map is just a keyboard mapping for ctrl-l. I use it
instead of ctrl-c as a prefix key (easier on the fingers)..
(global-unset-key "\C-l")
(defvar ctl-l-map (make-keymap)
"Keymap for local bindings and functions, prefixed by (^L)")
(define-key global-map "\C-l" 'Control-L-prefix)
(fset 'Control-L-prefix ctl-l-map)
But, you could just bind cmd-send-region to anything, just like you
bound C-c C-y
(define-key global-map "\C-c\C-y" 'comint-previous-input)
For example, if you wanted to bind it to C-c p to run the paragraph
(define-key global-map (kbd "C-c p") '(lambda () (interactive) (save-excursion
(mark-paragraph) (cmd-send-region (region-beginning) (region-end)))))
Typically you would use a (defun) instead of passing in a lambda
To start j, you could have a function like this in your .emacs
(defun jcmd()
(interactive)
(make-comint-in-buffer "cmd" nil
"C:/Users/jbogner/Downloads/j64-801/bin/jconsole.exe" nil)
(switch-to-buffer "*cmd*"))
and then do M-x jcmd
And then the C-c p should send the paragraph from another buffer to
it. I typically have emacs in a split window configuration - with my J
file on top and the interpreter buffer on the bottom.
I am happy to keep discussing it
On Wed, Mar 12, 2014 at 11:05 AM, Devon McCormick <[email protected]> wrote:
> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm