summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-08-10 15:32:24 +0200
committerBastien Guerry <bzg@altern.org>2012-08-10 15:32:24 +0200
commit9156bc2d6440ff8176c7b453d6aa4188e9fc8058 (patch)
treed19cd9798702d6c66fca00f05cbc0a6905f9c64b
parent8562d230fff31cf5db047d38bb66fca186e99954 (diff)
downloadorg-mode-9156bc2d6440ff8176c7b453d6aa4188e9fc8058.tar.gz
Various minor fixes.
* org-pcomplete.el (org-compat): Require. * ob-tangle.el (org-babel-load-file): Don't use `org-flet'. * org-bibtex.el (org-bibtex-write): Use let*.
-rw-r--r--lisp/ob-tangle.el26
-rw-r--r--lisp/org-bibtex.el8
-rw-r--r--lisp/org-pcomplete.el1
3 files changed, 18 insertions, 17 deletions
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 3cdecae..6ccd78e 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -144,19 +144,19 @@ This function exports the source code using
`org-babel-tangle' and then loads the resulting file using
`load-file'."
(interactive "fFile to load: ")
- (org-flet ((age (file)
- (float-time
- (time-subtract (current-time)
- (nth 5 (or (file-attributes (file-truename file))
- (file-attributes file)))))))
- (let* ((base-name (file-name-sans-extension file))
- (exported-file (concat base-name ".el")))
- ;; tangle if the org-mode file is newer than the elisp file
- (unless (and (file-exists-p exported-file)
- (> (age file) (age exported-file)))
- (org-babel-tangle-file file exported-file "emacs-lisp"))
- (load-file exported-file)
- (message "loaded %s" exported-file))))
+ (let* ((age (lambda (file)
+ (float-time
+ (time-subtract (current-time)
+ (nth 5 (or (file-attributes (file-truename file))
+ (file-attributes file)))))))
+ (base-name (file-name-sans-extension file))
+ (exported-file (concat base-name ".el")))
+ ;; tangle if the org-mode file is newer than the elisp file
+ (unless (and (file-exists-p exported-file)
+ (> (funcall age file) (funcall age exported-file)))
+ (org-babel-tangle-file file exported-file "emacs-lisp"))
+ (load-file exported-file)
+ (message "loaded %s" exported-file)))
;;;###autoload
(defun org-babel-tangle-file (file &optional target-file lang)
diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index 3d6e8f2..0e802dd 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -628,10 +628,10 @@ This uses `bibtex-parse-entry'."
(interactive)
(when (= (length org-bibtex-entries) 0)
(error "No entries in `org-bibtex-entries'."))
- (let ((entry (pop org-bibtex-entries))
- (org-special-properties nil) ; avoids errors with `org-entry-put'
- (val (lambda (field) (cdr (assoc field entry))))
- (togtag (lambda (tag) (org-toggle-tag tag 'on))))
+ (let* ((entry (pop org-bibtex-entries))
+ (org-special-properties nil) ; avoids errors with `org-entry-put'
+ (val (lambda (field) (cdr (assoc field entry))))
+ (togtag (lambda (tag) (org-toggle-tag tag 'on))))
(org-insert-heading)
(insert (funcall val :title))
(org-bibtex-put "TITLE" (funcall val :title))
diff --git a/lisp/org-pcomplete.el b/lisp/org-pcomplete.el
index 858dbc5..6d99582 100644
--- a/lisp/org-pcomplete.el
+++ b/lisp/org-pcomplete.el
@@ -31,6 +31,7 @@
(require 'cl))
(require 'org-macs)
+(require 'org-compat)
(require 'pcomplete)
(declare-function org-split-string "org" (string &optional separators))