Emacs配置中的ELIM / garak

时间:2010-11-07 18:01:16

标签: emacs

有人知道如何在emacs中设置ELIM吗?

没有关于添加帐户等的信息。

当我跑

  

/添加帐户

这里有一条消息

  

setq:符号的函数定义是   void:garak-read-protocol

谢谢

2 个答案:

答案 0 :(得分:0)

女贞,德米特里!

(2010-6-21 jonesbook上的Ununtu 9.04,GNU Emacs 23.2.1(i686-pc-linux-gnu,GTK +版本2.16.1))

Ya ustanovil ego tak:

1)u menia uge bil ustanovlen libpurple + pidgin(ver.2.5.5,some old)

2)git clone elim源码从github进入dir~ / .emacs.d / elim并制作它。好。 “elim-client”就在这里

3)将.emacs中的链接添加到dir~ / .emacs.d / elim / elisp,例如。

(add-to-list'load-path“〜/ .emacs.d / elim / elisp”)

(load-library“garak”)

4)可选。 (emacs必须使用--dbus编译)。安装todochiku.el并输入

(要求'todochiku)

然后,M-x garak

命令

/添加帐户

没有这样的消息工作:“符号定义无效:garak-read-protocol”

见garak.el

(add-account.garak-account-update) ... (add-account.garak-cmd-add-account)

(defun garak-cmd-add-account (args)
  (let (items user proto pass options elim errval)
    (setq items (split-string args)
          user  (car  items)
          proto (cadr items)
          items (cddr items))
    (setq elim garak-elim-process)
    (when (= (length proto) 0) (setq proto (garak-read-protocol elim)))
    (when (= (length user ) 0) (setq user  (garak-read-username elim proto)))
    (when (and (car items) (not (string-match "=" (car items))))
      (setq pass (car items) items (cdr items)))
    (when (= (length pass ) 0) (setq pass  (garak-read-password elim proto)))
    ;; options not supported yet:
    ;;(mapcar
    ;; (lambda (O) (setq options (nconc options (split-string "=" O)))) items)
    ;; (message "(elim-add-account PROC %S %S %S %S)" user proto pass nil)
    (elim-add-account elim user proto pass options)
    (format "/add-account %s" args) ))

(defun garak-account-update (proc name id status args)
  "This function handles updating the garak ui when the state of one of your
accounts changes. Typically this is as a result of elim-account-status-changed
elim-connection-state or elim-connection-progress, but any call can be handled as long as an \"account-uid\" entry is present in the ARGS alist."
  (let (buffer auid where-widget point end icon-name
        icon conn kids node tag proto iname alt atag aname)
    (setq buffer (elim-fetch-process-data proc :blist-buffer)
          auid   (elim-avalue "account-uid" args)
          status nil)
    ;; update any account conversation buffers with _our_ new status
    (garak-update-account-conversations proc auid)
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; proceed to updating the blist ui buffer
    (when (buffer-live-p buffer)
      (with-current-buffer buffer
        (setq where-widget (garak-ui-find-node auid :account))

        ;; set the conn or status data (whichever is appropriate)
        (cond ((eq name 'elim-account-status-changed) (setq status args))
              ((eq name 'elim-connection-state      ) (setq conn   args))
              ((eq name 'elim-connection-progress   ) (setq conn   args)))

        ;; fetch any data we did not receive:
        (when (not conn  ) (setq conn   (elim-account-connection proc auid)))
        (when (not status) (setq status (elim-account-status     proc auid)))

        ;; pick the most suitable status icon
        (if (eq name 'elim-exit)
            (setq icon-name ":offline")
          (setq icon-name (garak-account-list-choose-icon conn status)))
        ;;(message "CHOSE ICON: %S" icon-name)
        ;; widget not found or removing an account => refresh the parent node.
        ;; otherwise                               => update node icon
        (if (or (eq 'remove-account name) (not where-widget))
            ;; refreshing parent node:
            (when (setq where-widget (garak-ui-find-node :accounts :garak-type)
                        point        (car where-widget))
              (setq node (widget-at point)
                    kids (garak-tree-widget-apply node :expander))
              (garak-tree-widget-set node :args kids)
              (when (garak-tree-widget-get node :open)
                (widget-apply node :action)
                (widget-apply node :action)))
          ;; updating node icon:
          (setq point (car where-widget)
                end   (next-single-char-property-change point 'display)
                tag   (elim-avalue icon-name garak-icon-tags)
                adata (elim-account-data proc auid)
                proto (elim-avalue :proto adata)
                aname (elim-avalue :name  adata)
                iname (format ":%s" proto)
                atag  (or (elim-avalue iname garak-icon-tags) " ?? ")
                alt   (format "[%-4s]%s%s" atag tag aname)
                icon  (tree-widget-find-image icon-name))
          (let ((inhibit-read-only t) old)
            (setq widget (widget-at point)
                  old    (widget-get widget :tag))
            (if (eq (cdr where-widget) 'menu-choice)
                (widget-put widget :tag alt)
              (widget-put widget :tag tag))
            (if (and icon (tree-widget-use-image-p))
                (put-text-property point end 'display icon) ;; widgets w images
              (when tag
                (setq end (+ (length old) point))
                (save-excursion
                  (goto-char point)
                  (setq old (make-string (length old) ?.))
                  (when (search-forward-regexp old end t)
                    (if (eq (cdr where-widget) 'menu-choice)
                        (replace-match alt nil t)
                      (replace-match tag nil t))) )) )) )) )))

在这些函数中有很多调用(setq ...),我不知道 - 在哪里搜索问题。

您应该提供有关错误的更多信息。例如,命令堆栈。

答案 1 :(得分:0)

这已在提交d3c2f467ebf606fbe6406b2aac783aa68aa91019中修复,但尚未将其发布到版本中。您可以尝试从git repo中检出,或者只是在这个定义中使用monkeypatch:

(defun garak-read-protocol (proc)
  (let ((available (mapcar 'car (elim-protocol-alist proc))))
    (completing-read "protocol: " available nil t) ))