From abb9a0f88aeb67b340d5acaaa86c063353e5d3d0 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 13 Jan 2016 00:16:07 -0500 Subject: [PATCH 1/3] org-bibtex: Mark filename argument as required * lisp/org-bibtex.el (org-bibtex): Mark FILENAME argument as required because, when called from Lisp, the function does not provide a default file name when FILENAME is nil, leading to a type error. --- lisp/org-bibtex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el index dbfcc158d..2cd84b696 100644 --- a/lisp/org-bibtex.el +++ b/lisp/org-bibtex.el @@ -549,7 +549,7 @@ With optional argument OPTIONAL, also prompt for optional fields." ;;; Bibtex <-> Org-mode headline translation functions -(defun org-bibtex (&optional filename) +(defun org-bibtex (filename) "Export each headline in the current file to a bibtex entry. Headlines are exported using `org-bibtex-headline'." (interactive From 4eccbce9dc1a5febdc74df86c15655ebaa7aabfb Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 13 Jan 2016 00:18:42 -0500 Subject: [PATCH 2/3] org-bibtex: Fix type error in non-file buffers * lisp/org-bibtex.el (org-bibtex): Fix type error in cases where the buffer is not visiting a file. In an indirect buffer, use the file name for the base buffer. --- lisp/org-bibtex.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el index 2cd84b696..a1cd8b09a 100644 --- a/lisp/org-bibtex.el +++ b/lisp/org-bibtex.el @@ -555,8 +555,10 @@ Headlines are exported using `org-bibtex-headline'." (interactive (list (read-file-name "Bibtex file: " nil nil nil - (file-name-nondirectory - (concat (file-name-sans-extension (buffer-file-name)) ".bib"))))) + (let ((file (buffer-file-name (buffer-base-buffer)))) + (and file + (file-name-nondirectory + (concat (file-name-sans-extension file) ".bib"))))))) (let ((error-point (catch 'bib (let ((bibtex-entries From 6c6b94e2747af3c45b37a4b050838ca4a422ca19 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 13 Jan 2016 00:42:09 -0500 Subject: [PATCH 3/3] org-directory: Update docstring * lisp/org.el (org-directory): Fix docstring description of where this variable is used. --- lisp/org.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 9472a4bce..9a1e46cae 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -2293,17 +2293,17 @@ For more examples, see the system specific constants :group 'org) (defcustom org-directory "~/org" - "Directory with org files. + "Directory with Org files. This is just a default location to look for Org files. There is no need -at all to put your files into this directory. It is only used in the +at all to put your files into this directory. It is used in the following situations: 1. When a capture template specifies a target file that is not an absolute path. The path will then be interpreted relative to `org-directory' -2. When a capture note is filed away in an interactive way (when exiting the - note buffer with `C-1 C-c C-c'. The user is prompted for an org file, - with `org-directory' as the default path." +2. When the value of variable `org-agenda-files' is a single file, any + relative paths in this file will be taken as relative to + `org-directory'." :group 'org-refile :group 'org-capture :type 'directory)