diff options
author | Yuri Lenskiy <lenskiy@mit.edu> | 2011-10-26 21:47:46 +0000 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-10-26 19:04:36 +0200 |
commit | 611598099385e5ca2d04d7302cbf91eb421d47f4 (patch) | |
tree | c793b591822c0cdef571da4f15d8a2fca016d9fc | |
parent | a5cbe6a6cb761e2286bd91f319cdc91c62d5e304 (diff) | |
download | org-mode-611598099385e5ca2d04d7302cbf91eb421d47f4.tar.gz |
Addition of default-description parameter to org-insert-link
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
-rw-r--r-- | lisp/org.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index fe87eda..d42db47 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8995,7 +8995,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 @@ -9031,7 +9031,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) @@ -9161,6 +9164,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)) |