Open utterances-bot opened 4 years ago
Have you tried using (setq org-refile-allow-creating-parent-nodes 'confirm)? I'd like to be able to create my subheadings on the spot, but I haven't been able to make this happen. Have been searching online for hours. Let me know if you use this features. Thanks!
@Gahamelas
Yes, I'm using this feature and sometimes I'd create a new heading as a refile target:
What input did you use when trying to create a new heading?
I can't see very well what's going on because it's a bit fast on the GIF. Do you use HELM? With Helmmoving up and down among completions doesn't place the value in the minibuffer, so typing "/NEWHEADING" passes the complete path "/NEWHEADING" which isn't a valid location. Do you need to write the whole path of the new heading (file.org/heading/newheading)?
Very very nice. The org-search command is by itself a gem, so simple and so effective. I'm always surprised by the number of common sense commands that don't exist in vanilla emacs or vanilla org.
@Gahamelas I had same question as you and found the solution is in helm manual. Just use C-c C-y and the current selected item will be yanked into the input buffer. That's easiest way I have found so far.
Just found C-l (low level L) also works for this purpose.
@wangwb98 Regarding your answers:
C-c C-y runs the command org-evaluate-time-range (found in org-mode-map), which is an interactive Lisp closure
in ‘org-9.3.6/org.el’.
C-l runs the command recenter-top-bottom (found in global-map), which is an interactive compiled Lisp function
in ‘window.el’.
So I don't know which underlying commands you have mapped to these key bindings.
@wangwb98 Regarding your answers:
C-c C-y runs the command org-evaluate-time-range (found in org-mode-map), which is an interactive Lisp closure in ‘org-9.3.6/org.el’. C-l runs the command recenter-top-bottom (found in global-map), which is an interactive compiled Lisp function in ‘window.el’.
So I don't know which underlying commands you have mapped to these key bindings.
First, invoke the org-refile command when your cursor is in the org file . Spacemacs by default bind it to SPC m s r. Then the "Helm Org Refile" shows up, you can move up&down to find the item you want to refile to, and directly press C-c C-y. Remember this is a key combinding in helm, not in org mode.
I really like this workflow. I would like to tweak it slightly so as to have a separate search function (in addition to +org/opened-buffer-files
) that lets me search for headings within the active buffer only (rather than all open org buffers). Presumably these two search functions should set org-refile-targets
differently, one to ((+org/opened-buffer-files :maxlevel . 9))
and the other to whatever value restricts queries to headings in the active buffer, but I don't know how to define these functions (I'm new to Emacs). Any help would be appreciated.
Further to my previous comment, I found a package that allows me to run search queries both in the current buffer and in all open buffers or agenda files, and that it does so without any delays in fetching headings and without requiring periodic cache regeneration: helm-org-ql. You may want to check it out—the speed is amazing.
Further to my previous comment, I found a package that allows me to run search queries both in the current buffer and in all open buffers or agenda files, and that it does so without any delays in fetching headings and without requiring periodic cache regeneration: helm-org-ql. You may want to check it out—the speed is amazing.
I tried using helm-org-ql
but get no results. Do you call it interactively?
This is due to a bug with dash.el, which was fixed yesterday. Please update the dash.el package and try again. I can confirm that it works fine since the fix (whereas before I was also getting no results).
Still same thing. I call the function, type a keyword, and nothing happens.
Mmh, not sure then. Perhaps the fix didn't fully resolve the issue, though it may be unrelated.
Hi @benthamite,
glad to know that you've found helm-org-ql
!
I don't use helm
but I do use org-ql
for its agenda-like view.
It's so fast and I can't wait for it to support ivy
.
I also use counsel-imenu
(you may try helm-imenu
or imenu
) for navigating within current org buffer.
Hope it's helpful for you.
Thanks! What would be the difference between counsel-imenu
and helm-swoop
?
I don't use helm but I do use
org-ql
for its agenda-like view.
Thanks, this aspect of org-ql
looks very promising indeed.
Silly newbie question: is it possible to add (besides opened-buffer-files) all files in particular folder to org-refile-targets? For instance something like "~/orgfiles/*.org"
@andrej1919 coincidence, I just did that, based on the code on this post and another one that added the org-agenda-files to the refile targets (IIRC a Stack Exchange answer).
(setf org-agenda-files '("/path/to-all/myorgfiles"))
(setf org-refile-targets
'((nil :maxlevel . 3)
(org-agenda-files :maxlevel . 3)))
EDIT: see https://stackoverflow.com/questions/22200312/refile-from-one-file-to-other
@andrej1919 Here is my current org-refile-targets
config:
(defun +org/opened-buffer-files ()
"Return the list of files currently opened in emacs"
(delq nil
(mapcar (lambda (x)
(if (and (buffer-file-name x)
(string-match "\\.org$"
(buffer-file-name x)))
(buffer-file-name x)))
(buffer-list))))
(setq org-refile-targets `((+org/opened-buffer-files :maxlevel . 9)
(,(file-expand-wildcards "~/Org/Archived/*.org_archive") :maxlevel . 1)))
So for your demand, I think this would work
(setq org-refile-targets `((,(file-expand-wildcards "~/orgfiles/*.org") :maxlevel . 1))
Great! Thank you very much!
My org-refile workflow - Yiming Chen
https://yiming.dev/blog/2018/03/02/my-org-refile-workflow/