Function: data-debug-contract-current-line

data-debug-contract-current-line is a byte-compiled function defined in data-debug.el.gz.

Signature

(data-debug-contract-current-line)

Documentation

Contract the current line (if possible).

Do nothing if already contracted.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/data-debug.el.gz
(defun data-debug-contract-current-line ()
  "Contract the current line (if possible).
Do nothing if already contracted."
  (when (and (data-debug-current-line-expanded-p)
	     ;; Don't contract if the current line is not expandable.
	     (get-text-property (point) 'ddebug-function))
    (let ((ti (current-indentation))
	  (inhibit-read-only t)
	  )
      ;; If next indentation is larger, collapse.
      (end-of-line)
      (forward-char 1)
      (let ((start (point))
	    (end nil))
	(condition-case nil
	    (progn
	      ;; Keep checking indentation
	      (while (or (> (current-indentation) ti)
			 (looking-at "^\\s-*$"))
		(end-of-line)
		(forward-char 1))
	      (setq end (point))
	      )
	  (error (setq end (point-max))))
	(delete-region start end)
	(forward-char -1)
	(beginning-of-line))))
  (set-buffer-modified-p nil))