-;;; cl-indent.el --- enhanced lisp-indent mode
+;;; cl-indent.el --- Enhanced lisp-indent mode -*- lexical-binding:t -*-
;; Copyright (C) 1987, 2000-2017 Free Software Foundation, Inc.
;;; Code:
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(defgroup lisp-indent nil
"Indentation in Lisp."
(when (and (eq lisp-indent-backquote-substitution-mode 'corrected))
(save-excursion
(goto-char (elt state 1))
- (incf loop-indentation
- (cond ((eq (char-before) ?,) -1)
- ((and (eq (char-before) ?@)
- (progn (backward-char)
- (eq (char-before) ?,)))
- -2)
- (t 0)))))
+ (cl-incf loop-indentation
+ (cond ((eq (char-before) ?,) -1)
+ ((and (eq (char-before) ?@)
+ (progn (backward-char)
+ (eq (char-before) ?,)))
+ -2)
+ (t 0)))))
(goto-char indent-point)
(beginning-of-line)
;; If non-nil, this is an indentation to use
;; if nothing else specifies it more firmly.
tentative-calculated
- (last-point indent-point)
;; the position of the open-paren of the innermost containing list
(containing-form-start (elt state 1))
;; the column of the above
;; ",(...)" or ",@(...)"
(when (eq lisp-indent-backquote-substitution-mode
'corrected)
- (incf sexp-column -1)
+ (cl-incf sexp-column -1)
(when (eq (char-after (1- containing-sexp)) ?\@)
- (incf sexp-column -1)))
+ (cl-incf sexp-column -1)))
(cond (lisp-indent-backquote-substitution-mode
(setf tentative-calculated normal-indent)
(setq depth lisp-indent-maximum-backtracking)
function method path state indent-point
sexp-column normal-indent)))))
(goto-char containing-sexp)
- (setq last-point containing-sexp)
(unless calculated
(condition-case ()
(progn (backward-up-list 1)
(or calculated tentative-calculated))))
+;; Dynamically bound in common-lisp-indent-call-method.
+(defvar lisp-indent-error-function)
+
(defun common-lisp-indent-call-method (function method path state indent-point
sexp-column normal-indent)
(let ((lisp-indent-error-function function))
(lisp-indent-259 method path state indent-point
sexp-column normal-indent))))
-;; Dynamically bound in common-lisp-indent-call-method.
-(defvar lisp-indent-error-function)
-
(defun lisp-indent-report-bad-format (m)
(error "%s has a badly-formed %s property: %s"
;; Love those free variable references!!
(forward-sexp 2)
(skip-chars-forward " \t\n")
(while (looking-at "\\sw\\|\\s_")
- (incf nqual)
+ (cl-incf nqual)
(forward-sexp)
(skip-chars-forward " \t\n"))
(> nqual 0)))
path state indent-point sexp-column normal-indent))
-(defun lisp-indent-function-lambda-hack (path state indent-point
+(defun lisp-indent-function-lambda-hack (path _state _indent-point
sexp-column normal-indent)
;; indent (function (lambda () <newline> <body-forms>)) kludgily.
(if (or (cdr path) ; wtf?