/[emacs]/emacs/lisp/gnus/html2text.el
ViewVC logotype

Diff of /emacs/lisp/gnus/html2text.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.4.2 by miles, Wed Oct 6 05:23:52 2004 UTC revision 1.2.4.3 by miles, Fri Oct 29 02:05:07 2004 UTC
# Line 116  formatting, and then moved afterward.") Line 116  formatting, and then moved afterward.")
116  ;; <Utility functions>  ;; <Utility functions>
117  ;;  ;;
118    
 (defun html2text-buffer-head ()  
   (if (string= mode-name "Article")  
       (beginning-of-buffer)  
     (beginning-of-buffer)  
     )  
   )  
119    
120  (defun html2text-replace-string (from-string to-string p1 p2)  (defun html2text-replace-string (from-string to-string p1 p2)
121    (goto-char p1)    (goto-char p1)
# Line 432  formatting, and then moved afterward.") Line 426  formatting, and then moved afterward.")
426    "This _tries_ to fix up the paragraphs - this is done in quite a ad-hook    "This _tries_ to fix up the paragraphs - this is done in quite a ad-hook
427  fashion, quite close to pure guess-work. It does work in some cases though."  fashion, quite close to pure guess-work. It does work in some cases though."
428    (interactive)    (interactive)
429    (html2text-buffer-head)    (goto-char (point-min))
430    (replace-regexp "^<br>$" "")    (replace-regexp "^<br>$" "")
431    ;; Removing lonely <br> on a single line, if they are left intact we    ;; Removing lonely <br> on a single line, if they are left intact we
432    ;; dont have any paragraphs at all.    ;; dont have any paragraphs at all.
433    (html2text-buffer-head)    (goto-char (point-min))
434    (while (not (eobp))    (while (not (eobp))
435      (let ((p1 (point)))      (let ((p1 (point)))
436        (forward-paragraph 1)        (forward-paragraph 1)
# Line 462  fashion, quite close to pure guess-work. Line 456  fashion, quite close to pure guess-work.
456  See the documentation for that variable."  See the documentation for that variable."
457    (interactive)    (interactive)
458    (dolist (tag tag-list)    (dolist (tag tag-list)
459      (html2text-buffer-head)      (goto-char (point-min))
460      (while (re-search-forward (format "\\(</?%s[^>]*>\\)" tag) (point-max) t)      (while (re-search-forward (format "\\(</?%s[^>]*>\\)" tag) (point-max) t)
461        (delete-region (match-beginning 0) (match-end 0)))))        (delete-region (match-beginning 0) (match-end 0)))))
462    
# Line 472  See the documentation for that variable. Line 466  See the documentation for that variable.
466    (dolist (tag-and-function html2text-format-tag-list)    (dolist (tag-and-function html2text-format-tag-list)
467      (let ((tag      (car tag-and-function))      (let ((tag      (car tag-and-function))
468            (function (cdr tag-and-function)))            (function (cdr tag-and-function)))
469        (html2text-buffer-head)        (goto-char (point-min))
470        (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag)        (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag)
471                                  (point-max) t)                                  (point-max) t)
472          (let ((p1)          (let ((p1)
# Line 497  See the documentation for that variable. Line 491  See the documentation for that variable.
491    "See the variable \"html2text-replace-list\" for documentation"    "See the variable \"html2text-replace-list\" for documentation"
492    (interactive)    (interactive)
493    (dolist (e html2text-replace-list)    (dolist (e html2text-replace-list)
494      (html2text-buffer-head)      (goto-char (point-min))
495      (let ((old-string (car e))      (let ((old-string (car e))
496            (new-string (cdr e)))            (new-string (cdr e)))
497        (html2text-replace-string old-string new-string (point-min) (point-max))        (html2text-replace-string old-string new-string (point-min) (point-max))
# Line 511  See the documentation for that variable. Line 505  See the documentation for that variable.
505    (dolist (tag-and-function html2text-format-single-element-list)    (dolist (tag-and-function html2text-format-single-element-list)
506      (let ((tag      (car tag-and-function))      (let ((tag      (car tag-and-function))
507            (function (cdr tag-and-function)))            (function (cdr tag-and-function)))
508        (html2text-buffer-head)        (goto-char (point-min))
509        (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag)        (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag)
510                                  (point-max) t)                                  (point-max) t)
511          (let ((p1)          (let ((p1)

Legend:
Removed from v.1.2.4.2  
changed lines
  Added in v.1.2.4.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26