From: "Andreas Röhler" <andreas.roehler@online.de>
To: emacs-devel@gnu.org
Subject: Re: html2text-remove-tags documentation
Date: Wed, 27 Jul 2011 09:10:17 +0200 [thread overview]
Message-ID: <4E2FB9D9.50808@online.de> (raw)
In-Reply-To: <4E2F6D4C.2060107@dogan.se>
>> Furthermore, the function is interactive which doesn't make sense the
>> way it's written now.
>>
Thats right.
then (&optional tag-list)
in connection with
(or tag-list html2text-remove-tag-list)))
should DTRT.
Would not restrict it to interactive use,
as leaving out the argument-spec speeds up writing.
Cheers,
Andreas
>> So what should we do about this function?
>>
>> I suggest we make TAG-LIST optional and defaulted to
>> `html2text-remove-tag-list', i.e., (or tag-list
>> html2text-remove-tag-list). If called interactively, TAG-LIST should be
>> a space-or-comma-separated string of tags to remove.
>>
>> Such a definition could be:
>>
>> (defun html2text-remove-tags (&optional tag-list)
>> "Remove the tags in TAG-LIST.
>> If TAG-LIST is nil, use `html2text-remove-tag-list'.
>> If called interactively, "
>> (interactive "MTags to remove: ")
>> (setq tag-list (if (called-interactively-p 'any)
>> (split-string tag-list "[ ,]" t)
>> (or tag-list html2text-remove-tag-list)))
>> (dolist (tag tag-list)
>> (goto-char (point-min))
>> (while (re-search-forward (format "\\(</?%s[^>]*>\\)" tag) (point-max) t)
>> (delete-region (match-beginning 0) (match-end 0)))))
>>
>> This definition would not break any existing code as far as I can tell
>> and both fixes and adds functionality.
>>
>> What do you think?
>>
>
> Bumping this hoping to get it in before the "hard" feature freeze.
>
> Deniz
>
>
prev parent reply other threads:[~2011-07-27 7:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-24 9:11 html2text-remove-tags documentation Deniz Dogan
2011-07-27 1:43 ` Deniz Dogan
2011-07-27 6:51 ` Andreas Röhler
2011-07-27 7:10 ` Andreas Röhler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E2FB9D9.50808@online.de \
--to=andreas.roehler@online.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.