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

Lines Matching +defs:dir +defs:indent

205 (defcustom idlwave-main-block-indent 2
212 (defcustom idlwave-block-indent 3
220 A value equal to negative `idlwave-block-indent' will make END lines
225 (defcustom idlwave-continuation-indent 3
232 (defcustom idlwave-max-extra-continuation-indent 40
233 "*Maximum additional indentation for special continuation indent.
241 cases. See also `idlwave-indent-to-open-paren', which can override
246 (defcustom idlwave-indent-to-open-paren t
247 "*Non-nil means, indent continuation lines to innermost open
249 `idlwave-max-extra-continuation-indent'. Matching parens and the
259 the value of `max-extra-continuation-indent', which, if zero, would
270 (defcustom idlwave-indent-parens-nested nil
271 "*Non-nil means, indent continuation lines with parens by nesting
277 (defcustom idlwave-hanging-indent t
279 hanging indent given by `idlwave-hang-indent-regexp' match in the first line
284 (defcustom idlwave-hang-indent-regexp "- "
285 "*Regular expression matching the position of the hanging indent
286 in the first line of a comment paragraph. The size of the indent
291 (defcustom idlwave-use-last-hang-indent nil
292 "*If non-nil then use last match on line for `idlwave-indent-regexp'."
747 (defgroup idlwave-abbrev-and-indent-action nil
754 The actions that can be performed are listed in `idlwave-indent-action-table'."
755 :group 'idlwave-abbrev-and-indent-action
767 :group 'idlwave-abbrev-and-indent-action
774 See help for `idlwave-indent-action-table' for symbols using `idlwave-surround'.
782 :group 'idlwave-abbrev-and-indent-action
791 :group 'idlwave-abbrev-and-indent-action
799 :group 'idlwave-abbrev-and-indent-action
804 :group 'idlwave-abbrev-and-indent-action
808 "*Non-nil means re-indent line after END was typed."
809 :group 'idlwave-abbrev-and-indent-action
820 :group 'idlwave-abbrev-and-indent-action
830 :group 'idlwave-abbrev-and-indent-action
837 :group 'idlwave-abbrev-and-indent-action
847 ;; The action table is used by `idlwave-indent-line' whereas both the
848 ;; action and expand tables are used by `idlwave-indent-and-action'. In
870 (defvar idlwave-indent-action-table nil
872 and function as a cdr. This table is used by `idlwave-indent-line'.
880 (defvar idlwave-indent-expand-table nil
883 `idlwave-indent-and-action' function. See documentation for
1384 (defvar idlwave-comment-indent-function 'comment-indent-function
1385 "IDL mode comment indent function.")
1390 (defvar idlwave-comment-indent-char ?\
1477 "KEY and CMD are made into a key binding and an indent action.
1484 \(KEY . CMD\) is also placed in the `idlwave-indent-expand-table',
1486 will instead be placed in `idlwave-indent-action-table'.
1503 (let* ((table (if select 'idlwave-indent-action-table
1504 'idlwave-indent-expand-table))
1544 (define-key idlwave-mode-map "\M-\C-q" 'idlwave-indent-subprogram)
1548 ;; (define-key idlwave-mode-map "\t" 'idlwave-indent-line)
1549 (define-key idlwave-mode-map [(shift iso-lefttab)] 'idlwave-indent-statement)
1817 again followed by \\[indent-region] (`indent-region').
1914 (set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action)
1916 (make-local-variable idlwave-comment-indent-function)
1917 (set idlwave-comment-indent-function 'idlwave-comment-hook)
1924 (set (make-local-variable 'indent-tabs-mode) nil)
2159 ;; Re-indent end line
2160 ;;(insert-char ?\ 1) ;; So indent, etc. work well
2166 (if idlwave-reindent-end (idlwave-indent-line))
2237 (newline-and-indent)))
2283 ;; avoid clobbering indent
2285 (move-to-column (idlwave-calculate-indent))
2318 (idlwave-indent-to (+ start-col n))
2321 (idlwave-indent-to end-col (- n))
2345 ;; `indent-for-tab-command' followed by `newline-and-indent'.
2348 (idlwave-indent-line)
2350 (idlwave-indent-line))
2358 "Compute indent for the beginning of the IDL comment delimiter."
2366 ;; On line by itself, indent as code
2367 (let ((tem (idlwave-calculate-indent)))
2376 "Continue line by breaking line at point and indent the lines.
2395 (newline-and-indent)
2405 (newline-and-indent)))
2406 (indent-new-comment-line))
2410 (idlwave-indent-line)
2413 (idlwave-indent-line)))
2786 (defun idlwave-indent-and-action (&optional arg)
2787 "Call `idlwave-indent-line' and do expand actions.
2788 With prefix ARG non-nil, indent the entire sub-statement."
2803 (idlwave-indent-statement)
2804 (idlwave-indent-line t)))
2806 (defun idlwave-indent-line (&optional expand)
2808 The actions in `idlwave-indent-action-table' are performed.
2810 `idlwave-indent-expand-table' are performed."
2824 (idlwave-indent-left-margin (idlwave-comment-hook)))
2831 (mapcar 'idlwave-do-action idlwave-indent-expand-table))
2834 (mapcar 'idlwave-do-action idlwave-indent-action-table))
2849 ;; indent the line
2850 (idlwave-indent-left-margin (idlwave-calculate-indent)))
2854 ;; Emacs 21 is too smart with fill-column on comment indent
2855 (let ((fill-column (if (fboundp 'comment-indent-new-line)
2858 (indent-for-comment)))))
2879 (defun idlwave-indent-to (col &optional min)
2886 (defun idlwave-indent-left-margin (col)
2893 (idlwave-indent-to col)))
2895 (defun idlwave-indent-subprogram ()
2904 (indent-region beg (point) nil))
2907 (defun idlwave-indent-statement ()
2914 (indent-region beg (point) nil))))
2916 (defun idlwave-calculate-indent ()
2929 (idlwave-calculate-cont-indent))
2930 ;; calculate indent based on previous and current statements
2932 (the-indent
2933 ;; calculate indent based on previous statement
2943 (+ (idlwave-current-statement-indent)
2944 idlwave-main-block-indent))
2947 (+ (idlwave-min-current-statement-indent)
2948 idlwave-block-indent))
2955 (idlwave-min-current-statement-indent)))
2957 ;; idlwave-block-indent))
2959 ;; Default to current indent
2960 ((idlwave-current-statement-indent))))))
2965 (+ the-indent idlwave-end-offset))
2966 (the-indent)))))))
2969 ;; Parentheses indent
2972 (defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp)
2973 "Calculate the continuation indent inside a paren group.
2974 Returns a cons-cell with (open . indent), where open is the
2983 ;; Plain Kernighan-style nested indent
2984 (idlwave-indent-parens-nested
2985 (+ idlwave-continuation-indent (idlwave-current-indent)))
2991 ;; Empty (or just comment) follows -- revert to basic indent
3003 (defun idlwave-calculate-cont-indent ()
3004 "Calculates the IDL continuation indent column from the previous
3019 (basic-indent (+ (idlwave-min-current-statement-indent end-reg)
3020 idlwave-continuation-indent))
3021 fancy-nonparen-indent fancy-paren-indent)
3041 (- (idlwave-current-indent)
3042 (+ idlwave-block-indent idlwave-end-offset))
3043 (idlwave-current-indent)))
3060 (+ idlwave-continuation-indent (idlwave-current-indent)))
3062 ;; Parenthetical indent, either traditional or Kernighan style
3063 ((setq fancy-paren-indent
3069 indent-cons)
3071 (while (setq indent-cons (idlwave-calculate-paren-indent
3075 idlwave-indent-to-open-paren
3076 idlwave-indent-parens-nested
3077 (null (cdr indent-cons))
3078 (< (- (cdr indent-cons) basic-indent)
3079 idlwave-max-extra-continuation-indent))
3080 (throw 'loop (cdr indent-cons)))
3081 (setq end-reg (car indent-cons))))))
3082 fancy-paren-indent)
3086 (> idlwave-max-extra-continuation-indent 0)
3087 (setq fancy-nonparen-indent
3097 ;; Comment only, or blank line with "$"? Basic indent.
3115 (< (- fancy-nonparen-indent basic-indent)
3116 idlwave-max-extra-continuation-indent))
3117 (if fancy-paren-indent ;calculated but disallowed paren indent
3118 (+ fancy-nonparen-indent idlwave-continuation-indent)
3119 fancy-nonparen-indent))
3121 ;; Basic indent, by default
3122 (t basic-indent)))))
3126 (defun idlwave-find-key (key-re &optional dir nomark limit)
3135 (setq dir (or dir 0))
3137 (search-func (if (> dir 0) 're-search-forward 're-search-backward))
3145 (if (or (and (> dir 0) (eobp))
3146 (and (< dir 0) (bobp)))
3155 (defun idlwave-block-jump-out (&optional dir nomark)
3164 (or dir (setq dir 0))
3167 (limit (if (>= dir 0) (point-max) (point-min)))
3168 (block-limit (if (>= dir 0)
3175 (if (< dir 0)
3177 idlwave-begin-unit-reg dir t limit)
3180 idlwave-end-unit-reg dir t limit)))
3182 (if (>= dir 0) (end-of-line)) ;Make sure we are in current block
3183 (if (setq found (idlwave-find-key block-reg dir t unit-limit))
3185 (if (>= dir 0) (forward-word 1))
3186 (idlwave-block-jump-out dir t)
3187 (setq found (idlwave-find-key block-reg dir t unit-limit))))
3190 (if (>= dir 0) (forward-word 1)))))
3192 (defun idlwave-min-current-statement-indent (&optional end-reg)
3193 "The minimum indent in the current statement."
3196 (idlwave-current-indent)
3197 (let ((min (idlwave-current-indent)) comm-or-empty)
3202 (unless comm-or-empty (setq min (min min (idlwave-current-indent)))))
3205 (min min (idlwave-current-indent))))))
3207 (defun idlwave-current-statement-indent (&optional last-line)
3209 If in a statement, moves to beginning of statement before finding indent."
3213 (idlwave-current-indent))
3215 (defun idlwave-current-indent ()
3279 line comments. The indentation is given by the hanging indent of the
3283 with code. The hanging indent is given by the end of the first match
3284 matching `idlwave-hang-indent-regexp' on the paragraph's first line . If the
3285 optional argument NOHANG is non-nil then the hanging indent is
3294 ((indent 999)
3295 pre here diff fill-prefix-reg bcl first-indent
3370 ;; First check to see if indentation is based on hanging indent.
3371 (if (and (not nohang) idlwave-hanging-indent
3375 (idlwave-calc-hanging-indent))))
3377 ;; each line's indent is at least as great as the hanging
3378 ;; indent. This is needed for fill-paragraph to work with
3381 (setq indent hang)
3387 (if (> (setq diff (- indent (current-column))) 0)
3405 (setq indent
3406 (min indent
3416 (make-string (- indent pre)
3418 ;; first-line indent
3419 (setq first-indent
3427 indent))
3434 ;; indent length and to preserve any indent on the first line
3435 ;; (first indent).
3438 (buffer-substring start (+ start first-indent -1)))
3439 (subst-char-in-region start (+ start first-indent -1) ?\ ?~ nil)
3445 (delete-region start (+ start first-indent -1))
3453 (defun idlwave-calc-hanging-indent ()
3454 "Calculate the position of the hanging indent for the comment
3455 paragraph. The hanging indent position is given by the first match
3456 with the `idlwave-hang-indent-regexp'. If `idlwave-use-last-hang-indent' is
3457 non-nil then use last occurrence matching `idlwave-hang-indent-regexp' on
3460 (if idlwave-use-last-hang-indent
3464 idlwave-hang-indent-regexp
3467 (+ (current-column) (length idlwave-hang-indent-regexp))))
3471 idlwave-hang-indent-regexp
3490 (idlwave-indent-line)
3491 ;; Prevent actions do-auto-fill which calls indent-line-function.
3504 (idlwave-indent-line))
3510 ;; paragraph. So we check for a hanging indent.
3511 (if idlwave-hanging-indent
3513 (indent
3516 (idlwave-calc-hanging-indent))))
3517 (if indent
3526 (idlwave-indent-to indent)
3547 (idlwave-indent-line))
3569 ;; Although do-auto-fill (via indent-new-comment-line) calls
3570 ;; idlwave-indent-line for the new line, re-indent again
3572 (idlwave-indent-line))
3772 The lines containing S1 and S2 are reindented using `indent-region'
3794 (indent-region beg end nil))
3984 dir efile)
3986 (while (setq dir (car (pop dirs)))
3988 (setq efile (expand-file-name file dir)))
4007 (let (directory directories cmd append status numdirs dir getsubdirs
4024 (setq dir (nth numdirs directories))
4025 (while (and dir)
4028 (if (string-match "^[@]\\(.+\\)$" dir)
4030 (if (and getsubdirs) (setq dir (substring dir 1 (length dir))))
4031 (setq dir (expand-file-name dir))
4032 (if (file-directory-p dir)
4038 (concat "find " dir " -type d -print"))
4048 (setq files (list (concat dir "/*.pro"))))
4077 (setq dir (nth numdirs directories)))
4080 (setq dir (nth numdirs directories)))))
4229 (defun idlwave-sintern-dir (dir &optional set)
4230 (car (or (member dir idlwave-sint-dirs)
4231 (setq idlwave-sint-dirs (cons dir idlwave-sint-dirs)))))
4251 (defun idlwave-sintern-rinfo-list (list &optional set default-dir)
4277 (source-dir (if default-dir
4278 (file-name-as-directory default-dir)
4281 (if (stringp source-dir)
4282 (setq source-dir (idlwave-sintern-dir source-dir set)))
4285 (setq source (list source-type source-file source-dir source-lib)))
4340 "Alist with !PATH directories and zero or more flags if the dir has
4444 ;; (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") |
4445 ;; (buffer pro_file dir) | (compiled pro_file dir)
4609 (let* ((dir (file-name-as-directory
4610 (expand-file-name "help/online_help" (idlwave-sys-dir))))
4611 (catalog-file (expand-file-name "idl_catalog.xml" dir)))
4906 (let* ((dir (file-name-as-directory
4907 (expand-file-name "help/online_help" (idlwave-sys-dir))))
4908 (catalog-file (expand-file-name "idl_catalog.xml" dir))
4994 ;; (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") |
4995 ;; (buffer pro_file dir) | (compiled pro_file dir)
5259 (defvar idlwave-scanning-lib-dir)
5307 idlwave-scanning-lib-dir "UserLib")))
5324 (defun idlwave-sys-dir ()
5505 dir-entry)
5506 (while (setq dir-entry (pop this-path-alist))
5508 (if (memq 'lib (cdr dir-entry))
5509 (concat "[LIB] " (car dir-entry))
5510 (car dir-entry))
5512 (idlwave-path-alist-add-flag dir-entry 'user)
5513 (idlwave-path-alist-remove-flag dir-entry 'user)))
5520 (idlwave-scanning-lib-dir "")
5522 dirs-alist dir files file)
5531 (while (setq dir (pop dirs-alist))
5532 (when (memq 'user (cdr dir)) ; Has it marked for scan?
5533 (setq dir (car dir))
5534 (setq idlwave-scanning-lib-dir dir)
5535 (when (file-directory-p dir)
5536 (setq files (directory-files dir 'full "\\.[pP][rR][oO]\\'"))
5618 (defun idlwave-expand-path (path &optional default-dir)
5622 (let (path1 dir recursive)
5623 (while (setq dir (pop path))
5624 (if (setq recursive (string= (substring dir 0 1) "+"))
5625 (setq dir (substring dir 1)))
5627 (not (file-name-absolute-p dir)))
5628 (setq dir (expand-file-name dir default-dir)))
5631 (setq path1 (append (idlwave-recursive-directory-list dir) path1))
5633 (push dir path1)))
5637 (defun idlwave-recursive-directory-list (dir)
5639 (let ((path (list dir)) path1 file files)
5640 (while (setq dir (pop path))
5641 (when (file-directory-p dir)
5642 (setq files (nreverse (directory-files dir t "[^.]")))
5646 (push dir path1)))
5669 dir-entry dir flags catalog all-routines)
5671 (while (setq dir (pop dirs))
5674 (setq catalog (expand-file-name ".idlwave_catalog" dir)))
5692 idlwave-library-catalog-routines 'sys dir)
5697 (setq dir-entry (assoc dir idlwave-path-alist)))
5698 (idlwave-path-alist-add-flag dir-entry 'lib)))))
9029 (expand-file-name "lib" (idlwave-sys-dir)))))
9035 (let ((true-dir (file-name-directory (file-truename file))))
9036 (assoc true-dir (idlwave-true-path-alist))))
9067 (expand-file-name "lib" (idlwave-sys-dir))))))
9164 ["Indent Entire Statement" idlwave-indent-statement
9165 :active t :keys "C-u \\[indent-for-tab-command]" ]
9166 ["Indent Subprogram" idlwave-indent-subprogram t]