all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Is there something like `file-name-concat', but for urls?
Date: Wed, 26 Jul 2023 14:44:11 +0200	[thread overview]
Message-ID: <87mszix2p0.fsf@dataswamp.org> (raw)
In-Reply-To: CAP_d_8Vp_sBwrjBcbZ47DQyFsSW5KFRCBMTe_ED=bgDccXdtYg@mail.gmail.com

Here is how to do it in Emacs.

If you read the docstring for `url-generic-parse-url', you see
that it is based on RFC 3986, even.

Don't mention it ...

;;; -*- lexical-binding: t -*-
;;
;; this file:
;;   https://dataswamp.org/~incal/emacs-init/misc.el

(require 'cl-lib)
(require 'url-parse)

(defun valid-url (url)
  (let ((data (url-generic-parse-url url)))
    (when (cl-struct-slot-value 'url 'type data)
      t) ))

;; (valid-url "https://dataswamp.org/~incal/") ; t
;; (valid-url "dataswamp.org/~incal/")         ; nil

-- 
underground experts united
https://dataswamp.org/~incal




      parent reply	other threads:[~2023-07-26 12:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24  5:14 Is there something like `file-name-concat', but for urls? Marcin Borkowski
2023-07-24 11:58 ` Eli Zaretskii
2023-07-24 15:26   ` Marcin Borkowski
2023-07-25 16:21 ` Emanuel Berg
2023-07-25 17:24   ` tomas
2023-07-25 18:33     ` Emanuel Berg
2023-07-26  4:34       ` tomas
2023-07-26 12:13         ` Emanuel Berg
2023-07-25 19:00     ` Marcin Borkowski
2023-07-25 19:07       ` Emanuel Berg
2023-07-25 19:38         ` Emanuel Berg
2023-07-25 17:35   ` Yuri Khan
2023-07-25 18:23     ` Emanuel Berg
2023-07-25 20:01       ` Yuri Khan
2023-07-25 21:51         ` Emanuel Berg
2023-07-26 12:44         ` Emanuel Berg [this message]

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=87mszix2p0.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.