From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Kurochkin Newsgroups: gmane.emacs.devel Subject: Re: text_property_stickiness() ignores `text-property-default-nonsticky' Date: Tue, 05 Jul 2011 08:13:27 +0400 Message-ID: <87mxgt5pqw.fsf@gmail.com> References: <87aacuq5p2.fsf@gmail.com> <87tyb15v6s.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1309839234 14066 80.91.229.12 (5 Jul 2011 04:13:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2011 04:13:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 05 06:13:50 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qdx1B-0000JL-QQ for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2011 06:13:49 +0200 Original-Received: from localhost ([::1]:59245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdx1B-0005ry-2z for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2011 00:13:49 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdx0y-0005re-4H for emacs-devel@gnu.org; Tue, 05 Jul 2011 00:13:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qdx0w-0005dR-US for emacs-devel@gnu.org; Tue, 05 Jul 2011 00:13:36 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:48196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdx0w-0005dN-KV for emacs-devel@gnu.org; Tue, 05 Jul 2011 00:13:34 -0400 Original-Received: by bwd14 with SMTP id 14so5738458bwd.0 for ; Mon, 04 Jul 2011 21:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=GYt40f29lRh8pCYQDO/TwKUIttcG6dzpTdi64s+T6zI=; b=VMBJAqxGWfcF34Y8eYzb/d6ZgnypKempBbcZpMDngrEvJ98oMC59VBucI2YycXel12 Q+liVpbU4AtpYpPH8DJlJpJaMsp2d/UCBM/QC7yHZGfuM35q8a/4bwZUfo56CGa/SPYx OAgJBjO8iOmc0Wro/xta5uMdKfRQ4WDZRdsCQ= Original-Received: by 10.204.76.19 with SMTP id a19mr6287236bkk.110.1309839213697; Mon, 04 Jul 2011 21:13:33 -0700 (PDT) Original-Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id e6sm6144513bka.11.2011.07.04.21.13.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jul 2011 21:13:32 -0700 (PDT) In-Reply-To: User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) 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.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141570 Archived-At: On Mon, 04 Jul 2011 23:50:41 -0400, Stefan Monnier wrote: > > The patch below would not work because it checks for nil in > > `text-property-default-nonsticky' instead of 't. > > Yes, as you noticed, I caught it before committing. > > > But your commit r104949 fixes the issue. Thank you! Will it get > > included in some bugfix emacs release anytime soon? Or only Emacs24? > > The next Emacs release should be 24.1 (there are no more planned 23.N). > > > It seems that text_property_stickiness() or get_pos_property() or some > > other elisp interface to get "what inherited property value for PROP is > > at this POS" would be useful. For example, `widget-field-activate' > > should work at the end of widget. Currently, `widget-field-activate' is > > called at the end of widget, because keymap is rear-sticky but it does > > not call widget's action because `widget-field-at' does not respect > > stickiness. What do you think? > > At the C level, we have `get_pos_property' which returns the value of > a property at that position (i.e. between the char before the position > and the char after that position). Note that since stickiness can vary > between properties, get_pos_property could still return a value > inconsistent with the keymap used. Hm... I guess I miss something here. Can you provide an example here? > But I guess we could export get_pos_property to Elisp. > Perhaps there should be `get-char-property-sticky' (and similar) functions that do the same as non-sticky counterparts but check for sticky properties additionally. Then `widget-field-at' would use such function to get the `field' property instead of `get-char-property'. That should fix the issue with `widget-field-activate' I described above. Regards, Dmitry > > Stefan