 Should the Erlang tags system be installed this command knows
 about Erlang modules."
   (interactive)
-  (condition-case nil
-      (require 'etags)
-    (error nil))
-  (cond ((and (fboundp 'etags-tags-completion-table)
-              (fboundp 'tags-lazy-completion-table)) ; Emacs 23.1+
-         (let ((erlang-replace-etags-tags-completion-table t))
-           (complete-tag)))
-        ((and erlang-tags-installed
-              (fboundp 'complete-tag)
-              (fboundp 'tags-complete-tag)) ; Emacs 19-22
-         (let ((orig-tags-complete-tag (symbol-function 'tags-complete-tag)))
-           (fset 'tags-complete-tag
-                 (symbol-function 'erlang-tags-complete-tag))
-           (unwind-protect
-               (complete-tag)
-             (fset 'tags-complete-tag orig-tags-complete-tag))))
-        ((fboundp 'complete-tag)        ; Emacs 19
-         (complete-tag))
-        ((fboundp 'tag-complete-symbol) ; XEmacs
-         (funcall (symbol-function 'tag-complete-symbol)))
-        (t
-         (error "This version of Emacs can't complete tags"))))
+  (require 'etags)
+  (let ((erlang-replace-etags-tags-completion-table t))
+    (complete-tag)))
 
 
 (defun erlang-find-tag-for-completion ()


  (setq inferior-erlang-process
        (get-buffer-process inferior-erlang-buffer))
  (if (> 21 emacs-major-version) ; funcalls to avoid compiler warnings
      (funcall (symbol-function 'set-process-query-on-exit-flag)
               inferior-erlang-process nil)
    (funcall (symbol-function 'process-kill-without-query) inferior-erlang-process))
  (if erlang-inferior-shell-split-window
      (switch-to-buffer-other-window inferior-erlang-buffer)
    (switch-to-buffer inferior-erlang-buffer))

Erlang modules.  Tags can be entered on the for `module:tag' as well
as on the old form `tag'.

In the completion list, `module:tag' and `module:' shows up."
  (interactive)
  (require 'etags)
  (set (make-local-variable 'find-tag-default-function)
       'erlang-find-tag-for-completion)
  (if (>= emacs-major-version 25)
      (add-hook 'xref-backend-functions
                #'erlang-etags--xref-backend nil t)
    (erlang-tags-define-keys (current-local-map))
    (setq erlang-tags-installed t)))



