emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: Re: fill function: Put a newline at the end of each sentence in paragraph.
Date: Tue, 01 Oct 2019 19:02:22 +0300	[thread overview]
Message-ID: <8736gc5u9d.fsf@mat.ucm.es> (raw)
In-Reply-To: 87eezwqzfu.fsf@mbork.pl

>>> "MB" == Marcin Borkowski <mbork@mbork.pl> writes:

   > On 2019-10-01, at 08:34, Uwe Brauer <oub@mat.ucm.es> wrote:

   >> Hi 
   >> 
   >> I am looking for a filling function, which puts a newline at the end of
   >> each sentence. I have one for LaTeX mode but it does not work in org
   >> mode.
   >> 
   >> Anybody has a pointer?

   > How about these?

   > http://mbork.pl/2019-01-20_Filling_and_version_control and the two links there
aha, your code works, but not the code in the links you posted.

Small disadvantage of your code. If I execute it twice several  (unwanted)
newlines are  inserted after each sentence! But anyhow it works, if I
keep this in mind, it is almost perfect.

   > https://emacs.stackexchange.com/questions/443/editing-files-with-one-sentence-per-line

The second one does not help.

The coded posted there 

(defun ospl/fill-paragraph ()

Does not work in org mode.

I obtain 

Debugger entered--Lisp error: (wrong-number-of-arguments
  #f(compiled-function (ad--addoit-function arg) #<bytecode 0xfa2a39>)
  1) ad-Advice-fill-paragraph(#f(compiled-function (arg) (interactive
  "*P") #<bytecode 0xb1b619>)) apply(ad-Advice-fill-paragraph
  #f(compiled-function (arg) (interactive "*P") #<bytecode 0xb1b619>)
  nil) fill-paragraph() (save-excursion (fill-paragraph)
  (ospl/unfill-paragraph) (let ((end-of-paragraph (make-marker)))
  (save-excursion (forward-paragraph) (backward-sentence)
  (forward-sentence) (set-marker end-of-paragraph (point)))
  (forward-sentence) (while (< (point) end-of-paragraph)
  (just-one-space) (delete-backward-char 1) (newline)
  (forward-sentence)) (set-marker end-of-paragraph nil)))
  ospl/fill-paragraph() funcall-interactively(ospl/fill-paragraph)
  call-interactively(ospl/fill-paragraph record nil)
  command-execute(ospl/fill-paragraph record)
  execute-extended-command(nil "ospl/fill-paragraph" "ospl/f")
  funcall-interactively(execute-extended-command nil
  "ospl/fill-paragraph" "ospl/f")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)


And the github packages 
https://github.com/andersjohansson/tex-fold-linebreaks

Works for tex files, but for these I have a solution already, it is org
mode where the filling fails.


   > Hth,

      reply	other threads:[~2019-10-01 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  6:34 fill function: Put a newline at the end of each sentence in paragraph Uwe Brauer
2019-10-01 15:04 ` Marcin Borkowski
2019-10-01 16:02   ` Uwe Brauer [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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736gc5u9d.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@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/org-mode.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).