unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dan Jacobson <jidanni@jidanni.org>
Subject: Re: why not allow an argument to just-one-space?
Date: Thu, 13 Jan 2005 07:29:48 +0800	[thread overview]
Message-ID: <87mzvei5ub.fsf@jidanni.org> (raw)
In-Reply-To: E1Co69A-0000S5-Sn@fencepost.gnu.org

OK
>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:

rms> Does this do the job well?
rms> (defun just-one-space (n)
rms>   "Delete all spaces and tabs around point, leaving one space (or N spaces)."
rms>   (interactive "*p")
rms>   (let ((orig-pos (point)))
rms>     (skip-chars-backward " \t")
rms>     (constrain-to-field nil orig-pos)
rms>     (dotimes (i n)
rms>       (if (= (following-char) ?\ )
rms> 	  (forward-char 1)
rms> 	(insert ?\ )))
rms>     (delete-region
rms>      (point)
rms>      (progn
rms>        (skip-chars-forward " \t")
rms>        (constrain-to-field nil orig-pos t)))))

  parent reply	other threads:[~2005-01-12 23:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-08  1:16 why not allow an argument to just-one-space? Dan Jacobson
2005-01-09  0:41 ` Dan Jacobson
     [not found]   ` <E1Co69A-0000S5-Sn@fencepost.gnu.org>
2005-01-12 23:29     ` Dan Jacobson [this message]
     [not found] ` <mailman.12025.1105312659.27204.bug-gnu-emacs@gnu.org>
2005-01-10  0:07   ` Francis Litterio
2005-01-10 18:24   ` Kevin Rodgers

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=87mzvei5ub.fsf@jidanni.org \
    --to=jidanni@jidanni.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).