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

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.