1083 |
(if (eq major-mode 'doctex-mode) |
(if (eq major-mode 'doctex-mode) |
1084 |
;; XXX: We should probably cater for ^^A as well. |
;; XXX: We should probably cater for ^^A as well. |
1085 |
(progn |
(progn |
1086 |
(when (bolp) (skip-chars-forward "%")) |
(while (progn (if (bolp) (skip-chars-forward "%")) |
1087 |
(skip-chars-forward " \t\n") |
(> (skip-chars-forward " \t\n") 0))) |
|
(while (and (looking-at "^%*[ \t]*$") (not (eobp))) |
|
|
(beginning-of-line 2)) |
|
|
(when (bolp) (skip-chars-forward "%")) |
|
|
(skip-chars-forward " \t") |
|
1088 |
(when (eq (char-after) ?%) |
(when (eq (char-after) ?%) |
1089 |
(beginning-of-line 2))) |
(beginning-of-line 2) |
1090 |
|
t)) |
1091 |
(forward-comment 1))) |
(forward-comment 1))) |
1092 |
|
|
1093 |
|
|
1259 |
kend sbeg send cbeg cend |
kend sbeg send cbeg cend |
1260 |
cache-reset |
cache-reset |
1261 |
(parse-sexp-ignore-comments t)) ; scan-sexps ignores comments |
(parse-sexp-ignore-comments t)) ; scan-sexps ignores comments |
1262 |
(goto-char (match-end 0)) |
(save-restriction |
1263 |
(if (and asterisk (eq (following-char) ?\*)) |
;; Restrict to LIMIT. |
1264 |
(forward-char 1)) |
(narrow-to-region (point-min) limit) |
1265 |
(setq kend (point)) |
(goto-char (match-end 0)) |
1266 |
(while (and (< (point) limit) (font-latex-forward-comment))) |
(if (and asterisk (eq (following-char) ?\*)) |
1267 |
;; Optional arguments [...] |
(forward-char 1)) |
1268 |
(while (and (< (point) limit) |
(setq kend (point)) |
1269 |
(eq (following-char) ?\[)) |
(while (font-latex-forward-comment)) |
1270 |
(setq sbeg (point)) |
;; Optional arguments [...] |
1271 |
(save-restriction |
(while (eq (following-char) ?\[) |
1272 |
;; Restrict to LIMIT. |
(setq sbeg (point)) |
|
(narrow-to-region (point-min) limit) |
|
1273 |
(if (font-latex-find-matching-close ?\[ ?\]) |
(if (font-latex-find-matching-close ?\[ ?\]) |
1274 |
(setq send (point)) |
(setq send (point)) |
1275 |
(setq cache-reset t) |
(setq cache-reset t) |
1276 |
(setq send (point-max)) |
(setq send (point-max)) |
1277 |
(goto-char send)))) |
(goto-char send))) |
1278 |
;; Mandatory arguments {...} |
;; Mandatory arguments {...} |
1279 |
(dotimes (i arg-count) |
(dotimes (i arg-count) |
1280 |
(while (and (< (point) limit) (font-latex-forward-comment))) |
(while (font-latex-forward-comment)) |
1281 |
(when (and (< (point) limit) |
(when (eq (following-char) ?\{) |
1282 |
(eq (following-char) ?\{)) |
(when (= i 0) (setq cbeg (point))) |
|
(when (= i 0) (setq cbeg (point))) |
|
|
(save-restriction |
|
|
;; Restrict to LIMIT. |
|
|
(narrow-to-region (point-min) limit) |
|
1283 |
(if (font-latex-find-matching-close ?\{ ?\}) |
(if (font-latex-find-matching-close ?\{ ?\}) |
1284 |
(setq cend (point)) |
(setq cend (point)) |
1285 |
(setq cache-reset t) |
(setq cache-reset t) |