From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Girault Newsgroups: gmane.emacs.help Subject: Re: emacs-"distribution" for windows? Date: Fri, 27 Jul 2018 14:14:16 -0300 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1532711602 4948 195.159.176.226 (27 Jul 2018 17:13:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Jul 2018 17:13:22 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 27 19:13:18 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fj6Io-0001B1-Kc for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Jul 2018 19:13:18 +0200 Original-Received: from localhost ([::1]:42365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fj6Kv-0006Qo-Bp for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Jul 2018 13:15:29 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 134 Original-NNTP-Posting-Host: 0GFl95MMkh9rekr7ygW5/A.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Original-Xref: usenet.stanford.edu gnu.emacs.help:223479 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117604 Archived-At: On 24/07/2018 08:13, emacs-list-18@pgxml.net wrote: > Hi, > > i need a bit input from emacs users on the windows platform. > > What "distribution" do you use? Is the windows emacs from gnu suitable > for day to day work, or are there more windows-optimized emacs-dists > out there? > > Just tell me a bit about your setup, and what the main tasks you with > emacs are. I have to tell you my story. (Like the others, I also use no distribution. I haven't heard of one yet. I would have loved to have begun with a distribution, but I never knew of one.) I was working on a really bad job and my girlfriend was working on her dissertation. She used a terrible editor called TeXworks and was suffering dearly. She works in a highly technical area, so I was sure she would like the GNU EMACS. So I put together the editor plus many other software that she used. I also wrote code to set it up in a more personal way. When it was ready, I thought the result was so good that I began to use it myself every day and realized that Windows happens to be more adequate than GNU systems for her type (and my type) of work. I took the binary GNU EMACS from gnu.org. It had to be portable. She would put it on a USB drive and take it to other systems and continue to work. So when she'd run the GNU EMACS, it should know how to find the start-up code without environment variables. I eventually convinced myself that site-lisp/site-start.el is the solution. I'm not a site of various users. It's fine to consider that my dot-emacs. But EMACS does need the HOME variable sometimes. So I wrote some code to discover each time where is the EMACS binary running from. I eventually convinced myself the variable command-line-default-directory is ideal for that. (if (string= system-type "windows-nt") (progn (let ((my-path (split-string (expand-file-name command-line-default-directory) "/"))) (setq *my-home-dir* (mapconcat 'identity (subseq my-path 0 (- (length my-path) 2)) "/"))) (setq command-line-default-directory *my-home-dir*) (setenv "HOME" *my-home-dir*))) (cd *my-home-dir*) (if (string= system-type "windows-nt") (setenv "TMPDIR" (concat (file-name-as-directory *my-home-dir*) (file-name-as-directory "tmp")))) Having installed MinGW inside the EMACS directory, I also stay away from Windows command prompt as I think it's mostly useless. (if (string= system-type "windows-nt") (setq shell-file-name "~/mingw/msys/1.0/bin/sh.exe" explicit-shell-file-name "~/mingw/msys/1.0/bin/bash.exe")) I add various of my programs to the PATH, so I can access them from the EMACS shell --- ESHELL ---, which is my favorite. (setq my-list-of-paths (mapcar (lambda (e) (concat (file-name-as-directory *my-home-dir*) (file-name-as-directory e))) (if (string= system-type "windows-nt") ;; Windows '( "miktex/texmfs/install/miktex/bin" "git" "git/bin" "git/usr/bin" "bin" ; the emacs bin directory "ezwinports/bin" "Racket" "R/App/R-Portable/bin/i386" "mingw/bin" "lua/bin") ;; Other systems '()))) (if (string= system-type "windows-nt") (dolist (e my-list-of-paths) (setenv "PATH" (concat e ";" (getenv "PATH"))))) As it turns out, it's not just PATH that we need. If we use call-process, for example, we need exec-path too. (setq exec-path (append (mapcar 'file-name-as-directory my-list-of-paths) exec-path)) On Windows, you're on your own, so you must bring your own team. ;; Use this GNU debugger (when (string= system-type "windows-nt") (setq gdb-command-name "~/mingw/bin/gdb.exe")) ;; Use this spell checker (when (string= system-type "windows-nt") (setq ispell-program-name "~/aspell/bin/aspell.exe")) ;; Use this locate program (when (string= system-type "windows-nt") (setq locate-command "~/locate/locate.exe")) ;; Use this diff program (when (string= system-type "windows-nt") (setq ediff-diff-program "~/git/usr/bin/diff.exe")) ;; Use this hexl program (when (string= system-type "windows-nt") (setq hexl-program "~/bin/hexl.exe")) ;; Use this latex program (when (string= system-type "windows-nt") (setq tex-command "~/miktex/miktex/bin/latex.exe")) Obviously this isn't all the code I run on start up, but it's the one that's Windows related, so I stop there. I think most of the work is in finding all the programs that you need. I already mentioned MinGW, but I also took many programs from ezwinports --- special thanks to Eli Zaretskii --- and others from other places.