Re: [fossil-users] [PROPOSED FEATURE] Fossil commands output sent through a pager

2017-03-23 Thread Roy Keene
I vote that the pagination be off by default to preserve the existing 
behaviour -- terminals have been able to scroll for decades now so I don't 
know why systemd/git like to do this by default but it is REALLY annoying 
having to pipe EVERYTHING through "cat" to defeat it.


(Also, even better than scrolling -- my terminal can search 
forwards/backwards/copy/paste, etc, it's real handy.)


On Thu, 23 Mar 2017, Christophe Gouiran wrote:


Good morning,

I would like to implement the feature given in the title.
I'm inspired by what Git (by default ?) and Mercurial (with Pager extension 
activated) do.

I'd like to avoid typing "fossil  | less" everytime I notice it 
produces an output which doesn't fit in a single screen.

Find below my ideas (in no particular order).
Settings :
 1. Add a new boolean setting "Paginates commands" (it is true by default)
 2. Add a new string setting "pager-command" (it is empty by default)
 3. Add a new string setting "Commands to paginate" (default value to be 
defined)

If pager-command is empty then following pager command will be used:

 1. "more" under Windows.
 2. "less -FRSX" under any other OS.

When Fossil writes something to its standard output, then it is sent through 
the pager if (and only if) all following conditions are met:

 1. Fossil standard output is a real terminal.
 2. "Paginates commands" setting is true.
 3. Executed command is indicated in "Commands to paginate" setting.

Fossil standard error must not be paginated.


Now I'm waiting for your advices/improvements/feedbacks.

For example:

 1. Should the settings be versionnable ?
 2. Which commands to be put by default in "Commands to paginate" ?


Many thanks in advance for taking the time to participate.





___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] [PROPOSED FEATURE] Fossil commands output sent through a pager

2017-03-23 Thread Richard Hipp
I think there should be a single setting, pager-command, which the
pager uses for *all* command-line output if it defined.  The setting
defaults to an empty string, which means no pagination.  I don't think
you want to select some subset of commands to be paginated.  Do them
all, or do none of them.

This should not be a versionable setting since it has nothing to do
with the project and is merely a user display preference.

Implement it by hooking into the fossil_print() function (in printf.c)
which should be used for all output already.  (There may be exceptions
to this, but those will be bugs that need fixing.)  Probably you will
want to accumulate text in a buffer until you know you are going to
have more than 24 lines, and only invoke the pager if the number of
lines exceeds 24.

You will also need to hook the various prompt_*() routines to convince
them to flush the pager buffer.  I do not think any prompt_*() will
ever occur after more than 2 or 3 llines of output, so there should
never be a case where the pager has already started when the prompt_()
is run.

Let me just say that I really loath software, like the "man" command
on Ubuntu, that thinks it is doing me a favor by running a pager for
me automatically.  I haven't voluntarily used a pager since back in
the 80s when my terminal was a (real) VT100.  If output is long, I'll
scroll back or I will pipe into "open -f" which just works on Mac and
for which I have a reasonable work-a-like on Linux.  If I'm working
remote, I'll redirect to a file, then scp the file back to my desktop
and bring it up in an editor there.  I'm not alone in these habits.  I
say all this just to emphasize that the default value for the
pager-command should definitely be OFF.


On 3/23/17, Christophe Gouiran  wrote:
> Good morning,
>
> I would like to implement the feature given in the title.
> I'm inspired by what Git (by default ?) and Mercurial (with Pager
>  extension activated)
> do.
>
> I'd like to avoid typing "fossil  | less" everytime I notice it
> produces an output which doesn't fit in a single screen.
>
> Find below my ideas (in no particular order).
>
> Settings :
>
>1. Add a new boolean setting "Paginates commands" (it is true by
> default)
>2. Add a new string setting "pager-command" (it is empty by default)
>3. Add a new string setting "Commands to paginate" (default value to be
>defined)
>
> If pager-command is empty then following pager command will be used:
>
>1. "more" under Windows.
>2. "less -FRSX" under any other OS.
>
> When Fossil writes something to its standard output, then it is sent
> through the pager if (and only if) all following conditions are met:
>
>1. Fossil standard output is a real terminal.
>2. "Paginates commands" setting is true.
>3. Executed command is indicated in "Commands to paginate" setting.
>
> *Fossil standard error must not be paginated.*
>
>
> Now I'm waiting for your advices/improvements/feedbacks.
>
> For example:
>
>1. Should the settings be versionnable ?
>2. Which commands to be put by default in "Commands to paginate" ?
>
>
> Many thanks in advance for taking the time to participate.
>


-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] [PROPOSED FEATURE] Fossil commands output sent through a pager

2017-03-23 Thread Scott Robison
I don't know about what commands to paginate by default, but no to
versionable settings for this. Don't want to force this on others.

On Mar 23, 2017 4:08 PM, "Christophe Gouiran" 
wrote:

> Good morning,
>
> I would like to implement the feature given in the title.
> I'm inspired by what Git (by default ?) and Mercurial (with Pager
>  extension activated)
> do.
>
> I'd like to avoid typing "fossil  | less" everytime I notice it
> produces an output which doesn't fit in a single screen.
>
> Find below my ideas (in no particular order).
>
> Settings :
>
>1. Add a new boolean setting "Paginates commands" (it is true by
>default)
>2. Add a new string setting "pager-command" (it is empty by default)
>3. Add a new string setting "Commands to paginate" (default value to
>be defined)
>
> If pager-command is empty then following pager command will be used:
>
>1. "more" under Windows.
>2. "less -FRSX" under any other OS.
>
> When Fossil writes something to its standard output, then it is sent
> through the pager if (and only if) all following conditions are met:
>
>1. Fossil standard output is a real terminal.
>2. "Paginates commands" setting is true.
>3. Executed command is indicated in "Commands to paginate" setting.
>
> *Fossil standard error must not be paginated.*
>
>
> Now I'm waiting for your advices/improvements/feedbacks.
>
> For example:
>
>1. Should the settings be versionnable ?
>2. Which commands to be put by default in "Commands to paginate" ?
>
>
> Many thanks in advance for taking the time to participate.
>
>
>
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>
>
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] [PROPOSED FEATURE] Fossil commands output sent through a pager

2017-03-23 Thread Christophe Gouiran
Good morning,

I would like to implement the feature given in the title.
I'm inspired by what Git (by default ?) and Mercurial (with Pager
 extension activated) do.

I'd like to avoid typing "fossil  | less" everytime I notice it
produces an output which doesn't fit in a single screen.

Find below my ideas (in no particular order).

Settings :

   1. Add a new boolean setting "Paginates commands" (it is true by default)
   2. Add a new string setting "pager-command" (it is empty by default)
   3. Add a new string setting "Commands to paginate" (default value to be
   defined)

If pager-command is empty then following pager command will be used:

   1. "more" under Windows.
   2. "less -FRSX" under any other OS.

When Fossil writes something to its standard output, then it is sent
through the pager if (and only if) all following conditions are met:

   1. Fossil standard output is a real terminal.
   2. "Paginates commands" setting is true.
   3. Executed command is indicated in "Commands to paginate" setting.

*Fossil standard error must not be paginated.*


Now I'm waiting for your advices/improvements/feedbacks.

For example:

   1. Should the settings be versionnable ?
   2. Which commands to be put by default in "Commands to paginate" ?


Many thanks in advance for taking the time to participate.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] [PATCH] Makes NORETURN macro meaningful for msvc

2017-03-23 Thread Christophe Gouiran
Good morning,

When I compile Fossil revision [f21820f4] with Visual C++ 2010 I get
following warning:
import.c(1275) : warning C4715: 'svn_handle_symlinks' : not all control
paths return a value

Although, at line 1270 there is:
fossil_fatal("Too short symbolic link path");

which is a NORETURN function but the macro is only defined for gcc or clang
compilers.


Proposed patch add definition of NORETURN macro for msvc compiler and the
warning vanishes.



Index: src/config.h
==
--- src/config.h
+++ src/config.h
@@ -229,10 +229,12 @@
 /*
 ** A marker for functions that never return.
 */
 #if defined(__GNUC__) || defined(__clang__)
 # define NORETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+# define NORETURN __declspec(noreturn)
 #else
 # define NORETURN
 #endif
 
 /*

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users