List of list items in org mode

I am trying to improve my org-fu, and one of my tasks is updating list items. I usually prefer to use list items for various reasons (mainly without clogging up my CONTENT view and having a real plan, given the number of tasks I have).

But, alas, when I try to update the list item created using the capture system, I get an error message - I am not allowed to do this because it "does not make sense".

Is there any way to undo this behavior?

Edit: ATM. I only manage to restore the entries (i.e. Headings) and then convert them manually to list items. I guess there is a better solution than this ...

I found this function in org-capture.el:

(defun org-capture-refile () "Finalize the current capture and then refile the entry. Refiling is done from the base buffer, because the indirect buffer is then already gone. Any prefix argument will be passed to the refile command." (interactive) (unless (eq (org-capture-get :type 'local) 'entry) (error "Refiling from a capture buffer makes only sense for `entry'-type templates")) (let ((pos (point)) (base (buffer-base-buffer (current-buffer))) (org-refile-for-capture t)) (org-capture-finalize) (save-window-excursion (with-current-buffer (or base (current-buffer)) (save-excursion (save-restriction (widen) (goto-char pos) (call-interactively 'org-refile))))))) 

How can I remove the part (unless (eq (org-capture-get :type 'local) 'entry) so that it can take effect?

Edit: 10/23/12

So far I have managed to get this to work:

 (defun narrow-and-reveal () "Narrow and reveal all content" (org-narrow-to-subtree) (org-show-subtree) ) (defun widen-and-outline () "Widen and move to beginning of file" (widen) (beginning-of-buffer) (org-overview) (org-content) ) (defun org-goto-symbol () "Will navigate to the symbol at the current point of the cursor" (widen-and-outline) (interactive) (let ((current-prefix-arg 4)) ;; emulate Cu (call-interactively 'org-refile)) ;; invoke org-refile interactively (narrow-and-reveal) ) (defun custom-org-prompt-headline () (org-goto-symbol) ;; invoke org-refile interactively (end-of-buffer)) (setq org-capture-templates`( ("t" "ToDo" item (file+function (concat org-directory "ToDo.org") custom-org-prompt-headline)))) 

But it asks for a section in the file before entering the list item, which I find distracting. I just would like to be able to update list items. I can’t imagine that it should be so hard to achieve ... is it?

+4
source share
2 answers

Indeed, there is a better way: why don't you use capture patterns ?

Basically, you just need to determine the patterns you need, say:

 (setq org-capture-templates '(("t" "something" item (file+olp "~/path/to/you/file.org" "Header" "Subheader") "- %?\n %i") ("n" "notes" checkitem (file+olp "~/somewhere/notes.org" "Notes") "- [ ] %?\n"))) 

And then, during use, call (Mx) org-capture (bound to Cc c , if you follow the standard settings ) enter a note in the template list already , Cc Cc , and you're done!

All details are given in manual ( syntax of settings , automatically expanding elements ...)

+1
source

After digging through the mailing list archives, the best solution I have found so far for this is the org-refile-active-region-within-subtree . It allows the refile to move arbitrary regions of the text, but it can also convert that text to a heading (using org-toggle-heading ) before it moves it.

So, at least the text is moving, but its probably not 100% what you want (its no longer a list). This is probably a good starting point, although you need to look for an even better solution. Perhaps running org-toggle-heading after moving the text.

Here is the built-in documentation:

Non-nil also means updating the active area inside the subtree.

By default, `org-refile 'does not allow updating regions if they do not contain a set of subtrees, but this can be conveniently done sometimes: in this case, the first line of the region is converted to a header before reconfiguration.

And I found it in this thread - http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00535.html

+1
source

Source: https://habr.com/ru/post/1439931/


All Articles