From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Text property searching Date: Tue, 17 Apr 2018 19:10:24 +0000 Message-ID: <20180417191024.GA4739@ACM> References: <87lgdo5bb3.fsf@mouse.gnus.org> <87in8r16b0.fsf@mouse.gnus.org> <87d0yz15a3.fsf@mouse.gnus.org> <87604r143y.fsf@mouse.gnus.org> <87604qx4tj.fsf@mouse.gnus.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1523992333 7754 195.159.176.226 (17 Apr 2018 19:12:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2018 19:12:13 +0000 (UTC) User-Agent: Mutt/1.9.4 (2018-02-28) Cc: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= , emacs-devel To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 17 21:12:08 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 1f8W1Q-0001sU-B7 for ged-emacs-devel@m.gmane.org; Tue, 17 Apr 2018 21:12:08 +0200 Original-Received: from localhost ([::1]:57086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8W3V-0008Mr-62 for ged-emacs-devel@m.gmane.org; Tue, 17 Apr 2018 15:14:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8W2X-0008LO-Li for emacs-devel@gnu.org; Tue, 17 Apr 2018 15:13:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8W2U-0005Lh-Ct for emacs-devel@gnu.org; Tue, 17 Apr 2018 15:13:17 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:17258 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1f8W2U-0005Kp-5F for emacs-devel@gnu.org; Tue, 17 Apr 2018 15:13:14 -0400 Original-Received: (qmail 27908 invoked by uid 3782); 17 Apr 2018 19:13:12 -0000 Original-Received: from acm.muc.de (p5B146E15.dip0.t-ipconnect.de [91.20.110.21]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 17 Apr 2018 21:13:11 +0200 Original-Received: (qmail 4970 invoked by uid 1000); 17 Apr 2018 19:10:24 -0000 Content-Disposition: inline In-Reply-To: <87604qx4tj.fsf@mouse.gnus.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:224708 Archived-At: Hello, Lars. On Mon, Apr 16, 2018 at 22:40:56 +0200, Lars Ingebrigtsen wrote: > I've done some testing. > (progn > (insert "foo bar zot") > (put-text-property 2 3 'face nil) > (put-text-property 5 6 'face 'bold) > (goto-char (point-min)) > (goto-char (next-single-property-change (point) 'face))) > This goes to 5, not to 2, so `next-single-property-change' doesn't seem > to consider a nil value to be different from a missing value, either. > So I think it might make sense to just leave that complication out of > this function, because it's rather obscure (categories and stuff that > sounds way too complicate :-)). "Stuff like that" is part of Emacs. Please take care that the new functions handle category properties correctly (for whatever value of "correctly" is appropriate). If the functions are written in Lisp, this will probably happen automatically (but needs to be checked). If they're written in C, category properties will need to be handled explicitly. If you fail to do this, people will curse you. The functions, instead of being correct, will merely be functions which sort-of work most of the time. And the correct advice given to hackers wishing to write correct programs would be to avoid the new functions altogether and use the currently existing text property searching functions instead. The amount of effort required to document the deficiencies of the new and other functions in the Elisp manual would be non-trivial. Please do this properly. > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany).