Hardware Reference
In-Depth Information
Tip
If the
tramp-default-method
variable is set to
ssh
, then you can shorten your
URLs to
/bbb:/home/debian
. You can view the state of the variable by evaluating it.
To evaluate Emacs Lisp, press
M-:
and then type
tramp-default-method
and the
mini buffer should reply with
ssh
.
For more information on
dired
or anything about Emacs, you can view the built-in doc-
umentation by pressing
C-h r
. If you scroll or search (by pressing
C-s
), you'll find the
dired
manual on that page. The manual uses the info viewer, and you can read about
this by pressing
C-h i
to get the main information page and then pressing
h
.
One of the features of Emacs is its extensibility. Presumably, you will be connecting to the
BBB often, pressing
C-x d
, and typing
/ssh:bbb:/home/debian
can be tiresome.
Let's define a new key sequence to make this easier. Switch to the scratch buffer in
Emacs. This can be done by pressing
C-x b
, then typing
*scratch
, and then hitting
Tab
+
Enter
. Paste the following code:
(global-set-key
[(control x) (control y)]
(lambda ()
"Open a dired buffer on the BBB"
(interactive)
(dired "/ssh:bbb:/home/debian")))
Position the point, what Emacs calls the cursor, after the last parenthesis. Then, press
C-x
C-e
to evaluate this snippet of Emacs Lisp. The mini buffer should echo the result. Now
press
C-x C-y
and you should see the home directory of BBB. Congratulations! You've
just customized Emacs! If you restart Emacs, however, you'll lose this convenient func-
tion, so you need to save it. If you are using the Emacs prelude, customizations should go
in
~/.emacs.d/personal/foo.el
. You can save this buffer with
C-x C-s
and spe-
cify the filename.
If you enjoy using Emacs, you will probably enjoy changing Emacs, which can be done
with Emacs Lisp. Of course, Emacs contains a great manual to learn Emacs Lisp,
An In-
troduction to Programming in Emacs Lisp
. It can be accessed by pressing
C-h i d
and then
you can either scroll down to the manual or press m, type
Emacs Lisp
, and then press
Tab
for tabcompletion to
Emacs Lisp Intro
.