[ESS] A course on Emacs

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Wed Jan 31 10:30:51 CET 2007



 > > (This is not strictly to do with ESS, but you might learn something
 > > here that will carry over to ESS...)
 > 
 > You are right.
 > 
 > I cannot believe that I never learned about 'M-x occur RET REGEXP RET' 
 > till paging thru the first set of slides!!

Great tip Charles!  Yes, M-x occur is a neat way of browsing through
buffers.  I've had it bound to M-o for nearly 10 years now!

Another nice package that maybe people might want to investigate is
ffap, see commentary below.

Stephen
----------------------------------------------------------------------

Commentary:

Command find-file-at-point replaces find-file.  With a prefix, it
behaves exactly like find-file.  Without a prefix, it first tries
to guess a default file or URL from the text around the point
(`ffap-require-prefix' swaps these behaviors).  This is useful for
following references in situations such as mail or news buffers,
README's, MANIFEST's, and so on.  Submit bugs or suggestions with
M-x ffap-bug.

For the default installation, add this line to your .emacs file:

(ffap-bindings)                      ; do default key bindings

ffap-bindings makes the following global key bindings:

C-x C-f		find-file-at-point (abbreviated as ffap)
C-x C-r		ffap-read-only
C-x C-v		ffap-alternate-file

C-x d		dired-at-point
C-x C-d		ffap-list-directory

C-x 4 f		ffap-other-window
C-x 4 r		ffap-read-only-other-window
C-x 4 d		ffap-dired-other-window

C-x 5 f		ffap-other-frame
C-x 5 r		ffap-read-only-other-frame
C-x 5 d		ffap-dired-other-frame

S-mouse-3     ffap-at-mouse
C-S-mouse-3   ffap-menu

ffap-bindings also adds hooks to make the following local bindings
in vm, gnus, and rmail:

M-l         ffap-next, or ffap-gnus-next in gnus (l == "link")
M-m         ffap-menu, or ffap-gnus-menu in gnus (m == "menu")

If you do not like these bindings, modify the variable
`ffap-bindings', or write your own.

If you use ange-ftp, browse-url, complete, efs, or w3, it is best
to load or autoload them before ffap.  If you use ff-paths, load it
afterwards.  Try apropos {C-h a ffap RET} to get a list of the many
option variables.  In particular, if ffap is slow, try these:

(setq ffap-alist nil)                ; faster, dumber prompting
(setq ffap-machine-p-known 'accept)  ; no pinging
(setq ffap-url-regexp nil)           ; disable URL features in ffap
(setq ffap-shell-prompt-regexp nil)  ; disable shell prompt stripping

ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's.
For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site).
Also, you can add `ffap-menu-rescan' to various hooks to fontify
the file and URL references within a buffer.




More information about the ESS-help mailing list