Commit 38705cac authored by Raphaël Cauderlier's avatar Raphaël Cauderlier
Browse files

Merge branch 'julien@fix-albert-emacs-mode' into 'master'

[emacs mode] Fix undefined default-indent-size

See merge request !11
parents 32d676f7 9f22c53a
Pipeline #120850669 passed with stage
in 8 minutes and 34 seconds
......@@ -4,7 +4,7 @@
(defcustom albert-default-indent-size 2 "default indentation increment" )
(defcustom albert-definition-indent 0 "Indentation of definition begining")
(defcustom albert-after-definition-indent (+ albert-definition-indent default-indent-size) "Indentation of definition begining")
(defcustom albert-after-definition-indent (+ albert-definition-indent albert-default-indent-size) "Indentation of definition begining")
(defcustom albert-definition-start-keywords '("def" "type")
"Keywords starting a new definition")
......@@ -95,11 +95,11 @@
(setq not-indented nil))
((is-first-pattern) ; align on previous bar
(message "albert-indent-line : bar indented relatively to bar at %s" (what-line))
(setq current-indent (- (current-indentation) default-indent-size))
(setq current-indent (- (current-indentation) albert-default-indent-size))
(setq not-indented nil))
((non-empty-line) ; shift from previous text
(message "albert-indent-line : bar indented relatively to text at %s" (what-line))
(setq current-indent (+ (current-indentation) default-indent-size))
(setq current-indent (+ (current-indentation) albert-default-indent-size))
(setq not-indented nil))
((bobp) ;align at zero if no previous text
(message "albert-indent-line : bar indented on first line")
......@@ -124,15 +124,15 @@
(cond
((is-header) ;text is shifted from header
(message "albert-indent-line : non-empty indented relatively to header at %s" (what-line))
(setq current-indent (+ (current-indentation) default-indent-size))
(setq current-indent (+ (current-indentation) albert-default-indent-size))
(setq not-indented nil))
((is-definition-start-line) ;text is shifted from header
(message "albert-indent-line : non-empty indented relatively to definition at %s" (what-line))
(setq current-indent (+ (current-indentation) default-indent-size))
(setq current-indent (+ (current-indentation) albert-default-indent-size))
(setq not-indented nil))
((is-bar) ;text is unshifted from previous bar
(message "albert-indent-line : non-empty indented relatively to bar at %s" (what-line))
(setq current-indent (- (current-indentation) default-indent-size))
(setq current-indent (- (current-indentation) albert-default-indent-size))
(setq not-indented nil))
((and (non-empty-line) (not (is-comment))) ;text is aligned with previous non-empty, non-header/comment line
(message "albert-indent-line : non-empty indented relatively to text at %s" (what-line))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment