From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: A problem with eval-after-load Date: Wed, 16 Oct 2013 11:13:14 +0200 Organization: WMI UAM Message-ID: <20131016111314.7fa2ccc9@aga-netbook> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1381941572 18554 80.91.229.3 (16 Oct 2013 16:39:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Oct 2013 16:39:32 +0000 (UTC) To: GNU Emacs users list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 16 18:39:37 2013 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 1VWU8H-0000iG-CU for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 18:39:37 +0200 Original-Received: from localhost ([::1]:48366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWU8H-0007EN-0E for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 12:39:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWNAT-0004ei-Cl for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 05:13:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWNAN-0003FE-IH for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 05:13:25 -0400 Original-Received: from msg.wmi.amu.edu.pl ([150.254.78.50]:55017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWNAN-0003Ee-BR for help-gnu-emacs@gnu.org; Wed, 16 Oct 2013 05:13:19 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 093E14E1E1 for ; Wed, 16 Oct 2013 11:13:16 +0200 (CEST) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zBLIKjMU1QV6 for ; Wed, 16 Oct 2013 11:13:15 +0200 (CEST) Original-Received: from aga-netbook (99-52.echostar.pl [213.156.99.52]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id D10724E1CC for ; Wed, 16 Oct 2013 11:13:15 +0200 (CEST) X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.17; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 150.254.78.50 X-Mailman-Approved-At: Wed, 16 Oct 2013 12:39:21 -0400 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:94043 Archived-At: Hi all, I have a problem with eval-after-load. (In fact, this is one of the reasons I subscribed to this list;).) I have something like this in my init.el: (eval-after-load 'org-tree-slide '(setq org-tree-slide-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "") 'org-tree-slide-content) (define-key map (kbd "") 'org-tree-slide-move-previous-tree) (define-key map (kbd "") 'org-tree-slide-move-next-tree) map))) (load-file "~/some/path/org-tree-slide/org-tree-slide.el") The rationale is that I did not like the default keybindings of org-tree-slide (which is an Org-mode based simple presentation tool). The problem is that this doesn't work: the keymap is not updated. When I load the org-tree-slide.el *manually*, somehow it gets updated. (It is a bit embarassing that I noticed it before I posted this blog post: http://mbork.pl/2013-10-09_Better_keymap_for_org-tree-slide , but I didn't notice this at first. I will update the said post as soon as I understand what's going on here.) Of course, I could just get rid of eval-after-load and change the order of the loading and redefining the keymap - but I want to know what's the problem. (Initially, I didn't want to load org-tree-slide by default, hence the eval-after-load stuff. Then, I decided it won't hurt to have it loaded always. I should probably learn to use autoload.) Am I doing something wrong? (PS. org-mode-slide.el *does* say (provide 'org-tree-slide).) Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University