emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] function for inserting a block


From: Eric Abrahamsen
Subject: Re: [O] function for inserting a block
Date: Tue, 17 Oct 2017 09:27:14 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:


[...]

> Then it's `forward-line', not `forward-char', because there could be
> trailing spaces at the end of the paragraph, e.g.
>
>    This is a paragraph.<SPC><SPC>

Okay, changed to `forward-line'.

> Also, my question still holds, what about the last paragraph in a buffer
> not ending with a newline character, e.g.
>
>   This is the last paragraph.<EOB>
>
> You need to insert a newline character in this case.

I'm still not quite seeing this. This chunk should take care of it:

    (goto-char e)
    (if (bolp)
        (progn
          (skip-chars-backward " \n\t")
          (forward-line))
      (end-of-line)
      (insert "\n"))

If "e" is EOB, we do `end-of-line' and insert a newline, it should be
taken care of. I added a new clause in the test for this case, and it
seems to work fine... Am I missing anything?

Eric

Attachment: 0001-Move-org-completing-read-into-org-macs.el.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]