all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@online.de>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Generic string-strip still missing
Date: Fri, 25 Mar 2016 19:45:01 +0100	[thread overview]
Message-ID: <56F5872D.1080109@online.de> (raw)

Hi everybody,

whilst Emacs comes with a comment-string-strip --see def below-- a 
generic form is seems still missing.

 From newcomment.el:

(defun comment-string-strip (str beforep afterp)
   "Strip STR of any leading (if BEFOREP) and/or trailing (if AFTERP) 
space."
   (string-match (concat "\\`" (if beforep "\\s-*")
             "\\(.*?\\)" (if afterp "\\s-*\n?")
             "\\'") str)
   (match-string 1 str))

Making the matcher customizable resp. to hand over as arg, seems all 
what's needed.

Thanks,

Andreas




             reply	other threads:[~2016-03-25 18:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 18:45 Andreas Röhler [this message]
2016-03-25 18:47 ` Generic string-strip still missing Lars Magne Ingebrigtsen
2016-03-25 19:28   ` Andreas Röhler

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=56F5872D.1080109@online.de \
    --to=andreas.roehler@online.de \
    --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 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.