emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Creating changelog with magit


From: Florian Beck
Subject: Re: [O] Creating changelog with magit
Date: Thu, 03 Apr 2014 17:51:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

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.

-- 
Florian Beck



reply via email to

[Prev in Thread] Current Thread [Next in Thread]