Code :
In order to set the variable there are two functions called set and setq. The syntax of set is (set var val) where var is the variable to be set and val is its (new) value. More on set and setq can be referred here. Check out what happens when you set the variables given below. You need to be running the graphic version of emacs in order to see the changes.
If you are running the graphical version of emacs then you will see some strange things happen to the cursor as you set the values below one after another.
- fill-column
- 'fill-column
- (concat (number-to-string fill-column) " width")
- (message "Hi %s!\nHow are you" user-login-name)
Code :
For the next set of commands you must be running the graphical version of
emacs and you must place the cursor inside the emacs window where there is no text.
- (setq initial-cursor cursor-type)
- (setq cursor-type 'box)
- (setq cursor-type 'hollow)
- (setq cursor-type 'bar)
- (setq cursor-type '(bar . 5))
- (setq cursor-type 'hbar)
- (setq cursor-type '(hbar . 5))
- (setq cursor-type initial-cursor)
Code :
Now, before I wind up there is one small thing I would like to tell you. It is
about your .emacs file. You can customise emacs endlessly by storing some commands like the ones given above to be executed automatically.For instance open your ~/.emacs file and save the following lines. You can add any more commands that you would like emacs to execute automatically after startup.
- (setq initial-pointer void-text-area-pointer)
- (setq void-text-area-pointer 'arrow)
- (setq void-text-area-pointer 'text)
- (setq void-text-area-pointer 'hand)
- (setq void-text-area-pointer 'vdrag)
- (setq void-text-area-pointer 'hdrag)
- (setq void-text-area-pointer 'modeline)
- (setq void-text-area-pointer 'hourglass)
- (setq void-text-area-pointer initial-pointer)
Code :
Setting the default-directory variable will result in C-x C-f (find-file) prompting you
with the deafault path you set it to. Setting the scratch-message will result
in the message appearing in the *scratch* buffer. If you would like to see this
happpen you have to save the above lines in your ~/.emacs file and restart emacs.
- (setq default-directory "~/Desktop/")
- (setq initial-scratch-message "Hello World!")
0 comments:
Post a Comment