From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: [spiegel@gnu.org: Re: [Fwd: vc-annotate causes Emacs to die]] Date: 27 Aug 2002 17:56:51 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xbs7os3b0.fsf@kfs2.cua.dk> References: <200208260036.g7Q0aYe12400@wijiji.santafe.edu> <86n0r9vj6i.fsf@gerd.free-bsd.org> <87znv91n8y.fsf@wesley.springies.com> <86u1lhe5az.fsf@gerd.free-bsd.org> <868z2te0th.fsf@gerd.free-bsd.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1030460271 25086 127.0.0.1 (27 Aug 2002 14:57:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 Aug 2002 14:57:51 +0000 (UTC) Cc: Alan Shutko , rms@gnu.org, emacs-devel@gnu.org, spiegel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17jhms-0006WM-00 for ; Tue, 27 Aug 2002 16:57:46 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17jiID-0006IJ-00 for ; Tue, 27 Aug 2002 17:30:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jho5-00084e-00; Tue, 27 Aug 2002 10:59:01 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17jhlg-00080p-00 for emacs-devel@gnu.org; Tue, 27 Aug 2002 10:56:32 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17jhld-00080Y-00 for emacs-devel@gnu.org; Tue, 27 Aug 2002 10:56:31 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jhld-00080C-00; Tue, 27 Aug 2002 10:56:29 -0400 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id BC0C57C017; Tue, 27 Aug 2002 14:56:26 +0000 (GMT) Original-To: gerd.moellmann@t-online.de (Gerd Moellmann) In-Reply-To: <868z2te0th.fsf@gerd.free-bsd.org> Original-Lines: 241 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6985 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6985 gerd.moellmann@t-online.de (Gerd Moellmann) writes: > Gerd Moellmann 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 http://www.cua.dk