commit 01b9e654e554ae07007ef776a83d0c011eedaf2a
parent 888b4a2064ea02d9e8e4349fab5630cf7113713f
Author: rmj <pwishie@gmail.com>
Date: Sat, 18 Apr 2020 15:07:46 -0700
blkdel
Diffstat:
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/README.org b/README.org
@@ -16,8 +16,8 @@ Then, in your emacs configuration file:
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "~/.emacs.d/joestar/")
(require 'joestar)
-;; you can hook joestar to prog-mode like:
-(add-hook 'prog-mode-hook 'joestar-mode)
+ ;; you can hook joestar to prog-mode like:
+ (add-hook 'prog-mode-hook 'joestar-mode)
#+END_SRC
* Configuration
diff --git a/joestar.el b/joestar.el
@@ -299,8 +299,19 @@
(yank))
(hlt-highlight-region joe-block-mark-start joe-block-mark-end 'highlight))
+ ;; converts the block to region and then kills the region
+(defun joe-blkdel () ; TODO option to not save the block in kill ring
+ "Delete the block.
+Move mark to joestar's end of block and move point to joestar's end of block."
+ (interactive)
+ (let* ((cur-local (point-marker)))
+ (set-mark joe-block-mark-start)
+ (goto-char joe-block-mark-end)
+ (call-interactively 'kill-region)
+ (goto-char cur-local)))
;; end
+
;; TODO does not work
(defun joe-record (name)
"Record a keyboard macro and save it to NAME."
@@ -708,7 +719,7 @@
(define-key joe-map (kbd "<C-left>") 'joe-ctr-selection-left)
(define-key joe-map (kbd "<C-up>") 'joe-ctr-selection-up)
(define-key joe-map (kbd "<C-down>") 'joe-ctr-selection-down)
- (define-key joe-map (kbd "C-k C-y") 'delete-region) ; TODO
+ (define-key joe-map (kbd "C-k C-y") 'joe-blkdel)
(define-key joe-map (kbd "C-k y") (kbd "C-k C-y"))
(define-key joe-map (kbd "C-k C-m") 'joe-block-move)
(define-key joe-map (kbd "C-k m") (kbd "C-k C-m"))