1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-28 10:56:57 +00:00

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*.
This commit is contained in:
Bastien Guerry 2012-08-10 15:32:24 +02:00
parent 8562d230ff
commit 9156bc2d64
3 changed files with 18 additions and 17 deletions

View File

@ -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)

View File

@ -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))

View File

@ -31,6 +31,7 @@
(require 'cl))
(require 'org-macs)
(require 'org-compat)
(require 'pcomplete)
(declare-function org-split-string "org" (string &optional separators))