From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Girard Subject: [patch] Link abbreviations : left-trim the tag Date: Fri, 19 Jun 2009 23:56:36 +0200 Message-ID: <51b0095d0906191456j5fbd9be4l8e17ea9c26bd29d7@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHm4c-0006UZ-Ii for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 17:56:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHm4b-0006Ta-Tp for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 17:56:38 -0400 Received: from [199.232.76.173] (port=45044 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHm4b-0006TN-Ll for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 17:56:37 -0400 Received: from fg-out-1718.google.com ([72.14.220.156]:16061) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHm4b-0001ST-8E for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 17:56:37 -0400 Received: by fg-out-1718.google.com with SMTP id l27so168129fgb.7 for ; Fri, 19 Jun 2009 14:56:36 -0700 (PDT) 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 Hi, the following patch left-trims the tag in a link abbreviation ; this allows to write [[google: org-mode]] for better readability. -- Nicolas diff --git a/lisp/org.el b/lisp/org.el index 07d790f..8aef3c7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6830,7 +6830,7 @@ call CMD." (defun org-link-expand-abbrev (link) "Apply replacements as defined in `org-link-abbrev-alist." - (if (string-match "^\\([a-zA-Z][-_a-zA-Z0-9]*\\)\\(::?\\(.*\\)\\)?$" link) + (if (string-match "^\\([a-zA-Z][-_a-zA-Z0-9]*\\)\\(::?[ \t]*\\(.*\\)\\)?$" link) (let* ((key (match-string 1 link)) (as (or (assoc key org-link-abbrev-alist-local) (assoc key org-link-abbrev-alist)))