[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I contextually override shift selection functions?
From: |
ndame |
Subject: |
Re: How can I contextually override shift selection functions? |
Date: |
Mon, 5 Aug 2019 06:19:34 +0000 (GMT) |
> though I'm wondering why simply adding the caret to the interactive spec
> doesn't fix the issue:
>
> (local-set-key (kbd "S-<down>") (lambda ()
> (interactive "^")
> (if (my-context)
> (do 'something 'else)
>
> ;; call S-down as usual
> (call-interactively 'next-line))))
>
Ah, I took a closer look and now it's obvious I shouldn't bind Shift+...
at all and then interactive magic works:
(local-set-key (kbd "<down>") (lambda ()
(interactive "^")
(if (and this-command-keys-shift-translated
(my-context))
(do 'something 'else)
;; call down as usual
(next-line))))