[Top][All Lists]

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

fill-paragraph from elisp

From: Eike Kettner
Subject: fill-paragraph from elisp
Date: Sat, 11 Oct 2014 18:55:24 +0200

Hello list,

I want to insert some text from a database into a buffer. This should
happen with `fill-paraph' applied, and the string contains multiple
paragraphs. I came up with this (`descr' is the string):

(let ((beg (point)))
  (insert descr)
  (set-mark beg)
  (fill-paragraph nil t)
  (set-mark nil))

This works, but I'm not feeling confident with it. The documentation of
`set-mark' says this:

    ...Novice Emacs Lisp programmers often try to use the mark for the
    wrong purposes. ...

So.. I'm a novice elisp programmer. Is this a "wrong purpose"? What is
the idiomatic way to achieve this?

Thanks and regards

gpg: AD7AC35E
finger print: 137F BB0B 1639 D25F DC5D  E59C B412 C5F5 AD7A C35E

reply via email to

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