From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#8954: 23.3.50; flymake handles read-only directories badly Date: Tue, 10 Apr 2012 20:22:20 -0400 Message-ID: References: <877h858wek.fsf@sc3d.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1334103789 26265 80.91.229.3 (11 Apr 2012 00:23:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2012 00:23:09 +0000 (UTC) Cc: 8954-done@debbugs.gnu.org To: Reuben Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 11 02:23:08 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SHlKz-0003zH-Vv for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Apr 2012 02:23:06 +0200 Original-Received: from localhost ([::1]:57933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHlKz-0002nY-21 for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Apr 2012 20:23:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHlKv-0002nJ-BR for bug-gnu-emacs@gnu.org; Tue, 10 Apr 2012 20:23:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHlKt-0006pw-Gp for bug-gnu-emacs@gnu.org; Tue, 10 Apr 2012 20:23:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHlKt-0006pl-3y for bug-gnu-emacs@gnu.org; Tue, 10 Apr 2012 20:22:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SHlLu-0007YO-Lc for bug-gnu-emacs@gnu.org; Tue, 10 Apr 2012 20:24:02 -0400 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Apr 2012 00:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 8954 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 8954@debbugs.gnu.org, monnier@iro.umontreal.ca Original-Received: via spool by 8954-done@debbugs.gnu.org id=D8954.133410380928985 (code D ref 8954); Wed, 11 Apr 2012 00:24:01 +0000 Original-Received: (at 8954-done) by debbugs.gnu.org; 11 Apr 2012 00:23:29 +0000 Original-Received: from localhost ([127.0.0.1]:49617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SHlLM-0007XR-Qb for submit@debbugs.gnu.org; Tue, 10 Apr 2012 20:23:29 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:59778) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SHlLK-0007XJ-K5 for 8954-done@debbugs.gnu.org; Tue, 10 Apr 2012 20:23:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYIACxOgk+4rwGW/2dsb2JhbABDuCMDgQyBCIIJAQEEAVYjBQsLDiYSFBgNJBOICQW2MothhHkEpEWBXYMD X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="173170928" Original-Received: from 184-175-1-150.dsl.teksavvy.com (HELO pastel.home) ([184.175.1.150]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 10 Apr 2012 20:22:20 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 6F41459460; Tue, 10 Apr 2012 20:22:20 -0400 (EDT) In-Reply-To: <877h858wek.fsf@sc3d.org> (Reuben Thomas's message of "Tue, 28 Jun 2011 22:43:15 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58741 Archived-At: > If I open a system include file, and have flymake-mode in my > c-mode-hook, I get: > Note: file is write protected > flymake-save-buffer-in-file: Opening output file: permission denied, /usr= /include/regex_flymake.h > and (the actual bug) the buffer displayed is not regex.h I've installed the patch below which should fix the worst part of this bug. Stefan =3D=3D=3D modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-10 23:34:25 +0000 +++ lisp/ChangeLog 2012-04-11 00:20:36 +0000 @@ -1,3 +1,7 @@ +2012-04-11 Stefan Monnier + + * progmodes/flymake.el (flymake-mode): Beware read-only dirs (bug#8954). + 2012-04-10 S=E9bastien Gross (tiny change) =20 * progmodes/hideshow.el (hs-hide-all): Don't infloop on comments =3D=3D=3D modified file 'lisp/progmodes/flymake.el' --- lisp/progmodes/flymake.el 2012-02-08 02:12:24 +0000 +++ lisp/progmodes/flymake.el 2012-04-10 23:06:08 +0000 @@ -1356,8 +1356,12 @@ (setq flymake-timer (run-at-time nil 1 'flymake-on-timer-event (current-buffer))) =20 - (when flymake-start-syntax-check-on-find-file - (flymake-start-syntax-check))))) + (when (and flymake-start-syntax-check-on-find-file + ;; Since we write temp files in current dir, there's no p= oint + ;; trying if the directory is read-only (bug#8954). + (file-writable-p (file-name-directory buffer-file-name))) + (with-demoted-errors + (flymake-start-syntax-check)))))) =20 ;; Turning the mode OFF. (t