yatex

view yatex19.el @ 70:44e3a5e1e883

Fix makefile for Windows Brush up label completion \cite completion Support much more about LaTeX2e --- [yahtml] English Info (By Jun Ohya) Automatic pixel size detection for <img src="..."> Aware global-class of css definition & for char-entity reference
author yuuji
date Sun, 09 Apr 2000 03:37:47 +0000
parents 807c1e7e68b7
children 0aaebd07dad0
line source
1 ;;; -*- Emacs-Lisp -*-
2 ;;; YaTeX facilities for Emacs 19
3 ;;; (c )1994-1999 by HIROSE Yuuji.[yuuji@yatex.org]
4 ;;; Last modified Fri Nov 26 09:56:09 1999 on firestorm
5 ;;; $Id$
7 ;;; とりあえず hilit19 を使っている時に色が付くようにして
8 ;;; メニューバーでごにょごにょできるようにしただけ。
9 ;;; いったい誰がメニューバー使ってLaTeXソース書くんだろうか?
10 ;;; まあいいや練習練習。後ろの方にちょっとコメントあり。
11 ;;; 真中辺にあるけど、hilit19.el 対応の方は結構本気。
12 ;;; とかいってるうちに hilit19 って obsolete になってしまった…
14 ;(require 'yatex)
16 (defvar YaTeX-use-hilit19 (and (featurep 'hilit19) (fboundp 'x-color-values)
17 (fboundp 'hilit-translate))
18 "*Use hilit19 to fontify buffer or not.")
20 (defvar YaTeX-mode-menu-map (make-sparse-keymap "YaTeX"))
21 (defvar YaTeX-mode-menu-map-process (make-sparse-keymap "Process"))
22 (define-key YaTeX-mode-map [menu-bar yatex]
23 (cons "YaTeX" YaTeX-mode-menu-map))
24 (YaTeX-define-menu
25 'YaTeX-mode-menu-map-process
26 (nreverse
27 '((buffer "LaTeX" . (lambda () (interactive) (YaTeX-typeset-menu nil ?j)))
28 (kill "Kill LaTeX" . (lambda () (interactive) (YaTeX-typeset-menu nil ?k)))
29 (bibtex "BibTeX" . (lambda () (interactive) (YaTeX-typeset-menu nil ?b)))
30 (mindex "makeindex" . (lambda () (interactive) (YaTeX-typeset-menu nil ?i)))
31 (preview "Preview" . (lambda () (interactive) (YaTeX-typeset-menu nil ?p)))
32 (lpr "lpr" . (lambda () (interactive) (YaTeX-typeset-menu nil ?l)))
33 (lpq "lpq" . (lambda () (interactive) (YaTeX-typeset-menu nil ?q))))))
34 (defvar YaTeX-mode-menu-map-modes (make-sparse-keymap "Modes"))
35 (YaTeX-define-menu
36 'YaTeX-mode-menu-map-modes
37 (delq nil
38 (nreverse
39 (list
40 (if YaTeX-auto-math-mode nil
41 (cons 'math (cons "Toggle math-mode"
42 '(lambda () (interactive)
43 (YaTeX-switch-mode-menu nil ?t)))))
44 (cons 'mod (cons "Toggle Modify Mode"
45 '(lambda () (interactive)
46 (YaTeX-switch-mode-menu nil ?m))))))))
47 (defvar YaTeX-mode-menu-map-percent (make-sparse-keymap "percent"))
48 (YaTeX-define-menu
49 'YaTeX-mode-menu-map-percent
50 (nreverse
51 '((! "Change LaTeX typesetter(%#!)"
52 . (lambda () (interactive) (YaTeX-%-menu nil nil ?!)))
53 (begend "Set %#BEGIN-%#END on region"
54 . (lambda () (interactive) (YaTeX-%-menu nil nil ?b)))
55 (lpr "Change LPR format"
56 . (lambda () (interactive) (YaTeX-%-menu nil nil ?l))))))
58 (defvar YaTeX-mode-menu-map-jump (make-sparse-keymap "jump"))
59 (YaTeX-define-menu
60 'YaTeX-mode-menu-map-jump
61 (nreverse
62 '((corres "Goto corersponding position" . YaTeX-goto-corresponding-*)
63 (main "Visit main source"
64 . (lambda () (interactive) (YaTeX-visit-main)))
65 (main-other "Visit main source other window"
66 . YaTeX-visit-main-other-window))))
68 (defvar YaTeX-mode-menu-map-comment (make-sparse-keymap "comment"))
69 (YaTeX-define-menu
70 'YaTeX-mode-menu-map-comment
71 (nreverse
72 '((comment "Comment region or environment" . YaTeX-comment-region)
73 (uncomment "Unomment region or environment" . YaTeX-uncomment-region)
74 (commentp "Comment paragraph" . YaTeX-comment-paragraph)
75 (uncommentp "Uncomment paragraph" . YaTeX-uncomment-paragraph))))
77 (YaTeX-define-menu
78 'YaTeX-mode-menu-map
79 (nreverse
80 (list
81 ;; Change/Kill/Fill -------------------------------------------------------
82 (cons (list 'chg "Change") (cons "Change macros" 'YaTeX-change-*))
83 (cons (list 'kill "Kill") (cons "Kill macros" 'YaTeX-kill-*))
84 (cons (list 'fill "Fill") (cons "Fill \\item" 'YaTeX-fill-item))
85 (cons (list 'nl "Newline") (cons "Newline" 'YaTeX-intelligent-newline))
86 ;; ========================================================================
87 (cons (list 'sep1 "---") (cons "---" nil))
88 ;; Comment/Uncomment ------------------------------------------------------
89 (cons (list 'comment "comment") (cons "Comment region or environment"
90 'YaTeX-comment-region))
91 (cons (list 'uncomment "uncomment") (cons "Uncomment region or environment"
92 'YaTeX-uncomment-region))
93 (cons (list 'commentp "commentp") (cons "Comment paragraph"
94 'YaTeX-comment-paragraph))
95 (cons (list 'uncommentp "uncommentp") (cons "Uncomment paragraph"
96 'YaTeX-uncomment-paragraph))
97 ;; ========================================================================
98 (cons (list 'sep2 "---") (cons "---" nil))
99 ;; Jump cursor ------------------------------------------------------------
100 (cons (list 'jump "jump") (cons "Jump Cursor" YaTeX-mode-menu-map-jump))
101 ;; Document hierarchy ---------------------------------------------------
102 (cons (list 'hier "hier") (cons "Display Document hierarchy"
103 'YaTeX-display-hierarchy))
104 ;; What position ----------------------------------------------------------
105 (cons (list 'col "column") (cons "What column in tabular"
106 'YaTeX-what-column))
107 ;; % menu -----------------------------------------------------------------
108 (cons (list 'percent "percent") (cons "Edit %# notation"
109 YaTeX-mode-menu-map-percent))
110 ;; Switch modes -----------------------------------------------------------
111 (cons (list 'mode "mode") (cons "Switching YaTeX's modes"
112 YaTeX-mode-menu-map-modes))
113 ;; ========================================================================
114 (cons (list 'sep "---") (cons "---" nil))
115 ;; Help for LaTeX ---------------------------------------------------------
116 (cons (list 'ap "apr") (cons "Apropos on LaTeX commands" 'YaTeX-apropos))
117 (cons (list 'help "help") (cons "Help on LaTeX commands" 'YaTeX-help))
118 ;; Menu for Typeset relating processes ------------------------------------
119 (cons (list 'process "Process menu")
120 (cons "Process" YaTeX-mode-menu-map-process)))
121 ))
123 ;; Make section-type commands menu -------------------------------------------
124 (defvar YaTeX-mode-menu-map-sectionr
125 (make-sparse-keymap "Enclose region with section-type macro"))
126 (defvar YaTeX-mode-menu-map-section (make-sparse-keymap "Section-type macro"))
127 (let ((sorted-section
128 (sort
129 (delq nil
130 (mapcar (function (lambda (s)
131 (if (> (length (car s)) 5)
132 (car s))))
133 (append section-table user-section-table)))
134 'string<)))
135 (YaTeX-define-menu
136 'YaTeX-mode-menu-map-section
137 (mapcar
138 (function (lambda (secname)
139 (cons (intern secname)
140 (cons secname
141 (list 'lambda ()
142 (list 'interactive)
143 (list 'YaTeX-make-section
144 nil nil nil
145 secname))))))
146 sorted-section))
147 (YaTeX-define-menu
148 'YaTeX-mode-menu-map-sectionr
149 (mapcar
150 (function (lambda (secname)
151 (cons (intern secname)
152 (cons secname
153 (list 'lambda ()
154 (list 'interactive)
155 (list 'YaTeX-make-section
156 nil
157 (list 'region-beginning)
158 (list 'region-end)
159 secname))))))
160 sorted-section)))
162 (YaTeX-define-menu
163 'YaTeX-mode-menu-map
164 (nreverse
165 (list
166 (cons '(sectionr "Section-type (long name)")
167 (cons "Section type" YaTeX-mode-menu-map-section))
168 (cons '(section "Section-type region (long name)")
169 (cons "Section type region (long name)"
170 YaTeX-mode-menu-map-sectionr)))))
172 ;; Make large-type commands menu ---------------------------------------------
173 (defvar YaTeX-mode-menu-map-envr (make-sparse-keymap "Environment region"))
174 (defvar YaTeX-mode-menu-map-env (make-sparse-keymap "Environment"))
176 (let ((sorted-env
177 (sort
178 (mapcar (function (lambda (s) (car s)))
179 (append env-table user-env-table))
180 'string<)))
181 (YaTeX-define-menu
182 'YaTeX-mode-menu-map-env
183 (mapcar
184 (function (lambda (envname)
185 (cons (intern envname)
186 (cons envname
187 (list 'lambda ()
188 (list 'interactive)
189 (list 'YaTeX-insert-begin-end
190 envname nil))))))
191 sorted-env))
192 (YaTeX-define-menu
193 'YaTeX-mode-menu-map-envr
194 (mapcar
195 (function (lambda (envname)
196 (cons (intern envname)
197 (cons envname
198 (list 'lambda ()
199 (list 'interactive)
200 (list 'YaTeX-insert-begin-end
201 envname t))))))
202 sorted-env)))
203 (YaTeX-define-menu
204 'YaTeX-mode-menu-map
205 (nreverse
206 (list
207 (cons '(envr "Environment")
208 (cons "Environment" YaTeX-mode-menu-map-env))
209 (cons '(env "Environment region")
210 (cons "Environment region"
211 YaTeX-mode-menu-map-envr)))))
213 (and (featurep 'xemacs)
214 (add-hook 'yatex-mode-hook
215 '(lambda ()
216 (or (assoc "YaTeX" current-menubar)
217 (progn
218 (set-buffer-menubar (copy-sequence current-menubar))
219 (add-submenu nil YaTeX-mode-menu-map))))))
221 ;; Other key bindings for window-system
222 ;(YaTeX-define-key [?\C- ] 'YaTeX-do-completion)
223 (define-key YaTeX-mode-map [?\M-\C- ] 'YaTeX-mark-environment)
225 ;; Highlightening
226 ;; メニューに比べてこっちは結構本気でやってます。
227 ;; だって文書構造がとっても分かり易いんだもん。
228 ;; みんなも hilit19.el を使おう!
229 ;;
230 ;; さて、まずは対応する {} をピカピカ範囲とするような関数を作る。
231 ;; これは hilit-LaTeX.el を参考にした。でも、ちゃんと section 型コマンドの
232 ;; 引数を数えて正しい位置までピカピカさせるよ〜ん!
234 (defun YaTeX-19-region-section-type (pattern)
235 "Return list of starting and end point of section-type commands of PATTERN."
236 (if (re-search-forward pattern nil t)
237 (let ((m0 (match-beginning 0)) (e0 (match-end 0)) cmd (argc 1))
238 (setq cmd (substring (YaTeX-match-string 0) 1)
239 argc (or (car (cdr (YaTeX-lookup-table cmd 'section))) argc))
240 (if (= argc 0) (cons m0 (point)) ;引数個数0ならマッチした領域
241 (skip-chars-forward " \n\t*")
242 (while (looking-at "\\[") (forward-list 1)) ;optionならスキップ
243 (skip-chars-forward " \n\t")
244 (if (looking-at "{") ;{}が始まるならちゃんとしたsection型
245 (cons m0
246 (progn ;(skip-chars-backward "^{") (forward-char -2)
247 (while (> argc 0)
248 (skip-chars-forward "^{")
249 (forward-list 1)
250 (setq argc (1- argc)))
251 (point)))
252 ;{}でないならたぶん \verb 環境などにあるダミー
253 (cons m0 e0))))))
255 (defun YaTeX-19-region-large-type (pattern)
256 "Return list of large-type contents.
257 Assumes PATTERN begins with `{'."
258 (if (re-search-forward pattern nil t)
259 (let ((m0 (match-beginning 0)))
260 (goto-char m0)
261 (skip-chars-forward "^ \t\n")
262 (skip-chars-forward " \t\n")
263 (cons (point)
264 (progn (goto-char m0) (forward-list 1)
265 (1- (point)))))))
267 ;; 些細なことだが % の前の文字もピカリとさせてしまうようで… >hilit19
268 ;; ↓この関数は下の hilit-set-mode-patterns の "[^\\]\\(%\\).*$" に
269 ;; 依存している
270 (defun YaTeX-19-region-comment (pattern)
271 "Return list of comment start and end point."
272 (if (re-search-forward pattern nil t)
273 (cons (match-beginning 2) (match-end 0))))
275 ;;(make-face 'tt)
276 ;;(set-face-font 'tt "-schumacher-clean-medium-r-normal--*-*-*-*-*-*-*-*")
277 ;;(hilit-translate 'tt "white")
279 (defvar YaTeX-hilit-patterns-alist
280 '(
281 ;; comments
282 (YaTeX-19-region-comment "\\([^\\]\\|^\\)\\(%\\).*$" comment)
284 (YaTeX-19-region-section-type "\\\\footnote\\(mark\\|text\\)?\\>" keyword)
285 ("\\\\[a-z]+box" 0 keyword)
286 (YaTeX-19-region-section-type "\\\\\\(v\\|h\\)space\\>" keyword)
288 ;; (re-)define new commands/environments/counters
289 (YaTeX-19-region-section-type
290 "\\\\\\(re\\)?new\\(environment\\|command\\|theorem\\|length\\|counter\\)\\>"
291 defun)
292 (YaTeX-19-region-section-type
293 "\\\\textbf\\>" bold)
295 ;; various declarations/definitions
296 (YaTeX-19-region-section-type
297 "\\\\\\(set\\|setto\\|addto\\)\\(length\\|width\\|counter\\)\\>"
298 define)
299 (YaTeX-19-region-section-type
300 "\\\\\\(title\\|author\\|date\\|thanks\\)\\>" define)
302 ("\\\\document\\(style\\|class\\)\\(\\[.*\\]\\)?{" "}" decl)
303 ("\\\\\\(begin\\|end\\|nofiles\\|includeonly\\){" "}" decl)
304 ("\\\\\\(raggedright\\|makeindex\\|makeglossary\\|maketitle\\)\\b" 0 decl)
305 ("\\\\\\(pagestyle\\|thispagestyle\\|pagenumbering\\){" "}" decl)
306 ("\\\\\\(normalsize\\|small\\|footnotesize\\|scriptsize\\|tiny\\|large\\|Large\\|LARGE\\|huge\\|Huge\\)\\b" 0 decl)
307 ("\\\\\\(appendix\\|tableofcontents\\|listoffigures\\|listoftables\\)\\b"
308 0 decl)
309 ("\\\\\\(bf\\|em\\|it\\|rm\\|sf\\|sl\\|ss\\|tt\\)\\b" 0 decl)
311 ;; label-like things
312 ;;this should be customized by YaTeX-item-regexp
313 ("\\\\\\(sub\\)*item\\b\\(\\[[^]]*\\]\\)?" 0 label)
314 (YaTeX-19-region-section-type
315 "\\\\caption\\(\\[[^]]*\\]\\)?\\>" label)
317 ;; things that do some sort of cross-reference
318 (YaTeX-19-region-section-type
319 "\\\\\\(\\(no\\)?cite\\|\\(page\\)?ref\\|label\\|index\\|glossary\\)\\>"
320 crossref)
322 ;; things that bring in external files
323 ("\\\\\\(include\\|input\\|bibliography\\){" "}" include)
325 ;; formulas
326 ("[^\\]\\\\(" "\\\\)" formula) ; \( \)
327 ("[^\\]\\\\\\[" "\\\\\\]" formula) ; \[ \]
328 ("\\\\begin{\\(eqn\\|equation\\|x?x?align\\|split\\|multline\\|gather\\)"
329 "\\\\end{\\(eqn\\|equation\\|x?x?align\\|split\\|multline\\|gather\\).*}"
330 formula)
331 ("[^\\$]\\($\\($[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula); '$...$' or '$$...$$'
333 ;; "wysiwyg" emphasis -- these don't work on nested expressions
334 (YaTeX-19-region-large-type "{\\\\\\(em\\|it\\|sl\\)" italic)
335 (YaTeX-19-region-large-type "{\\\\bf" bold)
336 ;;;(YaTeX-19-region-large-type "{\\\\tt" tt)
337 ;;;("\\\\begin{verbatim" "\\\\end{verbatim" tt)
339 ("``" "''" string))
340 "*Hiliting pattern alist for LaTeX text.")
342 ;;(defvar YaTeX-hilit-pattern-adjustment-default nil)
343 ;; ↑いらなくなった。
344 (defvar YaTeX-hilit-pattern-adjustment-private nil
345 "*Adjustment hilit-pattern-alist for default yatex-mode's pattern.")
346 (defvar YaTeX-hilit-sectioning-face
347 '(yellow/dodgerblue yellow/slateblue)
348 "*Hilightening face for sectioning unit. '(FaceForLight FaceForDark)")
349 (defvar YaTeX-hilit-sectioning-attenuation-rate
350 '(15 40)
351 "*Maximum attenuation rate of sectioning face. '(ForeRate BackRate)
352 Each rate specifies how much portion of RGB value should be attenuated
353 towards to lowest sectioning unit. Numbers should be written in percentage.")
354 (defvar YaTeX-sectioning-patterns-alist nil
355 "Hilightening patterns for sectioning units.")
356 (defvar YaTeX-hilit-singlecmd-face
357 '(slateblue2 aquamarine)
358 "*Hilightening face for maketitle type. '(FaceForLight FaceForDark)")
360 ;;; セクションコマンドを、構造レベルの高さに応じて色の濃度を変える
361 ;;; 背景が黒でないと何が嬉しいのか分からないに違いない.
362 ;;; もしかして白地の時は構造レベルに応じて色を明るくしたほうが良いのか?
363 ;(if (fboundp 'win32-color-values)
364 ; (fset 'x-color-values 'win32-color-values))
366 (cond
367 (YaTeX-use-hilit19
368 (let*((sectface
369 (car (if (eq hilit-background-mode 'dark)
370 (cdr YaTeX-hilit-sectioning-face)
371 YaTeX-hilit-sectioning-face)))
372 (sectcol (symbol-name sectface))
373 sect-pat-alist)
374 (if (string-match "/" sectcol)
375 (let ((fmin (nth 0 YaTeX-hilit-sectioning-attenuation-rate))
376 (bmin (nth 1 YaTeX-hilit-sectioning-attenuation-rate))
377 colorvalue fR fG fB bR bG bB pat fg bg level from face list lm)
378 (require 'yatexsec)
379 (setq fg (substring sectcol 0 (string-match "/" sectcol))
380 bg (substring sectcol (1+ (string-match "/" sectcol)))
381 colorvalue (x-color-values fg)
382 fR (/ (nth 0 colorvalue) 256)
383 fG (/ (nth 1 colorvalue) 256)
384 fB (/ (nth 2 colorvalue) 256)
385 colorvalue (x-color-values bg)
386 bR (/ (nth 0 colorvalue) 256)
387 bG (/ (nth 1 colorvalue) 256)
388 bB (/ (nth 2 colorvalue) 256)
389 lm YaTeX-sectioning-max-level
390 list YaTeX-sectioning-level)
391 (while list
392 (setq pat (concat YaTeX-ec-regexp (car (car list))
393 ;"\\*?\\(\\[[^]]*\\]\\)?\\>" ;改行はさむと駄目
394 "\\>"
395 )
396 level (cdr (car list))
397 fg (format "hex-%02x%02x%02x"
398 (- fR (/ (* level fR fmin) lm 100))
399 (- fG (/ (* level fG fmin) lm 100))
400 (- fB (/ (* level fB fmin) lm 100)))
401 bg (format "hex-%02x%02x%02x"
402 (- bR (/ (* level bR bmin) lm 100))
403 (- bG (/ (* level bG bmin) lm 100))
404 (- bB (/ (* level bB bmin) lm 100)))
405 from (intern (format "sectioning-%d" level))
406 face (intern (concat fg "/" bg)))
407 (hilit-translate from face)
408 (setq sect-pat-alist
409 (cons;;(list pat "}" face)
410 (list 'YaTeX-19-region-section-type pat face)
411 sect-pat-alist))
412 (setq list (cdr list)))
413 (setq YaTeX-sectioning-patterns-alist sect-pat-alist))))))
415 ;; ローカルなマクロを読み込んだ後 redraw すると
416 ;; ローカルマクロを keyword として光らせる(keywordじゃまずいかな…)。
417 (defun YaTeX-19-collect-macros ()
418 (cond
419 (YaTeX-use-hilit19
420 (let ((get-face
421 (function
422 (lambda (table)
423 (cond
424 ((eq hilit-background-mode 'light) (car table))
425 ((eq hilit-background-mode 'dark) (car (cdr table)))
426 (t nil)))))
427 sect single)
428 (hilit-translate
429 ;;sectioning (funcall get-face YaTeX-hilit-sectioning-face)
430 macro (funcall get-face YaTeX-hilit-singlecmd-face))
431 (if (setq sect (append user-section-table tmp-section-table))
432 (setq sect (concat "\\\\\\("
433 (mapconcat
434 (function
435 (lambda (s) (regexp-quote (car s))))
436 sect
437 "\\|")
438 "\\)\\>")))
439 (if (setq single (append user-singlecmd-table tmp-singlecmd-table))
440 (setq single (concat "\\\\\\("
441 (mapconcat
442 (function (lambda (s) (regexp-quote (car s))))
443 single
444 "\\|")
445 "\\)\\b")))
446 (setq hilit-patterns-alist ;Remove at first.
447 (delq (assq 'yatex-mode hilit-patterns-alist) hilit-patterns-alist)
448 hilit-patterns-alist
449 (cons
450 (cons 'yatex-mode
451 (append
452 (list nil)
453 YaTeX-sectioning-patterns-alist
454 YaTeX-hilit-pattern-adjustment-private
455 ;;YaTeX-hilit-pattern-adjustment-default
456 YaTeX-hilit-patterns-alist
457 (delq nil
458 (list
459 (if sect (list
460 'YaTeX-19-region-section-type
461 sect
462 'keyword))
463 (if single (list single 0 'macro))))))
464 hilit-patterns-alist))))))
465 ;;(YaTeX-19-collect-macros) ;causes an error
466 (defun YaTeX-hilit-recenter (arg)
467 "Collect current local macro and hilit-recenter."
468 (interactive "P")
469 (YaTeX-19-collect-macros)
470 (hilit-recenter arg))
471 (if (fboundp 'hilit-recenter) ;Replace hilit-recenter with
472 (mapcar (function (lambda (key) ;YaTeX-hilit-recenter in yatex-mode
473 (define-key YaTeX-mode-map key 'YaTeX-hilit-recenter)))
474 (where-is-internal 'hilit-recenter)))
476 (defun YaTeX-switch-to-new-window ()
477 (let ((c 0) (i 1) (free (make-string win:max-configs ? )))
478 (while (< i win:max-configs)
479 (or (aref win:configs i) (aset free i (+ i win:base-key)))
480 (setq i (1+ i)))
481 (while (not (string-match (char-to-string c) free))
482 (message "Which window to create? [%s]: " free)
483 (setq c (read-char)))
484 (message "Creating window [%c]" c)
485 (set-buffer (get-buffer-create "*scratch*"))
486 (win:switch-window (- c win:base-key))))
488 (defun YaTeX-visit-main-other-frame ()
489 "Visit main file in other frame.
490 WARNING, This code is not perfect."
491 (interactive)
492 (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.")
493 (let (parent)
494 (save-excursion (YaTeX-visit-main t) (setq parent (current-buffer)))
495 (cond
496 ((get-buffer-window parent t)
497 (goto-buffer-window parent))
498 ((and (featurep 'windows) win:use-frame)
499 (YaTeX-switch-to-new-window)
500 (switch-to-buffer parent))
501 (t (switch-to-buffer-other-frame (buffer-name parent)))))))
503 (defun YaTeX-goto-corresponding-*-other-frame (arg)
504 "Go to corresponding object in other frame."
505 (interactive "P")
506 (let (b p)
507 (save-window-excursion
508 (save-excursion
509 (YaTeX-goto-corresponding-* arg)
510 (setq b (current-buffer) p (point))))
511 (cond
512 ((get-buffer-window b t)
513 (goto-buffer-window b)
514 (goto-char p))
515 ((and (featurep 'windows) win:use-frame)
516 (YaTeX-switch-to-new-window)
517 (switch-to-buffer b)
518 (goto-char p))
519 (t (switch-to-buffer-other-frame (buffer-name b))
520 (goto-char p))))
521 )
523 ;;; reverseVideo にして hilit-background-mode を 'dark
524 ;;; にしている人は数式などが暗くなりすぎて見づらいかもしれない。
525 ;;; 次のコードを hilit19 をロードしている場所の直後に置くとちょっ
526 ;;; とはまし。
527 ;;; (if (eq hilit-background-mode 'dark)
528 ;;; (hilit-translate
529 ;;; string 'mediumspringgreen
530 ;;; formula 'khaki
531 ;;; label 'yellow-underlined))
532 (and YaTeX-emacs-19
533 (not (featurep 'xemacs))
534 (boundp 'byte-compile-current-file)
535 (if (and (boundp 'window-system) window-system)
536 (require 'hilit19)
537 (error "Byte compile this file on window system! Not `-nw'!")))
539 (provide 'yatex19)