[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: insert w3m-current-url into minibuffer
- From: Naohiro Aota <naota@xxxxxxxxx>
- Date: Thu, 18 Aug 2011 19:37:56 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 11624
- References: <8762lve711.fsf@xxxxxxxxxxx>
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))))