From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24778 invoked by alias); 25 May 2011 08:34:19 -0000 Received: (qmail 24417 invoked by uid 22791); 25 May 2011 08:34:16 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 May 2011 08:33:59 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QP9XR-000450-Vv for cygwin@cygwin.com; Wed, 25 May 2011 10:33:58 +0200 Received: from 91.193.68.214 ([91.193.68.214]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 May 2011 10:33:57 +0200 Received: from gavenko by 91.193.68.214 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 May 2011 10:33:57 +0200 To: cygwin@cygwin.com From: Oleksandr Gavenko Subject: Re: Using Cygwin Emacs Date: Wed, 25 May 2011 08:34:00 -0000 Message-ID: <4DDCBEEF.7080106@bifit.com.ua> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-05/txt/msg00355.txt.bz2 On 16.05.2011 4:27, Sayth Renshaw wrote: > Before I venture down this path are there many people using > this package? Is it advantageous to use this package(cygwin)? Advantage is in full integration of Emacs and Cygwin tools. Watching this list I found that many people use Cygwin Emacs package. > Or is there not much upside to a user using the default 23.2 zip package? I use native GNU Emacs. It's GIU look more pretty and Emacs understand Windows-style path is good thing when you need "goto-error" feature for MSVC compiler, etc... With "cygwin-mount.el" native Emacs understand Cygwin-style path. Also I use: (when (eq system-type 'windows-nt) ;; Workaround for Cygwin shell, when set 'CYGWIN=noglob'. By default 'shell-quote-argument' ;; quoted by double '\' chars, this cause failure. (defun shell-quote-argument (argument) (concat "'" argument "'") ) ;; Workaround for Cygwin when 'shell-file-name' is 'bash'. (setq null-device "/dev/null") ) ;; Use shell from Cygwin/MinGW. (setq shell-file-name "bash") (setenv "SHELL" "/bin/bash") (setq explicit-bash-args '("-i")) (setq explicit-sh-args '("-i")) and some utils like "hg" require wrapper to make it .exe. Just compile: #include #include #include #include #define MAX_STR_LEN 500 int main(int argc, char **argv) { char cmd[MAX_STR_LEN] = ""; char **cmdarg = malloc((argc+1) * sizeof(char *)); char *start, *end; start = strrchr(*argv, '/'); if (start) start++; else start = *argv; end = strrchr(start, '.'); if (end) { memcpy(cmd, start, end - start); cmd[end - start] = '\0'; } else strcpy(cmd, start); for (int i = 0; i < argc; i++) cmdarg[i] = argv[i]; cmdarg[argc] = NULL; return execvp(cmd, cmdarg); } and take name to executable as shell/perl/python/... script with ".exe" suffix. Also I have troubles with quoting of " and {. For example to make vc-hg.el work properly I patch it: --- vc-hg.el 2011-01-08 19:45:14.000000000 +0200 +++ vc-hg-new.el 2011-03-17 17:20:26.187500000 +0200 @@ -218,7 +218,7 @@ vc-hg-program nil t nil "--config" "alias.parents=parents" "--config" "defaults.parents=" - "parents" "--template" "{rev}" (file-relative-name file))) + "parents" "--template" "\\{rev\\}" (file-relative-name file))) ;; Some problem happened. E.g. We can't find an `hg' ;; executable. (error nil))))))) @@ -324,7 +324,7 @@ (defun vc-hg-revision-table (files) (let ((default-directory (file-name-directory (car files)))) (with-temp-buffer - (vc-hg-command t nil files "log" "--template" "{rev} ") + (vc-hg-command t nil files "log" "--template" "\\{rev\\} ") (split-string (buffer-substring-no-properties (point-min) (point-max)))))) That's all you need to friend native Emacs with Cygwin. I am happy with this setup for 3 year with native Emacs from 22.1 to 23.3. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple