Emacs and CygWin


Don’t forget to look at the menu-bar, there are customizations for Cygwin available... like the Cygwin shell


some from .emacs

;; cygwin
;; NOTE: PATH-concat REVERSED from source material
;; so that native (Perl) executes first
(setenv "PATH" (concat (getenv "PATH") "c:/bin;"))
(setq exec-path (cons "c:/bin/" exec-path))
(require 'cygwin-mount)

(add-hook 'shell-mode-hook 'n-shell-mode-hook)
(defun n-shell-mode-hook ()
  "12Jan2002 - sailor, shell mode customizations."
  (local-set-key '[up] 'comint-previous-input)
  (local-set-key '[down] 'comint-next-input)
  (local-set-key '[(shift tab)] 'comint-next-matching-input-from-input)
  (setq comint-input-sender 'n-shell-simple-send)

;; designed for Cygwin (see "man"), but clear works just fine normally.
(defun n-shell-simple-send (proc command)
  "17Jan02 - sailor. Various commands pre-processing before sending to shell."
   ;; Checking for clear command and execute it.
   ((string-match "^[ \t]*clear[ \t]*$" command)
    (comint-send-string proc "\n")
   ;; Checking for man command and execute it.
   ((string-match "^[ \t]*man[ \t]*" command)
    (comint-send-string proc "\n")
    (setq command (replace-regexp-in-string "^[ \t]*man[ \t]*" "" command))
    (setq command (replace-regexp-in-string "[ \t]+$" "" command))
    ;;(message (format "command %s command" command))
    (funcall 'man command)
   ;; Send other commands to the default handler.
   (t (comint-simple-send proc command))



NOTE: the execution problem wasn’t from within a Cygwin shell -- it was the _normal_ shell; since the path has the cygwin bin first, the W32 shell would ignore native Perl, and run that, first. ouch.



See Also

Programming.Cyg Win




Emacs CygWin Shell



No comments yet.



Add Comment

 Your Message
 Enter value ← Have you entered the code number?