;;; border.el ;;; ;;; Copyright (C) 1997, 1998, 2004, 2007, 2008 Thien-Thi Nguyen ;;; ;;; This file is part of ttn's personal elisp library, released under ;;; the terms of the GNU General Public License as published by the ;;; Free Software Foundation; either version 3, or (at your option) any ;;; later version. There is NO WARRANTY. See file COPYING for details. ;;; Description: Given a list and break element, return "border" list. ;;; E.g., (border 3 '(1 2 3 4 5)) => (2 3 4 5). ;;; In conjunction w/ setcdr, this is useful for list splitting. ;;;###autoload (defun border (elem lst) "Find sublist, using ELEM of LST, where ELEM is the cadr. Test w/ equal." (and (consp lst) (consp (cdr lst)) (or (and (equal elem (cadr lst)) lst) (border elem (cdr lst))))) (provide 'border) ;;; border.el ends here