emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Konovalov <aragaer@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] org-cycle-show-empty-lines doesn't show empty lines at end of file [9.7.19 (9.7.19-5a4686 @ /home/aragaer/.config/emacs/elpa/org-9.7.19/)]
Date: Wed, 22 Jan 2025 12:13:28 +0300	[thread overview]
Message-ID: <87ed0vmcsn.fsf@gmail.com> (raw)


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

The `org-cycle-show-empty-lines` has a comment saying that it should
never hide empty lines at the end of the file. In practice it does hide
those empty lines. It seems that the issue is that
`outline-end-of-heading` only goes to the end of heading and the
following `looking-at "[ \t\n]+"` doesn't match.

A possible solution is to replace the final expression after the comment with following:

  (save-excursion
    (goto-char (point-max))
    (while (and (not (bobp)) (member (char-before) '(?\s ?\n ?\t)))
      (backward-char))
    (when (and (looking-at "[ \t\n]+")
               (= (match-end 0) (point-max)))
      (org-fold-region (point) (match-end 0) nil 'outline)))


Emacs  : GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, X toolkit)
 of 2024-11-18
Package: Org mode version 9.7.19 (9.7.19-5a4686 @ /home/aragaer/.config/emacs/elpa/org-9.7.19/)

current state:
==============
(setq
 org-agenda-prefix-format '((agenda .
                             " %i %-12(aragaer/agenda-category) %?-12t% s")
                            (todo . " %i %-12(aragaer/agenda-category) ")
                            (tags . " %i %-12(aragaer/agenda-category) ")
                            (search . " %i %-12(aragaer/agenda-category) "))
 org-archive-location "archive/%s::"
 org-brain-visualize-sort-function 'org-brain-title<
 org-link-elisp-confirm-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-checklist)
 org-roam-db-gc-threshold 2305843009213693951
 org-bibtex-headline-format-function 'org-bibtex-headline-format-default
 org-export-with-sub-superscripts nil
 org-capture-bookmark nil
 org-brain-path "~/Dropbox/org/brain"
 org-agenda-tags-todo-honor-ignore-options t
 org-agenda-custom-commands '(("d" "Undated tasks" alltodo ""
                               ((org-agenda-todo-ignore-with-date t)
                                (org-agenda-files
                                 (seq-remove
                                  (lambda (file) (cl-search "mylife" file))
                                  (org-agenda-files nil 'ifmode))
                                 )
                                )
                               )
                              ("j" "Unreviewed journal" tags-todo "+@journal"
                               ((org-agenda-sorting-strategy
                                 '((agenda category-up)))
                                )
                               )
                              ("t" . "Tree")
                              ("tn" "Next" occur-tree "TODO.*:next:")
                              ("tw" "Waiting" occur-tree "TODO.*:waiting:")
                              ("ts" "Someday" occur-tree "TODO.*:someday:")
                              ("o" "Overview"
                               ((tags-todo "next"
                                 ((org-agenda-overriding-header "Next")
                                  (org-agenda-todo-ignore-scheduled 'future))
                                 )
                                (tags-todo "calendar"
                                 ((org-agenda-overriding-header "Calendar")
                                  (org-agenda-entry-types '(:scheduled))
                                  (org-agenda-todo-ignore-scheduled 'future))
                                 )
                                (tags-todo "tickler"
                                 ((org-agenda-overriding-header "Tickler")
                                  (org-agenda-todo-ignore-scheduled 'future))
                                 )
                                (agenda))
                               )
                              ("w" "Waiting" tags-todo "+waiting"
                               ((org-agenda-todo-ignore-scheduled 'future)))
                              ("s" "Someday" tags-todo "+someday")
                              ("F" "Non-future" tags ""
                               ((org-agenda-todo-ignore-scheduled 'future)))
                              ("n" "Next" tags-todo "+next"
                               ((org-agenda-todo-ignore-scheduled 'future)
                                (org-agenda-dim-blocked-tasks 'invisible))
                               )
                              ("N" "Next including blocked" tags-todo "+next"
                               ((org-agenda-todo-ignore-scheduled 'future)))
                              )
 org-log-into-drawer "LOGBOOK"
 org-agenda-files "~/.config/emacs/agenda.list"
 org-publish-project-alist '(("finances" :base-directory "~/Dropbox/finances"
                              :publishing-directory "~/Dropbox/Documents/finances"
                              :publishing-function org-html-publish-to-html
                              :section-numbers nil :with-toc t)
                             ("finance-images" :base-directory
                              "~/Dropbox/finances" :base-extension "png\\|jpg"
                              :publishing-directory "~/Dropbox/Documents/finances"
                              :publishing-function org-publish-attachment)
                             )
 org-capture-templates '(("h" "Add Hledger entry" plain
                          (file
                           (lambda nil
                            (concat *hledger-dir*
                             (format-time-string "%Y/%m.journal" (current-time)))
                            )
                           )
                          "%<%Y-%m-%d> %^{entry title}\n %?" :empty-lines 1
                          :unnarrowed t)
                         ("r" "Read later")
                         ("rw" "Web page" entry (file "~/Dropbox/org/review.org")
                          "* READ [[%x][%?]]\nSCHEDULED:%^t")
                         ("t" "todo")
                         ("ts" "simple" entry (file "~/Dropbox/org/inbox.org")
                          "* TODO %?")
                         ("tt" "timed" entry
                          (file "~/Dropbox/org/tickler.org.gpg")
                          "* TODO %?\nSCHEDULED:%^t")
                         )
 org-roam-node-display-template #("${type:15}${title:*} ${tags:20}" 0 10 (face org-tag) 21 31 (face org-tag))
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-refile-targets '((nil :maxlevel . 3) (org-agenda-files :maxlevel . 3))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-latex-compiler "xelatex"
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
                            org-babel-header-arg-expand)
 org-tag-alist '((:startgrouptag) ("@work") (:grouptags) ("@sibedge") ("@asylum")
                 (:endgrouptag) (:startgrouptag) ("@sibedge") (:grouptags)
                 ("@aura") (:endgrouptag) (:startgrouptag) ("@aura") (:grouptags)
                 ("@hydra") ("@klhydra") ("@wrt") (:endgrouptag) (:startgrouptag)
                 ("@asylum") (:grouptags) ("@owniverse") (:endgrouptag))
 org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-h
                           org-roam--register-completion-functions-h
                           org-roam--replace-roam-links-on-save-h
                           org-roam-db-autosync--setup-update-on-save-h)
 org-refile-use-outline-path 'file
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 "%1\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
                  org-cycle-optimize-window-after-visibility-change
                  org-cycle-display-inline-images)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-modules '(org-checklist org-habit ol-doi ol-w3m ol-bbdb ol-bibtex ol-docview
               ol-gnus ol-info ol-irc ol-mhe ol-rmail ol-eww)
 org-yank-image-file-name-function 'org-yank-image-autogen-filename
 org-link-from-user-regexp "\\<aragaer@stronghold\\>"
 org-image-actual-width '(500)
 org-mode-hook '(#[0 "\301\211%10\207"
                   [imenu-create-index-function org-imenu-get-tree] 2]
                 visual-line-mode
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-fold-show-all append local]
                   5]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-babel-show-result-all
                    append local]
                   5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-babel-load-languages '((shell . t) (python . t) (haskell . t))
 org-agenda-todo-list-sublevels nil
 org-roam-ref-annotation-function 'org-roam-ref-read--annotation
 org-roam-directory "/home/aragaer/Dropbox/org/roam/"
 org-agenda-time-grid '((daily today require-timed) nil "......"
                        "----------------")
 org-agenda-span 1
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-agenda-cmp-user-defined 'aragaer/org-cmp-time-and-date
 org-roam-db-node-include-function #[0 "\300\207" [t] 1]
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-checklist-export-function 'org-export-as-ascii
 org-habit-graph-column 80
 org-startup-indented t
 org-brain-title-max-length 40
 org-sort-function 'string-collate-lessp
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-roam-capture-preface-hook '(org-roam-dailies--override-capture-time-h
                                 org-roam-capture--try-capture-to-ref-h)
 org-extend-today-until 3
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-capture-prepare-finalize-hook '(org-roam-capture--install-finalize-h)
 org-roam-preview-function 'org-roam-preview-default-function
 org-babel-tangle-lang-exts '(("haskell" . "hs") ("python" . "py")
                              ("emacs-lisp" . "el") ("elisp" . "el"))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
                     org-src-mode-configure-edit-buffer)
 org-roam-db-autosync-mode t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-window-setup 'current-window
 org-tags-exclude-from-inheritance '("project" "next" "agenda" "here" "ATTACH")
 org-log-buffer-setup-hook '(org-roam-log--setup)
 org-fold-show-context-detail '((default . canonical))
 org-hide-leading-stars t
 org-todo-keywords '((sequence "TODO" "|" "DONE") (sequence "|" "CANCELLED"))
 org--warnings nil
 org-roam-capture-new-node-hook '(org-roam-capture--insert-captured-ref-h)
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-speed-command-hook '(org-speed-command-activate
                          org-babel-speed-command-activate)
 org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-roam-buffer-frames 'visible
 org-enforce-todo-dependencies t
 org-confirm-babel-evaluate nil
 org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
 org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
                      org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-todo-keyword-faces '(("CANCELLED" :foreground "blue" :weight bold))
 org-brain-default-file-parent "unsorted"
 org-roam-mode-sections '((aragaer--roam-section :tags-include
                           ("#slipbox" "MOC" "#hub") :section-heading "Hubs")
                          (aragaer--roam-section :tags-exclude
                           ("#slipbox" "MOC" "#hub" "#trail" "#workspace"
                            "#archived")
                           :section-heading "Backlinks")
                          org-roam-reflinks-section
                          (aragaer--roam-section :tags-include ("#trail")
                           :section-heading "Trails")
                          (aragaer--roam-section :tags-include ("#workspace")
                           :section-heading "Workspaces")
                          (aragaer--roam-section :tags-include ("#archived")
                           :section-heading "Archived workspaces")
                          )
 org-occur-hook '(org-first-headline-recenter)
 org-roam-log-setup-hook '(org-roam--register-completion-functions-h)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-roam-node-annotation-function 'org-roam-node-read--annotation
 org-link-parameters '(("brainswitch" :complete org-brain--switch-link-complete
                        :follow org-brain--switch-link-follow)
                       ("brain-friend" :complete
                        #[0 "\301\b!\207"
                          [org-brain-friend-link-name org-brain-link-complete] 2]
                        :follow org-brain-goto)
                       ("brain-parent" :complete
                        #[0 "\301\b!\207"
                          [org-brain-parent-link-name org-brain-link-complete] 2]
                        :follow org-brain-goto)
                       ("brain-child" :complete
                        #[0 "\301\b!\207"
                          [org-brain-child-link-name org-brain-link-complete] 2]
                        :follow org-brain-goto)
                       ("brain" :complete org-brain-link-complete :follow
                        org-brain-goto :store org-brain-link-store)
                       ("mu4e" :follow mu4e-org-open :store mu4e-org-store-link)
                       ("roam" :follow org-roam-link-follow-link)
                       ("attachment" :follow org-attach-follow :complete
                        org-attach-complete-link)
                       ("eww" :follow org-eww-open :store org-eww-store-link)
                       ("rmail" :follow org-rmail-open :store org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
                       ("irc" :follow org-irc-visit :store org-irc-store-link
                        :export org-irc-export)
                       ("info" :follow org-info-open :export org-info-export
                        :store org-info-store-link :insert-description
                        org-info-description-as-command)
                       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
                       ("docview" :follow org-docview-open :export
                        org-docview-export :store org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store
                        org-bibtex-store-link)
                       ("bbdb" :follow org-bbdb-open :export org-bbdb-export
                        :complete org-bbdb-complete-link :store
                        org-bbdb-store-link)
                       ("w3m" :store org-w3m-store-link)
                       ("doi" :follow org-link-doi-open :export
                        org-link-doi-export)
                       ("id" :follow org-id-open :store org-id-store-link-maybe)
                       ("elfeed" :follow elfeed-link-open :store
                        elfeed-link-store-link)
                       ("file+sys") ("file+emacs")
                       ("shell" :follow org-link--open-shell)
                       ("news" :follow
                        #[514 "\301\300\302%4Q%2\"\207" ["news" browse-url ":"] 6
                          "\n\n(fn URL ARG)"]
                        )
                       ("mailto" :follow
                        #[514 "\301\300\302%4Q%2\"\207" ["mailto" browse-url ":"]
                          6 "\n\n(fn URL ARG)"]
                        )
                       ("https" :follow
                        #[514 "\301\300\302%4Q%2\"\207" ["https" browse-url ":"] 6
                          "\n\n(fn URL ARG)"]
                        )
                       ("http" :follow
                        #[514 "\301\300\302%4Q%2\"\207" ["http" browse-url ":"] 6
                          "\n\n(fn URL ARG)"]
                        )
                       ("ftp" :follow
                        #[514 "\301\300\302%4Q%2\"\207" ["ftp" browse-url ":"] 6
                          "\n\n(fn URL ARG)"]
                        )
                       ("help" :follow org-link--open-help :store
                        org-link--store-help)
                       ("file" :complete org-link-complete-file)
                       ("elisp" :follow org-link--open-elisp))
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-roam-capture-templates '(("d" "default" entry "* ${title}\n%?" :target
                               (node "unsorted slipbox") :prepare-finalize
                               (lambda nil (beginning-of-buffer)
                                (org-id-get-create))
                               )
                              )
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-blank-before-new-entry '((heading) (plain-list-item))
 org-return-follows-link t
 org-outline-path-complete-in-steps nil
 org-agenda-sort-notime-is-late nil
 org-agenda-current-time-string "now - - - - - - - - - - - - - - - - - - - - - - - - -"
 org-agenda-block-separator 61
 org-roam-indirect-buffer-hook '(org-roam--register-completion-functions-h)
 )


                 reply	other threads:[~2025-01-22  9:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ed0vmcsn.fsf@gmail.com \
    --to=aragaer@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).