chciałem też sposób na org-refile
łatwo ponownie składać do poddrzewa, więc napisałem jakiś kod i uogólnić go tak, że będzie ustawić dowolny cel natychmiastowe wszędzie (nie tylko w tym samym pliku).
Podstawowe użycie jest przenieść gdzieś w Tree B
i wpisz Cc Cx Cm oznaczyć cel dla ponownego dołączania, a następnie przenieść się do wejścia w Tree A
że chcesz ponownie składać i wpisz Cc Cw który natychmiast ponownie składać do lokalizacja docelowa ustawiona w Tree B
bez pytania, chyba że wywołałeś org-refile-immediate-target
z prefiksem arg Cu Cc Cx Cm.
Zauważ, że po naciśnięciu Cc Cw w krótkim odstępie czasu, aby ponownie składać wiele wpisów będzie zachować kolejność zgłoszeń nawet jeśli org-reverse-note-order
jest ustawiony na t
, ale można ją wyłączyć respektować ustawienia org-reverse-note-order
z podwójny przedrostek arg Cu Cu Cc Cx Cm.
(defvar org-refile-immediate nil
"Refile immediately using `org-refile-immediate-target' instead of prompting.")
(make-local-variable 'org-refile-immediate)
(defvar org-refile-immediate-preserve-order t
"If last command was also `org-refile' then preserve ordering.")
(make-local-variable 'org-refile-immediate-preserve-order)
(defvar org-refile-immediate-target nil)
"Value uses the same format as an item in `org-refile-targets'."
(make-local-variable 'org-refile-immediate-target)
(defadvice org-refile (around org-immediate activate)
(if (not org-refile-immediate)
ad-do-it
;; if last command was `org-refile' then preserve ordering
(let ((org-reverse-note-order
(if (and org-refile-immediate-preserve-order
(eq last-command 'org-refile)) nil org-reverse-note-order)))
(ad-set-arg 2 (assoc org-refile-immediate-target (org-refile-get-targets)))
(prog1 ad-do-it
(setq this-command 'org-refile)))))
(defadvice org-refile-cache-clear (after org-refile-history-clear activate)
(setq org-refile-targets (default-value 'org-refile-targets))
(setq org-refile-immediate nil)
(setq org-refile-immediate-target nil)
(setq org-refile-history nil))
;;;###autoload
(defun org-refile-immediate-target (&optional arg)
"Set current entry as `org-refile' target.
Non-nil turns off `org-refile-immediate', otherwise `org-refile'
will immediately refile without prompting for target using most
recent entry in `org-refile-targets' that matches
`org-refile-immediate-target' as the default."
(interactive "P")
(if (equal arg '(16))
(progn
(setq org-refile-immediate-preserve-order
(not org-refile-immediate-preserve-order))
(message "Order preserving is turned: %s"
(if org-refile-immediate-preserve-order
"on" "off")))
(setq org-refile-immediate (unless arg t))
(make-local-variable 'org-refile-targets)
(let* ((components (org-heading-components))
(level (first components))
(heading (nth 4 components))
(string (substring-no-properties heading)))
(add-to-list 'org-refile-targets
(append (list (buffer-file-name))
(cons :regexp
(format "^%s %s$"
(make-string level ?*)
string))))
(setq org-refile-immediate-target heading))))
(define-key org-mode-map "\C-c\C-x\C-m" 'org-refile-immediate-target)
Trudno było znaleźć klucz, który był wolny od Cc Cx prefiksu, więc użyłem m z mnemoników i * mm * ediate
Aby ponownie składać sub drzewa do pracy (C-C, C-W) wcięcia muszą wcięcie przez 2. np *** SubtreeA1. Ustawiłem wcięcia tak jak twoje i nie mogłem go uruchomić, dopóki się nie zorientowałem. – 79E09796
[To] (http://stackoverflow.com/questions/22200312/refile-from-one- file- to-other) pytanie może być pomocne. Możesz (tymczasowo) dodać bieżący plik do 'org-refile-targets' z ustawieniem': maxlevel' of> = 2 przy każdym ponownym uzupełnianiu. Jednak moje lisp-fu nie jest jeszcze wystarczająco silne, aby ci w tym pomóc. – Alex