easy-kill-extras.el icon indicating copy to clipboard operation
easy-kill-extras.el copied to clipboard

multiple-cursor block out of place in doc? gather all recommended config in one place? support for marking a paragraph.

Open guihembichot opened this issue 11 months ago • 2 comments

Hello. First, thanks for this great package which nicely complements easy-kill!

I noticed, in https://github.com/knu/easy-kill-extras.el , there are two "configuration" sections:

first one:

Configuration
Suggested settings are as follows:

;; Upgrade `mark-word' and `mark-sexp' with easy-mark
;; equivalents.
(global-set-key (kbd "M-@") 'easy-mark-word)
(global-set-key (kbd "C-M-@") 'easy-mark-sexp)
etc

second one:

Configuration
Suggested key bindings are as follows:

(define-key mc/keymap (kbd "C-. M-C-f") 'mc/mark-next-sexps)
(define-key mc/keymap (kbd "C-. M-C-b") 'mc/mark-previous-sexps)
etc

The multiple-cursor one (2nd block) is maybe not useful here? I mean, this is not a page about setting up multiple-cursor, it's about easy-kill-extras. Sorry if I'm misunderstood.

Still about documentation, the recommended (add-to-list 'easy-kill-alist etc) statements are scattered between two places (WORD is in "Extra things" section, whereas backward-line-edge is in "Configuration"), maybe it would be easier for the newbie user to have them all in one place.

Next, I implemented a selection type 'paragraph' ('p') (like there already is 'd' for defun, 'W' for WORD etc). It is not absolutely necessary as people can use mark-paragraph (meta-h) instead, however I find it nice to have this possibility inside easy-kill (makes things more uniform, sort of "for marking anything, just use easy-kill"). I simply put this near the top of extra-things.el:

;; ;; 
;; ;; paragraph
;; ;; 
(defun end-op-paragraph ()
 (forward-paragraph))
(defun beginning-op-paragraph () 
 (backward-paragraph)) 
(put 'paragraph 'end-op 'end-op-paragraph) 
(put 'paragraph 'beginning-op 'beginning-op-paragraph)     

and then this in the emacs configuration file: (add-to-list 'easy-kill-alist '(?p paragraph "\n") t)

It seems to work. If you'd like to include this, feel free.

Apologies if I got anything wrong.

guihembichot avatar Jan 23 '25 14:01 guihembichot

Ah, thanks for pointing out. The latter section is leftover text from copy-paste. I'll remove it.

For the second part, paragraph is already defined by thing-at-point, so you can just use it right away in easy-kill-alist without defining beginning/end-op, I guess.

knu avatar Jan 28 '25 01:01 knu

thank you, yes for paragraph I followed your advice and it works! The recommended (add-to-list 'easy-kill-alist etc) statements are scattered between two places (WORD is in "Extra things" section, whereas backward-line-edge is in "Configuration"), maybe it would be easier for the newbie user to have them all in one place?

guihembichot avatar Jan 28 '25 11:01 guihembichot