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

Lines Matching +defs:mode +defs:function

29 ;; Major mode for editing Python, with support for inferior processes.
31 ;; There is another Python mode, python-mode.el, used by XEmacs and
34 ;; for Emacs (though I've submitted fixes). This mode is rather
39 ;; This doesn't implement all the facilities of python-mode.el. Some
42 ;; `compilation-shell-minor-mode' now is probably enough for that.]
45 ;; not specific to Python, and I've installed a minor mode to do the
46 ;; job properly in Emacs 23. [CC mode 5.31 contains an incompatible
47 ;; feature, `c-subword-mode' which is intended to have a similar
52 ;; definitions, and the inferior mode following `cmuscheme'. (The
53 ;; inferior mode can find the source of errors from
54 ;; `python-send-region' & al via `compilation-shell-minor-mode'.)
59 ;; Even where it has similar facilities, this mode is incompatible
60 ;; with python-mode.el in some respects. For instance, various key
73 (autoload 'comint-mode "comint")
83 (add-to-list 'interpreter-mode-alist '("jython" . jython-mode))
85 (add-to-list 'interpreter-mode-alist '("python" . python-mode))
87 (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
109 (1 font-lock-keyword-face) (2 font-lock-function-name-face))
177 ;; (defun python-font-lock-syntactic-face-function (state)
178 ;; "`font-lock-syntactic-face-function' for Python mode.
198 (defvar python-mode-map
200 ;; Mostly taken from python-mode.el.
211 (define-key map "\C-c\C-v" 'python-check) ; a la sgml-mode
283 (defvar python-mode-syntax-table
311 (let ((table (copy-syntax-table python-mode-syntax-table)))
314 "`python-mode-syntax-table' with backslash given whitespace syntax.")
412 "Number of columns for a unit of indentation in Python mode.
419 "Non-nil means Python mode guesses `python-indent' for the buffer."
475 (setq indent-tabs-mode nil)))
556 ;; Fixme: Like python-mode.el; not convinced by this.
573 ;; indentable comment like python-mode.el
730 "`indent-region-function' for Python.
757 ;; Fixme: Define {for,back}ward-sexp-function? Maybe skip units like
761 "`beginning-of-defun-function' for Python.
772 ;; Treat bol at beginning of function as outside function so
784 ;; last internal function followed by first
793 "`end-of-defun-function' for Python.
1012 "`imenu-create-index-function' for Python.
1142 ;;;; Inferior mode stuff (following cmuscheme).
1177 buffer-local value similarly if the current buffer is in Python mode
1178 or Inferior Python mode, so that source buffer stays associated with a
1198 (defvar inferior-python-mode-map
1200 ;; This will inherit from comint-mode-map.
1212 (defvar inferior-python-mode-syntax-table
1213 (let ((st (make-syntax-table python-mode-syntax-table)))
1221 ;; Fixme: This should inherit some stuff from `python-mode', but I'm
1224 (define-derived-mode inferior-python-mode comint-mode "Inferior Python"
1225 "Major mode for interacting with an inferior Python process.
1228 Hooks `comint-mode-hook' and `inferior-python-mode-hook' are run in
1241 \\{inferior-python-mode-map}"
1243 (setq mode-line-process '(":%s"))
1253 (compilation-shell-minor-mode 1))
1262 "`comint-input-filter' function for inferior Python.
1285 "`comint-preoutput-filter-functions' function: ignore prompts not at bol."
1347 Runs the hook `inferior-python-mode-hook' \(after the
1348 `comint-mode-hook' is run). \(Type \\[describe-mode] in the process
1374 (inferior-python-mode)
1375 ;; Load function definitions we need.
1376 ;; Before the preoutput function was used, this was done via -c in
1383 (if (derived-mode-p 'python-mode)
1398 "Like `python-send-string' but resets `compilation-shell-minor-mode'.
1421 ;; function to remove the temporary file when it has been evaluated
1423 ;; filter). This function also catches exceptions and truncates
1424 ;; tracebacks not to mention the frame of the function itself.
1426 ;; The `compilation-shell-minor-mode' parsing takes care of relating
1468 ;; Fixme: Try to define the function or class within the relevant
1492 (defcustom python-source-modes '(python-mode jython-mode)
1497 :type '(repeat function)
1510 function location information for debugging, and supports users of
1519 ;; Fixme: I'm not convinced by this logic from python-mode.el.
1536 (get-buffer-process (if (derived-mode-p 'inferior-python-mode)
1556 (set-char-table-parent table python-mode-syntax-table)
1560 Otherwise inherits from `python-mode-syntax-table'.")
1627 (defun python-eldoc-function ()
1629 Only works when point is in a function name, not its arg list, for
1667 (with-no-warnings (Info-mode))
1676 :mode 'python-mode
1711 "Packages implying `jython-mode'.
1712 If these are imported near the beginning of the buffer, `python-mode'
1713 actually punts to `jython-mode'."
1717 ;; Called from `python-mode', this causes a recursive call of the
1718 ;; mode. See logic there to break out of the recursion.
1720 "Invoke `jython-mode' if the buffer appears to contain Jython code.
1721 The criterion is either a match for `jython-mode' via
1722 `interpreter-mode-alist' or an import of a module from the list
1724 ;; The logic is taken from python-mode.el.
1729 (let ((interpreter (if (looking-at auto-mode-interpreter-regexp)
1731 (if (and interpreter (eq 'jython-mode
1734 interpreter-mode-alist))))
1735 (jython-mode)
1744 (jython-mode)))))))
1747 "`fill-paragraph-function' handling comments and multi-line strings.
1827 "`outline-level' function for Python mode.
1834 "`add-log-current-defun-function' for Python."
1860 ;; Fixme: Provide a find-function-like command to find source of a
1892 ;; doc for a function in the buffer and the import will lose if the
1974 "Completion function for Python for use with `hippie-expand'."
1975 (when (derived-mode-p 'python-mode) ; though we only add it locally
2001 '(push '(python-mode . python-module-path) ffap-alist))
2014 "Alist of named skeletons for Python mode.
2017 (defvar python-mode-abbrev-table nil
2018 "Abbrev table for Python mode.
2020 (define-abbrev-table 'python-mode-abbrev-table ())
2027 (function (intern (concat "python-insert-" name))))
2029 (add-to-list 'python-skeletons ',(cons name function))
2031 (define-abbrev python-mode-abbrev-table ,name "" ',function nil t))
2032 (define-skeleton ,function
2035 (put 'def-python-skeleton 'lisp-indent-function 2)
2151 (let ((py-mode-map (make-sparse-keymap)) ; it assumes this
2152 (features (cons 'python-mode features))) ; and requires this
2154 (remove-hook 'python-mode-hook ; undo this from `brm-init'
2157 python-brm-menu python-mode-map
2187 (defvar eldoc-documentation-function)
2193 (set-syntax-table python-mode-syntax-table))
2196 (copy-syntax-table python-mode-syntax-table)
2205 (defvar python-mode-running) ;Dynamically scoped var.
2208 (define-derived-mode python-mode fundamental-mode "Python"
2209 "Major mode for editing Python files.
2210 Font Lock mode is currently required for correct parsing of the source.
2211 See also `jython-mode', which is actually invoked if the buffer appears to
2212 contain Jython code. See also `run-python' and associated Python mode
2220 \\<python-mode-map>
2231 Supports Eldoc mode (only for functions, using a Python process),
2232 Info-Look and Imenu. In Outline minor mode, `class' and `def'
2236 Hippie Expand mode is turned on. Completion of symbols of the
2241 \\{python-mode-map}"
2248 ;; (font-lock-syntactic-face-function
2249 ;; . python-font-lock-syntactic-face-function)
2254 (set (make-local-variable 'indent-line-function) #'python-indent-line)
2255 (set (make-local-variable 'indent-region-function) #'python-indent-region)
2257 (set (make-local-variable 'fill-paragraph-function) 'python-fill-paragraph)
2258 (set (make-local-variable 'require-final-newline) mode-require-final-newline)
2259 (set (make-local-variable 'add-log-current-defun-function)
2269 (set (make-local-variable 'beginning-of-defun-function)
2271 (set (make-local-variable 'end-of-defun-function) 'python-end-of-defun)
2272 (setq imenu-create-index-function #'python-imenu-create-index)
2273 (set (make-local-variable 'eldoc-documentation-function)
2274 #'python-eldoc-function)
2275 (add-hook 'eldoc-mode-hook
2282 `(python-mode "^\\s-*def\\>" nil "#"
2300 (setq indent-tabs-mode nil))
2303 (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode
2304 (let ((python-mode-running t))
2307 (custom-add-option 'python-mode-hook 'imenu-add-menubar-index)
2308 (custom-add-option 'python-mode-hook
2310 "Turn off Indent Tabs mode."
2311 (set (make-local-variable 'indent-tabs-mode) nil)))
2312 (custom-add-option 'python-mode-hook 'turn-on-eldoc-mode)
2313 (custom-add-option 'python-mode-hook 'abbrev-mode)
2314 (custom-add-option 'python-mode-hook 'python-setup-brm)
2317 (define-derived-mode jython-mode python-mode "Jython"
2318 "Major mode for editing Jython files.
2319 Like `python-mode', but sets up parameters for Jython subprocesses.
2320 Runs `jython-mode-hook' after `python-mode-hook'."