all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joakim Hove <hove@bccs.no>
Cc: Urban Gabor <gabaux@freemail.hu>
Subject: Re: Quick deleting from a comma separated list
Date: Thu, 18 Dec 2003 13:08:33 +0100	[thread overview]
Message-ID: <4yu13yl45a.fsf@skjellgran.ii.uib.no> (raw)
In-Reply-To: mailman.245.1071749454.868.help-gnu-emacs@gnu.org


Urban Gabor <gabaux@freemail.hu> writes:


> The cursor point is at the 'a' of the second argument. I
> want to delete the arg2 and the separating comma. What is
> solution if there are spaces after or before the comma?

Try this - *not* extensively tested!! Observe that it starts deleting
from point - ignoring where you stand, see comment in code?

(defun csv-kill ()
  (interactive)
  ;;
  ;; Should maybe start here with searching backwards for the beginning "," ??
  ;;
  (let ((p0 (point)))
    (if (search-forward "," (save-excursion (end-of-line) (point)) 't)
	(progn
	  (while (looking-at "[ \t]")
	    (forward-char 1))
	  (kill-region p0 (point)))
      (message "No further comma"))))


HTH - Joakim

-- 
  /--------------------------------------------------------------------\
 / Joakim Hove  / hove@bccs.no  /  (55 5) 84076       |                 \
 | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
 | CMU                                                | 5231 Paradis    |
 \ Thormøhlensgt.55, 5020 Bergen.                     | 55 91 28 18     /
  \--------------------------------------------------------------------/

  parent reply	other threads:[~2003-12-18 12:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.245.1071749454.868.help-gnu-emacs@gnu.org>
2003-12-18 12:01 ` Quick deleting from a comma separated list Pascal Bourguignon
2003-12-18 12:08 ` Joakim Hove [this message]
2003-12-18 17:14 ` Johan Bockgård
2003-12-18 18:06 ` Kai Grossjohann
2003-12-18 11:04 Urban Gabor

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

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

  git send-email \
    --in-reply-to=4yu13yl45a.fsf@skjellgran.ii.uib.no \
    --to=hove@bccs.no \
    --cc=gabaux@freemail.hu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.