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

Lines Matching +defs:auto +defs:mode +defs:list

1 ;;; cperl-mode.el --- Perl code editing commands for Emacs
32 ;; You can either fine-tune the bells and whistles of this mode or
44 ;; The mode information (on C-h m) provides some customization help.
45 ;; If you use font-lock feature of this mode, it is advisable to use
46 ;; either lazy-lock-mode or fast-lock-mode. I prefer lazy-lock.
54 ;; This mode supports font-lock, imenu and mode-compile. In the
56 ;; yourself (note that mode-compile is not standard yet). Well, you
92 (defvar font-lock-background-mode) ; not in Emacs
117 (;;(and (fboundp 'face-list)
118 ;; (face-list))
119 (fboundp 'face-list)
120 (` (member (, arg) (and (fboundp 'face-list)
121 (face-list)))))
139 (list (, file) (, line)))))
163 (defun cperl-choose-color (&rest list)
165 (while list
167 (if (or (x-color-defined-p (car list))
168 (null (cdr list)))
169 (setq answer (car list))))
170 (setq list (cdr list)))
174 "Major mode for editing Perl code."
285 (defcustom cperl-auto-newline nil
290 `cperl-auto-newline-after-colon' set."
296 Active if `cperl-auto-newline' is false."
300 (defcustom cperl-auto-newline-after-colon nil
302 Subject to `cperl-auto-newline' setting."
307 "*Non-nil means TAB in CPerl mode should always reindent the current line,
313 "*Non-nil (and non-null) means CPerl buffers will use `font-lock-mode'.
340 (or (and (boundp 'transient-mark-mode) ; For Emacs
341 transient-mark-mode)
360 Uses `abbrev-mode' to do the expansion. If you want to use your
361 own abbrevs in cperl-mode, but do not want keywords to be
362 electric, you must redefine `cperl-mode-abbrev-table': do
363 \\[edit-abbrevs], search for `cperl-mode-abbrev-table', and, in
395 "*Special version of `vc-sccs-header' that is used in CPerl mode buffers."
400 "*Special version of `vc-rcs-header' that is used in CPerl mode buffers."
410 (defcustom cperl-clobber-mode-lists
413 (boundp 'interpreter-mode-alist)
414 (assoc "miniperl" interpreter-mode-alist)
415 (assoc "\\.\\([pP][Llm]\\|al\\)$" auto-mode-alist)))
416 "*Whether to install us into `interpreter-' and `extension' mode lists."
480 entered CPerl mode the first time will have no effect."
642 "List given as an argument to `ps-extend-face-list' in `cperl-ps-print'."
664 "Font Lock mode face used non-overridable keywords and modifiers of regexps."
677 "Font Lock mode face used to highlight array names."
690 "Font Lock mode face used to highlight hash names."
701 Subdirectory `cperl-mode' may contain yet newer development releases and/or
705 ftp://ftp.math.ohio-state.edu/pub/users/ilya/cperl-mode/patches
708 mode.) As of beginning of 2003, XEmacs may provide a similar ability.
717 mode-compile.el.
719 If your Emacs does not default to `cperl-mode' on Perl files, and you
722 (defalias 'perl-mode 'cperl-mode)
740 Switch auto-help on/off with Perl/Tools/Auto-help.
742 Though with contemporary Emaxen CPerl mode should maintain the correct
745 \\[normal-mode]
749 \\[load-library] cperl-mode RET
750 \\[normal-mode]
756 "Description of problems in CPerl mode.
770 "Description of problems in CPerl mode specific for older Emacs versions.
784 Even with older Emacsen CPerl mode tries to corrects some Emacs
814 "Advantages of CPerl mode.
819 mode - but the latter number may have improved too in last years) even
841 1) Separate unordered list of \"interesting places\";
843 3) Separate list of packages;
849 f) Has a builtin list of one-line explanations for perl constructs.
952 "CPerl mode uses following faces for highlighting:
1010 `(define-key cperl-mode-map
1032 (if transient-mark-mode mark-active t))
1039 (set 'unread-command-events (list c))) ; Avoid undefined warning
1043 (setq unread-command-events (list (eval '(character-to-event c))))))
1063 (defcustom cperl-mode-hook nil
1064 "Hook run by CPerl mode."
1103 ;;;(and cperl-clobber-mode-lists
1104 ;;;(setq auto-mode-alist
1105 ;;; (append '(("\\.\\([pP][Llm]\\|al\\)$" . perl-mode)) auto-mode-alist ))
1106 ;;;(and (boundp 'interpreter-mode-alist)
1107 ;;; (setq interpreter-mode-alist (append interpreter-mode-alist
1108 ;;; '(("miniperl" . perl-mode))))))
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'")))
1125 (defvar cperl-mode-abbrev-table nil
1126 "Abbrev table in use in CPerl mode buffers.")
1128 (add-hook 'edit-var-mode-alist '(perl-mode (regexp . "^cperl-")))
1130 (defvar cperl-mode-map () "Keymap used in CPerl mode.")
1132 (if cperl-mode-map nil
1133 (setq cperl-mode-map (make-sparse-keymap))
1146 (cperl-define-key "\C-c\C-a" 'cperl-toggle-auto-newline)
1149 (cperl-define-key "\C-c\C-f" 'auto-fill-mode)
1205 cperl-mode-map global-map))
1208 cperl-mode-map global-map)
1211 cperl-mode-map global-map)
1214 cperl-mode-map global-map)))
1223 cperl-menu cperl-mode-map "Menu for CPerl mode"
1263 ["Run" mode-compile (fboundp 'mode-compile)]
1264 ["Kill" mode-compile-kill (and (fboundp 'mode-compile-kill)
1267 ["Check syntax" cperl-check-syntax (fboundp 'mode-compile)]
1305 (fboundp 'ps-extend-face-list)]
1316 ;;["Update classes" (cperl-tags-hier-init t) tags-table-list]
1353 ["Auto newline" cperl-toggle-auto-newline t]
1358 ["Auto fill" auto-fill-mode t])
1375 ["CPerl mode" (describe-function 'cperl-mode) t]
1458 (defvar cperl-mode-syntax-table nil
1459 "Syntax table in use in CPerl mode buffers.")
1462 "Syntax table in use in CPerl mode string-like chunks.")
1470 (if cperl-mode-syntax-table
1472 (setq cperl-mode-syntax-table (make-syntax-table))
1473 (modify-syntax-entry ?\\ "\\" cperl-mode-syntax-table)
1474 (modify-syntax-entry ?/ "." cperl-mode-syntax-table)
1475 (modify-syntax-entry ?* "." cperl-mode-syntax-table)
1476 (modify-syntax-entry ?+ "." cperl-mode-syntax-table)
1477 (modify-syntax-entry ?- "." cperl-mode-syntax-table)
1478 (modify-syntax-entry ?= "." cperl-mode-syntax-table)
1479 (modify-syntax-entry ?% "." cperl-mode-syntax-table)
1480 (modify-syntax-entry ?< "." cperl-mode-syntax-table)
1481 (modify-syntax-entry ?> "." cperl-mode-syntax-table)
1482 (modify-syntax-entry ?& "." cperl-mode-syntax-table)
1483 (modify-syntax-entry ?$ "\\" cperl-mode-syntax-table)
1484 (modify-syntax-entry ?\n ">" cperl-mode-syntax-table)
1485 (modify-syntax-entry ?# "<" cperl-mode-syntax-table)
1486 (modify-syntax-entry ?' "\"" cperl-mode-syntax-table)
1487 (modify-syntax-entry ?` "\"" cperl-mode-syntax-table)
1489 (modify-syntax-entry ?_ "w" cperl-mode-syntax-table))
1490 (modify-syntax-entry ?: "_" cperl-mode-syntax-table)
1491 (modify-syntax-entry ?| "." cperl-mode-syntax-table)
1492 (setq cperl-string-syntax-table (copy-syntax-table cperl-mode-syntax-table))
1504 (defvar cperl-use-major-mode 'cperl-mode)
1511 (defun cperl-mode ()
1512 "Major mode for editing Perl code.
1513 Expression and list commands understand all C brackets.
1523 since most the time you mean \"less\". CPerl mode tries to guess
1526 contains the parenths from the above list you want to be electrical.
1531 CPerl mode provides expansion of the Perl control constructs:
1577 \\{cperl-mode-map}
1579 Setting the variable `cperl-font-lock' to t switches on font-lock-mode
1587 options simultaneously (recommended mode of use) by setting
1590 whitespace inserted by semis and braces in `auto-newline'-mode by
1621 Non-nil means TAB in CPerl mode should always reindent the current line,
1625 `cperl-auto-newline'
1630 `cperl-auto-newline-after-colon' set.
1631 `cperl-auto-newline-after-colon'
1633 Subject to `cperl-auto-newline' setting.
1677 Turning on CPerl mode calls the hooks in the variable `cperl-mode-hook'
1685 (use-local-map cperl-mode-map)
1698 (setq major-mode cperl-use-major-mode)
1699 (setq mode-name "CPerl")
1701 (define-abbrev-table 'cperl-mode-abbrev-table '(
1723 (setq local-abbrev-table cperl-mode-abbrev-table)
1725 (abbrev-mode 1))
1726 (set-syntax-table cperl-mode-syntax-table)
1748 (setq require-final-newline mode-require-final-newline)
1778 ;;(setq auto-fill-function 'cperl-do-auto-fill) ; Need to switch on and off!
1858 (if (boundp 'normal-auto-fill-function) ; 19.33 and later
1859 (set (make-local-variable 'normal-auto-fill-function)
1860 'cperl-do-auto-fill)
1861 (or (fboundp 'cperl-old-auto-fill-mode)
1863 (fset 'cperl-old-auto-fill-mode (symbol-function 'auto-fill-mode))
1864 (defun auto-fill-mode (&optional arg)
1866 (eval '(cperl-old-auto-fill-mode arg)) ; Avoid a warning
1867 (and auto-fill-function (memq major-mode '(perl-mode cperl-mode))
1868 (setq auto-fill-function 'cperl-do-auto-fill))))))
1872 (font-lock-mode 1))))
1880 (run-mode-hooks 'cperl-mode-hook)
1913 (setcdr precdr (list
1914 (list
1915 '(memq major-mode '(cperl-mode perl-mode))
1995 "Comment or uncomment each line in the region in CPerl mode.
2002 "Uncomment or comment each line in the region in CPerl mode.
2012 If ONLY-BEFORE and `cperl-auto-newline', will insert newline before the
2040 (up-list (- (prefix-numeric-value arg)))
2048 (if (and (not arg) ; No args, end (of empty line or auto)
2061 (if cperl-auto-newline
2066 (if cperl-auto-newline
2068 (if (and cperl-auto-newline (null only-before))
2088 (cperl-auto-newline cperl-auto-newline)
2111 (setq cperl-auto-newline nil))
2142 (and abbrev-mode ; later it is too late, may be after `for'
2483 (if cperl-auto-newline
2493 (auto (and cperl-auto-newline
2495 cperl-auto-newline-after-colon)))
2522 (if auto (setq insertpos (point-marker)))
2525 (if auto
2543 (if (and cperl-auto-newline
2557 (if (and cperl-auto-newline
2671 ;; returns list (START STATE DEPTH PRESTART),
2699 (list start state depth prestart))))
2848 (list pre-indent-point)))
2970 (setq p (nth 1 ; start of innermost containing list
3002 "Alist of indentation rules for CPerl mode.
3192 "Alist of indentation rules for CPerl mode.
3201 "Return a list of lists ((TYPE POS)...) of good points before the point.
3213 (res (list (list 'parse-start start) (list 'parse-prestart prestart))))
3215 (setq res (cons (list 'string nil (nth 3 state)) res))) ; What started string
3228 (setq res (cons (list 'toplevel start) res)))
3230 (setq res (cons (list 'toplevel-after-parenth start) res)))
3232 (setq res (cons (list 'toplevel-continued start) res)))))
3237 (setq res (cons (list 'expression-blanks
3243 (cons (list 'expression containing-sexp) res))))
3248 (setq res (cons (list 'expression-blanks
3254 (cons (list 'expression containing-sexp) res))))
3257 (setq res (cons (list 'in-block containing-sexp) res))
3275 (list (list 'statement-continued containing-sexp))
3308 (list (list 'label-in-block (point)))
3310 (list
3311 (list 'label-in-block-min-indent (point))))
3313 (list 'statement-in-block (point))))))
3498 (modify-syntax-entry starter (concat "(" (list ender)) st)
3499 (modify-syntax-entry ender (concat ")" (list starter)) st))
3569 (list i i2 ender starter go-forward)))
3576 (or st-l (setq st-l (list nil))) ; Avoid overwriting '()
3680 (or st-l (setq st-l (list nil))) ; Avoid overwriting '()
3764 (case-fold-search nil) (inhibit-read-only t) (buffer-undo-list t)
3776 (st-l (list nil)) (err-l (list nil))
4641 tag nil ; list of POSIX classes
4868 ;; cperl-mode-syntax-table.
4869 ;; (set-syntax-table cperl-mode-syntax-table)
4871 (list (car err-l) overshoot)))
4963 `}' is treated \"smartly\" if it is not in the list)."
5104 (if (eq (following-char) ?$ ) ; for my $var (list)
5309 (up-list 1)
5347 "Simple variant of indentation of region in CPerl mode.
5360 (list nil nil nil) ; Cannot use '(), since will modify
5421 ;; Stolen from lisp-mode with a lot of improvements
5513 (defun cperl-do-auto-fill ()
5658 (let ((lst index-pack-alist) hier-list pack elt group name)
5662 (if (assoc name hier-list) nil
5663 (setq hier-list (cons (cons name (cdr elt)) hier-list))))
5669 (if (setq group (assoc pack hier-list))
5678 (setcdr group (list (cons (substring
5682 (setq hier-list
5684 (list (cons (substring
5688 hier-list))))))
5690 hier-list)
5734 (add-hook 'font-lock-mode-hook
5737 (if (memq major-mode '(perl-mode cperl-mode))
5746 "Additional expressions to highlight in Perl mode. Minimal set.")
5748 "Additional expressions to highlight in Perl mode. Default set.")
5750 "Additional expressions to highlight in Perl mode. Maximal set")
5787 (list
5802 (list
5839 "b\\(in\\(d\\|mode\\)\\|less\\)\\|"
5872 ;; Somehow 's', 'm' are not auto-generated???
5873 (list
5905 (list (concat "\\<sub"
5949 ;; Uncomment to get perl-mode-like vars
6058 (list '("\\([$*]{?\\sw+\\)" 1
6073 (list
6075 (list 'font-lock-comment-face
6081 (list 'font-lock-string-face
6087 (list 'font-lock-function-name-face
6099 (list 'font-lock-variable-name-face
6105 (list 'font-lock-type-face
6111 (list 'font-lock-warning-face
6119 (list 'font-lock-constant-face
6125 (list 'cperl-nonoverridable-face
6132 (list 'cperl-array-face
6139 (list 'cperl-hash-face
6219 (if (boundp 'font-lock-background-mode)
6220 font-lock-background-mode
6222 (face-list (and (fboundp 'face-list) (face-list))))
6226 ;;;; (face-list
6227 ;;;; (function (lambda (face) (member face face-list))))
6235 "Background as guessed by CPerl mode")
6346 (cperl-ps-extend-face-list cperl-ps-print-face-properties)
6582 "Set CPerl mode variables to use one of several different indentation styles.
6584 The list of styles is in `cperl-style-alist', available styles
6593 (let ((list (mapcar (function (lambda (elt) (list (car elt))))
6595 (list (completing-read "Enter style: " list nil 'insist))))
6619 (require 'mode-compile)
6621 (eval '(mode-compile)))) ; Avoid a warning
6659 (get major-mode 'find-tag-default-function)
6674 (list (if (equal read "")
6681 max-height char-height buf-list)
6701 buf-list (list buf "*info-perl-var*" "*info-perl*"))
6702 (while (and (not win) buf-list)
6703 (setq win (get-buffer-window (car buf-list) t))
6704 (setq buf-list (cdr buf-list)))
6862 (or files (setq files (list buffer-file-name)))
6866 (setq args (append (list "-e"
6875 (setq args (append (list "-e"
6886 (defun cperl-toggle-auto-newline ()
6887 "Toggle the state of `cperl-auto-newline'."
6889 (setq cperl-auto-newline (not cperl-auto-newline))
6890 (message "Newlines will %sbe auto-inserted now."
6891 (if cperl-auto-newline "" "not ")))
6894 "Toggle the state of automatic keyword expansion in CPerl mode."
6896 (abbrev-mode (if abbrev-mode 0 1))
6897 (message "Perl control structure will %sbe auto-inserted now."
6898 (if abbrev-mode "" "not ")))
6902 "Toggle the state of parentheses doubling in CPerl mode."
6905 (message "Parentheses will %sbe auto-doubled now."
6910 Delay of auto-help controlled by `cperl-lazy-help-time'."
6960 (set-syntax-table cperl-mode-syntax-table)
6962 (auto-fill-mode 0)
7043 (list (car elt)
7096 emacs -batch -q -no-site-file -l emacs/cperl-mode.el \
7105 emacs -batch -q -no-site-file -l emacs/cperl-mode.el \
7113 emacs -batch -q -no-site-file -l emacs/cperl-mode.el \
7153 tm nil) ; Return empty list
7196 (defvar cperl-tags-hier-regexp-list
7215 (while (re-search-forward cperl-tags-hier-regexp-list nil t)
7245 (setq cons1 (cons name (list (cons fileind (vector file info)))))
7257 One may build such TAGS files from CPerl mode menu."
7268 (setq cperl-hierarchy (list l1 l2 l3))
7274 (message "Updating list of classes...")
7277 (or tags-table-list
7282 (message "Updating list of classes... %s" tagsfile)
7285 tags-table-list)
7286 (message "Updating list of classes... postprocessing..."))
7289 (setq to (list nil (cons "Packages: " (nth 1 cperl-hierarchy))
7294 (message "Updating list of classes: done, requesting display...")
7310 (setq update (car update)))) ; Get the last from the list
7321 (make-list level "[_a-zA-Z0-9]+")
7339 (setcdr writeto (cons (list head (list "Packages: ")
7340 (list "Methods: "))
7394 (defun cperl-list-fold (list name limit)
7396 (if (<= (length list) limit) list
7398 (while list
7400 elt1 (car list)
7401 list (cdr list))
7407 list2 (list elt1)
7414 (let (list)
7420 (setq list (cperl-list-fold
7424 (cperl-menu-to-keymap list))))
7426 (list (cdr elt) (car elt) t))))) ; t is needed in 19.34
7427 (cperl-list-fold menu "Root" imenu-max-items)))))
7660 (list
7673 ... Range (list context); flip/flop [no flop when flip] (scalar context).
7685 $1 Match of the 1st set of parentheses in the last match (auto-local).
7686 $2 Match of the 2nd set of parentheses in the last match (auto-local).
7687 $3 Match of the 3rd set of parentheses in the last match (auto-local).
7688 $4 Match of the 4th set of parentheses in the last match (auto-local).
7689 $5 Match of the 5th set of parentheses in the last match (auto-local).
7690 $6 Match of the 6th set of parentheses in the last match (auto-local).
7691 $7 Match of the 7th set of parentheses in the last match (auto-local).
7692 $8 Match of the 8th set of parentheses in the last match (auto-local).
7693 $9 Match of the 9th set of parentheses in the last match (auto-local).
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).
7783 .. Range (list context); flip/flop (scalar context) operator.
7806 @_ Parameter array for subroutines; result of split() unless in list context.
8029 wantarray Returns true if the sub/eval is called in list context.
8086 =over [ NUMBER ] Start list.
8087 =item [ TITLE ] Start new item in the list.
8088 =back End list.
8601 (list (let* ((default-entry (cperl-word-at-point))
8624 (Manual-switches (if is-func (list "-f"))))
8674 (flist (and (boundp 'Man-filter-list) Man-filter-list)))
8682 (error "Malformed Man-filter-list"))
8704 SKIP is a list of possible types to skip, BEG and LIMIT are the starting
8707 SKIP may be a number, then it behaves as list of numbers up to SKIP; this
8713 (if (numberp skip) (setq skip (list 0 skip)))
8811 (push-mark (cdr p) nil t)) ; Message, activate in transient-mode
8827 (error "Face %s not configured for cperl-mode"
8849 (cperl-mode)
8851 (message "cperl-mode at %s: %s" l tot)
8875 (normal-mode)
8902 Delay of auto-help controlled by `cperl-lazy-help-time'."
8917 Delay of auto-help controlled by `cperl-lazy-help-time'."
8927 (if (not (memq major-mode '(perl-mode cperl-mode))) nil
8937 (let* ((modified (buffer-modified-p)) (buffer-undo-list t)
9056 (provide 'cperl-mode)
9059 ;;; cperl-mode.el ends here