From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4DO/ImoRqWAIPQEAgWs5BA (envelope-from ) for ; Sat, 22 May 2021 16:12:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KJlcHmoRqWCPewAAbx9fmQ (envelope-from ) for ; Sat, 22 May 2021 14:12:58 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7FC0B2AFD1 for ; Sat, 22 May 2021 16:12:57 +0200 (CEST) Received: from localhost ([::1]:36084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkSN6-0001BD-CC for larch@yhetil.org; Sat, 22 May 2021 10:12:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkSMm-0001B0-6V for emacs-orgmode@gnu.org; Sat, 22 May 2021 10:12:36 -0400 Received: from mout01.posteo.de ([185.67.36.65]:56177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkSMj-0000hm-Lh for emacs-orgmode@gnu.org; Sat, 22 May 2021 10:12:35 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 1DDAE240026 for ; Sat, 22 May 2021 16:12:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1621692750; bh=Pc1eIKT/xjiBA4LtQ8VjfcapxKJkOCCVNtrF1JxynbA=; h=From:To:Subject:Date:From; b=bo3Y99U+WcOSJXUgFJTc0DHFwm2v16jL86FnEsom9dgfWKOvmlsT2AgGqvGKkJrTh Fe96xhACh/ZlyhSHFK9kIRNIGRVhtbQ7Daa+W8F3GVuiwX7bUraH2sRDizgIoq6jGA DGnfGEAfU2rh4pKVxFQKDruwWLZT+vPLnz7ZNgH+TdyisQvmoEaJm4w6DVbVefbGrn Sfb6ZHASiu+xYR1nNU/xeVEi5j5GBwMXsgeum1U7nDtWi0gKViuwJAa0zC+qrdmqRe /7fSVnPy0h+OO0vwQszjUxED7RHaDbgVBqr8qxumfL1+Qk71EVK9NCJZQwD5LhAv63 z1HnFRmt6uIQQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FnQR13fxFz9rxF for ; Sat, 22 May 2021 16:12:29 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: [PATCH] org.el: use only link descriptions in indirect buffer names Date: Sat, 22 May 2021 14:12:28 +0000 Message-ID: <875yzac0xf.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NUMERIC_HTTP_ADDR=1.242, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, WEIRD_PORT=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621692778; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tXFDOASMNHHHfxYs8riIcMmPQ2XDuIL0miyx5330ZlM=; b=QYC947nsXlzpDBv1iDokB60G6aHDxLA+bwfmrsZCHmyiov5bvS+Ym0sx9WRxiyeGWhjhIl LyDGTAAgqyn2ocWbegcjz2CGhNm9PpPPPSWz6z9q7+oCyPT50vn1a8dObsf1vD+gABTorR yygs8VKy+8FDJnE08pRzSFN52o0BfXOp4wlw3W4Om3n2vpp4Y8n4O6KcxBkdW8a8Xq3mJe RKcfQenGm5mxrLEDrImY2FkT9jaShJkw499m42k60vWUTMtpWEEKyMCDFXBYWvczPkasEs MOC5t7Qu4ymkLcKJjZ1bqtxGxHIvdi/vizDFl6XlJ/jpxn01Twyw10Ziuxi3Rw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621692778; a=rsa-sha256; cv=none; b=GYmsyRjByqt4e85G3MFIQl7H7MYhR97VK0YCu7z7lvzW1dbOSByoKU84rdJ5Rg6a3p//uC meG5H+gr1iC2h5SCVongoCg++B4AtbSUx84JkVy5n4F7LKSNLZIT6OJFoq8wSpdUz4QKqV vFuNVQHvnH3jBrCizdiNFYY6IGqk/i9eeWtloUmHAw63iNmEyAf2iVPhoz0jQ3pzHlRz0d +Mgq2mOe/Sdg/btcwF4gtkEdEde8lWsHKDg1SQTabUcUCFxRtVLkfYJkIV5KIzPXBZFapQ Bn2jouVr7tdw8MPsJd9R1QNO7q1qrXgD7mgU9aAX7WM9RBo7FPWQPqZKuKaoZQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=bo3Y99U+; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=bo3Y99U+; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 7FC0B2AFD1 X-Spam-Score: -2.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: 4oJ+LvrFi9j3 --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-el-use-only-link-descriptions-in-indirect-buffer.patch >From b859f45abaa94e546e625b7b8c9f47ed64d6b4b4 Mon Sep 17 00:00:00 2001 From: Juan Manuel Macias 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 --=-=-=--