开发者

ELIM/garak in Emacs configuration

Does someone know how to setup ELIM in emacs?

There is no information about adding accounts etc.

开发者_如何转开发

when I run

/add-account

here comes a message

setq: Symbol's function definition is void: garak-read-protocol

Thank you


This was fixed in commit d3c2f467ebf606fbe6406b2aac783aa68aa91019, which may not have made it into a release yet. You can try checking out from the git repo, or just monkeypatch in this definition:

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


Privet, Dmitry!

(Ununtu 9.04, GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.16.1) of 2010-06-21 on jonesbook)

Ya ustanovil ego tak:

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

2) git clone elim source from github into dir ~/.emacs.d/elim and make it. OK. "elim-client" is here

3) Add link in .emacs to dir ~/.emacs.d/elim/elisp, e.g.

(add-to-list 'load-path "~/.emacs.d/elim/elisp")

(load-library "garak")

4) Optional. (emacs must compiled with --dbus). Install todochiku.el and put

(require 'todochiku)

Then, M-x garak

command

/add-account

work without such message: "Symbol definition is void: garak-read-protocol"

See 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))) )) )) )) )))

In these functions there are many calls (setq ...) and i don't know - where to search problem.

Your should give more information about error. Commands stack, for example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜