From bcc53ef51a2d1b43c1ac0352cd9fa5bafbe0ecc7 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Thu, 27 Jul 2006 19:36:31 +0000 Subject: [PATCH] Implement interactive insertion of URLs. * lisp/muse-mode.el (muse-insert-map): Add binding for muse-insert-url. (muse-insert-thing): Add text for URL to prompt. (muse-insert-relative-link-to-file): Docfix, style fix. (muse-insert-url): New function that reads a URL and description from the user. * muse.texi (Keystroke Summary): Mention insert-url keybinding. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-165 --- ChangeLog | 19 +++++++++++++++++++ lisp/muse-mode.el | 20 +++++++++++++------- muse.texi | 3 +++ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bede5ff..66350ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,25 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2006/muse--main--1.0 # +2006-07-27 19:36:31 GMT Michael Olson patch-165 + + Summary: + Implement interactive insertion of URLs. + Revision: + muse--main--1.0--patch-165 + + * lisp/muse-mode.el (muse-insert-map): Add binding for muse-insert-url. + (muse-insert-thing): Add text for URL to prompt. + (muse-insert-relative-link-to-file): Docfix, style fix. + (muse-insert-url): New function that reads a URL and description from + the user. + + * muse.texi (Keystroke Summary): Mention insert-url keybinding. + + modified files: + ChangeLog lisp/muse-mode.el muse.texi + + 2006-07-27 18:50:50 GMT Michael Olson patch-164 Summary: diff --git a/lisp/muse-mode.el b/lisp/muse-mode.el index e9ef3c6..4e209be 100644 --- a/lisp/muse-mode.el +++ b/lisp/muse-mode.el @@ -133,6 +133,7 @@ index at intervals." (let ((map (make-sparse-keymap))) (define-key map "l" 'muse-insert-relative-link-to-file) (define-key map "t" 'muse-insert-tag) + (define-key map "u" 'muse-insert-url) map)) @@ -306,7 +307,7 @@ the line if point is on a blank line." (defun muse-insert-thing () "Prompt for something to insert into the current buffer." (interactive) - (message "Insert:\nl link\nt tag") + (message "Insert:\nl link\nt tag\nu URL") (let (key cmd) (let ((overriding-local-map muse-insert-map)) (setq key (read-key-sequence nil))) @@ -476,16 +477,21 @@ Valid values of OPERATION are 'increase and 'decrease." ;;;###autoload (defun muse-insert-relative-link-to-file () - "Insert a relative link to a file, with optional description, -at the current point." + "Insert a relative link to a file, with optional description, at point." ;; Perhaps the relative location should be configurable, so that the - ;; file search would start in the publshing directory and then + ;; file search would start in the publishing directory and then ;; insert the link relative to the publishing directory (interactive) (insert - (muse-make-link - (file-relative-name (read-file-name "Link: ")) - (read-string "Text: ")))) + (muse-make-link (file-relative-name (read-file-name "Link: ")) + (read-string "Text: ")))) + +(defun muse-insert-url () + "Insert a URL, with optional description, at point." + (interactive) + (insert + (muse-make-link (read-string "URL: ") + (read-string "Text: ")))) ;;;###autoload (defun muse-edit-link-at-point () diff --git a/muse.texi b/muse.texi index 400007b..0a38256 100644 --- a/muse.texi +++ b/muse.texi @@ -456,6 +456,9 @@ Insert a link to a file interactively. @item C-c TAB t (`muse-insert-tag') Insert a tag interactively. +@item C-c TAB u (`muse-insert-url') +Insert a URL interactively. + @item TAB Move to the next Wiki reference. -- 2.11.4.GIT