• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/progmodes/

Lines Matching +defs:comment +defs:end +defs:skip

133 ;;   comment paragraph.  To accomplish this, tabs are permanently
136 ;; limited to comments only and occurs only when a comment
139 ;; Muti-statement lines (using "&") on block begin and end lines can
140 ;; ruin the formatting. For example, multiple end statements on a
141 ;; line: endif & endif. Using "&" outside of block begin/end lines
164 (unless (fboundp 'line-end-position)
165 (defalias 'line-end-position 'point-at-eol))
214 If you change this, you probably also want to change `idlwave-end-offset'."
218 (defcustom idlwave-end-offset -3
278 "*If set non-nil then comment paragraphs are indented under the
286 in the first line of a comment paragraph. The size of the indent
287 extends to the end of the match for the regular expression."
296 (defcustom idlwave-fill-comment-line-only t
297 "*If non-nil then auto fill will only operate on comment lines."
303 When the line end falls within a string, string concatenation with the
307 This variable is ignored when `idlwave-fill-comment-line-only' is
320 (defcustom idlwave-no-change-comment ";;;"
321 "*The indentation of a comment that starts with this regular
322 expression will not be changed. Note that the indentation of a comment
327 (defcustom idlwave-begin-line-comment nil
328 "*A comment anchored at the beginning of line.
329 A comment matching this regular expression will not have its
337 (defcustom idlwave-code-comment ";;[^;]"
338 "*A comment that starts with this regular expression on a line by
340 the comment is not preceded by whitespace it is unchanged."
345 ;; right-margin comment, i.e., to a minimum of `comment-column'.
802 (defcustom idlwave-expand-generic-end nil
807 (defcustom idlwave-reindent-end t
981 A ':' is added to the keyword end.
992 (defcustom idlwave-doclib-end "^;+-"
993 "*Regexp matching the end of a document library header."
1148 ;; "begin" "end"
1173 (goto-char (match-end 0)) ; needed for XEmacs, could be nil
1275 (defconst idlwave-comment-line-start-skip "^[ \t]*;"
1276 "Regexp to match the start of a full-line comment.
1277 That is the _beginning_ of a line containing a comment delimiter `;' preceded
1289 (defconst idlwave-end-unit-reg "^\\s-*\\(pro\\|function\\)\\>\\|\\'"
1290 "Regular expression to find the line that indicates the end of unit.
1291 This line is the end of buffer or the start of another unit. The case does
1297 (defconst idlwave-end-block-reg
1298 "\\<end\\(\\|case\\|switch\\|else\\|for\\|if\\|rep\\|while\\)\\>"
1299 "Regular expression to find the end of a block. The case does
1303 '(("pro" . "end")
1304 ("function" . "end")
1317 to expand generic end statements to their detailed form.")
1343 ;; "endif else" is the only possible "end" that can be
1345 '(endelse . ("end\\(\\|if\\)\\s +else" "end\\(\\|if\\)\\s +else"))
1346 ;; all other "end"s can not be followed by a statement.
1347 (cons 'end (list idlwave-end-block-reg nil))
1375 substatement starts after the end of the found match modulo
1384 (defvar idlwave-comment-indent-function 'comment-indent-function
1385 "IDL mode comment indent function.")
1390 (defvar idlwave-comment-indent-char ?\
1391 "Character to be inserted for IDL comment indentation.
1413 Specifically, if the abbrev is in a comment or string it is unexpanded.
1532 (define-key idlwave-mode-map "\C-c;" 'idlwave-toggle-comment-region)
1534 (define-key idlwave-mode-map "\C-\M-e" 'idlwave-end-of-subprogram)
1536 (define-key idlwave-mode-map "\C-c}" 'idlwave-end-of-block)
1742 (idlwave-define-abbrev "end" "end" 'idlwave-show-begin-check t)
1808 comment. The indentation of the second line of the paragraph
1811 comments. When the variable `idlwave-fill-comment-line-only' is
1880 If the variable `idlwave-expand-generic-end' is non-nil, each END typed
1916 (make-local-variable idlwave-comment-indent-function)
1917 (set idlwave-comment-indent-function 'idlwave-comment-hook)
1919 (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
1920 (set (make-local-variable 'comment-start) ";")
1921 (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions
1938 (setq comment-end "")
1939 (set (make-local-variable 'comment-multi-line) nil)
1975 idlwave-end-block-reg
2023 (defun idlwave-font-lock-fontify-region (beg end &optional verbose)
2033 (font-lock-default-fontify-region beg end verbose))
2068 "Reverses abbrev expansion if in comment or string.
2094 (defun idlwave-in-comment ()
2095 "Returns t if point is inside a comment, nil otherwise."
2098 (and (idlwave-goto-comment) (> here (point))))))
2100 (defun idlwave-goto-comment ()
2101 "Move to start of comment delimiter on current line.
2102 Moves to end of line if there is no comment delimiter.
2103 Ignores comment delimiters in strings.
2104 Returns point if comment found and nil otherwise."
2105 (let ((eos (progn (end-of-line) (point)))
2108 ;; Look for first comment delimiter not in a string
2110 (setq found (search-forward comment-start eos 'lim))
2112 (setq found (search-forward comment-start eos 'lim)))
2130 "Insert quote and show matching quote if this is end of a string."
2134 (if (and bq (not (idlwave-in-comment)))
2141 ;; Not the end of a string
2157 Also checks if the correct end statement has been used."
2158 ;; All end statements are reserved words
2159 ;; Re-indent end line
2164 (eol-pos (save-excursion (end-of-line) (point)))
2165 begin-pos end-pos end end1 )
2166 (if idlwave-reindent-end (idlwave-indent-line))
2176 (setq end-pos (point))
2177 (if (> end-pos eol-pos)
2178 (setq end-pos pos))
2179 (goto-char end-pos)
2180 (setq end (buffer-substring
2182 (skip-chars-backward "a-zA-Z")
2184 end-pos))
2189 ((string= (downcase end) (downcase end1))
2191 ((string= (downcase end) "end")
2192 ;; A generic end
2193 (if idlwave-expand-generic-end
2197 (insert (if (string= end "END") (upcase end1) end1))
2203 end1 end)
2220 '("begin" . "end"))
2226 '("begin" . "end")))))
2234 (skip-chars-backward " \t")
2239 (insert "end")
2275 - the character before point is inside a string or comment"
2281 (skip-chars-backward " \t")
2290 (skip-chars-forward " \t"))
2312 ((start-col (progn (skip-chars-backward " \t") (current-column)))
2314 (end-col (progn (skip-chars-forward " \t") (current-column))))
2321 (idlwave-indent-to end-col (- n))
2331 ;; If not in a comment and in a string then insertion of a newline
2334 (if (and (not (idlwave-in-comment)) (idlwave-in-quote))
2353 ;; Use global variable 'comment-column' to set parallel comment
2356 ;; Emacs Lisp and IDL (Wave CL) have identical comment syntax
2357 (defun idlwave-comment-hook ()
2358 "Compute indent for the beginning of the IDL comment delimiter."
2359 (if (or (looking-at idlwave-no-change-comment)
2360 (if idlwave-begin-line-comment
2361 (looking-at idlwave-begin-line-comment)
2364 (if (looking-at idlwave-code-comment)
2365 (if (save-excursion (skip-chars-backward " \t") (bolp))
2371 (skip-chars-backward " \t")
2373 comment-column))))
2377 For a code line insert continuation marker. If the line is a line comment
2378 then the new line will contain a comment with the same indentation.
2385 (if (not (idlwave-in-comment))
2406 (indent-new-comment-line))
2421 (defun idlwave-end-of-subprogram (&optional nomark)
2425 (idlwave-end-of-statement)
2426 (idlwave-find-key idlwave-end-unit-reg 1 nomark))
2431 (idlwave-end-of-statement)
2432 (let ((end (point)))
2434 (push-mark end nil t)))
2439 (idlwave-end-of-statement)
2441 (idlwave-end-of-statement)
2442 (let ((end (point)))
2445 (push-mark end nil t)))
2449 "Put mark at beginning of program, point at end.
2452 (idlwave-end-of-statement)
2461 If prefix ARG < 0 then move forward to enclosing block end."
2471 (defun idlwave-end-of-block ()
2502 idlwave-end-block-reg -1 'nomark eos))
2511 (idlwave-end-of-statement)
2512 (message "No nested block before end of containing block."))))
2516 "Put point at beginning of doc library header, mark at end.
2525 (if (re-search-forward idlwave-doclib-end nil t)
2529 (message "Could not find end of doc library header.")))
2559 (goto-char (match-end 0))))
2568 the first non-comment statement in the file, and nil otherwise."
2574 ;; skip blank lines, label lines, include lines and line comments
2580 (looking-at idlwave-comment-line-start-skip)
2585 ;; skip continuation lines
2593 (defun idlwave-end-of-statement ()
2594 "Moves point to the end of the current IDL statement.
2595 If not in a statement just moves to end of line. Returns position."
2599 (while (and (idlwave-is-comment-or-empty-line)
2601 (end-of-line)
2604 (defun idlwave-end-of-statement0 ()
2605 "Moves point to the end of the current IDL statement.
2606 If not in a statement just moves to end of line. Returns position."
2610 (end-of-line)
2616 non-comment IDL statement in the file, and nil otherwise."
2619 (idlwave-end-of-statement)
2620 ;; skip blank lines, label lines, include lines and line comments
2626 (looking-at idlwave-comment-line-start-skip)
2632 (defun idlwave-skip-multi-commands (&optional lim)
2636 (goto-char (match-end 0))
2642 (defun idlwave-skip-label-or-case ()
2649 ;; - it is not in a comment
2656 (eos (save-excursion (idlwave-end-of-statement) (point)))
2657 (end (idlwave-find-key ":" 1 'nomark eos)))
2658 (if (and end
2659 (= (nth 0 (parse-partial-sexp start end)) 0)
2660 (not (string-match "\\?" (buffer-substring start end)))
2661 (not (string-match "^::" (buffer-substring end eos))))
2676 (eos (idlwave-end-of-statement))
2680 (idlwave-skip-label-or-case)
2682 (idlwave-skip-multi-commands orig))
2691 (goto-char (match-end 0)))
2694 (goto-char (match-end 0)))
2715 (skip-chars-forward " \t")
2721 (append st (match-end 0))))))
2774 (skip-chars-backward "= \t")
2791 (if (and idlwave-expand-generic-end
2792 (re-search-backward "\\<\\(end\\)\\s-*\\="
2794 (looking-at "\\(end\\)\\([ \n\t]\\|\\'\\)"))
2795 (progn (goto-char (match-end 1))
2807 "Indents current IDL line as code or as a comment.
2814 (skip-chars-backward " \t")
2816 (skip-chars-forward " \t"))
2820 (if (looking-at idlwave-comment-line-start-skip)
2821 ;; Indentation for a line comment
2823 (skip-chars-forward " \t")
2824 (idlwave-indent-left-margin (idlwave-comment-hook)))
2851 ;; Adjust parallel comment
2852 (end-of-line)
2853 (if (idlwave-in-comment)
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)))))
2899 (idlwave-end-of-statement)
2913 (idlwave-end-of-statement)
2950 ((idlwave-look-at idlwave-end-block-reg t)
2956 ;; idlwave-end-offset
2964 ((idlwave-look-at idlwave-end-block-reg)
2965 (+ the-indent idlwave-end-offset))
2972 (defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp)
2976 (let ((open (nth 1 (parse-partial-sexp beg-reg end-reg))))
2991 ;; Empty (or just comment) follows -- revert to basic indent
3000 (skip-chars-forward " \t")
3012 (end-reg (progn (beginning-of-line) (point)))
3016 (if (eq (line-beginning-position) end-reg)
3019 (basic-indent (+ (idlwave-min-current-statement-indent end-reg)
3025 ("\\<\\(if\\|end\\(if\\)?\\)\\>" . "[ \t]*else")
3027 ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" .
3031 (goto-char end-reg)
3040 (if (looking-at "end") ;; that one's special
3042 (+ idlwave-block-indent idlwave-end-offset))
3052 (goto-char end-reg)
3064 (let* ((end-reg end-reg)
3066 (goto-char end-reg)
3067 (skip-chars-forward " \t")
3072 beg-reg end-reg close-exp))
3081 (setq end-reg (car indent-cons))))))
3090 (while (idlwave-look-at "&")) ; skip continued statements
3094 (idlwave-look-at "^[ \t]*\\(pro\\|function\\)") ;skip over
3096 (goto-char (match-end 0))
3105 (goto-char (match-end 0))
3156 "When optional argument DIR is non-negative, move forward to end of
3157 current block using the `idlwave-begin-block-reg' and `idlwave-end-block-reg'
3159 Recursively calls itself to skip over nested blocks. DIR defaults to
3170 idlwave-end-block-reg))
3173 idlwave-end-block-reg))
3178 (end-of-line)
3180 idlwave-end-unit-reg dir t limit)))
3182 (if (>= dir 0) (end-of-line)) ;Make sure we are in current block
3192 (defun idlwave-min-current-statement-indent (&optional end-reg)
3199 (or (setq comm-or-empty (idlwave-is-comment-or-empty-line))
3201 (or (null end-reg) (< (point) end-reg)))
3203 (if (or comm-or-empty (and end-reg (>= (point) end-reg)))
3211 (idlwave-end-of-statement)
3217 Skips any whitespace. Returns 0 if the end-of-line follows the whitespace."
3220 (skip-chars-forward " \t")
3221 ;; if we are at the end of blank line return 0
3227 Blank or comment-only lines following regular continuation lines (with
3238 (defun idlwave-is-comment-line ()
3239 "Tests if the current line is a comment line."
3244 (defun idlwave-is-comment-or-empty-line ()
3245 "Tests if the current line is a comment line."
3252 If optional argument CONT is non-nil, searches to the end of
3256 Ignores matches that end in a comment or inside a string expression.
3259 a comment delimiter. The search is case insensitive.
3264 (if cont (idlwave-end-of-statement) (end-of-line))
3276 A paragraph is made up of all contiguous lines having the same comment
3277 leader (the leading whitespace before the comment delimiter and the
3278 comment delimiter). In addition, paragraphs are separated by blank
3283 with code. The hanging indent is given by the end of the first match
3288 ;; check if this is a line comment
3291 (skip-chars-forward " \t")
3292 (looking-at comment-start))
3296 hang start end)
3310 (setq end (point)))
3311 (untabify start end)
3317 (concat "^[ \t]*" comment-start "+")
3318 (save-excursion (end-of-line) (point))
3320 ;; Get the comment leader on the line and its length
3322 ;; the comment leader is the indentation plus exactly the
3333 ;; Mark the beginning and end of the paragraph
3352 (end-of-line)
3353 ;; if at end of buffer add a newline (need this because
3359 ;; END is calculated as distance from end of buffer
3360 (setq end (- (point-max) (point) 1))
3384 (re-search-forward comment-start-skip
3385 (save-excursion (end-of-line) (point))
3400 ;; beginning of line and END is at the end of line
3409 comment-start-skip
3410 (save-excursion (end-of-line) (point))
3423 comment-start-skip
3424 (save-excursion (end-of-line) (point))
3442 (- (point-max) end)
3448 ;; When we want the point at the beginning of the comment
3450 (if (bolp) (skip-chars-forward (concat " \t" comment-start)))
3454 "Calculate the position of the hanging indent for the comment
3462 (end-of-line)
3472 (save-excursion (end-of-line) (point))
3478 Only fills non-comment lines if `idlwave-fill-comment-line-only' is
3479 non-nil. Places a continuation character at the end of the line if
3480 not in a comment. Splits strings with IDL concatenation operator `+'
3484 (if (or (not idlwave-fill-comment-line-only)
3486 ;; Check for comment line
3488 (looking-at idlwave-comment-line-start-skip)))
3502 (end-of-line 0)
3507 (looking-at idlwave-comment-line-start-skip))
3508 ;; A continued line comment
3509 ;; We treat continued line comments as part of a comment
3519 ;; Remove whitespace between comment delimiter and
3523 comment-start-skip
3524 (save-excursion (end-of-line) (point)) t)
3529 ;; Split code or comment?
3531 (end-of-line 0)
3532 (idlwave-in-comment))
3533 ;; Splitting a non-full-line comment.
3534 ;; Insert the comment delimiter from split line
3538 (skip-chars-forward " \t")
3543 (buffer-substring (idlwave-goto-comment)
3545 (skip-chars-forward "; ")
3550 (end-of-line 0)
3564 (skip-chars-forward " \t")
3569 ;; Although do-auto-fill (via indent-new-comment-line) calls
3605 (end-of-line)
3608 ;; skip function or procedure line
3611 (idlwave-end-of-statement)
3630 ;; Insert a blank line comment to separate from the date entry -
3642 (let* (beg end)
3648 (re-search-forward idlwave-doclib-end nil t)
3649 (setq end (match-end 0)))
3654 end t)
3655 (end-of-line)
3656 (goto-char end)
3657 (end-of-line -1)
3658 (insert "\n" comment-start "\n")
3659 (insert comment-start " " idlwave-doc-modifications-keyword ":"))
3672 ;;; abbrev instead of to the end of the abbrev). We now keep the
3675 (defun idlwave-expand-region-abbrevs (start end)
3680 (goto-char (min start end))
3683 (expand-region-abbrevs start end 'noquery))))
3686 "Returns t if point is in a comment or quoted string.
3688 (or (idlwave-in-comment) (idlwave-in-quote)))
3693 Ignores comment delimiters on the current line.
3704 (eol (progn (end-of-line) (point)))
3714 ;; Find the string end.
3786 end)
3792 (setq end (point)))
3794 (indent-region beg end nil))
3880 start (match-end 0)))
3887 end)
3888 (while (setq end (string-match replace_string string start))
3890 (concat ret_string (substring string start end) replace_with))
3891 (setq start (match-end 0)))
4088 (defun idlwave-toggle-comment-region (beg end &optional n)
4091 N is non-nil, then for N positive, add N comment delimiters or for N
4092 negative, remove N comment delimiters.
4093 Uses `comment-region' which does not place comment delimiters on
4097 (comment-region beg end (prefix-numeric-value n))
4101 ;; skip blank lines
4102 (skip-chars-forward " \t\n")
4103 (if (looking-at (concat "[ \t]*\\(" comment-start "+\\)"))
4105 (uncomment-region beg end)
4106 (comment-region beg end
4109 (match-end 1))))))
4110 (comment-region beg end)))))
4511 ;; reset was already done in idle time, so skip this step now once
4719 (setq name (substring name (match-end 0)))))
4743 kwd (substring kwd (match-end 0)))
4851 (match-end 0))))
5253 (idlwave-end-of-statement)
5275 (setq start (match-end 0))
5284 (setq start (match-end 0))
5399 "This is the front-end to the creation of the IDLWAVE user catalog.
5660 libraries being loaded, if passed, and skip loading/normalizing if
5718 end
5760 end
5774 end
5797 end
5814 end
5819 end
5947 module (substring module (match-end 0))))
6495 LAST-CHAR last relevant character before point (non-white non-comment,
6563 cw-class (if (match-end 4)
6573 ;; Grab the word around point. CLASS is for the `skip-chars=...' functions
6577 (progn (skip-chars-backward class) (point))
6578 (progn (skip-chars-forward class) (point)))))
6639 (if (and (idlwave-skip-object)
6656 (defun idlwave-skip-object ()
6661 (skip-chars-forward " ") ; white space
6662 (skip-chars-forward "*") ; de-reference
6665 (goto-char (match-end 0)))
6675 (goto-char (match-end 0)))
6688 "Return the last character before point which is not white or a comment
6695 ;; skip the current identifier
6696 (skip-chars-backward "a-zA-Z0-9_$")
6697 ;; also skip a leading slash which might be belong to the keyword
6702 (skip-chars-backward " \t")
6709 (goto-char (match-end 1))
6730 beg (end (point)) slash part spart completion all-completions
6738 (skip-chars-backward "a-zA-Z0-9_$")
6749 (setq part (buffer-substring beg end)
6762 (delete-region beg end)
7077 (skip-chars-backward "a-zA-Z0-9_")
7154 (setq start (match-end 0)
7167 (setq start (match-end 0)
7276 (defvar idlwave-struct-skip
7278 "Regexp for skipping continued blank or comment-only lines in
7283 idlwave-struct-skip ; 4 groups
7294 (end (cdr borders))
7298 (narrow-to-region beg end)
7299 (while (re-search-forward idlwave-struct-tag-regexp end t)
7304 (goto-char (match-end 0))))
7311 (end (cdr borders))
7314 end t)))
7322 (end (cdr borders))
7327 (narrow-to-region beg end)
7330 idlwave-struct-skip ; 4 groups
7332 idlwave-struct-skip ; 4 more
7334 end t)
7339 (goto-char (match-end 0))))
7346 (if (not (or (idlwave-in-comment) (idlwave-in-quote)))
7356 (skip-chars-forward "^{")
7440 (let ((case-fold-search t) end-lim list name)
7446 (setq end-lim (save-excursion (idlwave-end-of-subprogram) (point)))
7448 (idlwave-find-structure-definition nil t end-lim))
7614 (skip-chars-backward "a-zA-Z0-9._$")
7637 t) ; return t to skip other completions
7675 (skip-chars-backward "[a-zA-Z0-9_$]")
7682 t) ; return t to skip other completions
7685 (skip-chars-backward "a-zA-Z0-9_$.")
7688 (<= (match-end 0) pos)))
7701 t)) ; return t to skip other completions
7737 (string-to-number (substring link (match-end 0))))))
7824 (setq start (match-end 0)
7826 tags (if (match-end 3)
7855 (put-text-property (match-beginning 0) (match-end 0)
7954 (remove-text-properties (match-beginning 1) (match-end 1)
8144 (next-char (save-excursion (skip-chars-forward "a-zA-Z0-9$_")
9152 ["Subprogram End" idlwave-end-of-subprogram t]
9154 ["Block End" idlwave-end-of-block t]
9167 ["(Un)Comment Region" idlwave-toggle-comment-region t]