From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert Krewinkel Subject: [PATCH] org.el (org-offer-links-in-entry): Remove code duplication Date: Thu, 24 Apr 2014 16:36:08 +0200 Message-ID: <1398350168-18902-1-git-send-email-tarleb@moltkeplatz.de> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUj1-0008Vf-0e for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 21:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdKlY-0005Jd-9I for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 10:36:51 -0400 Received: from moltkeplatz.de ([85.214.95.47]:60262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdKlY-0005ID-2u for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 10:36:44 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Albert Krewinkel * org.el (org-offer-links-in-entry): Use `org-any-link-re' to avoid code duplication. The `re' variable defined in function `org-offer-links-in-entry' is string-equal to `org-any-link-re' and is hence replaced by the latter. This is a TINYCHANGE. --- lisp/org.el | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ad76e67..741529b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10694,10 +10694,7 @@ there is one, return it." (save-restriction (widen) (goto-char marker) - (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|" - "\\(" org-angle-link-re "\\)\\|" - "\\(" org-plain-link-re "\\)")) - (cnt ?0) + (let ((cnt ?0) (in-emacs (if (integerp nth) nil nth)) have-zero end links link c) (when (and (stringp zero) (string-match org-bracket-link-regexp zero)) @@ -10706,7 +10703,7 @@ there is one, return it." (save-excursion (org-back-to-heading t) (setq end (save-excursion (outline-next-heading) (point))) - (while (re-search-forward re end t) + (while (re-search-forward org-any-link-re end t) (push (match-string 0) links)) (setq links (org-uniquify (reverse links)))) (cond -- 1.9.2