Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: dealing with windows \222 char
       [not found] <87znaunir7.fsf@oz.fapse.ulg.ac.be>
@ 2004-03-06 14:59 ` Erwan David
       [not found] ` <vita-brevis-breviter-in-brevi-finietur-mors-venit-velociter-quae-neminem-veretur-87r7w6ui5k.fsf@gothgoose.net>
  1 sibling, 0 replies; 3+ messages in thread
From: Erwan David @ 2004-03-06 14:59 UTC (permalink / raw)


Arnaud Vandyck <avdyk@debian.org> wrote :

> I read a post about this but I lost it...
>
> Does someone has a solution about mails I receive with Windows encoding
> and those \222 characters to change them to a proper character.
>

look for "deuglify" in doc. For full OE deuglification, use W Y f


-- 
Real programs don't eat cache


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dealing with windows \222 char
  2004-03-06 20:53         ` Marcus Frings
@ 2004-03-06 21:38           ` Floyd L. Davidson
  0 siblings, 0 replies; 3+ messages in thread
From: Floyd L. Davidson @ 2004-03-06 21:38 UTC (permalink / raw)


Marcus Frings <iam-est-hora-surgere@despammed.com> wrote:
>* Arnaud Vandyck <avdyk@debian.org> wrote:
>
>> Cookie is a great solution and it works really fine...
>
>Ah, great!
>
>> I suppose I have to use something like:
>> (load-file "~/.gnus_dumbquotes.el")
>
>Exactly! That's the way how I do it.

I have two functions in my init files for GNU Emacs and XEmacs,
which affect the same problem.  By putting them in the init
files I have the functionality available when not running Gnus,
as I occasionally find odd extended ascii characters when doing
regular editing.

One function changes the way the characters are displayed
on the screen.  The other function modifies the current
buffer, making the changes permanent.

I've added these to menubar menus, because I don't use them
often enough to remember a key sequence.  However, in my ~/.gnus
file I do add the fld-fix-buffer function to the
message-send-news-hook, so that every article I post to Usenet
is "fixed" before being posted.  That changes any of the
specified characters in any quoted text, and it also does
untabify on the entire buffer and deletes all trailing white
space.  There is also a variable to toggle it on or off, and I
have a menubar menu item that does that in case I want to post
an article that has not been adjusted.

;;;
;;;  Display various extended ascii characters
;;;
(defvar bdt (make-display-table))

(defun fld-buffer-display-table ()
  "Change current-display-table to print various high bit
  extended ASCII characters  as regular ascii
  characters or string.

   \\200 --> EUR    \\214 --> OE    \\227 --> ---
   \\202 --> ,      \\221 --> \`    \\226 --> --
   \\203 --> f      \\222 --> \'    \\230 --> ~
   \\204 --> ,,     \\223 --> \"    \\231 --> (TM)
   \\205 --> ...    \\224 --> \"    \\233 --> >
   \\213 --> <      \\225 --> *     \\234 --> oe"

  (interactive)
  (setq bdt (make-display-table))
  (aset bdt ?\200 [?E ?U ?R])           ;\200 = EUR
  (aset bdt ?\202 [?,])                 ;\202 = ,
  (aset bdt ?\203 [?f])                 ;\203 = f
  (aset bdt ?\204 [?, ?,])              ;\204 = ,,
  (aset bdt ?\205 [?. ?. ?.])           ;\205 = ...
  (aset bdt ?\213 [?<])                 ;\213 = <
  (aset bdt ?\214 [?O ?E])              ;\214 = OE
  (aset bdt ?\221 [?`])                 ;\221 = `
  (aset bdt ?\222 [?'])                 ;\222 = '
  (aset bdt ?\223 [?\"])                ;\223 = "
  (aset bdt ?\224 [?\"])                ;\224 = "
  (aset bdt ?\225 [?*])                 ;\225 = *
  (aset bdt ?\226 [?- ?-])              ;\226 = --
  (aset bdt ?\227 [?- ?- ?-])           ;\227 = ---
  (aset bdt ?\230 [?~])                 ;\230 = ~
  (aset bdt ?\231 [?( ?T ?m ?)])        ;\231 = (Tm)
  (aset bdt ?\233 [?>])                 ;\233 = >
  (aset bdt ?\234 [?o ?e])              ;\230 = oe

  (eval-when-compile
    (when (not (featurep 'xemacs)) (defun set-specifier (d1 d2) ())))
  (when (featurep 'xemacs)
    (set-specifier current-display-table bdt))
  (setq buffer-display-table current-display-table))


;;;
;;; Untabify and replace various Extended ASCII characters
;;;
(defvar fld-fix-buffer-status t)
(defun fld-fix-buffer ()
 "Fix a buffer:  Trim trailing whitespace, replace tabs with
  spaces and change various high bit set Extended ASCII
  characters to seven-bit ASCII equivalents.  Disabled when
  fld-fix-buffer-status is nil.  Character replacements are:

   \\200 --> EUR    \\214 --> OE    \\227 --> ---
   \\202 --> ,      \\221 --> \`    \\226 --> --
   \\203 --> f      \\222 --> \'    \\230 --> ~
   \\204 --> ,,     \\223 --> \"    \\231 --> (TM)
   \\205 --> ...    \\224 --> \"    \\233 --> >
   \\213 --> <      \\225 --> *     \\234 --> oe"

  (interactive)
  (if fld-fix-buffer-status
      (save-excursion
        (goto-char (point-min))
        (replace-regexp "\\([\t ]\\)*$" "")       ; trim trailing whitespace
        (mark-whole-buffer)
        (untabify (point) (mark))                 ; untabify
        ;; replace various Extended ASCII characters
        (goto-char (point-min))
        (replace-string "\234" "oe")
        (goto-char (point-min))
        (replace-string "\233" ">")
        (goto-char (point-min))
        (replace-string "\231" "(Tm)")
        (goto-char (point-min))
        (replace-string "\230" "~")
        (goto-char (point-min))
        (replace-string "\227" "---")
        (goto-char (point-min))
        (replace-string "\226" "--")
        (goto-char (point-min))
        (replace-string "\225" "*")
        (goto-char (point-min))
        (replace-string "\224" "\"")
        (goto-char (point-min))
        (replace-string "\223" "\"")
        (goto-char (point-min))
        (replace-string "\222" "\'")
        (goto-char (point-min))
        (replace-string "\221" "\`")
        (goto-char (point-min))
        (replace-string "\214" "OE")
        (goto-char (point-min))
        (replace-string "\213" "<")
        (goto-char (point-min))
        (replace-string "\205" "...")
        (goto-char (point-min))
        (replace-string "\204" ",,")
        (goto-char (point-min))
        (replace-string "\203" "f")
        (goto-char (point-min))
        (replace-string "\202" ",")
        (goto-char (point-min))
        (replace-string "\200" "EUR")
        (goto-char (point-min))
        (replace-string "\r\n" "\n")
        (set-mark nil)
        (when (featurep 'xemacs)
          (zmacs-deactivate-region))  ; clears highlighted region
        (message "Buffer fixed..."))))

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dealing with windows \222 char
       [not found]       ` <87k71x6ew6.fsf@oz.fapse.ulg.ac.be>
@ 2004-03-06 20:53         ` Marcus Frings
  2004-03-06 21:38           ` Floyd L. Davidson
  0 siblings, 1 reply; 3+ messages in thread
From: Marcus Frings @ 2004-03-06 20:53 UTC (permalink / raw)


* Arnaud Vandyck <avdyk@debian.org> wrote:

> Cookie is a great solution and it works really fine...

Ah, great!

> I suppose I have to use something like:
> (load-file "~/.gnus_dumbquotes.el")

Exactly! That's the way how I do it.

Regards,
Marcus
-- 
"Alice pressed against the wall
So she can see the door
In case the laughing strangers crawl and
Crush the petals on the floor"


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-06 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87znaunir7.fsf@oz.fapse.ulg.ac.be>
2004-03-06 14:59 ` dealing with windows \222 char Erwan David
     [not found] ` <vita-brevis-breviter-in-brevi-finietur-mors-venit-velociter-quae-neminem-veretur-87r7w6ui5k.fsf@gothgoose.net>
     [not found]   ` <87smgmyn0v.fsf@oz.fapse.ulg.ac.be>
     [not found]     ` <vita-brevis-breviter-in-brevi-finietur-mors-venit-velociter-quae-neminem-veretur-87brn9x6rl.fsf@gothgoose.net>
     [not found]       ` <87k71x6ew6.fsf@oz.fapse.ulg.ac.be>
2004-03-06 20:53         ` Marcus Frings
2004-03-06 21:38           ` Floyd L. Davidson

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).