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

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

[nongnu] elpa/jade-mode 6b9d9507e2 010/128: can detect simple region sex


From: ELPA Syncer
Subject: [nongnu] elpa/jade-mode 6b9d9507e2 010/128: can detect simple region sexps
Date: Sat, 29 Jan 2022 08:24:42 -0500 (EST)

branch: elpa/jade-mode
commit 6b9d9507e2ebb571032dce7ca3fc86a663ad0c64
Author: brianc <brian.m.carlson@gmail.com>
Commit: brianc <brian.m.carlson@gmail.com>

    can detect simple region sexps
---
 jade-mode.el | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/jade-mode.el b/jade-mode.el
index f9f3cd479a..c5be348a50 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -80,6 +80,22 @@
         (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(\\.[A-Za-z0-9\-\_]*\\)" 
1 font-lock-function-name-face) ;; class name
         (,"^[ {2,}]+[a-z0-9_:\\-]*" 0 font-lock-comment-face)))
 
+(defun jade-next-line-indent ()
+  "Gets indentation level for next line."
+  (save-excursion
+    (next-line)
+    (current-indentation)))
+
+(defun jade-region-for-sexp ()
+  "Selects the current sexp as the region"
+  (interactive)
+  (beginning-of-line)
+  (let ((ci (current-indentation)))
+    (push-mark nil nil t)
+    (while (> (jade-next-line-indent) ci)
+      (next-line)
+      (end-of-line))))
+
 (defvar jade-mode-map (make-sparse-keymap))
 (define-key jade-mode-map [S-tab] 'jade-unindent-line)
 



reply via email to

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