• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/ruby-106/ruby/misc/

Lines Matching defs:indent

74 (defconst ruby-indent-beg-re
171 (define-key ruby-mode-map "\e\C-q" 'ruby-indent-exp)
172 (define-key ruby-mode-map "\t" 'ruby-indent-command)
174 (define-key ruby-mode-map "\C-j" 'ruby-reindent-then-newline-and-indent)
213 (defcustom ruby-indent-tabs-mode nil
216 (put 'ruby-indent-tabs-mode 'safe-local-variable 'booleanp)
218 (defcustom ruby-indent-level 2
221 (put 'ruby-indent-level 'safe-local-variable 'integerp)
229 "*Deep indent lists in parenthesis when non-nil.
234 (defcustom ruby-deep-indent-paren '(?\( ?\[ ?\] t)
235 "*Deep indent lists in parenthesis when non-nil. t means continuous line.
239 (defcustom ruby-deep-indent-paren-style 'space
240 "Default deep indent style."
251 (defvar ruby-indent-point nil "internal variable")
304 (make-local-variable 'indent-line-function)
305 (setq indent-line-function 'ruby-indent-line)
316 (setq indent-tabs-mode ruby-indent-tabs-mode)
369 (defun ruby-indent-line (&optional flag)
371 (ruby-indent-to (ruby-calculate-indent)))
373 (defun ruby-indent-command ()
375 (ruby-indent-line t))
377 (defun ruby-indent-to (x)
395 (indent-to x)
463 (defun ruby-deep-indent-paren-p (c &optional pos)
468 ((listp ruby-deep-indent-paren)
469 (let ((deep (assoc c ruby-deep-indent-paren)))
471 (or (cdr deep) ruby-deep-indent-paren-style))
472 ((memq c ruby-deep-indent-paren)
473 ruby-deep-indent-paren-style))))
474 ((eq c ruby-deep-indent-paren) ruby-deep-indent-paren-style)
477 (defun ruby-parse-partial (&optional end in-string nest depth pcol indent)
479 (or indent (setq indent 0))
555 (let ((deep (ruby-deep-indent-paren-p (char-after))))
568 (if (ruby-deep-indent-paren-p (matching-paren (char-after))
657 (state (list in-string nest depth pcol indent)))
666 indent (nth 4 state))
678 ruby-indent-point t)
681 (goto-char ruby-indent-point)))
693 (ruby-beginning-of-indent))
702 ;(car (nth 5 state)) ; indent
705 (defun ruby-indent-size (pos nest)
706 (+ pos (* (or nest 1) ruby-indent-level)))
708 (defun ruby-calculate-indent (&optional parse-start)
711 (let ((ruby-indent-point (point))
716 (indent 0))
719 (ruby-beginning-of-indent)
722 (setq indent (current-column))
723 (setq state (ruby-parse-region parse-start ruby-indent-point))
726 (setq indent nil)) ; do nothing
729 (let ((deep (ruby-deep-indent-paren-p (car (nth 1 state))
734 (setq indent (1- (current-column))))
737 (setq indent (1+ (current-column))))
738 ((let ((s (ruby-parse-region (point) ruby-indent-point)))
742 (setq indent (ruby-indent-size (current-column) (nth 2 state))))
744 (setq indent (current-column))
746 (paren (setq indent (1- indent)))
747 (t (setq indent (ruby-indent-size (1- indent) 1))))))
750 (setq indent (ruby-indent-size (current-column) (nth 2 state))))
752 (ruby-deep-indent-paren-p (matching-paren paren)
755 (setq indent (current-column)))))
766 (setq indent (ruby-indent-size (current-column) (nth 2 state))))
768 (setq indent (+ (current-column) ruby-indent-level)))))
771 (setq indent (ruby-indent-size (current-column) (nth 2 state)))))
772 (when indent
773 (goto-char ruby-indent-point)
778 ((and (not (ruby-deep-indent-paren-p paren
783 (setq indent (- indent ruby-indent-level))))
788 (or (ruby-deep-indent-paren-p t)
854 (setq indent
859 (eq (ruby-deep-indent-paren-p t) 'space)
865 ((car (nth 1 state)) indent)
867 (+ indent ruby-indent-level))))))))
868 (goto-char ruby-indent-point)
872 (+ indent ruby-indent-level)
873 indent))))
878 (ruby-indent-line t)
901 (defun ruby-beginning-of-indent ()
902 (and (re-search-backward (concat "^\\(" ruby-indent-beg-re "\\)\\_>")
919 (setq start (ruby-calculate-indent))
1050 (defun ruby-reindent-then-newline-and-indent ()
1055 (indent-according-to-mode)
1057 (indent-according-to-mode))
1068 (ruby-indent-line)))))
1073 (ruby-indent-line t)
1085 (defun ruby-indent-exp (&optional shutup-p)
1098 (setq column (ruby-calculate-indent start))
1103 (ruby-indent-to column)
1112 (let (mname mlist (indent 0))
1126 (setq indent (current-column))
1129 (while (and (> indent 0)
1136 (if (< (current-column) indent)
1139 (setq indent (current-column))
1478 \\[ruby-indent-command] properly indents subexpressions of multi-line
1482 The variable ruby-indent-level controls the amount of indentation.