Commit graph

137 commits

Author SHA1 Message Date
Roland Winkler
c48f463bdb (bibtex-format-entry): Handle error message refering to a missing
required field with the OPT prefix.  Make unwindform more robust.
2008-02-25 19:57:38 +00:00
Roland Winkler
5fe5075b03 * textmodes/bibtex.el: Remove support for hideshow minor mode as
it duplicates the bibtex support in progmodes/hideshow.el.
* progmodes/hideshow.el (hs-special-modes-alist): Allow bibtex
entry that do not start at the beginning of a line.
2008-02-25 19:49:23 +00:00
Roland Winkler
48c4d6a236 (bibtex-convert-alien): Do not use optional args in calls of sit-for. 2008-02-20 17:45:52 +00:00
Roland Winkler
7af32e665c (bibtex-search-entry): Rename from bibtex-find-entry.
Add outoload cookie.
(bibtex-find-entry): Alias for bibtex-search-entry.
(bibtex-search-crossref): Rename from bibtex-find-crossref.
(bibtex-find-crossref): Alias for bibtex-search-crossref.
(bibtex-clean-entry): atomic-change-group removed.
(bibtex-format-entry): Use atomic-change-group.  Use
unwind-protect to locate buffer location where error occured.
Make error messages more specific.
(bibtex-parse-keys): Only parse if buffer uses bibtex-mode.
2008-02-17 21:02:29 +00:00
Roland Winkler
65e1047888 (bibtex-initialize): New autoloaded command. Rename from function
bibtex-files-expand. New optional arg select.
(bibtex-flash-head): Allow blink-matching-delay being zero.
(bibtex-clean-entry): Use atomic-change-group.
(bibtex-format-entry): Check presence of required fields only after
formatting of fields. Use member-ignore-case. Do not use
bibtex-parse-entry. Do not use booktitle field to set a missing
title.
(bibtex-autofill-entry): Do not call undo-boundary.
(bibtex-lessp): Handle crossref keys that point to another bibtex
file.
(bibtex-sort-buffer, bibtex-prepare-new-entry, bibtex-validate):
Parse keys if necessary.
2008-01-09 01:37:50 +00:00
Miles Bader
59ce725a3b Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-987
2008-01-08 20:46:54 +00:00
Glenn Morris
12dc447f2a Add 2008 to copyright years. 2008-01-07 02:23:04 +00:00
Miles Bader
9aecacd08a Merge from emacs--rel--22
Patches applied:

 * emacs--rel--22  (patch 70-73)

   - Update from CVS

2007-07-25  Glenn Morris  <rgm@gnu.org>

   * Relicense all FSF files to GPLv3 or later.

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-828
2007-07-26 05:28:10 +00:00
Glenn Morris
5a9dffec38 Switch license to GPLv3 or later. 2007-07-25 04:24:43 +00:00
Roland Winkler
f2dfa899a4 (bibtex-entry-format): New options whitespace', braces', and `string'.
(bibtex-field-braces-alist, bibtex-field-strings-alist)
(bibtex-field-braces-opt, bibtex-field-strings-opt)
(bibtex-cite-matcher-alist): New variables.
(bibtex-font-lock-keywords): Use bibtex-cite-matcher-alist.
(bibtex-flash-head): Use blink-matching-delay.
(bibtex-insert-kill, bibtex-mark-entry): Use push-mark.
(bibtex-format-entry, bibtex-reformat): Handle new options of
bibtex-entry-format.
(bibtex-field-re-init, bibtex-font-lock-cite, bibtex-dist): New
functions.
(bibtex-complete-internal): Do not display messages while
minibuffer is used.  Do not leave around a completions buffer
that is out of date.
(bibtex-copy-summary-as-kill): New optional arg.
(bibtex-font-lock-url): New optional arg no-button.
(bibtex-find-crossref): Use `bibtex-cite-matcher-alist'.
(bibtex-url): Allow multiple URLs per entry.
2007-06-23 22:00:03 +00:00
Roland Winkler
27a61fcd5f (bibtex-include-OPTkey, bibtex-user-optional-fields)
(bibtex-entry-field-alist): Fix defcustom.
2007-04-17 03:25:51 +00:00
Roland Winkler
0dcfda42f3 (bibtex-entry-field-alist): Use defcustom. 2007-04-16 18:03:29 +00:00
Roland Winkler
cbc0b7831f (bibtex-field-list): Use functionp.
(bibtex-make-field): Check that INIT is a string. Use functionp.
2007-04-15 16:05:19 +00:00
Glenn Morris
84aa4fc6ee (bibtex-insert-kill): Pass non-nil NODELIM arg to bibtex-make-field.
(bibtex-make-field): Add optional fourth arg NODELIM.  Insert
delimiters around INIT unless this arg is non-nil.
2007-04-14 19:12:59 +00:00
Roland Winkler
238a5d6dc9 (bibtex-files): Fix customization type. 2007-01-21 13:48:17 +00:00
Glenn Morris
d7a0267c8d Add 2007 to copyright years. 2007-01-21 03:53:13 +00:00
Glenn Morris
f2e3589a33 Update copyright years. 2006-12-09 04:06:06 +00:00
Roland Winkler
f021dbca1a Fix typo in name of author of bibtex.el,
"Mark Shapiro" -> "Marc Shapiro".  Update his email address.
2006-11-06 21:33:47 +00:00
Stefan Monnier
7a0574f3e9 (bibtex-autokey-name-case-convert-function)
(bibtex-sort-entry-class): Add safe-local-variable predicate.
(bibtex-sort-entry-class-alist): Don't set the global value.
(bibtex-init-sort-entry-class-alist): New fun.
(bibtex-sort-buffer, bibtex-prepare-new-entry): Call it to compute
bibtex-init-sort-entry-class-alist from the buffer-local value (if any)
of bibtex-init-sort-entry-class.
2006-05-29 01:35:53 +00:00
Stefan Monnier
8e6ea7a321 (bibtex-format-entry, bibtex-clean-entry):
Signal more user-friendly error messages.
2006-05-22 21:50:47 +00:00
Reiner Steib
35fdd9a77a (bibtex-maintain-sorted-entries): Quote safe-local-variable predicate. 2006-05-22 13:19:02 +00:00
Roland Winkler
eab10abb18 (bibtex-maintain-sorted-entries): Mark as safe. 2006-05-21 17:45:09 +00:00
Roland Winkler
12fab222fb (bibtex-url): New optional arg no-browse. Return the URL or nil if
none can be generated.
2006-04-26 23:34:34 +00:00
Roland Winkler
90ce8c2a0b (bibtex-user-optional-fields): Mark as risky. 2006-04-26 23:32:39 +00:00
J.D. Smith
19f0b8b5fe (bibtex-find-entry): Don't demand matching case for @Article, etc. 2006-04-24 21:57:45 +00:00
Roland Winkler
5ad23234d6 (bibtex-entry-update): New optional arg entry-type. Add field
delimiters to numerical fields if they are not present.
2006-04-09 18:29:19 +00:00
Roland Winkler
ba7e3f51f2 (bibtex-find-text-internal): Add new element string-const to return value.
(bibtex-remove-delimiters): Use it.
2006-04-09 18:25:53 +00:00
Roland Winkler
8a51a3181a * textmodes/bibtex.el (bibtex-include-OPTkey)
(bibtex-entry-field-alist, bibtex-generate-url-list): Mark as
	risky.
	(bibtex-autokey-name-case-convert)
	(bibtex-autokey-titleword-case-convert): Make these the aliases
	for the following two variables.
	(bibtex-autokey-name-case-convert-function)
	(bibtex-autokey-titleword-case-convert-function): Make these the
	real names.
	(bibtex-font-lock-keywords): Make bibtex-font-lock-url and
	bibtex-font-lock-crossref sublists.
	(bibtex-mode): Revert 2005-12-30 change (which made
	completion-ignore-case buffer-local).
	(bibtex-url): Simplify
2006-03-19 21:55:25 +00:00
Thien-Thi Nguyen
ceb4c4d303 Update years in copyright notice; nfc. 2006-02-06 12:31:40 +00:00
Richard M. Stallman
964a8b4727 (bibtex-strings, bibtex-reference-keys): Mark as risky. 2006-01-19 17:48:06 +00:00
Eli Zaretskii
24ee740df0 (bibtex-validate-globally): Fix typo in a message text:
"Duplicat" => "Duplicate".
2006-01-06 12:00:22 +00:00
Roland Winkler
5e860c2408 (bibtex-mode): Make completion-ignore-case
buffer-local because choose-completion-delete-max-match requires
that we set completion-ignore-case (i.e., binding via let is not
sufficient).
(bibtex-complete): Always set completion-ignore-case and
choose-completion-string-functions. The latter is needed because
choose-completion-string-functions keeps its value if we quit the
*Completions* buffer without requesting a completion.
2005-12-30 17:00:32 +00:00
Roland Winkler
e8606202de (bibtex-text-in-field-bounds): Handle case that assoc-string returns
nil.
2005-12-29 17:10:53 +00:00
Roland Winkler
ffc1e1db03 (bibtex-entry-type-whitespace)
(bibtex-entry-type-str, bibtex-empty-field-re)
(bibtex-search-backward-string, bibtex-preamble-prefix)
(bibtex-search-entry, bibtex-enclosing-entry-maybe-empty-head):
Removed.
(bibtex-any-valid-entry-type): New variable.
(bibtex-parse-field-name): Simplify.
(bibtex-parse-string, bibtex-search-forward-string): New arg
empty-key.
(bibtex-preamble-prefix): Include left delimiter.
(bibtex-search-forward-field, bibtex-search-backward-field): Allow
unbounded search past entry boundaries (required by bibtex-pop).
(bibtex-text-in-field-bounds): Use push.
(bibtex-text-in-field): Do not use bibtex-narrow-to-entry.
(bibtex-parse-preamble, bibtex-valid-entry)
(bibtex-beginning-first-field): New functions.
(bibtex-skip-to-valid-entry): Use bibtex-valid-entry.  Fix regexp.
(bibtex-map-entries): Fix docstring.
(bibtex-flash-head): New arg prompt. Simplify.
(bibtex-enclosing-field): Include code of bibtex-inside-field.
(bibtex-insert-kill): Simplify.  Always insert text past the
current field or entry.
(bibtex-format-entry): Use bibtex-parse-field.
(bibtex-pop): Use bibtex-beginning-of-entry and
bibtex-end-of-entry to initiate the search.  Insert empty field if
we found ourselves.
(bibtex-print-help-message): New args field and comma.  Handle
entry keys.
(bibtex-make-field): Use bibtex-beginning-of-entry.
(bibtex-end-of-entry): Use bibtex-valid-entry.  Recognize any
invalid entry.
(bibtex-validate): Use bibtex-valid-entry and bibtex-parse-string.
Handle preambles.  Simplify code for thorough test.
(bibtex-next-field, bibtex-find-text, bibtex-find-text-internal):
New arg comma.  Handle entry heads.
(bibtex-remove-OPT-or-ALT, bibtex-remove-delimiters)
(bibtex-kill-field, bibtex-copy-field-as-kil, bibtex-empty-field):
New arg comma.
(bibtex-kill-entry): Use bibtex-any-entry-maybe-empty-head.
(bibtex-fill-field): Simplify.
(bibtex-fill-entry): Use bibtex-beginning-first-field and
bibtex-parse-field.
(bibtex-convert-alien): Do not wait before calling
bibtex-validate.
(bibtex-complete): Use bibtex-parse-preamble.
2005-12-29 15:25:28 +00:00
Stefan Monnier
2784fcc9de (bibtex-strings, bibtex-reference-keys):
Don't use the `args' argument of lazy-completion-table.
2005-12-26 15:54:21 +00:00
Stefan Monnier
cdc61d3531 (bibtex-expand-strings)
(bibtex-autokey-expand-string, bibtex-name-part)
(bibtex-entry-type-whitespace, bibtex-entry-type-str)
(bibtex-any-entry-maybe-empty-head, bibtex-string-type)
(bibtex-preamble-prefix, bibtex-string-empty-key): New variables.
(bibtex-entry-type, bibtex-entry-head): Match only valid entries.
(bibtex-entry-postfix, bibtex-known-entry-type-re)
(bibtex-valid-entry-re, bibtex-any-valid-entry-re)
(bibtex-valid-entry-whitespace-re, bibtex-empty-field-re)
(bibtex-field-name-for-parsing, bibtex-remove-delimiters-string)
(bibtex-beginning-of-last-entry): Remove.
(bibtex-parse-field-name): Use bibtex-field-name.  Issue error
message if comma is missing but buffer is read-only.
(bibtex-parse-field-text): Handle whitespaces at the end of field
text.  Return 3-element list with beginning and end of field text
and end of field.
(bibtex-end-of-text-in-field, bibtex-end-of-field): Change accordingly.
(bibtex-parse-field): Remove arg name.  Use bibtex-field-name.
(bibtex-search-forward-field, bibtex-search-backward-field):
Search always delimited by limits of entry.  Use more efficient
search algorithms.
(bibtex-name-in-field): Use bibtex-start-of-name-in-field and
bibtex-end-of-name-in-field.
(bibtex-text-in-field-bounds): Handle BibTeX strings when
extracting the content of a field.
(bibtex-text-in-field): Use search limits.
(bibtex-parse-string-prefix): Handle empty string keys based on
bibtex-string-empty-key.
(bibtex-parse-string): Fix docstring.
(bibtex-text-in-string): Use bibtex-text-in-field-bounds.
(bibtex-preamble-prefix, bibtex-strings): New functions.
(bibtex-skip-to-valid-entry): Include preceding whitespace in
BibTeX entries (consistent with other BibTeX functions).
(bibtex-map-entries): Use bibtex-skip-to-valid-entry.
(bibtex-search-entry): Fix docstring.  Simplify.
(bibtex-flash-head, bibtex-complete-string-cleanup)
(bibtex-count-entries, bibtex-sort-buffer): Simplify.
(bibtex-beginning-of-first-entry): Use bibtex-skip-to-valid-entry.
(bibtex-parse-entry): New optional arg content.
(bibtex-format-entry, bibtex-autofill-entry, bibtex-url): Use it.
Use bibtex-text-in-field-bounds.
(bibtex-print-help-message): Handle BibTeX strings and preambles.
(bibtex-end-of-entry): Use bibtex-preamble-prefix and
bibtex-parse-string-postfix.
(bibtex-find-text-internal): New function.
(bibtex-remove-delimiters): Use it.
(bibtex-find-text): Use it.  New optional arg help.
(bibtex-complete): Handle BibTeX string and preamble entries.
(bibtex-Preamble): Fix order of closing delimiters.
2005-12-14 17:15:20 +00:00
Stefan Monnier
9cee7d84e7 (bibtex-font-lock-url): Catch when point past bound of search. 2005-10-16 14:07:33 +00:00
Masatake YAMATO
f5fab556d4 * message.el (message-expand-group): Pass the common
prefix substring of completion to `display-completion-list'.

* mh-comp.el (mh-complete-word): Pass the common
prefix substring of completion to `display-completion-list'.

* dabbrev.el (dabbrev-completion): Pass the common
prefix substring of completion to `display-completion-list'.

* filecache.el (file-cache-minibuffer-complete)
(file-cache-complete): Ditto.

* tempo.el (tempo-display-completions): Ditto.

* wid-edit.el (widget-file-complete, widget-color-complete): Ditto.

* emacs-lisp/lisp.el (lisp-complete-symbol): Ditto.

* eshell/em-hist.el (eshell-list-history): Ditto.

* mail/mailabbrev.el (mail-abbrev-complete-alias): Ditto.

* progmodes/etags.el (complete-tag): Ditto.

* progmodes/make-mode.el (makefile-complete): Ditto.

* progmodes/meta-mode.el (meta-complete-symbol): Ditto.

* progmodes/octave-mod.el (octave-complete-symbol): Ditto.

* progmodes/pascal.el (pascal-complete-word)
(pascal-show-completions): Ditto.

* textmodes/bibtex.el (bibtex-complete-internal): Ditto.

* simple.el (completion-common-substring): New variable.
(completion-setup-function): Use `completion-common-substring'
to put faces.

* minibuf.c (Fdisplay_completion_list): Add new optional
argument COMMON_SUBSTRING. Bind `completion-common-substring'
to the optional argument during running `completion-setup-hook'.
2005-10-16 09:31:48 +00:00
Romain Francoise
1fdecd0cd4 2005-10-01 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
* textmodes/bibtex.el (bibtex-valid-entry-whitespace-re): Do not
	match newline.
	(bibtex-realign): Do not use bibtex-valid-entry-whitespace-re.
	(bibtex-summary): remove unnecessary save-excursion.
	(bibtex-fill-field-bounds): Use fill-region-as-paragraph.
2005-10-01 20:09:23 +00:00
Deepak Goel
5673af85e4 Message format spec fixes (2) 2005-09-18 12:28:30 +00:00
Thien-Thi Nguyen
3731a85096 Update years in copyright notice; nfc. 2005-08-06 17:48:15 +00:00
Lute Kamstra
4fc5845fe8 Update FSF's address. 2005-07-04 16:49:24 +00:00
Juanma Barranquero
ffe683488c (bibtex, bibtex-autokey): Finish `defgroup' description with period.
(bibtex-mode): "?\ " -> "?\s".
2005-07-04 03:29:01 +00:00
Stefan Monnier
c2fa1079b9 (bibtex-Preamble): Enclose BibTeX preamble by field delimiters. 2005-06-15 16:38:29 +00:00
Stefan Monnier
921a94830b (bibtex-summary): Use current BibTeX entry to avoid calling
bibtex-find-entry with arg global being t.  Remove arg key.
(bibtex-summary-function, bibtex-complete-crossref-cleanup)
(bibtex-copy-summary-as-kill): Change accordingly.
2005-05-05 15:18:05 +00:00
Stefan Monnier
a172852f2b (bibtex-autokey-titleword-ignore, bibtex-reference-key)
(bibtex-autokey-demangle-name, bibtex-mode): Use char-classes to accept
non-ascii letters, accepted in some recent bibtex implementations.
2005-04-10 20:35:00 +00:00
Stefan Monnier
63d516ce90 (bibtex-url): Use format to generate the url.
(bibtex-generate-url-list): Update docstring accordingly. Put the
complex example in the docstring.
(bibtex-font-lock-url): Use pop.
2005-04-03 21:26:11 +00:00
Lute Kamstra
31df23f567 (bibtex-format-entry): Use `bibtex-empty-field-re' only on the text of
fields, not on entire field lines.
(bibtex-autofill-entry): Use `bibtex-empty-field-re' on a string,
not on part of a buffer.
(bibtex-empty-field-re): Don't match nonempty field text strings like
"{letters\\macro{}more letters}".  Clarify docstring.
(bibtex-sort-entry-class, bibtex-autokey-titleword-ignore)
(bibtex-entry-offset, bibtex-parse-association)
(bibtex-parse-field-name): Fix typos in docstrings.
(bibtex-field-list, bibtex-find-crossref): Fix typos in error
messages.
2005-01-25 17:26:11 +00:00
Stefan Monnier
d10e87a203 (bibtex-font-lock-url-regexp):
Use delete-dups when calculating the initial value.
(bibtex-autokey-get-title): Use <=.
(bibtex-goto-line): New function.
(bibtex-reposition-window): Use line numbers instead of point positions.
Use window-body-height.
(bibtex-find-crossref): Use bibtex-reposition-window.
(bibtex-find-entry): Use bibtex-reposition-window.  Always return
position of entry if key is found or nil if not found.
2004-12-05 16:07:39 +00:00
Stefan Monnier
02c8032e0a (bibtex-sort-entry-class)
(bibtex-comment-start): Use defcustom.
(bibtex-entry-field-alist): Use nil if initial content of the
field is undefined.  Fix docstring.
(bibtex-parse-keys-timeout, bibtex-autokey-additional-names)
(bibtex-generate-autokey, bibtex-parse-buffers-stealthily)
(bibtex-mode, bibtex-field-list, bibtex-entry-updat)
(bibtex-autofill-entry, bibtex-entry-index, bibtex-next-field):
Fix docstring.
(bibtex-autokey-title-terminators): Use only one regexp.
(bibtex-string-maybe-empty-head): New variable.
(bibtex-remove-delimiters-string): New function.
(bibtex-text-in-field-bounds, bibtex-text-in-string):
Use bibtex-remove-delimiters-string.
(bibtex-progress-message, bibtex-field-left-delimiter)
(bibtex-field-right-delimiter, bibtex-entry-left-delimiter)
(bibtex-entry-right-delimiter, bibtex-search-entry): Use eq.
(bibtex-insert-kill): Rename from `bibtex-insert-current-kill'.
Simplify.
(bibtex-format-entry): Use save-excursion for inherited booktitle.
Use eq and bibtex-remove-delimiters-string.  For end markers use
insertion type so that marker stays after inserted text.
(bibtex-autokey-get-names): Return empty string if name is missing.
(bibtex-autokey-demangle-name): Call bibtex-autokey-abbrev before
calling bibtex-autokey-name-case-convert.
(bibtex-autokey-demangle-title):
Call bibtex-autokey-titleword-case-convert.  Remove call to
bibtex-autokey-titleword-case-convert from bibtex-autokey-get-title.
(bibtex-global-key-alist, bibtex-read-string-key): New functions.
(bibtex-read-key): New optional arg global.
(bibtex-files-expand): New optional arg force.
(bibtex-complete-string-cleanup): Expansion of abbrev can be absent.
(bibtex-complete-crossref-cleanup): Rename from
bibtex-complete-key-cleanup.  Simplify code.
(bibtex-copy-summary-as-kill): Remove arg key.  Operate on current entry.
Use looking-at.
(bibtex-button): Add docstring.
(bibtex-entry): Simplify.
(bibtex-make-field): Replace optional arg called-by-yank with more
specific args move and interactive.
(bibtex-end-of-entry): Use forward-sexp.
(bibtex-find-entry-globally): Remove.
(bibtex-find-crossref): Allow for crossref key located in other buffer.
Bound to C-c C-x.
(bibtex-find-entry): New optional args global and display.
(bibtex-find-text): Fix docstring.  Remove arg as-if-interactive.
(bibtex-validate): Use arg force of bibtex-files-expand.
(bibtex-clean-entry): Bugfix, clean string entries properly.
Always keep point at beginning of entry.
(bibtex-complete): Bugfix.  Handle string entries properly.
Call cleanup functions only if needed.
(bibtex-String): Use bibtex-read-string-key.
(bibtex-url): Use bibtex-remove-delimiters-string.  Do not alter
case of replacement text.
2004-11-26 23:24:44 +00:00