aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2017-12-02 19:58:52 +0000
committerDmitry Gutov2017-12-02 19:58:52 +0000
commit6e75a6316fb7dcf1e089a063c83afffee2f160b7 (patch)
tree4bde52e6e682813edae535b45bca369a9b9a9b30
parent243a43bfcd4243bd6840f048625f8c4769b4b55b (diff)
downloademacs-scratch/widen-less.tar.gz
emacs-scratch/widen-less.zip
Fix prog-first-column uses as variablescratch/widen-less
-rw-r--r--lisp/emacs-lisp/smie.el2
-rw-r--r--lisp/progmodes/js.el2
-rw-r--r--lisp/progmodes/python.el13
3 files changed, 8 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index da1e12b1408..e765e07d1db 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1457,7 +1457,7 @@ in order to figure out the indentation of some other (further down) point."
1457 ;; Start the file at column 0. 1457 ;; Start the file at column 0.
1458 (save-excursion 1458 (save-excursion
1459 (forward-comment (- (point))) 1459 (forward-comment (- (point)))
1460 (if (bobp) (prog-first-column)))) 1460 (if (bobp) prog-first-column)))
1461 1461
1462(defun smie-indent-close () 1462(defun smie-indent-close ()
1463 ;; Align close paren with opening paren. 1463 ;; Align close paren with opening paren.
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 1f86909362e..b843d979d46 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -2143,7 +2143,7 @@ indentation is aligned to that column."
2143 2143
2144 ((js--continued-expression-p) 2144 ((js--continued-expression-p)
2145 (+ js-indent-level js-expr-indent-offset)) 2145 (+ js-indent-level js-expr-indent-offset))
2146 (t (prog-first-column))))) 2146 (t prog-first-column))))
2147 2147
2148;;; JSX Indentation 2148;;; JSX Indentation
2149 2149
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 104889a31f8..bdc95dfa9cd 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -287,9 +287,8 @@
287;;; 24.x Compat 287;;; 24.x Compat
288 288
289 289
290(unless (fboundp 'prog-first-column) 290(unless (boundp 'prog-first-column)
291 (defun prog-first-column () 291 (defvar prog-first-column 0))
292 0))
293 292
294 293
295;;; Bindings 294;;; Bindings
@@ -1026,7 +1025,7 @@ happening for :at-dedenter-block-start context since the
1026possibilities can be narrowed to specific indentation points." 1025possibilities can be narrowed to specific indentation points."
1027 (save-excursion 1026 (save-excursion
1028 (pcase (python-indent-context) 1027 (pcase (python-indent-context)
1029 (`(:no-indent . ,_) (prog-first-column)) ; usually 0 1028 (`(:no-indent . ,_) prog-first-column) ; usually 0
1030 (`(,(or :after-line 1029 (`(,(or :after-line
1031 :after-comment 1030 :after-comment
1032 :inside-string 1031 :inside-string
@@ -1064,7 +1063,7 @@ possibilities can be narrowed to specific indentation points."
1064 (let ((opening-block-start-points 1063 (let ((opening-block-start-points
1065 (python-info-dedenter-opening-block-positions))) 1064 (python-info-dedenter-opening-block-positions)))
1066 (if (not opening-block-start-points) 1065 (if (not opening-block-start-points)
1067 (prog-first-column) ; if not found default to first column 1066 prog-first-column ; if not found default to first column
1068 (mapcar (lambda (pos) 1067 (mapcar (lambda (pos)
1069 (save-excursion 1068 (save-excursion
1070 (goto-char pos) 1069 (goto-char pos)
@@ -1082,7 +1081,7 @@ integers. Levels are returned in ascending order, and in the
1082case INDENTATION is a list, this order is enforced." 1081case INDENTATION is a list, this order is enforced."
1083 (if (listp indentation) 1082 (if (listp indentation)
1084 (sort (copy-sequence indentation) #'<) 1083 (sort (copy-sequence indentation) #'<)
1085 (nconc (number-sequence (prog-first-column) (1- indentation) 1084 (nconc (number-sequence prog-first-column (1- indentation)
1086 python-indent-offset) 1085 python-indent-offset)
1087 (list indentation)))) 1086 (list indentation))))
1088 1087
@@ -1107,7 +1106,7 @@ minimum."
1107 (python-indent--previous-level levels (current-indentation)) 1106 (python-indent--previous-level levels (current-indentation))
1108 (if levels 1107 (if levels
1109 (apply #'max levels) 1108 (apply #'max levels)
1110 (prog-first-column))))) 1109 prog-first-column))))
1111 1110
1112(defun python-indent-line (&optional previous) 1111(defun python-indent-line (&optional previous)
1113 "Internal implementation of `python-indent-line-function'. 1112 "Internal implementation of `python-indent-line-function'.