Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-09 Thread Max Nikulin

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:sran...@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.





Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-09 Thread Max Nikulin

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:sran...@gmail.com;)




Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-09 Thread Ihor Radchenko
Max Nikulin  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  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:sran...@gmail.com; (nil))
>>browse-url--mailto("mailto:sran...@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 .
Support Org development at ,
or support my work at 



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-08 Thread Scott Randby

On 6/8/23 11:47, Max Nikulin wrote:

I decided that it is consistent with


   nil("mailto:sran...@gmail.com; (nil))
   browse-url--mailto("mailto:sran...@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



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-08 Thread Max Nikulin

On 07/06/2023 19:56, Ihor Radchenko wrote:

Max Nikulin  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  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:sran...@gmail.com; (nil))
   browse-url--mailto("mailto:sran...@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.









Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-07 Thread Ihor Radchenko
Max Nikulin  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 .
Support Org development at ,
or support my work at 



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-06 Thread Scott Randby

On 6/6/23 02:05, Ihor Radchenko wrote:

Scott Randby  writes:


(4) I executed (customize-set-variable 'browse-url-mailto-function nil) and then executed 
(browse-url "mailto:sran...@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.



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-06 Thread Scott Randby

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.



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-06 Thread Max Nikulin

On 06/06/2023 02:21, Scott Randby wrote:


Debugger entered--Lisp error: (void-function nil)
   nil("mailto:sran...@gmail.com; (nil))
   browse-url--mailto("mailto:sran...@gmail.com; nil)
   apply(browse-url--mailto "mailto:sran...@gmail.com; nil)
   browse-url("mailto:sran...@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 "-").




Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-06 Thread Ihor Radchenko
Scott Randby  writes:

> (4) I executed (customize-set-variable 'browse-url-mailto-function nil) and 
> then executed (browse-url "mailto:sran...@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 .
Support Org development at ,
or support my work at 



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-05 Thread Scott Randby




On 6/5/23 15:48, Ihor Radchenko wrote:

Scott Randby  writes:


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

Debugger entered--Lisp error: (void-function nil)
nil("mailto:sran...@gmail.com; (nil))
browse-url--mailto("mailto:sran...@gmail.com; nil)
apply(browse-url--mailto "mailto:sran...@gmail.com; nil)
browse-url("mailto:sran...@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:sran...@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:sran...@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:sran...@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:sran...@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.



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-05 Thread Ihor Radchenko
Scott Randby  writes:

> When I execute (browse-url "mailto:sran...@gmail.com;) in the *scratch* 
> buffer, I get the following:
>
> Debugger entered--Lisp error: (void-function nil)
>nil("mailto:sran...@gmail.com; (nil))
>browse-url--mailto("mailto:sran...@gmail.com; nil)
>apply(browse-url--mailto "mailto:sran...@gmail.com; nil)
>browse-url("mailto:sran...@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 .
Support Org development at ,
or support my work at 



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-05 Thread Scott Randby

On 6/5/23 02:00, Ihor Radchenko wrote:

What will happen if you try

M-: (browse-url"mailto:your-em...@blah.com;) 

?


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

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

Debugger entered--Lisp error: (void-function nil)
  nil("mailto:sran...@gmail.com; (nil))
  browse-url--mailto("mailto:sran...@gmail.com; nil)
  apply(browse-url--mailto "mailto:sran...@gmail.com; nil)
  browse-url("mailto:sran...@gmail.com;)
  (progn (browse-url "mailto:sran...@gmail.com;))
  eval((progn (browse-url "mailto:sran...@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)



Re: mailto link issue in 9.5.5 and 9.6.6

2023-06-04 Thread Ihor Radchenko
Scott Randby  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-em...@blah.com;) 

?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at