Dieter Wilhelm wrote:
Hi
emacs -Q -D

Insert a line like the following:

otto      foo
       ^

Place the cursor approximately where the accent is.  Type M-- M-\ and
all white space is deleted instead of only the one on the left hand
side.

Neither the Emacs manual nor the delete-horizontal-space's doc string
says anything about how prefix args are handled.  But it seems like a
good idea to bind the BACKWARD-ONLY Lisp arg to the interactive prefix
arg:

2006-12-13  Kevin Rodgers  <[EMAIL PROTECTED]>

        * simple.el (delete-horizontal-space): Bind optional BACKWARD-ONLY
        arg to interactive prefix arg, and update doc string.

        * killing.texi (Deletion): Describe `M-\'
        (delete-horizontal-space) prefix argument.


*** simple.el.orig      2006-12-04 05:51:48 -0000
--- simple.el   2006-12-13 09:40:19.509429600 -0700
***************
*** 706,713 ****

  (defun delete-horizontal-space (&optional backward-only)
    "Delete all spaces and tabs around point.
! If BACKWARD-ONLY is non-nil, only delete spaces before point."
!   (interactive "*")
    (let ((orig-pos (point)))
      (delete-region
       (if backward-only
--- 706,713 ----

  (defun delete-horizontal-space (&optional backward-only)
    "Delete all spaces and tabs around point.
! With prefix arg BACKWARD-ONLY, only delete spaces and tabs before point."
!   (interactive "*P")
    (let ((orig-pos (point)))
      (delete-region
       (if backward-only


*** killing.texi.orig   2006-07-24 17:46:22 -0000
--- killing.texi        2006-12-13 09:39:38 -0700
***************
*** 148,154 ****
    The other delete commands are those which delete only whitespace
  characters: spaces, tabs and newlines.  @kbd{M-\}
  (@code{delete-horizontal-space}) deletes all the spaces and tab
! characters before and after point.  @[EMAIL PROTECTED]
  (@code{just-one-space}) does likewise but leaves a single space after
  point, regardless of the number of spaces that existed previously (even
  if there were none before).  With a numeric argument @var{n}, it
--- 148,155 ----
    The other delete commands are those which delete only whitespace
  characters: spaces, tabs and newlines.  @kbd{M-\}
  (@code{delete-horizontal-space}) deletes all the spaces and tab
! characters before and after point.  With a prefix argument, it only
! delete spaces and tabs before point.  @[EMAIL PROTECTED]
  (@code{just-one-space}) does likewise but leaves a single space after
  point, regardless of the number of spaces that existed previously (even
  if there were none before).  With a numeric argument @var{n}, it


Could you, please, also make the command symmetric? For example
negative arguments are killing on the left hand side of the point and
positive arguments on the left hand side.  The default would remain as
is.  (There was recently a request--unrelated to M-\--for such a
feature on gnu.emacs.help, killing white space left or right of the
cursor).

That would be cool.

--
Kevin



_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to