UNSW   Faculty of Engineering myCSE PRINT VERSION SITE MAP  
cse | School of Computer Science and Engineering (CRICOS Provider No. 00098G)
    #About CSE     #Undergraduate Study     #Postgraduate Study     #Timetables & Courses     #Research & Publications     #People & Work Units     #Help & Resources     #News & Events     #High School Portal

Last updated 28.09.06

prev UP NEXT GNU Emacs Manual

28.2.1: Examining and Setting Variables

C-h v var RET
Print the value and documentation of variable var (describe-variable).
M-x set-variable RET var RET value RET
Change the value of variable var to value.

To examine the value of a single variable, use C-h v (describe-variable), which reads a variable name using the minibuffer, with completion. It prints both the value and the documentation of the variable. For example,

C-h v fill-column RET

prints something like this:

fill-column's value is 75

Documentation:
*Column beyond which automatic line-wrapping should happen.
Automatically becomes buffer-local when set in any fashion.

The star at the beginning of the documentation indicates that this variable is an option. C-h v is not restricted to options; it allows any variable name.

The most convenient way to set a specific option is with M-x set-variable. This reads the variable name with the minibuffer (with completion), and then reads a Lisp expression for the new value using the minibuffer a second time. For example,

M-x set-variable RET fill-column RET 75 RET

sets fill-column to 75.

You can set any variable with a Lisp expression using the function setq. Here's how to use it to set fill-column:

(setq fill-column 75)

Setting variables, like all means of customizing Emacs except where explicitly stated, affects only the current Emacs session.

Top Of Page

 ###
Site maintained by webmistress@cse.unsw.edu.au
Please read the UNSW Copyright & Disclaimer Statement
 ###