comparison yatexsec.el @ 451:2011de73a671 dev

Who owes the incompatibility of string-to-int?
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 21 Feb 2017 15:46:12 +0859
parents 8ee8514e06ed
children 5eb2b1d824f3
comparison
equal deleted inserted replaced
450:8871fe9f563b 451:2011de73a671
1 ;;; yatexsec.el --- YaTeX sectioning browser 1 ;;; yatexsec.el --- YaTeX sectioning browser
2 ;;; 2 ;;;
3 ;;; (c) 1994-2013 by HIROSE Yuuji [yuuji@yatex.org] 3 ;;; (c) 1994-2017 by HIROSE Yuuji [yuuji@yatex.org]
4 ;;; Last modified Sun Dec 21 14:16:35 2014 on firestorm 4 ;;; Last modified Sun Dec 21 14:16:35 2014 on firestorm
5 ;;; $Id$ 5 ;;; $Id$
6 6
7 ;;; Code: 7 ;;; Code:
8 (defvar YaTeX-sectioning-level 8 (defvar YaTeX-sectioning-level
132 (YaTeX-showup-buffer YaTeX-sectioning-buffer-parent nil t) 132 (YaTeX-showup-buffer YaTeX-sectioning-buffer-parent nil t)
133 (or 133 (or
134 (and ln (string< "" ln) 134 (and ln (string< "" ln)
135 (progn 135 (progn
136 (goto-char (point-min)) 136 (goto-char (point-min))
137 (forward-line (max 0 (- (string-to-int ln) 2))) 137 (forward-line (max 0 (- (YaTeX-str2int ln) 2)))
138 (and 138 (and
139 (search-forward ptn nil t) 139 (search-forward ptn nil t)
140 (goto-char (match-beginning 0))))) 140 (goto-char (match-beginning 0)))))
141 (progn 141 (progn
142 (goto-char (point-max)) 142 (goto-char (point-max))
343 (setq secbuf (YaTeX-collect-sections)) 343 (setq secbuf (YaTeX-collect-sections))
344 (YaTeX-showup-buffer secbuf nil t) 344 (YaTeX-showup-buffer secbuf nil t)
345 (set-buffer secbuf) 345 (set-buffer secbuf)
346 (goto-char (point-max)) 346 (goto-char (point-max))
347 (while (re-search-backward pattern nil t) 347 (while (re-search-backward pattern nil t)
348 (if (< ln (string-to-int (YaTeX-match-string 1))) nil 348 (if (< ln (YaTeX-str2int (YaTeX-match-string 1))) nil
349 (beginning-of-line) 349 (beginning-of-line)
350 (search-forward YaTeX-ec) 350 (search-forward YaTeX-ec)
351 (looking-at YaTeX-TeX-token-regexp) 351 (looking-at YaTeX-TeX-token-regexp)
352 (setq command (YaTeX-match-string 0)) 352 (setq command (YaTeX-match-string 0))
353 (end-of-line) 353 (end-of-line)

yatex.org