all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Strey <mstrey@strey.biz>
To: emacs-orgmode@gnu.org
Cc: Robert Goldman <rpgoldman@sift.info>
Subject: Re: phone links...
Date: Thu, 4 Apr 2013 15:55:46 +0200	[thread overview]
Message-ID: <20130404135546.GE3245@strey.biz> (raw)
In-Reply-To: <20130404082653.GD3245@strey.biz>

On Thu, Apr 04, 2013 at 10:26:53AM +0200, Michael Strey wrote:

[...]

> Usually my phone links look like [[tel:+49 351 4129535]]; but since I
> imported data sets from a larger contact data base that had evolved over
> time, I ended up with stuff like this in my data base:
> 1. [[tel:0033 (0) 4568-33]]
> 2. [[tel:+49 (0)3 8899 66]]
> 3. [[tel:0351 41295-35]]
> 4. [[tel:0351/4129535]]
> 5. [[tel:(0351) 412 95-35]]
> 
> My filter function currently handles the cases 1. to 4. but (for no
> other reason than carelessness) not 5.

[...]

Here is a re-work of the filter function that handles all off the above
cases correctly.

#+BEGIN_SRC emacs-lisp
(defun trim-phone-number (phonenumber)
  "Remove whitespaces from a telephone number"
  (setq trimmed_phonenumber
     (mapconcat 'identity
        (split-string
        (mapconcat 'identity
		   (split-string phonenumber "(0)") "") "[()/ -]") "")))
#+END_SRC

I'm a Elisp newbie.  I'm sure that there are smarter solutions to solve this
problem.

Regards
-- 
Michael Strey 
www.strey.biz

  reply	other threads:[~2013-04-04 13:56 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-29 23:23 phone links Robert Goldman
2013-03-30  9:12 ` Karl Voit
2013-04-01 13:30 ` Robert Goldman
2013-04-03 14:52 ` Michael Strey
2013-04-03 15:05   ` Robert Goldman
2013-04-04  8:26     ` Michael Strey
2013-04-04 13:55       ` Michael Strey [this message]
2013-04-04 12:15 ` Bastien
2013-04-04 20:38   ` Simon Thum
2013-04-05  3:04     ` Robert P. Goldman
2013-04-05  6:42     ` Bastien
2013-04-06 12:05       ` Simon Thum
2013-04-06 12:10       ` Simon Thum
2013-04-06 20:58         ` Bastien
2013-04-05  2:38   ` Robert P. Goldman
2013-04-08 10:38     ` Michael Strey
2013-04-08 12:47       ` Robert Goldman
2013-04-08 14:07         ` Michael Strey
2013-04-08 14:44           ` Robert Goldman
2013-04-09  7:31             ` Michael Strey
2013-04-09 12:19               ` Robert Goldman
2013-04-09 14:40                 ` Michael Strey
2013-04-13 14:12               ` Feng Shu
2013-04-13 14:43                 ` Feng Shu
2013-04-14  8:38                   ` Bastien
2013-04-14 14:31                     ` Feng Shu
2013-04-15 15:39                       ` Bastien
2013-04-15 23:37                         ` Feng Shu
2013-04-16 21:11                       ` Daimrod
2013-04-17  3:55                         ` Feng Shu
2013-04-17  6:10                           ` Daimrod
2013-04-14 20:49               ` Michael Strey
2013-04-16 22:22                 ` Daimrod
2013-04-17 10:28                   ` Michael Strey
2013-04-20 15:59                     ` Daimrod
2013-04-26 12:48                       ` [Patch] " Michael Strey
2013-04-30  9:09                         ` Daimrod
2013-05-31  0:04                         ` Daimrod
2013-04-09  9:57       ` Feng Shu
2013-04-10 14:17 ` Michael Strey
2013-04-11 10:27   ` Michael Strey
2013-04-16  7:57     ` Eric S Fraga
2013-04-16 12:25       ` Robert P. Goldman
2013-04-17  8:14         ` Michael Strey

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=20130404135546.GE3245@strey.biz \
    --to=mstrey@strey.biz \
    --cc=emacs-orgmode@gnu.org \
    --cc=rpgoldman@sift.info \
    /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.