unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Zap-to-char behaviour
Date: Wed, 21 May 2003 12:37:14 -0500 (CDT)	[thread overview]
Message-ID: <200305211737.h4LHbEc08523@eel.dms.auburn.edu> (raw)
In-Reply-To: <20030521163038.2792062E4D@mallaury.noc.nerim.net> (jmarant@nerim.net)

J. Marant wrote:

   Anyway, would it be of any annoyance to add a
   'zap-up-to-char' function which does the same as zap-to-char
   except from removing the character? (I'm currently
   not fluent at Elisp).

No, as John Paul Wallington already pointed out, all you need to do is
uncomment a comment in the function definition.  If you are planning
on using both functions, I would also suggest differentiating between
the two echo area messages.  Result:

(defun zap-up-to-char (arg char)
  "Kill up to, but not including ARG'th occurrence of CHAR.
Case is ignored if `case-fold-search' is non-nil in the current buffer.
Goes backward if ARG is negative; error if CHAR not found."
  (interactive "p\ncZap up to char: ")
  (kill-region (point) (progn
			 (search-forward (char-to-string char) nil nil arg)
			 (goto-char (if (> arg 0) (1- (point)) (1+ (point))))
			 (point))))

The problem now is that if you want to keep the regular M-z binding to
zap-to-char, then you probably will need to bind the new command to a
longer key sequence and it takes only one keystroke to retype the
character anyway.

Sincerely,

Luc.

  reply	other threads:[~2003-05-21 17:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21 16:30 Zap-to-char behaviour jmarant
2003-05-21 17:37 ` Luc Teirlinck [this message]
2003-05-21 19:03   ` Luc Teirlinck
2003-05-21 20:02     ` Jérôme Marant
2003-05-21 20:31   ` Ehud Karni
2003-05-21 20:50     ` Jérôme Marant
2003-05-21 21:58     ` Luc Teirlinck
2003-05-21 22:35     ` Luc Teirlinck
2003-05-23 12:04 ` Richard Stallman
2003-05-23 18:27   ` Jérôme Marant
  -- strict thread matches above, loose matches on Subject: below --
2003-05-22  7:23 Jérôme Marant
2003-05-22 15:56 ` Luc Teirlinck
2003-05-22 21:04   ` Jérôme Marant
2003-05-20 20:40 Jérôme Marant
2003-05-20 20:59 ` John Paul Wallington
2003-05-20 21:08   ` Jérôme Marant
2003-05-21 15:31 ` Richard Stallman
2003-05-21 15:59   ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200305211737.h4LHbEc08523@eel.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).