2

(execute-kbd-macro (read-kbd-macro "<f11>")) As for the key sequence syntax see the edmacro-mode help (C-h f edmacro-mode). For example, it allows you to write: (execute-kbd-macro (read-kbd-macro "C-x 3 C-x o M-x ansi-term"))


2

Properties of frames are called frame parameters. Whether a frame is maximized this way or not is controlled by the 'fullscreen parameter. We want this parameter to be 'fullboth. And we can set a frame parameter using #'set-frame-parameter. So here's code to make sure the 'fullscreen parameter is 'fullboth: (set-frame-parameter nil 'fullscreen 'fullboth)


2

After digging into get-device-terminal it looks like it's the same as the device or tty frame property. According to the documentation, it's the X11 display name HOST.SERVER.SCREEN. On MS-windows it's simply the string "w32".


1

If you load the library frame-cmds.el then you can place the following in your init file: (when (display-graphic-p) (add-hook 'window-setup-hook #'maximize-frame-vertically)) The conditional is to make sure you are not running in a terminal window, where maximisation would not make sense.


1

You can call (display-monitor-attributes-list), it will return a list where each element describe each monitor. In your case, you can simply check the length of the list. If it contains one element you can configure Emacs for the built-in screen. If it contains two or more elements you can configure it for the external monitor. An ambitious solution could ...


1

I use this script (I found it, it is in Russian): #!/bin/bash ###################################################################################################### # This script will toggle minimize/activate first window with specified class # If window not found program will be launched # # window class can be found with next programs: # wmctrl -x -l # ...


1

The other answers pretty much cover it, but you may run into a problem with read-kbd-macro where it isn't really meant for reading raw text input. So "hello world" becomes the macro to insert "helloworld" without the space. You could write a function that gives you a way to specify what should be read as a macro and what is already read to be executed as ...


1

Customize user option default-frame-alist. Add (by clicking button INS) parameter fullscreen and give it a value of fullboth. Save the option changes.


Only top voted, non community-wiki answers of a minimum length are eligible