all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Seeking advice on writing a "line-based" major mode
@ 2015-06-07 21:16 Marcin Borkowski
  2015-06-08  2:17 ` Drew Adams
  2015-06-08 13:37 ` Tom Tromey
  0 siblings, 2 replies; 23+ messages in thread
From: Marcin Borkowski @ 2015-06-07 21:16 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi all,

I'm going to start coding a major mode, a bit like dired or grep-mode or
org-agenda mode, in which the buffer will contain a bunch of lines, each
of them correspoding to some object (basically, I have a vector of these
"objects", and I want to display them in some way).

This raises two problems.

1. I want to be able to display these objects using some kind of
a "template" (not unlike org's "property table", or dired's format
etc.).  I'd like this "template" to be configurable using a user option
(with possibilities like "x characters for a name, then y characters for
description, etc. for other fields").

2. When the point is one one of these lines, I want various keybindings
to perform some actions on the object in question (like, again, in
Dired or org-agenda).

Is there anything in Emacs or its libraries which might help with these
tasks?  For instance, each "object" is identified by a name (it's the
"primary key", so to speak), but it need not be e.g. the first thing on
the line.  The displaying function could use text properties of the
particular lines so that Emacs knows which object to act upon when point
is in some place, but maybe there is a ready-made library for that?

And maybe there is even a more general library to establish
a correspondence between some vector/list of objects and a buffer whose
lines contain some textual representation of these objects, so that
I wouldn't have to code e.g. the displaying routine from scratch?

Of course I could code all that myself - it doesn't seem to be too much
work - but why reinvent the wheel?

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 23+ messages in thread
[parent not found: <mailman.4548.1433712325.904.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2015-07-19  0:26 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-07 21:16 Seeking advice on writing a "line-based" major mode Marcin Borkowski
2015-06-08  2:17 ` Drew Adams
2015-06-18  8:06   ` Marcin Borkowski
2015-06-18 16:10     ` Drew Adams
2015-06-18 18:47       ` Marcin Borkowski
2015-06-18 19:50         ` Drew Adams
2015-06-18 20:44           ` Marcin Borkowski
2015-06-18 21:28             ` Drew Adams
2015-07-18 23:20           ` Marcin Borkowski
2015-07-19  0:26             ` Robert Thorpe
     [not found]     ` <mailman.5261.1434643820.904.help-gnu-emacs@gnu.org>
2015-06-18 16:23       ` Emanuel Berg
     [not found]   ` <mailman.5215.1434614824.904.help-gnu-emacs@gnu.org>
2015-06-18 15:57     ` Emanuel Berg
2015-06-18 22:01       ` Emanuel Berg
2015-06-20  1:28         ` Emanuel Berg
2015-06-08 13:37 ` Tom Tromey
2015-06-17 21:14   ` Marcin Borkowski
     [not found]   ` <mailman.5205.1434575686.904.help-gnu-emacs@gnu.org>
2015-06-18  1:50     ` Stefan Monnier
2015-06-18  7:58       ` Marcin Borkowski
     [not found] <mailman.4548.1433712325.904.help-gnu-emacs@gnu.org>
2015-06-07 22:23 ` Emanuel Berg
2015-06-07 22:48   ` Marcin Borkowski
2015-06-07 22:28 ` Emanuel Berg
2015-06-07 22:49   ` Marcin Borkowski
2015-06-08  0:09 ` Joost Kremers

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.