I often write python code in which a function returns a value. Often I will define that value higher up in the code as "returnvalue" or some similar name.
Then the next line is indented differently. This is because emacs believes (falsely) that I just used the command "return value"
I end up with things like this:
def square(x):
returnvalue = x*x
return returnvalue
where it should be
def square(x):
returnvalue = x*x
return returnvalue
Since indentation level is fundamentally important for python, this is a big deal.
I really like the auto-indenting, but I'd either like to somehow get it to recognize that if return isn't followed by white space, it should treat it as any other line of code. Alternately I'd like it to simply not treat return as a special word at all. Is this possible?
More information:
For what it's worth, I'm using Aquamacs (on Mac OS X). In ~/Library/Preferences/Aquamacs Emacs/
it says
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(aquamacs-additional-fontsets nil t)
'(aquamacs-customization-version-id 215 t)
'(aquamacs-tool-bar-user-customization nil t)
'(default-frame-alist (quote ((fringe) (right-fringe) (left-fringe . 1) (internal-border-width . 0) (vertical-scroll-bars . right) (cursor-type . box) (menu-bar-lines . 1) (tool-bar-lines . 1) (background-color . "black") (background-mode . dark) (border-color . "black") (cursor-color . "yellow") (foreground-color . "white") (mouse-color . "sienna1"))))
'(ns-tool-bar-display-mode (quote both) t)
'(ns-tool-bar-size-mode (quote regular) t)
'(visual-line-mode nil t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(autoface-default ((t (:inherit default))))
'(fundamental-mode-default ((t (:inherit autoface-default))) t))
I don't have a .emacs
file and ~/Library/Preferences/Aquamacs Emacs/Preferences.el
is empty. When I run emacs from the terminal command line it opens in the window and doesn't automatically indent.