* Re: [Emacs-diffs] fix-info-dups 6316172: Fix duplicates when completing Info files [not found] ` <E1YkAoN-0003Om-Rx@vcs.savannah.gnu.org> @ 2015-04-20 14:58 ` Stefan Monnier 2015-04-20 15:16 ` Oleh Krehel 0 siblings, 1 reply; 3+ messages in thread From: Stefan Monnier @ 2015-04-20 14:58 UTC (permalink / raw) To: emacs-devel; +Cc: Oleh Krehel > * lisp/info.el (Info-read-node-name-2): Use the STRING argument a lot > less, it's actually always "". What makes you think it's always ""? I haven't actually tested your patch, but the way I read it, I get the impression that it will break things like C-h i g (emacs-23/e TAB and C-h i g (/usr/sh TAB > Update the regex to remove the split files, the old one wasn't > working properly. But the new one only handles those cases where the ".info" extension is present, which is sadly not always the case (yup, the conventions about how to name info files suck). Stefan > + (not (string-match "\.info-[0-9]+" file)) ^^ You forgot to double the backslash. > + (complete-with-action action (cl-delete-duplicates > + (nreverse names) :test 'equal) string pred))) There's `delete-dups' for that. But I also wonder whether we couldn't try to reduce the amount of duplication (at least in some of the common cases) even before passing the result through delete-dups. IOW, I'm wondering where the duplication actually comes from. Stefan ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Emacs-diffs] fix-info-dups 6316172: Fix duplicates when completing Info files 2015-04-20 14:58 ` [Emacs-diffs] fix-info-dups 6316172: Fix duplicates when completing Info files Stefan Monnier @ 2015-04-20 15:16 ` Oleh Krehel 2015-04-20 19:43 ` Stefan Monnier 0 siblings, 1 reply; 3+ messages in thread From: Oleh Krehel @ 2015-04-20 15:16 UTC (permalink / raw) To: Stefan Monnier; +Cc: emacs-devel Stefan Monnier <monnier@iro.umontreal.ca> writes: >> * lisp/info.el (Info-read-node-name-2): Use the STRING argument a lot >> less, it's actually always "". > > What makes you think it's always ""? I deduced it from the two calls to it and the setup of my system. I may be wrong. > I haven't actually tested your patch, but the way I read it, I get the > impression that it will break things like > > C-h i g (emacs-23/e TAB > and > C-h i g (/usr/sh TAB OK, my impression was that only the files on `Info-directory-list' were acceptable. So actually it should be possible to navigate to any info file on the filesystem? >> Update the regex to remove the split files, the old one wasn't >> working properly. > > But the new one only handles those cases where the ".info" extension is > present, which is sadly not always the case (yup, the conventions about how > to name info files suck). OK, I'll work on it some more. > But I also wonder whether we couldn't try to reduce the amount of > duplication (at least in some of the common cases) even before passing > the result through delete-dups. > IOW, I'm wondering where the duplication actually comes from. In my case, it comes from `Info-directory-list': ("/usr/local/info/" "/usr/share/info/" "/usr/local/share/info/") I didn't mess with it on my own, this is the default value. These dirs have some intersections, hence the duplicates. So they're not actually duplicates, but duplicate info files, but there's no way to know which one is which from the completion system. Oleh ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Emacs-diffs] fix-info-dups 6316172: Fix duplicates when completing Info files 2015-04-20 15:16 ` Oleh Krehel @ 2015-04-20 19:43 ` Stefan Monnier 0 siblings, 0 replies; 3+ messages in thread From: Stefan Monnier @ 2015-04-20 19:43 UTC (permalink / raw) To: Oleh Krehel; +Cc: emacs-devel > OK, my impression was that only the files on `Info-directory-list' were > acceptable. So actually it should be possible to navigate to any info > file on the filesystem? Yes. Of course, you may decide not to care about this functionality, but the `g' command normally supports that, if completing-read-function lets the user write it. > In my case, it comes from `Info-directory-list': > > ("/usr/local/info/" "/usr/share/info/" "/usr/local/share/info/") Ah, because you have "emacs" info files in several places. Right, that makes sense. Then `delete-dups' is the only option. Stefan ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-20 19:43 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20150420122827.13008.83006@vcs.savannah.gnu.org> [not found] ` <E1YkAoN-0003Om-Rx@vcs.savannah.gnu.org> 2015-04-20 14:58 ` [Emacs-diffs] fix-info-dups 6316172: Fix duplicates when completing Info files Stefan Monnier 2015-04-20 15:16 ` Oleh Krehel 2015-04-20 19:43 ` Stefan Monnier
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).