unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* insert-phone
@ 2022-09-21  4:50 Emanuel Berg
  0 siblings, 0 replies; only message in thread
From: Emanuel Berg @ 2022-09-21  4:50 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-21  4:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21  4:50 insert-phone Emanuel Berg

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).