summaryrefslogtreecommitdiff
path: root/lisp/textmodes/reftex-index.el
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2016-11-19 13:34:24 -0500
committerMark Oteiza <mvoteiza@udel.edu>2016-11-19 13:41:09 -0500
commitb19e05b13192f72991b65b4b352e09c807fd581c (patch)
treece0ef9ef2f92c7740b7f75410a7c387717ee557f /lisp/textmodes/reftex-index.el
parent92b3528cf3e6d366086e89b9a909f0c81614a064 (diff)
downloademacs-b19e05b13192f72991b65b4b352e09c807fd581c.tar.gz
emacs-b19e05b13192f72991b65b4b352e09c807fd581c.tar.bz2
emacs-b19e05b13192f72991b65b4b352e09c807fd581c.zip
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-index.el')
-rw-r--r--lisp/textmodes/reftex-index.el30
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 3cea589a9cf..4dd190d2b0f 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -24,7 +24,7 @@
;;; Code:
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(declare-function texmathp "ext:texmathp" ())
(require 'reftex)
@@ -128,7 +128,7 @@ will prompt for other arguments."
;; Insert the macro and ask for any additional args
(insert macro)
- (loop for i from 1 to nargs do
+ (cl-loop for i from 1 to nargs do
(setq opt (member i opt-args)
value (cond ((= nindex i) key)
((equal ntag i) tag1)
@@ -214,16 +214,16 @@ will prompt for other arguments."
i -1
val nil)
(catch 'exit
- (while (and (< (incf i) len) (null val))
+ (while (and (< (cl-incf i) len) (null val))
(unless (assq (aref tag i) tag-alist)
(push (list (aref tag i)
tag
(concat (substring tag 0 i)
- "[" (substring tag i (incf i)) "]"
+ "[" (substring tag i (cl-incf i)) "]"
(substring tag i)))
tag-alist)
(throw 'exit t)))
- (push (list (+ ?0 (incf cnt)) tag
+ (push (list (+ ?0 (cl-incf cnt)) tag
(concat "[" (int-to-string cnt) "]:" tag))
tag-alist)))
(setq tag-alist (nreverse tag-alist))
@@ -317,10 +317,10 @@ will prompt for other arguments."
(define-key map "c" 'reftex-index-toggle-context)
;; The capital letters and the exclamation mark
- (loop for key across (concat "!" reftex-index-section-letters) do
- (define-key map (vector (list key))
- (list 'lambda '() '(interactive)
- (list 'reftex-index-goto-letter key))))
+ (cl-loop for key across (concat "!" reftex-index-section-letters) do
+ (define-key map (vector (list key))
+ (list 'lambda '() '(interactive)
+ (list 'reftex-index-goto-letter key))))
(easy-menu-define reftex-index-menu map
"Menu for Index buffer"
@@ -1426,7 +1426,7 @@ Here are all local bindings.
(interactive "p")
(reftex-index-phrases-parse-header t)
(while (> arg 0)
- (decf arg)
+ (cl-decf arg)
(end-of-line)
(if (re-search-forward reftex-index-phrases-phrase-regexp12 nil t)
(progn
@@ -1655,11 +1655,11 @@ this function repeatedly."
(widen)
(goto-char (point-min))
(while (re-search-forward re1 nil t)
- (incf ntimes1))
+ (cl-incf ntimes1))
(goto-char (point-min))
(while (re-search-forward re2 nil t)
(push (cons (count-lines 1 (point)) (match-string 1)) superphrases)
- (incf ntimes2))))
+ (cl-incf ntimes2))))
(save-current-buffer
(while (setq file (pop files))
(setq buf (reftex-get-file-buffer-force file))
@@ -1672,7 +1672,7 @@ this function repeatedly."
(let ((case-fold-search reftex-index-phrases-case-fold-search))
(while (re-search-forward re nil t)
(or (reftex-in-comment)
- (incf nmatches)))))))))
+ (cl-incf nmatches)))))))))
(with-output-to-temp-buffer "*Help*"
(princ (format " Phrase: %s\n" phrase))
(princ (format " Macro key: %s\n" char))
@@ -1682,7 +1682,7 @@ this function repeatedly."
(index-key
(let ((iks index-keys) (cnt 0) ik)
(while (setq ik (pop iks))
- (princ (format "Index entry %d: %s\n" (incf cnt) ik)))))
+ (princ (format "Index entry %d: %s\n" (cl-incf cnt) ik)))))
(repeat
(princ (format " Index entry: %s\n" phrase)))
(t
@@ -1943,7 +1943,7 @@ both ends."
(cond ((member char '(?y ?Y ?\ ))
;; Yes!
(replace-match rpl t t)
- (incf replace-count)
+ (cl-incf replace-count)
;; See if we should insert newlines to shorten lines
(and reftex-index-phrases-wrap-long-lines
(reftex-index-phrases-fixup-line beg end))