From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Fwd: flymake-start-syntax-check-process ignores dir setting Date: Thu, 7 Apr 2011 10:42:13 -0400 Message-ID: <21FA9BF8-42AF-41A3-BDF7-477CD75336B2@gmail.com> References: <2D75B365-730A-4827-90A9-04C5DE907731@duncf.ca> Reply-To: duncan@duncf.ca NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/mixed; boundary=Apple-Mail-16--389896760 X-Trace: dough.gmane.org 1302187357 11737 80.91.229.12 (7 Apr 2011 14:42:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2011 14:42:37 +0000 (UTC) Cc: duncan@duncf.ca To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 07 16:42:33 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7qPm-0005hh-D3 for ged-emacs-devel@m.gmane.org; Thu, 07 Apr 2011 16:42:30 +0200 Original-Received: from localhost ([127.0.0.1]:42530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7qPl-00018G-LV for ged-emacs-devel@m.gmane.org; Thu, 07 Apr 2011 10:42:29 -0400 Original-Received: from [140.186.70.92] (port=41914 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7qPb-00014z-UQ for emacs-devel@gnu.org; Thu, 07 Apr 2011 10:42:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7qPa-00030z-Bh for emacs-devel@gnu.org; Thu, 07 Apr 2011 10:42:19 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:42951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7qPa-00030P-0f for emacs-devel@gnu.org; Thu, 07 Apr 2011 10:42:18 -0400 Original-Received: by gyd8 with SMTP id 8so1277670gyd.0 for ; Thu, 07 Apr 2011 07:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from:date:cc :reply-to:message-id:references:to:x-mailer; bh=Wxn2OZT2sts5sY1RxFjxkVpH/Rc5Y5OyLANjMd9DuHs=; b=rEhWvT0y/dwGKLE05VwzMDm8KOTJRr/FG7iyoFKfF675PC9gxsbeGPwLtM/kh5k2lH 4F+j4ih4ojqCOYVbXvrIwtEssZjV33Mszbhf5mdTBuqkMlwIelmPzomyE+56ZbUd+Yep No6XIUogL7vx2y1dQ238rkyX4S1zDSW3s1H+0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:date:cc:reply-to:message-id :references:to:x-mailer; b=UioTqXlTJ6XXZqTk8FOumfyXhf7GRr9HfEELDkJXhixzTKgfudz+3qUwUlK+ObnLbK M4bx2LnvOMdfJ9bGq40fZsVM9mMnr1isoTRSiHxh3nZK3JFUWateq+p6VJeq+DyRnyb5 WuHCqgW8WuqzdvZQoZLdtxKl3gs9Ae5DgSGqw= Original-Received: by 10.42.82.75 with SMTP id c11mr1521705icl.92.1302187336769; Thu, 07 Apr 2011 07:42:16 -0700 (PDT) Original-Received: from elin.andrew.cmu.edu (ELIN.ANDREW.CMU.EDU [128.2.46.20]) by mx.google.com with ESMTPS id i3sm1193136iby.40.2011.04.07.07.42.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Apr 2011 07:42:15 -0700 (PDT) X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138281 Archived-At: --Apple-Mail-16--389896760 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Here's a patch from someone regarding flymake.el. I think that if this is good, it should be applied upstream. Begin forwarded message: > From: Duncan Findlay > Date: April 5, 2011 9:13:36 PM EDT > To: aquamacs-bugs@aquamacs.org > Subject: [Aquamacs-bugs] 23.3; flymake-start-syntax-check-process = ignores dir setting > Reply-To: Bug reports for Aquamacs Emacs >=20 > Hi, >=20 > I'm having trouble using flymake in Aquamacs 2.2. I want to run = "pyflakes" on my local host while editing remote Python (.py) files. = This worked in Aquamacs 2.1, but it looks like 2.2 now has support for = running commands on remote hosts. This is a good thing, but = unfortunately, I don't want pyflakes running remotely. >=20 > (The relavent change is here: = https://github.com/davidswelt/aquamacs-emacs/commit/7a542acd40a722a556dcad= c039aa8e00645dfd00#lisp/progmodes/flymake.el) >=20 > =46rom looking through the source, it looks like = flymake-start-syntax-check-process takes a dir argument, so that one can = customize what directory the flymake syntax checking process starts in. = Now that this function calls start-file-process instead of = start-process, this dir argument also ought to control what host the = process starts on, so I can use it to make sure it starts locally. >=20 > Unfortunately this dir variable seems to be pretty much ignored. I'm = not competent in Emacs Lisp, but I did come up with this ugly patch = (attached) that seems to work. I'm sure there's a much simpler and more = elegant way to do what I'm trying to do, but hopefully you get the idea. >=20 > The relevant section of my Preferences.el used to set up flymake to = run pyflakes on Python files is also attached.=20 >=20 > Thanks >=20 > Duncan >=20 >=20 >=20 >=20 --Apple-Mail-16--389896760 Content-Disposition: attachment; filename=patch Content-Type: application/octet-stream; name="patch" Content-Transfer-Encoding: 7bit --- /Users/duncan/tmp/flymake.el.new 2011-04-05 17:02:54.000000000 -0700 +++ /Users/duncan/Library/Preferences/Aquamacs Emacs/flymake.el 2011-04-05 17:50:08.000000000 -0700 @@ -1149,11 +1149,13 @@ (let* ((process nil)) (condition-case err (progn - (when dir + (if dir (let ((default-directory dir)) - (flymake-log 3 "starting process on dir %s" default-directory))) - (setq process (apply 'start-file-process - "flymake-proc" (current-buffer) cmd args)) + (flymake-log 3 "starting process on dir %s" default-directory) + (setq process (apply 'start-file-process + "flymake-proc" (current-buffer) cmd args))) + ((setq process (apply 'start-file-process + "flymake-proc" (current-buffer) cmd args)))) (set-process-sentinel process 'flymake-process-sentinel) (set-process-filter process 'flymake-process-filter) (push process flymake-processes) --Apple-Mail-16--389896760 Content-Disposition: attachment; filename=Preferences.el Content-Type: application/octet-stream; name="Preferences.el" Content-Transfer-Encoding: 7bit ;; pyflakes ;; from http://plope.com/Members/chrism/flymake-mode ;; and http://www.emacswiki.org/emacs/FlymakeRuby (setq flymake-log-level 3) (defun flymake-create-temp-intemp (file-name prefix) "Return file name in temporary directory for checking FILE-NAME. This is a replacement for `flymake-create-temp-inplace'. The difference is that it gives a file name in `temporary-file-directory' instead of the same directory as FILE-NAME. For the use of PREFIX see that function. Note that not making the temporary file in another directory \(like here) will not if the file you are checking depends on relative paths to other files \(for the type of checks flymake makes)." (unless (stringp file-name) (error "Invalid file-name")) (or prefix (setq prefix "flymake")) (let* ((name (concat (file-name-nondirectory (file-name-sans-extension file-name)) "_" prefix)) (ext (concat "." (file-name-extension file-name))) (temp-name (make-temp-file name nil ext)) ) (flymake-log 3 "create-temp-intemp: file=%s temp=%s" file-name temp-name) temp-name)) (when (load "flymake" t) (defun flymake-pyflakes-init () (let* ((temp-file (flymake-init-create-temp-buffer-copy 'flymake-create-temp-intemp)) (local-file (file-relative-name temp-file (file-name-directory buffer-file-name)))) (flymake-log 3 "flymake-pyflakes-init: temp=%s dir=%s" buffer-file-name (file-name-directory temp-file)) (list "pyflakes" (list local-file) (file-name-directory temp-file)))) (add-to-list 'flymake-allowed-file-name-masks '("\\.py\\'" flymake-pyflakes-init))) (add-hook 'find-file-hook 'flymake-find-file-hook) --Apple-Mail-16--389896760 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > --Apple-Mail-16--389896760--