unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: emacs-devel@gnu.org
Subject: insert-phone
Date: Wed, 21 Sep 2022 06:50:43 +0200	[thread overview]
Message-ID: <87r105ib4s.fsf@dataswamp.org> (raw)

Let's see if any bots starts sending me SMS now ...

Maybe the phone number should have a variable as well and not
be hard-coded ...

(defun insert-mail (&optional delim)
  (interactive "P")
  (pcase-let ((`(,delim-beg ,delim-end) (if delim '("<" ">") '("" ""))))
    (insert (format "%s%s%s" delim-beg user-mail-address delim-end)) ))
;; (insert-mail)   ;  incal@dataswamp.org
;; (insert-mail t) ; <incal@dataswamp.org>

(defun insert-phone (&optional world)
  "WORLD format according to ITU-T E.123,
  https://www.itu.int/rec/T-REC-E.123-200102-I

Sweden phone number practices,
  https://dataswamp.org/~incal/phone/swedish-phone-numbers.txt"
  (interactive "P")
  (let ((form (if world
                  "+46 %d%d %d%d%d %d%d %d%d"
                "0%d%d-%d%d%d %d%d %d%d") ))
    (insert (format form 7 2 9 4 6 2 0 2 6)) ))
;; (insert-phone)   ;    072-946 20 26
;; (insert-phone t) ; +46 72 946 20 26

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




                 reply	other threads:[~2022-09-21  4:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87r105ib4s.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=emacs-devel@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).