Function: org-delete-indentation

org-delete-indentation is an interactive and byte-compiled function defined in org.el.gz.

Signature

(org-delete-indentation &optional ARG)

Documentation

Join current line to previous and fix whitespace at join.

If previous line is a headline add to headline title. Otherwise the function calls delete-indentation.

I.e. with a non-nil optional argument, join the line with the following one. If there is a region then join the lines in that region.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-delete-indentation (&optional arg)
  "Join current line to previous and fix whitespace at join.

If previous line is a headline add to headline title.  Otherwise
the function calls `delete-indentation'.

I.e. with a non-nil optional argument, join the line with the
following one.  If there is a region then join the lines in that
region."
  (interactive "*P")
  (if (save-excursion
	(beginning-of-line (if arg 1 0))
	(let ((case-fold-search nil))
	  (looking-at org-complex-heading-regexp)))
      ;; At headline.
      (let ((tags-column (when (match-beginning 5)
			   (save-excursion (goto-char (match-beginning 5))
					   (current-column))))
	    (string (concat " " (progn (when arg (forward-line 1))
				       (org-trim (delete-and-extract-region
						  (line-beginning-position)
						  (line-end-position)))))))
	(unless (bobp) (delete-region (point) (1- (point))))
	(goto-char (or (match-end 4)
		       (match-beginning 5)
		       (match-end 0)))
	(skip-chars-backward " \t")
	(save-excursion (insert string))
	;; Adjust alignment of tags.
	(cond
	 ((not tags-column))		;no tags
	 (org-auto-align-tags (org-align-tags))
	 (t (org--align-tags-here tags-column)))) ;preserve tags column
    (let ((current-prefix-arg arg))
      (call-interactively #'delete-indentation))))