summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-04-23 07:53:41 -0600
committerEric Schulte <schulte.eric@gmail.com>2011-04-27 14:53:06 -0600
commit93e000923f31488dd50aaf605c840c3986750677 (patch)
treee0ca35a208558df45a0e8b59705ea15cffea4e0f
parent8a41d54c1a377addffd6ab8f9dbc967f5ac36ee9 (diff)
downloadorg-mode-93e000923f31488dd50aaf605c840c3986750677.tar.gz
org-bibtex: field prompt removes ":", and shrinks prompt window
-rw-r--r--lisp/org-bibtex.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index 6993d7e..8f1417a 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -117,6 +117,7 @@
(declare-function bibtex-generate-autokey "bibtex" ())
(declare-function bibtex-parse-entry "bibtex" (&optional content))
(declare-function bibtex-url "bibtex" (&optional pos no-browse))
+(declare-function longlines-mode "longlines" (&optional arg))
;;; Bibtex data
@@ -271,13 +272,14 @@ For example setting to 'BIB_' would allow interoperability with fireforg."
(unless (assoc field org-bibtex-fields)
(error "field:%s is not known" field))
(save-window-excursion
- (with-temp-buffer
- (setf (buffer-name) (format "*Bibtex Help %s*" field))
- (insert (cdr (assoc field org-bibtex-fields)))
- (fill-paragraph)
- (pop-to-buffer (current-buffer))
+ (let* ((name (substring (symbol-name field) 1))
+ (buf-name (format "*Bibtex Help %s*" name)))
+ (with-output-to-temp-buffer buf-name
+ (princ (cdr (assoc field org-bibtex-fields))))
+ (with-current-buffer buf-name (longlines-mode t))
+ (org-fit-window-to-buffer (get-buffer-window buf-name))
((lambda (result) (when (> (length result) 0) result))
- (read-from-minibuffer (format "%s " field))))))
+ (read-from-minibuffer (format "%s: " name))))))
(defun org-bibtex-autokey ()
"Generate an autokey for the current headline"