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

Re: saving a buffer without images [PATCH attached]



I agree with Kevin on all points. Here's my patch for one, and my
comment for the other.

On 2016-09-10 12:54, Kevin Ryde wrote:
> In the filename query "Save this page to:", could it say what it's about
> to save, ie. html only or with images?

Patch attached.

> Maybe a flavour of save rather than a boolean if there were other
> possibilities, maybe like saving as text.  Though for text I've only
> ever cut and pasted.

I also find myself cutting and pasting text, because most pages render
with all kinds of 'overhead' that is needless for someone wanting to
save text. In those cases, the inconvenience is copying or manually
typing the save-to filename, which for me is almost always the html
page name with a txt suffix.

How about this as an idea for emacs-w3m?

* A command that would act either on a selected region or on an entire
  buffer, and which would by default save only the text, ie. links and
  placeholders for images would be stripped. The default save name
  would be based upon the page name, and would save to the default w3m
  save folder.

* An option would exist to mark and display all links in lnum format,
  similar to how the programs 'lynx --dump' or 'urlview' render
  pages, with all urls footnoted at the bottom of the page.

* A second option would allow for stripping or inclusion of sections
  of a page based upon names or id's in their html 'span' or 'div'
  elements. This would, for instance, improve readability for many
  pages that have sidebars and header menus

What is the feeling on the list whether something like this would be
of sufficient general interest to include in the w3m package?

What might be missing from this idea?

What other, related, features would be desirable?

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0
83,84c83,86
< 	 (list (read-file-name
< 		"Save this page to: "
---
>      (if (not w3m-save-buffer-html-only)
>        (setq save-prompt "Save this page (with images) to: ")
>       (setq save-prompt "Save this page (html only) to: "))
> 	 (list (read-file-name save-prompt