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

Re: switching back from saved *w3m*-source-buffer



Am Dienstag, 3. Juli 2007 13:26 schrieb Katsumi Yamaoka:
> >>>>> In [emacs-w3m : No.09530] Katsumi Yamaoka wrote:
> >
> > AFAIK, Emacs-w3m offers no special way for saving html sources
> > to files.  How about using `M-x write-region' after setting the
> > region over the whole buffer?
>
> Oops, you can use `M-x w3m-download'.  That is much better than
> `write-region'.


Thanks a lot. It works fine.

Nevertheless I mean its worthwhile to avoid unexpected
behavior. Usually, if you save a site, the browser
doesn't quit the browsing-mode, you can surf on
afterward.

Herewith a little form for that. Its not
finished, just for discussion.

(defvar w3m-write-dir "~/")

(defun w3m-write-file () 
  " "
  (interactive)
  (set-buffer (get-buffer-create "*w3m-tmp-write-buffer*"))
  (erase-buffer) 
  (insert-buffer "*w3m*")
  (when (y-or-n-p (concat "Write file " w3m-write-dir "*w3m*.html?")) 
    (write-file (concat w3m-write-dir "*w3m*.html")))) 

The keys C-x C-s  set to  `w3m-write-file' in w3m-mode,
user must not even notice the changement.

Andreas Roehler