[Top][All Lists]

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

[O] Invalid function: org-with-silent-modifications

From: Sebastien Vauban
Subject: [O] Invalid function: org-with-silent-modifications
Date: Thu, 26 Sep 2013 14:22:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)


Trying to provide batch Emacs/Org scripts to colleagues, I must ensure that
they have Org 8.

I wrote the following code so that users which have a default (Cygwin) Emacs
24.3.1 (with the default Org 7.9.3f) are proposed an upgrade through the
`package' manager:

--8<---------------cut here---------------start------------->8---
(require 'package)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/";))

;; version info
(let ((org-dir (file-name-directory (locate-library "org"))))
  (message "Org mode version %s (org @ %s)" (org-version) org-dir))

(unless (string-match "^8" (org-version))
  (message "This version of Org mode is no longer supported")
  (if (yes-or-no-p (format "Install package `%s'? " 'org))
        (package-install 'org))
    (setq debug-on-error nil)
    (error "Please upgrade to 8 or later")))
--8<---------------cut here---------------end--------------->8---

Problem experienced by colleagues: "Invalid function:

Looking on the web, I find a post [1] where Bastien tells:

    When installing from ELPA, please do so from a fresh Emacs session where no
    Org function has been called.

That wasn't the case in the above code, as I first had to call `org-version' to
check for their current version, then install from ELPA if they don't have an
Org 8...


- Is there a way to unload Org before installing from ELPA?  (= workaround)

or better:

- Is there a way to fix the problem?  (= solution)

Best regards,

[1] http://comments.gmane.org/gmane.emacs.orgmode/70880

Sebastien Vauban

reply via email to

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