Hello,

Rasmus <ras...@gmx.us> writes:

> Due to recent controversy about Org being lacking Microsoftesque detail I
> finally implemented org-delete-indentation, which is a function I have
> been missing forever.

Thank you.

> +(defun org-delete-indentation (&optional ARG)
> +  "Join this line to previous and fix up whitespace at join.
> +
> +If previous row is a headline add to headline text."

You need to describe what ARG does.

> +  (interactive "*P")
> +  (if (save-excursion (if ARG
> +                       (beginning-of-line)
> +                     (forward-line -1))
> +                   (looking-at org-complex-heading-regexp))
> +      ;; At headline.
> +      (let ((string (concat " " (prog2 (and ARG (forward-line 1))
> +                                 (org-trim (delete-and-extract-region 
> (line-beginning-position)
> +                                                                      
> (line-end-position)))))))
> +     (when (eq (preceding-char) ?\n) (delete-region (point) (1- (point))))

  (unless (bobp) (delete-region ....))

Also, shouldn't the final (delete-indentation ARG) be in the "else" part
of the `if'?

> +(ert-deftest test-org-delete-indentation ()
> +  "Test M-^ (`org-delete-indentation') specification."

I suggest to omit binding in the description. That's one thing less we
have to keep up-to-date if it ever changes.


Regards,

-- 
Nicolas Goaziou

Reply via email to