emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Display-level automatic subtree numbering
@ 2018-10-23 18:29 Garreau, Alexandre
  2018-10-23 18:33 ` John Kitchin
  0 siblings, 1 reply; 13+ messages in thread
From: Garreau, Alexandre @ 2018-10-23 18:29 UTC (permalink / raw)
  To: org-mode

Hi,

This is provided on (almost?) all export formats, but yet when looking
at an org-file the prefered way, with emacs, there’s no numbering, by
default.

It’s so useful and simple (using a display text/overlay property), is
there just anything implementing that? mainline? if so why isn’t it?

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

* Re: Display-level automatic subtree numbering
  2018-10-23 18:29 Display-level automatic subtree numbering Garreau, Alexandre
@ 2018-10-23 18:33 ` John Kitchin
  2018-10-23 19:58   ` Garreau, Alexandre
  0 siblings, 1 reply; 13+ messages in thread
From: John Kitchin @ 2018-10-23 18:33 UTC (permalink / raw)
  To: galex-713; +Cc: org-mode-email

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

There are some answers at
https://emacs.stackexchange.com/questions/32396/complete-path-numbering-of-org-mode-headlines-and-plain-lists
.

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, Oct 23, 2018 at 2:30 PM Garreau, Alexandre <galex-713@galex-713.eu>
wrote:

> Hi,
>
> This is provided on (almost?) all export formats, but yet when looking
> at an org-file the prefered way, with emacs, there’s no numbering, by
> default.
>
> It’s so useful and simple (using a display text/overlay property), is
> there just anything implementing that? mainline? if so why isn’t it?
>
>

[-- Attachment #2: Type: text/html, Size: 1456 bytes --]

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

* Re: Display-level automatic subtree numbering
  2018-10-23 18:33 ` John Kitchin
@ 2018-10-23 19:58   ` Garreau, Alexandre
  2018-10-24  7:38     ` Nicolas Goaziou
  0 siblings, 1 reply; 13+ messages in thread
From: Garreau, Alexandre @ 2018-10-23 19:58 UTC (permalink / raw)
  To: John Kitchin; +Cc: org-mode-email

On 2018-10-23 at 14:33, John Kitchin wrote:
> There are some answers at
> https://emacs.stackexchange.com/questions/32396/complete-path-numbering-of-org-mode-headlines-and-plain-lists

Interesting.  Thank you (I’m unfortunately not very friend with search
engines): that also raises altogether the question of tables of contents.

But that doesn’t answer the question: why “doesn’t it exist”? shouldn’t
these functions be mainlined, if legally permitted?

Btw, since I read overlays create slowness proportional to their
numbers, and that’s surely a lot of overlays, wouldn’t it be better
using text properties?  these support `display' as well, and, I checked,
even for strings of different length: is there a particular reasons they
wouldn’t work as well?

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

* Re: Display-level automatic subtree numbering
  2018-10-23 19:58   ` Garreau, Alexandre
@ 2018-10-24  7:38     ` Nicolas Goaziou
  2018-10-24  8:54       ` Garreau, Alexandre
  0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Goaziou @ 2018-10-24  7:38 UTC (permalink / raw)
  To: Garreau, Alexandre; +Cc: org-mode-email, John Kitchin

Hello,

"Garreau, Alexandre" <galex-713@galex-713.eu> writes:

> But that doesn’t answer the question: why “doesn’t it exist”? shouldn’t
> these functions be mainlined, if legally permitted?

What kind of numbering are we talking about? A semi-permanent (i.e.,
togglable) naive numbering (e.g., not taking into account UNNUMBERED
property) for every headline?

Could you explain what are the use cases for that?

Regards,

-- 
Nicolas Goaziou

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

* Re: Display-level automatic subtree numbering
  2018-10-24  7:38     ` Nicolas Goaziou
@ 2018-10-24  8:54       ` Garreau, Alexandre
  2018-10-24 11:40         ` Nicolas Goaziou
  0 siblings, 1 reply; 13+ messages in thread
From: Garreau, Alexandre @ 2018-10-24  8:54 UTC (permalink / raw)
  To: John Kitchin; +Cc: org-mode-email

Le 24/10/2018 à 09h38, Nicolas Goaziou a écrit :
> Hello,
>
> "Garreau, Alexandre" <galex-713@galex-713.eu> writes:
>
>> But that doesn’t answer the question: why “doesn’t it exist”? shouldn’t
>> these functions be mainlined, if legally permitted?
>
> What kind of numbering are we talking about? A semi-permanent (i.e.,
> togglable) naive numbering (e.g., not taking into account UNNUMBERED
> property) for every headline?

Yes.  Didn’t know about UNNUMBERED, thanks, it is of interest for this issue.

> Could you explain what are the use cases for that?

As said in the previously mentioned stackoverflow question: helps
seeing where you are and how much sections are there.  To me it is
especially useful to avoid writing manually the number of the section to
know I’m currently in “exercice 8” or something alike.

Btw, some desirable feature as well would be automatic naming (as I
already do sometimes in LaTeX), such as appending whole “Exercice 8” or
“Section 8” for a desired specific level, instead of just a number.

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

* Re: Display-level automatic subtree numbering
  2018-10-24  8:54       ` Garreau, Alexandre
@ 2018-10-24 11:40         ` Nicolas Goaziou
  2018-10-24 11:49           ` Garreau, Alexandre
  0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Goaziou @ 2018-10-24 11:40 UTC (permalink / raw)
  To: Garreau, Alexandre; +Cc: org-mode-email, John Kitchin

"Garreau, Alexandre" <galex-713@galex-713.eu> writes:

> As said in the previously mentioned stackoverflow question: helps
> seeing where you are and how much sections are there.  To me it is
> especially useful to avoid writing manually the number of the section to
> know I’m currently in “exercice 8” or something alike.

But you don't need to number the whole buffer, do you? A breadcrumb like
feature could be enough. E.g., you hit <SPC> at the beginning of
a headline and get the numbering in addition to the outline path.

> Btw, some desirable feature as well would be automatic naming (as I
> already do sometimes in LaTeX), such as appending whole “Exercice 8” or
> “Section 8” for a desired specific level, instead of just a number.

I don't understand what you mean.

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

* Re: Display-level automatic subtree numbering
  2018-10-24 11:40         ` Nicolas Goaziou
@ 2018-10-24 11:49           ` Garreau, Alexandre
  2018-10-25 15:02             ` Nicolas Goaziou
  0 siblings, 1 reply; 13+ messages in thread
From: Garreau, Alexandre @ 2018-10-24 11:49 UTC (permalink / raw)
  To: John Kitchin; +Cc: org-mode-email

Le 24/10/2018 à 13h40, Nicolas Goaziou a écrit :
> "Garreau, Alexandre" <galex-713@galex-713.eu> writes:
>
>> As said in the previously mentioned stackoverflow question: helps
>> seeing where you are and how much sections are there.  To me it is
>> especially useful to avoid writing manually the number of the section to
>> know I’m currently in “exercice 8” or something alike.
>
> But you don't need to number the whole buffer, do you?

At least the screen.

> A breadcrumb like feature could be enough. E.g., you hit <SPC> at the
> beginning of a headline and get the numbering in addition to the
> outline path.

I’d prefer.  I find sad that all export backend supports this while raw
emacs doesn’t.  It is neat to see, and to, just by looking at the
screen, which section has which number.

>> Btw, some desirable feature as well would be automatic naming (as I
>> already do sometimes in LaTeX), such as appending whole “Exercice 8” or
>> “Section 8” for a desired specific level, instead of just a number.
>
> I don't understand what you mean.

Getting displayed, given “* Foo”, instead of “* 3.2 — Foo”, “* Exercice
3.2 — Foo” (with this naming configurable).

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

* Re: Display-level automatic subtree numbering
  2018-10-24 11:49           ` Garreau, Alexandre
@ 2018-10-25 15:02             ` Nicolas Goaziou
  2018-10-27 22:36               ` Garreau, Alexandre
  0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Goaziou @ 2018-10-25 15:02 UTC (permalink / raw)
  To: Garreau, Alexandre; +Cc: org-mode-email, John Kitchin

Hello,

"Garreau, Alexandre" <galex-713@galex-713.eu> writes:

> Le 24/10/2018 à 13h40, Nicolas Goaziou a écrit :
>> But you don't need to number the whole buffer, do you?
>
> At least the screen.
>
>> A breadcrumb like feature could be enough. E.g., you hit <SPC> at the
>> beginning of a headline and get the numbering in addition to the
>> outline path.
>
> I’d prefer.  I find sad that all export backend supports this while raw
> emacs doesn’t.

Output from export back-ends is static. A currently-edited Org document
isn't.

> It is neat to see, and to, just by looking at the
> screen, which section has which number.

You may be interested in "org-outline-numbering" package, then. It seems
to implement what you want.

HTH,

-- 
Nicolas Goaziou

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

* Re: Display-level automatic subtree numbering
  2018-10-25 15:02             ` Nicolas Goaziou
@ 2018-10-27 22:36               ` Garreau, Alexandre
  2018-11-01 17:49                 ` Nicolas Goaziou
  0 siblings, 1 reply; 13+ messages in thread
From: Garreau, Alexandre @ 2018-10-27 22:36 UTC (permalink / raw)
  To: John Kitchin; +Cc: org-mode-email

On 2018/10/25 at 17:02, Nicolas Goaziou wrote:
> "Garreau, Alexandre" <galex-713@galex-713.eu> writes:
>> Le 24/10/2018 à 13h40, Nicolas Goaziou a écrit :
>>> But you don't need to number the whole buffer, do you?
>>
>> At least the screen.
>>
>>> A breadcrumb like feature could be enough. E.g., you hit <SPC> at the
>>> beginning of a headline and get the numbering in addition to the
>>> outline path.
>>
>> I’d prefer.  I find sad that all export backend supports this while raw
>> emacs doesn’t.
>
> Output from export back-ends is static. A currently-edited Org document
> isn't.

That’s why it’d require special font-lock-like and lazy update
facilities : when you insert (or move) a node, you need to update the
same-level following nodes (or exchange numbering with the near node).

>> It is neat to see, and to, just by looking at the
>> screen, which section has which number.
>
> You may be interested in "org-outline-numbering" package, then. It seems
> to implement what you want.

No it doesn’t update anything, and doesn’t color number compatibly with
outlining.  Also it’s not integrated in org and only available in melpa,
unsigned.

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

* Re: Display-level automatic subtree numbering
  2018-10-27 22:36               ` Garreau, Alexandre
@ 2018-11-01 17:49                 ` Nicolas Goaziou
  2018-11-02  6:51                   ` Eric S Fraga
  2018-11-04  5:09                   ` Amin Bandali
  0 siblings, 2 replies; 13+ messages in thread
From: Nicolas Goaziou @ 2018-11-01 17:49 UTC (permalink / raw)
  To: Garreau, Alexandre; +Cc: org-mode-email, John Kitchin

[-- Attachment #1: Type: text/plain, Size: 733 bytes --]

Hello,

"Garreau, Alexandre" <galex-713@galex-713.eu> writes:

> No it doesn’t update anything, and doesn’t color number compatibly with
> outlining.  Also it’s not integrated in org and only available in melpa,
> unsigned.

As I was offline for a few days, I toyed a bit with this. I wrote the
following library. I didn't test it thoroughly. I didn't write
regression tests either.

Also, it ignores UNNUMBERED property and export tags. I have the feeling
these are orthogonal requirements (i.e., if you want to see the
numbering obtained upon export, just export your document).

You may want to test it. It could go in GNU ELPA or some such if fast
and accurate enough.

Regards,

-- 
Nicolas Goaziou

[-- Attachment #2: Dynamic headline numbering in Org --]
[-- Type: application/emacs-lisp, Size: 11256 bytes --]

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

* Re: Display-level automatic subtree numbering
  2018-11-01 17:49                 ` Nicolas Goaziou
@ 2018-11-02  6:51                   ` Eric S Fraga
  2018-11-02  7:12                     ` Marco Wahl
  2018-11-04  5:09                   ` Amin Bandali
  1 sibling, 1 reply; 13+ messages in thread
From: Eric S Fraga @ 2018-11-02  6:51 UTC (permalink / raw)
  To: Garreau, Alexandre; +Cc: org-mode-email, John Kitchin

On Thursday,  1 Nov 2018 at 18:49, Nicolas Goaziou wrote:
> As I was offline for a few days, I toyed a bit with this. I wrote the
> following library. I didn't test it thoroughly. I didn't write
> regression tests either.

Although I probably won't use this often, I have tried it out and it
seems to work very well.  I've only tried a couple of articles where
numbering makes some sense.  Looks good too.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4

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

* Re: Display-level automatic subtree numbering
  2018-11-02  6:51                   ` Eric S Fraga
@ 2018-11-02  7:12                     ` Marco Wahl
  0 siblings, 0 replies; 13+ messages in thread
From: Marco Wahl @ 2018-11-02  7:12 UTC (permalink / raw)
  To: emacs-orgmode


    NICOLAS> As I was offline for a few days, I toyed a bit with this. I
    NICOLAS> wrote the following library. I didn't test it thoroughly. I
    NICOLAS> didn't write regression tests either.

    ERIC> Although I probably won't use this often, I have tried it out
    ERIC> and it seems to work very well.  I've only tried a couple of
    ERIC> articles where numbering makes some sense.  Looks good too.

+1 for releasing the org-num.el lib.


Ciao,  Marco

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

* Re: Display-level automatic subtree numbering
  2018-11-01 17:49                 ` Nicolas Goaziou
  2018-11-02  6:51                   ` Eric S Fraga
@ 2018-11-04  5:09                   ` Amin Bandali
  1 sibling, 0 replies; 13+ messages in thread
From: Amin Bandali @ 2018-11-04  5:09 UTC (permalink / raw)
  To: Nicolas Goaziou, Garreau, Alexandre; +Cc: org-mode-email, John Kitchin

Hello,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> As I was offline for a few days, I toyed a bit with this. I wrote the
> following library.

Awesome, thanks for your work!

> I didn't test it thoroughly. I didn't write regression tests
> either.
>
> Also, it ignores UNNUMBERED property and export tags. I have the feeling
> these are orthogonal requirements (i.e., if you want to see the
> numbering obtained upon export, just export your document).
>

I really wish it did support UNNUMBERED (and perhaps COMMENT and
:ARCHIVED: too) though :(

> You may want to test it. It could go in GNU ELPA or some such if fast
> and accurate enough.

I took it for a spin on a few org files of moderate size (a few
thousand lines) and it seems to work pretty well.  I didn’t
extensively test or look for corner cases though.

Would love to see it on GNU ELPA.

Best,
amin

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

end of thread, other threads:[~2018-11-04  5:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-23 18:29 Display-level automatic subtree numbering Garreau, Alexandre
2018-10-23 18:33 ` John Kitchin
2018-10-23 19:58   ` Garreau, Alexandre
2018-10-24  7:38     ` Nicolas Goaziou
2018-10-24  8:54       ` Garreau, Alexandre
2018-10-24 11:40         ` Nicolas Goaziou
2018-10-24 11:49           ` Garreau, Alexandre
2018-10-25 15:02             ` Nicolas Goaziou
2018-10-27 22:36               ` Garreau, Alexandre
2018-11-01 17:49                 ` Nicolas Goaziou
2018-11-02  6:51                   ` Eric S Fraga
2018-11-02  7:12                     ` Marco Wahl
2018-11-04  5:09                   ` Amin Bandali

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).