emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Installing on windows


From: Charles Sebold
Subject: Re: [Orgmode] Installing on windows
Date: Wed, 04 Feb 2009 13:52:04 -0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (windows-nt)

On 4 Feb 2009, Bill Raynor wrote:

> I and many others would be grateful for a detailed step-by-step
> tutorial on installing org-mode on windows. The basic instructions
> work just fine on, say, OS X (edit makefile, make and make install)
> but don't work on windows.  Using emacs on windows is quite simple
> (download and install) but updating Org doesn't work so well.
>
> In the past I've used dired to attempt to compile the directory
> directly, which gets lots of error messages, but sort of works. I read
> a recent post on installing cygwin, but that doesn't quite work, as
> the post neglected to mention that you have to install cygwin + some
> unspecified packages (to get make, for instance). I trying that now.
> I am also using the W32 version of emacs.

Here's what I do (I'm running Emacs 22.3 provided by the FSF).  Using
this code, I don't ever run make, but I do need a version of makeinfo
in the path somewhere.  The "generate org-install" bit is lifted from
the Makefile, so it might have to change if the Makefile changes:

------------------------------------------------------------------------
(setq crs-org-path "/source/org") ; this is where I keep my git version
                                  ; of org
(setq org-actual-info-path "~/.emacs.d/info/org") ; this is where my
                                                  ; local info files
                                                  ; are

(defun crs-add-to-load-path (path-string &rest more-paths)
  (when path-string
    (message (format "Passed %S..." path-string))
    (when (file-exists-p path-string)
      (setq path-string (expand-file-name path-string))
      (message (format "Adding %S to load-path..." path-string))
      (add-to-list 'load-path path-string))
    (when more-paths
      (mapcar 'crs-add-to-load-path more-paths)))
  t)

(defun crs-newer-file-p (filename1 filename2)
  "Is FILENAME1 newer than FILENAME2?"
  (and (file-exists-p filename1)
       (file-exists-p filename2)
       (let ((first-time-mod (nth 5 (file-attributes filename1)))
             (second-time-mod (nth 5 (file-attributes filename2))))
         (or (> (car first-time-mod) (car second-time-mod))
             (and (= (car first-time-mod) (car second-time-mod))
                  (> (cadr first-time-mod) (cadr second-time-mod)))))))

; Add in GIT repository if it exists
(let ((org-lisp-path (concat crs-org-path "/lisp"))
      (org-docfile-path (concat crs-org-path "/doc/org")))
  (when (file-exists-p org-lisp-path)
    (crs-add-to-load-path org-lisp-path)
    ; recompile everything in this directory
    (byte-recompile-directory org-lisp-path 0 nil)
    ; generate and copy documentation
    (if (and (file-exists-p org-actual-info-path)
             (file-exists-p org-docfile-path)
             (crs-newer-file-p org-docfile-path org-actual-info-path))
        (copy-file org-docfile-path org-actual-info-path t)
      (when (and (or (not (file-exists-p org-docfile-path))
                     (crs-newer-file-p (concat org-docfile-path ".texi")
                                       org-docfile-path))
                 (file-exists-p (concat org-docfile-path ".texi")))
        (shell-command-to-string
         (concat "makeinfo --no-split "
                 (shell-quote-argument
                  (concat org-docfile-path ".texi"))
                 " -o "
                 (shell-quote-argument org-docfile-path)))
        (if (file-exists-p org-docfile-path)
            (copy-file org-docfile-path org-actual-info-path t)
          (message "Problem compiling org texinfo file?"))))
  ; generate org-install.el
    (when (or
           (not (file-exists-p (concat
                                org-lisp-path "/org-install.el")))
           (crs-newer-file-p (concat org-lisp-path "/Changelog")
                             (concat org-lisp-path "/org-install.el")))
      (let ((lispfiles0 (directory-files org-lisp-path
                                         nil "\\.el$" nil)))
        (find-file (concat org-lisp-path "/org-install.el"))
        (require 'autoload)
        (erase-buffer)
        (mapc (lambda (x) (generate-file-autoloads x)) lispfiles0)
        (insert "\n(provide (quote org-install))\n")
        (save-buffer)
        (kill-buffer nil)))))

; org-mode (current)
(require 'org-install)
------------------------------------------------------------------------

When I log in, most mornings, I run a batch file that "git pulls" the
latest from Carsten's repository, and then fires up Emacs for me to
handle the rest.

One nice thing about this is, if nothing has changed in my git
repository, then I don't notice any significant slowdown in booting, but
if it has, then I get the updated version.

If this seems convoluted, be aware at least that this is only about 2-3%
of a very long chain of things that my .emacs.d/init.el runs when I
start it up, and the functions I defined above get used in lots of other
places.
-- 
Charles Sebold                                     4th of February, 2009
GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) | Gnus v5.11 | org-mode 6.21trans
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]