From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64884 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.gnus.general Subject: Wrapping a region of an article Date: Wed, 04 Jul 2007 22:48:11 +0200 Message-ID: <871wfnki9g.fsf@escher.local.home> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1183582162 8095 80.91.229.12 (4 Jul 2007 20:49:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2007 20:49:22 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13394@lists.math.uh.edu Wed Jul 04 22:49:19 2007 connect(): Connection refused Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1I6Bmo-0006Ji-6D for ding-account@gmane.org; Wed, 04 Jul 2007 22:49:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1I6Blx-0003Wq-VF; Wed, 04 Jul 2007 15:48:26 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1I6Blv-0003Wc-9Q for ding@lists.math.uh.edu; Wed, 04 Jul 2007 15:48:23 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1I6Blt-0007he-SI for ding@lists.math.uh.edu; Wed, 04 Jul 2007 15:48:23 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1I6Bls-00008I-00 for ; Wed, 04 Jul 2007 22:48:20 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1I6Blp-0001rD-PV for ding@gnus.org; Wed, 04 Jul 2007 22:48:17 +0200 Original-Received: from i577bf760.versanet.de ([87.123.247.96]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Jul 2007 22:48:17 +0200 Original-Received: from Stephen.Berman by i577bf760.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Jul 2007 22:48:17 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 65 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: i577bf760.versanet.de User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Spam-Score: -2.3 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64884 Archived-At: --=-=-= Not infrequently I would like to apply word wrapping to a region of the article buffer, rather than to the whole buffer, for example, when the buffer contains a mix of overlong text lines and formatted text (inlined code, tables, etc.). In such cases gnus-article-fill-cited-article (bound to `W w') munges the formatted text, making it all but unreadable. Is there a way to do this that I have overlooked? (I know I can do 'W w' to read the text with overlong lines, then do `g' to redisplay the formatted text, but that's not so nice.) If not, then I would like to propose the attached change to gnus-article-fill-cited-article, which wraps an explicitly selected region of the article buffer, and if there isn't one, then wraps the whole buffer just as it currently does. My patch is against the current Emacs CVS trunk, i.e., Gnus 5.11. If such a feature is available in No Gnus, I would like to hear about it. Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: Wrap a region of an article *** gnus-cite.el.~1.22.~ 2007-01-21 23:44:37.000000000 +0100 --- gnus-cite.el 2007-07-04 21:39:28.000000000 +0200 *************** *** 493,498 **** --- 493,500 ---- (defun gnus-article-fill-cited-article (&optional force width) "Do word wrapping in the current article. + If a region of the article buffer is selected, wrap only that region, + otherwise, do wrapping in the entire article buffer. If WIDTH (the numerical prefix), use that text width when filling." (interactive (list t current-prefix-arg)) (save-excursion *************** *** 511,518 **** (fill-prefix (if (string= (cdar marks) "") "" (concat (cdar marks) " "))) use-hard-newlines) ! (fill-region (point-min) (point-max))) (set-marker (caar marks) nil) (setq marks (cdr marks))) (when marks --- 513,526 ---- (fill-prefix (if (string= (cdar marks) "") "" (concat (cdar marks) " "))) + (beg (if mark-active + (max (region-beginning) (point-min)) + (point-min))) + (end (if (and mark-active (> (region-end) (point-min))) + (min (region-end) (point-max)) + (point-max))) use-hard-newlines) ! (fill-region beg end)) (set-marker (caar marks) nil) (setq marks (cdr marks))) (when marks --=-=-=--