ELIM / гарак в конфигурации Emacs - PullRequest
0 голосов
/ 07 ноября 2010

Кто-нибудь знает, как настроить ELIM в emacs?

Нет информации о добавлении аккаунтов и т. Д.

когда я бегу

/ надстройка счета

здесь приходит сообщение

setq: определение функции символа void: garak-read-protocol

Спасибо

Ответы [ 2 ]

0 голосов
/ 08 февраля 2011

Это было исправлено в коммите d3c2f467ebf606fbe6406b2aac783aa68aa91019, который, возможно, еще не превратился в релиз.Вы можете попробовать проверить из git-репо или просто monkeypatch в этом определении:

(defun garak-read-protocol (proc)
  (let ((available (mapcar 'car (elim-protocol-alist proc))))
    (completing-read "protocol: " available nil t) ))
0 голосов
/ 08 ноября 2010

Привет, Дмитрий!

(Ununtu 9.04, GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK + версия 2.16.1) 2010-06-21 на jonesbook)

Я установил его так:

1) u menia uge bil ustanovlen libpurple + pidgin (ver. 2.5.5, некоторые старые)

2) git клонируйте источник elim из github в dir ~ / .emacs.d / elim и создайте его. ХОРОШО. "Элим-клиент" здесь

3) Добавить ссылку в .emacs на dir ~ / .emacs.d / elim / elisp, например,

(путь загрузки для добавления в список "~ / .emacs.d / elim / elisp")

(библиотека загрузки "garak")

4) Необязательно. (emacs должен быть скомпилирован с --dbus). Установите todochiku.el и поставьте

(требуется 'todochiku)

Тогда М-х Гарак

Команда

/ надстройка счета

работает без такого сообщения: "Определение символа недействительно: 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 ...), и я не знаю - где искать проблему.

Вы должны дать больше информации об ошибке. Стек команд, например.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...