Skip to main content
4 votes
Accepted

Which commands/functions/processes are run on keyboard input S-<right>?

(defun right-char (&optional n) ... (interactive "^p") describe-function interactive: If the string begins with ‘^’ and shift-select-mode is non-nil, Emacs first calls the function ...
shynur's user avatar
  • 5,318
2 votes
Accepted

How to move the cursor to the beginning/end of a shift-selected region by a left/right motion?

You can probably do something like (defvar my-old-region-bounds nil) (advice-add 'handle-shift-selection :around (lambda (orig-fun) (let ((was-active (region-active-p))) (funcall orig-...
Stefan's user avatar
  • 26.4k
2 votes

How to select (and highlight) non-consecutive blocks?

Not built in but another package for this is called objed (I'm the author). You can mark any text object with m the point is moved to the next object of current type automatically. Unmark any object ...
clemera's user avatar
  • 3,471
2 votes

Which commands/functions/processes are run on keyboard input S-<right>?

No, that key description (in *Help*) does not raise the question "Which command (s) is (are) run on keyboard input S-?". It answers that question: the command right-char is run. For ...
Drew's user avatar
  • 77.7k
2 votes
Accepted

Custom C-arrow cursor movement

Use (interactive "^") instead of (interactive). C-h f interactive tells you, way down near the bottom: If the string begins with ^ and shift-select-mode is non-nil, Emacs first calls the ...
Drew's user avatar
  • 77.7k
1 vote

Which commands/functions/processes are run on keyboard input S-<right>?

Let me first give all the names of the commands/functions/processes involved (it is what you ask for). They are: read-key-sequence ( built-in function in ‘C source code’ ) a procedure called in the ...
Claudio's user avatar
  • 450
1 vote

shift selection not working for rebound M-{ backward-paragraph

This appears to be a bug in emacs; M-{ should just automatically work, if we take the manual at face value. As a workaround, I took an answer to a similar question and modified it: (global-set-key (...
xdavidliu's user avatar
  • 213
1 vote
Accepted

How can I fix shift-select-mode with own syntax-table

You need to say that this command is a navigation command, by replacing your (interactive) with (interactive "^") C-h o interactive RET explains that: [...] If the string begins with ^ and ...
Stefan's user avatar
  • 26.4k
1 vote
Accepted

Make region transient in elisp function

Base on the implementation of the function handle-shift-selection, you can try something like this (defun isearch-exit-mark-match () "Exit isearch and mark the current match." (interactive) (...
xuchunyang's user avatar
  • 14.6k
1 vote

Make C-S-up handle shift selection under Org-Mode

Based on clues from lawlist's comments, reading around the area of "Key Sequence Input" in the elisp info file, and an explanation of defadvice that even I can understand, here, I added this to my ....
IPonder's user avatar
  • 11
1 vote

How to select (and highlight) non-consecutive blocks?

Emacs does not offer this currently. (And the so-called "non-consecutive region" is at best only a very partial substitute, IMHO.) You can, however, use library zones.el (see Zones and Multiple ...
Drew's user avatar
  • 77.7k
1 vote
Accepted

Region does not get deselected on move commands using `push-mark` from Elisp

You need to set variable transient-mark-mode to a special value: a cons with only as its car: (defun sandric/select-symbol-under-cursor () "Select symbol under cursor." (interactive) (unless (...
Drew's user avatar
  • 77.7k
1 vote

How to move the cursor to the beginning/end of a shift-selected region by a left/right motion?

I found a solution, feel free to comment / improve. (advice-add 'handle-shift-selection :before (lambda () (setq-local was-active (region-active-p)))) (bind-key* "M-l" (...
AhLeung's user avatar
  • 1,083

Only top scored, non community-wiki answers of a minimum length are eligible