From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ben Key Newsgroups: gmane.emacs.devel Subject: MAC OS X Bar Cursor Width Question Date: Sat, 12 Feb 2011 03:22:39 -0600 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6d7843c551a25049c125c99 X-Trace: dough.gmane.org 1297502606 31685 80.91.229.12 (12 Feb 2011 09:23:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 09:23:26 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 12 10:23:16 2011 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.69) (envelope-from ) id 1PoBhA-0001Vm-Hd for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 10:23:13 +0100 Original-Received: from localhost ([127.0.0.1]:48478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoBh8-0004IP-F9 for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 04:23:10 -0500 Original-Received: from [140.186.70.92] (port=55237 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoBh0-0004H5-UU for Emacs-devel@gnu.org; Sat, 12 Feb 2011 04:23:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoBgz-0006yQ-2a for Emacs-devel@gnu.org; Sat, 12 Feb 2011 04:23:03 -0500 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:60112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoBgy-0006y4-T5 for Emacs-devel@gnu.org; Sat, 12 Feb 2011 04:23:01 -0500 Original-Received: by bwz16 with SMTP id 16so3912981bwz.0 for ; Sat, 12 Feb 2011 01:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=Myjuo45B/8WFRHbmLwBjN1jMx9OL7BpSd5pc7p48sqM=; b=osaiTLsjzsZmIbYAbGed1uae054WHJXAi4ko7vOyvGJM0Ela7eJZIDHrive2FVw4i6 XNZczLKV+bLo3kq1c6cuFjRTuzDxZrUh0Ds2L8mGNBsV/M6VI6h2obt3a3DjDDviiuzc su/bD9tm9U+GX4FmLs8B7KmDZOMydP4VjkX1M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=pT5niomV+tv6vDnMyuHYca5vqylpcllv7/NPoJTraAQQ73pyshanfDCtseAZfikGoe SxBpIbFNivV2tQtkuvJMyyDVBLtCSJmjG/6LpDr65LIVtqn/ssyhy5UzrS+xznXkKJ3F K6z0fcUYIuTY6zqzeXpTymqjX8HHFc3zhfNRo= Original-Received: by 10.204.123.5 with SMTP id n5mr1356565bkr.58.1297502579267; Sat, 12 Feb 2011 01:22:59 -0800 (PST) Original-Received: by 10.204.9.193 with HTTP; Sat, 12 Feb 2011 01:22:39 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 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:135937 Archived-At: --0016e6d7843c551a25049c125c99 Content-Type: text/plain; charset=ISO-8859-1 Hello, I have a question about the bar cursor in Emacs on MAC OS X. The first thing I noticed when I configured Emacs to use the bar cursor on MAC OS X was that the cursor seemed to be narrower that I expected, despite the fact that when I configured Emacs to use the bar cursor I specified the width of the cursor to be four pixels wide using the (bar . WIDTH) syntax. While debugging this problem I found a couple of FIXME comments in ns_draw_window_cursor along with the following line of code s.size.width = min (cursor_width, 2); //FIXME(see above) The comments basically say that the cursor_width parameter is being ignored because set_frame_cursor_types does not always initialize it. When investigating this further, I discovered that it is true that set_frame_cursor_types does not always initialize the width (it is actually get_specified_cursor_type that fails to initialize the width). Note that as far as I can tell, when the (bar . WIDTH) syntax is used, the cursor_width parameter is always initialized correctly. My question is would it not be better to fix get_specified_cursor_type so that the width is always initialized and then modify ns_draw_window_cursor to honor the user specified cursor width than to always ignore the user's desired cursor width? This could be easily done by adding the line *width = 2; near the top of get_specified_cursor_type. Then the line in ns_draw_window_cursor could be changed to the following, causing the user's selection when they use the (bar . WIDTH) syntax to be honored. s.size.width = cursor_width; Or, as an alternative, the line could be changed to the following: s.size.width = min (cursor_width, w->phys_cursor_width); //FIXME(see above) Would not this be a better thing to do? I would appreciate any feedback you might have to offer on this question. --0016e6d7843c551a25049c125c99 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Hello,

I have a question about the bar cursor in Emacs on MAC = OS X.=A0 The first thing I noticed when I configured Emacs to use the bar c= ursor on MAC OS X was that the cursor seemed to be narrower that I expected= , despite the fact that when I configured Emacs to use the bar cursor I spe= cified the width of the cursor to be four pixels wide using the (bar . WIDT= H) syntax.

While debugging this problem I found a couple of FIXME = comments in ns_draw_window_cursor along with the following line of code
= =A0=A0=A0 s.size.width =3D min (cursor_width, 2); //FIXME(see above)
=

The comments basically say that the cursor_width parame= ter is being ignored because set_frame_cursor_types does not always initial= ize it.=A0 When investigating this further, I discovered that it is true th= at set_frame_cursor_types does not always initialize the width (it is actua= lly get_specified_cursor_type that fails to initialize the width).

Note that as far as I can tell, when the (bar . WIDTH) = syntax is used, the cursor_width parameter is always initialized correctly.=

My question is would it not be better to fix get_specif= ied_cursor_type so that the width is always initialized and then modify ns_= draw_window_cursor to honor the user specified cursor width than to always = ignore the user's desired cursor width?=A0 This could be easily done by= adding the line
=A0=A0=A0 *width =3D 2;
near the top of get_specified_cursor_type.

Then the line in ns_draw_window_cursor could be changed= to the following, causing the user's selection when they use the (bar = . WIDTH) syntax to be honored.
=A0=A0=A0 s.size.width =3D cursor_width;<= br>Or, as an alternative, the line could be changed to the following:
=A0=A0=A0=A0=A0 s.size.width =3D min (cursor_width, w->phys_cursor_width= ); //FIXME(see above)

Would not this be a better thing to do?

I would appreciate any feedback you might have to offer= on this question.

--0016e6d7843c551a25049c125c99--