Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
8a72c7f8
Commit
8a72c7f8
authored
Feb 04, 2008
by
Dan Nicolaescu
Browse files
Add new TODO entry.
(diff-create-changelog): New function. (diff-mode-menu): Bind it.
parent
c0bc7978
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
lisp/ChangeLog
lisp/ChangeLog
+6
-0
lisp/diff-mode.el
lisp/diff-mode.el
+33
-0
No files found.
lisp/ChangeLog
View file @
8a72c7f8
2008-02-04 Dan Nicolaescu <dann@ics.uci.edu>
* diff-mode.el: Add new TODO entry.
(diff-create-changelog): New function.
(diff-mode-menu): Bind it.
2008-02-04 Kenichi Handa <handa@ni.aist.go.jp>
* international/mule-diag.el (print-fontset-element): Handle the
...
...
lisp/diff-mode.el
View file @
8a72c7f8
...
...
@@ -39,6 +39,8 @@
;; Todo:
;; - Improve `diff-create-changelog', it is very simplistic now.
;;
;; - Add a `delete-after-apply' so C-c C-a automatically deletes hunks.
;; Also allow C-c C-a to delete already-applied hunks.
;;
...
...
@@ -171,6 +173,8 @@ when editing big diffs)."
[
"Apply hunk"
diff-apply-hunk
t]
[
"Test applying hunk"
diff-test-hunk
t]
[
"Apply diff with Ediff"
diff-ediff-patch
t]
[
"Create Change Log"
diff-create-changelog
:help
"Create ChangeLog entries for the changes in the diff buffer"
]
"-----"
[
"Reverse direction"
diff-reverse-direction
t]
[
"Context -> Unified"
diff-context->unified
t]
...
...
@@ -1725,6 +1729,35 @@ For use in `add-log-current-defun-function'."
props
'diff-refine-preproc
))))))))
(
defun
diff-create-changelog
()
"Iterate through the current diff and create ChangeLog entries."
(
interactive
)
;; XXX: Currently add-change-log-entry-other-window is only called
;; once per hunk. Some hunks have multiple changes, it would be
;; good to call it for each change.
(
save-excursion
(
goto-char
(
point-min
))
(
let
((
orig-buffer
(
current-buffer
)))
(
condition-case
nil
;; Call add-change-log-entry-other-window for each hunk in
;; the diff buffer.
(
while
t
(
set-buffer
orig-buffer
)
(
diff-hunk-next
)
(
beginning-of-line
)
(
while
(
not
(
looking-at
"^ "
))
(
forward-line
1
))
;; Move to where the changes are,
;; `add-change-log-entry-other-window' works better in
;; that case.
(
while
(
not
(
looking-at
"^[!+-]"
))
(
forward-line
1
))
(
add-change-log-entry-other-window
)
;; Insert a "." so that the entries created don't get
;; merged.
(
insert
"."
))
(
error
nil
)))))
;; provide the package
(
provide
'diff-mode
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment