COMP1011 Xemacs Frequently Asked Questions | |
---|---|
Computing 1A 05s2 |
Last updated
Wed 20 Jul 2005 14:14
Mail cs1011@cse.unsw.edu.au |
We'll post here all the interesting new questions which have been asked about Xemacs, and their answers. Please read this carefully before asking any questions - most of your questions will be answered in here. It is very bad form to ask a question which is answered in a FAQ.
Press C-x C-c.
(The notation C-x C-c means that you should press both Control and X at the same time, followed by Control and C at the same time.)
Try pressing C-g. That's is the universal "stop whatever you are doing" key in Xemacs. If that doesn't work, you'll have to kill Xemacs. To do this, type 'xkill' in an xterm, and when the cursor changes to the lovely skull, click on the Xemacs window to make it go away to the Xemacs afterland.
Using only the keyboard:
Using only the mouse:
You can select text normally with the mouse (using the left mouse button); pressing the middle mouse button will paste the text in at the point where you clicked (just like in an xterm). Remember that you use C-w to cut the text if you're using the mouse to select things, and you can still use C-y.
Thanks to Patryk Zadarnowski for this tip.
Press the F10 key. You can then use the Up-Arrow and Down-Arrow keys to select the menu choices you want. Note: the F10 key does not work with the telnet program that comes with Windows! It will pull down the menus of the telnet program rather than the menus of Xemacs. If you want to quit, see the answer to Question 1.
Press C-c C-l. You must be editing a .hs file for this to work. (If your Haskell file isn't being colourised by Xemacs, then you're probably forgetting to save it with the .hs extension.)
To close the ghci window, make sure that your cursor is in the window with your .hs file, and press C-x 1. (Mnemonic: Make this the only (1) window on the screen.)
If you are at a computer in the labs, just use the mouse and click in the window you want to edit in. If you are working from home through telnet, or you simply want to know every single Xemacs key in existance, C-x o switches windows. Note that the key combination is not C-x C-o! It's C-x, then just o by itself without Control.
Use the key combination M-/. (That's Alt with the / (slash) key.) Here's a bit more detail on how it works from Manuel himself:
M-/: also know as dynamic abbreviation. Works not only for function names, but anything that is a word by the rules of the syntax table of the currrent buffer. It just searches backward through the buffer for the first word starting with the same prefix (and if that doesn't match anything, forward through the buffer and then in other buffers). So, if I type com M-/ here, I get complete. By pressing M-/ repeatedly, you can cycle through all matches. IMHO this is one of Xemacs' killer features.
Funky.
Xemacs to the rescue! Put the following in a file called ~/.xemacs/init.el in your home directory and Xemacs will give much better highlighting of bracket pairs:
(paren-set-mode 'paren)
If you're still not convinced Xemacs can do anything, put this stuff in your ~/.xemacs/init.el file:
(global-set-key "%" 'match-paren) (defun match-paren (arg) "Go to the matching paren if on a paren; otherwise insert %." (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1)))))
Now, if you are on a bracket such as ( or ), pressing the % key will bounce you to the matching bracket pair. If you press % and your cursor is not on a bracket, Xemacs will just type out % as it normally would.
Use the "Options->Font" menu. If you want to change it so it will be also be used the next time you start Xemacs, do "Options->Save Options to Init File"
Yes! Xemacs has two types of automatic indentation available: simple and advanced.
If you don't know what type of indentation mode you're using, you're using advanced. In advanced mode, pressing the Tab key repeatedly cycles through the various indentation levels available.
In simple indentation mode, pressing Tab advances the cursor to where Xemacs thinks the next indentation level is. To use simple indent mode, make a file called .emacs in your home directory, and add the following line to it:
(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
You can mark the beginning of the rectangle with C-space, then go to the bottom-right corner and use C-x r k to cut a rectangle (or C-x r r to copy to a named register) and C-x r y (or C-x i from a named register) to paste it back at the point.
Press M-g (that's Alt-G).
Sure. Add the following to your .emacs file:
(custom-set-variables '(line-number-mode t))
Please email cs1011 if you have any questions or additions to this FAQ.
Click here, (Note: It's an executable file, so after you download it, just double-click it to install it. You do not have to "unzip" the file.)
Download and run the GHCI4XEmacs installer
Go to http://www.haskell.org/haskell-mode/ and have a read. Setting up Xemacs is way outside the scope of this FAQ; if you're really keen on this, consult a local Xemacs guru (or get your tutor to help you find an Xemacs guru).