Emacs tips

Stuff to remember:

Ok, the keys to the emacs kingdom (FWIW, HTH):
Find a way to do something:
C-h a and type in a search term, eg "kill" (assume familiarity with kill backward frame window terminology). Move the cursor (point) and hit enter on the highlighted bit.
Think of the key-combo you use most that's killing your fingers.
C-h k and type the key combo. Eg C-h k C-x C-f This should popup a window that explains what it's bound to, and a link to the .el file it is defined in. Eg: "It is bound to , C-x C-f. (ido-find-file)"
Rebind it -- decide what to rebind it to first, say C-k. Check what is currently bound to C-k with C-h k (describe key) then type C-k. If you decide to proceed: M-x global-set-key C-k find-file (tab completion is available)
Still, I haven't tried vimpulse, and I feel binding ESC would be cool if we could avoid keeping the modifier key pressed, I'd much rather do C h k f than C-h C-k C-f or M-S-h M-q f etc.
The first things I rebound were C-h d, C-h k and C-h b :-) and I'm well on my way to changing the bindings.

Installing Weblocks



Ok, now the important part, getting weblocks, patching it if needed, and getting its dependencies.

Getting weblocks:
cd ~/
# if you have weblocks you can update it with darcs pull
darcs get http://common-lisp.net/project/cl-weblocks/darcs/cl-weblocks


mkdir -p ~/.sbcl/systems
cd ~/.sbcl/systems
ln -s ~/cl-weblocks/*.asd .

The above ln command creates links to asd files so that weblocks can be easily loaded through slime.

Now, there are two dependencies that are hard to install the normal asdf way, so we'll install them manually.

mkdir -p ~/.sbcl/site/
cd ~/.sbcl/site/
# get 2 metabang packages
wget http://common-lisp.net/project/dynamic-classes/dynamic-classes.tar.gz
tar xvzf dynamic-classes.tar.gz
wget http://common-lisp.net/project/lift/lift_latest.tar.gz
tar xvzf lift_latest.tar.gz


Normally we should create links to the asd files inside ~/.sbcl/systems as we did for weblocks above. But it appears (confirmed) that when we do the following asdf installs, those links get created by some of the other metabang packages.

Also, while installing Gary King's metabang packages we do it in the following order: lift, metatilities-base, dynamic-classes -- we'll see this in slime, below.

At the time of this writing it was necessary to patch weblocks too. So first the patch, thanks to Bob Hutchison. Note that wget might not work with the patchname, so if the following doesn't work, use a web-browser to download the patch file and then copy it to the ~/cl-weblocks directory
cd ~/cl-weblocks
wget http://groups.google.com/group/weblocks/attach/0b57cd95a153dd1c/accommodate-metatilities-chages.patch?part=2
darcs apply accommodate-metatilities-chages.patch


Once darcs is finished your weblocks is up to date. Note: this tutorial refers to events from early June 2007 -- it's possible you may not need to do this patch. If you don't have darcs, get it with apt-get install darcs.


RUNNING EMACS + SLIME


Now, our first test run of lisp. These steps will become familiar to you as the incantations to start our environment. Optionally, first start screen (see subsection on screen in earlier post).
emacs -nw
M-x slime

You'll see slime load with sbcl and possibly some swank messages flash by, followed by the animation. If you see CL-USER you're in business, running the most powerful environment known to programmers (well, sort of!).

First we'll get some things weblocks needs, the dependencies are:
'( :closer-mop :metatilities :hunchentoot :cl-who :cl-ppcre :cl-json :puri :rt :tinaa :md5 :cl-fad :fare-matcher :cl-cont )

You could create the following file outside emacs too, but for argument's sake, let's do it here. C-x f is called 'visiting' a file and it creates one that doesn't exist.
C-x f ~/get-weblocks-deps.lisp



Emacs tips

While typing a command, C-g will usually get you out of it. C-h b shows you the current keybindings, C-h t runs the tutorial (too long), C-h c lets you describe a key: eg, try C-h c C-x C-c it should tell you the command that key runs, C-h k is the same but gives you more detail (try C-h k C-g it will tell you the key to run to remove the window). Occasionally, unwanted info windows will pop up (eg quite often after a compile). Some of them, like the compiler ones you can get rid of just by pressing q.

For other windows the following rule applies: If the cursor is in the unwanted window, type C-x 0, if it's in the window you want to keep, type C-x 1. Remembering this rule will save you a lot of frustration.

Now type the following:


(require 'asdf-install)
(asdf-install:install :closer-mop)

;Now get some packages from Gary King's metatilities.
;used to be '(:lift :metatilities-base :dynamic-classes))
(dolist (i '(:metatilities))
(format t "Metabang package: doing ~A" i)
(asdf-install:install i))

(defparameter *weblocks-deps*
'(:cffi :hunchentoot :cl-who :cl-ppcre :cl-json :puri :rt :tinaa :md5 :cl-fad :fare-matcher :cl-cont ))
(dolist (i *weblocks-deps*)
(format t "Doing ~A" i)
(asdf-install:install i))


Save the file

C-x s


Now we run the file using slime

C-c M-k


You should see some activity on the screen. An 'Install where?' dialog will be presented to you. Choose to install the files in your local system (option 2: Personal Installation). Also, when the loop runs, it will tell you which package it's installing ("Doing DYNAMIC-TEST-CLASSES Install where?"). If you run into trouble you can force an error by typing 0.

If there's an error, for example if you enter 0 instead of 1 or 2, you will be dropped into the debugger. A new window should open with the title *sldb sbcl/1* -- it will contain a list called restarts. To start from scratch, in general you can always choose the ABORT or TERMINATE-THREAD restart by typing the number next to it. You can use this as a way to break out of sticky situations.

In a similar vein, if you get stuck you can reset by typing C-x C-c which will close emacs. A warning message may be presented at the bottom of your emacs window that says active processes exist: type "yes" to quit anyway.

After you make your choice of where to install, a second dialog is presented to you related to GPG keys. Well, actually it's not a dialog, but rather that you get dropped into the debugger again because the GPG check will likely fail. Choose 0 to skip the GPG check and you will be fine. In general this is not a good practice, and after much digging around one could add the requisite GPG keys.

But it's a big hassle and we'll avoid it for now. To do things properly though, you should independently acquire the public keys of the lisp developers whose packages you want, and install them as trusted keys in your system. (TODO include pointers to good gpg tutorials here, preferably lisp specific: there is one on cliki or cl.net).

Now the package downloading and installation begins (you are connected to the internet, right?). It'll take some time and you'll be prompted for each package in your list, as well as all the packages those in the list depend upon.

Alert!


This is an excellent time to back up your install. Sometimes websites are down and packages are hard to get (this happens quite often with CL packages!). We will first delete any object files and then tar the rest.
cd ~/.sbcl
find . -name '*.fasl' | xargs rm
tar cvf ~/dotsbcldir.tar *
cd ~/cl-weblocks
find . -name '*.fasl' | xargs rm
tar cvf ~/clweblocks.tar *
cd ~/slime
find . -name '*.fasl' | xargs rm
tar cvf ~/slimeydir.tar *
cd ~/
tar cvjf all-lisp-webdev.tar.bz2 dotsbcl* clwebl* slimey*
# Copy this last file somewhere!


Please note problems in the comments so I can update these instructions with possible gotchas. Please don't post them to the list, since the procedure's been tested and it's not weblocks' fault if it doesn't work for some reason.


Running Weblocks for the first time


Let's assume you are no longer running emacs/slime (C-x C-c if you are).


0. Loading incantations


emacs -nw
M-x slime

at CL-USER> type

, load-system weblocks

(you can use tab completion and up-arrow after the comma)

Weblocks will load, because the weblocks.asd file is in a standard place. If this is the first time, some .fasl files will get created and it'll take some time. Subsequent loading will be faster since the compilation will have been done the first time around.

A compile messages window will pop up -- try using C-x 0 or q to get rid of it.

Now again at CL-USER> type

"(weblocks:start-weblocks " remember to type the space!

Now we see slime telling us what the function signature is. In the mini-bar window (TODO called what?) you'll see
(start-weblocks &key debug (port 8080) &allow-other-keys &rest keys)
this means that the function takes two key arguments, debug and port, and that port is by default 8080 unless specified.
&allow-other-keys means that if you override this function (TODO check) it will accept other keys even though this particular version in weblocks doesn't use them for anything.
&rest args (or keys, in this case) is a common idiom to group unspecified other arguments into a simple list that you can iterate over, or pass to another function.
finish up with (weblocks:start-weblocks :debug t :port 8080)

where :debug indicates it is a keyword symbol.

A hunchentoot server object is returned, this server is now talking on port 3000.
Open a browser and go to localhost:3000 (this url is convenient for us because that's where our failed RoR experiments lie!)
You should see the weblocks welcome page.


1. Run the standard weblocks demo (note other demos and dependencies)


Now we'll run the standard weblocks demo. There is also a clsql and elephant demo, but they have other dependencies like postgres etc.

Since the asd file for the demo is not in the standard directory, we have to tell ASDF where to find it. We do this by pushing its filename (aka pathname, the full canonical file path) onto a list maintained by ASDF. #p"/a/b/c" returns the pathname for the file c in the directory /a/b/ -- at least on unices.

type the following at your CL-USER> prompt:

(push #p"/home/lisper/cl-weblocks/examples/weblocks-demo/" asdf:*central-registry*)


lisp replies with the value of asdf:*central-registry* (which is a variable *central-registry* inside the namespace asdf)
The * doesn't signify anything special, other than that it's a global variable (lisp variables and functions can pretty much have any character as part of the name). A similar convention is used for variables called +i-is-a-variable+ too.. TODO fact-check.

You can see the value again. Just type asdf:*central-registry* at the repl.

You can see previous values at the repl by either using * by itself on a line (a repl shortcut unrelated to the above discussion) or by pressing M-p M-n to move back and forward in the command line history. you can also search for all previously typed expressions beginning with, for example, "(mooshu" by typing "(mooshu" (without quotes) followed by M-p [that is, type the expression to search, then press the meta and p keys together.

Anyway now you can see that the global variable is set to a list of places to check, and the one we added is first.

Now we can do

,load-system weblocks-demo
(use tab to see other ASD systems that ASDF found in the same directory)

to load the demo. Now we run the server with the earlier start-weblocks or with the equivalent

(weblocks-demo:start-weblocks-demo :debug t :port 8080)

which is a function in the weblocks-demo namespace that probably just calls the original function.
heck, we can check this. type (weblocks-demo:start-we[now press TAB to complete] [now press M-. (alt and period)]
voila, we jumped to the function definition! We can see it just calls the start-weblocks function from earlier, with the args it was given (which it doesn't even check, it leaves that to the original function to figure out!) Now press M-, to jump back (twice to go back to the repl)

Play around with M-. -- for example if you go back to the start-weblocks definition, at the bottom go to hunchentoot:session-value and press M-. a miniwindow opens up with some options. this is a good place to use C-x 0 :-)

Note: if you have already run weblocks:start-weblocks then weblocks-demo:start-weblocks-demo will return NIL, indicating it didn't do anything. stop the original hunchentoot server with weblocks:stop-weblocks first; and now the server runs just fine, and its value is returned, as before.


2. Make your own toy app


Weblocks now comes with a few functions to easily create the webapp file and directory structure.
Let's go back to the repl with

f12 r
Now type

,load-system weblocks-scripts
(weblocks-scripts:make-application 'mywebapp "/home/lisper/")

this will create a new webapp and its directory structure in /home/lisper.. you can leave off the second argument if you started your emacs in /home/lisper

however, the following is an error and will drop you into the debugger.

(weblocks-scripts:make-application "mywebapp" "/home/lisper/")


as the minibuffer function signature indicates, the second argument is optional .. if not included by default some notion of current directory will be used (you can find out what by doing M-. and seeing what the function does!). A great explanation of functions (and especially &key and &optional) is given at http://gigamonkeys.com/book/functions.html (chapter t) Peter Seibel's book is totally worth reading -- and very highly recommended by all lispers. It presents a modern way to look at lisp and has an eminently understandable way of explaining things, not to mention a great conversational tone, excellent fully fledged examples, copious explanatory footnotes, full implementation of a bayesian filter, mp3 shoutcast server and mp3 id-tags parsing library, complete unit test suite -- all in portable common lisp. His website also has lispbox, a lisp in a box probably most useful to marooned win32 users. There don't seem to be many (any?) weblocks users on win32 though.


Making (+ sbcl slime weblocks) load like the blazes.


This is one of the cooler tricks. One is supposed to keep the emacs session around long enough that speed of loading isn't an issue. However, this little hack can be quite useful in practice, say if you're on a laptop or open and close your emacs often.

What it does is load swank and weblocks once into a running lisp image, and then save that image. Subsequently when slime runs sbcl it loads the image. All of weblocks loads in a flash, at the expense of about 80MB of disk space (on a 64-bit linux box).

Quit any running emacs/slime. Go to the ~/.sbcl directory with

cd ~/.sbcl


Create this file:

cat > mkcore1.lisp
(require :asdf)
(push #p"/home/lisper/slime/" onto asdf:*central-registry*)
(asdf:operate 'asdf:load-op :swank)
(asdf:operate 'asdf:load-op :weblocks)
(load "/usr/share/common-lisp/source/slime/swank-loader.lisp" :verbose t)
;; a better way to do this is below
; (progn (load "/usr/share/common-lisp/source/slime/swank-loader.lisp" :verbose t)
; (funcall (read-from-string "swank:start-server") "/tmp/slime.7144" :coding-system "iso-latin-1-unix"))
;(sb-ext:save-lisp-and-die "sbcl.core")
(sb-ext:save-lisp-and-die "sbcl.core" :toplevel (lambda () (swank:create-server :port 4005) (sb-impl::toplevel-init)))
(quit)
^D


Before we proceed further though, we have to ensure that swank.asd exists in the default load path. As an exercise, this is left to the reader. There are two ways to do it!
[go to ~/.sbcl/systems and ln -s /home/lisper/slime/swank.asd . or push #p"/home/lisper/slime/" onto asdf:*central-registry* in the code above]

Now at a terminal go to ~/.sbcl and type

sbcl --load mkcore1.lisp

and watch the messages flash by. If all goes well you will be left with a sbcl.core file in the directory. Type ls -ltrh to check that it's there.

Now we open our ~/elisp/lisper.el file to enable loading the core. Find the line below "replace core" and uncomment it. Comment out the "original core" line with a leading semicolon. You're done! (Note you can rename cores and create different cores with stuff preloaded)

Now restart emacs and slime as before. An uber-functional web development environment in under three seconds! How cool is that?


Summary


This slightly long introduction's taken you from a fresh mac os x or linux user's system to an installed web development environment. Post questions here (there are subsequent posts for beginner and other questions).

Future plans include explaining the weblocks framework and keeping up to date with changes. The next few posts should be about with-flow, login and widget trees because as of now these seem most important to getting up and running the weblocks way. Meanwhile explore the demos, and the tests directory of the weblocks source.

Complete Beginners Setup for Weblocks

(+ slime emacs sbcl (some linux paredit redshank))






Introduction



This guide was written on ubuntu linux. Most of it should be the same on mac os x -- just adjust the pathnames and installers as necessary.



Win32 users should get lispbox at the gigamonkeys.com site and skip the initial setup: most of the weblocks stuff remains the same.



We start the instructions assuming you have installed your unix (linux or os x) and are logged into it. For those familiar with unix, you can skim through or go directly to the post titled Installing Weblocks.



The intent of this tutorial is to get beginners up and running with a functional development environment. It is hoped that by including some digressions on emacs, slime etc., at each step, by the end of the tutorial readers will be somewhat acquainted with the possibilities of this great system, and have a feel for what to do next.



Many thanks to Slava for a great framework and emacs wiki contributors for tips.






Start a Terminal



Start a terminal on KDE Ubuntu by typing




alt-F2

konsole





On a mac, use


Applications->Utilities->Terminal.app





The following instructions use sudo. Assuming it is setup (the default case on macs and ubuntu) just follow the instructions, otherwise, see below.




Obtaining Emacs and SBCL


In order to get started quickly, we'll kind of punt on the emacs installation: if you're on mac os x, google for aquamacs, or use fink/macports, or see here. For redhat and derivative linuxen use rpm to get the appropriate emacs packages.



See what's available:


apt-cache search emacs | more


Get emacs


sudo apt-get install emacs22

sudo apt-get install emacs-snapshot





Get sbcl


sudo apt-get install sbcl



Or go to this sbcl page and download your choice of platform and version. Copy the download to a directory in /tmp and tar -xvjf it.






wget http://prdownloads.sourceforge.net/sbcl/sbcl-1.0.17-x86-64-linux-binary.tar.bz2

tar -xvjf

http://prdownloads.sourceforge.net/sbcl/sbcl-1.0.17-x86-64-linux-binary.tar.bz2





Installation is simply going into the newly created sbcl directory, and type


sudo bash install.sh





Note: after this step is done, use


which sbcl



and note down the pathnames for the binaries, we'll need them later.






If sudo does not work





Open a new terminal and type "su - root", then enter the root password, then type the sudo commands above. Use your original terminal for non sudo commands, and keep this one around for the sudo commands. Don't mix up the two terminals!




Setting up your home directory


We'll create a new user for our lisp hacking because it'll be easier to keep a clean ~/ that way, plus we can tar up ~/ for backups (or use git to put our setup on github.com)



Also it may make it easier to manage downloaded lisp packages.



Add the user


sudo adduser lisper





Become the user


su - lisper





Check sbcl version


sbcl --version





Let's get slime.. this also creates the dir ~/slime for us.


cd ~/

cvs -d :pserver:anonymous:anonymous@common-lisp.net:/project/slime/cvsroot co slime








Emacs keystrokes



Note that in emacs parlance C-d means control-d, M-d is meta-d (alt is usually the same as meta) and M-D is different from M-d (the first one needs the shift key). We'll try and use emacs keystroke chains from now on. See the emacs manual for help if necessary.




Setting up emacs



Create the following file using a text editor and save it as /home/lisper/.emacs.el -- if using linux you should be able to select all this text and middle click it into a terminal.



Also, read the comments in these files (comments start with ; for elisp) and note that ymmv paraphrases to "remove or edit this if things go wrong, and try again".




cat > .emacs.el << EOF

;make ~/elisp contain all our site lisp

(if (fboundp 'normal-top-level-add-subdirs-to-load-path)

(let* ((my-lisp-dir "~/elisp/")

(default-directory my-lisp-dir))

(setq load-path (cons my-lisp-dir load-path))

(normal-top-level-add-subdirs-to-load-path)))

;this is where we'll put all our stuff

(require 'lisper)

EOF





Now make a directory to store our emacs elisp files:


mkdir ~/elisp

cd ~/elisp





Make our lisper file -- this is required by (require 'lisper) in .emacs.el above




cat > lisper.el << EOF

;kludge of the unknown hacker, ymmv

;found at http://www.emacswiki.org/cgi-bin/wiki/emacs-w3m#WThreeM

(require 'w3m-e21)

(provide 'w3m-e23)



;we'll wget these later

(require 'cldoc)

(require 'paredit)

(require 'redshank)



;; testing

(provide 'lisper)



;;;; SLIME



;setting up slime and lisp

(add-to-list 'load-path "~/slime")

(add-to-list 'load-path "~/slime/contrib")

(require 'slime)

(slime-setup '(slime-fancy slime-asdf slime-tramp))

(add-hook 'slime-load-hook (lambda () (require 'slime-fuzzy)

(slime-fuzzy-init)))

(add-hook 'lisp-mode-hook 'my-slime-settings)

(global-set-key [C-o] 'other-window)



;;; set your own sbcl path!!

(setenv "SBCL_HOME" "/usr/local/lib/sbcl")



;;from emacswiki

(defun customkeys ()

(local-set-key (kbd "TAB") 'slime-indent-and-complete-symbol) ;;mathrick#lisp

(local-set-key [C-tab] 'slime-fuzzy-complete-symbol)

(define-key lisp-mode-map (kbd "C-c l") 'lispdoc) ;billc lispdoc key

(local-set-key [return] 'newline-and-indent))



(setq browse-url-browser-function 'browse-url-generic

browse-url-generic-program "elinks"

browse-url-generic-args '(""))



(defun my-slime-settings ()

(slime-mode t)

(turn-on-redshank-mode) ;ymmv is great and stays out of your way

;(paredit-mode) ;ymmv: is great and gets in your way

(customkeys)



;;; set your own sbcl path!!

#|no core|# (setq inferior-lisp-program "/usr/local/bin/sbcl --noinform --no-userinit"

; with no cores (setq inferior-lisp-program "/usr/local/bin/sbcl --noinform --no-userinit"

; rm'd cores (setq inferior-lisp-program "/usr/local/bin/sbcl --noinform --core /home/lisper/.sbcl/sbcl.core-blocks-and-swank --no-userinit"

; replace core

; #|current|# (setq inferior-lisp-program "/usr/local/bin/sbcl --noinform --core /home/lisper/.sbcl/sbcl.core --no-userinit"



lisp-indent-function 'common-lisp-indent-function

slime-complete-symbol-function 'slime-fuzzy-complete-system

;;; set your own hyperspec path!!

common-lisp-hyperspec-root "file:///usr/share/doc/hyperspec/"

slime-startup-animation t))



(my-slime-settings)

;(add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))



; TODO explain

(define-key global-map (kbd "") 'slime-selector)



;;two funcs for setting up enter and C-tab in diff slime windows

(add-hook 'slime-repl-mode-hook

(lambda () (local-set-key [return] 'slime-repl-return)))



;; ymmv remove this if you want

(autoload 'paredit-mode "paredit"

"Minor mode for pseudo-structurally editing Lisp code."

t)



;; snippet for Emacs interaction with lispdoc, by Bill Clementson

;; http://bc.tech.coop/blog/070515.html

(defun lispdoc ()

"Searches lispdoc.com for SYMBOL, which is by default the

symbol currently under the curser"

(interactive)

(let* ((word-at-point (word-at-point))

(symbol-at-point (symbol-at-point))

(default (symbol-name symbol-at-point))

(inp (read-from-minibuffer

(if (or word-at-point symbol-at-point)

(concat "Symbol (default " default "): ")

"Symbol (no default): "))))

(if (and (string= inp "")

(not word-at-point)

(not symbol-at-point))

(message "you didn't enter a symbol!")

(let ((search-type

(read-from-minibuffer

"full-text (f) or basic (b) search (default b)? ")))

(browse-url (concat "http://lispdoc.com?q="

(if (string= inp "")

default

inp)

"&search;="

(if (string-equal search-type "f")

"full+text+search"

"basic+search")))))))



EOF



Notes on lisper.el





  • paredit, redshank:

    paredit is an emacs mode that gives you ways to edit lisp forms instead of plaintext. It'll ensure your lisp code is always well-formed (in the Godel Escher Bach sense) but it'll be a pain in the neck and it's a joy to use. There are neat key-combos for moving along the s-expression tree, you can copy and delete entire forms by using C-k and C-y! Just make sure you keep a browser window with the cheatsheet open and refer to the handy diagram in the right column of the cheatsheet to figure out what keys you need to press. If you ever have trouble with it, M-x paredit-mode toggles it off.




  • Paths

    You will need to adjust the paths in the file above, particularly all sbcl paths and the hyperspec path. The hyperspec can be installed with apt-get on linux, and we checked the sbcl path earlier.



    Mac users: /home/janedoe translates to /Users/janedoe and depending on how you install sbcl it might go in /Applications or in /opt





  • F12 selector: when you've run slime (M-x slime, see below) you can use f12 to jump between the repl and the last lisp buffer you were editing.



    f12 r -> jumps to repl

    f12 l -> jumps to file







Continuing..



Continuing our setup, we now get cldoc, paredit and redshank to help us in emacs. The function "my-slime-settings" in lisper.el controls their functionality.




cd ~/elisp

# wget the actual url! or use your browser to dowload the files,

# but remember to copy them to ~/elisp

wget cldoc.el

wget paredit.el

wget redshank.el








Elinks and screen





Elinks is useful browser for quickly browsing lisp docs using Bill Clementson's elisp function, so we'll get it. Screen is a terminal utility that opens virtual windows inside a terminal. It's essential to use on a server, because if you get disconnected from your remote webserver it prevents your running programs from dying. When you're using screen, just ssh back into the server and use screen -rd to get your workspace back just as it was. It doesn't hurt to apt-get it even if you decide not to use it for now, so we'll add it to our apt-get command.



Note: other options are using a remote REPL and/or tramp in emacs to edit remote files over ssh.




apt-get install elinks screen





You'll have to perform some setup within elinks options to ensure that links open in a new tab. At the beginning of your emacs session you can open a single elinks browser (say in a new terminal or using the screen command) and then any search you do for lisp docs within emacs will pop up a window in that browser. Or you can use safari, konqueror or firefox (modify lisper.el above, for example, just put "konqueror" in place of the string "elinks").



To use billc's function, position the block cursor (recommended over underline!) on a lisp keyword and type C-c l -- emacs will ask you if you want a full search or basic search. Press enter. Go to your elinks or browser window to view the result page. Check the emacs wiki link above if it doesn't work.



Elinks keys:


< and > --> cycle tabs

t and w --> new tab and close








Workspace setup with screen



This is an optional setup, feel free to skip it. Run a terminal and type screen to get a single screen (press enter after the warning). Now run emacs -nw here, then C-a C-c to create a new screen, and open an elinks in that.


#Run Terminal/Konsole/gnome-terminal

screen

emacs -nw

C-a C-c

elinks http://google.com





In screen


C-a C-a switches you back between two screens

C-a space cycles you though the existing screens

C-a k kills a screen

C-a d detaches screen

C-a r reattaches if you were inadvertently logged out

C-a " lists all the screens





That's all we need for now. Go to the next post to start installing weblocks!






Blog Archive