From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: not good proposal: "C-z " reserved for users Date: Mon, 15 Feb 2021 08:51:28 +0300 Message-ID: References: <871rdk4c1m.fsf@robertthorpeconsulting.com> <640551af-d035-f133-3b98-fe7c7a06279d@yandex.ru> <8f760064-b6c2-5714-8a0c-6645b398e0fc@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22305"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: gregory@heytings.org, Robert Thorpe , help-gnu-emacs@gnu.org To: Dmitry Gutov Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 15 06:57:19 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBWsp-0005eh-DR for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 15 Feb 2021 06:57:19 +0100 Original-Received: from localhost ([::1]:38936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBWso-0001QZ-Fh for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 15 Feb 2021 00:57:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBWsM-0001QL-Nn for help-gnu-emacs@gnu.org; Mon, 15 Feb 2021 00:56:50 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:46105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBWsF-00052p-St for help-gnu-emacs@gnu.org; Mon, 15 Feb 2021 00:56:48 -0500 Original-Received: from localhost ([::ffff:41.210.147.95]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001DFF5.00000000602A0CF8.00006F0D; Sun, 14 Feb 2021 22:56:07 -0700 Mail-Followup-To: Dmitry Gutov , Robert Thorpe , gregory@heytings.org, help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <8f760064-b6c2-5714-8a0c-6645b398e0fc@yandex.ru> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128076 Archived-At: * Dmitry Gutov [2021-02-15 01:14]: > On 14.02.2021 09:58, Jean Louis wrote: > > > > It's not a 100% conclusion of the survey we have referred to previously, > > > but its results state that ~30% of all users are in the terminal, ~30% of > > > all users are using a Vim key bindings emulation, and ~30% of all users have > > > been using Vim as their primary editor previously. They can't be all the > > > same users, but it's an interesting coincidence. > > > > If there are 200 million Ubuntu users, 13 million Emacs users by using > > Popularity Contest survey data, then 30% of those would be few > > millions of Emacs users using it in terminal. > > Not all Ubuntu users are software developers. Decent math otherwise. They are definitely not and I have not mentioned they are. Popularity Contest is not for developers. Being developer is the only characteristic for user to be Emacs user. Being ethusiastic user like we are is not the only characteristic to be Emacs user. Popularity Contest counts number of installations and, I just guess, asks users if they use the package often. > I'm not talking about the terminal in general and its usefulness, or about > what people *can* do with it. Only about what they actually do with regards > to the feature in question. >From online questions and answers such as Stackoverflow, by using their search engine, you may get quite a good information what people do with terminals. My personal opinion would be based on what people as user of those features like terminal are talking on some websites. > Because even though "suspend job" is handy to have in the toolset, if an > average user only reaches for it twice a year, that command doesn't really > need a key binding as prominent as 'C-z'. > > In comparison, I hit 'undo' at least a dozen times per hour. I will not go into my circle of friends or even co-workers and assume that if they don't use terminal functions that nobody use them. Especially I will not be inclined to remove well known functions because my close circle of friends or co-workers do not use them. They have nothing to say about it. For your awareness I have learned Control-Z since I have learned basics of shell somewhere in 1999-2000 and I have used Control-Z in terminal and in console many times during the last year. I wish I would see more understanding from your side on what job control is, but I have not get the impression you got it. You seem to have understanding that key binding like Control-Z is for enthusiastic users, those who may report on this mailing list, who identify themselves as "Emacs users", and who would be average users. My understanding is that Control-Z is for shell users, those who invoke various running processes and who need to suspend the process until later time, or maybe need to suspend it before deciding to kill it, or need to suspend it due to lack of some computing resources, or temporarily review of other actions in background before reverting back to Emacs. There is always some urgency involved and suspending Emacs as process may rather not be related to Emacs, rather to environmnet. It is not meant for average, beginner or advanced user of Emacs, it is rather meant as compliance to shell user expectations. That is how I see it. It is definitely not related to the status of the Emacs user. Let us think of Emacs user as beginner, Vim user as beginner, GNU/Linux beginner who is discovering terminal and Bash or other shell, on BSD derivativs may be Korn shell or other shell, on Debian it could be dash as system shell or Bash as user shell, any OS has already some kind of shell. Such users are exploring system. At least I know I was exploring systems in larval stage for about one year during the night, during the day I was sleeping. Control-C and Control-Z and Control-S are ways of stopping some executions of various programs being invoked. What if user is really Emacs beginner but shell user? Invoking Emacs does not necessarily get him out of it. Control-Z suspends Emacs, user can invoke maybe Internet access with lynx and find out how to exit from Emacs with C-x C-c, or read info or other text files. Replace now "Emacs" with any program there. Use the Internet search to get more awareness as that is where PowerShell users are crying for Control-Z implementation: https://duckduckgo.com/?q=powershell+control-z+suspend&atb=v154-3am&ia=web Realize that Control-Z comes as expectation from the shell job control. It does not come from Emacs job control. When something goes wrong or attention is required, Control-Z is one among intuitive keys to stop the job in shell. It invokes SIGTSTP or terminal stop signal. I do not know any other program that I can invoke in the shell as terminal program and not being able to suspend it. This is because programs know that they should not fiddle with shell job control. Job control gives users what? Control. Emacs shall not taking them that control. Shell invocations are numerous, there are millions of ways how is that used, it is not just an Emacs thing. When I invoke `emacs -Q' from terminal I can stop GUI from terminal with Control-Z -- that is I guess not a key that Emacs captures and emulates, it is I guess function in shell. That is useful for debugging. Recently I had my uptime 7 days, but before, I could never reach even 2-3 days as Emacs is hanging or doing some weird stuff with memory, bug is well known. Control-Z in those situations could maybe help in gaining access to computer. Emacs is not just editor, it is programming language. Any programming language shall be suspendable from shell. When I invoke Emacs to update interactions of 220008 people, I do not use that Emacs instance any more. It becomes unusable as it is processing data. All I can see are dots, like ".........." representing one person per dot being handled and process may last for one day. Suspending such processes I do over GUI process manager or in shell with Control-Z. I can remember before in time I have been using Perl to process a lot of data in the same way, I would run it in shell and sometimes suspend, or resume. Because Emacs has Emacs Lisp as programming language, one shall give users always power and control from outside to suspend whatever process is running within shell. Sometimes nothing in Emacs can help, like C-g numerous times may not easily suspend the process execution. I have some SQL queries and normally I require myself to enter at least 3 chars for the SQL query search. But I have forgotten in some functions to verify for 3 chars, so even searpching for "a" becomes possible. That is where C-g becomes almost impossible. Control-Z is for critical shell and terminal handlings and users' control over processes invoked in shell. > > > But I rarely ever see someone using the 'C-z' -> 'fg' pair, in fact, I > > > struggle to remember anyone do that (except some of the sysadmins, I > > > guess). > > > > If you have not get clear picture of number of terminal users you > > cannot possibly know somebody is using job control in their shells. > > You can do that by watching people work. And I do have a clear picture of > the number of terminal users. You can watch people who do not know bash, those are not representative people. I gave you good reference of those who need Control-Z in PowerShell, they cry for it. But we cannot take an example from those people who are not shell users, and even if shell users, from those who do not know what is job control. Quote: "There are basically three types of people in the world: those who know little or nothing about bash job control, those who know enough to believe that it's nothing that they would ever use, and those who can just skim the rest of this post." from: https://www.linuxjournal.com/content/job-control-bash-feature-you-only-think-you-dont-need If job control in shell would not be useful, there would no articles about it. The quote applies well here in this discussion. > > If you have not invoke programs that process large data sets it is > > harder to understand. 220005 people need to be updated for their > > number of interactions (their emails, SMS, calls, notes, tasks) and > > that process involves harvesting their emails, counting it, > > harvesting the database and counting. I wish it would be fast but it > > is not. The process will take usually 2 days. I do it maybe once per > > quarter. It blocks the system and computer has to be used. Suspending > > a job is easier, then unsuspending it when I am not personally on > > computer. > > Interesting. That sounds like the case closer to "non-multitasking" systems > I was talking about. > > Here, I can launch a resource-intensive process or two, and still use the > computer myself. That is your adjustment or view point on what is resource intensive. Emacs was and would still be hanging doing something with hard disk and memory, it makes this T410 Thinkpad almost halt. Sometimes the only way to liberate computer is to reset it hard. That is for Emacs. You probably have better computer than this one. And this is I guess i5 CPU, something with 4 GB of memory. This is multi-tasking system, but there are processes that require lot of resources, indexing databases, processing database information and handling files. Editing alone is almost never a problem. > You might also want to look into giving that process a lower priority, so > that it gives way to your interactive tasks when you're logged in. Thanks, yes, I do that. I index emails with `mu index' by giving it lowest priority. It still pretty much consumes resources. I have been using fast desktop computers, it was still using resources that impact somewhat the work. alias lazy='nice -n19 /usr/local/bin/mu index --lazy-check --maildir /home/data1/protected/Maildir/' I guess that with `nice -n19' I am doing that. But I am not sure if M-x mu4e and updating of the database would "nice" the process to lower priority, Emacs because less usable during tha indexing time. Look at this: - invoke Emacs on remote machine - run mu4e and update the mail database - realize that now machine is not responsive (surprise!) - realize that maybe websites and other servers are not serving people - Control-Z to suspend the job releases process - re-nice the process, either Emacs or indexing process (or other) - bring Emacs back to foreground Of course one could try using Emacs and M-x proced to do similar re-nicing, or top, htop or similar, but Emacs would still be slowed down, it could take longer until user becomes able to re-nice process from within Emacs. > > Video processing may need days, weeks to finish. I have programmed it > > by Emacs Lisp that invokes `ffmpeg' in such a way to process file by > > file. Such instance of Emacs may run separately in console, or > > terminal. I can then change my graphics environment without having > > process interrupted in console. I can suspend the process in terminal > > and have it waiting on separate workspace until I unsuspend it during > > the night time or my absence from the office. > > > > (defun video2webm-dired () > > "Converts any video to webm" > > (interactive) > > (let* ((bitrate (read-number "Bitrate: " 300)) > > (videos (dired-get-marked-files)) > > (videos (mapcar 'video-mime-type-p videos)) > > (videos (seq-remove 'null videos)) > > (async-shell-command-buffer 'new-buffer) > > (command (format "ffmpeg -y -i `?` -c:v libvpx-vp9 -b:v %sk -pass 1 -passlogfile `?` -speed 4 -c:a libopus -f webm /dev/null -async 1 -vsync passthrough && ffmpeg -y -i `?` -c:v libvpx-vp9 -b:v %sk -pass 2 -passlogfile `?` -speed 1 -c:a libopus \`?`.webm -async 1 -vsync passthrough && rm `?`-0.log;" bitrate bitrate))) > > (dired-do-async-shell-command command nil videos))) > > > > I could as well use Common Lisp or other programming language, again I > > would need suspend option as processing videos from mp4 to webm for > > websites takes days or weeks depending of size of videos. Other people > > delegate that job to YouTube, I don't and do processing on my > > computer. > > That's neat. But if you only do that once or twice per month, perhaps the > 'C-x C-z' binding could suffice? You lack the fundamental understanding from where Control-Z comes from. It is not from Emacs, it is not for Emacs. In general Control-Z does no function in Emacs, it suspends the job outside of Emacs. It comes from shell user expectation, not necessary from average or Emacs user expectation. Control-Z in shell is used in emergency situations. It is not used by plan neither is possible to predict situations where it becomes useful. Video processing is just one example. I may sometimes out of dissatisfaction with local computer open up a powerful VPS and process videos on that VPS. Control-Z is not meant only for Emacs users primarily, it comes from shell job control, it is meant for whoever and whatever reasons. Beginners invoking Emacs, Vim or any other software may liberate their shell with Control-Z. Shell user invokes a command and get surprised, something is wrong, maybe cannot exit Emacs. Control-Z may be one of choices. Control-C could be other choice if it works. After Control-Z user may `kill %1' the suspended job if it is the only one, or `kill %2' if it is the second one. If process cannot be suspended by the binding that is related to shell (Control-Z) you are putting at stake users' data for capricious reasons. > > > I am aware of that capability myself, but never take advantage of it, opting > > > instead for an additional split in the terminal emulator. Overall, it seems > > > to be like it had been more important in the earlier age when operating > > > systems had no real multitasking. Now we have terminal splits, and tmux, and > > > so on. > > > > Suspending a job is not same as concurrently running multiple > > jobs. It requires more understanding. > > Right. But I was assuming that people reach similar goals with those two > techniques. Perhaps not. - invoke terminal tetris - suspend it - put it in background, you can resume playing - invoke tetris in tmux/screen - log off, or do something else in other screen - come back and your game is lost Suspending a job is not losing a game. Putting suspended job in background may allow it to lose the game. Another example how user of nano editor was surprised that Control-Z was not supported by nano editor: https://teamtreehouse.com/community/using-ctrlz-to-suspend-nano-in-terminal-macintosh Remove Control-Z from Emacs and you will get many such website pages as people will search for it. It is not just "binding" in Emacs, it is expectation outside of Emacs. Some Reddit talk on suspending Emacs: https://www.reddit.com/r/emacs/comments/2t2cej/best_way_to_use_emacs_in_the_terminal_ctrlz/ or people speaking here: https://news.ycombinator.com/item?id=5920732 I cannot see the Reddit talk due to censorship in the country I am located. No time for Tor and VPN now. > > > If it actually matters to the decision makers, I could make a poll or two > > > (maybe on Reddit, maybe on my workplace) about whether people know about > > > this feature, and whether they use it regularly. > > > > I do believe firmly that not many users use it. But that is case for > > the Bash and general computing. Emacs is on top of the Bash, Bash is > > fundamental to Emacs and job control is more fundamental to Emacs. > > Is it? I mean, Emacs itself has shell, eshell, and other features that > sometimes duplicate Bash's functionality. Yes, sure it has. Some shell will normally be used to run the operating system, but you could, if you wish, use exclusively Emacs as your default shell. Just use `chsh' and change it to Emacs, provided that /etc/shells is also set. It is free world. In that case there will be no job control, as there is no shell, and job control relates to shell job control. You may spawn your X window straight from Emacs. Most probably you could use it as PID 1 as well. There are many reasons why is that not best way of using the system, but for personal use why not. Then when user enters system by using SSH, instead of Bash, then Emacs may be invoked, why not. Then when there is resource intensive process, or possibly damaging process, it will not be suspendable by Control-Z, then good luck. > > If you are making a poll, then make a poll among people who know what > > is job control. You can choose any community for your polls, but that > > will not make your survey authentic. If I ask chicks behind my house > > they will say pee, pee, but I am sure they will answer negatively on > > job control question, as they have never learned about Bash, and many > > people who learned about Bash, Korn Shell, dash, zsh, did not learn > > about job control. Ask those who KNOW about the job control if they > > use it and when and how. That will be authentic information. > > I won't be making the poll without the maintainers' request. That would be > just a waste of time. > > But if that happens, we should poll everybody. Because the question is not > whether to remove the feature, but whether it should take up an important > key sequence. And if people are using it very rarely, it shouldn't. That functionality is useful in rare situations. If use is rare it does not mean it should be taken away from users. This is because you come from different background and I come from different background. I am terminal user since years, I do not intend to ever "switch", of course that I know how to use Thunderbird, but what I can do with `mutt' is impossible to do with Thunderbird. I have tried it for years. For example, I cannot just press a key in Thunderbird and see user's profile in Emacs (all previous emails, SMS, notes) as that is what I do with mutt. I cannot press a key on mailer-daemon email and tell to database that email address of specific user is invalid. Polling exclusively the enthusiastic Emacs users, those who report here, is biased as expectation for Control-z comes from shell and terminal users in the first place, not Emacs users. Functionality is obviously not there to be used frequently. It suspends the process. We have seen here on the mailing list in last days that several people assumed that some keys are anyway not used by anybody, and some people said "NO", I use it every day. M-t for example I never use personally, should I for that reason assume it is "rare" and not used by average users and because it is not used by average users rather remove the key in the mainstream Emacs? I don't think so. I am aware that such poll would be biased from beginning. If you wish to make a poll, make it on all keys as that would not be biased poll. Or make a package that tracks which keys are used except of those with self-insert, and I will gladly run it and submit data to you. That would not be biased. Make something similar like popularity contest in Debian, just for keys, wait for one year and evaluate results. That would not be biased way. And polling new or casual users or Emacs is impossible as they will never report anywhere. Control-Z will be used by those shell and terminal users who know what is job control. >From that group of people, those Emacs beginners will be using Control-Z. >From that group of people, those Emacs users who use Emacs Lisp or Emacs for more extensive processing, will be those who use Control-Z. Average Emacs users will not be using Control-Z as average Emacs user does not handle extensive processing. Sarcasm follows: Go ahead and ask average group of users to remove a function on the key that is not used by average group of users (call it "rarely used"). You will not get complaints of beginners, as they will never report here. You may get few complaints of those who find it weird. But if you wish to apply such criterion then you should apply it on all Emacs key bindings: - ask only average users who report here or in other Emacs communities - find what is not used by average users, what is rare - remove or replace the function Again you will never hear of beginners complaining, you will hear complaints of those not average users who, for opinion of average users, use some functions rarely. All that makes no sense. > > If I suspend a job in bash, I may decide to run it in background, but > > not automatically. > > > > 1. Control-Z suspends the job, it stops running. > > > > 2. fg brings it in foreground > > > > 3. bg allows it to run in background, shell is free for other commands > > in parallel > > > > 4. Invoking other jobs in meantime is possible without interrupting > > the suspended job to be continual, they can be continued later with > > fg or bg commands in shell > > > > 5. nohup, screen and tmux are not job control commands. They help you > > run programs without your direct supervision and without > > interrupting them when you log off. But is not related to job > > control. > > > > See: (info "(bash) Job Control") > > This is Bash's manual. No Emacs's. Exactly true! That is where your misunderstanding of Control-Z expectation comes from. Expectation for Control-Z does not come from Emacs users, it comes from shell users. From dash, ksh, Bash and other shell users, including from PowerShell users who miss that function from Bash, just as referenced on the link above. Jean