Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ignoring unknown mode `GNUmakefile-mode'

7 views
Skip to first unread message

Dan Hitt

unread,
Jun 27, 2016, 4:52:55 AM6/27/16
to help-gn...@gnu.org
I have a file whose name is not 'makefile', nor 'Makefile', nor 'GNUmakefile'.

If i visit it using emacs (v 24.5.1, xubuntu 16.04), the modeline
correctly indicates GNUmakefile.

But if i add
# -*- GNUmakefile -*-
at the top of the file, i get a message:
Ignoring unknown mode `GNUmakefile-mode'.

This makes me very uneasy, because i don't know how it is detecting
the mode, and if i mess up the file, it may no longer recognize it as
a GNUmakefile. Also, i don't know if other versions of emacs will be
able to recognize that it is a GNUmakefile.

Note that i can explicitly set the mode with a line like
# -*- Makefile -*-

That does not generate any warnings, but the mode line indicates
'Makefile' rather than 'GNUmakefile', which is not really correct
since it uses a bunch of GNUmakefile specific things.

So . . . is there some way i can instruct emacs, in the text of the
file, that i want it to be treated as a GNUmakefile?

TIA for any clues!

dan

PS: i googled for the line in the subject, and was very surprised not
to get a single match.

Alain Ketterlin

unread,
Jun 27, 2016, 5:34:31 AM6/27/16
to
Dan Hitt <dan....@gmail.com> writes:

> But if i add
> # -*- GNUmakefile -*-
> at the top of the file, i get a message:
> Ignoring unknown mode `GNUmakefile-mode'.

Use makefile-gmake instead. The documentation of makefile-mode lists
other variants.

-- Alain.

Joost Kremers

unread,
Jun 27, 2016, 5:57:02 AM6/27/16
to
Dan Hitt wrote:
> I have a file whose name is not 'makefile', nor 'Makefile', nor 'GNUmakefile'.
>
> If i visit it using emacs (v 24.5.1, xubuntu 16.04), the modeline
> correctly indicates GNUmakefile.
>
> But if i add
> # -*- GNUmakefile -*-
> at the top of the file, i get a message:
> Ignoring unknown mode `GNUmakefile-mode'.

The name displayed in the mode line is not necessarily the actual name
of the major mode. For that, you should inspect the (buffer-local) value
of the variable `major-mode'. Do `C-h v major-mode RET` to check it out.


--
Joost Kremers joostk...@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

Dan Hitt

unread,
Jun 27, 2016, 10:48:16 AM6/27/16
to Joost Kremers, help-gn...@gnu.org
Thanks Joost and Alain,

The diagnostics work the way you said and makefile-gmake solves my problems.

dan

On Mon, Jun 27, 2016 at 2:56 AM, Joost Kremers
<joost.m...@gmail.com> wrote:
> Dan Hitt wrote:
.....
0 new messages