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 712912 - Reply quoting text
Reply quoting text
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: composer
unspecified
Other All
: High normal
: 0.10.0
Assigned To: Geary Maintainers
Geary Maintainers
review
Depends on:
Blocks:
 
 
Reported: 2012-06-20 03:40 UTC by Geary Maintainers
Modified: 2014-12-17 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Choose the message to reply to based on selection (3.67 KB, patch)
2014-08-25 02:57 UTC, Robert Schroll
none Details | Review
Use selected text in quotes when available (10.79 KB, patch)
2014-08-25 02:58 UTC, Robert Schroll
none Details | Review
Use bottom-posting when replying with selection (3.77 KB, patch)
2014-08-25 03:06 UTC, Robert Schroll
none Details | Review
Add selected text as quote in existing reply (3.63 KB, patch)
2014-08-25 03:12 UTC, Robert Schroll
none Details | Review
Choose the message to reply to based on selection (3.67 KB, patch)
2014-09-19 06:20 UTC, Robert Schroll
committed Details | Review
Use selected text in quotes when available (10.79 KB, patch)
2014-09-19 06:20 UTC, Robert Schroll
committed Details | Review
Use bottom-posting when replying with selection (3.77 KB, patch)
2014-09-19 06:20 UTC, Robert Schroll
committed Details | Review
Add selected text as quote in existing reply (3.63 KB, patch)
2014-09-19 06:21 UTC, Robert Schroll
committed Details | Review
Place cursor appropriately in new composer (5.10 KB, patch)
2014-09-19 06:22 UTC, Robert Schroll
committed Details | Review
Preserve newlines when quoting selected plain text (3.04 KB, patch)
2014-09-19 06:24 UTC, Robert Schroll
committed Details | Review
Strip quote chrome from selection when replying (1.53 KB, patch)
2014-09-19 06:24 UTC, Robert Schroll
committed Details | Review

Description Charles Lindsay 2013-11-21 20:17:37 UTC


---- Reported by geary-maint@gnome.bugs 2012-06-20 08:40:00 -0700 ----

Original Redmine bug id: 5425
Original URL: http://redmine.yorba.org/issues/5425
Searchable id: yorba-bug-5425
Original author: Gianmarco Brocchi
Original description:

I use (like a Gmail extension does) to reply quoting text in this way: I
select some sentences on a mail and click on the Reply button I have the mail
with the selected text quoting.

Related issues:
duplicated by geary - Feature #6886: quote selected text when replying (Duplicate)



---- Additional Comments From geary-maint@gnome.bugs 2013-05-01 10:31:00 -0700 ----

### History

####

#1

Updated by Eric Gregory over 1 year ago

This is a common feature in newer web forum software, and it's really handy.
I'd like to see this in Geary as well.

####

#2

Updated by Adam Dingle over 1 year ago

  * **Priority** changed from _Normal_ to _High_

Agreed - that would be sweet.

####

#3

Updated by Eric Gregory about 1 year ago

I just noticed (by accident) that Apple Mail has this feature.

####

#4

Updated by Robert Schroll 7 months ago

This would also help with the issue of "Which email does the user mean to
reply to?" It's the one he's selected, in this case.

Of course, we will need to decided what to do when the selection includes
multiple emails.



--- Bug imported by chaz@yorba.org 2013-11-21 20:18 UTC  ---

This bug was previously known as _bug_ 5425 at http://redmine.yorba.org/show_bug.cgi?id=5425

Unknown version " in product geary. 
   Setting version to "!unspecified".
Unknown milestone "unknown in product geary. 
   Setting to default milestone for this product, "---".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
Resolution set on an open status.
   Dropping resolution 

Comment 1 chris 2014-02-11 21:31:17 UTC
Thanks for a fun and promising MUA, team. Just a +1 to say this feature is desirable and would be very useful for me.
Comment 2 Robert Schroll 2014-08-16 22:47:51 UTC
Now that we have the inline composers, hitting reply multiple times will just refocus the open composer.  When there's selected text, we could insert that into the open composer.  This would help when you want to reply to several messages on a mailing list, for example.
Comment 3 Jim Nelson 2014-08-19 18:59:24 UTC
I agree.  That would make this feature kinda rockin'.

What about the detached composer?  Anything we need to worry about with that?  I'm thinking that detaching the composer essentially breaks the connection with the main window, so this feature would be unavailable.
Comment 4 Robert Schroll 2014-08-19 21:54:47 UTC
Yeah, I think once you've detached the composer, all this clever stuff stops working, if for no other reason than there needs to be a way to stop all this clever stuff.

The more difficult question is, what happens when you hit reply to a different message without selecting any text.  Right now, it'll open up a second composer.  Should that still happen if it doesn't when text is selected?
Comment 5 Jim Nelson 2014-08-19 23:39:20 UTC
Off the top of my head, I feel that this enhanced behavior we're discussing is based off which buttons are pressed.  The toolbar buttons mean "reply to the conversation" which is, in effect, the same as replying to the most recent message.  The message menu dropdown reply is to reply to that specific message.  This behavior we're discussing is then applied to the appropriate message.
Comment 6 Robert Schroll 2014-08-25 02:57:35 UTC
Created attachment 284363 [details] [review]
Choose the message to reply to based on selection

Here's the beginning of a solution.  I did it in pieces, and I've left 
it in separate commits for now.  Each touches several files, so I think 
it'll be easier to understand what's going on this way.  We may want to 
squash them in the end.

This one just selects the message being replied to based on the 
selection.  This only affects to "global" reply; hitting reply on a 
drop-dowm menu for a specific email still replies to that.
Comment 7 Robert Schroll 2014-08-25 02:58:35 UTC
Created attachment 284364 [details] [review]
Use selected text in quotes when available
Comment 8 Robert Schroll 2014-08-25 03:06:17 UTC
Created attachment 284365 [details] [review]
Use bottom-posting when replying with selection

I assume if you're selecting just a bit of text, you're going to be 
bottom-posting, like a civilized person.  Of course, my bias here is 
obvious, but this seems like an interesting way to solve the 
top/bottom-posting conundrum.

What's unclear to me is what to do in the case of forwards.  Our current 
formatting is unsuited to bottom-posting, so it stays with top-posting.  
But I wonder:

1) Should forwarding allow only selections?  I tend to think of forwards 
as being the whole text, but I'm comfortable with replies being edited.  
So is there a desire for edited forwards?

2) Should we use reply formatting of exerpts even when forwarding?  
That's the style I'd expect if I'm going to be interspersing my 
comments, no matter who it's going to.

On another subject, I don't think this is going to work so well with 
signatures.
Comment 9 Robert Schroll 2014-08-25 03:12:41 UTC
Created attachment 284366 [details] [review]
Add selected text as quote in existing reply

Because of the aforementioned problems, we always use the reply 
formatting for the excerpts.

The new quote is only added if the compose type is not changing.  I 
wanted to avoid the problem of doubly-inserting a quote when you change 
the reply type without deselecting the text.  Another way around this 
problem would be to save the previously quoted text, and only insert the 
current quote if it's different.

Each quote is given it's own "On" line.  Right now, that may not be 
desired, since all of them will be the same.  But I want to add the 
ability to quote different emails in the same message, and that'll be 
useful there.  Since it's easier to delete it when it's not needed than 
add it when it is, I've left it in for now.

Speaking of which, I want to make this mutliple message quote thing 
work.  This will take some re-thinking of the reply model.  Should we do 
that here, or make another bug?
Comment 10 Robert Schroll 2014-08-27 22:09:22 UTC
This fails rather comically if your selection includes a quote -- you get the expander button as well.  We can probably snip such things out as we're putting them in the composer.
Comment 11 Jim Nelson 2014-09-03 00:32:25 UTC
Thanks for your patience with me, Robert.  Some answers to your questions:

* Signatures need to work with this.  Signatures were, by far, the most requested feature in this release.

* How much time do you estimate for multiple-message-quoting?  It does seem powerful, but time is drawing to a close and I worry about introducing new modes and such to the inline composer.

* You mentioned a problem when the selection includes a quote.  Are you working on a fix to that, or are you read for me to review your last patch?
Comment 12 Robert Schroll 2014-09-03 01:22:28 UTC
There's no need for an in-depth review, but I wanted to make sure this was on the right track before I continue.  For instance, if we don't want bottom-posting with this mode, we won't have any problems with signatures.

I don't think there's any real technical problem with the multiple-message-quoting, but we'd need to specify how it's going to work in all sorts of different states.  I didn't know if we wanted to go into that now or not.
Comment 13 Jim Nelson 2014-09-09 20:04:30 UTC
This works fine for me, although this patch doesn't compile.  Still, I see where you're going with this and think it's quite clean (I assumed this feature would take more work than this).

I think we should worry about multiple message quoting later, unless it's something that you think is relatively minor to add to this patch (and, as above, doesn't hurt current features).
Comment 14 Robert Schroll 2014-09-19 06:20:31 UTC
Created attachment 286570 [details] [review]
Choose the message to reply to based on selection

I've rebased my branch onto master; hopefully this will fix the compile 
issues.  These first few patches will just replace the old ones.  If 
you'd prefer, I can set up a branch on git.gnome with this work.
Comment 15 Robert Schroll 2014-09-19 06:20:42 UTC
Created attachment 286571 [details] [review]
Use selected text in quotes when available
Comment 16 Robert Schroll 2014-09-19 06:20:56 UTC
Created attachment 286572 [details] [review]
Use bottom-posting when replying with selection
Comment 17 Robert Schroll 2014-09-19 06:21:14 UTC
Created attachment 286573 [details] [review]
Add selected text as quote in existing reply
Comment 18 Robert Schroll 2014-09-19 06:22:15 UTC
Created attachment 286574 [details] [review]
Place cursor appropriately in new composer

This should make it work with signatures.
Comment 19 Robert Schroll 2014-09-19 06:24:18 UTC
Created attachment 286575 [details] [review]
Preserve newlines when quoting selected plain text

I noticed an additional problem: newlines weren't preserved why part of 
a plain-text message was quoted.  When we construct a full quote of a 
plain text message, we wrap the whole thing in a styled div.  So if we 
notice that we've selected text inside a plain text message, we add that 
div to the quote.
Comment 20 Robert Schroll 2014-09-19 06:24:36 UTC
Created attachment 286576 [details] [review]
Strip quote chrome from selection when replying

Mainly the quote shower and hider.
Comment 21 Jim Nelson 2014-09-19 19:38:23 UTC
Yeah, let's create a branch on git.gnome.org for this work.  Are you ready for me to review or are you looking for comments?

I'm getting ready to cut 0.8 and I don't think we can merge this in time.  Certainly this is something we can look at adding after the release.
Comment 22 Robert Schroll 2014-09-19 19:57:40 UTC
I've pushed the branch to wip/712912-select-quote.  It should be ready to go -- I've been using it for the past few weeks.
Comment 23 Federico Bruni 2014-09-19 20:22:38 UTC
Wonderful, just compiled that branch and it seems to work great.
Since I started using Geary more than a year ago, this is the last of my 3 most wanted features being added (after save to draft and search).

Thanks Robert!
Comment 24 Jim Nelson 2014-09-25 22:22:51 UTC
Great work.  Commit!
Comment 25 Robert Schroll 2014-09-26 05:02:11 UTC
Two procedural questions:

1) Would you prefer the commits separate or squashed down to one?  I have no strong feelings either way; the small commits were to help with development.

2) Should we leave this bug open to handle multiple message quoting, or should I make a new bug for that?
Comment 26 Federico Bruni 2014-09-27 09:25:24 UTC
Quoting text works only if I reply using shortcuts. If I use the menu it doesn't.
Not a showstopper IMO, I just want to be sure that you are aware of this.

$ git branch
  master
* wip/712912-select-quote

Commit 7f2034f0876b63658fd1acbf02055dd561e98fe7
Comment 27 Robert Schroll 2014-09-27 17:42:42 UTC
(In reply to comment #26)
> Quoting text works only if I reply using shortcuts. If I use the menu it
> doesn't.
> Not a showstopper IMO, I just want to be sure that you are aware of this.

Quoting should work via shortcuts and the header bar buttons.  It does not work from the menu in each message.  This was a conscious decision on my part, though that doesn't mean it was the right one.

I was thinking about what should happen if you select text in one message and then choose "reply" from the menu in the second.  I decided that, in this case, we should ignore the selection and do the standard reply to the second message.  With this behavior, I though it would be odd to have selections work with this menu when the selection is in the same message -- sometimes that menu would work with selections; sometimes it wouldn't.  Therefore, I opted for consistent behavior: The message menu reply would never pay attention to selections.  (It was also easier to implement this way.)

I'm not wedded to this behavior, so feel free to argue if you think it should behave another way.
Comment 28 Federico Bruni 2014-09-27 19:32:31 UTC
I don't care much as I always use shortcuts.
Maybe an user would think that it's a bug and not a way to prevent an error. It may be worth a warning in the user guide.

BTW, reply quoting text via header bar buttons is not working here (again, I personally don't care as I never use the header bar buttons). See above the commit I'm on
Comment 29 Robert Schroll 2014-10-07 21:57:44 UTC
After thinking about it some more, I think it might make sense to allow quote-replies from the message menu of the message with a selection.  There's not that much chance for confusion.  But I'd prefer to get the existing code in first.

Jim, do you want this as a series of commits, or one squashed commit?  Also, please let me know if I should close this bug and open new ones for refinements, or just continue here.
Comment 30 Jim Nelson 2014-10-08 00:18:01 UTC
Re: squashing vs. series, the only requirements I have are that every commit compile and execute so that we can git bisect without issue.  Also, there should be no merge bubbles in master (i.e. in gitg you see a single line of commits).  I'll let you verify if each commit compiles properly.

Let's close this bug and open new tickets for fine-tuning (i.e. message menu).

Re: Federico's issue with the header bar buttons, have you seen that at all?  I can't reproduce it, the header bar buttons work fine for me.

If not, Federico: when Robert commits his changes, please test again.  If the buttons still don't work, please file a ticket letting us know and tell us exactly what steps you're going through to reproduce it.

Thanks!
Comment 31 Robert Schroll 2014-10-08 22:13:46 UTC
Here it goes as a series of patches, since that's slightly easier for 
me.  I'll open some new issues for further enhancement.

Attachment 286570 [details] pushed as 4d38f66 - Choose the message to reply to based on selection
Attachment 286571 [details] pushed as fac79c7 - Use selected text in quotes when available
Attachment 286572 [details] pushed as 099caa4 - Use bottom-posting when replying with selection
Attachment 286573 [details] pushed as db6b48e - Add selected text as quote in existing reply
Attachment 286574 [details] pushed as fc41d2a - Place cursor appropriately in new composer
Attachment 286575 [details] pushed as 387e710 - Preserve newlines when quoting selected plain text
Attachment 286576 [details] pushed as 3b173a0 - Strip quote chrome from selection when replying
Comment 32 Robert Schroll 2014-10-08 22:38:37 UTC
Replies through the message menu is bug #738187.

Replying to multiple messages is bug #738188.

Fedrico, if you can't get this to work with the header bar buttons, please open another issue.
Comment 33 Federico Bruni 2014-10-13 05:58:23 UTC
It's working fine here, thanks
Comment 34 Pétur 2014-12-15 14:17:42 UTC
With Geary 0.8.2, to select some text does not automatically quote it.

Is the patchs included in 0.8.2? If yes, there are not working (for me and other).
Comment 35 Jim Nelson 2014-12-15 20:33:01 UTC
As mentioned on the mailing list, this feature is in master and scheduled for 0.10.0.  (The "Target Milestone" at the bottom of our tickets hold that information.)
Comment 36 Pétur 2014-12-16 16:52:37 UTC
Indeed! 

I just installed Geary from source and this quoting feature works.

However, it doesn't work when forwarding emails. In comment #8 Robert Schroll wonders if the feature should be implemented to the forward action.

In my opinion, it should! To forward a part of a big email is a common practice. Usually we add under the quote something like "Hi X, What do you think of what Y said ("quote below")".

Do you consider implemented this also for forwarded mail?
Comment 37 Robert Schroll 2014-12-16 18:40:28 UTC
It's supposed to work for forwards.  It does for me, at least, and if it doesn't for you, please open a new bug about that.

However, forwards (1) get a different introduction, including more header information, (2) are not put into a blockquote, and (3) are formatted for top-posting, not bottom-posting.  Any and all of these are up for reconsideration.  This is a feature I don't use at all, so I didn't know what would be best.  If you want the behavior changed, open a new bug and subscribe me to it.
Comment 38 Pétur 2014-12-17 13:41:23 UTC
Indeed, it works for forward (my mistake).

I think the way it works now is perfect (top-posting for forwarding, not blockquote).