all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [BUG] Improve error message "org-back-to-heading: Before first headline at position 1" [9.6.8 (release_9.6.8-3-g21171d @/usr/local/share/emacs/29.1.50/lisp/org/)]
@ 2024-03-21  9:52 c.buhtz
  2024-03-21 10:02 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: c.buhtz @ 2024-03-21  9:52 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

using the first time this Emacs in build bug report thing. But have to 
send the mail via copy & paste because the bug reporter didn't work out 
of the box.
The "From" field is not valid. Modified it manually in the buffer. But 
didn't work.
Emacs tried to use STARTTLS with posteo.de:25 which is wrong I think. 
Should be port 587 but don't know how to set this.

OK, now the real problem:

This is not a support question about how to solve a problem or the error
message I do report here. It is a request to improve that error message
to help users understand the real problem and find a solution by their
own.

I get the this error message in context when using the Org attachments
feature (C-c C-a plus c).

     "org-back-to-heading: Before first headline at position 1 in 
buffer..."

I have no idea about the brackground here. And I also not a regular user
of orgs attachment feature. So I can not provide a better error
message. This will be up to you. Thank you.

Kind
Christian Buhtz

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



Emacs  : GNU Emacs 29.1.50 (build 1, aarch64-unknown-linux-gnu)
  of 2023-09-14
Package: Org mode version 9.6.8 (release_9.6.8-3-g21171d @ 
/usr/local/share/emacs/29.1.50/lisp/org/)

current state:
==============
(setq
  org-link-elisp-confirm-function 'yes-or-no-p
  org-roam-db-gc-threshold 314572800
  org-hide-emphasis-markers t
  org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 
"\n\n(fn ENTRY)"]
  org-download-file-format-function 'org-download-file-format-default
  org-roam-node-display-template #("${title:*} ${tags:20}" 11 21 (face 
org-tag))
  org-persist-after-read-hook '(org-element--cache-persist-after-read)
  org-export-before-parsing-hook '(org-attach-expand-links)
  org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
  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-archive-hook '(org-attach-archive-delete-maybe)
  org-edit-src-content-indentation 0
  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-mode-hook '(#[0 "\301\211\207" [imenu-create-index-function
  org-imenu-get-tree] 2]
                  buhtzology/org-mode-visual-fill org-bullets-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
  buhtzology/org-mode-setup
                  (closure (t) nil (display-line-numbers-mode 0)))
  org-roam-ref-annotation-function 'org-roam-ref-read--annotation
  org-roam-directory "~/.my.org-roam"
  org-ellipsis "↓"
  org-roam-db-node-include-function #[0 "\300\207" [t] 1]
  org-download-abbreviate-filename-function 'file-relative-name
  org-confirm-shell-link-function 'yes-or-no-p
  org-download-annotate-function 'org-download-annotate-default
  outline-isearch-open-invisible-function 'outline-isearch-open-invisible
  org-roam-capture-preface-hook '(org-roam-capture--try-capture-to-ref-h)
  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-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-log-buffer-setup-hook '(org-roam-log--setup)
  org-roam-capture-new-node-hook 
'(org-roam-capture--insert-captured-ref-h)
  org-structure-template-alist '(("rc" . "src rconsole") ("r" . "src R") 
("pc"
  . "src PyCon")
                                 ("p" . "src Python") ("a" . "export 
ascii")
  ("c" . "center")
                                 ("C" . "comment") ("e" . "example") ("E"
  . "export")
                                 ("h" . "export html") ("l" . "export 
latex")
  ("q" . "quote")
                                 ("s" . "src") ("v" . "verse"))
  org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
  org-bullets-bullet-list '("■" "○" "●" "○" "●" "○" "●")
  org-fold-core-isearch-open-function 'org-fold--isearch-reveal
  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-roam-completion-everywhere t
  org-agenda-loop-over-headlines-in-active-region nil
  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 '(("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)
                        ("roam" :follow org-roam-link-follow-link)
                        ("attachment" :follow org-attach-follow :complete
                         org-attach-complete-link)
                        ("id" :follow org-roam-id-open) ("file+sys")
  ("file+emacs")
                        ("shell" :follow org-link--open-shell)
                        ("news" :follow
                         #[514 "\301\300\302Q\"\207" ["news" browse-url 
":"]
  6
                           "\n\n(fn URL ARG)"]
                         )
                        ("mailto" :follow
                         #[514 "\301\300\302Q\"\207" ["mailto" browse-url
  ":"] 6
                           "\n\n(fn URL ARG)"]
                         )
                        ("https" :follow
                         #[514 "\301\300\302Q\"\207" ["https" browse-url
  ":"] 6
                           "\n\n(fn URL ARG)"]
                         )
                        ("http" :follow
                         #[514 "\301\300\302Q\"\207" ["http" browse-url 
":"]
  6
                           "\n\n(fn URL ARG)"]
                         )
                        ("ftp" :follow
                         #[514 "\301\300\302Q\"\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-roam-capture-templates '(("d" "default" plain "%?" :if-new
                                (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                 "#+title: ${title}\n#+date: [%<%Y-%m-%d
  %H:%M>]")
                                :unnarrowed t)
                               ("b" "Bibliographic notes" plain
                                "\n* Source\n- Author :: %^{Author}\n- 
Title ::
  ${title}\n- Year :: %^{Year}\n- doi :: 
[[https://doi.org/%^{DOI}][%\\3]]\n\n*
  Summary\n%?"
                                :if-new
                                (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                 "#+title: ${title}\n#+date: [%<%Y-%m-%d
  %H:%M>]\n#+filetags: Bib")
                                :unnarrowed t)
                               ("p" "project" plain
                                "* Goals\n\n%?\n\n* Tasks\n\n** TODO Add 
initial
  tasks\n\n* Dates\n\n"
                                :if-new
                                (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                 "#+title: ${title}\n#+date: [%<%Y-%m-%d
  %H:%M>]\n#+filetags: Project")
                                :unnarrowed t)
                               ("w" "Wiki" plain "%?" :if-new
                                (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                 "#+title: ${title}\n#+date: [%<%Y-%m-%d
  %H:%M>]\n#+filetags: Wiki")
                                :unnarrowed t)
                               ("m" "Meta" plain "* 
${title}\nSammelbecken zum
  Thema\n%?"
                                :if-new
                                (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                 "#+title: ${title}\n#+date: [%<%Y-%m-%d
  %H:%M>]\n#+filetags: Meta")
                                :unnarrowed t)
                               )
  org-metaup-hook '(org-babel-load-in-session-maybe)
  org-download-link-format-function 
'org-download-link-format-function-default
  org-download-image-dir "./attachments/images"
  org-roam-indirect-buffer-hook 
'(org-roam--register-completion-functions-h)
  )



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

* Re: [BUG] Improve error message "org-back-to-heading: Before first headline at position 1" [9.6.8 (release_9.6.8-3-g21171d @/usr/local/share/emacs/29.1.50/lisp/org/)]
  2024-03-21  9:52 [BUG] Improve error message "org-back-to-heading: Before first headline at position 1" [9.6.8 (release_9.6.8-3-g21171d @/usr/local/share/emacs/29.1.50/lisp/org/)] c.buhtz
@ 2024-03-21 10:02 ` Ihor Radchenko
  2024-03-21 10:42   ` c.buhtz
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2024-03-21 10:02 UTC (permalink / raw)
  To: c.buhtz; +Cc: emacs-orgmode

c.buhtz@posteo.jp writes:

> This is not a support question about how to solve a problem or the error
> message I do report here. It is a request to improve that error message
> to help users understand the real problem and find a solution by their
> own.
>
> I get the this error message in context when using the Org attachments
> feature (C-c C-a plus c).
>
>      "org-back-to-heading: Before first headline at position 1 in 
> buffer..."

I believe that this problem have been fixed on main.
If not, please provide more details on how to trigger the error.

> using the first time this Emacs in build bug report thing. But have to 
> send the mail via copy & paste because the bug reporter didn't work out 
> of the box.
> The "From" field is not valid. Modified it manually in the buffer. But 
> didn't work.
> Emacs tried to use STARTTLS with posteo.de:25 which is wrong I think. 
> Should be port 587 but don't know how to set this.

Something is off in your email settings (in emacs or in system mailer).

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] Improve error message "org-back-to-heading: Before first headline at position 1" [9.6.8 (release_9.6.8-3-g21171d @/usr/local/share/emacs/29.1.50/lisp/org/)]
  2024-03-21 10:02 ` Ihor Radchenko
@ 2024-03-21 10:42   ` c.buhtz
  2024-03-21 10:46     ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: c.buhtz @ 2024-03-21 10:42 UTC (permalink / raw)
  To: emacs-orgmode

Dear Ihor,
thanks for reply.

Am 21.03.2024 11:02 schrieb Ihor Radchenko:
>>      "org-back-to-heading: Before first headline at position 1 in
>> buffer..."
> 
> I believe that this problem have been fixed on main.

Do you mean the message was improved or the message do not appear 
anymore? Can you link please to the sources file where I can see the 
message. Let's see if I understand it. :D

> If not, please provide more details on how to trigger the error.

That is the simple example:

     :PROPERTIES:
     :ID:       a7f2b708-d2f9-41d5-a263-d82540b10b23
     :END:
     #+title: test2
     #+date: [2024-03-10 16:42]
     Paragraph

After writing my first message I learned that there need to be a heading 
that files are attached, too. I don't understand why. So I assume the 
reason for the error message was that there is no heading in that org 
file?
But I would strongly disagree. An org file has a heading by definition 
even if it is empty. The heading string (#+title) might not exist and is 
empty but there is always an ":ID:". To my very(!) limited knowledge I 
would treat this behavior also as a bug. But there might be a good 
reason for this behavior.

> Something is off in your email settings (in emacs or in system mailer).

I use Thunderbird. There are no other email settings. Never used Emacs 
with mails. I always wonder why debian-bugreport is able to send mails. 
:D
But copy & paste is good workaround in the first please.

Kind
Christian


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

* Re: [BUG] Improve error message "org-back-to-heading: Before first headline at position 1" [9.6.8 (release_9.6.8-3-g21171d @/usr/local/share/emacs/29.1.50/lisp/org/)]
  2024-03-21 10:42   ` c.buhtz
@ 2024-03-21 10:46     ` Ihor Radchenko
       [not found]       ` <6307229c8522ce6903c1afeeaf3eb5a5@posteo.de>
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2024-03-21 10:46 UTC (permalink / raw)
  To: c.buhtz; +Cc: emacs-orgmode

c.buhtz@posteo.jp writes:

>> I believe that this problem have been fixed on main.
>
> Do you mean the message was improved or the message do not appear 
> anymore? Can you link please to the sources file where I can see the 
> message. Let's see if I understand it. :D

The error message should not appear anymore when you try to attach a
file before first heading.

>> If not, please provide more details on how to trigger the error.
>
> That is the simple example:
>
>      :PROPERTIES:
>      :ID:       a7f2b708-d2f9-41d5-a263-d82540b10b23
>      :END:
>      #+title: test2
>      #+date: [2024-03-10 16:42]
>      Paragraph
>
> After writing my first message I learned that there need to be a heading 
> that files are attached, too. I don't understand why. So I assume the 
> reason for the error message was that there is no heading in that org 
> file?

Are you saying that the above example will trigger an error on the
latest main when you try to attach a file?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] Improve error message "org-back-to-heading: Before first headline at position 1" [9.6.8 (release_9.6.8-3-g21171d @/usr/local/share/emacs/29.1.50/lisp/org/)]
       [not found]       ` <6307229c8522ce6903c1afeeaf3eb5a5@posteo.de>
@ 2024-03-21 16:31         ` Ihor Radchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2024-03-21 16:31 UTC (permalink / raw)
  To: c.buhtz; +Cc: emacs-orgmode

[ Adding Org mailing list back to CC ]

c.buhtz@posteo.jp writes:

> Am 21.03.2024 11:46 schrieb Ihor Radchenko:
>> Are you saying that the above example will trigger an error on the
>> latest main when you try to attach a file?
>
> No, only the version (29.something) I reported this bug.
>
> "latest main" is to unstable for me.

Ok.
Since I cannot reproduce the problem on the latest main, but can on
bugfix, I am canceling this bug as it is fixed on main.
Canceled.

> Is there a stable version with this bug fixed?

No. It is only fixed on main.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2024-03-21 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-21  9:52 [BUG] Improve error message "org-back-to-heading: Before first headline at position 1" [9.6.8 (release_9.6.8-3-g21171d @/usr/local/share/emacs/29.1.50/lisp/org/)] c.buhtz
2024-03-21 10:02 ` Ihor Radchenko
2024-03-21 10:42   ` c.buhtz
2024-03-21 10:46     ` Ihor Radchenko
     [not found]       ` <6307229c8522ce6903c1afeeaf3eb5a5@posteo.de>
2024-03-21 16:31         ` Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.