Curing google groups issues (was parsing nested unbounded XML…)

rusi rustompmody at gmail.com
Thu Nov 28 14:31:47 CET 2013


On Tuesday, November 26, 2013 4:55:55 AM UTC+5:30, Larry.... at gmail.com wrote:
> > Not sure what you mean by malformed. I don't really care for Google Groups,
> > but I've been using it to post to this any other groups for years (since rn
> > and deja news went away) and no one ever said my posts were malformed. In
> > any case, I did not know the group was available as a ML. I've subbed to
> > that and will post that way.

> The mailing list works well for me too. Google Groups is deceptively
> easy for a lot of people, but if you look through the list's archives,
> you'll see that the posts it makes are unwrapped (and thus string out
> to the right an arbitrary length), and all quoted text is
> double-spaced, among other problems. Its users are generally unaware
> of this, and like you are not maliciously inflicting that on us all,
> but that doesn't make it any less painful to read :) Thanks for
> switching.

> I had noticed the double spacing and I always fixed that when I replied.

Here's what I do to manage the GG-headaches:

1. Firefox needs to have the "Its all text" addon installed
https://addons.mozilla.org/en-US/firefox/addon/its-all-text/

2. Set the editor in "Its all text" to emacs
   [You can use anything… including pure python… more on that below]

3. Put the following into your emacs init 
-----------------
;; Clean up Google Groups extra newlines containing only "> "

(defun clean-gg () 
  (interactive)
  (replace-regexp "^> *\n> *\n> *$" "-=\=-" nil 0 (point-max))
  (flush-lines "> *$" 0 (point-max))
  (replace-regexp "-=\=-" "" nil 0 (point-max))
;  (save-buffers-kill-terminal t)
)


(global-set-key (kbd "<f9>") 'clean-gg)

;(push 'clean-gg find-file-hook)
----------------

Now firefox will show a small new "edit" edit button in the text window.
Clicking that puts you into emacs with the text of the message.

Now F9 will cleanup the double-spaces.

Now, depending on whether you are comfortable with emacs or not you
can do either of:

1. Continue editing in emacs.
   M-q and/or auto-fill-mode will clean up long-line paras
   Save-quit will put you back into firefox with cleaned up text 

2. Not comfortable with emacs? Just F9 and save-quit will get you back
   to emacs with cleaned up double-spaced text.
   The long lines problem remains in this case

Dont like emacs?

1. If you know how to write similar code for vi (or whatever) you are
   set.
2. You can also setup emacs to cleanup and close immediately
3. You can also setup your 'editor' to be a pure python script
   [Ive not got round to doing it because I'm not sure how to
   catch-report errors in a proper cross-platform way.]
4. If you are a javascript/greasemonkey expert I guess you can convert
   the emacs-code to JS/GM code and that would be a zero-click
   solution.

Usually use emacs?
You may prefer emacsclient to emacs for the editor



More information about the Python-list mailing list