emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/widen-less 6e75a63 2/2: Fix prog-first-column uses


From: Dmitry Gutov
Subject: [Emacs-diffs] scratch/widen-less 6e75a63 2/2: Fix prog-first-column uses as variable
Date: Sat, 2 Dec 2017 15:01:38 -0500 (EST)

branch: scratch/widen-less
commit 6e75a6316fb7dcf1e089a063c83afffee2f160b7
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Fix prog-first-column uses as variable
---
 lisp/emacs-lisp/smie.el  |  2 +-
 lisp/progmodes/js.el     |  2 +-
 lisp/progmodes/python.el | 13 ++++++-------
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index da1e12b..e765e07 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 1f86909..b843d97 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 104889a..bdc95df 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'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]