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
Answertopia.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: Command Example, Up: Emacs Invocation


C.4 Resuming Emacs with Arguments

You can specify action arguments for Emacs when you resume it after a suspension. To prepare for this, put the following code in your .emacs file (see Hooks):

     (add-hook 'suspend-hook 'resume-suspend-hook)
     (add-hook 'suspend-resume-hook 'resume-process-args)

As further preparation, you must execute the shell script emacs.csh (if you use csh as your shell) or emacs.bash (if you use bash as your shell). These scripts define an alias named edit, which will resume Emacs giving it new command line arguments such as files to visit. The scripts are found in the etc subdirectory of the Emacs distribution.

Only action arguments work properly when you resume Emacs. Initial arguments are not recognized—it's too late to execute them anyway.

Note that resuming Emacs (with or without arguments) must be done from within the shell that is the parent of the Emacs job. This is why edit is an alias rather than a program or a shell script. It is not possible to implement a resumption command that could be run from other subjobs of the shell; there is no way to define a command that could be made the value of EDITOR, for example. Therefore, this feature does not take the place of the Emacs Server feature (see Emacs Server).

The aliases use the Emacs Server feature if you appear to have a server Emacs running. However, they cannot determine this with complete accuracy. They may think that a server is still running when in actuality you have killed that Emacs, because the file /tmp/esrv... still exists. If this happens, find that file and delete it.


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