From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Invalid function: org-with-silent-modifications Date: Thu, 26 Sep 2013 14:22:24 +0200 Message-ID: <86fvsrixhb.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Cc: Bastien Hello, 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/")) (package-initialize) ;; 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)) (ignore-errors (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: org-with-silent-modifications". 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... So, - 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, Seb [1] http://comments.gmane.org/gmane.emacs.orgmode/70880 -- Sebastien Vauban