Hi Masatake!

> I started to hack tla--read-* functions to accept not only name component
> but also full qualified name.
>
> During the hacking, I found a infinite recursive call.
>
>
> If tla-get-revision-info-at-point-function is not bound, there is
> calling-chain: tla--read-archive-name => tla--get-archive =>
> tla--read-archive-name.
>
> Could you someone who work on tla--get-archive, fix this?
> (Maybe Matthieu?)

That is probably my fault. Did it work some days before?
I don't have any time available until monday to look at this.
Perhaps it is best, if you revert tla--get-archive,
tla--read-archive-name to a previous working revision.

The actual function looks the following way:
(defun tla--read-archive-name (&optional archive-prompt default)
  "Reads an archive name from keyboard. Returned value is a
one-element list: (archive)."
  (tla--archive-tree-build-archives t)
  (let* ((my-default-archive (or default (tla-my-default-archive)))
         (archive-prompt (or archive-prompt "Archive name: "))
         (archive (or (tla--get-archive (tla--get-info-at-point))
                      (completing-read
                       (concat archive-prompt
                               "(default: " my-default-archive ") ")
                       tla--archive-tree
                       nil nil nil
                       'tla--read-archive-history
                       my-default-archive))))
    (list (when (not (string= archive ""))
            archive))))

The following should work:

(defun tla--read-archive-name (&optional archive-prompt default)
  "Reads an archive name from keyboard. Returned value is a
one-element list: (archive)."
  (tla--archive-tree-build-archives t)
  (let* ((my-default-archive (or default (tla-my-default-archive)))
         (archive-prompt (or archive-prompt "Archive name: "))
         (archive ;;(or (tla--get-archive (tla--get-info-at-point))
                      (completing-read
                       (concat archive-prompt
                               "(default: " my-default-archive ") ")
                       tla--archive-tree
                       nil nil nil
                       'tla--read-archive-history
                       my-default-archive)));)
    (list (when (not (string= archive ""))
            archive))))

There is probably a similar problem in tla--complete-category:
(defun tla--complete-category (archive &optional prompt)
  "See doc for `tla--complete-revision'"
  (tla--archive-tree-build-categories archive t t)
  (let ((category ;(or (cadr (tla--get-category (tla--get-info-at-point)))
                      (completing-read
                       (or prompt (concat "category for " archive ": "))
                       (cddr (tla--archive-tree-get-archive archive))
                       nil nil nil
                       'tla--read-archive-category-history)));)
    (when (not (string= category ""))
      category)))


My intent for this change was to get the use the archive information
of the current buffer, instead of asking the user.


It seems that using tla--get-archive in tla--read-archive-name is not
the correct approach to get the wanted behaviour.

Please revert my changes that introduced the error.

-- 
Stefan.

Reply via email to