unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* bounds for strings with - between subwords
@ 2021-05-06 22:32 steve-humphreys
  2021-05-06 22:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 6+ messages in thread
From: steve-humphreys @ 2021-05-06 22:32 UTC (permalink / raw)
  To: Help Gnu Emacs

I am using the following function that gets me the bounds for each word.

But I have strings like

bibl-bellerive-etal-2016

which I want to get the bounds for strings with - between subwords.

--------

(defun alpha-bounds ()
   "Gets bounds of a subword unit defined by regular expression [a-zA-Z]."

   (let ( ($bounds nil) $ma $mb )

      (skip-chars-backward "[:alpha:]")
      (setq $ma (point))
      (skip-chars-forward "[:alpha:]")
      (setq $mb (point))
      (setq $bounds (bounds-of-thing-at-point 'word))
      (cons $ma $mb) ))





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

end of thread, other threads:[~2021-05-07  1:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-06 22:32 bounds for strings with - between subwords steve-humphreys
2021-05-06 22:49 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-06 23:37   ` Christopher Dimech
2021-05-06 23:44     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-06 23:58       ` Christopher Dimech
2021-05-07  1:17       ` steve-humphreys

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