From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Toby Cubitt Newsgroups: gmane.emacs.bugs Subject: bug#459: Zero-length overlays, overlay keymaps, and `overlays-at' Date: Sun, 22 Jun 2008 12:31:48 +0100 Message-ID: <485E3824.6030405@dr-qubit.org> References: <485D204B.2@dr-qubit.org> Reply-To: Toby Cubitt , 459@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1214146539 16282 80.91.229.12 (22 Jun 2008 14:55:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Jun 2008 14:55:39 +0000 (UTC) To: 459@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 22 16:56:24 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KAQzO-0003ty-OU for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jun 2008 16:56:23 +0200 Original-Received: from localhost ([127.0.0.1]:56971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAQyZ-0000l1-N4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jun 2008 10:55:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAO2N-0008PF-Fi for bug-gnu-emacs@gnu.org; Sun, 22 Jun 2008 07:47:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAO2L-0008P3-0I for bug-gnu-emacs@gnu.org; Sun, 22 Jun 2008 07:47:14 -0400 Original-Received: from [199.232.76.173] (port=59884 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAO2K-0008P0-Qg for bug-gnu-emacs@gnu.org; Sun, 22 Jun 2008 07:47:12 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51852) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KAO2K-0002DC-AK for bug-gnu-emacs@gnu.org; Sun, 22 Jun 2008 07:47:12 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5MBlAHp003101; Sun, 22 Jun 2008 04:47:10 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m5MBe45t000865; Sun, 22 Jun 2008 04:40:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Toby Cubitt Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 22 Jun 2008 11:40:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 459 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 459-submit@emacsbugs.donarmstrong.com id=B459.121413432432036 (code B ref 459); Sun, 22 Jun 2008 11:40:04 +0000 Original-Received: (at 459) by emacsbugs.donarmstrong.com; 22 Jun 2008 11:32:04 +0000 Original-Received: from starfish.geekisp.com (mail.geekisp.com [216.168.135.169]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5MBW0XM032030 for <459@emacsbugs.donarmstrong.com>; Sun, 22 Jun 2008 04:32:02 -0700 Original-Received: (qmail 20256 invoked by uid 1003); 22 Jun 2008 11:31:55 -0000 Original-Received: from [192.168.2.3] (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Sun, 22 Jun 2008 07:31:49 -0400 User-Agent: Thunderbird 2.0.0.14 (X11/20080508) In-Reply-To: <485D204B.2@dr-qubit.org> X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) X-Primary-Address: toby@dr-qubit.org X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sun, 22 Jun 2008 07:47:14 -0400 X-Mailman-Approved-At: Sun, 22 Jun 2008 10:55:27 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18500 Archived-At: Looking through NEWS.22, I came upon the following: *** The `keymap' property now also works at the ends of overlays and text properties, according to their stickiness. This also means that it works with empty overlays. The same hold for the `local-map' property. So the first issue I reported is already fixed! (In exactly the way I suggested, which makes me suspect that future-bug might now have been fixed too... :) However, this behaviour isn't documented in the Emacs Lisp manual (unless I've overlooked something yet again), which *is* a bug. I think the second issue still remains, though. Toby Toby Cubitt wrote: [...] > 1. Overlay keymaps > ================== > > "Bug" description: > ------------------ > When a zero-length overlay has a keymap property, that keymap is never > active, even if when the point is at the overlay's start (and end) > position. This makes it impossible in Emacs to define a key binding that > is only active at a single point in the buffer. [...] > > Suggestions for possible fixes: > ------------------------------- [...] > b) If a) is undesirable, why not make the behaviour depend on the > overlay's front-advance and read-advance properties? If the zero-length > overlay has null front-advance and non-null read-advance, then there is > some logic in making its keymap active when point is at that position, > since any character inserted at that point will be within the overlay > after insertion. [...] > > > 2. `overlays-at' > ================ > > "Bug" description: > ------------------ > `overlays-at' never returns zero-length overlays. > > > Steps to reproduce: > ------------------- > (make-overlay 1 1) ; any position will do > (overlays-at 1) > > Returns nil instead of the overlay from 1 to 1. > > > Impact: > ------- > Again, zero-length overlays are probably rarely used. But this makes it > impossible in Emacs to find a zero-length overlay using `overlays-at'. > Instead, one has to work-around this using three calls to `overlays-in' > then filter out overlays that shouldn't be in the list. > > Overlays do fairly frequently become zero-length when the text they > cover is deleted (depending on their front- and rear-advance > properties), and this "bug" makes them suddenly disappear from the > return value of `overlays-at' even though they still exist in the buffer. > > > Suggestions for possible fixes: > ------------------------------- > a) Modify (overlays-at pos) to return zero-length overlays that start at > pos (it already returns all other overlays that start at pos). Again, > this seems unlikely to have significant impact on other parts of Emacs, > since zero-length overlays are rarely used. > > b) Modify (overlays-at pos) to return zero-length overlays that start at > pos, and have a null front-advance and non-nil rear-advance property. > (The logic for this is the same as in option b) for the overlay keymaps > issue.) > > c) Leave `overlays-at' unchanged, and define a new function > `overlays-at-point' that implements either a) or b). > > > Toby Cubitt >