;;; Code:
-(eval-when-compile
- (require 'cl))
+(eval-when-compile (require 'cl-lib))
(require 'easymenu)
(require 'cc-mode)
(buffer-syntactic-context-depth)
nil)
:EMACS
-;;; (incf antlr-statistics-inval)
+;;; (cl-incf antlr-statistics-inval)
(setq antlr-slow-context-cache nil))
(defunx antlr-syntactic-context ()
(if (>= orig antlr-slow-cache-diff-threshold)
(beginning-of-defun)
(goto-char (point-min)))
-;;; (cond ((and diff (< diff 0)) (incf antlr-statistics-full-neg))
-;;; ((and diff (>= diff 3000)) (incf antlr-statistics-full-diff))
-;;; (t (incf antlr-statistics-full-other)))
+;;; (cond ((and diff (< diff 0)) (cl-incf antlr-statistics-full-neg))
+;;; ((and diff (>= diff 3000)) (cl-incf antlr-statistics-full-diff))
+;;; (t (cl-incf antlr-statistics-full-other)))
(setq state (parse-partial-sexp (point) orig)))
(goto-char orig)
(if antlr-slow-context-cache
((nth 4 state) 'comment) ; block-comment? -- we don't care
(t (car state)))))
-;;; (incf (aref antlr-statistics 2))
+;;; (cl-incf (aref antlr-statistics 2))
;;; (unless (and (eq (current-buffer)
;;; (caar antlr-slow-context-cache))
;;; (eq (buffer-modified-tick)
;;; (cdar antlr-slow-context-cache)))
-;;; (incf (aref antlr-statistics 1))
+;;; (cl-incf (aref antlr-statistics 1))
;;; (setq antlr-slow-context-cache nil))
;;; (let* ((orig (point))
;;; (base (cadr antlr-slow-context-cache))
;;; ((eq orig (car base)) (cdr base))))
;;; diff diff2)
;;; (unless state
-;;; (incf (aref antlr-statistics 3))
+;;; (cl-incf (aref antlr-statistics 3))
;;; (when curr
;;; (if (< (setq diff (abs (- orig (car curr))))
;;; (setq diff2 (abs (- orig (car base)))))
;;; (setq state
;;; (parse-partial-sexp (car state) orig nil nil (cdr state)))
;;; (if (>= orig 3000) (beginning-of-defun) (goto-char (point-min)))
-;;; (incf (aref antlr-statistics 4))
+;;; (cl-incf (aref antlr-statistics 4))
;;; (setq cw (list orig (point) base curr))
;;; (setq state (parse-partial-sexp (point) orig)))
;;; (goto-char orig)
(antlr-skip-exception-part skip-comment))
(antlr-skip-file-prelude skip-comment))
(if (< arg 0)
- (unless (and (< (point) pos) (zerop (incf arg)))
+ (unless (and (< (point) pos) (zerop (cl-incf arg)))
;; if we have moved backward, we already moved one defun backward
(goto-char beg) ; rewind (to ";" / point)
- (while (and arg (<= (incf arg) 0))
+ (while (and arg (<= (cl-incf arg) 0))
(if (antlr-search-backward ";")
(setq beg (point))
(when (>= arg -1)
(antlr-skip-exception-part skip-comment)))
(if (<= (point) pos) ; moved backward?
(goto-char pos) ; rewind
- (decf arg)) ; already moved one defun forward
+ (cl-decf arg)) ; already moved one defun forward
(unless (zerop arg)
- (while (>= (decf arg) 0)
+ (while (>= (cl-decf arg) 0)
(antlr-search-forward ";"))
(antlr-skip-exception-part skip-comment)))))
(antlr-invalidate-context-cache)
(while (antlr-re-search-forward "\"\\(\\sw\\(\\sw\\|-\\)*\\)\"" nil)
(funcall transform (match-beginning 0) (match-end 0))
- (incf literals))))
+ (cl-incf literals))))
(message "Transformed %d literals" literals)))
(defun antlr-upcase-literals ()
(or (null ivocab)
(member ivocab import-vocabs) (push ivocab import-vocabs)))))
(if classes
- (list* (file-name-nondirectory buffer-file-name)
+ (cl-list* (file-name-nondirectory buffer-file-name)
(cons (nreverse classes) (nreverse superclasses))
(cons (nreverse export-vocabs) (nreverse import-vocabs))
antlr-language))))
(dolist (dep deps)
(let ((supers (cdadr dep))
(lang (cdr (assoc (cdddr dep) antlr-file-formats-alist))))
- (if n (incf n))
+ (if n (cl-incf n))
(antlr-makefile-insert-variable n "" " =")
(if supers
(insert " "
(if n
(let ((i 0))
(antlr-makefile-insert-variable nil "" " =")
- (while (<= (incf i) n)
+ (while (<= (cl-incf i) n)
(antlr-makefile-insert-variable i " $(" ")"))
(insert "\n" (car antlr-makefile-specification))))
(if (string-equal (car antlr-makefile-specification) "\n")
(goto-char boi)
(unless (symbolp syntax) ; direct indentation
;;(antlr-invalidate-context-cache)
- (incf indent (antlr-syntactic-context))
- (and (> indent 0) (looking-at antlr-indent-item-regexp) (decf indent))
+ (cl-incf indent (antlr-syntactic-context))
+ (and (> indent 0) (looking-at antlr-indent-item-regexp) (cl-decf indent))
(setq indent (* indent c-basic-offset)))
;; the usual major-mode indent stuff ---------------------------------
(setq orig (- (point-max) orig))
;;; Code:
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(require 'idlw-help)
;; For XEmacs
(and (or (memq t reasons)
(memq (cdr entry) reasons))
(kill-buffer (car entry))
- (incf cnt)
+ (cl-incf cnt)
(setq idlwave-outlawed-buffers
(delq entry idlwave-outlawed-buffers)))
(setq idlwave-outlawed-buffers
(idlwave-sint-classes 10 10))))
;; Make sure these are lists
- (loop for entry in entries
+ (cl-loop for entry in entries
for var = (car entry)
do (if (not (consp (symbol-value var))) (set var (list nil))))
;; Reset the system & library hash
(when (or (eq what t) (eq what 'syslib)
(null (cdr idlwave-sint-routines)))
- (loop for entry in entries
+ (cl-loop for entry in entries
for var = (car entry) for size = (nth 1 entry)
do (setcdr (symbol-value var)
(make-hash-table ':size size ':test 'equal)))
;; Reset the buffer & shell hash
(when (or (eq what t) (eq what 'bufsh)
(null (car idlwave-sint-routines)))
- (loop for entry in entries
+ (cl-loop for entry in entries
for var = (car entry) for size = (nth 1 entry)
do (setcar (symbol-value var)
(make-hash-table ':size size ':test 'equal))))))
(setq pref-list
(if (match-string 1 kwd) '("X" "Y" "Z") '("X" "Y"))
kwd (substring kwd (match-end 0)))
- (loop for x in pref-list do
+ (cl-loop for x in pref-list do
(push (list (concat x kwd) klink) kwds)))
(push (list kwd klink) kwds)))
(cons (substring name 1) link)
(if extra-kws (setq kwds (nconc kwds extra-kws)))
(setq kwds (idlwave-rinfo-group-keywords kwds link))
- (loop for idx from 0 to 1 do
+ (cl-loop for idx from 0 to 1 do
(if (aref syntax-vec idx)
(push (append (list name (if (eq idx 0) 'pro 'fun)
class '(system)
;; Clean up the syntax of routines which are actually aliases by
;; removing the "OR" from the statements
(let (syntax entry)
- (loop for x in aliases do
+ (cl-loop for x in aliases do
(setq entry (assoc x idlwave-system-routines))
(when entry
(while (string-match " +or +" (setq syntax (nth 4 entry)))
;; Duplicate and trim original routine aliases from rinfo list
;; This if for, e.g. OPENR/OPENW/OPENU
(let (alias remove-list new parts all-parts)
- (loop for x in aliases do
+ (cl-loop for x in aliases do
(when (setq parts (split-string (cdr x) "/"))
(setq new (assoc (cdr x) all-parts))
(unless new
(setcdr new (delete (car x) (cdr new)))))
;; Add any missing aliases (separate by slashes)
- (loop for x in all-parts do
+ (cl-loop for x in all-parts do
(if (cdr x)
(push (cons (nth 1 x) (car x)) aliases)))
- (loop for x in aliases do
+ (cl-loop for x in aliases do
(when (setq alias (assoc (cdr x) idlwave-system-routines))
(unless (memq alias remove-list) (push alias remove-list))
(setq alias (copy-sequence alias))
(setcar alias (car x))
(push alias idlwave-system-routines)))
- (loop for x in remove-list do
+ (cl-loop for x in remove-list do
(delq x idlwave-system-routines))))
(defun idlwave-convert-xml-clean-sysvar-aliases (aliases)
;; Duplicate and trim original routine aliases from rinfo list
;; This if for, e.g. !X, !Y, !Z.
(let (alias remove-list)
- (loop for x in aliases do
+ (cl-loop for x in aliases do
(when (setq alias (assoc (cdr x) idlwave-system-variables-alist))
(unless (memq alias remove-list) (push alias remove-list))
(setq alias (copy-sequence alias))
(setcar alias (car x))
(push alias idlwave-system-variables-alist)))
- (loop for x in remove-list do
+ (cl-loop for x in remove-list do
(delq x idlwave-system-variables-alist))))
(while rinfo
(setq elem (car rinfo)
rinfo (cdr rinfo))
- (incf elem-cnt)
+ (cl-incf elem-cnt)
(when (listp elem)
(setq type (car elem)
props (car (cdr elem)))
"Return the class alist - make it if necessary."
(or idlwave-class-alist
(let (class)
- (loop for x in idlwave-routines do
+ (cl-loop for x in idlwave-routines do
(when (and (setq class (nth 2 x))
(not (assq class idlwave-class-alist)))
(push (list class) idlwave-class-alist)))
(let (file (cnt 0))
(catch 'exit
(while entries
- (incf cnt)
+ (cl-incf cnt)
(setq file (idlwave-routine-source-file (nth 3 (car entries))))
(if (and file (idlwave-syslib-p file))
(throw 'exit cnt)
(progn (up-list -1) t)
(error nil))
(setq pos (point))
- (incf cnt)
+ (cl-incf cnt)
(when (and (= (following-char) ?\()
(re-search-backward
"\\(::\\|\\<\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\="
(while (setq re (pop regexps))
(if (string-match re name) (throw 'exit t))))))
- (loop for entry in (idlwave-routines) do
+ (cl-loop for entry in (idlwave-routines) do
(and (nth 2 entry) ; non-nil class
(memq (nth 2 entry) super-classes) ; an inherited class
(eq (nth 1 entry) type) ; correct type
"")
(if (> total 1) "- " ""))
entry props)
- (incf cnt)
+ (cl-incf cnt)
(when (and all (> cnt idlwave-rinfo-max-source-lines))
;; No more source lines, please
(insert (format
(> (idlwave-count-memq 'lib (nth 2 (car dtwins))) 1)
(> (idlwave-count-memq 'user (nth 2 (car dtwins))) 1)
(> (idlwave-count-memq 'buffer (nth 2 (car dtwins))) 1))
- (incf cnt)
+ (cl-incf cnt)
(insert (format "\n%s%s"
(idlwave-make-full-name (nth 2 routine)
(car routine))
(cnt 0)
source type type-cons file alist syslibp key)
(while (setq entry (pop entries))
- (incf cnt)
+ (cl-incf cnt)
(setq source (nth 3 entry)
type (car source)
type-cons (cons type (nth 3 source))