From mboxrd@z Thu Jan 1 00:00:00 1970 From: M Subject: FW: How to load .el file during startup and execute its commands (Win7/org8) Date: Wed, 12 Mar 2014 10:55:56 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNftg-00030q-R0 for Emacs-orgmode@gnu.org; Wed, 12 Mar 2014 05:56:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNftI-00017N-FU for Emacs-orgmode@gnu.org; Wed, 12 Mar 2014 05:56:24 -0400 Received: from mout.web.de ([212.227.15.4]:55400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNftI-00016v-64 for Emacs-orgmode@gnu.org; Wed, 12 Mar 2014 05:56:00 -0400 Received: from [192.168.2.13] ([91.45.153.251]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0Lk8ko-1WzkWt42NG-00c5tE for ; Wed, 12 Mar 2014 10:55:58 +0100 In-Reply-To: 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-mailinglist Sorry for asking again, but this issue is still a big problem for me, as I have to load my settings file manually (open, eval-buffer, close) at each startup... =20 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? =20 My =B4Emacs`version: GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-29 on MARVIN =20 What I tried: =A0 =20 ## ~/.emacs in the file `~/.emacs` I have (among others) those lines: =20 =A0=A0=A0 (if (boundp 'org-mode-user-lisp-path) =A0=A0=A0=A0=A0=A0=A0 (add-to-list 'load-path org-mode-user-lisp-path) =A0=A0=A0=A0=A0 (add-to-list 'load-path (expand-file-name "~/org-mode/org_current/lisp"))) =A0=A0 =A0 =A0=A0=A0 (setq default-directory "C:/Users/mypath/" ) =A0=A0=A0 (if (boundp 'org-mode-user-contrib-lisp-path) =A0=A0=A0=A0=A0=A0=A0 (add-to-list 'load-path org-mode-user-contrib-lisp-path) =A0=A0=A0=A0=A0 (add-to-list 'load-path (expand-file-name "~/org-mode/org_current/contrib/lisp/")) =A0=A0=A0=A0=A0 (add-to-list 'load-path (expand-file-name "~/org-mode/morelisp/"))) =A0=A0 =A0 =A0=A0=A0 (require 'icicles) =A0=A0=A0 (require 'dired+) =A0=A0=A0 (require 'org) =A0=A0=A0 (require 'bookmark+) =A0=A0 =A0 =A0=A0=A0 (load "org") =20 and later =20 =A0=A0=A0 (load "C:/Users/mypath/org-config/myname_orgmodeconfig.el") =20 =A0 =20 ## C:/Users/mypath/org-config/myname_orgmodeconfig.el =20 contains =20 =20 =20 =A0=A0=A0 (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode)) =A0=A0 =A0 =A0=A0=A0 ;; Standard key bindings =A0=A0=A0 (global-set-key "\C-cl" 'org-store-link) =A0=A0=A0 (global-set-key "\C-ca" 'org-agenda) =A0=A0 =A0 =A0=A0=A0 (if (boundp 'org-user-agenda-files) =A0=A0=A0=A0=A0=A0=A0 (setq org-agenda-files org-user-agenda-files) =A0=A0=A0=A0=A0 (setq org-agenda-files (quote ("~/org" =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 )))) =20 So I try to use all org-files in the path `~/org` as agenda files. =20 When I launch `emacs`, I get the following result in the `*Messages` buffer: =20 =A0=A0=A0 Turning OFF Icicle mode...done =A0=A0=A0 Turning ON Icicle mode...done =A0=A0=A0 Turning OFF Icicle mode...done =A0=A0=A0 Turning ON Icicle mode...done =A0=A0=A0 Turning ON Icicle mode...done =A0=A0=A0 Turning OFF Icicle mode...done =A0=A0=A0 Loading c:/Users/mypath/org-mode/org_current/lisp/org.el (source)...done =A0=A0=A0 Loading c:/Users/mypath/org-config/myname_orgmodeconfig.el (source)...done =A0=A0=A0 Loading paren...done =A0=A0=A0 For information about GNU Emacs and the GNU system, type C-h C-a. =20 =20 =20 # The Problem =20 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. =20 =A0 =20 **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.** =20 How can I fix that? =20 Kind regards Martin