Re: Emacs makefile mode - Commented text turns tab pink
Heime <[email protected]>
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <XGFlPFoELftQxqWxHDkhjQAQnbAi1bv__Dt2f5xbF8ZmaIqILeK5TLkp4LkovDUh0tIjhUQ46OrtHXWpUyyuh9OSGD6iq7YR7CDUOKtUj54=@protonmail.com> |
On Saturday, April 25th, 2026 at 5:08 AM, [email protected] <[email protected]> wrote: > Heime <[email protected]> writes: > > >> > I made a makefile with some comments. In Emacs the tab of the > >> > comment turns pink. An I doing something wrong? > >> > > >> > $(trgdir)/antares.info: $(srcdir)/antares.texi > >> > ## Make any missing parent directories > >> > mkdir -p $(trgdir) > >> > $(MAKEINFO) $(MAKEINFOFLAGS) -o $@ $< > >> > >> make-mode.el says: > >> > >> ;; Highlight shell comments that Make treats as commands, > >> ;; since these can fool people. > >> ("^\t+#" 0 makefile-space t) > >> > > > > Make treats the comment "## Make any missing parent directories" > > as a command? > > > > ‘make-mode’ is giving you a warning. See (info "(make) Recipe Syntax") > > * A comment in a recipe is not a 'make' comment; it will be passed to > the shell as-is. Whether the shell treats it as a comment or not > depends on your shell. > > If you want to get rid of the warning (which is a good idea > so that you do not get too many and fail to see important > ones), then you should move it to the end of a shell command > or outside of the rule definition: The warning seems redundant to me when the shell treats it as a comment anyway. If Emacs could determine that the shell would interpret the part as a comment, no warnings would be necessary. > 1. > $(trgdir)/antares.info: $(srcdir)/antares.texi > mkdir -p $(trgdir) # Make any missing parent directories > $(MAKEINFO) $(MAKEINFOFLAGS) -o $@ $< > > 2. > # Make any missing parent directories > $(trgdir)/antares.info: $(srcdir)/antares.texi > mkdir -p $(trgdir) > $(MAKEINFO) $(MAKEINFOFLAGS) -o $@ $< Is it common for a rule to include a shell comment in the command part? target [target ...]: [component ...] Tab [command 1] . . . Tab [command n] > -- > The lyf so short, the craft so long to lerne. > - Geoffrey Chaucer, The Parliament of Birds. >