unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Steve Purcell <steve@sanityinc.com>
Cc: tom@tromey.com, dgutov@yandex.ru, 27881@debbugs.gnu.org,
	simenheg@gmail.com
Subject: bug#27881: New major mode: Less mode
Date: Mon, 31 Jul 2017 08:44:24 -0400	[thread overview]
Message-ID: <jwv60e8dbnk.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <E692049D-47DF-438C-8399-92BF97F637F5@sanityinc.com> (Steve Purcell's message of "Mon, 31 Jul 2017 18:39:23 +1200")

>>> ;;;###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	other threads:[~2017-07-31 12:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-30 17:53 bug#27881: New major mode: Less mode Simen Heggestøyl
2017-07-30 20:59 ` Stefan Monnier
2017-07-31  6:39   ` Steve Purcell
2017-07-31 12:44     ` Stefan Monnier [this message]
2017-07-31  2:02 ` Glenn Morris
2017-07-31  4:32   ` Marcin Borkowski
2017-08-03 17:47     ` Simen Heggestøyl
2017-08-04 21:33       ` Richard Stallman
2017-08-02  2:16 ` Tom Tromey
2017-08-03 17:50   ` Simen Heggestøyl
2017-08-03 20:08     ` Stefan Monnier
2017-08-10 22:53       ` Simen Heggestøyl
2017-08-14 10:06         ` Stefan Monnier
2017-08-15 10:33           ` Simen Heggestøyl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv60e8dbnk.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=27881@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=simenheg@gmail.com \
    --cc=steve@sanityinc.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).