help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: why cannot set cursor-type with setq but only with setq-default?????


From: Bingham, Jay
Subject: RE: why cannot set cursor-type with setq but only with setq-default??????
Date: Wed, 15 Jan 2003 16:39:39 -0600

Greg Hill [mailto:ghill@synergymicro.com] wrote:

At 9:34 AM -0800 1/15/03, Christian Seberino wrote:
>>setq-default is used to set cursor to be a bar rather than a box...
>>
>>(setq-default cursor-type    'bar)
>>
>>How come (setq cursor-type    'bar) doesn't work????
>
>Chris,
>
>Apparently cursor-type is automatically buffer-local, so setq changes 
>its value only for the current buffer.  setq-default changes its 
>value for all buffers that don't have their own buffer-local version. 
>
>cursor-type as a variable seems to be new to emacs-21.  I didn't even 
>know it existed until you asked this question.  Before 21 you had to 
>use modify-frame-parameters to change it.  I have not been able to 
>find any documentation on cursor-type as a variable other than in 
>emacs-21's interactive help.  Can you point us to some?  Thanks.

The Emacs Lisp Manual for both version 20 and version 21 contain
information about cursor-type in the section on Window Frame Parameters.

See -
for Emacs 20:
        
http://www.gnu.org/manual/elisp-manual-20-2.5/html_mono/elisp.html
for Emacs 21:
        
http://www.gnu.org/manual/elisp-manual-21-2.8/html_mono/elisp.html

The Emacs 21 version says the following:
cursor-type 
The way to display the cursor. The legitimate values are bar, box, and
(bar . width). The symbol box specifies an ordinary black box overlaying
the character after point; that is the default. The symbol bar specifies
a vertical bar between characters as the cursor. (bar . width) specifies
a bar width pixels wide. 
The buffer-local variable cursor-type overrides the value of the
cursor-type frame parameter, and can in addition have values t (use the
cursor specified for the frame) and nil (don't display a cursor). 

The second paragraph is not in the Emacs 20 version.

More interesting is the following excerpt describing buffer-local
variables from the section Introduction to Buffer-Local Variables:

All buffers start out by sharing the default value of the variable as
usual, but setting the variable creates a buffer-local binding for the
current buffer. The new value is stored in the buffer-local binding,
leaving the default binding untouched. This means that the default value
cannot be changed with setq in any buffer; the only way to change it is
with setq-default.

-_
J_)
C_)ingham
.    HP - NonStop Austin Software & Services - Software Quality
Assurance
.    Austin, TX
. "Language is the apparel in which your thoughts parade in public.
.  Never clothe them in vulgar and shoddy attire."     -Dr. George W.
Crane-





reply via email to

[Prev in Thread] Current Thread [Next in Thread]