summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-11-03 17:56:03 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2013-11-03 17:56:03 -0500
commite61845c1db42405938b9dca7dfff73b4ab6aa52a (patch)
tree5dcf9ea81d4015156240064276f4b85715f7bd40 /lisp/emacs-lisp
parent295559b0fda938555055d0e7769d823428d99865 (diff)
downloademacs-e61845c1db42405938b9dca7dfff73b4ab6aa52a.tar.gz
emacs-e61845c1db42405938b9dca7dfff73b4ab6aa52a.tar.bz2
emacs-e61845c1db42405938b9dca7dfff73b4ab6aa52a.zip
* lisp/emacs-lisp/smie.el (smie-rule-parent): Always call
smie-indent-virtual rather than only for hanging tokens. (smie--next-indent-change): New helper command. * lisp/progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): Remove. (ruby-smie-rules): Use smie-rule-parent instead.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/smie.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index c4daa7a853f..26a72d7f3a7 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1236,15 +1236,7 @@ Only meaningful when called from within `smie-rules-function'."
(goto-char (cadr (smie-indent--parent)))
(cons 'column
(+ (or offset 0)
- ;; Use smie-indent-virtual when indenting relative to an opener:
- ;; this will also by default use current-column unless
- ;; that opener is hanging, but will additionally consult
- ;; rules-function, so it gives it a chance to tweak
- ;; indentation (e.g. by forcing indentation relative to
- ;; its own parent, as in fn a => fn b => fn c =>).
- (if (or (not (numberp (car smie--parent)))
- (smie-indent--hanging-p))
- (smie-indent-virtual) (current-column))))))
+ (smie-indent-virtual)))))
(defvar smie-rule-separator-outdent 2)
@@ -1837,6 +1829,15 @@ KEYWORDS are additional arguments, which can use the following keywords:
(edebug-instrument-function smie-rules-function)
(error "Sorry, don't know how to instrument a lambda expression")))
+(defun smie--next-indent-change ()
+ "Go to the next line that needs to be reindented (and reindent it)."
+ (interactive)
+ (while
+ (let ((tick (buffer-modified-tick)))
+ (indent-according-to-mode)
+ (eq tick (buffer-modified-tick)))
+ (forward-line 1)))
+
;;; User configuration
;; This is designed to be a completely independent "module", so we can play