From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'. Date: Sat, 12 Mar 2016 23:59:21 +0200 Message-ID: References: <20160308132530.861.91488@vcs.savannah.gnu.org> <20160308183010.GB6269@acm.fritz.box> <20160309174816.GE3948@acm.fritz.box> <56E0805F.3050804@gmx.at> <20160312170839.GE2572@acm.fritz.box> <56E48A47.9060404@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1457819986 28894 80.91.229.3 (12 Mar 2016 21:59:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Mar 2016 21:59:46 +0000 (UTC) To: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 12 22:59:46 2016 Return-path: Envelope-to: ged-emacs-devel@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 1aerZZ-0000kO-5V for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2016 22:59:45 +0100 Original-Received: from localhost ([::1]:33540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aerZY-0007PL-PN for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2016 16:59:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aerZI-0007PE-4G for emacs-devel@gnu.org; Sat, 12 Mar 2016 16:59:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aerZE-00080o-Uh for emacs-devel@gnu.org; Sat, 12 Mar 2016 16:59:28 -0500 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:36889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aerZE-00080R-Ny for emacs-devel@gnu.org; Sat, 12 Mar 2016 16:59:24 -0500 Original-Received: by mail-wm0-x232.google.com with SMTP id p65so58268354wmp.0 for ; Sat, 12 Mar 2016 13:59:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=HtvkgCnDLOixmF3/N9NtEaLMNPLO/ybleBvz1UtXy8Y=; b=VhxTBvvLof7EJnMuhlcbV6Fb8CLaFxGiX/H2YfA1O0k8q/0G3rBbxOXYtvW4mQEUxF lqMnQ/ocyuRyC0781FKE80qOndJshicN+M8tNEdH86MUCdG4mrY/3mdnYhyUWP6C12ql 2KHvP537l3Hnird8vWNouQRugG5Lky0bGYgNZQGIXEg8haFyewlm2mStMrfQkwU8VMqn dMeUeb+cYA6tp3Pd6srpzbtrqaI3FohcGDux6gMh72lVxidUE7DEFHckVy408ZOw6QOO 0hQPQF8gyB9ZLNixJr30LdpIUDZeNp7JszsFM2zlceuOwQvAAucqaTxWvL3zM23ue6vg zPbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=HtvkgCnDLOixmF3/N9NtEaLMNPLO/ybleBvz1UtXy8Y=; b=Y21GuiEjiHpegQhmiTY1sMhN8GlDtEGsLLri6xb7mBoTRqVuipQOdirJ8/HMqo3MCz RMpKQiOlQSidVRAEP3ww5Thtrwc7YRvZm6hRMLPjRHWY4McQXX7QIXHf/WmtU+NLoQFV vlUW96ibA4o827pbatg/CLqATs3FPRAleyjTKIl6EHe4P9ZtXWElT+vvkporHnr0u8Kz 4jCuazWG8Mef+sNB0ll1bRzbacbdSIBCTfYwczbzLx+iDcORAVSXwaBiV3l4S0cT+1GQ QPmhfINKYGcCwwphFYXFW9Y1ZyjEcVGTCuFWdIz+fyNQr2OgH7gZOP6XrtCjXzJqfT4D CjVw== X-Gm-Message-State: AD7BkJJlE0NGF7FAIWzeo3y6sllvMXxmtd+I+3s1VHbj2gdQ9ek629zvrkOOKOCoEsfO7A== X-Received: by 10.28.125.195 with SMTP id y186mr9217640wmc.79.1457819963880; Sat, 12 Mar 2016 13:59:23 -0800 (PST) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id ei9sm14936667wjd.40.2016.03.12.13.59.22 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Mar 2016 13:59:23 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <56E48A47.9060404@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::232 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:201565 Archived-At: On 03/12/2016 11:29 PM, Clément Pit--Claudel wrote: > Does this break on > > /* test */ > > in C mode? ( indicate the position of the point) If by break you mean does nothing, then yes. In what practical situations is this a problem? There might be ways to alleviate it (make syntax-ppss scan forward a little, e.g. till the end of the line), but a naive solution might mess up how syntax-propertize works: a) It wraps the calls to syntax-propertize-function in inhibit-modification-hooks. b) That function is allowed to call syntax-ppss as well, and then modify the syntax-table property of any position after the call. If syntax-ppss is allowed to rely on the syntax class of '*', it might return (and cache) a value that will turn out to be false in the future. *If* the issue is an actual problem, the best way to handle it might be in the caller of syntax-ppss. If the caller is not a part of syntax-propertize-function, or at least it doesn't inhibit modification hooks, it can try evaluating (nth 8 (syntax-ppss pos)) in several positions - from (point) to (+ (point) n -1), where n is the maximum length of a comment starter in the current language. When one of the calls returns a non-nil position (but one that's before point) => jump there.