From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Re: [Emacs.app dev]: ghost cursor problem is still there Date: Wed, 20 Aug 2008 01:22:38 -0400 Message-ID: <90AB958C-083A-4DA6-86B6-C63DB82776CE@gmail.com> References: <5f089c510807191428n349bdf55gebdff2e0ca668db7@mail.gmail.com> <7C93A2A7-54FD-43A9-BA1B-0B8502FFA5C6@gmail.com> <1AFEFF71-2AEA-4282-915E-B03050E98592@gmail.com> <8ED46157-6210-4767-A5AE-0DDE4C9DB1B3@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v926) Content-Type: multipart/signed; boundary=Apple-Mail-5-384389638; micalg=sha1; protocol="application/pkcs7-signature" X-Trace: ger.gmane.org 1219209829 6207 80.91.229.12 (20 Aug 2008 05:23:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2008 05:23:49 +0000 (UTC) Cc: "emacs.app dev list" , Emacs-Devel devel To: Adrian Robert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 20 07:24:41 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KVgBR-00066b-SP for ged-emacs-devel@m.gmane.org; Wed, 20 Aug 2008 07:24:38 +0200 Original-Received: from localhost ([127.0.0.1]:34006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVgAT-0003tu-VI for ged-emacs-devel@m.gmane.org; Wed, 20 Aug 2008 01:23:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVg9f-0003ac-7T for emacs-devel@gnu.org; Wed, 20 Aug 2008 01:22:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVg9d-0003a1-PQ for emacs-devel@gnu.org; Wed, 20 Aug 2008 01:22:46 -0400 Original-Received: from [199.232.76.173] (port=41555 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVg9d-0003Zq-FV for emacs-devel@gnu.org; Wed, 20 Aug 2008 01:22:45 -0400 Original-Received: from ug-out-1314.google.com ([66.249.92.173]:23063) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KVg9c-0000dt-Sp for emacs-devel@gnu.org; Wed, 20 Aug 2008 01:22:45 -0400 Original-Received: by ug-out-1314.google.com with SMTP id m2so1011177uge.17 for ; Tue, 19 Aug 2008 22:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=/mY9UI2PCNURt77POyizaCDfWuUB+NfrZj9qE/QAtJI=; b=jXrqyop/RxRBj2Bt0WvnMn0j+LVZCfUUDEydaBYMqRxbg3ePWYB+Kd42njtqTHZ5MI n/N+bwBFRLQWYpEGWLJKDChFpWnFOFZqVJcxGqq1wYf9wKM/F1SJ/H5AGJxuYECysnGs XmiLXaWNvuYhC8FB4oqj4sQZeuR2Wkh+f6mVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=LDKfqYRT0O9ueM1Y4wDe0bKOuHWtVgaSb1JQYygfPzNg1u7UqfEjndg0kpNdu+le0G gO2AhyFm9HHEO4UPgOw/pNmqtizrIPZE+2UMRRP78w5CaJONI+impskTQLqD7rmY3tn2 ghqDO0uSTGXnqMpB7jOqES5BOYTfmMFu/DpbI= Original-Received: by 10.66.224.19 with SMTP id w19mr5851740ugg.72.1219209762640; Tue, 19 Aug 2008 22:22:42 -0700 (PDT) Original-Received: from ?10.0.1.5? ( [68.162.152.50]) by mx.google.com with ESMTPS id m1sm470010uge.17.2008.08.19.22.22.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 19 Aug 2008 22:22:41 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.926) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:102709 Archived-At: --Apple-Mail-5-384389638 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Adrian et al, On 22 Jul 2008, at 09:41, David Reitter wrote: > > The main changes are that we check cursor_type instead of cursorType =20= > and draw the text glyph rather than the cursor when erasing anything =20= > (`hl' variable). There's a range of steps that we do to ensure that =20= > the cursor area is actually visible; I'm not sure if they are really =20= > needed, but the corresponding X code does it, too. > There is a good bit of guess-work involved, but I'm sure that =20 > testing will take care of any problems. OK, in my latest build, things work a lot better and the original =20 blink-cursor-mode appears to work fine now. (I don't quite understand =20= which change made the event mechanisms work better.) To repeat, these changes address the following issues: - frame background rather than the right glyph in the white-out phases =20= during blinking - `cursor-type' variable as in core Emacs, rather than NS specific =20 solution - with it, support for things like (box . 2) - box/hollow cursors too narrow - standard blink-cursor-mode with all its bells and whistles (whether =20= one needs them or not) I would also take the blink rate stuff out of the preferences (a patch =20= to the nib) - it doesn't work with the generic blinking code and I =20 believe it's there for historic reasons (because the NS port =20 implemented blinking separately) rather than because it would be very =20= important to have for users (one could think of much more important =20 settings that could be there). ns_set_cursor_type is now equivalent to the x_set_cursor_type (quasi) =20= generic. I left ns_set_cursor_color for you or someone else. The occasional ghost cursors seem to remain. Any objections? D Index: nsterm.m =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/nsterm.m,v retrieving revision 1.23 diff -c -r1.23 nsterm.m *** nsterm.m 5 Aug 2008 03:05:14 -0000 1.23 --- nsterm.m 20 Aug 2008 05:18:41 -0000 *************** *** 168,180 **** the Function modifer (laptops). May be any of the modifier lisp =20= symbols. */ Lisp_Object ns_function_modifier; - /* A floating point value specifying the rate at which to blink the =20= cursor. - YES indicates 0.5, NO indicates no blinking. */ - Lisp_Object ns_cursor_blink_rate; - - /* Used for liason with core emacs cursor-blink-mode. */ - Lisp_Object ns_cursor_blink_mode; - /* A floating point value specifying vertical stretch (positive) or =20= shrink (negative) of text line spacing. Zero means default spacing. YES indicates 0.5, NO indicates 0.0. */ --- 168,173 ---- *************** *** 235,241 **** static NSEvent *last_appdefined_event =3D 0; static NSTimer *timed_entry =3D 0; static NSTimer *fd_entry =3D nil; - static NSTimer *cursor_blink_entry =3D nil; static NSTimer *scroll_repeat_entry =3D nil; static fd_set select_readfds, t_readfds; static struct timeval select_timeout; --- 228,233 ---- *************** *** 2270,2275 **** --- 2262,2271 ---- int on_p, int active_p) /* =20 = --------------------------------------------------------------------------= External call (RIF): draw cursor + (modeled after x_draw_window_cursor and erase_phys_cursor. + FIXME: erase_phys_cursor is called from display_and_set_cursor, + called from update_window_cursor/x_update_window_end/... + Why do we have to duplicate this code? =20 = --------------------------------------------------------------------------= */ { NSRect r, s; *************** *** 2278,2291 **** struct glyph *phys_cursor_glyph; int overspill; unsigned char drawGlyph =3D 0, cursorType, oldCursorType; NSTRACE (dumpcursor); ! if (!on_p) return; w->phys_cursor_type =3D cursor_type; ! w->phys_cursor_on_p =3D 1; if (cursor_type =3D=3D NO_CURSOR) { --- 2274,2296 ---- struct glyph *phys_cursor_glyph; int overspill; unsigned char drawGlyph =3D 0, cursorType, oldCursorType; + int new_cursor_type; + int new_cursor_width; + int active_cursor; + enum draw_glyphs_face hl; + struct glyph_matrix *active_glyphs =3D w->current_matrix; + Display_Info *dpyinfo =3D FRAME_X_DISPLAY_INFO (f); + int hpos =3D w->phys_cursor.hpos; + int vpos =3D w->phys_cursor.vpos; + struct glyph_row *cursor_row; NSTRACE (dumpcursor); ! if (!on_p) // check this? && !w->phys_cursor_on_p) return; w->phys_cursor_type =3D cursor_type; ! w->phys_cursor_on_p =3D on_p; if (cursor_type =3D=3D NO_CURSOR) { *************** *** 2318,2326 **** if (overspill > 0) r.size.width -=3D overspill; - /* TODO: 23: use emacs stored f->cursor_type instead of ns-=20 specific */ oldCursorType =3D FRAME_CURSOR (f); cursorType =3D FRAME_CURSOR (f) =3D FRAME_NEW_CURSOR (f); f->output_data.ns->current_cursor_color =3D f->output_data.ns->desired_cursor_color; --- 2323,2332 ---- if (overspill > 0) r.size.width -=3D overspill; oldCursorType =3D FRAME_CURSOR (f); cursorType =3D FRAME_CURSOR (f) =3D FRAME_NEW_CURSOR (f); + + /* TODO: 23: use emacs stored cursor color instead of ns-specific */ f->output_data.ns->current_cursor_color =3D f->output_data.ns->desired_cursor_color; *************** *** 2342,2392 **** if (cursorType =3D=3D no_highlight || cursor_type =3D=3D NO_CURSOR) { /* clearing for blink: erase the cursor itself */ [FRAME_BACKGROUND_COLOR (f) set]; ! cursorType =3D oldCursorType; /* just clear what we had before = */ } else [FRAME_CURSOR_COLOR (f) set]; ! if (!active_p) ! { ! /* inactive window: ignore what we just set and use a hollow =20 box */ ! cursorType =3D hollow_box; ! [FRAME_CURSOR_COLOR (f) set]; ! } ! switch (cursorType) ! { ! case no_highlight: ! break; ! case filled_box: ! NSRectFill (r); ! drawGlyph =3D 1; ! break; ! case hollow_box: ! NSRectFill (r); ! [FRAME_BACKGROUND_COLOR (f) set]; ! NSRectFill (NSInsetRect (r, 1, 1)); ! [FRAME_CURSOR_COLOR (f) set]; ! drawGlyph =3D 1; ! break; ! case underscore: ! s =3D r; ! s.origin.y +=3D lrint (0.75 * s.size.height); ! s.size.height =3D lrint (s.size.height * 0.25); ! NSRectFill (s); ! break; ! case bar: ! s =3D r; ! s.size.width =3D 1; ! NSRectFill (s); ! break; } ns_unfocus (f); /* if needed, draw the character under the cursor */ if (drawGlyph) ! draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR); } --- 2348,2472 ---- if (cursorType =3D=3D no_highlight || cursor_type =3D=3D NO_CURSOR) { /* clearing for blink: erase the cursor itself */ + + /* No cursor displayed or row invalidated =3D> nothing to do on =20= the + screen. */ + if (w->phys_cursor_type =3D=3D NO_CURSOR) + return; + + /* VPOS >=3D active_glyphs->nrows means that window has been =20 resized. + Don't bother to erase the cursor. */ + if (vpos >=3D active_glyphs->nrows) + return; + + /* If row containing cursor is marked invalid, there is =20 nothing we + can do. */ + cursor_row =3D MATRIX_ROW (active_glyphs, vpos); + if (!cursor_row->enabled_p) + return; + + /* If line spacing is > 0, old cursor may only be partially =20 visible in + window after split-window. So adjust visible height. */ + cursor_row->visible_height =3D min (cursor_row->visible_height, + window_text_bottom_y (w) - = cursor_row->y); + + /* If row is completely invisible, don't attempt to delete a =20 cursor which + isn't there. This can happen if cursor is at top of a window, = and + we switch to a buffer with a header line in that window. */ + if (cursor_row->visible_height <=3D 0) + return; + + /* If cursor is in the fringe, erase by drawing actual bitmap =20= there. */ + if (cursor_row->cursor_in_fringe_p) + { + cursor_row->cursor_in_fringe_p =3D 0; + draw_fringe_bitmap (w, cursor_row, 0); + return; + } + + /* This can happen when the new row is shorter than the old one. + In this case, either draw_glyphs or clear_end_of_line + should have cleared the cursor. Note that we wouldn't be + able to erase the cursor in this case because we don't have a + cursor glyph at hand. */ + if (w->phys_cursor.hpos >=3D cursor_row->used[TEXT_AREA]) + return; + + /* If the cursor is in the mouse face area, redisplay that when + we clear the cursor. */ + if (! NILP (dpyinfo->mouse_face_window) + && w =3D=3D XWINDOW (dpyinfo->mouse_face_window) + && (vpos > dpyinfo->mouse_face_beg_row + || (vpos =3D=3D dpyinfo->mouse_face_beg_row + && hpos >=3D dpyinfo->mouse_face_beg_col)) + && (vpos < dpyinfo->mouse_face_end_row + || (vpos =3D=3D dpyinfo->mouse_face_end_row + && hpos < dpyinfo->mouse_face_end_col)) + /* Don't redraw the cursor's spot in mouse face if it is at = the + end of a line (on a newline). The cursor appears there, = but + mouse highlighting does not. */ + && cursor_row->used[TEXT_AREA] > hpos) + hl =3D DRAW_MOUSE_FACE; + else + hl =3D DRAW_NORMAL_TEXT; + drawGlyph =3D 1; // just draw the Glyph [FRAME_BACKGROUND_COLOR (f) set]; ! ! NSDisableScreenUpdates (); } else + { + cursorType =3D cursor_type; + hl =3D DRAW_CURSOR; [FRAME_CURSOR_COLOR (f) set]; + ! if (!active_p) ! { ! /* inactive window: ignore what we just set and use a hollow = box */ ! cursorType =3D hollow_box; ! [FRAME_CURSOR_COLOR (f) set]; ! } ! NSDisableScreenUpdates (); ! ! switch (cursorType) ! { ! case NO_CURSOR: // no_highlight: ! break; ! case FILLED_BOX_CURSOR: //filled_box: ! NSRectFill (r); ! drawGlyph =3D 1; ! break; ! case HOLLOW_BOX_CURSOR: //hollow_box: ! NSRectFill (r); ! [FRAME_BACKGROUND_COLOR (f) set]; ! NSRectFill (NSInsetRect (r, 1, 1)); ! [FRAME_CURSOR_COLOR (f) set]; ! drawGlyph =3D 1; ! break; ! case HBAR_CURSOR: // underscore: ! s =3D r; ! s.origin.y +=3D lrint (0.75 * s.size.height); ! s.size.height =3D cursor_width; //lrint (s.size.height * = 0.25); ! NSRectFill (s); ! break; ! case BAR_CURSOR: //bar: ! s =3D r; ! s.size.width =3D cursor_width; ! NSRectFill (s); ! drawGlyph =3D 1; ! break; ! } } ns_unfocus (f); /* if needed, draw the character under the cursor */ if (drawGlyph) ! draw_phys_cursor_glyph (w, glyph_row, hl); ! ! NSEnableScreenUpdates (); ! } *************** *** 3173,3207 **** repeats: YES] retain]; - if (!NILP (ns_cursor_blink_mode) && !cursor_blink_entry) - { - if (!NUMBERP (ns_cursor_blink_rate)) - ns_cursor_blink_rate =3D make_float (0.5); - cursor_blink_entry =3D [[NSTimer - scheduledTimerWithTimeInterval: XFLOATINT =20 (ns_cursor_blink_rate) - target: NSApp - selector: @selector =20 (cursor_blink_handler:) - userInfo: 0 - repeats: YES] - retain]; - } - else if (NILP (ns_cursor_blink_mode) && cursor_blink_entry) - { - if (NUMBERP (ns_cursor_blink_rate)) - ns_cursor_blink_rate =3D Qnil; - struct ns_display_info *dpyinfo =3D x_display_list; /* HACK */ - [cursor_blink_entry invalidate]; - [cursor_blink_entry release]; - cursor_blink_entry =3D 0; - if (dpyinfo->x_highlight_frame) - { - Lisp_Object tem - =3D get_frame_param (dpyinfo->x_highlight_frame, = Qcursor_type); - dpyinfo->x_highlight_frame->output_data.ns->desired_cursor - =3D ns_lisp_to_cursor_type (tem); - } - } - /* Let Application dispatch events until it receives an event of =20= the type NX_APPDEFINED, which should only be sent by =20 timeout_handler. */ inNsSelect =3D 1; --- 3253,3258 ---- *************** *** 3487,3494 **** ns_command_modifier =3D Qsuper; ns_control_modifier =3D Qcontrol; ns_function_modifier =3D Qnone; - ns_cursor_blink_rate =3D Qnil; - ns_cursor_blink_mode =3D Qnil; ns_expand_space =3D make_float (0.0); ns_antialias_text =3D Qt; ns_antialias_threshold =3D 10.0; /* not exposed to lisp side */ --- 3538,3543 ---- *************** *** 3795,3804 **** Qnil, Qnil, NO, YES); if (NILP (ns_function_modifier)) ns_function_modifier =3D Qnone; - ns_default ("CursorBlinkRate", &ns_cursor_blink_rate, - make_float (0.5), Qnil, YES, NO); - if (NUMBERP (ns_cursor_blink_rate)) - ns_cursor_blink_mode =3D Qt; ns_default ("ExpandSpace", &ns_expand_space, make_float (0.5), make_float (0.0), YES, NO); ns_default ("GSFontAntiAlias", &ns_antialias_text, --- 3844,3849 ---- *************** *** 4194,4224 **** extern void update_window_cursor (struct window *w, int on); - - (void)cursor_blink_handler: (NSTimer *)cursorEntry - /* =20 = --------------------------------------------------------------------------= - Flash the cursor - =20 = --------------------------------------------------------------------------= */ - { - struct ns_display_info *dpyinfo =3D x_display_list; /*HACK, but OK =20= for now */ - struct frame *f =3D dpyinfo->x_highlight_frame; - NSTRACE (cursor_blink_handler); - - if (!f) - return; - if (f->output_data.ns->current_cursor =3D=3D no_highlight) - { - Lisp_Object tem =3D get_frame_param (f, Qcursor_type); - f->output_data.ns->desired_cursor =3D ns_lisp_to_cursor_type =20 (tem); - } - else - { - f->output_data.ns->desired_cursor =3D no_highlight; - } - update_window_cursor (XWINDOW (FRAME_SELECTED_WINDOW (f)), 1); - /*x_update_cursor (f, 1); */ - } - - - (void)fd_handler: (NSTimer *) fdEntry /* =20 = --------------------------------------------------------------------------= Check data waiting on file descriptors and terminate if so --- 4239,4244 ---- *************** *** 6025,6039 **** int cursorType =3D ns_lisp_to_cursor_type (get_frame_param (frame, = Qcursor_type)); prevExpandSpace =3D XFLOATINT (ns_expand_space); - prevBlinkRate =3D NILP (ns_cursor_blink_rate) - ? 0 : XFLOATINT (ns_cursor_blink_rate); #ifdef NS_IMPL_COCOA prevUseHighlightColor =3D ns_use_system_highlight_color; #endif [expandSpaceSlider setFloatValue: prevExpandSpace]; - [cursorBlinkSlider setFloatValue: prevBlinkRate]; [cursorTypeMatrix selectCellWithTag: (cursorType =3D=3D filled_box = ? =20 1 : (cursorType =3D=3D bar ? 2 : (cursorType =3D=3D =20 underscore ? 3 : 4)))]; --- 6045,6056 ---- *************** *** 6062,6070 **** int ctrlTag =3D [[controlModMenu selectedItem] tag]; int fnTag =3D [[functionModMenu selectedItem] tag]; #endif - float blinkRate =3D [cursorBlinkSlider floatValue]; float expandSpace =3D [expandSpaceSlider floatValue]; - Lisp_Object old_cursor_blink_mode; if (expandSpace !=3D prevExpandSpace) { --- 6079,6085 ---- *************** *** 6075,6112 **** x_set_window_size (frame, 0, frame->text_cols, frame-=20 >text_lines); */ prevExpandSpace =3D expandSpace; } - if (blinkRate !=3D prevBlinkRate) - { - old_cursor_blink_mode =3D ns_cursor_blink_mode; - if (blinkRate =3D=3D 0.0) - { - ns_cursor_blink_rate =3D Qnil; - ns_cursor_blink_mode =3D Qnil; - } - else - { - ns_cursor_blink_rate =3D make_float (blinkRate); - ns_cursor_blink_mode =3D Qt; - } - if (!EQ (ns_cursor_blink_mode, old_cursor_blink_mode)) - Feval (Fcons (intern ("blink-cursor-mode"), Qnil)); - - if (blinkRate !=3D 0.0 && prevBlinkRate !=3D 0.0) - { /* if changed rates, remove blink handler so change =20 picked up */ - struct ns_display_info *dpyinfo =3D FRAME_NS_DISPLAY_INFO =20= (frame); - [cursor_blink_entry invalidate]; - [cursor_blink_entry release]; - cursor_blink_entry =3D 0; - if (dpyinfo->x_highlight_frame) - { - Lisp_Object tem - =3D get_frame_param (dpyinfo->x_highlight_frame, = Qcursor_type); - dpyinfo->x_highlight_frame->output_data.ns-=20 >desired_cursor - =3D ns_lisp_to_cursor_type (tem); - } - } - prevBlinkRate =3D blinkRate; - } FRAME_NEW_CURSOR (frame) =3D (cursorTag =3D=3D 1 ? filled_box : cursorTag =3D=3D 2 ? bar --- 6090,6095 ---- *************** *** 6419,6432 **** Set to none means that the function key is not interpreted by Emacs =20= at all,\n\ allowing it to be used at a lower level for accented character =20 entry."); - DEFVAR_LISP ("ns-cursor-blink-rate", &ns_cursor_blink_rate, - "Rate at which the Emacs cursor blinks (in seconds).\n\ - Set to nil to disable blinking."); - - DEFVAR_LISP ("ns-cursor-blink-mode", &ns_cursor_blink_mode, - "Internal variable -- use M-x blink-cursor-mode or =20 preferences\n\ - panel to control this setting."); - DEFVAR_LISP ("ns-expand-space", &ns_expand_space, "Amount by which spacing between lines is expanded =20 (positive)\n\ or shrunk (negative). Zero (the default) means standard line =20 height.\n\ --- 6402,6407 ---- *** nsfns.m 09 Aug 2008 04:37:53 -0400 1.20 --- nsfns.m 19 Aug 2008 13:36:53 -0400=09 *************** *** 412,417 **** --- 412,418 ---- } } + /* FIXME: adapt to generics */ static void ns_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object =20= oldval) *************** *** 435,440 **** --- 436,453 ---- update_face_from_frame_parameter (f, Qcursor_color, arg); } + /* this is like x_set_cursor_type defined in xfns.c */ + void + ns_set_cursor_type (f, arg, oldval) + FRAME_PTR f; + Lisp_Object arg, oldval; + { + set_frame_cursor_types (f, arg); + + /* Make sure the cursor gets redrawn. */ + cursor_type_changed =3D 1; + } + =0C static void ns_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object =20 oldval) *************** *** 929,954 **** } - static void - ns_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object =20 oldval) - { - int val; - - val =3D ns_lisp_to_cursor_type (arg); - if (val >=3D 0) - { - f->output_data.ns->desired_cursor =3Dval; - } - else - { - store_frame_param (f, Qcursor_type, oldval); - error ("the `cursor-type' frame parameter should be either =20 `no', `box', \ - `hollow', `underscore' or `bar'."); - } - - update_mode_lines++; - } - /* 23: called to set mouse pointer color, but all other terms use =20 it to initialize pointer types (and don't set the color ;) */ --- 942,947 ---- *** ns-win.el 18 Aug 2008 12:23:42 -0400 1.24 --- ns-win.el 19 Aug 2008 12:42:35 -0400=09 *************** *** 59,65 **** ;; nsterm.m (defvar ns-version-string) (defvar ns-expand-space) - (defvar ns-cursor-blink-rate) (defvar ns-alternate-modifier) ;;;; Command line argument handling. --- 59,64 ---- *************** *** 995,1004 **** (ns-set-resource nil "CommandModifier" (symbol-name ns-command-=20 modifier)) (ns-set-resource nil "ControlModifier" (symbol-name ns-control-=20 modifier)) (ns-set-resource nil "FunctionModifier" (symbol-name ns-function-=20= modifier)) - (ns-set-resource nil "CursorBlinkRate" - (if ns-cursor-blink-rate - (number-to-string ns-cursor-blink-rate) - "NO")) (ns-set-resource nil "ExpandSpace" (if ns-expand-space (number-to-string ns-expand-space) --- 994,999 ---- *************** *** 1228,1257 **** 0 1)) )) (if (not tool-bar-mode) (tool-bar-mode t))) - (defvar ns-cursor-blink-mode) ; nsterm.m - - ;; Redefine from frame.el. - (define-minor-mode blink-cursor-mode - "Toggle blinking cursor mode. - With a numeric argument, turn blinking cursor mode on if ARG is =20 positive, - otherwise turn it off. When blinking cursor mode is enabled, the - cursor of the selected window blinks. - - Note that this command is effective only when Emacs - displays through a window system, because then Emacs does its own - cursor display. On a text-only terminal, this is not implemented." - :init-value (not (or noninteractive - no-blinking-cursor - (eq ns-cursor-blink-rate nil))) - :initialize 'custom-initialize-safe-default - :group 'cursor - :global t - (if blink-cursor-mode - (setq ns-cursor-blink-mode t) - (setq ns-cursor-blink-mode nil))) - - - ;;;; Dialog-related functions. ;; Ask user for confirm before printing. Due to Kevin Rodgers. --- 1223,1228 ---- --Apple-Mail-5-384389638 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIFxDCCAn0w ggHmoAMCAQICEEfSZyInpN9bVdFPsdICbiIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA3MTIwOTIzMDM0OFoXDTA4MTIwODIzMDM0 OFowYjEQMA4GA1UEBBMHUmVpdHRlcjEOMAwGA1UEKhMFRGF2aWQxFjAUBgNVBAMTDURhdmlkIFJl aXR0ZXIxJjAkBgkqhkiG9w0BCQEWF2RhdmlkLnJlaXR0ZXJAZ21haWwuY29tMIGfMA0GCSqGSIb3 DQEBAQUAA4GNADCBiQKBgQDIS4kZGULD+CxprkxDnEccAnZ2GQQxfn55aiAPoy5kJ+uLhelaZP4p lgx3Vq8xYK1bjsLepGYp8qzVlHsyQPb6O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