emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-insert-todo-heading-respect-content and org-insert-todo-heading have different behaviors [9.6.1 ( @ /home/username/.chemacs/spacemacs/elpa/28.2/develop/org-9.6.1/)]
@ 2023-05-30 20:55 Xuan Wang
  2023-06-07 12:21 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Xuan Wang @ 2023-05-30 20:55 UTC (permalink / raw)
  To: emacs-orgmode

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

--text follows this line--

Problem: Now org-insert-todo-heading-respect-content does not respect the
TODO
state of current heading.

How to reproduce:
Example: define a todo sequence as followed:
"#+TODO: WAIT(w@/!) TODO(t) | DONE(d) CANCELED(c@)"

With the cursor at a heading with todo state as "TODO",
org-insert-todo-heading
will insert a heading with todo state "TODO", the same as the current
heading,
as stated as in the doc. "Insert a new heading with the same level and TODO
state as current heading."

However, org-insert-todo-heading-respect-content will insert a heading with
todo
state "WAIT", not "TODO".

Expected behavior: org-insert-todo-heading-respect-content shall act like
org-insert-todo-heading, insert "TODO" for the new heading if the current
heading is "TODO".

Reason: org-insert-todo-heading-respect-content's doc says "Insert TODO
heading
with ‘org-insert-heading-respect-content’ set to t.", so it shall be
expected
that the result should be the same as calling org-insert-todo-heading.

Another reason to justify this: like above, I defined the TODO sequence to
be
WAIT-TODO-DONE-CANCELED, so that I can easily switch between WAIT and TODO
using
S-left and S-right and a single S-right can change TODO to DONE. It is
desirable
that to manually write one TODO heading, then create all following TODO
headings
with org-insert-todo-heading-respect-content. However, with the current
version
of org-mode, org-insert-todo-heading-respect-content will insert WAIT
instead of
TODO.

Old version of org-mode doesn't have the problem. git-blame shows the
changes
was made in the following commit:

b4e41b98792f85a1c6d4c73141de49c78b0e5bf7
Author:     Ihor Radchenko <yantar92@gmail.com>
AuthorDate: Sat Aug 20 14:22:53 2022 +0800
Commit:     Ihor Radchenko <yantar92@gmail.com>
CommitDate: Sat Aug 20 14:24:47 2022 +0800

I removed a few variables from the variables lists below for privacy.
------------------------------------------------------------------------


Emacs  : GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.24.20, cairo version 1.16.0)
 of 2023-04-26
Package: Org mode version 9.6.1 ( @
/home/username/.chemacs/spacemacs/elpa/28.2/develop/org-9.6.1/)

current state:
==============
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-ref-cite-onclick-function #[257 "\300 \207"
[org-ref-citation-hydra/body] 2 "\n\n(fn _)"]
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-ref-insert-cite-function 'org-ref-insert-cite-link
 org-download-file-format-function 'org-download-file-format-default
 org-log-done 'time
 org-fontify-done-headline nil
 org-babel-after-execute-hook '(spacemacs/ob-fix-inline-images)
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-format-latex-options '(:foreground default :background default :scale
1.5 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0
:matchers
                            ("begin" "$1" "$" "$$" "\\(" "\\["))
 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-default-notes-file "/home/username/org/notes.org"
 org-export-async-init-file
"/home/username/.chemacs/spacemacs/layers/+emacs/org/local/org-async-init.el"
 org-download-method 'attach
 org-ref-bibtex-assoc-pdf-with-entry-move-function 'rename-file
 org-publish-timestamp-directory
"~/.chemacs/spacemacs/.cache/.org-timestamps/"
 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 " \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-habit ol-doi ol-w3m ol-bbdb ol-bibtex ol-docview ol-gnus
ol-info ol-irc ol-mhe ol-rmail ol-eww)
 org-image-actual-width nil
 org-mode-hook '(org-ref-org-menu org-indent-mode auto-fill-mode
org-ai-mode org-tempo-setup
                 #[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
                 #[0 "\301\211 \207" [imenu-create-index-function
org-imenu-get-tree] 2] flyspell-mode spacemacs/org-setup-evil-surround
spacemacs/load-yasnippet toc-org-enable
                 org-superstar-mode (lambda nil (require 'org-ref))
org-download-enable dotspacemacs//prettify-spacemacs-docs
spacemacs//org-babel-do-load-languages
                 spacemacs//evil-org-mode org-eldoc-load
spacemacs//init-company-org-mode company-mode)
 org-babel-load-languages '((shell . t) (js . t) (python . t) (emacs-lisp .
t))
 org-ref-insert-link-function 'org-ref-insert-link
 org-id-locations-file "~/.chemacs/spacemacs/.cache/.org-id-locations"
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-download-timestamp ""
 org-download-abbreviate-filename-function 'file-relative-name
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-present-mode-hook '(spacemacs//org-present-start)
 org-projectile-per-project-filepath "TODOs.org"
 org-present-mode-quit-hook '(spacemacs//org-present-end)
 org-download-annotate-function 'org-download-annotate-default
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-ai-on-project-mode-hook '(#[0 "\301\300!\210\302\211 \207"
[show-trailing-whitespace make-local-variable nil] 2])
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-link-translation-function 'toc-org-unhrefify
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el")
("elisp" . "el"))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-ref-clean-bibtex-entry-hook '(org-ref-bibtex-format-url-if-doi
orcb-key-comma org-ref-replace-nonascii orcb-& orcb-%
org-ref-title-case-article orcb-clean-year orcb-key
                                   orcb-clean-doi orcb-clean-pages
orcb-check-journal org-ref-sort-bibtex-entry orcb-fix-spacing
orcb-download-pdf)
 org-ref-insert-ref-function 'org-ref-insert-ref-link
 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-clock-persist-file "~/.chemacs/spacemacs/.cache/org-clock-save.el"
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-prefer-user-labels t
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-fold-core-isearch-open-function 'org-fold--isearch-reveal
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-ref-clean-bibtex-key-function '(lambda (key) (replace-regexp-in-string
":" "" key))
 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-capture-mode-hook '(spacemacs//org-capture-start)
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-html-format-headline-function
'org-html-format-headline-default-function
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-agenda-restore-windows-after-quit t
 org-ref-insert-label-function 'org-ref-insert-label-link
 org-startup-with-inline-images t
 org-imenu-depth 8
 org-download-link-format-function
'org-download-link-format-function-default
 org-tab-before-tab-emulation-hook '(org-tempo-complete-tag)
 org-reverse-note-order t
 org-attach-store-link-p t
 )

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

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

* Re: [BUG] org-insert-todo-heading-respect-content and org-insert-todo-heading have different behaviors [9.6.1 ( @ /home/username/.chemacs/spacemacs/elpa/28.2/develop/org-9.6.1/)]
  2023-05-30 20:55 [BUG] org-insert-todo-heading-respect-content and org-insert-todo-heading have different behaviors [9.6.1 ( @ /home/username/.chemacs/spacemacs/elpa/28.2/develop/org-9.6.1/)] Xuan Wang
@ 2023-06-07 12:21 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2023-06-07 12:21 UTC (permalink / raw)
  To: Xuan Wang; +Cc: emacs-orgmode

Xuan Wang <xuan.public@gmail.com> writes:

> --text follows this line--
>
> Problem: Now org-insert-todo-heading-respect-content does not respect the
> TODO
> state of current heading.
>
> How to reproduce:
> Example: define a todo sequence as followed:
> "#+TODO: WAIT(w@/!) TODO(t) | DONE(d) CANCELED(c@)"
> ...

Thanks for reporting and for the detailed analysis!
Fixed, on main. Now, we just pass the prefix args directly to
`org-insert-todo-heading'.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ba8c46863

-- 
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] 2+ messages in thread

end of thread, other threads:[~2023-06-07 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 20:55 [BUG] org-insert-todo-heading-respect-content and org-insert-todo-heading have different behaviors [9.6.1 ( @ /home/username/.chemacs/spacemacs/elpa/28.2/develop/org-9.6.1/)] Xuan Wang
2023-06-07 12:21 ` Ihor Radchenko

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