Commit Graph

394 Commits

Author SHA1 Message Date
Barry Warsaw 7c29b2328b (py-beginning-of-def-or-class, py-end-of-def-or-class,
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.
1998-07-07 17:45:38 +00:00
Barry Warsaw 003932a508 (py-comment-indent-function): A replacement for
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.
1998-07-07 15:11:24 +00:00
Guido van Rossum 0b3b43ca6f New blood. 1998-06-30 17:02:57 +00:00
Guido van Rossum 795a4bc666 Added a line to process SGI_ABI. 1998-06-08 21:22:12 +00:00
Guido van Rossum 750c8cee7e Add LDLAST to the list of variables processed by the sed script. 1998-05-20 15:53:22 +00:00
Barry Warsaw 3bfed5b6b1 (py-ask-about-save): New variable used in
py-execute-import-or-reload.  Same semantics as
compilation-ask-about-save.
1998-05-19 16:25:04 +00:00
Barry Warsaw 1d0364b2dc (py-execute-string): Bind to C-c C-s, and put on menu 1998-05-19 16:15:26 +00:00
Barry Warsaw 751f4931d8 (py-stringlit-re): Another ME patch to recognize SQTQs and DQTQs
(single and double quoted triple quoted strings :-) with embedded
single like-quotes.  Also recognizes raw prefix.
1998-05-19 16:06:21 +00:00
Barry Warsaw 820273d6d1 More ME patches:
(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.
1998-05-19 15:54:45 +00:00
Barry Warsaw ab0e86cbcc (beginning-of-python-def-or-class): Renamed to
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.
1998-05-19 15:31:46 +00:00
Barry Warsaw ebc7b7ac45 More ME patches:
(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.
1998-05-19 15:01:06 +00:00
Barry Warsaw 145ab1ce9d #Documentation and comment typos patch given by Michael Ernst. More
#of his patches to follow.
1998-05-19 14:49:49 +00:00
Guido van Rossum cc8e1a4ed7 Add some help for AIX. (Konrad Hinsen) 1998-04-30 13:34:12 +00:00
Barry Warsaw 77d1fce2f6 (py-compute-indentation): Use forward-comment to skip over all
whitespace and comment noise.
1998-04-16 20:04:59 +00:00
Guido van Rossum 974f295dd4 Some more new stuff. 1998-04-13 21:00:54 +00:00
Guido van Rossum 9238f23c50 Two more, for beta testers who reported real bugs. 1998-04-13 18:14:22 +00:00
Guido van Rossum c45cf02938 Added changes from 1.5 to 1.5.1.
The sections are now in a more useful order: the most recent changes
are listed first.
1998-04-10 20:06:21 +00:00
Guido van Rossum 07c44c7ad5 Document -x too. 1998-04-10 19:46:00 +00:00
Guido van Rossum 29d465bef7 Document -t flag. 1998-04-10 19:36:09 +00:00
Guido van Rossum 13aa5cedcb Jeff Epler 1998-04-10 19:18:03 +00:00
Barry Warsaw ea609c18a0 (py-toggle-shells): Added a message in the minibuf. 1998-04-10 16:08:26 +00:00
Barry Warsaw a239880a22 Quick and extremely dirty hacks to toggle between using CPython and
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.
1998-04-09 23:28:20 +00:00
Guido van Rossum e2bb8bb90d Tons of new names... 1998-04-09 21:01:06 +00:00
Barry Warsaw 3179fe03ca (imenu-example--python-class-regexp): Fix to recognize Module.Class in
inheritance list.
1998-04-04 21:36:53 +00:00
Barry Warsaw 5204b4a984 #Oops, I lost the CVS/RCS $Revision$ 1998-04-02 19:27:18 +00:00
Barry Warsaw 92166d9a75 (py-compute-indentation): When looking at a continuation line inside
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.
1998-04-01 21:59:41 +00:00
Barry Warsaw 585f733b39 Two patches for Emacs 20.2 compatibility:
(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.
1998-04-01 21:13:51 +00:00
Barry Warsaw f9b99f4375 (py-postprocess-output-buffer): Return t if an exception was found,
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).
1998-03-26 16:08:59 +00:00
Barry Warsaw 512af04b35 (py-execute-region): Watch out for shell-command-on-region killing a
zero sized output buffer.
1998-03-25 23:27:17 +00:00
Barry Warsaw beef9e73c3 Removed all the mixed indentation face stuff. It's not as helpful as
it at first seems.  I think we've got a good idea of what to do, but
it'll be a bit of work... for later.
1998-03-20 17:06:11 +00:00
Barry Warsaw 8ca702823d (py-tab-face): => py-mixed-indentation-face
(python-font-lock-keywords): Better regexp given by Sjoerd.  This
matches only mixed indentation which is probably more useful than
matching all tabs.
1998-03-20 14:48:30 +00:00
Barry Warsaw e908b6ba57 (py-in-literal, py-fast-in-literal): New functions (mostly) stolen
from CC Mode.

(py-guess-indent-offset): Teach it about colons in `literals'
(e.g. comments and strings).  Don't false hit colons in literals; keep
searching for a real block introducing line.
1998-03-19 22:48:02 +00:00
Barry Warsaw b6c1f1f927 #minor change to eval-while-compile so that it must both find
#custom.el and have an up-to-date version (i.e. one that defines
#defcustom -- which Emacs 19.34's by default does not).
1998-03-19 22:33:06 +00:00
Barry Warsaw 0d2805b771 (py-tab-face, python-font-lock-keywords): Color all tabs at the start
of a line in py-tab-face to aid in seeing mixed tab/space indentation.
This face defaults to the `default' face so it is unobtrusive until
you `M-x customize-face' py-tab-face to something obnoxious like
"Yellow".
1998-03-19 21:52:06 +00:00
Barry Warsaw 639eea670c (py-smart-indentation): Updated docstring for new policy.
(python-mode): Implement new policy: never turn indent-tabs-mode on.
Only turn it off if tab-width != py-indent-offset.
1998-03-16 18:12:13 +00:00
Barry Warsaw 8046befce7 #(py-smart-indentation): Small fixes for clarity in the docstring. 1998-03-13 20:04:52 +00:00
Barry Warsaw 9e9968859e (python-mode): Removed vi vi vi hack for setting the tab width from a
magic comment.  Now Guido only has to worry about the northern
Wisconsin Braces Freedom Fighter Militia.
1998-03-13 18:53:15 +00:00
Barry Warsaw 742a5116d2 (py-smart-indentation): New variable which controls the automagic
setting of py-indent-offset and indent-tabs-mode.

(python-mode): After python-mode-hook is run, do the automagic
calculation if py-smart-indentation is non-nil.

(py-parse-state): Get rid of unused variable to quiet the
byte-compiler.
1998-03-13 17:29:15 +00:00
Guido van Rossum 38d3fe012e Add LINKFORSHARED and LDLAST as in the main Makefile. 1998-03-11 17:49:55 +00:00
Barry Warsaw 2f32fbba34 (py-execute-region): Simplified calculation of temporary file name.
When running synchronously in a subproc buffer, be sure to
pop-to-buffer so the output is visible.
1998-02-25 16:45:43 +00:00
Barry Warsaw 6c6db0a073 (py-temp-directory): Minor docstring nit. 1998-02-25 16:33:56 +00:00
Barry Warsaw 50b3eb6a9e (py-master-file): Fixed some typos in the docstring. 1998-02-25 15:57:47 +00:00
Barry Warsaw f64b4054af (py-compute-indentation): Several changes made to improve navigation
over and around triple-quoted strings:

    - move the beginning-of-line to above the p-p-s call

    - in the `t' clause of the big cond, where we skip over
      triple-quoted strings, first find out if we're looking at a
      single or TQS, then skip over it in one fell swoop, instead of
      trying to loop over skipage of SQS's.

(py-parse-state): Implement XEmacs only hack to more accurately figure
out whether we're in a string or not.  Can't do this in Emacs because
it lacks the necessary primitive, so we just do it the old (and mostly
accurate, but foolable) way for Emacs.
1998-02-12 16:52:14 +00:00
Barry Warsaw 8ee4a60c70 (py-scroll-process-buffer): Default value changed to nil to act more
like default shell-mode behavior.
1998-02-06 16:01:52 +00:00
Barry Warsaw f1b3e89800 (py-parse-state): When looking for landing inside triple-quoted
string, don't check for indentation at column zero.  This will falsely
hit a line inside a docstring that starts at column zero but ends in a
colon.
1998-02-05 23:35:09 +00:00
Barry Warsaw 8f972b762a (py-python-command-args): New variable, allows user to customize the
arguments past to py-python-command when invoking the Python shell.
1998-02-05 20:45:49 +00:00
Barry Warsaw f06777dd7c (py-outdent-p): When looking at the previous line, watch out for
continuation lines.  This fixes this bug report, reported by Frank
Stajano.

# But if I split the "raise" line and reindent, the else WRONGLY goes up a
# level (?!?)

while condition1:
    if condition2:
        raise error3, \
              moreInfo4
else: # meant to close "if condition2"
    action5()
1998-01-21 05:36:18 +00:00
Barry Warsaw 9ec9fbc355 (py-goto-initial-line): Shut up the byte compiler. 1998-01-21 05:15:57 +00:00
Barry Warsaw 82aecb9d66 (py-mode-map): Add a binding of C-m to py-newline-and-indent. This is
a religious issue: RMS decrees that the Enter (RET) key should just do
a newline and a LFD (C-j) should do a newline and indent (i.e. the
python-mode version of this).  Almost everyone I know disagrees and
finds that RET should do newline and indent.  Almost everyone hacks
their modes to do this, if they know how.  Because it's hard for
newbies to figure out how to do this, and because most DOS keyboards
lack a LFD (leaving users to the more obscure C-j), I think it makes
better sense to add this default binding.
1998-01-21 05:14:24 +00:00
Barry Warsaw c210e69981 (py-compute-indentation): In the most common case, where indentation
is based on the line above, watch out for landing inside a triple
quoted string.  In this case, use iterative search +
parse-partial-sexp backwards to find the beginning of the string.

Note this does affect performance, but very little in the common cases
(I hope).  It could be made *much* faster by adding Emacs and XEmacs
dependent code -- different code naturally.  :-(

Fixes the following reported bug:

if len(sys.argv) >= 6:
    # More lines here
    fptr = open('/etc/hosts', 'w')
    fptr.write("""# /etc/hosts -- autocreated by /etc/ppp/ip-up
#
# Address from pppd
%-15s	%s

# For loopbacking
127.0.0.1	localhost

255.255.255.255	broadcast
""" % (ipaddr, ipname) )

os.chmod('/etc/hosts', 0644)
1998-01-20 22:52:56 +00:00