Function: dcl-split-line
dcl-split-line is an interactive and byte-compiled function defined in
dcl-mode.el.gz.
Signature
(dcl-split-line)
Documentation
Break line at point and insert text to keep the syntax valid.
Inserts continuation marks and splits character strings.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/dcl-mode.el.gz
;;;-------------------------------------------------------------------------
(defun dcl-split-line ()
"Break line at point and insert text to keep the syntax valid.
Inserts continuation marks and splits character strings."
;; Still don't know what to do with comments at the end of a command line.
(interactive "*")
(let (done
(type (dcl-get-line-type)))
(cond
((or (equal type '$) (equal type '-))
(let ((info (parse-partial-sexp
(save-excursion (dcl-beginning-of-statement) (point))
(point))))
;; handle some special cases
(cond
((nth 3 info) ; in text constant
(insert "\" + -\n\"")
(indent-according-to-mode)
(setq done t))
((not (nth 4 info)) ; not in comment
(cond
((and (not (eolp))
(= (char-after (point)) ?\")
(= (char-after (1- (point))) ?\"))
(progn ; a " "" " situation
(forward-char -1)
(insert "\" + -\n\"")
(forward-char 1)
(indent-according-to-mode)
(setq done t)))
((and (dcl-was-looking-at "[ \t]*-[ \t]*") ; after cont mark
(looking-at "[ \t]*\\(!.*\\)?$"))
;; Do default below. This might considered wrong if we're
;; after a subtraction: $ x = 3 - <M-LFD>
)
(t
(delete-horizontal-space)
(insert " -")
(insert "\n") (indent-according-to-mode)
(setq done t))))
))))
;; use the normal function for other cases
(if (not done) ; normal M-LFD action
(indent-new-comment-line))))