Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"org-sort" doesn't work in evil #38

Closed
TheBB opened this issue Nov 11, 2011 · 12 comments
Closed

"org-sort" doesn't work in evil #38

TheBB opened this issue Nov 11, 2011 · 12 comments

Comments

@TheBB
Copy link
Member

TheBB commented Nov 11, 2011

Originally reported by: York Zhao (Bitbucket: york, GitHub: york)


This problem have been confirmed by using "make emacs".

The problem is that in org-mode, if you select a region of headlines and use "org-sort" on the region, the headlines will be sorted however the sorted headlines will be combined into one line. For example, I have the following text:

*** headline b
*** headline a

I select these two lines by moving the point to the first line and press "V", "j", then "M-x org-sort", the result will be:

*** headline a *** headline b

Instead of:

*** headline a
*** headline b

If I place the point on the first line and press "C-SPC", DOWN, DOWN, and then press LEFT to move the point to the the end of the second line it will work fine.


@TheBB
Copy link
Member Author

TheBB commented Dec 23, 2011

Original comment by Vegard Øye (Bitbucket: epsil, GitHub: epsil):


Fixed in commit 8dd67aa.

@TheBB
Copy link
Member Author

TheBB commented Dec 24, 2011

Original comment by York Zhao (Bitbucket: york, GitHub: york):


This is still problematic, example:

== *** foo
== *** bar
== *** something else

After `org-sort', they become:

== *** bar***
== foo

== *** something else

@TheBB
Copy link
Member Author

TheBB commented Jan 2, 2012

Original comment by York Zhao (Bitbucket: york, GitHub: york):


Bump this one as I was confused by what "wontfix" means.

@TheBB
Copy link
Member Author

TheBB commented Jan 3, 2012

Original comment by Vegard Øye (Bitbucket: epsil, GitHub: epsil):


I'm not able to reproduce this. Could you wrap the example in ... so that BitBucket doesn't format it?

@TheBB
Copy link
Member Author

TheBB commented Jan 3, 2012

Original comment by Anonymous:


Could you wrap the example in ... so that BitBucket doesn't format it?

Sorry I didn't know how to stop BitBucket's auto format. So here is the org-mode buffer to start with:

** foo
** bar
** something else

Type "V", then "j" to select the first two lines, and M-x org-sort, choose 'a' and the buffer becomes:

** bar**
foo
<blank line>
** something else

which is incorrect, after the sort the buffer should be:

** bar
** foo
** something else

Thanks

@TheBB
Copy link
Member Author

TheBB commented Jan 3, 2012

Original comment by Vegard Øye (Bitbucket: epsil, GitHub: epsil):


I'm still unable to reproduce it. Here are my steps:

  1. Start a fresh Evil instance with make emacs.

  2. Create an empty buffer with :b test.

  3. Insert the following text:

    ** foo
    ** bar
    ** something else

  4. Go to the beginning of the buffer.

  5. Select the text with Vjj.

  6. Sort the lines with M-x org-sort ([a]lpha).

  7. Result:

    ** bar
    ** foo
    ** something else

@TheBB
Copy link
Member Author

TheBB commented Jan 3, 2012

Original comment by York Zhao (Bitbucket: york, GitHub: york):


Should be "Vj" to select only the first two lines not "Vjj".

@TheBB
Copy link
Member Author

TheBB commented Jan 6, 2012

Original comment by Vegard Øye (Bitbucket: epsil, GitHub: epsil):


I'm still not able to reproduce this. What is your version of Org-mode (M-x org-version)? Mine is 7.6, installed with sudo apt-get install org-mode.

@TheBB
Copy link
Member Author

TheBB commented Jan 6, 2012

Original comment by York Zhao (Bitbucket: york, GitHub: york):


I'm using the latest org-version from git, v7.8.03, but the problem has been there for awhile, back to the time while using v7.7.

@TheBB
Copy link
Member Author

TheBB commented Jan 7, 2012

Original comment by Vegard Øye (Bitbucket: epsil, GitHub: epsil):


I upgraded to version 7.8.03. Still nothing.

I don't even understand what kind of bug this is supposed to be. The only way I can get something similar is if I insert newlines in between. That is,

** foo

** bar

** something else

instead of

** foo
** bar
** something else

Then, if I select foo + newline + bar, I get bar + foo + newline after sorting (the "newline layout" is not retained). If I select foo + newline + bar + newline, then I get bar + newline + foo + newline after sorting (the "newline layout" //is// retained).

@TheBB
Copy link
Member Author

TheBB commented Jan 7, 2012

Original comment by Vegard Øye (Bitbucket: epsil, GitHub: epsil):


If this second bug is in any way related to the first (which was addressed by commit 8dd67aa), then commit 9f7dbc2 //might// fix it. But as I said, I'm not exactly sure what we're dealing with here.

@TheBB
Copy link
Member Author

TheBB commented Jan 7, 2012

Original comment by York Zhao (Bitbucket: york, GitHub: york):


9f7dbc finally fixed the issue, working beautifully now. Good job Vegard.

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant