* Re: master b8d4242e8bd 1/2: New user option 'shell-command-guess-functions' (bug#18132)
[not found] ` <20231127173714.78D41C36D10@vcs2.savannah.gnu.org>
@ 2023-11-29 19:14 ` Arash Esbati
2023-11-30 6:08 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Arash Esbati @ 2023-11-29 19:14 UTC (permalink / raw)
To: emacs-devel; +Cc: Juri Linkov
Juri Linkov <juri@jurta.org> writes:
> branch: master
> commit b8d4242e8bdbdb6ca364bf0760e50689f6a6e118
> Author: Juri Linkov <juri@linkov.net>
> Commit: Juri Linkov <juri@linkov.net>
> [...]
> diff --git a/lisp/simple.el b/lisp/simple.el
> index 02c68912dba..35bce6ab4b8 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -4273,19 +4273,17 @@ This buffer is used when `shell-command' or `shell-command-on-region'
> is run interactively. A value of nil means that output to stderr and
> stdout will be intermixed in the output stream.")
>
> -(declare-function mailcap-file-default-commands "mailcap" (files))
> (declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep))
>
> (defun minibuffer-default-add-shell-commands ()
> "Return a list of all commands associated with the current file.
> -This function is used to add all related commands retrieved by `mailcap'
> -to the end of the list of defaults just after the default value."
> - (interactive)
> +This function is used to add all related commands retrieved by
> +`shell-command-guess' to the end of the list of defaults just
> +after the default value."
> (let* ((filename (if (listp minibuffer-default)
> (car minibuffer-default)
> minibuffer-default))
> - (commands (and filename (require 'mailcap nil t)
> - (mailcap-file-default-commands (list filename)))))
> + (commands (and filename (shell-command-guess (list filename)))))
> (setq commands (mapcar (lambda (command)
> (concat command " " filename))
> commands))
This give me:
ELC+ELN ../lisp/simple.elc
In end of data:
simple.el:4286:35: Warning: the function ‘shell-command-guess’ is not
known to be defined.
Maybe you want to declare that function? This is with Emacs 30
(a811846879) on macOS.
Best, Arash
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master b8d4242e8bd 1/2: New user option 'shell-command-guess-functions' (bug#18132)
2023-11-29 19:14 ` master b8d4242e8bd 1/2: New user option 'shell-command-guess-functions' (bug#18132) Arash Esbati
@ 2023-11-30 6:08 ` Eli Zaretskii
2023-11-30 17:22 ` Juri Linkov
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-11-30 6:08 UTC (permalink / raw)
To: Arash Esbati; +Cc: emacs-devel, juri
> From: Arash Esbati <arash@gnu.org>
> Cc: Juri Linkov <juri@linkov.net>
> Date: Wed, 29 Nov 2023 20:14:54 +0100
>
> Juri Linkov <juri@jurta.org> writes:
>
> > (defun minibuffer-default-add-shell-commands ()
> > "Return a list of all commands associated with the current file.
> > -This function is used to add all related commands retrieved by `mailcap'
> > -to the end of the list of defaults just after the default value."
> > - (interactive)
> > +This function is used to add all related commands retrieved by
> > +`shell-command-guess' to the end of the list of defaults just
> > +after the default value."
> > (let* ((filename (if (listp minibuffer-default)
> > (car minibuffer-default)
> > minibuffer-default))
> > - (commands (and filename (require 'mailcap nil t)
> > - (mailcap-file-default-commands (list filename)))))
> > + (commands (and filename (shell-command-guess (list filename)))))
> > (setq commands (mapcar (lambda (command)
> > (concat command " " filename))
> > commands))
>
> This give me:
>
> ELC+ELN ../lisp/simple.elc
> In end of data:
> simple.el:4286:35: Warning: the function ‘shell-command-guess’ is not
> known to be defined.
>
> Maybe you want to declare that function? This is with Emacs 30
> (a811846879) on macOS.
Same as previously: recompile once more, and the warning will be gone.
There's no problem here.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master b8d4242e8bd 1/2: New user option 'shell-command-guess-functions' (bug#18132)
2023-11-30 6:08 ` Eli Zaretskii
@ 2023-11-30 17:22 ` Juri Linkov
2023-11-30 17:55 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2023-11-30 17:22 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Arash Esbati, emacs-devel
>> ELC+ELN ../lisp/simple.elc
>> In end of data:
>> simple.el:4286:35: Warning: the function ‘shell-command-guess’ is not
>> known to be defined.
>>
>> Maybe you want to declare that function? This is with Emacs 30
>> (a811846879) on macOS.
>
> Same as previously: recompile once more, and the warning will be gone.
>
> There's no problem here.
I still see this warning on bootstrap:
In end of data:
simple.el:4286:35: Warning: the function `shell-command-guess' is not known to be defined.
I expected that ;;;###autoload will add it to the global loaddefs.el,
and only ;;;###dired-autoload will add it to dired-loaddefs.el.
But actually ;;;###autoload adds it to dired-loaddefs.el.
I don't know if there is a way to override this only for one autoload:
;; generated-autoload-file: "dired-loaddefs.el"
Something like using ;;;###global-autoload?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master b8d4242e8bd 1/2: New user option 'shell-command-guess-functions' (bug#18132)
2023-11-30 17:22 ` Juri Linkov
@ 2023-11-30 17:55 ` Eli Zaretskii
2023-11-30 18:12 ` Juri Linkov
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-11-30 17:55 UTC (permalink / raw)
To: Juri Linkov; +Cc: arash, emacs-devel
> From: Juri Linkov <juri@linkov.net>
> Cc: Arash Esbati <arash@gnu.org>, emacs-devel@gnu.org
> Date: Thu, 30 Nov 2023 19:22:03 +0200
>
> >> ELC+ELN ../lisp/simple.elc
> >> In end of data:
> >> simple.el:4286:35: Warning: the function ‘shell-command-guess’ is not
> >> known to be defined.
> >>
> >> Maybe you want to declare that function? This is with Emacs 30
> >> (a811846879) on macOS.
> >
> > Same as previously: recompile once more, and the warning will be gone.
> >
> > There's no problem here.
>
> I still see this warning on bootstrap:
>
> In end of data:
> simple.el:4286:35: Warning: the function `shell-command-guess' is not known to be defined.
>
> I expected that ;;;###autoload will add it to the global loaddefs.el,
> and only ;;;###dired-autoload will add it to dired-loaddefs.el.
> But actually ;;;###autoload adds it to dired-loaddefs.el.
>
> I don't know if there is a way to override this only for one autoload:
>
> ;; generated-autoload-file: "dired-loaddefs.el"
>
> Something like using ;;;###global-autoload?
Autoloading is the wrong tool for preloaded stuff. Did you try
declare-function?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master b8d4242e8bd 1/2: New user option 'shell-command-guess-functions' (bug#18132)
2023-11-30 17:55 ` Eli Zaretskii
@ 2023-11-30 18:12 ` Juri Linkov
0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2023-11-30 18:12 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: arash, emacs-devel
>> In end of data:
>> simple.el:4286:35: Warning: the function `shell-command-guess' is not known to be defined.
>>
>> I expected that ;;;###autoload will add it to the global loaddefs.el,
>> and only ;;;###dired-autoload will add it to dired-loaddefs.el.
>> But actually ;;;###autoload adds it to dired-loaddefs.el.
>>
>> I don't know if there is a way to override this only for one autoload:
>>
>> ;; generated-autoload-file: "dired-loaddefs.el"
>>
>> Something like using ;;;###global-autoload?
>
> Autoloading is the wrong tool for preloaded stuff. Did you try
> declare-function?
Ok, now added declare-function that removed this warning.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-30 18:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <170110663333.10282.3772392230229139487@vcs2.savannah.gnu.org>
[not found] ` <20231127173714.78D41C36D10@vcs2.savannah.gnu.org>
2023-11-29 19:14 ` master b8d4242e8bd 1/2: New user option 'shell-command-guess-functions' (bug#18132) Arash Esbati
2023-11-30 6:08 ` Eli Zaretskii
2023-11-30 17:22 ` Juri Linkov
2023-11-30 17:55 ` Eli Zaretskii
2023-11-30 18:12 ` Juri Linkov
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.