From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Beck Subject: Re: How to load .el file during startup and execute its commands (Win7/org8) Date: Mon, 10 Feb 2014 09:28:31 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCnAn-0000en-3D for emacs-orgmode@gnu.org; Mon, 10 Feb 2014 04:29:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCnAf-0003gA-QS for emacs-orgmode@gnu.org; Mon, 10 Feb 2014 04:29:05 -0500 Received: from plane.gmane.org ([80.91.229.3]:55774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCnAf-0003g6-Jt for emacs-orgmode@gnu.org; Mon, 10 Feb 2014 04:28:57 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WCnAd-00013j-RK for emacs-orgmode@gnu.org; Mon, 10 Feb 2014 10:28:55 +0100 Received: from mail.polytec.de ([213.144.13.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Feb 2014 10:28:55 +0100 Received: from elwood151 by mail.polytec.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Feb 2014 10:28:55 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org web.de> writes: > I'm trying to use a custom setup for `org-mode 8.2` on `Windows 7`, but it >does not work as expected. Sorry for pushing that, but is very annoying to have to load the file manually at each startup. Could anyone tell me if I'm doing something wrong here? My ´Emacs`version: GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-29 on MARVIN What I tried:   ## ~/.emacs in the file `~/.emacs` I have (among others) those lines:     (if (boundp 'org-mode-user-lisp-path)         (add-to-list 'load-path org-mode-user-lisp-path)       (add-to-list 'load-path (expand-file-name "~/org-mode/org_current/lisp")))          (setq default-directory "C:/Users/mypath/" )     (if (boundp 'org-mode-user-contrib-lisp-path)         (add-to-list 'load-path org-mode-user-contrib-lisp-path)       (add-to-list 'load-path (expand-file-name "~/org-mode/org_current/contrib/lisp/"))       (add-to-list 'load-path (expand-file-name "~/org-mode/morelisp/")))          (require 'icicles)     (require 'dired+)     (require 'org)     (require 'bookmark+)          (load "org") and later     (load "C:/Users/mypath/org-config/myname_orgmodeconfig.el")   ## C:/Users/mypath/org-config/myname_orgmodeconfig.el contains     (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))          ;; Standard key bindings     (global-set-key "\C-cl" 'org-store-link)     (global-set-key "\C-ca" 'org-agenda)          (if (boundp 'org-user-agenda-files)         (setq org-agenda-files org-user-agenda-files)       (setq org-agenda-files (quote ("~/org"                                  )))) So I try to use all org-files in the path `~/org` as agenda files. When I launch `emacs`, I get the following result in the `*Messages` buffer:     Turning OFF Icicle mode...done     Turning ON Icicle mode...done     Turning OFF Icicle mode...done     Turning ON Icicle mode...done     Turning ON Icicle mode...done     Turning OFF Icicle mode...done     Loading c:/Users/mypath/org-mode/org_current/lisp/org.el (source)...done     Loading c:/Users/mypath/org-config/myname_orgmodeconfig.el (source)...done     Loading paren...done     For information about GNU Emacs and the GNU system, type C-h C-a. # The Problem So I assume, as the file `myname_orgmodeconfig.el` has been loaded, all the elisp code inside should have been executed and it should have also set my agenda files.   **However, the list of agenda files is empty after startup. When I then _manually_ ofen the file `myname_orgmodeconfig.el` and execute the command `eval-buffer`, everything is fine.** How can I fix that? Kind regards Martin