emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/bibtex.el


From: Lute Kamstra
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/bibtex.el
Date: Tue, 25 Jan 2005 12:25:06 -0500

Index: emacs/lisp/textmodes/bibtex.el
diff -c emacs/lisp/textmodes/bibtex.el:1.90 emacs/lisp/textmodes/bibtex.el:1.91
*** emacs/lisp/textmodes/bibtex.el:1.90 Sun Dec  5 16:06:39 2004
--- emacs/lisp/textmodes/bibtex.el      Tue Jan 25 17:25:06 2005
***************
*** 173,179 ****
  If value of `bibtex-maintain-sorted-entries' is `entry-class'
  entries are ordered according to the classes they belong to.  Each
  class contains a list of entry names.  An entry `catch-all' applies
! to all entries not explicitely mentioned."
    :group 'BibTeX
    :type '(repeat (choice :tag "Class"
                           (const :tag "catch-all" (catch-all))
--- 173,179 ----
  If value of `bibtex-maintain-sorted-entries' is `entry-class'
  entries are ordered according to the classes they belong to.  Each
  class contains a list of entry names.  An entry `catch-all' applies
! to all entries not explicitly mentioned."
    :group 'BibTeX
    :type '(repeat (choice :tag "Class"
                           (const :tag "catch-all" (catch-all))
***************
*** 654,660 ****
    '("A" "An" "On" "The" "Eine?" "Der" "Die" "Das"
      "[^A-Z].*" ".*[^A-Z0-9].*")
    "Determines words from the title that are not to be used in the key.
! Each item of the list is a regexp.  If a word of the title matchs a
  regexp from that list, it is not included in the title part of the key.
  See `bibtex-generate-autokey' for details."
    :group 'bibtex-autokey
--- 654,660 ----
    '("A" "An" "On" "The" "Eine?" "Der" "Die" "Das"
      "[^A-Z].*" ".*[^A-Z0-9].*")
    "Determines words from the title that are not to be used in the key.
! Each item of the list is a regexp.  If a word of the title matches a
  regexp from that list, it is not included in the title part of the key.
  See `bibtex-generate-autokey' for details."
    :group 'bibtex-autokey
***************
*** 730,736 ****
  
  (defcustom bibtex-entry-offset 0
    "Offset for BibTeX entries.
! Added to the value of all other variables which determine colums."
    :group 'bibtex
    :type 'integer)
  
--- 730,736 ----
  
  (defcustom bibtex-entry-offset 0
    "Offset for BibTeX entries.
! Added to the value of all other variables which determine columns."
    :group 'bibtex
    :type 'integer)
  
***************
*** 1115,1123 ****
                        t))
    "Regexp matching the name of any valid BibTeX entry (including string).")
  
! 
! (defconst bibtex-empty-field-re "\"\"\\|{}"
!   "Regexp matching an empty field.")
  
  (defconst bibtex-font-lock-syntactic-keywords
    `((,(concat "^[ \t]*\\(" (substring bibtex-comment-start 0 1) "\\)"
--- 1115,1122 ----
                        t))
    "Regexp matching the name of any valid BibTeX entry (including string).")
  
! (defconst bibtex-empty-field-re "\\`\\(\"\"\\|{}\\)\\'"
!   "Regexp matching the text part (as a string) of an empty field.")
  
  (defconst bibtex-font-lock-syntactic-keywords
    `((,(concat "^[ \t]*\\(" (substring bibtex-comment-start 0 1) "\\)"
***************
*** 1179,1185 ****
    "Parse a string of the format <left-hand-side = right-hand-side>.
  The functions PARSE-LHS and PARSE-RHS are used to parse the corresponding
  substrings.  These functions are expected to return nil if parsing is not
! successfull.  If both functions return non-nil, a pair containing the returned
  values of the functions PARSE-LHS and PARSE-RHS is returned."
    (save-match-data
      (save-excursion
--- 1178,1184 ----
    "Parse a string of the format <left-hand-side = right-hand-side>.
  The functions PARSE-LHS and PARSE-RHS are used to parse the corresponding
  substrings.  These functions are expected to return nil if parsing is not
! successful.  If both functions return non-nil, a pair containing the returned
  values of the functions PARSE-LHS and PARSE-RHS is returned."
    (save-match-data
      (save-excursion
***************
*** 1196,1202 ****
  If the field name is found, return a triple consisting of the position of the
  very first character of the match, the actual starting position of the name
  part and end position of the match.  Move point to end of field name.
! If `bibtex-autoadd-commas' is non-nil add missing comma at end of preceeding
  BibTeX field as necessary."
    (cond ((looking-at ",[ \t\n]*")
           (let ((start (point)))
--- 1195,1201 ----
  If the field name is found, return a triple consisting of the position of the
  very first character of the match, the actual starting position of the name
  part and end position of the match.  Move point to end of field name.
! If `bibtex-autoadd-commas' is non-nil add missing comma at end of preceding
  BibTeX field as necessary."
    (cond ((looking-at ",[ \t\n]*")
           (let ((start (point)))
***************
*** 1875,1881 ****
                                (if opt-alt (+ beg-name 3) beg-name) end-name))
                   (empty-field (string-match bibtex-empty-field-re
                                              (buffer-substring-no-properties
!                                              beg-field end-field)))
                   deleted)
  
              ;; We have more elegant high-level functions for several
--- 1874,1880 ----
                                (if opt-alt (+ beg-name 3) beg-name) end-name))
                   (empty-field (string-match bibtex-empty-field-re
                                              (buffer-substring-no-properties
!                                              beg-text end-text)))
                   deleted)
  
              ;; We have more elegant high-level functions for several
***************
*** 2824,2830 ****
    (let ((e (assoc-string entry-type bibtex-entry-field-alist t))
          required optional)
      (unless e
!       (error "Bibtex entry type %s not defined" entry-type))
      (if (and (member-ignore-case entry-type bibtex-include-OPTcrossref)
               (nth 2 e))
          (setq required (nth 0 (nth 2 e))
--- 2823,2829 ----
    (let ((e (assoc-string entry-type bibtex-entry-field-alist t))
          required optional)
      (unless e
!       (error "BibTeX entry type %s not defined" entry-type))
      (if (and (member-ignore-case entry-type bibtex-include-OPTcrossref)
               (nth 2 e))
          (setq required (nth 0 (nth 2 e))
***************
*** 2960,2968 ****
        (while (setq bounds (bibtex-parse-field bibtex-field-name))
          (let ((text (assoc-string (bibtex-name-in-field bounds t)
                                      other t)))
!           (goto-char (bibtex-start-of-text-in-field bounds))
!           (if (not (and (looking-at bibtex-empty-field-re) text))
                (goto-char (bibtex-end-of-field bounds))
              (delete-region (point) (bibtex-end-of-text-in-field bounds))
              (insert (cdr text)))))
        ;; Finally try to update the text based on the difference between
--- 2959,2971 ----
        (while (setq bounds (bibtex-parse-field bibtex-field-name))
          (let ((text (assoc-string (bibtex-name-in-field bounds t)
                                      other t)))
!           (if (not (and text
!                           (string-match bibtex-empty-field-re
!                                         (buffer-substring-no-properties
!                                          (bibtex-start-of-text-in-field 
bounds)
!                                          (bibtex-end-of-text-in-field 
bounds)))))
                (goto-char (bibtex-end-of-field bounds))
+               (goto-char (bibtex-start-of-text-in-field bounds))
              (delete-region (point) (bibtex-end-of-text-in-field bounds))
              (insert (cdr text)))))
        ;; Finally try to update the text based on the difference between
***************
*** 3269,3275 ****
             (bibtex-reposition-window)
             (beginning-of-line)
             (if (and eqb (> pnt pos))
!                (error "The referencing entry must preceed the crossrefed 
entry!")))
            ;; `bibtex-find-crossref' is called noninteractively during
            ;; clean-up of an entry.  Then it is not possible to check
            ;; whether the current entry and the crossrefed entry have
--- 3272,3278 ----
             (bibtex-reposition-window)
             (beginning-of-line)
             (if (and eqb (> pnt pos))
!                (error "The referencing entry must precede the crossrefed 
entry!")))
            ;; `bibtex-find-crossref' is called noninteractively during
            ;; clean-up of an entry.  Then it is not possible to check
            ;; whether the current entry and the crossrefed entry have




reply via email to

[Prev in Thread] Current Thread [Next in Thread]