all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "David O'Toole" <dto@gnu.org>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Spreadsheet display mode
Date: Sat, 24 Nov 2007 06:49:24 -0500	[thread overview]
Message-ID: <64bfe3d50711240349m6e9d2100n4ffcf9d5607bb8ff@mail.gmail.com> (raw)
In-Reply-To: <E1IvlSD-0007IZ-OJ@fencepost.gnu.org>

Hi Richard,

On Nov 23, 2007 10:13 PM, Richard Stallman <rms@gnu.org> wrote:

> In your design, the buffer holds the text as it is displayed,
> and the real underlying text is somewhere else.

This isn't quite correct---actions in a cell-mode spreadsheet don't
inherently cause updates to some other text that actually represents
the spreadsheet data (i.e. formulas.) That is more like how SES works.
In contrast, most of the stuff I've done with cell-mode involved cells
with cl structs in them, each typically having some function-valued
slots, and different user actions could trigger different functions.

> In the design I have in mind, the real, underlying text is in the
> buffer, so editing operates on the underlying text.

This is good for formulas and quite a bit else, so I would like to
support this in cell-mode. But I can think of situations where I would
not want it to act this way.

For example, I wrote a little program that uses cell-mode to display a
grid of colored squares. You can issue cell-mode commands that tell
the cell to change its color, etc. Once you've drawn something, you
can invoke another command to generate a buffer with an XPM version of
the image, as text. It sounds like what you are suggesting is that
each editing operation (i.e. color change in a pixel) would result in
an immediate corresponding update to the XPM text. But I don't know if
it makes sense to parse the XPM buffer and figure out which bits need
to be updated for every editing operation (especially since the number
of characters per pixel etc. can vary) instead of just generating the
XPM all at once when it's time to save (or autosave.)

In short, I would rather write a function that translates Lisp data to
XPM (and another function to do the reverse) than edit an image by
making repeated changes to its ASCII representation. (I don't think
XPM was ever intended as an in-memory format for dealing with
pixmaps.)

I can imagine other, similar situations. For example, using cell-mode
to replace the default display of dired, buffer-list, and other
interactive-table stuff--- what would the "real text" be, which we
were supposed to update on every operation, if the spreadsheet
represents a list of Emacs buffers or external processes?

I think the real gain would be allowing the spreadsheet (when
appropriate) to explicitly NOT correspond to some block of text in
another buffer.

> The columnar
> display form would NOT be in the buffer.  It would be generated
> inside the display code under the control of this new feature.
>
> Maybe we could combine the two ideas using a hidden buffer.  Your code
> could operate on the user-visible buffer, generating text in another
> buffer, and redisplay would use part of that other buffer in place of
> parts of the user-visible buffer.

Hmm.

I'd like to understand a bit more clearly what you envision for the C
part (i.e. "this new feature") and how it would fit in with the other
special display property stuff. This would help me figure out if I can
adapt cell-mode into something suitable.

 Actually it sounds like there are three distinct parts:

 - A user-interface library that can draw fancy spreadsheets and help
the user interact with grids of arbitrary Lisp objects (insert/delete
rows/columns and other basic spreadsheet stuff).
 - Applications that use the UI as a front-end (potentially SES,
org-table, dired etc)
 - A new feature in the display code of Emacs (written in C) that
makes this all possible. Can you be more specific about this part? It
sounds a little bit like indirect buffers.

--Dave

  reply	other threads:[~2007-11-24 11:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-23  1:03 Spreadsheet display mode David O'Toole
2007-11-23  8:18 ` Bastien
2007-11-24  3:12   ` Richard Stallman
2007-11-23 12:03 ` Johan Bockgård
2007-11-23 13:35   ` Johan Bockgård
2007-11-24 15:20     ` Richard Stallman
2007-11-23 14:00   ` David O'Toole
2007-11-24  3:13 ` Richard Stallman
2007-11-24 11:49   ` David O'Toole [this message]
2007-11-24 22:05     ` Richard Stallman
2007-11-25  5:31       ` David O'Toole
  -- strict thread matches above, loose matches on Subject: below --
2007-11-22 16:23 Richard Stallman
2007-11-22 19:19 ` Glenn Morris
2007-11-23  4:35   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64bfe3d50711240349m6e9d2100n4ffcf9d5607bb8ff@mail.gmail.com \
    --to=dto@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.