🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #1734

Re: BibTeX - Sorting Bibliography Entries

#1734
From: Ralph P. Sobek
Date: Wed, 26 Aug 1992 15:58
35 lines
1806 bytes
I use the following under emacs.  The only problem that I've ever
noticed showed up a bug in emacs 18.55, in which *very* large BibTeX
entries (on the order of a couple hundred characters) would be skipped
during the sort.

Here is sort-BibTeX.el:

;;; File: sort-BibTeX.el
;;; by Ralph P. Sobek (ralph@laas.fr) --  May 18, 1990

(require 'bibtex-mode)

(defconst bibtex-reference "^@.*{\\(.*\\),\\\n\\(^[^}].*\\\n\\)*}$")

(defun sort-BibTeX ()
  (interactive)
  ; A BibTeX record entry here is defined to be:
  ; @name{key,\n...\n}$
  ; For the moment, the key is
  (sort-regexp-fields nil bibtex-reference "\\2"
		      (point-min) (point-max))
;  (set-visited-file-name (concat (buffer-file-name) ".sorted"))
)

That's all folks.  If there are any improvements or suggestions,
please let me know.

--
Ralph P. Sobek			  Disclaimer: The above ruminations are my own.
Ralph.Sobek@laas.fr			   Addresses are ordered by importance.
ralph@laas.fr						If all else fails, try:
ralph@laas.uucp, or ...!uunet!laas!ralph	      sobek@eclair.Berkeley.EDU
Telephone: (+33-)61-33-62-66  FAX-1: (+33-)61-33-64-55 FAX-2: (+33-)61-55-35-77
===============================================================================
Let's hear it for justice, California style!  Bravo, guys!  SNAFU!
Technical Details
Message-ID: <RALPH.92Aug26175821@orion.laas.fr>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!laas!ralph
References: <redel.714314320@shannon>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!laas!ralph
From: ralph@laas.fr (Ralph P. Sobek)
Newsgroups: comp.text.tex,gnu.emacs.sources
Subject: Re: BibTeX - Sorting Bibliography Entries
Message-ID: <RALPH.92Aug26175821@orion.laas.fr>
Date: 26 Aug 92 15:58:21 GMT
References: <redel.714314320@shannon>
Sender: news@laas.fr
Followup-To: comp.text.tex
Organization: LAAS-CNRS France
Lines: 35
Nntp-Posting-Host: orion
In-reply-to: redel@shannon.ee.wits.ac.za's message of 20 Aug 92 12:38:40 GMT