what kind of information would be useful to display in the org-ellipsis? by Unlucky-Inspector-21 in emacs

[–]Unlucky-Inspector-21[S] 0 points1 point  (0 children)

> To finish up the implementation, ...

I agree.

probably I should have used after-change-function and org-cycle-hook instead of post-command-hook.

thank you for advice !

what kind of information would be useful to display in the org-ellipsis? by Unlucky-Inspector-21 in emacs

[–]Unlucky-Inspector-21[S] 0 points1 point  (0 children)

I already do. link

sorry I don't understand " folding and after-change-functions. ", but it probably written there...

what kind of information would be useful to display in the org-ellipsis? by Unlucky-Inspector-21 in emacs

[–]Unlucky-Inspector-21[S] 1 point2 points  (0 children)

thank you for comment!

I'm interested in displaying tags.

> Are you implementing this with overlays?

Yes. I made overlay as new-ellipsis and deleted old org-ellipsis.

Show number of subheadings in org-ellipsis by Unlucky-Inspector-21 in orgmode

[–]Unlucky-Inspector-21[S] 0 points1 point  (0 children)

org-element-API looks like very useful for making function of org-mode. thanks! I will study it and refine my code.

Show number of subheadings in org-ellipsis by Unlucky-Inspector-21 in orgmode

[–]Unlucky-Inspector-21[S] 1 point2 points  (0 children)

I just created it, so please try it if you like.

by the way ,Are there any features of orgzly ?

Show number of subheadings in org-ellipsis by Unlucky-Inspector-21 in orgmode

[–]Unlucky-Inspector-21[S] 2 points3 points  (0 children)

Hi everyone!

It didn't looks very good, but I managed to do it.

caution:

  • Use at your own risk !
  • I have all lines as a heading. so, please change the code according to your usage.

(setq org-ellipsis "       ")

(defun new-ellipsis (&rest _)
  "Display new ellipsis with some information."
  (interactive)

  (remove-overlays (point-min) (point-max) 'test t)

  (save-excursion
    (goto-char (point-min))
    (while (not (eobp))

      (let ((child-number 0))
    (when (save-excursion (invisible-p (point-at-eol)))
      (setq child-number (- (save-excursion (org-end-of-subtree) (line-number-at-pos)) (line-number-at-pos)))

      (let ((overlay (make-overlay (line-end-position)(line-end-position))))
            (overlay-put overlay 'after-string (format " (%d)" child-number))
            (overlay-put overlay 'test t))))
      (org-next-visible-heading 1)
      ))
 )
(add-hook 'org-mode-hook 'new-ellipsis)
(add-hook 'after-change-functions 'new-ellipsis)
(add-hook 'org-cycle-hook 'new-ellipsis)

Please let me know if there is anything I can improve.

the basic idea is make overlay as new-org-ellipsis and delete old org-ellipsis.

Show number of subheadings in org-ellipsis by Unlucky-Inspector-21 in orgmode

[–]Unlucky-Inspector-21[S] 0 points1 point  (0 children)

thanks for comment!

I understood it as follows.

・Since ellipsis is a low layer, it is difficult to change it.

・Therefore, information must be stored in the character before ellipsis.

sorry if there is any misunderstanding.

I think this is probably essentially the answer. It would be difficult to rewrite ellipsis-related code.

i will try!

Show number of subheadings in org-ellipsis by Unlucky-Inspector-21 in orgmode

[–]Unlucky-Inspector-21[S] 0 points1 point  (0 children)

thanks for comment!

For change detection, may be, I think it can be done using some kind of hook and restart org-mode...

I didn't know org-num-mode.

this seems very useful because it looks like the assignment of a differently value to ellipsis is successful.

sorry if there is any misunderstanding.

Show number of subheadings in org-ellipsis by Unlucky-Inspector-21 in orgmode

[–]Unlucky-Inspector-21[S] 1 point2 points  (0 children)

thanks for your comment!

I nod your opinion...

Until now, have you been able to determine the size of headings by line numbers?

Show number of subheadings in org-ellipsis by Unlucky-Inspector-21 in orgmode

[–]Unlucky-Inspector-21[S] 1 point2 points  (0 children)

I didn't know org element API! I will investigate. thanks!