? biber.patch ? biber1.patch Index: font-latex.el =================================================================== RCS file: /sources/auctex/auctex/font-latex.el,v retrieving revision 5.194 diff -r5.194 font-latex.el 293a294,321 > ("biblatexnoarg" > ("newrefsegment" "mancite" "pno" "ppno" "nopp" "psq" "psqq") > 'font-lock-variable-name-face 2 noarg) > ("biblatex" > (("newrefsection" "[") ("ExecuteBibliographyOptions" "[{") > ("printbibliography" "[") ("printshorthands" "[") ("printbibheading" "[") > ("addbibresource" "[{") ("addglobalbib" "[{") ("addsectionbib" "[{") > ("bibbysection" "[") ("bibbysegment" "[") ("bibbycategory" "[") > ("DeclareBibliographyCategory" "{") ("addtocategory" "{{") ("defbibenvironment" "{{{{") > ("defbibheading" "{[{") ("defbibnote" "{{") ("defbibfilter" "{{") ("defbibcheck" "{{") > ("defbibentryset" "{{") ("Cite" "[[{") ("parencite" "*[[{") ("Parencite" "[[{") > ("footcite" "[[{") ("footcitetext" "[[{") ("textcite" "[[{") ("Textcite" "[[{") > ("smartcite" "[[{") ("Smartcite" "[[{") ("supercite" "{") ("autocite" "*[{{") > ("Autocite" "*[{{") ("citeauthor" "[{{") ("Citeauthor" "[{{") ("citetitle" "*[{{") > ("citeyear" "*[[{") ("citedate" "*[[{") ("citeurl" "[[{") ("parentext" "{") > ("brackettext" "{") ("fullcite" "[[{") ("fullfootcite" "[[{") ("volcite" "[{[[") > ("Volcite" "[{[[") ("pvolcite" "[{[[") ("Pvolcite" "[{[[") ("fvolcite" "[{[[") > ("ftvolcite" "[{[[") ("svolcite" "[{[[") ("Svolcite" "[{[[") ("tvolcite" "[{[[") > ("Tvolcite" "[{[[") ("avolcite" "[{[[") ("Avolcite" "[{[[") ("notecite" "[[{") > ("Notecite" "[[{") ("pnotecite" "[[{") ("Pnotecite" "[[{") ("fnotecite" "[[{") > ("citename" "[[{[{") ("citelist" "[[{[{") ("citefield" "[[{[{") ("citereset" "*") > ("RN" "{") ("Rn" "{") ("DefineBibliographyStrings" "{{") ("DefineBibliographyExtras" "{{") > ("UndefineBibliographyExtras" "{{") ("DefineHyphenationExceptions" "{{") > ("NewBibliographyString" "{") ("autocites" "(([[{") ("Autocites" "(([[{") > ("cites" "(([[{") ("Cites" "(([[{") ("parencites" "(([[{") ("Parencites" "(([[{") > ("footcites" "(([[{") ("footcitetexts" "(([[{") ("smartcites" "(([[{") > ("Smartcites" "(([[{") ("textcites" "(([[{") ("Textcites" "(([[{") ("supercites" "(([[{")) > 'font-lock-constant-face 2 command) 295c323 < (("nocite" "{") ("cite" "[{") ("label" "{") ("pageref" "{") --- > (("nocite" "*{") ("cite" "*[[{") ("label" "{") ("pageref" "{") 798c826 < symbols 'warning, 'variable, 'reference, 'function, sectioning-0, --- > symbols 'warning, 'variable, 'reference, 'biblatex, 'function, sectioning-0, Index: latex.el =================================================================== RCS file: /sources/auctex/auctex/latex.el,v retrieving revision 5.470 diff -r5.470 latex.el 1215c1215,1221 < ("\\\\bibliography{\\([^#}\\\\\n\r]+\\)}" 1 LaTeX-auto-bibliography))) --- > ("\\\\bibliography{\\([^#}\\\\\n\r]+\\)}" 1 LaTeX-auto-bibliography) > ("\\\\addbibresource\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\\\n\r\.]+\\)\\..+}" 1 LaTeX-auto-bibliography) > ("\\\\add\\(?:global\\|section\\)bib\\(?:\\[[^]]+\\]\\)?{\\([^#}\\\\\n\r\.]+\\)\\(?:\\..+\\)?}" 1 LaTeX-auto-bibliography) > ("\\\\newrefsection\\[\\([^]]+\\)\\]" 1 LaTeX-split-bibs) > ("\\\\begin{refsection}\\[\\([^]]+\\)\\]" 1 LaTeX-split-bibs) > ("backend=\\(biber\\)" 1 LaTeX-biber) > ("\\\\ExecuteBibliographyOptions\\(?:\\[[^]]+\\]\\)?{.*?backend=\\(biber\\)}" 1 LaTeX-using-Biber))) 1221a1228,1245 > ;; Either the user has set a global use biber flag or we detect it from the file > (defun LaTeX-biber (match) > (if (or LaTeX-always-use-Biber > (string= "biber" (TeX-match-buffer match))) > (setq LaTeX-using-Biber t) > (setq LaTeX-using-Biber nil))) > > (defun LaTeX-split-bibs (match) > (let ((bibs (TeX-split-string " *, *" (TeX-match-buffer match)))) > (dolist (bib bibs) > (LaTeX-add-bibliographies (replace-regexp-in-string > (concat "\\(?:\\." > (mapconcat 'regexp-quote > BibTeX-Biber-file-extensions > "\\|\\.") > "\\)") > "" bib))))) > 1251c1275 < ;; Cleanup BibTeX files --- > ;; Cleanup BibTeX/Biber files 1386a1411,1416 > ;;; Biber support > ;;; Need a variable to say if we're using biber - certain things need consitionalising on this > > (defvar LaTeX-using-Biber nil "Used to track whether we detected Biber in use") > (defvar LaTeX-always-use-Biber nil "Global override for biber usage") > 1682c1712 < (bibinputs "${BIBINPUTS}" ("bibtex/bib/") BibTeX-file-extensions) --- > (bibinputs "${BIBINPUTS}" ("bibtex/bib/") BibTeX-Biber-file-extensions) 1780,1781c1810,1811 < (defvar BibTeX-global-files nil < "Association list of BibTeX files. --- > (defvar BibTeX-Biber-global-files nil > "Association list of BibTeX/Biber files. 1783c1813 < Initialized once at the first time you prompt for an BibTeX file. --- > Initialized once at the first time you prompt for an BibTeX/Biber file. 1787c1817 < "Prompt for a BibTeX database file. --- > "Prompt for a BibTeX/Biber database file. 1791,1793c1821,1823 < (message "Searching for BibTeX files...") < (or BibTeX-global-files < (setq BibTeX-global-files --- > (message "Searching for BibTeX/Biber files...") > (or BibTeX-Biber-global-files > (setq BibTeX-Biber-global-files 1797c1827 < (TeX-argument-prompt optional prompt "BibTeX files") --- > (TeX-argument-prompt optional prompt "BibTeX/Biber files") 1800c1830 < BibTeX-global-files)))) --- > BibTeX-Biber-global-files)))) 5262a5293 > '("addbibresource" TeX-arg-bibliography) Index: tex-buf.el =================================================================== RCS file: /sources/auctex/auctex/tex-buf.el,v retrieving revision 1.286 diff -r1.286 tex-buf.el 79c79 < Return non-nil if document need to be re-TeX'ed." --- > Return non-nil if document needs to be re-TeX'ed." 369c369 < "Check that DERIVED is newer than any of the ORIGINALS. --- > "Check if DERIVED is newer than any of the ORIGINALS. 371,384c371,385 < in `TeX-check-path'." < (let ((found nil) < (regexp (concat "\\`\\(" < (mapconcat (lambda (dir) < (regexp-quote < (expand-file-name < (file-name-as-directory dir)))) < TeX-check-path "\\|") < "\\).*\\(" < (mapconcat 'regexp-quote originals "\\|") < "\\)\\.\\(" < (mapconcat 'regexp-quote extensions "\\|") < "\\)\\'")) < (buffers (buffer-list))) --- > in `TeX-check-path'. Returns true if any of the ORIGINALS with any of the > EXTENSIONS are newer than DERIVED. Will prompt to save the buffer of any > ORIGINALS which are modified but not saved yet." > (let ((existingoriginals nil) > (found nil) > (buffers (buffer-list))) > (dolist (path (map 'list (lambda (dir) > (expand-file-name > (file-name-as-directory dir))) > TeX-check-path)) > (dolist (orig originals) > (dolist (ext extensions) > (let ((filepath (concat path orig "." ext))) > (if (file-exists-p filepath) > (setq existingoriginals (cons filepath existingoriginals))))))) 387,399c388,402 < (name (buffer-file-name buffer))) < (setq buffers (cdr buffers)) < (if (and name (string-match regexp name)) < (progn < (and (buffer-modified-p buffer) < (or (not TeX-save-query) < (y-or-n-p (concat "Save file " < (buffer-file-name buffer) < "? "))) < (save-excursion (set-buffer buffer) (save-buffer))) < (if (file-newer-than-file-p name derived) < (setq found t)))))) < found)) --- > (name (buffer-file-name buffer))) > (setq buffers (cdr buffers)) > (if (and name (member name existingoriginals)) > (progn > (and (buffer-modified-p buffer) > (or (not TeX-save-query) > (y-or-n-p (concat "Save file " > (buffer-file-name buffer) > "? "))) > (save-excursion (set-buffer buffer) (save-buffer))))))) > (dolist (eo existingoriginals) > (if (file-newer-than-file-p eo derived) > (setq found t))) > found > )) 407a411,415 > ;; Something to remember - if you are testing on a document with no content at all, > ;; perhaps one with just \nocite{*} in it for testing Biber runs, no PDF file is created > ;; by latex and so the first cond clause will match because (file-newer-than-p) returns > ;; t when the second argument does not exist ... this has caused hours of pointless investigations > ;; before ... 411,433c419,443 < (TeX-check-files (concat name "." (TeX-output-extension)) < (list name) < TeX-file-extensions) < (TeX-save-document (TeX-master-file))) < TeX-command-default) < ((and (memq major-mode '(doctex-mode latex-mode)) < (TeX-check-files (concat name ".bbl") < (mapcar 'car < (LaTeX-bibliography-list)) < BibTeX-file-extensions)) < ;; We should check for bst files here as well. < TeX-command-BibTeX) < ((TeX-process-get-variable name < 'TeX-command-next < TeX-command-Show)) < (TeX-command-Show))) < (completion-ignore-case t) < (answer (or TeX-command-force < (completing-read < (concat "Command: (default " default ") ") < (TeX-mode-specific-command-list major-mode) nil t < nil 'TeX-command-history)))) < ;; If the answer "latex" it will not be expanded to "LaTeX" --- > (TeX-check-files (concat name "." (TeX-output-extension)) > (list name) > TeX-file-extensions) > (TeX-save-document (TeX-master-file))) > TeX-command-default) > ((and (memq major-mode '(doctex-mode latex-mode)) > ;; Want to know if bib file is newer than .bbl > ;; We don't care whether the bib files are open in emacs > (TeX-check-files (concat name ".bbl") > (mapcar 'car > (LaTeX-bibliography-list)) > BibTeX-Biber-file-extensions)) > ;; We should check for bst files here as well. > (if LaTeX-using-Biber TeX-command-Biber TeX-command-BibTeX)) > ((TeX-process-get-variable name > 'TeX-command-next > TeX-command-Show)) > (TeX-command-Show))) > (completion-ignore-case t) > (answer (or TeX-command-force > (completing-read > (concat "Command: (default " default ") ") > (TeX-mode-specific-command-list major-mode) nil t > nil 'TeX-command-history)))) > ;; If the answer is "latex" it will not be expanded to "LaTeX" 436,437c446,447 < (not (string-equal answer ""))) < answer --- > (not (string-equal answer ""))) > answer 675a686,693 > (defun TeX-run-Biber (name command file) > "Create a process for NAME using COMMAND to format FILE with Biber." > (let ((process (TeX-run-command name command file))) > (setq TeX-sentinel-function 'TeX-Biber-sentinel) > (if TeX-process-asynchronous > process > (TeX-synchronous-sentinel name file process)))) > 942a961,973 > "^Package biblatex Warning: Please (re)run Biber on the file" nil t)) > (with-current-buffer TeX-command-buffer > (and (LaTeX-bibliography-list) > (TeX-check-files (TeX-master-file "bbl") > (TeX-style-list) > (append TeX-file-extensions > BibTeX-Biber-file-extensions))))) > (message "%s%s" "You should run Biber to get citations right, " > (TeX-current-pages)) > (setq TeX-command-next (with-current-buffer TeX-command-buffer > TeX-command-Biber))) > ((and (save-excursion > (re-search-forward 949c980 < BibTeX-file-extensions))))) --- > BibTeX-Biber-file-extensions))))) 953a985,988 > ((re-search-forward "^(biblatex)\\W+Page breaks have changed" nil t) > (message "%s%s" "You should run LaTeX again - page breaks have changed, " > (TeX-current-pages)) > (setq TeX-command-next TeX-command-default)) 1011,1012c1046,1071 < "Run LaTeX again to get citations right.")))) < (setq TeX-command-next TeX-command-default)) --- > "Run LaTeX again to get citations right.")) > (setq TeX-command-next TeX-command-default)))) > > (defun TeX-Biber-sentinel (process name) > "Cleanup TeX output buffer after running Biber." > (goto-char (point-max)) > (cond > ((re-search-backward (concat > "^INFO - \\(WARNINGS\\|ERRORS\\): \\([0-9]+\\)") nil t) > (message (concat "Biber finished with %s %s. " > "Type `%s' to display output.") > (match-string 2) (downcase (match-string 1)) > (substitute-command-keys > "\\\\[TeX-recenter-output-buffer]")) > (setq TeX-command-next TeX-command-default)) > ((re-search-backward (concat > "^FATAL") nil t) > (message (concat "Biber had a fatal error and did not finish! " > "Type `%s' to display output.") > (substitute-command-keys > "\\\\[TeX-recenter-output-buffer]")) > (setq TeX-command-next TeX-command-Biber)) > (t > (message (concat "Biber finished successfully. " > "Run LaTeX again to get citations right.")) > (setq TeX-command-next TeX-command-default)))) Index: tex.el =================================================================== RCS file: /sources/auctex/auctex/tex.el,v retrieving revision 5.697 diff -r5.697 tex.el 137a138 > ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber") 181a183,184 > TeX-run-Biber: For Biber output. > 229a233 > (function-item TeX-run-Biber) 1783a1788,1793 > (defcustom TeX-command-Biber "Biber" > "*The name of the Biber entry in `TeX-command-list'." > :group 'TeX-command-name > :type 'string) > (make-variable-buffer-local 'TeX-command-Biber) > 3296c3306 < BibTeX-file-extensions)) --- > BibTeX-Biber-file-extensions)) 3316c3326 < (BibTeX-file-extensions nil)) --- > (BibTeX-Biber-file-extensions nil)) 3631,3632c3641,3642 < (defcustom BibTeX-file-extensions '("bib") < "Valid file extensions for BibTeX files." --- > (defcustom BibTeX-Biber-file-extensions '("bib" "ris" "xml") > "Valid file extensions for BibTeX/Biber files." 3807c3817 < (bibinputs "${BIBINPUTS}" ("bibtex/bib/") BibTeX-file-extensions) --- > (bibinputs "${BIBINPUTS}" ("bibtex/bib/") BibTeX-Biber-file-extensions) 5164c5174 < BibTeX-global-files nil --- > BibTeX-Biber-global-files nil