Browse Source

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*.
Bastien Guerry 7 years ago
parent
commit
9156bc2d64
3 changed files with 18 additions and 17 deletions
  1. 13 13
      lisp/ob-tangle.el
  2. 4 4
      lisp/org-bibtex.el
  3. 1 0
      lisp/org-pcomplete.el

+ 13 - 13
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)

+ 4 - 4
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))

+ 1 - 0
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))