From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: =?UTF-8?B?UmU6IFtCVUddIGBvcmctbG9hZC1ub2Vycm9yLW11c3RzdWZmaXg=?= =?UTF-8?B?wrQgaXMgbm90IGRlZmluZWQsIGludHJvZHVjZWQgYnkgNTQ4NGEzM2I=?= Date: Sat, 12 Jan 2013 12:03:48 +0100 Message-ID: <876232mzmz.fsf@Rainer.invalid> References: <87a9sh3tsp.fsf@gmail.com> <877gnlknlx.fsf@bzg.ath.cx> <87sj69ro12.fsf@gmail.com> <87pq1dj76n.fsf@bzg.ath.cx> <87hamprlob.fsf@gmail.com> <11306.1357839845@alphaville> <874niosy6w.fsf@gmail.com> <87txqodgix.fsf@bzg.ath.cx> <87txqovnv3.fsf@gmail.com> <874niodcry.fsf@bzg.ath.cx> <87vcb4spxe.fsf@gmail.com> <8738y8n0b2.fsf@gmail.com> <87lic0bpwj.fsf@bzg.ath.cx> <87hamo7gdk.fsf@gmail.com> <87wqvk9p5f.fsf@bzg.ath.cx> <87ehhrhpjl.fsf@bzg.ath.cx> <87sj67d662.fsf@Rainer.invalid> <87a9sf1wsl.fsf@bzg.ath.cx> <87k3rjd51k.fsf@Rainer.invalid> <87obgvzlah.fsf@bzg.ath.cx> <87fw27cybb.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttyt7-0006qQ-0I for emacs-orgmode@gnu.org; Sat, 12 Jan 2013 06:04:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ttysy-0008Ik-1M for emacs-orgmode@gnu.org; Sat, 12 Jan 2013 06:04:32 -0500 Received: from plane.gmane.org ([80.91.229.3]:36618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ttysx-0008Ie-Lv for emacs-orgmode@gnu.org; Sat, 12 Jan 2013 06:04:23 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ttyt8-000657-H2 for emacs-orgmode@gnu.org; Sat, 12 Jan 2013 12:04:34 +0100 Received: from pd9eb4193.dip.t-dialin.net ([217.235.65.147]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Jan 2013 12:04:34 +0100 Received: from Stromeko by pd9eb4193.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Jan 2013 12:04:34 +0100 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Achim Gratz writes: > The problem is that for the previous discussion "(require 'org-macs)" > was effectively a NOP because 'org-macs was already loaded from a > different place. If you want to fix it, then that's where the effort > should be directed (org-reload already does that and it's not difficult > to do here either). The attached patch series will implement a workaround that unloads any features that have already been loaded with a different load-path so that the correct files from the current load-path will prevail. This should solve the reported problems with the init file using parts of Org before the load-path is set up. The implementation uses unload-feature, so customizations loaded previously (instead of at the very end as they should) might vanish. Please report if any init systems do this. Package manager will still fail in certain situations when Org is installed via ELPA in an Emacs session that has already used another version of Org. This needs to be fixed in package manager, there's no workaround to do this from Org's side. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Revert-org.el-org-loaddefs.el-use-load-not-org-load-.patch >From c6b5e0daafb2f6e43ba936a85969b134037ff912 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sat, 12 Jan 2013 08:55:07 +0100 Subject: [PATCH 1/3] Revert "org.el ("org-loaddefs.el"): use `load', not `org-load-noerror-mustsuffix'" This reverts commit db7ece9fa2e27944d9482961af9bfd9d08bb3b51. --- lisp/org.el | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 1c2ee9a..e979b35 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -78,11 +78,12 @@ (defvar org-table-formula-constants-local nil (require 'find-func) (require 'format-spec) -(load "org-loaddefs.el" t t t) - (require 'org-macs) (require 'org-compat) +(let ((load-suffixes (list ".el"))) + (org-load-noerror-mustsuffix "org-loaddefs")) + ;; `org-outline-regexp' ought to be a defconst but is let-binding in ;; some places -- e.g. see the macro org-with-limited-levels. ;; @@ -16901,27 +16902,6 @@ (defun org-date-from-calendar () (org-insert-time-stamp (encode-time 0 0 0 (nth 1 cal-date) (car cal-date) (nth 2 cal-date)))))) -(defcustom org-effort-durations - `(("h" . 60) - ("d" . ,(* 60 8)) - ("w" . ,(* 60 8 5)) - ("m" . ,(* 60 8 5 4)) - ("y" . ,(* 60 8 5 40))) - "Conversion factor to minutes for an effort modifier. - -Each entry has the form (MODIFIER . MINUTES). - -In an effort string, a number followed by MODIFIER is multiplied -by the specified number of MINUTES to obtain an effort in -minutes. - -For example, if the value of this variable is ((\"hours\" . 60)), then an -effort string \"2hours\" is equivalent to 120 minutes." - :group 'org-agenda - :version "24.1" - :type '(alist :key-type (string :tag "Modifier") - :value-type (number :tag "Minutes"))) - (defun org-minutes-to-clocksum-string (m) "Format number of minutes as a clocksum string. The format is determined by `org-time-clocksum-format', @@ -17031,6 +17011,27 @@ (defun org-hh:mm-string-to-minutes (s) (string-to-number (match-string 1 s))) (t 0))) +(defcustom org-effort-durations + `(("h" . 60) + ("d" . ,(* 60 8)) + ("w" . ,(* 60 8 5)) + ("m" . ,(* 60 8 5 4)) + ("y" . ,(* 60 8 5 40))) + "Conversion factor to minutes for an effort modifier. + +Each entry has the form (MODIFIER . MINUTES). + +In an effort string, a number followed by MODIFIER is multiplied +by the specified number of MINUTES to obtain an effort in +minutes. + +For example, if the value of this variable is ((\"hours\" . 60)), then an +effort string \"2hours\" is equivalent to 120 minutes." + :group 'org-agenda + :version "24.1" + :type '(alist :key-type (string :tag "Modifier") + :value-type (number :tag "Minutes"))) + (defcustom org-image-actual-width t "Should we use the actual width of images when inlining them? -- 1.8.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Revert-org-load-noerror-mustsuffix-requires-an-autol.patch >From 6e158e45fad2c56c37e3cacee772102aec89dbd3 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sat, 12 Jan 2013 08:55:51 +0100 Subject: [PATCH 2/3] Revert "`org-load-noerror-mustsuffix' requires an autoload" This reverts commit f94d81a17e2c947a474e0f3b274c46afc3aa99a9. --- lisp/org-macs.el | 1 - 1 file changed, 1 deletion(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 974a366..e5d6100 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -426,7 +426,6 @@ (defun org-make-parameter-alist (flat) (cons (list (car flat) (cadr flat)) (org-make-parameter-alist (cddr flat))))) -;;;###autoload (defmacro org-load-noerror-mustsuffix (file) "Load FILE with optional arguments NOERROR and MUSTSUFFIX. Drop the MUSTSUFFIX argument for XEmacs, which doesn't recognize it." (if (featurep 'xemacs) -- 1.8.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-org.el-advice-around-require-to-defuse-mixed-install.patch >From dd67ebfa2366ba5a275886c7c68f96643c59280b Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sat, 12 Jan 2013 11:50:27 +0100 Subject: [PATCH 3/3] org.el: advice around require to defuse mixed-install scenario * lisp/org.el (require-reloads-when-shadowed): Advice around require to check and correct for the situation where some parts of Org have already been loaded, then the load-path has been changed and Org is now about to be activated. To do this, unload the previously loaded feature named "org", "ob" or starting with "org-" or "ob-" so that the original require function does load the requested feature from the current load-path. Move some requires up in the file so that the advice can be removed as early as possible. --- lisp/org.el | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index e979b35..e94442d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -78,8 +78,35 @@ (defvar org-table-formula-constants-local nil (require 'find-func) (require 'format-spec) +;; some parts of Org might already have been used from a different +;; place, try to reload these parts from the current load-path +(require 'loadhist) +(defadvice require (before org-require-reload-when-shadowed + (feature &optional filename noerror) + activate compile preactivate) + "Check whether a required feature has been shadowed by changing +`load-path' after it has been loaded and reload that feature from +current load-path in this case." + (when (featurep feature) + (let ((feature-name (or filename (symbol-name feature)))) + (when (string-match "^\\(org\\|ob\\)\\(-.*\\)?$" feature-name) + (let ((feature-lib (file-name-directory (or (locate-library feature-name) ""))) + (feature-dir (file-name-directory (feature-file feature)))) + ;(message "require-reload-when shadowed %s\n\t%s\n\t%s" feature-name feature-lib feature-dir) + (when (not (string= feature-lib feature-dir)) + (message "Reloading %s" feature-name) + (unload-feature feature t))))))) (require 'org-macs) (require 'org-compat) +(require 'org-entities) +(require 'org-faces) +(require 'org-list) +(require 'org-pcomplete) +(require 'org-src) +(require 'org-footnote) +;; babel +(require 'ob) +(eval-and-compile (ad-unadvise 'require)) (let ((load-suffixes (list ".el"))) (org-load-noerror-mustsuffix "org-loaddefs")) @@ -4991,17 +5018,6 @@ (defvar buffer-face-mode-face) (require 'easymenu) (require 'overlay) -;; (require 'org-macs) moved higher up in the file before it is first used -(require 'org-entities) -;; (require 'org-compat) moved higher up in the file before it is first used -(require 'org-faces) -(require 'org-list) -(require 'org-pcomplete) -(require 'org-src) -(require 'org-footnote) - -;; babel -(require 'ob) ;;;###autoload (define-derived-mode org-mode outline-mode "Org" -- 1.8.1 --=-=-= Content-Type: text/plain Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf microQ V2.22R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada --=-=-=--