unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Printing text in a buffer
@ 2022-07-30 22:23 carlmarcos--- via Users list for the GNU Emacs text editor
  2022-07-30 23:39 ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-07-30 22:23 UTC (permalink / raw)
  To: Help Gnu Emacs


I want to print text in a buffer that I create.  It is easy enough to make a `defvar myvar' followed by `(insert myvar)'.  But I want to have lines and paragraph fill up to particular column with something like `(fill-paragraph)'.  How can such thing be implemented?





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

* Re: Printing text in a buffer
  2022-07-30 22:23 Printing text in a buffer carlmarcos--- via Users list for the GNU Emacs text editor
@ 2022-07-30 23:39 ` Emanuel Berg
  2022-07-31  0:18   ` carlmarcos--- via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2022-07-30 23:39 UTC (permalink / raw)
  To: help-gnu-emacs

carlmarcos--- via Users list for the GNU Emacs text editor wrote:

> But I want to have lines and paragraph fill up to particular
> column with something like `(fill-paragraph)'. How can such
> thing be implemented?

I feels like I'm so close to the answer but ... I don't know.
What is it?

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Printing text in a buffer
  2022-07-30 23:39 ` Emanuel Berg
@ 2022-07-31  0:18   ` carlmarcos--- via Users list for the GNU Emacs text editor
  2022-08-01  2:58     ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-07-31  0:18 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs


Jul 30, 2022, 23:39 by incal@dataswamp.org:

> carlmarcos--- via Users list for the GNU Emacs text editor wrote:
>
>> But I want to have lines and paragraph fill up to particular
>> column with something like `(fill-paragraph)'. How can such
>> thing be implemented?
>>
>
> I feels like I'm so close to the answer but ... I don't know.
> What is it?
>
For instance, suppose I have 

(defvar version-license
You can redistribute exact copies of Typex or modify it under
the terms of the Gnu Affero General Public License as published
by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.)

which will print the paragraph as it is, when using 

(with-current-buffer typex
(insert version-license))

With last word on each line being printed as last word on each line in buffer name `typex'.

It does not write the text as a paragraph according to maximum column as with `fill-paragraph'.






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

* Re: Printing text in a buffer
  2022-07-31  0:18   ` carlmarcos--- via Users list for the GNU Emacs text editor
@ 2022-08-01  2:58     ` Emanuel Berg
  2022-08-01  3:15       ` carlmarcos--- via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2022-08-01  2:58 UTC (permalink / raw)
  To: help-gnu-emacs

carlmarcos--- via Users list for the GNU Emacs text editor wrote:

> (defvar version-license
> You can redistribute exact copies of Typex or modify it under
> the terms of the Gnu Affero General Public License as published
> by the Free Software Foundation; either version 3 of the License,
> or (at your option) any later version.)

DNC

> which will print the paragraph as it is, when using
>
> (with-current-buffer typex
> (insert version-license))

No :)

> It does not write the text as a paragraph according to
> maximum column as with `fill-paragraph'.

(defun fill-buffer ()
  "Fill all paragraphs in the buffer."
  (interactive)
  (fill-region (point-min) (point-max)) )

Fill even more with Fillcal Software:

  https://dataswamp.org/~incal/emacs-init/fill-incal.el

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Printing text in a buffer
  2022-08-01  2:58     ` Emanuel Berg
@ 2022-08-01  3:15       ` carlmarcos--- via Users list for the GNU Emacs text editor
  2022-08-01  3:23         ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-08-01  3:15 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

Aug 1, 2022, 02:58 by incal@dataswamp.org:

> carlmarcos--- via Users list for the GNU Emacs text editor wrote:
>
>> (defvar version-license
>> You can redistribute exact copies of Typex or modify it under
>> the terms of the Gnu Affero General Public License as published
>> by the Free Software Foundation; either version 3 of the License,
>> or (at your option) any later version.)
>>
>
> DNC
>
>> which will print the paragraph as it is, when using
>>
>> (with-current-buffer typex
>> (insert version-license))
>>
>
> No :)
>
>> It does not write the text as a paragraph according to
>> maximum column as with `fill-paragraph'.
>>
>
> (defun fill-buffer ()
>  "Fill all paragraphs in the buffer."
>  (interactive)
>  (fill-region (point-min) (point-max)) )
>
> Fill even more with Fillcal Software:
>
>  https://dataswamp.org/~incal/emacs-init/fill-incal.el
>
I cannot see how to use your solution.  When would I insert the message and what is point-min and point-max?




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

* Re: Printing text in a buffer
  2022-08-01  3:15       ` carlmarcos--- via Users list for the GNU Emacs text editor
@ 2022-08-01  3:23         ` Emanuel Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2022-08-01  3:23 UTC (permalink / raw)
  To: help-gnu-emacs

carlmarcos--- via Users list for the GNU Emacs text editor wrote:

> When would I insert the message

Before that ...

> and what is point-min and point-max?

Around that ...

-- 
underground experts united
https://dataswamp.org/~incal




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

end of thread, other threads:[~2022-08-01  3:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-30 22:23 Printing text in a buffer carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-30 23:39 ` Emanuel Berg
2022-07-31  0:18   ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-08-01  2:58     ` Emanuel Berg
2022-08-01  3:15       ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-08-01  3:23         ` Emanuel Berg

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