all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

* Re: Generic string-strip still missing
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-03-25 18:47 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-devel@gnu.org

Andreas Röhler <andreas.roehler@online.de> writes:

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

See `string-trim*' and `string-remove*'.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Generic string-strip still missing
  2016-03-25 18:47 ` Lars Magne Ingebrigtsen
@ 2016-03-25 19:28   ` Andreas Röhler
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Röhler @ 2016-03-25 19:28 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel@gnu.org



On 25.03.2016 19:47, Lars Magne Ingebrigtsen wrote:
> Andreas Röhler <andreas.roehler@online.de> writes:
>
>> whilst Emacs comes with a comment-string-strip --see def below-- a
>> generic form is seems still missing.
> See `string-trim*' and `string-remove*'.
>

Thanks, found it in subr-x.el

emacs -Q M-x apropos RET string-trim RET seems not to know about it.



^ 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.