From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#15900: 24.3.50; foreground-color-at-point returns wrong results Date: Sat, 16 Nov 2013 10:57:01 +0200 Message-ID: <83vbzshggy.fsf@gnu.org> References: <87siuyxvw7.fsf@web.de> <83li0qhxyl.fsf@gnu.org> <878uwpgvh8.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1384592293 30019 80.91.229.3 (16 Nov 2013 08:58:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Nov 2013 08:58:13 +0000 (UTC) Cc: michael_heerdegen@web.de, 15900@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 16 09:58:17 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vhbho-0001wk-8L for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Nov 2013 09:58:16 +0100 Original-Received: from localhost ([::1]:35146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vhbhn-0007y2-AI for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Nov 2013 03:58:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vhbhg-0007xt-81 for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2013 03:58:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vhbha-0007zF-MG for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2013 03:58:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vhbha-0007zB-Ia for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2013 03:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vhbha-0007lf-1w for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2013 03:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2013 08:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15900 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15900-submit@debbugs.gnu.org id=B15900.138459224329802 (code B ref 15900); Sat, 16 Nov 2013 08:58:02 +0000 Original-Received: (at 15900) by debbugs.gnu.org; 16 Nov 2013 08:57:23 +0000 Original-Received: from localhost ([127.0.0.1]:56627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vhbgw-0007kZ-Lx for submit@debbugs.gnu.org; Sat, 16 Nov 2013 03:57:23 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:41094) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vhbgu-0007kL-4Z for 15900@debbugs.gnu.org; Sat, 16 Nov 2013 03:57:21 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MWC00F00M72OK00@a-mtaout22.012.net.il> for 15900@debbugs.gnu.org; Sat, 16 Nov 2013 10:57:13 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MWC00FU8M7DBQA0@a-mtaout22.012.net.il>; Sat, 16 Nov 2013 10:57:13 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80631 Archived-At: > Date: Fri, 15 Nov 2013 16:26:15 -0800 (PST) > From: Drew Adams > Cc: 15900@debbugs.gnu.org > > > > As you later discovered, even (face-at-point nil t) doesn't > > > do the job. Which doesn't surprise me a bit: this kind of > > > things cannot be done reliably from Lisp > > I don't see any basis for saying that. See above. Sounds > pretty straightforward in Lisp, to me. What am I missing? You are missing the fact that only part of what the display engine does to compute the appearance of a given character on display is exposed to Lisp. > > > even at a price of the kind of obfuscated code that > > > face-at-point and foreground-color-at-point use. > > Care to back that up? Just where do you see obfuscation? Everywhere. I don't understand why that code does what it does, for starters. It looks to me as a series of kludges one upon another, with the sole purpose of outsmarting the display engine. These kinds of things should never be done in Lisp, because they all will look like that: complicated, fragile, and unreliable. > > > It is much simpler to write a C primitive that simulates > > > the display, then returns the resulting face at a given > > > character position, a simple and straightforward task on > > > the C level, something the display engine does all the > > > time. > > Overengineering, IMO. In my book, a simple and elegant solution is always better than a complex and inelegant one. That's the opposite of over-engineering.