Re: [O] Regression - problem with links

2019-03-15 Thread Eric S Fraga
On Friday, 15 Mar 2019 at 10:27, Bernt Hansen wrote:
> Recently C-c C-o shows the link address instead of description which
> makes it hard to use.  This occurs for C-c C-o on the headline of the
> task and also in the agenda.

This was noted and then fixed last week.  Maybe you need to update to a more 
recent version?

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.2-287-gb1429c



Re: [O] Regression - problem with links

2019-03-15 Thread Marco Wahl
Hi,

[...]

> My links are like this:
>
>
> [[https://somewebsiteaddress.net/path/to/page.do][Timekeeper]]
> [[id:eb1085ed-15fe-46a3-8b5e-3971587d1123][OTL 2019]]
>
> and I want to see
>
> [1] Timekeeper
> [2] OTL 2019
>
> but instead I get the address like this which is much less useable
>
> [1] https://somewebsiteaddress.net/path/to/page.do
> [2] id:eb1085ed-15fe-46a3-8b5e-3971587d1123

This sounds like a bug fixed a few days ago.


https://code.orgmode.org/bzg/org-mode/commit/b1429cdfe043b199bb7be6dc5c97a299954b4e0d

Can you check if the fix is in your copy of Org?


HTH,  Marco






[O] Regression - problem with links

2019-03-15 Thread Bernt Hansen
Hi,

I have a habit with a list of links in it which I use to navigate to
places for dealing with the task.

Recently C-c C-o shows the link address instead of description which
makes it hard to use.  This occurs for C-c C-o on the headline of the
task and also in the agenda.

My links are like this:


[[https://somewebsiteaddress.net/path/to/page.do][Timekeeper]]

[[id:eb1085ed-15fe-46a3-8b5e-3971587d1123][OTL 2019]]

and I want to see

[1] Timekeeper
[2] OTL 2019

but instead I get the address like this which is much less useable

[1] https://somewebsiteaddress.net/path/to/page.do
[2] id:eb1085ed-15fe-46a3-8b5e-3971587d1123

I have multiple lists with multiple id: entries so I can't tell which is
which anymore from the headline.  My workaround is to display the task
and do C-c C-o on the task I need to visit.

I am on the latest git master commit as of this morning.

Regards,
Bernt



Re: [O] Regression - problem with links

2019-03-15 Thread Bernt Hansen
Bernt Hansen  writes:

> Marco Wahl  writes:
>
>> Hi,
>>
>> [...]
>>
>>> My links are like this:
>>>
>>>
>>> [[https://somewebsiteaddress.net/path/to/page.do][Timekeeper]]
>>> [[id:eb1085ed-15fe-46a3-8b5e-3971587d1123][OTL 2019]]
>>>
>>> and I want to see
>>>
>>> [1] Timekeeper
>>> [2] OTL 2019
>>>
>>> but instead I get the address like this which is much less useable
>>>
>>> [1] https://somewebsiteaddress.net/path/to/page.do
>>> [2] id:eb1085ed-15fe-46a3-8b5e-3971587d1123
>>
>> This sounds like a bug fixed a few days ago.
>>
>> 
>> https://code.orgmode.org/bzg/org-mode/commit/b1429cdfe043b199bb7be6dc5c97a299954b4e0d
>>
>> Can you check if the fix is in your copy of Org?
>
> I have that commit in my current git version.
>
> Last week I noticed agenda clock reports had file: text before this fix
> and reverted back to normal looking clock reports after however the menu
> from C-c C-o doesn't display link descriptions for me.
>
> I'll try to isolate which commit breaks this.
>
> Regards,
> Bernt

My current master  is

f0dc3a06d (test-org-clock: Fix one test, 2019-03-15)

This may be another case that isn't covered by the fix.
maint displays links correctly but master does not for me in the menu
when you select a link to jump to with C-c C-o from the heading or from
the agenda.

git bisect identifies the following commit:

2b00d6281606ef295dadbe4ddd929ebdd6716d60 is the first bad commit
commit 2b00d6281606ef295dadbe4ddd929ebdd6716d60
Author: Nicolas Goaziou 
Date:   Sat Mar 9 10:58:41 2019 +0100

Change bracket link escape syntax

* contrib/lisp/org-link-edit.el (org-link-edit--link-data):
* lisp/ob-tangle.el (org-babel-tangle-comment-links): Update
match-group.
(org-babel-detangle): Remove unnecessary `org-link-escape' call.
(org-babel-tangle-jump-to-org): Update match group.
(org-link-url-hexify):
(org-link-escape-chars): Remove variables.
* lisp/ol.el (org-link--decode-compound): Renamed from
  `org-link--unescape-compound'.
(org-link--decode-single-byte-sequence): Renamed from
`org-link--unescape-single-byte-sequence'.
(org-link-make-regexps): Update `org-link-bracket-re' syntax.
(org-link-encode): New function, renamed from `org-link-escape'.
(org-link-decode): New function, renamed from `org-link-unescape'.
(org-link-escape):
(org-link-unescape): Use new escape syntax.
(org-link-make-string): Apply new escaping rules.
(org-link-display-format):
(org-insert-link): Update match group.
* lisp/org-agenda.el (org-diary):
(org-agenda-format-item):
(org-agenda-to-appt): Update match group.
* lisp/org-clock.el (org-clocktable-write-default): Update match
group.
* lisp/org-element.el (org-element-link-parser): Update match group.
* lisp/org-mobile.el (org-mobile-escape-olp):
(org-mobile-locate-entry): Apply function renaming.
* lisp/org-protocol.el (org-protocol-split-data):
(org-protocol-parse-parameters): Apply function renaming.
* lisp/org.el (org-refile): Update match group.
* testing/README (Interactive testing from within Emacs): Fix
  examples.
* testing/lisp/test-ol.el (test-ol/encode): Merge old escape tests.
(test-ol/decode): Merge old unescape tests.
(test-ol/escape):
(test-ol/unescape):
(test-ol/make-string): New tests.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/link):
* testing/lisp/test-org.el (test-org/custom-id):
(test-org/fuzzy-links):
* testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link):
Update
  tests.

:04 04 474dd71a09f6396ef593cf061aa0001968fb5412
976cda41aeecca75da7c5982aeb89a2cde5e5567 M  contrib
:04 04 2ab4f30b6deac5cfc4c9e83fc1f2ac013232f8da
d7b6b3c0ff0adda1a557dfe87bffd0d8f17f6659 M  lisp
:04 04 133b3e5e20e848a7347ca4c73c517bca4120461d
28f9768c483af5bce6a242889360747be4ac865a M  testing

Regards,
Bernt.



Re: [O] Regression - problem with links

2019-03-15 Thread Bernt Hansen
Marco Wahl  writes:

> Hi,
>
> [...]
>
>> My links are like this:
>>
>>
>> [[https://somewebsiteaddress.net/path/to/page.do][Timekeeper]]
>> [[id:eb1085ed-15fe-46a3-8b5e-3971587d1123][OTL 2019]]
>>
>> and I want to see
>>
>> [1] Timekeeper
>> [2] OTL 2019
>>
>> but instead I get the address like this which is much less useable
>>
>> [1] https://somewebsiteaddress.net/path/to/page.do
>> [2] id:eb1085ed-15fe-46a3-8b5e-3971587d1123
>
> This sounds like a bug fixed a few days ago.
>
> 
> https://code.orgmode.org/bzg/org-mode/commit/b1429cdfe043b199bb7be6dc5c97a299954b4e0d
>
> Can you check if the fix is in your copy of Org?

I have that commit in my current git version.

Last week I noticed agenda clock reports had file: text before this fix
and reverted back to normal looking clock reports after however the menu
from C-c C-o doesn't display link descriptions for me.

I'll try to isolate which commit breaks this.

Regards,
Bernt



Re: [O] [PATCH 2/2] test-ob-emacs-lisp: Test :lexical src block header argument

2019-03-15 Thread Sebastian Miele


Nicolas Goaziou  writes:

> However, from experience, having to fix a regression when your only
> indication comes from a test you do not fully understand is a pain. To
> see what I mean, have a look at tests in
> "test-ob-header-arg-defaults.el" and imagine one of them fails…

After looking into test-ob-header-arg-defaults.el and its accompanying
Org file for two hours I still do not understand everything that's going
on there. You are right. And I now have a solid desire and strategy to
circumnavigate the production of such problems in the future. Thank you
for the input.

Best wishes!



Re: [O] Regression - problem with links

2019-03-15 Thread Marco Wahl
Bernt Hansen  writes:

 My links are like this:


 [[https://somewebsiteaddress.net/path/to/page.do][Timekeeper]]
 [[id:eb1085ed-15fe-46a3-8b5e-3971587d1123][OTL 2019]]

 and I want to see

 [1] Timekeeper
 [2] OTL 2019

 but instead I get the address like this which is much less useable

 [1] https://somewebsiteaddress.net/path/to/page.do
 [2] id:eb1085ed-15fe-46a3-8b5e-3971587d1123

>> Last week I noticed agenda clock reports had file: text before this fix
>> and reverted back to normal looking clock reports after however the menu
>> from C-c C-o doesn't display link descriptions for me.

> My current master  is
>
> f0dc3a06d (test-org-clock: Fix one test, 2019-03-15)
>
> This may be another case that isn't covered by the fix.
> maint displays links correctly but master does not for me in the menu
> when you select a link to jump to with C-c C-o from the heading or from
> the agenda.

> 2b00d6281606ef295dadbe4ddd929ebdd6716d60 is the first bad commit

With commit 2b00d6281 I can reproduce the display of e.g.
[[https://duckduckgo.com][ddg]] as "https://duckduckgo.com;.

With commit b1429cdfe and also f0dc3a06d the link is displayed as "ddg".

Further C-c C-o, which is bound here to command org-open-at-point, on
the following heading opens the webpage as expected for commit
2b00d6281, b1429cdfe and f0dc3a06d.

#v+
* duckduckgo
[[http://duckduckgo.com][ddg]]
#v-

IOW I can't reproduce your issue AFAICS.

Is it a configuration issue?


Best regards,  Marco




[O] [PATCH] make 'org-at-date-range-p work like org-at-timestamp-p

2019-03-15 Thread Thomas Plass
Hello maintainers,

it's counter-intuitive that 'org-at-date-range-p doesn't work like
'org-at-timestamp-p when point is on the leading bracket of a range.
Witness (^ = point)

<2019-12-30 Mo 12:00>
^ (org-at-timestamp-p)=> t

<2019-12-30 Mo 12:00>--<2019-12-31 Di 09:00>
^ (org-at-timestamp-p)=> t
 ^ (org-at-date-range-p)  => t
^ (org-at-date-range-p)   => nil

Is the attached patch OK?

Regards,

Thomas


>From 11424a8a8f975148a6914ba324b7e34218fed30d Mon Sep 17 00:00:00 2001
From: Thomas Plass 
Date: Fri, 15 Mar 2019 22:56:01 +0200
Subject: [PATCH] * make 'org-at-date-range-p work like org-at-timestamp-p  
 when point is on starting bracket

---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 24e1549a2..2053ae6b7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10651,7 +10651,7 @@ on INACTIVE-OK."
   (save-excursion
 (catch 'exit
   (let ((pos (point)))
-   (skip-chars-backward "^[<\r\n")
+   (or (looking-at-p "[<[]") (skip-chars-backward "^[<\r\n"))
(skip-chars-backward "<[")
(and (looking-at (if inactive-ok org-tr-regexp-both org-tr-regexp))
 (>= (match-end 0) pos)
-- 
2.13.1.windows.2




Re: [O] [ANN] Changes to link syntax

2019-03-15 Thread Nicolas Goaziou
stardiviner  writes:

> Hi, @Nicolas, will you release a method to update all existing Org
> file links?

On second though, you may want to test the following:

  (defun org-update-link-syntax ()
"Update syntax for links in current buffer."
(org-with-point-at 1
  (let ((case-fold-search t))
(while (re-search-forward "\\[\\[[^]]*?%\\(?:2[05]\\|5[BD]\\)" nil t)
  (let ((object (save-match-data (org-element-context
(when (and (eq 'link (org-element-type object))
   (= (match-beginning 0)
  (org-element-property :begin object)))
  (goto-char (org-element-property :end object))
  (let* ((uri-start (+ 2 (match-beginning 0)))
 (uri-end (save-excursion
(goto-char uri-start)
(re-search-forward "\\][][]" nil t)
(match-beginning 0)))
 (uri (buffer-substring-no-properties uri-start uri-end))
 (start 0))
(when (catch :obsolete
(while (string-match "%\\(..\\)?" uri start)
  (setq start (match-end 0))
  (unless (member (match-string 1 uri)
  '("25" "5B" "5D" "20"))
(throw :obsolete nil)))
(y-or-n-p
 (format "Possibly obsolete URI syntax: %S.  Update?"
 uri)))
  (setf (buffer-substring uri-start uri-end)
(org-link-escape (org-link-decode uri)))




Re: [O] [ANN] Changes to link syntax

2019-03-15 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> Hi, @Nicolas, will you release a method to update all existing Org
> file links?

This is not limited to file links.

There is no method that can, with certainty, convert old syntax into the
new one. More accurately, it is possible to convert them with:

(org-link-escape (org-link-decode URI))

but in some cases, it may be difficult to tell when the URI should be
decoded in the first place.

I suggest to first try the linter on a document. Once we know it detects
with a good ratio links to convert, we can write a wrapper to also
convert them.

> I don't know which special escaped characters need to be converted.

%20, %25, %5B and %5D.

Regards,

-- 
Nicolas Goaziou