2 ;;; $Id: tl-str.el,v 3.2 1994/12/19 10:03:57 morioka Exp $
8 ;;; @@ about rightful dividing for multi-octet string
11 (defun rightful-boundary-short-string (str width)
13 (let ((i 0) (w 0) chr (len (length str)))
16 (setq chr (elt str i))
17 (setq w (+ w (char-width chr)))
20 (setq i (+ i (char-bytes chr)))
29 (defun get-version-string (id)
30 (and (string-match "[0-9][0-9.]*" id)
31 (substring id (match-beginning 0)(match-end 0))
37 (defun replace-as-filename (str)
39 (i 0)(len (length str))
42 (setq chr (elt str i))
43 (if (or (and (<= ?+ chr)(<= chr ?.))
44 (and (<= ?0 chr)(<= chr ?:))
46 (and (<= ?@ chr)(<= chr ?\[))
47 (and (<= ?\] chr)(<= chr ?_))
48 (and (<= ?a chr)(<= chr ?{))
49 (and (<= ?} chr)(<= chr ?~))
51 (setq dest (concat dest
52 (char-to-string chr)))
59 ;;; @@ message editing utilities
61 (defvar cited-prefix-regexp "^[^ \t>]*[>|]+[ \t#]*")
63 (defun fill-cited-region (beg end)
72 (narrow-to-region beg end)
73 (goto-char (point-min))
75 (and (re-search-forward cited-prefix-regexp nil t)
76 (or (re-search-forward cited-prefix-regexp nil t)
78 (buffer-substring (match-beginning 0)
81 (pat (concat "\n" fill-prefix))
83 (goto-char (point-min))
84 (while (search-forward pat nil t)
87 (goto-char (point-min))
88 (fill-region (point-min) (point-max))
91 (defun replace-top-string (&optional old new)
94 (setq old (read-string "old string is ? "))
97 (setq new (read-string "new string is ? "))
99 (while (re-search-forward (concat "^" (regexp-quote old)) nil t)
104 ;;; @@ jinn compatible functions
107 (defun symbol-concat (&rest args)
108 (intern (apply (function concat)
111 (cond ((symbolp s) (symbol-name s))
118 (defun top-string-match (pat str)
120 (concat "^" (regexp-quote pat))
122 (list pat (substring str (match-end 0)))
125 (defun middle-string-match (pat str)
128 (if (string-match (regexp-quote pat) str)
129 (let ((b (match-beginning 0))
131 (list (if (not (= b 0))
135 (if (> (length str) e)