Re: mg: print default choice before colon in echo line prompts

2017-08-05 Thread Brian Callahan



On 08/05/17 18:23, Brian Callahan wrote:


On 8/5/2017 5:15 PM, Scott Cheloha wrote:

1 week bump, any other feedback on this?

I can't commit this right now but I'm also ok with it. If no one commits
it by the time I get home later tonight, I'll do it.

~Brian


Committed now--thanks!

~Brian


--
Scott Cheloha


On Jul 30, 2017, at 2:05 AM, Florian Obser  wrote:

OK florian@

[...]




Re: mg: print default choice before colon in echo line prompts

2017-08-05 Thread Brian Callahan


On 8/5/2017 5:15 PM, Scott Cheloha wrote:
> 1 week bump, any other feedback on this?

I can't commit this right now but I'm also ok with it. If no one commits
it by the time I get home later tonight, I'll do it.

~Brian

> --
> Scott Cheloha
>
>> On Jul 30, 2017, at 2:05 AM, Florian Obser  wrote:
>>
>> OK florian@
>>
>> [...]



Re: mg: print default choice before colon in echo line prompts

2017-08-05 Thread Scott Cheloha
1 week bump, any other feedback on this?

--
Scott Cheloha

> On Jul 30, 2017, at 2:05 AM, Florian Obser  wrote:
> 
> OK florian@
> 
> [...]



Re: mg: print default choice before colon in echo line prompts

2017-07-30 Thread Florian Obser
OK florian@

On Sat, Jul 29, 2017 at 04:23:24PM -0500, Scott Cheloha wrote:
> Hi,
> 
> GNU Emacs always, or very nearly always, prints the default
> choice before the colon in any given prompt.  For example,
> you'll see
> 
>   "Kill buffer (default foo): "
> 
> not
> 
>   "Kill buffer: (default foo) "
> 
> This patch moves all default choices before the colon in all
> of mg's prompts.
> 
> While here, add missing spaces in two prompts in tags.c and
> capitalize the tables prompt in tags.c.  The first word of
> a minibuffer prompt is typically capitalized, and all others
> in mg(1) are currently capitalized except for "apropos",
> which is exempt because in that case it's meant to evoke the
> utility of the same name.
> 
> Feedback?
> 
> --
> Scott Cheloha
> 
> Index: usr.bin/mg/buffer.c
> ===
> RCS file: /cvs/src/usr.bin/mg/buffer.c,v
> retrieving revision 1.103
> diff -u -p -r1.103 buffer.c
> --- usr.bin/mg/buffer.c   13 Mar 2017 20:32:58 -  1.103
> +++ usr.bin/mg/buffer.c   29 Jul 2017 20:55:54 -
> @@ -86,7 +86,7 @@ usebuffer(int f, int n)
>   if (curbp->b_altb == NULL)
>   bufp = eread("Switch to buffer: ", bufn, NBUFN, EFNEW | EFBUF);
>   else
> - bufp = eread("Switch to buffer: (default %s) ", bufn, NBUFN,
> + bufp = eread("Switch to buffer (default %s): ", bufn, NBUFN,
>   EFNUL | EFNEW | EFBUF, curbp->b_altb->b_bname);
> 
>   if (bufp == NULL)
> @@ -112,7 +112,7 @@ poptobuffer(int f, int n)
>   bufp = eread("Switch to buffer in other window: ", bufn, NBUFN,
>   EFNEW | EFBUF);
>   else
> - bufp = eread("Switch to buffer in other window: (default %s) ",
> + bufp = eread("Switch to buffer in other window (default %s): ",
>   bufn, NBUFN, EFNUL | EFNEW | EFBUF, curbp->b_altb->b_bname);
>   if (bufp == NULL)
>   return (ABORT);
> @@ -146,7 +146,7 @@ killbuffer_cmd(int f, int n)
> 
>   if (f & FFRAND) /* dired mode 'q' */
>   bp = curbp;
> - else if ((bufp = eread("Kill buffer: (default %s) ", bufn, NBUFN,
> + else if ((bufp = eread("Kill buffer (default %s): ", bufn, NBUFN,
>   EFNUL | EFNEW | EFBUF, curbp->b_bname)) == NULL)
>   return (ABORT);
>   else if (bufp[0] == '\0')
> @@ -746,7 +746,7 @@ bufferinsert(int f, int n)
> 
>   /* Get buffer to use from user */
>   if (curbp->b_altb != NULL)
> - bufp = eread("Insert buffer: (default %s) ", bufn, NBUFN,
> + bufp = eread("Insert buffer (default %s): ", bufn, NBUFN,
>   EFNUL | EFNEW | EFBUF, curbp->b_altb->b_bname);
>   else
>   bufp = eread("Insert buffer: ", bufn, NBUFN, EFNEW | EFBUF);
> Index: usr.bin/mg/re_search.c
> ===
> RCS file: /cvs/src/usr.bin/mg/re_search.c,v
> retrieving revision 1.32
> diff -u -p -r1.32 re_search.c
> --- usr.bin/mg/re_search.c30 May 2017 07:05:22 -  1.32
> +++ usr.bin/mg/re_search.c29 Jul 2017 20:55:54 -
> @@ -429,7 +429,7 @@ re_readpattern(char *re_prompt)
>   if (re_pat[0] == '\0')
>   rep = eread("%s: ", tpat, NPAT, EFNEW | EFCR, re_prompt);
>   else
> - rep = eread("%s: (default %s) ", tpat, NPAT,
> + rep = eread("%s (default %s): ", tpat, NPAT,
>   EFNUL | EFNEW | EFCR, re_prompt, re_pat);
>   if (rep == NULL)
>   return (ABORT);
> Index: usr.bin/mg/search.c
> ===
> RCS file: /cvs/src/usr.bin/mg/search.c,v
> retrieving revision 1.45
> diff -u -p -r1.45 search.c
> --- usr.bin/mg/search.c   30 May 2017 07:05:22 -  1.45
> +++ usr.bin/mg/search.c   29 Jul 2017 20:55:54 -
> @@ -838,7 +838,7 @@ readpattern(char *r_prompt)
>   if (pat[0] == '\0')
>   rep = eread("%s: ", tpat, NPAT, EFNEW | EFCR, r_prompt);
>   else
> - rep = eread("%s: (default %s) ", tpat, NPAT,
> + rep = eread("%s (default %s): ", tpat, NPAT,
>   EFNUL | EFNEW | EFCR, r_prompt, pat);
> 
>   /* specified */
> Index: usr.bin/mg/tags.c
> ===
> RCS file: /cvs/src/usr.bin/mg/tags.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 tags.c
> --- usr.bin/mg/tags.c 30 May 2017 07:05:22 -  1.15
> +++ usr.bin/mg/tags.c 29 Jul 2017 20:55:54 -
> @@ -86,7 +86,7 @@ tagsvisit(int f, int n)
>   return (FALSE);
>   }
>   
> - bufp = eread("visit tags table (default %s): ", fname,
> + bufp = eread("Visit tags table (default %s): ", fname,
>   NFILEN, EFFILE | EFCR | EFNEW | EFDEF, DEFAULTFN);
>   if (bufp == NULL)
>   return (ABORT);
> @@ -150,9 +150,9 @@ findtag(int f, int n)
> 
>   if (curtok

mg: print default choice before colon in echo line prompts

2017-07-29 Thread Scott Cheloha
Hi,

GNU Emacs always, or very nearly always, prints the default
choice before the colon in any given prompt.  For example,
you'll see

"Kill buffer (default foo): "

not

"Kill buffer: (default foo) "

This patch moves all default choices before the colon in all
of mg's prompts.

While here, add missing spaces in two prompts in tags.c and
capitalize the tables prompt in tags.c.  The first word of
a minibuffer prompt is typically capitalized, and all others
in mg(1) are currently capitalized except for "apropos",
which is exempt because in that case it's meant to evoke the
utility of the same name.

Feedback?

--
Scott Cheloha

Index: usr.bin/mg/buffer.c
===
RCS file: /cvs/src/usr.bin/mg/buffer.c,v
retrieving revision 1.103
diff -u -p -r1.103 buffer.c
--- usr.bin/mg/buffer.c 13 Mar 2017 20:32:58 -  1.103
+++ usr.bin/mg/buffer.c 29 Jul 2017 20:55:54 -
@@ -86,7 +86,7 @@ usebuffer(int f, int n)
if (curbp->b_altb == NULL)
bufp = eread("Switch to buffer: ", bufn, NBUFN, EFNEW | EFBUF);
else
-   bufp = eread("Switch to buffer: (default %s) ", bufn, NBUFN,
+   bufp = eread("Switch to buffer (default %s): ", bufn, NBUFN,
EFNUL | EFNEW | EFBUF, curbp->b_altb->b_bname);

if (bufp == NULL)
@@ -112,7 +112,7 @@ poptobuffer(int f, int n)
bufp = eread("Switch to buffer in other window: ", bufn, NBUFN,
EFNEW | EFBUF);
else
-   bufp = eread("Switch to buffer in other window: (default %s) ",
+   bufp = eread("Switch to buffer in other window (default %s): ",
bufn, NBUFN, EFNUL | EFNEW | EFBUF, curbp->b_altb->b_bname);
if (bufp == NULL)
return (ABORT);
@@ -146,7 +146,7 @@ killbuffer_cmd(int f, int n)

if (f & FFRAND) /* dired mode 'q' */
bp = curbp;
-   else if ((bufp = eread("Kill buffer: (default %s) ", bufn, NBUFN,
+   else if ((bufp = eread("Kill buffer (default %s): ", bufn, NBUFN,
EFNUL | EFNEW | EFBUF, curbp->b_bname)) == NULL)
return (ABORT);
else if (bufp[0] == '\0')
@@ -746,7 +746,7 @@ bufferinsert(int f, int n)

/* Get buffer to use from user */
if (curbp->b_altb != NULL)
-   bufp = eread("Insert buffer: (default %s) ", bufn, NBUFN,
+   bufp = eread("Insert buffer (default %s): ", bufn, NBUFN,
EFNUL | EFNEW | EFBUF, curbp->b_altb->b_bname);
else
bufp = eread("Insert buffer: ", bufn, NBUFN, EFNEW | EFBUF);
Index: usr.bin/mg/re_search.c
===
RCS file: /cvs/src/usr.bin/mg/re_search.c,v
retrieving revision 1.32
diff -u -p -r1.32 re_search.c
--- usr.bin/mg/re_search.c  30 May 2017 07:05:22 -  1.32
+++ usr.bin/mg/re_search.c  29 Jul 2017 20:55:54 -
@@ -429,7 +429,7 @@ re_readpattern(char *re_prompt)
if (re_pat[0] == '\0')
rep = eread("%s: ", tpat, NPAT, EFNEW | EFCR, re_prompt);
else
-   rep = eread("%s: (default %s) ", tpat, NPAT,
+   rep = eread("%s (default %s): ", tpat, NPAT,
EFNUL | EFNEW | EFCR, re_prompt, re_pat);
if (rep == NULL)
return (ABORT);
Index: usr.bin/mg/search.c
===
RCS file: /cvs/src/usr.bin/mg/search.c,v
retrieving revision 1.45
diff -u -p -r1.45 search.c
--- usr.bin/mg/search.c 30 May 2017 07:05:22 -  1.45
+++ usr.bin/mg/search.c 29 Jul 2017 20:55:54 -
@@ -838,7 +838,7 @@ readpattern(char *r_prompt)
if (pat[0] == '\0')
rep = eread("%s: ", tpat, NPAT, EFNEW | EFCR, r_prompt);
else
-   rep = eread("%s: (default %s) ", tpat, NPAT,
+   rep = eread("%s (default %s): ", tpat, NPAT,
EFNUL | EFNEW | EFCR, r_prompt, pat);

/* specified */
Index: usr.bin/mg/tags.c
===
RCS file: /cvs/src/usr.bin/mg/tags.c,v
retrieving revision 1.15
diff -u -p -r1.15 tags.c
--- usr.bin/mg/tags.c   30 May 2017 07:05:22 -  1.15
+++ usr.bin/mg/tags.c   29 Jul 2017 20:55:54 -
@@ -86,7 +86,7 @@ tagsvisit(int f, int n)
return (FALSE);
}

-   bufp = eread("visit tags table (default %s): ", fname,
+   bufp = eread("Visit tags table (default %s): ", fname,
NFILEN, EFFILE | EFCR | EFNEW | EFDEF, DEFAULTFN);
if (bufp == NULL)
return (ABORT);
@@ -150,9 +150,9 @@ findtag(int f, int n)

if (curtoken(f, n, dtok) == FALSE) {
dtok[0] = '\0';
-   bufp = eread("Find tag:", utok, MAX_TOKEN, EFNUL | EFNEW);
+   bufp = eread("Find tag: ", utok, MAX_TOKEN, EFNUL | EFNEW);
} else