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

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

bug#45339: closed (Readline filename completion)


From: GNU bug Tracking System
Subject: bug#45339: closed (Readline filename completion)
Date: Wed, 19 May 2021 19:31:01 +0000

Your message dated Wed, 19 May 2021 21:31:26 +0200
with message-id <290FCB18-EE13-4E18-9BA0-43ED1F653812@sarc.name>
and subject line Re: bug#45339: Readline filename completion
has caused the debbugs.gnu.org bug report #45339,
regarding Readline filename completion
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
45339: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45339
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Readline filename completion Date: Sun, 20 Dec 2020 11:37:56 +0100
Hi. Filename completion just doesn't work at all. Using
filename-completion-function as a completer for readline always throws
an error.

Minimal example:
  (use-modules (ice-9 readline))

  (with-readline-completion-function
   filename-completion-function
   readline)

Hitting TAB when prompted results in:
  File: Backtrace:
  In ice-9/boot-9.scm:
    1736:10  8 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
  In unknown file:
             7 (apply-smob/0 #<thunk 7ffa51f5e500>)
  In ice-9/boot-9.scm:
      718:2  6 (call-with-prompt _ _ #<procedure default-prompt-handler (k 
proc)>)
  In ice-9/eval.scm:
      619:8  5 (_ #(#(#<directory (guile-user) 7ffa51f63c80>)))
  In ice-9/boot-9.scm:
     2806:4  4 (save-module-excursion _)
    4351:12  3 (_)
  In ice-9/readline.scm:
      213:4  2 (with-readline-completion-function _ #<procedure 7ffa4f684328 at 
/data/lampilelo/Misc-Scripts/install-wizard.scm:27:1 ()>)
  In unknown file:
             1 (%readline "File: " #<input: file /dev/pts/1> #<undefined> 
#<undefined>)
             0 (filename-completion-function "" #t)

  ERROR: In procedure filename-completion-function:
  In procedure scm_from_stringn: NULL string pointer

My version of Guile is 3.0.4 but I expect it to fail on every version.
It results in an error because the scm_filename_completion_function()
calls readline's rl_filename_completion_function() and doesn't check if
it returned NULL instead of a string.
Readline's info manual states:
"The generator function returns '(char *)NULL' to inform
'rl_completion_matches()' that there are no more possibilities left."
So it's impossible for the current implementation to work, since
scm_filename_completion_function() throws an error every time NULL is
returned.

I'm attaching a patch.

Jakub

Attachment: 0001-Fixed-filename-completion-function-for-readline-comp.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message --- Subject: Re: bug#45339: Readline filename completion Date: Wed, 19 May 2021 21:31:26 +0200
Applied in f3a23edf9ed111caab7bbad583874ad34ff8652d. Thanks!


> On 19 May 2021, at 17:24, "" <jakub-w@riseup.net> <jakub-w@riseup.net> wrote:
> 
> Since my patch didn't follow GNU C style here's an update.
> Sorry guys!
> 

Attachment: Fixed-style-for-02439a124.patch
Description: Text Data


--- End Message ---

reply via email to

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