From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.devel Subject: Re: [arensb@ooblick.com: Feature suggestion: split-line] Date: Fri, 3 Jan 2003 01:33:27 +0200 Organization: Mivtach-Simon Insurance agencies Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301022333.h02NXR0v001405@beta.mvs.co.il> References: Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8 Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1041552590 1798 80.91.224.249 (3 Jan 2003 00:09:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 3 Jan 2003 00:09:50 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18UFPH-0000Sa-00 for ; Fri, 03 Jan 2003 01:09:47 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18UFRd-0001T4-00 for ; Fri, 03 Jan 2003 01:12:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18UFOA-0006aE-00 for emacs-devel@quimby.gnus.org; Thu, 02 Jan 2003 19:08:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18UFJV-0004oY-00 for emacs-devel@gnu.org; Thu, 02 Jan 2003 19:03:49 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18UFHy-0004Dn-00 for emacs-devel@gnu.org; Thu, 02 Jan 2003 19:02:22 -0500 Original-Received: from unix.sw.co.il ([192.114.178.12] helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18UEqJ-0006Ln-00; Thu, 02 Jan 2003 18:33:39 -0500 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.11.6/8.11.6) with ESMTP id h02NXSh28330; Fri, 3 Jan 2003 01:33:28 +0200 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.12.5/8.12.5) with ESMTP id h02NXRed001411; Fri, 3 Jan 2003 01:33:27 +0200 Original-Received: (from ehud@localhost) by beta.mvs.co.il (8.12.5/8.12.5/Submit) id h02NXR0v001405; Fri, 3 Jan 2003 01:33:27 +0200 X-Authentication-Warning: beta.mvs.co.il: ehud set sender to ehud@unix.mvs.co.il using -f Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Thu, 02 Jan 2003 13:38:26 -0500) X-Mailer: Emacs 21.2.91.3 rmail (send-msg 1.106) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10422 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10422 On Thu, 02 Jan 2003 13:38:26 -0500, Richard Stallman wrote: > > > The quick > > brown fox > instead of > > The quick > brown fox Since `delete-indentation' (aka join-line) is deleting `fill-prefix', it is reasonable that `split-line' should add it. `delete-indentation' checks for the `fill-prefix' existence. I think `split-line' should check it too, i.e. Add IT ONLY IF the current line HAS IT. So here is my suggestion for `split-line': (defun split-line () "Split current line, moving portion beyond point vertically down. If fill-prefix is set and the current line has it, put it on the new line" (interactive "*") (skip-chars-forward " \t") (let ((col (current-column)) (pos (point)) (prfx (and fill-prefix (string= fill-prefix (buffer-substring (line-beginning-position) (+ (line-beginning-position) (length fill-prefix))))))) (newline 1) (if prfx (insert-and-inherit fill-prefix)) (indent-to col 0) (goto-char pos))) BTW. I would have changed the behavior of `open-line' to the same logic, i.e. - Add fill-prefix if the current line has it (instead of its current behavior - adding it only when you are at bolp). Ehud. -- Ehud Karni Tel: +972-3-7966-561 /"\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ mailto:ehud@unix.mvs.co.il Better Safe Than Sorry