Function: idlwave-newline
idlwave-newline is an interactive and byte-compiled function defined
in idlwave.el.gz.
Signature
(idlwave-newline)
Documentation
Insert a newline and indent the current and previous line.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
(defun idlwave-newline ()
"Insert a newline and indent the current and previous line."
(interactive)
;;
;; Handle unterminated single and double quotes
;; If not in a comment and in a string then insertion of a newline
;; will mean unbalanced quotes.
;;
(if (and (not (idlwave-in-comment)) (idlwave-in-quote))
(progn (beep)
(message "Warning: unbalanced quotes?")))
(newline)
;;
;; The current line is being split, the cursor should be at the
;; beginning of the new line skipping the leading indentation.
;;
;; The reason we insert the new line before indenting is that the
;; indenting could be confused by keywords (e.g. END) on the line
;; after the split point. This prevents us from just using
;; `indent-for-tab-command' followed by `newline-and-indent'.
;;
(beginning-of-line 0)
(idlwave-indent-line)
(forward-line)
(idlwave-indent-line))