Hi, herewith a first solution to requests posted at python-list
(defun py-newline-and-close-block () " " (interactive "*") (let ((ci (current-indentation))) (end-of-line) (newline) (indent-to-column (- ci py-indent-offset)))) If this proceeding seems acceptable, I'll figure out py-newline-and-close-function py-newline-and-close-class py-newline-and-close-form (if, while, etc) It would always close the adressed form above, choosing the indent to proceed. Below some examples of requests in python-list posted by Eric S. Johansson <[EMAIL PROTECTED]> Title was: "special editor support for indentation needed": ;;;;;;;;;;; here's an example of the problem: class foo( object): def cat(self) self.x=1 def dog self.x=2 this is legal Python but it's not what you need 99% of the time. There is no cue to the editor to tell it to outdent to give me what I really want which is: class foo( object): def cat(self) self.x=1 def dog self.x=2 ;;;;;;;;;;;;; and at another place ;;;;;;;;;;;;; the current outdent capability conflates multiple outdent events. The outdent events are, at a minimum,: Close block close method close class Another way to look at these events are start method, start class and close block. Now using these events, let's compare a use case against the outdent mechanism. starting with an example of a previous message, class pet (object): """ """ def cat(self): """ """ if food in bowl: self.empty = True def dog(self): to start the dog method, after ending the Method, I would need to say something like: newline tab key Close block close block delta echo foxtrot dog left paren self close paren colon... But if the method ended like: ... def cat(self): """ """ self.empty = True def dog(self): I would only want to use a single "close block" to outdent. unfortunately, this context dependent behavior is frustratingly wrong when it comes to creating speech driven macros to enter templates. it requires user intervention to tell you how may times to outdent and that's counterproductive at best and physically damaging at worst for a disabled user. ;;;;;;;;;;;;;;;;;;;; So far the report. _______________________________________________ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode