Added ajustable indentation
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
(define-key map "\C-j" 'newline-and-indent)
|
(define-key map "\C-j" 'newline-and-indent)
|
||||||
map)
|
map)
|
||||||
"Keymap for KRL major mode")
|
"Keymap for KRL major mode")
|
||||||
|
(defvar krl-indent-offset 2
|
||||||
|
"Indentation step for nested KRL blocks.")
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.src\\'" . krl-mode))
|
(add-to-list 'auto-mode-alist '("\\.src\\'" . krl-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.dat\\'" . krl-mode))
|
(add-to-list 'auto-mode-alist '("\\.dat\\'" . krl-mode))
|
||||||
@@ -267,13 +269,13 @@
|
|||||||
(setq ind 0))
|
(setq ind 0))
|
||||||
((looking-at krl-indent-regex-toplevel-block-open)
|
((looking-at krl-indent-regex-toplevel-block-open)
|
||||||
;(message "found tlb open")
|
;(message "found tlb open")
|
||||||
(setq ind (+ 2 (current-indentation))))
|
(setq ind (+ krl-indent-offset (current-indentation))))
|
||||||
((looking-at krl-indent-regex-nested-block-close)
|
((looking-at krl-indent-regex-nested-block-close)
|
||||||
;(message "found nb close")
|
;(message "found nb close")
|
||||||
(setq ind (current-indentation)))
|
(setq ind (current-indentation)))
|
||||||
((looking-at krl-indent-regex-nested-block-open)
|
((looking-at krl-indent-regex-nested-block-open)
|
||||||
;(message "found nb open")
|
;(message "found nb open")
|
||||||
(setq ind (+ 2 (current-indentation))))
|
(setq ind (+ krl-indent-offset (current-indentation))))
|
||||||
(t
|
(t
|
||||||
;(message "found other")
|
;(message "found other")
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user