Thursday, June 03, 2004


I did solve the problem of getting the right table and solved a another problem. The right completion table is now computed by etags-tags-completion-buffer and the other problem was that I didn't join the right tables, not having thought about how it was done, the incorret code would do nothing because (mapatoms (lambda ...) nil) should do nothing.

(defun php-completion-table ()
  (or php-completion-table
      (let ((table (make-vector 1022 0))
            (php-completion-buffer (find-file-noselect php-completion-buffer-file))
            (my-tags-table (if (functionp 'etags-tags-completion-table)
                               (with-current-buffer (get-file-buffer tags-file-name)
          (set-buffer php-completion-buffer)
          (goto-char (point-min))
          (while (re-search-forward
                  nil t)
            (intern (buffer-substring (match-beginning 1) (match-end 1))
        (when my-tags-table
          ;; Combine the tables.
          (mapatoms (lambda (sym) (intern (symbol-name sym) table))
        (setq php-completion-table table))))

No comments: