girzel / ebdb

An EIEIO port of BBDB, Emacs' contact-management package
67 stars 11 forks source link

record indent strange. #21

Closed tumashu closed 7 years ago

tumashu commented 7 years ago
  bug-hyperbole
  mail: bug-hyperbole@gnu.org
 phone: (work)

instead of

  bug-hyperbole
       mail: bug-hyperbole@gnu.org
      phone: (work)
girzel commented 7 years ago

Each record gets its own indentation, based on its longest field label. I hope your example above isn't quite right -- surely the record name is farthest left, and the phone label is indented under it?

Is this record a person or organization? And would you prefer it was a mailing-list? I have plans for creating a mailing-list record class, but haven't done it yet.

If you find the indentation uncomfortable, please let me know. If a majority of users don't like it, I'll be happy to switch back to a fixed indentation.

girzel commented 7 years ago

Maybe you can post a screenshot, so I can be sure of how it looks?

tumashu commented 7 years ago

test

tumashu commented 7 years ago

The below is BBDB's buffer , Its indent is more beautiful then ebdb

girzel commented 7 years ago

Okay, I see. A couple of things:

Would you load ebdb-chn first, then edit your name, and re-save it? 这样EBDB就可以识别性和名字,可能会让整个姓名的排版好看一些。

另外,我想我可以设定一个基本的indentation,不管怎么样可以多几个空格。

tumashu commented 7 years ago

cannot create record

ad-Advice-call-interactively: Wrong type argument: commandp, ebdb-create
girzel commented 7 years ago

How did you get to that error?

tumashu commented 7 years ago

MENU: ebdb -> Manupulate database -> create new record

girzel commented 7 years ago

Whoops, good point! I never use the menu...

Fixed!

tumashu commented 7 years ago

How to input first-name and last-name?

tumashu commented 7 years ago
funcall-interactively: Wrong number of arguments: ((t) (records &optional query) "Delete redundant or duplicate mails from RECORDS.
For example, \"foo@bar.baz.com\" is redundant w.r.t. \"foo@baz.com\".
Duplicates may (but should not) occur if we feed EBDB automatically.
If QUERY is non-nil (as in interactive calls, unless we use a prefix arg)
query before deleting the redundant mail addresses.

Noninteractively, this may be used as an element of `ebdb-notice-record-hook'
or `ebdb-change-hook'.  However, see also `ebdb-ignore-redundant-mails',
which is probably more suited for your needs." (interactive (list (ebdb-do-records) (not current-prefix-arg) t)) (let ((--dolist-tail-- (ebdb-record-list records))) (while --dolist-tail-- (let ((record (car --dolist-tail--))) (let (mails redundant okay) (let ((--dolist-tail-- (ebdb-record-mail record))) (while --dolist-tail-- (let ((mail ...)) (if (assoc-string mail mails t) (setq redundant ...) (setq mails ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (let ((mail-re (delq nil (mapcar ... mails))) (case-fold-search t)) (if (not (cdr mail-re)) (setq okay (nreverse mails)) (setq mail-re (concat "\\`\\(?:" (mapconcat ... mail-re "\\|") "\\)\\'")) (let ((--dolist-tail-- mails)) (while --dolist-tail-- (let ... ... ...))))) (let ((form (format "redundant mail%s %s" (if ... "s" "") (ebdb-concat ... ...)))) (if (and redundant (or (not query) (y-or-n-p ...))) (progn (if query nil (message "Deleting %s" form)) (let (...) (while --dolist-tail-- ...)) (let (...) (while --dolist-tail-- ...)))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))), 3
user-error: Minibuffer window is not active
Mark set 
tumashu commented 7 years ago

Menu -> dup* command

tumashu commented 7 years ago

test

tumashu commented 7 years ago

Seem to look ugly

girzel commented 7 years ago

Okay, one thing at a time! I've never used ebdb-delete-redundant-mails before, I am going to open a separate issue for that, so I don't forget.

For the buffer formatting, let me tweak the output. In your case, the real solution will be to implement mailing-list records. This is in the plans, but I haven't done it yet. Basically, mailing-list records will have simple-string names that don't end up with the space before them.

In the case of Bastien, if you edit his name to Bastien Guerry it will be fine :)

tumashu commented 7 years ago
In the case of Bastien, if you edit his name to Bastien Guerry it will be fine :)

Good tip, but it seem to not work well with chinese name, when I load ebdb-chn

girzel commented 7 years ago

Give me more details! Parsing should work well with Chinese names...

(And thanks for pushing the package this hard!)

tumashu commented 7 years ago

Two space before every chinese name

tumashu commented 7 years ago

In my opinion, only add.one or zero space before name when format ebdb buffer

girzel commented 7 years ago

No matter what, all the records should be formatted with the same number of spaces before the name.

tumashu commented 7 years ago

Why Bastien have two space instead one space., while Bastien Guerry have one space and all chinese have two space

girzel commented 7 years ago

Because the previous formatting assumed there was both surname and given name present. Bastien has an extra space because it left an extra space for his (non-existent) surname. During migration, the Chinese names were all interpreted as given name with no surname, so same thing.

I've adjusted the name formatting now so that it doesn't output extra spaces when there's no given name.

Your Chinese-language contacts might need adjusting. The migration process didn't split the names. I should be able to come up with a short function that goes through all your contacts names and splits the Chinese ones correctly.

tumashu commented 7 years ago

thanks, i will try again

tumashu commented 7 years ago

test

tumashu commented 7 years ago

%s ?

girzel commented 7 years ago

That's what I get for trying to solve problems on the spot, without testing! I'll try to fix this in the morning.

tumashu commented 7 years ago

我突然感觉自己就是遭雷体质,走一步遇一个bug ...

girzel commented 7 years ago

抱歉,你确实是!这个package我一直注重的是核心功能、数据的integrity,外表和用户体验这些方面可能还没顾上,很感谢你多踩几个雷!

tumashu commented 7 years ago

:-)

girzel commented 7 years ago

Here's a function for re-parsing your record names. This should help "fix" the surnames and given names of Chinese contacts.

(defun ebdb-reparse-names () (interactive) (require 'ebdb) (require 'ebdb-chn) (require 'eieio) (dolist (rec (ebdb-records)) (with-slots (name dirty) rec (setf name (ebdb-parse (eieio-object-class name) (ebdb-string name))) (ebdb-init-record rec) (setf dirty t))))

girzel commented 7 years ago

Besides that, I'm going to close this multi-bug issue! Feel free to open more as necessary.

tumashu commented 7 years ago

显示似乎正常了,赞!