From mboxrd@z Thu Jan 1 00:00:00 1970 From: James TD Smith Subject: [PATCH 4/9] Fix link display in imenus and the refile interface Date: Sat, 20 Sep 2008 22:09:01 +0100 Message-ID: <20080920210901.19759.78844.stgit@nyarlathotep.internal.mohorovi.cc> References: <20080920210101.19759.15959.stgit@nyarlathotep.internal.mohorovi.cc> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kh9hR-00048a-01 for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 17:09:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kh9hQ-00048D-99 for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 17:09:04 -0400 Received: from [199.232.76.173] (port=60159 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kh9hQ-000488-5P for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 17:09:04 -0400 Received: from 81-86-40-42.dsl.pipex.com ([81.86.40.42]:58439 helo=yog-sothoth.mohorovi.cc) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kh9hP-00025q-Ja for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 17:09:04 -0400 Received: from nyarlathotep.internal.mohorovi.cc (Debian-exim@nyarlathotep.internal.mohorovi.cc [10.0.0.5]) by yog-sothoth.mohorovi.cc (8.14.2/8.14.2) with ESMTP id m8KL91xb017659 for ; Sat, 20 Sep 2008 22:09:01 +0100 (BST) (envelope-from ahktenzero@mohorovi.cc) Received: from [127.0.0.1] (helo=nyarlathotep.internal.mohorovi.cc ident=ahktenzero) by nyarlathotep.internal.mohorovi.cc with esmtp (Exim 4.69) (envelope-from ) id 1Kh9hN-0005pT-OL for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 22:09:01 +0100 In-Reply-To: <20080920210101.19759.15959.stgit@nyarlathotep.internal.mohorovi.cc> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Replace links with their descriptions in when generating the items for imenus and the refile interface. --- lisp/ChangeLog | 4 ++++ lisp/org.el | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3896ddf..b52700d 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2008-09-20 James TD Smith + * org.el (org-get-refile-targets): Replace links with their + descriptions + (org-imenu-get-tree): Replace links with their descriptions + * org-agenda.el (org-agenda-get-closed): show durations of clocked items as well as the start and end times. diff --git a/lisp/org.el b/lisp/org.el index cdbe7bb..99b62d0 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7866,7 +7866,10 @@ on the system \"/user@host:\"." (while (re-search-forward descre nil t) (goto-char (point-at-bol)) (when (looking-at org-complex-heading-regexp) - (setq txt (match-string 4) + (setq txt (save-match-data + (replace-regexp-in-string + org-bracket-link-analytic-regexp "\\5" + (match-string 4))) re (concat "^" (regexp-quote (buffer-substring (match-beginning 1) (match-end 4))))) @@ -14673,6 +14676,9 @@ Show the heading too, if it is currently invisible." (looking-at org-complex-heading-regexp) (setq head (org-match-string-no-properties 4) m (org-imenu-new-marker)) + (setq head (replace-regexp-in-string + org-bracket-link-analytic-regexp + "\\5" head)) (org-add-props head nil 'org-imenu-marker m 'org-imenu t) (if (>= level last-level) (push (cons head m) (aref subs level))