girzel / ebdb

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

Is it possible set ~/.emacs.d/ebdb's coding? #35

Closed tumashu closed 7 years ago

tumashu commented 7 years ago

qq 20170223170609

girzel commented 7 years ago

eieio-persistent-save can only write in utf-8-emacs. What coding system are you using? I guess I'll have to make sure everything gets converted correctly.

When you open up the EBDB database file, what encoding does Emacs say it's in?

tumashu commented 7 years ago

utf-8 in linux and gbk in window

tumashu commented 7 years ago

maybe we should force add follow line to ebdb file, so user can proper open and view it

;; Local Variables:
;; coding: utf-8-emacs
;; End:
girzel commented 7 years ago

The file is saved as utf-8, and Emacs should be able to recognize that and open it as utf-8. When you open the file, what coding system does it open the file in? Down at the bottom left of the mode line?

tumashu commented 7 years ago

gbk

girzel commented 7 years ago

I'd rather not monkey-patch the files...

Would you eval this snippet, and tell me if it works okay? If so, I'll add it to ebdb-load.

(push
     (cons
      (regexp-opt (mapcar (lambda (db)
                (slot-value db 'file))
              ebdb-db-list))
      'utf-8-emacs)
     auto-coding-alist)
tumashu commented 7 years ago

tomorrow, I will try this :-)

girzel commented 7 years ago

Do let me know if this takes care of it!

tumashu commented 7 years ago

好像ebdb buffer不乱码了,但.ebdb还是不能正确识别为UTF-8

girzel commented 7 years ago

它应该就是把utf-8 decode 为 gbk,这没有问题。如果 EBDB buffers 可以正常输入、显示内容,就差不多了。

tumashu commented 7 years ago

OK

fu123456 commented 6 years ago

ebdb default file is ~/.emacs.d/ebdb, but I want to define other directory, for example ~/MEGA/ebdb.gpg. I set {{(setq ebdb-file "~/.emacs.d/ebdb.pgp")}}, but it does not work. How to solve it?

girzel commented 6 years ago

You should just be able to:

(setq ebdb-sources (list "~/.emacs.d/ebdb.pgp"))