Browse Source

org.el ("org-loaddefs.el"): use `load', not `org-load-noerror-mustsuffix'

* org.el ("org-loaddefs.el"): Load org-loaddefs.el before
requiring any org library.  Also use `load', not
`org-load-noerror-mustsuffix'.
(org-effort-durations): Move up to fix a compiler warning.

This patch should reduce complexity without breaking compatibility
with XEmacs.  Before this patch, users with a wrong load path would
require org-compat.el from this wrong load path, and loading
org-loaddefs.el would not work.
Bastien Guerry 5 years ago
parent
commit
db7ece9fa2
1 changed files with 23 additions and 24 deletions
  1. 23 24
      lisp/org.el

+ 23 - 24
lisp/org.el

@@ -78,12 +78,11 @@
 (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.
 ;;
@@ -16897,6 +16896,27 @@ If there is already a time stamp at the cursor position, update it."
       (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',
@@ -17006,27 +17026,6 @@ If no number is found, the return value is 0."
     (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?