[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112277: lisp/textmodes/bibtex.el (bi
From: |
Roland Winkler |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112277: lisp/textmodes/bibtex.el (bibtex-initialize): If the current buffer does not visit a BibTeX file, exclude it from the list of buffers returned by bibtex-initialize |
Date: |
Sat, 13 Apr 2013 15:38:52 -0500 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 112277
committer: Roland Winkler <address@hidden>
branch nick: trunk
timestamp: Sat 2013-04-13 15:38:52 -0500
message:
lisp/textmodes/bibtex.el (bibtex-initialize): If the current buffer does not
visit a BibTeX file, exclude it from the list of buffers returned by
bibtex-initialize
modified:
lisp/ChangeLog
lisp/textmodes/bibtex.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-04-13 14:37:20 +0000
+++ b/lisp/ChangeLog 2013-04-13 20:38:52 +0000
@@ -1,3 +1,9 @@
+2012-09-23 Roland Winkler <address@hidden>
+
+ * textmodes/bibtex.el (bibtex-initialize): If the current buffer
+ does not visit a BibTeX file, exclude it from the list of buffers
+ returned by bibtex-initialize.
+
2013-04-13 Stephen Berman <address@hidden>
* window.el (split-window): Remove interactive form, since as a
=== modified file 'lisp/textmodes/bibtex.el'
--- a/lisp/textmodes/bibtex.el 2013-01-01 09:11:05 +0000
+++ b/lisp/textmodes/bibtex.el 2013-04-13 20:38:52 +0000
@@ -3020,11 +3020,14 @@
Visit the BibTeX files defined by `bibtex-files' and return a list
of corresponding buffers.
Initialize in these buffers `bibtex-reference-keys' if not yet set.
-List of BibTeX buffers includes current buffer if CURRENT is non-nil.
+List of BibTeX buffers includes current buffer if CURRENT is non-nil
+and the current buffer visits a file using `bibtex-mode'.
If FORCE is non-nil, (re)initialize `bibtex-reference-keys' even if
already set. If SELECT is non-nil interactively select a BibTeX buffer.
-When called interactively, FORCE is t, CURRENT is t if current buffer uses
-`bibtex-mode', and SELECT is t if current buffer does not use `bibtex-mode',"
+
+When called interactively, FORCE is t, CURRENT is t if current buffer
+visits a file using `bibtex-mode', and SELECT is t if current buffer
+does not use `bibtex-mode',"
(interactive (list (eq major-mode 'bibtex-mode) t
(not (eq major-mode 'bibtex-mode))))
(let ((file-path (split-string (or bibtex-file-path default-directory) ":+"))
@@ -3062,10 +3065,12 @@
(if (file-readable-p file)
(push (find-file-noselect file) buffer-list)))
;; Include current buffer iff we want it.
- ;; Exclude current buffer if it doesn't use `bibtex-mode'.
- ;; Thus calling `bibtex-initialize' gives meaningful results for
- ;; any current buffer.
- (unless (and current (eq major-mode 'bibtex-mode)) (setq current nil))
+ ;; Exclude current buffer if it does not visit a file using `bibtex-mode'.
+ ;; This way we exclude BibTeX buffers such as `bibtex-search-buffer'
+ ;; that are not visiting a BibTeX file. Also, calling `bibtex-initialize'
+ ;; gives meaningful results for any current buffer.
+ (unless (and current (eq major-mode 'bibtex-mode) buffer-file-name)
+ (setq current nil))
(cond ((and current (not (memq (current-buffer) buffer-list)))
(push (current-buffer) buffer-list))
((and (not current) (memq (current-buffer) buffer-list))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112277: lisp/textmodes/bibtex.el (bibtex-initialize): If the current buffer does not visit a BibTeX file, exclude it from the list of buffers returned by bibtex-initialize,
Roland Winkler <=