emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Off-by-one when archiving to top level date [9.3.6 (9.3.6-17-g389288-elpa @ /home/charlestam/.emacs.d/elpa/org-20200224/)]
@ 2020-02-27 23:31 Charles Tam
  2020-09-09  9:43 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Tam @ 2020-02-27 23:31 UTC (permalink / raw)
  To: emacs-orgmode

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

I am archiving subtrees of my main Orgmode document to a top-level
datetree in a secondary file. When I do so, I expect something like
the following:

* 2020
*** 2020-02 February  (org-odd-levels-only t)
***** 2020-02-27 Thursday
******* Archived Item

But instead I get

* 2020
*** 2020-02 February
***** 2020-02-27 Thursday
***** Archived Item

The archived item ends up as a sibling of the targeted date, instead of
a child. This seems incorrect.

Thanks,
Charles

Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.2), modified by Debian
Package: Org mode version 9.3.6 (9.3.6-17-g389288-elpa @
/home/charlestam/.emacs.d/elpa/org-20200224/)

current state:
==============
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-special-ctrl-a/e t
 org-agenda-files '("~/mise/TODO")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-reveal-start-hook '(org-decrypt-entry)
 org-modules '(org-w3m org-bbdb org-bibtex org-docview org-gnus org-info
org-irc org-mhe org-rmail
               org-eww)
 org-link-doi-server-url "http://dx.doi.org/"
 org-archive-location "%s_archive::datetree/"
 org-mode-hook '((closure
                  (org--rds reftex-docstruct-symbol org-with-time
org-defdecode org-def
                   org-read-date-inactive org-ans2 org-ans1
org-columns-current-fmt-compiled
                   org-end-time-was-given org-time-was-given
org-blocked-by-checkboxes org-state
                   org-agenda-headline-snapshot-before-repeat
org-capture-last-stored-marker
                   org-struct-menu org-last-state org-id-track-globally
texmathp-why
                   remember-data-file iswitchb-temp-buflist
calc-embedded-open-mode
                   calc-embedded-open-formula calc-embedded-close-formula
align-mode-rules-list
                   org-export-registered-backends
org-indent-indentation-per-level
                   org-inlinetask-min-level t)
                  nil
                  (add-hook (quote change-major-mode-hook) (quote
org-show-all) (quote append)
                   (quote local))
                  )
                 (closure (*this* org-babel-confirm-evaluate-answer-no t)
nil
                  (add-hook (quote change-major-mode-hook) (quote
org-babel-show-result-all)
                   (quote append) (quote local))
                  )
                 (closure (t) nil (setq imenu-create-index-function (quote
org-imenu-get-tree)))
                 (lambda nil (auto-fill-mode t) (local-set-key (kbd "M-[")
(quote org-metaleft))
                  (local-set-key (kbd "M-]") (quote org-metaright))
                  (local-set-key (kbd "M-{") (quote org-shiftmetaleft))
                  (local-set-key (kbd "M-}") (quote org-shiftmetaright))
                  (local-set-key (kbd "<backtab>") (quote org-shifttab))
                  (local-unset-key (kbd "C-c C-j")) (local-unset-key (kbd
"C-,")))
                 turn-on-font-lock
                 (lambda nil
                  (font-lock-add-keywords nil (quote (("{{{.+}}}" 0 (quote
org-macro-face))))))
                 #[0 "\301\211 \207" [imenu-create-index-function
org-imenu-get-tree] 2]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-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-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-latex-format-drawer-function '(closure (t) (_ contents) contents)
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-hide-leading-stars t
 org-babel-load-languages '((python . t))
 org-clock-clocktable-default-properties '(:maxlevel 2 :scope file)
 org-log-done 'time
 org-hide-emphasis-markers t
 org-export-backends '(ascii html latex md)
 org-ascii-format-drawer-function '(closure (t) (_name contents _width)
contents)
 org-use-fast-todo-selection t
 org-occur-hook '(org-first-headline-recenter)
 org-agenda-start-with-log-mode t
 org-odd-levels-only t
 org-structure-template-alist '(("n" "#+NAME: ?") ("p" "#+BEGIN_SRC
python?\n#+END_SRC")
                                ("a" . "export ascii") ("c" . "center")
("C" . "comment")
                                ("e" . "example") ("E" . "export") ("h" .
"export html")
                                ("l" . "export latex") ("q" . "quote") ("s"
. "src") ("v" . "verse"))
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-tags-column -100
 org-preview-latex-process-alist '((dvipng :programs ("latex" "dvipng")
:description "dvi > png"
                                    :message "you need to install the
programs: latex and dvipng."
                                    :image-input-type "dvi"
:image-output-type "png"
                                    :image-size-adjust (1.0 . 1.0)
:latex-compiler
                                    ("latex -interaction nonstopmode
-output-directory %o %f")
                                    :image-converter
                                    ("dvipng -fg %F -bg %B -D %D -T tight
-o %O %f"))
                                   (dvisvgm :programs ("latex" "dvisvgm")
:description "dvi > svg"
                                    :message "you need to install the
programs: latex and dvisvgm."
                                    :use-xcolor t :image-input-type "dvi"
:image-output-type "svg"
                                    :image-size-adjust (1.7 . 1.5)
:latex-compiler
                                    ("latex -interaction nonstopmode
-output-directory %o %f")
                                    :image-converter ("dvisvgm %f -n -b min
-c %S -o %O"))
                                   (imagemagick :programs ("latex"
"convert") :description
                                    "pdf > png" :message
                                    "you need to install the programs:
latex and imagemagick."
                                    :use-xcolor t :image-input-type "pdf"
:image-output-type "png"
                                    :image-size-adjust (1.0 . 1.0)
:latex-compiler
                                    ("pdflatex -interaction nonstopmode
-output-directory %o %f")
                                    :image-converter
                                    ("convert -density %D -trim -antialias
%f -quality 100 %O"))
                                   )
 org-table-number-regexp
"^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|[<>]?[-+]?0[xX][0-9a-fA-F.]+\\|[<>]?[-+]?[0-9]+#[0-9a-zA-Z.]+\\|nan\\|[-+u]?inf\\)$"
 org-agenda-start-with-clockreport-mode t
 org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el")
("elisp" . "el"))
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-open-link :export
org-attach-export-link
                        :complete org-attach-complete-link)
                       ("id" :follow org-id-open) ("eww" :follow eww :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)
                       ("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) ("file+sys")
("file+emacs")
                       ("doi" :follow org-link--open-doi) ("elisp" :follow
org-link--open-elisp)
                       ("file" :complete org-link-complete-file)
                       ("ftp" :follow
                        #[257 "\301\300\302 Q!\207" ["ftp" browse-url ":"]
5 "\n\n(fn URL)"])
                       ("help" :follow org-link--open-help)
                       ("http" :follow
                        #[257 "\301\300\302 Q!\207" ["http" browse-url ":"]
5 "\n\n(fn URL)"])
                       ("https" :follow
                        #[257 "\301\300\302 Q!\207" ["https" browse-url
":"] 5 "\n\n(fn URL)"])
                       ("mailto" :follow
                        #[257 "\301\300\302 Q!\207" ["mailto" browse-url
":"] 5 "\n\n(fn URL)"])
                       ("news" :follow
                        #[257 "\301\300\302 Q!\207" ["news" browse-url ":"]
5 "\n\n(fn URL)"])
                       ("shell" :follow org-link--open-shell))
 org-agenda-skip-scheduled-if-done t
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-link-email-description-format "Email %c: %.30s"
 org-capture-templates '(("t" "Task" entry (file+headline "~/mise/TODO"
"File Me")
                          "*** UNINIT'D %^{Summary}\n    /Captured %U/\n
 %?\n")
                         ("s" "Snippet" plain (file+olp+datetree
"~/mise/TODO" "Snippets")
                          "        * %?" :empty-lines-after 1 :tree-type
week)
                         ("j" "Journal" plain (file+olp+datetree
"~/mise/NOTES") "      %?"
                          :empty-lines-after 2)
                         ("n" "Note" plain (file+headline "~/mise/NOTES"
"Notes")
                          "  * %<%Y-%m-%d> -- %?" :empty-lines-after 1
:prepend t)
                         )
 org-link-elisp-confirm-function 'yes-or-no-p
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-html-format-drawer-function '(closure
                                   (htmlize-buffer-places
org-html-format-table-no-css
                                    htmlize-css-name-prefix
htmlize-output-type htmlize-output-type
                                    htmlize-css-name-prefix t)
                                   (_name contents) contents)
 org-clocktable-defaults '(:maxlevel 2 :lang "en" :scope file :block nil
:wstart 1 :mstart 1 :tstart
                           nil :tend nil :step nil :stepskip0 nil
:fileskip0 nil :tags nil :match
                           nil :emphasize nil :link nil :narrow 40! :indent
t :formula nil
                           :timestamp nil :level nil :tcolumns nil
:formatter nil)
 org-html-format-headline-function
'org-html-format-headline-default-function
 org-confirm-babel-evaluate nil
 org-agenda-skip-deadline-if-done t
 )

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

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

* Re: Bug: Off-by-one when archiving to top level date [9.3.6 (9.3.6-17-g389288-elpa @ /home/charlestam/.emacs.d/elpa/org-20200224/)]
  2020-02-27 23:31 Bug: Off-by-one when archiving to top level date [9.3.6 (9.3.6-17-g389288-elpa @ /home/charlestam/.emacs.d/elpa/org-20200224/)] Charles Tam
@ 2020-09-09  9:43 ` Bastien
  2020-11-10  8:20   ` Charles Tam
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2020-09-09  9:43 UTC (permalink / raw)
  To: Charles Tam; +Cc: emacs-orgmode

Hi Charles,

sorry for the late feedback.

Charles Tam <me@charlest.net> writes:

> I am archiving subtrees of my main Orgmode document to a top-level
> datetree in a secondary file. When I do so, I expect something like
> the following:
>
> * 2020
> *** 2020-02 February  (org-odd-levels-only t)
> ***** 2020-02-27 Thursday
> ******* Archived Item
>
> But instead I get
>
> * 2020
> *** 2020-02 February
> ***** 2020-02-27 Thursday
> ***** Archived Item
>
> The archived item ends up as a sibling of the targeted date, instead
> of a child. This seems incorrect.

What command or keybinding do you use when archiving?

Can you provide a minimal step-by-step recipe to reproduce this bug
with emacs -q ?

Thanks,

-- 
 Bastien


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

* Re: Bug: Off-by-one when archiving to top level date [9.3.6 (9.3.6-17-g389288-elpa @ /home/charlestam/.emacs.d/elpa/org-20200224/)]
  2020-09-09  9:43 ` Bastien
@ 2020-11-10  8:20   ` Charles Tam
  2020-11-12  6:07     ` Kyle Meyer
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Tam @ 2020-11-10  8:20 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

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

Wow it's been a while. Sorry I dropped this!

To reproduce the bug, open the following content in `emacs -q` and run
org-archive-subtree on the TEST ITEM:

#+COMMENT: Local Variables:
#+COMMENT: mode: org
#+COMMENT: org-archive-location: "::datetree/"
#+COMMENT: org-odd-levels-only: t
#+COMMENT: End:

* TEST ITEM

You can check that the indentation of the TEST ITEM is more correct if you
set org-odd-levels-only to nil. More weirdness also happens if you set
org-archive-location to "::datetree/* Archive Header" (while
org-odd-levels-only is t).

Charles

On Wed, Sep 9, 2020 at 5:44 AM Bastien <bzg@gnu.org> wrote:

> Hi Charles,
>
> sorry for the late feedback.
>
> Charles Tam <me@charlest.net> writes:
>
> > I am archiving subtrees of my main Orgmode document to a top-level
> > datetree in a secondary file. When I do so, I expect something like
> > the following:
> >
> > * 2020
> > *** 2020-02 February  (org-odd-levels-only t)
> > ***** 2020-02-27 Thursday
> > ******* Archived Item
> >
> > But instead I get
> >
> > * 2020
> > *** 2020-02 February
> > ***** 2020-02-27 Thursday
> > ***** Archived Item
> >
> > The archived item ends up as a sibling of the targeted date, instead
> > of a child. This seems incorrect.
>
> What command or keybinding do you use when archiving?
>
> Can you provide a minimal step-by-step recipe to reproduce this bug
> with emacs -q ?
>
> Thanks,
>
> --
>  Bastien
>

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

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

* Re: Bug: Off-by-one when archiving to top level date [9.3.6 (9.3.6-17-g389288-elpa @ /home/charlestam/.emacs.d/elpa/org-20200224/)]
  2020-11-10  8:20   ` Charles Tam
@ 2020-11-12  6:07     ` Kyle Meyer
  0 siblings, 0 replies; 4+ messages in thread
From: Kyle Meyer @ 2020-11-12  6:07 UTC (permalink / raw)
  To: Charles Tam; +Cc: Bastien, emacs-orgmode

Charles Tam writes:

> Wow it's been a while. Sorry I dropped this!
>
> To reproduce the bug, open the following content in `emacs -q` and run
> org-archive-subtree on the TEST ITEM:
>
> #+COMMENT: Local Variables:
> #+COMMENT: mode: org
> #+COMMENT: org-archive-location: "::datetree/"
> #+COMMENT: org-odd-levels-only: t
> #+COMMENT: End:
>
> * TEST ITEM
>
> You can check that the indentation of the TEST ITEM is more correct if you
> set org-odd-levels-only to nil. More weirdness also happens if you set
> org-archive-location to "::datetree/* Archive Header" (while
> org-odd-levels-only is t).

Thanks for the reproducer.  Should be fixed with 262777294.


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

end of thread, other threads:[~2020-11-12  6:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 23:31 Bug: Off-by-one when archiving to top level date [9.3.6 (9.3.6-17-g389288-elpa @ /home/charlestam/.emacs.d/elpa/org-20200224/)] Charles Tam
2020-09-09  9:43 ` Bastien
2020-11-10  8:20   ` Charles Tam
2020-11-12  6:07     ` Kyle Meyer

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