Trying to make backling searching work for custom-id links

Daniel Borchmann 2020-09-26 18:16:43 +02:00
parent 4efb8cfe18
commit 669ecb6e4f
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 4 additions and 2 deletions

View File

@ -613,9 +613,11 @@ not."
(user-error "CUSTOM_ID must consist of alphanumeric charaters only"))
(let ((query (cond
((and id custom-id) (format "{\\[\\[id:%s\\]\\|\\[\\[#%s\\]}" id custom-id))
((and id custom-id) (format "{\\[\\[id:%s\\]\\|\\[\\[file:[^]]*::#%s\\]\\|\\[#%s\\]}"
id custom-id custom-id))
(id (format "[[id:%s]" id))
(custom-id (format "[[#%s]" custom-id))
(custom-id (format "{\\[file:[^]]*::#%s\\]\\|\\[#%s\\]}"
custom-id custom-id))
(t (user-error "Neither ID nor CUSTOM_ID given")))))
(org-search-view nil query)))