diff options
| author | Stefan Monnier | 2008-02-13 15:10:57 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-02-13 15:10:57 +0000 |
| commit | 02dfeba8a4ce93dadd7f5fa7f462fca12fdf28f8 (patch) | |
| tree | 6f3af2c8cce69d443906f83ed834d82ec34b4a2f /lisp | |
| parent | 78dc87a23feb2a1a5d5dc0c2a5abc3a310493dcf (diff) | |
| download | emacs-02dfeba8a4ce93dadd7f5fa7f462fca12fdf28f8.tar.gz emacs-02dfeba8a4ce93dadd7f5fa7f462fca12fdf28f8.zip | |
(smerge-auto-combine-max-separation): New var.
(smerge-auto-combine): New fun.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/smerge-mode.el | 21 |
2 files changed, 28 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 927b3ce86aa..cfd106aca27 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-02-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * smerge-mode.el (smerge-auto-combine-max-separation): New var. | ||
| 4 | (smerge-auto-combine): New fun. | ||
| 5 | |||
| 1 | 2008-02-12 Juri Linkov <juri@jurta.org> | 6 | 2008-02-12 Juri Linkov <juri@jurta.org> |
| 2 | 7 | ||
| 3 | * startup.el (fancy-startup-screen, normal-splash-screen): | 8 | * startup.el (fancy-startup-screen, normal-splash-screen): |
| @@ -6,8 +11,8 @@ | |||
| 6 | * desktop.el (after-init-hook): Set inhibit-startup-screen to t | 11 | * desktop.el (after-init-hook): Set inhibit-startup-screen to t |
| 7 | after reading the desktop. | 12 | after reading the desktop. |
| 8 | 13 | ||
| 9 | * progmodes/compile.el (compilation-auto-jump): Call | 14 | * progmodes/compile.el (compilation-auto-jump): |
| 10 | compile-goto-error only when compilation-auto-jump-to-first-error | 15 | Call compile-goto-error only when compilation-auto-jump-to-first-error |
| 11 | is non-nil. | 16 | is non-nil. |
| 12 | (compilation-scroll-output): Replace :type 'boolean with a choice | 17 | (compilation-scroll-output): Replace :type 'boolean with a choice |
| 13 | that has three options including a third option `first-error'. | 18 | that has three options including a third option `first-error'. |
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index f2a7a9caf9e..8a3f15bac44 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el | |||
| @@ -297,6 +297,8 @@ Can be nil if the style is undecided, or else: | |||
| 297 | 297 | ||
| 298 | (defun smerge-combine-with-next () | 298 | (defun smerge-combine-with-next () |
| 299 | "Combine the current conflict with the next one." | 299 | "Combine the current conflict with the next one." |
| 300 | ;; `smerge-auto-combine' relies on the finish position (at the beginning | ||
| 301 | ;; of the closing marker). | ||
| 300 | (interactive) | 302 | (interactive) |
| 301 | (smerge-match-conflict) | 303 | (smerge-match-conflict) |
| 302 | (let ((ends nil)) | 304 | (let ((ends nil)) |
| @@ -328,6 +330,25 @@ Can be nil if the style is undecided, or else: | |||
| 328 | (dolist (m match-data) (if m (move-marker m nil))) | 330 | (dolist (m match-data) (if m (move-marker m nil))) |
| 329 | (mapc (lambda (m) (if m (move-marker m nil))) ends))))) | 331 | (mapc (lambda (m) (if m (move-marker m nil))) ends))))) |
| 330 | 332 | ||
| 333 | (defvar smerge-auto-combine-max-separation 2 | ||
| 334 | "Max number of lines between conflicts that should be combined.") | ||
| 335 | |||
| 336 | (defun smerge-auto-combine () | ||
| 337 | "Automatically combine conflicts that are near each other." | ||
| 338 | (interactive) | ||
| 339 | (save-excursion | ||
| 340 | (goto-char (point-min)) | ||
| 341 | (while (smerge-find-conflict) | ||
| 342 | ;; 2 is 1 (default) + 1 (the begin markers). | ||
| 343 | (while (save-excursion | ||
| 344 | (smerge-find-conflict | ||
| 345 | (line-beginning-position | ||
| 346 | (+ 2 smerge-auto-combine-max-separation)))) | ||
| 347 | (forward-line -1) ;Go back inside the conflict. | ||
| 348 | (smerge-combine-with-next) | ||
| 349 | (forward-line 1) ;Move past the end of the conflict. | ||
| 350 | )))) | ||
| 351 | |||
| 331 | (defvar smerge-resolve-function | 352 | (defvar smerge-resolve-function |
| 332 | (lambda () (error "Don't know how to resolve")) | 353 | (lambda () (error "Don't know how to resolve")) |
| 333 | "Mode-specific merge function. | 354 | "Mode-specific merge function. |