help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RE: Deleting a word using keybinding


From: Christopher Dimech
Subject: Re: RE: Deleting a word using keybinding
Date: Thu, 15 Oct 2020 23:48:23 +0200

   I have made some imporvement.  Been using the following text for
   testing, and when I am
   getting a comma, dash, or period, the function is deleting backwards.
   When this happens
   I just want it to behave as (kill-word)

   ;; This buffer is for text that is not saved, and for Lisp evaluation.
   ;; To create a file, visit it with C-x C-f and enter text in its
   buffer.

   (defun kill-spacword ()
     "Kills Word forward including Current Word.
   Multiple Spaces are reduced to one space, but without deleting
   next word."
     (interactive)
       (if (looking-at "[ \t\n]")
          ;; Space detected.
          (progn
             (forward-char)
             (if (looking-at "[ \t\n]")
               (just-one-space)
               (progn (backward-char) (kill-word 1) )
            )
          )
          ;; Current Point found on a word
          ( progn
              (if (eobp)
                 nil
                 ;;(progn (backward-word) (kill-word 1))
                 (progn
                   (backward-char)
                   (if (looking-at "[ \t\n]")
                      (kill-word 1)
                      (progn (backward-word) (kill-word 1))
                   )
                 )
             )
          )
       )
   )




   Sent: Thursday, October 15, 2020 at 11:27 PM
   From: "Drew Adams" <drew.adams@oracle.com>
   To: "Christopher Dimech" <dimech@gmx.com>
   Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>, "Thien-Thi Nguyen"
   <ttn@gnuvola.org>
   Subject: RE: Deleting a word using keybinding
   > Is there a way to detect end of buffer?
   Function `eobp'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]