From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: compile-defun of function in package.el has no effect Date: Mon, 19 Oct 2015 13:54:51 +0200 Message-ID: <87h9lnrs38.fsf@web.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445255732 8991 80.91.229.3 (19 Oct 2015 11:55:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Oct 2015 11:55:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 19 13:55:23 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zo927-0008Sd-DG for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Oct 2015 13:55:19 +0200 Original-Received: from localhost ([::1]:38504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo926-0006zu-KN for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Oct 2015 07:55:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo91u-0006zi-AI for help-gnu-emacs@gnu.org; Mon, 19 Oct 2015 07:55:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zo91q-0002Hf-B2 for help-gnu-emacs@gnu.org; Mon, 19 Oct 2015 07:55:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:44138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo91q-0002H6-4E for help-gnu-emacs@gnu.org; Mon, 19 Oct 2015 07:55:02 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zo91o-0008GA-Bu for help-gnu-emacs@gnu.org; Mon, 19 Oct 2015 13:55:00 +0200 Original-Received: from ip-90-186-2-209.web.vodafone.de ([90.186.2.209]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Oct 2015 13:55:00 +0200 Original-Received: from michael_heerdegen by ip-90-186-2-209.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Oct 2015 13:55:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 63 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-90-186-2-209.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:Sp6Yrt6g7NYQjdV3+K/aOgu6NxU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107754 Archived-At: 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 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.