all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Felician Nemeth <felician.nemeth@gmail.com>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 69098@debbugs.gnu.org
Subject: bug#69098: [PATCH] Add new command 'browse-url-here'
Date: Tue, 13 Feb 2024 12:57:57 +0100	[thread overview]
Message-ID: <877cj8d1a2.fsf@betli.tmit.bme.hu> (raw)
In-Reply-To: <87ttmc7k0h.fsf@posteo.net> (Philip Kaludercic's message of "Tue,  13 Feb 2024 10:09:50 +0000")

Philip Kaludercic <philipk@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?

> +(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?  

> +  "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."

> +  (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".

> +    (browse-url-of-file
> +     (expand-file-name
> +      (or (and arg ".")
> +          (and (derived-mode-p 'dired-mode)
> +               (dired-get-filename))
> +          buffer-file-name ".")))))





  reply	other threads:[~2024-02-13 11:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 10:09 bug#69098: [PATCH] Add new command 'browse-url-here' Philip Kaludercic
2024-02-13 11:57 ` Felician Nemeth [this message]
2024-02-14 17:11   ` Philip Kaludercic
2024-02-18  8:41     ` Felician Nemeth
2024-02-18 12:36       ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cj8d1a2.fsf@betli.tmit.bme.hu \
    --to=felician.nemeth@gmail.com \
    --cc=69098@debbugs.gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.