Re: [O] [PATCH] org: Support creating arbitrary headline paths when refiling

2018-10-14 Thread Sebastian Reuße
Nicolas Goaziou writes: AFAICT, it still doesn't work. I get the exact same result as detailed above. That’s odd, I can’t reproduce your example anymore. Is your Emacs session still the same one as earlier today? While implementing the patch I had to C-0 M-x org-refile occasionally, becau

[O] Headlines with slashes when refiling

2018-10-14 Thread Sebastian Reuße
BTW this reminds me of some issues I ran into on master a while back. When a refile target has a headline containing a slash, there are some issues: 1. When an existing headline contains a slash, completing-read will display the target as »A\/Slash«. However, when entering the string manually

Re: [O] [PATCH] org: Support creating arbitrary headline paths when refiling

2018-10-14 Thread Sebastian Reuße
Hello Nicolas, Nicolas Goaziou writes: I still cannot make it work property. With the following document: --8<---cut here---start->8--- * Foo ** Bar * Foo2 --8<---cut here---end--->8--- Trying to refile "Foo2" under

[O] [PATCH] org: Support creating arbitrary headline paths when refiling

2018-10-14 Thread Sebastian Reuße
* org.el (org--refile-new-path): Add. (org-refile): Use it. (org-refile-new-child): Support creating new root nodes. * test-org.el (test-org/org-refile): Add test. While ‘org-refile’ currently supports creating new headlines when refiling, only one single headline can be created this way. For con

[O] [PATCH] org: Support creating arbitrary headline paths when refiling

2018-10-11 Thread Sebastian Reuße
* org.el (org--refile-new-path): Add. (org-refile): Use it. (org-refile-new-child): Support creating new root nodes. * test-org.el (test-org/org-refile): Add test. While ‘org-refile’ currently supports creating new headlines when refiling, only one single headline can be created this way. For con

Re: [O] [PATCH] org: Support creating arbitrary headline paths when refiling

2018-10-10 Thread Sebastian Reuße
Sebastian Reuße writes: + (if (and (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ) I realize this is overly restrictive if you don’t have ‘org-refile-use-outline-path’ set to ‘file’ and want to refile under a newly created root headline. AFAICT this would also have

Re: [O] [PATCH] org: Support creating arbitrary headline paths when refiling

2018-10-10 Thread Sebastian Reuße
Hello Nicolas, Nicolas Goaziou writes: Compiling your patch generates the following warnings. org.el:11417:1:Warning: Unused lexical variable ‘parent’ org.el:11417:1:Warning: Unused lexical variable ‘child’ org.el:11417:1:Warning: Unused lexical variable ‘parent-target’ Goo

[O] [PATCH] org: Support creating arbitrary headline paths when refiling

2018-10-10 Thread Sebastian Reuße
* org.el (org--refile-new-path): Add. (org-refile): Use it. (org-refile-new-child): Make new nodes more compact. * test-org.el (test-org/org-refile): Add test. While ‘org-refile’ currently supports creating new headlines when refiling, only one single headline can be created this way. For conveni

[O] [PATCH] org: Support creating arbitrary headline paths when refiling

2018-10-07 Thread Sebastian Reuße
* org.el (org--refile-new-path): Add. (org-refile): Use it. (org-refile-new-child): Make new nodes more compact. * test-org.el (test-org/org-refile): Add test. While ‘org-refile’ currently supports creating new headlines when refiling, only one single headline can be created this way. For conveni

Re: [O] bug: org-table-sort-lines does only case sensitive alphabetical sorting

2018-07-19 Thread Sebastian Reuße
Heikki Lehvaslaiho writes: > (string-collate-lessp "ß" "ssa" "de_DE.utf-8") ; nil > (string-lessp "ß" "ssa") ; nil This shows us that your Emacs installation does not support alphabetic sorting at all, regardless of case, and instead only sorts lexicographically (i.e., re

Re: [O] bug: org-table-sort-lines does only case sensitive alphabetical sorting

2018-07-17 Thread Sebastian Reuße
Heikki Lehvaslaiho writes: > x86_64-apple-darwin14.5.0 Looking at the C source of ‘string-collate-lessp’ (src/fns.c), it looks like there exists a case where Emacs itself will fall back on ‘string-lessp’ even when ‘string-collate-lessp’ is invoked. #else /* !__STDC_ISO_10646__, !WINDOWSN

Re: [O] bug: org-table-sort-lines does only case sensitive alphabetical sorting

2018-07-14 Thread Sebastian Reuße
Hello Nicolas, hello Heikki, > Heikki Lehvaslaiho writes: >> I can not see any change in function with the new code. Alphabetical >> sorting is fixedly case sensitive. Is your Emacs≤24? Emacs (surprisingly) only gained a facility for alphabetic (locale-sensitive) sorting with ver. 25. Before th

Re: [O] [BUG] org-sort-entries errors out when headline is empty

2018-03-23 Thread Sebastian Reuße
Hello Nicolas, Nicolas Goaziou writes: > Sebastian Reuße writes: >> I was also wondering if it might make sense to tweak >> ‘org-complex-heading-regexp’ so that the respective capture group >> captures an empty string. This could be achieved by making the title

[O] [PATCH 1/2] Extend org-sort-entries test

2018-03-13 Thread Sebastian Reuße
* test-org.el (test-org/sort-entries): Test with empty headings. --- testing/lisp/test-org.el | 10 ++ 1 file changed, 10 insertions(+) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 33769aafa..8c98fce4d 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test

[O] [BUG] org-sort-entries errors out when headline is empty

2018-03-13 Thread Sebastian Reuße
So, I’ve noticed that when sorting a subtree (alphabetically or numerically), ‘org-sort-entries’ will raise an error arising from the call to ‘org-sort-remove-invisible’ (lines 8761 and 8766 in bc7b24d0d). I’m following up with a test. The error is triggered by the capture group in ‘org-complex-he

[O] [PATCH 2/2] Guard against empty headings when sorting

2018-03-13 Thread Sebastian Reuße
* org.el (org-sort-entries): Guard against empty headings when sorting alphabetically, numerically. Due to how ‘org-complex-heading-regexp’ is defined, the title capture group currently returns nil in empty headings, which we don’t want to pass on to ‘org-sort-remove-invisible’. --- lisp/org.el |

Re: [O] [PATCH 2/6] Fix alphabetic string matching operators

2018-03-11 Thread Sebastian Reuße
Sorry, I committed this one without using the compat-shimmed version of ‘string-collate-lessp’. Amended. Kind regards, SR -- Insane cobra split the wood Trader of the lowland breed Call a jittney, drive away In the slipstream we will stay

[O] [PATCH] Fix alphabetic string matching operators

2018-03-11 Thread Sebastian Reuße
* org.el (org-string<): Add. (org-op-to-function): Use it. (org-string> etc.): Use collated comparison. Cf. commit 551d2f1fe. --- lisp/org.el | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ac1ad3c75..24923ad4f 100644 --- a/lisp/org.el

[O] [PATCH 6/6] Improve ‘org-sort-list’ test

2018-03-11 Thread Sebastian Reuße
* test-org-list.el (test-org-list/sort): Take case-sensitive vs. insensitive sorting into account. --- testing/lisp/test-org-list.el | 36 ++-- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list

[O] [PATCH 3/6] Fix org-table-sort-lines test

2018-03-11 Thread Sebastian Reuße
* test-org-table.el (test-org-table/sort-lines): Fix and improve testcase. Sorting and reversing «a C b» should result in «C b a», not in «b a C». This test did not fail previously only because org-table-sort-lines had an issue whereby sorts were always case-sensitive. --- testing/lisp/test-org-

[O] [PATCH 5/6] org-table-sort-lines: Fix case-sensitive sorting

2018-03-11 Thread Sebastian Reuße
* org-table.el (org-table-sort-lines): Fix case sensitive sorting, improve docstring. * test-org-table.el (test-org-table/sort-lines): Enforce C locale when testing alphabetic sorting. ‘sort-subr’ ignores ‘sort-fold-case’ when a predicate is provided. To correctly handle case-sensitivity, we now b

[O] [PATCH 2/6] Fix alphabetic string matching operators

2018-03-11 Thread Sebastian Reuße
* org.el (org-string<): Add. (org-op-to-function): Use it. (org-string> etc.): Use collated comparison. Cf. commit 551d2f1fe. --- lisp/org.el | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ac1ad3c75..edae502a8 100644 --- a/lisp/org.el

[O] [PATCH 4/6] Fix string-collate-lessp shim

2018-03-11 Thread Sebastian Reuße
* org-compat.el (org-string-collate-lessp): When shimming string-collate-lessp, accept the same arguments as in the unshimmed case. --- lisp/org-compat.el | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 975752224..a2

[O] [PATCH 1/6] Fix alphabetic sorting for tables, plain lists

2018-03-11 Thread Sebastian Reuße
* org-table.el (org-table-sort-lines): Use collated sorting. * org-list.el (org-sort-list): Use collated sorting. Cf. commit 551d2f1fe. --- etc/ORG-NEWS | 6 ++ lisp/org-list.el | 5 +++-- lisp/org-table.el | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/etc/ORG-

Re: [O] [PATCH] Fix alphabetic sorting for headlines, tags

2018-02-12 Thread Sebastian Reuße
Nicolas Goaziou writes: > Sebastian Reuße writes: >> The test will error out if the data for the chosen locale isn’t >> actually present on the system. I chose the «en_US» locale in the >> hopes that this will frequently be installed. I’ll leave it up to you >>

[O] [PATCH] Fix alphabetic sorting for headlines, tags

2018-02-12 Thread Sebastian Reuße
* org.el (org-sort-entries): Use collated sorting. (org-tags-sort-function): Use collated sorting. (org-string-collate-greaterp): Add helper-function to use as defcustom option, since there is no ‘string-collate-greaterp’ in Emacs. * org-compat.el (org-string-collate-lessp): Add proxy to fall-back

Re: [O] [PATCH] Fix alphabetic sorting for headlines, tags

2018-02-12 Thread Sebastian Reuße
Nicolas Goaziou writes: > Sebastian Reuße writes: > >> I also considered adding a regression test for non-ASCII chars to >> «test-org/sort-entries», but for stable results, one would have to >> enforce some canonical locale. Unfortunately, it’s not possible to >>

[O] [PATCH] Fix alphabetic sorting for headlines, tags

2018-02-11 Thread Sebastian Reuße
* org.el (org-sort-entries): Use collated sorting. (org-tags-sort-function): Use collated sorting. (org-string-collate-greaterp): Add helper-function to use as defcustom option, since there is no ‘string-collate-greaterp’ in Emacs. * org-compat.el (org-string-collate-lessp): Add proxy to fall-back

Re: [O] [PATCH] Fix alphabetic sorting for headlines, tags

2018-02-11 Thread Sebastian Reuße
Hello Nicolas, Nicolas Goaziou writes: > However, Org 9.X still supports Emacs 24, so we cannot use > `string-collate-lessp without degrading gracefully to `string-lessp' > in these Emacsen. > We could add `org-string-collate-lessp' to "org-compat.el", which > would be an alias for `string-coll

[O] [PATCH] Fix alphabetic sorting for headlines, tags

2018-02-06 Thread Sebastian Reuße
* org.el (org-sort-entries): Use collated sorting. (org-tags-sort-function): Use collated sorting. (org-string-collate-greaterp): Add helper-function to use as defcustom option, since there is no ‘string-collate-greaterp’ in Emacs. ‘org-sort-entries’ and ‘org-tags-sort-function’ advertise alphabet

[O] [PATCH] Fix alphabetic sorting for headlines, tags

2018-02-06 Thread Sebastian Reuße
* org.el (org-sort-entries): Use collated sorting. (org-tags-sort-function): Use collated sorting. (org-string-collate-greaterp): Add helper-function to use as defcustom option, since there is no ‘string-collate-greaterp’ in Emacs. ‘org-sort-entries’ and ‘org-tags-sort-function’ advertise alphabet

Re: [O] [PATCH 2/2] org-refile: Fix inconsistency when listing refile targets

2017-06-21 Thread Sebastian Reuße
Hello Allen, Allen Li writes: > On Mon, May 15, 2017 at 5:54 AM, Sebastian Reuße wrote: >> * org.el (org-refile-get-targets): Setting org-refile-use-outline-path >> to `file' or `buffer-name' causes an additional target for the file’s >> root node to be inserted

Re: [O] [PATCH 1/2] Add tests for org-refile-get-targets

2017-05-21 Thread Sebastian Reuße
Nicolas Goaziou writes: > Sebastian Reuße writes: >> It didn’t feel right copy-pasting the tests wholesale, so I made a >> helper-macro. I checked the ert output by forcing a failure and the >> failure explanation looks as expected. Does this work for you? > H

[O] [PATCH] Add tests for org-refile-get-targets

2017-05-17 Thread Sebastian Reuße
* testing/lisp/test-org.el: Add test. --- testing/examples/refile/a.org | 6 testing/examples/refile/b.org | 6 testing/lisp/test-org.el | 71 +++ 3 files changed, 83 insertions(+) create mode 100644 testing/examples/refile/a.org create mo

Re: [O] [PATCH 1/2] Add tests for org-refile-get-targets

2017-05-17 Thread Sebastian Reuße
Hello Nicolas, Nicolas Goaziou writes: > Nitpick: Sections in test-org.el are sorted alphabetically. So the new > "Refile" section could go between "Radio Targets" and "Sparse trees". Thank you, I hadn’t noticed. > Would it be possible to split this big test into smaller ones, with > a descrip

[O] [PATCH 1/2] Add tests for org-refile-get-targets

2017-05-15 Thread Sebastian Reuße
* testing/lisp/test-org.el: Add test. --- testing/examples/refile/a.org | 6 ++ testing/examples/refile/b.org | 6 ++ testing/lisp/test-org.el | 44 +++ 3 files changed, 56 insertions(+) create mode 100644 testing/examples/refile/a.org creat

[O] [PATCH 2/2] org-refile: Fix inconsistency when listing refile targets

2017-05-15 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Setting org-refile-use-outline-path to `file' or `buffer-name' causes an additional target for the file’s root node to be inserted. This functionality was absent when using `full-file-path'. We now add this since it is convenient and makes the behavior more consis

[O] [PATCH] ORG-NEWS: Update new features

2017-05-06 Thread Sebastian Reuße
--- etc/ORG-NEWS | 5 + 1 file changed, 5 insertions(+) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index b16b73ae1..2c00f767a 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -219,6 +219,11 @@ This allow to use a different title than entry title. Using ~C-c C-a u~ prompts for a URL pointing to

Re: [O] [PATCH 1/2] org-refile: escape slashes only in headline of refile target

2017-05-05 Thread Sebastian Reuße
Kyle Meyer writes: > Based on the Org contributor page [*], it doesn't look like you've > signed papers with the FSF, so the commit message should label this as > a "TINYCHANGE". (I think this and the next patch would be small enough > to mark as tiny changes.) I have a copyright assignment wit

Re: [O] [PATCH 1/2] org-refile: escape slashes only in headline of refile target

2017-05-05 Thread Sebastian Reuße
Kyle Meyer writes: > Org's master branch currently supports Emacs >= 24.3, but string-join > was added in the 24.5 release. > I'm fine with the append -> cons conversion, but avoiding it would > make for a cleaner diff that's more focused on the main purpose of > this patch. Thank you, Kyle. I

[O] [PATCH 2/2] org-refile: Optionally prefix refile targets with buffer name

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Add case to optionally prefix refile targets with the buffer name. (org-refile-use-outline-path): Add new option setting and document. Having an option to use the buffer name as a prefix is convenient, since this will work hand in hand with uniquify to only show

[O] [PATCH 1/2] org-refile: Escape slashes only in headline of refile target

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Only escape slashes in headline part of refile target; leave any file-system path component (when enabled) unescaped. The reason to escape slashes in refile targets is to make it clear when a slash was part of a headline vs. part of the outline path. It makes se

[O] [PATCH 2/2] org-refile: Optionally prefix refile targets with buffer name

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Add case to optionally prefix refile targets with the buffer name. (org-refile-use-outline-path): Add new option setting and document. Having an option to use the buffer name as a prefix is convenient, since this will work hand in hand with uniquify to only show

[O] [PATCH 1/2] org-refile: Escape slashes only in headline of refile target

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Only escape slashes in headline part of refile target; leave any file-system path component (when enabled) unescaped. The reason to escape slashes in refile targets is to make it clear when a slash was part of a headline vs. part of the outline path. It makes se

[O] [PATCH 2/2] org-refile: Optionally prefix refile targets with buffer name

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Add case to optionally prefix refile targets with the buffer name. (org-refile-use-outline-path): Add new option setting and document. Having an option to use the buffer name as a prefix is convenient, since this will work hand in hand with uniquify to only show

[O] [PATCH 1/2] org-refile: Escape slashes only in headline of refile target

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Only escape slashes in headline part of refile target; leave any file-system path component (when enabled) unescaped. The reason to escape slashes in refile targets is to make it clear when a slash was part of a headline vs. part of the outline path. It makes se

[O] [PATCH 2/2] org-refile: optionally prefix refile targets with buffer name

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Add case to optionally prefix refile targets with the buffer name. (org-refile-use-outline-path): Add new option setting and document. Having an option to use the buffer name as a prefix is convenient, since this will work hand in hand with uniquify to only show

Re: [O] [PATCH 2/2] org-refile: optionally prefix refile targets with buffer name

2017-05-05 Thread Sebastian Reuße
Apologies for the resubmission; forgot to stage a hunk in one of the commits. Kind regards, Sebastian Reuße

[O] [PATCH 1/2] org-refile: escape slashes only in headline of refile target

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): only escape slashes in headline part of refile target; leave any file-system path component (when enabled) unescaped. The reason to escape slashes in refile targets is to make it clear when a slash was part of a headline vs. part of the outline path. It makes se

[O] [PATCH 2/2] org-refile: optionally prefix refile targets with buffer name

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): Add case to optionally prefix refile targets with the buffer name. (org-refile-use-outline-path): Document new option. Having an option to use the buffer name as a prefix is convenient, since this will work hand in hand with uniquify to only show those parts of t

[O] [PATCH 1/2] org-refile: escape slashes only in headline of refile target

2017-05-05 Thread Sebastian Reuße
* org.el (org-refile-get-targets): only escape slashes in headline part of refile target; leave any file-system path component (when enabled) unescaped. The reason to escape slashes in refile targets is to make it clear when a slash was part of a headline vs. part of the outline path. It makes se