bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37518: [PATCH] Search upward from current dir for the default TAGS f


From: Lars Ingebrigtsen
Subject: bug#37518: [PATCH] Search upward from current dir for the default TAGS file
Date: Mon, 07 Oct 2019 06:19:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Hong Xu <hong@topbug.net> writes:

> * lisp/progmodes/etags.el (tags--find-default-tags-dir)
> (tags--find-default-tags-dir-impl, visit-tags-table): Search
> upward from current dir for the default TAGS file

Sounds good.  Some minor comments:

[...]

>  +(defun tags--find-default-tags-dir-impl (current-dir)

We don't really call functions for "-impl" or the like -- as this
recurses upwards, what about calling it something more descriptive like
`tags--find-default-tags-dir-recursively'?

[...]

> +(defun tags--find-default-tags-dir ()
> +  "Find the directory that hosts the default TAGS file.
> +It is the first directory that contains a file named TAGS encountered
> +searching upward from `default-directory'."
> +  (let ((default-tag-dir
> +          (tags--find-default-tags-dir-impl default-directory)))
> +    (if default-tag-dir
> +        default-tag-dir
> +      default-directory)))

This is basically

(or (tags--find-default-tags-dir-impl default-directory)
    default-directory)

so I don't think this intermediary function is needed.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]