all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13045: 24.2.90; dired-guess-shell-command: default in prompt after colon
@ 2012-12-01 15:03 Christopher Schmidt
  2012-12-02  0:50 ` Juri Linkov
  2012-12-06 13:49 ` Christopher Schmidt
  0 siblings, 2 replies; 4+ messages in thread
From: Christopher Schmidt @ 2012-12-01 15:03 UTC (permalink / raw)
  To: 13045

    emacs -q
    C-x C-f /tmp RET
    M-x load-library RET dired-x RET
    M-! touch rms.tar RET
    g
    # Move point to rms.tar
    !

The prompt says

    ! on rms.tar: {3 guesses} [tar xvf]

I think it should say

    ! on rms.tar {3 guesses} [tar xvf]:

This is consistent with most other commands that insert the default in
the prompt.

The code that generates the prompt is in dired-guess-shell-command.

I think it is a good idea to add a new magic options to Emacs which
will, if customised, unconditionally add the default value, if there is
one, to the minibuffer prompt.  WDYT?

        Christopher





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

* bug#13045: 24.2.90; dired-guess-shell-command: default in prompt after colon
  2012-12-01 15:03 bug#13045: 24.2.90; dired-guess-shell-command: default in prompt after colon Christopher Schmidt
@ 2012-12-02  0:50 ` Juri Linkov
  2012-12-06 13:49 ` Christopher Schmidt
  1 sibling, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2012-12-02  0:50 UTC (permalink / raw)
  To: 13045

> I think it is a good idea to add a new magic options to Emacs which
> will, if customised, unconditionally add the default value, if there is
> one, to the minibuffer prompt.  WDYT?

Indeed a new magic option would be good like proposed in
http://debbugs.gnu.org/12443

This could also display the number of available default values
and the first default, e.g. a customized option:

(defcustom minibuffer-default-prompt-format " (%i defaults, %s)"
 "Default format."
 :type 'string)

Then for your example `dired-guess-shell-command' could display:

    ! on rms.tar (3 defaults, tar xvf):





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

* bug#13045: 24.2.90; dired-guess-shell-command: default in prompt after colon
  2012-12-01 15:03 bug#13045: 24.2.90; dired-guess-shell-command: default in prompt after colon Christopher Schmidt
  2012-12-02  0:50 ` Juri Linkov
@ 2012-12-06 13:49 ` Christopher Schmidt
  2012-12-15 12:05   ` Juri Linkov
  1 sibling, 1 reply; 4+ messages in thread
From: Christopher Schmidt @ 2012-12-06 13:49 UTC (permalink / raw)
  To: 13045

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

Christopher Schmidt <christopher@ch.ristopher.com> writes:
>     emacs -q
>     C-x C-f /tmp RET
>     M-x load-library RET dired-x RET
>     M-! touch rms.tar RET
>     g
>     # Move point to rms.tar
>     !
>
> The prompt says
>
>     ! on rms.tar: {3 guesses} [tar xvf]
>
> I think it should say
>
>     ! on rms.tar {3 guesses} [tar xvf]:
>
> This is consistent with most other commands that insert the default in
> the prompt.
>
> The code that generates the prompt is in dired-guess-shell-command.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dired-guess-shell-command.diff --]
[-- Type: text/x-diff, Size: 893 bytes --]

=== modified file 'lisp/dired-x.el'
--- lisp/dired-x.el	2012-09-25 04:13:02 +0000
+++ lisp/dired-x.el	2012-12-06 13:47:11 +0000
@@ -1114,6 +1114,7 @@
     (if (null default)
         ;; Nothing to guess
         (read-shell-command prompt nil 'dired-shell-command-history)
+      (setq prompt (replace-regexp-in-string ": $" " " prompt))
       (if (listp default)
           ;; More than one guess
           (setq default-list default
@@ -1124,7 +1125,7 @@
         ;; Just one guess
         (setq default-list (list default)))
       ;; Put the first guess in the prompt but not in the initial value.
-      (setq prompt (concat prompt (format "[%s] " default)))
+      (setq prompt (concat prompt (format "[%s]: " default)))
       ;; All guesses can be retrieved with M-n
       (setq val (read-shell-command prompt nil
                                     'dired-shell-command-history


[-- Attachment #3: Type: text/plain, Size: 65 bytes --]


Patch for emacs-24 as of right now.  WDYT?

        Christopher

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

* bug#13045: 24.2.90; dired-guess-shell-command: default in prompt after colon
  2012-12-06 13:49 ` Christopher Schmidt
@ 2012-12-15 12:05   ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2012-12-15 12:05 UTC (permalink / raw)
  To: 13045-done

> === modified file 'lisp/dired-x.el'
> --- lisp/dired-x.el	2012-09-25 04:13:02 +0000
> +++ lisp/dired-x.el	2012-12-06 13:47:11 +0000
> @@ -1114,6 +1114,7 @@
>      (if (null default)
>          ;; Nothing to guess
>          (read-shell-command prompt nil 'dired-shell-command-history)
> +      (setq prompt (replace-regexp-in-string ": $" " " prompt))
>        (if (listp default)
>            ;; More than one guess
>            (setq default-list default
> @@ -1124,7 +1125,7 @@
>          ;; Just one guess
>          (setq default-list (list default)))
>        ;; Put the first guess in the prompt but not in the initial value.
> -      (setq prompt (concat prompt (format "[%s] " default)))
> +      (setq prompt (concat prompt (format "[%s]: " default)))

Thanks, this is a satisfactory short-term solution.  Installed to the trunk.





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

end of thread, other threads:[~2012-12-15 12:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-01 15:03 bug#13045: 24.2.90; dired-guess-shell-command: default in prompt after colon Christopher Schmidt
2012-12-02  0:50 ` Juri Linkov
2012-12-06 13:49 ` Christopher Schmidt
2012-12-15 12:05   ` 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.