unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Hong Xu <hong@topbug.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 37538@debbugs.gnu.org
Subject: bug#37538: [PATCH] Add docstring for `tags-complete-tags-table-file'.
Date: Sat, 28 Sep 2019 11:40:15 -0700	[thread overview]
Message-ID: <7e0290a2-e80b-f566-9c3b-894aaf4e5d9d@topbug.net> (raw)
In-Reply-To: <838sq8j0vl.fsf@gnu.org>

On 9/28/19 1:11 AM, Eli Zaretskii wrote:
>> From: Hong Xu <hong@topbug.net>
>> Date: Sat, 28 Sep 2019 00:59:21 -0700
>>
>> * lisp/progmodes/etags.el (tags-complete-tags-table-file): Add docstring.
> 
> Thanks.  A comment below.
> 
>> -(defun tags-complete-tags-table-file (string predicate what) ; Doc string?
>> +(defun tags-complete-tags-table-file (string predicate what)
>> +  "Complete file names in the current tags table.
>> +The meaning of the arguments are the same as the function form of
>> +COLLECTION as explained in Info node `(elisp) Programmed
>> +Completion'."
> 
> The first line of the doc string should mention the arguments.  And we
> should explain STRING and WHAT there, because those aren't passed to
> all-completions and try-completion.
> 

Please see my update below. I'm writing in this concise form because `(elisp) Programmed Completion' has a lot of explanation and I don't think we should repeat them here.

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index a03516100087..2770baa7067c 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1843,13 +1843,18 @@ tags-query-replace
     delimited)
    (fileloop-continue))
  
-(defun tags-complete-tags-table-file (string predicate what) ; Doc string?
+(defun tags-complete-tags-table-file (string predicate what)
+  "Complete STRING from file names in the current tags table.
+The meaning of the arguments are the same as the function form of
+COLLECTION as explained in Info node `(elisp) Programmed
+Completion', except that if WHAT does not equal t, it is treated
+as if it were nil."
    (save-excursion
      ;; If we need to ask for the tag table, allow that.
      (let ((enable-recursive-minibuffers t))
        (visit-tags-table-buffer))
      (if (eq what t)
-       (all-completions string (tags-table-files) predicate)
+        (all-completions string (tags-table-files) predicate)
        (try-completion string (tags-table-files) predicate))))
  
  ;;;###autoload
-- 
2.20.1







  reply	other threads:[~2019-09-28 18:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-28  7:59 bug#37538: [PATCH] Add docstring for `tags-complete-tags-table-file' Hong Xu
2019-09-28  8:11 ` Eli Zaretskii
2019-09-28 18:40   ` Hong Xu [this message]
2019-10-07  4:13     ` Lars Ingebrigtsen
2019-10-07 16:18       ` Eli Zaretskii
2019-10-07 17:27         ` Hong Xu
2019-10-08 16:21           ` Lars Ingebrigtsen
2019-10-09  6:39             ` Hong Xu
2019-10-09  8:09               ` Eli Zaretskii
2019-10-09 22:58                 ` Hong Xu
2019-10-10  7:49                   ` Eli Zaretskii
2019-10-12  0:48                     ` Hong Xu
2019-10-12  9:04                       ` Eli Zaretskii
2019-10-12 18:46                         ` Hong Xu
2019-10-12 18:57                           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e0290a2-e80b-f566-9c3b-894aaf4e5d9d@topbug.net \
    --to=hong@topbug.net \
    --cc=37538@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).