emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/phps-mode 95e749e 028/405: Started with indentation fun


From: Stefan Monnier
Subject: [elpa] externals/phps-mode 95e749e 028/405: Started with indentation function
Date: Sat, 13 Jul 2019 09:59:33 -0400 (EDT)

branch: externals/phps-mode
commit 95e749e69fbc68b705ade0a453846af47e7fb9ac
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>

    Started with indentation function
---
 phps-functions.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/phps-functions.el b/phps-functions.el
index 48aac15..9b8382a 100644
--- a/phps-functions.el
+++ b/phps-functions.el
@@ -38,7 +38,14 @@
 
 (defun phps-mode/indent-line ()
   "Indent line."
-  )
+  (let ((data (phps-mode/lexer-get-point-data)))
+    (if (nth 0 data)
+        (progn
+          (message "inside scripting %s" data)
+          (indent-line-to (nth 1 data)))
+      (progn
+        (message "Outside scripting %s" data)
+        (indent-relative)))))
 
 (defun phps-mode/indent-region ()
   "Indent region."
@@ -47,7 +54,7 @@
 (defun phps-mode/functions-init ()
   "PHP specific init-cleanup routines."
 
-  ;; (set (make-local-variable 'indent-line-function) #'phps-mode/indent-line)
+  (set (make-local-variable 'indent-line-function) #'phps-mode/indent-line)
   ;; (set (make-local-variable 'indent-line-function) 
#'phps-mode/indent-region)
   )
 



reply via email to

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