summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2017-12-02 19:58:52 +0000
committerDmitry Gutov <dgutov@yandex.ru>2017-12-02 19:58:52 +0000
commit6e75a6316fb7dcf1e089a063c83afffee2f160b7 (patch)
tree4bde52e6e682813edae535b45bca369a9b9a9b30
parent243a43bfcd4243bd6840f048625f8c4769b4b55b (diff)
downloademacs-scratch/widen-less.tar.gz
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."
;; Start the file at column 0.
(save-excursion
(forward-comment (- (point)))
- (if (bobp) (prog-first-column))))
+ (if (bobp) prog-first-column)))
(defun smie-indent-close ()
;; 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."
((js--continued-expression-p)
(+ js-indent-level js-expr-indent-offset))
- (t (prog-first-column)))))
+ (t prog-first-column))))
;;; JSX Indentation
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 @@
;;; 24.x Compat
-(unless (fboundp 'prog-first-column)
- (defun prog-first-column ()
- 0))
+(unless (boundp 'prog-first-column)
+ (defvar prog-first-column 0))
;;; Bindings
@@ -1026,7 +1025,7 @@ happening for :at-dedenter-block-start context since the
possibilities can be narrowed to specific indentation points."
(save-excursion
(pcase (python-indent-context)
- (`(:no-indent . ,_) (prog-first-column)) ; usually 0
+ (`(:no-indent . ,_) prog-first-column) ; usually 0
(`(,(or :after-line
:after-comment
:inside-string
@@ -1064,7 +1063,7 @@ possibilities can be narrowed to specific indentation points."
(let ((opening-block-start-points
(python-info-dedenter-opening-block-positions)))
(if (not opening-block-start-points)
- (prog-first-column) ; if not found default to first column
+ prog-first-column ; if not found default to first column
(mapcar (lambda (pos)
(save-excursion
(goto-char pos)
@@ -1082,7 +1081,7 @@ integers. Levels are returned in ascending order, and in the
case INDENTATION is a list, this order is enforced."
(if (listp indentation)
(sort (copy-sequence indentation) #'<)
- (nconc (number-sequence (prog-first-column) (1- indentation)
+ (nconc (number-sequence prog-first-column (1- indentation)
python-indent-offset)
(list indentation))))
@@ -1107,7 +1106,7 @@ minimum."
(python-indent--previous-level levels (current-indentation))
(if levels
(apply #'max levels)
- (prog-first-column)))))
+ prog-first-column))))
(defun python-indent-line (&optional previous)
"Internal implementation of `python-indent-line-function'.