From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Guerry Subject: [Accepted] Addition of default-description parameter to org-insert-link Date: Wed, 26 Oct 2011 19:04:52 +0200 (CEST) Message-ID: <20111026170452.4557AA97E@myhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ6tV-0005Qk-9K for emacs-orgmode@gnu.org; Wed, 26 Oct 2011 13:04:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJ6tT-0000Qd-H4 for emacs-orgmode@gnu.org; Wed, 26 Oct 2011 13:04:01 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:45890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ6tT-0000QI-Bt for emacs-orgmode@gnu.org; Wed, 26 Oct 2011 13:03:59 -0400 Received: by wwf27 with SMTP id 27so2122574wwf.30 for ; Wed, 26 Oct 2011 10:03:58 -0700 (PDT) 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 Patch 1010 (http://patchwork.newartisans.com/patch/1010/) is now "Accepted". Maintainer comment: none This relates to the following submission: http://mid.gmane.org/%3CCABAjAKc0XK4ZJX6Cw%3DPhWAq24EmYNwSzbDVu378XUa4JMbEr_g%40mail.gmail.com%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O] Addition of default-description parameter to org-insert-link > Date: Wed, 26 Oct 2011 21:47:46 -0000 > From: Yuri Lenskiy > X-Patchwork-Id: 1010 > Message-Id: > To: emacs-orgmode@gnu.org > > This patch, against the stable 7.7 branch version of org.el, adds a > default-description argument to org-insert-link that, if non-nil, will > become the default description. > > - Yuri Lenskiy > > > diff --git a/lisp/org.el b/lisp/org.el > index c29ef11..bf6daab 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -8854,7 +8854,7 @@ This command can be called in any mode to insert a link in Org-mode syntax." > (org-load-modules-maybe) > (org-run-like-in-org-mode 'org-insert-link)) > > -(defun org-insert-link (&optional complete-file link-location) > +(defun org-insert-link (&optional complete-file link-location default-description) > "Insert a link. At the prompt, enter the link. > > Completion can be used to insert any of the link protocol prefixes like > @@ -8890,7 +8890,10 @@ called with the link target, and the result will be the default > link description. > > If the LINK-LOCATION parameter is non-nil, this value will be > -used as the link location instead of reading one interactively." > +used as the link location instead of reading one interactively. > + > +If the DEFAULT-DESCRIPTION parameter is non-nil, this value will > +be used as the default description." > (interactive "P") > (let* ((wcf (current-window-configuration)) > (region (if (org-region-active-p) > @@ -9020,6 +9023,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support > (if org-make-link-description-function > (setq desc (funcall org-make-link-description-function link desc))) > > + (if default-description (setq desc default-description)) > (setq desc (read-string "Description: " desc)) > (unless (string-match "\\S-" desc) (setq desc nil)) > (if remove (apply 'delete-region remove)) >