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.devel Subject: Current column in non-selected (inactive) window. Date: Mon, 17 Sep 2018 18:24:51 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1537233812 26894 195.159.176.226 (18 Sep 2018 01:23:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2018 01:23:32 +0000 (UTC) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 18 03:23:28 2018 Return-path: Envelope-to: ged-emacs-devel@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 1g24jg-0006u5-3Y for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2018 03:23:28 +0200 Original-Received: from localhost ([::1]:38003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g24lm-0002la-5r for ged-emacs-devel@m.gmane.org; Mon, 17 Sep 2018 21:25:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g24lB-0002kK-CD for emacs-devel@gnu.org; Mon, 17 Sep 2018 21:25:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g24l5-0002sv-Py for emacs-devel@gnu.org; Mon, 17 Sep 2018 21:25:01 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.53.25]:25755) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g24l5-0002gU-HZ for emacs-devel@gnu.org; Mon, 17 Sep 2018 21:24:55 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id C0A41400D38B6 for ; Mon, 17 Sep 2018 20:24:52 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 24l2gOxLKaSey24l2gpIIr; Mon, 17 Sep 2018 20:24:52 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc: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=mNARpX7lRo8fsr3xQIgJsFHK/+tJFKaIieRU/nwaGqM=; b=YlOPwaTtAr2XUGoSo/vV8qMaBE scMCHO2vJQMk/0Gp3Sx8bdHvW2RZIdFpau5C6u+1i2O82GiiAQe3t5VWKQpLLw4glgy+0jSIF7x1h 9LD0fHKAaZ+wnYfMGe5NEbWvXYvj1Eh9ZV4S56cc7cDXV1fF1GIN5ntjfTFE+fyAyT0EL7wmllCkd ITmLbF2PY3ePLVhHqTJKpJsddwjO5C3ExYpQiXg5/kf3gKV2zuGmyW8LExRM6c5rAR18d1aQiD3kg 0TBJAiq5dBBC7s9D/DhiyNw5CTNmqGFopFNseliYfeuVfh7gFOKwTWqwaZCDISZvrc0R3LLS0F+fk Y0ORJaKQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54485 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1g24l1-001TJy-V3 for emacs-devel@gnu.org; Mon, 17 Sep 2018 20:24:52 -0500 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 - 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: 1g24l1-001TJy-V3 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54485 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.53.25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229928 Archived-At: I am working on feature requests #17684 (crosshairs) and #22873 (multiple fake cursors). [Crosshairs changes colors depending upon whether the current column is odd/even numbered, or beyond the fill-column.] I was unable to find a built-in way to obtain the current column of point in the non-selected (inactive) window. I believe the problem is that current_column and its underling functions use PT and PT_BYTE, which is not the same as the window_point in the non-selected (inactive) window. I resolved the issue by creating a new function (nearly identical to current_column and its underlying functions) that now take an argument for a particular point of interest, and I am using Fwindow_point to get that interesting point. I replaced all PT with my particular point of interest, and in a couple of places, I replaced PT_BYTE with CHAR_TO_BYTE (point_of_interest). Other than creating those new functions as described above, is there a built-in mechanism to get the current column in a non-selected (inactive) window? If nothing exists, perhaps this new feature might be useful to other users in the future?