GNU bug report logs - #69098
[PATCH] Add new command 'browse-url-here'

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Tue, 13 Feb 2024 10:11:02 UTC

Severity: wishlist

Tags: patch

Full log


Message #11 received at 69098 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Felician Nemeth <felician.nemeth <at> gmail.com>
Cc: 69098 <at> debbugs.gnu.org
Subject: Re: bug#69098: [PATCH] Add new command 'browse-url-here'
Date: Wed, 14 Feb 2024 17:11:35 +0000
[Message part 1 (text/plain, inline)]
Felician Nemeth <felician.nemeth <at> gmail.com> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> The idea is to have a command that can be used to open a file or
>> directory using something outside Emacs.
>>
>> I find this useful, but it might be that there are edge-cases that I am
>> not considering that don't pop up on my system.
>
> Shouldn't it do something when the buffer is modified?

A warning is generated by `browse-url-of-file'.

>> +(defun browse-url-here (arg)
>
> Since browse-url-of-buffer does something similar, the name could be
> more descriptive.   Maybe browse-url-of-buffer-external?  

I like that name, used it.

>> +  "Open current file or directory with external tools.
>> +With prefix argument ARG, open the current `default-directory' instead
>> +of the buffer of the current file."
>
> "the file of the current buffer."

Done, thanks.

>> +  (interactive "P")
>> +  (let ((browse-url-default-handlers '()))
>
> This is strange.  There are other ways to use an external browser-kind.
> Maybe you could use browse-url-secondary-browser-function, which is
> "usually an external browser".

The thing is if `browse-url-default-handlers' includes

  (browse-url--non-html-file-url-p . browse-url-emacs)

then this catches all the requests and the file is always opened in
Emacs.  In this patch I try to only filter out these entries that would
open the file in Emacs:

[0001-Add-new-command-browse-url-of-buffer-external.patch (text/x-patch, attachment)]

This bug report was last modified 126 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.