From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Sanest way to make emacs behave on a Solaris OS Date: Wed, 07 Aug 2013 02:22:01 +0200 Organization: Aioe.org NNTP Server Message-ID: <871u66uz86.fsf@VLAN-3434.student.uu.se> References: <87d2pzj4m2.fsf@VLAN-3434.student.uu.se> <87ob9izk9k.fsf@VLAN-3434.student.uu.se> <87fvusw968.fsf@newsguy.com> <87mwoz2gzr.fsf@VLAN-3434.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1375835115 9441 80.91.229.3 (7 Aug 2013 00:25:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Aug 2013 00:25:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 07 02:25:18 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V6rYz-0007sg-W8 for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Aug 2013 02:25:18 +0200 Original-Received: from localhost ([::1]:56854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6rYz-0000TI-1e for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Aug 2013 20:25:17 -0400 X-Received: by 10.180.208.67 with SMTP id mc3mr236999wic.1.1375834922530; Tue, 06 Aug 2013 17:22:02 -0700 (PDT) Original-Path: usenet.stanford.edu!el7no10034691wib.1!news-out.google.com!ed8ni14584wic.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 91 Original-NNTP-Posting-Host: SWN/nubmpQxYKwY7hPy4YA.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:DpmPet1lNgPgaYdkEkEoXyVOqrU= Original-Xref: usenet.stanford.edu gnu.emacs.help:200497 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92764 Archived-At: Dan Espen writes: > #if ( HEIGHT == 900 ) /* Traditional Sparc */ > Rxvt.geometry: 80x55 > #elif ( HEIGHT == 1024 ) /* Sparc 21 inch */ > Rxvt.geometry: 80x65 > #elif ( HEIGHT == 768 ) /* Exceed in 1024x768 mode */ > Rxvt.geometry: 80x47 > #else /* I have no idea... */ > Rxvt.geometry: 80x40 > #endif I did some research on this, and put it a short article. I will probably send it to some Linux aficionados and their publications, so I made an effort to be more pedagogical in tone, than I usually am. Anyway, suggestions how to improve are welcome. But this post is also a continuation of this very discussion, so don't worry! Xdefaults vs. Xresources The old solution was: Whenever an X ("Xlib" - ?) application is invoked, it looks in ~/.Xdefaults for settings, and then executes. The file had to be on the same filesystem, in the user's HOME. The "new" solution is: Whenever an X application is invoked, it looks for settings in RESOURCE_MANAGER (XA_RESOURCE_MANAGER - ?) in the root window of screen 0. Settings are there, if xrdb has been run since the start of X. If not, the *fallback* is to look for settings in Xdefaults (every time, for every application, exactly as the old solution). xrdb doesn't have to read ~/.Xresources, that's a convention. It can read any file, even ~/.Xdefaults. (Note that xrdb *has* to be used - some say ~/.Xresources is ignored because of GNOME and GDM - this is not the case - even with xinit or startx, xrdb has to be used.) Xresources makes for flexibility, as any user can use, or not use, xrdb, and use it on any file. Xresources makes for mobility, as ~/.Xdefaults has to be in the user's HOME folder, on the same file system. To test the enhanced mobility, after reading resources with xrdb, do the following: 1. In X, and a WM (e.g., Openbox), and a terminal (e.g., urxvt), ssh to a remote system with the -Y option. There, start xterm, or any other application that you have configured on your local system, but not on the system, to which you ssh'd. Then, do the same on you local system: start xterm. They look the same! 2. Now, on your local system, run 'xrdb -remove'. Again, start xterm on both the remote and the local system - again, they look the same, only now, they aren't configured. 3. Last, to demonstrate the limited scope of Xdefaults, without using xrdb since step 2, on you local system, run 'cp ~/.Xresources ~/.Xdefaults' (after salvaging anything of value from Xdefaults), then run xterm on both remote and local system. The remote xterm is unconfigured, but the local xterm is - only, this time, from Xdefaults. Notes: The #1 Google hit on this issue recommends making ~/.xinitrc an executable, with 'chmod +x' - this is not needed. Also, the same article exemplifies the use of xrdb in .xinitrc with a trailing '&', making xrdb a background process. This isn't right, as the next program run from .xinitrc may use the very same settings, that xrdb is in the process of setting up, and that must be completed before any application that depends on it can be run. Simple cure: remove the '&'. Some xterm settings useful for testing: xterm*autoWrap: true xterm*pointerMode: 2 xterm*geometry: 77x28 xterm*background: black xterm*foreground: green4 xterm*faceName: default xterm*metaSendsEscape: true -- Emanuel Berg - programmer (hire me! CV below) computer projects: http://user.it.uu.se/~embe8573 internet activity: http://home.student.uu.se/embe8573