diff options
author | Mark Oteiza <mvoteiza@udel.edu> | 2016-11-19 13:34:24 -0500 |
---|---|---|
committer | Mark Oteiza <mvoteiza@udel.edu> | 2016-11-19 13:41:09 -0500 |
commit | b19e05b13192f72991b65b4b352e09c807fd581c (patch) | |
tree | ce0ef9ef2f92c7740b7f75410a7c387717ee557f /lisp/textmodes/reftex-parse.el | |
parent | 92b3528cf3e6d366086e89b9a909f0c81614a064 (diff) | |
download | emacs-b19e05b13192f72991b65b4b352e09c807fd581c.tar.gz |
Port RefTeX to cl-lib
* lisp/textmodes/reftex-auc.el:
* lisp/textmodes/reftex-cite.el: Use cl-lib.
(reftex-do-citation, reftex-create-bibtex-file): Substitute cl-lib
macros.
* lisp/textmodes/reftex-dcr.el: Use cl-lib.
(reftex-view-regexp-match): Substitute cl-lib macro.
* lisp/textmodes/reftex-global.el: Use cl-lib.
(reftex-find-duplicate-labels, reftex-renumber-simple-labels):
(reftex-translate): Substitute cl-lib macros.
* lisp/textmodes/reftex-index.el: Use cl-lib.
(reftex-index, reftex-index-select-tag, reftex-index-mode-map):
(reftex-index-next-phrase, reftex-index-phrases-info):
(reftex-query-index-phrase): Substitute cl-lib macros.
* lisp/textmodes/reftex-parse.el: Use cl-lib.
(reftex-parse-from-file, reftex-where-am-I, reftex-what-macro):
(reftex-nth-arg, reftex-init-section-numbers, reftex-section-number):
Substitute cl-lib macros.
* lisp/textmodes/reftex-ref.el: Use cl-lib.
(reftex-uniquify-label, reftex-offer-label-menu): Substitute cl-lib
macros.
* lisp/textmodes/reftex-sel.el: Use cl-lib.
(reftex-select-shared-map): Set keymap parent to special-mode-map.
Flatten loop and remove digits and hyphen definitions from the map.
(reftex-select-label-mode-map):
(reftex-select-bib-mode-map): Use cl-lib macro, and flatten other loop.
(reftex-insert-docstruct, reftex-select-unmark): Use cl-lib macros.
* lisp/textmodes/reftex-vars.el (reftex-vref-is-default): Use
cl-pushnew.
* lisp/textmodes/reftex.el: Use cl-lib.
(reftex-docstruct-symbol): Use cl-incf.
(reftex-ref-style-toggle): Replace add-to-list with append.
(reftex-compile-variables): Use cl-lib macros, and functions with
compiler macros. cl-first is just an alias.
(reftex-parse-args, reftex-scanning-info-available-p):
(reftex-select-external-document, reftex-get-file-buffer-force): Use
cl-lib macros.
(reftex-isearch-minor-mode): Replace add-to-list with append.
Diffstat (limited to 'lisp/textmodes/reftex-parse.el')
-rw-r--r-- | lisp/textmodes/reftex-parse.el | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 1d6fa311d5f..9180bea3d3b 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -24,7 +24,7 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) (require 'reftex) @@ -306,7 +306,7 @@ of master file." (when reftex-support-index (setq index-entry (reftex-index-info file)) (when index-entry - (add-to-list 'reftex--index-tags (nth 1 index-entry)) + (cl-pushnew (nth 1 index-entry) reftex--index-tags :test #'equal) (push index-entry docstruct)))) ((match-end 11) @@ -608,7 +608,7 @@ if the information is exact (t) or approximate (nil)." found) (save-excursion (while (not rtn) - (incf cnt) + (cl-incf cnt) (setq found (re-search-backward (reftex-everything-regexp) nil t)) (setq rtn (cond @@ -672,7 +672,7 @@ if the information is exact (t) or approximate (nil)." (when (and (eq (car (car list)) 'index) (string= (nth 2 index-info) (nth 2 (car list)))) - (incf n) + (cl-incf n) (setq dist (abs (- (point) (nth 4 (car list))))) (if (or (not last-dist) (< dist last-dist)) (setq last-dist dist last (car list)))) @@ -841,8 +841,8 @@ considered an argument of macro \\macro." (let ((forward-sexp-function nil)) (backward-sexp) t) (error nil))) - (if (eq (following-char) ?\[) (incf cnt-opt)) - (incf cnt)) + (if (eq (following-char) ?\[) (cl-incf cnt-opt)) + (cl-incf cnt)) (setq pos (point)) (when (and (or (= (following-char) ?\[) (= (following-char) ?\{)) @@ -984,18 +984,18 @@ OPT-ARGS is a list of argument numbers which are optional." (while (< cnt n) (while (and (member cnt opt-args) (eq (following-char) ?\{)) - (incf cnt)) + (cl-incf cnt)) (when (< cnt n) (unless (and (condition-case nil (or (forward-list 1) t) (error nil)) (reftex-move-to-next-arg) - (incf cnt)) + (cl-incf cnt)) (setq cnt 1000)))) (while (and (memq cnt opt-args) (eq (following-char) ?\{)) - (incf cnt))) + (cl-incf cnt))) (if (and (= n cnt) (> (skip-chars-forward "{\\[") 0)) (reftex-context-substring) @@ -1057,7 +1057,7 @@ When point is just after a { or [, limit string to matching parenthesis" (- (string-to-char number-string) ?A -1)) (aset reftex-section-numbers i (string-to-number number-string))) (pop numbers)) - (decf i))) + (cl-decf i))) (put 'reftex-section-numbers 'appendix appendix)) ;;;###autoload @@ -1081,7 +1081,7 @@ When LEVEL is non-nil, increase section numbers on that level." (if (or (not partspecial) (not (= idx 1))) (aset reftex-section-numbers idx 0)) - (incf idx)))) + (cl-incf idx)))) (if partspecial (setq string (concat "Part " (reftex-roman-number (aref reftex-section-numbers 0)))) @@ -1091,7 +1091,7 @@ When LEVEL is non-nil, increase section numbers on that level." (if (not (and partspecial (not (equal string "")))) (setq string (concat string (if (not (string= string "")) "." "") (int-to-string n)))) - (incf idx)) + (cl-incf idx)) (save-match-data (if (string-match "\\`\\([@0]\\.\\)+" string) (setq string (replace-match "" nil nil string))) |