* page-at-a-time output for M-x shell @ 2009-07-11 13:14 Francis Moreau 2009-07-11 13:56 ` Pascal J. Bourguignon ` (4 more replies) 0 siblings, 5 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-11 13:14 UTC (permalink / raw) To: help-gnu-emacs 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 ? Thanks ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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 ` (2 more replies) 2009-07-11 14:19 ` Peter Dyballa ` (3 subsequent siblings) 4 siblings, 3 replies; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-11 13:56 UTC (permalink / raw) To: help-gnu-emacs 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 ? I've got: ----(~/.emacs_bash)----------------------------------------------------- unset LC_MONETARY unset LC_NUMERIC unset LC_MESSAGES unset LC_COLLATE unset LC_CTYPE unset LC_TIME export LC_CTYPE=en_US.UTF-8 export PAGER=cat export TERM=emacs alias less=cat alias more=cat stty rows 10000 columns 80 echo '# welcome to emacs shell' ------------------------------------------------------------------------ Then I use PgUp and PgDn after a cmd-with-a-lot-of-output -- __Pascal Bourguignon__ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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-12 12:24 ` Francis Moreau 2 siblings, 1 reply; 53+ messages in thread From: Peter Dyballa @ 2009-07-11 15:04 UTC (permalink / raw) To: Pascal J. Bourguignon; +Cc: help-gnu-emacs Am 11.07.2009 um 15:56 schrieb Pascal J. Bourguignon: > Then I use PgUp and PgDn after a cmd-with-a-lot-of-output Well, PgUp and PgDn make it necessary that you read. GNU Emacs can it better and faster! So I just let it search for something when I've found some time… -- Greetings Pete They're putting dimes in the hole in my head to see the change in me. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-11 15:04 ` Peter Dyballa @ 2009-07-11 17:29 ` Sumit Narayan 0 siblings, 0 replies; 53+ messages in thread From: Sumit Narayan @ 2009-07-11 17:29 UTC (permalink / raw) To: Peter Dyballa; +Cc: Pascal J. Bourguignon, help-gnu-emacs I usually use C-r to return to the beginning of the previous command. Works fine on shell and eshell. C-e will take you back to the prompt. Sumit. On Sat, Jul 11, 2009 at 10:04 AM, Peter Dyballa<Peter_Dyballa@web.de> wrote: > > Am 11.07.2009 um 15:56 schrieb Pascal J. Bourguignon: > >> Then I use PgUp and PgDn after a cmd-with-a-lot-of-output > > > Well, PgUp and PgDn make it necessary that you read. GNU Emacs can it better > and faster! So I just let it search for something when I've found some time… > > -- > Greetings > > Pete > > They're putting dimes in the hole in my head to see the change in me. > > > > > > ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2292.1247324671.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [not found] ` <mailman.2292.1247324671.2239.help-gnu-emacs@gnu.org> @ 2009-07-11 18:06 ` Pascal J. Bourguignon 0 siblings, 0 replies; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-11 18:06 UTC (permalink / raw) To: help-gnu-emacs Peter Dyballa <Peter_Dyballa@Web.DE> writes: > Am 11.07.2009 um 15:56 schrieb Pascal J. Bourguignon: > >> Then I use PgUp and PgDn after a cmd-with-a-lot-of-output > > > Well, PgUp and PgDn make it necessary that you read. Which is what the OP wanted to do, otherwise he would have used |grep 'target' instead of |less. > GNU Emacs can it > better and faster! So I just let it search for something when I've > found some time… -- __Pascal Bourguignon__ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-11 13:56 ` Pascal J. Bourguignon 2009-07-11 15:04 ` Peter Dyballa [not found] ` <mailman.2292.1247324671.2239.help-gnu-emacs@gnu.org> @ 2009-07-12 12:24 ` Francis Moreau 2009-07-12 17:02 ` Pascal J. Bourguignon 2 siblings, 1 reply; 53+ messages in thread From: Francis Moreau @ 2009-07-12 12:24 UTC (permalink / raw) To: help-gnu-emacs Hello, On Jul 11, 3:56 pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: [...] > Then I use PgUp and PgDn after a cmd-with-a-lot-of-output That's not what I want because it's not convenient otherwise PAGER in all environment would be almost useless. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-12 12:24 ` Francis Moreau @ 2009-07-12 17:02 ` Pascal J. Bourguignon 0 siblings, 0 replies; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-12 17:02 UTC (permalink / raw) To: help-gnu-emacs Francis Moreau <francis.moro@gmail.com> writes: > Hello, > > On Jul 11, 3:56 pm, p...@informatimago.com (Pascal J. Bourguignon) > wrote: > > [...] > >> Then I use PgUp and PgDn after a cmd-with-a-lot-of-output > > That's not what I want because it's not convenient otherwise PAGER in > all environment would be almost useless. If your purpose is to use a pager, then use M-x term RET C-c C-q instead. On the other hand, if your purpose is to read the output of a command, then use M-x shell and PgUp / PgDn. -- __Pascal Bourguignon__ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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 14:19 ` Peter Dyballa [not found] ` <mailman.2288.1247322297.2239.help-gnu-emacs@gnu.org> ` (2 subsequent siblings) 4 siblings, 0 replies; 53+ messages in thread From: Peter Dyballa @ 2009-07-11 14:19 UTC (permalink / raw) To: Francis Moreau; +Cc: help-gnu-emacs Am 11.07.2009 um 15:14 schrieb Francis Moreau: > Does anybody know some trick here ? I'm leaving away the ' | less' part. -- Greetings Pete Who the fsck is "General Failure," and why is he reading my disk? ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2288.1247322297.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [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> 0 siblings, 2 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-12 12:20 UTC (permalink / raw) To: help-gnu-emacs On Jul 11, 4:19 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: > Am 11.07.2009 um 15:14 schrieb Francis Moreau: > > > Does anybody know some trick here ? > > I'm leaving away the ' | less' part. > Hm, I'm probably missing your point, but I don't see how does that solve my issue... I'd want to use a pager with 'M-x shell' but ' | $PAGER' doesn't work nicely in emacs shell. So if I loose the '| $PAGER' part, I loose the functionnality I want to have as well... ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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> 1 sibling, 0 replies; 53+ messages in thread From: Peter Dyballa @ 2009-07-12 13:45 UTC (permalink / raw) To: Francis Moreau; +Cc: help-gnu-emacs Am 12.07.2009 um 14:20 schrieb Francis Moreau: > I'd want to use a pager with 'M-x shell' Why? Is it so hard for you to understand that GNU Emacs is no terminal emulation? -- Greetings Pete I wouldn't recommend sex, drugs or insanity for everyone, but they've always worked for me. – Hunter S. Thompson ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2349.1247406371.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [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 1 sibling, 1 reply; 53+ messages in thread From: Richard Riley @ 2009-07-12 14:12 UTC (permalink / raw) To: help-gnu-emacs Peter Dyballa <Peter_Dyballa@Web.DE> writes: > Am 12.07.2009 um 14:20 schrieb Francis Moreau: > >> I'd want to use a pager with 'M-x shell' > > Why? Is it so hard for you to understand that GNU Emacs is no > terminal emulation? I'm not sure I understand you. You can use a pager such as less in a multi-term. Why is he so wrong to enquire about just that? ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-12 14:12 ` Richard Riley @ 2009-07-12 17:47 ` Francis Moreau 0 siblings, 0 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-12 17:47 UTC (permalink / raw) To: help-gnu-emacs On Jul 12, 4:12 pm, Richard Riley <rileyrg...@gmail.com> wrote: > > You can use a pager such as less in a multi-term. Why is he so wrong to > enquire about just that? I don't know either. One weird thing, is that 'M-x term' is a term emulation where less(1) works and it has the 'C-c C-q' one-page-at-a-time thing as well... M-x shell, has neither. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell [not found] ` <mailman.2349.1247406371.2239.help-gnu-emacs@gnu.org> 2009-07-12 14:12 ` Richard Riley @ 2009-07-12 17:40 ` Francis Moreau 2009-07-12 17:54 ` Teemu Likonen ` (2 more replies) 1 sibling, 3 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-12 17:40 UTC (permalink / raw) To: help-gnu-emacs On Jul 12, 3:45 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: > Am 12.07.2009 um 14:20 schrieb Francis Moreau: > > > I'd want to use a pager with 'M-x shell' > > Why? Is it so hard for you to understand that GNU Emacs is no > terminal emulation? > Peter, From what I saw, your posts are usually helpful but here I must admit that it's totaly pointeless and useless. If you don't know or if emacs don't know, then simply say it, I can certainly live with that. Is Gnu Emacs a news reader ? a erc client ? ... No, but guess what, some people wrote some nice package to extend emacs functionnality and they work. Oh some other people extend emacs to add shell functionality in Emacs ! And why is it so hard to understand that a pager feature would be nice in this package ? Some other Emacs commands already do that, M-x shell get the output of the command and put it in the buffer, so I would guess that it's not that hard to tell Emacs to display one page of output at time but it's just a guess... Cheers ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-12 17:40 ` Francis Moreau @ 2009-07-12 17:54 ` Teemu Likonen 2009-07-13 8:07 ` Francis Moreau 2009-07-12 19:41 ` Peter Dyballa [not found] ` <mailman.2380.1247427719.2239.help-gnu-emacs@gnu.org> 2 siblings, 1 reply; 53+ messages in thread From: Teemu Likonen @ 2009-07-12 17:54 UTC (permalink / raw) To: help-gnu-emacs On 2009-07-12 10:40 (-0700), Francis Moreau wrote: > Some other Emacs commands already do that, M-x shell get the output of > the command and put it in the buffer, so I would guess that it's not > that hard to tell Emacs to display one page of output at time but it's > just a guess... Please understand that "less" needs a _terminal_. Emacs's shell-mode is not a terminal so "less" doesn't work. If the programs you use needs terminal features then you must use a terminal, such as "M-x term". ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-12 17:54 ` Teemu Likonen @ 2009-07-13 8:07 ` Francis Moreau 2009-07-13 8:21 ` Teemu Likonen 0 siblings, 1 reply; 53+ messages in thread From: Francis Moreau @ 2009-07-13 8:07 UTC (permalink / raw) To: help-gnu-emacs On Jul 12, 7:54 pm, Teemu Likonen <tliko...@iki.fi> wrote: > On 2009-07-12 10:40 (-0700), Francis Moreau wrote: > > > Some other Emacs commands already do that, M-x shell get the output of > > the command and put it in the buffer, so I would guess that it's not > > that hard to tell Emacs to display one page of output at time but it's > > just a guess... > > Please understand that "less" needs a _terminal_. Emacs's shell-mode is > not a terminal so "less" doesn't work. If the programs you use needs > terminal features then you must use a terminal, such as "M-x term". I did understand that ! If you read my post carefully, I'm asking why 'page-at-a-time' feature (available in M-x term) is not implemented in M-x shell where it would seem to be more needed. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-13 8:07 ` Francis Moreau @ 2009-07-13 8:21 ` Teemu Likonen 2009-07-13 9:16 ` Francis Moreau 0 siblings, 1 reply; 53+ messages in thread From: Teemu Likonen @ 2009-07-13 8:21 UTC (permalink / raw) To: help-gnu-emacs On 2009-07-13 01:07 (-0700), Francis Moreau wrote: > On Jul 12, 7:54 pm, Teemu Likonen <tliko...@iki.fi> wrote: >> Please understand that "less" needs a _terminal_. Emacs's shell-mode >> is not a terminal so "less" doesn't work. If the programs you use >> needs terminal features then you must use a terminal, such as "M-x >> term". > > I did understand that ! > > If you read my post carefully, I'm asking why 'page-at-a-time' feature > (available in M-x term) is not implemented in M-x shell where it would > seem to be more needed. OK, then it's probably me who fails to understand why do you keep talking about "M-x shell" when you need a terminal. This "page-at-a-time" feature comes with terminal emulation. There's no need to make "M-x shell" a real terminal because there already is one: "M-x term". Is there something wrong with "M-x term"? ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-13 8:21 ` Teemu Likonen @ 2009-07-13 9:16 ` Francis Moreau 2009-07-13 9:51 ` Teemu Likonen 0 siblings, 1 reply; 53+ messages in thread From: Francis Moreau @ 2009-07-13 9:16 UTC (permalink / raw) To: help-gnu-emacs On Jul 13, 10:21 am, Teemu Likonen <tliko...@iki.fi> wrote: > > OK, then it's probably me who fails to understand why do you keep > talking about "M-x shell" when you need a terminal. This > "page-at-a-time" feature comes with terminal emulation. There's no need > to make "M-x shell" a real terminal because there already is one: "M-x > term". Ok then it's probably me who fails to understand the point of "M-x shell"... Just because it's not a real terminal emulation, does that mean it should be boring to be used with commands with a lot of output (hence lot of processing) ? If "M-x shell" implements this 'page-at-a-time' feature, does that mean it becomes a real term emulation ? Is it really that much hard to make "M-x shell" mimics the one page at a time ? Maybe this shows one of the Emacs' drawback: there're so many packages out there which implement the same functionnality but differently and with different limitations and that make the user confused and spend a lot of time to wonder/try each of all of these packages. And eventually once the use makes a choice: "ok this package is good enough but I miss this X functionnality". So now he's asking why X functionnality is not implemented, and he got some answers like: "there's an 10th package you should look at" or "just don't be silly and use package 'A'".... > Is there something wrong with "M-x term"? Not really, but I found it not very well suited to be used inside Emacs: the key bindings are not very friendly with the rest of Emacs and sometimes the output is screwed, I dunno why. So it's not very integrated to Emacs, and I just prefer start another term outside emacs if I want a real term emulation. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-13 9:16 ` Francis Moreau @ 2009-07-13 9:51 ` Teemu Likonen 2009-07-13 11:27 ` Francis Moreau 0 siblings, 1 reply; 53+ messages in thread From: Teemu Likonen @ 2009-07-13 9:51 UTC (permalink / raw) To: help-gnu-emacs On 2009-07-13 02:16 (-0700), Francis Moreau wrote: > On Jul 13, 10:21 am, Teemu Likonen <tliko...@iki.fi> wrote: >> >> OK, then it's probably me who fails to understand why do you keep >> talking about "M-x shell" when you need a terminal. This >> "page-at-a-time" feature comes with terminal emulation. There's no >> need to make "M-x shell" a real terminal because there already is >> one: "M-x term". > > Ok then it's probably me who fails to understand the point of "M-x > shell"... The documentation says "Major mode for interacting with an inferior shell" (C-h f shell-mode). It's like repeated M-! but more convenient. > If "M-x shell" implements this 'page-at-a-time' feature, does that > mean it becomes a real term emulation ? To make "less" work it needs some terminal features so it would heading towards that direction, that is, towards term-mode which already exists. Perhaps someone could write some custom pager system in shell-mode but it still wouldn't make "less" work. > Is it really that much hard to make "M-x shell" mimics the one page at > a time ? You can write to emacs-devel mailing list and ask. I don't know. >> Is there something wrong with "M-x term"? > > Not really, but I found it not very well suited to be used inside > Emacs: the key bindings are not very friendly with the rest of Emacs > and sometimes the output is screwed, I dunno why. So it's not very > integrated to Emacs, and I just prefer start another term outside > emacs if I want a real term emulation. If you can present the problems in a clear way you could report them as bugs, with "M-x report-emacs-bug" command. I don't use term-mode (nor shell-mode for that matter) much but I have successfully tested Mutt email client, Vim and Emacs itself inside term-mode, with no problems. What comes to key bindings I have changed the escape char to C-x: (add-hook 'term-mode-hook 'my-term-mode-hook) (defun my-term-mode-hook () (term-set-escape-char ?\C-x)) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-13 9:51 ` Teemu Likonen @ 2009-07-13 11:27 ` Francis Moreau 2009-07-13 13:12 ` Sébastien Vauban 0 siblings, 1 reply; 53+ messages in thread From: Francis Moreau @ 2009-07-13 11:27 UTC (permalink / raw) To: help-gnu-emacs On Jul 13, 11:51 am, Teemu Likonen <tliko...@iki.fi> wrote: > On 2009-07-13 02:16 (-0700), Francis Moreau wrote: > > > On Jul 13, 10:21 am, Teemu Likonen <tliko...@iki.fi> wrote: > > >> OK, then it's probably me who fails to understand why do you keep > >> talking about "M-x shell" when you need a terminal. This > >> "page-at-a-time" feature comes with terminal emulation. There's no > >> need to make "M-x shell" a real terminal because there already is > >> one: "M-x term". > > > Ok then it's probably me who fails to understand the point of "M-x > > shell"... > > The documentation says "Major mode for interacting with an inferior > shell" (C-h f shell-mode). It's like repeated M-! but more convenient. > > > If "M-x shell" implements this 'page-at-a-time' feature, does that > > mean it becomes a real term emulation ? > > To make "less" work it needs some terminal features so it would heading > towards that direction, that is, towards term-mode which already exists. > Perhaps someone could write some custom pager system in shell-mode but > it still wouldn't make "less" work. > Damn, I repeat one more time: I don't want "| less" or less(1) work in "M-x shell" (hope this is clear now) IOW, I'd like 'M-x shell' to output in its buffer one page at time, and this could be enabled/disabled by a variable like "M-x term" does. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-13 11:27 ` Francis Moreau @ 2009-07-13 13:12 ` Sébastien Vauban 2009-07-13 14:48 ` Anselm Helbig 2009-07-14 15:07 ` Francis Moreau 0 siblings, 2 replies; 53+ messages in thread From: Sébastien Vauban @ 2009-07-13 13:12 UTC (permalink / raw) To: help-gnu-emacs-mXXj517/zsQ Francis Moreau wrote: > On Jul 13, 11:51 am, Teemu Likonen <tliko...-X3B1VOXEql0@public.gmane.org> wrote: >> On 2009-07-13 02:16 (-0700), Francis Moreau wrote: >>> On Jul 13, 10:21 am, Teemu Likonen <tliko...-X3B1VOXEql0@public.gmane.org> wrote: >>>> OK, then it's probably me who fails to understand why do you keep talking >>>> about "M-x shell" when you need a terminal. This "page-at-a-time" feature >>>> comes with terminal emulation. There's no need to make "M-x shell" a real >>>> terminal because there already is one: "M-x term". > > Damn, I repeat one more time: I don't want "| less" or less(1) work in "M-x > shell" (hope this is clear now) Just one (real) question: what's the advantage of `M-x shell'? I understand `M-x term' allows for full-blown terminal emulation, but can we use it every time we were going to use `M-x shell'? Or are there some things `M-x term' can't do while `M-x shell' can? Thanks, Seb -- Sébastien Vauban ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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 1 sibling, 1 reply; 53+ messages in thread From: Anselm Helbig @ 2009-07-13 14:48 UTC (permalink / raw) To: help-gnu-emacs [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 1580 bytes --] At Mon, 13 Jul 2009 15:12:25 +0200, Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote: > > Francis Moreau wrote: > > On Jul 13, 11:51 am, Teemu Likonen <tliko...@iki.fi> wrote: > >> On 2009-07-13 02:16 (-0700), Francis Moreau wrote: > >>> On Jul 13, 10:21 am, Teemu Likonen <tliko...@iki.fi> wrote: > >>>> OK, then it's probably me who fails to understand why do you keep talking > >>>> about "M-x shell" when you need a terminal. This "page-at-a-time" feature > >>>> comes with terminal emulation. There's no need to make "M-x shell" a real > >>>> terminal because there already is one: "M-x term". > > > > Damn, I repeat one more time: I don't want "| less" or less(1) work in "M-x > > shell" (hope this is clear now) > > Just one (real) question: what's the advantage of `M-x shell'? I understand > `M-x term' allows for full-blown terminal emulation, but can we use it every > time we were going to use `M-x shell'? > > Or are there some things `M-x term' can't do while `M-x shell' can? M-x term is a terminal emulation, so things work more or less like they do in an xterm, gnome-terminal or putty. With M-x shell you're using emacs to construct the command to pass to the shell. This is an advantage if you shell doesn't keep a history or offers no completion mechanism. Also, you can use isearch to search through the command output, copy stuff into the kill ring or use the rectangle functions. Or you might just prefer the emacs keybindings over the one's your shell offers. 8-) HTH, Anselm -- Anselm Helbig mailto:anselm.helbig+news2009@googlemail.com ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-13 14:48 ` Anselm Helbig @ 2009-07-13 15:07 ` Teemu Likonen 0 siblings, 0 replies; 53+ messages in thread From: Teemu Likonen @ 2009-07-13 15:07 UTC (permalink / raw) To: help-gnu-emacs On 2009-07-13 16:48 (+0200), Anselm Helbig wrote: > With M-x shell you're using emacs to construct the command to pass to > the shell. This is an advantage if you shell doesn't keep a history or > offers no completion mechanism. Also, you can use isearch to search > through the command output, copy stuff into the kill ring or use the > rectangle functions. Or you might just prefer the emacs keybindings > over the one's your shell offers. 8-) I'd like to point out that term-mode has also the so called "line mode" (C-c C-j) in which user can wander around the buffer pretty much like anywhere else in Emacs. Kill-ring commands, isearch etc. work. Then there is "char mode" (C-c C-k), the default, which is like your normal terminal emulator except the escape key. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-13 13:12 ` Sébastien Vauban 2009-07-13 14:48 ` Anselm Helbig @ 2009-07-14 15:07 ` Francis Moreau 2009-07-14 17:16 ` Pascal J. Bourguignon 1 sibling, 1 reply; 53+ messages in thread From: Francis Moreau @ 2009-07-14 15:07 UTC (permalink / raw) To: help-gnu-emacs On 13 juil, 15:12, Sébastien Vauban <wxhgmqzgw...@spammotel.com> wrote: > Francis Moreau wrote: > > On Jul 13, 11:51 am, Teemu Likonen <tliko...@iki.fi> wrote: > >> On 2009-07-13 02:16 (-0700), Francis Moreau wrote: > >>> On Jul 13, 10:21 am, Teemu Likonen <tliko...@iki.fi> wrote: > >>>> OK, then it's probably me who fails to understand why do you keep talking > >>>> about "M-x shell" when you need a terminal. This "page-at-a-time" feature > >>>> comes with terminal emulation. There's no need to make "M-x shell" a real > >>>> terminal because there already is one: "M-x term". > > > Damn, I repeat one more time: I don't want "| less" or less(1) work in "M-x > > shell" (hope this is clear now) > > Just one (real) question: what's the advantage of `M-x shell'? I understand > `M-x term' allows for full-blown terminal emulation, but can we use it every > time we were going to use `M-x shell'? This one has already been asked before just look at: <76036640-c499-482c-81c0-9e0cb325e96a@k26g2000vbp.googlegroups.com> > > Or are there some things `M-x term' can't do while `M-x shell' can? > Actually you can read this in the emacs info pages: "In line mode, Term basically acts like Shell mode". The problem here is the word 'basically' which probably means 'almost'. So they differ in the details. In my case, I started to use 'M-x shell', and like it since I almost never have to use applications that need a real term emulation. But if you look at them (M-x term and M-x shell) carefully, then 'M-x term' has some weird behaviours when using the shell mode key bindings; try for instance: 'C-c C-e', 'C-c C-a', 'C-c C-o'... but as I said they're details. But the main problem I think, which is a different issue, is why the hell Emacs has 2 functionalities that do 'basically' the same thing ?! Why can't it offer one and only one package that give the best of the 2 worlds ? ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-14 15:07 ` Francis Moreau @ 2009-07-14 17:16 ` Pascal J. Bourguignon 2009-07-14 20:02 ` Francis Moreau 0 siblings, 1 reply; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-14 17:16 UTC (permalink / raw) To: help-gnu-emacs Francis Moreau <francis.moro@gmail.com> writes: > But the main problem I think, which is a different issue, is why the > hell Emacs has 2 functionalities that do 'basically' the same thing ?! Two? I know at least three! M-x terminal is yet another. As for mail UA, there are at least four (gnus, rmail, vm, mew), and probably many more. > Why can't it offer one and only one package that give the best of the > 2 worlds ? Because this is not a scarce world. There's nobody to strangle the offer and make you pay dearly for a few features. There's an aboundance of coders, and an aboundance of code produced, so you can choose amongst several options. If you want empty shops, URSS^W North Korea is that way. -- __Pascal Bourguignon__ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-14 17:16 ` Pascal J. Bourguignon @ 2009-07-14 20:02 ` Francis Moreau 2009-07-14 22:42 ` Peter Dyballa 0 siblings, 1 reply; 53+ messages in thread From: Francis Moreau @ 2009-07-14 20:02 UTC (permalink / raw) To: help-gnu-emacs; +Cc: Pascal J. Bourguignon On 14 juil, 19:16, pjb@informatimago.com (Pascal J. Bourguignon) wrote: > Francis Moreau <francis.moro@gmail.com> writes: > > But the main problem I think, which is a different issue, is why the > > hell Emacs has 2 functionalities that do 'basically' the same thing ?! > > Two? I know at least three! M-x terminal is yet another. > > As for mail UA, there are at least four (gnus, rmail, vm, mew), and > probably many more. > > > Why can't it offer one and only one package that give the best of the > > 2 worlds ? > > Because this is not a scarce world. There's nobody to strangle the > offer and make you pay dearly for a few features. There's an > aboundance of coders, and an aboundance of code produced, so you can > choose amongst several options. If you want empty shops, URSS^W North > Korea is that way. > Damn, Monsieur, you're crazy :-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-14 20:02 ` Francis Moreau @ 2009-07-14 22:42 ` Peter Dyballa 0 siblings, 0 replies; 53+ messages in thread From: Peter Dyballa @ 2009-07-14 22:42 UTC (permalink / raw) To: Francis Moreau; +Cc: Pascal J. Bourguignon, help-gnu-emacs Am 14.07.2009 um 22:02 schrieb Francis Moreau: > Damn, Monsieur, you're crazy :-) I'm in the same situation! I can't understand how my family switches through thirty-something TV programmes! Some years ago our old TV set broke. The new one had no buttons to switch programmes. And the cable delivered thirty-something! I did not care, the important programmes like arte, 3sat, BR, WDR I could easily reach. And for the others I had my folks. One summer I had to stay at home while the family was on holidays (I was offered to come later in my car). Now I had a problem! From my car, a big truck, I was used to twenty-something gear programmes, en route on route national 7 or German autobahns. No problem to switch! But that damned TV set, it had no gear box! Being a born mechanic (and Elisp programmer) I could easily dismantle my truck's gear and take it up home (second floor). Now, stupid TV set, I'll teach how to switch programmes! No dice… OK, I did not solve the programme, uhm, problem last millennium, I could get away into holidays, so that I still don't know whether I have to bring the whole TV set into the truck or the complete truck into the living room… It actually still puzzles me! (Dancing my onze danses pour combattre ma migraine.) -- Greetings Pete Imbecility, n.: A kind of divine inspiration, or sacred fire affecting censorious critics of this dictionary. – Ambrose Bierce: _The Devil's Dictionary_ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-12 17:40 ` Francis Moreau 2009-07-12 17:54 ` Teemu Likonen @ 2009-07-12 19:41 ` Peter Dyballa 2009-07-13 5:17 ` tomas [not found] ` <mailman.2380.1247427719.2239.help-gnu-emacs@gnu.org> 2 siblings, 1 reply; 53+ messages in thread From: Peter Dyballa @ 2009-07-12 19:41 UTC (permalink / raw) To: Francis Moreau; +Cc: help-gnu-emacs Am 12.07.2009 um 19:40 schrieb Francis Moreau: > And why is it so hard to understand that a pager feature would > be nice in this package ? Because I never needed it, not even when working 20 years ago at an alpha-numeric hardware terminal. And I have no imagination to invent circumstances that I would need it. If the text cursor is at the end of the *shell* buffer and is pushed away by fast effervescent output, faster than you can read, it's one command to return to the prompt. It's easier to send the command and make the cursor go up a line. GNU Emacs is no terminal emulation. It does not need a pager. These programmes were developed for hardware terminals from 20 or more years ago. There is no sense in keeping them today, in a time of feature full terminal emulations. They can be abolished together with atom reactors and bombs. And your splendid idea. -- Greetings Pete We also sponsor National Invisible Chronic Illness Awareness Week annually in September. Join the millions ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-12 19:41 ` Peter Dyballa @ 2009-07-13 5:17 ` tomas 2009-07-13 8:10 ` Peter Dyballa 0 siblings, 1 reply; 53+ messages in thread From: tomas @ 2009-07-13 5:17 UTC (permalink / raw) To: Peter Dyballa; +Cc: help-gnu-emacs, Francis Moreau -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, Jul 12, 2009 at 09:41:47PM +0200, Peter Dyballa wrote: > > Am 12.07.2009 um 19:40 schrieb Francis Moreau: > >> And why is it so hard to understand that a pager feature would >> be nice in this package ? [...] > GNU Emacs is no terminal emulation. It does not need a pager. These > programmes were developed for hardware terminals from 20 or more years ago. > There is no sense in keeping them today, in a time of feature full terminal > emulations. They can be abolished together with atom reactors and bombs. Completely agree on atom reactors and bombs ;-) But you can pry my 'less' from my cold, dead fingers... How are you supposed to page around a hundreds-of-megabytes heavy log file across a ssh connection: by first pulling everything before the pos you want to jump to? Besides, less is faster than anything else around (with exception of possibly 'more', but this one feels really archaic, even to me). > And your splendid idea. Hm. See above. And besides, Emacs buffers can't cope with sizes a pager would take quite happily (unless you go to 64 bit platforms, where I would expect the difference to be irrelevant). Regards - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFKWsNlBcgs9XrR2kYRAqBbAJsFPj5kmpM3EkVEludEHZdU3hqZnACfUonm 94rk5EYnFc7nTcQmnUgobMQ= =kmRy -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-13 5:17 ` tomas @ 2009-07-13 8:10 ` Peter Dyballa 0 siblings, 0 replies; 53+ messages in thread From: Peter Dyballa @ 2009-07-13 8:10 UTC (permalink / raw) To: tomas; +Cc: help-gnu-emacs, Francis Moreau Am 13.07.2009 um 07:17 schrieb tomas@tuxteam.de: > How are you supposed to page around a hundreds-of-megabytes heavy log > file across a ssh connection: by first pulling everything before > the pos > you want to jump to? Well, I'd use dired and tail. To give a real recommendation I first need some real experience. I've did some remote log file searching and similiar things, configuring and serving Apache, and I did not run into a situation I would have needed a pager, using TRAMP with SSH or PuTTY. Log rotation is a nice thing. At least, I don't feel great when I have to work with GB log files. -- Greetings Pete "We need a president who's fluent in at least one language." – Buck Henry ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2380.1247427719.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [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> 0 siblings, 2 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-13 8:03 UTC (permalink / raw) To: help-gnu-emacs On Jul 12, 9:41 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: > Am 12.07.2009 um 19:40 schrieb Francis Moreau: > > > And why is it so hard to understand that a pager feature would > > be nice in this package ? [...] > If the text cursor is at the end of the *shell* buffer and is pushed > away by fast effervescent output, faster than you can read, it's one > command to return to the prompt. It's easier to send the command and > make the cursor go up a line. no. BTW, some tools which being designed this 3 last couple years do send their output to a pager by default. > GNU Emacs is no terminal emulation. But it offers the possibility. It's well described in the info pages and the info pages never say that it's a deprecated usage. > It does not need a pager. These > programmes were developed for hardware terminals from 20 or more > years ago. There is no sense in keeping them today, in a time of > feature full terminal emulations. They can be abolished together with > atom reactors and bombs. So make it clear in the info page and see how people react. > And your splendid idea. I never claim to have a splendid idea. I just found weird that this is not offered by M-x shell, whereas it is by M-x term... ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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> 1 sibling, 0 replies; 53+ messages in thread From: Peter Dyballa @ 2009-07-13 9:04 UTC (permalink / raw) To: Francis Moreau; +Cc: help-gnu-emacs Am 13.07.2009 um 10:03 schrieb Francis Moreau: > I never claim to have a splendid idea. I just found weird that this is > not offered by M-x shell, whereas it is by M-x term... The one offers an environment to run a shell interpreter interactively in it, the other a terminal emulation. The one is restricted, the other not that much. -- Greetings Pete Math illiteracy affects 7 out of every 5 Americans. ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2414.1247475890.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [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 ` (2 more replies) 2009-07-13 9:53 ` Richard Riley 1 sibling, 3 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-13 9:38 UTC (permalink / raw) To: help-gnu-emacs On Jul 13, 11:04 am, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: > Am 13.07.2009 um 10:03 schrieb Francis Moreau: > > > I never claim to have a splendid idea. I just found weird that this is > > not offered by M-x shell, whereas it is by M-x term... > > The one offers an environment to run a shell interpreter > interactively in it, OK, so what am I supposed to run in this shell interpreter ? I can understand that I can't start mutt or any other appli that needs all term environment in M-x shell, but the feature I'm asking is not specific to term emulation, it's just a goodies to make life easier when reading the _text_ output of any commands I start from this shell interpreter. One other thing: why 'M-x term' proposes the 'page-at-a-time' output feature whereas it supports the " | less" thing ? maybe because it's just convenient enough to make it the default of all commands... ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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-14 3:12 ` Barry Margolin 2 siblings, 0 replies; 53+ messages in thread From: Peter Dyballa @ 2009-07-13 10:43 UTC (permalink / raw) To: Francis Moreau; +Cc: help-gnu-emacs Am 13.07.2009 um 11:38 schrieb Francis Moreau: > OK, so what am I supposed to run in this shell interpreter ? Everything but pagers and other programmes or utilities that control the cursor. Some ANSI compliance is achieved, to support gls' colourful output or bash colourising the prompt. > > I can understand that I can't start mutt or any other appli that needs > all term environment in M-x shell, but the feature I'm asking is not > specific to term emulation, You're wrong: pagers take full cursor control over the terminal. They're no simple filters (source code is available), because then they would have been implemented as simple shell scripts. Like, for example, which. > it's just a goodies to make life easier when reading the _text_ > output of any commands I start from this shell > interpreter. Write some simple Lua, Ruby, Python, Perl, Shell, or whatever script which counts lines and echoes a (fixed or not) number of them to stdout. Or, much simpler, change your mind and bethink yourself of the task or the aim you want to reach. Is it using a pager? Then take *term* buffer or xterm, or aterm, or… Probably the *very* best is to take one week holidays. At least. -- Greetings Pete Sending unsolicited commercial eMail to this account incurs a fee of € 500 per message and acknowledges the legality of this contract. ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2418.1247481796.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [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> 0 siblings, 2 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-13 11:29 UTC (permalink / raw) To: help-gnu-emacs On Jul 13, 12:43 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: > Am 13.07.2009 um 11:38 schrieb Francis Moreau: > > > OK, so what am I supposed to run in this shell interpreter ? > > Everything but pagers and other programmes or utilities that control > the cursor. Some ANSI compliance is achieved, to support gls' > colourful output or bash colourising the prompt. > [...] > > You're wrong: pagers take full cursor control over the terminal. > They're no simple filters (source code is available), because then > they would have been implemented as simple shell scripts. Like, for > example, which. > Ok, I give up. > > Probably the *very* best is to take one week holidays. At least. > yeah, I probably need it specially after such discussion ;) thanks anyway ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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> 1 sibling, 0 replies; 53+ messages in thread From: Samuel Wales @ 2009-07-13 20:42 UTC (permalink / raw) To: Francis Moreau; +Cc: help-gnu-emacs I read the whole thread, and I am surprised at how thoroughly and repeatedly the OP was misunderstood. So much so that: On Mon, Jul 13, 2009 at 04:29, Francis Moreau<francis.moro@gmail.com> wrote: > Ok, I give up. Many respondents took time out of their busy lives to explain the difference between term and shell -- but I think he knew those differences. Many graciously told him that he can't run less in shell -- but I think he knew that. I think what he wants is shell mode (not term) but to have some sort of less-like solution (not less itself) for paging output. Page up and prompt search and term in line mode are all good ideas, but he probably tried them. It doesn't seem like he's so wrong for merely asking how to do that or whether it is possible. Perhaps a simple "I don't know of a solution for this" would suffice. -- Myalgic encephalomyelitis causes death and severe suffering. You can get it any time and never recover. Conflicts of interest are destroying research. Do science and justice matter to you? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2451.1247517772.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [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> 1 sibling, 0 replies; 53+ messages in thread From: Teemu Likonen @ 2009-07-13 22:05 UTC (permalink / raw) To: Samuel Wales; +Cc: help-gnu-emacs, Francis Moreau On 2009-07-13 13:42 (-0700), Samuel Wales wrote: > I read the whole thread, and I am surprised at how thoroughly and > repeatedly the OP was misunderstood. Then I'm certainly one of those. Sorry about that, Francis. > I think what he wants is shell mode (not term) but to have some sort > of less-like solution (not less itself) for paging output. Page up and > prompt search and term in line mode are all good ideas, but he > probably tried them. Hmm, speaking speculatively, would it be some code in shell.el (or much likely comint.el) which stores shell commands' output in an intermediate hidden buffer or some Lisp data type and then pages it to *shell* buffer for user? I'm pretty sure that that would be possible to implement. From quick glance it looks like comint-output-filter is the function which handles the output that's coming from shell commands. The function is called automatically when Emacs sees data coming from an external process. I can see no pager features there but that's the place to start for someone who's interested. Split the functionality: have the output filter function write directly to hidden buffer and implement another output function which moves content from hidden buffer to *shell* buffer, possibly page by page. > It doesn't seem like he's so wrong for merely asking how to do that or > whether it is possible. I agree with that. Assuming I'm finally understanding what is being asked. :-) ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2453.1247522780.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [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 20:00 ` Francis Moreau 1 sibling, 1 reply; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-14 10:55 UTC (permalink / raw) To: help-gnu-emacs Teemu Likonen <tlikonen@iki.fi> writes: > On 2009-07-13 13:42 (-0700), Samuel Wales wrote: > >> I read the whole thread, and I am surprised at how thoroughly and >> repeatedly the OP was misunderstood. > > Then I'm certainly one of those. Sorry about that, Francis. > >> I think what he wants is shell mode (not term) but to have some sort >> of less-like solution (not less itself) for paging output. Page up and >> prompt search and term in line mode are all good ideas, but he >> probably tried them. > > Hmm, speaking speculatively, would it be some code in shell.el (or much > likely comint.el) which stores shell commands' output in an intermediate > hidden buffer or some Lisp data type and then pages it to *shell* buffer > for user? I'm pretty sure that that would be possible to implement. Of course. It is ALREADY implemented. That data structure is called BUFFER, and the pages are called WINDOWS. There is a user interface to let the user scan the pages, they're the PgUp and PgDn keys (PAGE UP, PAGE DOWN). How much silliness must we endure each day??? But note however, that M-x term implements an automatic pager in emacs, so you don't even have to remember to type |less : as soon as the output is more than a window-long, the term emacs pager jumps in. -- __Pascal Bourguignon__ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-14 10:55 ` Pascal J. Bourguignon @ 2009-07-14 15:10 ` Francis Moreau 2009-07-14 17:21 ` Pascal J. Bourguignon 0 siblings, 1 reply; 53+ messages in thread From: Francis Moreau @ 2009-07-14 15:10 UTC (permalink / raw) To: help-gnu-emacs On 14 juil, 12:55, p...@informatimago.com (Pascal J. Bourguignon) wrote: > Teemu Likonen <tliko...@iki.fi> writes: > > On 2009-07-13 13:42 (-0700), Samuel Wales wrote: > > >> I read the whole thread, and I am surprised at how thoroughly and > >> repeatedly the OP was misunderstood. > > > Then I'm certainly one of those. Sorry about that, Francis. > > >> I think what he wants is shell mode (not term) but to have some sort > >> of less-like solution (not less itself) for paging output. Page up and > >> prompt search and term in line mode are all good ideas, but he > >> probably tried them. > > > Hmm, speaking speculatively, would it be some code in shell.el (or much > > likely comint.el) which stores shell commands' output in an intermediate > > hidden buffer or some Lisp data type and then pages it to *shell* buffer > > for user? I'm pretty sure that that would be possible to implement. > > Of course. It is ALREADY implemented. That data structure is called > BUFFER, and the pages are called WINDOWS. There is a user interface > to let the user scan the pages, they're the PgUp and PgDn keys (PAGE > UP, PAGE DOWN). No it's not. What you propose with PgUp/PgDn is a _workaround_. > > How much silliness must we endure each day??? > > But note however, that M-x term implements an automatic pager in > emacs, so you don't even have to remember to type |less : as soon as > the output is more than a window-long, the term emacs pager jumps in. > So why is it silly to implement the 'automatic pager emulation' in shell mode and not in 'M-x term' ? ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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> 0 siblings, 2 replies; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-14 17:21 UTC (permalink / raw) To: help-gnu-emacs Francis Moreau <francis.moro@gmail.com> writes: > On 14 juil, 12:55, p...@informatimago.com (Pascal J. Bourguignon) > wrote: >> Teemu Likonen <tliko...@iki.fi> writes: >> > On 2009-07-13 13:42 (-0700), Samuel Wales wrote: >> >> >> I read the whole thread, and I am surprised at how thoroughly and >> >> repeatedly the OP was misunderstood. >> >> > Then I'm certainly one of those. Sorry about that, Francis. >> >> >> I think what he wants is shell mode (not term) but to have some sort >> >> of less-like solution (not less itself) for paging output. Page up and >> >> prompt search and term in line mode are all good ideas, but he >> >> probably tried them. >> >> > Hmm, speaking speculatively, would it be some code in shell.el (or much >> > likely comint.el) which stores shell commands' output in an intermediate >> > hidden buffer or some Lisp data type and then pages it to *shell* buffer >> > for user? I'm pretty sure that that would be possible to implement. >> >> Of course. It is ALREADY implemented. That data structure is called >> BUFFER, and the pages are called WINDOWS. There is a user interface >> to let the user scan the pages, they're the PgUp and PgDn keys (PAGE >> UP, PAGE DOWN). > > No it's not. > > What you propose with PgUp/PgDn is a _workaround_. > >> >> How much silliness must we endure each day??? >> >> But note however, that M-x term implements an automatic pager in >> emacs, so you don't even have to remember to type |less : as soon as >> the output is more than a window-long, the term emacs pager jumps in. >> > > So why is it silly to implement the 'automatic pager emulation' in > shell mode and not in 'M-x term' ? It is clear from the first paragraph of my previous answer, but since you don't understand (to the point of making this thread sound trollish), I'll repeat: it is silly to implement the 'automatic pager emulation' in shell mode, because the feature is ALREADY IMPLEMENTED IN THE GUISE of a BUFFER, a WINDOW and PgUp and PgDn to browse the buffer. What more do you want? more or less implement exactly the same features, they load the file in a buffer, and display a window-long at a time, and let you advance and (for less) retroced on the press of a key. If you don't like the keys PgUp or PgDn, there's already substitute keys implemented in emacs shell, namely C-v and M-v, and if you don't like them either, it's trivial to bind other keys. -- __Pascal Bourguignon__ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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> 1 sibling, 0 replies; 53+ messages in thread From: tomas @ 2009-07-14 19:21 UTC (permalink / raw) To: Pascal J. Bourguignon; +Cc: help-gnu-emacs -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, Jul 14, 2009 at 07:21:02PM +0200, Pascal J. Bourguignon wrote: > Francis Moreau <francis.moro@gmail.com> writes: > > > On 14 juil, 12:55, p...@informatimago.com (Pascal J. Bourguignon) > > wrote: [...] > >> Of course. It is ALREADY implemented [...] > > No it's not. > > > > What you propose with PgUp/PgDn is a _workaround_. [...] > It is clear from the first paragraph of my previous answer, but since > you don't understand (to the point of making this thread sound > trollish), I'll repeat: [...] To be fair, a buffer with PgUp and PgDn doesn't completely emulate a pager at least in two respects: * performance (as was pointed out upthread) * stopping the output stream of the process at each page. They are just much better to cope with huge/fast streams. So the OP's query isn't silly at all. Regards - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFKXNq6Bcgs9XrR2kYRAuJiAJ0ek30XyPhh2ZHWxgA6SwmFfnm1GACfW6N8 AI57k0jnjgJIYVGstwfeT0M= =KS8V -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 53+ messages in thread
[parent not found: <mailman.2508.1247599009.2239.help-gnu-emacs@gnu.org>]
* Re: page-at-a-time output for M-x shell [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 0 siblings, 1 reply; 53+ messages in thread From: Francis Moreau @ 2009-07-14 19:52 UTC (permalink / raw) To: help-gnu-emacs On 14 juil, 21:21, to...@tuxteam.de wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, Jul 14, 2009 at 07:21:02PM +0200, Pascal J. Bourguignon wrote: > > Francis Moreau <francis.m...@gmail.com> writes: > > > > On 14 juil, 12:55, p...@informatimago.com (Pascal J. Bourguignon) > > > wrote: > > [...] > > > >> Of course. It is ALREADY implemented [...] > > > No it's not. > > > > What you propose with PgUp/PgDn is a _workaround_. > > [...] > > > It is clear from the first paragraph of my previous answer, but since > > you don't understand (to the point of making this thread sound > > trollish), I'll repeat: [...] > > To be fair, a buffer with PgUp and PgDn doesn't completely emulate a > pager at least in two respects: > > * performance (as was pointed out upthread) > * stopping the output stream of the process at each page. I actually mentioned the second point which was more important than performance when using Emacs, I guess. > They are just much better to cope with huge/fast streams. So the OP's > query isn't silly at all. Yeah but some people here are cleverer than I am, specially Monsieur Bourguignon with his nice PgUp/PgDw solution and his nice followups. So yes Monsieur Bourguignon, you're right, it's enough for this empty discussion. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-14 19:52 ` Francis Moreau @ 2009-07-14 20:39 ` Pascal J. Bourguignon 0 siblings, 0 replies; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-14 20:39 UTC (permalink / raw) To: help-gnu-emacs Francis Moreau <francis.moro@gmail.com> writes: > Yeah but some people here are cleverer than I am, specially Monsieur > Bourguignon with his nice PgUp/PgDw solution and his nice followups. > > So yes Monsieur Bourguignon, you're right, it's enough for this empty > discussion. Don't be so up tight, I provided you with three solutions, including a pager that works in M-x shell! -- __Pascal Bourguignon__ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell [not found] ` <mailman.2453.1247522780.2239.help-gnu-emacs@gnu.org> 2009-07-14 10:55 ` Pascal J. Bourguignon @ 2009-07-14 20:00 ` Francis Moreau 1 sibling, 0 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-14 20:00 UTC (permalink / raw) To: help-gnu-emacs; +Cc: help-gnu-emacs, Teemu Likonen On 14 juil, 00:05, Teemu Likonen <tlikonen@iki.fi> wrote: > On 2009-07-13 13:42 (-0700), Samuel Wales wrote: > > > I read the whole thread, and I am surprised at how thoroughly and > > repeatedly the OP was misunderstood. > > Then I'm certainly one of those. Sorry about that, Francis. > Well, no problem and thanks anyway to spend some time of your busy life to answer my question. > > I think what he wants is shell mode (not term) but to have some sort > > of less-like solution (not less itself) for paging output. Page up and > > prompt search and term in line mode are all good ideas, but he > > probably tried them. > > Hmm, speaking speculatively, would it be some code in shell.el (or much > likely comint.el) which stores shell commands' output in an intermediate > hidden buffer or some Lisp data type and then pages it to *shell* buffer > for user? I'm pretty sure that that would be possible to implement. > > From quick glance it looks like comint-output-filter is the function > which handles the output that's coming from shell commands. The function > is called automatically when Emacs sees data coming from an external > process. I can see no pager features there but that's the place to start > for someone who's interested. Split the functionality: have the output > filter function write directly to hidden buffer and implement another > output function which moves content from hidden buffer to *shell* > buffer, possibly page by page. Ok, I'll may take a look at this just because that might be a good exercise for learning elisp. > > > It doesn't seem like he's so wrong for merely asking how to do that or > > whether it is possible. > > I agree with that. Assuming I'm finally understanding what is being > asked. :-) Take a look at the subject ;-) ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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-14 3:12 ` Barry Margolin 2009-07-14 9:21 ` Miles Bader 2009-07-14 15:20 ` Francis Moreau 2 siblings, 2 replies; 53+ messages in thread From: Barry Margolin @ 2009-07-14 3:12 UTC (permalink / raw) To: help-gnu-emacs [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 1319 bytes --] In article <0eab476b-cd5f-444d-b2af-d82ac076e73b@r34g2000vba.googlegroups.com>, Francis Moreau <francis.moro@gmail.com> wrote: > On Jul 13, 11:04 am, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: > > Am 13.07.2009 um 10:03 schrieb Francis Moreau: > > > > > I never claim to have a splendid idea. I just found weird that this is > > > not offered by M-x shell, whereas it is by M-x term... > > > > The one offers an environment to run a shell interpreter > > interactively in it, > > OK, so what am I supposed to run in this shell interpreter ? > > I can understand that I can't start mutt or any other appli that needs > all term environment in M-x shell, but the feature I'm asking is not > specific to term emulation, it's just a goodies to make life easier > when reading the _text_ output of any commands I start from this shell > interpreter. Why do you need a pager, when the Emacs shell buffer allows you to page back and forward through the output, search it, etc.? What can you do in a pager that you can't do with Emacs's own features? And if there is something Emacs is missing, it should be easy to add it. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-14 3:12 ` Barry Margolin @ 2009-07-14 9:21 ` Miles Bader 2009-07-14 15:20 ` Francis Moreau 1 sibling, 0 replies; 53+ messages in thread From: Miles Bader @ 2009-07-14 9:21 UTC (permalink / raw) To: help-gnu-emacs Barry Margolin <barmar@alum.mit.edu> writes: > Why do you need a pager, when the Emacs shell buffer allows you to page > back and forward through the output, search it, etc.? What can you do > in a pager that you can't do with Emacs's own features? And if there is > something Emacs is missing, it should be easy to add it. BTW, note that if a command outputs lots of text, it's easy to go back to the previous prompt using "C-c C-p" and then page through the output with "C-v". -Miles -- Success, n. The one unpardonable sin against one's fellows. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 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 1 sibling, 2 replies; 53+ messages in thread From: Francis Moreau @ 2009-07-14 15:20 UTC (permalink / raw) To: help-gnu-emacs On 14 juil, 05:12, Barry Margolin <bar...@alum.mit.edu> wrote: > In article > <0eab476b-cd5f-444d-b2af-d82ac076e...@r34g2000vba.googlegroups.com>, > Francis Moreau <francis.m...@gmail.com> wrote: > > > > > On Jul 13, 11:04 am, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: > > > Am 13.07.2009 um 10:03 schrieb Francis Moreau: > > > > > I never claim to have a splendid idea. I just found weird that this is > > > > not offered by M-x shell, whereas it is by M-x term... > > > > The one offers an environment to run a shell interpreter > > > interactively in it, > > > OK, so what am I supposed to run in this shell interpreter ? > > > I can understand that I can't start mutt or any other appli that needs > > all term environment in M-x shell, but the feature I'm asking is not > > specific to term emulation, it's just a goodies to make life easier > > when reading the _text_ output of any commands I start from this shell > > interpreter. > > Why do you need a pager, when the Emacs shell buffer allows you to page > back and forward through the output, search it, etc.? Ok, let me ask you one question: why do anybody use ('| less') in all term emulation whereas they all have the PgUp/PgDw functionality ? because it's obviously not convenient. It's not convenient because a) you get the wanted result without any user interventions (search, key press...) b) the command which outputs the data is stopped as soon as the reader stops to read the produced data. Note: just to be sure I'm understood, I'm not asking for a pager in shell mode. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-14 15:20 ` Francis Moreau @ 2009-07-14 17:39 ` Pascal J. Bourguignon 2009-07-14 21:05 ` Barry Margolin 1 sibling, 0 replies; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-14 17:39 UTC (permalink / raw) To: help-gnu-emacs Francis Moreau <francis.moro@gmail.com> writes: > On 14 juil, 05:12, Barry Margolin <bar...@alum.mit.edu> wrote: >> In article >> <0eab476b-cd5f-444d-b2af-d82ac076e...@r34g2000vba.googlegroups.com>, >> Francis Moreau <francis.m...@gmail.com> wrote: >> >> >> >> > On Jul 13, 11:04 am, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: >> > > Am 13.07.2009 um 10:03 schrieb Francis Moreau: >> >> > > > I never claim to have a splendid idea. I just found weird that this is >> > > > not offered by M-x shell, whereas it is by M-x term... >> >> > > The one offers an environment to run a shell interpreter >> > > interactively in it, >> >> > OK, so what am I supposed to run in this shell interpreter ? >> >> > I can understand that I can't start mutt or any other appli that needs >> > all term environment in M-x shell, but the feature I'm asking is not >> > specific to term emulation, it's just a goodies to make life easier >> > when reading the _text_ output of any commands I start from this shell >> > interpreter. >> >> Why do you need a pager, when the Emacs shell buffer allows you to page >> back and forward through the output, search it, etc.? > > Ok, let me ask you one question: why do anybody use ('| less') in all > term emulation whereas they all have the PgUp/PgDw functionality ? > > because it's obviously not convenient. You are wrong, and mixing concepts. 1- Not all terminal emulator have an history that you can navigate (with suposedly PgUp and PgDn). The job of a terminal emulator is to send bytes to the application for any key pressed including PgUp and PgDn, so normally they wouldn't preempt them to scroll the history, if they have one. 2- In the case of M-x shell, nobody use |less, since we can scroll back painlessly. Actually, the invention of more or less comes directly from this characteristic feature of a glass terminal, that it shows only a limited number of lines, and you cannot scroll back. When we still worked with teletypes, there was no need for more or less, since you could always check what was printed in the roll of paper (and it would have been totally ludicrous to print again a page that had been already printed). Then glass tty were introduced, that behaved like teletypes, but they showed only 24 or 25 lines. This was a big backset, but it presented some advantages: we didn't need to use so many trees anymore, and we could now directly address and update any characters in the window. Anyway with these glass tty, since anything beyond the 24th/25th line was lost, a workaround was needed, and more or less (the pager concept) was invented. Notice that 25*80 = 2000 bytes which is about the size of central memory that was allocated to each user on the computers used at that time, so it would have been impossible to keep the whole output in a RAM buffer too (data was dumped in temporary spool files). But then bitmap screens and X servers and emacs were invented, on machines with more memory than you could fill with your trolls, so the previous workaround could be lost, and we can now implement the normal feature, dump the whole output in the in RAM buffer, and let the user see whatever part he wants with normal buffer navigation commands. > It's not convenient because a) you get the wanted result without any > user interventions (search, key press...) So you're saying that user intervention is "convenient"? Computer are made to aleviate human work, not to give more work to human slaves. > b) the command which outputs the data is stopped as soon as the > reader stops to read the produced data. You'll have to explain in what aspect it is convenient to stop a process, and leave resources busy for an indeterminate amount of time, instead of releasing them for the other processes to use. > Note: just to be sure I'm understood, I'm not asking for a pager in > shell mode. How strange, it seemed to everybody that was exactly what you were asking in your second post: I'd want to use a pager with 'M-x shell' but ' | $PAGER' doesn't work nicely in emacs shell. So if I loose the '| $PAGER' part, I loose the functionnality I want to have as well... and we've spend an inordinate amount of time explaining that you didn't loose the functionality, since shell implements it inherently, in addition to the epager script I provided if you didn't want to loose the '| $PAGER' part. You should consider yourself satisfied and quit it. -- __Pascal Bourguignon__ ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-14 15:20 ` Francis Moreau 2009-07-14 17:39 ` Pascal J. Bourguignon @ 2009-07-14 21:05 ` Barry Margolin 1 sibling, 0 replies; 53+ messages in thread From: Barry Margolin @ 2009-07-14 21:05 UTC (permalink / raw) To: help-gnu-emacs [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 2584 bytes --] In article <19dfd9e3-c7ad-4680-bfb7-2d25f79fca91@o36g2000vbl.googlegroups.com>, Francis Moreau <francis.moro@gmail.com> wrote: > On 14 juil, 05:12, Barry Margolin <bar...@alum.mit.edu> wrote: > > In article > > <0eab476b-cd5f-444d-b2af-d82ac076e...@r34g2000vba.googlegroups.com>, > > Francis Moreau <francis.m...@gmail.com> wrote: > > > > > > > > > On Jul 13, 11:04 am, Peter Dyballa <Peter_Dyba...@Web.DE> wrote: > > > > Am 13.07.2009 um 10:03 schrieb Francis Moreau: > > > > > > > I never claim to have a splendid idea. I just found weird that this is > > > > > not offered by M-x shell, whereas it is by M-x term... > > > > > > The one offers an environment to run a shell interpreter > > > > interactively in it, > > > > > OK, so what am I supposed to run in this shell interpreter ? > > > > > I can understand that I can't start mutt or any other appli that needs > > > all term environment in M-x shell, but the feature I'm asking is not > > > specific to term emulation, it's just a goodies to make life easier > > > when reading the _text_ output of any commands I start from this shell > > > interpreter. > > > > Why do you need a pager, when the Emacs shell buffer allows you to page > > back and forward through the output, search it, etc.? > > Ok, let me ask you one question: why do anybody use ('| less') in all > term emulation whereas they all have the PgUp/PgDw functionality ? Terminal emulators often have a scrollback limit. Also, you can search for things with "less", you can't easily search in the emulator window. Or maybe you can -- I've been using more and less since the days of real terminals, so that's where my habits got formed. > > because it's obviously not convenient. > > It's not convenient because a) you get the wanted result without any > user interventions (search, key press...) b) the command which outputs > the data is stopped as soon as the reader stops to read the produced > data. I agree with these points, too. Scrollback in some terminal emulators doesn't work well if the output is still going -- sometimes they spring you back to the end, or the position moves as the end moves, etc. Pagers give more control, but you get all the same control in Emacs. Actually, I generally try to avoid running programs that produce lots of output in my shell buffer. I'll usually run them with M-! so they go to their own buffer. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell [not found] ` <mailman.2414.1247475890.2239.help-gnu-emacs@gnu.org> 2009-07-13 9:38 ` Francis Moreau @ 2009-07-13 9:53 ` Richard Riley 1 sibling, 0 replies; 53+ messages in thread From: Richard Riley @ 2009-07-13 9:53 UTC (permalink / raw) To: help-gnu-emacs Peter Dyballa <Peter_Dyballa@Web.DE> writes: > Am 13.07.2009 um 10:03 schrieb Francis Moreau: > >> I never claim to have a splendid idea. I just found weird that this is >> not offered by M-x shell, whereas it is by M-x term... > > > The one offers an environment to run a shell interpreter > interactively in it, the other a terminal emulation. The one is > restricted, the other not that much. The point is that you pretty much derided the idea that "Gnu Emacs" needing a pager whereas you probably meant shell as opposed to a term inside emacs. ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-11 13:14 page-at-a-time output for M-x shell Francis Moreau ` (2 preceding siblings ...) [not found] ` <mailman.2288.1247322297.2239.help-gnu-emacs@gnu.org> @ 2009-07-12 12:40 ` Teemu Likonen 2009-07-12 13:26 ` Richard Riley 2009-07-13 21:43 ` Pascal J. Bourguignon 4 siblings, 1 reply; 53+ messages in thread From: Teemu Likonen @ 2009-07-12 12:40 UTC (permalink / raw) To: help-gnu-emacs On 2009-07-11 06:14 (-0700), Francis Moreau wrote: > 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 ? Emacs shell is a "dump" terminal which doesn't support (all) terminal control codes. You need to use "M-x term" if you want a proper terminal (but even that is not as good as the good old XTerm). ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-12 12:40 ` Teemu Likonen @ 2009-07-12 13:26 ` Richard Riley 2009-07-12 14:52 ` Thierry Volpiatto 0 siblings, 1 reply; 53+ messages in thread From: Richard Riley @ 2009-07-12 13:26 UTC (permalink / raw) To: help-gnu-emacs Teemu Likonen <tlikonen@iki.fi> writes: > On 2009-07-11 06:14 (-0700), Francis Moreau wrote: > >> 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 ? > > Emacs shell is a "dump" terminal which doesn't support (all) terminal > control codes. You need to use "M-x term" if you want a proper terminal > (but even that is not as good as the good old XTerm). http://www.emacswiki.org/emacs/download/multi-term.el ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-12 13:26 ` Richard Riley @ 2009-07-12 14:52 ` Thierry Volpiatto 0 siblings, 0 replies; 53+ messages in thread From: Thierry Volpiatto @ 2009-07-12 14:52 UTC (permalink / raw) To: help-gnu-emacs Hi all, If you use eshell you can call easily term for the commands that need it: ,---- | (when (require 'em-term) | (dolist (i '("kop" "ledger" "mc" "htop")) | (add-to-list 'eshell-visual-commands i))) `---- This code add the commands kop, ledger, mc, htop to `eshell-visual-commands'. That mean when you run one of these commands in eshell, they are executed in term. At the end the term buffer is killed and you are back in eshell. Richard Riley <rileyrgdev@gmail.com> writes: > Teemu Likonen <tlikonen@iki.fi> writes: > >> On 2009-07-11 06:14 (-0700), Francis Moreau wrote: >> >>> 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 ? >> >> Emacs shell is a "dump" terminal which doesn't support (all) terminal >> control codes. You need to use "M-x term" if you want a proper terminal >> (but even that is not as good as the good old XTerm). > > http://www.emacswiki.org/emacs/download/multi-term.el > -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France ^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: page-at-a-time output for M-x shell 2009-07-11 13:14 page-at-a-time output for M-x shell Francis Moreau ` (3 preceding siblings ...) 2009-07-12 12:40 ` Teemu Likonen @ 2009-07-13 21:43 ` Pascal J. Bourguignon 4 siblings, 0 replies; 53+ messages in thread From: Pascal J. Bourguignon @ 2009-07-13 21:43 UTC (permalink / raw) To: help-gnu-emacs 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__ ^ permalink raw reply [flat|nested] 53+ messages in thread
end of thread, other threads:[~2009-07-14 22:42 UTC | newest] Thread overview: 53+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).