From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Emacs 21.2 display bugs: variables: cursor-type; properties: display, before-string, after-string, invisible, intangible Date: Sun, 26 May 2002 16:25:35 -0600 (MDT) Sender: emacs-devel-admin@gnu.org Message-ID: <200205262225.g4QMPZp06445@aztec.santafe.edu> References: Reply-To: rms@gnu.org NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1022452059 31810 127.0.0.1 (26 May 2002 22:27:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 26 May 2002 22:27:39 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17C6UF-0008Gx-00 for ; Mon, 27 May 2002 00:27:39 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17C6lI-0004ZN-00 for ; Mon, 27 May 2002 00:45:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17C6Um-0005Nr-00; Sun, 26 May 2002 18:28:12 -0400 Original-Received: from pele.santafe.edu ([192.12.12.119]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17C6SK-0005Hn-00; Sun, 26 May 2002 18:25:40 -0400 Original-Received: from aztec.santafe.edu (aztec [192.12.12.49]) by pele.santafe.edu (8.11.6+Sun/8.9.3) with ESMTP id g4QMPZK01991; Sun, 26 May 2002 16:25:35 -0600 (MDT) Original-Received: (from rms@localhost) by aztec.santafe.edu (8.10.2+Sun/8.9.3) id g4QMPZp06445; Sun, 26 May 2002 16:25:35 -0600 (MDT) X-Authentication-Warning: aztec.santafe.edu: rms set sender to rms@aztec using -f Original-To: jbw@izanami.cee.hw.ac.uk In-Reply-To: (message from Joe Wells on 18 May 2002 19:53:34 +0100) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4404 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4404 ;; * The buffer's value of cursor-type is ignored when the buffer's ;; window is not the selected window. Instead, the usual hollow box ;; cursor is displayed. Do you like the results of this change? *** xterm.c.~1.734.~ Sat May 25 17:30:04 2002 --- xterm.c Sun May 26 17:25:30 2002 *************** *** 11649,11654 **** --- 11649,11655 ---- struct frame *f = XFRAME (w->frame); int new_cursor_type; int new_cursor_width; + int cursor_off_state = 0; struct glyph_matrix *current_glyphs; struct glyph_row *glyph_row; struct glyph *glyph; *************** *** 11688,11738 **** marked off, draw no cursor. In all other cases, we want a hollow box cursor. */ new_cursor_width = -1; if (cursor_in_echo_area && FRAME_HAS_MINIBUF_P (f) && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) { 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 = HOLLOW_BOX_CURSOR; else new_cursor_type = NO_CURSOR; } ! else { ! if (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame ! || 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 ! new_cursor_type = HOLLOW_BOX_CURSOR; ! } else ! { ! struct buffer *b = XBUFFER (w->buffer); ! if (EQ (b->cursor_type, Qt)) ! new_cursor_type = FRAME_DESIRED_CURSOR (f); ! else ! new_cursor_type = x_specified_cursor_type (b->cursor_type, ! &new_cursor_width); ! if (w->cursor_off_p) ! { ! 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; ! else ! new_cursor_type = NO_CURSOR; ! } ! } } /* If cursor is currently being shown and we don't want it to be or it is in the wrong place, or the cursor type is not what we want, --- 11689,11748 ---- marked off, draw no cursor. In all other cases, we want a hollow box cursor. */ new_cursor_width = -1; + new_cursor_type = -2; + + /* Echo area */ if (cursor_in_echo_area && FRAME_HAS_MINIBUF_P (f) && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)) { 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; + } + + /* Nonselected window or nonselected frame. */ + else if (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame + || 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 + cursor_off_state = 1; } ! ! /* If new_cursor_type isn't decided yet, decide it now. */ ! if (new_cursor_type == -2) { ! struct buffer *b = XBUFFER (w->buffer); ! ! if (EQ (b->cursor_type, Qt)) ! new_cursor_type = FRAME_DESIRED_CURSOR (f); else ! new_cursor_type = x_specified_cursor_type (b->cursor_type, ! &new_cursor_width); ! } ! /* Dim out or hollow out the cursor, ! 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; ! else ! new_cursor_type = NO_CURSOR; } + + /* Now new_cursor_type is correct. */ /* If cursor is currently being shown and we don't want it to be or it is in the wrong place, or the cursor type is not what we want,