emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Achim Gratz <Stromeko@nexgo.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] `org-load-noerror-mustsuffix´ is not defined, introduced by 5484a33b
Date: Fri, 11 Jan 2013 13:19:21 -0700	[thread overview]
Message-ID: <87zk0fwjzq.fsf@gmail.com> (raw)
In-Reply-To: <87fw27cybb.fsf@Rainer.invalid> (Achim Gratz's message of "Fri, 11 Jan 2013 20:30:16 +0100")

Achim Gratz <Stromeko@nexgo.de> writes:

> Bastien writes:
>> Yep, typo.  But the 'mustsuffix trick is to force loading ".el" (and
>> not ".elc" files, right?  My question is: when is it necessary?
>
> The 'mustsuffix argument prevents consideration of the filename without
> the extensions listed in load-suffixes.  In other words, when you are
> trying to load feature 'x, a file named just "x" does not satisfy the
> requirement as it otherwise would.  On the other hand, it does not
> prevent using "x.el.gz" instead of "x.el" as 'nosuffix does.
>
>> I'm trying to consider real use-cases, with a sense of "real" close to
>> "not so improbable".  I don't see why Org should take care of users
>> who are pervert enough to gzip their org-loaddefs.el... but maybe I
>> lack imagination, as usual :)
>
> This is a real use case.  Installation with compression is a standard
> feature of Emacs and just currently not supported by the build system,
> mainly due to "little" problems like the above.  Emacs' current
> installer itself compresses the source files only when there's a
> byte-compiled file around, so any recent Emacs would automatically have
> a file "org-loaddefs.el" in load-path, although some packagers have
> their own ideas about this.  You should generally expect that the
> installed files, whether sources or byte-compiled files could have been
> compressed.
>
> Now if someone decides to compress the lisp folder for their own org
> installation and aren't taking care to exclude the autoload files, then
> this is what they get from 'emacs -Q":
>
> --8<---------------cut here---------------start------------->8---
> (require 'find-func)
> => find-func
> (find-library-name "org-loaddefs.el")
> => "/usr/local/share/emacs/24.2/lisp/org/org-loaddefs.el"
> (add-to-list 'load-path "~/lisp/org-mode/lisp")
> => (~/lisp/org-mode/lisp …)
> (find-library-name "org-loaddefs.el")
> "/home/gratz/lisp/org-mode/lisp/org-loaddefs.el.gz"
> (load "org-loaddefs.el" t nil t)
> => Loading /usr/local/share/emacs/24.2/lisp/org/org-loaddefs.el (source)...done
> --8<---------------cut here---------------end--------------->8---
>
> This is decidedly not what you wanted to achieve and outright devious,
> given that you don't even get the hint from *Messages* what file
> actually got loaded when the second argument to load is also "t".
>
> --8<---------------cut here---------------start------------->8---
> (require 'org-macs)
> (let ((load-suffixes (list ".el")))
>   (org-load-noerror-mustsuffix "org-loaddefs"))
> => Loading /home/gratz/lisp/org-mode/lisp/org-loaddefs.el.gz...
> => uncompressing org-loaddefs.el.gz...done
> => Loading /home/gratz/lisp/org-mode/lisp/org-loaddefs.el.gz...done
> --8<---------------cut here---------------end--------------->8---
>
> This on the other hand is what was intended to happen.
>
> The problem is that for the previous discussion "(require 'org-macs)"
> was effectively a NOP because 'org-macs was already loaded from a
> different place.  If you want to fix it, then that's where the effort
> should be directed (org-reload already does that and it's not difficult
> to do here either).
>
> […]
>> But I know your answer, `find-library' does not give the library from
>> which functions have been autoloaded.
>
> I might harp too much about this, but it's not the answer to this
> question.  But see above how find-library can fool you when you are
> actually using load with optional arguments instead.
>

These sounds like a Emacs-wide (or possibly find-library) issues, rather
than anything specific to Org, outlining, agendas or plain text notes.

Shouldn't this sort of discussion and development be taking place on
emacs-dev and in non-org Emacs libraries.

In my opinion the only reason to try to solve these issues in Org-mode
proper is if we are testing out new functionality which will eventually
be adopted by core Emacs.  Otherwise I would argue that such development
within Org-mode is a waste of Org-mode development time, effort and code
complexity.

At the least perhaps such load/require mechanisms should be extracted
into a separate library with no Org-mode specific code.  Then Org-mode
could make use of these libraries, but so could other large systems
distributed with Emacs but developed independently (e.g., gnus).

Best,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  reply	other threads:[~2013-01-11 20:19 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 16:08 [BUG] `org-load-noerror-mustsuffix´ is not defined, introduced by 5484a33b Eric Schulte
2013-01-10 16:29 ` Bastien
2013-01-10 16:38   ` Eric Schulte
2013-01-10 17:09     ` Bastien
2013-01-10 17:29       ` Eric Schulte
2013-01-10 17:44         ` Nick Dokos
2013-01-10 18:13           ` Eric Schulte
2013-01-10 18:44             ` Bastien
2013-01-10 19:28               ` Eric Schulte
2013-01-10 20:05                 ` Bastien
2013-01-10 21:12                   ` Eric Schulte
2013-01-10 22:24                     ` Eric Schulte
2013-01-10 22:45                       ` Nick Dokos
2013-01-10 23:05                       ` Bastien
2013-01-10 23:44                         ` Eric Schulte
2013-01-11  7:04                           ` Bastien
2013-01-11 12:28                             ` Bastien
2013-01-11 15:41                               ` Eric Schulte
2013-01-11 16:31                                 ` Bastien
2013-01-11 16:50                                 ` Achim Gratz
2013-01-11 16:40                               ` Achim Gratz
2013-01-11 16:58                                 ` Bastien
2013-01-11 17:04                                   ` Achim Gratz
2013-01-11 17:23                                     ` Bastien
2013-01-11 19:30                                       ` Achim Gratz
2013-01-11 20:19                                         ` Eric Schulte [this message]
2013-01-11 20:48                                           ` Achim Gratz
2013-01-12  6:57                                           ` Bastien
2013-01-12  6:56                                         ` Bastien
2013-01-12  7:44                                           ` Achim Gratz
2013-01-12  8:40                                             ` Bastien
2013-01-12 10:27                                               ` Achim Gratz
2013-01-12 11:03                                         ` Achim Gratz
2013-01-12 13:35                                           ` Bastien
2013-01-12 15:49                                             ` Achim Gratz
2013-01-12 16:06                                               ` Bastien
2013-01-12 16:17                                                 ` Achim Gratz
2013-01-12 16:12                                               ` Bastien
2013-01-12 16:24                                                 ` Achim Gratz
2013-01-11  9:12                           ` Achim Gratz
2013-01-10 23:27                       ` Stelian Iancu
2013-01-10 23:27                       ` Stelian Iancu
2013-01-10 20:09                 ` Achim Gratz
2013-01-10 22:30                   ` Eric Schulte
2013-01-10 22:55                     ` Nick Dokos
2013-01-11  8:58                     ` Achim Gratz
2013-01-10 19:37             ` Nick Dokos
2013-01-10 19:47 ` Achim Gratz
2013-01-13 22:08   ` Thorsten Jolitz
2013-01-13 23:06     ` Stelian Iancu
2013-01-13 23:22       ` Thorsten Jolitz
2013-01-14 21:44         ` Eric Schulte
2013-01-15  1:29           ` Thorsten Jolitz
2013-01-15  6:07             ` Eric Schulte
2013-01-15 11:31               ` Thorsten Jolitz
2013-01-15 12:22                 ` Nick Dokos
2013-01-15 13:36                   ` Thorsten Jolitz
2013-01-15 13:49                     ` Nick Dokos
2013-01-15 18:58                 ` Achim Gratz
2013-01-15 20:17                   ` Thorsten Jolitz

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.orgmode.org/

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

  git send-email \
    --in-reply-to=87zk0fwjzq.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=Stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.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/org-mode.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).