Lines Matching defs:indent

34 (require "indent")
49 (:brace-indent . nil)
52 (:case-indent . t)
58 (:cont-indent . t)
60 ;; Boolean. Move cursor to the indent column after pressing <Enter>?
61 (:newline-indent . t)
78 (:only-newline-indent . nil)
81 ;; This should default to T when newline-indent is not NIL.
86 (:disable-indent . nil)
92 (:brace-indent . nil)
93 (:case-indent . nil)
95 (:cont-indent . t)
96 (:newline-indent . t)
107 (:brace-indent . t)
108 (:case-indent . nil)
110 (:cont-indent . t)
111 (:newline-indent . nil)
122 (:brace-indent . nil)
123 (:case-indent . nil)
125 (:cont-indent . t)
126 (:newline-indent . t)
150 (defindent *c-mode-indent* :main
252 (indreduce :indent
291 ((:indent :eol))
299 ((:indent :hash))
300 (setq *indent* 0)
301 (indent-macro-reject-left)
305 ((:indent :hash nil :eol))
325 ((:expression :eol :indent :expression)
351 (((or :expression :exp-comma) :eol :indent :stat)
352 ;; rule below may have removed the :indent
357 (indinit c-exp-indent)
362 ((:indent :stat :eol)
363 (:indent :stat)
367 (null c-exp-indent)
368 (/= (cdar c-exp-indent) (+ *ind-offset* *ind-length*))
376 c-exp-indent
380 (car c-exp-indent)
384 (when (consp (cdr c-exp-indent))
389 (= (caar c-exp-indent) (caadr c-exp-indent))
393 (setq *indent* (caar c-exp-indent))
394 (indent-macro-reject-left)
398 (rplacd c-exp-indent nil)
417 ((:indent :obrace))
418 (setq *indent* (offset-indentation (+ *ind-offset* *ind-length*)))
422 (indent-macro-reject-left)
435 ((:indent :expression :collon :eol))
438 *indent*
439 (- (offset-indentation *ind-offset* :resolve t) *base-indent*)
441 (indent-macro-reject-left)
465 (:else :eol :indent :if)
519 (:switch :eol :indent :stat)
528 ((:indent :switch :obrace)
531 *indent* (offset-indentation *ind-offset* :resolve t)
534 (indent-macro-reject-left)
541 ((:indent :switch :eol :indent :obrace)
544 *indent* (- (offset-indentation *ind-offset* :resolve t) *base-indent*)
547 (and *brace-indent* (incf *indent* *base-indent*))
548 (indent-macro-reject-left)
554 (not *case-indent*)
560 ((:indent :case)
563 *indent* (offset-indentation *ind-offset* :resolve t)
566 (indent-macro-reject-left)
593 (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))
594 (indent-macro-reject-left)
605 (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))
606 (indent-macro-reject-left)
617 ((:indent (or :for :while :if :else-if :else :do) :obrace)
619 (setq *indent* (offset-indentation *ind-offset* :resolve t))
620 (indent-macro-reject-left)
626 ((:indent (or :for :while :if :else-if :else :do) :eol :indent :obrace)
629 *indent*
630 (- (offset-indentation *ind-offset* :resolve t) *base-indent*)
632 (and *brace-indent* (incf *indent* *base-indent*))
633 (indent-macro-reject-left)
642 ((:indent (or :for :while :if :else-if :else :do) :eol :indent)
644 (setq *indent* (offset-indentation *ind-offset* :resolve t))
645 (indent-macro-reject-left)
649 ;; Simplify, remove old (:eol :indent)
655 ((:eol :indent))
668 (incf *indent* *base-indent*)
675 (incf *indent* *base-indent*)
681 (incf *indent* *base-indent*)
696 (incf *indent* *base-indent*)
703 (incf *indent* *base-indent*)
719 *indent*
721 *base-indent*
727 (decf *indent* *base-indent*)
729 (or *case-indent*
730 (decf *indent* *base-indent*)
742 (incf *indent* *base-indent*)
746 (incf *indent* *base-indent*)
750 (decf *indent* *base-indent*)
751 (and *case-indent* c-case-flag
752 (decf *indent* *base-indent*)
768 *indent* (- *indent* *base-indent*)
774 *cont-indent*
777 (incf *indent* *base-indent*)
783 *cont-indent*
785 (> *indent* 0)
788 (incf *indent* *base-indent*)
797 (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))
806 (defun c-offset-indent (&aux char (point (point)))
808 (while (member (setq char (char-after point)) indent-spaces)
811 (or (characterp char) (return-from c-offset-indent point))
818 (or (characterp char) (return-from c-offset-indent point))
821 (while (member (setq char (char-after point)) indent-spaces)
824 (or (characterp char) (return-from c-offset-indent point))
830 (compile 'c-offset-indent)
832 (defun c-should-indent (options)
836 (indent-clear-empty-line)
840 (and (gethash :disable-indent options)
841 (return-from c-should-indent)
856 (return-from c-should-indent)
859 ;; if at bol and should indent only when starting a line
860 (and (gethash :only-newline-indent options)
861 (return-from c-should-indent (= point start))
867 (return-from c-should-indent t)
872 (return-from c-should-indent t)
877 (return-from c-should-indent (gethash :newline-indent options))
882 (return-from c-should-indent t)
888 (gethash :cont-indent options)
896 (member (char-before offset) indent-spaces)
902 (return-from c-should-indent t)
923 (return-from c-should-indent (<= (- (caar match) offset) 2))
928 ;; Should not indent
931 (compile 'c-should-indent)
934 (defun c-indent-check (syntax syntable options
949 (member (char-before left) indent-spaces)
955 (c-indent syntax syntable)
968 (c-indent syntax syntable)
972 (defun c-indent (syntax syntable)
976 *base-indent*
977 *brace-indent*
978 *case-indent*
980 *cont-indent*
983 (or (c-should-indent options) (return-from c-indent))
986 *base-indent* (gethash :indentation options 4)
987 *brace-indent* (gethash :brace-indent options nil)
988 *case-indent* (gethash :case-indent options t)
990 *cont-indent* (gethash :cont-indent options t)
993 (indent-macro
994 *c-mode-indent*
995 (c-offset-indent)
999 (c-indent-check syntax syntable options)
1002 (compile 'c-indent)
1004 (defsyntax *c-mode* :main nil #'c-indent *c-mode-options*
1053 (syntable :comment *prop-comment* #'default-indent
1064 (syntable :string *prop-string* #'default-indent
1098 (syntable :preprocessor *prop-preprocessor* #'default-indent