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

Re: Persistent emacs-w3m sessions



"Clemens Fischer" <ino-qc@spotteswoode.de.eu.org> writes:

> in what order do you initialize w3m related things?  do you first require
> w3m-session (which requires w3m) and afterwards map the keys?
>
>   clemens
>

i first require w3m and customize it. aftewards i do this:

(if (require 'w3m-session nil t)
    (progn
     (setq w3m-session-file "~/.emacs.d/w3m-session")
     (setq w3m-session-save-always nil)
     (setq w3m-session-load-always nil)
     (setq w3m-session-duplicate-tabs 'ask)

     ;;;;; jump to w3m buffer
     (defmacro jao-w3m-add-jumper ()
       (let ((n (length (w3m-list-buffers))))
         `(define-key w3m-mode-map
            (vector (list 'meta (+ ?0 ,n)))
            (lambda ()
              (interactive)
              (let ((tab (nth (1- ,n) (w3m-list-buffers))))
                (if tab (switch-to-buffer tab)
                  (message "No such tab")))))))
     (add-hook 'w3m-mode-hook (lambda () (jao-w3m-add-jumper)))

     ;;;;; additional shortcuts
     (defun jao-w3m-keys ()
       (define-key w3m-mode-map "v" 'bmk-mgr-show-bookmarks)
       (define-key w3m-mode-map "a" 'bmk-mgr-add-current-w3m-page)
       (define-key w3m-mode-map "S" 'w3m-session-save)
       (define-key w3m-mode-map "L" 'w3m-session-load)
       (define-key w3m-mode-map "V" 'w3m-view-image)
       (define-key w3m-mode-map [(meta tab)] 'w3m-next-buffer))
     (add-hook 'w3m-mode-hook 'jao-w3m-keys))
  (message "w3m-session not available"))

hth,
jao
-- 
Experience is not what happens to you; it is what you do with what
happens to you.
   - Aldous Huxley, 1956