GNU bug report logs - #31906
26.1.50; Properly set completion-at-point-functions in eshell

Previous Next

Package: emacs;

Reported by: Carlos Pita <carlosjosepita <at> gmail.com>

Date: Wed, 20 Jun 2018 02:35:02 UTC

Severity: minor

Found in version 26.1.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31906 in the body.
You can then email your comments to 31906 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31906; Package emacs. (Wed, 20 Jun 2018 02:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carlos Pita <carlosjosepita <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 20 Jun 2018 02:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1.50; Properly set completion-at-point-functions in eshell
Date: Tue, 19 Jun 2018 23:34:03 -0300
Currently C-M-i is bound to:

(defun eshell-complete-lisp-symbol ()
  "Try to complete the text around point as a Lisp symbol."
  (interactive)
  (let ((completion-at-point-functions '(lisp-completion-at-point)))
    (completion-at-point)))

This is fine but interferes with other completion frameworks that peep
into completion-at-point-functions, for example company.

Why not properly setting the functions for the buffer as most modes do
instead of overriding its value on every completion call?

---

In GNU Emacs 26.1.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-06-18 built on carlos
Repository revision: 0a8b7f365cbc8de02ddb4e806dd76b1bf6302565
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description:	Manjaro Linux

Recent messages:
Invalid face attribute :inherit nil
Invalid face reference: comint-highlight-prompt
Invalid face attribute :inherit nil
Invalid face reference: comint-highlight-prompt
Invalid face attribute :inherit nil
Invalid face reference: comint-highlight-prompt
Invalid face attribute :inherit nil
Invalid face reference: comint-highlight-prompt
Invalid face attribute :inherit nil
Invalid face reference: comint-highlight-prompt

Configured using:
 'configure --prefix=/home/carlos/Local/stow/emacs-26
 --libexecdir=/home/carlos/Local/stow/emacs-26/lib --with-x-toolkit=gtk3
 --with-xft --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  diff-auto-refine-mode: t
  pyvenv-mode: t
  shell-dirtrack-mode: t
  xclip-mode: t
  winner-mode: t
  show-paren-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  global-company-mode: t
  company-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-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
  column-number-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
rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail em-rebind
em-smart em-tramp cus-dep autoload cus-theme erc-pcomplete erc-goodies
erc erc-backend erc-compat misearch multi-isearch noutline outline
lisp-mnt jka-compr dabbrev pp cl-print completion face-remap eieio-opt
speedbar sb-image ezimage dframe find-func pcmpl-unix em-unix em-term
term disp-table ehelp em-script em-prompt em-ls em-hist em-pred em-glob
em-dirs em-cmpl em-basic em-banner em-alias sh-script smie executable
term/xterm xterm display-line-numbers checkdoc flymake-proc flymake
warnings doom-themes-org vc-git cl-extra yasnippet elec-pair
highlight-indentation help-fns radix-tree help-mode elpy
find-file-in-project ivy delsel ivy-overlay ffap thingatpt windmove
diff-mode easy-mmode elpy-shell pyvenv esh-var esh-io esh-cmd esh-opt
esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util
elpy-profile elpy-django elpy-refactor subr-x python tramp-sh tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time format-spec advice json map grep compile comint ansi-color
files-x company-oddmuse company-keywords company-etags etags xref
project company-gtags company-dabbrev-code company-dabbrev company-files
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-css company-nxml company-bbdb
doom-tomorrow-night-theme doom-themes doom-themes-common xclip winner
ring paren ido-completing-read+ memoize s cus-edit minibuf-eldef ido
gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
mail-utils mm-util mail-prsvr wid-edit company edmacro kmacro pcase
cus-start cus-load finder-inf info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib server time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 minibuffer 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 dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 1196737 80838)
 (symbols 48 38962 1)
 (miscs 40 3723 686)
 (strings 32 105392 2953)
 (string-bytes 1 2805376)
 (vectors 16 71622)
 (vector-slots 8 1810041 127260)
 (floats 8 334 648)
 (intervals 56 5454 399)
 (buffers 992 34))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31906; Package emacs. (Wed, 20 Jun 2018 02:42:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 26.1.50; Properly set completion-at-point-functions in eshell
Date: Tue, 19 Jun 2018 23:40:32 -0300
Oh, by the way:

(lisp-completion-at-point &optional PREDICATE)

This function is obsolete since 25.1;
use ‘elisp-completion-at-point’ instead.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31906; Package emacs. (Wed, 20 Jun 2018 03:00:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 26.1.50; Properly set completion-at-point-functions in eshell
Date: Tue, 19 Jun 2018 23:59:29 -0300
Mmmh it seems to be that it's overriding the default
pcomplete-completions-at-point. But then why is this default set at
all? <Tab> is directly bound to eshell-pcomplete, a simple wrapper
around pcomplete, which AFAICS doesn't rely on
completion-at-point-functions. But there is this workaround for
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12838 in the final line
of eshell-pcomplete:

(defun eshell-pcomplete (&optional interactively)
  "Eshell wrapper for `pcomplete'."
  (interactive "p")
  ;; Pretend to be pcomplete so that cycling works (bug#13293).
  (setq this-command 'pcomplete)
  (condition-case nil
      (if interactively
      (call-interactively 'pcomplete)
    (pcomplete))
    (text-read-only (completion-at-point)))) ; Workaround for bug#12838.

Although I don't fully understand the workaround.

So to sum up, what I would have expected is:

1. completion-at-point-functions contains only elisp-completions-at-point.
2. M-<Tab> is bound to completion-at-point.
3. <Tab> is bound to a wrapper to pcomplete (that doesn't call
completion-at-point).

All these expectations are violated.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31906; Package emacs. (Wed, 20 Jun 2018 03:40:01 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 26.1.50; Properly set completion-at-point-functions in eshell
Date: Wed, 20 Jun 2018 00:38:47 -0300
Well, inspecting the code a bit more I conclude that all of the above
is in order to make completion-at-point work as a fallback for some
corner cases that break pcomplete, hence the same completion functions
should be installed for both completion mechanisms, although M-<Tab>
can't access them. This has the happy consequence that company sees
the more relevant completions (the <Tab> ones). It's hackish but I
think this can be closed (although the obsolete name
lisp-completion-at-point could be updated).




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Thu, 03 Oct 2019 02:15:02 GMT) Full text and rfc822 format available.

Notification sent to Carlos Pita <carlosjosepita <at> gmail.com>:
bug acknowledged by developer. (Thu, 03 Oct 2019 02:15:03 GMT) Full text and rfc822 format available.

Message #19 received at 31906-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: 31906-done <at> debbugs.gnu.org
Subject: Re: bug#31906: 26.1.50;
 Properly set completion-at-point-functions in eshell
Date: Thu, 3 Oct 2019 04:14:21 +0200
Carlos Pita <carlosjosepita <at> gmail.com> writes:

> Well, inspecting the code a bit more I conclude that all of the above
> is in order to make completion-at-point work as a fallback for some
> corner cases that break pcomplete, hence the same completion functions
> should be installed for both completion mechanisms, although M-<Tab>
> can't access them. This has the happy consequence that company sees
> the more relevant completions (the <Tab> ones). It's hackish but I
> think this can be closed

OK, closing now.

> (although the obsolete name lisp-completion-at-point could be
> updated).

Fixed on master, thanks.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 31 Oct 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.