emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: format text in TreeWidget.
@ 2011-01-10 20:53 Alin Soare
  2011-01-10 21:04 ` Alin Soare
  2011-01-10 21:10 ` Chong Yidong
  0 siblings, 2 replies; 3+ messages in thread
From: Alin Soare @ 2011-01-10 20:53 UTC (permalink / raw)
  To: Emacs Dev, emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2375 bytes --]

No.

Thanks for your answer.

No, your answer is wrong.

You did not understand what I meant.

I answer you so:

I do not like to create a tree like this :


|- aaaaaaaaaaaaa
aaaaaaaaaaaaaaa
|- bbbbbbbbbbbbb
bbbbbbbbbbbbbbb
`cccccccccccccccc
ccccccccccccccccc

but like this:


|- aaaaaaaaaaaaaaaaaaa
|  aaaaaaaaaaaaaaaaaaa
|- bbbbbbbbbbbbbbbbbbb
| bbbbbbbbbbbbbbbbbbbb
|-ccccccccccccccccccccccc
`ccccccccccccccccccccccc


In other words:

Is there a function fill-paragraph for tree-mode ?


Thanks.

Alin
















<quote author="Tassilo Horn-5">
Alin Soare <as1789@gmail.com> writes:

> I did write the following code.
>
> As the :tag text is very long on some lines, and pass over the end the
> line, it is displayed on myltiple lines, and the tree looks spoiled. I
> wish to make the tree widget show the text formatted correctly, and on
> maximum N columns.

Hm, this somehow works, but is not perfect:

--8<---------------cut here---------------start------------->8---
(widget-create 'tree-widget
           :node '(push-button :tag
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" :format "%[%t%]\n")
           `(tree-widget
         :tag ,(with-temp-buffer
             (set-fill-column 50)
             (insert "bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla")
             (fill-paragraph)
             (buffer-string)))
           `(tree-widget
         :tag ,(with-temp-buffer
             (set-fill-column 60)
             (insert "foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foo foo foo foo foo")
             (fill-paragraph)
             (buffer-string)))
           `(tree-widget
         :tag ,(with-temp-buffer
             (set-fill-column 70)
             (insert "baz baz baz baz baz baz baz baz baz baz baz baz baz
baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz
baz baz baz baz baz baz baz baz baz baz baz")
             (fill-paragraph)
             (buffer-string))))
--8<---------------cut here---------------end--------------->8---

The problem is that only the first line has correct tree lines...

But maybe that's still a pointer into the right direction.

Bye,
Tassilo



</quote>

[-- Attachment #1.2: Type: text/html, Size: 3041 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: format text in TreeWidget.
  2011-01-10 20:53 format text in TreeWidget Alin Soare
@ 2011-01-10 21:04 ` Alin Soare
  2011-01-10 21:10 ` Chong Yidong
  1 sibling, 0 replies; 3+ messages in thread
From: Alin Soare @ 2011-01-10 21:04 UTC (permalink / raw)
  To: Emacs Dev, emacs-orgmode

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

I generate the tree in the following order:

XML - (xml-parse-tag) -> LISP - (defining xml-tags as lisp functions) ->
tree-widget format.

I can insert to te level "xml-tags as lisp functions" an accumulator to help
me know the

:level N

of every tree-widget element. N can represens the number of columns at the
beginning of a line used by "group"

||||||||| [N times]

Supposing you have a (:level N) element for every element of tree-widget,
how do you define a fill-paragraph function in tree-widget mode ?

Please help from the author of tree-widget and everybody else who knows it .


Alin.












2011/1/10 Alin Soare <as1789@gmail.com>

>
> No.
>
> Thanks for your answer.
>
> No, your answer is wrong.
>
> You did not understand what I meant.
>
> I answer you so:
>
> I do not like to create a tree like this :
>
>
> |- aaaaaaaaaaaaa
> aaaaaaaaaaaaaaa
> |- bbbbbbbbbbbbb
> bbbbbbbbbbbbbbb
> `cccccccccccccccc
> ccccccccccccccccc
>
> but like this:
>
>
> |- aaaaaaaaaaaaaaaaaaa
> |  aaaaaaaaaaaaaaaaaaa
> |- bbbbbbbbbbbbbbbbbbb
> | bbbbbbbbbbbbbbbbbbbb
> |-ccccccccccccccccccccccc
> `ccccccccccccccccccccccc
>
>
> In other words:
>
> Is there a function fill-paragraph for tree-mode ?
>
>
> Thanks.
>
> Alin
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> <quote author="Tassilo Horn-5">
> Alin Soare <as1789@gmail.com> writes:
>
> > I did write the following code.
> >
> > As the :tag text is very long on some lines, and pass over the end the
> > line, it is displayed on myltiple lines, and the tree looks spoiled. I
> > wish to make the tree widget show the text formatted correctly, and on
> > maximum N columns.
>
> Hm, this somehow works, but is not perfect:
>
> --8<---------------cut here---------------start------------->8---
> (widget-create 'tree-widget
>            :node '(push-button :tag
> "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" :format "%[%t%]\n")
>            `(tree-widget
>          :tag ,(with-temp-buffer
>              (set-fill-column 50)
>              (insert "bla bla bla bla bla bla bla bla bla bla bla bla bla
> bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
> bla bla bla bla bla bla bla bla bla bla bla")
>              (fill-paragraph)
>              (buffer-string)))
>            `(tree-widget
>          :tag ,(with-temp-buffer
>              (set-fill-column 60)
>              (insert "foo foo foo foo foo foo foo foo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
> foo foo foo foo foo foo foo foo foo foo foo")
>              (fill-paragraph)
>              (buffer-string)))
>            `(tree-widget
>          :tag ,(with-temp-buffer
>              (set-fill-column 70)
>              (insert "baz baz baz baz baz baz baz baz baz baz baz baz baz
> baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz baz
> baz baz baz baz baz baz baz baz baz baz baz")
>              (fill-paragraph)
>              (buffer-string))))
> --8<---------------cut here---------------end--------------->8---
>
> The problem is that only the first line has correct tree lines...
>
> But maybe that's still a pointer into the right direction.
>
> Bye,
> Tassilo
>
>
>
> </quote>
>
>

[-- Attachment #2: Type: text/html, Size: 4107 bytes --]

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

* Re: format text in TreeWidget.
  2011-01-10 20:53 format text in TreeWidget Alin Soare
  2011-01-10 21:04 ` Alin Soare
@ 2011-01-10 21:10 ` Chong Yidong
  1 sibling, 0 replies; 3+ messages in thread
From: Chong Yidong @ 2011-01-10 21:10 UTC (permalink / raw)
  To: Alin Soare; +Cc: emacs-orgmode, Emacs Dev

Alin Soare <as1789@gmail.com> writes:

> |- aaaaaaaaaaaaaaaaaaa
> |  aaaaaaaaaaaaaaaaaaa
> |- bbbbbbbbbbbbbbbbbbb
> | bbbbbbbbbbbbbbbbbbbb
> |-ccccccccccccccccccccccc
> `ccccccccccccccccccccccc
>
> Is there a function fill-paragraph for tree-mode ?

You could look at the value of (widget-get widget :indent) and emit a
string that is filled accordingly.

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

end of thread, other threads:[~2011-01-10 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-10 20:53 format text in TreeWidget Alin Soare
2011-01-10 21:04 ` Alin Soare
2011-01-10 21:10 ` Chong Yidong

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