577 |
|
|
578 |
(defun browse-url-interactive-arg (prompt) |
(defun browse-url-interactive-arg (prompt) |
579 |
"Read a URL from the minibuffer, prompting with PROMPT. |
"Read a URL from the minibuffer, prompting with PROMPT. |
580 |
Default to the URL at or before point. If invoked with a mouse button, |
If `transient-mark-mode' is non-nil and the mark is active, |
581 |
set point to the position clicked first. Return a list for use in |
it defaults to the current region, else to the URL at or before |
582 |
`interactive' containing the URL and `browse-url-new-window-flag' or its |
point. If invoked with a mouse button, it moves point to the |
583 |
negation if a prefix argument was given." |
position clicked before acting. |
584 |
|
|
585 |
|
This function returns a list (URL NEW-WINDOW-FLAG) |
586 |
|
for use in `interactive'." |
587 |
(let ((event (elt (this-command-keys) 0))) |
(let ((event (elt (this-command-keys) 0))) |
588 |
(and (listp event) (mouse-set-point event))) |
(and (listp event) (mouse-set-point event))) |
589 |
(list (read-string prompt (browse-url-url-at-point)) |
(list (read-string prompt (or (and transient-mark-mode mark-active |
590 |
|
;; rfc2396 Appendix E. |
591 |
|
(replace-regexp-in-string |
592 |
|
"[\t\r\f\n ]+" "" |
593 |
|
(buffer-substring-no-properties |
594 |
|
(region-beginning) (region-end)))) |
595 |
|
(browse-url-url-at-point))) |
596 |
(not (eq (null browse-url-new-window-flag) |
(not (eq (null browse-url-new-window-flag) |
597 |
(null current-prefix-arg))))) |
(null current-prefix-arg))))) |
598 |
|
|