girzel / ebdb

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

ebdb-complete-message-tab's error #41

Closed tumashu closed 7 years ago

tumashu commented 7 years ago
Debugger entered--Lisp error: (void-variable ebdb-message-clean-name-function)
  (if ebdb-message-clean-name-function (funcall ebdb-message-clean-name-function (car components)) (car components))
  (if (car components) (if ebdb-message-clean-name-function (funcall ebdb-message-clean-name-function (car components)) (car components)))
  (list (if (car components) (if ebdb-message-clean-name-function (funcall ebdb-message-clean-name-function (car components)) (car components))) (if (car (cdr components)) (if ebdb-canonicalize-mail-function (funcall ebdb-canonicalize-mail-function (car (cdr components))) (ebdb-string-trim (car (cdr components))))))
  ebdb-clean-address-components(("你好" "tumashu@gmail.com"))
  (if all (mapcar (quote ebdb-clean-address-components) (mail-extract-address-components address t)) (ebdb-clean-address-components (mail-extract-address-components address)))
  ebdb-extract-address-components("\"你好\" <tumashu@gmail.com>")
  (let* ((address (ebdb-extract-address-components orig)) (record (car (ebdb-message-search (car address) (car (cdr address)))))) (if (and record (setq dwim-completions (mapcar (function (lambda (m) (ebdb-dwim-mail record m))) (ebdb-record-mail record t)))) (cond ((and (= 1 (length dwim-completions)) (string= orig (car dwim-completions))) (setq done (quote unchanged))) (cycle-completion-buffer (setq done (quote cycle-choose))) ((let* ((canon (car ...)) (dwim-mail (let ... ...))) (if (not (string= orig dwim-mail)) (progn (delete-region beg end) (insert dwim-mail) (ebdb-complete-mail-cleanup dwim-mail beg) (setq done ...))) done)) (t (let ((dwim-mail (or ... ...))) (delete-region beg end) (insert dwim-mail) (ebdb-complete-mail-cleanup dwim-mail beg) (setq done (quote cycle)))))))
  (progn (let* ((address (ebdb-extract-address-components orig)) (record (car (ebdb-message-search (car address) (car (cdr address)))))) (if (and record (setq dwim-completions (mapcar (function (lambda ... ...)) (ebdb-record-mail record t)))) (cond ((and (= 1 (length dwim-completions)) (string= orig (car dwim-completions))) (setq done (quote unchanged))) (cycle-completion-buffer (setq done (quote cycle-choose))) ((let* ((canon ...) (dwim-mail ...)) (if (not ...) (progn ... ... ... ...)) done)) (t (let ((dwim-mail ...)) (delete-region beg end) (insert dwim-mail) (ebdb-complete-mail-cleanup dwim-mail beg) (setq done (quote cycle))))))))
  (if (and (not done) ebdb-complete-mail-allow-cycling) (progn (let* ((address (ebdb-extract-address-components orig)) (record (car (ebdb-message-search (car address) (car ...))))) (if (and record (setq dwim-completions (mapcar (function ...) (ebdb-record-mail record t)))) (cond ((and (= 1 ...) (string= orig ...)) (setq done (quote unchanged))) (cycle-completion-buffer (setq done (quote cycle-choose))) ((let* (... ...) (if ... ...) done)) (t (let (...) (delete-region beg end) (insert dwim-mail) (ebdb-complete-mail-cleanup dwim-mail beg) (setq done ...))))))))
  (let* ((end (point)) (done (if beg nil (quote nothing))) (orig (and beg (buffer-substring-no-properties beg end))) (completion-ignore-case t) (completion (and orig (try-completion orig ebdb-hashtable (quote ebdb-completion-predicate)))) all-completions dwim-completions one-record) (if done nil (if (and (stringp completion) (string-match "," completion)) (setq completion (substring completion 0 (match-beginning 0)))) (setq all-completions (all-completions orig ebdb-hashtable (quote ebdb-completion-predicate))) (let ((records (delete-dups (apply (quote append) (mapcar ... all-completions))))) (setq one-record (and (not (cdr records)) (car records)))) (let ((window (get-buffer-window "*Completions*"))) (if (window-live-p window) (quit-window nil window))) (cond (one-record (let ((completion-list (if ... ... ebdb-completion-list)) (mails (ebdb-record-mail one-record t)) mail elt) (if (not mails) (progn (message "Matching record has no mail field") (sit-for 1) (setq done ...)) (if (try-completion orig ...) (setq mail ...)) (if mail nil (while ... ...)) (if mail nil (error "No match for %s" orig)) (let (...) (if ... ... ... ... ... ...))))) ((and (stringp completion) (not (ebdb-string= orig completion))) (delete-region beg end) (insert completion) (setq done (quote partial))) (completion (let ((completion-list (if ... ... ebdb-completion-list))) (let ((--dolist-tail-- all-completions)) (while --dolist-tail-- (let ... ... ...))) (setq dwim-completions (sort (delete-dups dwim-completions) (quote string-lessp))) (cond ((not dwim-completions) (message "Matching record has no mail field") (sit-for 1) (setq done ...)) ((eq 1 ...) (delete-region beg end) (insert ...) (ebdb-complete-mail-cleanup ... beg) (setq done ...)) (t (setq done ...))))))) (if (and (not done) ebdb-complete-mail-allow-cycling) (progn (let* ((address (ebdb-extract-address-components orig)) (record (car (ebdb-message-search ... ...)))) (if (and record (setq dwim-completions (mapcar ... ...))) (cond ((and ... ...) (setq done ...)) (cycle-completion-buffer (setq done ...)) ((let* ... ... done)) (t (let ... ... ... ... ...))))))) (if (member done (quote (choose cycle-choose))) (progn (if (string< (substring emacs-version 0 4) "23.2") (message "*Completions* buffer requires at least GNU Emacs 23.2") (let ((status (not ...)) (completion-base-position (list beg end)) (completion-list-insert-choice-function (cons ... ...))) (if status (message "Making completion list...")) (let* ((old-dir default-directory) (buf ...) (standard-output buf)) (prog1 (progn ...) (internal-temp-output-buffer-show buf))) (if status (message "Making completion list...done")))))) (if (eq done (quote nothing)) nil done))
  ebdb-complete-mail()
  (let ((ebdb-complete-mail-allow-cycling t)) (message "Cycling current user's email address!") (ebdb-complete-mail) (let ((window (get-buffer-window (ebdb-make-buffer-name)))) (if (window-live-p window) (quit-window nil window))))
  (if (save-excursion (let* ((end (point)) (begin (line-beginning-position)) (string (buffer-substring-no-properties begin end))) (string-match-p "@.*>$" string))) (let ((ebdb-complete-mail-allow-cycling t)) (message "Cycling current user's email address!") (ebdb-complete-mail) (let ((window (get-buffer-window (ebdb-make-buffer-name)))) (if (window-live-p window) (quit-window nil window)))) (ebdb (ebdb-search-style) ""))
  (if (and prefix-string (> (length prefix-string) 0)) (progn (delete-char (- 0 (length prefix-string))) (puthash :window-point (point) ebdb-complete-info) (ebdb (ebdb-search-style) prefix-string)) (if (save-excursion (let* ((end (point)) (begin (line-beginning-position)) (string (buffer-substring-no-properties begin end))) (string-match-p "@.*>$" string))) (let ((ebdb-complete-mail-allow-cycling t)) (message "Cycling current user's email address!") (ebdb-complete-mail) (let ((window (get-buffer-window (ebdb-make-buffer-name)))) (if (window-live-p window) (quit-window nil window)))) (ebdb (ebdb-search-style) "")))
  (let ((buffer (current-buffer)) prefix-string) (if (derived-mode-p (quote message-mode)) (progn (setq prefix-string (ebdb-complete-grab-word)) (puthash :buffer buffer ebdb-complete-info) (puthash :window (get-buffer-window) ebdb-complete-info) (puthash :window-point (point) ebdb-complete-info)) (setq ebdb-complete-info (clrhash ebdb-complete-info) prefix-string nil)) (if (and prefix-string (> (length prefix-string) 0)) (progn (delete-char (- 0 (length prefix-string))) (puthash :window-point (point) ebdb-complete-info) (ebdb (ebdb-search-style) prefix-string)) (if (save-excursion (let* ((end (point)) (begin (line-beginning-position)) (string (buffer-substring-no-properties begin end))) (string-match-p "@.*>$" string))) (let ((ebdb-complete-mail-allow-cycling t)) (message "Cycling current user's email address!") (ebdb-complete-mail) (let ((window (get-buffer-window ...))) (if (window-live-p window) (quit-window nil window)))) (ebdb (ebdb-search-style) ""))) (if (and (derived-mode-p (quote message-mode))) (progn (save-current-buffer (set-buffer (ebdb-make-buffer-name)) (setq header-line-format (format (substitute-command-keys (concat "## Type `\\[ebdb-complete-push-mail]' or `\\[ebdb-complete-push-mail-and-quit-window]' " "to push email to buffer \"%s\". ##")) (buffer-name buffer)))))))
  ebdb-complete()
  (cond ((and (save-excursion (let ((point (point))) (message-goto-body) (> (point) point))) (not (looking-back "^\\(Subject\\|From\\): *.*" (line-beginning-position))) (not (looking-back "^" (line-beginning-position)))) (ebdb-complete)) (message-tab-body-function (funcall message-tab-body-function)) (t (funcall (or (lookup-key text-mode-map "   ") (lookup-key global-map " ") (quote indent-relative)))))
  ebdb-complete-message-tab()
  funcall-interactively(ebdb-complete-message-tab)
  #<subr call-interactively>(ebdb-complete-message-tab nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> ebdb-complete-message-tab nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (ebdb-complete-message-tab nil nil))
  call-interactively(ebdb-complete-message-tab nil nil)
  command-execute(ebdb-complete-message-tab)
girzel commented 7 years ago

Thanks!