[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: insert w3m-current-url into minibuffer



jidanni@xxxxxxxxxxx writes:

> How can we modify http://paste.lisp.org/display/38031 to instead insert
> w3m-current-url if not nil? Looks tough. OK true, just do a "c ....
> C-y", the same number of keystrokes as ".... C-c C-f", but not as intuitive.

I think writing from scratch is much easier... like this?

(define-key minibuffer-local-completion-map "\C-c\C-f" 'minibuffer-ins-w3m-url)
(defun minibuffer-ins-w3m-url (arg)
  (interactive "P")
  (let ((url (catch 'url
	       (dolist (b (cdr (buffer-list)))
		 (with-current-buffer b
		   (when w3m-current-url
		     (throw 'url w3m-current-url))))
	       nil)))
    (if url
	(insert url)
      (beep))))