diff --git a/docs/yatex.ref b/docs/yatex.ref index 7e1ea18..ee681b7 100644 --- a/docs/yatex.ref +++ b/docs/yatex.ref @@ -117,7 +117,8 @@ ��item�̌����� [prefix] i - \item ���g���‹����̂ݗL���ł��B + \item ���g���‹����̂ݗL���ł��B\item �̍��ڑS�̂��n���O�C���f + ���g���܂��B ��LaTeX�R�}���h�ύX [prefix] c @@ -152,6 +153,9 @@ �u���܂������s�v�� tabular, array, itemize, enumerate, list, description �‹��ŗL���ł��B + + ���C���N���[�h�\���u���E�Y [prefix] d + �L���Y�� yuuji@ae.keio.ac.jp pcs39334@asciinet.or.jp diff --git a/docs/yatexe.tex b/docs/yatexe.tex index 0c6fcbc..6149cfe 100644 --- a/docs/yatexe.tex +++ b/docs/yatexe.tex @@ -36,10 +36,11 @@ * Cursor jump:: Jumping to related position * Changing and Deleting:: Changing/deleting certain unit of text * Filling:: Filling an item or paragraph -* Updation of @code{\includeonly}:: Maintaining @code{\includeonly} -* What column?:: Column position guide in tabular +* Updation of includeonly:: Free from maintaining includeonly +* What column?:: Guidance to tabular column * Intelligent newline:: Guess requisites of new line * Online help:: On-line documentation of LaTeX +* Browsing file hierarchy:: Walking through file hierarchy * Cooperation with other packages:: Work well with gmhist, min-out * Customizations:: How to breed `Wild Bird' * Etcetera:: YaTeX is acquisitive. @@ -138,6 +139,7 @@ (@kbd{C-c a}, @kbd{;}, @kbd{:}) @item Online help for the popular La@TeX{} commands (@kbd{C-c ?}, @kbd{C-c /})(English help is not yet supported) +@item Document files hierarchy browser (@kbd{C-c d}) @end itemize @node Installation, Typesetting, Main features, Top @@ -1180,7 +1182,7 @@ character on a line changes the fill-prefix temporarily to the depth of the line. -@node Updation of @code{\includeonly}, What column?, Filling, Top +@node Updation of includeonly, What column?, Filling, Top @comment node-name, next, previous, up @chapter Updation of @code{\includeonly} @cindex includeonly @@ -1299,7 +1301,7 @@ useful. See the definition of the function @code{YaTeX-intelligent-newline-itemize} as an example. -@node Online help, Cooperation with other packages, Intelligent newline, Top +@node Online help, Browsing file hierarchy, Intelligent newline, Top @comment node-name, next, previous, up @chapter Online help @cindex online help @@ -1349,7 +1351,73 @@ standard commands. I might want to include it in the next distribution. -@node Cooperation with other packages, Customizations, Online help, Top +@node Browsing file hierarchy, Cooperation with other packages, Online help, Top +@comment node-name, next, previous, up +@chapter Browsing file hierarchy +@cindex hierarchy +@cindex browsing + + When you are editing multi-file source, typing + +@table @kbd +@item [prefix] d + @dots{} browse file hierarchy +@end table + +@noindent +asks you the parent-most file (which may be defaulted) and displays the +documentation hierarchy in the next window. In this buffer, the following +commands are available. + +@table @kbd +@item n + @dots{} move to the next line and show its contents +@item p + @dots{} move to the previous line and show its contents +@item N + @dots{} move to the next file in the same inclusion level +@item P + @dots{} move to the previous file in the same inclusion level +@item j + @dots{} move to the next line +@item k + @dots{} move to the previous line +@item u + @dots{} move to the parent file +@item . + @dots{} show the current files contents in the next window +@item SPC + @dots{} scroll up the current file window +@item DEL, b + @dots{} scroll down the current file window +@item < + @dots{} show the beginning of the current file +@item > + @dots{} show the end of the current file +@item > + @dots{} return to the previous postion after @kbd{<} or @kbd{>} +@item RET, g + @dots{} open the current file in the next window +@item mouse-2 + @dots{} same as RET(available only with window system) +@item o + @dots{} other window +@item 1 + @dots{} delete other windows +@item - + @dots{} shrink hierarchy buffer window +@item + + @dots{} enlarge hierarchy buffer window +@item ? + @dots{} describe mode +@item q + @dots{} quit +@end table + + Note that operations on the file contents in the next window do not work +correctly when you close the corresponding file. + +@node Cooperation with other packages, Customizations, Browsing file hierarchy, Top @comment node-name, next, previous, up @chapter Cooperation with other packages @@ -1583,6 +1651,14 @@ Alist of LaTeX's sectioning command vs its height. @end defvar +@defvar YaTeX-hierarchy-ignore-heading-regexp +@code{YaTeX-display-hierarchy} searches for sectioning command first, and +comment line secondary as a file headings. In latter case, ignore lines +that match with regular expression of this variable. Default value of +this variable is RCS header expressions and mode specifying line `-*- xxxx +-*'. +@end defvar + @node Sample definitions, Hook variables, All customizable variables, Lisp variables @comment node-name, next, previous, up @subsection Sample definitions diff --git a/docs/yatexj.tex b/docs/yatexj.tex index e4a25e4..e8fe39f 100644 --- a/docs/yatexj.tex +++ b/docs/yatexj.tex @@ -178,6 +178,8 @@ (@kbd{C-c a}, @kbd{;}, @kbd{/}) @item tabular/array�‹��̃J�����ʒu�K�C�h @item �W���I La@TeX{} �R�}���h�̃I�����C���w���v(@kbd{C-c ?}, @kbd{C-c /}) +@item �h�L�������g�̃C���N���[�h�\���̎��o�I�\���ƃo�b�t�@�؂�ւ� +(@kbd{C-c d}) @end itemize @node Installation, Invocation, Main features, Top @@ -1556,6 +1558,73 @@ �΂���������������Ȃ�΂��Ў��܂ł��̐����������艺�����B����̔z�z�Ɋ܂� �����Ǝv���܂��B +@node Inclusion hierarchy browser +@comment node-name, next, previous, up +@chapter �C���N���[�h�\���u���E�U +@cindex �C���N���[�h�\��[���񂭂邤�Ƃ�������] +@cindex prefix d + +�����̃t�@�C���ɕ������Ă���h�L�������g�������Ă���ꍇ�A + +@table @kbd +@item [prefix] d + @dots{} �C���N���[�h�\���u���E�Y +@end table + +@noindent +�������ƁA���̃h�L�������g�̐e�t�@�C���𕷂��ė��܂��B�����őS�Ẵt�@�C�� +�̐e�ƂȂ�t�@�C��(�f�t�H���g��������Ă���̂ő���RET�̂�)����͂���� +�C���N���[�h���Ă���S�Ẵt�@�C������͂��A�C���N���[�h�󋵂����o�I�ɕ\�� +���܂��B���̃o�b�t�@�ł͈ȉ��̃L�[���삪�L���ł��B + +@table @kbd +@item n + @dots{} ���̍s�Ɉړ����Ή�����t�@�C����ׂ̃o�b�t�@�ɕ\�� +@item p + @dots{} ��̍s�Ɉړ����Ή�����t�@�C����ׂ̃o�b�t�@�ɕ\�� +@item N + @dots{} �����C���N���[�h���x���̎��̃t�@�C���Ɉړ� +@item P + @dots{} �����C���N���[�h���x���̑O�̃t�@�C���Ɉړ� +@item j + @dots{} ���̍s�Ɉړ� +@item k + @dots{} ��̍s�Ɉړ� +@item u + @dots{} ���e�ɂ�����t�@�C���Ɉړ� +@item . + @dots{} �J�[�\���ʒu�̃t�@�C����ׂ̃o�b�t�@�ɕ\�� +@item SPC + @dots{} �ׂ̃o�b�t�@�̑Ή��t�@�C�����X�N���[���A�b�v +@item DEL, b + @dots{} �ׂ̃o�b�t�@�̑Ή��t�@�C�����X�N���[���_�E�� +@item < + @dots{} �ׂ̃o�b�t�@�̑Ή��t�@�C���̐擪��\�� +@item > + @dots{} �ׂ̃o�b�t�@�̑Ή��t�@�C���̖�����\�� +@item ' + @dots{} (@kbd{<}��@kbd{>}�̌��)���̕\���ʒu�ɖ߂� +@item RET, g + @dots{} �J�[�\���ʒu�̃t�@�C����ׂ̃o�b�t�@�ŃI�[�v�� +@item mouse-2 + @dots{} RET�Ɠ���(�E�B���h�E�g�p���̂�) +@item o + @dots{} �ׂ̃E�B���h�E�Ɉړ� +@item 1 + @dots{} ���̃E�B���h�E������ +@item - + @dots{} �u���E�Y�E�B���h�E������������ +@item + + @dots{} �u���E�Y�E�B���h�E��傫������ +@item ? + @dots{} �w���v�\�� +@item q + @dots{} �\���O�̏�Ԃɖ߂� +@end table + + �������A�ׂ̃E�B���h�E�̃t�@�C���̓��e��\������@�\�Ɋւ��ẮA�Ή����� +�t�@�C�����N���[�Y���Ă��܂��Ƃ��܂������܂���̂ł����ӂ��������B + @node Cooperation with other packages, Customizations, Online help, Top @comment node-name, next, previous, up @chapter ���p�b�P�[�W�Ƃ̘A�g @@ -1785,6 +1854,17 @@ �ɂ���Ă� hilit19 �̃h�L�������g)���Q�Ƃ���B @end defvar +@defvar YaTeX-sectioning-level +LaTeX�̃Z�N�V�����P�ʐ錾�R�}���h�Ƃ��̘_���I������alist�B +@end defvar + +@defvar YaTeX-hierarchy-ignore-heading-regexp +Hierarchy �o�b�t�@�͒ʏ�t�@�C���w�b�_�Ƃ��āALaTeX�̃Z�N�V�����錾�R�}�� +�h�̈������������A���ꂪ�Ȃ���΃R�����g�s��T�����A���̍ۂɃw�b�_�Ƃ��Ă� +�Ӗ��������Ȃ��p�^�[�������̕ϐ��ɐݒ肷��B�f�t�H���g�ł� RCS �w�b�_�ƃ��[ +�h�w��s(-*- xxx -*-)���ݒ肳��Ă���B +@end defvar + @node Sample definitions, Hook variables, All customizable variables, Lisp variables @comment node-name, next, previous, up @subsection �J�X�^�}�C�Y�ϐ��ݒ�� diff --git a/help/YATEXHLP.jp b/help/YATEXHLP.jp index ffde2d9..fc787f7 100644 --- a/help/YATEXHLP.jp +++ b/help/YATEXHLP.jp @@ -1306,12 +1306,18 @@ ���}�a�G����(JAIST) �쒹/������ Mailing List ��ݗ����Ē����܂����B -���{���F����(�����w�|��w) +���{���F����(�����w�|��) �}�j���A���̃o�O���w�E���Ē����܂����B -���{�R�N�q����(������w) +���{�R�N�q����(������) \item[] �Ȃǂ̕⊮�� [] �̒��ɃJ�[�\����u���v�]�𒸂��܂����B +�|���_����(������) + M-q (YaTeX-fill-paragraph) �̃o�O��񍐂��Ē����܂����B + +�����\����(�c���) + �l�X�g���������itemize�‹��ł�indentation�̕s����w�E���Ē��� + �܂����B yatex (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist)) diff --git a/yatex.el b/yatex.el index 631d782..c5a3846 100644 --- a/yatex.el +++ b/yatex.el Binary files differ diff --git a/yatex.new b/yatex.new index 7b24d6f..e6cefd1 100644 --- a/yatex.new +++ b/yatex.new @@ -1,12 +1,27 @@ What's new in YaTeX yatex.el �e�o�[�W�����̕ύX�_�ɂ‚��� +1.57 �����‹����l�X�g���Ă��鎞�� M-C-a, M-C-e �̃o�O�C���B + \begin�̍s��TAB��reindent��������\end���������ɑ�����B + ���W�������‹��Ŋ��������̒��g�̏������s���֐� + YaTeX-enclose-<�‹���> ���T�|�[�g�Bequation �Ŋ��������ɒ��g�� $ + ��S�ď������Averbatim�Ŋ��������͂Ȃɂ����Ȃ��悤�ɂ����B + \item �s��TAB�������ɃJ�[�\���ʒu��ۑ��B + \item ��⊮�������� section �^�R�}���h�̃f�t�H���g�� label �ɁB + hierarchy�o�b�t�@�ł� SPC, DEL, +, - �̒lj��B + fill ����� kill-ring ���󂵂Ă��܂��̂��C���B + �����‹��ł̃C���f���g�̃T�|�[�g(�₾�Ȃ�)�B + �����ʂ��l�X�g������A�������������� section �^�R�}���h�������� + hilit ����悤�ɂ��A% �� hilit ���K���������B + �C���f���g���ς��Ȃ�����TAB�ł��C���t���O�������Ă����̂��C���B + 1.56 [prefix] d �� YaTeX-display-hierarchy ��lj��B �ϐ� indent-line-function �� YaTeX-indent-line ��ݒ肵���B YaTeX-generate-simple �̏C��(1.51���獡�܂őS�R�����Ȃ������̂Ɂc)�B NTT-jTeX �𗘗p���鎞�ɕ������C���f���g���Ă��ǂ��悤�� auto-fill �� fill-paragraph �𒲐������B maketitle �^�R�}���h�� [] �ŏI����Ă��鎞�ɂ̓J�[�\�������ʓ��ɁB + �Z�N�V�����R�}���h�̘_���I�����ɉ����ĐF�̔Z�x��ς���(Mule2+X)�B 1.55 {}�̏�� [prefix] k �������ɒ��O�̃R�}���h�� maketitle �^������ �����Ă���� {} �̂�(�t�H���g�w��q������΂����)�������悤�ɂ����B diff --git a/yatex19.el b/yatex19.el index ec2281a..b20c447 100644 --- a/yatex19.el +++ b/yatex19.el @@ -1,13 +1,14 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX facilities for Emacs 19 ;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sun Jan 22 23:15:56 1995 on landcruiser +;;; Last modified Thu Feb 2 23:44:30 1995 on figaro ;;; $Id$ ;;; �Ƃ肠���� hilit19 ���g���Ă��鎞�ɐF���t���悤�ɂ��� ;;; ���j���[�o�[�ł��ɂ傲�ɂ�ł���悤�ɂ��������B ;;; ���������N�����j���[�o�[�g����LaTeX�\�[�X�����񂾂낤��? ;;; �܂���������K���K�B���̕��ɂ�����ƃR�����g����B +;;; �^���ӂɂ��邯�ǁAhilit19.el �Ή��̕��͌��\�{�C�B (require 'yatex) @@ -207,28 +208,116 @@ (sort (append env-table user-env-table) '(lambda (x y) (string< (car x) (car y)))))) +;; Other key bindings for window-system +;(YaTeX-define-key [?\C- ] 'YaTeX-do-completion) +(define-key YaTeX-mode-map [?\M-\C- ] 'YaTeX-mark-environment) + ;; Highlightening -;; ���[�J���ȃ}�N����ǂݍ��񂾌� redraw ����� -;; ���[�J���}�N���� keyword �Ƃ��Č��点��(keyword����܂������ȁc)�B -(defvar YaTeX-hilit-patterns-alist nil - "*Hiliting pattern alist for LaTeX text. -Default value is equal to latex-mode's one.") -(defvar YaTeX-hilit-pattern-adjustment-default - (list - ;;\def �� define �Ȃ񂾂��� new* �� define �ł��傤�B - '("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" define) - '("\\\\new\\(length\\|theorem\\|counter\\){" "}" define) - ;;�Z�N�V�����R�}���h���P�Ȃ�L�[���[�h���Ă��Ƃ͂Ȃ��ł��傤�B - ;;(list - ;;(concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}" - ;;'sectioning) - ;;eqnarray �Ȃǂ̐����‹��������ĂȂ��݂����c - '("\\\\begin{\\(eqnarray\\*?\\|equation\\*?\\)}" - "\\\\end{\\(eqnarray\\*?\\|equation\\*?\\)}" - formula)) - "Adjustment for hilit19's LaTeX hilit pattern.") +;; ���j���[�ɔ�ׂĂ������͌��\�{�C�ł���Ă܂��B +;; �����ĕ����\�����Ƃ��Ă�������Ղ��񂾂���B +;; �݂�Ȃ� hilit19.el ���g����! +;; +;; ���āA�܂��͑Ή����� {} ���s�J�s�J�͈͂Ƃ���悤�Ȋ֐������B +;; ����� hilit-LaTeX.el ���Q�l�ɂ����B�ł��A������ section �^�R�}���h�� +;; �����𐔂��Đ������ʒu�܂Ńs�J�s�J�������`��! + +(defun YaTeX-19-region-section-type (pattern) + "Return list of starting and end point of section-type commands of PATTERN." + (if (re-search-forward pattern nil t) + (let ((m0 (match-beginning 0)) cmd (argc 1)) + (setq cmd (substring (YaTeX-match-string 0) 1 -1) + argc (or (car (cdr (YaTeX-lookup-table cmd 'section))) argc)) + (cons m0 + (progn (skip-chars-backward "^{") (forward-char -2) + (while (> argc 0) + (skip-chars-forward "^{") + (forward-list 1) + (setq argc (1- argc))) + (point)))))) + +(defun YaTeX-19-region-large-type (pattern) + "Return list of large-type contents. +Assumes PATTERN begins with `{'." + (if (re-search-forward pattern nil t) + (let ((m0 (match-beginning 0))) + (goto-char m0) + (skip-chars-forward "^ \t\n") + (skip-chars-forward " \t\n") + (cons (point) + (progn (goto-char m0) (forward-list 1) + (1- (point))))))) + +;; ���ׂȂ��Ƃ��� % �̑O�̕������s�J���Ƃ����Ă��܂��悤�Łc >hilit19 +;; �����̊֐��͉��� hilit-set-mode-patterns �� "[^\\]\\(%\\).*$" �� +;; �ˑ����Ă��� +(defun YaTeX-19-region-comment (pattern) + "Return list of comment start and end point." + (if (re-search-forward pattern nil t) + (cons (match-beginning 1) (match-end 0)))) + +(defvar YaTeX-hilit-patterns-alist + '( + ;; comments + (YaTeX-19-region-comment "[^\\]\\(%\\).*$" comment) + + (YaTeX-19-region-section-type "\\\\footnote\\(mark\\|text\\)?{" keyword) + ("\\\\[a-z]+box" 0 keyword) + (YaTeX-19-region-section-type "\\\\\\(v\\|h\\)space\\(\*\\)?{" keyword) + + ;; (re-)define new commands/environments/counters + (YaTeX-19-region-section-type + "\\\\\\(re\\)?new\\(environment\\|command\\|theorem\\){" defun) + (YaTeX-19-region-section-type + "\\\\\\(re\\)?new\\(length\\|counter\\){" define) + + ;; various declarations/definitions + (YaTeX-19-region-section-type + "\\\\\\(set\\|setto\\|addto\\)\\(length\\|width\\|counter\\){" + define) + (YaTeX-19-region-section-type + "\\\\\\(title\\|author\\|date\\|thanks\\){" define) + + ("\\\\documentstyle\\(\\[.*\\]\\)?{" "}" decl) + ("\\\\\\(begin\\|end\\|nofiles\\|includeonly\\){" "}" decl) + ("\\\\\\(raggedright\\|makeindex\\|makeglossary\\|maketitle\\)\\b" 0 decl) + ("\\\\\\(pagestyle\\|thispagestyle\\|pagenumbering\\){" "}" decl) + ("\\\\\\(normalsize\\|small\\|footnotesize\\|scriptsize\\|tiny\\|large\\|Large\\|LARGE\\|huge\\|Huge\\)\\b" 0 decl) + ("\\\\\\(appendix\\|tableofcontents\\|listoffigures\\|listoftables\\)\\b" + 0 decl) + ("\\\\\\(bf\\|em\\|it\\|rm\\|sf\\|sl\\|ss\\|tt\\)\\b" 0 decl) + + ;; label-like things + ;;this should be customized by YaTeX-item-regexp + ("\\\\\\(sub\\)*item\\b\\(\\[[^]]*\\]\\)?" 0 label) + (YaTeX-19-region-section-type + "\\\\caption\\(\\[[^]]*\\]\\)?{" label) + + ;; formulas + ("[^\\]\\\\(" "\\\\)" formula) ; \( \) + ("[^\\]\\\\\\[" "\\\\\\]" formula) ; \[ \] + ("\\\\begin{\\(eqn\\|equation\\)" "\\\\end{\\(eqn\\|equation\\)" formula) + ("[^\\$]\\($\\($[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula) ; '$...$' or '$$...$$' + + ;; things that bring in external files + ("\\\\\\(include\\|input\\|bibliography\\){" "}" include) + + ;; "wysiwyg" emphasis -- these don't work with nested expressions + ;; ("{\\\\\\(em\\|it\\|sl\\)" "}" italic) + (YaTeX-19-region-large-type "{\\\\bf" bold) + + ("``" "''" string) + + ;; things that do some sort of cross-reference + (YaTeX-19-region-section-type + "\\\\\\(\\(no\\)?cite\\|\\(page\\)?ref\\|label\\|index\\|glossary\\){" + crossref) + ) + "*Hiliting pattern alist for LaTeX text.") + +;;(defvar YaTeX-hilit-pattern-adjustment-default nil) +;; ������Ȃ��Ȃ����B (defvar YaTeX-hilit-pattern-adjustment-private nil - "*Private variable, same purpose as YaTeX-hilit-pattern-adjustment-default.") + "*Adjustment hilit-pattern-alist for default yatex-mode's pattern.") (defvar YaTeX-hilit-sectioning-face '(yellow/dodgerblue yellow/cornflowerblue) "*Hilightening face for sectioning unit. '(FaceForLight FaceForDark)") @@ -240,54 +329,55 @@ ;;; �Z�N�V�����R�}���h���A�\�����x���̍����ɉ����ĐF�̔Z�x��ς��� ;;; �w�i�����łȂ��Ɖ����������̂�������Ȃ��ɈႢ�Ȃ�. -(let*((sectface - (car (if (eq hilit-background-mode 'dark) - (cdr YaTeX-hilit-sectioning-face) - YaTeX-hilit-sectioning-face))) - (sectcol (symbol-name sectface)) - sect-pat-alist) - (if (string-match "/" sectcol) - (let (colorvalue fR fG fB bR bG bB list pat fg bg level from face) - (require 'yatexsec) - (setq fg (substring sectcol 0 (string-match "/" sectcol)) - bg (substring sectcol (1+ (string-match "/" sectcol))) - colorvalue (x-color-values fg) - fR (/ (nth 0 colorvalue) 256) - fG (/ (nth 1 colorvalue) 256) - fB (/ (nth 2 colorvalue) 256) - colorvalue (x-color-values bg) - bR (/ (nth 0 colorvalue) 256) - bG (/ (nth 1 colorvalue) 256) - bB (/ (nth 2 colorvalue) 256) - list YaTeX-sectioning-level) - (while list - (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{") - level (cdr (car list)) - fg (format "hex-%02x%02x%02x" - (- fR (/ (* level fR) 40)) ;40 musn't be constant - (- fG (/ (* level fG) 40)) - (- fB (/ (* level fB) 40))) - bg (format "hex-%02x%02x%02x" - (- bR (/ (* level bR) 15)) ;20 musn't be constant - (- bG (/ (* level bG) 15)) - (- bB (/ (* level bB) 15))) - from (intern (format "sectioning-%d" level)) - face (intern (concat fg "/" bg))) - (hilit-translate from face) - (setq sect-pat-alist - (cons (list pat "}" face) - sect-pat-alist)) - (setq list (cdr list))) - (setq YaTeX-sectioning-patterns-alist sect-pat-alist)))) +;;; ���������Ĕ��n�̎��͍\�����x���ɉ����ĐF�𖾂邭�����ق����ǂ��̂�? +(cond + ((and (featurep 'hilit19) (fboundp 'x-color-values)) + (let*((sectface + (car (if (eq hilit-background-mode 'dark) + (cdr YaTeX-hilit-sectioning-face) + YaTeX-hilit-sectioning-face))) + (sectcol (symbol-name sectface)) + sect-pat-alist) + (if (string-match "/" sectcol) + (let (colorvalue fR fG fB bR bG bB list pat fg bg level from face) + (require 'yatexsec) + (setq fg (substring sectcol 0 (string-match "/" sectcol)) + bg (substring sectcol (1+ (string-match "/" sectcol))) + colorvalue (x-color-values fg) + fR (/ (nth 0 colorvalue) 256) + fG (/ (nth 1 colorvalue) 256) + fB (/ (nth 2 colorvalue) 256) + colorvalue (x-color-values bg) + bR (/ (nth 0 colorvalue) 256) + bG (/ (nth 1 colorvalue) 256) + bB (/ (nth 2 colorvalue) 256) + list YaTeX-sectioning-level) + (while list + (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{") + level (cdr (car list)) + fg (format "hex-%02x%02x%02x" + (- fR (/ (* level fR) 40)) ;40 musn't be constant + (- fG (/ (* level fG) 40)) + (- fB (/ (* level fB) 40))) + bg (format "hex-%02x%02x%02x" + (- bR (/ (* level bR) 15)) ;20 musn't be constant + (- bG (/ (* level bG) 15)) + (- bB (/ (* level bB) 15))) + from (intern (format "sectioning-%d" level)) + face (intern (concat fg "/" bg))) + (hilit-translate from face) + (setq sect-pat-alist + (cons;;(list pat "}" face) + (list 'YaTeX-19-region-section-type pat face) + sect-pat-alist)) + (setq list (cdr list))) + (setq YaTeX-sectioning-patterns-alist sect-pat-alist)))))) -(defun YaTeX-19-collect-macro () +;; ���[�J���ȃ}�N����ǂݍ��񂾌� redraw ����� +;; ���[�J���}�N���� keyword �Ƃ��Č��点��(keyword����܂������ȁc)�B +(defun YaTeX-19-collect-macros () (cond ((and (featurep 'hilit19) (fboundp 'hilit-translate)) - (or YaTeX-hilit-patterns-alist - (let ((alist (cdr (assq 'latex-mode hilit-patterns-alist)))) - (setcar (assoc "\\\\item\\(\\[[^]]*\\]\\)?" alist) - (concat YaTeX-item-regexp "\\b\\(\\[[^]]*\\]\\)?")) - (setq YaTeX-hilit-patterns-alist alist))) (let ((get-face (function (lambda (table) @@ -306,17 +396,18 @@ (append YaTeX-sectioning-patterns-alist YaTeX-hilit-pattern-adjustment-private - YaTeX-hilit-pattern-adjustment-default + ;;YaTeX-hilit-pattern-adjustment-default YaTeX-hilit-patterns-alist (list (list + 'YaTeX-19-region-section-type (concat "\\\\\\(" (mapconcat (function (lambda (s) (regexp-quote (car s)))) (append user-section-table tmp-section-table) "\\|") "\\){") - "}" 'keyword) + 'keyword) (list (concat "\\\\\\(" (mapconcat @@ -326,17 +417,64 @@ "\\)\\b") 0 'macro)))) hilit-patterns-alist))))) -(YaTeX-19-collect-macro) +;;(YaTeX-19-collect-macros) ;causes an error (defun YaTeX-hilit-recenter (arg) "Collect current local macro and hilit-recenter." (interactive "P") - (YaTeX-19-collect-macro) + (YaTeX-19-collect-macros) (hilit-recenter arg)) (if (fboundp 'hilit-recenter) ;Replace hilit-recenter with (mapcar (function (lambda (key) ;YaTeX-hilit-recenter in yatex-mode (define-key YaTeX-mode-map key 'YaTeX-hilit-recenter))) (where-is-internal 'hilit-recenter))) +(defun YaTeX-switch-to-new-window () + (let ((c 0) (i 1) (free (make-string win:max-configs ? ))) + (while (< i win:max-configs) + (or (aref win:configs i) (aset free i (+ i win:base-key))) + (setq i (1+ i))) + (while (not (string-match (char-to-string c) free)) + (message "Which window to create? [%s]: " free) + (setq c (read-char))) + (message "Creating window [%c]" c) + (set-buffer (get-buffer-create "*scratch*")) + (win:switch-window (- c win:base-key)))) + +(defun YaTeX-visit-main-other-frame () + "Visit main file in other frame. +WARNING, This code is not perfect." + (interactive) + (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.") + (let (parent) + (save-excursion (YaTeX-visit-main t) (setq parent (current-buffer))) + (cond + ((get-buffer-window parent t) + (goto-buffer-window parent)) + ((and (featurep 'windows) win:use-frame) + (YaTeX-switch-to-new-window) + (switch-to-buffer parent)) + (t (switch-to-buffer-other-frame (buffer-name parent))))))) + +(defun YaTeX-goto-corresponding-*-other-frame (arg) + "Go to corresponding object in other frame." + (interactive "P") + (let (b p) + (save-window-excursion + (save-excursion + (YaTeX-goto-corresponding-* arg) + (setq b (current-buffer) p (point)))) + (cond + ((get-buffer-window b t) + (goto-buffer-window b) + (goto-char p)) + ((and (featurep 'windows) win:use-frame) + (YaTeX-switch-to-new-window) + (switch-to-buffer b) + (goto-char p)) + (t (switch-to-buffer-other-frame (buffer-name b)) + (goto-char p)))) +) + ;;; reverseVideo �ɂ��� hilit-background-mode �� 'dark ;;; �ɂ��Ă���l�͐����Ȃǂ��Â��Ȃ肷���Č��Â炢��������Ȃ��B ;;; ���̃R�[�h�� hilit19 �����[�h���Ă���ꏊ�̒���ɒu���Ƃ���� diff --git a/yatexadd.el b/yatexadd.el index c1681a2..ab09379 100644 --- a/yatexadd.el +++ b/yatexadd.el @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX add-in functions. -;;; yatexadd.el rev.12 +;;; yatexadd.el rev.13 ;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sun Jan 22 23:15:48 1995 on landcruiser +;;; Last modified Thu Jan 26 03:31:20 1995 on figaro ;;; $Id$ ;;; @@ -286,7 +286,10 @@ (concat "[" label "]"))) ) -(defun YaTeX:item () " ") +(defun YaTeX:item () + (YaTeX-indent-line) + (setq section-name "label") + " ") (fset 'YaTeX:item\[\] 'YaTeX:item) (fset 'YaTeX:subitem 'YaTeX:item) (fset 'YaTeX:subsubitem 'YaTeX:item) diff --git a/yatexenv.el b/yatexenv.el index b484e2d..93ce46d 100644 --- a/yatexenv.el +++ b/yatexenv.el @@ -2,7 +2,7 @@ ;;; YaTeX environment-specific functions. ;;; yatexenv.el ;;; (c ) 1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Thu Nov 24 04:33:18 1994 on 98fa +;;; Last modified Thu Feb 2 16:11:12 1995 on pajero ;;; $Id$ ;;; @@ -165,30 +165,19 @@ ;; Functions for itemize/enumerate/list environments ;;; -(defun YaTeX-indent-for-item () - (let (col (p (point)) begenv) - (save-excursion - (YaTeX-beginning-of-environment t) - (setq begenv (point-end-of-line)) - (goto-char p) - (if (YaTeX-search-active-backward "\\item" YaTeX-comment-prefix begenv t) - (setq col (current-column)))) - (if col (indent-to col) (YaTeX-indent-line))) -) - (defvar YaTeX-item-for-insert "\\item ") (defun YaTeX-intelligent-newline-itemize () "Insert '\\item '." - (YaTeX-indent-for-item) (insert YaTeX-item-for-insert) + (YaTeX-indent-line) ) (fset 'YaTeX-intelligent-newline-enumerate 'YaTeX-intelligent-newline-itemize) (fset 'YaTeX-intelligent-newline-list 'YaTeX-intelligent-newline-itemize) (defun YaTeX-intelligent-newline-description () - (YaTeX-indent-for-item) (insert "\\item[] ") (forward-char -2) + (YaTeX-indent-line) ) @@ -211,3 +200,103 @@ (if (and env func (fboundp func)) (funcall func))) ) + +;;; +;; Environment-specific line indenting functions +;;; +;;;###autoload +(defun YaTeX-indent-line-equation () + "Indent a line in equation family." + (let ((p (point)) (l-r 0) right-p peol depth (mp YaTeX-environment-indent)) + (if (save-excursion + (beginning-of-line) + (skip-chars-forward " \t") + (looking-at "\\\\right\\b")) + (progn (YaTeX-reindent + (save-excursion (YaTeX-goto-corresponding-leftright) + (current-column)))) + (save-excursion + (forward-line -1) + (while (and (not (bobp)) (YaTeX-on-comment-p)) + (forward-line -1)) + ;;(beginning-of-line) ;must be unnecessary + (skip-chars-forward " \t") + (if (eolp) (error "Math-environment can't have a null line!!")) + (setq depth (current-column) + peol (point-end-of-line)) + (while (re-search-forward + "\\\\\\(\\(left\\)\\|\\(right\\)\\)\\b" peol t) + (setq l-r (+ l-r (if (match-beginning 2) 1 -1)))) + (cond + ((progn (beginning-of-line) + (re-search-forward "\\\\\\\\\\s *$" (point-end-of-line) t)) + ;;If previous line has `\\', this indentation is always normal. + (setq depth (+ (YaTeX-current-indentation) mp))) + ((> l-r 0) + (beginning-of-line) + (search-forward "\\left" peol) + (goto-char (1+ (match-beginning 0))) + (setq depth (current-column))) + ((< l-r 0) + (goto-char (match-beginning 0)) ;should be \right + (YaTeX-goto-corresponding-leftright) + (beginning-of-line) + (skip-chars-forward " \t") + (setq depth (+ (current-column) mp))) ;+mp is good? + (t ;if \left - \right = 0 + (cond + ((re-search-forward "\\\\\\\\\\s *$" peol t) + (setq depth (+ (YaTeX-current-indentation) mp))) + ((re-search-forward "\\\\end{" peol t) + nil) ;same indentation as previous line's + ((re-search-forward "\\\\begin{" peol t) + (setq depth (+ depth mp))) + (t + (or (bobp) (forward-line -1)) + (cond + ((re-search-forward + "\\\\\\\\\\s *$\\|\\\\begin{" (point-end-of-line) t) + (setq depth (+ depth mp))) + ))))) + (goto-char p)) + (YaTeX-reindent depth)))) + +;;;###autoload +(defun YaTeX-goto-corresponding-leftright () + "Go to corresponding \left or \right. +Note that this function assumes the corresponding \left\right +is on another line." + (let ((YaTeX-struct-begin "\\left%1") + (YaTeX-struct-end "\\right%1") + (YaTeX-struct-name-regexp "[][(){}.|]")) + (YaTeX-goto-corresponding-environment t))) + +;;; +;; Functions for formatting region being enclosed with environment +;;; +; These functions must take two argument; region-beginning, region-end. + +(defun YaTeX-enclose-equation (beg end) + (goto-char beg) + (save-restriction + (let (m0 bsl) + (narrow-to-region beg end) + (while (YaTeX-re-search-active-forward + "\\(\\$\\)" YaTeX-comment-prefix nil t) + (goto-char (setq m0 (match-beginning 0))) + (setq bsl 0) + (if (and (not (bobp)) (= (char-after (1- (point))) ?\\ )) + (while (progn (forward-char -1) (= (char-after (point)) ?\\ )) + (setq bsl (1+ bsl)))) + (goto-char m0) + (if (= 0 (% bsl 2)) + (delete-char 1) + (forward-char 1)))))) + +(fset 'YaTeX-enclose-eqnarray 'YaTeX-enclose-equation) +(fset 'YaTeX-enclose-eqnarray* 'YaTeX-enclose-equation) + +(defun YaTeX-enclose-verbatim (beg end)) ;do nothing when enclose verbatim +(fset 'YaTeX-enclose-verbatim* 'YaTeX-enclose-verbatim) + +(provide 'yatexenv) diff --git a/yatexhie.el b/yatexhie.el index e2b8db3..d2ede23 100644 --- a/yatexhie.el +++ b/yatexhie.el @@ -2,21 +2,22 @@ ;;; YaTeX hierarchy browser. ;;; yatexhie.el ;;; (c )1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] -;;; Last modified Sun Jan 22 23:15:25 1995 on landcruiser +;;; Last modified Thu Feb 2 23:55:59 1995 on figaro ;;; $Id$ ;; ----- Customizable variables ----- -(defvar YaTeX-hierarchy-inspect-mode t - "*Non-nil inspects the contents of file of cursor position.") - +(defvar YaTeX-hierarchy-ignore-heading-regexp + "\\$[A-Z][a-z]+: .* \\$\\|-\\*- .* -\\*-" + "*Regexp of lines to ignore as files' headline.") ;; ----- General variables ----- (defvar YaTeX-default-TeX-extensions "\\.\\(tex\\|sty\\)") (defvar YaTeX-hierarchy-current-main nil) (defvar YaTeX-hierarchy-buffer-message (concat - "n)ext p)rev N)extsamelev P)revsamelev u)p K)ill-buffer RET)select" - (if (and YaTeX-emacs-19 window-system) " Mouse2)select" ""))) + "n)ext p)rev N)extsame P)revsame u)p K)illbuf RET)select" + (if (and YaTeX-emacs-19 window-system) " Mouse2)select" "") + " ?)help")) (defvar YaTeX-hierarchy-saved-wc nil "Saved window configuration.") ;; ----- Functions for parsing hierarchy ----- @@ -81,23 +82,30 @@ (save-excursion (set-buffer (find-file-noselect file)) (save-excursion - (goto-char (point-min)) - (cond - ((and - (YaTeX-re-search-active-forward - (concat YaTeX-ec-regexp YaTeX-sectioning-regexp) - YaTeX-comment-prefix nil t) - (re-search-forward "{\\([^}]+\\)}" nil t)) - (goto-char (match-beginning 1)) - (skip-chars-forward " \t\n") - (buffer-substring (point) - (min (point-end-of-line) - (match-end 1)))) - ((re-search-forward "^ *%\\([^#]\\)" nil t) - (goto-char (match-beginning 1)) - (skip-chars-forward " \t") - (buffer-substring (point) (point-end-of-line))) - (t ""))))) + (let (p) + (goto-char (point-min)) + (cond + ((re-search-forward + (concat YaTeX-ec-regexp YaTeX-sectioning-regexp) nil t) + (search-forward "{") + (forward-char -1) + (setq p (condition-case nil + (progn (forward-list 1) (1- (point))) + (error (point-end-of-line)))) + (goto-char (1+ (match-beginning 0))) + (skip-chars-forward " \t\n") + (buffer-substring (point) (min (point-end-of-line) p))) + ((catch 'found + (while (re-search-forward "^ *%\\([^#]\\)" nil t) + (or (re-search-forward + YaTeX-hierarchy-ignore-heading-regexp + (point-end-of-line) t) + (throw 'found t)))) + (beginning-of-line) + (search-forward "%") + (skip-chars-forward "% \t") + (buffer-substring (point) (point-end-of-line))) + (t "")))))) (defun YaTeX-display-a-hierachy (hier level) "Put a HIER of document hierarchy. @@ -177,12 +185,19 @@ \\[YaTeX-hierarchy-next] next line \\[YaTeX-hierarchy-prev] previous line -\\[YaTeX-hierarchy-forward] move forward in same level -\\[YaTeX-hierarchy-backward] move backward in same level +\\[YaTeX-hierarchy-forward] move forward in the same level +\\[YaTeX-hierarchy-backward] move backward in the same level \\[YaTeX-hierarchy-up-document] move to parent file \\[delete-other-windows] delete other windows \\[other-window] other window -\\[YaTeX-hierarchy-show] show buffer contents in the next window +\\[shrink-window] shrink window +\\[enlarge-window] enlarge window +\\[YaTeX-hierarchy-show] show file contents in the next window +\\[YaTeX-hierarchy-scroll-up] scroll up file contents buffer +\\[YaTeX-hierarchy-scroll-down] scroll down file contents buffer +\\[YaTeX-hierarchy-top] show the top of file contents +\\[YaTeX-hierarchy-bottom] show the bottom of file contents +\\[YaTeX-hierarchy-lastpos] return to the previous position \\[YaTeX-hierarchy-select] select file \\[YaTeX-hierarchy-mouse-select] select " @@ -214,7 +229,7 @@ (interactive "p") (forward-line arg) (skip-chars-forward "- +\\|") - (if (and (/= arg 0) YaTeX-hierarchy-inspect-mode (not quiet)) + (if (and (/= arg 0) (not quiet)) (YaTeX-hierarchy-select t)) (message YaTeX-hierarchy-buffer-message)) @@ -278,7 +293,9 @@ (interactive "p") (YaTeX-hierarchy-next 0) ;move to file name column (if (bolp) (error "Not on file name line")) - (let ((file (buffer-substring (point) (point-end-of-line)))) + (let ((file (buffer-substring + (point) + (progn (skip-chars-forward "^ \t") (point))))) (YaTeX-hierarchy-next arg) (cond ((get-buffer file) @@ -321,13 +338,51 @@ (set-window-configuration (car YaTeX-hierarchy-saved-wc)) (bury-buffer nil))) -(defun YaTeX-hierarchy-toggle-inspection (arg) - "Toggle inspection mode of YaTeX-hierarchy buffer." +(defun YaTeX-hierarchy-scroll-up (arg &optional action) + "Scroll up file contents of YaTeX-hierarchy." (interactive "P") - (setq YaTeX-hierarchy-inspect-mode - (or arg (not YaTeX-hierarchy-inspect-mode))) - (message "YaTeX hierarchy inspection mode %s" - (if YaTeX-hierarchy-inspect-mode "ON" "OFF"))) + (YaTeX-hierarchy-next 0 t) + (let*((bufname (buffer-substring + (point) + (save-excursion (skip-chars-forward "^ \t") (point)))) + (buf (get-buffer bufname)) + (cw (selected-window))) + (cond + ((and buf (get-buffer-window buf)) + (select-window (get-buffer-window buf))) + ((and buf (YaTeX-showup-buffer buf nil t)) t) + (t (YaTeX-hierarchy-select nil))) + (unwind-protect + (cond + ((eq action 'down) (scroll-down arg)) + ((eq action 'top) (beginning-of-buffer)) + ((eq action 'bottom) (end-of-buffer)) + ((eq action 'last) (exchange-point-and-mark)) + (t (scroll-up arg))) + (select-window cw)))) + +(defun YaTeX-hierarchy-scroll-down (arg) + "Scroll down file contents of YaTeX-hierarchy." + (interactive "P") + (YaTeX-hierarchy-scroll-up arg 'down)) + +(defun YaTeX-hierarchy-top () + "Show the top of YaTeX-hierarchy inspection buffer's." + (interactive) + (YaTeX-hierarchy-scroll-up nil 'top) +) + +(defun YaTeX-hierarchy-bottom () + "Show the top of YaTeX-hierarchy inspection buffer's." + (interactive) + (YaTeX-hierarchy-scroll-up nil 'bottom) +) + +(defun YaTeX-hierarchy-lastpos () + "Go to last position in YaTeX-hierarchy buffer." + (interactive) + (YaTeX-hierarchy-scroll-up nil 'last) +) ;; ----- Setting up keymap ----- (defvar YaTeX-hierarchy-mode-map nil "Keymap used in YaTeX-hierarchy-mode.") @@ -347,9 +402,17 @@ (define-key YaTeX-hierarchy-mode-map "K" 'YaTeX-hierarchy-kill-buffer) (define-key YaTeX-hierarchy-mode-map "1" 'delete-other-windows) (define-key YaTeX-hierarchy-mode-map "o" 'other-window) + (define-key YaTeX-hierarchy-mode-map "-" 'shrink-window) + (define-key YaTeX-hierarchy-mode-map "+" 'enlarge-window) (define-key YaTeX-hierarchy-mode-map "." 'YaTeX-hierarchy-show) + (define-key YaTeX-hierarchy-mode-map " " 'YaTeX-hierarchy-scroll-up) + (define-key YaTeX-hierarchy-mode-map "b" 'YaTeX-hierarchy-scroll-down) + (define-key YaTeX-hierarchy-mode-map "\C-?" 'YaTeX-hierarchy-scroll-down) (define-key YaTeX-hierarchy-mode-map "\C-m" 'YaTeX-hierarchy-select) - (define-key YaTeX-hierarchy-mode-map ";" 'YaTeX-hierarchy-toggle-inspection) + (define-key YaTeX-hierarchy-mode-map "<" 'YaTeX-hierarchy-top) + (define-key YaTeX-hierarchy-mode-map ">" 'YaTeX-hierarchy-bottom) + (define-key YaTeX-hierarchy-mode-map "'" 'YaTeX-hierarchy-lastpos) + (define-key YaTeX-hierarchy-mode-map "g" 'YaTeX-hierarchy-select) (define-key YaTeX-hierarchy-mode-map "q" 'YaTeX-hierarchy-quit) (define-key YaTeX-hierarchy-mode-map "?" 'describe-mode) (if (and YaTeX-emacs-19 window-system) diff --git a/yatexhlp.el b/yatexhlp.el index 89ebf0e..a49b2b3 100644 --- a/yatexhlp.el +++ b/yatexhlp.el @@ -2,7 +2,7 @@ ;;; YaTeX helper with LaTeX commands and macros. ;;; yatexhlp.el ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sat Nov 12 04:20:26 1994 on VFR +;;; Last modified Mon Jan 23 10:17:11 1995 on pajero ;;; $Id$ (let ((help-file (concat "YATEXHLP." @@ -151,7 +151,7 @@ (if (and (= (current-column) 1) (= (preceding-char) ?.) (eolp)) (let ((cbuf (current-buffer))) (beginning-of-line) - (kill-line 1) + (delete-region (point) (progn (forward-line 1) (point))) (save-excursion (YaTeX-help-add-entry YaTeX-help-command-current YaTeX-help-file-current)) diff --git a/yatexlib.el b/yatexlib.el index 8a239d0..b1123b9 100644 --- a/yatexlib.el +++ b/yatexlib.el @@ -2,7 +2,7 @@ ;;; YaTeX library of general functions. ;;; yatexlib.el ;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sun Jan 22 23:15:03 1995 on landcruiser +;;; Last modified Thu Jan 26 11:15:29 1995 on pajero ;;; $Id$ ;;;###autoload @@ -128,7 +128,7 @@ that gives the maximum value by the FUNC. FUNC should take an argument of its window object. Non-nil for optional third argument SELECT selects that window. This function never selects minibuffer window." - (or (and (if YaTeX-emacs-19 + (or (and (if (and YaTeX-emacs-19 select) (get-buffer-window buffer t) (get-buffer-window buffer)) (progn @@ -355,4 +355,14 @@ (read-with-history-in hsym prompt init)) (t (read-string prompt init)))) +;;; +;; Interface function for windows.el +;;; +;;;###autoload +(defun YaTeX-switch-to-window () + "Switch to windows.el's window decided by last pressed key." + (interactive) + (or (featurep 'windows) (error "Why don't you use `windows.el'?")) + (win-switch-to-window 1 (- last-command-char win:base-key))) + (provide 'yatexlib) diff --git a/yatexmth.el b/yatexmth.el index ce91838..c33fe5d 100644 --- a/yatexmth.el +++ b/yatexmth.el @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX math-mode-specific functions. -;;; yatexmth.el rev.3 +;;; yatexmth.el rev.4 ;;; (c )1993-1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] -;;; Last modified Sun Jan 22 23:14:51 1995 on landcruiser +;;; Last modified Fri Jan 27 23:57:40 1995 on VFR ;;; $Id$ ;;; [Customization guide] @@ -228,6 +228,9 @@ ("\\-" "leftharpoondown" "__\n\\") ("-/" "rightharpoondown" "__\n/") ("-\\" "rightharpoonup" "~~\n\\") + ;;left and right + ("left" "left" "(leftmark)") + ("right" "right" "(rightmark)") ;other marks ("Z" "aleph" "|\\|") ("|\\|" "aleph" "|\\|") @@ -671,7 +674,9 @@ (delete-region beg (point)) (call-interactively (global-key-binding this-key))) ((eq result 'select) - (message "Done.")) + (message "Done.") + (setq YaTeX-current-completion-type 'maketitle) + (insert (YaTeX-addin single-command))) ((eq result 'exit) (delete-region beg (point)) (YaTeX-toggle-math-mode)) diff --git a/yatexprc.el b/yatexprc.el index 9d25398..75db52b 100644 --- a/yatexprc.el +++ b/yatexprc.el @@ -2,7 +2,7 @@ ;;; YaTeX process handler. ;;; yatexprc.el ;;; (c )1993-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sun Jan 22 23:14:44 1995 on landcruiser +;;; Last modified Sat Jan 28 01:01:44 1995 on VFR ;;; $Id$ (require 'yatex) @@ -632,7 +632,11 @@ (setq cmd (read-string-with-history "Edit command line: " - (format cmd (YaTeX-get-preview-file-name)) + (format cmd + (if (get 'dvi2-command 'region) + (substring YaTeX-texput-file + 0 (rindex YaTeX-texput-file ?.)) + (YaTeX-get-preview-file-name))) 'YaTeX-lpr-command-history)) (save-excursion (YaTeX-visit-main t) ;;change execution directory diff --git a/yatexsec.el b/yatexsec.el index 412c253..49339e5 100644 --- a/yatexsec.el +++ b/yatexsec.el @@ -2,7 +2,7 @@ ;;; YaTeX sectioning browser. ;;; yatexsec.el ;;; (c ) 1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] -;;; Last modified Fri Nov 25 04:46:42 1994 on VFR +;;; Last modified Tue Jan 24 23:19:14 1995 on VFR ;;; $Id$ (defvar YaTeX-sectioning-level @@ -152,7 +152,8 @@ (interactive "p") (if (eq (selected-window) (minibuffer-window)) (let*((command (buffer-string)) - (aster (equal (substring command -1) "*")) + (aster (and (string< "" command) + (equal (substring command -1) "*"))) (command (if aster (substring command 0 -1) command)) (alist YaTeX-sectioning-level) (level 0))