summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2012-10-10 16:04:19 (GMT)
committer Achim Gratz <Stromeko@Stromeko.DE>2012-10-10 16:04:19 (GMT)
commit5451668d7b2df82d7a3df4057370cc7274417d61 (patch)
tree470cceadf1ba48d3404debd66ec2a424e05ef5fb
parentb6822edce3a799aa605fc1757232bd720b769ee8 (diff)
downloadorg-mode-5451668d7b2df82d7a3df4057370cc7274417d61.zip
org-mode-5451668d7b2df82d7a3df4057370cc7274417d61.tar.gz
org-reload: do not use the symbol name of the feature to map to the file name
* lisp/org.el (org-reload): Do not use the symbol name of the feature to map to the library name. Use the function feature-file from loadhist instead. Remove duplicate filenames from the resulting list since several files define multiple features, which was also the root cause of the reported bug. Thanks to Rainer M. Krug for reporting this. http://permalink.gmane.org/gmane.emacs.orgmode/61429
-rw-r--r--lisp/org.el27
1 files changed, 17 insertions, 10 deletions
diff --git a/lisp/org.el b/lisp/org.el
index f3dc5a3..dbeae6d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19999,27 +19999,34 @@ Your bug report will be posted to the Org-mode mailing list.
"Reload all org lisp files.
With prefix arg UNCOMPILED, load the uncompiled versions."
(interactive "P")
+ (require 'loadhist)
(let* ((org-dir (org-find-library-dir "org"))
(babel-dir (or (org-find-library-dir "ob") org-dir))
(contrib-dir (or (org-find-library-dir "org-contribdir") org-dir))
(feature-re "^\\(org\\|ob\\)\\(-.*\\)?")
(remove-re (mapconcat 'identity
- (list
- (if (featurep 'xemacs) "org-colview" "org-colview-xemacs")
- "^org$" "^org-infojs$" "^org-loaddefs$" "^org-version$")
- "\\|"))
- (feats features)
+ (mapcar (lambda (f) (concat "^" f "$"))
+ (list (if (featurep 'xemacs)
+ "org-colview"
+ "org-colview-xemacs")
+ "org" "org-loaddefs" "org-version"))
+ "\\|"))
+ (feats (delete-dups
+ (mapcar 'file-name-sans-extension
+ (mapcar 'file-name-nondirectory
+ (delq nil
+ (mapcar 'feature-file
+ features))))))
(lfeat (append
(sort
(setq feats
(delq nil (mapcar
(lambda (f)
- (let ((feat (symbol-name f)))
- (if (and (string-match feature-re feat)
- (not (string-match remove-re feat)))
- feat nil)))
+ (if (and (string-match feature-re f)
+ (not (string-match remove-re f)))
+ f nil))
feats)))
- 'string-lessp)
+ 'string-lessp)
(list "org-version" "org")))
(load-suffixes (if uncompiled (reverse load-suffixes) load-suffixes))
(load-misses ()))