From 572587e97168355edda475ccfb3e770743162653 Mon Sep 17 00:00:00 2001 From: plipus Date: Sun, 5 Jul 2026 19:06:07 +0200 Subject: [PATCH 1/2] Add advice to mark-set command for multicursor selection --- src/commands/mark.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/mark.lisp b/src/commands/mark.lisp index 906574dc2..955e4a742 100644 --- a/src/commands/mark.lisp +++ b/src/commands/mark.lisp @@ -12,7 +12,7 @@ (define-key *global-keymap* "C-x C-x" 'exchange-point-mark) (define-key *global-keymap* "C-x h" 'mark-set-whole-buffer) -(define-command mark-set (p) (:universal-nil) +(define-command (mark-set (:advice-classes editable-advice)) (p) (:universal-nil) "Sets a mark at the current cursor position." (if p (move-point (current-point) (pop-buffer-point)) From a72ca5dbb3b0011b067ed6deb60452a5be1f5e65 Mon Sep 17 00:00:00 2001 From: plipus Date: Fri, 10 Jul 2026 19:11:05 +0200 Subject: [PATCH 2/2] Remove unwanted advice, use check on cursor type --- src/commands/mark.lisp | 4 ++-- src/cursors.lisp | 4 ++++ src/internal-packages.lisp | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/mark.lisp b/src/commands/mark.lisp index 955e4a742..d36b14b8d 100644 --- a/src/commands/mark.lisp +++ b/src/commands/mark.lisp @@ -12,13 +12,13 @@ (define-key *global-keymap* "C-x C-x" 'exchange-point-mark) (define-key *global-keymap* "C-x h" 'mark-set-whole-buffer) -(define-command (mark-set (:advice-classes editable-advice)) (p) (:universal-nil) +(define-command mark-set (p) (:universal-nil) "Sets a mark at the current cursor position." (if p (move-point (current-point) (pop-buffer-point)) (progn (set-cursor-mark (current-point) (current-point)) - (message "Mark set")))) + (when-real-cursor (message "Mark set"))))) (define-command exchange-point-mark () () "Exchange the current cursor position with the marked position." diff --git a/src/cursors.lisp b/src/cursors.lisp index 83802d51b..cf8ae3b80 100644 --- a/src/cursors.lisp +++ b/src/cursors.lisp @@ -123,3 +123,7 @@ (if not-lastp (write-line string out) (write-string string out)))))))) + +(defmacro when-real-cursor (&body body) + `(unless (typep (current-point) 'fake-cursor) + ,@body)) \ No newline at end of file diff --git a/src/internal-packages.lisp b/src/internal-packages.lisp index 2bbeb4ad3..175b2d248 100644 --- a/src/internal-packages.lisp +++ b/src/internal-packages.lisp @@ -621,7 +621,8 @@ :make-fake-cursor :delete-fake-cursor :merge-cursor-killrings - :clear-cursors) + :clear-cursors + :when-real-cursor) ;; typeout.lisp (:export :*typeout-mode-keymap*