From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Howard Melman Newsgroups: gmane.emacs.help Subject: Re: Proposal: "C-z " reserved for users Date: Thu, 11 Feb 2021 08:52:42 -0500 Message-ID: References: <1973673328.2493716.1612740554692.ref@mail.yahoo.com> <1973673328.2493716.1612740554692@mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32131"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:3fBccYEDPxForg4MLQ91cjv8ee8= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 11 14:57:46 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 1lACTY-0008H4-Py for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 11 Feb 2021 14:57:44 +0100 Original-Received: from localhost ([::1]:60104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lACTX-0003cj-RB for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 11 Feb 2021 08:57:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lACOt-0007a7-3n for help-gnu-emacs@gnu.org; Thu, 11 Feb 2021 08:52:55 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:51286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lACOn-0005SI-VR for help-gnu-emacs@gnu.org; Thu, 11 Feb 2021 08:52:54 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lACOl-00027H-Qw for help-gnu-emacs@gnu.org; Thu, 11 Feb 2021 14:52:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:127809 Archived-At: Christopher Miles writes: > <#secure method=pgpmime mode=sign> > > Hi, Howard, your keybinding is great. > > I copied your code, found some command is not defined. > > Can you share your Emacs configuration? Thanks in > advance. 😄 I had forgotten I'd defined some simple commands. I'm not inclined to share my whole config, but here are a few that are used in this transient. Howard (defun move-frame-right () "Move the current frame right 200 pixels" (interactive) (let* ((p (frame-position)) (x (car p)) (y (cdr p))) (set-frame-position (selected-frame) (+ x 200) y))) (defun move-frame-left () "Move the current frame left 200 pixels" (interactive) (let* ((p (frame-position)) (x (car p)) (y (cdr p))) (set-frame-position (selected-frame) (- x 200) y))) (defun select-previous-frame (&optional arg) "Select the -ARG'th visible frame on current display, and raise it. All frames are arranged in a cyclic order. This command selects the frame ARG steps previously in that order. It is the reverse of `other-frame'." (interactive "p") (other-frame (* -1 arg))) (defun kill-buffer-and-frame () "Kill the current buffer and the current frame." (interactive) ;; do this trick in case of dedicated window in special frame ;; in that case kill-buffer will delete-frame too ;; can't check after kill buffer since selected-frame will have changed (if (window-dedicated-p (selected-window)) (kill-buffer (current-buffer)) (kill-buffer (current-buffer)) (delete-frame))) > > Howard Melman writes: > > S Boucher writes: > > C-z is bound to a low frequency use function (suspend-frame)… and > speaking for myself, I probably can count on one hand the number of > times I've used it in the last 25years :-) > > I would suggest:1) move suspend-frame to "C-c C-z" (that is still a > quick shortcut) 2) reserve C-z for users That still leaves a > whole lot with C-z C-… C-z M-… > > FWIW I used to bind the ctl-x-5-map to C-z add was happier typing C-z > f than C-x 5 f. I shifted to this frame oriented transient on C-z for > a while now and have been happy. I'm sure it could be improved but as > a first attempt it's been pretty good for me. > > ;;; frame commands from ctl-x-5-map > (define-transient-command hrm-frame-transient () > "Frame commands mirroring ctl-x-5-map" > ["Configure Frames" > ["Manage" > ("2" "New" make-frame-command) > ("0" "Delete" delete-frame) > ("k" "Kill Frame & Buffer" kill-buffer-and-frame) > ("1" "Delete others" delete-other-frames) > ] > ["Select" > ("o" "Other" other-frame) > ("n" "Next" other-frame) > ("p" "Previous" select-previous-frame) > ] > ["Display" > ("-" "Fixed Width" variable-pitch-mode) > ("l" "Lower" lower-frame) > ("=" "Maximize" toggle-frame-maximized) > ("i" "Iconify" iconify-frame) > ] > ["Move" > ("<" "Left" move-frame-left :transient t) > (">" "Right" move-frame-right :transient t) > ] > ] > ["Open in other Frame" > ["Files" > ("b" "Buffer" switch-to-buffer-other-frame) > ("C-o" "Buffer other frame" display-buffer-other-frame) > ("C-f" "File" find-file-other-frame) > ("f" "File" find-file-other-frame) > ("r" "File Read-Only" find-file-read-only-other-frame) > ] > ["Apps" > ("d" "Dired" dired-other-frame) > ("." "Xref" xref-find-definitions-other-frame) > ("m" "Compose Mail" compose-mail-other-frame) > ] > ["Help For" > ("V" "Variable" find-variable-other-frame) > ("F" "Function" find-function-other-frame) > ("K" "Key" find-function-on-key-other-frame) > ("L" "Library" find-library-other-frame) > ] > ] > ) > (global-set-key (kbd "C-z") 'hrm-frame-transient) -- Howard