From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12541 Path: main.gmane.org!not-for-mail From: wmperry@aventail.com (William M. Perry) Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 06 Oct 1997 12:57:45 -0700 Message-ID: <86g1qed5qe.fsf@kramer.in.aventail.com> References: Reply-To: wmperry@aventail.com NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035152059 4331 80.91.224.250 (20 Oct 2002 22:14:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:14:19 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id OAA17116 for ; Mon, 6 Oct 1997 14:17:37 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id QAA21444 for ; Mon, 6 Oct 1997 16:10:26 -0500 (CDT) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Mon, 6 Oct 1997 22:00:46 +0200 Original-Received: (qmail 9661 invoked by uid 504); 6 Oct 1997 20:00:44 -0000 Original-Received: (qmail 9658 invoked from network); 6 Oct 1997 20:00:44 -0000 Original-Received: from newman.aventail.com (root@199.238.236.1) by claymore.vcinet.com with SMTP; 6 Oct 1997 20:00:42 -0000 Original-Received: from kramer.in.aventail.com (wmperry@kramer.in.aventail.com [192.168.1.12]) by newman.aventail.com (8.8.5/8.8.5) with ESMTP id NAA28499; Mon, 6 Oct 1997 13:00:41 -0700 (PDT) Original-Received: (from wmperry@localhost) by kramer.in.aventail.com (8.8.5/8.8.5) id MAA26745; Mon, 6 Oct 1997 12:57:45 -0700 Original-To: "St. Suika Roberts" Errors-to: wmperry@aventail.com X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7 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.