all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to load .el file during startup and execute its commands (Win7/org8)
@ 2014-01-21 12:54 elwood151
  2014-02-10  9:28 ` Martin Beck
  0 siblings, 1 reply; 10+ messages in thread
From: elwood151 @ 2014-01-21 12:54 UTC (permalink / raw)
  To: emacs orgmode-mailinglist

[-- Attachment #1: Type: text/html, Size: 4190 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to load .el file during startup and execute its commands (Win7/org8)
  2014-01-21 12:54 How to load .el file during startup and execute its commands (Win7/org8) elwood151
@ 2014-02-10  9:28 ` Martin Beck
  2014-03-12  9:55   ` FW: " M
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Beck @ 2014-02-10  9:28 UTC (permalink / raw)
  To: emacs-orgmode

 <elwood151 <at> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* FW: How to load .el file during startup and execute its commands (Win7/org8)
  2014-02-10  9:28 ` Martin Beck
@ 2014-03-12  9:55   ` M
  2014-03-12 11:06     ` Jambunathan K
  2014-03-12 15:17     ` Bastien
  0 siblings, 2 replies; 10+ messages in thread
From: M @ 2014-03-12  9:55 UTC (permalink / raw)
  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...

 
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: FW: How to load .el file during startup and execute its commands (Win7/org8)
  2014-03-12  9:55   ` FW: " M
@ 2014-03-12 11:06     ` Jambunathan K
  2014-03-15  7:32       ` Martin Beck
  2014-03-12 15:17     ` Bastien
  1 sibling, 1 reply; 10+ messages in thread
From: Jambunathan K @ 2014-03-12 11:06 UTC (permalink / raw)
  To: M; +Cc: emacs orgmode-mailinglist

M <Elwood151@web.de> writes:

> have to load my settings file manually (open, eval-buffer, close) at
> each startup...

By hand, do

   M-x load-file RET path-to-file RET

Now after you have done this, do

  M-x list-command-history RET

And copy-paste the relevant portion to your .emacs.  That is all.  No
need to mess with load-path.

----------------------------------------------------------------

Here is what I get, when I follow the above sequence on one of my files.

    (load-file "~/.emacs.d/lisp/hx.el")

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: FW: How to load .el file during startup and execute its commands (Win7/org8)
  2014-03-12  9:55   ` FW: " M
  2014-03-12 11:06     ` Jambunathan K
@ 2014-03-12 15:17     ` Bastien
  2014-03-12 15:29       ` John Hendy
  2014-03-15  7:35       ` Martin Beck
  1 sibling, 2 replies; 10+ messages in thread
From: Bastien @ 2014-03-12 15:17 UTC (permalink / raw)
  To: M; +Cc: emacs orgmode-mailinglist

M <Elwood151@web.de> writes:

>  (load "org")

Replace this with (require 'org)

And make sure (1) you have been running ~$ make (or ~$ make autoloads)
in your Org directory.

If this does not work, please use M-x org-version RET and report the
exact version number.

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: FW: How to load .el file during startup and execute its commands (Win7/org8)
  2014-03-12 15:17     ` Bastien
@ 2014-03-12 15:29       ` John Hendy
  2014-03-12 16:14         ` Bastien
  2014-03-15  7:35       ` Martin Beck
  1 sibling, 1 reply; 10+ messages in thread
From: John Hendy @ 2014-03-12 15:29 UTC (permalink / raw)
  To: Bastien; +Cc: M, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

On Mar 12, 2014 10:17 AM, "Bastien" <bzg@gnu.org> wrote:
>
> M <Elwood151@web.de> writes:
>
> >  (load "org")
>
> Replace this with (require 'org)
>
> And make sure (1) you have been running ~$ make (or ~$ make autoloads)
> in your Org directory.
>

I thought requiring org wasn't required anymore?

John

> If this does not work, please use M-x org-version RET and report the
> exact version number.
>
> Thanks,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 773 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: FW: How to load .el file during startup and execute its commands (Win7/org8)
  2014-03-12 15:29       ` John Hendy
@ 2014-03-12 16:14         ` Bastien
  2014-03-12 18:08           ` John Hendy
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2014-03-12 16:14 UTC (permalink / raw)
  To: John Hendy; +Cc: M, emacs-orgmode

John Hendy <jw.hendy@gmail.com> writes:

> I thought requiring org wasn't required anymore?

Yes, it is not required, but better than (load "org").

-- 
 Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: FW: How to load .el file during startup and execute its commands (Win7/org8)
  2014-03-12 16:14         ` Bastien
@ 2014-03-12 18:08           ` John Hendy
  0 siblings, 0 replies; 10+ messages in thread
From: John Hendy @ 2014-03-12 18:08 UTC (permalink / raw)
  To: Bastien; +Cc: M, emacs-orgmode

On Wed, Mar 12, 2014 at 11:14 AM, Bastien <bzg@gnu.org> wrote:
> John Hendy <jw.hendy@gmail.com> writes:
>
>> I thought requiring org wasn't required anymore?
>
> Yes, it is not required, but better than (load "org").

Great -- just making sure I'm not goofing my own setup. Looks like he
actually has both:

#+begin_quote
 (require 'icicles)
     (require 'dired+)
     (require 'org)
     (require 'bookmark+)

     (load "org")
#+end_quote

John

>
> --
>  Bastien

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: FW: How to load .el file during startup and execute its commands (Win7/org8)
  2014-03-12 11:06     ` Jambunathan K
@ 2014-03-15  7:32       ` Martin Beck
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Beck @ 2014-03-15  7:32 UTC (permalink / raw)
  To: emacs-orgmode

Jambunathan K <kjambunathan <at> gmail.com> writes:

> 
> M <Elwood151 <at> web.de> writes:
> 
> > have to load my settings file manually (open, eval-buffer, close) at
> > each startup...
> 
> By hand, do
> 
>    M-x load-file RET path-to-file RET
> 
> Now after you have done this, do
> 
>   M-x list-command-history RET
> 

For my understanding: Is there a difference between load and load-file?

Anyway, thanks a lot! That helped me quickly finding the source of my 
2 real problems:

I first loaded the second .el file with my custom settings 
from my .emacs and then afterwards overwrote these custom
 agenda settings like the agenda-files with the following commands
 in my  .emacs, which had been inserted at the end of the
 .emacs file... :-( 
By placing the loading of my custom settings from the 2nd
 file at the end of my .emacs, the 
problem was solved.

The other problem was, that due to a permissions problem, 
the evaluation of my .emacs file was interrupted at the 
(server-start) command.. 

Kind regards

Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: FW: How to load .el file during startup and execute its commands (Win7/org8)
  2014-03-12 15:17     ` Bastien
  2014-03-12 15:29       ` John Hendy
@ 2014-03-15  7:35       ` Martin Beck
  1 sibling, 0 replies; 10+ messages in thread
From: Martin Beck @ 2014-03-15  7:35 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg <at> gnu.org> writes:

> >  (load "org")
> 
> Replace this with (require 'org)
> 
> And make sure (1) you have been running ~$ make (or ~$ make autoloads)
> in your Org directory.

Hi Bastien,
thanks a lot, I'll also change this, however the 2 real sources of the problem
 seemed to be  the following:

1) I had the load command for the .el file in the middle of my .emacs 
(not in the end) and then some agenda settings were overwritten by ,emacs 
again later.

2) the evaluation of my .emacs was interrupted somewhere in the middle
 due to permissions problems with the .emacs.d directory ...

Kind regards

Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-03-15  7:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 12:54 How to load .el file during startup and execute its commands (Win7/org8) elwood151
2014-02-10  9:28 ` Martin Beck
2014-03-12  9:55   ` FW: " M
2014-03-12 11:06     ` Jambunathan K
2014-03-15  7:32       ` Martin Beck
2014-03-12 15:17     ` Bastien
2014-03-12 15:29       ` John Hendy
2014-03-12 16:14         ` Bastien
2014-03-12 18:08           ` John Hendy
2014-03-15  7:35       ` Martin Beck

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.