[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch to change just-one-space
From: |
Andreas Roehler |
Subject: |
Re: Patch to change just-one-space |
Date: |
Fri, 14 Aug 2009 14:19:00 +0200 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
Deniz Dogan wrote:
> 2009/8/14 Stephen J. Turnbull <address@hidden>:
>> Deniz Dogan writes:
>> > 2009/8/14 Juri Linkov <address@hidden>:
>>
>> > > No, it's a controversial change. Just imagine typing M-SPC at the end
>> > > of the paragraph.
>> >
>> > That's exactly why I wrote this change, because that's how I use my
>> > own version of M-SPC. I very rarely use the version that's in CVS now.
>>
>> I use the current definition a lot; usage patterns vary, it seems.
>>
>> In your typical use there are *no* non-newline spaces?
>
> No, it is usually a combination of spaces and newlines, e.g. in:
>
> <div>
> <p>
> c <a href="#">Hello</a>
> </p>
> </div>
>
> ...where point is at "c". Then I'd just merge the lines using M-SPC
> DEL or M-0 M-SPC. Then I would probably do it again:
>
> <div>
> <p><a href="#">Hello</a>c
> </p>
> </div>
>
> ...where point is at "c". The result:
>
> <div>
> <p><a href="#">Hello</a></p>
> </div>
>
>> It seems to me that a more flexible and discoverable (and to you
>> equivalent, up to default keybindings) idea would be to define
>> `paragraph-join' and `paragraph-break', and bind the former to M-SPC.
>
> Sounds interesting. So basically we would make `paragraph-join' the
> same as "my" version of `just-one-space'? Or did you have something
> different in mind?
>
Hi,
I use a similar thing quite often and instead of
fixup-whitespace. Its a useful feature IMO.
Here original behaviour is available via arg.
(defun my-fixup-whitespace (&optional arg)
"Fixup white space between objects around point.
Leave one space or none, according to the context.
With ARG, don't kill \\r\\n\\f"
(interactive "*P")
(save-excursion
(if (eq 4 (prefix-numeric-value arg))
(delete-horizontal-space)
;; 2007-11-28 address@hidden changed section start
(unless (bolp)
(skip-chars-backward " \t\r\n\f"))
(let ((start (point)))
(skip-chars-forward " \t\r\n\f")
(delete-region start (point)))
;; 2007-11-28 address@hidden changed section end
(if (or (looking-at "^\\|\\s)")
(save-excursion (forward-char -1)
(looking-at "$\\|\\s(\\|\\s'")))
nil
(insert ? )))))
;;;;
- Re: Patch to change just-one-space, (continued)
- Re: Patch to change just-one-space, Deniz Dogan, 2009/08/14
- capitalize-dwim (was: Patch to change just-one-space), Stefan Monnier, 2009/08/14
- Re: capitalize-dwim (was: Patch to change just-one-space), Xah Lee, 2009/08/14
- Re: capitalize-dwim, joakim, 2009/08/14
- Re: capitalize-dwim, Richard Stallman, 2009/08/14
- Re: Patch to change just-one-space, David Kastrup, 2009/08/14
Re: Patch to change just-one-space, Juri Linkov, 2009/08/13
Re: Patch to change just-one-space, Miles Bader, 2009/08/13