From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: [arensb@ooblick.com: Feature suggestion: split-line]
Date: 03 Jan 2003 10:43:50 +0100 [thread overview]
Message-ID: <5x7kdmk1pk.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <200301022333.h02NXR0v001405@beta.mvs.co.il>
"Ehud Karni" <ehud@unix.mvs.co.il> writes:
> On Thu, 02 Jan 2003 13:38:26 -0500, Richard Stallman <rms@gnu.org> 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.
I like that!
In message buffers, I'd rather like it to insert message-yank-prefix
with the same semantics! But I guess a message-split-line would be
better for that; and [remap split-line] to it in the message-mode-map.
Something like this:
(defun message-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 message-yank-prefix
(string= message-yank-prefix
(buffer-substring (line-beginning-position)
(+ (line-beginning-position)
(length message-yank-prefix)))))))
(newline 1)
(if prfx (insert-and-inherit message-yank-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).
I'd second that too.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
prev parent reply other threads:[~2003-01-03 9:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-02 18:38 [arensb@ooblick.com: Feature suggestion: split-line] Richard Stallman
2003-01-02 23:33 ` Ehud Karni
2003-01-03 9:43 ` Kim F. Storm [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5x7kdmk1pk.fsf@kfs2.cua.dk \
--to=storm@cua.dk \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).