* bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell
@ 2018-06-20 2:34 Carlos Pita
2018-06-20 2:40 ` Carlos Pita
2019-10-03 2:14 ` Stefan Kangas
0 siblings, 2 replies; 5+ messages in thread
From: Carlos Pita @ 2018-06-20 2:34 UTC (permalink / raw)
To: 31906
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))
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell
2018-06-20 2:34 bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell Carlos Pita
@ 2018-06-20 2:40 ` Carlos Pita
2018-06-20 2:59 ` Carlos Pita
2019-10-03 2:14 ` Stefan Kangas
1 sibling, 1 reply; 5+ messages in thread
From: Carlos Pita @ 2018-06-20 2:40 UTC (permalink / raw)
To: 31906
Oh, by the way:
(lisp-completion-at-point &optional PREDICATE)
This function is obsolete since 25.1;
use ‘elisp-completion-at-point’ instead.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell
2018-06-20 2:40 ` Carlos Pita
@ 2018-06-20 2:59 ` Carlos Pita
2018-06-20 3:38 ` Carlos Pita
0 siblings, 1 reply; 5+ messages in thread
From: Carlos Pita @ 2018-06-20 2:59 UTC (permalink / raw)
To: 31906
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell
2018-06-20 2:59 ` Carlos Pita
@ 2018-06-20 3:38 ` Carlos Pita
0 siblings, 0 replies; 5+ messages in thread
From: Carlos Pita @ 2018-06-20 3:38 UTC (permalink / raw)
To: 31906
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).
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell
2018-06-20 2:34 bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell Carlos Pita
2018-06-20 2:40 ` Carlos Pita
@ 2019-10-03 2:14 ` Stefan Kangas
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2019-10-03 2:14 UTC (permalink / raw)
To: Carlos Pita; +Cc: 31906-done
Carlos Pita <carlosjosepita@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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-10-03 2:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20 2:34 bug#31906: 26.1.50; Properly set completion-at-point-functions in eshell Carlos Pita
2018-06-20 2:40 ` Carlos Pita
2018-06-20 2:59 ` Carlos Pita
2018-06-20 3:38 ` Carlos Pita
2019-10-03 2:14 ` Stefan Kangas
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.