Matnni nusxalashdan S-backspace yoki M-backspace ni qanday to'xtatish mumkin?

Kursordan matnning katta qismini yo'q qilish, o'chirilgan kontentni o'ldirilish rishtasiga ko'chirishga olib keladi, u erda saqlangan narsalar haqida yozadi. Buni qanday qilib to'xtatishim mumkin?

3
github.com/lewang/le_emacs_MRU_yank ham foydali bo'lishi mumkin
qo'shib qo'ydi muallif alastairs, manba
O'ldirish halqasida oxirgi kill-ring-max o'ldiriladi. C-y va takroriy M-y dan foydalaning. doc
qo'shib qo'ydi muallif jorgepc, manba

1 javoblar

If you look at what M-backspace calls using C-h you see that it calls backward-kill-word that function simply calls kill-word with a negative argument. The kill-word function is coded as:

(defun kill-word (arg)
  "Kill characters forward until encountering the end of a word.
With argument ARG, do this that many times."
  (interactive "p")
  (kill-region (point) (progn (forward-word arg) (point))))

kill-region o'rniga delete-region dan foydalangan holda bir xil vazifani yozadigan bo'lsak, biz kerakli natijani qo'lga kiritamiz. Bizning yangi delete-word funktsiyasi:

(defun delete-word (arg)
  "Delete characters forward until encountering the end of a word.
With argument ARG, do this that many times."
  (interactive "p")
  (delete-region (point) (progn (forward-word arg) (point))))

Endi back-kill-work yordamida o'z kodini back-delete-word yozing.

(defun backward-delete-word (arg)
  "Delete characters backward until encountering the beginning of a word.
With argument ARG, do this that many times."
  (interactive "p")
  (delete-word (- arg)))

afterwards all we need to do is bind this new function to !

Agar sizda biron bir savol bo'lsa, menga xabar bering!

5
qo'shib qo'ydi