all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* elpa package loading problem?
@ 2012-06-02 16:44 Xah Lee
  2012-06-04  8:58 ` José A. Romero L.
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Xah Lee @ 2012-06-02 16:44 UTC (permalink / raw)
  To: help-gnu-emacs

does anyone have problems with emacs package system?

recently, installed several packages with it: {“rainbow-mode”,
“bookmark+”, “smex”, “expand-region”}.

But they all have a similar problem related to autoload. For example,
let's say rainbow-mode. When in css, it's not loaded. You have to
manually call it. So, if you want it to load automatically when in
css, you have to add stuff to your init file. Then, this means the
package system does not really automatically manage things. You still
have know some elisp, and manually add things to your init file. (we
talking about basic activation, not advanced customization)

The issue is more pronounced with modes such as bookmark+, smex,
expand-region. For example, in bookmark+, when i start my emacs, call
bookmark 【Ctrl+x r l】, it gives a error about some current-bookmark-
file var not defined. Apparently, the problem is that bookmark+ must
be properly initialized before i start my bookmark. (when calling
bookmark-bmenu-list, it does automatically load bookmark+, but isn't
properly initialized) Here, i've spent some 20 min but haven't
succeeded in making it work. (i suppose i'll need to take time to
understand how elpa loading mechanism works.)

Similar things happen with smex, expand-region. For example, smex
requires you to define a key for M-x. So i added (global-set-key (kbd
"<apps>") 'smex) in my init. But after starting emacs, i press the
apps key, i get: “Symbol's function definition is void: smex”. If i
put (require 'smex), restart, i get “Debugger entered--Lisp error:
(file-error "Cannot open load file" "smex")”. Next step is to add the
load path, which i haven't tried yet. But that seems to defeat half of
goodness of package system.

Any insight on this?

for emacs 24, is this the way things are?


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

* Re: elpa package loading problem?
  2012-06-02 16:44 elpa package loading problem? Xah Lee
@ 2012-06-04  8:58 ` José A. Romero L.
  2012-06-04 19:18   ` José A. Romero L.
  2012-06-04 23:09   ` Xah Lee
  2012-11-29  7:09 ` Easior
       [not found] ` <mailman.14118.1354247749.855.help-gnu-emacs@gnu.org>
  2 siblings, 2 replies; 7+ messages in thread
From: José A. Romero L. @ 2012-06-04  8:58 UTC (permalink / raw)
  To: help-gnu-emacs

W dniu sobota, 2 czerwca 2012 18:44:29 UTC+2 użytkownik Xah Lee napisał:
> does anyone have problems with emacs package system?
> 
> recently, installed several packages with it: {“rainbow-mode”,
> “bookmark+”, “smex”, “expand-region”}.
(...)
> apps key, i get: “Symbol's function definition is void: smex”. If i
(...)
> Any insight on this?

AFAIK, ELPA relies heavily on correctly declared autoload cookies,
especially if you really want to avoid loading whole packages at
startup. From my own experience adapting SC to ELPA I know this is
not easy to get right from the beginning -- you, as a user, may end
needing to add the missing autoloads to the xxx-autoloads.el file
automatically generated by ELPA (this sucks big time, because your
added code is ditched away with every upgrade of the package). ELPA
works wonderfully well, but only if the authors of the packages you
happen to use did make that extra effort to get things right from the
start.

> for emacs 24, is this the way things are?

Yep, that's just the way it is. I'm afraid you'll have to submit a
few bug reports before things start working properly for you.

Cheers,
--
José A. Romero L.
escherdragon at gmail
"We who cut mere stones must always be envisioning cathedrals."
(Quarry worker's creed)


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

* Re: elpa package loading problem?
  2012-06-04  8:58 ` José A. Romero L.
@ 2012-06-04 19:18   ` José A. Romero L.
  2012-06-04 23:09   ` Xah Lee
  1 sibling, 0 replies; 7+ messages in thread
From: José A. Romero L. @ 2012-06-04 19:18 UTC (permalink / raw)
  To: help-gnu-emacs

> (...)
> > apps key, i get: “Symbol's function definition is void: smex”. If i
> (...)

BTW, for smex I've added this to my .emacs:

    (defun jarl/smex ()
      (interactive)
      (condition-case description
          (progn
            (smex-initialize)
            (global-set-key (kbd "M-x") 'smex)
            (global-set-key (kbd "M-X") 'smex-major-mode-commands)
            (global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
            (smex))
        (error (execute-extended-command))))
    (global-set-key (kbd "M-x") 'jarl/smex)

Cheers,
--
José A. Romero L.
escherdragon at gmail
"We who cut mere stones must always be envisioning cathedrals."
(Quarry worker's creed)



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

* Re: elpa package loading problem?
  2012-06-04  8:58 ` José A. Romero L.
  2012-06-04 19:18   ` José A. Romero L.
@ 2012-06-04 23:09   ` Xah Lee
  1 sibling, 0 replies; 7+ messages in thread
From: Xah Lee @ 2012-06-04 23:09 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 4, 1:58 am, José A. Romero L. <escherdra...@gmail.com> wrote:
> W dniu sobota, 2 czerwca 2012 18:44:29 UTC+2 użytkownik Xah Lee napisał:
>
> > does anyone have problems with emacs package system?
>
> > recently, installed several packages with it: {“rainbow-mode”,
> > “bookmark+”, “smex”, “expand-region”}.
> (...)
> > apps key, i get: “Symbol's function definition is void: smex”. If i
> (...)
> > Any insight on this?
>
> AFAIK, ELPA relies heavily on correctly declared autoload cookies,
> especially if you really want to avoid loading whole packages at
> startup. From my own experience adapting SC to ELPA I know this is
> not easy to get right from the beginning -- you, as a user, may end
> needing to add the missing autoloads to the xxx-autoloads.el file
> automatically generated by ELPA (this sucks big time, because your
> added code is ditched away with every upgrade of the package). ELPA
> works wonderfully well, but only if the authors of the packages you
> happen to use did make that extra effort to get things right from the
> start.
>
> > for emacs 24, is this the way things are?
>
> Yep, that's just the way it is. I'm afraid you'll have to submit a
> few bug reports before things start working properly for you.
>
> Cheers,
> --
> José A. Romero L.
> escherdragon at gmail
> "We who cut mere stones must always be envisioning cathedrals."
> (Quarry worker's creed)


Thanks a lot Jose. Very informative.

 Xah


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

* Re: elpa package loading problem?
  2012-06-02 16:44 elpa package loading problem? Xah Lee
  2012-06-04  8:58 ` José A. Romero L.
@ 2012-11-29  7:09 ` Easior
  2012-11-30  4:18   ` Jude DaShiell
       [not found] ` <mailman.14118.1354247749.855.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 7+ messages in thread
From: Easior @ 2012-11-29  7:09 UTC (permalink / raw)
  To: Xah Lee; +Cc: help-gnu-emacs

>>>>> "XL" == Xah Lee <xahlee@gmail.com> writes:

    XL> does anyone have problems with emacs package system?
    XL> recently, installed several packages with it: {“rainbow-mode”,
    XL> “bookmark+”, “smex”, “expand-region”}.

    XL> But they all have a similar problem related to autoload. For example,
    XL> let's say rainbow-mode. When in css, it's not loaded. You have to
    XL> manually call it. So, if you want it to load automatically when in
    XL> css, you have to add stuff to your init file. Then, this means the
    XL> package system does not really automatically manage things. You still
    XL> have know some elisp, and manually add things to your init file. (we
    XL> talking about basic activation, not advanced customization)

    XL> The issue is more pronounced with modes such as bookmark+, smex,
    XL> expand-region. For example, in bookmark+, when i start my emacs, call
    XL> bookmark 【Ctrl+x r l】, it gives a error about some current-bookmark-
    XL> file var not defined. Apparently, the problem is that bookmark+ must
    XL> be properly initialized before i start my bookmark. (when calling
    XL> bookmark-bmenu-list, it does automatically load bookmark+, but isn't
    XL> properly initialized) Here, i've spent some 20 min but haven't
    XL> succeeded in making it work. (i suppose i'll need to take time to
    XL> understand how elpa loading mechanism works.)

    XL> Similar things happen with smex, expand-region. For example, smex
    XL> requires you to define a key for M-x. So i added (global-set-key (kbd
    XL> "<apps>") 'smex) in my init. But after starting emacs, i press the
    XL> apps key, i get: “Symbol's function definition is void: smex”. If i
    XL> put (require 'smex), restart, i get “Debugger entered--Lisp error:
    XL> (file-error "Cannot open load file" "smex")”. Next step is to add the
    XL> load path, which i haven't tried yet. But that seems to defeat half of
    XL> goodness of package system.

    XL> Any insight on this?

    XL> for emacs 24, is this the way things are?

It's just my question. 

However, I also found something strange with package.el in emacs 24.
I installed command-frequency.el, info+.el, maxfame.el etc, by elpa.
Those package couldn't load properly if I add the following lines:

,------------------------------------------------
| (require 'command-frequency)
| (eval-after-load "info" '(require 'info+))
| (require 'maxframe)
| (add-hook 'window-setup-hook 'maximize-frame t)
`------------------------------------------------

to the file ~/.emacs. The *Bugtrace* reports that

If I adjust my dotemacs file as follows

,------------------------------------------------
| ;; (require 'command-frequency)
| ;; (eval-after-load "info" '(require 'info+))
| ;; (require 'maxframe)
| (add-hook 'window-setup-hook 'maximize-frame t)
`------------------------------------------------

then the maxframe.el works well while command-frequency.el and
info+.el didn't take any effects. I found those files named
<package>-<autoloads>.el when I entered into the elpa directory.
Based on these facts, I understand that 

* packages installed by elpa couldn't required in ~/.emacs since
  they would be autoloaded through the autoloads files. Furthermore,
  the autoloads files are generated from the ;;##autoload lines in
  package sources.
* maxfame.el works since the function, maximize-frame, is in the
  autoloads file.
* command-frequency.el doesn't work because there is nothing in its
  autoloads file. 

Is it right? 

Question: 

Is there a way to make info+.el, command-frequency.el run by elpa?
What can I do?

Thanks in advance.

Best regards,

Easior
-----
Ich bin von heute und ehedam, aber etwas ist in mir, das ist vor
morgen und übermorgen und einstmal.

                                     Friedrich Wilhelm Nietzsche




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

* Re: elpa package loading problem?
  2012-11-29  7:09 ` Easior
@ 2012-11-30  4:18   ` Jude DaShiell
  0 siblings, 0 replies; 7+ messages in thread
From: Jude DaShiell @ 2012-11-30  4:18 UTC (permalink / raw)
  To: Easior; +Cc: help-gnu-emacs, Xah Lee


I predict your time will be better spent reading through the tops of those 
.el files which is the lisp source code that elpa downloaded for you.  The 
elpa package isn't responsible for modifying your .emacs file that's for 
people on the recieving system to do.  Sometimes package paths will have 
to be added to the emacs PATH variable too.

--------------------------------------------------------------------------- 
jude <jdashiel@shellworld.net> Adobe fiend for failing to Flash





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

* Re: elpa package loading problem?
       [not found] ` <mailman.14118.1354247749.855.help-gnu-emacs@gnu.org>
@ 2012-11-30  4:53   ` Xah Lee
  0 siblings, 0 replies; 7+ messages in thread
From: Xah Lee @ 2012-11-30  4:53 UTC (permalink / raw)
  To: help-gnu-emacs

On Nov 28, 11:09 pm, Easior <eas...@126.com> wrote:
> …
> It's just my question.
>
> However, I also found something strange with package.el in emacs 24.
> I installed command-frequency.el, info+.el, maxfame.el etc, byelpa.
> Those package couldn't load properly if I add the following lines:
>
> ,------------------------------------------------
> | (require 'command-frequency)
> | (eval-after-load "info" '(require 'info+))
> | (require 'maxframe)
> | (add-hook 'window-setup-hook 'maximize-frame t)
> `------------------------------------------------
>
> to the file ~/.emacs. The *Bugtrace* reports that
>
> If I adjust my dotemacs file as follows
>
> ,------------------------------------------------
> | ;; (require 'command-frequency)
> | ;; (eval-after-load "info" '(require 'info+))
> | ;; (require 'maxframe)
> | (add-hook 'window-setup-hook 'maximize-frame t)
> `------------------------------------------------
>
> then the maxframe.el works well while command-frequency.el and
> info+.el didn't take any effects. I found those files named
> <package>-<autoloads>.el when I entered into theelpadirectory.
> Based on these facts, I understand that
>
> * packages installed byelpacouldn't required in ~/.emacs since
>   they would be autoloaded through the autoloads files. Furthermore,
>   the autoloads files are generated from the ;;##autoload lines in
>   package sources.
> * maxfame.el works since the function, maximize-frame, is in the
>   autoloads file.
> * command-frequency.el doesn't work because there is nothing in its
>   autoloads file.
>
> Is it right?
>
> Question:
>
> Is there a way to make info+.el, command-frequency.el run byelpa?
> What can I do?
>
> Thanks in advance.
>
> Best regards,
>
> Easior
> -----
> Ich bin von heute und ehedam, aber etwas ist in mir, das ist vor
> morgen und übermorgen und einstmal.
>
>                                      Friedrich Wilhelm Nietzsche


in general, you want to do

(package-initialize)

first before trying to do any config for packages from the package
system.

See update here, bottom:

〈Emacs 24 Package System Problems〉
http://ergoemacs.org/emacs/emacs_package_system_problem.html

also, i recommend using MELPA.

〈A Guide on Emacs 24 Package System〉
http://ergoemacs.org/emacs/emacs_package_system.html

command-frequency is obsolete. New is keyfreq.el. Please see bottom:

〈Emacs's Command Frequency〉
http://ergoemacs.org/emacs/command-frequency.html

 Xah


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

end of thread, other threads:[~2012-11-30  4:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-02 16:44 elpa package loading problem? Xah Lee
2012-06-04  8:58 ` José A. Romero L.
2012-06-04 19:18   ` José A. Romero L.
2012-06-04 23:09   ` Xah Lee
2012-11-29  7:09 ` Easior
2012-11-30  4:18   ` Jude DaShiell
     [not found] ` <mailman.14118.1354247749.855.help-gnu-emacs@gnu.org>
2012-11-30  4:53   ` Xah Lee

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.