bug#38918: 26.3; EBDB fails to edit (add) tags

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Jorge P. de Morais Neto
 0x8000078ebdb<return><return>eE
Hello.  I use the latest EBDB (0.6.11) on an updated Spacemacs (develop
branch) atop GNU Emacs 26.3 on an updated Debian buster.  Emacs was
installed via GNU Guix.

I cannot add tags to EBDB records.  To help you with reproducing the
bug, I reproduced it on a GNU Emacs configuration where the only
customization was augmenting `package-archives' (which I later realized
was unnecessary) and installing `ebdb'.  I also used a minimal EBDB
database.  I then inserted a tags field in one record; EBDB did not ask
for the contents of the field, so an empty tags field was inserted.

Then I restarted Emacs, invoked `toggle-debug-on-error', opened the
dribble file and quickly reproduced the bug:

1. Invoke M-x ebdb; <RET><RET>;
2. Move to the tags field; press e (Emacs says "Point not in field");
3. Return to the tags field; press E (a backtrace is shown).

The backtrace shown after pressing E:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (cl-no-applicable-method clone nil)
  signal(cl-no-applicable-method (clone nil))
  cl-no-applicable-method(#s(cl--generic :name clone :dispatches ((0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x4b131d>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1d837d>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1d8391>)))) :method-table (#s(cl--generic-method :specializers (eieio-named) :qualifiers nil :uses-cnm t :function #f(compiled-function (obj &rest params) "Clone OBJ, initializing `:parent' to OBJ.\nAll slots are unbound, except those initialized with PARAMS." #<bytecode 0xf987a1>)) #s(cl--generic-method :specializers (eieio-instance-inheritor) :qualifiers nil :uses-cnm t :function #f(compiled-function (obj &rest params) "Clone OBJ, initializing `:parent' to OBJ.\nAll slots are unbound, except those initialized with PARAMS." #<bytecode 0xd0f955>)) #s(cl--generic-method :specializers (eieio-default-superclass) :qualifiers nil :uses-cnm nil :function #f(compiled-function (obj &rest params) "Make a copy of OBJ, and then apply PARAMS." #<bytecode 0x4ac7bd>))) :options nil) nil)
  apply(cl-no-applicable-method #s(cl--generic :name clone :dispatches ((0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x4b131d>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1d837d>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1d8391>)))) :method-table (#s(cl--generic-method :specializers (eieio-named) :qualifiers nil :uses-cnm t :function #f(compiled-function (obj &rest params) "Clone OBJ, initializing `:parent' to OBJ.\nAll slots are unbound, except those initialized with PARAMS." #<bytecode 0xf987a1>)) #s(cl--generic-method :specializers (eieio-instance-inheritor) :qualifiers nil :uses-cnm t :function #f(compiled-function (obj &rest params) "Clone OBJ, initializing `:parent' to OBJ.\nAll slots are unbound, except those initialized with PARAMS." #<bytecode 0xd0f955>)) #s(cl--generic-method :specializers (eieio-default-superclass) :qualifiers nil :uses-cnm nil :function #f(compiled-function (obj &rest params) "Make a copy of OBJ, and then apply PARAMS." #<bytecode 0x4ac7bd>))) :options nil) nil)
  #f(compiled-function (&rest args) #<bytecode 0xd1ad45>)(nil)
  apply(#f(compiled-function (&rest args) #<bytecode 0xd1ad45>) nil nil)
  clone(nil)
  ebdb-edit-field-customize(#<ebdb-record-person John Doe> nil)
  funcall-interactively(ebdb-edit-field-customize #<ebdb-record-person John Doe> nil)
  call-interactively(ebdb-edit-field-customize nil nil)
  command-execute(ebdb-edit-field-customize)
--8<---------------cut here---------------end--------------->8---


In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.12)
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Debug on Error enabled globally
Loading EBDB sources...
Initializing EBDB records... done
Formatting EBDB...done.
Point not in field
Entering debugger...
Saving file /home/jorge/ebdb_backtrace...
Wrote /home/jorge/ebdb_backtrace

Configured using:
 'configure
 CONFIG_SHELL=/gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash
 SHELL=/gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash
 --prefix=/gnu/store/hg2qd5ggvnxq5gfdhxqpidhm3rr8vysr-emacs-26.3
 --enable-fast-install --with-modules --disable-build-details'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS

Important settings:
  value of $EMACSLOADPATH: /home/jorge/.guix-profile/share/emacs/site-lisp:/home/jorge/.guix-profile/share/emacs/26.3/lisp
  value of $LC_MONETARY: pt_BR.UTF-8
  value of $LC_NUMERIC: pt_BR.UTF-8
  value of $LC_TIME: pt_BR.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: EBDB

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
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils cl-print debug ebdb-com crm mailabbrev ebdb-format
ebdb cl-extra help-mode eieio-opt speedbar sb-image ezimage dframe
find-func eieio-base pcase subr-x cal-menu calendar cal-loaddefs map
timezone cus-start cus-load elec-pair finder-inf info package easymenu
epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache url-vars guix-emacs rx seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date
mule-util 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 menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame 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 minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 152599 8435)
 (symbols 48 25475 1)
 (miscs 40 108 149)
 (strings 32 45705 1601)
 (string-bytes 1 1278319)
 (vectors 16 23222)
 (vector-slots 8 653535 11456)
 (floats 8 60 85)
 (intervals 56 680 0)
 (buffers 992 15))

Regards
Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
[hidden email] (Jorge P. de Morais Neto) writes:

>  0x8000078ebdb<return><return>eE
>
> Hello.  I use the latest EBDB (0.6.11) on an updated Spacemacs (develop
> branch) atop GNU Emacs 26.3 on an updated Debian buster.  Emacs was
> installed via GNU Guix.
>
> I cannot add tags to EBDB records.  To help you with reproducing the
> bug, I reproduced it on a GNU Emacs configuration where the only
> customization was augmenting `package-archives' (which I later realized
> was unnecessary) and installing `ebdb'.  I also used a minimal EBDB
> database.  I then inserted a tags field in one record; EBDB did not ask
> for the contents of the field, so an empty tags field was inserted.

Bah, that's embarrassing. I only ever use the Org-specific tags, and
never noticed I'd forgotten to write an `ebdb-read' method for generic
tags. I'll have a patch for you to test later today.

Thanks for the report,
Eric



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
In reply to this post by Jorge P. de Morais Neto
[hidden email] (Jorge P. de Morais Neto) writes:

>  0x8000078ebdb<return><return>eE
>
> Hello.  I use the latest EBDB (0.6.11) on an updated Spacemacs (develop
> branch) atop GNU Emacs 26.3 on an updated Debian buster.  Emacs was
> installed via GNU Guix.
>
> I cannot add tags to EBDB records.  To help you with reproducing the
> bug, I reproduced it on a GNU Emacs configuration where the only
> customization was augmenting `package-archives' (which I later realized
> was unnecessary) and installing `ebdb'.  I also used a minimal EBDB
> database.  I then inserted a tags field in one record; EBDB did not ask
> for the contents of the field, so an empty tags field was inserted.

Would you please eval the following forms and let me know if everything
works as expected?


(cl-defmethod ebdb-read ((field (subclass ebdb-field-tags)) &optional slots obj)
  (let* ((crm-separator (cadr (assq 'ebdb-field-tags ebdb-separator-alist)))
         (val (completing-read-multiple
               (format "Tags (separate with \"%s\"): " crm-separator)
               ebdb-tags
               nil nil
               (when obj (ebdb-string obj)))))
    (cl-call-next-method field (plist-put slots :tags val))))


(cl-defmethod ebdb-fmt-field :around ((_fmt ebdb-formatter-ebdb)
                                      (field ebdb-field)
                                      _style
                                      (_record ebdb-record))
  "Put the 'ebdb-field text property on FIELD.  The value of the
property is the field instance itself."
  (let ((str (cl-call-next-method)))
    (propertize (if (or (null str)
                        (string-empty-p str))
                    "<empty>"
                  str)
                'ebdb-field field)))



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Jorge P. de Morais Neto
Error inserting field: cl-no-applicable-method, (ebdb-record-delete-field #s(ebdb-record-person #s(ebdb-field-uuid ce30c771-c0e3-4874-ab90-a8e49078e531) #s(ebdb-field-creation-date (24078 20399 443853 624000)) #s(ebdb-field-timestamp (24081 9450 666073 294000)) (#s(ebdb-field-tags (TODO))) nil nil t #s(ebdb-cache John Doe (John Doe Doe, John) (ACME) nil ([hidden email]) doe, john (#s(ebdb-db-file ~/.emacs.d/ebdb File: ebdb #s(ebdb-field-uuid 41310d36-e033-4b31-81fa-c1c9421c8cb7) (24081 9445 487995 717000) (#1 #s(ebdb-record-organization #s(ebdb-field-uuid 88bf0c5e-6c6c-4317-899a-8cf19dd4c6a5) #s(ebdb-field-creation-date (24078 20310 981426 250000)) #s(ebdb-field-timestamp (24078 20310 981328 143000)) nil nil nil nil #s(ebdb-cache ACME nil nil nil nil acme (#4)) nil nil nil #s(ebdb-field-name-simple ACME) #s(ebdb-field-domain acme.com))) nil 0.1  nil t t nil ebdb-record-person))) nil nil nil #s(ebdb-field-name-complex Doe (John) nil nil nil) nil nil (#s(ebdb-field-role CEO ce30c771-c0e3-4874-ab90-a8e49078e531 88bf0c5e-6c6c-4317-899a-8cf19dd4c6a5 #s(ebdb-field-mail nil [hidden email] primary) nil nil))) (#s(ebdb-field-tags (TODO))))

Em [2020-01-04 sáb 10:55:41-0800], Eric Abrahamsen escreveu:

> Would you please eval the following forms and let me know if everything
> works as expected?
> [...]

Thank you for the fix.  With it I can indeed insert a tag.  I tested on
my real EBDB database on Spacemacs develop as well as on the pure GNU
Emacs with minimal customization and minimal EBDB database I used to
reproduce this bug.  The tests were quick however, I just added a small
tag to a few records, and on one case I edited a tags field to add a
second tag (manually separated by ":").

There are still quirks:

1. When hitting "i" to insert a tags field on a record that already has
   a tags field, I get a big error message (attached).  I would prefer a
   short and clear error message.
2. When editing a tags field with the extended interface ("E"), and
   adding a second tag, I can successfully hit "[Apply]" and it works;
   but when hitting "[Accept]" I get an error.

Regards
Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
Jorge P. de Morais Neto <[hidden email]> writes:

[...]

> Thank you for the fix. With it I can indeed insert a tag. I tested on
> my real EBDB database on Spacemacs develop as well as on the pure GNU
> Emacs with minimal customization and minimal EBDB database I used to
> reproduce this bug. The tests were quick however, I just added a small
> tag to a few records, and on one case I edited a tags field to add a
> second tag (manually separated by ":").
>
> There are still quirks:
>
> 1. When hitting "i" to insert a tags field on a record that already has
> a tags field, I get a big error message (attached). I would prefer a
> short and clear error message.
> 2. When editing a tags field with the extended interface ("E"), and
> adding a second tag, I can successfully hit "[Apply]" and it works;
> but when hitting "[Accept]" I get an error.

Well this is still weird. I can reproduce number 1 above, but not number
2. Let me first fix the problems I can reproduce, and then try to figure
out exactly why I'm not seeing what you're seeing.

Thanks,
Eric



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
In reply to this post by Jorge P. de Morais Neto
Jorge P. de Morais Neto <[hidden email]> writes:

[...]

> 1. When hitting "i" to insert a tags field on a record that already has
> a tags field, I get a big error message (attached). I would prefer a
> short and clear error message.
> 2. When editing a tags field with the extended interface ("E"), and
> adding a second tag, I can successfully hit "[Apply]" and it works;
> but when hitting "[Accept]" I get an error.

Okay, I've fixed the first problem. For the second, are you getting a
'ebdb-unacceptable-field error, or what is it?



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Jorge P. de Morais Neto
cl-no-applicable-method: No applicable method: ebdb-record-delete-field, #s(ebdb-record-person #s(ebdb-field-uuid "ce30c771-c0e3-4874-ab90-a8e49078e531") #s(ebdb-field-creation-date (24078 20399 443853 624000)) #s(ebdb-field-timestamp (24081 48590 249568 725000)) (#s(ebdb-field-tags ("TODO"))) nil nil t #s(ebdb-cache "John Doe" ("John Doe" "Doe, John") ("ACME") nil ("[hidden email]") "doe, john" (#s(ebdb-db-file "~/.emacs.d/ebdb" "File: ebdb" #s(ebdb-field-uuid "41310d36-e033-4b31-81fa-c1c9421c8cb7") (24081 48578 561310 979000) (#0 #s(ebdb-record-organization #s(ebdb-field-uuid "88bf0c5e-6c6c-4317-899a-8cf19dd4c6a5") #s(ebdb-field-creation-date (24078 20310 981426 250000)) #s(ebdb-field-timestamp (24078 20310 981328 143000)) nil nil nil nil #s(ebdb-cache "ACME" nil nil nil nil "acme" (#3)) nil ...)) nil "0.1" "" nil ...))) nil ...), (#s(ebdb-field-tags ("TODO")))

Em [2020-01-04 sáb 16:43:04-0800], Eric Abrahamsen escreveu:

> Okay, I've fixed the first problem.

Thanks!

> For the second, are you getting a 'ebdb-unacceptable-field error, or
> what is it?

I get the error attached.  I also attached the EBDB database I used to
get the error.  And how I got it:

1. Start Emacs
2. Invoke M-x ebdb <RET><RET>
3. Move point to the tags line (it has two tags)
4. Hit "E"
5. Delete the second tag
6. Hit [Apply]
7. Hit [Accept]

Notice that I hit [Accept] after hitting [Apply].  This is how the error
occurs.  Sorry for not mentioning that in the first email.

Regards
--
- <https://jorgemorais.gitlab.io/justice-for-rms/>
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]

Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Jorge P. de Morais Neto
Hi.  What is the procedure to make EBDB work with Org Tags?  I tried
opening a minimally customized Emacs (with the attached EBDB database in
.emacs.d/) and:

1. Set org-tag-alist
2. Execute the following three requires:
   (require 'org)
   (require 'ebdb)
   (require 'ebdb-org)
3. Invoke M-x ebdb <RET> <RET>
4. Insert a new field by hitting "i"
5. Choose org tags as the field type
6. My Org tags are not offered for completion

Regards
--
- <https://jorgemorais.gitlab.io/justice-for-rms/>
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Jorge P. de Morais Neto

Em [2020-01-06 seg 15:43:38-0300], Jorge P. de Morais Neto escreveu:

> Hi.  What is the procedure to make EBDB work with Org Tags?  I tried
> opening a minimally customized Emacs (with the attached EBDB database in
> .emacs.d/) and:

Forgot to attach the database.
--
- <https://jorgemorais.gitlab.io/justice-for-rms/>
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]

ebdb (864 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
In reply to this post by Jorge P. de Morais Neto

On 01/05/20 07:49 AM, Jorge P. de Morais Neto wrote:

> cl-no-applicable-method: No applicable method:
> ebdb-record-delete-field, #s(ebdb-record-person #s(ebdb-field-uuid
> "ce30c771-c0e3-4874-ab90-a8e49078e531") #s(ebdb-field-creation-date
> (24078 20399 443853 624000)) #s(ebdb-field-timestamp (24081 48590
> 249568 725000)) (#s(ebdb-field-tags ("TODO"))) nil nil t #s(ebdb-cache
> "John Doe" ("John Doe" "Doe, John") ("ACME") nil ("[hidden email]")
> "doe, john" (#s(ebdb-db-file "~/.emacs.d/ebdb" "File: ebdb"
> #s(ebdb-field-uuid "41310d36-e033-4b31-81fa-c1c9421c8cb7") (24081
> 48578 561310 979000) (#0 #s(ebdb-record-organization
> #s(ebdb-field-uuid "88bf0c5e-6c6c-4317-899a-8cf19dd4c6a5")
> #s(ebdb-field-creation-date (24078 20310 981426 250000))
> #s(ebdb-field-timestamp (24078 20310 981328 143000)) nil nil nil nil
> #s(ebdb-cache "ACME" nil nil nil nil "acme" (#3)) nil ...)) nil "0.1"
> "" nil ...))) nil ...), (#s(ebdb-field-tags ("TODO")))
>
>
> Em [2020-01-04 sáb 16:43:04-0800], Eric Abrahamsen escreveu:
>
>> Okay, I've fixed the first problem.
>
> Thanks!
>
>> For the second, are you getting a 'ebdb-unacceptable-field error, or
>> what is it?
>
> I get the error attached.  I also attached the EBDB database I used to
> get the error.  And how I got it:

Oh, sorry, these two were actually the same problem, and all should be
fixed now. I've done a 0.6.12 release -- would you update when it's
available and check that this fixes everything? Though I'm not sure if
it will address your other error. Let's get this closed out first.

Thanks,
Eric



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
In reply to this post by Jorge P. de Morais Neto

On 01/06/20 15:43 PM, Jorge P. de Morais Neto wrote:
> Hi.  What is the procedure to make EBDB work with Org Tags?  I tried
> opening a minimally customized Emacs (with the attached EBDB database in
> .emacs.d/) and:

Huh, this is actually more complicated than I thought. I don't set
`org-tag-alist' or `org-tag-persistent-alist', I simply define the tags
by use in my Org files. That allows the
`org-global-tags-completion-table' function to find all my tags, but
apparently that function doesn't consult the user-defined alists.

Let me ask on the Org mailing list if there's a canonical way of doing
this.

Eric



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
In reply to this post by Jorge P. de Morais Neto
Jorge P. de Morais Neto <[hidden email]> writes:

> Hi.  What is the procedure to make EBDB work with Org Tags?  I tried
> opening a minimally customized Emacs (with the attached EBDB database in
> .emacs.d/) and:
>
> 1. Set org-tag-alist
> 2. Execute the following three requires:
>    (require 'org)
>    (require 'ebdb)
>    (require 'ebdb-org)
> 3. Invoke M-x ebdb <RET> <RET>
> 4. Insert a new field by hitting "i"
> 5. Choose org tags as the field type
> 6. My Org tags are not offered for completion

Also, it was a mistake on my part to define a separate field class for
Org tags, vs "regular" non-Org tags. It's enough just to have the
ebdb-org.el define new functions for dealing with the regular tag field
class, there's no need to have a separate class.

In the next week I'm going to add a backwards-compatibility hack so that
creating a new ebdb-org-field-tags instance actually returns an instance
of ebdb-field-tags. Just FYI -- you might as well just use a regular
ebdb-field-tags field, it will get Org integration soon.

Eric



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Jorge P. de Morais Neto
In reply to this post by Eric Abrahamsen-2
Em [2020-01-06 seg 11:40:30-0800], Eric Abrahamsen escreveu:

> Oh, sorry, these two were actually the same problem, and all should be
> fixed now.  I've done a 0.6.12 release -- would you update when it's
> available and check that this fixes everything?  Though I'm not sure
> if it will address your other error.  Let's get this closed out first.

Yes, with EBDB 0.6.12 I can insert and edit tags, and I can edit them
with both "e" and "E".  The error message when, in the extended
customize interface ("E"), I hit "[Apply]" and then "[Accept]", also
seems to have been fixed.  There is still one quirk: when I insert a
tags field on a record that already has a tags field, EBDB overwrites
the old field and, when it asks for the tags, it does not offer the
previous ones as default.  It would be more user-friendly if EBDB either
offered the previous tags as default, or simply signaled an error with a
short and clear message.

And two feature requests:

1. Undo.  So far I have never suffered much for the lack of undo (it is
   only an inconvenience) and of course I leave it up to you to
   prioritize this feature, but it would be useful, though clearly not
   as useful as 2:
2. Compatibility with other contacts formats.  I would like to import my
   Gmail contacts and complete my transition away from G$$gle spyware.

Should I open two bug reports for these two feature requests?

Regards
--
- <https://jorgemorais.gitlab.io/justice-for-rms/>
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
Jorge P. de Morais Neto <[hidden email]> writes:

> Em [2020-01-06 seg 11:40:30-0800], Eric Abrahamsen escreveu:
>
>> Oh, sorry, these two were actually the same problem, and all should be
>> fixed now.  I've done a 0.6.12 release -- would you update when it's
>> available and check that this fixes everything?  Though I'm not sure
>> if it will address your other error.  Let's get this closed out first.
>
> Yes, with EBDB 0.6.12 I can insert and edit tags, and I can edit them
> with both "e" and "E".  The error message when, in the extended
> customize interface ("E"), I hit "[Apply]" and then "[Accept]", also
> seems to have been fixed.  There is still one quirk: when I insert a
> tags field on a record that already has a tags field, EBDB overwrites
> the old field and, when it asks for the tags, it does not offer the
> previous ones as default.  It would be more user-friendly if EBDB either
> offered the previous tags as default, or simply signaled an error with a
> short and clear message.

Yes, this isn't ideal; there's no indication of which fields are
"singletons" and which aren't. I think you're right that inserting a new
field should essentially behave like editing the old one -- actually
maybe that's all that needs to happen. That plus a message afterwards.
I'll take a look.

> And two feature requests:
>
> 1. Undo.  So far I have never suffered much for the lack of undo (it is
>    only an inconvenience) and of course I leave it up to you to
>    prioritize this feature, but it would be useful, though clearly not
>    as useful as 2:

I've thought about this in the past. Each record has a "cache" object
that stores metadata and computed strings for the record, and this would
be natural place to store undo information. A dumb implementation could
store entire copies of the record as it is edited, and allow you to
switch them out. Alternately, the vCard specs provide for a versioning
system for individual properties
(https://tools.ietf.org/html/rfc6350#section-7), maybe I could adapt
that once I've gone and figured out how it works.

> 2. Compatibility with other contacts formats. I would like to import my
>    Gmail contacts and complete my transition away from G$$gle spyware.

This is definitely on the roadmap, and taking me too long. Presumably
you'd export your Gmail contacts as a vCard file? Or something else? I'm
in the middle of writing a vCard parser, which is actually a separate
library from EBDB (so other software can use it), but will be used in
EBDB code.

Anyway, if we're talking about importing vCards, that's on the way.

> Should I open two bug reports for these two feature requests?

For the undo feature, please -- it's not high priority but it would be
good to keep track of. I've already got Github issues open for the other
request.

Thanks,
Eric



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
In reply to this post by Eric Abrahamsen-2

On 01/06/20 11:40 AM, Eric Abrahamsen wrote:

> On 01/05/20 07:49 AM, Jorge P. de Morais Neto wrote:
>> cl-no-applicable-method: No applicable method:
>> ebdb-record-delete-field, #s(ebdb-record-person #s(ebdb-field-uuid
>> "ce30c771-c0e3-4874-ab90-a8e49078e531") #s(ebdb-field-creation-date
>> (24078 20399 443853 624000)) #s(ebdb-field-timestamp (24081 48590
>> 249568 725000)) (#s(ebdb-field-tags ("TODO"))) nil nil t #s(ebdb-cache
>> "John Doe" ("John Doe" "Doe, John") ("ACME") nil ("[hidden email]")
>> "doe, john" (#s(ebdb-db-file "~/.emacs.d/ebdb" "File: ebdb"
>> #s(ebdb-field-uuid "41310d36-e033-4b31-81fa-c1c9421c8cb7") (24081
>> 48578 561310 979000) (#0 #s(ebdb-record-organization
>> #s(ebdb-field-uuid "88bf0c5e-6c6c-4317-899a-8cf19dd4c6a5")
>> #s(ebdb-field-creation-date (24078 20310 981426 250000))
>> #s(ebdb-field-timestamp (24078 20310 981328 143000)) nil nil nil nil
>> #s(ebdb-cache "ACME" nil nil nil nil "acme" (#3)) nil ...)) nil "0.1"
>> "" nil ...))) nil ...), (#s(ebdb-field-tags ("TODO")))
>>
>>
>> Em [2020-01-04 sáb 16:43:04-0800], Eric Abrahamsen escreveu:
>>
>>> Okay, I've fixed the first problem.
>>
>> Thanks!
>>
>>> For the second, are you getting a 'ebdb-unacceptable-field error, or
>>> what is it?
>>
>> I get the error attached.  I also attached the EBDB database I used to
>> get the error.  And how I got it:
>
> Oh, sorry, these two were actually the same problem, and all should be
> fixed now. I've done a 0.6.12 release -- would you update when it's
> available and check that this fixes everything? Though I'm not sure if
> it will address your other error. Let's get this closed out first.

Bah, this still isn't behaving correctly, hang on a moment...



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Jorge P. de Morais Neto
In reply to this post by Eric Abrahamsen-2
Em [2020-01-07 ter 09:37:02-0800], Eric Abrahamsen escreveu:

> This is definitely on the roadmap, and taking me too long.  Presumably
> you'd export your Gmail contacts as a vCard file?  Or something else?

It seems Gmail supports vCard and two CSV variants[1].  I do not know
which works best.

  [1]: https://www.lifewire.com/how-to-export-your-gmail-contacts-1171992

> I'm in the middle of writing a vCard parser, which is actually a
> separate library from EBDB (so other software can use it), but will be
> used in EBDB code.

Great!  Thank you.

> For the undo feature, please -- it's not high priority but it would be
> good to keep track of.

I'll do.

Regards
--
- <https://jorgemorais.gitlab.io/justice-for-rms/>
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
Jorge P. de Morais Neto <[hidden email]> writes:

> Em [2020-01-07 ter 09:37:02-0800], Eric Abrahamsen escreveu:
>
>> This is definitely on the roadmap, and taking me too long.  Presumably
>> you'd export your Gmail contacts as a vCard file?  Or something else?
>
> It seems Gmail supports vCard and two CSV variants[1].  I do not know
> which works best.
>
>   [1]: https://www.lifewire.com/how-to-export-your-gmail-contacts-1171992

Cool, well we'll start with vCard. A CSV importer would be a good idea,
too.

Would you eval this and see if it solves your Org tags issue?


(cl-defmethod ebdb-read ((field (subclass ebdb-org-field-tags)) &optional slots obj)
  (let* ((crm-separator (cadr (assq 'ebdb-field-tags ebdb-separator-alist)))
         (val (completing-read-multiple
               "Tags: "
               (org--tag-add-to-alist
                (org--tag-add-to-alist
                 (org--tag-add-to-alist
                  (org-global-tags-completion-table)
                  org-tag-alist)
                 org-tag-persistent-alist)
                ebdb-tags)
               nil nil
               (when obj (ebdb-string obj)) 'org-tags-history)))
    (cl-call-next-method field (plist-put slots :tags val))))



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Jorge P. de Morais Neto
Em [2020-01-12 dom 09:10:50-0800], Eric Abrahamsen escreveu:

> Would you eval this and see if it solves your Org tags issue?
> [...]

This does make Org Tags work with EBDB 0.6.11, but not on EBDB 0.6.12.
On EBDB 6.12, with a minimally customized GNU Emacs instance the
following occurs:

1. I open the minimally customized GNU Emacs instance.
2. I eval (require 'ebdb-org)
3. I eval the code snippet you provided
4. At some moment I set org-tag-alist (note: I actually I don't remember
   if I set it after steps 2-3 or before)
5. Invoke M-x ebdb <RET><RET>
6. I Try to add Org Tags to a record.  My Org tags are offered for
   completion, but when I choose one, then EBDB seems to ignore my
   answer; it then asks for a "regular" tag without offering the Org
   tags for completion.

Besides, it seems that the function `org--tag-add-to-alist' does not
exist on the Org Mode version (9.1 IIRC) that comes with Emacs 26.3.  I
think you should document that the Org Tags functionality depends on
recent Org Mode.  Also, maybe (I don't know if this would be worth your
time) EBDB could provide a clear error message when the user attempts to
use that functionality on an old Org Mode.  Currently it lets Emacs
complain that the symbol's value as a function is void.

--
- <https://jorgemorais.gitlab.io/justice-for-rms/>
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Eric Abrahamsen-2
Jorge P. de Morais Neto <[hidden email]> writes:

> Em [2020-01-12 dom 09:10:50-0800], Eric Abrahamsen escreveu:
>
>> Would you eval this and see if it solves your Org tags issue?
>> [...]
>
> This does make Org Tags work with EBDB 0.6.11, but not on EBDB 0.6.12.
> On EBDB 6.12, with a minimally customized GNU Emacs instance the
> following occurs:
>
> 1. I open the minimally customized GNU Emacs instance.
> 2. I eval (require 'ebdb-org)
> 3. I eval the code snippet you provided
> 4. At some moment I set org-tag-alist (note: I actually I don't remember
>    if I set it after steps 2-3 or before)
> 5. Invoke M-x ebdb <RET><RET>
> 6. I Try to add Org Tags to a record.  My Org tags are offered for
>    completion, but when I choose one, then EBDB seems to ignore my
>    answer; it then asks for a "regular" tag without offering the Org
>    tags for completion.

Bah, sorry! I forgot that this was a two-part fix, and I only gave you
one of the parts. The other part is in:

https://git.sr.ht/~girzel/EBDB/commit/046750093275092db4c2407b22482d6d0d702453

But don't worry about it, I'm 99.9% sure that this problem is taken care
of. Sorry to make you test in vain.

> Besides, it seems that the function `org--tag-add-to-alist' does not
> exist on the Org Mode version (9.1 IIRC) that comes with Emacs 26.3.  I
> think you should document that the Org Tags functionality depends on
> recent Org Mode.  Also, maybe (I don't know if this would be worth your
> time) EBDB could provide a clear error message when the user attempts to
> use that functionality on an old Org Mode.  Currently it lets Emacs
> complain that the symbol's value as a function is void.

This is a bigger problem -- I'm committed to supporting Emacs 25. I
think I'll just write my own function (read: copy and paste Org's) to do
the same thing.

Thanks,
Eric



Reply | Threaded
Open this post in threaded view
|

bug#38918: 26.3; EBDB fails to edit (add) tags

Deus Max
On Tue, Jan 14 2020, Eric Abrahamsen wrote:

> Jorge P. de Morais Neto <[hidden email]> writes:
>
>
>> Besides, it seems that the function `org--tag-add-to-alist' does not
>> exist on the Org Mode version (9.1 IIRC) that comes with Emacs 26.3.  I
>> think you should document that the Org Tags functionality depends on
>> recent Org Mode.  Also, maybe (I don't know if this would be worth your
>> time) EBDB could provide a clear error message when the user attempts to
>> use that functionality on an old Org Mode.  Currently it lets Emacs
>> complain that the symbol's value as a function is void.
>
> This is a bigger problem -- I'm committed to supporting Emacs 25. I
> think I'll just write my own function (read: copy and paste Org's) to do
> the same thing.
>
> Thanks,
> Eric

Hi Eric,

It's a bad practice to duplicate functions from other packages. At least
maybe you could enclose the definition in a (eval-after-load 'org ...)
construct and provide org--tag-add-to-alist only if it is not defined.
That way you will also be able to provide a message recommending an
upgrade to a more recent org-mode.

Deus