unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* fill-paragraph from elisp
@ 2014-10-11 16:55 Eike Kettner
  2014-10-11 19:15 ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Eike Kettner @ 2014-10-11 16:55 UTC (permalink / raw)
  To: help-gnu-emacs


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
Eike

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



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

end of thread, other threads:[~2014-10-11 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-11 16:55 fill-paragraph from elisp Eike Kettner
2014-10-11 19:15 ` Drew Adams
2014-10-11 19:52   ` Eike Kettner

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