[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Creating changelog with magit
From: |
Thorsten Jolitz |
Subject: |
Re: [O] Creating changelog with magit |
Date: |
Thu, 03 Apr 2014 21:59:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Florian Beck <address@hidden> writes:
> Thorsten Jolitz <address@hidden> writes:
>
>> I get a meager
>>
>> ,-------------------
>> |
>> | * org.el:
>> |
>> | # <<comment text>>
>> |
>> `-------------------
>
> You get this when you are on the file that has changed. Press TAB
> (magit-toggle-section) and you see a diff. Move to the chunk you want to
> comment on and press "C": this should insert the defun/defvar/etc in the
> commit buffer.
>
> To automate this I have
>
> (defun fb/magit-commit-add-log ()
> (interactive)
> (let* ((ol (car (overlays-at (point))))
> (beg (overlay-start ol))
> (end (overlay-end ol))
> commit-buffer)
> (save-excursion
> (goto-char beg)
> (while (re-search-forward "^[+-]" end t)
> (save-window-excursion
> (magit-commit-add-log)
> (setq commit-buffer (current-buffer)))))
> (display-buffer commit-buffer)))
>
> ... but I don't really use this, because it is very slow and, usually,
> you want to arrange things differently.
Thanks, I hoped there is more than just this minimal skeleton, and there
is, like so often with emacs/org-mode.
I will try TAB/C and your function next time I commit.
--
cheers,
Thorsten