emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* fill function: Put a newline at the end of each sentence in paragraph.
@ 2019-10-01  6:34 Uwe Brauer
  2019-10-01 15:04 ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Brauer @ 2019-10-01  6:34 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]



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?

Regards

Uwe Brauer 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fill function: Put a newline at the end of each sentence in paragraph.
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2019-10-01 15:04 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode


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
https://emacs.stackexchange.com/questions/443/editing-files-with-one-sentence-per-line

Hth,

-- 
Marcin Borkowski
http://mbork.pl

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fill function: Put a newline at the end of each sentence in paragraph.
  2019-10-01 15:04 ` Marcin Borkowski
@ 2019-10-01 16:02   ` Uwe Brauer
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Brauer @ 2019-10-01 16:02 UTC (permalink / raw)
  To: emacs-orgmode

>>> "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,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-01 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).