From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.bugs Subject: bug#5351: Rectangles of type `beer bellied' Date: Sun, 10 Jan 2010 22:22:09 -0500 Message-ID: Reply-To: MON KEY , 5351@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1263181773 29772 80.91.229.12 (11 Jan 2010 03:49:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jan 2010 03:49:33 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 11 04:49:26 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NUBHR-0004mv-I0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Jan 2010 04:49:26 +0100 Original-Received: from localhost ([127.0.0.1]:39987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUBHS-00011d-8R for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jan 2010 22:49:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUBHC-0000uZ-2d for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 22:49:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUBH7-0000tc-GY for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 22:49:09 -0500 Original-Received: from [199.232.76.173] (port=39803 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUBH7-0000tZ-11 for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 22:49:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59862) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NUBH6-0000z5-HR for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 22:49:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NUAru-0005Jz-Hu; Sun, 10 Jan 2010 22:23:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: MON KEY , 5351@debbugs.gnu.org Resent-From: MON KEY Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jan 2010 03:23:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5351 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@debbugs.gnu.org id=B.126318014720445 (code B ref -1); Mon, 11 Jan 2010 03:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Jan 2010 03:22:27 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NUArK-0005Ji-M6 for submit@debbugs.gnu.org; Sun, 10 Jan 2010 22:22:26 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NUArJ-0005JP-2S for submit@debbugs.gnu.org; Sun, 10 Jan 2010 22:22:25 -0500 Original-Received: from mail.gnu.org ([199.232.76.166]:33942 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NUArF-0003FO-ME for submit@debbugs.gnu.org; Sun, 10 Jan 2010 22:22:21 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NUArE-0007MF-D6 for submit@debbugs.gnu.org; Sun, 10 Jan 2010 22:22:21 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:34535) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NUArE-0007MB-7j for submit@debbugs.gnu.org; Sun, 10 Jan 2010 22:22:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUArD-0006gK-Ll for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 22:22:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUAr7-0006eD-OH for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 22:22:18 -0500 Original-Received: from [199.232.76.173] (port=60162 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUAr7-0006eA-GS for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 22:22:13 -0500 Original-Received: from mail-yw0-f177.google.com ([209.85.211.177]:48197) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUAr7-0007L9-0e for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2010 22:22:13 -0500 Original-Received: by ywh7 with SMTP id 7so13099974ywh.24 for ; Sun, 10 Jan 2010 19:22:09 -0800 (PST) Original-Received: by 10.150.44.24 with SMTP id r24mr4126817ybr.249.1263180129392; Sun, 10 Jan 2010 19:22:09 -0800 (PST) X-Google-Sender-Auth: 6f29ac193fc6484c X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -6.6 (------) Resent-Date: Sun, 10 Jan 2010 22:23:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34193 Archived-At: This bug report is apropos Emacs bug - #1184 of Thu, 16 Oct 2008 19:45:02 UTC "document how to deal with beer belly rectangles" Bug #1184 is Tagged: wontfix As that bug report log contains one legit message and 44 bogus messages rather than add to the fray I am starting a new bug report. FWIW the following function handles the problem. ;;; ============================== ;;; :BUG #1184 of Thu, 16 Oct 2008 19:45:02 UTC ;;; "document how to deal with beer belly rectangles" ;;; :SEE (URL `http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1184') ;;; :CREATED (defun kill-rectangle-w-beer-belly (belly-start belly-end) "Like kill-rectangle but adds trailing whitespace when column at mark is less than the longest line in rectangle." (interactive "r\n") (let ((max-len 0) (fatter-belly)) (unwind-protect (narrow-to-region belly-start belly-end) (goto-char (point-min)) (while (eq (forward-line) 0) (end-of-line) (when (> (current-column) max-len) (setq max-len (current-column)))) (when (= (current-column) max-len) (setq fatter-belly t) (kill-rectangle belly-start belly-end)) (unless fatter-belly (setq fatter-belly (buffer-substring-no-properties belly-start belly-end)) (goto-char belly-start) (kill-line) (while (eq (forward-line) 0) (kill-line)) (when (stringp fatter-belly) (with-temp-buffer (insert fatter-belly) (goto-char (point-min)) (while (eq (forward-line) 0) (let ((lebp `(,(line-beginning-position) . ,(line-end-position)))) (unless (= (- (car lebp) (cdr lebp)) max-len) (end-of-line) (insert (make-string (- max-len (- (cdr lebp) (car lebp))) 32))))) (kill-rectangle (buffer-end 0) (buffer-end 1))))) (widen)))) /s_P\