Skip to content

Commit 42bb850

Browse files
author
Travis Jefferson
committed
fix some compile warnings and sexp-region
* Some compile warnings were in need of attention; there's one left re: syntactic keywords for font-lock that I think might be better left as-is * Added a next-line-indentation function to fix a stale ref in jade-region-for-sexp. This seems to work now.
1 parent c4014d8 commit 42bb850

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

jade-mode.el

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
(require 'font-lock)
77
(require 'js)
88

9+
(defvar jade-tab-width)
10+
911
(defun jade-debug (string &rest args)
1012
"Prints a debug message"
1113
(apply 'message (append (list string) args)))
@@ -187,8 +189,8 @@ declaration"
187189
(beginning-of-line)
188190
(let ((ci (current-indentation)))
189191
(push-mark nil nil t)
190-
(while (> (jade-next-line-indent) ci)
191-
(next-line)
192+
(while (> (jade-next-line-indentation) ci)
193+
(forward-line)
192194
(end-of-line))))
193195

194196
(defun jade-indent ()
@@ -307,6 +309,19 @@ Follows indentation behavior of `indent-rigidly'."
307309
(let ((prev-line-indent (current-indentation)))
308310
prev-line-indent)))
309311

312+
(defun jade-next-line-indentation ()
313+
"Get the indentation of the next (non-blank) line (from point)."
314+
(interactive)
315+
(save-excursion
316+
317+
;; move down to the next non-blank line (or buffer end)
318+
(while (progn ;; progn used to get do...while control flow
319+
(forward-line 1)
320+
(message "cur line %d" (line-number-at-pos))
321+
(and (jade-blank-line-p) (not (= (point-at-eol) (point-max))))))
322+
(let ((next-line-indent (current-indentation)))
323+
next-line-indent)))
324+
310325
(defun jade-newline-and-indent ()
311326
"Insert newline and indent to parent's indentation level."
312327
(interactive)

0 commit comments

Comments
 (0)