Prefer advice over remap exchange-point-and-mark

This commit is contained in:
toctan 2014-06-08 13:16:17 +08:00
parent ab6ecdedfd
commit ba2272a690
3 changed files with 5 additions and 10 deletions

View file

@ -469,11 +469,6 @@ Doesn't mess with special buffers."
(when after-init-time
(eval form))))
(defun prelude-exchange-point-and-mark ()
"Identical to `exchange-point-and-mark' but will not activate the region."
(interactive)
(exchange-point-and-mark (not (region-active-p))))
(require 'epl)
(defun prelude-update ()

View file

@ -280,6 +280,11 @@ The body of the advice is in BODY."
(browse-kill-ring-default-keybindings)
(global-set-key (kbd "s-y") 'browse-kill-ring)
(defadvice exchange-point-and-mark (before deactivate-mark activate compile)
"When called with no active region, do not activate mark."
(interactive
(list (not (region-active-p)))))
;; automatically indenting yanked text if in programming-modes
(defvar yank-indent-modes
'(LaTeX-mode TeX-mode)

View file

@ -110,11 +110,6 @@
(global-set-key (kbd "C-=") 'er/expand-region)
;; make C-x C-x usable with transient-mark-mode
(define-key global-map
[remap exchange-point-and-mark]
'prelude-exchange-point-and-mark)
(global-set-key (kbd "C-c j") 'ace-jump-mode)
(global-set-key (kbd "s-.") 'ace-jump-mode)
(global-set-key (kbd "C-c J") 'ace-jump-buffer)