From: Leo <sdl.web@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Noah Friedman <friedman+savannah@splode.com>, emacs-devel@gnu.org
Subject: Re: Include vCard.el
Date: Tue, 13 Nov 2007 21:52:33 +0000 [thread overview]
Message-ID: <m3ejetu82m.fsf@cam.ac.uk> (raw)
In-Reply-To: <jwv3avrkviq.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 31 Oct 2007 14:20:19 -0400")
On 2007-10-31 18:20 +0000, Stefan Monnier wrote:
>> (defgroup vcard nil
>> "Support for the vCard electronic business card format."
>> :group 'vcard
>
> Don't put the group within itself.
>
>> ;; This is used by vcard-region-decode-base64
>
> Why not use base64-decode-region?
>
>> (save-excursion
>> (set-buffer buf)
>
> Please use with-current-buffer.
>
>> (kill-buffer buf))
>
> You can use with-temp-buffer rather than
> generate-new-buffer+unwind-protect+with-current-buffer+kill-buffer.
>
>> (goto-char (point-min))
>> (while (re-search-forward vcard-regexp-begin-vcard nil t)
>> (let ((vcard-data nil))
>> (set-marker pos (point))
>> (while (and (not (looking-at vcard-regexp-end-vcard))
>> (re-search-forward ":[ \t]*" nil t))
>> (set-marker newpos (match-end 0))
>> (setq properties
>> (vcard-parse-region-properties pos (match-beginning 0)))
>> (set-marker pos (marker-position newpos))
>> (re-search-forward "[ \t]*\n")
>> (set-marker newpos (match-end 0))
>> (setq value
>> (vcard-parse-region-value properties pos (match-beginning 0)))
>> (set-marker pos (marker-position newpos))
>> (goto-char pos)
>> (funcall filter properties value)
>> (setq vcard-data (cons (cons properties value) vcard-data)))
>> (setq vcard-list-data (cons (nreverse vcard-data) vcard-list-data))))))
>> (nreverse vcard-list-data)))
>
> AFAICT your code doesn't modify the buffer, so there's no need for markers.
> E.g. you can just replace (set-marker newpos (match-end 0))
> with (setq pos (match-end 0)).
>
>> (defun vcard-split-string (string &optional separator limit)
>
> Why not use split-string?
>
>
> Stefan
I have included the author of vcard.el in the list.
--
.: Leo :. [ sdl.web AT gmail.com ] .: [ GPG Key: 9283AA3F ] :.
Use the best OS -- http://www.fedoraproject.org/
next prev parent reply other threads:[~2007-11-13 21:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 12:48 Include vCard.el Leo
2007-10-31 18:20 ` Stefan Monnier
2007-11-13 21:52 ` Leo [this message]
2007-11-01 7:32 ` Richard Stallman
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=m3ejetu82m.fsf@cam.ac.uk \
--to=sdl.web@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=friedman+savannah@splode.com \
--cc=monnier@iro.umontreal.ca \
/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).