emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs Survey: Toolbars


From: Arthur Miller
Subject: Re: Emacs Survey: Toolbars
Date: Tue, 22 Dec 2020 18:52:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Tue, 22 Dec 2020 11:03:04 +0000
>> Cc: emacs-devel@gnu.org
>> From: Gregory Heytings via "Emacs development discussions." 
>> <emacs-devel@gnu.org>
>> 
>> > I've been trying for more than 10 years to urge people to work toward 
>> > giving Emacs the document capabilities of a word processor, but I have 
>> > not convinced people to do this work.
>> What do you mean by this?  I'm probably biased, but I don't see what 
>> important "capability of a word processor" is lacking in Emacs.

Personally I think Emacs is half-wysiwyg, or more then half by now. I
think there are almost all tools needed to implement a word processor a
lá Word already in Emacs; I think there is just some minor details
needed; like renderer that can draw efficient representation of a page
below a buffer text (a rectangle) and to tie the text editing stuff to
pixels rather then columns. I was experimenting with modelling a page in
Emacs in context of some other discussion, and that was what I found a
tad bit awkward.

But I am bad at Elisp, and what Emacs already has, so hopefully Eli will
step in and say: "we already have this."

To explain myself:

A word processor usually has some representation of page in paper
format. We can modell a page easily as a region; but it would take
work to implement text processing functions to work with "pages" (insert,
delete etc). It is not hard part, it is just labourous. Problem is when
presenting an empty page to the user to work with in Emacs windows. There is
need to draw some kind of rectangle representing page and user would
type in text above it. Emacs renderer has svg which can render
rectangles fast, but can it render below the buffer text? If it can then
you have everythign needed. I don't know how to do it though.

It is also a bit awkward to work with window-text-pixel-size and 
window-lines-pixel-dimensions because they need a text to being able to
calculate something. When buffer is empty, there is nothing to
calculate. There is need to tell Emacs: "I wish a buffer of this pixel
width and height". In some way. That is what I have seen as a problem,
but it is maybe possible, I am just not aware of funcionality I can use.

I have made a small demo, just roughly modelling a page. To overcome the
need for content in buffer in order to display something, the idea was to
insert "filler-spaces" so I could have something for renderer to
display. I ment to see if I can implement same behaviour as Emacs does
for invisible text: to restrict cursor motion into filler-spaces. But
I never come to that part. The idea was also to model columns, headers,
footers etc just regions in a buffer and to adjust insertion/deletion
routines for "page-mode" so cursor movement, and all the other editing
would look like in a word processor. For example deleteion would delete
a character but insert a filler-character, insertion would insert a
character but delete a filler-character and so on.

I think it is possible, it is just lots of labour I don't have time for
tht myself.

For illustration purpose I have attached the demo I worked on if anyone
would like to look at it, maybe continue or maybe just get an idea how
to implement it more efficiently. Paper size database has to be
evaluated forst, then page.el. It was just a small test I never got back
to, so take it just as a small illustration. Demo is font dependent so
with of the rendered page will depend on what font Emacs uses to
calculate (whatever is default). On my machine it is Anonymous Pro.

Attachment: page.el
Description: Text document

Attachment: paper-size-iso.el
Description: Text document


reply via email to

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