all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: compile-defun of function in package.el has no effect
Date: Mon, 19 Oct 2015 13:54:51 +0200	[thread overview]
Message-ID: <87h9lnrs38.fsf@web.de> (raw)
In-Reply-To: bd59d9dd-b02b-4bbb-9496-7e90b26be505@googlegroups.com

eric.scott@acm.org writes:

> I'm having some trouble getting a package (elpy) installed with the
> package manager,

FWIW; I can install it without any problems with my Emacs 25.

> and thought I'd take this as an opportunity to learn a little bit
> about how package.el works. However, I'm finding it hard to add
> tracing statements because no changes I make in the code seem to be
> taking.
>
> For example I added the word 'the' to this expression in
> package.el/package-menu-execute():
>
>       (if (yes-or-no-p
> 	   (if (= (length install-list) 1)
> 	       (format "Install the package `%s'? " (car
> install-list))
>                ...))))
>
> then executed M-x compile-defun on it.

The standard way to eval a piece of code in a buffer is to put the
cursor after it and hit C-x C-e, but AFAICT M-x compile-defun should
work as well.

> There were no complaints, but when I tried again to install the
> package, my edit did not appear i.e.: instead of "Install the package
> 'elpy'?" I got the old version 'Install package 'elpy'?
>
> As I understand it, 'compile-defun should dynamically bind the
> byte-compiled new definition to the unique symbol
> 'package-menu-execute, but clearly it's not binding it, or the symbol
> is not unique, or something is coming along later and changing it
> back.

You can check the function binding of a symbol; in this case:

  M-: (symbol-function 'package-menu-execute) RET

This may be byte code of course.

> The value of M-x locate-library <package> is
> /usr/share/emacs/24.3/lisp/emacs-lisp/package.elc
>
> I tried byte-compiling the whole package.el file (as linked from the
> stack trace) and copying it to that position, and there is still no
> effect after restarting.

Are you sure you are changing the right function?  You can check with
`trace-function'.

> BTW, the error I'm getting when trying to install elpy is 'package
> emacs-24.1 is unavailable'. I'm running v 24.3.

Dunno why you get this.  But if you are able to modify files under
"/usr/share/emacs/24.3/lisp/emacs-lisp" (not a good idea IMHO, you may
risk breaking your whole installation), maybe you can just upgrade to a
more recent Emacs version?  The problem may be gone then.


Michael.




  reply	other threads:[~2015-10-19 11:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-18 16:48 compile-defun of function in package.el has no effect eric.scott
2015-10-19 11:54 ` Michael Heerdegen [this message]
     [not found] ` <mailman.630.1445255709.7904.help-gnu-emacs@gnu.org>
2015-10-19 14:21   ` Joost Kremers
2015-10-19 20:25 ` Stefan Monnier

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=87h9lnrs38.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@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 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.