Skip to main content
Bumped by Community user
Bumped by Community user
edited title; edited tags
Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

Visual indication of previous How to prevent deactivating the region-based commands after a command?

Source Link

Visual indication of previous region-based commands

When a function is called on a region, I want a visual indication of affected area (a blink for ex.). Say, I've written a function upcasing previous word, and after evaluation I immediately get the result (and that's good) but I also want region highlighted for a sec. How could it be implemented?

Also I even can't get the region remain highlighted after the evaluation. (setq mark-active t) doesn't seem to work at all. Mark is forced to deactivate after interactive function or what?

(defun upcase-previous-WORD ()
  (interactive)
  (set-mark (point))
  (forward-whitespace -1)
  (call-interactively
     'upcase-region)
  (exchange-point-and-mark)
  (setq mark-active t)))