After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759092 - GtkTextIter: add starts_tag() and deprecate begins_tag(), for consistency
GtkTextIter: add starts_tag() and deprecate begins_tag(), for consistency
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.19.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-12-06 16:56 UTC by Sébastien Wilmet
Modified: 2015-12-08 19:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
textiter: add starts_tag() and deprecate begins_tag() (4.37 KB, patch)
2015-12-06 16:57 UTC, Sébastien Wilmet
committed Details | Review
Don't use gtk_text_iter_begins_tag() (deprecated) (3.51 KB, patch)
2015-12-06 16:57 UTC, Sébastien Wilmet
committed Details | Review

Description Sébastien Wilmet 2015-12-06 16:56:15 UTC
See the attached patches.
Comment 1 Sébastien Wilmet 2015-12-06 16:57:27 UTC
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().
Comment 2 Sébastien Wilmet 2015-12-06 16:57:33 UTC
Created attachment 316848 [details] [review]
Don't use gtk_text_iter_begins_tag() (deprecated)

Use gtk_text_iter_starts_tag() instead.
Comment 3 Matthias Clasen 2015-12-07 17:41:06 UTC
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.
Comment 4 Sébastien Wilmet 2015-12-07 18:27:29 UTC
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.
Comment 5 Sébastien Wilmet 2015-12-08 13:17:26 UTC
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.
Comment 6 Matthias Clasen 2015-12-08 16:17:24 UTC
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.
Comment 7 Matthias Clasen 2015-12-08 16:17:44 UTC
Review of attachment 316848 [details] [review]:

ok
Comment 8 Matthias Clasen 2015-12-08 16:17:46 UTC
Review of attachment 316848 [details] [review]:

ok
Comment 9 Sébastien Wilmet 2015-12-08 19:05:36 UTC
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)