all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mike Mattie <codermattie@gmail.com>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: emacs-devel@gnu.org
Subject: Re: user-controlled load-path extension: load-dir
Date: Mon, 7 Mar 2011 16:47:27 -0800	[thread overview]
Message-ID: <20110308004724.GA1952@event-horizon.homenet> (raw)
In-Reply-To: <871v2i525h.fsf@lifelogs.com>

[-- Attachment #1: Type: text/plain, Size: 5562 bytes --]

On Mon, Mar 07, 2011 at 10:24:58AM -0600, Ted Zlatanov wrote:
> On Sat, 5 Mar 2011 11:11:34 -0800 Chad Brown <yandros@MIT.EDU> wrote: 
> 
> CB> On Mar 4, 2011, at 7:18 PM, Ted Zlatanov wrote:
> >> 
> >> By analogy consider some of the software that lets you put a snippet in
> >> a conf.d directory, obviously implying that this is convenient for the
> >> user.  This is just a sampling from my machine:
> 
> CB> Those are all machine-wide configurations.  For that, use site-lisp.
> 
> Bazaar has a plugins directory; files in it are automatically activated,
> as an example of a user-level facility like this.  Anyhow, my point is
> that placing a file in a directory is inherently more modular and
> convenient to the user than augmenting a single file.  Do you disagree?
> 
> CB> If the user has to go through a set of steps to install and activate a
> CB> package, how isn't that what ELPA does?
> 
> They are not packages, they are snippets of code.  ELPA requires far
> more structure and many more steps.  For what I'm proposing, a lot less
> work is required (just a y/n prompt the first time a snippet is found to
> ensure it's not placed there maliciously).
> 

This whole security thing is a real non-issue. There is no security in
Emacs, it (Emacs) simply uses the underlying system security
model. What is really at issue is whether the user _trusts_ the
code. Trying to address security issues in a software system that has
no security API/model leads to some skewed thinking, and I am not just
splitting hairs. Thinking in terms of trust leads to better reasoning.

> On Sat, 5 Mar 2011 23:21:51 -0800 Mike Mattie <codermattie@gmail.com> wrote: 
> 
> MM> There are ways to solve the problem you are looking at without wiring more
> MM> logic into Emacs. Use the .emacs file as a more sophisticated loader for a
> MM> complex configuration when necessary.
> 
> I can and do, sure.  I don't think it creates a nice user experience.
> 
> MM> I have done this with my Grail project (on EmacsWiki), as has tidyconfig.
> MM> I would look at these solutions first before proposing code that has to
> MM> be wired into the bootstrap codepath.
> 
> Thanks for pointing those out.  Would Grail or tidyconfig work as a core
> option on startup (meaning the user doesn't have to install a package,
> just customize a boolean)?  Do they handle signing the snippets the
> first time they are found?  Can you give us a comparison of them and any
> other similar solutions you know?  They have to be GPL and assigned to
> Emacs to be included.

I doubt Grail would be included in-tree. Maybe I am wrong, but I get that
vibe. I would certianly need to convert some recursive functions to iterative
versions before even bringing Grail to the table. I have been maturing Grail
out-of-tree to ensure the code is robust, designed well, and is targetted at
typical user needs.

> 
> MM> There are a number of issues a reliable loader should address:
> 
> MM> how does it handle errors ?
> 
> MM> how does it handle --batch ?
> 
> MM> how does it handle --daemon ?
> 
> MM> how simple,transparent,debuggable is the loader code ?
> 
> MM> I have not seen any code so far in your proposal unless I accidentally
> MM> skipped or deleted a message with it.
> 
> I can write the code but haven't seen the need for actual code yet (I
> could have just comitted some code to Emacs instead, but find that
> option to be antisocial).
> 
> I'd rather use something that already exists such as Grail or tidyconfig
> that you kindly pointed out.  If you could tell us how any potential
> solutions can help answer the questions above, that would be wonderful.
> I can look at any solutions and evaluate them if you like.

I can only speak for grail, but Grail essentially Handles the
load-path issue. When it comes to load-path Grail is
comprehensive. What grail does not do is automatically load code from
a given directory. Directories that grail looks for are added to
load-path when they exist. Grail looks for files such as keys.el
commands.el, user.el and does load those when found.  They are assumed
to be user created files. When snippets are collected in a directory
such as dist/elisp, or local/elisp, the user is expected to place a
require or similar command in one of these recognized files to
actually load the snippet/whatever at the start.

As far as error-handling goes grail does shine a bit in that errors within
a file are trapped, meaning that mistakes in one file does not cause the
entire configuration to abort leading to a --debug-init situtation. In this
regard Grail is extremely robust.

I will be updating the documentation of Grail extensively over the next couple
few days to describe it's use, usefulness, limitations etc .. I will send you
a mail off-list when I have articulated Grail properly.

> 
> To answer your questions from my perspective, IMHO a loader should work
> like package.el.  IOW, whenever and however package.el is loaded
> currently, this loader we're discussing should also be loaded, since
> it's effectively a package manager but with snippets instead of
> packages.

I am seriously considering how to add the kind of functionality you want to
Grail. I would like to add it to broaden the usefullness of Grail. I do not
like the idea of hacking another load-path 'ish variable into Emacs when simply
adding elisp to manage load-path is an option. Two similar variables is simply
bad design.

> 
> Ted
> 
> 

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2011-03-08  0:47 UTC|newest]

Thread overview: 134+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 20:32 user-controlled load-path extension: load-dir Ted Zlatanov
2011-03-03 21:07 ` Dimitri Fontaine
2011-03-04  9:55   ` Julien Danjou
2011-03-04 17:18     ` Tom Tromey
2011-03-04 18:04       ` Ted Zlatanov
2011-03-04 18:37       ` Dimitri Fontaine
2011-03-04 19:35         ` Tom Tromey
2011-03-04 19:45           ` Dimitri Fontaine
2011-03-04 19:54             ` Ted Zlatanov
2011-03-04 20:21               ` Dimitri Fontaine
2011-03-04 20:25               ` Chad Brown
2011-03-04 20:46                 ` Ted Zlatanov
2011-03-05 19:24                   ` Chad Brown
2011-03-04 20:26               ` Chad Brown
2011-03-04 20:08             ` Tom Tromey
2011-03-04 20:24               ` Dimitri Fontaine
2011-03-04 21:17                 ` Tom Tromey
2011-03-04 21:33                   ` Dimitri Fontaine
2011-03-04 21:37                     ` Tom Tromey
2011-03-05  3:18                     ` Ted Zlatanov
2011-03-05 19:11                       ` Chad Brown
2011-03-06  7:21                       ` Mike Mattie
2011-03-07 16:24                         ` Ted Zlatanov
2011-03-07 17:18                           ` Chad Brown
2011-03-07 17:59                             ` Ted Zlatanov
2011-03-08 17:36                             ` Dimitri Fontaine
2011-03-08 18:30                               ` Chad Brown
2011-03-07 17:52                           ` Stefan Monnier
2011-03-07 20:39                             ` PJ Weisberg
2011-03-08  2:46                               ` Stefan Monnier
2011-03-08 10:26                                 ` Ted Zlatanov
2011-03-08 17:14                                   ` Chong Yidong
2011-03-08 18:47                                     ` Ted Zlatanov
2011-03-08 19:23                                       ` Julien Danjou
2011-03-09  2:54                                         ` Stefan Monnier
2011-03-09 19:57                                           ` Chong Yidong
2011-03-08 20:59                                   ` Stefan Monnier
2011-03-08 21:38                                     ` Ted Zlatanov
2011-03-09  7:06                                       ` Jan D.
2011-03-09  7:17                                         ` Christoph Scholtes
2011-03-09 10:01                                           ` Jan Djärv
2011-03-09 15:42                                             ` `custom-file' and init-file [was: user-controlled load-path extension: load-dir] Drew Adams
2011-03-09 17:54                                               ` `custom-file' and init-file Stephen J. Turnbull
2011-03-09 21:19                                               ` `custom-file' and init-file [was: user-controlled load-path extension: load-dir] Evans Winner
2011-03-09 21:39                                                 ` `custom-file' and init-file [was: user-controlled load-pathextension: load-dir] Drew Adams
2011-03-10  2:52                                                 ` `custom-file' and init-file [was: user-controlled load-path extension: load-dir] Stephen J. Turnbull
2011-03-09 17:29                                             ` user-controlled load-path extension: load-dir Stephen J. Turnbull
2011-03-09 18:18                                               ` Ted Zlatanov
2011-03-09 19:33                                                 ` Stephen J. Turnbull
2011-03-09 19:57                                                   ` Ted Zlatanov
2011-03-10  3:20                                                     ` Stephen J. Turnbull
2011-03-10  5:01                                                       ` Ted Zlatanov
2011-03-10  7:08                                                         ` Stephen J. Turnbull
2011-03-10 13:15                                                           ` Ted Zlatanov
2011-03-11  2:10                                                             ` Stephen J. Turnbull
2011-03-09 21:57                                         ` Mike Mattie
2011-03-10  7:08                                           ` Jan Djärv
2011-03-09  6:03                                   ` Mike Mattie
2011-03-09  7:20                                     ` Jan D.
2011-03-09 23:44                                       ` Mike Mattie
2011-03-08  0:47                           ` Mike Mattie [this message]
2011-03-08 10:37                             ` Ted Zlatanov
2011-03-09  6:26                               ` Mike Mattie
2011-03-09 11:26                                 ` Ted Zlatanov
  -- strict thread matches above, loose matches on Subject: below --
2011-03-08  7:14 Ben Key
2011-03-08  9:58 ` Evans Winner
2011-03-08 18:49   ` PJ Weisberg
2011-03-08 18:05 bug#8205: " Ben Key
2011-03-08 18:49 ` Ben Key
2011-03-08 20:01   ` Dimitri Fontaine
2011-03-08 20:25     ` Chad Brown
2011-03-08 20:38       ` Dimitri Fontaine
2011-03-08 22:40         ` Chad Brown
2011-03-09  9:36           ` Dimitri Fontaine
2011-03-09 11:52             ` Ted Zlatanov
2011-03-08 22:57     ` Ben Key
2011-03-09  3:28       ` Ben Key
2011-03-09  6:50         ` Ben Key
2011-03-09  7:29           ` Jan D.
2011-03-09 16:00             ` Ben Key
2011-03-09 11:39           ` Ted Zlatanov
2011-03-09 19:51       ` Chong Yidong
2011-03-09 20:08         ` Ben Key
2011-03-09 20:18         ` Ted Zlatanov
2011-03-09 20:32           ` Chong Yidong
2011-03-09 20:44             ` Ted Zlatanov
2011-03-10 11:30             ` Dimitri Fontaine
2011-03-10 14:27               ` Tom Tromey
2011-03-10 17:23                 ` Dimitri Fontaine
2011-03-10 18:33                   ` Tom Tromey
2011-03-10 18:56                     ` Chong Yidong
2011-03-10 19:32                       ` Eli Zaretskii
2011-03-10 20:30                       ` Dimitri Fontaine
2011-03-10 21:54                         ` Chong Yidong
2011-03-11  8:43                           ` Dimitri Fontaine
2011-03-10 19:36                     ` Jambunathan K
2011-03-11 15:00               ` chad
2011-03-11 17:41                 ` Dimitri Fontaine
2011-03-12  5:51                   ` chad
2011-03-12 10:09                     ` Jan Djärv
2011-03-11 18:51                 ` Ted Zlatanov
2011-03-16 14:16             ` Ted Zlatanov
2011-03-16 15:43               ` Stefan Monnier
2011-03-16 20:08                 ` Ted Zlatanov
2011-03-17  2:13                   ` Stefan Monnier
2011-03-17  3:34                     ` Ted Zlatanov
2011-03-17  4:42                       ` PJ Weisberg
2011-03-16 20:11               ` Evans Winner
2011-03-16 20:23                 ` Ted Zlatanov
2011-03-10  2:21         ` Stefan Monnier
2011-03-17  4:22 Ben Key
2011-03-17  6:31 ` Evans Winner
2011-03-17 10:55 ` Ted Zlatanov
2011-03-17 20:11   ` Stefan Monnier
2011-03-17 21:01     ` Ted Zlatanov
2011-03-17 21:05       ` Tom Tromey
2011-03-17 21:23         ` Ted Zlatanov
2011-03-17 22:50           ` Glenn Morris
2011-03-18  2:46             ` Ted Zlatanov
2011-03-18 10:56               ` Dimitri Fontaine
2011-03-18 13:07                 ` Ted Zlatanov
2011-03-18  2:21       ` Stefan Monnier
2011-03-19  4:10 Ben Key
2011-03-19 13:29 ` Juanma Barranquero
2011-03-19 16:07   ` Ben Key
2011-03-19 14:15 ` Ted Zlatanov
2011-03-20  2:58 ` Stefan Monnier
2011-03-20 12:05   ` Ted Zlatanov
2011-03-23 15:32     ` Ted Zlatanov
2011-03-23 20:33       ` Stefan Monnier
2011-03-24  0:03 Ben Key
2011-03-24 14:38 ` Stefan Monnier
2011-03-26 11:37   ` Ted Zlatanov
2011-04-02 18:35     ` Chong Yidong
2011-04-04  9:54       ` Ted Zlatanov

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=20110308004724.GA1952@event-horizon.homenet \
    --to=codermattie@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.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 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.