emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Charles Sebold <csebold@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Installing on windows
Date: Wed, 04 Feb 2009 13:52:04 -0600	[thread overview]
Message-ID: <uprhyc74r.fsf@gmail.com> (raw)
In-Reply-To: <bfcafcdc0902040919n7cf6efacm3ea78642fb388e0a@mail.gmail.com> (Bill Raynor's message of "Wed\, 4 Feb 2009 11\:19\:50 -0600")

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
 

  parent reply	other threads:[~2009-02-04 19:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 17:19 Installing on windows Bill Raynor
2009-02-04 17:47 ` Saurabh Agrawal
2009-02-04 17:48 ` Manish
2009-02-04 18:07   ` Saurabh Agrawal
2009-02-05  2:01     ` Manish
2009-02-05  5:02       ` Saurabh Agrawal
2009-02-05  5:14         ` Manish
2009-02-05  5:18           ` Cameron Horsburgh
2009-02-05  5:30             ` Manish
2009-02-05  6:11               ` Cameron Horsburgh
2009-02-05  7:53                 ` Manish
2009-02-05  8:25                   ` Cameron Horsburgh
2009-02-06  7:15           ` Saurabh Agrawal
2009-02-06  8:05             ` Manish
2009-02-06 11:26               ` Saurabh Agrawal
     [not found]                 ` <e7cdbe30902060434y5a5011eep1a2567f5facce184@mail.gmail.com>
2009-02-06 13:07                   ` Saurabh Agrawal
2009-02-06 19:52                     ` Manish
2009-02-06 21:24                       ` Chris McMahan
2009-02-06 23:30                         ` Sebastian Rose
2009-02-07  8:20                           ` Manish
2009-02-04 18:16   ` Bill Raynor
2009-02-04 19:52 ` Charles Sebold [this message]
2009-02-05  9:38 ` Tony Mc
  -- strict thread matches above, loose matches on Subject: below --
2009-02-06 23:19 Tim O'Callaghan
2009-02-07  9:09 ` Manish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uprhyc74r.fsf@gmail.com \
    --to=csebold@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).