GNU bug report logs - #27881
New major mode: Less mode

Previous Next

Package: emacs;

Reported by: Simen Heggestøyl <simenheg <at> gmail.com>

Date: Sun, 30 Jul 2017 17:54:01 UTC

Severity: wishlist

Tags: patch

Done: Simen Heggestøyl <simenheg <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Steve Purcell <steve <at> sanityinc.com>
Cc: bug-gnu-emacs <at> gnu.org, Tom Tromey <tom <at> tromey.com>,
 Simen Heggestøyl <simenheg <at> gmail.com>,
 Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: New major mode: Less mode
Date: Mon, 31 Jul 2017 08:44:24 -0400
>>> ;;;###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




This bug report was last modified 7 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.