From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [patch] org-delete-indentation
Date: Sun, 17 May 2015 10:33:29 +0200 [thread overview]
Message-ID: <87k2w78uxy.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87fv6wh6yr.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 16 May 2015 17:34:20 +0200")
Hello,
Rasmus <rasmus@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
next prev parent reply other threads:[~2015-05-17 8:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-16 15:34 [patch] org-delete-indentation Rasmus
2015-05-16 19:05 ` Rasmus
2015-05-17 8:33 ` Nicolas Goaziou [this message]
2015-05-17 8:35 ` Nicolas Goaziou
2015-05-17 13:21 ` Rasmus
2015-05-20 22:48 ` Rasmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k2w78uxy.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=rasmus@gmx.us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).