* Generic string-strip still missing
@ 2016-03-25 18:45 Andreas Röhler
2016-03-25 18:47 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Röhler @ 2016-03-25 18:45 UTC (permalink / raw)
To: emacs-devel@gnu.org
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-25 19:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-25 18:45 Generic string-strip still missing Andreas Röhler
2016-03-25 18:47 ` Lars Magne Ingebrigtsen
2016-03-25 19:28 ` Andreas Röhler
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.