From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Visher Newsgroups: gmane.emacs.help Subject: Re: disable save hook temporarily Date: Wed, 21 Aug 2013 10:22:23 -0400 Message-ID: References: <20130820174528.GA3337@a.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1377094997 12879 80.91.229.3 (21 Aug 2013 14:23:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Aug 2013 14:23:17 +0000 (UTC) Cc: emacs To: wempwer@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 21 16:23:21 2013 Return-path: Envelope-to: geh-help-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 1VC9Jg-0004cz-UH for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Aug 2013 16:23:21 +0200 Original-Received: from localhost ([::1]:54040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC9Jg-0000Fv-DC for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Aug 2013 10:23:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC9JU-0000Fd-Sh for help-gnu-emacs@gnu.org; Wed, 21 Aug 2013 10:23:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VC9JQ-0004Yn-5s for help-gnu-emacs@gnu.org; Wed, 21 Aug 2013 10:23:08 -0400 Original-Received: from mail-ve0-x22f.google.com ([2607:f8b0:400c:c01::22f]:51989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC9JQ-0004Yg-2R for help-gnu-emacs@gnu.org; Wed, 21 Aug 2013 10:23:04 -0400 Original-Received: by mail-ve0-f175.google.com with SMTP id oy10so384888veb.6 for ; Wed, 21 Aug 2013 07:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=o41uw7uOHZ4hRI9PgKv40FpdpELZFokltFSFytgwDng=; b=LV5iLDlMa565IhWvdzKlsLgVr/4l8J0ZzgezIQdUu75XEZxstPBoeYIm5qtWtesbqC E0fm2QrfuNZmob09ftLUv7+zNUqI0DgjVhV7Gas/rbD0YyHlgycOswi07JSo3o6RaHfr LECh17duXIUyjmJiKlzo7QPLmrdsDPVBBblCp91D/XFvbJz3+rcNWltuhtM/nTjAKwsc aLzRMFsRXHabKLJcgkSV+iKnVseCKc/khSiGJ4q8tVUcHvVtM9cZ9QbsC52/6qkR8vFh l0JxTUUTcoeDQvdj0b6/1M//KgektSuZTlwXqBKHxdYpJzO3JfUXjD/1+zbdK6xADEK0 1SdQ== X-Received: by 10.220.145.132 with SMTP id d4mr6714539vcv.9.1377094983442; Wed, 21 Aug 2013 07:23:03 -0700 (PDT) Original-Received: by 10.221.54.129 with HTTP; Wed, 21 Aug 2013 07:22:23 -0700 (PDT) In-Reply-To: <20130820174528.GA3337@a.lan> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c01::22f X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93030 Archived-At: On Tue, Aug 20, 2013 at 1:45 PM, wrote: > I have plenty of stuff put in my C-mode save hook such as untabify, > remove trailing whitespaces, add a new line at the end etc. It's good > but sometimes I receive code from someone, need to do some changes in > it and send it back or just contribute to a larger project that > already has their own set of rules I don't want to break. The other > thing is that sometimes, especially in very big files it can take a > substantial amount of time to parse the whole buffer and execute save > hook. So my question is, what is the fastest and the most convenient > way to disable c save hook temporarily or how do you handle these > things? One idea that came to mind is to store all my code in a > specified directory such as ~/c and execute my save hook only for > files in this directory and don't call the hook for files in other > directories. This is untested, but maybe putting ((c-mode . ((before-save-hook . nil)))) in the `.dir-locals.el` file of the project would do the trick? -- In Christ, Timmy V. http://blog.twonegatives.com/ http://five.sentenc.es/ -- Spend less time on mail