From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lucien Pullen Newsgroups: gmane.emacs.devel Subject: [ELPA] Update package: psgml Date: Sun, 16 Apr 2017 16:38:03 -0600 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1492382294 25831 195.159.176.226 (16 Apr 2017 22:38:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Apr 2017 22:38:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (darwin) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 17 00:38:11 2017 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 1czso6-0006dL-Tm for ged-emacs-devel@m.gmane.org; Mon, 17 Apr 2017 00:38:11 +0200 Original-Received: from localhost ([::1]:33740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czsoC-0006b7-P7 for ged-emacs-devel@m.gmane.org; Sun, 16 Apr 2017 18:38:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czso6-0006ao-7u for emacs-devel@gnu.org; Sun, 16 Apr 2017 18:38:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czso3-0002yO-4h for emacs-devel@gnu.org; Sun, 16 Apr 2017 18:38:10 -0400 Original-Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:35568) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1czso2-0002y8-Uc for emacs-devel@gnu.org; Sun, 16 Apr 2017 18:38:07 -0400 Original-Received: by mail-io0-x22d.google.com with SMTP id r16so134108160ioi.2 for ; Sun, 16 Apr 2017 15:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=O5Yzv1h/h+XmN7kT4DLgJF4iJLuRFCqdg/spdKSIj94=; b=iM1C1SuQJuKjlkobRjAWjCFolFJoMMlStUtZG9ryWzVa1yCybP1pBI6RKi06kndGiq p7OfvUEDNZYPwVFHejUjuYopeZXf+5rV9/H+b7xwc1JKtVp/cdpe3F8SNL7HYhqKo7W7 F3uXyKi/ls1tWGNH1Q0MUxGe0kyfY4csevEhpua2TOTmdA6Y7v68oMsJxiCteUIyQpMN ageMr09TAAe6YTwclgGIv2DGjloGPp3Z88FxL05xHX9/iUc7yAZkFVDP3wf84svHhKP0 DtlXHbKd+kgxe+WTv5CV80qyigHK+KWTPme3/up7jB+qSOklrFBvHRYvUufKOiCy30Bx olYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=O5Yzv1h/h+XmN7kT4DLgJF4iJLuRFCqdg/spdKSIj94=; b=Z6NFyPOQaEZmuOYebRl31tV7FhDo1SMjbRzKEdwEIVPmHBBae2G/LtJPuCimw9YZ3A Q1r0pvRQs5/rIq5yHs0AIqttGovXD2GMt9lgjooj4i6wZbtqgYr6OP6st1kfy+igEK3d pghXMEMPhjdqNCjvmvUEj7RaoHE/PThM2jNzGeJPJM97Iqho9dOZX9nFZvOGMEgxPRaK yfEq1FiA4Y6NVZTqefJGJHrgCrV8orQXUEpFxsQ90crflsEiZqxaQxpKCVjYiVVf7pnB /NtQ5S05jLC61mIsXmQoHRW84mFBVFPU7TkVEPXX1SHlDf66EK+w7PhOLiXsVSAU1+V1 AS8g== X-Gm-Message-State: AN3rC/6wXNZyEZHYTUP2ANFakhwduQ3qjoZaHMvKd8Wgd8YnTxh+462W DN6mGheWLwHbxZ6X X-Received: by 10.36.22.201 with SMTP id a192mr6240643ita.116.1492382285697; Sun, 16 Apr 2017 15:38:05 -0700 (PDT) Original-Received: from lucien.drurowin.org (c-71-56-236-181.hsd1.co.comcast.net. [71.56.236.181]) by smtp.googlemail.com with ESMTPSA id v89sm4164715iov.49.2017.04.16.15.38.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Apr 2017 15:38:04 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::22d 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:214031 Archived-At: --=-=-= Content-Type: text/plain Update how PSGML uses `sgml-set-face' to include a list of major modes. If the current major mode isn't in the list, treat as nil, otherwise t. This allows PSGML's parser to be used in other major modes without clobbering font locking in the process. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-psgml-conditionally-set-face-from-major-mode.patch >From c3cf6728d7f4bb1836aefaa78c8eb3e74f722085 Mon Sep 17 00:00:00 2001 From: Lucien Pullen Date: Sun, 16 Apr 2017 16:00:23 -0600 Subject: [PATCH] psgml: conditionally set face from major mode * psgml-parse.el (sgml-set-face): In addition to never (nil) and always (t), can be a list of major mode functions to only set face in those modes. --- psgml-parse.el | 12 +++++++----- psgml.el | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/psgml-parse.el b/psgml-parse.el index 5609767..eb9828e 100644 --- a/psgml-parse.el +++ b/psgml-parse.el @@ -1317,8 +1317,9 @@ was successful or nil if failed." "Set the type of the markup parsed to TYPE. The markup starts at position given by variable `sgml-markup-start' and ends at point." - (when (and sgml-set-face - (null sgml-current-eref)) + (when (and (or (eq sgml-set-face t) + (find major-mode sgml-set-face)) + (null sgml-current-eref)) (sgml-set-face-for sgml-markup-start (point) type)) (setq sgml-markup-type type)) @@ -2821,7 +2822,7 @@ overrides the entity type in entity look up." (when (and (not executing-macro) (or (and (boundp 'which-function-mode) which-function-mode ) - sgml-set-face) + (or (eq sgml-set-face t) (find major-mode sgml-set-face)) sgml-buffer-parse-state (sit-for 0)) (let ((deactivate-mark nil)) @@ -2833,7 +2834,8 @@ overrides the entity type in entity look up." (sgml-element-gi sgml-last-element))) (let ((eol-pos (save-excursion (end-of-line 1) (point)))) ;; Set face on current line - (when (and sgml-set-face (not (input-pending-p))) + (when (and (or (eq sgml-set-face t) (find major-mode sgml-set-face)) + (not (input-pending-p))) (save-excursion (condition-case nil (sgml-parse-to @@ -2846,7 +2848,7 @@ overrides the entity type in entity look up." (defun sgml-fontify-buffer (delay) (and - sgml-set-face + (or (eq sgml-set-face t) (find major-mode sgml-set-face)) (null (sgml-tree-etag-epos (sgml-pstate-top-tree sgml-buffer-parse-state))) (sit-for delay) diff --git a/psgml.el b/psgml.el index 142079a..b0ff140 100644 --- a/psgml.el +++ b/psgml.el @@ -849,7 +849,9 @@ sgml-normalize-trims If non-nil, sgml-normalize will trim off white space from end of element when adding end tag. sgml-indent-step How much to increment indent for every element level. sgml-indent-data If non-nil, indent in data/mixed context also. -sgml-set-face If non-nil, psgml will set the face of parsed markup. +sgml-set-face If non-nil, psgml will set the face of parsed markup, + either always (when t) or when the buffer's major mode matches + one of the listed function names. sgml-markup-faces The faces used when the above variable is non-nil. sgml-public-map Mapping from public identifiers to file names. sgml-offer-save If non-nil, ask about saving modified buffers before -- 2.3.4 --=-=-=--