bindable readline command to perform spelling correction on a word

This commit is contained in:
Chet Ramey
2021-03-18 11:48:48 -04:00
parent 83c4ad27c7
commit 6be3a741cb
16 changed files with 1607 additions and 1370 deletions
+18 -3
View File
@@ -2421,9 +2421,24 @@ dumb_update:
((nfd-new) < (prompt_last_invisible-(current_line*_rl_screenwidth+prompt_invis_chars_first_line))))
ADJUST_CPOS (wrap_offset - prompt_invis_chars_first_line);
/* XXX - what happens if wrap_offset == prompt_invis_chars_first_line
and we are drawing the first line (current_line == 0)? We should
adjust by _rl_last_c_pos -= prompt_invis_chars_first_line */
/* What happens if wrap_offset == prompt_invis_chars_first_line
and we are drawing the first line (current_line == 0), or if we
are drawing the first line and changing the number of invisible
characters in the line? If we're starting to draw before the last
invisible character in the prompt, we need to adjust by
_rl_last_c_pos -= prompt_invis_chars_first_line. This can happen
when we finish reading a digit argument (with the "(arg: N)"
prompt) and are switching back to displaying a line with a prompt
containing invisible characters, since we have to redraw the
entire prompt string. */
if ((mb_cur_max > 1 && rl_byte_oriented == 0) &&
current_line == 0 && wrap_offset &&
displaying_prompt_first_line &&
wrap_offset == prompt_invis_chars_first_line &&
visible_wrap_offset != current_invis_chars &&
visible_wrap_offset != prompt_invis_chars_first_line &&
((nfd-new) < prompt_last_invisible))
ADJUST_CPOS (prompt_invis_chars_first_line);
}
}
else /* Delete characters from line. */
+20 -6
View File
@@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
topdir = .
srcdir = .
VPATH = .
@@ -49,6 +48,8 @@ TEXI2HTML = $(srcdir)/texi2html
QUIETPS = #set this to -q to shut up dvips
PSDPI = 300 # I don't have any 600-dpi printers
DVIPS = dvips -D ${PSDPI} $(QUIETPS) -o $@ # tricky
DVIPDF = dvipdfm -o $@ -p ${PAPERSIZE}
PSPDF = gs -sPAPERSIZE=${PAPERSIZE} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@
RLSRC = $(srcdir)/rlman.texi $(srcdir)/rluser.texi \
$(srcdir)/rltech.texi $(srcdir)/version.texi \
@@ -66,15 +67,25 @@ DVIOBJ = readline.dvi history.dvi rluserman.dvi
INFOOBJ = readline.info history.info rluserman.info
PSOBJ = readline.ps history.ps rluserman.ps
HTMLOBJ = readline.html history.html rluserman.html
PDFOBJ = readline.pdf history.pdf rluserman.pdf
INTERMEDIATE_OBJ = rlman.dvi
CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ)
CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(PDFOBJ)
.SUFFIXES: .ps .txt .dvi
.SUFFIXES: .ps .txt .dvi .html .pdf
all: info dvi html ps
.ps.pdf:
$(RM) $@
-${PSPDF} $<
.dvi.pdf:
$(RM) $@
-${DVIPDF} $<
all: info dvi html ps
nodvi: info html
pdf: $(PDFOBJ)
readline.dvi: $(RLSRC)
TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rlman.texi
@@ -123,14 +134,17 @@ dvi: $(DVIOBJ)
ps: $(PSOBJ)
html: $(HTMLOBJ)
readline.pdf: readline.dvi
history.pdf: history.dvi
rluserman.pdf: rluserman.dvi
clean:
$(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \
*.fns *.kys *.tps *.vrs *.o core
*.fns *.kys *.tps *.vrs *.bt *.bts *.o core *.core
distclean: clean
$(RM) $(CREATED_DOCS)
$(RM) $(INTERMEDIATE_OBJ)
$(RM) Makefile
mostlyclean: clean
+6 -5
View File
@@ -2,20 +2,21 @@
# This makefile for Readline library documentation is in -*- text -*- mode.
# Emacs likes it that way.
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
topdir = .
srcdir = .
@@ -45,7 +46,7 @@ MAKEINFO = LANGUAGE= makeinfo
TEXI2DVI = $(srcdir)/texi2dvi
TEXI2HTML = $(srcdir)/texi2html
QUIETPS = #set this to -q to shut up dvips
PSDPI = 600
PSDPI = 300 # I don't have any 600-dpi printers
DVIPS = dvips -D ${PSDPI} $(QUIETPS) -o $@ # tricky
DVIPDF = dvipdfm -o $@ -p ${PAPERSIZE}
PSPDF = gs -sPAPERSIZE=${PAPERSIZE} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@
+5
View File
@@ -1772,6 +1772,11 @@ the output is formatted in such a way that it can be made part
of an @var{inputrc} file. This command is unbound by default.
@ifset BashFeatures
@item spell-correct-word (C-x s)
Perform spelling correction on the current word, treating it as a directory
or filename, in the same way as the @code{cdspell} shell option.
Word boundaries are the same as those used by @code{shell-forward-word}.
@item glob-complete-word (M-g)
The word before point is treated as a pattern for pathname expansion,
with an asterisk implicitly appended. This pattern is used to
+2 -2
View File
@@ -4,7 +4,7 @@ Copyright (C) 1988-2021 Free Software Foundation, Inc.
@set EDITION 8.1
@set VERSION 8.1
@set UPDATED 10 March 2021
@set UPDATED 16 March 2021
@set UPDATED-MONTH March 2021
@set LASTCHANGE Wed Mar 10 15:43:49 EST 2021
@set LASTCHANGE Tue Mar 16 14:41:07 EDT 2021