Bug 141459 - Put %CURSOR at top of templates by default
Summary: Put %CURSOR at top of templates by default
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kmail
Classification: Applications
Component: templates (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-09 21:46 UTC by Maciej Pilichowski
Modified: 2012-08-19 00:28 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Pilichowski 2007-02-09 21:46:54 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    SuSE RPMs

3.5.5 was just fine -- if something is not broken does not fix it!

I downloaded 3.5.6 and now KMail starts replying from the last line -- it does not make sense at all because I don't see the beginning so I have to in each case (no exceptions) go to the first manually.

Please, provide, old, good behaviour.
Comment 1 Allen Winter 2007-02-09 21:50:56 UTC
This is caused by the new templates feature.

Go into Configure KMail-> Composer -> Templates
Select Reply to Sender.

You'll see a %CURSOR in the template.

Make the template look something like:
%REM="Default reply template"%-
%CURSOR
On %ODATEEN %OTIMELONGEN you wrote:
%QUOTE

Comment 2 Allen Winter 2007-02-09 22:03:35 UTC
sorry, I will fix this by moving the %CURSOR up to the top of the template.
so -> reopening.

but you have a way to fix this yourself in the meantime.
Comment 3 Maciej Pilichowski 2007-02-09 22:09:51 UTC
Yes, thank you very much.
Comment 4 Thomas McGuire 2007-06-20 19:09:04 UTC
Isn't this fixed in KMail 1.9.7 by now? For me the cursor is placed at the top of mail.
Comment 5 Thomas McGuire 2007-07-17 13:39:07 UTC
Mass-changing component to "templates" and adding original template author to 
CC list.
Comment 6 Thomas McGuire 2007-08-15 16:40:15 UTC
SVN commit 700430 by tmcguire:

Fix the cursor position for templates.
Now %CURSOR works again, this was somehow lost in porting.
Additionally, it is now possible again to set the cursor to the first line.

BUG: 140917
CCBUG: 141459

 M  +2 -3      kmcomposewin.cpp  
 M  +8 -0      kmedit.cpp  
 M  +4 -0      kmedit.h  


--- trunk/KDE/kdepim/kmail/kmcomposewin.cpp #700429:700430
@@ -4635,9 +4635,8 @@
 void KMComposeWin::setReplyFocus( bool hasMessage )
 {
   mEditor->setFocus();
-  if ( hasMessage ) {
-    mEditor->setCursorPosition( 1, 0 );
-  }
+  if ( hasMessage )
+    mEditor->setCursorPositionFromStart( (unsigned int) mMsg->getCursorPos() );
 }
 
 void KMComposeWin::setFocusToSubject()
--- trunk/KDE/kdepim/kmail/kmedit.cpp #700429:700430
@@ -759,4 +759,12 @@
   }
 }
 
+void KMEdit::setCursorPositionFromStart( unsigned int pos ) {
+  unsigned int l = 0;
+  unsigned int c = 0;
+  posToRowCol( pos, l, c );
+  setCursorPosition( l, c );
+  ensureCursorVisible();
+}
+
 #include "kmedit.moc"
--- trunk/KDE/kdepim/kmail/kmedit.h #700429:700430
@@ -91,6 +91,10 @@
 
   unsigned int lineBreakColumn() const;
 
+  /** set cursor to absolute position pos */
+  void setCursorPositionFromStart(unsigned int pos);
+
+
 signals:
   void spellcheck_done( int result );
   void attachPNGImageData( const QByteArray &image );
Comment 7 Thomas McGuire 2007-08-15 16:44:04 UTC
Closing as WONTFIX.
The default is that the cursor is at the end.
It can be changed easily by the user so that the cursor is at the top. This is not the default as top-posting is discouraged.
Comment 8 Maciej Pilichowski 2007-08-16 13:09:20 UTC
Thomas, I believe the last comment was supposed to be in the other report, right?
Comment 9 Thomas McGuire 2007-08-30 17:50:51 UTC
>Thomas, I believe the last comment was supposed to be in the other report, right? 
If you mean comment #6, then yes. I CC'ed this bug report because it was related, as it fixed the extra newline when %CURSOR was at the beginning.

By comment #7, I am not to sure about WONTFIX. Maybe convert this to a wish to set %CURSOR at the top by default?
Comment 10 Maciej Pilichowski 2007-08-30 19:06:57 UTC
Yes, it would be nice :-)

1) to mimic the old behaviour
2) if you answer with quotes the natural way is to start from the beginning and answer piece by piece
Comment 11 Thomas McGuire 2007-08-30 19:11:07 UTC
Reopening to change this to a wish
Comment 12 Thomas McGuire 2007-08-30 19:16:01 UTC
Argh, should be wishlist, not minor.
Comment 13 Julian G 2009-02-16 13:16:49 UTC
It seems that with Kmail 1.11 this feature got broken again - I set the "%CURSOR" and it did work just before fedora 10 pushed the kde 4.2 update.
Comment 14 Torgny Nyblom 2009-02-16 19:33:06 UTC
Working fine here using KMail Version 1.11.0 (Using KDE 4.2.00 (KDE 4.2.0))
Might be a Fedora packaging error.
Comment 15 Julian G 2009-02-19 12:41:39 UTC
there's another template setup for each identity which is deactivated by default. somehow it has been activated by kde update from 4.1.4 to 4.2.
Comment 16 Myriam Schweingruber 2012-08-18 07:56:43 UTC
Thank you for your feature request. Kmail1 is currently unmaintained so we are closing all wishes. Please feel free to reopen a feature request for Kmail2 if it has not already been implemented.
Thank you for your understanding.
Comment 17 Luigi Toscano 2012-08-19 00:28:53 UTC
Instead of creating a new feature request, please confirm here if the wishlist is still valid for kmail2.