emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exposing the effective mode in a multi-mode


From: Alan Mackenzie
Subject: Re: exposing the effective mode in a multi-mode
Date: Mon, 18 Sep 2017 09:30:53 +0000
User-agent: Mutt/1.7.2 (2016-11-26)

Hello, Tom

On Sun, Sep 17, 2017 at 17:13:39 -0600, Tom Tromey wrote:
> I noticed that company couldn't do CSS completion in a <style> element
> in mhtml-mode.

> company-css understands how web-mode handles sub-modes, by calling a
> web-mode function ("web-mode-language-at-pos") directly, but it doesn't
> understand mhtml-mode.

> So, I'd like to propose this patch for Emacs 26.  It adds a new function
> to prog-mode.el so that multi-modes can expose the sub-mode at point.
> It also changes mhtml-mode to set the new variable to make this work.

prog-mode seems the wrong place to put this.  It has nothing to do with
programming languages, as such, and everything to do with multi-mode
modes.

The facility will surely be needed by modes which aren't derived from
prog-mode.

The implementation of multi modes is, as far as I understand it, still
in flux.  Is the current implementation going to be applicable to all
these various ways of doing multi-mode?  Would it not be better to have
this as a hook function (in global namespace), where the pertinent
multi-mode could set the hook to its own function?

Just a few thoughts.

> Tom

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]