Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-09 Thread Samuel Wales
actually i don't know if i'd create fuzzy links ever.  but if they
defaulted to exact match first, maybe i would create them by default.



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-09 Thread Samuel Wales
it's a good idea.  i never got that stuff to work right, including the
create thing.

but fyi there remains a use case, which is when you in a non-exported
org file create a regular link but do not want to create an org-id,
then change the header.  this is the result of error.  you don't think
you will change the header.  you still want the link to offer to make
a guess if possible.  but the fuzziness would need to be a fuzzy match
as in hamming distance or so.  i don't know if i'd want to create a
fuzzy link for every link.



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-09 Thread Nicolas Goaziou
Hello,

"Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)"  writes:

> HOWEVER, in the case of links pointing to headlines, the matching to has
> to be EXACT (but it was not necessary in earlier version since 2011 at
> least) otherwise I get the message below:
>
>   "No match for fuzzy expression: "
>
> Do you know if I can revert some option to make the sample below to work
> again?

You cannot. This option somehow disappeared years ago.

Note that you can complete "[[*" with M-, which can help a bit. If
the feature is considered useful anyway,
`org-link-search-must-match-exact-headline' is not the right way to
solve this. With this variable, that the same document can mean two
different things, which cripples portability.

For example, the following document

* XX
Contents 1
* X
Contents 2
* Headline
See [[*X]].

means two different things if you set
`org-link-search-must-match-exact-headline' to nil and I don't. 

Granted, you can use file local variables to fix a given value in the
document, but that doesn't sound right. Org format ought to be more
self-contained.

So, here's an idea. We could drop
`org-link-search-must-match-exact-headline' (the `query-to-create' value
could be handled in a dedicated variable) and introduce a new syntax for
regexp searches:

  [[?random words]] and [[*?random words]]

This way, where the link should point to is explicit.

The question about export is still open. [[*?random words]] targets
a headline it can be handled the usual way. However [[?random words]]
may target anything, including parts of the document that cannot be
referenced easily (e.g., comments, the contents of an example block...).

Another option is to keep only [[*?random words]] since we cannot handle
the other properly. Note that, even without this feature, you can still
use targets for specific locations in the buffer:

  Some <>long text

  [[here]]

I have the feeling that a feature like [[?random words]] (and
`org-link-search-must-match-exact-headline') is going to bite us
someday.

WDYT?

Regards,

-- 
Nicolas Goaziou



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-08 Thread Aʟᴏɴɢ-Tʀᴀᴄᴋ

This patch to my ~/.emacs PARTIALLY, but permanently, solved my issue:

diff --git a/conf/home/.emacs b/conf/home/.emacs
index 6bc96469e..cef1c08a7 100755
--- a/conf/home/.emacs
+++ b/conf/home/.emacs
@@ -27,6 +27,7 @@
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
+ '(org-link-search-must-match-exact-headline nil)
  '(inhibit-startup-screen t)
  '(safe-local-variable-values

Now, I can use again my internal links to inline random text in my
files

HOWEVER, in the case of links pointing to headlines, the matching to has
to be EXACT (but it was not necessary in earlier version since 2011 at
least) otherwise I get the message below:

  "No match for fuzzy expression: "

Do you know if I can revert some option to make the sample below to work
again?

-8<-
[[*random text][link to the past]]

* TODO random text in a headline title
-8<-

As of today, only this link with EXACT matching would work:

[[*random text in a headline title][link to the past]]

Thanks a lot,
Nicolas

On 05/01/2018 17:15, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:

On 05/01/2018 13:27, Eric S Fraga wrote:

On Friday,  5 Jan 2018 at 13:10, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:

[...]


Is it possible that this setting is set by Debian packagers?
I ask this because I reproduced this bug with and without my
  ~/.emacs[.d/] files.


It's the default for org (at least now, as far as I can tell).


But I ashamedly don't know how to set it permanently in my  ~/.emacs!
Would you please help me on this?


Easy: describe the variable

   C-h v org-link-search-must-match-exact-headline RET

and then click on the "customize" link near the end of the
description.  Make sure to "Apply and set" the change you make.



I've done this but only changed the indentation of the
custom-set-variables block and added nothing new.

And if I start from an empty ~/.emacs I got this ew block, but again, it
does not mention org-link-search-must-match-exact-headline variable:

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  )
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  )

What should I add *by hand* in ~/.emacs?
I'm sorry, it is just a matter of very basic elisp syntax (but I never
took the time to dig into elisp yet!).

Thank you,
Nicolas



--
Nicolas Bercher
Aʟᴏɴɢ-Tʀᴀᴄᴋ
Mob: +33 651 792 011
Tel: +33 952 550 210
Fax: +33 957 550 210
http://www.along-track.com/



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-05 Thread Tim Cross

Eric has provided the 'manual' solution for setting that variable. At
the risk of 'muddying the waters', I just wanted to mention a couple of
things which might help clarify matters.

- The built-in 'customize' facility of emacs means that you do not need
to do anything 'by hand' to customize the setting. It should be possible
for you to use customize and not do anything else.

- The block from your .emacs file is the customize system code block and
it is meant to be completely managed by the customize system. The one
you have posted is a vanilla block with no customisation settings.

- When you make a change via the customise interface, you have multiple
choices for how Emacs will use/interpret that change. This is referred
to as 'state' in the custom interface. There are a number of options,
all explained in the manual, but the two most common are 'Set for
current session' and 'Save for future sessions'.

- It is important to realise that the custom interface does basically
two things. First, it sets any current variables representing the value
being customised. This is essentially the 'Set for current session'
part. Second, assuming you select a state option which preserves your
changes, it will write the setting to the custom block in your .emacs
file so that your changes persist across emacs sessions. This is
essentially the 'Save for future sessions' part.

The benefit of the set for current session option is that it give the
the opportunity to try out a custom setting. If it doesn't work or it
breaks things, you can just quit emacs and re-start and everything is
back to the pre-custom setting. The downside of this option is that if
you don't later in the same session re-run the custom interface and
select the 'Save for future sessions' option, your changes will be lost
when you re-start.

Given that you noted the custom interface was able to re-indent your
.emacs custom block, we know that custom is working and can access your
.emacs file ok. Therefore, the next thing I would check is that when you
run the customize interface you are selecting Save for future sessions
option. This should see the setting updated in your .emacs 'custom'
block. (I suspect you may have selected 'set for current session' which
will not update the custom block in your .emacs file).

I would highly recommend reading the customisation section of the Emacs
manual. The custom interface has been implemented precisely for people
who don't know emacs lisp and just want to perform basic editor or mode
customisation. Using that interface, you don't need to know any Emacs
lisp and don't need to do anything by hand. There are also a number of
different ways to initiate a customisation session. I find that

M-x customize-group  [mode]

to be very useful. For example,

M-x customize-group  org

HTH

Tim



Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)  writes:

> On 05/01/2018 13:27, Eric S Fraga wrote:
>> On Friday,  5 Jan 2018 at 13:10, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:
>> 
>> [...]
>> 

> [...]
> I've done this but only changed the indentation of the
> custom-set-variables block and added nothing new.
>
> And if I start from an empty ~/.emacs I got this ew block, but again, it
> does not mention org-link-search-must-match-exact-headline variable:
>
> (custom-set-variables
>   ;; custom-set-variables was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>   )
> (custom-set-faces
>   ;; custom-set-faces was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>   )
>
> What should I add *by hand* in ~/.emacs?
> I'm sorry, it is just a matter of very basic elisp syntax (but I never
> took the time to dig into elisp yet!).
>



-- 
Tim Cross



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-05 Thread Eric S Fraga
On Friday,  5 Jan 2018 at 17:15, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:
> On 05/01/2018 13:27, Eric S Fraga wrote:

[...]

>> Easy: describe the variable
>>
>>C-h v org-link-search-must-match-exact-headline RET
>>
>> and then click on the "customize" link near the end of the
>> description.  Make sure to "Apply and set" the change you make.
>>
>
> I've done this but only changed the indentation of the
> custom-set-variables block and added nothing new.

Strange.

> What should I add *by hand* in ~/.emacs?

Try

  (setq org-link-search-must-match-exact-headline nil)
  
> I'm sorry, it is just a matter of very basic elisp syntax (but I never
> took the time to dig into elisp yet!).

No worries.  None of us is born known lisp...  However, no time like
the present to start learning. ;-)

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6


signature.asc
Description: PGP signature


Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-05 Thread Aʟᴏɴɢ-Tʀᴀᴄᴋ

On 05/01/2018 13:27, Eric S Fraga wrote:

On Friday,  5 Jan 2018 at 13:10, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:

[...]


Is it possible that this setting is set by Debian packagers?
I ask this because I reproduced this bug with and without my
  ~/.emacs[.d/] files.


It's the default for org (at least now, as far as I can tell).


But I ashamedly don't know how to set it permanently in my  ~/.emacs!
Would you please help me on this?


Easy: describe the variable

   C-h v org-link-search-must-match-exact-headline RET

and then click on the "customize" link near the end of the
description.  Make sure to "Apply and set" the change you make.



I've done this but only changed the indentation of the
custom-set-variables block and added nothing new.

And if I start from an empty ~/.emacs I got this ew block, but again, it
does not mention org-link-search-must-match-exact-headline variable:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

What should I add *by hand* in ~/.emacs?
I'm sorry, it is just a matter of very basic elisp syntax (but I never
took the time to dig into elisp yet!).

Thank you,
Nicolas



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-05 Thread Eric S Fraga
On Friday,  5 Jan 2018 at 13:10, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:

[...]

> Is it possible that this setting is set by Debian packagers?
> I ask this because I reproduced this bug with and without my
>  ~/.emacs[.d/] files.

It's the default for org (at least now, as far as I can tell).

> But I ashamedly don't know how to set it permanently in my  ~/.emacs!
> Would you please help me on this?

Easy: describe the variable

  C-h v org-link-search-must-match-exact-headline RET

and then click on the "customize" link near the end of the
description.  Make sure to "Apply and set" the change you make.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6


signature.asc
Description: PGP signature


Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-05 Thread Aʟᴏɴɢ-Tʀᴀᴄᴋ

On 05/01/2018 08:32, Nicolas Goaziou wrote:

Hello,

"Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)"  writes:


The regression makes several some kinds of org-mode links not to work
anymore.

Examples:

This should be a [[%5B2018-01-03%20mer.%2016:29%5D][valid link]] to
log's headline but Org can't find it
anymore and asks for the creation of a new headline:

   "No match - create this as a new heading? (yes or no)"

Also, the following links are broken:

  - [[the following links are broken][link to internal text in this
file]] (but equivalent to the
timestamped broken link reported above), reports:

"No match - create this as a new heading? (yes or no)"

  - [[should point here][link to internal text from an external
org-mode file]] (same issue
than above) which _should point here_, but reports

"No match for fuzzy expression: should point here"

The following links still work well:
  - link to a [[*headline][*headline]]
  - link to a [[* headline][* headline with space]]
  - external [[http://www.example.com/][links to the www]]

* [2018-01-03 mer. 16:29] A time stamped log headline
* headline


You probably have `org-link-search-must-match-exact-headline' set to
a non-nil value (default setting is non-nil).

Note that such links do not export correctly. For this use case, it's
better to use targets.

Regards,



Dear Nicolas,

Thank you a lot for your help.
Is it possible that this setting is set by Debian packagers?
I ask this because I reproduced this bug with and without my 
 ~/.emacs[.d/] files.


OK, I've tried and it does the trick:

  M-x set-variable RET
  org-link-search-must-match-exact-headline RET
  nil RET

But I ashamedly don't know how to set it permanently in my  ~/.emacs!
Would you please help me on this?

Nicolas

--
Nicolas Bercher
Aʟᴏɴɢ-Tʀᴀᴄᴋ
Mob: +33 651 792 011
Tel: +33 952 550 210
Fax: +33 957 550 210
http://www.along-track.com/



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-04 Thread Nicolas Goaziou
Hello,

"Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)"  writes:

> The regression makes several some kinds of org-mode links not to work
> anymore.
>
> Examples:
>
> This should be a [[%5B2018-01-03%20mer.%2016:29%5D][valid link]] to
> log's headline but Org can't find it
> anymore and asks for the creation of a new headline:
>
>   "No match - create this as a new heading? (yes or no)"
>
> Also, the following links are broken:
>
>  - [[the following links are broken][link to internal text in this
> file]] (but equivalent to the
>timestamped broken link reported above), reports:
>
>"No match - create this as a new heading? (yes or no)"
>
>  - [[should point here][link to internal text from an external
> org-mode file]] (same issue
>than above) which _should point here_, but reports
>
>"No match for fuzzy expression: should point here"
>
> The following links still work well:
>  - link to a [[*headline][*headline]]
>  - link to a [[* headline][* headline with space]]
>  - external [[http://www.example.com/][links to the www]]
>
> * [2018-01-03 mer. 16:29] A time stamped log headline
> * headline

You probably have `org-link-search-must-match-exact-headline' set to
a non-nil value (default setting is non-nil).

Note that such links do not export correctly. For this use case, it's
better to use targets.

Regards,

-- 
Nicolas Goaziou



Re: [O] [IT] Broken support for links to text files (both internal & external)

2018-01-04 Thread Eric S Fraga
On Thursday,  4 Jan 2018 at 17:20, Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ) wrote:
> Dear org-mode developers,
>
> Please find attached an org-mode file describing the issue.

Could you please post an org file that demonstrates the actual problem?
That is, one with headings you wish to link to?

> This is a sample org-mode log to report on what looks like a
> regression in between Debian Jessie's emacs24 (=24.4+1-5+deb8u1) and
> Debian Stretch's emacs24 (=24.5+1-11+deb9u1).

What are the versions of org in each of these?  They may be quite old
and, more importantly, they could straddle a major version change of org
(from 7.x to 8.x or even 9.x).

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6


signature.asc
Description: PGP signature


[O] [IT] Broken support for links to text files (both internal & external)

2018-01-04 Thread Aʟᴏɴɢ-Tʀᴀᴄᴋ

Dear org-mode developers,

Please find attached an org-mode file describing the issue.

It is also pasted here for technical convenience:

-8<-

This is a sample org-mode log to report on what looks like a
regression in between Debian Jessie's emacs24 (=24.4+1-5+deb8u1) and
Debian Stretch's emacs24 (=24.5+1-11+deb9u1).

The regression makes several some kinds of org-mode links not to work
anymore.

Examples:

This should be a [[%5B2018-01-03%20mer.%2016:29%5D][valid link]] to 
log's headline but Org can't find it

anymore and asks for the creation of a new headline:

  "No match - create this as a new heading? (yes or no)"

Also, the following links are broken:

 - [[the following links are broken][link to internal text in this 
file]] (but equivalent to the

   timestamped broken link reported above), reports:

   "No match - create this as a new heading? (yes or no)"

 - [[should point here][link to internal text from an external org-mode 
file]] (same issue

   than above) which _should point here_, but reports

   "No match for fuzzy expression: should point here"

The following links still work well:
 - link to a [[*headline][*headline]]
 - link to a [[* headline][* headline with space]]
 - external [[http://www.example.com/][links to the www]]

* [2018-01-03 mer. 16:29] A time stamped log headline
* headline

-8<-

Thank you for your help,
Nicolas
--
Nicolas Bercher
Aʟᴏɴɢ-Tʀᴀᴄᴋ
Mob: +33 651 792 011
Tel: +33 952 550 210
Fax: +33 957 550 210
http://www.along-track.com/
This is a sample org-mode log to report on what looks like a
regression in between Debian Jessie's emacs24 (=24.4+1-5+deb8u1) and
Debian Stretch's emacs24 (=24.5+1-11+deb9u1).

The regression makes several some kinds of org-mode links not to work
anymore.

Examples:

This should be a [[%5B2018-01-03%20mer.%2016:29%5D][valid link]] to log's 
headline but Org can't find it
anymore and asks for the creation of a new headline:

  "No match - create this as a new heading? (yes or no)"

Also, the following links are broken:

 - [[the following links are broken][link to internal text in this file]] (but 
equivalent to the
   timestamped broken link reported above), reports:

   "No match - create this as a new heading? (yes or no)"

 - [[should point here][link to internal text from an external org-mode file]] 
(same issue
   than above) which _should point here_, but reports

   "No match for fuzzy expression: should point here"

The following links still work well:
 - link to a [[*headline][*headline]]
 - link to a [[* headline][* headline with space]]
 - external [[http://www.example.com/][links to the www]]

* [2018-01-03 mer. 16:29] A time stamped log headline
* headline