unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 44078@debbugs.gnu.org
Subject: bug#44078: 26.3; `tabulated-list-mode': Use it in any mode and for part of a buffer
Date: Tue, 20 Oct 2020 09:20:30 -0700 (PDT)	[thread overview]
Message-ID: <30886403-3940-456d-9d1a-5ced5a7baba6@default> (raw)
In-Reply-To: <87pn5dgmfj.fsf@gnus.org>

> > But for `tabulated-list-mode' I think we need more than just to add a
> > minor-mode version.  We really need a way to confine its effect to a
> > part of a buffer.
> 
> Whenever I've done some work on tabulated-list-mode, I've been kinda
> frustrated by its design.  You'd ideally just be able to have a
> functional interface where you just call a function with all the data
> (and some commands to apply to the data), and then everything would
> work.  But instead it's a strange mixture of functional, buffer-local
> data and updating functions.
> 
> A side effect of this is that the table isn't an "object" you can do
> operations on -- there can only be one table per buffer, and it wants to
> control the entire buffer.
> 
> So I'd welcome a more functional rewrite of tabulated-list-mode that
> would constrain all actions to the area of the buffer where the table
> is, and leave the rest of the buffer alone.  And stash the table data in
> the table instead of using the buffer-local variables.

I agree with all that you say.  And this is a great
summary of my feelings about the failings of t-m-mode:

  there can only be one table per buffer,
  and it wants to control the entire buffer

I don't expect this enhancement request to get traction
anytime soon.  And in fact I think that ultimately this
is related to the real need for some kind of reasonable,
robust, multiple-major-modes feature.

That might not be the best name, and there are multiple
ways to envision such things.  But wrt this request,
I'm thinking of an ability to, in the same buffer, have
tables that are governed by something like t-m-mode, but
without impacting the buffer mode in general or at least
other parts of the buffer.

The key-bindings part could likely be dealt with using
a `keymap' text property.  But t-m-mode is a major mode
so far, and there are its local variables to be dealt
with (and a mode hook, and maybe other buffer-related 
stuff).

Variables with values specific to a given span of text,
i.e., realized via text properties, might be a way to
deal with some of this.  Dunno, and dunno how that
might be realized.

Just thinking out loud.  I'm sure that others, who've
spent a lot of time trying to think about multiple
major modes, have a much better view of the obstacles
and possibilities in this regard.

It just seems to me that making t-m-mode a major mode
is a mistake.  You can't even add any additional text
to the buffer, outside the table - not even a heading.
It just kind of takes over a buffer, and that's quite
limiting.





      reply	other threads:[~2020-10-20 16:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 16:03 bug#44078: 26.3; `tabulated-list-mode': Use it in any mode and for part of a buffer Drew Adams
2020-10-20 11:35 ` Lars Ingebrigtsen
2020-10-20 16:20   ` Drew Adams [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=30886403-3940-456d-9d1a-5ced5a7baba6@default \
    --to=drew.adams@oracle.com \
    --cc=44078@debbugs.gnu.org \
    --cc=larsi@gnus.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).