Hot answers tagged

15

Reasons to use Lucid over GTK Stability Examples from etc/PROBLEMS: ** When Emacs is compiled with Gtk+, closing a display kills Emacs. ... *** Emacs built with GTK+ toolkit produces corrupted display on HiDPI screen *** Emacs built with GTK+ toolkit can unexpectedly widen frames Recent example: Bug#25228 "custom-set-faces from init file ~/.emacs ...


7

Q also uses --no-site-lisp. See the Emacs manual, node Initial Options. For information about X resources, see node Resources. Learn to ask Emacs: C-h r, then i and type some text to match an index entry, then TAB to see the matches, and choose one. You can find i and other manual-browsing keys by doing C-h m in the manual. C-h m in any mode gives you ...


6

Lucid Emacs uses the older lucid widget toolkit for XWindows. It looks older and greyer and I see no compelling reason to use it on a modern X desktop. Unless of course you have specific reasons to run it: run emacs in server mode on the background where the lucid version is reportedly more stable run on very stripped down X server configurations tldr; if ...


6

You can use the external utilities xsel or xclip (they have mostly the same features, I'll use xsel in this answer) to copy data from or to the X clipboard. To copy to the clipboard, pass the desired content on standard input. When pasting from the clipboard, the content is written to standard output. To copy the selection to the X clipboard, use M-| xsel -...


5

You might want to have a look at the various ns-*-modifier, like ns-alternate-modifier (for Option) or ns-command-modifier (for Command). They allow to map the native OSX keys to arbitrary modifiers. Note that there exists a ns-function-modifier which is quite handy for laptops. That should solve the native OSX Emacs part. As for XQuartz, without testing ...


5

To expand on Tarsius' answer. display-pixel-width and display-pixel-height return the width and height respectively. display-monitor-attributes-list will give you information on all the available monitors attached to the DISPLAY. If you're dealing with a multi-monitor situation you'll probably need: (assq 'workarea (nth X (display-monitor-attributes-list)...


5

To quote the documentation: window-system is a variable defined in `C source code'. Its value is x It is a terminal-local variable; global value is the same. Documentation: Name of window system through which the selected frame is displayed. The value is a symbol: nil for a termcap frame (a character-only terminal), 'x' for an Emacs ...


4

try to add this code in init.el and restart the daemon: (require 'frame) (defun set-cursor-hook (frame) (modify-frame-parameters frame (list (cons 'cursor-color "DeepSkyBlue")))) (add-hook 'after-make-frame-functions 'set-cursor-hook)


4

Since Emacs 23, you no longer need to care whether Emacs was started from inside X. Start Emacs however you like, possibly as a daemon. Open and close frames on any display as desired. Start Emacs with emacs --daemon then when you want to edit a file, run emacsclient MYFILE or if you just want to create a frame, run emacsclient -c which will create an ...


4

Use display-pixel-width and display-pixel-height.


4

I tracked down the problem to the last line of use-fancy-splash-screens-p, which erroneously returns nil. If we change the last number from 19 to 17, the Emacs logo appears as expected. The revised function can be placed in the .emacs file and it is detected before the splash screen is displayed. Here is the open bug report: http://debbugs.gnu.org/cgi/...


4

Emacs 26 by default switches on double buffering for X servers when it finds the Xdbe header on the build machine. (See Emacs 26 release notes at the GitHub mirror.) Some X servers don’t support this. Therfore switching off double buffering by adding '(inhibit-double-buffering . t) to your frame parameters might fix this. Safest way is to add it to default-...


3

Since this is running on X, it might be possible to use a program like xdotool , xdo, or wmctrl All these programs allow you to list windows, select one, and simulate typing on them. Another approach would be to run x11vnc on the remote machine and connect to it with a local vnc viewer. The referenced manual page tells you how to forward needed ports using ...


3

You can apply a super modifier with C-x @ s. So to type Super+z, you woule press C-x @ s z. If you find the C-x @ s combo too cumbersome, then you can bind it to something easier to type. Here is an example of binding it to C-]: ;; Turn `C-]' into a sticky "super" modifier. (define-key local-function-key-map [?\C-\]] 'event-apply-super-modifier) ;; Move ...


3

I ended up making this script based on this #!/bin/bash -e if [[ "$DISPLAY" ]]; then frame=`emacsclient -a '' -e "(member \"$DISPLAY\" (mapcar 'terminal-name (frames-on-display-list)))" 2>/dev/null` [[ "$frame" == "nil" ]] && opts='-c' # if there is no frame open create one [[ "${@/#-nw/}" == "$@" ]] && opts="$...


3

Before running emacsclient you need to run xauth merge /var/run/gdm/auth-for-anthony-ATsjnA/database. This is due to gdm3's braindead use of XAUTHORITY. One way to work around that is to use something like a ~/.xsession file where you do: gdmauth=$XAUTHORITY unset XAUTHORITY export XAUTHORITY xauth merge "$gdmauth"


3

You can use the function display-graphics-p: (display-graphic-p &optional DISPLAY) Return non-nil if DISPLAY is a graphic display. Graphical displays are those which are capable of displaying several frames and several different fonts at once. This is true for displays that use a window system such as X, and false for text-only terminals. ...


3

I suggest you try out the xclip package, availble in GNU ELPA.


2

It turns out that Delete (delete) is also translated to DEL rather than deletechar; this happens in local-function-key-map, not in input-decode-map, so I didn't notice it at first because my keybindings overrode that. The manual has a section “If <DEL> Fails to Delete”, which pointed me to normal-erase-is-backspace, which is used when a frame is ...


2

Try running "xcompmgr -n &". (See https://michaelheap.com/google-chrome-stealing-focus-repainting-in-xmonad/) This finally fixed emacs for me, but, ironically, it has slowed google-chrome down in the current session I am in.


2

The hypothesis The problem should come from Xressources. The Xressources are set via xrdb calls. The user-space place to store Xressources settings is ~/.Xressources (that usually are read and applicated via xrdb -merge ~/.Xressources on login). But other than that, there are plenty of mechanisms that can call xrdb (xinit, XSession, display-manager, ...


2

In addition to zarkone's answer, there's a variable that controls whether Emacs should infer X resources: inhibit-x-resources. Setting it to t would disallow Emacs to use any X resources, relying on its own colors.


2

You can use the mouse-avoidance-mode, see here for documentation. To test it simply enter M-x mouse-avoidance-mode and then select an option (see documentation link above) To have it permanently use M-x customize-group RET avoid RET. Then set it up and save it.


2

There is no graphical Emacs build for Linux without X, no. As suggested in the commentary, you can use textual Emacs instead and customize the parts interacting with the clipboard to use wl-clipboard instead.


2

The answer to the question is to use the Lucid version of emacs. With Ubuntu, the package is called emacs25-lucid. From comments in the code and it also pops out on stderr if you can managed to get it: When compiled with GTK, Emacs cannot recover from X disconnects.\n\ This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\ For details, see ...


1

You can use (setq make-pointer-invisible t)


1

As pointed out in the Emacs manual, by default “Emacs hides the mouse pointer each time you type a self-inserting character” (emphasis mine). If hiding only on self-inserting characters is not enough, customize mouse-avoidance-mode and set it to banish, which will force the mouse pointer to a corner of the frame on any keystroke.


1

Partial solution: ESC key is equivalent to M-key, so you can type Escape key instead of Alt+key if that's more convenient. If you don't use Menu for anything in Emacs, you can make it an alternate ESC. You'd have to type Menu then the key instead of using it as a modifier. (define-key function-key-map [menu] [?\e]) An approximately equivalent solution ...


1

It seems that X defaults to a font that looks bad, or at least just has bad size. Try customizing fonts to make them look good (Options > Set Default font... from menu bar.) You add something like this in your config file to change fonts only when you're using X: (when (eq window-system 'x) ;; your custom font settings here )


1

Not exactly what you're asking for, but this works well for me: (global-unset-key [down-mouse-1]) ; no dragging nonsense (global-set-key [mouse-1] 'mouse-select-window) ; no setting point This doesn't match your request exactly in that not only is the frame made active but so is the window clicked. But, I find that to be useful. Double click moves the ...


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