unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45764: icomplete in buffer completion does not work for completion-at-point
@ 2021-01-10 12:35 simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-07 13:25 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-01-10 12:35 UTC (permalink / raw)
  To: 45764

emacs -Q
in *scratch* eval
(setq icomplete-in-buffer t)
(icomplete-mode t)
type:
"(icompl" followed by C-M-i (completion-at-point) select icomplete-mode via C-j
-> *scratch* buffer is now empty apart from icomplete-mode ; all other text is deleted

it works however in shell mode for directory completion (tab invokes icomplete-mode)

In GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95))
 of 2020-08-12 built on builder10-14.porkrind.org
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.7

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
THREADS JSON PDUMPER

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 44811 6704)
 (symbols 48 5927 1)
 (strings 32 15254 1703)
 (string-bytes 1 504784)
 (vectors 16 10174)
 (vector-slots 8 126879 9518)
 (floats 8 19 39)
 (intervals 56 189 0)
 (buffers 1000 11))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45764: icomplete in buffer completion does not work for completion-at-point
  2021-01-10 12:35 bug#45764: icomplete in buffer completion does not work for completion-at-point simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-07 13:25 ` Lars Ingebrigtsen
  2022-06-07 14:43   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-07 13:25 UTC (permalink / raw)
  To: simon254; +Cc: 45764, Stefan Monnier

simon254@mailbox.org writes:

> emacs -Q
> in *scratch* eval
> (setq icomplete-in-buffer t)
> (icomplete-mode t)
> type:
> "(icompl" followed by C-M-i (completion-at-point) select icomplete-mode via C-j
> -> *scratch* buffer is now empty apart from icomplete-mode ; all other text is deleted
>
> it works however in shell mode for directory completion (tab invokes icomplete-mode)

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

`C-j' is bound to `icomplete-force-complete-and-exit', and it calls
`minibuffer-force-complete-and-exit' unconditionally, which deletes the
buffer contents.  I can't get icomplete-in-buffer to work in either
*shell* or in other modes -- has this feature gotten much testing/use?
Are there cases where it works?

Adding Stefan to the CCs, since he hadded this in 2013.

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45764: icomplete in buffer completion does not work for completion-at-point
  2022-06-07 13:25 ` Lars Ingebrigtsen
@ 2022-06-07 14:43   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-08 11:50     ` Lars Ingebrigtsen
  2023-02-27 18:33     ` Juri Linkov
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-07 14:43 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: simon254, 45764

> `C-j' is bound to `icomplete-force-complete-and-exit', and it calls
> `minibuffer-force-complete-and-exit' unconditionally, which deletes the
> buffer contents.

There are 2 problems, both of which stem from the fact that the code has
not been adjusted to the case where it's working in a normal buffer
rather than in the minibuffer:
- it calls `minibuffer-exit` which is wrong for in-buffer completion
  (it should probably exit `completion-in-region-mode` instead).
- it assumes the area of completion is the whole buffer (it should
  probably use `icomplete--field-end/beg`).

> I can't get icomplete-in-buffer to work in either *shell* or in other
> modes -- has this feature gotten much testing/use?

`icomplete-in-buffer` needs more love, indeed.
[ BTW, I see its docstring says that it doesn't affect
  `dabbrev-completion` but that's not true any more.  ]


        Stefan






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45764: icomplete in buffer completion does not work for completion-at-point
  2022-06-07 14:43   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-08 11:50     ` Lars Ingebrigtsen
  2023-02-27 18:33     ` Juri Linkov
  1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-08 11:50 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: simon254, 45764

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> `C-j' is bound to `icomplete-force-complete-and-exit', and it calls
>> `minibuffer-force-complete-and-exit' unconditionally, which deletes the
>> buffer contents.
>
> There are 2 problems, both of which stem from the fact that the code has
> not been adjusted to the case where it's working in a normal buffer
> rather than in the minibuffer:
> - it calls `minibuffer-exit` which is wrong for in-buffer completion
>   (it should probably exit `completion-in-region-mode` instead).
> - it assumes the area of completion is the whole buffer (it should
>   probably use `icomplete--field-end/beg`).

Poking at this a bit more, the test case also bugs out in
(icomplete--field-string), because there are no fields in the buffer.
(I think.  I'm apparently getting different results when edebugging and
not...)

>> I can't get icomplete-in-buffer to work in either *shell* or in other
>> modes -- has this feature gotten much testing/use?
>
> `icomplete-in-buffer` needs more love, indeed.
> [ BTW, I see its docstring says that it doesn't affect
>   `dabbrev-completion` but that's not true any more.  ]

Ah; I've now adjusted the doc string.

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45764: icomplete in buffer completion does not work for completion-at-point
  2022-06-07 14:43   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-08 11:50     ` Lars Ingebrigtsen
@ 2023-02-27 18:33     ` Juri Linkov
  2023-02-27 18:57       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2023-02-27 18:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Lars Ingebrigtsen, simon254, 45764

close 45764 30.0.50
thanks

>> `C-j' is bound to `icomplete-force-complete-and-exit', and it calls
>> `minibuffer-force-complete-and-exit' unconditionally, which deletes the
>> buffer contents.
>
> There are 2 problems, both of which stem from the fact that the code has
> not been adjusted to the case where it's working in a normal buffer
> rather than in the minibuffer:
> - it calls `minibuffer-exit` which is wrong for in-buffer completion
>   (it should probably exit `completion-in-region-mode` instead).
> - it assumes the area of completion is the whole buffer (it should
>   probably use `icomplete--field-end/beg`).

This is fixed now in master, and with these fixes works quite nicely.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45764: icomplete in buffer completion does not work for completion-at-point
  2023-02-27 18:33     ` Juri Linkov
@ 2023-02-27 18:57       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-02-27 18:57 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Ingebrigtsen, simon254, 45764

> This is fixed now in master, and with these fixes works quite nicely.

Thanks, Juri!


        Stefan






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-27 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-10 12:35 bug#45764: icomplete in buffer completion does not work for completion-at-point simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-07 13:25 ` Lars Ingebrigtsen
2022-06-07 14:43   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-08 11:50     ` Lars Ingebrigtsen
2023-02-27 18:33     ` Juri Linkov
2023-02-27 18:57       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).