all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: page-at-a-time output for M-x shell
Date: Mon, 13 Jul 2009 23:43:21 +0200	[thread overview]
Message-ID: <87fxd0gsxy.fsf@galatea.local> (raw)
In-Reply-To: 30a09a22-cd05-44b6-9b82-8a7e6c1796d5@x3g2000yqa.googlegroups.com

Francis Moreau <francis.moro@gmail.com> writes:

> Hello,
>
> M-x term has a nice feature 'page-at-a-time' which I'd like to have in
> M-x shell specially because commands like
>
>    $ cmd-with-a-lof-of-output | less
>    WARNING: terminal is not fully functional
>     -  (press RETURN)
>
> doesn't work properly.
>
> Does anybody know some trick here ?

So, it seems that you don't like PgUp and PgDn, and you don't like M-x
term RET.   Then if you insist om M-x shell, you will have to write
your own pager that doesn't require a smart terminal (which shell is
not):


[pjb@galatea :0.0 ~]$ cat ~/bin/epager
#!/bin/bash
HEIGHT=${HEIGHT:=25}
eof=0
while [ $eof -eq 0 ] ; do
    i=0
    while [ $i -lt $HEIGHT -a $eof -eq 0 ] ; do
        line=''
        read line 
        if [ $? -eq 0 ] ; then
            printf "%s\n" "$line" 
        else
            eof=1
        fi
        i=$(( $i + 1 ))
    done
    read -p 'Press RET to continue, q RET to abort:' rep < /dev/tty
    if [ "$rep" = 'q' ] ; then
        eof=1
    fi
done
[pjb@galatea :0.0 ~]$ cat /home/pjb/tmp/misc/wang | HEIGHT=10 epager
Hao Wang, logicien americain.

L'algorithme en  question  a  ete  publie  en  1960  dans l'IBM Journal,
article intitule "Toward  Mechanical Mathematics", avec des variantes et
une  extension au calcul  des  predicats.  Il  s'agit  ici  du  "premier
programme" de Wang, systeme "P".

L'article a ete ecrit en 1958, et les experiences effectuees sur IBM 704
- machine a lampes, 32 k  mots  de 36 bits, celle-la meme qui vit naitre
LISP a la meme epoque. Le programme  a  ete ecrit en assembleur (Fortran
Press RET to continue, q RET to abort:

existait, mais il ne s'etait pas encore impose)  et  l'auteur estime que
"there is very little in the program that is not straightforward".

Il observe que les preuves engendrees sont "essentiellement des arbres",
et  annonce  que  la  machine  a  demontre 220 theoremes du  calcul  des
propositions  (tautologies)  en  3  minutes. Il en tire argument pour la
superiorite  d'une  approche  algorithmique  par  rapport a une approche
heuristique comme celle du "Logic Theorist" de Newell, Shaw et  Simon (a
partir de 1956 sur la machine JOHNNIAC de la Rand Corporation): un debat
qui dure encore...
Press RET to continue, q RET to abort:


Cet  algorithme  a  ete popularise par J. McCarthy, comme exemple-fanion
d'application  de LISP. Il figure dans le manuel de la premiere  version
de  LISP  (LISP  1,  sur IBM 704 justement, le manuel est date  de  Mars
1960), et il a ete repris dans le celebre "LISP 1.5 Programmer's Manual"
publie en 1962 par MIT Press, un des maitres-livres de l'Informatique.



Press RET to continue, q RET to abort:

[pjb@galatea :0.0 ~]$ cat /home/pjb/tmp/misc/wang | HEIGHT=10 epager
Hao Wang, logicien americain.

L'algorithme en  question  a  ete  publie  en  1960  dans l'IBM Journal,
article intitule "Toward  Mechanical Mathematics", avec des variantes et
une  extension au calcul  des  predicats.  Il  s'agit  ici  du  "premier
programme" de Wang, systeme "P".

L'article a ete ecrit en 1958, et les experiences effectuees sur IBM 704
- machine a lampes, 32 k  mots  de 36 bits, celle-la meme qui vit naitre
LISP a la meme epoque. Le programme  a  ete ecrit en assembleur (Fortran
Press RET to continue, q RET to abort:q
[pjb@galatea :0.0 ~]$ 


-- 
__Pascal Bourguignon__


      parent reply	other threads:[~2009-07-13 21:43 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11 13:14 page-at-a-time output for M-x shell Francis Moreau
2009-07-11 13:56 ` Pascal J. Bourguignon
2009-07-11 15:04   ` Peter Dyballa
2009-07-11 17:29     ` Sumit Narayan
     [not found]   ` <mailman.2292.1247324671.2239.help-gnu-emacs@gnu.org>
2009-07-11 18:06     ` Pascal J. Bourguignon
2009-07-12 12:24   ` Francis Moreau
2009-07-12 17:02     ` Pascal J. Bourguignon
2009-07-11 14:19 ` Peter Dyballa
     [not found] ` <mailman.2288.1247322297.2239.help-gnu-emacs@gnu.org>
2009-07-12 12:20   ` Francis Moreau
2009-07-12 13:45     ` Peter Dyballa
     [not found]     ` <mailman.2349.1247406371.2239.help-gnu-emacs@gnu.org>
2009-07-12 14:12       ` Richard Riley
2009-07-12 17:47         ` Francis Moreau
2009-07-12 17:40       ` Francis Moreau
2009-07-12 17:54         ` Teemu Likonen
2009-07-13  8:07           ` Francis Moreau
2009-07-13  8:21             ` Teemu Likonen
2009-07-13  9:16               ` Francis Moreau
2009-07-13  9:51                 ` Teemu Likonen
2009-07-13 11:27                   ` Francis Moreau
2009-07-13 13:12                     ` Sébastien Vauban
2009-07-13 14:48                       ` Anselm Helbig
2009-07-13 15:07                         ` Teemu Likonen
2009-07-14 15:07                       ` Francis Moreau
2009-07-14 17:16                         ` Pascal J. Bourguignon
2009-07-14 20:02                           ` Francis Moreau
2009-07-14 22:42                             ` Peter Dyballa
2009-07-12 19:41         ` Peter Dyballa
2009-07-13  5:17           ` tomas
2009-07-13  8:10             ` Peter Dyballa
     [not found]         ` <mailman.2380.1247427719.2239.help-gnu-emacs@gnu.org>
2009-07-13  8:03           ` Francis Moreau
2009-07-13  9:04             ` Peter Dyballa
     [not found]             ` <mailman.2414.1247475890.2239.help-gnu-emacs@gnu.org>
2009-07-13  9:38               ` Francis Moreau
2009-07-13 10:43                 ` Peter Dyballa
     [not found]                 ` <mailman.2418.1247481796.2239.help-gnu-emacs@gnu.org>
2009-07-13 11:29                   ` Francis Moreau
2009-07-13 20:42                     ` Samuel Wales
     [not found]                     ` <mailman.2451.1247517772.2239.help-gnu-emacs@gnu.org>
2009-07-13 22:05                       ` Teemu Likonen
     [not found]                       ` <mailman.2453.1247522780.2239.help-gnu-emacs@gnu.org>
2009-07-14 10:55                         ` Pascal J. Bourguignon
2009-07-14 15:10                           ` Francis Moreau
2009-07-14 17:21                             ` Pascal J. Bourguignon
2009-07-14 19:21                               ` tomas
     [not found]                               ` <mailman.2508.1247599009.2239.help-gnu-emacs@gnu.org>
2009-07-14 19:52                                 ` Francis Moreau
2009-07-14 20:39                                   ` Pascal J. Bourguignon
2009-07-14 20:00                         ` Francis Moreau
2009-07-14  3:12                 ` Barry Margolin
2009-07-14  9:21                   ` Miles Bader
2009-07-14 15:20                   ` Francis Moreau
2009-07-14 17:39                     ` Pascal J. Bourguignon
2009-07-14 21:05                     ` Barry Margolin
2009-07-13  9:53               ` Richard Riley
2009-07-12 12:40 ` Teemu Likonen
2009-07-12 13:26   ` Richard Riley
2009-07-12 14:52     ` Thierry Volpiatto
2009-07-13 21:43 ` Pascal J. Bourguignon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fxd0gsxy.fsf@galatea.local \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.