unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44588: 28.0.50; project-find-file with thing at point
@ 2020-11-12  9:53 Manuel Uberti
  2020-11-12 12:34 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Manuel Uberti @ 2020-11-12  9:53 UTC (permalink / raw)
  To: 44588

Hi,

the documentation of `project-find-file` states:

"The completion default is the filename at point, if one is
recognized."

However, this what happens on emacs -Q:

- C-x p p
- Type "ch" (without the double quotes)
- Hit TAB
- Hit RET
- Pick a directory (I picked my own ~/.emacs.d, which is versioned with
  Git)
- Visit a file (I visited my init.el)
- The first line of my init.el is `(setq load-prefer-newer t)`
- Place the curson on `load-prefer-newer`
- C-x p f
- The prompt shows `(default load-prefer-newer)`

Is this the expected behaviour? `load-prefer-newer` is not a file name
in that directory, nor I have a file somewhere else with this name.


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.18, cairo
version 1.16.0)
 of 2020-11-12 built on hathaway
Repository revision: dcd23618014fe710ee2a898a0b8a48e503f76d7a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Ubuntu 20.04 LTS

Configured using:
 'configure --with-harfbuzz --with-json --with-mailutils'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD
JSON PDUMPER LCMS2

Important settings:
  value of $LC_MONETARY: it_IT.UTF-8
  value of $LC_NUMERIC: it_IT.UTF-8
  value of $LC_TIME: it_IT.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8

Major mode: ClojureScript

Minor modes in effect:
  magit-auto-revert-mode: t
  flimenu-global-mode: t
  flimenu-mode: t
  cider-mode: t
  subword-mode: t
  flymake-mode: t
  flyspell-mode: t
  goto-address-prog-mode: t
  symbol-overlay-mode: t
  hl-line-mode: t
  show-paren-mode: t
  mark-thing-at-mode: t
  global-page-break-lines-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  delete-selection-mode: t
  auto-image-file-mode: t
  save-place-mode: t
  global-so-long-mode: t
  envrc-mode: t
  global-git-commit-mode: t
  shell-command-with-editor-mode: t
  shell-dirtrack-mode: t
  async-bytecomp-package-mode: t
  git-identity-magit-mode: t
  gcmh-mode: t
  better-jumper-mode: t
  better-jumper-local-mode: t
  global-company-mode: t
  company-mode: t
  minibuffer-depth-indicate-mode: t
  recentf-mode: t
  savehist-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  selectrum-prescient-mode: t
  minibuffer-electric-default-mode: t
  prescient-persist-mode: t
  selectrum-mode: t
  ctrlf-mode: t
  ctrlf-local-mode: t
  el-patch-use-package-mode: t
  general-override-mode: t
  straight-use-package-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
  window-divider-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 flymake-proselint mail-extr emacsbug sendmail magit-extras
beginend face-remap git-identity tramp-cache pkg-info url-http url-auth
url-gw epl network-stream nsm magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func magit-diff hydra smerge-mode diff
magit-core magit-autorevert autorevert filenotify magit-margin
magit-transient magit-process magit-mode lv f s org-capture org-agenda
org noutline outline org-version ob-emacs-lisp org-table org-loaddefs ob
ob-tangle ol ob-ref ob-lob ob-table ob-exp org-macro org-footnote
org-src org-keys ob-comint ob-core ob-eval org-pcomplete org-list
org-entities org-faces org-compat org-macs cal-menu calendar
cal-loaddefs flimenu cider tramp-sh cider-debug cider-browse-ns
cider-repl-history pulse auto-minor-mode cider-mode cider-inspector
cider-completion cider-profile cider-eval cider-repl cider-resolve
cider-eldoc cider-test cider-stacktrace cider-doc cider-browse-spec
cider-clojuredocs cider-overlays cider-client cider-common etags
fileloop generator xref cider-connection cider-util color cider-popup
sesman-browser nrepl-client queue nrepl-dict cider-compat spinner
parseedn parseclj-parser parseclj-lex a cap-words superword subword
flymake-kondor flymake-quickdef sesman clojure-mode package-lint-flymake
package-lint let-alist finder find-func package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse url-vars flymake-proc flymake
compile flyspell ispell goto-addr symbol-overlay elisp-mode lisp-mnt
align imenu hl-line crux tramp tramp-loaddefs trampver tramp-integration
files-x tramp-compat parse-time iso8601 ls-lisp unfill paren windmove
keychain-environment mark-thing-at choice-program
choice-program-complete page-break-lines smartparens thingatpt delsel
image-file image-converter saveplace so-long envrc git-commit
with-editor warnings term disp-table ehelp eshell esh-cmd esh-ext
esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util shell
pcomplete comint ansi-color transient async-bytecomp async format-spec
magit-git magit-section magit-utils log-edit message rmc puny rfc822 mml
mml-sec epa epg epg-config gnus-util rmail rmail-loaddefs auth-source
eieio eieio-core eieio-loaddefs password-cache json text-property-search
time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log git-identity-magit pp vc-git char-fold ring
cursor-sensor project modus-vivendi-theme gcmh server better-jumper
advice company-files company-capf company completing-history
modus-operandi-theme dired-x dired dired-loaddefs mb-depth recentf
tree-widget wid-edit savehist diff-hl vc-dir ewoc vc vc-dispatcher
diff-mode selectrum-prescient selectrum minibuf-eldef map crm prescient
modeline dash packages yaml-mode-autoloads xterm-color-autoloads
web-mode-autoloads unfill-autoloads typo-autoloads
symbol-overlay-autoloads smartparens-autoloads
selectrum-prescient-autoloads selectrum-autoloads scratch-autoloads
rg-autoloads wgrep-autoloads restart-emacs-autoloads
rainbow-mode-autoloads prescient-autoloads page-break-lines-autoloads
package-lint-flymake-autoloads package-lint-autoloads olivetti-autoloads
multiple-cursors-autoloads modus-vivendi-theme-autoloads
modus-operandi-theme-autoloads mixed-pitch-autoloads
markdown-mode-autoloads mark-thing-at-autoloads choice-program-autoloads
magit-autoloads keychain-environment-autoloads json-mode-autoloads
json-snatcher-autoloads json-reformat-autoloads imenu-anywhere-autoloads
ibuffer-vc-autoloads helpful-autoloads elisp-refs-autoloads
loop-autoloads dash-functional-autoloads goto-last-change-autoloads
git-identity-autoloads f-autoloads s-autoloads hydra-autoloads
lv-autoloads git-commit-autoloads with-editor-autoloads async-autoloads
transient-autoloads flyspell-correct-autoloads
flymake-proselint-autoloads flymake-kondor-autoloads
flymake-quickdef-autoloads use-package-ensure flimenu-autoloads
envrc-autoloads diredfl-autoloads diff-hl-autoloads ctrlf-autoloads
csv-mode-autoloads crux-autoloads completing-history-autoloads
company-native-complete-autoloads native-complete-autoloads
company-autoloads cider-autoloads sesman-autoloads spinner-autoloads
queue-autoloads pkg-info-autoloads epl-autoloads parseedn-autoloads
parseclj-autoloads a-autoloads clojure-mode-autoloads
better-jumper-autoloads beginend-autoloads auctex-autoloads tex-site
apheleia-autoloads easy-mmode built-ins rx el-patch core-settings
edmacro kmacro general core-packages no-littering no-littering-autoloads
general-autoloads finder-inf use-package-core derived gcmh-autoloads
el-patch-autoloads cl-seq dash-autoloads auto-minor-mode-autoloads
use-package-autoloads bind-key-autoloads straight-autoloads info
cl-extra help-mode easymenu seq byte-opt straight subr-x bytecomp
byte-compile cconv core-lib pcase cl-macs gv cl-loaddefs cl-lib 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 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 button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 627801 181961)
 (symbols 48 53072 1)
 (strings 32 183938 50453)
 (string-bytes 1 5912146)
 (vectors 16 56741)
 (vector-slots 8 1559639 178570)
 (floats 8 436 1119)
 (intervals 56 2806 70)
 (buffers 992 20))

-- 
Manuel Uberti
www.manueluberti.eu





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

* bug#44588: 28.0.50; project-find-file with thing at point
  2020-11-12  9:53 bug#44588: 28.0.50; project-find-file with thing at point Manuel Uberti
@ 2020-11-12 12:34 ` Lars Ingebrigtsen
  2020-11-12 13:36   ` Manuel Uberti
  2020-11-12 13:53   ` Dmitry Gutov
  0 siblings, 2 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-12 12:34 UTC (permalink / raw)
  To: Manuel Uberti; +Cc: 44588

Manuel Uberti <manuel.uberti@inventati.org> writes:

> "The completion default is the filename at point, if one is
> recognized."

The doc string is trying to say that the string under point is the
default -- it doesn't check that it matches an existing file.  I'll
adjust the doc string.

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





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

* bug#44588: 28.0.50; project-find-file with thing at point
  2020-11-12 12:34 ` Lars Ingebrigtsen
@ 2020-11-12 13:36   ` Manuel Uberti
  2020-11-14 15:17     ` Lars Ingebrigtsen
  2020-11-12 13:53   ` Dmitry Gutov
  1 sibling, 1 reply; 7+ messages in thread
From: Manuel Uberti @ 2020-11-12 13:36 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 44588

On 12/11/20 13:34, Lars Ingebrigtsen wrote:
> The doc string is trying to say that the string under point is the
> default -- it doesn't check that it matches an existing file.  I'll
> adjust the doc string.

Thank you. I guess the same could be done for `project-or-external-find-file` as
well, then.

-- 
Manuel Uberti
www.manueluberti.eu





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

* bug#44588: 28.0.50; project-find-file with thing at point
  2020-11-12 12:34 ` Lars Ingebrigtsen
  2020-11-12 13:36   ` Manuel Uberti
@ 2020-11-12 13:53   ` Dmitry Gutov
  2020-11-14 15:19     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 7+ messages in thread
From: Dmitry Gutov @ 2020-11-12 13:53 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Manuel Uberti; +Cc: 44588, Stephen Leake

On 12.11.2020 14:34, Lars Ingebrigtsen wrote:
> The doc string is trying to say that the string under point is the
> default -- it doesn't check that it matches an existing file.  I'll
> adjust the doc string.

Well, the default _is_ (thing-at-point 'filename), though.

I have noticed that too often the picked up default is too long, though. 
And that clutters up the prompt. Perhaps project--completing-read-strict 
should shorten it with ellipsis to some predefined width.





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

* bug#44588: 28.0.50; project-find-file with thing at point
  2020-11-12 13:36   ` Manuel Uberti
@ 2020-11-14 15:17     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-14 15:17 UTC (permalink / raw)
  To: Manuel Uberti; +Cc: 44588

Manuel Uberti <manuel.uberti@inventati.org> writes:

> Thank you. I guess the same could be done for
> `project-or-external-find-file` as well, then.

Sure; done now.

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





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

* bug#44588: 28.0.50; project-find-file with thing at point
  2020-11-12 13:53   ` Dmitry Gutov
@ 2020-11-14 15:19     ` Lars Ingebrigtsen
  2020-11-14 22:53       ` Dmitry Gutov
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-14 15:19 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Manuel Uberti, Stephen Leake, 44588

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 12.11.2020 14:34, Lars Ingebrigtsen wrote:
>> The doc string is trying to say that the string under point is the
>> default -- it doesn't check that it matches an existing file.  I'll
>> adjust the doc string.
>
> Well, the default _is_ (thing-at-point 'filename), though.

Which just looks for a regexp, not whether it's a file that exists.

> I have noticed that too often the picked up default is too long,
> though. And that clutters up the prompt. Perhaps
> project--completing-read-strict should shorten it with ellipsis to
> some predefined width.

It'd be pretty unusual for a prompt to elide bits of the string it's
actually going to use.

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





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

* bug#44588: 28.0.50; project-find-file with thing at point
  2020-11-14 15:19     ` Lars Ingebrigtsen
@ 2020-11-14 22:53       ` Dmitry Gutov
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Gutov @ 2020-11-14 22:53 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Manuel Uberti, Stephen Leake, 44588

On 14.11.2020 17:19, Lars Ingebrigtsen wrote:
> Dmitry Gutov <dgutov@yandex.ru> writes:
> 
>> On 12.11.2020 14:34, Lars Ingebrigtsen wrote:
>>> The doc string is trying to say that the string under point is the
>>> default -- it doesn't check that it matches an existing file.  I'll
>>> adjust the doc string.
>>
>> Well, the default _is_ (thing-at-point 'filename), though.
> 
> Which just looks for a regexp, not whether it's a file that exists.

Right. But a file name doesn't have to describe an existing file to be a 
file name. One example: the argument to file-exists-p.

>> I have noticed that too often the picked up default is too long,
>> though. And that clutters up the prompt. Perhaps
>> project--completing-read-strict should shorten it with ellipsis to
>> some predefined width.
> 
> It'd be pretty unusual for a prompt to elide bits of the string it's
> actually going to use.

Perhaps.

I wonder if others see the problem I described, and if so whether they 
have other suggestions.





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

end of thread, other threads:[~2020-11-14 22:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12  9:53 bug#44588: 28.0.50; project-find-file with thing at point Manuel Uberti
2020-11-12 12:34 ` Lars Ingebrigtsen
2020-11-12 13:36   ` Manuel Uberti
2020-11-14 15:17     ` Lars Ingebrigtsen
2020-11-12 13:53   ` Dmitry Gutov
2020-11-14 15:19     ` Lars Ingebrigtsen
2020-11-14 22:53       ` Dmitry Gutov

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