unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* What is a "superior mode"?
@ 2021-03-09  4:54 Marcin Borkowski
  2021-03-09  7:19 ` Philip Kaludercic
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Marcin Borkowski @ 2021-03-09  4:54 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi all,

the Elisp reference says (in the "Mode-Specific Indent" node):

 -- Function: prog-first-column
     Call this function instead of using a literal value (usually, zero)
     of the column number for indenting top-level program constructs.
     The function’s value is the column number to use for top-level
     constructs.  When no superior mode is in effect, this function
     returns zero.

What is a "superior mode" (and a "sub-mode", for that matter)?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09  4:54 What is a "superior mode"? Marcin Borkowski
@ 2021-03-09  7:19 ` Philip Kaludercic
  2021-03-09 11:54 ` Dmitry Gutov
  2021-03-09 12:49 ` Eli Zaretskii
  2 siblings, 0 replies; 10+ messages in thread
From: Philip Kaludercic @ 2021-03-09  7:19 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Help Gnu Emacs mailing list

Marcin Borkowski <mbork@mbork.pl> writes:

> Hi all,
>
> the Elisp reference says (in the "Mode-Specific Indent" node):
>
>  -- Function: prog-first-column
>      Call this function instead of using a literal value (usually, zero)
>      of the column number for indenting top-level program constructs.
>      The function’s value is the column number to use for top-level
>      constructs.  When no superior mode is in effect, this function
>      returns zero.
>
> What is a "superior mode" (and a "sub-mode", for that matter)?

I would guess a mode that you'd derive another mode from.  So prog-mode
is the superior mode, and c-mode would be a sub-mode.  Kind of like
super-class in OOP.

> TIA,

-- 
	Philip K.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09  4:54 What is a "superior mode"? Marcin Borkowski
  2021-03-09  7:19 ` Philip Kaludercic
@ 2021-03-09 11:54 ` Dmitry Gutov
  2021-03-09 21:20   ` Marcin Borkowski
  2021-03-09 12:49 ` Eli Zaretskii
  2 siblings, 1 reply; 10+ messages in thread
From: Dmitry Gutov @ 2021-03-09 11:54 UTC (permalink / raw)
  To: Marcin Borkowski, Help Gnu Emacs mailing list

On 09.03.2021 06:54, Marcin Borkowski wrote:
> the Elisp reference says (in the "Mode-Specific Indent" node):
> 
>   -- Function: prog-first-column
>       Call this function instead of using a literal value (usually, zero)
>       of the column number for indenting top-level program constructs.
>       The function’s value is the column number to use for top-level
>       constructs.  When no superior mode is in effect, this function
>       returns zero.
> 
> What is a "superior mode" (and a "sub-mode", for that matter)?

It refers to a "multiple major modes" situation. Like Python embedded in 
HTML, that sort of thing. Or C inside Latex.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09  4:54 What is a "superior mode"? Marcin Borkowski
  2021-03-09  7:19 ` Philip Kaludercic
  2021-03-09 11:54 ` Dmitry Gutov
@ 2021-03-09 12:49 ` Eli Zaretskii
  2021-03-09 21:19   ` Marcin Borkowski
  2 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2021-03-09 12:49 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Tue, 09 Mar 2021 05:54:45 +0100
> 
>  -- Function: prog-first-column
>      Call this function instead of using a literal value (usually, zero)
>      of the column number for indenting top-level program constructs.
>      The function’s value is the column number to use for top-level
>      constructs.  When no superior mode is in effect, this function
>      returns zero.
> 
> What is a "superior mode" (and a "sub-mode", for that matter)?

That was supposed to be clear from the paragraph before the
description of prog-indentation-context, which explains the context
where these two come in handy.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09 12:49 ` Eli Zaretskii
@ 2021-03-09 21:19   ` Marcin Borkowski
  0 siblings, 0 replies; 10+ messages in thread
From: Marcin Borkowski @ 2021-03-09 21:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


On 2021-03-09, at 13:49, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Marcin Borkowski <mbork@mbork.pl>
>> Date: Tue, 09 Mar 2021 05:54:45 +0100
>> 
>>  -- Function: prog-first-column
>>      Call this function instead of using a literal value (usually, zero)
>>      of the column number for indenting top-level program constructs.
>>      The function’s value is the column number to use for top-level
>>      constructs.  When no superior mode is in effect, this function
>>      returns zero.
>> 
>> What is a "superior mode" (and a "sub-mode", for that matter)?
>
> That was supposed to be clear from the paragraph before the
> description of prog-indentation-context, which explains the context
> where these two come in handy.

Thanks, I missed that!  Now I feel stupid...

-- 
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09 11:54 ` Dmitry Gutov
@ 2021-03-09 21:20   ` Marcin Borkowski
  2021-03-09 21:37     ` Dmitry Gutov
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Marcin Borkowski @ 2021-03-09 21:20 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Help Gnu Emacs mailing list


On 2021-03-09, at 12:54, Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 09.03.2021 06:54, Marcin Borkowski wrote:
>> the Elisp reference says (in the "Mode-Specific Indent" node):
>>   -- Function: prog-first-column
>>       Call this function instead of using a literal value (usually, zero)
>>       of the column number for indenting top-level program constructs.
>>       The function’s value is the column number to use for top-level
>>       constructs.  When no superior mode is in effect, this function
>>       returns zero.
>> What is a "superior mode" (and a "sub-mode", for that matter)?
>
> It refers to a "multiple major modes" situation. Like Python embedded
> in HTML, that sort of thing. Or C inside Latex.

Yeah, I know now.  But: are "multiple modes" supported by core Emacs?

Best,

-- 
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09 21:20   ` Marcin Borkowski
@ 2021-03-09 21:37     ` Dmitry Gutov
  2021-03-09 21:49     ` Stefan Monnier
  2021-03-10  3:26     ` Eli Zaretskii
  2 siblings, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2021-03-09 21:37 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Help Gnu Emacs mailing list

On 09.03.2021 23:20, Marcin Borkowski wrote:
> On 2021-03-09, at 12:54, Dmitry Gutov<dgutov@yandex.ru>  wrote:
> 
>> On 09.03.2021 06:54, Marcin Borkowski wrote:
>>> the Elisp reference says (in the "Mode-Specific Indent" node):
>>>    -- Function: prog-first-column
>>>        Call this function instead of using a literal value (usually, zero)
>>>        of the column number for indenting top-level program constructs.
>>>        The function’s value is the column number to use for top-level
>>>        constructs.  When no superior mode is in effect, this function
>>>        returns zero.
>>> What is a "superior mode" (and a "sub-mode", for that matter)?
>> It refers to a "multiple major modes" situation. Like Python embedded
>> in HTML, that sort of thing. Or C inside Latex.
> Yeah, I know now.  But: are "multiple modes" supported by core Emacs?

Not really. But there is a modicum of support for them.

And mmm-mode is in GNU ELPA.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09 21:20   ` Marcin Borkowski
  2021-03-09 21:37     ` Dmitry Gutov
@ 2021-03-09 21:49     ` Stefan Monnier
  2021-03-10  7:07       ` Marcin Borkowski
  2021-03-10  3:26     ` Eli Zaretskii
  2 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2021-03-09 21:49 UTC (permalink / raw)
  To: help-gnu-emacs

> Yeah, I know now.  But: are "multiple modes" supported by core Emacs?

That presumes a yes/no answer, whereas the answer needs a lot more
nuance than that.


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09 21:20   ` Marcin Borkowski
  2021-03-09 21:37     ` Dmitry Gutov
  2021-03-09 21:49     ` Stefan Monnier
@ 2021-03-10  3:26     ` Eli Zaretskii
  2 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2021-03-10  3:26 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Tue, 09 Mar 2021 22:20:03 +0100
> Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
> 
> >>   -- Function: prog-first-column
> >>       Call this function instead of using a literal value (usually, zero)
> >>       of the column number for indenting top-level program constructs.
> >>       The function’s value is the column number to use for top-level
> >>       constructs.  When no superior mode is in effect, this function
> >>       returns zero.
> >> What is a "superior mode" (and a "sub-mode", for that matter)?
> >
> > It refers to a "multiple major modes" situation. Like Python embedded
> > in HTML, that sort of thing. Or C inside Latex.
> 
> Yeah, I know now.  But: are "multiple modes" supported by core Emacs?

Those facilities are some simple infrastructure in support of such
modes.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: What is a "superior mode"?
  2021-03-09 21:49     ` Stefan Monnier
@ 2021-03-10  7:07       ` Marcin Borkowski
  0 siblings, 0 replies; 10+ messages in thread
From: Marcin Borkowski @ 2021-03-10  7:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs


On 2021-03-09, at 22:49, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>> Yeah, I know now.  But: are "multiple modes" supported by core Emacs?
>
> That presumes a yes/no answer, whereas the answer needs a lot more
> nuance than that.

OK, I was just asking - I remember big discussion about that several
years ago, and I don't follow Emacs development much nowadays, so I was
just curious.

Thanks,

-- 
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-03-10  7:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-09  4:54 What is a "superior mode"? Marcin Borkowski
2021-03-09  7:19 ` Philip Kaludercic
2021-03-09 11:54 ` Dmitry Gutov
2021-03-09 21:20   ` Marcin Borkowski
2021-03-09 21:37     ` Dmitry Gutov
2021-03-09 21:49     ` Stefan Monnier
2021-03-10  7:07       ` Marcin Borkowski
2021-03-10  3:26     ` Eli Zaretskii
2021-03-09 12:49 ` Eli Zaretskii
2021-03-09 21:19   ` Marcin Borkowski

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).