unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: Defcustoms, how do users find them?
Date: Thu, 26 Nov 2009 21:09:13 -0500	[thread overview]
Message-ID: <jwv1vjku4gx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <e01d8a50911260936y6033b563wbda79f0dee51404@mail.gmail.com> (Lennart Borgman's message of "Thu, 26 Nov 2009 18:36:17 +0100")

>> So it ends up increasing Emacs's footprint by a bit less than
>> a megabyte.  It's not the end of the world, but it might be worthwhile
>> trying to avoid loading this data unless it's really needed.
> The easiest seems to be to split cus-load.el in two part and only load
> this extra part in C-h v etc.

I think C-h v, C-h f and very common operations which most of the time
do not need this info, so I'd like to avoid eating up 1MB just for that.

>> Of course, maybe there's a way to represent the same info
>> more compactly
> I doubt it is possible, but I do not understand all the figures.
> Does it help to erase the data again after C-h v?

Erasing the data after use might be a way around the problem.
Note that in the form in which you currently store the data (Customize
symbol properties), it's difficult to unload it.

If you additionally split the data (e.g. based on the first letter),
you'd end up only loading a tenth of the data at a time, which would
seem a lot more reasonable.

>> or to load it piecemeal (e.g. I've been using a local
>> hack where C-h v foo-bar RET will try to load foo.el if foo-bar is not
>> yet defined).
> Doesn't it need this data?

No it does it by guessing that "foo-bar" is probably in file foo.el
based on the prefix, so it doesn't need any data at all, but then it
only works in some cases.  And doesn't provide any completion at all.

Obviously, this is just a hack.  But maybe it can be turned into
something more robust.  E.g. we could collect a list of unique prefixes
for each file, so we could then easily figure out from a variable name
(or from a prefix) which (set of) files might provide variables of
that name.  And this data should be fairly compact.  Better yet: it
could be used to check/encourage use of the coding convention that
asks to use unique prefixes for namespace management: well-coded
packages will use less prefixes/less resources.

The main interest for me here is that this should work for defvars and
defuns as well, without much additional cost.

Ideally such a feature should use autoload.el rather than cus-dep.el, so
it can also work for unbundled packages.


        Stefan




  reply	other threads:[~2009-11-27  2:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-16 21:11 Defcustoms, how do users find them? Lennart Borgman
2009-11-16 23:05 ` Stefan Monnier
2009-11-16 23:49   ` Lennart Borgman
2009-11-17  2:52     ` Stefan Monnier
2009-11-17  3:17       ` Lennart Borgman
2009-11-17  3:38         ` Stefan Monnier
2009-11-17  3:41           ` Lennart Borgman
2009-11-17 14:22             ` Lennart Borgman
2009-11-17 14:45               ` Lennart Borgman
2009-11-17 23:13                 ` Lennart Borgman
2009-11-18  3:26                   ` Stefan Monnier
2009-11-18  3:31                     ` Lennart Borgman
2009-11-18 14:34                       ` Stefan Monnier
2009-11-26 12:51                         ` Lennart Borgman
2009-11-26 16:42                           ` Lennart Borgman
2009-11-26 17:30                             ` Stefan Monnier
2009-11-26 17:36                               ` Lennart Borgman
2009-11-27  2:09                                 ` Stefan Monnier [this message]
2009-11-27  2:22                                   ` Lennart Borgman
2009-11-26 16:45                           ` Stefan Monnier
2009-11-17 10:03 ` Juri Linkov
2009-11-17 17:24   ` Glenn Morris
2009-11-18  9:57     ` Juri Linkov
2009-11-18 14:37       ` Stefan Monnier
2009-11-17 17:49   ` Drew Adams
2009-11-17 17:56     ` Lennart Borgman

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=jwv1vjku4gx.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    /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).