comparison lisp/gnus/gnus-cite.el @ 111269:3d7a1caabf14

Merge changes made in Gnus trunk. nnimap.el (nnimap-open-connection): Only send AUTHENTICATE PLAIN if LOGINDISABLED is set. gnus.el (gnus-group-startup-message): Move point to the start of the buffer. nndoc.el (nndoc-dissect-buffer): Reverse the order of the articles to reflect the order they're in in the digest. gnus-sum.el (gnus-summary-select-article): Make `C-d' work reliably by checking whether the original article buffer is alive. shr.el (shr-find-fill-point): Don't break lines between punctuation and non-punctuation (like after the apostrophe in "'We"). gnus-cite.el (gnus-article-fill-cited-article): Remove unused `force' parameter. gnus-art.el (gnus-treatment-function-alist): Have gnus-treat-fill-long-lines point to gnus-article-fill-cited-long-lines. gnus-art.el (gnus-treat-fill-long-lines): Change default to fill all text/plain sections. gnus.el: Autoload gnus-article-fill-cited-long-lines. gnus-art.el (gnus-mime-display-alternative): Actually pass the type on to `gnus-treat-article'. gnus-sum.el (gnus-summary-show-article): Add `C-u C-u g' for showing the raw article, and change `C-u g' to show the article without doing treatments. gnus.texi (Paging the Article): Document C-u g/C-u C-u g. gnus-cite.el (gnus-article-foldable-buffer): Refactor out. gnus-cite.el (gnus-article-foldable-buffer): Don't fold regions that have a ragged left edge. gnus-cite.el (gnus-article-foldable-buffer): Skip past the prefix when determining raggedness. gnus-srvr.el, nnir.el: Allow nnir searching for an entire server. gnus-msg.el (gnus-configure-posting-styles): Permit the use of regular expression match and replace in posting styles. gnus-art.el (gnus-treat-article): Only inhibit body washing, and leave the header washing to take place. nnimap.el (nnimap-request-accept-article): Erase buffer before appending for easier debugging. nnimap.el (nnimap-wait-for-connection): Take a regexp. nnimap.el (nnimap-request-accept-article): Wait for the continuation line before sending anything unless we're streaming.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 31 Oct 2010 22:31:24 +0000
parents 8d09094063d0
children 0c7c9736f766
comparison
equal deleted inserted replaced
111268:a8ba29b9ad19 111269:3d7a1caabf14
514 (= (point) (caaddr m))) 514 (= (point) (caaddr m)))
515 (setcdr m (cdddr m)) 515 (setcdr m (cdddr m))
516 (setq m (cdr m)))) 516 (setq m (cdr m))))
517 marks)))) 517 marks))))
518 518
519 (defun gnus-article-fill-cited-article (&optional force width) 519 (defun gnus-article-fill-cited-long-lines ()
520 (gnus-article-fill-cited-article nil t))
521
522 (defun gnus-article-fill-cited-article (&optional width long-lines)
520 "Do word wrapping in the current article. 523 "Do word wrapping in the current article.
521 If WIDTH (the numerical prefix), use that text width when filling." 524 If WIDTH (the numerical prefix), use that text width when
522 (interactive (list t current-prefix-arg)) 525 filling. If LONG-LINES, only fill sections that have lines
526 longer than the frame width."
527 (interactive "P")
523 (with-current-buffer gnus-article-buffer 528 (with-current-buffer gnus-article-buffer
524 (let ((buffer-read-only nil) 529 (let ((buffer-read-only nil)
525 (inhibit-point-motion-hooks t) 530 (inhibit-point-motion-hooks t)
526 (marks (gnus-dissect-cited-text)) 531 (marks (gnus-dissect-cited-text))
527 (adaptive-fill-mode nil) 532 (adaptive-fill-mode nil)
533 (let ((adaptive-fill-regexp 538 (let ((adaptive-fill-regexp
534 (concat "^" (regexp-quote (cdar marks)) " *")) 539 (concat "^" (regexp-quote (cdar marks)) " *"))
535 (fill-prefix 540 (fill-prefix
536 (if (string= (cdar marks) "") "" 541 (if (string= (cdar marks) "") ""
537 (concat (cdar marks) " "))) 542 (concat (cdar marks) " ")))
543 (do-fill (not long-lines))
538 use-hard-newlines) 544 use-hard-newlines)
539 (fill-region (point-min) (point-max))) 545 (unless do-fill
546 (setq do-fill (gnus-article-foldable-buffer (cdar marks))))
547 (when do-fill
548 (fill-region (point-min) (point-max))))
540 (set-marker (caar marks) nil) 549 (set-marker (caar marks) nil)
541 (setq marks (cdr marks))) 550 (setq marks (cdr marks)))
542 (when marks 551 (when marks
543 (set-marker (caar marks) nil)) 552 (set-marker (caar marks) nil))
544 ;; All this information is now incorrect. 553 ;; All this information is now incorrect.
545 (setq gnus-cite-prefix-alist nil 554 (setq gnus-cite-prefix-alist nil
546 gnus-cite-attribution-alist nil 555 gnus-cite-attribution-alist nil
547 gnus-cite-loose-prefix-alist nil 556 gnus-cite-loose-prefix-alist nil
548 gnus-cite-loose-attribution-alist nil 557 gnus-cite-loose-attribution-alist nil
549 gnus-cite-article nil))))) 558 gnus-cite-article nil)))))
559
560 (defun gnus-article-foldable-buffer (prefix)
561 (let ((do-fill nil)
562 columns)
563 (goto-char (point-min))
564 (while (not (eobp))
565 (forward-char (length prefix))
566 (skip-chars-forward " \t")
567 (unless (eolp)
568 (let ((elem (assq (current-column) columns)))
569 (unless elem
570 (setq elem (cons (current-column) 0))
571 (push elem columns))
572 (setcdr elem (1+ (cdr elem)))))
573 (end-of-line)
574 (when (> (current-column) (frame-width))
575 (setq do-fill t))
576 (forward-line 1))
577 (and do-fill
578 ;; We know know that there are long lines here, but does this look
579 ;; like code? Check for ragged edges on the left.
580 (< (length columns) 3))))
550 581
551 (defun gnus-article-natural-long-line-p () 582 (defun gnus-article-natural-long-line-p ()
552 "Return true if the current line is long, and it's natural text." 583 "Return true if the current line is long, and it's natural text."
553 (save-excursion 584 (save-excursion
554 (beginning-of-line) 585 (beginning-of-line)