|
3 | 3 | ;; Author: Bob Weiner |
4 | 4 | ;; |
5 | 5 | ;; Orig-Date: 19-Sep-91 at 20:45:31 |
6 | | -;; Last-Mod: 19-Apr-25 at 17:51:14 by Bob Weiner |
| 6 | +;; Last-Mod: 26-Apr-25 at 10:19:22 by Mats Lidell |
7 | 7 | ;; |
8 | 8 | ;; SPDX-License-Identifier: GPL-3.0-or-later |
9 | 9 | ;; |
|
45 | 45 | (require 'org-macs) ;; for org-uuid-regexp |
46 | 46 | (require 'subr-x) ;; for string-trim |
47 | 47 | (require 'thingatpt) |
| 48 | +(eval-when-compile (require 'smerge-mode)) |
48 | 49 |
|
49 | 50 | ;;; ************************************************************************ |
50 | 51 | ;;; Public declarations |
@@ -1737,6 +1738,26 @@ If a boolean function or variable, display its value." |
1737 | 1738 | ;; If you want to to disable ALL Hyperbole support within Org major |
1738 | 1739 | ;; and minor modes, set the custom option `hsys-org-enable-smart-keys' to nil. |
1739 | 1740 |
|
| 1741 | +;;; ======================================================================== |
| 1742 | +;;; Resolve merge conflicts in smerge-mode |
| 1743 | +;;; ======================================================================== |
| 1744 | + |
| 1745 | +(defib smerge () |
| 1746 | + "Act on conflicts in merge buffers, i.e. when smerge-mode is active." |
| 1747 | + (when (bound-and-true-p smerge-mode) |
| 1748 | + (let (op) |
| 1749 | + (save-excursion |
| 1750 | + (beginning-of-line) |
| 1751 | + (cond ((looking-at smerge-end-re) |
| 1752 | + (setq op 'smerge-keep-lower)) |
| 1753 | + ((looking-at smerge-begin-re) |
| 1754 | + (setq op 'smerge-keep-upper)) |
| 1755 | + ((looking-at smerge-lower-re) |
| 1756 | + (setq op 'smerge-keep-all)))) |
| 1757 | + (when op |
| 1758 | + (ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0)) |
| 1759 | + (hact op))))) |
| 1760 | + |
1740 | 1761 | (run-hooks 'hibtypes-end-load-hook) |
1741 | 1762 | (provide 'hibtypes) |
1742 | 1763 |
|
|
0 commit comments