all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Searching an alist
@ 2003-12-23 22:35 David Chadd
  0 siblings, 0 replies; only message in thread
From: David Chadd @ 2003-12-23 22:35 UTC (permalink / raw)


I have an alist in the following form:

(defvar occasions
 '(
("14020200" "Purificatio Mariae" "Purification of Mary \(Candlemas\)" "February 2")
("14020208" "Purificatio Mariae, infra octavas" "In week after Purification of Mary" "")
("14020300" "S. Blasii" "Blaise, Bishop of Sebastea, Martyr" "February 3")
("14020308" "S. Blasii, infra octavas" "In week after Blaise" "")
("14020500" "S. Agathae" "Agatha, Martyr" "February 5")
("14020508" "S. Agathae, infra octavas" "In week after Agatha" "")
 [and so on...]

(It's a list of medieval Christian liturgical feasts with serial
numbers -- over 1000 altogether.)

What I want to do is to be able to search it, with an input from the
minibuffer, so that all matching entries are displayed via
'with-output-to-temp-buffer'.  I can do this OK for the first matching
list (using 'find') if I supply the exact match for the whole of an
element.  But what I want is to be able to look for _part_ of an
element.  So, I want (e.g.) the minibuffer to take the input "Blaise",
and both the third and fourth lines above to be returned. (Basically,
what I want is to automate the looking-up of the serial numbers.)

So, there are two things I can't manage.  One is to search for part of
an element (I can if necessary have this restricted to the cadr or
caddr of the list, which is what I have been doing already with :key
#'caddr).  The other is to display _all_ the lists which match.  I
have a feeling that 'assoc-default' might be the clue to the first of
these, but frankly I find both the docstring and manual entry for this
func beyond my feeble understanding of lisp :-(

Any help gratefully received.

DC
-- 
--------------------------
Professor David Chadd
University of East Anglia
Norwich NR4 7TJ, UK
net: <d.chadd@uea.ac.uk>
web: www.uea.ac.uk/~q506/
fax: +44 (0)1263 250454
--------------------------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-12-23 22:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-23 22:35 Searching an alist David Chadd

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.