diff options
| author | Joakim Verona | 2011-11-03 22:25:57 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-11-03 22:25:57 +0100 |
| commit | e40ee7bd1eac05291eb99306f8b7afc7637e9064 (patch) | |
| tree | d595dcee4dd86760181816af6ce6194ec9128055 /lisp | |
| parent | 85a3fca5206d1a2bc466cdb5d8817e1bf69b8820 (diff) | |
| download | emacs-e40ee7bd1eac05291eb99306f8b7afc7637e9064.tar.gz emacs-e40ee7bd1eac05291eb99306f8b7afc7637e9064.zip | |
improvement to 'g'
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/net/browse-url.el | 5 | ||||
| -rw-r--r-- | lisp/xwidget.el | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 39a48bde645..87e772f1833 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -669,7 +669,7 @@ regarding its parameter treatment." | |||
| 669 | ;; functions allows them to be stand-alone commands, making it easier | 669 | ;; functions allows them to be stand-alone commands, making it easier |
| 670 | ;; to switch between browsers. | 670 | ;; to switch between browsers. |
| 671 | 671 | ||
| 672 | (defun browse-url-interactive-arg (prompt) | 672 | (defun browse-url-interactive-arg (prompt &optional default-url) |
| 673 | "Read a URL from the minibuffer, prompting with PROMPT. | 673 | "Read a URL from the minibuffer, prompting with PROMPT. |
| 674 | If `transient-mark-mode' is non-nil and the mark is active, | 674 | If `transient-mark-mode' is non-nil and the mark is active, |
| 675 | it defaults to the current region, else to the URL at or before | 675 | it defaults to the current region, else to the URL at or before |
| @@ -686,7 +686,8 @@ for use in `interactive'." | |||
| 686 | "[\t\r\f\n ]+" "" | 686 | "[\t\r\f\n ]+" "" |
| 687 | (buffer-substring-no-properties | 687 | (buffer-substring-no-properties |
| 688 | (region-beginning) (region-end)))) | 688 | (region-beginning) (region-end)))) |
| 689 | (browse-url-url-at-point))) | 689 | (browse-url-url-at-point) |
| 690 | default-url)) | ||
| 690 | (not (eq (null browse-url-new-window-flag) | 691 | (not (eq (null browse-url-new-window-flag) |
| 691 | (null current-prefix-arg))))) | 692 | (null current-prefix-arg))))) |
| 692 | 693 | ||
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index e89f074280d..0225889811d 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el | |||
| @@ -72,7 +72,7 @@ NEW-SESSION specifies whether to create a new xwidget-webkit session. URL | |||
| 72 | defaults to the string looking like a url around the cursor position." | 72 | defaults to the string looking like a url around the cursor position." |
| 73 | (interactive (progn | 73 | (interactive (progn |
| 74 | (require 'browse-url) | 74 | (require 'browse-url) |
| 75 | (browse-url-interactive-arg "xwidget-webkit URL: "))) | 75 | (browse-url-interactive-arg "xwidget-webkit URL: " ( xwidget-webkit-current-url)))) |
| 76 | (when (stringp url) | 76 | (when (stringp url) |
| 77 | (setq url (url-tidy url)) | 77 | (setq url (url-tidy url)) |
| 78 | (if new-session | 78 | (if new-session |
| @@ -337,7 +337,9 @@ Argument H height." | |||
| 337 | (defun xwidget-webkit-current-url () | 337 | (defun xwidget-webkit-current-url () |
| 338 | "Get the webkit url. place it on kill ring." | 338 | "Get the webkit url. place it on kill ring." |
| 339 | (interactive) | 339 | (interactive) |
| 340 | (message "url: %s" (kill-new (xwidget-webkit-execute-script-rv (xwidget-webkit-current-session) "document.URL")))) | 340 | (let ((url (kill-new (xwidget-webkit-execute-script-rv (xwidget-webkit-current-session) "document.URL")))) |
| 341 | (message "url: %s" url ) | ||
| 342 | url)) | ||
| 341 | 343 | ||
| 342 | (defun xwidget-webkit-execute-script-rv (xw script &optional default) | 344 | (defun xwidget-webkit-execute-script-rv (xw script &optional default) |
| 343 | "same as xwidget-webkit-execute-script but also wraps an ugly hack to return a value" | 345 | "same as xwidget-webkit-execute-script but also wraps an ugly hack to return a value" |