文字列
Type: Function
Arguments: abbreviate-display-string STRING LENGTH &optional PATHNAMEP
Package: editor
File: builtin.l
文字列を表示幅に収まるように[...]で省略して返します。
STRING : 表示する文字列を指定します。
LENGTH : 表示幅を指定します。
PATHNAMEP : 文字列がファイル名かどうかを指定します。
ファイル名の場合には先頭の3文字(例:"C:/")だけ残して省略します。
使用例:
(abbreviate-display-string "c:/xyzzy/lisp/builtin.l" 20 nil)
=> "c:/xyzzy.../builtin.l"
(abbreviate-display-string "c:/xyzzy/lisp/builtin.l" 20 t)
=> "c:/.../lisp/builtin.l"
Type: Function
Arguments: buffer-substring FROM TO
Package: editor
File: builtin.l
バッファの指定された範囲の文字列を返します。
Type: Function
Arguments: capitalize-word &optional (ARG 1)
Package: editor
File: cmds.l
前方の単語の先頭の文字を大文字に、それ以外の文字を小文字に変換します。
[ESC c]
カーソルが単語の途中にある場合は、カーソル位置の文字を大文字に、それ以
降の文字を小文字に変換します。
SeeAlso: capitalize-region
SeeAlso: forward-word
Type: Function
Arguments: char STRING INDEX
Package: lisp
File: builtin.l
STRINGのINDEX番目の文字を返します。
INDEXは0を基底とします。
使用例:
;;; 先頭から最後まで取得する。
(char "foo" -1) => 範囲外の値です: -1
(char "foo" 0) => #\f
(char "foo" 1) => #\o
(char "foo" 2) => #\o
(char "foo" 3) => 範囲外の値です: 3
Type: Function
Arguments: concat &rest SEQ
Package: editor
File: misc.l
指定された文字列を連結します。
使用例:
;;; concatを使ってみる。
(setq foo "It's ") => "It's "
(setq bar "show time!!!") => "show time!!!"
(concat foo bar) => "It's show time!!!"
(concat "It's " "show " "time!!!")
=>"It's show time!!!"
Type: Function
Arguments: copy-string STRING
Package: lisp
File: builtin.l
STRINGのコピーを返します。
使用例:
;;; 単にsetqしただけでは同じオブジェクトになっている。
(setq foo "abc") => "abc"
(setq bar foo) => "abc"
(eq foo bar) => t
;;; コピーすると別のオブジェクトになる。
(setq bar (copy-string foo)) => "abc"
(eq foo bar) => nil
Type: Function
Arguments: decode-escape-sequence STRING REGEXPP
Package: editor
File: builtin.l
エスケープシーケンスをデコードします。
STRING :デコードするエスケープシーケンス
REGEXPP:STRING が正規表現か否かを指定します。
使用例:
;;; [\thoge]という6文字をデコードして5文字にする。
"\\thoge"
=> "\\thoge"
(decode-escape-sequence "\\thoge" nil)
=> " hoge"
(length "\\thoge")
=> 6
(length (decode-escape-sequence "\\thoge" nil))
=> 5
Link: [xyzzy:04201]
Type: Function
Arguments: delete-indentation &optional ARG
Package: editor
File: cmds.l
インデントを削除し直前の行と連結します。
連結する行とされる行は、半角スペースで区切られます。
ARG : 連結する行を指定します。
t 次行のインデントを削除し、現在の行に連結します。
nil 現在の行のインデントを削除し、直前の行に連結します。
Type: Function
Arguments: delete-last-ime-composition
Package: editor
File: kanji.l
IME 変換直後であれば、直前に変換した文字列を削除します。[C-c C-d]
Type: Function
Arguments: downcase-word &optional (ARG 1)
Package: editor
File: cmds.l
カーソル位置から単語の末尾までを小文字に変換します。
SeeAlso: downcase-region
SeeAlso: upcase-word
Type: Function
Arguments: fill-paragraph
Package: editor
File: fill.l
現在の段落を詰め込みます。
SeeAlso: fill-region-as-paragraph
Type: Function
Arguments: ime-push-composition-string &optional NODELETE
Package: editor
File: kanji.l
セレクションの確定済仮名文字を非確定状態にします。[C-c C-p]
Type: Function
Arguments: map-backslash-to-slash STRING
Package: editor
File: builtin.l
文字列のバックスラッシュをスラッシュに置換して返します。
STRING : 変換対象の文字列
使用例:
;;; パスを変換する。
(map-backslash-to-slash "C:\\xyzzy\\xyzzy.exe")
=> "C:/xyzzy/xyzzy.exe"
SeeAlso: map-slash-to-backslash
Type: Function
Arguments: map-slash-to-backslash STRING
Package: editor
File: builtin.l
文字列のスラッシュをバックスラッシュに置換して返します。
STRING : 変換対象の文字列
使用例:
;;; パスを変換する。
(map-slash-to-backslash "C:/xyzzy/xyzzy.exe")
=> "C:\\xyzzy\\xyzzy.exe"
SeeAlso: map-backslash-to-slash
Type: Function
Arguments: namestring PATHNAME
Package: lisp
File: builtin.l
PATHNAMEの内容に応じて適切なフルパスを返すような動きをする。与えたのがフ
ルパスでなければ、先頭に(default-directory)を補ってフルパスらしくします。
使用例:
(default-directory)
=>"C:/Applications/xyzzy/"
(namestring "abc.txt")
=>"C:/Applications/xyzzy/abc.txt"
(namestring "Z:/zzz.txt")
=>"Z:/zzz.txt"
SeeAlso: file-namestring
Type: Function
Arguments: nstring-capitalize STRING &key :start :end
Package: lisp
File: builtin.l
STRINGの内部の単語の先頭を大文字に、それ以外を小文字にします。
元のSTRINGは変更されます。
使用例:
(setq foo "tHis iS a pEn.")
=> "tHis iS a pEn."
(nstring-capitalize foo)
=> "This Is A Pen."
foo
=> "This Is A Pen."
SeeAlso: string-capitalize
Type: Function
Arguments: nstring-downcase STRING &key :start :end
Package: lisp
File: builtin.l
STRINGを小文字にした文字列を返します。元のSTRINGは変更されます。
使用例:
(setq foo "XyZzY")
=> "XyZzY"
(nstring-downcase foo)
=> "xyzzy"
foo
=> "xyzzy"
SeeAlso: string-downcase
Type: Function
Arguments: nstring-upcase STRING &key :start :end
Package: lisp
File: builtin.l
STRINGを大文字にした文字列を返します。元のSTRINGは変更されます。
使用例:
(setq foo "xyzzy")
=> "xyzzy"
(nstring-upcase foo)
=> "XYZZY"
foo
=> "XYZZY"
SeeAlso: string-upcase
Type: Function
Arguments: quote-string STRING TARGET-CHAR QUOTE-CHAR
Package: editor
File: builtin.l
文字列中の特定文字の前にエスケープ文字をつけます。
STRING : 置換する文字列
TARGET-CHAR : エスケープされる文字
QUOTE-CHAR : エスケープ文字
使用例:
;;; スペースの前に'をつけます。
(quote-string "a b c" #\SPC #\')
=> "a' b' ' c"
Type: Function
Arguments: rewind-ime-composition &optional NODELETE POP
Package: editor
File: kanji.l
直前に IME で変換した文字列を非確定状態に戻します。[C-c C-c]
変換直後でなければ、直前に変換した文字列を非確定状態で挿入します。
Type: Function
Arguments: schar SIMPLE-STRING INDEX
Package: lisp
File: builtin.l
SIMPLE-STRINGのINDEX番目の文字を返します。
INDEXは0を基底とします。
使用例:
;;; simpleでないstringでscharを使ってみる。
(setq foo (make-vector 10 :initial-element #\a :element-type 'character :fill-pointer 3))
=> "aaa"
(schar foo 0) => 不正なデータ型です: "aaa": simple-string
(setq bar "aaa") => "aaa"
(schar bar 0) => #\a
SeeAlso: simple-string
Type: Function
Arguments: split-string STRING SEPARATOR &optional IGNORE-EMPTY CHAR-BAG
Package: editor
File: builtin.l
文字列を指定されたセパレータ文字で分割したリストにします。
セパレータ文字は含まれません。
STRING : 分割する文字列を指定します。
SEPARATOR : セパレータ文字を指定します。
IGNORE-EMPTY : 長さが0の文字列も(つまり、セパレータ文字が連続するような場合)
を許すかどうかを指定します。
CHAR-BAG : 分割した後の文字列の前後をトリムするための文字群を指定します。
使用例:
(split-string "121,,12321" #\,) => ("121" "12321")
(split-string "121,,12321" #\, t) => ("121" "" "12321")
(split-string "121,,12321" #\, t "1") => ("2" "" "232")
(split-string "121,,12321" #\, t "3") => ("121" "" "12321")
Type: Function
Arguments: string X
Package: lisp
File: builtin.l
Xが文字列ならそれを返します。シンボルならその名前を返します。
使用例:
(string "foo")
=> "foo"
(string 'bar)
=> "bar"
Type: Function
Arguments: string-capitalize STRING &key :start :end
Package: lisp
File: builtin.l
STRINGの内部の単語の先頭を大文字に、それ以外を小文字にした文字列を返します。
使用例:
(string-capitalize "xYZzY")
=> "Xyzzy"
(string-capitalize "tHis iS a pEn.")
=> "This Is A Pen."
SeeAlso: nstring-capitalize
Type: Function
Arguments: string-downcase STRING &key :start :end
Package: lisp
File: builtin.l
STRINGを小文字にした文字列を返します。元のSTRINGは変更されません。
使用例:
(string-downcase "XyZzY")
=> "xyzzy"
(string-downcase "XYZZY" :start 2 :end 4)
=> "XYzzY"
SeeAlso: nstring-downcase
Type: Function
Arguments: string-equal STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を大文字小文字に関係なく比較して等しければt、そうでなけ
ればnilを返します。
使用例:
(string-equal "foo" "foo")
=> t
(string-equal "foo" "Foo")
=> t
SeeAlso: string=
Type: Function
Arguments: string-greaterp STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を大文字小文字に関係なく比較して、等しければ一致しない文
字のインデックスを、そうでなければnilを返します。
使用例:
(string-greaterp "ac" "ab")
=> 1
(string-greaterp "ac" "ac")
=> nil
(string-greaterp "AC" "ab")
=> 1
SeeAlso: string>
Type: Function
Arguments: string-left-trim CHARACTER-BAG STRING
Package: lisp
File: builtin.l
文字列の先頭から指定した文字群を削除します。
STRING : 文字列
CHARACTGER-BAG : 削除する文字群です。
使用例:
;;; 先頭の"/"や"\"を取り除きます。
(string-left-trim "/\\" "/foo/bar/zzz.txt/" )
=> "foo/bar/zzz.txt/"
SeeAlso: string-trim
SeeAlso: string-right-trim
Type: Function
Arguments: string-lessp STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を大文字小文字に関係なく比較して条件に合えば一致しない文
字のインデックスを、そうでなければnilを返します。
使用例:
(string-lessp "Aa" "ab")
=> 1
(string-lessp "ac" "AB")
=> nil
SeeAlso: string<
Type: Function
Arguments: string-match REGEXP STRING &optional START END
Package: editor
File: builtin.l
指定された文字列が正規表現に一致するかどうかを返します。
REGEXP : 正規表現
STRING : チェックする文字列
START : 文字列の開始位置
END : 文字列の終了位置
--- muleの説明 ---
この関数は、(string 中で)正規表現 regexp に最初にマッチする場所のインデ
ックスか、 (マッチしない場合) nil を返します。 start が non-nil の場合、
サーチは string 中のそのインデックスから行ないます。
マッチ部分の先の(最初の)文字のインデックスは (match-end 0) で作られます。
0 でないアーギュメントを持つ match-end と match-beginning はパターン中の
括弧構成(訳注:parenthesis constructs) にマッチするサブストリングのイン
デックスを与えます。
(string-match "X[a-z]*Y" "X1 Y Xab cY XabcY")
=> 12
(match-end 0)
=> 17
互換性:
muleあり。
Common Lispなし。
SeeAlso: string-matchp
Type: Function
Arguments: string-matchp REGEXP STRING &optional START END
Package: editor
File: builtin.l
| string-match と string-matchp とはどこがどう
| 違うのでしょう?
p 付きの方は大文字小文字を区別しません。
SeeAlso: string-match
Type: Function
Arguments: string-not-equal STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を大文字小文字に関係なく比較して等しくなければt、そうで
なければnilを返します。string-equalの反対の機能です。
SeeAlso: string-equal
Type: Function
Arguments: string-not-greaterp STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を大文字小文字に関係なく比較して条件に合えば一致しない文
字のインデックスを、そうでなければnilを返します。
SeeAlso: string<=
Type: Function
Arguments: string-not-lessp STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を大文字小文字に関係なく比較して条件に合えば一致しない文
字のインデックスを、そうでなければnilを返します。
SeeAlso: string>=
Type: Function
Arguments: string-replace-match STRING REPLACEMENT
Package: editor
File: builtin.l
string-matchで検索した結果を使って文字列の置換を行います。
STRING : string-matchで指定した文字列を指定します。
REPLACEMENT : 置換する文字列を指定します。
REPLACEには正規表現に部分\1-\9を含めることが可能です。
使用例:
;;; 文字列を置換してみる。
(setq str "01356:00001:error message")
=> "01356:00001:error message"
(when (string-match "\\([0-9]+\\):\\([0-9]+\\):\\(.*\\)" str)
(setq str (string-replace-match str "\\1,\\3")))
=> "01356,error message"
SeeAlso: string-match
Type: Function
Arguments: string-right-trim CHARACTER-BAG STRING
Package: lisp
File: builtin.l
文字列の末尾から指定した文字群を削除します。
STRING : 文字列
CHARACTGER-BAG : 削除する文字群です。
使用例:
;;; 末尾の"/"や"\"を取り除きます。
(string-right-trim "/\\" "/foo/bar/zzz.txt/" )
=> "/foo/bar/zzz.txt"
SeeAlso: string-trim
SeeAlso: string-left-trim
Type: Function
Arguments: string-trim CHARACTER-BAG STRING
Package: lisp
File: builtin.l
文字列の前後から指定した文字群を削除します。
STRING : 文字列
CHARACTGER-BAG : 削除する文字群です。
使用例:
;;; 前後の"/"や"\"を取り除きます。
(string-trim "/\\" "/foo/bar/zzz.txt/" )
=> "foo/bar/zzz.txt"
SeeAlso: string-right-trim
SeeAlso: string-left-trim
Type: Function
Arguments: string-upcase STRING &key :start :end
Package: lisp
File: builtin.l
STRINGを大文字にした文字列を返します。元のSTRINGは変更されません。
使用例:
(string-upcase "xyzzy")
=> "XYZZY"
(string-upcase "xyzzy" :start 2 :end 4)
=> "xyZZy"
SeeAlso: nstring-upcase
Type: Function
Arguments: string/= STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を比較して等しくなければt、そうでなければnilを返します。
英字の大文字と小文字は区別します。string=の反対の機能です。
SeeAlso: string=
Type: Function
Arguments: string< STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を比較して条件に合えば一致しない文字のインデックスを、そ
うでなければnilを返します。
使用例:
(string< "aa" "aa")
=> nil
(string< "aa" "ab")
=> 1
SeeAlso: string-lessp
Type: Function
Arguments: string<= STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を比較して条件に合えば一致しない文字のインデックスを、そ
うでなければnilを返します。
SeeAlso: string-not-greaterp
Type: Function
Arguments: string= STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を比較して等しければt、そうでなければnilを返します。
英字の大文字と小文字は区別します。
使用例:
(string= "foo" "foo")
=> t
(string= "foo" "Foo")
=> nil
(string= "together" "frog" :start1 1 :end1 3 :start2 2)
=> t
参考:
case-sensitive case-insensitive
---- ----
string= string-equal
string/= string-not-equal
string< string-lessp
string> string-greaterp
string<= string-not-greaterp
string>= string-not-lessp
SeeAlso: string-equal
Type: Function
Arguments: string> STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を比較して条件に合えば一致しない文字のインデックスを、そ
うでなければnilを返します。
使用例:
(string> "ac" "ab")
=> 1
(string> "ac" "ac")
=> nil
(string> "AC" "ab")
=> nil
SeeAlso: string-greaterp
Type: Function
Arguments: string>= STRING1 STRING2 &key :start1 :end1 :start2 :end2
Package: lisp
File: builtin.l
STRING1とSTRING2を比較して条件に合えば一致しない文字のインデックスを、そ
うでなければnilを返します。
SeeAlso: string-not-lessp
Type: Function
Arguments: substitute-string STRING PATTERN REPLACEMENT &key :case-fold :start :end :skip :count
Package: editor
File: builtin.l
文字列中のパターンを置換して返します。
使用例:
;;; 部分文字列を置換する。
(substitute-string "Hogehoge" "ho" "pa")
=> "Hogepage"
;;; 大文字小文字を区別せず置換する。
(substitute-string "Hogehoge" "ho" "pa" :case-fold t)
=> "pagepage"
Type: Function
Arguments: substring STRING START &optional END
Package: lisp
File: builtin.l
指定された文字列の部分文字列を返します。
--- muleの説明 ---
この関数は、 string 中の start の文字から始め end の文字で終るストリング
を (新しく)返します。負の数字は、(ストリングの最後の文字を -1 として) ス
トリングの終りから数えます。
start と end のどちらかが integer でなかったり、 start が end の後の文字
を指していたり、どちらかの integer がストリングの範囲を出てしまっている
場合、エラーになります。
(substring "abcdefg" 0)
=> "abcdefg"
(substring "abcdefg" 0 2)
=> "ab"
(substring "abcdefg" 5 nil)
=> "fg"
(substring "abcdefg" -1 nil)
=> "g"
互換性:
Common Lispにはなし(commonではsubseqというらしい)
muleあり。
Type: Function
Arguments: transpose-words &optional (ARG 1)
Package: editor
File: cmds.l
カーソル位置の単語を後方の単語と入れ換えます。
Type: Function
Arguments: upcase-word &optional (ARG 1)
Package: editor
File: cmds.l
カーソル位置から単語の末尾までを大文字に変換します。
SeeAlso: upcase-region
SeeAlso: downcase-word