summaryrefslogtreecommitdiffstats
path: root/Misc/python-mode.el
Commit message (Collapse)AuthorAgeFilesLines
...
* (py-electric-backspace): I'm not sure this function should be specialBarry Warsaw1999-05-241-4/+5
| | | | | | casing when py-honor-comment-indentation is nil, but this could be a religious issue with some. Seems to me we should still be dedenting such comment lines one level.
* (py-parse-state): When running under Emacs -- which doesn't haveBarry Warsaw1999-05-241-1/+7
| | | | | | buffer-syntactic-context -- just short circuit the TQS test by jumping to point-min and doing the test from there. For long files, this will be faster than looping with a re-search-backwards.
* (py-statement-closes-block-p): Add a py-goto-initial-line which fixesBarry Warsaw1999-05-241-0/+1
| | | | | | | | | | | | | | | indentation when the return value is a multiline sexp: def bug(): try: if 2>1: return (11+ 12) else: #XXX return 12 except: return 13
* (py-shell): Added optional argprompt, which will prompt for additionalBarry Warsaw1999-02-161-12/+30
| | | | switches to pass into the shell process (only on initial startup).
* (py-default-interpreter): New variable which selects whether CPythonBarry Warsaw1999-02-161-2/+32
| | | | | or JPython is the default interpreter to use when `C-c !' is entered for the first time.
* (py-mode-map): Add back force of RET (aka C-m) toBarry Warsaw1999-01-211-0/+9
| | | | py-newline-and-indent.
* (py-mode-map): Removed special bindings for C-m and C-j toBarry Warsaw1999-01-191-3/+0
| | | | | | | | | | | py-newline-and-indent. These ought to get picked up by the mapcar that follows; any existing binding to newline-and-indent gets shadowed to py-newline-and-indent. This will break some people who, e.g. bind C-m or C-j to newline but still want these bound to py-newline-and-indent in Python mode. On the other hand, the forced binding pisses off Emacs diehards. So consider this experimental and see if any tall Dutch guys complain :-)
* (py-narrow-to-defun): New command (bound to C-x n d) which mimics theBarry Warsaw1999-01-181-0/+15
| | | | | | standard narrow-to-defun but works with Python classes and methods. With no arg, narrows to most enclosing def/method. With C-u arg, narrows to most enclosing class.
* (py-electric-delete): Implement the XEmacs 21 blessed way of checkingBarry Warsaw1999-01-151-3/+4
| | | | for delete forwardness.
* (py-outdent-p): Short circuit infloop for illegal constructBarry Warsaw1999-01-091-0/+2
| | | | (e.g. except: on first line of buffer).
* (py-goto-beginning-of-tqs): Finds the beginning of the triple quotedBarry Warsaw1998-12-151-11/+28
| | | | | | | | | | | | | | | | | | | | | | | string we find ourselves in, based on the passed in delimiter. (py-compute-indentation): Fixes for indentation errors when we land inside a triple quoted string. For example: def foo(): if os.path.isfile(o_pri_mbox_file) and os.path.isfile(o_pub_mbox_file): print """\ I found both a private and a public mbox archive file private: %s public : %s I won't move either file, but you should choose one and move it to %s You may want to merge them manually, but be careful about exposing private correspondences to the public.""" % ( o_pri_mbox_file, o_pub_mbox_file, mbox_file) *----indentation would be wrong on this line.
* (py-execute-region): Hack around the different behavior and switchBarry Warsaw1998-11-201-14/+21
| | | | | semantics between CPython/JPython when the script source is piped to stdin.
* (py-execute-region): Patch by Hunter Kelly so that execution uses theBarry Warsaw1998-11-171-4/+4
| | | | correct Python shell (CPython or JPython).
* (py-imenu-method-regexp): Fix suggested by Daniel Calvelo toBarry Warsaw1998-10-281-2/+6
| | | | generalize the matching of function arguments.
* #XEmacs 21 now supports Imenu, so I am able to test (and fix) someBarry Warsaw1998-10-281-92/+73
| | | | | | | | | | | | | #simple things. First step: rename the Imenu supportive variables and #functions in this file to py-imenu-* so I can grok what is part of #python-mode and what is part of Imenu. (py-imenu-create-index-engine): Fixed problem with two classes in a single file, caused by new semantics of py-beginning-of-def-or-class when called programmatically. #Note, there are still some problems with Imenu when arguments to #functions are funky, but it should be much better now.
* #Some minor changes in the commentary, obstensibly to test the newBarry Warsaw1998-10-271-8/+9
| | | | #checkin script.
* #Fixed some typos in docstrings.Barry Warsaw1998-10-271-6/+6
|
* (py-comint-output-filter-function): Horrible kludgearound for makingBarry Warsaw1998-09-251-1/+4
| | | | the de-queing of exec files work for NT XEmacs 21.0.
* (py-guess-indent-offset): Only print message about py-indent-offsetBarry Warsaw1998-09-251-3/+4
| | | | when in an interactive session (suggested by B. Wiener).
* (py-execute-file, py-execute-import-or-reload): Use a Python `raw'Barry Warsaw1998-09-241-2/+2
| | | | | | string in the argument to execfile() so a Windows temp directory named, e.g. c:\\tmp doesn't get interpreted as a file name with an embedded tab! (given by C. Waldman).
* (py-block-comment-prefix): Remove trailing space. Also explain thatBarry Warsaw1998-09-221-4/+5
| | | | | | | | this string should not end with whitespace. (py-compute-indentation): Append whitespace regexp to py-block-comment-prefix so that any combination of intervening whitespace will be recognized.
* #Code rearranging to quiet byte-compilerBarry Warsaw1998-09-141-88/+88
|
* (py-in-literal): How'd this get through? c-point => py-pointBarry Warsaw1998-08-291-1/+1
|
* Update commentary. For most stuff, point people to the web pageBarry Warsaw1998-08-201-58/+18
|
* (py-shell-map): New variable contains the keymap used in *Python*Barry Warsaw1998-08-201-5/+12
| | | | | | | | shell buffers. (py-shell): Moved the require of comint to the top level. Also use-local-map py-shell-map instead of hacking on the comint-mode-map. This eliminates breakage of other comint-mode buffers (e.g. shell).
* (py-shell): comint-output-filter-functions is already buffer-localBarry Warsaw1998-08-201-1/+0
|
* (py-process-filter): Deleted this function. In order to fixBarry Warsaw1998-08-201-116/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interactions with newer Emacsen, I've rewritten the way all the process filters work in the *Python* buffer. We use more of the comint infrastructure, specifically the default process filter. This means that scrolling is now handled by the default comint variables including comint-scroll-to-bottom-on-output. Note that this is somewhat experimental change! (py-comint-output-filter-function): Moved to here from the obsolete py-process-filter function, the logic to pop and exec the next queued file waiting to be executed. (py-execute-file): Don't bind comint-scroll-to-bottom-on-output to t, and save the excursion when inserting the "working on" message. This lets the standard comint scrolling variables as set by the user, continue to work. (python-mode, py-shell, py-describe-mode): Remove description of py-scroll-process-buffer. Also in py-shell, make comint-output-filter-functions buffer-local, and add py-comint-output-filter-function to this hook (instead of setting the process filter). (py-scroll-process-buffer): Deleted this variable. See comint variables including comint-scroll-to-bottom-on-output. (py-execute-region): When exec files are being queued, push the next temp file on the end of the list. (py-submit-bug-report): Removed reporting of py-scroll-process-buffer.
* (imenu-example--create-python-index-engine): Fix nesting breakage whenBarry Warsaw1998-08-181-0/+2
| | | | | | a method definition has args that span multiple lines; be sure to go to the beginning of the method definition -- but watch out for the match-data!
* (imenu-example--python-method-regexp): Patch from Christian Tanzer:Barry Warsaw1998-08-101-1/+1
| | | | | | | "3.67 fixes Imenu as far as classes are concerned, but some default values for function arguments are still not supported." This ought to fix that problem.
* (py-compute-indentation): Changes to the `t' condition which affectBarry Warsaw1998-08-101-9/+15
| | | | | | | | | | | indetnation of normal statements: The regular expression that searches for indenting comment lines has been changed to not require a space/tab after the first `#'. We then explicitly look for py-block-comment-prefix depending on the value of py-honor-comment-indentation. I think this more accurately reflects the documentation for py-honor-comment-indentation.
* #Typos from previous checkinBarry Warsaw1998-08-101-2/+2
|
* Huge number of docstring changes, typo fixes, rewordings, GNU standardBarry Warsaw1998-08-101-186/+234
| | | | | | | | conformations, etc., etc. inspired and given by Michael Ernst. These include error string fixes, moving of comments to docstrings, some other non-related typos, terminology standardizing (b/w TP and myself, and b/w myself and myself :-) although more can still be done. E.g. "outdenting" => "dedenting".
* (py-execute-region): When temp-names are broken (Emacs 19.34), aBarry Warsaw1998-08-071-3/+7
| | | | | | serial number isn't enough to uniquify the temp file name -- what if two users are on the same machine? Add in the (emacs-pid) to help further. Should never be tickled on Emacs 20, XEmacs 20, 21.
* (py-beginning-of-def-or-class, py-end-of-def-or-class,Barry Warsaw1998-07-071-21/+37
| | | | | | | | | | py-mark-def-or-class): Integrated Michael Ernst latest patches. Primarily, it allows functions that search or mark defs/classes based on programmatic specification, to take an 'either flag value which allows searching for both classes and defs (stopping at the nearest construct). Also clean up some docstrings.
* (py-comment-indent-function): A replacement forBarry Warsaw1998-07-071-13/+32
| | | | | | | | | | | | comment-indent-function's default lambda value (in simple.el), this version finally kills this nit: auto-filling a comment that starts in column zero with filladapt turned off would cascade the #'s to the right. Now auto-filling seems to work with or without filladapt, and with the comment starting in any column. (python-mode): Set comment-indent-function.
* (py-ask-about-save): New variable used inBarry Warsaw1998-05-191-5/+13
| | | | | py-execute-import-or-reload. Same semantics as compilation-ask-about-save.
* (py-execute-string): Bind to C-c C-s, and put on menuBarry Warsaw1998-05-191-0/+2
|
* (py-stringlit-re): Another ME patch to recognize SQTQs and DQTQsBarry Warsaw1998-05-191-2/+20
| | | | | (single and double quoted triple quoted strings :-) with embedded single like-quotes. Also recognizes raw prefix.
* More ME patches:Barry Warsaw1998-05-191-4/+86
| | | | | | | | | | | | | | (py-execute-import-or-reload): Cool new command that imports or reloads the current file as a module, so as not to clutter the global namespace. Bound to C-c C-m. (py-execute-def-or-class): New command that sends the current def or class to the interpreter. Bound to C-M-x. (py-execute-string): New command that sends arbitrary string to the interpreter. Not bound by default. (py-describe-mode): Doco updates.
* (beginning-of-python-def-or-class): Renamed toBarry Warsaw1998-05-191-52/+82
| | | | | | | | | py-beginning-of-def-or-class, and defaliased for backwards compatibility. ME patch to add optional second argument, count. (end-of-python-def-or-class): Renamed to py-end-of-def-or-class, and defaliased for backwards compatibility. ME patch to add optional second argument, count.
* More ME patches:Barry Warsaw1998-05-191-2/+7
| | | | | | | | (py-shell): Recognize the Python debugger prompt (py-jump-to-exception): Force into python-mode any buffer that gets jumped to on exception. Cope with py-exception-buffer possibly a cons.
* #Documentation and comment typos patch given by Michael Ernst. MoreBarry Warsaw1998-05-191-17/+17
| | | | #of his patches to follow.
* (py-compute-indentation): Use forward-comment to skip over allBarry Warsaw1998-04-161-1/+1
| | | | whitespace and comment noise.
* (py-toggle-shells): Added a message in the minibuf.Barry Warsaw1998-04-101-0/+1
|
* Quick and extremely dirty hacks to toggle between using CPython andBarry Warsaw1998-04-091-1/+59
| | | | | | | | | | | | | | | JPython interpreters. This implementation may suck. (py-jpython-command, py-jpython-command-args): New variables. (py-mode-map): py-toggle-shells bound to C-c C-t (py-toggle-shells): Command to toggle between using CPython (the default) and JPython. This is buffer local, and notice the mode-name change. (py-shell): Use either CPython or JPython. Note that py-execute-* still needs to be modified.
* (imenu-example--python-class-regexp): Fix to recognize Module.Class inBarry Warsaw1998-04-041-1/+1
| | | | inheritance list.
* #Oops, I lost the CVS/RCS $Revision$Barry Warsaw1998-04-021-1/+1
|
* (py-compute-indentation): When looking at a continuation line insideBarry Warsaw1998-04-011-1/+6
| | | | | | | | | | | an open paren, do a better job of reindenting the line. For example: def foo(): print 'hello %s, %d' % ( a, b) Hit TAB on the line starting with `a'. Without this patch this line will never be reindented.
* Two patches for Emacs 20.2 compatibility:Barry Warsaw1998-04-011-5/+4
| | | | | | | | | (py-compute-indentation): int-to-char isn't defined in Emacs, but we don't really need it anyway, so just remove this conversion. XEmacs is happy either way. (py-parse-state): The Emacs branch (i.e. w/o buffer-syntactic-context) wasn't adjusting point correctly.
* (py-postprocess-output-buffer): Return t if an exception was found,Barry Warsaw1998-03-261-9/+13
| | | | | | | | | | otherwise return nil. (py-execute-region): When executing the buffer asynchronously in a subprocess, if an exception occurred, show both the output buffer and the file containing the exception, leaving point on the source line containing bottom-most error in the traceback. If no exception occurred, jump to the output buffer (no change).