Hi, When a heading contains a link with a description, `org-tree-to-indirect-buffer' can produce in the name of the indirect buffer strings like this:
"streaming.org-[[url-media:http://192.168.1.36:8888/Radiohead%20-%20Studio%20Discography/OK%20Computer%20%281997%29/recurse.m3u][Radiohead -- OK Computer (1997)]]-1" I would like to propose the attached patch, so that only the link description is used in the indirect buffer name: "streaming.org-Radiohead -- OK Computer (1997)-1" Best regards, Juan Manuel
>From b859f45abaa94e546e625b7b8c9f47ed64d6b4b4 Mon Sep 17 00:00:00 2001 From: Juan Manuel Macias <maciasch...@posteo.net> Date: Sat, 22 May 2021 15:33:15 +0200 Subject: [PATCH] org.el: use only link descriptions in indirect buffer names * lisp/org.el (org-tree-to-indirect-buffer): If the variable `heading' contains a link with a description, it is replaced by the description string. --- lisp/org.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 1bd9e02eb..ca87cac67 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6895,8 +6895,13 @@ frame is not changed." (while (> (setq level (org-outline-level)) arg) (org-up-heading-safe))) (setq beg (point) - heading (org-get-heading 'no-tags)) + heading (replace-regexp-in-string + org-link-bracket-re + (lambda (x) + (pcase (match-string 2 x) + (`nil (match-string 1 x)) + ((pred stringp) (match-string 2 x)))) + (org-get-heading 'no-tags))) (org-end-of-subtree t t) (when (org-at-heading-p) (backward-char 1)) (setq end (point))) -- 2.26.0