bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#27881: New major mode: Less mode


From: Stefan Monnier
Subject: bug#27881: New major mode: Less mode
Date: Mon, 31 Jul 2017 08:44:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

>>> ;;;###autoload
>>> -(defcustom less-css-lessc-command "lessc"
>> Why autoload all these defcustom.  Sounds like a bug.
> It may well be superfluous, but I found a note that this was added because
> non-autoloaded custom vars wouldn’t be considered safe as dir local
> variables otherwise.

The safety info may need to be autoloaded, indeed (IIUC we have
a misfeature in there: we should enable the major mode (when possible)
before checking safety of the local vars).

But the vars themselves are better not autoloaded.

> However, I wouldn’t advocate adding arbitrary flags to a command like this,
> because it can’t then be passed to one of the “process” functions that
> expects the first of its args to be the path of the executable, right?

Indeed, if you don't quote it there, it means it's a "shell" string and
can hence only make sense when passed to a shell, rather than used
directly as a file name.

>> The standard way is to do:
>>
>> (defvar less-mode-map
>>   (let ((map (make-sparse-keymap))))
>>     (define-key map "\C-c\C-c" 'less-compile)
>>   map)
>>
>> before the `define-derived-mode’.
> Is there an advantage to this?

Mostly consistency (each style has its quirks).


        Stefan





reply via email to

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