From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: /srv/bzr/emacs/trunk r101338: * lisp/emacs-lisp/syntax.el (syntax-ppss): More sanity check to catch Date: Fri, 14 Feb 2014 09:22:22 -0800 (PST) Message-ID: <2290b40a-7afc-43db-8703-3c6c56426be5@default> References: < <87r47bi1e5.fsf@yandex.ru>> < <52F96284.50507@yandex.ru>> < <52FAE12B.6060101@yandex.ru> > <<52FC3BEE.60604@yandex.ru> <52FCD2B4.5080006@yandex.ru> <52FD9F1D.50205@yandex.ru>> <<83mwhucg1h.fsf@gnu.org> <878ute589i.fsf@fencepost.gnu.org>> <<83d2iqc84m.fsf@gnu.org>> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1392398572 9339 80.91.229.3 (14 Feb 2014 17:22:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2014 17:22:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii , David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 14 18:22:57 2014 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 1WEMTX-0001Jd-KU for ged-emacs-devel@m.gmane.org; Fri, 14 Feb 2014 18:22:55 +0100 Original-Received: from localhost ([::1]:53023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEMTX-0003YL-8E for ged-emacs-devel@m.gmane.org; Fri, 14 Feb 2014 12:22:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEMTL-0003Wk-MG for emacs-devel@gnu.org; Fri, 14 Feb 2014 12:22:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEMTD-0002CR-1e for emacs-devel@gnu.org; Fri, 14 Feb 2014 12:22:43 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:28410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEMT3-0002AH-TC; Fri, 14 Feb 2014 12:22:26 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s1EHMOlM029791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 14 Feb 2014 17:22:25 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s1EHMNW6025800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Feb 2014 17:22:23 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s1EHMNJk024802; Fri, 14 Feb 2014 17:22:23 GMT In-Reply-To: <<83d2iqc84m.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:169625 Archived-At: eli>> Emacs can use text properties to switch syntax tables or eli>> categories or even keymaps in mid-buffer. Maybe switching the eli>> whole mode would be feasible in a similar manner. sm>=20 sm> Yes, something like that. Basically, somehow present to major-mode sm> features only a portion of the buffer (e.g., by narrowing sm> internally). and eli> One possibility would be a special text property, whose value is eli> the major mode in effect for the text covered by that property. eli> (I'm not saying this is the best idea, I'm just trying to explain eli> what kind of infrastructure would be needed.) FWIW - Lennart Borgman's MuMaMo multiple-major-mode code uses/used a text property, `mumamo-major-mode', to distinguish zones mapped to particular major modes. I know very little about MuMaMo. The reason I know about this property is that my library `isearch-prop.el' takes this into account, to allow isearching (only) the zones ("chunks") that are mapped to a particular major mode. The value of property `mumamo-major-mode' is handled as a special case by `isearch-prop.el'. Properties `face' and `font-lock-face' are also handled specially by default, and customization allows special handling of others.=20 Normally, searching uses `equal' to check whether a property value matches a value specified by the user. For `face', `font-lock-face', and `mumamo-major-mode', the matching check is not `equal'. For the first two, text is searched that has a face property value that includes any of the faces specified by the user. For `mumamo-major-mode', the user-specified major-mode name is matched against the car of the `mumamo-major-mode' property value. IOW, this is the default matching function: (defun isearchp-property-default-match-fn (property) "Return the default match function for text or overlay PROPERTY. Properties `face', `font-lock-face', and `mumamo-major-mode' are handled specially. For other properties the values are matched using `equal'." (case property ((face font-lock-face) (lambda (val rprop) (if (consp rprop) (condition-case nil ; Allow for dotted cons. (member val rprop) (error nil)) (eq val rprop)))) ((mumamo-major-mode) (lambda (val rprop) (equal val (car rprop)))) (t #'equal)))