aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2017-05-23 09:23:54 -0400
committerStefan Monnier2017-05-23 09:23:54 -0400
commit9b0662d3698692f99384cfc8d1bd0b41b0625e09 (patch)
treec5f96437c1945b3d9bded176f53f904307c4d92c
parent2eee73e7bf5a6bee18272248876eb8820d3db568 (diff)
downloademacs-9b0662d3698692f99384cfc8d1bd0b41b0625e09.tar.gz
emacs-9b0662d3698692f99384cfc8d1bd0b41b0625e09.zip
* lisp/emacs-lisp/cl-indent.el: Don't require CL. Use lexical-binding.
(common-lisp-indent-function-1): Remove unused var `last-point`. (lisp-indent-error-function): Move defvar before first use.
-rw-r--r--lisp/emacs-lisp/cl-indent.el34
1 files changed, 16 insertions, 18 deletions
diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el
index 33ecf3f4542..9941d173596 100644
--- a/lisp/emacs-lisp/cl-indent.el
+++ b/lisp/emacs-lisp/cl-indent.el
@@ -1,4 +1,4 @@
1;;; cl-indent.el --- enhanced lisp-indent mode 1;;; cl-indent.el --- Enhanced lisp-indent mode -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1987, 2000-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1987, 2000-2017 Free Software Foundation, Inc.
4 4
@@ -35,7 +35,7 @@
35 35
36;;; Code: 36;;; Code:
37 37
38(eval-when-compile (require 'cl)) 38(eval-when-compile (require 'cl-lib))
39 39
40(defgroup lisp-indent nil 40(defgroup lisp-indent nil
41 "Indentation in Lisp." 41 "Indentation in Lisp."
@@ -187,13 +187,13 @@ the standard lisp indent package."
187 (when (and (eq lisp-indent-backquote-substitution-mode 'corrected)) 187 (when (and (eq lisp-indent-backquote-substitution-mode 'corrected))
188 (save-excursion 188 (save-excursion
189 (goto-char (elt state 1)) 189 (goto-char (elt state 1))
190 (incf loop-indentation 190 (cl-incf loop-indentation
191 (cond ((eq (char-before) ?,) -1) 191 (cond ((eq (char-before) ?,) -1)
192 ((and (eq (char-before) ?@) 192 ((and (eq (char-before) ?@)
193 (progn (backward-char) 193 (progn (backward-char)
194 (eq (char-before) ?,))) 194 (eq (char-before) ?,)))
195 -2) 195 -2)
196 (t 0))))) 196 (t 0)))))
197 197
198 (goto-char indent-point) 198 (goto-char indent-point)
199 (beginning-of-line) 199 (beginning-of-line)
@@ -315,7 +315,6 @@ instead."
315 ;; If non-nil, this is an indentation to use 315 ;; If non-nil, this is an indentation to use
316 ;; if nothing else specifies it more firmly. 316 ;; if nothing else specifies it more firmly.
317 tentative-calculated 317 tentative-calculated
318 (last-point indent-point)
319 ;; the position of the open-paren of the innermost containing list 318 ;; the position of the open-paren of the innermost containing list
320 (containing-form-start (elt state 1)) 319 (containing-form-start (elt state 1))
321 ;; the column of the above 320 ;; the column of the above
@@ -410,9 +409,9 @@ instead."
410 ;; ",(...)" or ",@(...)" 409 ;; ",(...)" or ",@(...)"
411 (when (eq lisp-indent-backquote-substitution-mode 410 (when (eq lisp-indent-backquote-substitution-mode
412 'corrected) 411 'corrected)
413 (incf sexp-column -1) 412 (cl-incf sexp-column -1)
414 (when (eq (char-after (1- containing-sexp)) ?\@) 413 (when (eq (char-after (1- containing-sexp)) ?\@)
415 (incf sexp-column -1))) 414 (cl-incf sexp-column -1)))
416 (cond (lisp-indent-backquote-substitution-mode 415 (cond (lisp-indent-backquote-substitution-mode
417 (setf tentative-calculated normal-indent) 416 (setf tentative-calculated normal-indent)
418 (setq depth lisp-indent-maximum-backtracking) 417 (setq depth lisp-indent-maximum-backtracking)
@@ -465,7 +464,6 @@ instead."
465 function method path state indent-point 464 function method path state indent-point
466 sexp-column normal-indent))))) 465 sexp-column normal-indent)))))
467 (goto-char containing-sexp) 466 (goto-char containing-sexp)
468 (setq last-point containing-sexp)
469 (unless calculated 467 (unless calculated
470 (condition-case () 468 (condition-case ()
471 (progn (backward-up-list 1) 469 (progn (backward-up-list 1)
@@ -474,6 +472,9 @@ instead."
474 (or calculated tentative-calculated)))) 472 (or calculated tentative-calculated))))
475 473
476 474
475;; Dynamically bound in common-lisp-indent-call-method.
476(defvar lisp-indent-error-function)
477
477(defun common-lisp-indent-call-method (function method path state indent-point 478(defun common-lisp-indent-call-method (function method path state indent-point
478 sexp-column normal-indent) 479 sexp-column normal-indent)
479 (let ((lisp-indent-error-function function)) 480 (let ((lisp-indent-error-function function))
@@ -484,9 +485,6 @@ instead."
484 (lisp-indent-259 method path state indent-point 485 (lisp-indent-259 method path state indent-point
485 sexp-column normal-indent)))) 486 sexp-column normal-indent))))
486 487
487;; Dynamically bound in common-lisp-indent-call-method.
488(defvar lisp-indent-error-function)
489
490(defun lisp-indent-report-bad-format (m) 488(defun lisp-indent-report-bad-format (m)
491 (error "%s has a badly-formed %s property: %s" 489 (error "%s has a badly-formed %s property: %s"
492 ;; Love those free variable references!! 490 ;; Love those free variable references!!
@@ -717,7 +715,7 @@ optional\\|rest\\|key\\|allow-other-keys\\|aux\\|whole\\|body\\|environment\
717 (forward-sexp 2) 715 (forward-sexp 2)
718 (skip-chars-forward " \t\n") 716 (skip-chars-forward " \t\n")
719 (while (looking-at "\\sw\\|\\s_") 717 (while (looking-at "\\sw\\|\\s_")
720 (incf nqual) 718 (cl-incf nqual)
721 (forward-sexp) 719 (forward-sexp)
722 (skip-chars-forward " \t\n")) 720 (skip-chars-forward " \t\n"))
723 (> nqual 0))) 721 (> nqual 0)))
@@ -726,7 +724,7 @@ optional\\|rest\\|key\\|allow-other-keys\\|aux\\|whole\\|body\\|environment\
726 path state indent-point sexp-column normal-indent)) 724 path state indent-point sexp-column normal-indent))
727 725
728 726
729(defun lisp-indent-function-lambda-hack (path state indent-point 727(defun lisp-indent-function-lambda-hack (path _state _indent-point
730 sexp-column normal-indent) 728 sexp-column normal-indent)
731 ;; indent (function (lambda () <newline> <body-forms>)) kludgily. 729 ;; indent (function (lambda () <newline> <body-forms>)) kludgily.
732 (if (or (cdr path) ; wtf? 730 (if (or (cdr path) ; wtf?