home *** CD-ROM | disk | FTP | other *** search
/ ftp.madoka.org / 2014.12.ftp.madoka.org.tar / ftp.madoka.org / pub / irchat-pj / irchat-pj-2.4.24.22.tar.gz / irchat-pj-2.4.24.22.tar / irchat-pj-2.4.24.22 / irchat-inlines.el < prev    next >
Lisp/Scheme  |  2002-07-18  |  2KB  |  79 lines

  1. ;;;
  2. ;;; $Id: irchat-inlines.el,v 1.2 1993/10/06 16:18:28 tmo Exp $
  3. ;;;
  4. ;;; see file irchat-copyright.el for change log and copyright info
  5.  
  6. ;; modified by simm@irc.fan.gr.jp, Wed, 05 Jan 2000 02:51:10 +0900
  7. (or (fboundp 'defsubst)
  8.     (fset 'defsubst 'defun))
  9.  
  10. (provide 'irchat-inlines)
  11.  
  12. (defsubst string-list-ci-memberp (thing list)
  13.   "returns t if thing is member of list, not funcallable"
  14.   (let ((item (car list))
  15.     (uthing (upcase thing)))
  16.     (while (and item (not (string-equal uthing (upcase item))))
  17.       (setq item (car list)
  18.         list (cdr list)))
  19.     item))
  20.  
  21. (defsubst string-list-memberp (thing list)
  22.   "returns t if thing is member of list, not funcallable"
  23.   (let ((item (car list)))
  24.     (while (and item (not (string-equal thing item)))
  25.       (setq item (car list)
  26.         list (cdr list)))
  27.     item))
  28.  
  29. (defsubst string-list-ci-delete (thing list)
  30.   (let ((uthing (upcase thing))
  31.     (item (car list))
  32.     (result nil))
  33.     (while item
  34.       (if (not (string-equal (upcase item) uthing))
  35.       (setq result (nconc result (list item))))
  36.       (setq list (cdr list)
  37.         item (car list)))
  38.     result))
  39.  
  40. (defsubst string-list-delete (thing list)
  41.   (let ((item (car list))
  42.     (result nil))
  43.     (while item
  44.       (if (not (string-equal item thing))
  45.       (setq result (nconc result (list item))))
  46.       (setq list (cdr list)
  47.         item (car list)))
  48.     result))
  49.  
  50. (defsubst list-to-assoclist (list)
  51.   (let ((result nil) (item (car list)))
  52.     (while item
  53.       (setq result (cons (list item) result)
  54.         list (cdr list)
  55.         item (car list)))
  56.     result))
  57.  
  58. (defsubst matching-substring (string arg)
  59.   (substring string (match-beginning arg) (match-end arg)))
  60.  
  61. (defsubst string-ci-equal (s1 s2)
  62.   (string-equal (upcase s1) (upcase s2)))
  63.  
  64. (defsubst nth1 (nn str)
  65.   (nth (- nn 1) str))
  66.  
  67. (defsubst nth1cdr (nn str)
  68.   (nthcdr (- nn 1) str))
  69.  
  70. (defsubst add-space (length string)
  71.   (if (< (length string) length)
  72.       (format "%s%s" string (make-string (- length (length string)) 32))
  73.     string))
  74.  
  75. (defsubst irchat-next-line (&optional n)
  76.   (if (= (point) (point-max))
  77.       (newline))
  78.   (forward-line n))
  79.