[PATCH] Overwrite existing file prompt now accepts 'y' and 'n' as shortcuts for 'yes' and 'no'

View: New views
6 Messages — Rating Filter:   Alert me  

[PATCH] Overwrite existing file prompt now accepts 'y' and 'n' as shortcuts for 'yes' and 'no'

by scottjad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It always bothered me that the "Overwrite existing file x?" prompt made me type out yes or no instead of taking y and n. No more!

Cheers,
Scott

---
 modules/minibuffer-read-option.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 modules/minibuffer-read-option.js

diff --git a/modules/minibuffer-read-option.js b/modules/minibuffer-read-option.js
old mode 100644
new mode 100755
index 889b4f5..34deceb
--- a/modules/minibuffer-read-option.js
+++ b/modules/minibuffer-read-option.js
@@ -32,8 +32,8 @@ minibuffer.prototype.read_explicit_option = function () {
 
 minibuffer.prototype.read_yes_or_no = function () {
     keywords(arguments);
-    var result = yield this.read_explicit_option(forward_keywords(arguments), $options = ["yes", "no"]);
-    yield co_return(result == "yes");
+    var result = yield this.read_explicit_option(forward_keywords(arguments), $options = ["yes", "no", "y", "n"]);
+    yield co_return(result == "yes" || result == "y");
 };
 
 function single_character_options_minibuffer_state(continuation) {
--

_______________________________________________
Conkeror mailing list
Conkeror@...
https://www.mozdev.org/mailman/listinfo/conkeror

Re: [PATCH] Overwrite existing file prompt now accepts 'y' and 'n' as shortcuts for 'yes' and 'no'

by Deniz Dogan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/9/11 Scott Jaderholm <jaderholm@...>:

> It always bothered me that the "Overwrite existing file x?" prompt made me
> type out yes or no instead of taking y and n. No more!
>
> Cheers,
> Scott
>
> ---
>  modules/minibuffer-read-option.js |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 modules/minibuffer-read-option.js
>
> diff --git a/modules/minibuffer-read-option.js
> b/modules/minibuffer-read-option.js
> old mode 100644
> new mode 100755
> index 889b4f5..34deceb
> --- a/modules/minibuffer-read-option.js
> +++ b/modules/minibuffer-read-option.js
> @@ -32,8 +32,8 @@ minibuffer.prototype.read_explicit_option = function () {
>
>  minibuffer.prototype.read_yes_or_no = function () {
>      keywords(arguments);
> -    var result = yield
> this.read_explicit_option(forward_keywords(arguments), $options = ["yes",
> "no"]);
> -    yield co_return(result == "yes");
> +    var result = yield
> this.read_explicit_option(forward_keywords(arguments), $options = ["yes",
> "no", "y", "n"]);
> +    yield co_return(result == "yes" || result == "y");
>  };
>
>  function single_character_options_minibuffer_state(continuation) {
> --
>
> _______________________________________________
> Conkeror mailing list
> Conkeror@...
> https://www.mozdev.org/mailman/listinfo/conkeror
>
>

I actually prefer having to write out "yes" because that makes me
think again before actually doing it. My five cents. :)

--
Deniz Dogan
_______________________________________________
Conkeror mailing list
Conkeror@...
https://www.mozdev.org/mailman/listinfo/conkeror

Re: [PATCH] Overwrite existing file prompt now accepts 'y' and 'n' as shortcuts for 'yes' and 'no'

by Sebastian Rose-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Deniz Dogan <deniz.a.m.dogan@...> writes:
> 2009/9/11 Scott Jaderholm <jaderholm@...>:
>> It always bothered me that the "Overwrite existing file x?" prompt made me
>> type out yes or no instead of taking y and n. No more!

Try this in your setup:

  (fset 'yes-or-no-p 'y-or-n-p) ;; y/n instead of `yes/no'



  Sebastian
_______________________________________________
Conkeror mailing list
Conkeror@...
https://www.mozdev.org/mailman/listinfo/conkeror

Re: [PATCH] Overwrite existing file prompt now accepts 'y' and 'n' as shortcuts for 'yes' and 'no'

by Sebastian Rose-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Errr - forgive me - my mind still was on the rong list...


Sebastian Rose <sebastian_rose@...> writes:
> Deniz Dogan <deniz.a.m.dogan@...> writes:
>> 2009/9/11 Scott Jaderholm <jaderholm@...>:
>>> It always bothered me that the "Overwrite existing file x?" prompt made me
>>> type out yes or no instead of taking y and n. No more!
>
> Try this in your setup:
>
>   (fset 'yes-or-no-p 'y-or-n-p) ;; y/n instead of `yes/no'
_______________________________________________
Conkeror mailing list
Conkeror@...
https://www.mozdev.org/mailman/listinfo/conkeror

Re: [PATCH] Overwrite existing file prompt now accepts 'y' and 'n' as shortcuts for 'yes' and 'no'

by Deniz Dogan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/9/11 Sebastian Rose <sebastian_rose@...>:

> Deniz Dogan <deniz.a.m.dogan@...> writes:
>> 2009/9/11 Scott Jaderholm <jaderholm@...>:
>>> It always bothered me that the "Overwrite existing file x?" prompt made me
>>> type out yes or no instead of taking y and n. No more!
>
> Try this in your setup:
>
>  (fset 'yes-or-no-p 'y-or-n-p) ;; y/n instead of `yes/no'
>
>
>
>  Sebastian
>

Scott means in Conkeror, not Emacs. ;)

--
Deniz Dogan
_______________________________________________
Conkeror mailing list
Conkeror@...
https://www.mozdev.org/mailman/listinfo/conkeror

Re: [PATCH] Overwrite existing file prompt now accepts 'y' and 'n' as shortcuts for 'yes' and 'no'

by Jeremy Maitin-Shepard-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Scott Jaderholm <jaderholm@...> writes:

> It always bothered me that the "Overwrite existing file x?" prompt made me
> type out yes or no instead of taking y and n. No more!

It was intentional to require that the full "yes" or "no" be typed to
avoid accidental mistakes.  However, you could create a new
minibuffer.prototype.read_y_or_n function and then in your rc file
assign:

minibuffer.prototype.read_yes_or_no = minibuffer.prototype.read_y_or_n;


--
Jeremy Maitin-Shepard
_______________________________________________
Conkeror mailing list
Conkeror@...
https://www.mozdev.org/mailman/listinfo/conkeror