comparison yatexenv.el @ 49:eb0512bfcb7f

Abolish user-article table. Use normal read-string instead. Supply smart add-in function for documentstyle. Update user dictionary whenever new words entered. Enhance [prefix] c. Allow user defined sectioning commands in yatexsec.
author yuuji
date Fri, 25 Nov 1994 08:26:13 +0000
parents cd1b63102eed
children 5f4b18da14b3
comparison
equal deleted inserted replaced
48:a0640ff3f72f 49:eb0512bfcb7f
1 ;;; -*- Emacs-Lisp -*- 1 ;;; -*- Emacs-Lisp -*-
2 ;;; YaTeX environment-specific functions. 2 ;;; YaTeX environment-specific functions.
3 ;;; yatexenv.el 3 ;;; yatexenv.el
4 ;;; (c ) 1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 4 ;;; (c ) 1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
5 ;;; Last modified Tue Sep 20 01:35:46 1994 on figaro 5 ;;; Last modified Thu Nov 24 04:33:18 1994 on 98fa
6 ;;; $Id$ 6 ;;; $Id$
7 7
8 ;;; 8 ;;;
9 ;; Functions for tabular environment 9 ;; Functions for tabular environment
10 ;;; 10 ;;;
11 11
12 ;; Showing the matching column of tabular environment. 12 ;; Showing the matching column of tabular environment.
13 (defun YaTeX-array-what-column () 13 (defun YaTeX-array-what-column ()
14 "Show matching columne title of array environment. 14 "Show matching columne title of array environment.
15 When calling from a program, make sure to be in array/tabular environment." 15 When calling from a program, make sure to be in array/tabular environment."
16 (let ((p (point)) beg eot bor (nlptn "\\\\\\\\") (andptn "[^\\]&") (n 0) 16 (let ((p (point)) beg eot bor (nlptn "\\\\\\\\") (andptn "[^\\]&")
17 (n 0) j
17 (firsterr "This line might be the first row.")) 18 (firsterr "This line might be the first row."))
18 (save-excursion 19 (save-excursion
19 (YaTeX-beginning-of-environment) 20 (YaTeX-beginning-of-environment)
20 (search-forward "{" p) (up-list 1) 21 (search-forward "{" p) (up-list 1)
21 (search-forward "{" p) (up-list 1) 22 (search-forward "{" p) (up-list 1)
44 (buffer-substring (match-beginning 1) 45 (buffer-substring (match-beginning 1)
45 (match-end 1))) 46 (match-end 1)))
46 -1))))) 47 -1)))))
47 (message "%s" n) 48 (message "%s" n)
48 (goto-char (1- beg)) 49 (goto-char (1- beg))
49 (cond 50 (setq j n)
50 ((= n 1) (message "Here is the FIRST column!")) 51 (while (> j 1)
51 (t (while (> n 1) 52 (or (re-search-forward andptn p nil)
52 (or (re-search-forward andptn p nil) 53 (error "This column exceeds the limit."))
53 (error "This column exceeds the limit.")) 54 (setq j (1- j)))
54 (setq n (1- n))) 55 (skip-chars-forward "\\s ")
55 (skip-chars-forward "\\s ") 56 (message
56 (message 57 "This is the column(#%d) of: %s" n
57 "Here is the column of: %s" 58 (buffer-substring
58 (buffer-substring 59 (point)
59 (point) 60 (progn
60 (progn 61 (re-search-forward (concat andptn "\\|" nlptn) eot)
61 (re-search-forward (concat andptn "\\|" nlptn) eot) 62 (goto-char (match-beginning 0))
62 (goto-char (match-beginning 0)) 63 (if (looking-at andptn)
63 (if (looking-at andptn) 64 (forward-char 1))
64 (forward-char 1)) 65 (skip-chars-backward "\\s ")
65 (skip-chars-backward "\\s ") 66 (point))))))
66 (point))))))))
67 ) 67 )
68 68
69 ;;;###autoload 69 ;;;###autoload
70 (defun YaTeX-what-column () 70 (defun YaTeX-what-column ()
71 "Show which kind of column the current position is belonging to." 71 "Show which kind of column the current position is belonging to."

yatex.org