unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* why cannot set cursor-type with setq but only with setq-default??????
@ 2003-01-15 17:34 Christian Seberino
  2003-01-15 21:28 ` Greg Hill
  2003-01-15 21:41 ` Kai Großjohann
  0 siblings, 2 replies; 7+ messages in thread
From: Christian Seberino @ 2003-01-15 17:34 UTC (permalink / raw)


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????

I know setq-default is more far-reaching than setq
but setq should work too right???

BTW I set default major mode to be text mode.  I don't
know if that has something to do with it..

(setq default-major-mode 'text-mode)

Thanks,

chris

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: why cannot set cursor-type with setq but only with setq-default??????
@ 2003-01-15 22:15 Bingham, Jay
  0 siblings, 0 replies; 7+ messages in thread
From: Bingham, Jay @ 2003-01-15 22:15 UTC (permalink / raw)


I don't know for sure, but I think that at one time I had some logic in my .emacs that set buffer-local variables and as I recall it affected the *scratch* buffer.

-_
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-


-----Original Message-----
From: Romain FRANCOISE [mailto:romain@orebokech.com] 
Sent: Wednesday, January 15, 2003 4:00 PM
To: help-gnu-emacs@gnu.org
Subject: Re: why cannot set cursor-type with setq but only with setq-default??????

kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:

> I don't know what's the current buffer when ~/.emacs is executed.  A
> temp buffer, perhaps, or *scratch*.

Actually I don't think there is a buffer.  I seem to remember that the
init file is loaded using `load', and that doesn't need a buffer, it's
a built-in function.  A call to `current-buffer' would probably return
whatever buffer was active at the moment, so that would be *scratch*,
or maybe not (if the init file creates a buffer somehow, like a call to
(calendar) would).

But I'm No Expert(tm).

-- 
Romain FRANCOISE <romain@orebokech.com> | It was fourteen degrees below
it's a miracle -- http://orebokech.com/ | on a screeching march 23.
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: why cannot set cursor-type with setq but only with setq-default??????
@ 2003-01-15 22:39 Bingham, Jay
  0 siblings, 0 replies; 7+ messages in thread
From: Bingham, Jay @ 2003-01-15 22:39 UTC (permalink / raw)


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-

^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <mailman.338.1042670496.21513.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2003-01-15 23:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-15 17:34 why cannot set cursor-type with setq but only with setq-default?????? Christian Seberino
2003-01-15 21:28 ` Greg Hill
2003-01-15 21:41 ` Kai Großjohann
2003-01-15 21:59   ` Romain FRANCOISE
  -- strict thread matches above, loose matches on Subject: below --
2003-01-15 22:15 Bingham, Jay
2003-01-15 22:39 Bingham, Jay
     [not found] <mailman.338.1042670496.21513.help-gnu-emacs@gnu.org>
2003-01-15 23:21 ` John Paul Wallington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).