* programmatically make window full length but not change width @ 2022-07-29 23:56 Mickey Ferguson via Users list for the GNU Emacs text editor 2022-07-30 1:03 ` [External] : " Drew Adams 0 siblings, 1 reply; 7+ messages in thread From: Mickey Ferguson via Users list for the GNU Emacs text editor @ 2022-07-29 23:56 UTC (permalink / raw) To: Emacs Help I'm trying to figure out how to generate what happens when I have my emacs window open and I double-click on the top edge of the window. Say I'm working in notepad. (The horror!) I double-click on the top edge of the window (not the title area, but the very edge, when the mouse pointer changes to an up/down arrow), and the window resizes to the very top and very bottom of the desktop, while maintaining the width it had. (This is how it differentiates from double-clicking on the title bar of the window, which just maximizes the window.) Or, if there is a simple function that does this, that would be even better. I just want the simplest way to make my window full length - something I could put in my .emacs or code into a function that can be bound to a keyboard operation. -- *For more information on how and why we collect your personal information, please visit our Privacy Policy <https://www.motorolasolutions.com/en_us/about/privacy-policy.html?elqTrackId=8980d888905940e39a2613a7a3dcb0a7&elqaid=2786&elqat=2#privacystatement>.* ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [External] : programmatically make window full length but not change width 2022-07-29 23:56 programmatically make window full length but not change width Mickey Ferguson via Users list for the GNU Emacs text editor @ 2022-07-30 1:03 ` Drew Adams 2022-07-31 23:42 ` Mickey Ferguson via Users list for the GNU Emacs text editor 2022-08-01 17:26 ` Mickey Ferguson via Users list for the GNU Emacs text editor 0 siblings, 2 replies; 7+ messages in thread From: Drew Adams @ 2022-07-30 1:03 UTC (permalink / raw) To: Mickey Ferguson; +Cc: 'Help-Gnu-Emacs (help-gnu-emacs@gnu.org)' [-- Attachment #1: Type: text/plain, Size: 587 bytes --] > I just want the simplest way to make my window full length - > something I could put in my .emacs or code into a function > that can be bound to a keyboard operation. Not sure what you're asking. And I think maybe you mean Emacs "frame" when you say "window". Anyway, maybe something like this is what you're looking for: maximize-frame-vertically is an interactive compiled Lisp function in ‘frame-cmds.el’. (maximize-frame-vertically &optional FRAME) Maximize selected frame vertically. https://www.emacswiki.org/emacs/download/frame-cmds.el [-- Attachment #2: winmail.dat --] [-- Type: application/ms-tnef, Size: 13591 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [External] : programmatically make window full length but not change width 2022-07-30 1:03 ` [External] : " Drew Adams @ 2022-07-31 23:42 ` Mickey Ferguson via Users list for the GNU Emacs text editor 2022-08-01 1:18 ` Drew Adams 2022-08-01 17:26 ` Mickey Ferguson via Users list for the GNU Emacs text editor 1 sibling, 1 reply; 7+ messages in thread From: Mickey Ferguson via Users list for the GNU Emacs text editor @ 2022-07-31 23:42 UTC (permalink / raw) To: Drew Adams, Emacs Help Is this a more recent module? I'm on 24.5.1, and there is no such frame-cmds.el in my distribution. If I should upgrade to a new version, how difficult is it going to be to go from 24.5.1? I have some customizations in my .emacs and site-init.el files, and I remember when I tried to go to 25, some things weren't very good, so I just stayed on 24.5.1. *Mickey Ferguson* On Fri, Jul 29, 2022 at 6:03 PM Drew Adams <drew.adams@oracle.com> wrote: > > I just want the simplest way to make my window full length - > > something I could put in my .emacs or code into a function > > that can be bound to a keyboard operation. > > Not sure what you're asking. And I think maybe > you mean Emacs "frame" when you say "window". > > Anyway, maybe something like this is what you're > looking for: > > maximize-frame-vertically is an interactive compiled > Lisp function in ‘frame-cmds.el’. > > (maximize-frame-vertically &optional FRAME) > > Maximize selected frame vertically. > > > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.emacswiki.org_emacs_download_frame-2Dcmds.el&d=DwIGaQ&c=q3cDpHe1hF8lXU5EFjNM_C93KOmcBXCBnhee2v6PYlc&r=UnDOGxolu249_JBsoh3j9MMwtRmzwiw3bhtcIBr6iLhRqxrssOAsmBCh1HfDYPjU&m=bOJv4lpOoGb_VDN2Etcsph94Gte8uw7M_f3We2NOF4uCSh96-u4GIgmhl6qziQEU&s=8DSGyi15cZSMz35GLxwcetFaWG-WymMslW83_1BIheM&e= > > -- *For more information on how and why we collect your personal information, please visit our Privacy Policy <https://www.motorolasolutions.com/en_us/about/privacy-policy.html?elqTrackId=8980d888905940e39a2613a7a3dcb0a7&elqaid=2786&elqat=2#privacystatement>.* ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [External] : programmatically make window full length but not change width 2022-07-31 23:42 ` Mickey Ferguson via Users list for the GNU Emacs text editor @ 2022-08-01 1:18 ` Drew Adams 0 siblings, 0 replies; 7+ messages in thread From: Drew Adams @ 2022-08-01 1:18 UTC (permalink / raw) To: Mickey Ferguson, Emacs Help > > https://www.emacswiki.org/emacs/download/frame-cmds.el > > Is this a more recent module? I'm on 24.5.1, and there is no such frame-cmds.el in my distribution. > > If I should upgrade to a new version, how difficult is it going to be to go from 24.5.1? I have some customizations in my .emacs and site-init.el files, and I remember when I tried to go to 25, some things weren't very good, so I just stayed on 24.5.1. I gave you the URL in the msg you replied to (above). It's a 3rd-party library, not part of vanilla Emacs. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [External] : programmatically make window full length but not change width 2022-07-30 1:03 ` [External] : " Drew Adams 2022-07-31 23:42 ` Mickey Ferguson via Users list for the GNU Emacs text editor @ 2022-08-01 17:26 ` Mickey Ferguson via Users list for the GNU Emacs text editor 2022-08-01 17:57 ` Drew Adams 1 sibling, 1 reply; 7+ messages in thread From: Mickey Ferguson via Users list for the GNU Emacs text editor @ 2022-08-01 17:26 UTC (permalink / raw) To: Drew Adams; +Cc: Help-Gnu-Emacs (help-gnu-emacs@gnu.org) Thank you, Drew. After downloading the frame-cmds.el, I also needed frame-fns.el to allow things to compile. One other tweak I needed, since my windows toolbar is at the bottom of the screen, I needed to add: (setq window-mgr-title-bar-pixel-height '175) This made it size correctly on my laptop. However, if I connect to my remote desktop computer, using either VNC or Remote Desktop Connection, then that sizing is incorrect. It seemed to be around 60 for that computer. Oh, and each of these computers have a 1920x1080 display setting, if that makes any difference. Is this a setting that needs to be set individually for each computer? If so, that's getting outside of what I would know how to do, since my goal is to have a single .emacs file for all of the computers where I work. Maybe it would be a registry setting or environment variable, for which I could easily have each computer have its own customized setting, and then the .emacs would get that env var or reg value on startup? I do appreciate the timely and quality help you provide. *Mickey Ferguson* On Fri, Jul 29, 2022 at 6:03 PM Drew Adams <drew.adams@oracle.com> wrote: > > I just want the simplest way to make my window full length - > > something I could put in my .emacs or code into a function > > that can be bound to a keyboard operation. > > Not sure what you're asking. And I think maybe > you mean Emacs "frame" when you say "window". > > Anyway, maybe something like this is what you're > looking for: > > maximize-frame-vertically is an interactive compiled > Lisp function in ‘frame-cmds.el’. > > (maximize-frame-vertically &optional FRAME) > > Maximize selected frame vertically. > > > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.emacswiki.org_emacs_download_frame-2Dcmds.el&d=DwIGaQ&c=q3cDpHe1hF8lXU5EFjNM_C93KOmcBXCBnhee2v6PYlc&r=UnDOGxolu249_JBsoh3j9MMwtRmzwiw3bhtcIBr6iLhRqxrssOAsmBCh1HfDYPjU&m=bOJv4lpOoGb_VDN2Etcsph94Gte8uw7M_f3We2NOF4uCSh96-u4GIgmhl6qziQEU&s=8DSGyi15cZSMz35GLxwcetFaWG-WymMslW83_1BIheM&e= > > -- *For more information on how and why we collect your personal information, please visit our Privacy Policy <https://www.motorolasolutions.com/en_us/about/privacy-policy.html?elqTrackId=8980d888905940e39a2613a7a3dcb0a7&elqaid=2786&elqat=2#privacystatement>.* ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [External] : programmatically make window full length but not change width 2022-08-01 17:26 ` Mickey Ferguson via Users list for the GNU Emacs text editor @ 2022-08-01 17:57 ` Drew Adams 2022-08-01 19:14 ` Mickey Ferguson via Users list for the GNU Emacs text editor 0 siblings, 1 reply; 7+ messages in thread From: Drew Adams @ 2022-08-01 17:57 UTC (permalink / raw) To: Mickey Ferguson; +Cc: Help-Gnu-Emacs (help-gnu-emacs@gnu.org) > After downloading the frame-cmds.el, I also needed frame-fns.el to allow things to compile. One other tweak I needed, since my windows toolbar is at the bottom of the screen, I needed to add: > > (setq window-mgr-title-bar-pixel-height '175) > > This made it size correctly on my laptop. However, if I connect to my remote desktop computer, using either VNC or Remote Desktop Connection, then that sizing is incorrect. It seemed to be around 60 for that computer. Oh, and each of these computers have a 1920x1080 display setting, if that makes any difference. > > Is this a setting that needs to be set individually for each computer? For each context where the title bar has a different height. `C-h v window-mgr-title-bar-pixel-height': Height of frame title bar provided by the window manager, in pixels. You might alternatively call this constant the title-bar "width" or "thickness". There is no way for Emacs to determine this, so you must set it. You can set it conditionally based on however you can determine the context and the right height for it. From the source file you see that the default value is set using this: (cond ((eq window-system 'mac) 22) ;; For older versions of macOS, 40 might be better. ((eq window-system 'ns) 50) (t 27)) If the difference between the contexts you mention is reflected in the value of `window-system' then you can use a similar sexp to set it appropriately in your init file: (setq window-mgr-title-bar-pixel-height (cond ((eq window-system 'FOO) N) ((eq window-system 'BAR) M) ... (t 27))) Where FOO, BAR, N, and M are whatever values you need. > If so, that's getting outside of what I would know how to do, since my goal is to have a single .emacs file for all of the computers where I work. Maybe it would be a registry setting or environment variable, for which I could easily have each computer have its own customized setting, and then the .emacs would get that env var or reg value on startup? See above. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [External] : programmatically make window full length but not change width 2022-08-01 17:57 ` Drew Adams @ 2022-08-01 19:14 ` Mickey Ferguson via Users list for the GNU Emacs text editor 0 siblings, 0 replies; 7+ messages in thread From: Mickey Ferguson via Users list for the GNU Emacs text editor @ 2022-08-01 19:14 UTC (permalink / raw) To: Drew Adams; +Cc: Help-Gnu-Emacs (help-gnu-emacs@gnu.org) For most of my computers, I can use a default value of 60, but on one of my computers, I need 175. So I've put this code in my .emacs file (after loading the two frame- libraries). On my one computer, I have an environment variable that it reads. This seems to do the trick! Thanks for the help, Drew! (setq window-mgr-title-bar-pixel-height (string-to-number (or (getenv "emacs-window-mgr-title-bar-pixel-height") "60"))) *Mickey Ferguson* On Mon, Aug 1, 2022 at 10:57 AM Drew Adams <drew.adams@oracle.com> wrote: > > After downloading the frame-cmds.el, I also needed frame-fns.el to allow > things to compile. One other tweak I needed, since my windows toolbar is > at the bottom of the screen, I needed to add: > > > > (setq window-mgr-title-bar-pixel-height '175) > > > > This made it size correctly on my laptop. However, if I connect to my > remote desktop computer, using either VNC or Remote Desktop Connection, > then that sizing is incorrect. It seemed to be around 60 for that > computer. Oh, and each of these computers have a 1920x1080 display > setting, if that makes any difference. > > > > Is this a setting that needs to be set individually for each computer? > > For each context where the title bar has a different height. > > `C-h v window-mgr-title-bar-pixel-height': > > Height of frame title bar provided by the window manager, in pixels. > You might alternatively call this constant the title-bar "width" or > "thickness". There is no way for Emacs to determine this, so you > must set it. > > You can set it conditionally based on however you can > determine the context and the right height for it. > > From the source file you see that the default value is > set using this: > > (cond ((eq window-system 'mac) 22) > ;; For older versions of macOS, 40 might be better. > ((eq window-system 'ns) 50) > (t 27)) > > If the difference between the contexts you mention is > reflected in the value of `window-system' then you can > use a similar sexp to set it appropriately in your init > file: > > (setq window-mgr-title-bar-pixel-height > (cond ((eq window-system 'FOO) N) > ((eq window-system 'BAR) M) > ... > (t 27))) > > Where FOO, BAR, N, and M are whatever values you need. > > > If so, that's getting outside of what I would know how to do, since my > goal is to have a single .emacs file for all of the computers where I > work. Maybe it would be a registry setting or environment variable, for > which I could easily have each computer have its own customized setting, > and then the .emacs would get that env var or reg value on startup? > > See above. > > -- *For more information on how and why we collect your personal information, please visit our Privacy Policy <https://www.motorolasolutions.com/en_us/about/privacy-policy.html?elqTrackId=8980d888905940e39a2613a7a3dcb0a7&elqaid=2786&elqat=2#privacystatement>.* ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-08-01 19:14 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-07-29 23:56 programmatically make window full length but not change width Mickey Ferguson via Users list for the GNU Emacs text editor 2022-07-30 1:03 ` [External] : " Drew Adams 2022-07-31 23:42 ` Mickey Ferguson via Users list for the GNU Emacs text editor 2022-08-01 1:18 ` Drew Adams 2022-08-01 17:26 ` Mickey Ferguson via Users list for the GNU Emacs text editor 2022-08-01 17:57 ` Drew Adams 2022-08-01 19:14 ` Mickey Ferguson via Users list for the GNU Emacs text editor
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).