From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#16856: Enable fringe cursor when *almost* exact_window_width_line_p Date: Thu, 09 Nov 2017 10:50:41 -0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1510253478 14129 195.159.176.226 (9 Nov 2017 18:51:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Nov 2017 18:51:18 +0000 (UTC) Cc: alan@idiocy.org, andlind@gmail.com, david.reitter@gmail.com To: 16856@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 09 19:51:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCruw-0003Hm-Hk for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Nov 2017 19:51:11 +0100 Original-Received: from localhost ([::1]:38348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCrv0-0003LF-TK for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Nov 2017 13:51:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCrur-0003KB-P1 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2017 13:51:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCruo-00004y-Mh for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2017 13:51:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52095) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eCruo-00004r-IR for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2017 13:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eCruo-0003hD-Bp for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2017 13:51:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Nov 2017 18:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16856 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: unreproducible X-Debbugs-Original-To: Emacs Bug Reports X-Debbugs-Original-Cc: Alan Third , 16856@debbugs.gnu.org, Martin Rudalics , David Reitter , Eli Zaretskii , Anders Lindgren Original-Received: via spool by 16856-submit@debbugs.gnu.org id=B16856.151025344814160 (code B ref 16856); Thu, 09 Nov 2017 18:51:02 +0000 Original-Received: (at 16856) by debbugs.gnu.org; 9 Nov 2017 18:50:48 +0000 Original-Received: from localhost ([127.0.0.1]:60770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCruZ-0003gK-Q5 for submit@debbugs.gnu.org; Thu, 09 Nov 2017 13:50:47 -0500 Original-Received: from gateway33.websitewelcome.com ([192.185.146.87]:14461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCruW-0003gB-IE for 16856@debbugs.gnu.org; Thu, 09 Nov 2017 13:50:46 -0500 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 423037A837 for <16856@debbugs.gnu.org>; Thu, 9 Nov 2017 12:50:43 -0600 (CST) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id CruUeZy1rDL8rCruVeO2nN; Thu, 09 Nov 2017 12:50:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Gt0Oql2lLHUxP5AkkKqaUC3FRw9QhC78fltWrQlDddU=; b=G2Qn94I30F83N5807T651ubRvF clh8T14fbxLiKawGKay3HOmdI0RwC/L7uqj6xhSb1SGjCcqmysZYvlLM54BV2Q8aypQTLZZs0EY08 xoo8B7JPgj62dQQapfB+Iw5zEejoIhk3mrjmUoyLe5cpENk/H7udli5iuIp2OhcJo+x8Zuny1za3O S0ySmDlVr+2gptWGP8kb1nk09W2SY6MaSiqb/4mlraEZ2HztRkcD7axPh2ZTeusRTmHkm7JbTHvs/ KjTZVTY2Za78tESf/TeonPMZ9O2Mstqgcqzw0zVAivaHJbYYrkSpt4SyacvrF8+OrajRcZcDqyeYw tNsHA6uw==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50175 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1eCruT-0008xV-VD; Thu, 09 Nov 2017 12:50:42 -0600 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1eCruT-0008xV-VD X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:50175 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:139681 Archived-At: For those users who wish to customize the frame width pixelwise to a size such that exact_window_width_line_p will _never_ be true, those users miss out on the joy of seeing the fringe cursor bitmap. While the patch that was applied pursuant to Bug#16856 fixed the problem with the cursor being drawn on top of the fringe (e5015c5d9632a0bf685c093249ae4a7d3e825b13), it does not permit a fringe bitmap to be placed there instead. If I had it to do all over again, I would have made the following two modifications. [I have not yet experimented with xterm.c and w32term.c to see if the new condition should be added there as well for Emacs platform builds on Windows and X11.] In window.c, add the following condition to get_phys_cursor_glyph: /* This modification enables placement of the cursor-in-fringe bitmap when the window-width is slightly less than `glyph_row->exact_window_width_line_p`. This modification also prevents drawing the real cursor on the fringe (instead of using the cursor-in-fringe bitmap) in the above-mentioned circumstance. */ struct frame *f = XFRAME (w->frame); int frame_char_width = FRAME_COLUMN_WIDTH (f); int text_area_width = window_box_width (w, TEXT_AREA); bool cursor_in_fringe_p = w->phys_cursor.x + frame_char_width >= text_area_width; if (cursor_in_fringe_p) return NULL; And, in nsterm.m, modify a section of ns_draw_window_cursor to include the new condition: if ((phys_cursor_glyph = get_phys_cursor_glyph (w)) == NULL) { /* This modification enables placement of the cursor-in-fringe bitmap when the window-width is slightly less than `glyph_row->exact_window_width_line_p`. This modification also prevents drawing the real cursor on the fringe (instead of using the cursor-in-fringe bitmap) in the above-mentioned circumstance. */ int frame_char_width = FRAME_COLUMN_WIDTH (f); int text_area_width = window_box_width (w, TEXT_AREA); bool cursor_in_fringe_p = w->phys_cursor.x + frame_char_width >= text_area_width; if ((glyph_row->exact_window_width_line_p && w->phys_cursor.hpos >= glyph_row->used[TEXT_AREA]) || cursor_in_fringe_p) { glyph_row->cursor_in_fringe_p = 1; draw_fringe_bitmap (w, glyph_row, 0); } return; }