unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* general customize-like data editor?
@ 2016-12-14 15:02 Ted Zlatanov
  2016-12-14 16:30 ` raman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ted Zlatanov @ 2016-12-14 15:02 UTC (permalink / raw)
  To: emacs-devel

Several times[1] I've wished for a general data editor.

It would behave like Customize but at the data level. The closest I've
found is `eieio-customize-object' from eieio-custom.el. The EIEIO
facilities make a lot of sense for this, and I don't think it's a big
burden for packages to map their *editable* structures to defclasses,
even if they don't buy into it generally.

So my questions are:

1) are there non-EIEIO field editors, based on alists or plists when you
don't know all the fields in advance, but can specify their type? The
use case here is "I have a data structure with integer keys x, y, z; all
the rest should default to string editing."

2) inside Emacs, `eieio-customize-object' is only used by CEDET. Are
there other packages that use it? Any experiences, positive or negative?

3) currently `eieio-customize-object' is focused on editing a single
object. Are there table editors that would allow changing multiple
objects? For instance the process environment editor in
https://github.com/dgtized/list-environment.el could use that. The
use case here is "I have a data structure with a list of strings I'd
like to edit."

Clearly this parallels the Customize interface, which knows how to
validate and edit things like '(repeat string) etc. so if there are ways
to simply use that interface, that's probably easiest. But that doesn't
solve editing multiples as in (3) and seems to have a lot of hard-coded
behavior specific to customizing named variables. So I'm not sure what
to do.

Thanks
Ted


[1] https://github.com/vmware/govmomi/issues/646 and https://github.com/dgtized/list-environment.el/issues/2 for instance




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

* Re: general customize-like data editor?
  2016-12-14 15:02 general customize-like data editor? Ted Zlatanov
@ 2016-12-14 16:30 ` raman
  2016-12-14 17:52 ` Eric Abrahamsen
  2016-12-15  7:39 ` Andreas Röhler
  2 siblings, 0 replies; 4+ messages in thread
From: raman @ 2016-12-14 16:30 UTC (permalink / raw)
  To: emacs-devel

Ted Zlatanov <tzz@lifelogs.com> writes:

forms-mode?> Several times[1] I've wished for a general data editor.
>
> It would behave like Customize but at the data level. The closest I've
> found is `eieio-customize-object' from eieio-custom.el. The EIEIO
> facilities make a lot of sense for this, and I don't think it's a big
> burden for packages to map their *editable* structures to defclasses,
> even if they don't buy into it generally.
>
> So my questions are:
>
> 1) are there non-EIEIO field editors, based on alists or plists when you
> don't know all the fields in advance, but can specify their type? The
> use case here is "I have a data structure with integer keys x, y, z; all
> the rest should default to string editing."
>
> 2) inside Emacs, `eieio-customize-object' is only used by CEDET. Are
> there other packages that use it? Any experiences, positive or negative?
>
> 3) currently `eieio-customize-object' is focused on editing a single
> object. Are there table editors that would allow changing multiple
> objects? For instance the process environment editor in
> https://github.com/dgtized/list-environment.el could use that. The
> use case here is "I have a data structure with a list of strings I'd
> like to edit."
>
> Clearly this parallels the Customize interface, which knows how to
> validate and edit things like '(repeat string) etc. so if there are ways
> to simply use that interface, that's probably easiest. But that doesn't
> solve editing multiples as in (3) and seems to have a lot of hard-coded
> behavior specific to customizing named variables. So I'm not sure what
> to do.
>
> Thanks
> Ted
>
>
> [1] https://github.com/vmware/govmomi/issues/646 and https://github.com/dgtized/list-environment.el/issues/2 for instance
>
>

-- 



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

* Re: general customize-like data editor?
  2016-12-14 15:02 general customize-like data editor? Ted Zlatanov
  2016-12-14 16:30 ` raman
@ 2016-12-14 17:52 ` Eric Abrahamsen
  2016-12-15  7:39 ` Andreas Röhler
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Abrahamsen @ 2016-12-14 17:52 UTC (permalink / raw)
  To: emacs-devel

Ted Zlatanov <tzz@lifelogs.com> writes:

> Several times[1] I've wished for a general data editor.
>
> It would behave like Customize but at the data level. The closest I've
> found is `eieio-customize-object' from eieio-custom.el. The EIEIO
> facilities make a lot of sense for this, and I don't think it's a big
> burden for packages to map their *editable* structures to defclasses,
> even if they don't buy into it generally.
>
> So my questions are:
>
> 1) are there non-EIEIO field editors, based on alists or plists when you
> don't know all the fields in advance, but can specify their type? The
> use case here is "I have a data structure with integer keys x, y, z; all
> the rest should default to string editing."
>
> 2) inside Emacs, `eieio-customize-object' is only used by CEDET. Are
> there other packages that use it? Any experiences, positive or negative?

I've used it a grand total of once, and it works great. The code looks
like this:

(cl-defmethod ebdb-db-customize ((db ebdb-db))
  (require 'eieio-custom)
  (eieio-customize-object db))

(cl-defmethod eieio-done-customizing ((db ebdb-db))
  (setf (slot-value db 'dirty) t)
  (cl-call-next-method))

That's all I had to do! That plus :custom tags on the slot definitions.
The only thing I find a little awkward is that you end up having
semi-redundant information in the :type and :custom tags.

> 3) currently `eieio-customize-object' is focused on editing a single
> object. Are there table editors that would allow changing multiple
> objects? For instance the process environment editor in
> https://github.com/dgtized/list-environment.el could use that. The
> use case here is "I have a data structure with a list of strings I'd
> like to edit."

This example sounds like you're customizing a single object, with a
single slot, with a :type (list-of string) tag and a :custom (repeat
string) tag (see what I mean about semi-redundancy?). So far as I know,
this will work out of the box.

Actually editing multiple objects in one Customize buffer would probably
require new code.

Eric

> Clearly this parallels the Customize interface, which knows how to
> validate and edit things like '(repeat string) etc. so if there are ways
> to simply use that interface, that's probably easiest. But that doesn't
> solve editing multiples as in (3) and seems to have a lot of hard-coded
> behavior specific to customizing named variables. So I'm not sure what
> to do.
>
> Thanks
> Ted
>
>
> [1] https://github.com/vmware/govmomi/issues/646 and https://github.com/dgtized/list-environment.el/issues/2 for instance




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

* Re: general customize-like data editor?
  2016-12-14 15:02 general customize-like data editor? Ted Zlatanov
  2016-12-14 16:30 ` raman
  2016-12-14 17:52 ` Eric Abrahamsen
@ 2016-12-15  7:39 ` Andreas Röhler
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Röhler @ 2016-12-15  7:39 UTC (permalink / raw)
  To: emacs-devel



On 14.12.2016 16:02, Ted Zlatanov wrote:
> Several times[1] I've wished for a general data editor.
>
> to do.
>
> Thanks
> Ted
>
>
> [1] https://github.com/vmware/govmomi/issues/646 and https://github.com/dgtized/list-environment.el/issues/2 for instance
>
>

Hi Ted,

might be having some tools nearby. Please feel free to send me some 
example-code.

Cheers,
Andreas



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

end of thread, other threads:[~2016-12-15  7:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-14 15:02 general customize-like data editor? Ted Zlatanov
2016-12-14 16:30 ` raman
2016-12-14 17:52 ` Eric Abrahamsen
2016-12-15  7:39 ` Andreas Röhler

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