X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d5dc920668a85c56c4d3e54a6898bbd43bcb64a1..c026460bc47f9c3be3fc27efb014c39d782a955e:/lisp/textmodes/refer.el diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el index 3ff01ef5c7..a811c8f658 100644 --- a/lisp/textmodes/refer.el +++ b/lisp/textmodes/refer.el @@ -1,6 +1,7 @@ ;;; refer.el --- look up references in bibliography files -;; Copyright (C) 1992, 1996, 2001, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 1992, 1996, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Ashwin Ram ;; Maintainer: Gernot Heiser @@ -9,10 +10,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,9 +21,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -78,57 +77,57 @@ :group 'wp) (defcustom refer-bib-directory nil - "Directory, or list of directories, to search for \\.bib files. Can -be set to 'bibinputs or 'texinputs, in which case the environment + "Directory, or list of directories, to search for \\.bib files. +Can be set to 'bibinputs or 'texinputs, in which case the environment variable BIBINPUTS or TEXINPUTS, respectively, is used to obtain a -list of directories. Useful only if refer-bib-files is set to 'dir or -a list of file names (without directory). A value of nil indicates the +list of directories. Useful only if `refer-bib-files' is set to 'dir or +a list of file names (without directory). A value of nil indicates the current working directory. -If refer-bib-directory is 'bibinputs or 'texinputs, it is setq'd to +If `refer-bib-directory' is 'bibinputs or 'texinputs, it is setq'd to the appropriate list of directories when it is first used. Note that an empty directory is interpreted by BibTeX as indicating -the default search path. Since Refer does not know that default path, -it cannot search it. Include that path explicitly in your BIBINPUTS +the default search path. Since Refer does not know that default path, +it cannot search it. Include that path explicitly in your BIBINPUTS environment if you really want it searched (which is not likely to happen anyway)." :type '(choice (repeat directory) (const bibinputs) (const texinputs)) :group 'refer) (defcustom refer-bib-files 'dir - "*List of \\.bib files to search for references, + "List of \\.bib files to search for references, or one of the following special values: nil = prompt for \\.bib file (if visiting a \\.bib file, use it as default) auto = read \\.bib file names from appropriate command in buffer (see - refer-bib-files-regexp) unless the buffer's mode is bibtex-mode, + `refer-bib-files-regexp') unless the buffer's mode is `bibtex-mode', in which case only the buffer is searched -dir = use all \\.bib files in directories referenced by refer-bib-directory. +dir = use all \\.bib files in directories referenced by `refer-bib-directory'. If a specified file doesn't exist and has no extension, a \\.bib extension is automatically tried. -If refer-bib-files is nil, auto or dir, it is setq'd to the appropriate -list of files when it is first used if refer-cache-bib-files is t. If -refer-cache-bib-files is nil, the list of \\.bib files to use is re-read +If `refer-bib-files' is nil, auto or dir, it is setq'd to the appropriate +list of files when it is first used if `refer-cache-bib-files' is t. If +`refer-cache-bib-files' is nil, the list of \\.bib files to use is re-read each time it is needed." :type '(choice (repeat file) (const nil) (const auto) (const dir)) :group 'refer) (defcustom refer-cache-bib-files t - "*Variable determining whether the value of refer-bib-files should be cached. + "Variable determining whether the value of `refer-bib-files' should be cached. If t, initialize the value of refer-bib-files the first time it is used. If -nil, re-read the list of \\.bib files depending on the value of refer-bib-files +nil, re-read the list of \\.bib files depending on the value of `refer-bib-files' each time it is needed." :type 'boolean :group 'refer) (defcustom refer-bib-files-regexp "\\\\bibliography" - "*Regexp matching a bibliography file declaration. + "Regexp matching a bibliography file declaration. The current buffer is expected to contain a line such as \\bibliography{file1,file2,file3} -which is read to set up refer-bib-files. The regexp must specify the command -(such as \\bibliography) that is used to specify the list of bib files. The +which is read to set up `refer-bib-files'. The regexp must specify the command +\(such as \\bibliography) that is used to specify the list of bib files. The command is expected to specify a file name, or a list of comma-separated file names, within curly braces. If a specified file doesn't exist and has no extension, a \\.bib extension @@ -149,8 +148,8 @@ is automatically tried." (defun refer-find-entry (keywords &optional continue) "Find entry in refer-bib-files containing KEYWORDS. If KEYWORDS is nil, prompt user for blank-separated list of keywords. -If CONTINUE is t, or if called interactively with a prefix arg, look for next -entry by continuing search from previous point." +If CONTINUE is non-nil, or if called interactively with a prefix arg, +look for next entry by continuing search from previous point." (interactive (list nil current-prefix-arg)) (or keywords (setq keywords (if continue refer-previous-keywords @@ -159,13 +158,13 @@ entry by continuing search from previous point." (refer-find-entry-internal keywords continue)) (defun refer-find-next-entry () - "Find next occurrence of entry in refer-bib-files. See refer-find-entry." + "Find next occurrence of entry in `refer-bib-files'. See `refer-find-entry'." (interactive) (refer-find-entry-internal refer-previous-keywords t)) (defun refer-yank-key () "Inserts at point in current buffer the \"key\" field of the entry -found on the last refer-find-entry or refer-find-next-entry." +found on the last `refer-find-entry' or `refer-find-next-entry'." (interactive) (let ((old-point (point))) (insert @@ -338,7 +337,7 @@ found on the last refer-find-entry or refer-find-next-entry." (list (expand-file-name (if (eq major-mode 'bibtex-mode) (read-file-name - (format ".bib file: (default %s) " + (format ".bib file (default %s): " (file-name-nondirectory (buffer-file-name))) (file-name-directory (buffer-file-name)) @@ -397,5 +396,5 @@ found on the last refer-find-entry or refer-find-next-entry." (setq refer-bib-files files)) files)) -;;; arch-tag: 151f641b-e79b-462b-9a29-a95c3793f300 +;; arch-tag: 151f641b-e79b-462b-9a29-a95c3793f300 ;;; refer.el ends here