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

Lines Matching +defs:ps +defs:comment +defs:string

49 ;; and control flow words, one for each: comments, string, labels,
82 (defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version))
102 (string< "19.31" emacs-version)) ; Checked with 19.30: defface does not work
150 (goto-line (string-to-int (elt (, elt) 1)))))
155 (defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version))
324 (defcustom cperl-electric-parens-string "({[]})<"
327 :type 'string
384 (defcustom cperl-comment-column 32
389 (defcustom cperl-indent-comment-at-column-0 nil
390 "*Non-nil means that comment started at column 0 should be indentable."
396 :type '(repeat string)
401 :type '(repeat string)
440 (defcustom cperl-pod-face 'font-lock-comment-face
451 (defcustom cperl-here-face 'font-lock-string-face
522 :type 'string
555 "*Non-nil means that the comment starting in leftmost column should indent."
567 :type 'string
629 (defcustom cperl-ps-print-face-properties
636 (font-lock-comment-face nil "LightGray" italic)
637 (font-lock-string-face nil nil italic underline)
642 "List given as an argument to `ps-extend-face-list' in `cperl-ps-print'."
644 (cons (choice (const nil) string)
645 (cons (choice (const nil) string)
761 `fill-paragraph' on a comment may leave the point behind the
792 as a comment, but it will be recognized as a regexp by the indentation
956 `font-lock-comment-face' Comments, PODs and whatever is considered
967 `font-lock-string-face' Strings, qw() constructs, RExen, POD sections,
970 as string literals
985 `font-lock-string-face' \"Normal\" stuff and non-0-length constructs
1000 `font-lock-comment-face' Embedded comments
1048 (comment-region beg end -1)))
1051 (if (string< emacs-version "19.30")
1115 (if (fboundp 'ps-extend-face-list)
1116 (defmacro cperl-ps-extend-face-list (arg)
1117 `(ps-extend-face-list ,arg))
1118 (defmacro cperl-ps-extend-face-list (arg)
1119 `(error "This version of Emacs has no `ps-extend-face-list'")))
1165 ;;(cperl-define-key "\e;" 'cperl-indent-for-comment)
1174 ;;(concat (char-to-string help-char) "f") ; does not work
1178 ;;(concat (char-to-string help-char) "v") ; does not work
1182 ;;(concat (char-to-string help-char) "f") ; does not work
1186 ;;(concat (char-to-string help-char) "v") ; does not work
1192 ;;(concat (char-to-string help-char) "v") ; does not work
1200 (cperl-define-key "\e;" 'cperl-indent-for-comment)
1213 'indent-for-comment 'cperl-indent-for-comment
1229 ["Fill paragraph/comment" fill-paragraph t]
1260 ["Comment region" cperl-comment-region (cperl-use-region-p)]
1304 ["CPerl pretty print (exprmntl)" cperl-ps-print
1305 (fboundp 'ps-extend-face-list)]
1387 (defconst cperl-maybe-white-and-comment-rex "[ \t\n]*\\(#[^\n]*\n[ \t\n]*\\)*"
1392 (defconst cperl-white-and-comment-rex "\\([ \t\n]\\|#[^\n]*\n\\)+"
1409 cperl-white-and-comment-rex ; n+2=pre-name
1414 cperl-maybe-white-and-comment-rex ; n+5=pre-proto
1418 cperl-maybe-white-and-comment-rex ; n+8=pre-attr
1423 cperl-maybe-white-and-comment-rex ; whitespace-comments
1428 cperl-maybe-white-and-comment-rex ; whitespace-comments
1444 cperl-white-and-comment-rex ; 4 = pre-package-name
1449 cperl-maybe-white-and-comment-rex ; 15=pre-block
1461 (defvar cperl-string-syntax-table nil
1462 "Syntax table in use in CPerl mode string-like chunks.")
1492 (setq cperl-string-syntax-table (copy-syntax-table cperl-mode-syntax-table))
1493 (modify-syntax-entry ?$ "." cperl-string-syntax-table)
1494 (modify-syntax-entry ?\{ "." cperl-string-syntax-table)
1495 (modify-syntax-entry ?\} "." cperl-string-syntax-table)
1496 (modify-syntax-entry ?# "." cperl-string-syntax-table)) ; (?# comment )
1525 appropriate. You can set `cperl-electric-parens-string' to the string that
1581 on electric space between $ and {, `cperl-electric-parens-string' is
1582 the string that contains parentheses that should be electric in CPerl
1624 Non-nil means that the comment starting in leftmost column should indent.
1749 (make-local-variable 'comment-start)
1750 (setq comment-start "# ")
1751 (make-local-variable 'comment-end)
1752 (setq comment-end "")
1753 (make-local-variable 'comment-column)
1754 (setq comment-column cperl-comment-column)
1755 (make-local-variable 'comment-start-skip)
1756 (setq comment-start-skip "#+ *")
1760 ;;; cperl-maybe-white-and-comment-rex ; 15=pre-block
1767 cperl-maybe-white-and-comment-rex))
1768 (make-local-variable 'comment-indent-function)
1769 (setq comment-indent-function 'cperl-comment-indent)
1811 ((string< emacs-version "19.30")
1813 ((string< emacs-version "19.33") ; Which one to use?
1921 ;; This is used by indent-for-comment
1922 ;; to decide how much to indent a comment in CPerl code
1923 ;; based on its context. Do fallback if comment is found wrong.
1925 (defvar cperl-wrong-comment)
1934 (defun cperl-comment-indent () ; called at point at supposed comment
1936 (if (and (not cperl-indent-comment-at-column-0)
1938 0 ; Existing comment at bol stays there.
1939 ;; Wrong comment found
1941 (setq was (cperl-to-comment-or-eol)
1955 comment-column
1956 (max (1+ was) ; Else indent at comment column
1957 comment-column)))
1960 (insert comment-start)
1961 (backward-char (length comment-start)))
1962 (setq cperl-wrong-comment t)
1963 (cperl-make-indent comment-column 1) ; Indent min 1
1966 ;;;(defun cperl-comment-indent-fallback ()
1967 ;;; "Is called if the standard comment-search procedure fails.
1968 ;;;Point is at start of real comment."
1970 ;;; (if (= c comment-column) nil
1973 ;;; (current-column))) ; Else indent at comment column
1974 ;;; comment-column))
1975 ;;; (if (= c comment-column) nil
1985 (defun cperl-indent-for-comment ()
1986 "Substitute for `indent-for-comment' in CPerl."
1988 (let (cperl-wrong-comment)
1989 (indent-for-comment)
1990 (if cperl-wrong-comment ; set by `cperl-comment-indent'
1991 (progn (cperl-to-comment-or-eol)
1992 (forward-char (length comment-start))))))
1994 (defun cperl-comment-region (b e arg)
1996 See `comment-region'."
1998 (let ((comment-start "#"))
1999 (comment-region b e arg)))
2002 "Uncomment or comment each line in the region in CPerl mode.
2003 See `comment-region'."
2005 (let ((comment-start "#"))
2006 (comment-region b e (- arg))))
2026 (>= (save-excursion (cperl-to-comment-or-eol) (point)) (point)))
2074 (search-forward (make-string
2104 ;; Check whether we are in comment
2116 (append cperl-electric-parens-string nil))
2137 (append cperl-electric-parens-string nil))
2138 (>= (save-excursion (cperl-to-comment-or-eol) (point)) (point))
2149 (insert (make-string
2167 (append cperl-electric-parens-string nil))
2176 (>= (save-excursion (cperl-to-comment-or-eol) (point)) (point))
2183 (insert (make-string
2383 (save-excursion (cperl-to-comment-or-eol)
2384 (>= (point) pos)) ; Not in a comment
2503 ;; Ignore in comment lines
2630 ;; (setq indent (cperl-calculate-indent-within-comment)))
2737 [comment-special:at-beginning-of-line])
2812 [comment])
2814 [string])
2826 (eq (point) old-indent) ; old-indent was at comment
2869 ;; Find previous non-comment character.
2932 ;; We are at beginning of code (NOT label or comment)
2999 (comment-special:at-beginning-of-line nil)
3000 (string t)
3001 (comment nil))
3012 Returns nil if line starts inside a string, t if in a comment.
3037 ((eq 'terminator (elt i 1)) ; Lone terminator of "indentable string"
3121 ;; be quick anyway (this comment comes
3186 '((string nil)
3187 (comment nil)
3202 POS may be nil if it is hard to find, say, when TYPE is `string' or `comment'.
3214 (cond ((nth 3 state) ; In string
3215 (setq res (cons (list 'string nil (nth 3 state)) res))) ; What started string
3216 ((nth 4 state) ; In comment
3217 (setq res (cons '(comment) res)))
3259 ;; Find previous non-comment character.
3349 (defun cperl-calculate-indent-within-comment ()
3351 the current line is to be regarded as part of a block comment."
3359 (cperl-to-comment-or-eol)
3365 (defun cperl-to-comment-or-eol ()
3366 "Go to position before comment on the current line, or to end of line.
3367 Returns true if comment is found. In POD will not move the point."
3385 ; stop at comment
3386 ;; If fails (beginning-of-line inside sexp), then contains not-comment
3406 (t ; It was fair comment
3421 ;; C code looks for "^\\s(" to skip comment backward in "hard" situations
3427 (defun cperl-commentify (bb e string &optional noface)
3432 (setq string (if string cperl-st-sfence cperl-st-cfence))
3434 ;; one-char string/comment?!
3436 (cperl-modify-syntax-type bb string)
3437 (cperl-modify-syntax-type (1- e) string))
3438 (if (and (eq string cperl-st-sfence) (> (- e 2) bb))
3440 'syntax-table cperl-string-syntax-table))
3445 (put-text-property bb e 'face (if string 'font-lock-string-face
3446 'font-lock-comment-face)))))
3555 "End of `%s%s%c ... %c' string/RE not found: %s"
3598 (defvar font-lock-string-face)
3620 ;; d) 'Q'uoted string:
3621 ;; part between markers inclusive is marked `syntax-type' ==> `string'
3673 (defvar font-lock-comment-face)
3686 ":" cperl-maybe-white-and-comment-rex ; 2=whitespace/comment?
3711 (cperl-commentify p (point) t))) ; mark as string
3712 (forward-comment (buffer-size))
3779 (font-lock-string-face (if (boundp 'font-lock-string-face)
3780 font-lock-string-face
3781 'font-lock-string-face))
3805 (font-lock-comment-face
3806 (if (boundp 'font-lock-comment-face)
3807 font-lock-comment-face
3808 'font-lock-comment-face))
3862 cperl-white-and-comment-rex
3865 cperl-maybe-white-and-comment-rex
3931 (if (nth 3 state) ; in string
3939 t) ; Do nothing in comment/string
4171 'face font-lock-string-face)
4182 'face font-lock-string-face)
4333 i2 (string-match "^\\([sy]\\|tr\\)$" argument)
4368 (put-text-property b (point) 'syntax-type 'string)
4371 (string-match "^qw$" argument))
4391 (put-text-property b i 'syntax-type 'string)
4396 (put-text-property b (point) 'syntax-type 'string)
4412 (and (string-match "^\\([sm]?\\|qr\\)$" argument)
4430 (string-match "^\\(m\\|qr\\)$" argument)
4568 (not (string-match "(\\?[-imsx]+)"
4569 (match-string 0))))
4684 (char-to-string (char-after b))
4717 ((and (match-beginning 2) ; #-comment
4763 (t ; (?#)-comment
4773 "Couldn't find end of (?#...)-comment in a REx, pos=%s"
4784 'face font-lock-comment-face))))))
4803 ;; cperl-white-and-comment-rex ;13
4805 ;;"\\(" cperl-maybe-white-and-comment-rex ;15,16
4814 (cperl-commentify ; Prototypes; mark as string
4818 (forward-comment (buffer-size))
4828 ;;;(if (nth 3 state) nil ; in string
4840 ;; Trailing backslash; make non-quoting outside string/comment
4878 ;; Stops at lim or after non-whitespace that is not in comment
4879 ;; XXXX Wrongly understands end-of-multiline strings with # as comment
4889 (not (memq pr '(string prestring))))
4890 (progn (cperl-to-comment-or-eol) (bolp))
4897 (defun cperl-block-p () ; Do not C-M-q ! One string contains ";" !
4962 CHARS is a string that contains good characters to have before us (however,
4984 (if (looking-at "^[ \t]*\\(#\\|$\\)") nil ; Only comment, skip
4986 (cperl-to-comment-or-eol) ; Will not move past "." after a format
5006 (and (eq (following-char) ?.) ; in format: see comment above
5023 (or (looking-at (concat cperl-maybe-white-and-comment-rex "[;}]"))
5077 Will not indent comment if it starts at `comment-indent' or looks like
5078 continuation of the comment on the previous line.
5112 cperl-maybe-white-and-comment-rex
5114 cperl-maybe-white-and-comment-rex
5123 (concat cperl-maybe-white-and-comment-rex
5170 (insert (make-string cperl-indent-region-fix-constructs ?\s))
5188 (insert (make-string cperl-indent-region-fix-constructs ?\s))
5197 (insert (make-string cperl-indent-region-fix-constructs ?\s))
5206 (insert (make-string cperl-indent-region-fix-constructs ?\s))
5216 (make-string cperl-indent-region-fix-constructs ?\s))
5260 (make-string cperl-indent-region-fix-constructs ?\s))))
5269 (make-string cperl-indent-region-fix-constructs ?\ )))
5348 Should be slow. Will not indent comment if it starts at `comment-indent'
5349 or looks like continuation of the comment on the previous line.
5367 (setq old-comm-indent (and (cperl-to-comment-or-eol)
5379 comment-column))
5387 (let ((comment-column new-comm-indent))
5388 (indent-for-comment)))
5397 (and (cperl-to-comment-or-eol)
5405 (progn (indent-for-comment)
5425 If any of the current line is a comment, fill the comment or the
5426 block of it that point is in, preserving the comment's initial
5427 indentation and initial hashes. Behaves usually outside of comment."
5429 (let (;; Non-nil if the current line contains a comment.
5430 has-comment
5432 ;; If has-comment, the appropriate fill-prefix for the comment.
5433 comment-fill-prefix
5434 ;; Line that contains code and comment (or nil)
5436 c spaces len dc (comment-column comment-column))
5437 ;; Figure out what kind of comment we are looking at.
5442 ;; A line with nothing but a comment on it?
5444 (setq has-comment t
5445 comment-fill-prefix (buffer-substring (match-beginning 0)
5448 ;; A line with some code, followed by a comment? Remember that the
5449 ;; semi which starts the comment shouldn't be part of a string or
5451 ((cperl-to-comment-or-eol)
5452 (setq has-comment t)
5455 comment-fill-prefix
5456 (concat (make-string (current-column) ?\s)
5463 (insert (make-string dc ?-))))) ; Placeholder (to avoid splitting???)
5464 (if (not has-comment)
5465 (fill-paragraph justify) ; Do the usual thing outside of comment
5466 ;; Narrow to include only the comment, and then fill the region.
5499 (fill-prefix comment-fill-prefix))
5507 (setq comment-column c)
5508 (indent-for-comment)
5520 (cperl-to-comment-or-eol) (point)))
5523 ;; Don't break line inside code: only inside comment.
5625 ((string-match "[:']" name)
5641 (setq name (concat (make-string
5667 (cond ((string-match "\\(::\\|'\\)[_a-zA-Z0-9]+$" (car elt))
5728 (cond ((featurep 'ps-print)
5742 "ps-print"
5906 cperl-white-and-comment-rex ; whitespace/comments
5909 cperl-maybe-white-and-comment-rex ;whitespace/comments?
5911 cperl-maybe-white-and-comment-rex ; whitespace/comments?
5933 (2 font-lock-string-face t)
5937 (2 font-lock-string-face t)
5940 (1 font-lock-string-face t))))
5942 2 font-lock-string-face t)))
5944 font-lock-string-face t)
5964 cperl-maybe-white-and-comment-rex
5966 cperl-maybe-white-and-comment-rex
5974 cperl-maybe-white-and-comment-rex
5976 cperl-maybe-white-and-comment-rex
6024 (string< "21.1.9" emacs-version)
6025 (and (string< "21.1.10" emacs-version)
6026 (string< emacs-version "21.1.2")))
6069 (if (fboundp 'ps-print-buffer) (cperl-ps-print-init))
6075 (list 'font-lock-comment-face
6081 (list 'font-lock-string-face
6166 (cperl-force-face font-lock-comment-face
6185 ;; (or (boundp 'font-lock-comment-face)
6186 ;; (defconst font-lock-comment-face
6187 ;; 'font-lock-comment-face
6310 (defun cperl-ps-print-init ()
6311 "Initialization of `ps-print' components for faces used in CPerl."
6312 (eval-after-load "ps-print"
6313 '(setq ps-bold-faces
6317 ps-bold-faces)
6318 ps-italic-faces
6321 ps-italic-faces)
6322 ps-underlined-faces
6325 ps-underlined-faces))))
6327 (defvar ps-print-face-extension-alist)
6329 (defun cperl-ps-print (&optional file)
6331 If optional argument FILE is an empty string, prints to printer, otherwise
6334 Style of printout regulated by the variable `cperl-ps-print-face-properties'."
6339 (concat (buffer-file-name) ".ps")
6343 (require 'ps-print) ; To get ps-print-face-extension-alist
6344 (let ((ps-print-color-p t)
6345 (ps-print-face-extension-alist ps-print-face-extension-alist))
6346 (cperl-ps-extend-face-list cperl-ps-print-face-properties)
6347 (ps-print-buffer-with-faces file)))
6349 ;;; (defun cperl-ps-print-init ()
6350 ;;; "Initialization of `ps-print' components for faces used in CPerl."
6352 ;;; (defvar ps-underlined-faces nil)
6353 ;;; (defvar ps-bold-faces nil)
6354 ;;; (defvar ps-italic-faces nil)
6355 ;;; (setq ps-bold-faces
6364 ;;; ps-bold-faces))
6365 ;;; (setq ps-italic-faces
6371 ;;; ps-italic-faces))
6372 ;;; (setq ps-underlined-faces
6378 ;;; ps-underlined-faces))
6379 ;;; (cons 'font-lock-type-face ps-underlined-faces))
6583 The arguments are a string representing the desired style.
6671 (read (read-string
6682 (if (string-match "^-[a-zA-Z]$" command)
6684 (setq isvar (string-match "^[$@%]" command)
6824 (setq search (regexp-quote (char-to-string (following-char)))))
6993 (if (and prefix (string-match (concat "^" prefix) name))
6995 (cond ((string-match "::" name) nil)
7040 (cond ((string-match "^[_a-zA-Z]" (car elt))
7062 (if (string-match "^package " (car elt))
7066 (number-to-string (elt elt 2)) ; Line
7068 (number-to-string (1- (elt elt 1))) ; Char pos 0-based
7070 (if (and (string-match "^[_a-zA-Z]+::" (car elt))
7071 (string-match "^sub[ \t]+\\([_a-zA-Z]+\\)[^:_a-zA-Z]"
7086 (insert "\f\n" rel "," (number-to-string (1- pos)) "\n")
7158 ((string-match cperl-noscan-files-regexp file)
7161 (if (string-match cperl-scan-files-regexp file)
7167 (setq xs (string-match "\\.xs$" file))
7327 root-packages root-functions ms many_ms same_name ps
7331 (cond ((and (string-match regexp (car elt))
7589 (string-match "[a-zA-Z0-9_]" (char-to-string (preceding-char)))
7612 (not (string-match "^#!\\|\\\\\\|^=" word)) ; Show help even in comments/strings.
7614 '(font-lock-comment-face font-lock-string-face))
7633 ((string-match "^[&*][a-zA-Z_]" val)
7635 ((string-match "^[$@]\\([a-zA-Z_:0-9]+\\)[ \t]*\\[" val)
7637 ((string-match "^[$@]\\([a-zA-Z_:0-9]+\\)[ \t]*{" val)
7639 ((and (string= val "x") (string-match "^x=" val))
7641 ((string-match "^\\$[\C-a-\C-z]" val)
7642 (setq val (concat "$^" (char-to-string (+ ?A -1 (aref val 1))))))
7643 ((string-match "^CORE::" val)
7645 ((string-match "^SUPER::" val)
7647 ((and (string= "<" val) (string-match "^<\\$?[a-zA-Z0-9_:]+>" val))
7677 $! In numeric context: errno. In a string context: error string.
7694 $& The string matched by the last pattern match (auto-local).
7695 $' The string after what was matched by the last match (auto-local).
7696 $` The string before what was matched by the last match (auto-local).
7700 $* Deprecated: Set to 1 to do multiline matching within a string.
7715 $[ Deprecated: The index of the first element/char in an array/string.
7717 $] The perl version string as displayed with perl -v.
7943 ord(EXPR) ASCII value of the first char of the string.
8033 ... x ... Repeat string or array.
8068 pos STRING Set/Get end-position of the last match over this string, see \\G.
8250 (or (eolp) (indent-for-comment))
8365 ((match-beginning 1) ; #-comment
8411 (let (A B pre-B post-B pre-if post-if pre-A post-A if-string
8433 (setq if-string (buffer-substring (match-beginning 0) (match-end 0)))
8456 (and (looking-at "[ \t]*#") (cperl-indent-for-comment))
8460 (insert if-string " (" A ") {")
8465 (cperl-indent-for-comment)
8488 pre-A post-A pre-B post-B A B state p end-B-code is-block B-comment
8489 (if-string (buffer-substring (match-beginning 0) (match-end 0))))
8521 "`%s' (EXPR) {BLOCK} with `else'/`elsif'" if-string)
8535 (error "`%s' inside `%s' BLOCK" A if-string))
8545 (setq B-comment
8561 (and B-comment (insert B-comment " "))
8569 (indent-for-comment))
8581 (if B-comment
8584 (indent-for-comment)
8586 (error "`%s' (EXPR) not with an {BLOCK}" if-string)))
8587 ;; (error "`%s' not with an (EXPR)" if-string)
8602 (input (read-string
8604 (if (string= default-entry "")
8607 (if (string= input "")
8608 (if (string= default-entry "")
8615 (string-match "^[a-z]+$" word)
8616 (string-match (concat "^" word "\\>")
8717 (and (eq (get-text-property beg 'syntax-type) 'string)
9052 (string-match ":\\s *\\([0-9.]+\\)" v)