GNU Info

Info Node: (efaq)Viewing articles with embedded underlining

(efaq)Viewing articles with embedded underlining


Next: Saving a multi-part Gnus posting Prev: Gnus does not work with NNTP Up: Mail and news
Enter node , (file) or (file)node

How do I view news articles with embedded underlining (e.g., ClariNews)?
========================================================================

   Underlining appears like this:

     _^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^Hi_^Hn_^Hg

   Per Abrahamsen <abraham@dina.kvl.dk> suggests using the following
code, which uses the underline face to turn such text into true
underlining, inconjunction with Gnus:

     (defun gnus-article-prepare-overstrike ()
       ;; Prepare article for overstrike commands.
       (save-excursion
         (set-buffer gnus-article-buffer)
         (let ((buffer-read-only nil))
         (goto-char (point-min))
           (while (search-forward "\b" nil t)
             (let ((next (following-char))
                   (previous (char-after (- (point) 2))))
               (cond ((eq next previous)
                      (delete-region (- (point) 2) (point))
                      (put-text-property (point) (1+ (point))
                                         'face 'bold))
                     ((eq next ?_)
                      (delete-region (1- (point)) (1+ (point)))
                      (put-text-property (1- (point)) (point)
                                         'face 'underline))
                     ((eq previous ?_)
                      (delete-region (- (point) 2) (point))
                      (put-text-property (point) (1+ (point))
                                         'face 'underline))))))))
     
     (add-hook 'gnus-article-prepare-hook 'gnus-article-prepare-overstrike)

   Latest versions of Gnus do such a conversion automatically.

   If you prefer to do away with underlining altogether, you can
destructively remove it with `M-x ununderline-region'; do this
automatically via

     (add-hook 'gnus-article-prepare-hook
       (lambda () (ununderline-region (point-min) (point-max))))


automatically generated by info2www version 1.2.2.9