Skip to content

Instantly share code, notes, and snippets.

@siassaj
Created September 13, 2012 01:54
Show Gist options
  • Save siassaj/3711360 to your computer and use it in GitHub Desktop.
Save siassaj/3711360 to your computer and use it in GitHub Desktop.
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
+(4 nil)
(setq indent (+ (current-column) ruby-indent-level))
(cond ((looking-at "do\\>[^_]") (if (nth 3 state) (goto-char (nth 3 state)) (goto-char parse-start) (back-to-indentation)) (setq indent (ruby-indent-size (current-column) (nth 2 state)))) (t (setq indent (+ (current-column) ruby-indent-level))))
(cond ((nth 0 state) (setq indent nil)) ((car (nth 1 state)) (goto-char (setq begin (cdr (nth 1 state)))) (let ((deep (ruby-deep-indent-paren-p (car (nth 1 state)) (1- (cdr ...))))) (if deep (cond ((and (eq deep t) (eq ... paren)) (skip-syntax-backward " ") (setq indent (1- ...))) ((let (...) (and ... ... ...)) (forward-word -1) (setq indent (ruby-indent-size ... ...))) (t (setq indent (current-column)) (cond (...) (paren ...) (t ...)))) (if (nth 3 state) (goto-char (nth 3 state)) (goto-char parse-start) (back-to-indentation)) (setq indent (ruby-indent-size (current-column) (nth 2 state)))) (and (eq (car (nth 1 state)) paren) (ruby-deep-indent-paren-p (matching-paren paren) (1- (cdr (nth 1 state)))) (search-backward (char-to-string paren)) (setq indent (current-column))))) ((and (nth 2 state) (> (nth 2 state) 0)) (if (null (cdr (nth 1 state))) (error "invalid nest")) (goto-char (cdr (nth 1 state))) (forward-word -1) (setq begin (point)) (cond ((looking-at "do\\>[^_]") (if (nth 3 state) (goto-char (nth 3 state)) (goto-char parse-start) (back-to-indentation)) (setq indent (ruby-indent-size (current-column) (nth 2 state)))) (t (setq indent (+ (current-column) ruby-indent-level))))) ((and (nth 2 state) (< (nth 2 state) 0)) (setq indent (ruby-indent-size (current-column) (nth 2 state)))))
(let ((ruby-indent-point (point)) (case-fold-search nil) state bol eol begin op-end (paren (progn (skip-syntax-forward " ") (and (char-after) (matching-paren (char-after))))) (indent 0)) (if parse-start (goto-char parse-start) (ruby-beginning-of-indent) (setq parse-start (point))) (back-to-indentation) (setq indent (current-column)) (setq state (ruby-parse-region parse-start ruby-indent-point)) (cond ((nth 0 state) (setq indent nil)) ((car (nth 1 state)) (goto-char (setq begin (cdr (nth 1 state)))) (let ((deep (ruby-deep-indent-paren-p (car ...) (1- ...)))) (if deep (cond ((and ... ...) (skip-syntax-backward " ") (setq indent ...)) ((let ... ...) (forward-word -1) (setq indent ...)) (t (setq indent ...) (cond ... ... ...))) (if (nth 3 state) (goto-char (nth 3 state)) (goto-char parse-start) (back-to-indentation)) (setq indent (ruby-indent-size (current-column) (nth 2 state)))) (and (eq (car (nth 1 state)) paren) (ruby-deep-indent-paren-p (matching-paren paren) (1- (cdr ...))) (search-backward (char-to-string paren)) (setq indent (current-column))))) ((and (nth 2 state) (> (nth 2 state) 0)) (if (null (cdr (nth 1 state))) (error "invalid nest")) (goto-char (cdr (nth 1 state))) (forward-word -1) (setq begin (point)) (cond ((looking-at "do\\>[^_]") (if (nth 3 state) (goto-char (nth 3 state)) (goto-char parse-start) (back-to-indentation)) (setq indent (ruby-indent-size (current-column) (nth 2 state)))) (t (setq indent (+ (current-column) ruby-indent-level))))) ((and (nth 2 state) (< (nth 2 state) 0)) (setq indent (ruby-indent-size (current-column) (nth 2 state))))) (when indent (goto-char ruby-indent-point) (end-of-line) (setq eol (point)) (beginning-of-line) (cond ((and (not (ruby-deep-indent-paren-p paren (and ... ...))) (re-search-forward ruby-negative eol t)) (and (not (eq 95 (char-after ...))) (setq indent (- indent ruby-indent-level)))) ((and (save-excursion (beginning-of-line) (not (bobp))) (or (ruby-deep-indent-paren-p t) (null (car ...)))) (let (end done) (while (not done) (skip-chars-backward " \n") (setq end (point)) (beginning-of-line) (if (re-search-forward "^\\s *#" end t) (beginning-of-line) (setq done t)))) (setq bol (point)) (end-of-line) (skip-chars-backward " ") (let (end (pos (point))) (beginning-of-line) (while (and (re-search-forward "#" pos t) (setq end ...) (or ... ...)) (setq end nil)) (goto-char (or end pos)) (skip-chars-backward " ") (setq begin (if (and end ...) pos (cdr ...))) (setq state (ruby-parse-region parse-start (point)))) (or (bobp) (forward-char -1)) (and (or (and (looking-at ruby-symbol-re) (skip-chars-backward ruby-symbol-chars) (looking-at ...) (not ...) (save-excursion ... ...)) (and (looking-at ruby-operator-re) (not ...) (let ... ...))) (setq indent (cond (... ... ... ... ...) (... indent) (t ...))))))) (goto-char ruby-indent-point) (beginning-of-line) (skip-syntax-forward " ") (if (looking-at "\\.[^.]") (+ indent ruby-indent-level) indent))
(save-excursion (beginning-of-line) (let ((ruby-indent-point (point)) (case-fold-search nil) state bol eol begin op-end (paren (progn (skip-syntax-forward " ") (and (char-after) (matching-paren (char-after))))) (indent 0)) (if parse-start (goto-char parse-start) (ruby-beginning-of-indent) (setq parse-start (point))) (back-to-indentation) (setq indent (current-column)) (setq state (ruby-parse-region parse-start ruby-indent-point)) (cond ((nth 0 state) (setq indent nil)) ((car (nth 1 state)) (goto-char (setq begin (cdr (nth 1 state)))) (let ((deep (ruby-deep-indent-paren-p ... ...))) (if deep (cond (... ... ...) (... ... ...) (t ... ...)) (if (nth 3 state) (goto-char ...) (goto-char parse-start) (back-to-indentation)) (setq indent (ruby-indent-size ... ...))) (and (eq (car ...) paren) (ruby-deep-indent-paren-p (matching-paren paren) (1- ...)) (search-backward (char-to-string paren)) (setq indent (current-column))))) ((and (nth 2 state) (> (nth 2 state) 0)) (if (null (cdr (nth 1 state))) (error "invalid nest")) (goto-char (cdr (nth 1 state))) (forward-word -1) (setq begin (point)) (cond ((looking-at "do\\>[^_]") (if (nth 3 state) (goto-char ...) (goto-char parse-start) (back-to-indentation)) (setq indent (ruby-indent-size ... ...))) (t (setq indent (+ ... ruby-indent-level))))) ((and (nth 2 state) (< (nth 2 state) 0)) (setq indent (ruby-indent-size (current-column) (nth 2 state))))) (when indent (goto-char ruby-indent-point) (end-of-line) (setq eol (point)) (beginning-of-line) (cond ((and (not (ruby-deep-indent-paren-p paren ...)) (re-search-forward ruby-negative eol t)) (and (not (eq 95 ...)) (setq indent (- indent ruby-indent-level)))) ((and (save-excursion (beginning-of-line) (not ...)) (or (ruby-deep-indent-paren-p t) (null ...))) (let (end done) (while (not done) (skip-chars-backward " \n") (setq end ...) (beginning-of-line) (if ... ... ...))) (setq bol (point)) (end-of-line) (skip-chars-backward " ") (let (end (pos ...)) (beginning-of-line) (while (and ... ... ...) (setq end nil)) (goto-char (or end pos)) (skip-chars-backward " ") (setq begin (if ... pos ...)) (setq state (ruby-parse-region parse-start ...))) (or (bobp) (forward-char -1)) (and (or (and ... ... ... ... ...) (and ... ... ...)) (setq indent (cond ... ... ...)))))) (goto-char ruby-indent-point) (beginning-of-line) (skip-syntax-forward " ") (if (looking-at "\\.[^.]") (+ indent ruby-indent-level) indent)))
ruby-calculate-indent()
(ruby-indent-to (ruby-calculate-indent))
ruby-indent-line()
indent-for-tab-command(nil)
call-interactively(indent-for-tab-command nil nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment