unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: Alan Shutko <ats@acm.org>,
	rms@gnu.org, emacs-devel@gnu.org, spiegel@gnu.org
Subject: Re: [spiegel@gnu.org: Re: [Fwd: vc-annotate causes Emacs to die]]
Date: 27 Aug 2002 17:56:51 +0200	[thread overview]
Message-ID: <5xbs7os3b0.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <868z2te0th.fsf@gerd.free-bsd.org>

gerd.moellmann@t-online.de (Gerd Moellmann) writes:

> Gerd Moellmann <gerd.moellmann@t-online.de> writes:
> 
> P.S.
> 
> Can I now have the 21.2 cursor shapes back, as I requested a couple of
> times?  The new cursor shapes for the off-state of the blinking cursor
> and in non-selected windows drive me up the wall.  Why was that change
> made, for heaven's sake?
> 

Try this patch [X version only, but easily ported to mac and w32].

It changes cursor-in-non-selected-windows to a lisp object with
(almost) same values as cursor-type, and adds alternative-cursor-type
for the "off-state" of the blinking cursor.


Anyone else think this is nice to have?



Index: dispextern.h
===================================================================
RCS file: /cvs/emacs/src/dispextern.h,v
retrieving revision 1.137
diff -c -r1.137 dispextern.h
*** dispextern.h	16 Jul 2002 19:48:08 -0000	1.137
--- dispextern.h	27 Aug 2002 14:48:45 -0000
***************
*** 2268,2274 ****
  extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
  extern int help_echo_showing_p;
  extern int current_mode_line_height, current_header_line_height;
! extern int cursor_in_non_selected_windows;
  
  /* Defined in sysdep.c */
  
--- 2268,2275 ----
  extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
  extern int help_echo_showing_p;
  extern int current_mode_line_height, current_header_line_height;
! extern Lisp_Object Vcursor_in_non_selected_windows;
! extern Lisp_Object Valternate_cursor_type;
  
  /* Defined in sysdep.c */
  
Index: lisp.h
===================================================================
RCS file: /cvs/emacs/src/lisp.h,v
retrieving revision 1.438
diff -c -r1.438 lisp.h
*** lisp.h	14 Aug 2002 10:35:03 -0000	1.438
--- lisp.h	27 Aug 2002 14:48:45 -0000
***************
*** 2364,2369 ****
--- 2364,2370 ----
  extern Lisp_Object Qinhibit_eval_during_redisplay;
  extern Lisp_Object Qmessage_truncate_lines;
  extern Lisp_Object Qcursor_in_non_selected_windows;
+ extern Lisp_Object Qalternate_cursor_type;
  extern Lisp_Object Vmessage_log_max;
  extern int message_enable_multibyte;
  extern Lisp_Object echo_area_buffer[2];
Index: xdisp.c
===================================================================
RCS file: /cvs/emacs/src/xdisp.c,v
retrieving revision 1.778
diff -c -r1.778 xdisp.c
*** xdisp.c	27 Aug 2002 00:59:55 -0000	1.778
--- xdisp.c	27 Aug 2002 14:48:46 -0000
***************
*** 528,539 ****
  
  static int message_cleared_p;
  
! /* Non-zero means we want a hollow cursor in windows that are not
!    selected.  Zero means there's no cursor in such windows.  */
  
! int cursor_in_non_selected_windows;
  Lisp_Object Qcursor_in_non_selected_windows;
  
  /* A scratch glyph row with contents used for generating truncation
     glyphs.  Also used in direct_output_for_insert.  */
  
--- 528,547 ----
  
  static int message_cleared_p;
  
! /* Specifies the cursor type to display in windows that are not
!    selected.  t means we want a hollow cursor in such windows.
!    nil means there's no cursor in such windows.  */
  
! Lisp_Object Vcursor_in_non_selected_windows;
  Lisp_Object Qcursor_in_non_selected_windows;
  
+ /* Specifies the desired cursor-type to use to show the blinking
+    cursor off state and cursor shown in non-selected windows.
+    t means to use the default.  */
+ 
+ Lisp_Object Valternate_cursor_type;
+ Lisp_Object Qalternate_cursor_type;
+ 
  /* A scratch glyph row with contents used for generating truncation
     glyphs.  Also used in direct_output_for_insert.  */
  
***************
*** 15293,15298 ****
--- 15301,15308 ----
    staticpro (&Qmessage_truncate_lines);
    Qcursor_in_non_selected_windows = intern ("cursor-in-non-selected-windows");
    staticpro (&Qcursor_in_non_selected_windows);
+   Qalternate_cursor_type = intern ("alternate-cursor-type");
+   staticpro (&Qalternate_cursor_type);
    Qgrow_only = intern ("grow-only");
    staticpro (&Qgrow_only);
    Qinhibit_menubar_update = intern ("inhibit-menubar-update");
***************
*** 15513,15523 ****
  go back to their normal size.  */);
    Vresize_mini_windows = Qgrow_only;
  
!   DEFVAR_BOOL ("cursor-in-non-selected-windows",
! 	       &cursor_in_non_selected_windows,
!     doc: /* *Non-nil means display a hollow cursor in non-selected windows.
! nil means don't display a cursor there.  */);
!   cursor_in_non_selected_windows = 1;
  
    DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p,
      doc: /* *Non-nil means scroll the display automatically to make point visible.  */);
--- 15523,15538 ----
  go back to their normal size.  */);
    Vresize_mini_windows = Qgrow_only;
  
!   DEFVAR_LISP ("cursor-in-non-selected-windows",
! 	       &Vcursor_in_non_selected_windows,
!     doc: /* *Cursor type to display in non-selected windows.
! t means display a hollow cursor in non-selected windows, nil means
! don't display a cursor there.  See `cursor-type' for other values.  */);
!   Vcursor_in_non_selected_windows = Qt;
! 
!   DEFVAR_LISP ("alternate-cursor-type", &Valternate_cursor_type,
!     doc: /* *Cursor type displayed in the blinking cursor off state.  */);
!   Valternate_cursor_type = Qt;
  
    DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p,
      doc: /* *Non-nil means scroll the display automatically to make point visible.  */);
Index: xterm.c
===================================================================
RCS file: /cvs/emacs/src/xterm.c,v
retrieving revision 1.750
diff -c -r1.750 xterm.c
*** xterm.c	14 Aug 2002 00:59:01 -0000	1.750
--- xterm.c	27 Aug 2002 14:48:47 -0000
***************
*** 11808,11813 ****
--- 11808,11814 ----
       int on, hpos, vpos, x, y;
  {
    struct frame *f = XFRAME (w->frame);
+   Lisp_Object alt_cursor;
    int new_cursor_type;
    int new_cursor_width;
    int cursor_off_state = 0;
***************
*** 11849,11854 ****
--- 11850,11856 ----
       the cursor type given by the frame parameter.  If explicitly
       marked off, draw no cursor.  In all other cases, we want a hollow
       box cursor.  */
+   alt_cursor = Qalternate_cursor_type;
    new_cursor_width = -1;
    new_cursor_type = -2;
  
***************
*** 11859,11866 ****
      {
        if (w == XWINDOW (echo_area_window))
  	new_cursor_type = FRAME_DESIRED_CURSOR (f);
!       else if (NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows,
! 					  w->buffer)))
  	new_cursor_type = NO_CURSOR;
        else
  	cursor_off_state = 1;
--- 11861,11868 ----
      {
        if (w == XWINDOW (echo_area_window))
  	new_cursor_type = FRAME_DESIRED_CURSOR (f);
!       else if ((alt_cursor = Fbuffer_local_value (Qcursor_in_non_selected_windows,
! 						  w->buffer), NILP (alt_cursor)))
  	new_cursor_type = NO_CURSOR;
        else
  	cursor_off_state = 1;
***************
*** 11871,11878 ****
  	   || w != XWINDOW (f->selected_window))
      {
        if ((MINI_WINDOW_P (w) && minibuf_level == 0)
! 	  || NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows,
! 					w->buffer))
  	  || NILP (XBUFFER (w->buffer)->cursor_type))
  	new_cursor_type = NO_CURSOR;
        else
--- 11873,11880 ----
  	   || w != XWINDOW (f->selected_window))
      {
        if ((MINI_WINDOW_P (w) && minibuf_level == 0)
! 	  || (alt_cursor = Fbuffer_local_value (Qcursor_in_non_selected_windows,
! 						w->buffer), NILP (alt_cursor))
  	  || NILP (XBUFFER (w->buffer)->cursor_type))
  	new_cursor_type = NO_CURSOR;
        else
***************
*** 11898,11904 ****
       if it has blinked off or for nonselected windows.  */
    if (w->cursor_off_p || cursor_off_state)
      {
!       if (new_cursor_type == FILLED_BOX_CURSOR)
  	new_cursor_type = HOLLOW_BOX_CURSOR;
        else if (new_cursor_type == BAR_CURSOR && new_cursor_width > 1)
  	new_cursor_width = 1;
--- 11900,11912 ----
       if it has blinked off or for nonselected windows.  */
    if (w->cursor_off_p || cursor_off_state)
      {
!       if ((!EQ (alt_cursor, Qalternate_cursor_type) ||
! 	   (alt_cursor = Fbuffer_local_value (Qalternate_cursor_type,
! 					      w->buffer))) &&
! 	  !EQ (alt_cursor, Qt))
! 	new_cursor_type = x_specified_cursor_type (alt_cursor,
! 						   &new_cursor_width);
!       else if (new_cursor_type == FILLED_BOX_CURSOR)
  	new_cursor_type = HOLLOW_BOX_CURSOR;
        else if (new_cursor_type == BAR_CURSOR && new_cursor_width > 1)
  	new_cursor_width = 1;



-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2002-08-27 15:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-26  0:36 [spiegel@gnu.org: Re: [Fwd: vc-annotate causes Emacs to die]] Richard Stallman
2002-08-26 13:33 ` Gerd Moellmann
2002-08-26 18:26   ` vc-annotate causes Emacs to die Andre Spiegel
2002-08-26 18:35   ` [spiegel@gnu.org: Re: [Fwd: vc-annotate causes Emacs to die]] Alan Shutko
2002-08-26 20:25     ` Gerd Moellmann
2002-08-26 22:02       ` Gerd Moellmann
2002-08-27  1:59         ` Miles Bader
2002-08-27 10:31           ` Gerd Moellmann
2002-08-28  1:15             ` Miles Bader
2002-08-28 10:07               ` Gerd Moellmann
2002-08-27 15:56         ` Kim F. Storm [this message]
2002-08-27 15:50           ` Gerd Moellmann
2002-08-27 19:05         ` Richard Stallman
2002-08-27 23:35           ` Alan Shutko
2002-08-28 23:32             ` Richard Stallman
2002-08-29  6:27               ` Juanma Barranquero
2002-08-29  7:36                 ` Miles Bader
2002-08-28 10:12           ` Gerd Moellmann
2002-08-28 23:33             ` Richard Stallman
2002-08-30 13:15               ` Kim F. Storm
2002-08-27 19:05   ` Richard Stallman
2002-08-28 10:32     ` Gerd Moellmann
2002-08-28 23:33       ` Richard Stallman
2002-08-29  9:51         ` Gerd Moellmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5xbs7os3b0.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=ats@acm.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=spiegel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).