I've just started using LispWorks 7.1
In SLIME, ctrl + up/down arrow brings the previous / next expressions.
How to do the same in LispWorks in the Listener?
In the Listener?
Depends on the keybindings. See c-h b for a list of bindings. See the editor commands History Next and History Previous in the list - there might be more than one keybinding for that. One can also customize that, if wanted. Use the function editor:bind-key for that.
Related
I'm new to Clojure and new to Emacs.
Is there an Emacs short-cut to intelligently re-indent the whole file?
if not, is there at least a way to indent selected regions left or right?
I feel like I'm back in the stone age repeatedly pressing the arrows
C-x h selects the entire buffer. C-M-\ reindents the selected region.
Ctrl-x, h (select all) followed by Tab (to indent)
cider-format-buffer command (Since cider 0.9.0)
When you capture data from a sequence like C-u C-c C-e
(cider-eval-last-sexp), the raw data output to your buffer can be
unwieldy to inspect/work with. And the normal code-indenting commands
(mentioned in answers here) don't handle it well.
For handling results from such evaluated expressions, try
cider-format-edn-region.
As a concrete example, have you ever tried reformatting your
~/.lein/profiles.clj? This is pretty hard to do and keep
consistent, until you discover cider-format-edn-region. Take
caution that it will, however, remove any comments.
Use cljfmt for many configurable ways to reformat/reindent. It has an Emacs plugin, but also can be run via lein.
In org-mode, pressing M-S-RET (meta-shift-return) will create a new TODO on a new line. This key sequence sends M-RET to emacs through my terminal. I've checked this with C-h c ESC-S-RET, which returns M-RET is undefined in the mini-buffer.
I'm using Snow Leopard with Emacs 23.2.1 running in Terminal.app. There is no option to define a RET sequence in the terminal keyboard preferences.
Any idea what's causing the missing SHIFT? Workarounds?
You can get Emacs to pretend that it got S-RET with C-x # S RET (note uppercase S).
This also works for adding control, meta, alt, hyper or super modifiers; type C-x # C-h for the list of bindings. The Modifier Keys section in the Emacs manual mentions this as well.
In general, lots of keystrokes are simply impossible to send via a terminal, since terminals emulate an old protocol that only allowed 256 separate keys (or maybe only 128).
Chances are, when you press S-RET, Terminal.app does exactly the same thing as if you'd pressed RET. Thus Emacs has no way to distinguish those two cases.
Cross-linking to other Q&As:
If you are using an xterm, then the modifyOtherKeys option may facilitate that binding. See the following for details:
Send "C-(" to Emacs in VT100/xterm terminal (Mac OS X's Terminal)?
I suspect Emacs recognises those codes by default, but if not then also see input-decode-map as described here: Binding M-<up> / M-<down> in Emacs 23.1.1
See explanation and alternative shortcuts for TTY here.
Some of these have worked for me in a terminal in Ubuntu Linux (both locally and over SSH), but not all of them seem to work. For example, the alternative provided for S-RET (which I expected to run org-table-copy-down) instead seems to run org-clone-subtree-with-time-shift for some reason. However, I have found the list of alternatives useful, particularly those with the M- prefix. For example ESC UP for M-UP to move text around in tables.
My problem is that I want to bind Control + Backspace combination to backward-delete-word function. However, it doesn't seem possible because emacs doesn't detect the Control key in combination with backspace.
I detected that by looking at the "logger" (C-h l). So if I press Backspace, it shows DEL. If I press Control + Backspace, it still shows DEL.
Is there any way to achieve that?
I have read and tried other questions, but couldn't fix it.
As #phils pointed out, if you are using Emacs in a terminal (e.g. emacs -nw) instead of as a GUI (no -nw command-line option), and if you are not on MS Windows, then by default certain key sequences are not available to you.
However, it might still be possible for you to configure the terminal (e.g., xterm) so that it in fact supports some such key sequences for Emacs. See this comment by the Emacs maintainer in the discussion of Emacs bug #10387.
(That said, you might find it simpler to just use a different key sequence. Or switch to the GUI version of Emacs.)
In emacs (ver. 24.3), I have my forward-paragraph and backward-paragraph mapped to M-p and M-n instead of M-{ and M-}. It is easier for me to remember and use fluidly with C-p and C-n. I've recently started using multi-term to run most of my terminal work. However, when I switch to line-mode my custom bindings for forward and backward paragraph no longer work. It says 'empty input ring'. Oddly when I'm in char-mode, the C-p and C-n do what they are supposed to do (bringing up previous prompt entries), but my paragraph movements work.
So in short, my custom forward and backward paragraph bindings work in char-mode (where I don't really need them), but not in line-mode. Any ideas?
See term-bind-key-alist, which includes C-p, C-n, M-p, and M-n by default. See also these passages from the EmacsWiki page MultiTerm. The second especially seems relevant to your problem. These do not mention term-line-mode or term-char-mode, but I think they might give you a place to start.
Note 1
‘term-unbind-key-list’ is a list of keys which emacs keeps for itself. By default it contains (“C-z” “C-c” “C-x” “C-h” “C-y” “”)
‘term-bind-key-alist’ is a list of keys and functions which you can use, for example to use Emacs style cursor movement to the multi-terminal. The default is long, so I’ll let you look it up yourself.
Note 2
Because C-r is default keystroke for isearch-backward, for avoid conflict with C-r, i binding M-r to send “C-r” character to shell.
You can use option term-bind-key-alist/term-unbind-key-list to binding/unbinding special keystroke in multi-term.el, and don’t use term-mode-hook. ☺ –- AndyStewart
Also, I don't see term-line-mode anywhere in multi-term.el. It looks as if it makes use only of term-char-mode. See, for instance, multi-term-keystroke-setup.
I'm new to Clojure and new to Emacs.
Is there an Emacs short-cut to intelligently re-indent the whole file?
if not, is there at least a way to indent selected regions left or right?
I feel like I'm back in the stone age repeatedly pressing the arrows
C-x h selects the entire buffer. C-M-\ reindents the selected region.
Ctrl-x, h (select all) followed by Tab (to indent)
cider-format-buffer command (Since cider 0.9.0)
When you capture data from a sequence like C-u C-c C-e
(cider-eval-last-sexp), the raw data output to your buffer can be
unwieldy to inspect/work with. And the normal code-indenting commands
(mentioned in answers here) don't handle it well.
For handling results from such evaluated expressions, try
cider-format-edn-region.
As a concrete example, have you ever tried reformatting your
~/.lein/profiles.clj? This is pretty hard to do and keep
consistent, until you discover cider-format-edn-region. Take
caution that it will, however, remove any comments.
Use cljfmt for many configurable ways to reformat/reindent. It has an Emacs plugin, but also can be run via lein.