GNOME Bugzilla – Bug 759092
GtkTextIter: add starts_tag() and deprecate begins_tag(), for consistency
Last modified: 2015-12-08 19:05:51 UTC
See the attached patches.
Created attachment 316847 [details] [review] textiter: add starts_tag() and deprecate begins_tag() The name gtk_text_*_begins_* was used only for begins_tag(). All other similar functions use "starts": starts_line(), starts_word(), etc. So for consistency, add gtk_text_iter_starts_tag() and deprecate gtk_text_iter_begins_tag().
Created attachment 316848 [details] [review] Don't use gtk_text_iter_begins_tag() (deprecated) Use gtk_text_iter_starts_tag() instead.
I'm not really convinced this is worth the deprecation churn.Thanks for taking the time to report this. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.
Having consistency in the API is important. begins_tag() is an exception in GtkTextView. It is also possible to do the change for GTK+ 4, but nothing prevents us from doing it before, so it will be one less thing to do when porting an application to GTK+ 4.
To give more context, the patch was a followup of a discussion on #gedit. In GtkTextView, there is starts vs begins, and find vs search, which can be confusing. I think there is no other naming consistency problems. The deprecation is really straightforward to fix, it's just a substitution. And the advantage is to have a little nicer API. Otherwise we would have to live with that for the rest of GtkTextView's life.
Review of attachment 316847 [details] [review]: Alright then. Lets churn. There's an unrelated change to the annotation in the old api in here. Ideally, do that separately, or at least mention it in the commit message.
Review of attachment 316848 [details] [review]: ok
Attachment 316847 [details] pushed as 1dcb3a0 - textiter: add starts_tag() and deprecate begins_tag() Attachment 316848 [details] pushed as e2d1042 - Don't use gtk_text_iter_begins_tag() (deprecated)