Codebase list flim / HEAD mime-ja.texi
HEAD

Tree @HEAD (Download .tar.gz)

mime-ja.texi @HEADraw · history · blame

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
\input texinfo-ja @c -*-texinfo -*- coding: utf-8 -*-
@c Generated automatically from mime-ja.sgml by sinfo 3.7.
@setfilename mime-ja.info
@documentlanguage ja
@documentencoding utf-8
@settitle FLIM-LB 1.14 MIME 機能説明書
@dircategory GNU Emacs Lisp
@direntry
* FLIM-LB (ja): (mime-ja).         Internet message library.
@end direntry
@titlepage
@title FLIM-LB 1.14 MIME 機能説明書
@author 守岡 知彦 <morioka@@jaist.ac.jp>
@author 伊藤 和博
@subtitle 2020-09-17
@end titlepage
@node Top, Introduction, (dir), (dir)
@top FLIM-LB 1.14 MIME 機能説明書

@ifinfo

This file documents MIME features of FLIM-LB, a fundamental library to
process Internet Messages for GNU Emacsen.@refill

GNU Emacsen 用の Internet Message 処理のための基礎 library である FLIM-LB
 MIME 機能に関して説明します
@end ifinfo

@menu
* Introduction::                FLIM-LB って何
* How to use::                  FLIM  MIME 機能の使い方
* Entity::                      Message  Entity
* Content-Type::                Content-Type 欄の情報
* Content-Disposition::         Content-Disposition 欄の情報
* Content-Transfer-Encoding::   符号化法
* encoded-word::                Header  network 表現
* custom::                      一般設定
* Appendix::                    付録
* Concept Index::               概念索引
* Function Index::              関数索引
* Variable Index::              変数索引
@end menu

@node Introduction, How to use, Top, Top
@chapter FLIM-LB って何

FLIM  Internet Message の表現や符号化に関する基礎的な機能を提供する
ための library です
FLIM-LB  FLIM のバリアントの一つで
最新バージョンの Emacs への対応などを特徴とします


@node How to use, Entity, Introduction, Top
@chapter FLIM  MIME 機能の使い方

FLIM の提供する MIME 機能を使うためには

@lisp
(require 'mime)
@end lisp

@noindent
を評価してください


@node Entity, Content-Type, How to use, Top
@chapter Message  Entity
@cindex mime-entity
@cindex entity

RFC 2045 (@ref{RFC 2045}) によれば、「Entity という語はmessage, もしく
multipart entity  body 中の1つの部分のMIME で定義された header
field と内容を指すとなっていますここではMIME で定義された header
field 以外の全ての header  body を指す語として @strong{entity}を用いる
ことにします@refill

RFC 2045 の定義はMIME message  entity を節とする木構造であることを示
していますつまりMIME  message を木構造に拡張した訳です@refill

FLIM  entity の情報を表現するために@strong{mime-entity} 
造体を用います以下では単に mime-entity と呼ぶことにします


@menu
* Entity creation::             Entity の生成
* Entity hierarchy::            Entity 階層
* Entity Search::               Entity の検索
* Entity Attributes::           Entity の属性
* Entity-header::               Entity header の情報
* entity formatting::           Entity の文字表現
* Entity-content::              Entity の内容
* Entity-network-representation::  Entity のネットワーク表現
* Entity buffer::               Entity  buffer による表現
* mm-backend::                  Entity の表現と実現
@end menu

@node Entity creation, Entity hierarchy, Entity, Entity
@section Entity の生成

@defun mime-open-entity type location

Entity を開いてそれを返します@refill

@var{type}  representation-type です(cf. @ref{mm-backend}) @refill

@var{location}  entity の位置です指定方法は
representation-type に依って変わります
@end defun


@defun mime-parse-buffer &optional  buffer type

@var{buffer}  message として構文解析しその結果の mime-entity  
@var{buffer} @code{mime-message-structure} に格納する@refill

@var{buffer} が省略された場合現在の buffer を構文解析する@refill

@var{type} が指定された場合その値を生成される mime-entity の表象型とし
て用いる省略された場合は @var{buffer} となる(cf. @ref{mm-backend})
@end defun



@node Entity hierarchy, Entity Search, Entity creation, Entity
@section Entity 階層
@cindex node-id
@cindex entity-number
@cindex message
@cindex root-entity

MIME message  entity を単位とする木構造になっています@refill

この木において根となる節は message 全体を表す entity ですここでは
れを @strong{root-entity} もしくは@strong{message} と呼びます@refill

root-entity 以外の entity は親を持ちますまたentity は子供を持つかも
知れませんこの親子関係を考えることで entity の相対関係を扱うことができ
ます@refill

一方entity  message における位置を考えることもできます@refill

entity はこの木における節となりますがこの木には深さと同じ深さの中の
順番に従って番号が付けることができます即ち
@example

                              ┌───┐
                                nil 
                              └─┬─┘
              ┌─────────┼─────────┐
            ┌┴┐              ┌┴┐              ┌┴┐
                                        
            └┬┘              └┬┘              └┬┘
                      ┌────┼────┐        
          ┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐
           0.0││ 1.0││ 1.1││ 1.2││ 2.0
          └───┘└───┘└───┘└───┘└───┘
@end example

@noindent
のように深さ n の節には長さ n の整数列の節番号が振れますこれ
 @strong{entity-number} と呼びますentity-number  S 式と
しては @code{(1 2 3)} のような整数のリストとして表現されます

mime-entity ではこれと同様の @strong{node-id} を用いますnode-id はちょ
うど entity-number を逆にしたリストでentity-number 1.2.3 に対応する 
node-id  @code{(3 2 1)} です@refill

前述のようにMIME message  entity を単位とした木構造になっているので
この根である message 全体も mime-entity で表現することができbuffer
local 変数 @code{mime-message-structure} に格納することにします@refill

@code{mime-message-structure} を起点に entity-number  node-id 
で示される entity を取り出すことができます

@defvar mime-message-structure

現在の buffer における message 全体の mime-entity 構造体を格納するbuffer
local 変数
@end defvar


@defun mime-entity-children entity

@var{entity} に含まれる entity  list を返す
@end defun


@defun mime-entity-parent entity  &optional  message

@var{entity} の親の entity を返す@refill

@var{message} が指定された場合これを根と見倣す
@end defun


@defun mime-root-entity-p entity

@var{entity} が根即ちmessage 全体である場合に-@code{nil} を返

@end defun


@defun mime-entity-node-id entity

@var{entity}  node-id を返す
@end defun


@defun mime-entity-number entity

@var{entity}  entity-number を返す
@end defun



@node Entity Search, Entity Attributes, Entity hierarchy, Entity
@section Entity の検索

@defun mime-find-entity-from-number entity-number  &optional  message

@var{message} から@var{enity-number}  entity を返します@refill

@var{message} が指定されていない場合は
@code{mime-message-structrue} が使われます
@end defun


@defun mime-find-entity-from-node-id entity-node-id  &optional  message

@var{message} から@var{entity-node-id}  entity を返します@refill

@var{message} が指定されていない場合は
@code{mime-message-structure} が使われます
@end defun


@defun mime-find-entity-from-content-id cid  &optional  message

@var{message} から@var{cid}  entity を返します@refill

@var{message} が指定されていない場合は
@code{mime-message-structure} が使われます
@end defun



@node Entity Attributes, Entity-header, Entity Search, Entity
@section Entity の属性

@defun mime-entity-content-type entity

@var{entity}  content-type を返す(cf. @ref{mime-content-type})
@end defun


@defun mime-entity-content-disposition entity

@var{entity}  content-disposition を返す
(cf. @ref{mime-content-disposition})
@end defun


@defun mime-entity-filename entity

@var{entity}  file 名を返す
@end defun


@defun mime-entity-encoding entity  &optional  default-encoding

@var{entity}  content-transfer-encoding を返す
(cf. @ref{Content-Transfer-Encoding}) @refill

もし@var{entity}  Content-Transfer-Encoding 欄が存在しない場合は
@var{default-encoding} を返すこれが指定されない場合は@code{"7bit"} 
を用いる
@end defun


@defun mime-entity-cooked-p entity

@var{entity} の内容が既にコード変換されている場合は nil で無い値
を返す
@end defun



@node Entity-header, entity formatting, Entity Attributes, Entity
@section Entity header の情報

@defun mime-fetch-field field-name  &optional  entity

@var{entity}  header 中の @var{field-name} 欄の body を返す@refill

結果の文字列は network 表現のままである@refill

@var{entity} が省略された場合は@code{mime-message-structure} の値を用
いる@refill

@var{field-name} 欄が存在しない場合は @code{nil} を返す
@end defun


@defun mime-read-field field-name  &optional  entity

@var{entity}  header 中の @var{field-name} 欄を構文解析した結果を返す
@refill

結果の形式は欄毎に異なる非構造化欄の場合は文字列を返し構造化欄の場合
はその形式に従った list を返す@refill

結果中の文字列は Emacs の内部表現に変換される@refill

@var{entity} が省略された場合は@code{mime-message-structure} の値を用
いる@refill

@var{field-name} 欄が存在しない場合は nil を返す
@end defun



@node entity formatting, Entity-content, Entity-header, Entity
@section Entity の文字表現

@defun mime-insert-header entity  &optional  invisible-fields visible-fields

現在位置に @var{entity} の復号した header を挿入する@refill

@var{invisible-fields}  @var{visible-fields} は正規表現のlist それ
ぞれ表示したくない field 名と表示したい欄名を表現したものである
@refill

@var{invisible-fields} の要素のどれかに match かつ
@var{visible-fields} の要素のどれにも match しない欄は表示されない
@refill

encoded-word (@ref{encoded-word}) は復号される。『生の非 us-ascii 文字
 @code{default-mime-charset} として解釈される
@end defun


@defun mime-insert-text-content entity

point の前に @var{entity}  text entity として挿入します@refill

@var{entity} の内容は @ref{MIME charset} として復号化され
ます@var{entity}  Content-Type field  charset paramter が無
いと@code{default-mime-charset} が初期値として使われます
@end defun


@defvar default-mime-charset

適切な MIME charset (@ref{MIME charset}) が見つからなかった場合に用いら
れるMIME charset.@refill

本来は APEL の変数である
@end defvar



@node Entity-content, Entity-network-representation, entity formatting, Entity
@section Entity の内容

@defun mime-entity-content entity

@var{entity} の内容の byte 列を返す
@end defun


@defun mime-insert-entity-content entity

point の位置に @var{entity} の内容を挿入します
@end defun


@defun mime-write-entity-content entity filename

@var{entity} の内容を @var{filename} に書き込みます
@end defun



@node Entity-network-representation, Entity buffer, Entity-content, Entity
@section Entity のネットワーク表現

@defun mime-insert-entity entity

@var{entity}  header  body  point のところに挿入します
@end defun


@defun mime-write-entity entity filename

@var{entity} の表現を @var{filename} に書き込みます
@end defun


@defun mime-write-entity-body entity filename

@var{entity}  body  @var{filename} に書き込みます
@end defun



@node Entity buffer, mm-backend, Entity-network-representation, Entity
@section Entity  buffer による表現

@defun mime-entity-buffer entity

@var{entity} が存在する buffer を返す
@end defun


@defun mime-entity-point-min entity

@var{entity} が存在する buffer における@var{entity} が占める領域の先頭
位置を返す
@end defun


@defun mime-entity-point-max entity

@var{entity} が存在する buffer における@var{entity} が占める領域の末尾
位置を返す
@end defun


@defun mime-entity-header-start entity

@var{entity} が存在する buffer におけるheader が占める領域の先頭位置を
返す
@end defun


@defun mime-entity-header-end entity

@var{entity} が存在する buffer におけるheader が占める領域の末尾位置を
返す
@end defun


@defun mime-entity-body-start entity

@var{entity} が存在する buffer におけるbody が占める領域の先頭位置を返

@end defun


@defun mime-entity-body-end entity

@var{entity} が存在する buffer におけるbody が占める領域の末尾位置を返

@end defun



@node mm-backend,  , Entity buffer, Entity
@section Entity の表現と実現
@cindex mm-backend
@cindex entity 処理 method
@cindex representation-type

Entity は抽象化されたデータ表現で実際のデータ表現としては用途に応じて
さまざまなものが利用できるように設計されています@refill

ここでentity がどういう種類の表現を行っているかを示すのが
@strong{representation-type} entity を生成する時にはこれを指定します
(cf. @ref{Entity creation}) @refill

前節までに述べて来た entity に対する処理はentity に対してその処理を依
頼することによって実現されていますEntity は自分の representation-type 
を知っておりその representation-type に応じて実際の処理を行う関数を呼
び出しますこのような関数を @strong{entity 処理method} と呼びますまた
representation-type 毎にこのような関数をまとめたものを 
@strong{mm-backend} と呼びます@refill

mm-backend  representation-type の名前の先頭に @code{mm} という
接頭辞を付けた関数名からなる module その module 名は同様に
representation-type の名前の先頭に @code{mm} を付けたものになって
いますこの module  representation-type  entity が最初に生成される
時に自動的に require されます


@menu
* Request for entity::          Entity への便り
* mm-backend module::           mm-backend の作り方
@end menu

@node Request for entity, mm-backend module, mm-backend, mm-backend
@subsection Entity への便り

@defun mime-entity-send entity message  &rest  args

@var{entity}  @var{message} を送る@refill

@var{args}  @var{message} の引数である
@end defun



@node mm-backend module,  , Request for entity, mm-backend
@subsection mm-backend の作り方

@defmac mm-define-backend type &optional  parents

@var{type}  mm-backend として定義します@refill

@var{PARENTS} が指定されている場合は@var{type}  prents
を継承しますそれぞれの parent  representation-type である必要があ
ります

:@refill

@lisp
(mm-define-backend chao (generic))
@end lisp
@end defmac


@defmac mm-define-method name args  &rest  body

@var{name}  (nth 1 (car @var{args})) backend  method 
数として定義します@refill

@var{args}  lambda の引数リストのようなものですが(car
@var{args}) は指定された parameter である必要があります(car
(car @var{args})) は変数の名前で(nth 1 (car @var{args}))
 backend の名前 (representation-type) です@refill

:@refill

@lisp
(mm-define-method entity-cooked-p ((entity chao)) nil)
@end lisp
@end defmac



@node Content-Type, Content-Disposition, Entity, Top
@chapter Content-Type 欄の情報
@cindex mime-content-type
@cindex Content-Type 

@strong{Content-Type }  media-type (@ref{media-type})  MIME
charset といった entity (@ref{Entity}) の内容の種類や表現形式などを記述
するためのものでRFC 2045 (@ref{RFC 2045}) で定義されています

@noindent
@strong{[Memo]}
@quotation

歴史的には RFC 1049  Content-Type 欄が提案されている但しMIME 
media-type のような type  subtype の区別はなくMIME charset のような
文字符号の種類を表現することもできない
@end quotation


FLIM  Content-Type 欄を構文解析する関数と Content-Type 欄の解析結果を
格納する構造体 @strong{mime-content-type} を提供します


@menu
* Content-Type field::          Content-Type 欄の形式
* mime-content-type::           mime-content-type 構造体
* Content-Type parser::         Content-Type 欄の解析器
* Content-Type utility::        Content-Type に関する有用な関数
@end menu

@node Content-Type field, mime-content-type, Content-Type, Content-Type
@section Content-Type 欄の形式
@cindex parameter
@cindex subtype
@cindex type

Content-Type 欄の形式は以下のように定義されています

@quotation
``Content-Type'' ``:'' @strong{type} ``/''
@strong{subtype} *( ``;'' @strong{parameter} )
@end quotation

例えば

@quotation
@example
Content-Type: image/jpeg
@end example
@end quotation

@noindent


@quotation
@example
Content-Type: text/plain; charset=iso-2022-jp
@end example
@end quotation

@noindent
などのように用いられます

ここで、`type'  `subtype'  entity の形式を示すもので両者を総称し
、`media-type' と呼ぶことにします上記の例における `image/jpeg' 
`text/plain'  media-type の1つです

@noindent
@strong{[Memo]}
@quotation

Content-Type 欄のない entity 

@quotation
@example
Content-Type: text/plain; charset=us-ascii
@end example
@end quotation

@noindent
として解釈される(cf. @ref{us-ascii})
@end quotation



@node mime-content-type, Content-Type parser, Content-Type field, Content-Type
@section mime-content-type 構造体

@deffn{Structure} mime-content-type

Content-Type 欄の情報を格納するための構造体@refill

この構造体を参照するには @code{mime-content-type-要素名} という名前の参
照関数を用いる@refill

この構造体の要素は以下の通りである

@table @var
@item primary-type
media-type の主型 (symbol).

@item subtype
media-type の副型 (symbol).

@item parameters
Content-Type 欄の parameter (連想 list).

@end table
@end deffn


@defun make-mime-content-type type subtype
	   &optional  parameters

content-type の生成子
@end defun


@defun mime-content-type-parameter content-type parameter

@var{content-type}  @var{parameter} の値を返す
@end defun



@node Content-Type parser, Content-Type utility, mime-content-type, Content-Type
@section Content-Type 欄の解析器

@defun mime-parse-Content-Type string

@var{string}  content-type として解析した結果を返す
@end defun


@defun mime-read-Content-Type

現在の buffer  Content-Type 欄を読み取り解析した結果を返す@refill

Content-Type 欄が存在しない場合は nil を返す
@end defun



@node Content-Type utility,  , Content-Type parser, Content-Type
@section Content-Type に関する有用な関数

@defun mime-type/subtype-string type  &optional  subtype

@var{type}  @var{subtype} から type/subtype 形式の文字列を返す
@end defun



@node Content-Disposition, Content-Transfer-Encoding, Content-Type, Top
@chapter Content-Disposition 欄の情報
@cindex mime-content-disposition
@cindex RFC 2183
@cindex Standards Track
@cindex Content-Disposition 

@strong{Content-Disposition }  entity の表示や file 名など
の属性になどに関する情報を記述するためのものです


@noindent
[RFC 2183]
@quotation
S. Dorner, K. Moore and R. Troost, ``Communicating Presentation
Information in Internet Messages: The Content-Disposition Header'',
August 1997, Standards Track.
@end quotation

FLIM  Content-Disposition 欄を構文解析する関数と Content-Disposition 
欄の解析結果を格納する構造体 
@strong{mime-content-disposition} を提供します


@menu
* mime-content-disposition::    mime-content-disposition 構造体
* Content-Disposition parser::  Content-Disposition 欄の解析器
@end menu

@node mime-content-disposition, Content-Disposition parser, Content-Disposition, Content-Disposition
@section mime-content-disposition 構造体

@deffn{Structure} mime-content-disposition

Content-Disposition 欄の解析結果を収めるための構造体@refill

この構造体を参照するには @code{mime-content-disposition-要素名} という名
前の参照関数を用いる@refill

この構造体の要素は以下の通りである

@table @var
@item disposition-type
disposition-type (symbol).

@item parameters
Content-Disposition 欄の parameter (連想 list).

@end table
@end deffn


@defun mime-content-disposition-parameter content-disposition parameter

@var{content-disposition}  @var{parameter} の値を返す
@end defun


@defun mime-content-disposition-filename content-disposition

@var{content-disposition}  filename の値を返す
@end defun



@node Content-Disposition parser,  , mime-content-disposition, Content-Disposition
@section Content-Disposition 欄の解析器

@defun mime-parse-Content-Disposition string

@var{string}  content-disposition として解析した結果を返す
@end defun


@defun mime-read-Content-Disposition

現在の buffer  Content-Disposition 欄を読み取り解析した結果を返す
@refill

Content-Disposition 欄が存在しない場合は nil を返す
@end defun



@node Content-Transfer-Encoding, encoded-word, Content-Disposition, Top
@chapter 符号化法
@cindex Content-Transfer-Encoding 

@strong{Content-Transfer-Encoding }  entity の符号化法を記述するため
のものです@refill

FLIM では Content-Transfer-Encoding 欄を構文解析する関数を提供します
れらの関数は Content-Transfer-Encoding 欄の情報は文字列で表現します
@refill

またContent-Transfer-Encoding に基づいて符号化復号化を行う関数も提
供されます


@menu
* Content-Transfer-Encoding parser::  Content-Transfer-Encoding 欄の解析器
* encoder/decoder::             符号化復号化
* Encoding information::        Other utilities
* mel-backend::                 How to write encoder/decoder module
* generic function for mel-backend::  How to add encoding/decoding service
@end menu

@node Content-Transfer-Encoding parser, encoder/decoder, Content-Transfer-Encoding, Content-Transfer-Encoding
@section Content-Transfer-Encoding 欄の解析器

@defun mime-parse-Content-Transfer-Encoding string

@var{string}  content-transfer-encoding として解析した結果を返す
@end defun


@defun mime-read-Content-Transfer-Encoding &optional default-encoding

現在の buffer  Content-Transfer-Encoding 欄を読み取り解析した結果を
返す@refill

Content-Transfer-Encoding 欄が存在しない場合は@var{default-encoding} 
返す
@end defun



@node encoder/decoder, Encoding information, Content-Transfer-Encoding parser, Content-Transfer-Encoding
@section 符号化復号化

@defun mime-encode-region start end encoding

現在の buffer  @var{start} から @var{end} までの region 
@var{encoding} を使って符号化します
@end defun


@defun mime-decode-region start end encoding

現在の buffer  @var{start} から @var{end} までの region 
@var{encoding} を使って復号化します
@end defun



@defun mime-decode-string string encoding

@var{string}  @var{encoding} として復号した結果を返す
@end defun



@defun mime-insert-encoded-file filename encoding

@var{ENCODING} format で符号化された file @var{FILENAME} 
挿入する
@end defun


@defun mime-write-decoded-region start end filename encoding

@var{encoding} で符号化された現在の region を復号化して
@var{filename}に書き込みます

<var>start<var>  @var{end}  buffer の位置です
@end defun



@node Encoding information, mel-backend, encoder/decoder, Content-Transfer-Encoding
@section Other utilities

@defun mime-encoding-list &optional  SERVICE

Content-Transfer-Encoding  list を返します@refill

@var{service} が指定されているとそれに対する
Content-Transfer-Encoding を返します
@end defun


@defun mime-encoding-alist &optional  SERVICE

補完のための Content-Transfer-Encoding の表を返します@refill

@var{service} が指定されている場合はそれに対する
Content-Transfer-Encoding  list を返します
@end defun



@node mel-backend, generic function for mel-backend, Encoding information, Content-Transfer-Encoding
@section How to write encoder/decoder module

@defmac mel-define-method name args  &rest  body

@var{name}  (nth 1 (car (last @var{args}))) backend 
method 関数として定義します

@var{args}  lambda の引数 list と似ていますが(car (last
@var{args})) は指定された parameter である必要があります(car
(car (last @var{args}))) は変数の名前で(nth 1 (car (last
@var{args})))  backend の名前 (encoding) です@refill

:@refill

@lisp
(mel-define-method mime-write-decoded-region (start end filename
						    (nil "base64"))
  "Decode and write current region encoded by base64 into FILENAME.
START and END are buffer positions."
  (interactive
   (list (region-beginning) (region-end)
	 (read-file-name "Write decoded region to file: ")))
  (let ((str (buffer-substring start end)))
    (with-temp-buffer
      (insert (decode-base64-string str))
      (write-region-as-binary (point-min) (point-max) filename)
      )))
@end lisp
@end defmac


@defmac mel-define-method-function spec function

@var{spec} の関数定義を @var{function} に設定します@refill

@var{spec} の最初の要素は service です@refill

@var{args} の残りは lambda の引数 list 似ていますが(car (last
@var{args})) は指定された parameter である必要があります(car
(car (last @var{args}))) は変数の名前で(nth 1 (car (last
@var{args})))  backend の名前 (encoding) です@refill

:@refill

@lisp
(mel-define-method-function (mime-encode-string string (nil "base64"))
			    'encode-base64-string)
@end lisp
@end defmac



@node generic function for mel-backend,  , mel-backend, Content-Transfer-Encoding
@section 符号化/復号化 service を追加する方法

@defmac mel-define-service name &optional  args doc-string

@var{name}  Content-Transfer-Encoding  service として定義しま
@refill

@var{args} が指定されていると@var{name}  service 
generic function として定義されます@refill

:@refill

@lisp
(mel-define-service encoded-text-encode-string (string encoding)
  "Encode STRING as encoded-text using ENCODING.
ENCODING must be string.")
@end lisp
@end defmac



@node encoded-word, custom, Content-Transfer-Encoding, Top
@chapter Header  network 表現
@cindex RFC 2047
@cindex Standards Track
@cindex RFC 2047

encoded-word  header で非 ASCII (@ref{ASCII}) 文字を表現するための形式
@strong{RFC 2047} で定義されています@refill


@noindent
[RFC 2047]
@quotation
K. Moore, ``MIME (Multipurpose Internet Mail Extensions) Part Three:
Message Header Extensions for Non-ASCII Text'', November 1996, Standards
Track (obsolete RFC 1521,1522,1590).
@end quotation

また行儀の悪いことだと言えますがencoded-word を用いずに非 ASCII
(@ref{ASCII}) 文字を header に入れた記事も存在します@refill

FLIM はこれらを符号化復号化する機能を提供します


@menu
* Header encoder/decoder::      Header の符号化復号化
@end menu

@node Header encoder/decoder,  , encoded-word, encoded-word
@section Header の符号化復号化

@defun eword-decode-header &optional  code-conversion separator

Header 中の encoded-word を復号する@refill

もし @var{code-conversion}  @code{nil} ならencoded-word だけが復号さ
れるもし@var{code-conversion}  MIME charset (@ref{MIME charset}) 
なら ASCII bit patterns はその MIME charset として復号されるこれ以
外の場合 ASCII bit patterns @code{default-mime-charset}. として復
号される(cf. @ref{entity formatting}) @refill

もし @var{separator}  @code{nil} でなければその値がheader separator 
として用いられる
@end defun


@defun eword-encode-header &optional  code-conversion

Header  network 表現に符号化する@refill

 field  @code{mime-field-encoding-method-alist} で指定された方式で
符号化される
@end defun


@defvar mime-field-encoding-method-alist

Field を符号化する方法を指定する連想 list element  (FIELD
. METHOD) の様になっている@refill

METHOD  @code{mime} であればFIELD  MIME format に符号化さ
れる (encoded-word)

METHOD  @code{nil} であればFIELD は符号化されない

METHOD  MIME charset であればFIELD はネットワークコードに変換しな
ければならないときに charset に符号化される@refill

そうでなければFIELD はネットワークコードに変換しなければならないとき
 変数 @code{default-mime-charset} で符号化される
@end defvar



@node custom, Appendix, encoded-word, Top
@chapter 一般設定

@deffn{group} mime

MIME 関連機能に関する group.@refill

@code{mail}  @code{news} に属する
@end deffn


@node Appendix, Concept Index, custom, Top
@chapter 付録


@menu
* Glossary::                    用語
* Bug report::                  bug 報告の仕方
* GitHub::                      GitHub による開発
* History::                     歴史
@end menu

@node Glossary, Bug report, Appendix, Appendix
@section 用語


@menu
* 7bit::                        
* 8bit::                        
* ASCII::                       
* Base64::                      
* binary::                      
* Coded character set::         Coded character set符号化文字集合, Character code文字符号
* media-type::                  
* message::                     
* MIME::                        
* MIME charset::                
* MTA::                         
* MUA::                         
* Quoted-Printable::            
* RFC 822::                     
* RFC 1036::                    
* RFC 2045::                    
* RFC 2046::                    
* RFC 2048::                    
* RFC 2049::                    
* plain text::                  
* us-ascii::                    
@end menu

@node 7bit, 8bit, Glossary, Glossary
@subsection 7bit

ここでは 0 から 127 の整数を指す@refill

0 から 127 の整数の列で表現できるような data  ``7bit  data'' と呼ぶ
@refill

また0 から 31 および 127 で表現される制御文字と 32 で表現される空白と 
33 から 126 で表現される図形文字からなる文字列のことを ``7bit の文字列'' 
と呼ぶこれは ISO 2022 7 単位系と同様)。

伝統的な Internet  MTA (@ref{MTA})  7bit  data を転送できるので
7bit  data  Quoted-Printable (@ref{Quoted-Printable})  Base64
(@ref{Base64}) といった変換を行わなくてもそのまま転送できる@refill

しかし7bit であればどんな data でも良いとはいえないなぜなら行の
長さがあまりに長いとMTA はその message を転送することができないからで
あるちなみにRFC 822 (@ref{RFC 822}) は1行は改行文字を除いて 998
byte 以内であることを求めているよってこれ以上の行が含まれる可能性の
ある data, 例えばPostscript  data などは Quoted-Printable 等で 
encodeする必用がある


@node 8bit, ASCII, 7bit, Glossary
@subsection 8bit
@cindex binary

ここでは 0 から 255 の整数を指す@refill

0 から 255 の整数の列で表現できるような data  ``8bit  data'' と呼ぶ
@refill

また0 から 31, 127 および 128 から 159 で表現される制御文字と 32 で表
現される空白と 33 から 126  160 から 255 で表現される図形文字からなる
文字列のことを ``8bit の文字列'' と呼ぶこれは ISO 2022 8 単位系と同様)。@refill

iso-8859-1  euc-kr といった符号化文
字集合は 8bit の文字列である@refill

伝統的な Internet  MTA (@ref{MTA})  7bit (@ref{7bit})  data しか転
送できないのでそうした MTA を経由する場合Quoted-Printable
(@ref{Quoted-Printable})  Base64 (@ref{Base64}) といった変換を行わなく
てはならない@refill

しかし最近では 8bit の文字列をそのまま通すことができる MTA も登場して
きたのでそのまま送ることができる場合も増えてきた@refill

しかし8bit であればどんな data でも良いとはいえないなぜなら行の
長さがあまりに長いとMTA はその message を転送することができないからで
あるちなみにRFC 822 (@ref{RFC 822}) は1行は改行文字を除いて 998
byte 以内であることを求めているよってこれ以上の行が含まれる可能性の
ある data, 例えばPostscript  data などは Quoted-Printable 等で 
encodeする必用がある@refill

またこうした理由から行が 999 byte 以上の行が存在する可能性のある
data  @strong{binary} (@ref{binary}) と呼ぶことにする@refill

ちなみに7bit で表現できる data  8bit でも表現できるよって
``8bit'' と言った場合行が 998 byte 以下の任意の data を指すことが
ある


@node ASCII, Base64, 8bit, Glossary
@subsection ASCII
@cindex ANSI X3.4:1986
@cindex ASCII

アメリカ連邦で使われる文字を符号化した符号化文字集合 (@ref{Coded character set})A-Z, a-z  Latin 文字と数字幾つかの記号からなるISO 646 の一つ
現在は国際基準版 (IRV) になっている


@noindent
[ASCII]
@quotation
``Coded Character Set -- 7-Bit American Standard Code for Information
Interchange'', ANSI X3.4:1986.
@end quotation



@node Base64, binary, ASCII, Glossary
@subsection Base64
@cindex pad

RFC 2045 (@ref{RFC 2045}) で定義されている MIME (@ref{MIME}) における 
binary data (@ref{binary})  network での変換法の1つ@refill

64 進数という意味で3 byte  data  0 から 63 の数を表す ASCII
(@ref{ASCII}) 4 文字に変換する方法。(もし4 文字にならなければ 
@strong{pad} と呼ばれる詰め物をして長さを調整する@refill

この 65 種類の文字は ASCII  EBCDIC の共通部分から選ばれており
Internet 以外の network を経由する場合でも安全に転送できるように設計さ
れている


@node binary, Coded character set, Base64, Glossary
@subsection binary
@cindex binary data
@cindex binary

任意の byte 列を @strong{binary} と呼ぶ@refill

8bit (@ref{8bit}) と異なるのは data に行の構造を仮定しないことである

また行の構造があっても999 byte 以上からなる行がある場合も binary 
呼ぶことにする@refill

ちなみに7bit (@ref{7bit})  8bit で表現できる data  binary でも表現
できるよって@strong{binary data} と言った場合任意の data を指すこ
とがある


@node Coded character set, media-type, binary, Glossary
@subsection Coded character set符号化文字集合, Character code文字符号

文字と byte 列と1対1に対応付ける曖昧でない規則の集合


@node media-type, message, Coded character set, Glossary
@subsection media-type
@cindex x-token
@cindex primary-type/subtype
@cindex message
@cindex multipart
@cindex application
@cindex video
@cindex audio
@cindex image
@cindex text
@cindex subtype
@cindex primary-type

MIME (@ref{MIME}) における entity (@ref{Entity}) の種類
@strong{primary-type}  @strong{subtype} からなるRFC 2046 (@ref{RFC 2046}) で定義されている@refill

primary-type は標準では

@itemize @bullet
@item
@strong{text}
@item
@strong{image}
@item
@strong{audio}
@item
@strong{video}
@item
@strong{application}
@item
@strong{multipart}
@item
@strong{message}
@end itemize

@noindent
が定義されそれぞれには application/octet-stream, audio/basic,
image/jpeg, multipart/mixed, text/plain, video/mpeg などの
さまざまな subtype が定義されている

@noindent
@strong{[注意]}
@quotation

ここではtext/plain などの type/subtype の組をしばしば 
@strong{primary-type/subtype} と書く
@end quotation


media-type RFC 2046 で定義されているものに加えて登録することもでき
現在登録されているものは MEDIA TYPES
(ftp://ftp.isi.edu/in-notes/iana/assignments/media-types) で参照できる。

またtype もしくは subtype 前に `x-' を付けた @strong{x-token} を用
いることにより登録されていないものを私的に用いることもできるしかし
当然のことながらこうした私的な media-type は諒解を得た者の間でしか解釈
できないので利用には注意すること@refill

(cf. @ref{Content-Type})



@node message, MIME, media-type, Glossary
@subsection message

ここでは mail  news 記事の総称として用いる


@node MIME, MIME charset, message, Glossary
@subsection MIME
@cindex Multipurpose Internet Mail Extensions

@strong{Multipurpose Internet Mail Extensions} の略でInternet  mail 
 news  us-ascii plain text (@ref{us-ascii}) 以外の文字を使うための 
RFC 822 (@ref{RFC 822}) に対する拡張@refill

RFC 2045 は冒頭で次のように述べている@refill

STD 11, RFC 822 US-ASCII message header に関して非常に詳細に規定し
 message 表現 protocol を定義しているしかしそれは単に flat  
US-ASCII text のみに留まりmessage の内容や message body に関する規定
はなされていないMultipurpose Internet Mail Extensions, あるいは MIME 
と総称されるこの一連の文書は以下の事を可能とするために message 
形式を再定義した

@enumerate
@item
文書 message body における US-ASCII 以外の文字集合
@item
非文書 message body
@item
複数の部分からなる message body
@item
US-ASCII 以外の文字集合からなる文書 header 情報
@end enumerate


RFC 2045 (@ref{RFC 2045}), RFC 2046 (@ref{RFC 2046}), RFC 2047
(@ref{encoded-word}), RFC 2048 (@ref{RFC 2048}), RFC 2049 (@ref{RFC 2049}) で定義されている


@node MIME charset, MTA, MIME, Glossary
@subsection MIME charset

Content-Type (@ref{Content-Type}) 欄や encoded-word (@ref{encoded-word}) 
 charset parameter で用いられる登録された符号化文字集合(@ref{Coded character set})@refill

RFC 2045 (@ref{RFC 2045}) で定義されている@refill

iso-2022-jp  euc-kr はその1つ


@node MTA, MUA, MIME charset, Glossary
@subsection MTA
@cindex Message Transfer Agent

@strong{Message Transfer Agent} の略でqmail  sendmail などの mail 
 program  inn などの news server の総称@refill

(cf. @ref{MUA})



@node MUA, Quoted-Printable, MTA, Glossary
@subsection MUA
@cindex Message User Agent

@strong{Message User Agent} の略でmail reader  news reader の総称
@refill

(cf. @ref{MTA})



@node Quoted-Printable, RFC 822, MUA, Glossary
@subsection Quoted-Printable

RFC 2045 (@ref{RFC 2045}) で定義されている MIME (@ref{MIME}) における 
binary data  network での変換法の1つ@refill

`=' や制御文字や 128 以上の文字などは `=AF' のように `=' の後に続く 16 
進数で表現するこのためASCII (@ref{ASCII}) 文字中心の data では 
Base64 (@ref{Base64}) に比べると可読性が高くなる可能性がある@refill

しかしながらEBCDIC には存在しない文字を利用する場合EBCDIC を利用し
ている network では安全に転送することができずBase64 に比べて安全性は
低い


@node RFC 822, RFC 1036, Quoted-Printable, Glossary
@subsection RFC 822
@cindex RFC 822
@cindex STD 11
@cindex Internet message
@cindex Internet mail
@cindex message header

Internet mail の主に @strong{message header} に関する形式に
関する標準を定めている RFC.

@noindent
@strong{[Memo]}
@quotation

news message もこれに準じているので@strong{Internet mail} と書くよりも
@strong{Internet message} と書いた方が良いかもしれない
@end quotation



@noindent
[RFC 822]
@quotation
D. Crocker, ``Standard for the Format of ARPA Internet Text Messages'',
August 1982, STD 11.
@end quotation



@node RFC 1036, RFC 2045, RFC 822, Glossary
@subsection RFC 1036
@cindex RFC 1036
@cindex USENET

USENET での message の形式を定めた RFC.  RFC 822 (@ref{RFC 822})  
subset になっているInternet の標準ではないがUSENET 以外の netnews 
もこれに準じているものが多い


@noindent
[USENET: RFC 1036]
@quotation
M. Horton and R. Adams, ``Standard for Interchange of USENET Messages'',
December 1987, (obsolete RFC 850).
@end quotation



@node RFC 2045, RFC 2046, RFC 1036, Glossary
@subsection RFC 2045
@cindex RFC 2045
@cindex Standards Track


@noindent
[RFC 2045]
@quotation
N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions
(MIME) Part One: Format of Internet Message Bodies'', November 1996,
Standards Track (obsolete RFC 1521, 1522, 1590).
@end quotation



@node RFC 2046, RFC 2048, RFC 2045, Glossary
@subsection RFC 2046
@cindex RFC 2046
@cindex Standards Track


@noindent
[RFC 2046]
@quotation
N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions
(MIME) Part Two: Media Types'', November 1996, Standards Track (obsolete
RFC 1521, 1522, 1590).
@end quotation



@node RFC 2048, RFC 2049, RFC 2046, Glossary
@subsection RFC 2048
@cindex RFC 2048
@cindex Standards Track


@noindent
[RFC 2048]
@quotation
N. Freed, J. Klensin and J. Postel, ``Multipurpose Internet Mail
Extensions (MIME) Part Four: Registration Procedures'', November 1996,
Standards Track (obsolete RFC 1521, 1522, 1590).
@end quotation



@node RFC 2049, plain text, RFC 2048, Glossary
@subsection RFC 2049
@cindex RFC 2049
@cindex Standards Track


@noindent
[RFC 2049]
@quotation
N. Freed and N. Borenstein, ``Multipurpose Internet Mail Extensions
(MIME) Part Five: Conformance Criteria and Examples'', November 1996,
Standards Track (obsolete RFC 1521, 1522, 1590).
@end quotation



@node plain text, us-ascii, RFC 2049, Glossary
@subsection plain text

書体や組版に関する情報を持たない文字符号 (@ref{Coded character set}) のみ
で表現される text 情報



@node us-ascii,  , plain text, Glossary
@subsection us-ascii
@cindex ASCII
@cindex us-ascii

アメリカ連邦などで使われる英語などを表現するための MIME charset
(@ref{MIME charset}) の1つ@refill

ASCII (@ref{ASCII}) のみからなり ISO 2022 による符号拡張は許されない

Internet message における標準の符号化文字集合 (@ref{Coded character set})
であり明示的に MIME charset が示されない場合は原則として 
@strong{us-ascii} が使われる@refill

またRFC 822 (@ref{RFC 822}) における @strong{ASCII}  us-ascii である


@node Bug report, GitHub, Glossary, Appendix
@section bug 報告の仕方

FLIM-LB に関する議論は以下のメーリングリストで行われます
最新バージョンのアナウンスもこちらに流れます

@display
Wanderlust Mailing List @t{<wl@@ml.gentei.org>}
@end display

ここでは主に日本語での議論が行われていますまた英語専用のリストとして

@display
Wanderlust List in English @t{<wl-en@@ml.gentei.org>}
@end display

もあります(こちらに投稿されたメッセージは前者にも配送されます)

これらのメーリングリストのガイドを得るには@t{wl-ctl@@ml.gentei.org} 
(英語の方は @t{wl-en-ctl@@ml.gentei.org} ) 本文に

@example
# guide
@end example

@noindent
と書いたメールを送って下さい

バグ報告やパッチの送付もこれらのメーリングリストへ送ってくださいメーリ
ングリストへの送信はメンバになる必要があります

但しあまりにも古い版に関する報告は歓迎されません古い版の bug 
しい版では治っているかもしれませんまず最新版で確認してみましょう
@refill

それから適切な報告をしましょう単にうまく動かないと言われてもど
ういう状況なのかはさっぱり判りません最低限OS, emacs, APEL, FLIM,
SEMI, 使っている MUA の種類および版設定を書く必要がありますまた
error が起っている場合は backtrace を送ることも重要です
(cf. @ref{Bugs,Reporting Bugs ,Reporting Bugs, emacs, GNU Emacs
Manual})

またbug は大抵複数の人が遭遇するものですそうでなければbug ではな
い可能性があります)。だから作者に直接 mail を送ると作者は同じ mail
を何通も書く羽目になりますだから必ず bug 報告は上記の address に送っ
てください


@node GitHub, History, Bug report, Appendix
@section GitHub による開発

FLIM-LB のリポジトリは GitHub で公開されています

@example
@uref{https://github.com/wanderlust/flim}
@end example

プルリクエストを送る場合はEmacs の様にコミットメッセージに従来の
@file{ChangeLog} エントリに相当する内容をインデントせずに入力して下さい
Emacs  @file{CONTRIBUTE} ファイル
@footnote{@uref{https://git.savannah.gnu.org/cgit/emacs.git/plain/CONTRIBUTE}}
にある @cite{Commit messages} セクションを参照して下さい

またバグ報告の場合はバックトレースを取って添付すると原因究明しやすくな
ります @footnote{バックトレースの取り方は
@uref{http://www.jpl.org/elips/BUGS-ja.html}が参考になります。}


@node History,  , GitHub, Appendix
@section 歴史

FLIM  code の最古の部分は 榎並 嗣智 氏が書いた @file{mime.el} に起源し
ますこの小さな program  Nemacs で動作する iso-2022-jp  B-encoding 
専用の encoded-word の復号化プログラムでした@refill

その後守岡 知彦  @file{mime.el} を元に@file{tiny-mime.el} というプロ
グラムを書きますこれはNemacs  Mule で動作する encoded-word の符号
復号化プログラムでした@file{tiny-mime.el}  B-encoding だけでなく 
Q-encoding もsupport またMULE で扱うことができるさまざまな MIME
charset (@ref{MIME charset}) を同時に使うことができましたこの時
Nemacs  Mule の双方を support するために用いられたテクニックは後に emu
package にまとめられます@refill

この頃守岡 知彦  @file{tiny-mime.el} をさまざまな MUA で使うための設
定集も配布していましたがそれらは後に@file{tiny-mime.el} とともに1つの 
package にまとめられtm という名前で配布されます@refill

守岡 知彦 はやがてMIME message を閲覧するためのプログラムである
@file{tm-body.el} を書きますこれはすぐに@file{tm-view.el} という名前
に変わりましたがやがてこれが@file{tiny-mime.el} に代わってtm の中
核となります@refill

@file{tm-view.el} は当然Content-Transfer-Encoding を扱う必要があります
この目的のためにMEL が整備されはじめましたBase64 に関しては 
@file{tiny-mime.el}  code が移されまた新たにQuoted-Printable  
code が追加されましたこれらが@file{mel-b.el}  @file{mel-q.el} になり
ました@refill

また後に守岡 知彦 によって uuencode 用の @file{mel-u.el} が追加され
その後に小林 修平 氏によって x-gzip64 用の@file{mel-g.el} が追加されま
した@refill

tm では後に守岡 知彦 によって @file{tiny-mime.el} の再実装が行われ
の過程でSTD 11  parser が書かれましたこれは現在の 
@file{std11.el} に当たりますまたこの過程で @file{tiny-mime.el} は復
号化を行う @file{tm-ew-d.el} と符号化を行う @file{tm-ew-e.el} に分けられ
ましたこの両者が現在の @file{eword-decode.el}  
@file{eword-encode.el} の先祖に当たります@refill

後に守岡 知彦 らによって tm の全面書き換え作業が行われこの過程でtm 
 APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME などに分けられました
のうちの MEL  FLIM の直接の先祖に当たります@refill

後にAPEL から @file{std11.el} が移されまた@file{mailcap.el},
@file{eword-decode.el} および @file{eword-encode.el}  SEMI から移され
package の名前が FLIM となります@refill

この直前から田中  氏がより RFC に忠実な実装を書き始めこれは現在
FLIM の枝である ``FLIM-FLAM'' となっています


@node Concept Index, Function Index, Appendix, Top
@chapter 概念索引

@printindex cp

@node Function Index, Variable Index, Concept Index, Top
@chapter 関数索引

@printindex fn

@node Variable Index,  , Function Index, Top
@chapter 変数索引

@printindex vr
@bye