Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Next: , Previous: Mac International, Up: Mac OS


F.3 Environment Variables and Command Line Arguments.

On Mac OS X, when Emacs is run in a terminal, it inherits the values of environment variables from the shell from which it is invoked. However, when it is run from the Finder as a GUI application, it only inherits environment variable values defined in the file ~/.MacOSX/environment.plist that affects all the applications invoked from the Finder or the open command.

Command line arguments are specified like

     /Applications/Emacs.app/Contents/MacOS/Emacs -geometry 80x25 &

if Emacs is installed at /Applications/Emacs.app. If Emacs is invoked like this, then it also inherits the values of environment variables from the shell from which it is invoked.

On Mac OS Classic, environment variables and command line arguments for Emacs can be set by modifying the ‘STR#’ resources 128 and 129, respectively. A common environment variable that one may want to set is ‘HOME’.

The way to set an environment variable is by adding a string of the form

     ENV_VAR=VALUE

to resource ‘STR#’ number 128 using ResEdit. To set up the program to use unibyte characters exclusively, for example, add the string

     EMACS_UNIBYTE=1

Although Emacs on Mac does not support X resources (see X Resources) directly, one can use the Preferences system in place of X resources. For example, adding the line

     Emacs.cursorType: bar

to ~/.Xresources in X11 corresponds to the execution of

     defaults write org.gnu.Emacs Emacs.cursorType bar

on Mac OS X. One can use boolean or numeric values as well as string values as follows:

     defaults write org.gnu.Emacs Emacs.toolBar -bool false
     defaults write org.gnu.Emacs Emacs.lineSpacing -int 3

Try M-x man RET defaults RET for the usage of the defaults command. Alternatively, if you have Developer Tools installed on Mac OS X, you can use Property List Editor to edit the file ~/Library/Preferences/org.gnu.Emacs.plist.


 
 
  Published under the terms of the GNU General Public License Design by Interspire