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

Lines Matching +defs:insert +defs:char

173   (define-key ruby-mode-map "\C-c\C-e" 'ruby-insert-end)
214 "*Indentation can insert tabs in ruby mode if this is non-nil."
257 (goto-char beg)
288 (goto-char beg))))
331 (goto-char (point-min))
333 (goto-char (point-min))
351 (goto-char (match-beginning 2))
355 (cond ((= n 0) (insert " ") (backward-char))
356 ((= n -1) (insert " "))
357 ((forward-char)))))
358 (insert coding-system)))
360 (t (insert "# -*- coding: " coding-system " -*-\n"))
398 (defun ruby-special-char-p (&optional pnt)
400 (let ((c (char-before pnt)) (b (and (< (point-min) pnt) (char-before (1- pnt)))))
402 ((and (eq c ?:) (or (not b) (eq (char-syntax b) ? ))))
408 (and (or (bolp) (not (eq (char-before (point)) ?_)))
419 (forward-char -1)
421 (or (eq (char-syntax (char-before (point))) ?w)
422 (ruby-special-char-p))))
425 (not (progn (goto-char start) (ruby-singleton-class-p))))
431 (save-excursion (forward-char -1) (looking-at "\\Sw$"))))
440 (goto-char (match-end 0))
449 (let ((n 1) (c (string-to-char term))
456 (> (setq n (if (eq (char-before (point)) c)
458 (forward-char -1))
465 (if pos (goto-char pos))
482 (goto-char (match-beginning 0))
484 ((and (memq (char-before) '(?@ ?$)) (looking-at "\\sw"))
485 (goto-char pnt))
493 (goto-char end))))
501 (goto-char end))))
503 (goto-char pnt))
510 (goto-char end)))
512 (goto-char pnt))))
519 (goto-char (match-beginning 1))
520 (setq expand (not (memq (char-before) '(?q ?w))))
537 (goto-char end)))
539 (goto-char pnt))))
540 ((looking-at "\\?") ;skip ?char
544 (goto-char (match-end 0)))
546 (goto-char pnt))))
547 ((looking-at "\\$") ;skip $char
548 (goto-char pnt)
549 (forward-char 1))
552 (goto-char (point))
555 (let ((deep (ruby-deep-indent-paren-p (char-after))))
556 (if (and deep (or (not (eq (char-after) ?\{)) (ruby-expr-beg)))
560 (setq nest (cons (cons (char-after (point)) (point)) nest))
563 (setq nest (cons (cons (char-after (point)) pnt) nest))
565 (goto-char pnt)
568 (if (ruby-deep-indent-paren-p (matching-paren (char-after))
572 (forward-char)
578 (goto-char pnt))
582 (forward-char -1)
583 (setq w (char-after (point)))
587 (goto-char pnt)
588 (setq w (char-after (point)))
595 (goto-char pnt))
599 (forward-char -1)
600 (not (eq ?_ (char-after (point))))))
604 (goto-char (match-end 0)))
614 (forward-char -1)
615 (setq w (char-after (point)))
618 (goto-char pnt)
619 (setq w (char-after (point)))
625 (goto-char (match-beginning 0))
628 (goto-char pnt)
631 (goto-char pnt))
633 (goto-char (match-beginning 1))
636 (goto-char (match-end 0)))
638 (goto-char (match-end 0)))
643 (goto-char (match-end 0)))
648 (goto-char end)))
655 (let* ((id-end (goto-char (match-end 0)))
671 (goto-char end))))
673 (goto-char pnt))))
675 (goto-char pnt))
681 (goto-char ruby-indent-point)))
692 (goto-char start)
715 (and (char-after) (matching-paren (char-after)))))
718 (goto-char parse-start)
728 (goto-char (setq begin (cdr (nth 1 state))))
736 (goto-char (cdr (nth 1 state)))
740 (or (goto-char (cdr (nth 1 s))) t)))
748 (if (nth 3 state) (goto-char (nth 3 state))
749 (goto-char parse-start) (back-to-indentation))
754 (search-backward (char-to-string paren))
759 (goto-char (cdr (nth 1 state)))
764 (if (nth 3 state) (goto-char (nth 3 state))
765 (goto-char parse-start) (back-to-indentation))
773 (goto-char ruby-indent-point)
782 (and (not (eq ?_ (char-after (match-end 0))))
807 (or (ruby-special-char-p end)
811 (goto-char (or end pos))
815 (or (bobp) (forward-char -1))
822 (goto-char (match-end 0))
825 (not (ruby-special-char-p))
827 (let ((c (char-after (point))))
831 ;; (goto-char begin)
838 (or (not (eq ?| (char-after (point))))
840 (or (eolp) (forward-char -1))
846 (forward-char -1)
862 (goto-char (or begin parse-start))
868 (goto-char ruby-indent-point)
877 (insert-char last-command-char 1)
879 (delete-char -1)
880 (self-insert-command (prefix-numeric-value arg)))
954 (goto-char (cdaadr state)))
975 (if (looking-at ",\\s *") (goto-char (match-end 0)))
977 (goto-char (match-end 0)))
981 (goto-char (scan-sexps (point) 1)))
983 (not (eq (char-before (point)) ?.))
984 (not (eq (char-before (point)) ?:)))
990 (cond ((looking-at "::") (forward-char 2) t)
993 (forward-char 1) nil)))))
1015 (forward-char -1)
1017 (goto-char (scan-sexps (1+ (point)) -1))
1018 (case (char-before)
1019 (?% (forward-char -1))
1021 (if (eq (char-before (1- (point))) ?%) (forward-char -2))))
1024 (let ((c (char-to-string (char-before (match-end 0)))))
1029 (if (ruby-special-char-p) (forward-char -1)))
1032 (forward-char 1)
1034 (case (char-before)
1036 (?. (forward-char -1) t)
1038 (forward-char -1)
1039 (and (eq (char-before) (char-after)) (forward-char -1)))
1041 (forward-char -1)
1042 (eq (char-before) :)))))
1064 (goto-char beg)
1070 (defun ruby-insert-end ()
1072 (insert "end")
1105 (goto-char here)
1125 (goto-char (match-beginning 1))
1135 (goto-char (match-beginning 1))
1172 (when (eq (char-before) ?\})
1173 (delete-char -1)
1174 (if (eq (char-syntax (char-before)) ?w)
1175 (insert " "))
1176 (insert "end")
1177 (if (eq (char-syntax (char-after)) ?w)
1178 (insert " "))
1179 (goto-char orig)
1180 (delete-char 1)
1181 (if (eq (char-syntax (char-before)) ?w)
1182 (insert " "))
1183 (insert "do")
1185 (insert " ")
1186 (backward-char))
1191 (not (memq (char-syntax (char-before)) '(?w ?_))))
1194 (backward-char 3)
1196 (delete-char 3)
1197 (insert "}")
1198 (goto-char orig)
1199 (delete-char 2)
1200 (insert "{")
1202 (delete-char (- (match-end 0) (match-beginning 0) 1)))
1304 (goto-char (match-end 0))
1309 (goto-char (match-end 0)))
1311 (goto-char (match-end 0))
1316 (goto-char (match-beginning 0))
1325 (goto-char (nth 8 pss)) ; Go to the beginning of heredoc.
1330 (progn (goto-char (match-end 0)) ; And it's the last heredoc on its line...