diff --git a/docs/htmlqa b/docs/htmlqa index b823ecb..96ab118 100644 --- a/docs/htmlqa +++ b/docs/htmlqa @@ -8,22 +8,36 @@ ���C���X�g�[���֘A �ELaTeX�g��Ȃ����ǖ쒹������Ȃ���_���ł���? - �����Ȃɂ�B�쒹�̃��C�u���������g���Ă���̂Ŗ쒹�����܂킹�� - ����ĉ������܂��B + ��A�ʂɂ��������B + ftp://ftp.ae.keio.ac.jp/pub/emacs-lisp/text/yatex/ + �̂Ȃ��ɁA"yahtml" �Ŏn�܂�t�@�C��������̂Ŏ�����͂�������� + �ė���悲���B ���J�X�^�}�C�Y�֘A �E������ EUC �ɂ��Ă��܂� JIS �R�[�h�̃t�@�C������肽�����ǁB ~/.emacs �� (setq yahtml-kanji-code 3) ;3��EUC - ���Ă����Ε��i��html�R�[�h��EUC�ɂȂ�܂��BJIS�ɂ������Ƃ��́A - html�\�[�X�̂��K�ɁA + ���Ă����Ε��i��html�R�[�h��EUC�ɂȂ�܂��B�ŋǏ��I�ɕς�����@�B + �T�[�o�[��Apache�ł���? �Ȃ炻�̃f�B���N�g���� .htaccess �Ƃ��� + �t�@�C����p�ӂ��āA + + AddType "text/html; charset=iso-2020-jp" .html + + �Ƃ����s�������܂��傤�B�����Apache�N�͂��̃f�B���N�g����html�t�@ + �C�����uiso-2022-jp(������JIS)����[�v�Ƃ��q����ɂ��炩���ߓ` + ����悤�ɂȂ�܂��Byahtml������ɏ]���A���̃f�B���N�g���ȉ��̃t�@ + �C���͊����R�[�h��JIS�ɐݒ肵�܂��B + + �ȂɁAapache�ł͂Ȃ��ƂȁB�Ȃ疾���I��html�\�[�X�̂��K�ɁA �Ə����Ă������̃t�@�C������JIS�ɂȂ�܂��B + �������AEmacs-20 �� XEmacs �̏ꍇ�A�����R�[�h�̃V���{���̗��[��* + �͕t���܂���B ���ǂ��ɂ��Ȃ�Ȃ��֘A �E���������̉��̕����ƃC���f���g���߂���x�����ǁB @@ -73,7 +87,7 @@ �Eyahtml�̍ŐV����? �������Ȃ����AWWW�ɃA�N�Z�X�ł���Ȃ�A - http://www.comp.ae.keio.ac.jp/~yuuji/yatex/ + http://www.yatex.org/ ��`���Ă݂ĉ������B���̂Ȃ��́A�uyatex-current�v�Ƃ��������N�� ���ǂ�ƍŐV�ł̖쒹����肷�邱�Ƃ��ł��܂��B�������A���������[ �X�łł͂Ȃ��A��҂��f�o�b�O���������肵�Đ���ɓ��삵�Ȃ��\�� @@ -86,7 +100,7 @@ �E�߂��ɂ���ڂ����l�ɕ��� �E���C�����O���X�g�Ɏ�����o�� - �Eyuuji@ae.keio.ac.jp �Ɏ�����o�� + �Eyuuji@gentei.org �Ɏ�����o�� �ł��傤���B���D���ȕ��@�łǂ����B diff --git a/docs/qanda.eng b/docs/qanda.eng index 1a6f619..8f2b2f8 100644 --- a/docs/qanda.eng +++ b/docs/qanda.eng @@ -212,6 +212,17 @@ commands in a suitable sequence. You can find `latexmk' script in a directory of supports/latexmk in some CTAN ftp directory. +*Can I inhibit auto-filling against very long line? + + If you use Emacs-19 or later, Yes. The variable + auto-fill-inhibit-regexp controls the filling behaviour. To set + this, use yatex-mode-hook as below. + + (add-hook 'yahtml-mode-hook + '(lambda () + (setq auto-fill-inhibit-regexp + "^[ ]*\\( + +@end example + +@noindent +�̂悤�ɊJ�n�^�O�ƏI���^�O���s�ɓn���ď��������ꍇ�̕⊮���w���܂��B +�����Ƀu���b�N�^�^�O���⊮���Ɋ܂܂�܂��B + +@item [prefix] s (�쒹��section�^�⊮�ɑΉ�) +@dots{} +@example + +@end example + +@noindent +�̂悤�ɏI���^�O���������A�������l�݂̂ŋ@�\���w�肷��^�O��⊮���܂��B +�⊮���Ƃ��ẮAimg, input �����݂��܂��B + +@item [prefix] l (�쒹��large�^�⊮�ɑΉ�) +@dots{} begin�^�⊮�Ƃقړ����ł����A + +@example + �` +@end example + +@noindent +�̂悤�Ɉ�s���ɊJ�n/�I���^�O����ꂽ���Ƃ��ɗ��p���܂��B + +@item [prefix] m (�쒹��maketitle�^�⊮�ɑΉ�) +@dots{} �v�f�������l�������Ȃ��^�O��⊮���͂��܂��B +�Ȃǂ��⊮���ɑ������܂��B + +@item [prefix] a (�쒹�̃A�N�Z���g�⊮�ɑΉ�) +@dots{} �G���e�B�e�B�Q�Ƃɂ�镶���\�L����͂���Ƃ��ɗp���܂��B +�f�t�H���g�ł� < (<), > (>), & (&), " ("), ' ('), +�u�����N ( ) �̕⊮���͂��s���܂��B +@end table + +@node Jump, Changing and Deleting, Completion, Top +@comment node-name, next, previous, up +@chapter �J�[�\���W�����v +�������̂��낢��ȏꏊ�� + +@table @kbd +@item [prefix] g + @dots{} �Ή�����I�u�W�F�N�g�ɃW�����v +@end table + +@noindent +���������Ƃɂ��A�J�[�\���ʒu��HTML�\���ɑΉ�����ꏊ�ɃW�����v +���܂��B�Ή��W�����݂���Ɖ��߂����R�}���h�ɂ͈ȉ��̂��̂�����܂��B + +@itemize @bullet +@item @code{} ���� @code{} +@item @code{} �� �Ή�����viewer�N�� +@item @code{} �� �����N��ւ̃|�C���g�ړ� +@item @code{} �� Java�\�[�X�v���O�����ւ̈ړ� +@c @item @code{\include(\input)} �� �Ή�����t�@�C�� +@end itemize + +@node Changing and Deleting, Customizations, Jump, Top +@comment node-name, next, previous, up +@chapter �ύX/�폜 + +@menu +* �^�O�̕ύX:: +* �����Q�Ƃւ̕ύX:: +* ���W������������URLencode:: +@end menu + +@node �^�O�̕ύX, �����Q�Ƃւ̕ύX, Changing and Deleting, Changing and Deleting +@comment node-name, next, previous, up +@section �^�O�̕ύX +�������̂��낢��ȏꏊ�� + +@table @kbd +@item [prefix] c + @dots{} �Ή�����^�O����ύX +@end table + +@noindent +���������Ƃɂ��A�J�[�\���ʒu��HTML�\���ɉ����� +�L�q���e�̕ύX���s���܂��B�J�[�\���ʒu�ƕύX������e�� +�Ή��͈ȉ��̒ʂ�ł��B + +@itemize @bullet +@item @code{}�`@code{} +@dots{} @code{TAG} �̕ύX +@item @code{ alt="photo"} �Ȃǂ̑����l +@dots{} �����l�̕ύX +@end itemize + +@node �����Q�Ƃւ̕ύX, ���W������������URLencode, �^�O�̕ύX, Changing and Deleting +@comment node-name, next, previous, up +@section �����Q�Ƃւ̕ύX +�����Ƃ��Ă� < �� > ��\������Ƃ��́A�����Q�Ƃ�p���� +< �� > �ƕ\�L����K�v������܂����A +HTML�ȊO�̃t�@�C�����炱���̕������܂ރe�L�X�g�荞�ꍇ +�ȂǂɁA�����̕������ꊇ���ĕ����Q�ƌ`���ɕϊ��ł��܂��B + +@table @kbd +@item [prefix] ; + @dots{} �w�肵���̈�̕����Q�Ƃɒu��������ׂ������̒u�� +@item [prefix] : + @dots{} �w�肵���̈�̕����Q�Ƃ��Q�ƕ������̂��̂ɒu�� + ([prefix] ; �̋t�ϊ�) +@end table + + +@node ���W������������URLencode, , �����Q�Ƃւ̕ύX, Changing and Deleting +@comment node-name, next, previous, up +@section ���W������������URLencode +@table + @item [prefix] # + @dots{} �w�肵���̈���� URLencode ���ׂ���������������� + �G���R�[�h�\�L�ɒu���B +@end table + + +@node Customizations, Copying, Changing and Deleting, Top +@comment node-name, next, previous, up +@chapter �J�X�^�}�C�Y +@cindex �J�X�^�}�C�Y[�������܂���] +@cindex �L�[�A�T�C��[������������] + +yahtml�̓���𐧌䂷��ϐ��ɂ��Đ������܂��B + +@menu +* All customizable variables:: �J�X�^�}�C�Y�ϐ��ꗗ +* Hook variables:: hook�ϐ� +@end menu + +@node All customizable variables, Hook variables, Customizations, Customizations +@comment node-name, next, previous, up +@section �J�X�^�}�C�Y�ϐ��ꗗ + +@defvar yahtml-prefix +yahtml-mode ���̃v���t�B�N�X�L�[ (@kbd{\C-c}) +@end defvar + +@defvar yahtml-image-viewer +img�ŎQ�Ƃ��Ă���摜�t�@�C����\������Ƃ��ɋN������R�}���h (xv) +@end defvar + +@defvar yahtml-www-browser +@kbd{[prefix]g} �ŊO���y�[�W��\������Ƃ��ɋN������u���E�U (netscape) +@end defvar + +@defvar yahtml-kanji-code +�f�t�H���g�̊����R�[�h�B1=sjis, 2=jis, 3=euc (2) +.htaccess �t�@�C���� +@quotation + AddType "text/html; charset=xxx" .html +@end quotation +�̋L�q���������ꍇ�͂���ɏ]�� +@end defvar + +@defvar yahtml-fill-column +auto-fill����Ƃ��̃J������ (72) +@end defvar + +@defvar yahtml-fill-prefix +yahtml-mode �ŗL��fill-prefix (@code{nil}) +@end defvar + +@defvar yahtml-path-url-alist +OS�̃t�@�C���V�X�e����ł̃t���p�X���ƁA���̊O�����J����URL�̑Ή��\�B +@end defvar + +@defvar yahtml-directory-index +�T�[�o�A�N�Z�X���t�@�C�������ȗ������Ƃ��Ƀf�t�H���g�ŊJ����� +�C���f�b�N�X�t�@�C���̖��O�B�����̏ꍇ index.html�B(@code{"index.html"}) +@end defvar + +@defvar yahtml-lint-program +HTML�\���`�F�b�N�v���O�����B(@code{"jweblint"}) +@end defvar + +@defvar yahtml-hate-too-deep-indentation +�l�X�g�����n���ł̃C���f���g���[������Ƃ���t�ɂ���B(@code{nil}) +@end defvar + +@defvar yahtml-always-/p +@code{} �����ꂽ��K�� @code{} �������l�����B@code{nil} +@end defvar + +@defvar yahtml-p-prefered-env-regexp +�����I�� @code{} �����ė~�������B@code{^\(body\|dl\)} +@end defvar + +@defvar yahtml-template-file +�V�KHTML�t�@�C���쐬���Ɏ����I�ɑ}�����ė~�����t�@�C�����B +@file{"~/http/template.html"} +@end defvar + +@defvar yahtml-prefer-upcases +�^�O�ɑ啶�����g�������B@code{nil} +@end defvar + +@defvar yahtml-prefer-upcase-attributes +�����w��q�ɑ啶�����g�������B@code{nil} +@end defvar + +@defvar yahtml-server-type +Apache�n�̃T�[�o�𗘗p���Ă���ꍇ�� 'apache ���Z�b�g����B +./.htaccess ���Q�Ƃ��邩�ǂ��������肷��B@code{'apache} +@end defvar + +@defvar yahtml-apache-access-file +@code{yahtml-server-type} �� @code{'apache} �̂Ƃ��� +�A�N�Z�X�����t�@�C�������w��B@file{".htaccess"} +@end defvar + +@defvar yahtml-shell-command-option +�V�F���ŕʃR�}���h���N������Ƃ��̃I�v�V�����B +@end defvar + +@defvar yahtml-translate-hyphens-when-comment-region +�̈�R�����g�A�E�g������Ƃ��Ɋ��ɑ��݂���n�C�t���� @code{-} �� +�ύX���邩�ǂ����B(@code{t}) +@end defvar + +@defvar yahtml-entity-reference-chars-alist +�G���e�B�e�B�Q��(Entity Reference)�ŋL�q���ׂ������Q�� + @code{'(?���� . "�G���e�B�e�B�\�L")} �Ƃ����`������� +alist�ŕ��ׂ�B�f�t�H���g�� @code{<}, @code{>}, @code{&}, @code{'}, +@code{"} �ɑ���alist���ݒ肳��Ă���̂ŁA�lj����������������L�q����Η� +���Bcdr�� @code{"�G���e�B�e�B�\�L"} �́A�擪�� @code{&} �� ������@code{;} +�͊܂߂��ɏ����B +@end defvar + +@defvar yahtml-faithful-to-htmllint +�\���`�F�b�J�Ƃ��� htmllint �𗘗p����ꍇ������Ƃ����]�v�ȋȂǂ� +���Ă��x���������̂ŁA������������Ƃ��ɂ͂��̕ϐ���@code{t}�� +����B +@end defvar + + +@node Hook variables, , All customizable variables, Customizations +@comment node-name, next, previous, up +@section hook�ϐ� + + +@node Copying, Concept Index, Customizations, Top +@comment node-name, next, previous, up +@chapter ��舵�� + + �{�v���O�����̓t���[�\�t�g�E�F�A�ł��B�{�v���O�������g�p���Đ����������� +�錋�ʂɑ��Ă���҂͐ӔC��Ȃ����ƂƂ��܂��B�]�ړ��Ɋւ��Ă͐������� +���܂���B�펯�I�Ɉ����Ă��������B�܂��A�g�p���Ă���|�����C���ł��m�点�� +�������ƁA��҂͊��ŃT�|�[�g�ɗ�ނ��Ƃł��傤�B + + ���A��]�A�o�O�A���z���͊��}�������܂��B +�A���� gentei.org �܂�(1999�N7������)�B +�p���I�Ɏg�p���Ă���������̓��C�����O���X�g�ufj�쒹�̉�v�� +����������Ă��������B�������@�ɂ��Ă͖{�p�b�P�[�W�� @file{docs/yahtmlqa} +�t�@�C���́u���̑��v�̏͂��䗗���������B + +�d�l�́A�\���Ȃ��m����(�C�������)�ύX����܂�:-p�B + +@flushright +�L���Y�� +@end flushright + + +@node Concept Index, , Copying, Top +@comment node-name, next, previous, up +@unnumbered ���� +@printindex cp + + +@contents + +@bye + +@c Local Variables: +@c fill-column: 74 +@c fill-prefix: nil +@c End: + +Tag table: + +End tag table diff --git a/docs/yatex.ref b/docs/yatex.ref index c2871b4..17ced41 100644 --- a/docs/yatex.ref +++ b/docs/yatex.ref @@ -159,8 +159,7 @@ ���C���N���[�h�\���u���E�Y [prefix] d �L���Y�� - yuuji@ae.keio.ac.jp - pcs39334@asciinet.or.jp + yuuji@gentei.org Local variables: mode: text diff --git a/docs/yatexadd.doc b/docs/yatexadd.doc index 012a413..4bd51cf 100644 --- a/docs/yatexadd.doc +++ b/docs/yatexadd.doc @@ -169,5 +169,5 @@ �v���܂��B - �L���Y�� - yuuji@ae.keio.ac.jp + �L���Y�� + yuuji@gentei.org diff --git a/docs/yatexe.tex b/docs/yatexe.tex index 012b7c6..cb51c73 100644 --- a/docs/yatexe.tex +++ b/docs/yatexe.tex @@ -14,7 +14,7 @@ @subtitle Yet Another tex-mode for emacs @title Wild Bird @subtitle // YaTeX // -@author @copyright{} 1991-1996 by HIROSE, Yuuji [yuuji@@ae.keio.ac.jp] +@author @copyright{} 1991-1996 by HIROSE, Yuuji [yuuji@@gentei.org] @end titlepage @node Top, What is YaTeX?, (dir), (dir) @@ -2018,7 +2018,7 @@ short descriptions on useful functions, where [F] means function, [A] means arguments, [D] means description. -@itemize +@table @kbd @item [F] YaTeX:read-position @itemx [A] @@ -2047,7 +2047,7 @@ Check the current completion type is specified one and cause error if not. The variable @code{YaTeX-current-completion-type} holds the symbol according to the current completion type. -@end itemize +@end table @node Contribution, , Useful functions for creating add-in, Add-in functions @comment node-name, next, previous, up @@ -2271,8 +2271,8 @@ redistribute this software freely but with NO warranty to anything as a result of using this software. However, any reports and suggestions are welcome as long as I feel interests in this -software. My possible e-mail address is `yuuji@@ae.keio.ac.jp'. -(up to Mar.1995 at least) And there is mailing list for YaTeX. +software. My possible e-mail address is `yuuji@@gentei.org'. +(up to May.1999 at least) And there is mailing list for YaTeX. Although the common language is Japanese, questions in English will be welcome. To join the ML, send the mail whose subject is `append' to the address `yatex-control@@jaist.ac.jp'. If you have some diff --git a/docs/yatexgen.doc b/docs/yatexgen.doc index a871140..b94c936 100644 --- a/docs/yatexgen.doc +++ b/docs/yatexgen.doc @@ -175,5 +175,5 @@ ��A�K�����ɐZ�邾���ɂ��āA�����ĕM�҂܂ő������肵�Ȃ��ʼn������B yatexgen ��������A�낭�Ȋ�����Ȃ����Ƃ͕������Ă܂�:-p�B - �L���Y�� - yuuji@ae.keio.ac.jp + �L���Y�� + yuuji@gentei.org diff --git a/docs/yatexj.tex b/docs/yatexj.tex index 44170e2..faf4486 100644 --- a/docs/yatexj.tex +++ b/docs/yatexj.tex @@ -6,6 +6,7 @@ @iftex @c @syncodeindex fn cp @c �����Y���̂ł����ɏ����Ƃ����B +@c C-l C-c n �Ńm�[�h���� @c �m�[�h���������� C-l C-u C-n �S���̃m�[�h�X�V C-l C-u C-e @c ���j���[���₵���� C-l C-u C-m �S���̃��j���[�X�V C-l C-u C-a @c �t�H�[�}�b�g����Ƃ��� C-l C-e C-b @@ -18,7 +19,7 @@ @subtitle Yet Another tex-mode for emacs @title �w�쒹�x @subtitle // YaTeX // -@author @copyright{} 1991-1997 by HIROSE, Yuuji [yuuji@@ae.keio.ac.jp] +@author @copyright{} 1991-1999 by HIROSE, Yuuji [yuuji@@gentei.org] @end titlepage @node Top, Intro, (dir), (dir) @@ -2112,8 +2113,7 @@ �������ƁA��҂͊��ŃT�|�[�g�ɗ�ނ��Ƃł��傤�B ���A��]�A�o�O�A���z���͊��}�������܂��B -�A���� yuuji@@ae.keio.ac.jp �܂��́A -pcs39334@@asciinet.or.jp �܂�(1995�N3������)�B +�A���� yuuji@@gentei.org �܂�(1999�N5������)�B �p���I�Ɏg�p���Ă���������̓��C�����O���X�g�ufj�쒹�̉�v�� ����������Ă��������B�������@�ɂ��Ă͖{�p�b�P�[�W�� @file{docs/qanda} �t�@�C���́u���̑��v�̏͂��䗗���������B diff --git a/docs/yatexref.eng b/docs/yatexref.eng index dc593db..e0d91bf 100644 --- a/docs/yatexref.eng +++ b/docs/yatexref.eng @@ -154,9 +154,8 @@ *Browse included structure [prefix] d - HIROSE Yuuji - yuuji@ae.keio.ac.jp - pcs39334@asciinet.or.jp + HIROSE Yuuji + yuuji@gentei.org Local variables: mode: text diff --git a/help/YATEXHLP.jp b/help/YATEXHLP.jp index 613d254..58eddc0 100644 --- a/help/YATEXHLP.jp +++ b/help/YATEXHLP.jp @@ -1297,12 +1297,12 @@ ����܂����B���N��\�Z�B�ނɂ́A�쒹�����łȂ�������|�������� ���̃\�t�g�E�F�A����铮�@�A�Z���X���ӂ��R�����g�Ȃǂ��܂� ���B���݂̖쒹���F�l�Ɏx�������悤�Ɍ��₩�Ɉ�����͔̂ނ̂��� - ���ƌ����Ă��ߌ��ł͂���܂���B�쒹/����/�������g���Ƃ��ɔނ̈� - �炩�Ȗ�������Ƌ��ɋF���ĉ������B + ���ƌ����Ă��ߌ��ł͂���܂���B�쒹/����/����/���g���Ƃ��� + �ނ̈��炩�Ȗ�������Ƌ��ɋF���ĉ������B ��˂�������(asciinet) �肢�t�������ł��B - http://www.comp.ae.keio.ac.jp/~yuuji/lune/astrology/ + http://www.gentei.org/~yuuji/lune/astrology/ �O���P�Y����(�c���) �J�����ʂ̓��͎��̏����̃��[�h�����̃A�C�f�A���܂����B @@ -1370,6 +1370,7 @@ YaTeX-insert-amper ��contribute���Ē����܂����B ��҂̐������̖}�~�X�J�ɏE���ĉ������܂����B YaTeX-shift-section-undo �̎������@�������Ă��������܂����B + Wz�ւ̈ڐA�� HackTeX ���쐬����܂����B �����\����(�c���) �l�X�g���������itemize���ł�indentation�̕s����w�E���Ē��� @@ -1428,6 +1429,9 @@ �������[�h�ł̃Z�N�V�����^�}�N���Ή��̗v�]�Ƒ����ׂ��}�N���ꗗ�� �����܂����B +���c�Ύ�����(��t��) + AMS LaTeX�p�̂������̊��AYaTeX-change-parentheses �Ȃǂ��쐬 + ���Ē����܂����B yatex (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist)) diff --git a/yahtml.el b/yahtml.el index a41c45c..c7087cf 100644 --- a/yahtml.el +++ b/yahtml.el @@ -1,9 +1,7 @@ ;;; -*- Emacs-Lisp -*- -;;; (c ) 1994-1997 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] -;;; Last modified Mon Oct 26 19:57:36 1998 on firestorm +;;; (c ) 1994-1999 by HIROSE Yuuji [yuuji@gentei.org] +;;; Last modified Wed Jul 14 18:01:18 1999 on firestorm ;;; $Id$ -(defconst yahtml-revision-number "1.65.5" - "Revision number of running yatex.el") ;;;[Installation] ;;; @@ -77,6 +75,12 @@ ;;; is "netscape") ;;; * [prefix] a YaTeX's accent mark's equivalent of yahtml. ;;; This function can input $lt, $gt or so. +;;; * [prefix] ; Translate chars of `>', `<', `&', and `"' to +;;; `>', `<', `&', `"' respectively +;;; in the region. +;;; * [prefix] : Do translation opposite to above, in the region. +;;; * [prefix] # Translate unsafe-chars and unreserved-chars to +;;; URLencoded string in the region. ;;; ;;;[�L�[�̐���] ;;; @@ -126,6 +130,11 @@ ;;; ����Ƃ����|�����o���܂�) ;;; * [prefix] a YaTeX �̃A�N�Z���g�L���⊮�Ɠ����ł��B ;;; < > �������͂ł��܂��B +;;; * [prefix] ; �w�肵�����W�������� > < & " �����ꂼ�� +;;; > < & " �ɕϊ����܂��B +;;; * [prefix] : �w�肵�����W�������ŏ�Ƌt�̕ϊ������܂��B +;;; * [prefix] # �w�肵�����W��������%�G���R�[�h�̕K�v�ȕ����� +;;; ����������G���R�[�h���܂��B ;;; ;;; [�ӎ�] ;;; @@ -150,9 +159,14 @@ "*WWW Browser command") (defvar yahtml-kanji-code 2 "*Kanji coding system number of html file; 1=sjis, 2=jis, 3=euc") -(defvar yahtml-coding-system - (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist)) - "Kanji coding system") +;;(defvar yahtml-coding-system +;; (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist)) +;; "Kanji coding system") +(and (featurep 'mule) + (integerp yahtml-kanji-code) + (setq yahtml-kanji-code + (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist)))) + (defvar yahtml-fill-column 72 "*fill culumn used for yahtml-mode") (defvar yahtml-fill-prefix nil "*fill prefix for yahtml-mode") @@ -186,6 +200,20 @@ (defvar yahtml-template-file "~/http/template.html" "*Template HTML file. It'll be inserted to empty file.") +(defvar yahtml-prefer-upcases nil + "*Non-nil for preferring upcase TAGs") + +(defvar yahtml-prefer-upcase-attributes nil + "*Non-nil for preferring upcase attributes") + +(defvar yahtml-server-type 'apache + "*WWW server program type") + +(defvar yahtml-apache-access-file ".htaccess" + "*Server access file name for apache") + +(defvar yahtml-use-css t "*Use stylesheet or not") + ;;; --- customizable variable ends here --- (defvar yahtml-prefix-map nil) (defvar yahtml-mode-map nil "Keymap used in yahtml-mode.") @@ -216,7 +244,6 @@ (yahtml-define-begend-region-key (concat (upcase (substring key 0 1)) (substring key 1)) env map))) - (if yahtml-mode-map nil (setq yahtml-mode-map (make-sparse-keymap) yahtml-prefix-map (make-sparse-keymap)) @@ -279,6 +306,9 @@ (YaTeX-define-key "t" 'yahtml-browse-menu map) (YaTeX-define-key "a" 'yahtml-complete-mark map) (YaTeX-define-key "'" 'yahtml-prev-error map) + (YaTeX-define-key ";" 'yahtml-translate-region map) + (YaTeX-define-key ":" 'yahtml-translate-reverse-region map) + (YaTeX-define-key "#" 'yahtml-escape-chars-region map) ;;;;;(YaTeX-define-key "i" 'yahtml-fill-item map) )) @@ -310,7 +340,7 @@ ;;; Completion tables for `form' (defvar yahtml-form-table - '(("img") ("input"))) + '(("img") ("input") ("link") ("meta"))) (defvar yahtml-user-form-table nil) (defvar yahtml-tmp-form-table nil) (defvar yahtml-last-form "img") @@ -322,14 +352,16 @@ ("UnorderedList" . "ul") ("DefinitionList" . "dl") ("Preformatted" . "pre") - ("table") ("tr") ("th") ("td") + ("table") ("thead") ("tbody") ("tfoot") ("caption") ("tr") ("th") ("td") + ("address") ("h1") ("h2") ("h3") ("h4") ("h5") ("h6") ;; ("p") ;This makes indentation screwed up! + ("style") ("div") )) -(defvar yahtml-itemizing-regexp - "\\(ul\\|ul\\|dl\\)" - "Regexp of itemizing forms") +;(defvar yahtml-itemizing-regexp +; "\\(ul\\|ol\\|dl\\)" +; "Regexp of itemizing forms") (defvar yahtml-user-env-table nil) (defvar yahtml-tmp-env-table nil) @@ -342,7 +374,8 @@ (defvar yahtml-typeface-table (append '(("dfn") ("em") ("cite") ("code") ("kbd") ("samp") ("strike") - ("strong") ("var") ("b") ("i") ("tt") ("u") ("address") ("font")) + ("strong") ("var") ("b") ("i") ("tt") ("u") ("big") ("small") ("font") + ("sup") ("sub") ("span")) yahtml-env-table) "Default completion table of typeface designator") (defvar yahtml-user-typeface-table nil) @@ -364,8 +397,6 @@ (defvar yahtml-tmp-single-cmd-table nil) (defvar yahtml-last-single-cmd nil) -(defvar yahtml-prefer-upcases nil) - ;(defvar yahtml-struct-name-regexp ; "\\<\\(h[1-6]\\|[uod]l\\|html\\|body\\|title\\|head\\|table\\|t[rhd]\\|pre\\|a\\|form\\|select\\|center\\|blockquote\\)\\b") (defvar yahtml-struct-name-regexp @@ -377,23 +408,65 @@ (or (assoc "p" yahtml-env-table) (setq yahtml-env-table (cons '("p") yahtml-env-table))) +(defun yahtml-dir-default-charset () + (cond + ((and (eq yahtml-server-type 'apache) ;;check .htaccess + buffer-file-name) + (let ((dir default-directory) + charset af ext (ldir "") + (case-fold-search t) + (uid (car (cdr (cdr (file-attributes ".")))))) + (setq ext (file-name-nondirectory buffer-file-name) + ext (substring ext (string-match "\\.[a-z0-9]+$" ext))) + (if (string-match "^[A-Z]:" dir) + (setq dir (substring dir 2))) ;remove drive letter + (while (and dir + (not (string= dir ldir)) + (equal uid (car (cdr (cdr (file-attributes dir)))))) + (setq af (expand-file-name yahtml-apache-access-file dir)) + (if (file-exists-p af) + (save-excursion + (set-buffer (find-file-noselect af)) + (save-excursion + (goto-char (point-min)) + (if (re-search-forward ;search the charset for same extension + (format "^\\s *AddType.*charset=\\(.*\\)\\%s$" ext) + nil t) + (progn + (setq charset + (buffer-substring + (match-beginning 1) (match-end 1))) + (cond + ((string-match "iso-2022-jp" charset) + (setq charset 2)) + ((string-match "euc-jp" charset) + (setq charset 3)) + ((string-match "shift_jis" charset) + (setq charset 1)) + (t (setq charset nil))) + (setq dir "")))) + (kill-buffer (current-buffer)))) + (setq ldir dir + dir (substring dir 0 (string-match "/$" dir)) + dir (file-name-directory dir))) + (if (featurep 'mule) + (setq charset (cdr (assq charset YaTeX-kanji-code-alist)))) + charset + )) + (t nil)) + ) + (defun yahtml-mode () (interactive) - (cond - ((and YaTeX-emacs-20 (fboundp 'coding-system-equal)) - (let ((mp (buffer-modified-p)) - (ud (memq buffer-file-coding-system - '(undecided undecided-unix undecided-dos undecided-mac)))) - (if (coding-system-equal - yahtml-coding-system buffer-file-coding-system) - nil ; if coding-system is the same, do nothing - (set-buffer-file-coding-system yahtml-coding-system) - (if ud (set-buffer-modified-p mp))))) - ((featurep 'mule) - (set-file-coding-system yahtml-coding-system)) - ((boundp 'NEMACS) - (make-local-variable 'kanji-fileio-code) - (setq kanji-fileio-code yahtml-kanji-code))) + (let ((coding (or (yahtml-dir-default-charset) yahtml-kanji-code))) + (cond + ((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system)) + (setq buffer-file-coding-system coding)) + ((featurep 'mule) + (set-file-coding-system coding)) + ((boundp 'NEMACS) + (make-local-variable 'kanji-fileio-code) + (setq kanji-fileio-code coding)))) (setq major-mode 'yahtml-mode mode-name "yahtml") (mapcar @@ -408,7 +481,7 @@ (YaTeX-struct-end . "%1>") (YaTeX-struct-name-regexp . yahtml-struct-name-regexp) (YaTeX-comment-prefix . "" comment) ;; include&exec - ("" include) + ("" include) ;; string (hilit-string-find ?\\ string) (yahtml-hilit-region-tag "\\(em\\|strong\\)" bold) diff --git a/yatex.el b/yatex.el index 523becf..b0e7311 100644 --- a/yatex.el +++ b/yatex.el @@ -1,9 +1,11 @@ ;;; -*- Emacs-Lisp -*- -;;; Yet Another tex-mode for emacs. -;;; yatex.el rev. 1.66 -;;; (c )1991-1998 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Mon Oct 26 21:05:14 1998 on firestorm +;;; Yet Another tex-mode for emacs - //�쒹// +;;; yatex.el rev. 1.67 +;;; (c )1991-1999 by HIROSE Yuuji.[yuuji@gentei.org] +;;; Last modified Tue Jul 13 14:20:45 1999 on firestorm ;;; $Id$ +;;; The latest version of this software is always available at; +;;; http://www.yatex.org/ ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -22,35 +24,35 @@ (require 'comment) (require 'yatexlib) -(defconst YaTeX-revision-number "1.66" - "Revision number of running yatex.el" -) +(defconst YaTeX-revision-number "1.67" + "Revision number of running yatex.el") + ;---------- Local variables ---------- (defvar YaTeX-prefix "\C-c" "*Prefix key to call YaTeX functions. -You can select favorite prefix key by setq in your ~/.emacs." -) +You can select favorite prefix key by setq in your ~/.emacs.") + (defvar YaTeX-environment-indent 1 - "*Indentation depth at column width in LaTeX environments." -) + "*Indentation depth at column width in LaTeX environments.") + (defvar YaTeX-fill-prefix nil "*fill-prefix used for auto-fill-mode. -The default value is nil." -) +The default value is nil.") + (defvar YaTeX-fill-column 72 - "*fill-column used for auto-fill-mode." -) + "*fill-column used for auto-fill-mode.") + (defvar YaTeX-comment-prefix "%" - "TeX comment prefix." -) + "TeX comment prefix.") + (defvar YaTeX-current-position-register ?3 "*Position register to keep where the last completion was done. All of YaTeX completing input store the current position into the register YaTeX-current-position-register. So every time you make a trip to any other part of text other than you are writing, you can return to the editing paragraph by calling register-to-point with argument -YaTeX-current-position-register." -) +YaTeX-current-position-register.") + ;;(defvar YaTeX-tmp-dic-unit 'main-file ;; "*Default switching unit of temporary dictionary. ;;There are two switching unit: @@ -58,20 +60,20 @@ ;;'directory : switch tmp-dic dir by dir." ;;) (defvar tex-command (if YaTeX-japan "jlatex" "latex") - "*Default command for typesetting LaTeX text." -) + "*Default command for typesetting LaTeX text.") + (defvar bibtex-command (if YaTeX-japan "jbibtex" "bibtex") - "*Default command of BibTeX." -) + "*Default command of BibTeX.") + (defvar dvi2-command ;previewer command for your site (if YaTeX-dos "dviout -wait=0" "xdvi -geo +0+0 -s 4") "*Default previewer command including its option. -This default value is for X window system." -) +This default value is for X window system.") + (defvar makeindex-command (if YaTeX-dos "makeind" "makeindex") - "*Default makeindex command." -) + "*Default makeindex command.") + (defvar dviprint-command-format (if YaTeX-dos "dviprt %s %f%t" "dvi2ps %f %t %s | lpr") @@ -79,31 +81,31 @@ Format string %s will be replaced by the filename. Do not forget to specify the `from usage' and `to usage' with their option by format string %f and %t. - See also documentation of dviprint-from-format and dviprint-to-format." -) + See also documentation of dviprint-from-format and dviprint-to-format.") + (defvar dviprint-from-format (if YaTeX-dos "%b-" "-f %b") - "*`From' page format of dvi filter. %b will turn to beginning page number." -) + "*`From' page format of dvi filter. %b will turn to beginning page number.") + (defvar dviprint-to-format (if YaTeX-dos "%e" "-t %e") - "*`To' page format of dvi filter. %e will turn to end page number." -) + "*`To' page format of dvi filter. %e will turn to end page number.") + (defvar YaTeX-default-document-style (concat (if YaTeX-japan "j") "article") - "*Default LaTeX Documentstyle for YaTeX-typeset-region." -) + "*Default LaTeX Documentstyle for YaTeX-typeset-region.") + (defvar YaTeX-need-nonstop nil - "*T for adding `\\nonstopmode{}' to text before invoking latex command." -) + "*T for adding `\\nonstopmode{}' to text before invoking latex command.") + (defvar latex-warning-regexp "line.* [0-9]*" - "*Regular expression of line number of warning message by latex command." -) + "*Regular expression of line number of warning message by latex command.") + (defvar latex-error-regexp "l\\.[1-9][0-9]*" "*Regular expression of line number of latex error. Perhaps your latex command stops at this error message with line number of -LaTeX source text." -) +LaTeX source text.") + (defvar latex-dos-emergency-message "Emergency stop" ;<- for Micro tex, ASCII-pTeX 1.6 "Message pattern of emergency stop of typesetting. @@ -113,12 +115,12 @@ other process, user or OS. Define to this variable a message string of your latex command on DOS shown at abnormal termination. Remember Demacs's call-process function is not oriented for interactive -process." -) +process.") + (defvar latex-message-kanji-code 2 "*Kanji coding system latex command types out. -1 = Shift JIS, 2 = JIS, 3 = EUC." -) +1 = Shift JIS, 2 = JIS, 3 = EUC.") + (defvar NTT-jTeX nil "*T for using NTT-jTeX for latex command. More precisely, setting t to this variables inhibits inter-word break on @@ -126,16 +128,16 @@ put % after each line at filling. ���s+�C���f���g�ɂ���āA�^�C�v�Z�b�g��̎��Ԃ��Ă��܂��̂�}������ꍇ�� t�ɂ���(�Â�NTT-jTeX�Ō����Ɍ����)�B��̓I�ɂ́Afill����Ƃ��Ɋe�s�̏I���� -%��t������B" -) +%��t������B") + (defvar YaTeX-item-regexp (concat (regexp-quote "\\") "\\(sub\\|bib\\)*item") - "*Regular expression of item command." -) + "*Regular expression of item command.") + (defvar YaTeX-sectioning-regexp - "part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\(\\*?\\|\\b\\)" - "*LaTeX sectioning commands regexp." -) + "\\(part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\)\\(\\*\\|\\b\\)" + "*LaTeX sectioning commands regexp.") + (defvar YaTeX-paragraph-start (concat "^[ \t]*%\\|^[ \t]*$\\|\\'\\|^\C-l\\|\\\\\\\\$\\|^[ \t]*\\\\\\(" YaTeX-sectioning-regexp ;sectioning commands @@ -143,8 +145,8 @@ "\\|newpage\\b\\|vspace\\b" "\\)") "*Paragraph starting regexp of common LaTeX source. Use this value -for YaTeX-uncomment-paragraph." -) +for YaTeX-uncomment-paragraph.") + (defvar YaTeX-paragraph-separate (concat "^[ \t]*%\\|^[ \t]*$\\|^\C-l\\|\\\\\\\\$\\|^[ \t]*\\\\\\(" YaTeX-sectioning-regexp ;sectioning commands @@ -153,8 +155,8 @@ "\\|newpage\\b\\|vspace\\b" "\\)") "*Paragraph delimiter regexp of common LaTeX source. Use this value -for YaTeX-uncomment-paragraph." -) +for YaTeX-uncomment-paragraph.") + (defvar YaTeX-verbatim-environments '("verbatim" "verbatim*") "*Assume these environments of this variable disable LaTeX commands.") @@ -162,11 +164,11 @@ "*Regexp of verb family. Do not contain preceding \\\\ nor \\(\\).") (defvar YaTeX-fill-inhibit-environments (append '("tabular" "tabular*" "array" "picture" "eqnarray" "eqnarray*" - "equation" "math" "displaymath") + "equation" "equation*" "math" "displaymath") YaTeX-verbatim-environments) "*In these environments, YaTeX inhibits fill-paragraph from formatting. -Define those environments as a form of list." -) +Define those environments as a form of list.") + (defvar YaTeX-itemizing-env-regexp "itemize\\|enumerate\\|description\\|list\\|thebibliography" "*Regexp of itemizing environments") @@ -176,51 +178,52 @@ (defvar YaTeX-array-env-regexp (concat "array\\*?\\|eqnarray\\*?\\|tabbing\\|tabular\\*?\\|" ;LaTeX + "matrix\\|pmatrix\\|bmatrix\\|vmatrix\\|Vmatrix\\|" ;AMS-LaTeX "align\\*?\\|split\\*?\\|aligned\\*?\\|alignat\\*?\\|" ;AMS-LaTeX "[bpvV]?matrix\\|smallmatrix\\|cases\\|" ;AMS-LaTeX "xalignat\\*?\\|xxalignat\\*?") ;AMS-LaTeX "*Regexp of environments where `&' becomes field delimiter.") (defvar YaTeX-uncomment-once t "*T for removing all continuous commenting character(%). -Nil for removing only one commenting character at the beginning-of-line." -) +Nil for removing only one commenting character at the beginning-of-line.") + (defvar YaTeX-close-paren-always t - "Close parenthesis always when YaTeX-modify-mode is nil." -) + "*Close parenthesis always when YaTeX-modify-mode is nil.") + (defvar YaTeX-greek-by-maketitle-completion nil - "*T for greek letters completion by maketitle-type completion." -) + "*T for greek letters completion by maketitle-type completion.") + (defvar YaTeX-auto-math-mode t "*T for changing YaTeX-math mode automatically.") (defvar YaTeX-use-AMS-LaTeX nil - "*T for using AMS-LaTeX" -) + "*T for using AMS-LaTeX") + (defvar yatex-mode-hook nil - "*List of functions to be called at the end of yatex-mode initializations." -) + "*List of functions to be called at the end of yatex-mode initializations.") + ;;-- Math mode values -- (defvar YaTeX-math-key-list-default '((";" . YaTeX-math-sign-alist) (":" . YaTeX-greek-key-alist)) - "Default key sequence to invoke math-mode's image completion." -) + "Default key sequence to invoke math-mode's image completion.") + (defvar YaTeX-math-key-list-private nil - "*User defined alist, math-mode-prefix vs completion alist." -) + "*User defined alist, math-mode-prefix vs completion alist.") + (defvar YaTeX-math-key-list (append YaTeX-math-key-list-private YaTeX-math-key-list-default) - "Key sequence to invoke math-mode's image completion." -) + "Key sequence to invoke math-mode's image completion.") + (defvar YaTeX-skip-default-reader nil - "Non-nil skips default argument reader of section-type completion." -) + "Non-nil skips default argument reader of section-type completion.") + (defvar YaTeX-simple-messages nil - "Non-nil makes minibuffer messages simpler." -) + "Non-nil makes minibuffer messages simpler.") + (defvar YaTeX-template-file "~/work/template.tex" - "*Template TeX source file. This will be inserted to empty file." -) + "*Template TeX source file. This will be inserted to empty file.") + (defvar YaTeX-addin-prefix "YaTeX:") ;------------ Completion table ------------ ; Set tex-section-like command possible completion @@ -245,8 +248,8 @@ ;; section types in mathmode ("frac" 2) ("sqrt") ("mathrm") ("mathbf") ("mathit") ) - "Default completion table for section-type completion." -) + "Default completion table for section-type completion.") + (defvar user-section-table nil) (defvar tmp-section-table nil) @@ -260,8 +263,8 @@ ("thebibliography") ("theindex") ("flushleft") ("flushright") ("minipage") ) - "Default completion table for begin-type completion." -) + "Default completion table for begin-type completion.") + (defvar user-env-table nil) (defvar tmp-env-table nil) @@ -272,8 +275,8 @@ ("tiny") ("scriptsize") ("footnotesize") ("small")("normalsize") ("large") ("Large") ("LARGE") ("huge") ("Huge") ) - "Default completion table for large-type completion." -) + "Default completion table for large-type completion.") + (defvar user-fontsize-table nil) (defvar tmp-fontsize-table nil) @@ -296,8 +299,8 @@ ("upsilon") ("phi") ("varphi") ("chi") ("psi") ("omega") ("Gamma") ("Delta") ("Theta") ("Lambda")("Xi") ("Pi") ("Sigma") ("Upsilon") ("Phi") ("Psi") ("Omega")))) - "Default completion table for maketitle-type completion." -) + "Default completion table for maketitle-type completion.") + (defvar user-singlecmd-table nil) (defvar tmp-singlecmd-table nil) @@ -307,24 +310,23 @@ ;; Do not change this section. ;;; (defvar YaTeX-mode-map nil - "Keymap used in YaTeX mode" -) + "Keymap used in YaTeX mode") + (defvar YaTeX-prefix-map nil - "Keymap used when YaTeX-prefix key pushed" -) + "Keymap used when YaTeX-prefix key pushed") + (defvar YaTeX-user-extensional-map (make-sparse-keymap) "*Keymap used for the user's customization") (defvar YaTeX-current-completion-type nil - "Has current completion type. This may be used in YaTeX addin functions." -) + "Has current completion type. This may be used in YaTeX addin functions.") + (defvar YaTeX-modify-mode nil "*Current editing mode. When non-nil, each opening parentheses only opens, -nil enters both open/close parentheses when opening parentheses key pressed." -) +nil enters both open/close parentheses when opening parentheses key pressed.") + (defvar YaTeX-math-mode nil - "Holds whether current mode is math-mode." -) + "Holds whether current mode is math-mode.") ;;; ;; Define key table ;;; @@ -336,6 +338,7 @@ (define-key YaTeX-mode-map "{" 'YaTeX-insert-braces) (define-key YaTeX-mode-map "(" 'YaTeX-insert-parens) (define-key YaTeX-mode-map "$" 'YaTeX-insert-dollar) + (define-key YaTeX-mode-map "|" 'YaTeX-insert-bar) (define-key YaTeX-mode-map "&" 'YaTeX-insert-amper) (define-key YaTeX-mode-map "[" 'YaTeX-insert-brackets) (define-key YaTeX-mode-map YaTeX-prefix YaTeX-prefix-map) @@ -419,8 +422,7 @@ (function (lambda (key) (define-key YaTeX-mode-map (car key) 'YaTeX-math-insert-sequence))) - YaTeX-math-key-list) -) + YaTeX-math-key-list)) (defvar YaTeX-section-completion-map nil "*Key map used at YaTeX completion in the minibuffer.") @@ -448,8 +450,8 @@ (defvar fontsize-name "large" "*Initial fontsize completion") (defvar single-command "maketitle" "*Initial LaTeX single command") (defvar YaTeX-kanji-code (if YaTeX-dos 1 2) - "*File kanji code used by Japanese TeX." -) + "*File kanji code used by Japanese TeX.") + (defvar YaTeX-coding-system nil "File coding system used by Japanese TeX.") (cond (YaTeX-emacs-20 @@ -469,8 +471,7 @@ (setq YaTeX-mode-syntax-table (make-syntax-table (standard-syntax-table))) (modify-syntax-entry ?\n " " YaTeX-mode-syntax-table) (modify-syntax-entry ?\{ "(}" YaTeX-mode-syntax-table) - (modify-syntax-entry ?\} "){" YaTeX-mode-syntax-table) -) + (modify-syntax-entry ?\} "){" YaTeX-mode-syntax-table)) ;---------- Provide YaTeX-mode ---------- ;;; @@ -549,19 +550,11 @@ )) (cond ((boundp 'MULE) (set-file-coding-system YaTeX-coding-system)) - ((and YaTeX-emacs-20 (fboundp 'coding-system-equal)) - (let ((mp (buffer-modified-p)) - (ud (memq - buffer-file-coding-system - '(undecided undecided-unix undecided-dos undecided-mac)))) - (if (coding-system-equal - YaTeX-coding-system buffer-file-coding-system) - nil ; if coding-system is the same, do nothing - (set-buffer-file-coding-system YaTeX-coding-system) - (if ud (set-buffer-modified-p mp))))) + ((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system)) + (setq buffer-file-coding-system YaTeX-coding-system)) ((featurep 'mule) (set-file-coding-system YaTeX-coding-system)) - ((boundp 'NEMACS) + ((boundp 'NEMACS) (make-local-variable 'kanji-fileio-code) (setq kanji-fileio-code YaTeX-kanji-code))) (setq fill-column YaTeX-fill-column @@ -582,8 +575,7 @@ (and (= 0 (buffer-size)) (file-exists-p YaTeX-template-file) (y-or-n-p (format "Insert %s?" YaTeX-template-file)) (insert-file-contents (expand-file-name YaTeX-template-file))) - (run-hooks 'text-mode-hook 'yatex-mode-hook) -) + (run-hooks 'text-mode-hook 'yatex-mode-hook)) ;---------- Define YaTeX-mode functions ---------- (defvar YaTeX-ec "\\" "Escape character of current mark-up language.") @@ -625,6 +617,12 @@ (autoload 'YaTeX-in-math-mode-p "yatexmth" "Check if in math-env." t) (autoload 'YaTeX-toggle-math-mode "yatexmth" "YaTeX math-mode interfaces." t) (autoload 'YaTeX-math-member-p "yatexmth" "Check if a word is math command." t) +(autoload 'YaTeX-insert-amsparens-region "yatexmth" "AMS parens region" t) +(autoload 'YaTeX-insert-amsbraces-region "yatexmth" "AMS braces region" t) +(autoload 'YaTeX-insert-amsbrackets-region "yatexmth" "AMS brackets region" t) +(autoload 'YaTeX-on-parenthesis-p "yatexmth" "Check if on math-parens" t) +(autoload 'YaTeX-goto-open-paren "yatexmth" "Goto opening paren" t) +(autoload 'YaTeX-change-parentheses "yatexmth" "Change corresponding parens" t) ;;autoload from yatexhlp.el (autoload 'YaTeX-help "yatexhlp" "YaTeX helper with LaTeX commands." t) @@ -635,6 +633,7 @@ (autoload 'YaTeX-generate-simple "yatexgen" "YaTeX add-in support." t) ;;autoload from yatexsec.el +(autoload 'YaTeX-section-overview "yatexsec" "YaTeX sectioning(view)" t) (autoload 'YaTeX-read-section-in-minibuffer "yatexsec" "YaTeX sectioning" t) (autoload 'YaTeX-make-section-with-overview "yatexsec" "YaTeX sectioning" t) @@ -704,8 +703,7 @@ (YaTeX-intelligent-newline nil) (YaTeX-indent-line)) (if YaTeX-current-position-register - (point-to-register YaTeX-current-position-register))) -) + (point-to-register YaTeX-current-position-register)))) (defun YaTeX-make-begin-end (arg) "Make LaTeX environment command of \\begin{env.} ... \\end{env.} @@ -724,14 +722,12 @@ (setq env-name env) (YaTeX-update-table (list env-name) 'env-table 'user-env-table 'tmp-env-table) - (YaTeX-insert-begin-end env-name arg)) -) + (YaTeX-insert-begin-end env-name arg))) (defun YaTeX-make-begin-end-region () "Call YaTeX-make-begin-end with ARG to specify region mode." (interactive) - (YaTeX-make-begin-end t) -) + (YaTeX-make-begin-end t)) (defun YaTeX-make-section (arg &optional beg end cmd) "Make LaTeX \\section{} type command with completing read. @@ -813,14 +809,12 @@ (forward-char -1)) (while (string= (buffer-substring (- (point) 3) (1- (point))) "{}") (forward-char -2))) - (if (<= (minibuffer-depth) 0) (use-global-map global-map))) -) + (if (<= (minibuffer-depth) 0) (use-global-map global-map)))) (defun YaTeX-make-section-region (args beg end) "Call YaTeX-make-section with arguments to specify region mode." (interactive "P\nr") - (YaTeX-make-section args beg end) -) + (YaTeX-make-section args beg end)) (defun YaTeX-make-fontsize (arg &optional fontsize) "Make completion like {\\large ...} or {\\slant ...} in minibuffer. @@ -856,14 +850,12 @@ (if YaTeX-current-position-register (point-to-register YaTeX-current-position-register)) (save-excursion - (insert (YaTeX-addin fontsize-name) "}")))) -) + (insert (YaTeX-addin fontsize-name) "}"))))) (defun YaTeX-make-fontsize-region () "Call function:YaTeX-make-fontsize with ARG to specify region mode." (interactive) - (YaTeX-make-fontsize t) -) + (YaTeX-make-fontsize t)) (defvar YaTeX-singlecmd-suffix "" "*Suffix for maketitle-type commands.") (defvar YaTeX-read-singlecmd-history nil "Holds maketitle-type history.") @@ -895,8 +887,7 @@ (forward-char -2) (if (looking-at "\\[\\]") (forward-char 1) (goto-char q))) (if YaTeX-current-position-register - (point-to-register YaTeX-current-position-register)) -) + (point-to-register YaTeX-current-position-register))) (defvar YaTeX-completion-begin-regexp "[{\\]" "Regular expression of limit where LaTeX command's completion begins.") @@ -957,8 +948,7 @@ (message "Making completion list...") (with-output-to-temp-buffer "*Help*" (display-completion-list - (all-completions pattern all-table)))))))))) -) + (all-completions pattern all-table))))))))))) (defun YaTeX-toggle-modify-mode (&optional arg) (interactive "P") @@ -971,8 +961,7 @@ (message "Modify mode")) (setq YaTeX-modify-mode nil) (message "Cancel modify mode.")) - (set-buffer-modified-p (buffer-modified-p)) ;redraw mode-line -) + (set-buffer-modified-p (buffer-modified-p))) ;redraw mode-line (defun YaTeX-switch-mode-menu (arg &optional char) (interactive "P") @@ -983,8 +972,7 @@ ((or (= c ?$) (= c ?t)) (if YaTeX-auto-math-mode (message "Makes no sense in YaTeX-auto-math-mode.") - (YaTeX-toggle-math-mode arg))))) -) + (YaTeX-toggle-math-mode arg)))))) (defun YaTeX-insert-quote () (interactive) @@ -1001,8 +989,7 @@ (regexp-quote (char-to-string (preceding-char))) "�A�B�C�D�H�I�u�v�w�x�y�z()")) "``") - (t "''"))) -) + (t "''")))) (defun YaTeX-closable-p () (and (not YaTeX-modify-mode) @@ -1014,7 +1001,7 @@ ;; (and (not YaTeX-close-paren-always) (not (eolp))) ;; (input-pending-p) ;; (YaTeX-quick-in-environment-p "verbatim")) -) + ) (defun YaTeX-insert-braces-region (beg end &optional open close) (interactive "r") @@ -1022,8 +1009,7 @@ (goto-char end) (insert (or close "}")) (goto-char beg) - (insert (or open "{"))) -) + (insert (or open "{")))) (defun YaTeX-insert-braces (arg &optional open close) (interactive "p") @@ -1037,6 +1023,24 @@ (looking-at "\\\\left\\\\")) (insert "{\\right\\}") (forward-char -8)) + ((save-excursion ;from matsu@math.s.chiba-u.ac.jp + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]igl\\\\")) + (insert + (concat + "{" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\}")) + (forward-char -7)) + ((save-excursion + (and (> (- (point) (point-min)) 7) + (condition-case () (forward-char -7) (error nil))) + (looking-at "\\\\[bB]iggl\\\\")) + (insert + (concat + "{" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\}")) + (forward-char -8)) + ((= (preceding-char) ?\\ ) + (insert "{\\}") + (forward-char -2)) ;matsu's hack ends here ((and (> (point) (+ (point-min) 4)) (save-excursion (backward-char 4) (looking-at "\\\\end")) (not (YaTeX-literal-p)) @@ -1057,13 +1061,11 @@ (if (and (eq (char-after (point)) ?\}) (eq (char-after (- (point) 2)) ?\\ )) (progn (insert "\\") (forward-char -1))) - ))) -) + )))) (defun YaTeX-jmode () (or (and (boundp 'canna:*japanese-mode*) canna:*japanese-mode*) - (and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*)) -) + (and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*))) (defun YaTeX-jmode-off () (cond @@ -1072,9 +1074,11 @@ ((and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*) (egg:toggle-egg-mode-on-off)) ((and (fboundp 'skk-mode) (boundp 'skk-mode) skk-mode) - (if (fboundp 'skk-mode-off) (skk-mode-off) (j-mode-off))) - ((and (fboundp 'fep-force-off) (fep-force-off)))) -) + (cond + ((fboundp 'skk-latin-mode) (skk-latin-mode t)) + ((fboundp 'skk-mode-off) (skk-mode-off)) + (t (j-mode-off)))) + ((and (fboundp 'fep-force-off) (fep-force-off))))) (defun YaTeX-self-insert (arg) (call-interactively (global-key-binding (char-to-string last-command-char)))) @@ -1092,6 +1096,20 @@ (looking-at "\\\\left")) (insert "[\\right]") (forward-char -7)) + ((save-excursion ;from matsu@math.s.chiba-u.ac.jp + (and (> (- (point) (point-min)) 5) (forward-char -5)) + (looking-at "\\\\[bB]igl")) + (insert + (concat + "[" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r]")) + (forward-char -6)) + ((save-excursion + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]iggl")) + (insert + (concat + "[" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r]")) + (forward-char -7)) ;matsu's hack ends here ((and (= (preceding-char) ?\\ ) (/= (char-after (- (point) 2)) ?\\ ) (not (YaTeX-in-math-mode-p))) @@ -1106,14 +1124,11 @@ ((YaTeX-closable-p) (insert "[]") (backward-char 1)) - (t (YaTeX-self-insert arg))) - ) -) + (t (YaTeX-self-insert arg))))) (defun YaTeX-insert-brackets-region (beg end) (interactive "r") - (YaTeX-insert-braces-region beg end "[" "]") -) + (YaTeX-insert-braces-region beg end "[" "]")) (defun YaTeX-insert-parens (arg) "Insert parenthesis pair." @@ -1126,19 +1141,85 @@ (looking-at "\\\\left")) (insert "(\\right)") (forward-char -7)) - ((and (= (preceding-char) ?\\ ) (not (YaTeX-in-math-mode-p))) + ((save-excursion ;from matsu@math.s.chiba-u.ac.jp + (and (> (- (point) (point-min)) 5) (forward-char -5)) + (looking-at "\\\\[bB]igl")) + (insert + (concat + "(" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r)")) + (forward-char -6)) + ((save-excursion + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]iggl")) + (insert + (concat + "(" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r)")) + (forward-char -7)) + ((= (preceding-char) ?\\ ) ;matsu's hack ends here (insert "(\\)") (backward-char 2)) ((YaTeX-closable-p) (insert "()") (backward-char 1)) - (t (YaTeX-self-insert arg))) -) + (t (YaTeX-self-insert arg)))) (defun YaTeX-insert-parens-region (beg end) (interactive "r") - (YaTeX-insert-braces-region beg end "(" ")") -) + (YaTeX-insert-braces-region beg end "(" ")")) + +(defun YaTeX-insert-bar (arg) + "Insert bar pair." + (interactive "p") + (cond + ((YaTeX-jmode) (YaTeX-self-insert arg)) + ((not (YaTeX-closable-p)) (YaTeX-self-insert arg)) + ((save-excursion + (and (> (- (point) (point-min)) 5) (forward-char -5)) + (looking-at "\\\\left")) + (insert "|\\right|") + (forward-char -7)) + ((save-excursion ;from matsu@math.s.chiba-u.ac.jp + (and (> (- (point) (point-min)) 5) (forward-char -5)) + (looking-at "\\\\[bB]igl")) + (insert + (concat + "|" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r|")) + (forward-char -6)) + ((save-excursion + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]iggl")) + (insert + (concat + "|" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r|")) + (forward-char -7)) + ((save-excursion ; added by Jin + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\left\\\\")) + (insert "|\\right\\|") + (forward-char -8)) + ((save-excursion + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]igl\\\\")) + (insert + (concat + "|" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\|")) + (forward-char -7)) + ((save-excursion + (and (> (- (point) (point-min)) 7) (forward-char -7)) + (looking-at "\\\\[bB]iggl\\\\")) + (insert + (concat + "|" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\|")) + (forward-char -8)) ; added by Jin up to here. + ((= (preceding-char) ?\\ ) + (insert "|\\|") + (backward-char 2)) +; ((and (YaTeX-closable-p) +; (/= (preceding-char) ?|) +; (/= (following-char) ?|)) +; (insert "||") +; (backward-char 1)) + (t (YaTeX-self-insert arg)))) (defun YaTeX-insert-dollar () (interactive) @@ -1150,13 +1231,11 @@ (insert "$$") (forward-char -1) (YaTeX-jmode-off) - (or YaTeX-auto-math-mode YaTeX-math-mode (YaTeX-toggle-math-mode 1))) -) + (or YaTeX-auto-math-mode YaTeX-math-mode (YaTeX-toggle-math-mode 1)))) (defun YaTeX-insert-dollars-region (beg end) (interactive "r") - (YaTeX-insert-braces-region beg end "$" "$") -) + (YaTeX-insert-braces-region beg end "$" "$")) (defun YaTeX-insert-amper () (interactive) @@ -1165,8 +1244,7 @@ (= (preceding-char) 92) (YaTeX-literal-p)) (insert "&") - (insert "\\&")) -) + (insert "\\&"))) (defun YaTeX-version () "Return string of the version of running YaTeX." @@ -1175,8 +1253,7 @@ (concat "Yet Another tex-mode " (if YaTeX-japan "�u�쒹�v" "`Wild Bird'") " Revision " - YaTeX-revision-number)) -) + YaTeX-revision-number))) (defun YaTeX-typeset-menu (arg &optional char) "Typeset, preview, visit error and miscellaneous convenient menu. @@ -1205,8 +1282,7 @@ ((= c ?l) (YaTeX-lpr arg)) ((= c ?m) (YaTeX-switch-mode-menu arg)) ((= c ?b) (YaTeX-insert-string "\\")) - ((= c ?s) (YaTeX-xdvi-remote-search arg)))) -) + ((= c ?s) (YaTeX-xdvi-remote-search arg))))) (defun YaTeX-%-menu (&optional beg end char) "Operate %# notation." @@ -1248,8 +1324,7 @@ (insert "%#END\n") (set-marker b nil) (set-marker e nil)) - ))) -) + )))) (defun YaTeX-goto-corresponding-label (reverse &optional otherwin) "Jump to corresponding \\label{} and \\ref{} or \\cite and \\bibitem. @@ -1342,8 +1417,7 @@ (setq regexp-search-ring (cons string (delete string regexp-search-ring))) (setq search-last-regexp string))) - (t nil))) -) + (t nil)))) (defun YaTeX-goto-corresponding-environment (&optional allow-mismatch noerr) "Go to corresponding begin/end enclosure. @@ -1406,8 +1480,7 @@ (if noerr 'message 'error) "Corresponding environment `%s' not found." env) (sit-for 1) - nil))))) -) + nil)))))) (defun YaTeX-goto-corresponding-file (&optional other) "Visit or switch buffer of corresponding file, @@ -1429,8 +1502,7 @@ (t (YaTeX-switch-to-buffer input-file))) (or (YaTeX-get-builtin "!") YaTeX-parent-file - (setq YaTeX-parent-file parent)))) -) + (setq YaTeX-parent-file parent))))) (defun YaTeX-goto-corresponding-BEGIN-END () (if (not (YaTeX-on-BEGIN-END-p)) nil @@ -1441,8 +1513,7 @@ (not (search-backward "%#BEGIN" nil t)))) (error "Corresponding %%#BEGIN/END not found.")) (beginning-of-line) - t) -) + t)) (defvar YaTeX-processed-file-regexp-alist nil "Alist of regexp of processed file regexp vs. its file name part; @@ -1479,13 +1550,12 @@ ("\\\\\\(psbox\\)\\(\\[[^]]+\\]\\)?{\\(\\([^,} ]*/\\)?[^} ]+\\)\\(\\.e?ps\\)}" 3) ;\psbox[options...]{hoge.eps} (97/1/11) ("\\\\input{\\([^} ]+\\)\\(\\.tps\\)}" 1) ;tgif2tex (1998/9/16) ) - "See the documentation of YaTeX-processed-file-regexp-alist." -) + "See the documentation of YaTeX-processed-file-regexp-alist.") (defvar YaTeX-file-processor-alist nil "*Alist of files' processor vs. its extension; -See also the documentation of YaTeX-processed-file-regexp-alist." -) +See also the documentation of YaTeX-processed-file-regexp-alist.") + (defvar YaTeX-file-processor-alist-default '(("tgif" . ".obj") ("ghostview" . ".ps") @@ -1493,8 +1563,7 @@ (t . ".tex") (t . ".sty") (t . "")) - "See the documentation of YaTeX-file-processor-alist." -) + "See the documentation of YaTeX-file-processor-alist.") (defun YaTeX-goto-corresponding-file-processor (&optional other) "Execute corresponding file processor." @@ -1558,8 +1627,7 @@ (cond ((symbol-function cmd) (funcall cmd src other))) - t))))))) -) + t)))))))) (defun YaTeX-on-section-command-p (command) "Check if point is on the LaTeX command: COMMAND(regexp). @@ -1606,8 +1674,7 @@ (>= p (match-beginning i)) (< p (match-end i))) -1 ;return -1 if point is on optional arg (if (< p (point)) parg)) - )))) -) + ))))) (defun YaTeX-on-maketitle-p () "Check if point is on maketitle type commands. @@ -1636,15 +1703,13 @@ (YaTeX-replace-format-args (regexp-quote YaTeX-struct-end) (concat "\\(" YaTeX-struct-name-regexp "\\)") "" "" "")) - (point-end-of-line) t)) -) + (point-end-of-line) t))) (defun YaTeX-on-includes-p () (save-excursion (beginning-of-line) (re-search-forward "\\(\\(include.*\\)\\|\\(input\\)\\){.*}" - (point-end-of-line) t)) -) + (point-end-of-line) t))) (defun YaTeX-on-comment-p (&optional sw) "Return t if current line is commented out. @@ -1653,15 +1718,14 @@ (save-excursion (beginning-of-line) (skip-chars-forward "\\s ") - (looking-at (if sw "%" "%[^#]"))) -) + (looking-at (if sw "%" "%[^#]")))) (defun YaTeX-on-BEGIN-END-p () (save-excursion (let ((case-fold-search nil)) (beginning-of-line) - (re-search-forward "\\(%#BEGIN\\)\\|\\(%#END\\)" (point-end-of-line) t))) -) + (re-search-forward + "\\(%#BEGIN\\)\\|\\(%#END\\)" (point-end-of-line) t)))) (defun YaTeX-goto-corresponding-* (arg) "Parse current line and call suitable function." @@ -1676,8 +1740,7 @@ YaTeX-equation-env-regexp ;to delay loading (or (YaTeX-inner-environment t) "document")) (YaTeX-goto-corresponding-leftright))) - (t (message "I don't know where to go."))) -) + (t (message "I don't know where to go.")))) (defun YaTeX-goto-corresponding-*-other-window (arg) "Parse current line and call suitable function." @@ -1687,8 +1750,7 @@ ;;((YaTeX-goto-corresponding-environment)) ((YaTeX-goto-corresponding-file t)) ;;((YaTeX-goto-corresponding-BEGIN-END)) - (t (message "I don't know where to go."))) -) + (t (message "I don't know where to go.")))) (defun YaTeX-comment-region (alt-prefix) "Comment out region by '%'. @@ -1700,8 +1762,7 @@ (if alt-prefix (read-string "Insert prefix: ") YaTeX-comment-prefix)) - (YaTeX-comment-uncomment-env 'comment-out-region)) -) + (YaTeX-comment-uncomment-env 'comment-out-region))) (defun YaTeX-uncomment-region (alt-prefix) "Uncomment out region by '%'." @@ -1711,8 +1772,7 @@ (if alt-prefix (read-string "Remove prefix: ") YaTeX-comment-prefix) (region-beginning) (region-end) YaTeX-uncomment-once) - (YaTeX-comment-uncomment-env 'uncomment-region)) -) + (YaTeX-comment-uncomment-env 'uncomment-region))) (defun YaTeX-comment-uncomment-env (func) "Comment or uncomment out one LaTeX environment switching function by FUNC." @@ -1725,8 +1785,7 @@ (if (> p (point)) (setq beg (1+ beg)) (forward-char 1)) (funcall func YaTeX-comment-prefix beg (point) YaTeX-uncomment-once))) (message "%sommented out current environment." - (if (eq func 'comment-out-region) "C" "Un-c")) -) + (if (eq func 'comment-out-region) "C" "Un-c"))) (defun YaTeX-beginning-of-environment (&optional limit-search-bound end) "Goto the beginning of the current environment. @@ -1740,16 +1799,14 @@ (goto-char (get 'YaTeX-inner-environment 'point)) (and end (YaTeX-goto-corresponding-environment)) (if (interactive-p) (push-mark op)) - t))) -) + t)))) (defun YaTeX-end-of-environment (&optional limit-search-bound) "Goto the end of the current environment. Optional argument LIMIT-SEARCH-BOUND non-nil limits the search bound to most recent sectioning command." (interactive) - (YaTeX-beginning-of-environment limit-search-bound t) -) + (YaTeX-beginning-of-environment limit-search-bound t)) (defun YaTeX-mark-environment () "Mark current position and move point to end of environment." @@ -1773,8 +1830,7 @@ (set-mark-command nil) (YaTeX-goto-corresponding-environment) (end-of-line) - (if (eobp) nil (forward-char 1)))) -) + (if (eobp) nil (forward-char 1))))) (defun YaTeX-comment-paragraph () "Comment out current paragraph." @@ -1792,8 +1848,7 @@ (t (mark-paragraph) (if (looking-at paragraph-separate) (forward-line 1)) - (comment-out-region "%")))) -) + (comment-out-region "%"))))) (defun YaTeX-uncomment-paragraph () "Uncomment current paragraph." @@ -1816,8 +1871,7 @@ (mark-paragraph) (if (not (bobp)) (forward-line 1)) (uncomment-region "%" nil nil YaTeX-uncomment-once)) - (message "This line is not a comment line.")))) -) + (message "This line is not a comment line."))))) (defun YaTeX-remove-prefix (prefix &optional once) "Remove prefix on current line as far as prefix detected. But @@ -1826,8 +1880,7 @@ (beginning-of-line) (while (re-search-forward (concat "^" prefix) (point-end-of-line) t) (replace-match "") - (if once (end-of-line))) -) + (if once (end-of-line)))) (defun YaTeX-kill-some-pairs (predicate gofunc kill-contents) "Kill some matching pair. @@ -1878,8 +1931,7 @@ (kill-region (if (bolp) (point) b1) e2))) - t)) -) + t))) (defun YaTeX-kill-section-command (point kill-all) "Kill section-type command at POINT leaving its argument. @@ -1902,8 +1954,7 @@ (goto-char end) (set-marker end nil) (kill-append (buffer-substring (point) (1- (point))) nil) - (delete-backward-char 1)))) -) + (delete-backward-char 1))))) (defun YaTeX-kill-paren (kill-contents) "Kill parentheses leaving its contents. @@ -1927,8 +1978,7 @@ (point) (progn (re-search-forward "\\s +" nil t) (point))) (delete-char 1))) - t)))) -) + t))))) (defvar YaTeX-read-environment-history nil "Holds history of environments.") (put 'YaTeX-read-environment-history 'no-default t) @@ -1939,8 +1989,7 @@ prompt (append tmp-env-table user-env-table env-table) predicate must-match initial - 'YaTeX-read-environment-history) -) + 'YaTeX-read-environment-history)) (defvar YaTeX-read-section-history nil "Holds history of section-types.") (put 'YaTeX-read-section-history 'no-default t) @@ -1951,8 +2000,7 @@ (append tmp-section-table user-section-table section-table))) (read-from-minibuffer-with-history prompt initial YaTeX-section-completion-map nil - 'YaTeX-read-section-history)) -) + 'YaTeX-read-section-history))) (defun YaTeX-read-section-with-overview () "Read sectioning command with overview. @@ -1974,9 +2022,7 @@ (if (eq (selected-window) (minibuffer-window)) (erase-buffer)) (insert sect) - (exit-minibuffer) - ) -) + (exit-minibuffer))) (defvar YaTeX-read-fontsize-history nil "Holds history of font designator.") (put 'YaTeX-read-fontsize-history 'no-default t) @@ -1985,8 +2031,7 @@ (YaTeX-sync-local-table 'tmp-fontsize-table) (completing-read-with-history prompt (append tmp-fontsize-table user-fontsize-table fontsize-table) - predicate must-match initial 'YaTeX-read-fontsize-history) -) + predicate must-match initial 'YaTeX-read-fontsize-history)) (defun YaTeX-change-environment () "Change the name of environment." @@ -2010,8 +2055,7 @@ (exchange-point-and-mark) (search-forward (concat "{" env) (point-end-of-line) t) (replace-match (concat "{" newenv) t))) - t))) -) + t)))) (defun YaTeX-change-section () "Change section-type command." @@ -2061,8 +2105,7 @@ (goto-char beg) (insert-before-markers new) ;;(goto-char (marker-position p)) - new)) -) + new))) (defun YaTeX-change-fontsize () "Change large-type command." @@ -2091,8 +2134,7 @@ (insert-before-markers new) new) (t nil) - ))) -) + )))) (defun YaTeX-change-math-image () "Change with image completion." @@ -2118,8 +2160,7 @@ ((YaTeX-on-section-command-p YaTeX-command-token-regexp);on any command (YaTeX-kill-section-command (match-beginning 0) arg)) ((YaTeX-kill-paren arg)) - (t (message "I don't know what to kill."))) -) + (t (message "I don't know what to kill.")))) (defun YaTeX-change-* () "Parse current line and call suitable function." @@ -2129,8 +2170,8 @@ ((YaTeX-change-section)) ((YaTeX-change-fontsize)) ((YaTeX-change-math-image)) - (t (message "I don't know what to change."))) -) + ((YaTeX-change-parentheses)) + (t (message "I don't know what to change.")))) ;;; ;Check availability of add-in functions @@ -2147,8 +2188,8 @@ (fboundp (intern-soft (concat YaTeX-addin-prefix name)))) (let ((s (funcall (intern (concat YaTeX-addin-prefix name))))) (if (stringp s) s "")) - "") ;Add in function is not bound. -) + "")) ;Add in function is not bound. + (defun YaTeX-on-item-p (&optional point) "Return t if POINT (default is (point)) is on \\item." @@ -2158,8 +2199,7 @@ (end-of-line) (setq p (point)) (re-search-backward YaTeX-paragraph-delimiter nil t) - (re-search-forward YaTeX-item-regexp p t))) -) + (re-search-forward YaTeX-item-regexp p t)))) (defun YaTeX-in-verb-p (&optional point) "Check if POINT is in verb or verb*. Default of POINT is (point)." @@ -2175,8 +2215,7 @@ (goto-char (match-end 2)) (skip-chars-forward (concat "^" (buffer-substring (match-beginning 2) (match-end 2)))) - (and (< (match-beginning 2) point) (< (1- point) (point))))) -) + (and (< (match-beginning 2) point) (< (1- point) (point)))))) (defun YaTeX-literal-p (&optional point) "Check if POINT is in verb or verb* or verbatime environment family. @@ -2187,8 +2226,7 @@ (and point (goto-char point)) (or (YaTeX-in-verb-p (point)) (and (not (looking-at "\\\\end{verb")) - (YaTeX-quick-in-environment-p YaTeX-verbatim-environments)))))) -) + (YaTeX-quick-in-environment-p YaTeX-verbatim-environments))))))) (defun YaTeX-in-environment-p (env) "Return if current LaTeX environment is ENV. @@ -2220,8 +2258,7 @@ (and (cdr env) (YaTeX-in-environment-p (cdr env))))))) (store-match-data md) p;(or p (YaTeX-in-verb-p (match-beginning 0))) - ) -) + )) (defun YaTeX-quick-in-environment-p (env) "Check quickly but unsure if current environment is ENV. @@ -2242,8 +2279,7 @@ YaTeX-struct-end env) YaTeX-comment-prefix p t nil)))) (store-match-data md) - rc)))) -) + rc))))) ;; Filling \item (defun YaTeX-remove-trailing-comment (start end) @@ -2253,8 +2289,7 @@ (goto-char start) (while (re-search-forward trcom end t) (if (/= (char-after (1- (match-beginning 0))) ?\\ ) - (replace-match "\\1"))))) -) + (replace-match "\\1")))))) (defun YaTeX-get-item-info (&optional recent thisenv) "Return the list of the beginning of \\item and column of its item. @@ -2281,8 +2316,7 @@ (if (equal (following-char) ?\[) (forward-list 1)) (setq c 0)) (skip-chars-forward " \t" (point-end-of-line)) - (list (point-beginning-of-line) (+ c (current-column))))))) -) + (list (point-beginning-of-line) (+ c (current-column)))))))) (defun YaTeX-fill-item () "Fill item in itemize environment." @@ -2334,8 +2368,7 @@ (if NTT-jTeX (while (progn(forward-line -1)(end-of-line) (> (point) start)) (insert ?%))) - (pop-mark))))) -) + (pop-mark)))))) (defun YaTeX-fill-paragraph (arg) "YaTeX adjustment function for fill-paragraph. @@ -2410,8 +2443,7 @@ (forward-line 1)) (goto-char p) (if (looking-at "%") (delete-char 1)) ;remove last inserted `%' - ))))))) -) + )))))))) (if (fboundp 'YaTeX-saved-indent-new-comment-line) nil (fset 'YaTeX-saved-indent-new-comment-line @@ -2421,6 +2453,7 @@ (defun YaTeX-indent-new-comment-line (&optional soft) "Tuned `indent-new-comment-line' function for yatex. See the documentation of `YaTeX-saved-indent-new-comment-line'." + (interactive) (cond ((or (not (memq major-mode '(yatex-mode yahtml-mode))) (string-match @@ -2435,16 +2468,14 @@ ((and (eq major-mode 'yatex-mode) ;1997/2/4 (YaTeX-in-math-mode-p)) nil) ;1996/12/30 (t (let (fill-prefix) - (apply 'YaTeX-saved-indent-new-comment-line (if soft (list soft)))))) -) + (apply 'YaTeX-saved-indent-new-comment-line (if soft (list soft))))))) (defun YaTeX-fill-* () "Fill paragraph according to its condition." (interactive) (cond ((YaTeX-fill-item)) - ) -) + )) ;; Accent completion (defun YaTeX-read-accent-char (x) @@ -2454,8 +2485,7 @@ (if (and (or (= c ?i) (= c ?j)) (not (string-match (regexp-quote x) "cdb"))) "\\" "") - (char-to-string c))) -) + (char-to-string c)))) (defun YaTeX-make-accent () "Make accent usage." @@ -2471,8 +2501,7 @@ (backward-char 1) (insert (YaTeX-read-accent-char c)) (if (string= c "t") (insert (YaTeX-read-accent-char c))) - (forward-char 1))) -) + (forward-char 1)))) ;; Indentation (defun YaTeX-current-indentation () @@ -2484,8 +2513,7 @@ (forward-line -1) (beginning-of-line) (skip-chars-forward " \t")) - (current-column)) -) + (current-column))) (defun YaTeX-previous-line-indentation () (save-excursion @@ -2612,8 +2640,7 @@ (save-excursion (backward-word 1) (looking-at "\\sw+")) ;is not japanese string - (insert YaTeX-comment-prefix)))))) -) + (insert YaTeX-comment-prefix))))))) (provide 'yatex) (defvar yatex-mode-load-hook nil diff --git a/yatex.new b/yatex.new index a9caf69..e98fe6f 100644 --- a/yatex.new +++ b/yatex.new @@ -1,6 +1,33 @@ - What's new in YaTeX + What's new in YaTeX/yahtml �쒹/yahtml - �e�o�[�W�����̕ύX�_�ɂ��� +1.67 [[[ http://www.yatex.org/ ���a�����܂��� ]]] + === yahtml === + href���͂�SPC�Ȃǂ�unsafe-char��%�G���R�[�h�ɒu�����邩�� + yahtml-escape-chars �őI�ׂ�悤�ɂ����Bnil�Ȃ炵�Ȃ��At�Ȃ��ɁA + 'ask �Ȃ�m�F����B�f�t�H���g�� 'ask�B + ����href���͎��� yahtml-urls ��⊮���ɓ���ĂȂ������̂��C���B + [prefix] ; �Ń��W�������� <>'"& ���G���e�B�e�B�Q�Ƃɕϊ��A + [prefix] : �ŋt�ϊ�����@�\��lj��B + yahtml-translate-hyphens-when-comment-region �� non-nil �̂Ƃ��� + �̈�R�����g�A�E�g�� - �� - �ɕϊ��B + yahtml-prefer-upcase-attributes �� non-nil �̂Ƃ���������啶���ɁB + �J�����g�܂��͏�ʃf�B���N�g���� .htaccess �t�@�C�������肻�̒��� + AddType "text/html; charset=XXXX" .html + �錾������ΕҏW����HTML�\�[�X�̊����R�[�h�����̐錾�ɍ��킹��B +
} �����ꂽ��K�� @code{
} �����ė~�������B@code{^\(body\|dl\)} +@end defvar + +@defvar yahtml-template-file +�V�KHTML�t�@�C���쐬���Ɏ����I�ɑ}�����ė~�����t�@�C�����B +@file{"~/http/template.html"} +@end defvar + +@defvar yahtml-prefer-upcases +�^�O�ɑ啶�����g�������B@code{nil} +@end defvar + +@defvar yahtml-prefer-upcase-attributes +�����w��q�ɑ啶�����g�������B@code{nil} +@end defvar + +@defvar yahtml-server-type +Apache�n�̃T�[�o�𗘗p���Ă���ꍇ�� 'apache ���Z�b�g����B +./.htaccess ���Q�Ƃ��邩�ǂ��������肷��B@code{'apache} +@end defvar + +@defvar yahtml-apache-access-file +@code{yahtml-server-type} �� @code{'apache} �̂Ƃ��� +�A�N�Z�X�����t�@�C�������w��B@file{".htaccess"} +@end defvar + +@defvar yahtml-shell-command-option +�V�F���ŕʃR�}���h���N������Ƃ��̃I�v�V�����B +@end defvar + +@defvar yahtml-translate-hyphens-when-comment-region +�̈�R�����g�A�E�g������Ƃ��Ɋ��ɑ��݂���n�C�t���� @code{-} �� +�ύX���邩�ǂ����B(@code{t}) +@end defvar + +@defvar yahtml-entity-reference-chars-alist +�G���e�B�e�B�Q��(Entity Reference)�ŋL�q���ׂ������Q�� + @code{'(?���� . "�G���e�B�e�B�\�L")} �Ƃ����`������� +alist�ŕ��ׂ�B�f�t�H���g�� @code{<}, @code{>}, @code{&}, @code{'}, +@code{"} �ɑ���alist���ݒ肳��Ă���̂ŁA�lj����������������L�q����Η� +���Bcdr�� @code{"�G���e�B�e�B�\�L"} �́A�擪�� @code{&} �� ������@code{;} +�͊܂߂��ɏ����B +@end defvar + +@defvar yahtml-faithful-to-htmllint +�\���`�F�b�J�Ƃ��� htmllint �𗘗p����ꍇ������Ƃ����]�v�ȋȂǂ� +���Ă��x���������̂ŁA������������Ƃ��ɂ͂��̕ϐ���@code{t}�� +����B +@end defvar + + +@node Hook variables, , All customizable variables, Customizations +@comment node-name, next, previous, up +@section hook�ϐ� + + +@node Copying, Concept Index, Customizations, Top +@comment node-name, next, previous, up +@chapter ��舵�� + + �{�v���O�����̓t���[�\�t�g�E�F�A�ł��B�{�v���O�������g�p���Đ����������� +�錋�ʂɑ��Ă���҂͐ӔC��Ȃ����ƂƂ��܂��B�]�ړ��Ɋւ��Ă͐������� +���܂���B�펯�I�Ɉ����Ă��������B�܂��A�g�p���Ă���|�����C���ł��m�点�� +�������ƁA��҂͊��ŃT�|�[�g�ɗ�ނ��Ƃł��傤�B + + ���A��]�A�o�O�A���z���͊��}�������܂��B +�A���� gentei.org �܂�(1999�N7������)�B +�p���I�Ɏg�p���Ă���������̓��C�����O���X�g�ufj�쒹�̉�v�� +����������Ă��������B�������@�ɂ��Ă͖{�p�b�P�[�W�� @file{docs/yahtmlqa} +�t�@�C���́u���̑��v�̏͂��䗗���������B + +�d�l�́A�\���Ȃ��m����(�C�������)�ύX����܂�:-p�B + +@flushright +�L���Y�� +@end flushright + + +@node Concept Index, , Copying, Top +@comment node-name, next, previous, up +@unnumbered ���� +@printindex cp + + +@contents + +@bye + +@c Local Variables: +@c fill-column: 74 +@c fill-prefix: nil +@c End: + +Tag table: + +End tag table diff --git a/docs/yatex.ref b/docs/yatex.ref index c2871b4..17ced41 100644 --- a/docs/yatex.ref +++ b/docs/yatex.ref @@ -159,8 +159,7 @@ ���C���N���[�h�\���u���E�Y [prefix] d �L���Y�� - yuuji@ae.keio.ac.jp - pcs39334@asciinet.or.jp + yuuji@gentei.org Local variables: mode: text diff --git a/docs/yatexadd.doc b/docs/yatexadd.doc index 012a413..4bd51cf 100644 --- a/docs/yatexadd.doc +++ b/docs/yatexadd.doc @@ -169,5 +169,5 @@ �v���܂��B - �L���Y�� - yuuji@ae.keio.ac.jp + �L���Y�� + yuuji@gentei.org diff --git a/docs/yatexe.tex b/docs/yatexe.tex index 012b7c6..cb51c73 100644 --- a/docs/yatexe.tex +++ b/docs/yatexe.tex @@ -14,7 +14,7 @@ @subtitle Yet Another tex-mode for emacs @title Wild Bird @subtitle // YaTeX // -@author @copyright{} 1991-1996 by HIROSE, Yuuji [yuuji@@ae.keio.ac.jp] +@author @copyright{} 1991-1996 by HIROSE, Yuuji [yuuji@@gentei.org] @end titlepage @node Top, What is YaTeX?, (dir), (dir) @@ -2018,7 +2018,7 @@ short descriptions on useful functions, where [F] means function, [A] means arguments, [D] means description. -@itemize +@table @kbd @item [F] YaTeX:read-position @itemx [A] @@ -2047,7 +2047,7 @@ Check the current completion type is specified one and cause error if not. The variable @code{YaTeX-current-completion-type} holds the symbol according to the current completion type. -@end itemize +@end table @node Contribution, , Useful functions for creating add-in, Add-in functions @comment node-name, next, previous, up @@ -2271,8 +2271,8 @@ redistribute this software freely but with NO warranty to anything as a result of using this software. However, any reports and suggestions are welcome as long as I feel interests in this -software. My possible e-mail address is `yuuji@@ae.keio.ac.jp'. -(up to Mar.1995 at least) And there is mailing list for YaTeX. +software. My possible e-mail address is `yuuji@@gentei.org'. +(up to May.1999 at least) And there is mailing list for YaTeX. Although the common language is Japanese, questions in English will be welcome. To join the ML, send the mail whose subject is `append' to the address `yatex-control@@jaist.ac.jp'. If you have some diff --git a/docs/yatexgen.doc b/docs/yatexgen.doc index a871140..b94c936 100644 --- a/docs/yatexgen.doc +++ b/docs/yatexgen.doc @@ -175,5 +175,5 @@ ��A�K�����ɐZ�邾���ɂ��āA�����ĕM�҂܂ő������肵�Ȃ��ʼn������B yatexgen ��������A�낭�Ȋ�����Ȃ����Ƃ͕������Ă܂�:-p�B - �L���Y�� - yuuji@ae.keio.ac.jp + �L���Y�� + yuuji@gentei.org diff --git a/docs/yatexj.tex b/docs/yatexj.tex index 44170e2..faf4486 100644 --- a/docs/yatexj.tex +++ b/docs/yatexj.tex @@ -6,6 +6,7 @@ @iftex @c @syncodeindex fn cp @c �����Y���̂ł����ɏ����Ƃ����B +@c C-l C-c n �Ńm�[�h���� @c �m�[�h���������� C-l C-u C-n �S���̃m�[�h�X�V C-l C-u C-e @c ���j���[���₵���� C-l C-u C-m �S���̃��j���[�X�V C-l C-u C-a @c �t�H�[�}�b�g����Ƃ��� C-l C-e C-b @@ -18,7 +19,7 @@ @subtitle Yet Another tex-mode for emacs @title �w�쒹�x @subtitle // YaTeX // -@author @copyright{} 1991-1997 by HIROSE, Yuuji [yuuji@@ae.keio.ac.jp] +@author @copyright{} 1991-1999 by HIROSE, Yuuji [yuuji@@gentei.org] @end titlepage @node Top, Intro, (dir), (dir) @@ -2112,8 +2113,7 @@ �������ƁA��҂͊��ŃT�|�[�g�ɗ�ނ��Ƃł��傤�B ���A��]�A�o�O�A���z���͊��}�������܂��B -�A���� yuuji@@ae.keio.ac.jp �܂��́A -pcs39334@@asciinet.or.jp �܂�(1995�N3������)�B +�A���� yuuji@@gentei.org �܂�(1999�N5������)�B �p���I�Ɏg�p���Ă���������̓��C�����O���X�g�ufj�쒹�̉�v�� ����������Ă��������B�������@�ɂ��Ă͖{�p�b�P�[�W�� @file{docs/qanda} �t�@�C���́u���̑��v�̏͂��䗗���������B diff --git a/docs/yatexref.eng b/docs/yatexref.eng index dc593db..e0d91bf 100644 --- a/docs/yatexref.eng +++ b/docs/yatexref.eng @@ -154,9 +154,8 @@ *Browse included structure [prefix] d - HIROSE Yuuji - yuuji@ae.keio.ac.jp - pcs39334@asciinet.or.jp + HIROSE Yuuji + yuuji@gentei.org Local variables: mode: text diff --git a/help/YATEXHLP.jp b/help/YATEXHLP.jp index 613d254..58eddc0 100644 --- a/help/YATEXHLP.jp +++ b/help/YATEXHLP.jp @@ -1297,12 +1297,12 @@ ����܂����B���N��\�Z�B�ނɂ́A�쒹�����łȂ�������|�������� ���̃\�t�g�E�F�A����铮�@�A�Z���X���ӂ��R�����g�Ȃǂ��܂� ���B���݂̖쒹���F�l�Ɏx�������悤�Ɍ��₩�Ɉ�����͔̂ނ̂��� - ���ƌ����Ă��ߌ��ł͂���܂���B�쒹/����/�������g���Ƃ��ɔނ̈� - �炩�Ȗ�������Ƌ��ɋF���ĉ������B + ���ƌ����Ă��ߌ��ł͂���܂���B�쒹/����/����/���g���Ƃ��� + �ނ̈��炩�Ȗ�������Ƌ��ɋF���ĉ������B ��˂�������(asciinet) �肢�t�������ł��B - http://www.comp.ae.keio.ac.jp/~yuuji/lune/astrology/ + http://www.gentei.org/~yuuji/lune/astrology/ �O���P�Y����(�c���) �J�����ʂ̓��͎��̏����̃��[�h�����̃A�C�f�A���܂����B @@ -1370,6 +1370,7 @@ YaTeX-insert-amper ��contribute���Ē����܂����B ��҂̐������̖}�~�X�J�ɏE���ĉ������܂����B YaTeX-shift-section-undo �̎������@�������Ă��������܂����B + Wz�ւ̈ڐA�� HackTeX ���쐬����܂����B �����\����(�c���) �l�X�g���������itemize���ł�indentation�̕s����w�E���Ē��� @@ -1428,6 +1429,9 @@ �������[�h�ł̃Z�N�V�����^�}�N���Ή��̗v�]�Ƒ����ׂ��}�N���ꗗ�� �����܂����B +���c�Ύ�����(��t��) + AMS LaTeX�p�̂������̊��AYaTeX-change-parentheses �Ȃǂ��쐬 + ���Ē����܂����B yatex (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist)) diff --git a/yahtml.el b/yahtml.el index a41c45c..c7087cf 100644 --- a/yahtml.el +++ b/yahtml.el @@ -1,9 +1,7 @@ ;;; -*- Emacs-Lisp -*- -;;; (c ) 1994-1997 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] -;;; Last modified Mon Oct 26 19:57:36 1998 on firestorm +;;; (c ) 1994-1999 by HIROSE Yuuji [yuuji@gentei.org] +;;; Last modified Wed Jul 14 18:01:18 1999 on firestorm ;;; $Id$ -(defconst yahtml-revision-number "1.65.5" - "Revision number of running yatex.el") ;;;[Installation] ;;; @@ -77,6 +75,12 @@ ;;; is "netscape") ;;; * [prefix] a YaTeX's accent mark's equivalent of yahtml. ;;; This function can input $lt, $gt or so. +;;; * [prefix] ; Translate chars of `>', `<', `&', and `"' to +;;; `>', `<', `&', `"' respectively +;;; in the region. +;;; * [prefix] : Do translation opposite to above, in the region. +;;; * [prefix] # Translate unsafe-chars and unreserved-chars to +;;; URLencoded string in the region. ;;; ;;;[�L�[�̐���] ;;; @@ -126,6 +130,11 @@ ;;; ����Ƃ����|�����o���܂�) ;;; * [prefix] a YaTeX �̃A�N�Z���g�L���⊮�Ɠ����ł��B ;;; < > �������͂ł��܂��B +;;; * [prefix] ; �w�肵�����W�������� > < & " �����ꂼ�� +;;; > < & " �ɕϊ����܂��B +;;; * [prefix] : �w�肵�����W�������ŏ�Ƌt�̕ϊ������܂��B +;;; * [prefix] # �w�肵�����W��������%�G���R�[�h�̕K�v�ȕ����� +;;; ����������G���R�[�h���܂��B ;;; ;;; [�ӎ�] ;;; @@ -150,9 +159,14 @@ "*WWW Browser command") (defvar yahtml-kanji-code 2 "*Kanji coding system number of html file; 1=sjis, 2=jis, 3=euc") -(defvar yahtml-coding-system - (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist)) - "Kanji coding system") +;;(defvar yahtml-coding-system +;; (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist)) +;; "Kanji coding system") +(and (featurep 'mule) + (integerp yahtml-kanji-code) + (setq yahtml-kanji-code + (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist)))) + (defvar yahtml-fill-column 72 "*fill culumn used for yahtml-mode") (defvar yahtml-fill-prefix nil "*fill prefix for yahtml-mode") @@ -186,6 +200,20 @@ (defvar yahtml-template-file "~/http/template.html" "*Template HTML file. It'll be inserted to empty file.") +(defvar yahtml-prefer-upcases nil + "*Non-nil for preferring upcase TAGs") + +(defvar yahtml-prefer-upcase-attributes nil + "*Non-nil for preferring upcase attributes") + +(defvar yahtml-server-type 'apache + "*WWW server program type") + +(defvar yahtml-apache-access-file ".htaccess" + "*Server access file name for apache") + +(defvar yahtml-use-css t "*Use stylesheet or not") + ;;; --- customizable variable ends here --- (defvar yahtml-prefix-map nil) (defvar yahtml-mode-map nil "Keymap used in yahtml-mode.") @@ -216,7 +244,6 @@ (yahtml-define-begend-region-key (concat (upcase (substring key 0 1)) (substring key 1)) env map))) - (if yahtml-mode-map nil (setq yahtml-mode-map (make-sparse-keymap) yahtml-prefix-map (make-sparse-keymap)) @@ -279,6 +306,9 @@ (YaTeX-define-key "t" 'yahtml-browse-menu map) (YaTeX-define-key "a" 'yahtml-complete-mark map) (YaTeX-define-key "'" 'yahtml-prev-error map) + (YaTeX-define-key ";" 'yahtml-translate-region map) + (YaTeX-define-key ":" 'yahtml-translate-reverse-region map) + (YaTeX-define-key "#" 'yahtml-escape-chars-region map) ;;;;;(YaTeX-define-key "i" 'yahtml-fill-item map) )) @@ -310,7 +340,7 @@ ;;; Completion tables for `form' (defvar yahtml-form-table - '(("img") ("input"))) + '(("img") ("input") ("link") ("meta"))) (defvar yahtml-user-form-table nil) (defvar yahtml-tmp-form-table nil) (defvar yahtml-last-form "img") @@ -322,14 +352,16 @@ ("UnorderedList" . "ul") ("DefinitionList" . "dl") ("Preformatted" . "pre") - ("table") ("tr") ("th") ("td") + ("table") ("thead") ("tbody") ("tfoot") ("caption") ("tr") ("th") ("td") + ("address") ("h1") ("h2") ("h3") ("h4") ("h5") ("h6") ;; ("p") ;This makes indentation screwed up! + ("style") ("div") )) -(defvar yahtml-itemizing-regexp - "\\(ul\\|ul\\|dl\\)" - "Regexp of itemizing forms") +;(defvar yahtml-itemizing-regexp +; "\\(ul\\|ol\\|dl\\)" +; "Regexp of itemizing forms") (defvar yahtml-user-env-table nil) (defvar yahtml-tmp-env-table nil) @@ -342,7 +374,8 @@ (defvar yahtml-typeface-table (append '(("dfn") ("em") ("cite") ("code") ("kbd") ("samp") ("strike") - ("strong") ("var") ("b") ("i") ("tt") ("u") ("address") ("font")) + ("strong") ("var") ("b") ("i") ("tt") ("u") ("big") ("small") ("font") + ("sup") ("sub") ("span")) yahtml-env-table) "Default completion table of typeface designator") (defvar yahtml-user-typeface-table nil) @@ -364,8 +397,6 @@ (defvar yahtml-tmp-single-cmd-table nil) (defvar yahtml-last-single-cmd nil) -(defvar yahtml-prefer-upcases nil) - ;(defvar yahtml-struct-name-regexp ; "\\<\\(h[1-6]\\|[uod]l\\|html\\|body\\|title\\|head\\|table\\|t[rhd]\\|pre\\|a\\|form\\|select\\|center\\|blockquote\\)\\b") (defvar yahtml-struct-name-regexp @@ -377,23 +408,65 @@ (or (assoc "p" yahtml-env-table) (setq yahtml-env-table (cons '("p") yahtml-env-table))) +(defun yahtml-dir-default-charset () + (cond + ((and (eq yahtml-server-type 'apache) ;;check .htaccess + buffer-file-name) + (let ((dir default-directory) + charset af ext (ldir "") + (case-fold-search t) + (uid (car (cdr (cdr (file-attributes ".")))))) + (setq ext (file-name-nondirectory buffer-file-name) + ext (substring ext (string-match "\\.[a-z0-9]+$" ext))) + (if (string-match "^[A-Z]:" dir) + (setq dir (substring dir 2))) ;remove drive letter + (while (and dir + (not (string= dir ldir)) + (equal uid (car (cdr (cdr (file-attributes dir)))))) + (setq af (expand-file-name yahtml-apache-access-file dir)) + (if (file-exists-p af) + (save-excursion + (set-buffer (find-file-noselect af)) + (save-excursion + (goto-char (point-min)) + (if (re-search-forward ;search the charset for same extension + (format "^\\s *AddType.*charset=\\(.*\\)\\%s$" ext) + nil t) + (progn + (setq charset + (buffer-substring + (match-beginning 1) (match-end 1))) + (cond + ((string-match "iso-2022-jp" charset) + (setq charset 2)) + ((string-match "euc-jp" charset) + (setq charset 3)) + ((string-match "shift_jis" charset) + (setq charset 1)) + (t (setq charset nil))) + (setq dir "")))) + (kill-buffer (current-buffer)))) + (setq ldir dir + dir (substring dir 0 (string-match "/$" dir)) + dir (file-name-directory dir))) + (if (featurep 'mule) + (setq charset (cdr (assq charset YaTeX-kanji-code-alist)))) + charset + )) + (t nil)) + ) + (defun yahtml-mode () (interactive) - (cond - ((and YaTeX-emacs-20 (fboundp 'coding-system-equal)) - (let ((mp (buffer-modified-p)) - (ud (memq buffer-file-coding-system - '(undecided undecided-unix undecided-dos undecided-mac)))) - (if (coding-system-equal - yahtml-coding-system buffer-file-coding-system) - nil ; if coding-system is the same, do nothing - (set-buffer-file-coding-system yahtml-coding-system) - (if ud (set-buffer-modified-p mp))))) - ((featurep 'mule) - (set-file-coding-system yahtml-coding-system)) - ((boundp 'NEMACS) - (make-local-variable 'kanji-fileio-code) - (setq kanji-fileio-code yahtml-kanji-code))) + (let ((coding (or (yahtml-dir-default-charset) yahtml-kanji-code))) + (cond + ((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system)) + (setq buffer-file-coding-system coding)) + ((featurep 'mule) + (set-file-coding-system coding)) + ((boundp 'NEMACS) + (make-local-variable 'kanji-fileio-code) + (setq kanji-fileio-code coding)))) (setq major-mode 'yahtml-mode mode-name "yahtml") (mapcar @@ -408,7 +481,7 @@ (YaTeX-struct-end . "%1>") (YaTeX-struct-name-regexp . yahtml-struct-name-regexp) (YaTeX-comment-prefix . "" comment) ;; include&exec - ("" include) + ("" include) ;; string (hilit-string-find ?\\ string) (yahtml-hilit-region-tag "\\(em\\|strong\\)" bold) diff --git a/yatex.el b/yatex.el index 523becf..b0e7311 100644 --- a/yatex.el +++ b/yatex.el @@ -1,9 +1,11 @@ ;;; -*- Emacs-Lisp -*- -;;; Yet Another tex-mode for emacs. -;;; yatex.el rev. 1.66 -;;; (c )1991-1998 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Mon Oct 26 21:05:14 1998 on firestorm +;;; Yet Another tex-mode for emacs - //�쒹// +;;; yatex.el rev. 1.67 +;;; (c )1991-1999 by HIROSE Yuuji.[yuuji@gentei.org] +;;; Last modified Tue Jul 13 14:20:45 1999 on firestorm ;;; $Id$ +;;; The latest version of this software is always available at; +;;; http://www.yatex.org/ ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -22,35 +24,35 @@ (require 'comment) (require 'yatexlib) -(defconst YaTeX-revision-number "1.66" - "Revision number of running yatex.el" -) +(defconst YaTeX-revision-number "1.67" + "Revision number of running yatex.el") + ;---------- Local variables ---------- (defvar YaTeX-prefix "\C-c" "*Prefix key to call YaTeX functions. -You can select favorite prefix key by setq in your ~/.emacs." -) +You can select favorite prefix key by setq in your ~/.emacs.") + (defvar YaTeX-environment-indent 1 - "*Indentation depth at column width in LaTeX environments." -) + "*Indentation depth at column width in LaTeX environments.") + (defvar YaTeX-fill-prefix nil "*fill-prefix used for auto-fill-mode. -The default value is nil." -) +The default value is nil.") + (defvar YaTeX-fill-column 72 - "*fill-column used for auto-fill-mode." -) + "*fill-column used for auto-fill-mode.") + (defvar YaTeX-comment-prefix "%" - "TeX comment prefix." -) + "TeX comment prefix.") + (defvar YaTeX-current-position-register ?3 "*Position register to keep where the last completion was done. All of YaTeX completing input store the current position into the register YaTeX-current-position-register. So every time you make a trip to any other part of text other than you are writing, you can return to the editing paragraph by calling register-to-point with argument -YaTeX-current-position-register." -) +YaTeX-current-position-register.") + ;;(defvar YaTeX-tmp-dic-unit 'main-file ;; "*Default switching unit of temporary dictionary. ;;There are two switching unit: @@ -58,20 +60,20 @@ ;;'directory : switch tmp-dic dir by dir." ;;) (defvar tex-command (if YaTeX-japan "jlatex" "latex") - "*Default command for typesetting LaTeX text." -) + "*Default command for typesetting LaTeX text.") + (defvar bibtex-command (if YaTeX-japan "jbibtex" "bibtex") - "*Default command of BibTeX." -) + "*Default command of BibTeX.") + (defvar dvi2-command ;previewer command for your site (if YaTeX-dos "dviout -wait=0" "xdvi -geo +0+0 -s 4") "*Default previewer command including its option. -This default value is for X window system." -) +This default value is for X window system.") + (defvar makeindex-command (if YaTeX-dos "makeind" "makeindex") - "*Default makeindex command." -) + "*Default makeindex command.") + (defvar dviprint-command-format (if YaTeX-dos "dviprt %s %f%t" "dvi2ps %f %t %s | lpr") @@ -79,31 +81,31 @@ Format string %s will be replaced by the filename. Do not forget to specify the `from usage' and `to usage' with their option by format string %f and %t. - See also documentation of dviprint-from-format and dviprint-to-format." -) + See also documentation of dviprint-from-format and dviprint-to-format.") + (defvar dviprint-from-format (if YaTeX-dos "%b-" "-f %b") - "*`From' page format of dvi filter. %b will turn to beginning page number." -) + "*`From' page format of dvi filter. %b will turn to beginning page number.") + (defvar dviprint-to-format (if YaTeX-dos "%e" "-t %e") - "*`To' page format of dvi filter. %e will turn to end page number." -) + "*`To' page format of dvi filter. %e will turn to end page number.") + (defvar YaTeX-default-document-style (concat (if YaTeX-japan "j") "article") - "*Default LaTeX Documentstyle for YaTeX-typeset-region." -) + "*Default LaTeX Documentstyle for YaTeX-typeset-region.") + (defvar YaTeX-need-nonstop nil - "*T for adding `\\nonstopmode{}' to text before invoking latex command." -) + "*T for adding `\\nonstopmode{}' to text before invoking latex command.") + (defvar latex-warning-regexp "line.* [0-9]*" - "*Regular expression of line number of warning message by latex command." -) + "*Regular expression of line number of warning message by latex command.") + (defvar latex-error-regexp "l\\.[1-9][0-9]*" "*Regular expression of line number of latex error. Perhaps your latex command stops at this error message with line number of -LaTeX source text." -) +LaTeX source text.") + (defvar latex-dos-emergency-message "Emergency stop" ;<- for Micro tex, ASCII-pTeX 1.6 "Message pattern of emergency stop of typesetting. @@ -113,12 +115,12 @@ other process, user or OS. Define to this variable a message string of your latex command on DOS shown at abnormal termination. Remember Demacs's call-process function is not oriented for interactive -process." -) +process.") + (defvar latex-message-kanji-code 2 "*Kanji coding system latex command types out. -1 = Shift JIS, 2 = JIS, 3 = EUC." -) +1 = Shift JIS, 2 = JIS, 3 = EUC.") + (defvar NTT-jTeX nil "*T for using NTT-jTeX for latex command. More precisely, setting t to this variables inhibits inter-word break on @@ -126,16 +128,16 @@ put % after each line at filling. ���s+�C���f���g�ɂ���āA�^�C�v�Z�b�g��̎��Ԃ��Ă��܂��̂�}������ꍇ�� t�ɂ���(�Â�NTT-jTeX�Ō����Ɍ����)�B��̓I�ɂ́Afill����Ƃ��Ɋe�s�̏I���� -%��t������B" -) +%��t������B") + (defvar YaTeX-item-regexp (concat (regexp-quote "\\") "\\(sub\\|bib\\)*item") - "*Regular expression of item command." -) + "*Regular expression of item command.") + (defvar YaTeX-sectioning-regexp - "part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\(\\*?\\|\\b\\)" - "*LaTeX sectioning commands regexp." -) + "\\(part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\)\\(\\*\\|\\b\\)" + "*LaTeX sectioning commands regexp.") + (defvar YaTeX-paragraph-start (concat "^[ \t]*%\\|^[ \t]*$\\|\\'\\|^\C-l\\|\\\\\\\\$\\|^[ \t]*\\\\\\(" YaTeX-sectioning-regexp ;sectioning commands @@ -143,8 +145,8 @@ "\\|newpage\\b\\|vspace\\b" "\\)") "*Paragraph starting regexp of common LaTeX source. Use this value -for YaTeX-uncomment-paragraph." -) +for YaTeX-uncomment-paragraph.") + (defvar YaTeX-paragraph-separate (concat "^[ \t]*%\\|^[ \t]*$\\|^\C-l\\|\\\\\\\\$\\|^[ \t]*\\\\\\(" YaTeX-sectioning-regexp ;sectioning commands @@ -153,8 +155,8 @@ "\\|newpage\\b\\|vspace\\b" "\\)") "*Paragraph delimiter regexp of common LaTeX source. Use this value -for YaTeX-uncomment-paragraph." -) +for YaTeX-uncomment-paragraph.") + (defvar YaTeX-verbatim-environments '("verbatim" "verbatim*") "*Assume these environments of this variable disable LaTeX commands.") @@ -162,11 +164,11 @@ "*Regexp of verb family. Do not contain preceding \\\\ nor \\(\\).") (defvar YaTeX-fill-inhibit-environments (append '("tabular" "tabular*" "array" "picture" "eqnarray" "eqnarray*" - "equation" "math" "displaymath") + "equation" "equation*" "math" "displaymath") YaTeX-verbatim-environments) "*In these environments, YaTeX inhibits fill-paragraph from formatting. -Define those environments as a form of list." -) +Define those environments as a form of list.") + (defvar YaTeX-itemizing-env-regexp "itemize\\|enumerate\\|description\\|list\\|thebibliography" "*Regexp of itemizing environments") @@ -176,51 +178,52 @@ (defvar YaTeX-array-env-regexp (concat "array\\*?\\|eqnarray\\*?\\|tabbing\\|tabular\\*?\\|" ;LaTeX + "matrix\\|pmatrix\\|bmatrix\\|vmatrix\\|Vmatrix\\|" ;AMS-LaTeX "align\\*?\\|split\\*?\\|aligned\\*?\\|alignat\\*?\\|" ;AMS-LaTeX "[bpvV]?matrix\\|smallmatrix\\|cases\\|" ;AMS-LaTeX "xalignat\\*?\\|xxalignat\\*?") ;AMS-LaTeX "*Regexp of environments where `&' becomes field delimiter.") (defvar YaTeX-uncomment-once t "*T for removing all continuous commenting character(%). -Nil for removing only one commenting character at the beginning-of-line." -) +Nil for removing only one commenting character at the beginning-of-line.") + (defvar YaTeX-close-paren-always t - "Close parenthesis always when YaTeX-modify-mode is nil." -) + "*Close parenthesis always when YaTeX-modify-mode is nil.") + (defvar YaTeX-greek-by-maketitle-completion nil - "*T for greek letters completion by maketitle-type completion." -) + "*T for greek letters completion by maketitle-type completion.") + (defvar YaTeX-auto-math-mode t "*T for changing YaTeX-math mode automatically.") (defvar YaTeX-use-AMS-LaTeX nil - "*T for using AMS-LaTeX" -) + "*T for using AMS-LaTeX") + (defvar yatex-mode-hook nil - "*List of functions to be called at the end of yatex-mode initializations." -) + "*List of functions to be called at the end of yatex-mode initializations.") + ;;-- Math mode values -- (defvar YaTeX-math-key-list-default '((";" . YaTeX-math-sign-alist) (":" . YaTeX-greek-key-alist)) - "Default key sequence to invoke math-mode's image completion." -) + "Default key sequence to invoke math-mode's image completion.") + (defvar YaTeX-math-key-list-private nil - "*User defined alist, math-mode-prefix vs completion alist." -) + "*User defined alist, math-mode-prefix vs completion alist.") + (defvar YaTeX-math-key-list (append YaTeX-math-key-list-private YaTeX-math-key-list-default) - "Key sequence to invoke math-mode's image completion." -) + "Key sequence to invoke math-mode's image completion.") + (defvar YaTeX-skip-default-reader nil - "Non-nil skips default argument reader of section-type completion." -) + "Non-nil skips default argument reader of section-type completion.") + (defvar YaTeX-simple-messages nil - "Non-nil makes minibuffer messages simpler." -) + "Non-nil makes minibuffer messages simpler.") + (defvar YaTeX-template-file "~/work/template.tex" - "*Template TeX source file. This will be inserted to empty file." -) + "*Template TeX source file. This will be inserted to empty file.") + (defvar YaTeX-addin-prefix "YaTeX:") ;------------ Completion table ------------ ; Set tex-section-like command possible completion @@ -245,8 +248,8 @@ ;; section types in mathmode ("frac" 2) ("sqrt") ("mathrm") ("mathbf") ("mathit") ) - "Default completion table for section-type completion." -) + "Default completion table for section-type completion.") + (defvar user-section-table nil) (defvar tmp-section-table nil) @@ -260,8 +263,8 @@ ("thebibliography") ("theindex") ("flushleft") ("flushright") ("minipage") ) - "Default completion table for begin-type completion." -) + "Default completion table for begin-type completion.") + (defvar user-env-table nil) (defvar tmp-env-table nil) @@ -272,8 +275,8 @@ ("tiny") ("scriptsize") ("footnotesize") ("small")("normalsize") ("large") ("Large") ("LARGE") ("huge") ("Huge") ) - "Default completion table for large-type completion." -) + "Default completion table for large-type completion.") + (defvar user-fontsize-table nil) (defvar tmp-fontsize-table nil) @@ -296,8 +299,8 @@ ("upsilon") ("phi") ("varphi") ("chi") ("psi") ("omega") ("Gamma") ("Delta") ("Theta") ("Lambda")("Xi") ("Pi") ("Sigma") ("Upsilon") ("Phi") ("Psi") ("Omega")))) - "Default completion table for maketitle-type completion." -) + "Default completion table for maketitle-type completion.") + (defvar user-singlecmd-table nil) (defvar tmp-singlecmd-table nil) @@ -307,24 +310,23 @@ ;; Do not change this section. ;;; (defvar YaTeX-mode-map nil - "Keymap used in YaTeX mode" -) + "Keymap used in YaTeX mode") + (defvar YaTeX-prefix-map nil - "Keymap used when YaTeX-prefix key pushed" -) + "Keymap used when YaTeX-prefix key pushed") + (defvar YaTeX-user-extensional-map (make-sparse-keymap) "*Keymap used for the user's customization") (defvar YaTeX-current-completion-type nil - "Has current completion type. This may be used in YaTeX addin functions." -) + "Has current completion type. This may be used in YaTeX addin functions.") + (defvar YaTeX-modify-mode nil "*Current editing mode. When non-nil, each opening parentheses only opens, -nil enters both open/close parentheses when opening parentheses key pressed." -) +nil enters both open/close parentheses when opening parentheses key pressed.") + (defvar YaTeX-math-mode nil - "Holds whether current mode is math-mode." -) + "Holds whether current mode is math-mode.") ;;; ;; Define key table ;;; @@ -336,6 +338,7 @@ (define-key YaTeX-mode-map "{" 'YaTeX-insert-braces) (define-key YaTeX-mode-map "(" 'YaTeX-insert-parens) (define-key YaTeX-mode-map "$" 'YaTeX-insert-dollar) + (define-key YaTeX-mode-map "|" 'YaTeX-insert-bar) (define-key YaTeX-mode-map "&" 'YaTeX-insert-amper) (define-key YaTeX-mode-map "[" 'YaTeX-insert-brackets) (define-key YaTeX-mode-map YaTeX-prefix YaTeX-prefix-map) @@ -419,8 +422,7 @@ (function (lambda (key) (define-key YaTeX-mode-map (car key) 'YaTeX-math-insert-sequence))) - YaTeX-math-key-list) -) + YaTeX-math-key-list)) (defvar YaTeX-section-completion-map nil "*Key map used at YaTeX completion in the minibuffer.") @@ -448,8 +450,8 @@ (defvar fontsize-name "large" "*Initial fontsize completion") (defvar single-command "maketitle" "*Initial LaTeX single command") (defvar YaTeX-kanji-code (if YaTeX-dos 1 2) - "*File kanji code used by Japanese TeX." -) + "*File kanji code used by Japanese TeX.") + (defvar YaTeX-coding-system nil "File coding system used by Japanese TeX.") (cond (YaTeX-emacs-20 @@ -469,8 +471,7 @@ (setq YaTeX-mode-syntax-table (make-syntax-table (standard-syntax-table))) (modify-syntax-entry ?\n " " YaTeX-mode-syntax-table) (modify-syntax-entry ?\{ "(}" YaTeX-mode-syntax-table) - (modify-syntax-entry ?\} "){" YaTeX-mode-syntax-table) -) + (modify-syntax-entry ?\} "){" YaTeX-mode-syntax-table)) ;---------- Provide YaTeX-mode ---------- ;;; @@ -549,19 +550,11 @@ )) (cond ((boundp 'MULE) (set-file-coding-system YaTeX-coding-system)) - ((and YaTeX-emacs-20 (fboundp 'coding-system-equal)) - (let ((mp (buffer-modified-p)) - (ud (memq - buffer-file-coding-system - '(undecided undecided-unix undecided-dos undecided-mac)))) - (if (coding-system-equal - YaTeX-coding-system buffer-file-coding-system) - nil ; if coding-system is the same, do nothing - (set-buffer-file-coding-system YaTeX-coding-system) - (if ud (set-buffer-modified-p mp))))) + ((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system)) + (setq buffer-file-coding-system YaTeX-coding-system)) ((featurep 'mule) (set-file-coding-system YaTeX-coding-system)) - ((boundp 'NEMACS) + ((boundp 'NEMACS) (make-local-variable 'kanji-fileio-code) (setq kanji-fileio-code YaTeX-kanji-code))) (setq fill-column YaTeX-fill-column @@ -582,8 +575,7 @@ (and (= 0 (buffer-size)) (file-exists-p YaTeX-template-file) (y-or-n-p (format "Insert %s?" YaTeX-template-file)) (insert-file-contents (expand-file-name YaTeX-template-file))) - (run-hooks 'text-mode-hook 'yatex-mode-hook) -) + (run-hooks 'text-mode-hook 'yatex-mode-hook)) ;---------- Define YaTeX-mode functions ---------- (defvar YaTeX-ec "\\" "Escape character of current mark-up language.") @@ -625,6 +617,12 @@ (autoload 'YaTeX-in-math-mode-p "yatexmth" "Check if in math-env." t) (autoload 'YaTeX-toggle-math-mode "yatexmth" "YaTeX math-mode interfaces." t) (autoload 'YaTeX-math-member-p "yatexmth" "Check if a word is math command." t) +(autoload 'YaTeX-insert-amsparens-region "yatexmth" "AMS parens region" t) +(autoload 'YaTeX-insert-amsbraces-region "yatexmth" "AMS braces region" t) +(autoload 'YaTeX-insert-amsbrackets-region "yatexmth" "AMS brackets region" t) +(autoload 'YaTeX-on-parenthesis-p "yatexmth" "Check if on math-parens" t) +(autoload 'YaTeX-goto-open-paren "yatexmth" "Goto opening paren" t) +(autoload 'YaTeX-change-parentheses "yatexmth" "Change corresponding parens" t) ;;autoload from yatexhlp.el (autoload 'YaTeX-help "yatexhlp" "YaTeX helper with LaTeX commands." t) @@ -635,6 +633,7 @@ (autoload 'YaTeX-generate-simple "yatexgen" "YaTeX add-in support." t) ;;autoload from yatexsec.el +(autoload 'YaTeX-section-overview "yatexsec" "YaTeX sectioning(view)" t) (autoload 'YaTeX-read-section-in-minibuffer "yatexsec" "YaTeX sectioning" t) (autoload 'YaTeX-make-section-with-overview "yatexsec" "YaTeX sectioning" t) @@ -704,8 +703,7 @@ (YaTeX-intelligent-newline nil) (YaTeX-indent-line)) (if YaTeX-current-position-register - (point-to-register YaTeX-current-position-register))) -) + (point-to-register YaTeX-current-position-register)))) (defun YaTeX-make-begin-end (arg) "Make LaTeX environment command of \\begin{env.} ... \\end{env.} @@ -724,14 +722,12 @@ (setq env-name env) (YaTeX-update-table (list env-name) 'env-table 'user-env-table 'tmp-env-table) - (YaTeX-insert-begin-end env-name arg)) -) + (YaTeX-insert-begin-end env-name arg))) (defun YaTeX-make-begin-end-region () "Call YaTeX-make-begin-end with ARG to specify region mode." (interactive) - (YaTeX-make-begin-end t) -) + (YaTeX-make-begin-end t)) (defun YaTeX-make-section (arg &optional beg end cmd) "Make LaTeX \\section{} type command with completing read. @@ -813,14 +809,12 @@ (forward-char -1)) (while (string= (buffer-substring (- (point) 3) (1- (point))) "{}") (forward-char -2))) - (if (<= (minibuffer-depth) 0) (use-global-map global-map))) -) + (if (<= (minibuffer-depth) 0) (use-global-map global-map)))) (defun YaTeX-make-section-region (args beg end) "Call YaTeX-make-section with arguments to specify region mode." (interactive "P\nr") - (YaTeX-make-section args beg end) -) + (YaTeX-make-section args beg end)) (defun YaTeX-make-fontsize (arg &optional fontsize) "Make completion like {\\large ...} or {\\slant ...} in minibuffer. @@ -856,14 +850,12 @@ (if YaTeX-current-position-register (point-to-register YaTeX-current-position-register)) (save-excursion - (insert (YaTeX-addin fontsize-name) "}")))) -) + (insert (YaTeX-addin fontsize-name) "}"))))) (defun YaTeX-make-fontsize-region () "Call function:YaTeX-make-fontsize with ARG to specify region mode." (interactive) - (YaTeX-make-fontsize t) -) + (YaTeX-make-fontsize t)) (defvar YaTeX-singlecmd-suffix "" "*Suffix for maketitle-type commands.") (defvar YaTeX-read-singlecmd-history nil "Holds maketitle-type history.") @@ -895,8 +887,7 @@ (forward-char -2) (if (looking-at "\\[\\]") (forward-char 1) (goto-char q))) (if YaTeX-current-position-register - (point-to-register YaTeX-current-position-register)) -) + (point-to-register YaTeX-current-position-register))) (defvar YaTeX-completion-begin-regexp "[{\\]" "Regular expression of limit where LaTeX command's completion begins.") @@ -957,8 +948,7 @@ (message "Making completion list...") (with-output-to-temp-buffer "*Help*" (display-completion-list - (all-completions pattern all-table)))))))))) -) + (all-completions pattern all-table))))))))))) (defun YaTeX-toggle-modify-mode (&optional arg) (interactive "P") @@ -971,8 +961,7 @@ (message "Modify mode")) (setq YaTeX-modify-mode nil) (message "Cancel modify mode.")) - (set-buffer-modified-p (buffer-modified-p)) ;redraw mode-line -) + (set-buffer-modified-p (buffer-modified-p))) ;redraw mode-line (defun YaTeX-switch-mode-menu (arg &optional char) (interactive "P") @@ -983,8 +972,7 @@ ((or (= c ?$) (= c ?t)) (if YaTeX-auto-math-mode (message "Makes no sense in YaTeX-auto-math-mode.") - (YaTeX-toggle-math-mode arg))))) -) + (YaTeX-toggle-math-mode arg)))))) (defun YaTeX-insert-quote () (interactive) @@ -1001,8 +989,7 @@ (regexp-quote (char-to-string (preceding-char))) "�A�B�C�D�H�I�u�v�w�x�y�z()")) "``") - (t "''"))) -) + (t "''")))) (defun YaTeX-closable-p () (and (not YaTeX-modify-mode) @@ -1014,7 +1001,7 @@ ;; (and (not YaTeX-close-paren-always) (not (eolp))) ;; (input-pending-p) ;; (YaTeX-quick-in-environment-p "verbatim")) -) + ) (defun YaTeX-insert-braces-region (beg end &optional open close) (interactive "r") @@ -1022,8 +1009,7 @@ (goto-char end) (insert (or close "}")) (goto-char beg) - (insert (or open "{"))) -) + (insert (or open "{")))) (defun YaTeX-insert-braces (arg &optional open close) (interactive "p") @@ -1037,6 +1023,24 @@ (looking-at "\\\\left\\\\")) (insert "{\\right\\}") (forward-char -8)) + ((save-excursion ;from matsu@math.s.chiba-u.ac.jp + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]igl\\\\")) + (insert + (concat + "{" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\}")) + (forward-char -7)) + ((save-excursion + (and (> (- (point) (point-min)) 7) + (condition-case () (forward-char -7) (error nil))) + (looking-at "\\\\[bB]iggl\\\\")) + (insert + (concat + "{" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\}")) + (forward-char -8)) + ((= (preceding-char) ?\\ ) + (insert "{\\}") + (forward-char -2)) ;matsu's hack ends here ((and (> (point) (+ (point-min) 4)) (save-excursion (backward-char 4) (looking-at "\\\\end")) (not (YaTeX-literal-p)) @@ -1057,13 +1061,11 @@ (if (and (eq (char-after (point)) ?\}) (eq (char-after (- (point) 2)) ?\\ )) (progn (insert "\\") (forward-char -1))) - ))) -) + )))) (defun YaTeX-jmode () (or (and (boundp 'canna:*japanese-mode*) canna:*japanese-mode*) - (and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*)) -) + (and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*))) (defun YaTeX-jmode-off () (cond @@ -1072,9 +1074,11 @@ ((and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*) (egg:toggle-egg-mode-on-off)) ((and (fboundp 'skk-mode) (boundp 'skk-mode) skk-mode) - (if (fboundp 'skk-mode-off) (skk-mode-off) (j-mode-off))) - ((and (fboundp 'fep-force-off) (fep-force-off)))) -) + (cond + ((fboundp 'skk-latin-mode) (skk-latin-mode t)) + ((fboundp 'skk-mode-off) (skk-mode-off)) + (t (j-mode-off)))) + ((and (fboundp 'fep-force-off) (fep-force-off))))) (defun YaTeX-self-insert (arg) (call-interactively (global-key-binding (char-to-string last-command-char)))) @@ -1092,6 +1096,20 @@ (looking-at "\\\\left")) (insert "[\\right]") (forward-char -7)) + ((save-excursion ;from matsu@math.s.chiba-u.ac.jp + (and (> (- (point) (point-min)) 5) (forward-char -5)) + (looking-at "\\\\[bB]igl")) + (insert + (concat + "[" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r]")) + (forward-char -6)) + ((save-excursion + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]iggl")) + (insert + (concat + "[" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r]")) + (forward-char -7)) ;matsu's hack ends here ((and (= (preceding-char) ?\\ ) (/= (char-after (- (point) 2)) ?\\ ) (not (YaTeX-in-math-mode-p))) @@ -1106,14 +1124,11 @@ ((YaTeX-closable-p) (insert "[]") (backward-char 1)) - (t (YaTeX-self-insert arg))) - ) -) + (t (YaTeX-self-insert arg))))) (defun YaTeX-insert-brackets-region (beg end) (interactive "r") - (YaTeX-insert-braces-region beg end "[" "]") -) + (YaTeX-insert-braces-region beg end "[" "]")) (defun YaTeX-insert-parens (arg) "Insert parenthesis pair." @@ -1126,19 +1141,85 @@ (looking-at "\\\\left")) (insert "(\\right)") (forward-char -7)) - ((and (= (preceding-char) ?\\ ) (not (YaTeX-in-math-mode-p))) + ((save-excursion ;from matsu@math.s.chiba-u.ac.jp + (and (> (- (point) (point-min)) 5) (forward-char -5)) + (looking-at "\\\\[bB]igl")) + (insert + (concat + "(" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r)")) + (forward-char -6)) + ((save-excursion + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]iggl")) + (insert + (concat + "(" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r)")) + (forward-char -7)) + ((= (preceding-char) ?\\ ) ;matsu's hack ends here (insert "(\\)") (backward-char 2)) ((YaTeX-closable-p) (insert "()") (backward-char 1)) - (t (YaTeX-self-insert arg))) -) + (t (YaTeX-self-insert arg)))) (defun YaTeX-insert-parens-region (beg end) (interactive "r") - (YaTeX-insert-braces-region beg end "(" ")") -) + (YaTeX-insert-braces-region beg end "(" ")")) + +(defun YaTeX-insert-bar (arg) + "Insert bar pair." + (interactive "p") + (cond + ((YaTeX-jmode) (YaTeX-self-insert arg)) + ((not (YaTeX-closable-p)) (YaTeX-self-insert arg)) + ((save-excursion + (and (> (- (point) (point-min)) 5) (forward-char -5)) + (looking-at "\\\\left")) + (insert "|\\right|") + (forward-char -7)) + ((save-excursion ;from matsu@math.s.chiba-u.ac.jp + (and (> (- (point) (point-min)) 5) (forward-char -5)) + (looking-at "\\\\[bB]igl")) + (insert + (concat + "|" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r|")) + (forward-char -6)) + ((save-excursion + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]iggl")) + (insert + (concat + "|" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r|")) + (forward-char -7)) + ((save-excursion ; added by Jin + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\left\\\\")) + (insert "|\\right\\|") + (forward-char -8)) + ((save-excursion + (and (> (- (point) (point-min)) 6) (forward-char -6)) + (looking-at "\\\\[bB]igl\\\\")) + (insert + (concat + "|" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\|")) + (forward-char -7)) + ((save-excursion + (and (> (- (point) (point-min)) 7) (forward-char -7)) + (looking-at "\\\\[bB]iggl\\\\")) + (insert + (concat + "|" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\|")) + (forward-char -8)) ; added by Jin up to here. + ((= (preceding-char) ?\\ ) + (insert "|\\|") + (backward-char 2)) +; ((and (YaTeX-closable-p) +; (/= (preceding-char) ?|) +; (/= (following-char) ?|)) +; (insert "||") +; (backward-char 1)) + (t (YaTeX-self-insert arg)))) (defun YaTeX-insert-dollar () (interactive) @@ -1150,13 +1231,11 @@ (insert "$$") (forward-char -1) (YaTeX-jmode-off) - (or YaTeX-auto-math-mode YaTeX-math-mode (YaTeX-toggle-math-mode 1))) -) + (or YaTeX-auto-math-mode YaTeX-math-mode (YaTeX-toggle-math-mode 1)))) (defun YaTeX-insert-dollars-region (beg end) (interactive "r") - (YaTeX-insert-braces-region beg end "$" "$") -) + (YaTeX-insert-braces-region beg end "$" "$")) (defun YaTeX-insert-amper () (interactive) @@ -1165,8 +1244,7 @@ (= (preceding-char) 92) (YaTeX-literal-p)) (insert "&") - (insert "\\&")) -) + (insert "\\&"))) (defun YaTeX-version () "Return string of the version of running YaTeX." @@ -1175,8 +1253,7 @@ (concat "Yet Another tex-mode " (if YaTeX-japan "�u�쒹�v" "`Wild Bird'") " Revision " - YaTeX-revision-number)) -) + YaTeX-revision-number))) (defun YaTeX-typeset-menu (arg &optional char) "Typeset, preview, visit error and miscellaneous convenient menu. @@ -1205,8 +1282,7 @@ ((= c ?l) (YaTeX-lpr arg)) ((= c ?m) (YaTeX-switch-mode-menu arg)) ((= c ?b) (YaTeX-insert-string "\\")) - ((= c ?s) (YaTeX-xdvi-remote-search arg)))) -) + ((= c ?s) (YaTeX-xdvi-remote-search arg))))) (defun YaTeX-%-menu (&optional beg end char) "Operate %# notation." @@ -1248,8 +1324,7 @@ (insert "%#END\n") (set-marker b nil) (set-marker e nil)) - ))) -) + )))) (defun YaTeX-goto-corresponding-label (reverse &optional otherwin) "Jump to corresponding \\label{} and \\ref{} or \\cite and \\bibitem. @@ -1342,8 +1417,7 @@ (setq regexp-search-ring (cons string (delete string regexp-search-ring))) (setq search-last-regexp string))) - (t nil))) -) + (t nil)))) (defun YaTeX-goto-corresponding-environment (&optional allow-mismatch noerr) "Go to corresponding begin/end enclosure. @@ -1406,8 +1480,7 @@ (if noerr 'message 'error) "Corresponding environment `%s' not found." env) (sit-for 1) - nil))))) -) + nil)))))) (defun YaTeX-goto-corresponding-file (&optional other) "Visit or switch buffer of corresponding file, @@ -1429,8 +1502,7 @@ (t (YaTeX-switch-to-buffer input-file))) (or (YaTeX-get-builtin "!") YaTeX-parent-file - (setq YaTeX-parent-file parent)))) -) + (setq YaTeX-parent-file parent))))) (defun YaTeX-goto-corresponding-BEGIN-END () (if (not (YaTeX-on-BEGIN-END-p)) nil @@ -1441,8 +1513,7 @@ (not (search-backward "%#BEGIN" nil t)))) (error "Corresponding %%#BEGIN/END not found.")) (beginning-of-line) - t) -) + t)) (defvar YaTeX-processed-file-regexp-alist nil "Alist of regexp of processed file regexp vs. its file name part; @@ -1479,13 +1550,12 @@ ("\\\\\\(psbox\\)\\(\\[[^]]+\\]\\)?{\\(\\([^,} ]*/\\)?[^} ]+\\)\\(\\.e?ps\\)}" 3) ;\psbox[options...]{hoge.eps} (97/1/11) ("\\\\input{\\([^} ]+\\)\\(\\.tps\\)}" 1) ;tgif2tex (1998/9/16) ) - "See the documentation of YaTeX-processed-file-regexp-alist." -) + "See the documentation of YaTeX-processed-file-regexp-alist.") (defvar YaTeX-file-processor-alist nil "*Alist of files' processor vs. its extension; -See also the documentation of YaTeX-processed-file-regexp-alist." -) +See also the documentation of YaTeX-processed-file-regexp-alist.") + (defvar YaTeX-file-processor-alist-default '(("tgif" . ".obj") ("ghostview" . ".ps") @@ -1493,8 +1563,7 @@ (t . ".tex") (t . ".sty") (t . "")) - "See the documentation of YaTeX-file-processor-alist." -) + "See the documentation of YaTeX-file-processor-alist.") (defun YaTeX-goto-corresponding-file-processor (&optional other) "Execute corresponding file processor." @@ -1558,8 +1627,7 @@ (cond ((symbol-function cmd) (funcall cmd src other))) - t))))))) -) + t)))))))) (defun YaTeX-on-section-command-p (command) "Check if point is on the LaTeX command: COMMAND(regexp). @@ -1606,8 +1674,7 @@ (>= p (match-beginning i)) (< p (match-end i))) -1 ;return -1 if point is on optional arg (if (< p (point)) parg)) - )))) -) + ))))) (defun YaTeX-on-maketitle-p () "Check if point is on maketitle type commands. @@ -1636,15 +1703,13 @@ (YaTeX-replace-format-args (regexp-quote YaTeX-struct-end) (concat "\\(" YaTeX-struct-name-regexp "\\)") "" "" "")) - (point-end-of-line) t)) -) + (point-end-of-line) t))) (defun YaTeX-on-includes-p () (save-excursion (beginning-of-line) (re-search-forward "\\(\\(include.*\\)\\|\\(input\\)\\){.*}" - (point-end-of-line) t)) -) + (point-end-of-line) t))) (defun YaTeX-on-comment-p (&optional sw) "Return t if current line is commented out. @@ -1653,15 +1718,14 @@ (save-excursion (beginning-of-line) (skip-chars-forward "\\s ") - (looking-at (if sw "%" "%[^#]"))) -) + (looking-at (if sw "%" "%[^#]")))) (defun YaTeX-on-BEGIN-END-p () (save-excursion (let ((case-fold-search nil)) (beginning-of-line) - (re-search-forward "\\(%#BEGIN\\)\\|\\(%#END\\)" (point-end-of-line) t))) -) + (re-search-forward + "\\(%#BEGIN\\)\\|\\(%#END\\)" (point-end-of-line) t)))) (defun YaTeX-goto-corresponding-* (arg) "Parse current line and call suitable function." @@ -1676,8 +1740,7 @@ YaTeX-equation-env-regexp ;to delay loading (or (YaTeX-inner-environment t) "document")) (YaTeX-goto-corresponding-leftright))) - (t (message "I don't know where to go."))) -) + (t (message "I don't know where to go.")))) (defun YaTeX-goto-corresponding-*-other-window (arg) "Parse current line and call suitable function." @@ -1687,8 +1750,7 @@ ;;((YaTeX-goto-corresponding-environment)) ((YaTeX-goto-corresponding-file t)) ;;((YaTeX-goto-corresponding-BEGIN-END)) - (t (message "I don't know where to go."))) -) + (t (message "I don't know where to go.")))) (defun YaTeX-comment-region (alt-prefix) "Comment out region by '%'. @@ -1700,8 +1762,7 @@ (if alt-prefix (read-string "Insert prefix: ") YaTeX-comment-prefix)) - (YaTeX-comment-uncomment-env 'comment-out-region)) -) + (YaTeX-comment-uncomment-env 'comment-out-region))) (defun YaTeX-uncomment-region (alt-prefix) "Uncomment out region by '%'." @@ -1711,8 +1772,7 @@ (if alt-prefix (read-string "Remove prefix: ") YaTeX-comment-prefix) (region-beginning) (region-end) YaTeX-uncomment-once) - (YaTeX-comment-uncomment-env 'uncomment-region)) -) + (YaTeX-comment-uncomment-env 'uncomment-region))) (defun YaTeX-comment-uncomment-env (func) "Comment or uncomment out one LaTeX environment switching function by FUNC." @@ -1725,8 +1785,7 @@ (if (> p (point)) (setq beg (1+ beg)) (forward-char 1)) (funcall func YaTeX-comment-prefix beg (point) YaTeX-uncomment-once))) (message "%sommented out current environment." - (if (eq func 'comment-out-region) "C" "Un-c")) -) + (if (eq func 'comment-out-region) "C" "Un-c"))) (defun YaTeX-beginning-of-environment (&optional limit-search-bound end) "Goto the beginning of the current environment. @@ -1740,16 +1799,14 @@ (goto-char (get 'YaTeX-inner-environment 'point)) (and end (YaTeX-goto-corresponding-environment)) (if (interactive-p) (push-mark op)) - t))) -) + t)))) (defun YaTeX-end-of-environment (&optional limit-search-bound) "Goto the end of the current environment. Optional argument LIMIT-SEARCH-BOUND non-nil limits the search bound to most recent sectioning command." (interactive) - (YaTeX-beginning-of-environment limit-search-bound t) -) + (YaTeX-beginning-of-environment limit-search-bound t)) (defun YaTeX-mark-environment () "Mark current position and move point to end of environment." @@ -1773,8 +1830,7 @@ (set-mark-command nil) (YaTeX-goto-corresponding-environment) (end-of-line) - (if (eobp) nil (forward-char 1)))) -) + (if (eobp) nil (forward-char 1))))) (defun YaTeX-comment-paragraph () "Comment out current paragraph." @@ -1792,8 +1848,7 @@ (t (mark-paragraph) (if (looking-at paragraph-separate) (forward-line 1)) - (comment-out-region "%")))) -) + (comment-out-region "%"))))) (defun YaTeX-uncomment-paragraph () "Uncomment current paragraph." @@ -1816,8 +1871,7 @@ (mark-paragraph) (if (not (bobp)) (forward-line 1)) (uncomment-region "%" nil nil YaTeX-uncomment-once)) - (message "This line is not a comment line.")))) -) + (message "This line is not a comment line."))))) (defun YaTeX-remove-prefix (prefix &optional once) "Remove prefix on current line as far as prefix detected. But @@ -1826,8 +1880,7 @@ (beginning-of-line) (while (re-search-forward (concat "^" prefix) (point-end-of-line) t) (replace-match "") - (if once (end-of-line))) -) + (if once (end-of-line)))) (defun YaTeX-kill-some-pairs (predicate gofunc kill-contents) "Kill some matching pair. @@ -1878,8 +1931,7 @@ (kill-region (if (bolp) (point) b1) e2))) - t)) -) + t))) (defun YaTeX-kill-section-command (point kill-all) "Kill section-type command at POINT leaving its argument. @@ -1902,8 +1954,7 @@ (goto-char end) (set-marker end nil) (kill-append (buffer-substring (point) (1- (point))) nil) - (delete-backward-char 1)))) -) + (delete-backward-char 1))))) (defun YaTeX-kill-paren (kill-contents) "Kill parentheses leaving its contents. @@ -1927,8 +1978,7 @@ (point) (progn (re-search-forward "\\s +" nil t) (point))) (delete-char 1))) - t)))) -) + t))))) (defvar YaTeX-read-environment-history nil "Holds history of environments.") (put 'YaTeX-read-environment-history 'no-default t) @@ -1939,8 +1989,7 @@ prompt (append tmp-env-table user-env-table env-table) predicate must-match initial - 'YaTeX-read-environment-history) -) + 'YaTeX-read-environment-history)) (defvar YaTeX-read-section-history nil "Holds history of section-types.") (put 'YaTeX-read-section-history 'no-default t) @@ -1951,8 +2000,7 @@ (append tmp-section-table user-section-table section-table))) (read-from-minibuffer-with-history prompt initial YaTeX-section-completion-map nil - 'YaTeX-read-section-history)) -) + 'YaTeX-read-section-history))) (defun YaTeX-read-section-with-overview () "Read sectioning command with overview. @@ -1974,9 +2022,7 @@ (if (eq (selected-window) (minibuffer-window)) (erase-buffer)) (insert sect) - (exit-minibuffer) - ) -) + (exit-minibuffer))) (defvar YaTeX-read-fontsize-history nil "Holds history of font designator.") (put 'YaTeX-read-fontsize-history 'no-default t) @@ -1985,8 +2031,7 @@ (YaTeX-sync-local-table 'tmp-fontsize-table) (completing-read-with-history prompt (append tmp-fontsize-table user-fontsize-table fontsize-table) - predicate must-match initial 'YaTeX-read-fontsize-history) -) + predicate must-match initial 'YaTeX-read-fontsize-history)) (defun YaTeX-change-environment () "Change the name of environment." @@ -2010,8 +2055,7 @@ (exchange-point-and-mark) (search-forward (concat "{" env) (point-end-of-line) t) (replace-match (concat "{" newenv) t))) - t))) -) + t)))) (defun YaTeX-change-section () "Change section-type command." @@ -2061,8 +2105,7 @@ (goto-char beg) (insert-before-markers new) ;;(goto-char (marker-position p)) - new)) -) + new))) (defun YaTeX-change-fontsize () "Change large-type command." @@ -2091,8 +2134,7 @@ (insert-before-markers new) new) (t nil) - ))) -) + )))) (defun YaTeX-change-math-image () "Change with image completion." @@ -2118,8 +2160,7 @@ ((YaTeX-on-section-command-p YaTeX-command-token-regexp);on any command (YaTeX-kill-section-command (match-beginning 0) arg)) ((YaTeX-kill-paren arg)) - (t (message "I don't know what to kill."))) -) + (t (message "I don't know what to kill.")))) (defun YaTeX-change-* () "Parse current line and call suitable function." @@ -2129,8 +2170,8 @@ ((YaTeX-change-section)) ((YaTeX-change-fontsize)) ((YaTeX-change-math-image)) - (t (message "I don't know what to change."))) -) + ((YaTeX-change-parentheses)) + (t (message "I don't know what to change.")))) ;;; ;Check availability of add-in functions @@ -2147,8 +2188,8 @@ (fboundp (intern-soft (concat YaTeX-addin-prefix name)))) (let ((s (funcall (intern (concat YaTeX-addin-prefix name))))) (if (stringp s) s "")) - "") ;Add in function is not bound. -) + "")) ;Add in function is not bound. + (defun YaTeX-on-item-p (&optional point) "Return t if POINT (default is (point)) is on \\item." @@ -2158,8 +2199,7 @@ (end-of-line) (setq p (point)) (re-search-backward YaTeX-paragraph-delimiter nil t) - (re-search-forward YaTeX-item-regexp p t))) -) + (re-search-forward YaTeX-item-regexp p t)))) (defun YaTeX-in-verb-p (&optional point) "Check if POINT is in verb or verb*. Default of POINT is (point)." @@ -2175,8 +2215,7 @@ (goto-char (match-end 2)) (skip-chars-forward (concat "^" (buffer-substring (match-beginning 2) (match-end 2)))) - (and (< (match-beginning 2) point) (< (1- point) (point))))) -) + (and (< (match-beginning 2) point) (< (1- point) (point)))))) (defun YaTeX-literal-p (&optional point) "Check if POINT is in verb or verb* or verbatime environment family. @@ -2187,8 +2226,7 @@ (and point (goto-char point)) (or (YaTeX-in-verb-p (point)) (and (not (looking-at "\\\\end{verb")) - (YaTeX-quick-in-environment-p YaTeX-verbatim-environments)))))) -) + (YaTeX-quick-in-environment-p YaTeX-verbatim-environments))))))) (defun YaTeX-in-environment-p (env) "Return if current LaTeX environment is ENV. @@ -2220,8 +2258,7 @@ (and (cdr env) (YaTeX-in-environment-p (cdr env))))))) (store-match-data md) p;(or p (YaTeX-in-verb-p (match-beginning 0))) - ) -) + )) (defun YaTeX-quick-in-environment-p (env) "Check quickly but unsure if current environment is ENV. @@ -2242,8 +2279,7 @@ YaTeX-struct-end env) YaTeX-comment-prefix p t nil)))) (store-match-data md) - rc)))) -) + rc))))) ;; Filling \item (defun YaTeX-remove-trailing-comment (start end) @@ -2253,8 +2289,7 @@ (goto-char start) (while (re-search-forward trcom end t) (if (/= (char-after (1- (match-beginning 0))) ?\\ ) - (replace-match "\\1"))))) -) + (replace-match "\\1")))))) (defun YaTeX-get-item-info (&optional recent thisenv) "Return the list of the beginning of \\item and column of its item. @@ -2281,8 +2316,7 @@ (if (equal (following-char) ?\[) (forward-list 1)) (setq c 0)) (skip-chars-forward " \t" (point-end-of-line)) - (list (point-beginning-of-line) (+ c (current-column))))))) -) + (list (point-beginning-of-line) (+ c (current-column)))))))) (defun YaTeX-fill-item () "Fill item in itemize environment." @@ -2334,8 +2368,7 @@ (if NTT-jTeX (while (progn(forward-line -1)(end-of-line) (> (point) start)) (insert ?%))) - (pop-mark))))) -) + (pop-mark)))))) (defun YaTeX-fill-paragraph (arg) "YaTeX adjustment function for fill-paragraph. @@ -2410,8 +2443,7 @@ (forward-line 1)) (goto-char p) (if (looking-at "%") (delete-char 1)) ;remove last inserted `%' - ))))))) -) + )))))))) (if (fboundp 'YaTeX-saved-indent-new-comment-line) nil (fset 'YaTeX-saved-indent-new-comment-line @@ -2421,6 +2453,7 @@ (defun YaTeX-indent-new-comment-line (&optional soft) "Tuned `indent-new-comment-line' function for yatex. See the documentation of `YaTeX-saved-indent-new-comment-line'." + (interactive) (cond ((or (not (memq major-mode '(yatex-mode yahtml-mode))) (string-match @@ -2435,16 +2468,14 @@ ((and (eq major-mode 'yatex-mode) ;1997/2/4 (YaTeX-in-math-mode-p)) nil) ;1996/12/30 (t (let (fill-prefix) - (apply 'YaTeX-saved-indent-new-comment-line (if soft (list soft)))))) -) + (apply 'YaTeX-saved-indent-new-comment-line (if soft (list soft))))))) (defun YaTeX-fill-* () "Fill paragraph according to its condition." (interactive) (cond ((YaTeX-fill-item)) - ) -) + )) ;; Accent completion (defun YaTeX-read-accent-char (x) @@ -2454,8 +2485,7 @@ (if (and (or (= c ?i) (= c ?j)) (not (string-match (regexp-quote x) "cdb"))) "\\" "") - (char-to-string c))) -) + (char-to-string c)))) (defun YaTeX-make-accent () "Make accent usage." @@ -2471,8 +2501,7 @@ (backward-char 1) (insert (YaTeX-read-accent-char c)) (if (string= c "t") (insert (YaTeX-read-accent-char c))) - (forward-char 1))) -) + (forward-char 1)))) ;; Indentation (defun YaTeX-current-indentation () @@ -2484,8 +2513,7 @@ (forward-line -1) (beginning-of-line) (skip-chars-forward " \t")) - (current-column)) -) + (current-column))) (defun YaTeX-previous-line-indentation () (save-excursion @@ -2612,8 +2640,7 @@ (save-excursion (backward-word 1) (looking-at "\\sw+")) ;is not japanese string - (insert YaTeX-comment-prefix)))))) -) + (insert YaTeX-comment-prefix))))))) (provide 'yatex) (defvar yatex-mode-load-hook nil diff --git a/yatex.new b/yatex.new index a9caf69..e98fe6f 100644 --- a/yatex.new +++ b/yatex.new @@ -1,6 +1,33 @@ - What's new in YaTeX + What's new in YaTeX/yahtml �쒹/yahtml - �e�o�[�W�����̕ύX�_�ɂ��� +1.67 [[[ http://www.yatex.org/ ���a�����܂��� ]]] + === yahtml === + href���͂�SPC�Ȃǂ�unsafe-char��%�G���R�[�h�ɒu�����邩�� + yahtml-escape-chars �őI�ׂ�悤�ɂ����Bnil�Ȃ炵�Ȃ��At�Ȃ��ɁA + 'ask �Ȃ�m�F����B�f�t�H���g�� 'ask�B + ����href���͎��� yahtml-urls ��⊮���ɓ���ĂȂ������̂��C���B + [prefix] ; �Ń��W�������� <>'"& ���G���e�B�e�B�Q�Ƃɕϊ��A + [prefix] : �ŋt�ϊ�����@�\��lj��B + yahtml-translate-hyphens-when-comment-region �� non-nil �̂Ƃ��� + �̈�R�����g�A�E�g�� - �� - �ɕϊ��B + yahtml-prefer-upcase-attributes �� non-nil �̂Ƃ���������啶���ɁB + �J�����g�܂��͏�ʃf�B���N�g���� .htaccess �t�@�C�������肻�̒��� + AddType "text/html; charset=XXXX" .html + �錾������ΕҏW����HTML�\�[�X�̊����R�[�h�����̐錾�ɍ��킹��B +