From dc9308b4225c3695558d43710e4c84f87c04be5d Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Wed, 12 Feb 2014 08:27:08 -0500 Subject: [PATCH] Add clever mark stuff --- init.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/init.el b/init.el index 6a3ccc0..b90237c 100644 --- a/init.el +++ b/init.el @@ -257,6 +257,30 @@ a file in the home directory." (concat emacs-dir basename) (concat "~/.emacs-" basename))))) +;; clever mark stuff +(defun push-mark-no-activate () + "Pushes `point' to `mark-ring' and does not activate the region +Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled" + (interactive) + (push-mark (point) t nil) + (message "Pushed mark to ring")) +(global-set-key (kbd "C-`") 'push-mark-no-activate) + +(defun jump-to-mark () + "Jumps to the local mark, respecting the `mark-ring' order. +This is the same as using \\[set-mark-command] with the prefix argument." + (interactive) + (set-mark-command 1)) +(global-set-key (kbd "M-`") 'jump-to-mark) + +(defun exchange-point-and-mark-no-activate () + "Identical to \\[exchange-point-and-mark] but will not activate the region." + (interactive) + (exchange-point-and-mark) + (deactivate-mark nil)) +(define-key global-map [remap exchange-point-and-mark] 'exchange-point-and-mark-no-activate) + + (setq server-name (kde-current-activity)) (server-start) (menu-bar-mode -99)