From: wmperry@aventail.com (William M. Perry)
Cc: ding@gnus.org
Subject: Re: Yet another washing function.
Date: 06 Oct 1997 12:57:45 -0700 [thread overview]
Message-ID: <86g1qed5qe.fsf@kramer.in.aventail.com> (raw)
In-Reply-To: "St. Suika Roberts"'s message of "04 Oct 1997 18:47:34 -0600"
"St. Suika Roberts" <wrobert2@mailhost.tcs.tulane.edu> writes:
> I started working on this one back in May, but I only got it to where
> I like it today ^^;;
>
> It fixes M$Word style `smart quotes' back to normal ascii ones.
> ------------------------------ cut here ------------------------------
> (defun gnus-article-fix-m$word ()
> "Fix M$Word smartquotes in an article."
> (interactive)
> (save-excursion
> (with-current-buffer gnus-article-buffer
> (let ((buffer-read-only nil))
> (goto-char (point-min))
> (while (search-forward "\221" nil t)
> (replace-match "`" t t))
> (goto-char (point-min))
> (while (search-forward "\222" nil t)
> (replace-match "'" t t))
> (goto-char (point-min))
> (while (search-forward "\223" nil t)
> (replace-match "\"" t t))
> (goto-char (point-min))
> (while (search-forward "\224" nil t)
> (replace-match "\"" t t))))))
I would use subst-char-in-region:
(defun gnus-article-fix-quotes ()
(interactive)
(with-current-buffer gnus-article-buffer
(let ((buffer-read-only nil)
(inhibit-read-only t))
(subst-char-in-region (point-min) (point-max) ?\221 ?`)
(subst-char-in-region (point-min) (point-max) ?\222 ?')
(subst-char-in-region (point-min) (point-max) ?\223 ?\")
(subst-char-in-region (point-min) (point-max) ?\224 ?\"))))
-Bill P.
next prev parent reply other threads:[~1997-10-06 19:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-10-05 0:47 St. Suika Roberts
1997-10-05 11:27 ` Kim-Minh Kaplan
[not found] ` <x7iuvc8f0r.fsf@peorth.gweep.net>
1997-10-06 0:57 ` Greg Stark
1997-10-08 16:23 ` Lars Balker Rasmussen
1997-11-13 18:06 ` Lars Balker Rasmussen
1997-11-13 21:37 ` Lars Magne Ingebrigtsen
1997-10-06 19:57 ` William M. Perry [this message]
1997-10-07 14:06 ` Michael Welsh Duggan
1997-10-12 14:53 ` Lars Magne Ingebrigtsen
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=86g1qed5qe.fsf@kramer.in.aventail.com \
--to=wmperry@aventail.com \
--cc=ding@gnus.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).