From c0af15279da1bc2e3e7b379027fb82d89e90842c Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sat, 17 Jun 2023 15:06:16 +0800 Subject: common: Bind point-to-register to a more convenient key * common.el (register-val-jump-to): Do not ask for confirmation to visit files again. This was enabled to send to others, and I forgot to modify that back. (ctl-x-r-map): Bind point-to-register to a more convenient key. I am tired of typing 'C-x r C-x @ c @' to add a point to a register. Another binding involves the space key, and I would like to have an alternative convenient key-binding that does not involve the space key, as I find that the space key is pressed way too oft. Haha! --- common.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common.el b/common.el index 860e031..fd317ad 100644 --- a/common.el +++ b/common.el @@ -332,9 +332,7 @@ mark at the end for the first yank." (require 'bookmark) (bookmark-jump (cdr val))) ((eq (car val) 'file-query) - (or (find-buffer-visiting (nth 1 val)) - (y-or-n-p (format "Visit file %s again? " (nth 1 val))) - (user-error "Register access aborted")) + (find-buffer-visiting (nth 1 val)) (find-file (nth 1 val)) (goto-char (nth 2 val))) (t (cl-call-next-method val delete)))) @@ -424,6 +422,10 @@ mark at the end for the first yank." (princ "a rectangle starting with ") (princ (car val)))))) +;;; Bind point-to-register to a more convenient key + +(define-key ctl-x-r-map (vector ?p) #'point-to-register) + ;;; Intentionally disable some key-bindings. ;; Using byte-code is fun. -- cgit v1.2.3-18-g5258