Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
2025-04-26 Mats Lidell <matsl@gnu.org>

* hibtypes.el (smerge): Add ibut smerge.

* hui-mouse.el (smart-magit): Add smerge support in magit-status-mode.

* hywiki.el (hywiki-word-face-at-p): Add optional pos to enable reuse.

* test/hy-test-helpers.el (hy-test-word-face-at-region): Simplify by
Expand Down
23 changes: 22 additions & 1 deletion hibtypes.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 19-Sep-91 at 20:45:31
;; Last-Mod: 19-Apr-25 at 17:51:14 by Bob Weiner
;; Last-Mod: 26-Apr-25 at 10:19:22 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -45,6 +45,7 @@
(require 'org-macs) ;; for org-uuid-regexp
(require 'subr-x) ;; for string-trim
(require 'thingatpt)
(eval-when-compile (require 'smerge-mode))

;;; ************************************************************************
;;; Public declarations
Expand Down Expand Up @@ -1737,6 +1738,26 @@ If a boolean function or variable, display its value."
;; If you want to to disable ALL Hyperbole support within Org major
;; and minor modes, set the custom option `hsys-org-enable-smart-keys' to nil.

;;; ========================================================================
;;; Resolve merge conflicts in smerge-mode
;;; ========================================================================

(defib smerge ()
"Act on conflicts in merge buffers, i.e. when smerge-mode is active."
(when (bound-and-true-p smerge-mode)
(let (op)
(save-excursion
(beginning-of-line)
(cond ((looking-at smerge-end-re)
(setq op 'smerge-keep-lower))
((looking-at smerge-begin-re)
(setq op 'smerge-keep-upper))
((looking-at smerge-lower-re)
(setq op 'smerge-keep-all))))
(when op
(ibut:label-set (match-string-no-properties 0) (match-beginning 0) (match-end 0))
(hact op)))))

(run-hooks 'hibtypes-end-load-hook)
(provide 'hibtypes)

Expand Down
28 changes: 20 additions & 8 deletions hui-mouse.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 04-Feb-89
;; Last-Mod: 15-Apr-25 at 12:51:50 by Mats Lidell
;; Last-Mod: 25-Apr-25 at 23:35:04 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1575,13 +1575,25 @@ If key is pressed:
point (\"RET\" key binding) but display based on the value of
`hpath:display-where'."
(interactive)
(cond ((last-line-p)
(call-interactively (key-binding "q")))
((eolp)
(smart-scroll-up))
(t
(let ((magit-display-buffer-function #'hpath:display-buffer))
(call-interactively #'smart-magit-tab)))))
(let (op)
(cond ((last-line-p)
(call-interactively (key-binding "q")))
((eolp)
(smart-scroll-up))
((and
(eq major-mode 'magit-status-mode)
(save-excursion
(beginning-of-line)
(cond ((looking-at (regexp-quote "++>>>>>>>"))
(setq op 'magit-smerge-keep-lower))
((looking-at (regexp-quote "++<<<<<<<"))
(setq op 'magit-smerge-keep-upper))
((looking-at (regexp-quote "++======="))
(setq op 'magit-smerge-keep-all)))))
(call-interactively op))
(t
(let ((magit-display-buffer-function #'hpath:display-buffer))
(call-interactively #'smart-magit-tab))))))

(defun smart-magit-assist ()
"Use an assist key or mouse key to jump to source and to hide/show changes.
Expand Down