How to set 80 columns in LispWorks? - common-lisp

I'm very new with Common Lisp and LispWorks so please describe all the steps.
I want to set 80 columns, how can I do?
I'm using LispWorks Personal.
I have found this command, but I don't know how to use it... where have I to write those two commands?
Turn on auto-fill-mode:
(setf fill-column 80)
(add-hook 'latex-mode-hook #'auto-fill-mode)
Thank you.

The best way for you to set the lini width to the canonical 80 columns in Lispworks Personal is the run the command "Auto Fill Mode".
You hit M-x in any buffer and, at the "Extended Command:" prompt you just type "Auto Fill Mode" (autocompletion via Tab works).
In Lispworks Personal edition you cannot use an init file, so it is pointless to try to put any commands in the ~/.lispworks file.
The commands you show in you post, appear to be Emacs ones, in ELisp. They will not function in Lispworks, which uses an Emacs, but different from the GNU based one. As Rainer said, LW does not have a LaTeX mode.
Cheers
MA

Related

How to scroll up in Vim buffer with R (using Nvim-R)

I'm a happy user of the Nvim-R plugin, but I cannot find out how to scroll up in the buffer window that the plugin opens with R. Say for instance that I have a large output in console, but I cannot see the top of it - how do I scroll up to see this? In tmux for instance there's a copy mode that quite handily lets you do this, but how is this done in the R buffer?
An example below where I'm very curious to see what's on the line above the one begining with "is.na(a)...". How can this be achieved?
I have scoured the documentation found here, but without luck.
The answer is apparently to use Ctrl+\ Ctrl+n according to this answer on the bugreports for NVim-R.
Here's what my output looks like when I output mtcars:
When I hit Ctrl+\ Ctrl+n, I can move the cursor and I get line numbers:
To get back to interactive, I just use i, the same way I normally would.
Apparently, if you are using neovim, then you can add let R_esc_term = 0 in your ~/.vimrc file and you can then use the escape key, but if you don't use neovim, you are stuck using the two ctrl commands ¯\_(ツ)_/¯.
As pointed out by ZNK, it is about switching to normal mode in Vim's terminal. This, however, can easily fail due to cumbersome keybinding. If such is the case, remap the default keybinding to something reasonable, say, by putting this in your .vimrc:
tnoremap jk <C-\><C-n>
This works for me in Linux running Vim 8.0 in terminal (e.g. does not require Neovim). As you can see, I use 'jk' to switch from insert to normal mode. One can use Esc instead of jk, however, this makes me unable to use up arrow to retrieve command line history as been reported elsewhere.

About Vi and Vim editor

What is the difference between vi and vim editor?? I want difference in technical point of view not in theatrical. If you gave example then it is much helpful for me or all the readers.
From the vim documentation:
Vim is a text editor that is upwards compatible to Vi. ... There are a lot of enhancements above Vi: multi level undo, multi windows and buffers, syntax highlighting, command line editing, filename completion, on-line help, visual selection, etc.. See
":help vi_diff.txt" for a summary of the differences between Vim and Vi.
The vi_diff help page is quite extensive; it's over 1000 lines as of vim version 7.4. That's the best place to look. You can access it in vim by running :h vi_diff, or online at http://vimdoc.sourceforge.net/htmldoc/vi_diff.html.
You should also be aware that on many systems running vi will actually invoke vim, because of the presence of either a hardlink or a symlink (or maybe even a script or executable, which I've seen). But there are slight differences between the two methods of invocation; for instance, running vi may not load your .vimrc.
vim has vi's features plus other features like, the ability to visually select blocks of code, and much more. Syntax coloring/highlighting as well. You can use vim for just about anything you would use vi.
Vim stands for Vi IMproved. It has been ported to multiple different platforms, but is functionally almost the same. Wikipedia it!

Emacs auto-complete for ESS in tooltip instead of buffer

I understand from the following resources:
http://www.emacswiki.org/emacs/ESSAuto-complete
http://www.emacswiki.org/emacs/AutoComplete
Emacs autocomplete-mode extension for ESS and R
Is it possible to get code completion for R in Emacs ESS similar to what is available in Rstudio?
...that I should have access to tooltips for auto-complete help in emacs when using ESS for R development. The last link additionally specifies that it should work out of the box with the latest ESS, and:
From version 12.03 ESS integrates out of the box with auto-complete
package.
Three sources ‘ac-source-R-args’, ‘ac-source-R-objects’ and
‘ac-source-R’ are included in ESS distribution. The latest combines
previous two and makes them play nicely together.
I know that in general, my emacs tooltips are possible because they appear correctly with my python jedi setup in emacs.
However, my emacs auto-complete does not work. Instead, there is a buffer at the bottom:
instead of this, with the help superimposed on the working buffer:
And I have the following in my init.el:
(require 'auto-complete)
(setq ess-use-auto-complete t)
(ess-toggle-underscore nil)
I have the following versions of:
ess 20131207.1141 installed No description available.
ess-R-data-view 20130509.458 installed Data viewer for GNU R
ess-R-object-popup 20130302.336 installed popup description of R object
auto-complete 20140208.653 installed Auto Completion for GNU Emacs
What am I missing?
UPDATE 1
Here's my init for ESS stuff. This produces completions in a buffer, but not in a tooltip, where some configuration options from the manual have been added. (I have now tried all permutations of commenting and not commenting all of these):
(require 'auto-complete)
(global-auto-complete-mode)
(require 'auto-complete-config)
(ac-config-default)
(require 'ess-site)
(setq ess-use-auto-complete t)
(setq ac-auto-start 2)
(setq ac-auto-show-menu 0.2)
(ess-toggle-underscore nil)
UPDATE 2
Similar question here, but the same solution is suggested which did not actually result in tooltips on my setup. But it suggests to me this might be a platform issue? The poster there was also on Ubuntu 12.04 as I am---is it possible the solutions that worked for VitoshKa, Alex Vorobiev, and Iqbal Ansari were on a different platform? Are you guys using OS X?
UPDATE 3
Maybe other diagnostics:
ac-source-R is a variable defined in `ess-r-d.el'.
Its value is ((prefix . ess-ac-start)
(candidates . ess-ac-candidates)
(document . ess-ac-help))
Documentation:
Combined ad-completion source for R function arguments and R objects
ac-source-R-objects is a variable defined in `ess-r-d.el'.
Its value is ((prefix . ess-symbol-start)
(candidates . ess-ac-objects)
(document . ess-ac-help-object))
Documentation:
Auto-completion source for R objects
ac-source-R-args is a variable defined in `ess-r-d.el'.
Its value is ((prefix . ess-ac-start-args)
(candidates . ess-ac-args)
(document . ess-ac-help-arg))
Documentation:
Auto-completion source for R function arguments
[back]
where the variables for ess-ac[TAB] are only...
Click <mouse-2> on a completion to select it.
In this buffer, type RET to select the completion near point.
Possible completions are:
ess-ac-R-argument-suffix
ess-ac-sources
So maybe the problem is my ESS install is lacking all ess-ac-* things defined above, like ess-ac-args, etc?
My auto-complete configuration also has
(require 'auto-complete-config)
(ac-config-default)
and after that setting ess-use-auto-complete makes ESS show the popup menus.
So as per your comments it turned out that auto-complete was not enabled in your emacs config. So just enable auto-complete by adding something like this in you init file
(load "auto-complete")
(global-auto-complete-mode)
Also for ESS you will need to set ess-use-auto-complete to t something like following would do
(setq ess-use-auto-complete t)
EDIT: ess-use-auto-complete is by default set to t so this step is not really needed.
Also since you found this option confusing I would recommend you to open an issue on the github repo so that the maintainers can improve the documentation (or code) whichever can reduce the confusion.
Auto-complete has a lot of configuration options do read the manual when you get time.
Glad I could help
Don't confuse eldoc with auto-completion. Eldoc is what you have in your screenshot, it shows all arguments of a function without being intrusive. Auto-completion pops up when you start typing stuff and activates after ac-auto-start characters.

ess-execute key binding not working with new ESS version

I recently upgraded from R 2.15 and an older version of ESS using Vincent Goulet's Windows 7 installer at http://vgoulet.act.ulaval.ca/en/emacs/. This includes ESS version 13.09. I also just installed R version 3.0.2.
My old workflow was to use C-c C-t (the default key binding) to run commands via ess-execute and send results to a temporary buffer. I found this incredibly useful for my workflow and style of R programming.
However with the new version this key binding has been removed. I searched around and could not find any other threads regarding this topic. I looked into ess-mode.el and found this line:
;; (define-key map "\C-c\C-t" 'ess-execute-in-tb)
Which is commented out. I see they have added the nice feature ess-describe-object-at-point but that doesn't allow for executing commands.
I'm not an emacs power-user so I tend to copy pieces of lisp into my .emacs and do minor edits to them. I tried (1) uncommenting the line above and (2) defining a new keybinding in my .emacs file the same place as the new keybindings in ESSShift Enter (http://www.emacswiki.org/emacs/ESSShiftEnter).
(add-hook 'ess-mode-hook
(lambda()
(local-set-key [(shift return)] 'my-ess-eval)
;; added Ctrl-Enter to stay on same line
(local-set-key [C-return] 'ess-eval-line)
;; Newest version of ESS got rid of C-c C-t for ess-execute add back
(local-set-key "\C-c\C-t" 'ess-execute-in-tb))
However, neither one of these methods worked.
My questions are: Is there a reason this keybinding was disabled in the new version? I.e. should I be using some other feature that has replaced it? If not, what is the best way to enable this keybinding again?
ESS keys were remodeled an year or so ago. C-c C-t is now bound to
dev-map which provides a bunch of useful functionality that you might want to
use in the future. So better not disable it. Your code should work. You probably
tried C-c C-t from the*R* buffer, but that one is inferior-ess-mode, not
ess-mode.
You better define your keys in ess-exta-map, this way it will work both in
ess-mode and inferior-ess-mode. Something like this:
(eval-after-load "ess-mode"
'(progn
(define-key ess-extra-map "\C-e" 'ess-execute-in-tb)))
The pain with eval-after-load is necessary because Vincent's distribution loads ess after the user init file has been loaded. If you load your ESS with (load "ess-site") then you can just leave (define-key ...) part in your .emacs.el .
Now C-c C-e C-e should execute your command.
I am adding this exact key to ESS development version. So, in the next version
you can remove the above code. Thanks for popping this up.
By the way C-RET is bound to
ess-eval-region-or-line-and-step. You might consider keeping it like that.

Why do <C-PageUp> and <C-PageDown> not work in vim?

I have Vim 7.2 installed on Windows. In GVim, the <C-PageUp> and <C-PageDown> work for navigation between tabs by default. However, it doesn't work for Vim.
I have even added the below lines in _vimrc, but it still does not work.
map <C-PageUp> :tabp<CR>
map <C-PageDown> :tabn<CR>
But, map and works.
map <C-left> :tabp<CR>
map <C-right> :tabn<CR>
Does anybody have a clue why?
The problem you describe is generally caused by vim's terminal settings not knowing the correct character sequence for a given key (on a console, all keystrokes are turned into a sequence of characters). It can also be caused by your console not sending a distinct character sequence for the key you're trying to press.
If it's the former problem, doing something like this can work around it:
:map <CTRL-V><CTRL-PAGEUP> :tabp<CR>
Where <CTRL-V> and <CTRL-PAGEUP> are literally those keys, not "less than, C, T, R, ... etc.".
If it's the latter problem then you need to either adjust the settings of your terminal program or get a different terminal program. (I'm not sure which of these options actually exist on Windows.)
This may seem obvious to many, but konsole users should be aware that some versions bind ctrl-pageup / ctrl-pagedown as secondary bindings to it's own tabbed window feature, (which may not be obvious if you don't use that feature).
Simply clearing them from the 'Configure Shortcuts' menu got them working in vim correctly for me. I guess other terminals may have similar features enabeld by default.
I'm adding this answer, taking details from vi & Vim, to integrate those that are already been given/accepted with some more details that sound very important to me.
The alredy proposed answers
It is true what the other answer says:
map <C-PageUp> :echo "hello"<CR> won't work because Vim doesn't know what escape sequence corresponds to the keycode <C-PageUp>;
one solution is to type the escape sequence explicitly: map ^[[5^ :echo "hello"<CR>, where the escape sequence ^[[5^ (which is in general different from terminal to terminal) can be obtained by Ctrl+VCtrl+PageUp.
One additional important detail
On the other hand the best solution for me is the following
set <F13>=^[[5^
map <F13> :echo "hello"<CR>
which makes use of one of additional function key codes (you can use up to <F37>). Likewise, you could have a bunch of set keycode=escapesequence all together in a single place in your .vimrc (or in another dedicated file that you source from your .vimrc, why not?).

Resources