unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45417: 28.0.50; vcard-parse-buffer only parses single card
@ 2020-12-25  6:30 dalanicolai
  2020-12-25 22:18 ` Lars Ingebrigtsen
  2020-12-26  5:44 ` Eric Abrahamsen
  0 siblings, 2 replies; 6+ messages in thread
From: dalanicolai @ 2020-12-25  6:30 UTC (permalink / raw)
  To: 45417

[-- Attachment #1: Type: text/plain, Size: 4008 bytes --]

 Install vcard via list-packages.
Insert following lines (vcard file example, from google contacts export)
in a buffer:

BEGIN:VCARD
VERSION:3.0
TEL;TYPE=CELL:+00 000 00 00 00
CATEGORIES:myContacts
end:VCARD
BEGIN:VCARD
VERSION:3.0
TEL;TYPE=WORK:000 000 0000
CATEGORIES:myContacts
END:VCARD

in the buffer evaluate (M-:): (vcard-parse-buffer)

it will stop after the first card.

SOLUTION: in the function `vcard-parse-buffer`, (line-end-position 2)
should be replaced by (+ (line-end-position 2) 1)



In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23,
cairo version 1.16.0)
of 2020-12-21 built on daniel-Ubuntu
Repository revision: faf3613cba8571eaef2709bd7bb6f11a956b9262
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12009000
System Description: Ubuntu 20.10

Configured using:
'configure --with-imagemagick --with-cairo --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS GSETTINGS
GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ
M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES
THREADS LIBSYSTEMD PDUMPER LCMS2

Important settings:
  value of $LC_MONETARY: nl_NL.UTF-8
  value of $LC_NUMERIC: nl_NL.UTF-8
  value of $LC_TIME: nl_NL.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: vCard

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail vcard-parse vcard iso8601
compile comint ansi-color ring autoload radix-tree lisp-mnt tar-mode
arc-mode archive-mode cus-edit pp cus-start cus-load wid-edit misearch
multi-isearch mm-archive message dired dired-loaddefs rfc822 mml mml-sec
epa derived gnus-util rmail rmail-loaddefs text-property-search
time-date mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode
mail-utils mule-util gnutls network-stream url-http mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm rmc puny
url-cache url-auth epg epg-config finder-inf package easymenu browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 215914 19596)
(symbols 48 11177 1)
(strings 32 41500 2179)
(string-bytes 1 1277285)
(vectors 16 19501)
(vector-slots 8 250240 21585)
(floats 8 35 226)
(intervals 56 24166 107)
(buffers 984 17))

[-- Attachment #2: Type: text/html, Size: 4874 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45417: 28.0.50; vcard-parse-buffer only parses single card
  2020-12-25  6:30 bug#45417: 28.0.50; vcard-parse-buffer only parses single card dalanicolai
@ 2020-12-25 22:18 ` Lars Ingebrigtsen
  2020-12-26  5:47   ` Eric Abrahamsen
  2020-12-26  5:44 ` Eric Abrahamsen
  1 sibling, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-25 22:18 UTC (permalink / raw)
  To: dalanicolai; +Cc: 45417

dalanicolai <dalanicolai@gmail.com> writes:

> SOLUTION: in the function `vcard-parse-buffer`, (line-end-position 2) 
> should be replaced by (+ (line-end-position 2) 1) 

I've now done something similar to your suggested fix.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45417: 28.0.50; vcard-parse-buffer only parses single card
  2020-12-25  6:30 bug#45417: 28.0.50; vcard-parse-buffer only parses single card dalanicolai
  2020-12-25 22:18 ` Lars Ingebrigtsen
@ 2020-12-26  5:44 ` Eric Abrahamsen
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2020-12-26  5:44 UTC (permalink / raw)
  To: dalanicolai; +Cc: 45417

dalanicolai <dalanicolai@gmail.com> writes:

>  Install vcard via list-packages.
> Insert following lines (vcard file example, from google contacts export)
> in a buffer:
>
> BEGIN:VCARD
> VERSION:3.0
> TEL;TYPE=CELL:+00 000 00 00 00
> CATEGORIES:myContacts
> end:VCARD
> BEGIN:VCARD
> VERSION:3.0
> TEL;TYPE=WORK:000 000 0000
> CATEGORIES:myContacts
> END:VCARD
>
> in the buffer evaluate (M-:): (vcard-parse-buffer)
>
> it will stop after the first card.
>
> SOLUTION: in the function `vcard-parse-buffer`, (line-end-position 2)
> should be replaced by (+ (line-end-position 2) 1)

Whoops! I've been running with a few local patches and didn't realize
I hadn't committed this fix. `vcard-parse-card' was supposed to end with
a final `forward-line', to get past the "END:VCARD" line, and I'll push
version 0.1.1 with this change in a moment.

I'm glad someone's actually using this library! Please feel free to
report further bugs and feature requests, and maybe cc me if you do.

In particular I'm trying to decide how useful it actually is to provide
`vcard-parse-(property|card)-consumer-function' options, and I would be
interested to hear opinions about this. I'm also planning on
re-implementing parsing using syntax tables, which I hope will make it
faster.

Thanks,
Eric





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45417: 28.0.50; vcard-parse-buffer only parses single card
  2020-12-25 22:18 ` Lars Ingebrigtsen
@ 2020-12-26  5:47   ` Eric Abrahamsen
  2020-12-26  5:52     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2020-12-26  5:47 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: dalanicolai, 45417

Lars Ingebrigtsen <larsi@gnus.org> writes:

> dalanicolai <dalanicolai@gmail.com> writes:
>
>> SOLUTION: in the function `vcard-parse-buffer`, (line-end-position 2) 
>> should be replaced by (+ (line-end-position 2) 1) 
>
> I've now done something similar to your suggested fix.

Oh, I replied before refreshing. If you don't mind, I'd prefer the
forward-line fix.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45417: 28.0.50; vcard-parse-buffer only parses single card
  2020-12-26  5:47   ` Eric Abrahamsen
@ 2020-12-26  5:52     ` Lars Ingebrigtsen
  2020-12-26 13:09       ` dalanicolai
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-26  5:52 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: dalanicolai, 45417

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Oh, I replied before refreshing. If you don't mind, I'd prefer the
> forward-line fix.

Sure, go ahead.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45417: 28.0.50; vcard-parse-buffer only parses single card
  2020-12-26  5:52     ` Lars Ingebrigtsen
@ 2020-12-26 13:09       ` dalanicolai
  0 siblings, 0 replies; 6+ messages in thread
From: dalanicolai @ 2020-12-26 13:09 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Eric Abrahamsen, 45417

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

Thanks guys

On Sat, 26 Dec 2020 at 06:52, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
> > Oh, I replied before refreshing. If you don't mind, I'd prefer the
> > forward-line fix.
>
> Sure, go ahead.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

[-- Attachment #2: Type: text/html, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-26 13:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-25  6:30 bug#45417: 28.0.50; vcard-parse-buffer only parses single card dalanicolai
2020-12-25 22:18 ` Lars Ingebrigtsen
2020-12-26  5:47   ` Eric Abrahamsen
2020-12-26  5:52     ` Lars Ingebrigtsen
2020-12-26 13:09       ` dalanicolai
2020-12-26  5:44 ` Eric Abrahamsen

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