branch: master commit 7d2a306ee7ad7b84fb53dd1f676ae6dd4ad1a40c Author: Ivan Andrus <darthand...@gmail.com> Commit: Ivan Andrus <darthand...@gmail.com>
Fix indentation in rnc-mode * rnc-mode.el (rnc-smie-forward-token,rnc-smie-backward-token): Only move one character for a punctuation token. --- packages/rnc-mode/rnc-mode.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/rnc-mode/rnc-mode.el b/packages/rnc-mode/rnc-mode.el index 9a08b5e..30f3c39 100644 --- a/packages/rnc-mode/rnc-mode.el +++ b/packages/rnc-mode/rnc-mode.el @@ -4,7 +4,7 @@ ;; Author: Stefan Monnier <monn...@iro.umontreal.ca> ;; Keywords: xml relaxng -;; Version: 0.1 +;; Version: 0.2 ;; This file is part of GNU Emacs. @@ -106,7 +106,12 @@ (forward-comment -1) (= (point) start))) " ; " - (smie-default-forward-token)))) + (if (looking-at "\\s.") + (buffer-substring-no-properties + (point) + (progn (forward-char 1) + (point))) + (smie-default-forward-token))))) (defun rnc-smie-backward-token () (let ((start (point))) @@ -118,7 +123,12 @@ (looking-at "\\(?:\\s_\\|\\sw\\)+[ \t\n]*[|&]?=") (goto-char pos)))) " ; " - (smie-default-backward-token)))) + (if (looking-back "\\s." (1- (point))) + (buffer-substring-no-properties + (point) + (progn (forward-char -1) + (point))) + (smie-default-backward-token))))) (defun rnc-smie-rules (kind token) (pcase (cons kind token)