emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* mailto link issue in 9.5.5 and 9.6.6
@ 2023-06-05  2:12 Scott Randby
  2023-06-05  6:00 ` Ihor Radchenko
  0 siblings, 1 reply; 15+ messages in thread
From: Scott Randby @ 2023-06-05  2:12 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I'm having a problem with mailto links. The problem occurs in Org 9.5.5 (running emacs -q) and Org 9.6.6 at least. It did not occur when I used Org 9.4.6.

I do not use Emacs for email (sorry). The documentation states that when browse-url-mailto-function is set to nil, then the setting of browse-url-browse-function will be used. That function is set to browse-url-default-browser in Org 9.5.5, and it is set to browse-url-firefox in my Org 9.6.6. However when browse-url-mailto-function is set to nil and I C-c C-o on a mailto link, I get this message: "Symbol's definition is void: nil"

How do I fix this issue? The other types of links I use (http, https, file, info) all work fine.

Scott Randby


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-05  2:12 mailto link issue in 9.5.5 and 9.6.6 Scott Randby
@ 2023-06-05  6:00 ` Ihor Radchenko
  2023-06-05 19:21   ` Scott Randby
  0 siblings, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2023-06-05  6:00 UTC (permalink / raw)
  To: Scott Randby; +Cc: emacs-orgmode

Scott Randby <srandby@gmail.com> writes:

> I do not use Emacs for email (sorry). The documentation states that when browse-url-mailto-function is set to nil, then the setting of browse-url-browse-function will be used. That function is set to browse-url-default-browser in Org 9.5.5, and it is set to browse-url-firefox in my Org 9.6.6. However when browse-url-mailto-function is set to nil and I C-c C-o on a mailto link, I get this message: "Symbol's definition is void: nil"

What will happen if you try

M-: (browse-url "mailto:your-email@blah.com") <RET>

?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-05  6:00 ` Ihor Radchenko
@ 2023-06-05 19:21   ` Scott Randby
  2023-06-05 19:48     ` Ihor Radchenko
  2023-06-06 14:30     ` Max Nikulin
  0 siblings, 2 replies; 15+ messages in thread
From: Scott Randby @ 2023-06-05 19:21 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

On 6/5/23 02:00, Ihor Radchenko wrote:
> What will happen if you try
> 
> M-: (browse-url"mailto:your-email@blah.com") <RET>
> 
> ?

I get this: Symbol's function definition is void: nil

When I execute (browse-url "mailto:srandby@gmail.com") in the *scratch* buffer, I get the following:

Debugger entered--Lisp error: (void-function nil)
   nil("mailto:srandby@gmail.com" (nil))
   browse-url--mailto("mailto:srandby@gmail.com" nil)
   apply(browse-url--mailto "mailto:srandby@gmail.com" nil)
   browse-url("mailto:srandby@gmail.com")
   (progn (browse-url "mailto:srandby@gmail.com"))
   eval((progn (browse-url "mailto:srandby@gmail.com")) t)
   elisp--eval-last-sexp(nil)
   eval-last-sexp(nil)
   funcall-interactively(eval-last-sexp nil)
   call-interactively(eval-last-sexp nil nil)
   command-execute(eval-last-sexp)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-05 19:21   ` Scott Randby
@ 2023-06-05 19:48     ` Ihor Radchenko
  2023-06-05 21:40       ` Scott Randby
  2023-06-06 14:30     ` Max Nikulin
  1 sibling, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2023-06-05 19:48 UTC (permalink / raw)
  To: Scott Randby; +Cc: emacs-orgmode

Scott Randby <srandby@gmail.com> writes:

> When I execute (browse-url "mailto:srandby@gmail.com") in the *scratch* buffer, I get the following:
>
> Debugger entered--Lisp error: (void-function nil)
>    nil("mailto:srandby@gmail.com" (nil))
>    browse-url--mailto("mailto:srandby@gmail.com" nil)
>    apply(browse-url--mailto "mailto:srandby@gmail.com" nil)
>    browse-url("mailto:srandby@gmail.com")

Then, it looks like mis-configured `browse-url'.
Check your configuration.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-05 19:48     ` Ihor Radchenko
@ 2023-06-05 21:40       ` Scott Randby
  2023-06-06  6:05         ` Ihor Radchenko
  0 siblings, 1 reply; 15+ messages in thread
From: Scott Randby @ 2023-06-05 21:40 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode



On 6/5/23 15:48, Ihor Radchenko wrote:
> Scott Randby <srandby@gmail.com> writes:
> 
>> When I execute (browse-url "mailto:srandby@gmail.com") in the *scratch* buffer, I get the following:
>>
>> Debugger entered--Lisp error: (void-function nil)
>>     nil("mailto:srandby@gmail.com" (nil))
>>     browse-url--mailto("mailto:srandby@gmail.com" nil)
>>     apply(browse-url--mailto "mailto:srandby@gmail.com" nil)
>>     browse-url("mailto:srandby@gmail.com")
> 
> Then, it looks like mis-configured `browse-url'.
> Check your configuration.
> 

Here are some steps I tried following your advice.

(1) I eliminated all customizations that involved `browse-url' from my configuration and restarted Emacs (Emacs 28.2, Org 9.6.6).

(2) I executed (browse-url "mailto:srandby@gmail.com") and the buffer to edit an email appeared.

(3) I executed (browse-url "https://orgmode.org/") and the Org Mode site opened in Firefox.

(4) I executed (customize-set-variable 'browse-url-mailto-function nil) and then executed (browse-url "mailto:srandby@gmail.com"). The result gave the same error messages.

(5) I quit Emacs and ran `emacs -q' (Emacs 28.2, Org 9.5.5).

(6) I executed (browse-url "mailto:srandby@gmail.com") and the buffer to edit an email appeared.

(7) I executed (browse-url "https://orgmode.org/") and the Org Mode site opened in Firefox.

(8) I executed (customize-set-variable 'browse-url-mailto-function nil) and then executed (browse-url "mailto:srandby@gmail.com"). The result gave the same error messages.

I'm not sure how my configuration can be at fault when `emacs -q' gives the same result. I'm not sure what to do now.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-05 21:40       ` Scott Randby
@ 2023-06-06  6:05         ` Ihor Radchenko
  2023-06-06 15:00           ` Scott Randby
  0 siblings, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2023-06-06  6:05 UTC (permalink / raw)
  To: Scott Randby; +Cc: emacs-orgmode

Scott Randby <srandby@gmail.com> writes:

> (4) I executed (customize-set-variable 'browse-url-mailto-function nil) and then executed (browse-url "mailto:srandby@gmail.com"). The result gave the same error messages.

This sounds like Emacs bug, and I can reproduce. Please report it to
Emacs devs. (M-x report-emacs-bug)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-05 19:21   ` Scott Randby
  2023-06-05 19:48     ` Ihor Radchenko
@ 2023-06-06 14:30     ` Max Nikulin
  2023-06-06 14:49       ` Scott Randby
  2023-06-07 12:56       ` Ihor Radchenko
  1 sibling, 2 replies; 15+ messages in thread
From: Max Nikulin @ 2023-06-06 14:30 UTC (permalink / raw)
  To: Scott Randby, emacs-orgmode

On 06/06/2023 02:21, Scott Randby wrote:
> 
> Debugger entered--Lisp error: (void-function nil)
>    nil("mailto:srandby@gmail.com" (nil))
>    browse-url--mailto("mailto:srandby@gmail.com" nil)
>    apply(browse-url--mailto "mailto:srandby@gmail.com" nil)
>    browse-url("mailto:srandby@gmail.com")

Try to set `browse-url-mailto-function' to `browse-url-default-browser'.

It seems https://orgmode.org/worg/org-faq.html#mailto-links requires an 
update for Emacs-28 (besides a typo with "~" instead of "-").


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-06 14:30     ` Max Nikulin
@ 2023-06-06 14:49       ` Scott Randby
  2023-06-09 15:47         ` Max Nikulin
  2023-06-07 12:56       ` Ihor Radchenko
  1 sibling, 1 reply; 15+ messages in thread
From: Scott Randby @ 2023-06-06 14:49 UTC (permalink / raw)
  To: emacs-orgmode

On 6/6/23 10:30, Max Nikulin wrote:
> 
> Try to set `browse-url-mailto-function' to `browse-url-default-browser'.
> 

I tried that yesterday and it didn't work.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-06  6:05         ` Ihor Radchenko
@ 2023-06-06 15:00           ` Scott Randby
  0 siblings, 0 replies; 15+ messages in thread
From: Scott Randby @ 2023-06-06 15:00 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

On 6/6/23 02:05, Ihor Radchenko wrote:
> Scott Randby <srandby@gmail.com> writes:
> 
>> (4) I executed (customize-set-variable 'browse-url-mailto-function nil) and then executed (browse-url "mailto:srandby@gmail.com"). The result gave the same error messages.
> 
> This sounds like Emacs bug, and I can reproduce. Please report it to
> Emacs devs. (M-x report-emacs-bug)
> 

I agree, I've looked through the code of browse-url.el in 28.2 and 27.2 (where it works) but I can't find the problem because my understanding of Elisp is primitive. I've never reported an Emacs bug before, but I will try.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-06 14:30     ` Max Nikulin
  2023-06-06 14:49       ` Scott Randby
@ 2023-06-07 12:56       ` Ihor Radchenko
  2023-06-08 15:47         ` Max Nikulin
  1 sibling, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2023-06-07 12:56 UTC (permalink / raw)
  To: Max Nikulin; +Cc: Scott Randby, emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

> It seems https://orgmode.org/worg/org-faq.html#mailto-links requires an 
> update for Emacs-28 (besides a typo with "~" instead of "-").

May you elaborate? (Or, better, send a patch)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-07 12:56       ` Ihor Radchenko
@ 2023-06-08 15:47         ` Max Nikulin
  2023-06-08 18:28           ` Scott Randby
  2023-06-09  9:19           ` Ihor Radchenko
  0 siblings, 2 replies; 15+ messages in thread
From: Max Nikulin @ 2023-06-08 15:47 UTC (permalink / raw)
  To: emacs-orgmode

On 07/06/2023 19:56, Ihor Radchenko wrote:
> Max Nikulin <manikulin@gmail.com> writes:
> 
>> It seems https://orgmode.org/worg/org-faq.html#mailto-links requires an
>> update for Emacs-28 (besides a typo with "~" instead of "-").
> 
> May you elaborate? (Or, better, send a patch)

The typo in https://orgmode.org/worg/org-faq.html#mailto-links

browse-url~browser-function
----------^

Looking at 
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c4adfbae24d9
Allow for custom URL handlers in browse-url.
(included into Emacs-28)

> +(defun browse-url--mailto (url &rest args)
> +  "Calls `browse-url-mailto-function' with URL and ARGS."
> +  (funcall browse-url-mailto-function url args))

I decided that it is consistent with

>    nil("mailto:srandby@gmail.com" (nil))
>    browse-url--mailto("mailto:srandby@gmail.com" nil)

when `browse-url-mailto-function' is set to nil. However docstring to 
this variable allows nil (perhaps there is really an Emacs bug). Now I 
am puzzled why setting `browse-url-mailto-function' to 
`browse-url-default-browser' does not help. I have no idea what should 
be suggested to users instead of nil.







^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-08 15:47         ` Max Nikulin
@ 2023-06-08 18:28           ` Scott Randby
  2023-06-09  9:19           ` Ihor Radchenko
  1 sibling, 0 replies; 15+ messages in thread
From: Scott Randby @ 2023-06-08 18:28 UTC (permalink / raw)
  To: emacs-orgmode

On 6/8/23 11:47, Max Nikulin wrote:
> I decided that it is consistent with
> 
>>    nil("mailto:srandby@gmail.com" (nil))
>>    browse-url--mailto("mailto:srandby@gmail.com" nil)
> 
> when `browse-url-mailto-function' is set to nil. However docstring to this variable allows nil (perhaps there is really an Emacs bug). Now I am puzzled why setting `browse-url-mailto-function' to `browse-url-default-browser' does not help. I have no idea what should be suggested to users instead of nil.
> 
> 

I've spent some time looking through the code of browse-url.el, and I've been unable to alter its code so that setting `browse-url-mailto-function' to `browse-url-default-browser' works. But my grasp of Elisp is not good. I'm going to make a detailed bug report as soon as I can find the time to make it.

Scott Randby


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-08 15:47         ` Max Nikulin
  2023-06-08 18:28           ` Scott Randby
@ 2023-06-09  9:19           ` Ihor Radchenko
  2023-06-09 15:58             ` Max Nikulin
  1 sibling, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2023-06-09  9:19 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

Max Nikulin <manikulin@gmail.com> writes:

>> May you elaborate? (Or, better, send a patch)
>
> The typo in https://orgmode.org/worg/org-faq.html#mailto-links
>
> browse-url~browser-function
> ----------^

Fixed.
https://git.sr.ht/~bzg/worg/commit/60bed811

> Looking at 
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c4adfbae24d9
> Allow for custom URL handlers in browse-url.
> (included into Emacs-28)
>
>> +(defun browse-url--mailto (url &rest args)
>> +  "Calls `browse-url-mailto-function' with URL and ARGS."
>> +  (funcall browse-url-mailto-function url args))
>
> I decided that it is consistent with
>
>>    nil("mailto:srandby@gmail.com" (nil))
>>    browse-url--mailto("mailto:srandby@gmail.com" nil)
>
> when `browse-url-mailto-function' is set to nil. However docstring to 
> this variable allows nil (perhaps there is really an Emacs bug). Now I 
> am puzzled why setting `browse-url-mailto-function' to 
> `browse-url-default-browser' does not help. I have no idea what should 
> be suggested to users instead of nil.

This is Emacs bug that should be reported.
I do not think that we need to document every workaround for Emacs bugs.
Especially given that Emacs 29 is just around the corner.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-06 14:49       ` Scott Randby
@ 2023-06-09 15:47         ` Max Nikulin
  0 siblings, 0 replies; 15+ messages in thread
From: Max Nikulin @ 2023-06-09 15:47 UTC (permalink / raw)
  To: emacs-orgmode

On 06/06/2023 21:49, Scott Randby wrote:
> On 6/6/23 10:30, Max Nikulin wrote:
>>
>> Try to set `browse-url-mailto-function' to `browse-url-default-browser'.
> 
> I tried that yesterday and it didn't work.

It is strange taking into account `browse-url-default-handlers'. I am 
curious what happens in response to

     (browse-url-default-browser "mailto:srandby@gmail.com")



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: mailto link issue in 9.5.5 and 9.6.6
  2023-06-09  9:19           ` Ihor Radchenko
@ 2023-06-09 15:58             ` Max Nikulin
  0 siblings, 0 replies; 15+ messages in thread
From: Max Nikulin @ 2023-06-09 15:58 UTC (permalink / raw)
  To: emacs-orgmode

On 09/06/2023 16:19, Ihor Radchenko wrote:
> Max Nikulin writes:
>> browse-url~browser-function
> 
> Fixed. https://git.sr.ht/~bzg/worg/commit/60bed811

Thanks

>>>     nil("mailto:srandby@gmail.com" (nil))
>>
>> when `browse-url-mailto-function' is set to nil. However docstring to
>> this variable allows nil (perhaps there is really an Emacs bug). Now I
>> am puzzled why setting `browse-url-mailto-function' to
>> `browse-url-default-browser' does not help. I have no idea what should
>> be suggested to users instead of nil.
> 
> This is Emacs bug that should be reported.
> I do not think that we need to document every workaround for Emacs bugs.
> Especially given that Emacs 29 is just around the corner.

Debian bookworm (that is about to be released) has Emacs-28.

It is preferable to have a link clearly describing a workaround, at 
least to a specific comment at debbugs. However I believe, it is better 
to describe a recipe in Org FAQ and to retain users from customizing 
`org-link-parameters' if no web page may be suggested instead.

Anyway we do not have a workaround yet.




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-06-09 15:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-05  2:12 mailto link issue in 9.5.5 and 9.6.6 Scott Randby
2023-06-05  6:00 ` Ihor Radchenko
2023-06-05 19:21   ` Scott Randby
2023-06-05 19:48     ` Ihor Radchenko
2023-06-05 21:40       ` Scott Randby
2023-06-06  6:05         ` Ihor Radchenko
2023-06-06 15:00           ` Scott Randby
2023-06-06 14:30     ` Max Nikulin
2023-06-06 14:49       ` Scott Randby
2023-06-09 15:47         ` Max Nikulin
2023-06-07 12:56       ` Ihor Radchenko
2023-06-08 15:47         ` Max Nikulin
2023-06-08 18:28           ` Scott Randby
2023-06-09  9:19           ` Ihor Radchenko
2023-06-09 15:58             ` Max Nikulin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).