I want the delete to end of word command to delete the word, regardless of the cursor position.
(defun my-kill-word () (interactive) (backward-word) (kill-word 1)) (global-set-key (kbd "M-d") 'my-kill-word)
The best code could be:
(defun my-kill-word () (interactive) (unless (looking-at "\\<") (backward-word)) (kill-word 1)) (global-set-key (kbd "M-d") 'my-kill-word)
So, we move back only if we are not at the beginning of the word though.
Source: https://habr.com/ru/post/1746272/More articles:Как выполнить синтаксический анализ шаблона в Python? - pythonTurn ImageView updates into ProgressBar - androidSQLite trigger for updating consolidated accounts - sqliteExample DNS Protocol Message - dnsProblem with import java.nio.file - javaRun a Windows application as a service? - windowsUsing MVC2 to update an Entity Framework v4 object using foreign keys - entity-frameworkDisplay HTML content on top of applet - is wmode transparent? - javaHow can I adjust the transparency of a Java applet to display content behind it? - javaThe Link Between Two Firefox Add-Ons (Tier Link) - firefoxAll Articles