diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index fbc8bea8b..18e5be71a 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,7 @@ +2009-02-14 Jari Aalto + + * faq-using.xml: Expand Emacs entries. + 2009-02-13 Nahor * overview.sgml: Fix 1.7 release date. diff --git a/winsup/doc/faq-using.xml b/winsup/doc/faq-using.xml index ea5caa9b3..e4aee312a 100644 --- a/winsup/doc/faq-using.xml +++ b/winsup/doc/faq-using.xml @@ -805,14 +805,25 @@ Consider using XEmacs for now. + +What about XEmacs? + + +For a concise description of the current situation with XEmacs, see +this message from the Cygwin mailing list: +http://cygwin.com/ml/cygwin/2002-11/msg00609.html. + + + What about NT Emacs? -If you want GNU Emacs with a native Microsoft GUI interface, then -you can either use XEmacs (see below), or you can fetch a native NT Emacs -from http://ftp.gnu.org/pub/gnu/emacs/windows/. See also the README file you get from the -same place. +If you want GNU Emacs with a native Microsoft GUI interface, +then you can either use XEmacs (see above), or native +NT Emacs: see section +Where can I get pre-compiled versions? in NT Emacs FAQ. + NT Emacs uses the Windows command shell by default. Since it is not a Cygwin application, it has no knowledge of Cygwin mounts. With those @@ -822,25 +833,86 @@ for the JDEE package (http://jdee.sunsite.d settings are for Emacs 21.1: + + ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Initial setup + ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; This assumes that Cygwin is installed in C:\cygwin (the ;; default) and that C:\cygwin\bin is not already in your ;; Windows Path (it generally should not be). - ;; + (setq exec-path (cons "C:/cygwin/bin" exec-path)) (setenv "PATH" (concat "C:\\cygwin\\bin;" (getenv "PATH"))) - ;; - ;; NT-emacs assumes a Windows command shell, which you change - ;; here. - ;; + + ;; LOGNAME and USER are expected in many Emacs packages + ;; Check these environment variables. + + (if (and (null (getenv "USER")) + ;; Windows includes variable USERNAME, which is copied to + ;; LOGNAME and USER respectively. + (getenv "USERNAME")) + (setenv "USER" (getenv "USERNAME"))) + + (if (and (getenv "LOGNAME") + ;; Bash shell defines only LOGNAME + (null (getenv "USER"))) + (setenv "USER" (getenv "LOGNAME"))) + + (if (and (getenv "USER") + (null (getenv "LOGNAME"))) + (setenv "LOGNAME" (getenv "USER"))) + + ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; (A) M-x shell: This change M-x shell permanently + ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ;; Would call Windows command interpreter. Change it. + (setq shell-file-name "bash") - (setenv "SHELL" shell-file-name) - (setq explicit-shell-file-name shell-file-name) - ;; - ;; This removes unsightly ^M characters that would otherwise - ;; appear in the output of java applications. - ;; + (setenv "SHELL" shell-file-name) + (setq explicit-shell-file-name shell-file-name) + + ;; Remove C-m (^M) characters that appear in output + (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m) + + ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; (B) *OR* call following function with M-x my-bash + ;; The M-x shell would continue to run standard Windows shell + ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (defun my-bash (&optional buffer) + "Run Cygwin Bash shell in optional BUFFER; default *shell-bash*." + (autoload 'comint-check-proc "comint") + (interactive + (let ((name "*shell-bash*")) + (if current-prefix-arg + (setq name (read-string + (format "Cygwin shell buffer (default %s): " name) + (not 'initial-input) + (not 'history) + name))) + (list name))) + (or buffer + (setq buffer "*shell-bash*")) + (if (comint-check-proc buffer) + (pop-to-buffer buffer) + (let* ((shell-file-name "bash") + (explicit-shell-file-name shell-file-name) + (explicit-sh-args '("--login" "-i")) + (explicit-bash-args explicit-sh-args) + (w32-quote-process-args ?\"));; Use Cygwin quoting rules. + (shell buffer) + ;; By default Emacs sends "\r\n", but bash wants plain "\n" + (set-buffer-process-coding-system 'undecided-dos 'undecided-unix) + ;; With TAB completion, add slash path separator, none to filenames + (make-local-variable 'comint-completion-addsuffix) + (setq comint-completion-addsuffix '("/" . "")) + ;; This variable is local to buffer + (setq comint-prompt-regexp "^[ \n\t]*[$] ?")))) + If you want NT Emacs to understand Cygwin paths, get @@ -851,16 +923,6 @@ Emacs or XEmacs from Cygwin Setup. - -What about XEmacs? - - -For a concise description of the current situation with XEmacs, see -this message from the Cygwin mailing list: -http://cygwin.com/ml/cygwin/2002-11/msg00609.html. - - - Is there a better alternative to the standard console window?