From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] Update package: psgml Date: Wed, 19 Apr 2017 08:35:22 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1492605370 13606 195.159.176.226 (19 Apr 2017 12:36:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Apr 2017 12:36:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 19 14:36:06 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 1d0oq5-0003P1-Vr for ged-emacs-devel@m.gmane.org; Wed, 19 Apr 2017 14:36:06 +0200 Original-Received: from localhost ([::1]:47822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0oqB-0005C4-TC for ged-emacs-devel@m.gmane.org; Wed, 19 Apr 2017 08:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0opc-0005Bm-HW for emacs-devel@gnu.org; Wed, 19 Apr 2017 08:35:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0opZ-0001Gf-C9 for emacs-devel@gnu.org; Wed, 19 Apr 2017 08:35:36 -0400 Original-Received: from [195.159.176.226] (port=45678 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0opZ-0001GE-6F for emacs-devel@gnu.org; Wed, 19 Apr 2017 08:35:33 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d0opR-0002at-E4 for emacs-devel@gnu.org; Wed, 19 Apr 2017 14:35:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:5Cxi131B3LQZUXQFO2UZlIg8y7c= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:214112 Archived-At: >> Could you give some further details about the context where you bumped >> into the problem? > I'm doing a lot of DSSSL at the moment, and I wanted the SGML editor > commands to work in DSSSL mode. With sgml-set-face turned on for > editing SGML structure, doing something like sgml-insert-element > fontifies for SGML up to point instead of fontifying for lisp because > PSGML fontifies as it parses the buffer to figure out the current > element. I'm not really familiar with DSSSL, so I'm not sure what thie use case looks like concretely. Is that some Lisp-ish sublanguage that appears between two SGML tags or on the contrary Lisp-ish language with SGML tags within it (i.e. some sort of multi-major-mode situation)? Do you use a dsssl-mode major mode for it? Can you point me to it? > I actually wanted it to be mode-local, which emacs doesn't really do, Emacs does support "mode-local" in the following sense: (add-hook 'foo1-mode-hook (lambda () (setq-local VAR VAL1))) (add-hook 'foo2-mode-hook (lambda () (setq-local VAR VAL2))) ... > I can set sgml-set-face in a hook for sgml-mode, but then I have to > unset it if I want to edit in the other mode. I figured a single list > of modes where SGML should be fontified would be easier to keep track of > than a slue of mode hooks. A bunch of mode hooks is the "standard" way to deal with such situations in Emacs. Which is more convenient depends on the situation, admittedly. In the specific case of psgml, I think the real fix should be to make psgml interact more normally with font-lock. I haven't looked into it hard enough yet, tho. > I looked into indirect buffers, but this seems more intuitive. This makes me feel like you indeed have a multi-major-mode situation, in which case sgml-set-face is probably just one part of the problem (and using indirect buffers would just add more problems). Stefan