• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/progmodes/

Lines Matching +defs:indent +defs:string

40 ;; (setq pascal-indent-level       3
41 ;; pascal-case-indent 2
43 ;; pascal-tab-always-indent t
48 ;; "integer" "real" "string" "record")
117 ;;; Regular expressions used to calculate indent, etc.
187 (defcustom pascal-indent-level 3
192 (defcustom pascal-case-indent 2
203 (defcustom pascal-indent-nested-functions t
208 (defcustom pascal-tab-always-indent t
245 '("array" "file" "packed" "char" "integer" "real" "string" "record")
250 :type '(repeat (string :tag "Keyword"))
260 :type '(repeat (string :tag "Keyword"))
269 :type '(repeat (string :tag "Keyword"))
308 (defsubst pascal-within-string ()
337 pascal-indent-level (default 3)
339 pascal-case-indent (default 2)
344 pascal-indent-nested-functions (default t)
346 pascal-tab-always-indent (default t)
367 (make-local-variable 'indent-line-function)
368 (setq indent-line-function 'pascal-indent-line)
369 (make-local-variable 'comment-indent-function)
370 (setq comment-indent-function 'pascal-indent-comment)
399 "Terminate line and indent next line."
406 (pascal-indent-line)))
410 (pascal-indent-line)
414 ;; Check if we shall indent inside comment
429 (pascal-indent-line)
439 (pascal-indent-line))
444 "Insert `:' and do all indentions except line indent on this line."
447 ;; Do nothing if within string.
448 (if (pascal-within-string)
452 (pascal-indent-line))
453 (let ((pascal-tab-always-indent nil))
454 (pascal-indent-command))))
460 (if (eq (car (pascal-calculate-indent)) 'declaration)
461 (let ((pascal-tab-always-indent nil))
462 (pascal-indent-command))))
465 "Insert `#', and indent to column 0 if this is a CPP directive."
475 ;; Do nothing if within a string or in a CPP directive.
476 (if (or (pascal-within-string)
480 ;; If pascal-tab-always-indent, indent the beginning of the line.
481 (if pascal-tab-always-indent
484 (pascal-indent-line))
488 (pascal-indent-line)
490 (pascal-indent-command)))
507 (pascal-indent-line)))
512 (pascal-indent-line)
617 (or (nth 3 state) (nth 4 state))) ; Inside string or comment
650 (or (nth 3 state) (nth 4 state))) ; Inside string or comment
747 (let ((type (car (pascal-calculate-indent))))
789 (defconst pascal-indent-alist
790 '((block . (+ ind pascal-indent-level))
791 (case . (+ ind pascal-case-indent))
793 (declaration . (+ ind pascal-indent-level))
794 (paramlist . (pascal-indent-paramlist t))
795 (comment . (pascal-indent-comment))
797 (unknown . ind) (string . 0) (progbeg . 0)))
799 (defun pascal-indent-command ()
801 (let* ((indent-str (pascal-calculate-indent))
802 (type (car indent-str)))
806 (pascal-indent-paramlist)
807 (pascal-indent-paramlist))
811 (pascal-indent-declaration))
815 (pascal-indent-case)))
819 (defun pascal-indent-line ()
821 (let* ((indent-str (pascal-calculate-indent))
822 (type (car indent-str))
823 (ind (car (cdr indent-str))))
833 (; Other things should have no extra indent
835 (indent-to ind))
838 (if (and pascal-indent-nested-functions
840 (indent-to (+ ind pascal-indent-level))
841 (indent-to ind)))
843 (indent-to (eval (cdr (assoc type pascal-indent-alist))))
846 (defun pascal-calculate-indent ()
847 "Calculate the indent of the current Pascal line.
857 ;; Check if inside a string, comment or parenthesis
858 (cond ((nth 3 state) (throw 'nesting 'string))
866 ;; Loop until correct indent is found
948 ;; Return type of block and indent level.
951 (list type (pascal-indent-level))))))
953 (defun pascal-indent-level ()
954 "Return the indent-level the current statement has.
965 (defun pascal-indent-comment ()
966 "Return indent for current comment."
973 (defun pascal-indent-case ()
982 ;; Get right indent
1001 (indent-to (1+ ind))
1010 (defun pascal-indent-paramlist (&optional arg)
1013 indent of the current line in parameterlist."
1023 ;; If arg, just return indent
1032 (indent-to (+ 4 stcol)))
1033 (pascal-indent-declaration nil stpos edpos)))))
1035 (defun pascal-indent-declaration (&optional arg start end)
1058 (indent-to arg)
1059 (indent-to (+ arg pascal-indent-level)))
1063 (setq ind (pascal-get-lineup-indent stpos edpos lineup))
1069 (indent-to ind)
1071 (forward-line 1) ; No more indent if there is no : or =
1077 (pascal-indent-declaration (current-column)))
1084 ; "Return the indent level that will line up several lines within the region
1085 ;from b to e nicely. The lineup string is str."
1086 (defun pascal-get-lineup-indent (b e str)
1111 ;; No lineup-string found
1129 (defun pascal-string-diff (str1 str2)
1147 (if (string= pascal-str "")
1186 (if (string-match (concat "\\<" pascal-str) match)
1242 (if (string-match (concat "\\<" pascal-str) s)
1252 ;; of all possible completions. If it is nil it returns a string, the
1265 (let ((state (car (pascal-calculate-indent))))
1302 ;; Get longest string common in the labels
1307 (if (string= match pascal-str)
1311 ;; Find longest common string
1312 (if (< (setq tmp (pascal-string-diff match (car elm))) min)
1317 (if (string= (car elm) pascal-str)
1346 (string= pascal-last-word-shown pascal-str))
1353 ;; Delete old string
1366 ;; Display next match or same string if no match was found
1373 ;; Insert match if found, or the original string if no match
1390 (momentary-string-display "" (point))
1403 (string= pascal-last-word-shown pascal-str))
1410 (momentary-string-display "" (point))
1415 "Return symbol around current point as a string."
1437 ;; it returns a string, the longest possible completion, or t if STR
1452 (if (string= pascal-str "")
1476 (label (if (not (string= default ""))
1484 (if (string= label "")
1486 ;; Goto right place in buffer if label is not an empty string
1487 (or (string= label "")