From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Carlo Tambuatco Newsgroups: gmane.emacs.help Subject: How to activate hook for a specific buffer...? Date: Wed, 25 Apr 2018 15:48:34 -0400 Message-ID: <7051F297-53B1-4ACD-857A-E616B732B688@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1524688810 29429 195.159.176.226 (25 Apr 2018 20:40:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 25 Apr 2018 20:40:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 25 22:40:06 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 1fBRCw-0007b7-BV for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Apr 2018 22:40:06 +0200 Original-Received: from localhost ([::1]:39033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBRF3-00070k-7P for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Apr 2018 16:42:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBQP8-0000jR-2r for help-gnu-emacs@gnu.org; Wed, 25 Apr 2018 15:48:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBQP7-0003wO-05 for help-gnu-emacs@gnu.org; Wed, 25 Apr 2018 15:48:38 -0400 Original-Received: from mail-yb0-x234.google.com ([2607:f8b0:4002:c09::234]:35864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBQP6-0003vu-RX for help-gnu-emacs@gnu.org; Wed, 25 Apr 2018 15:48:36 -0400 Original-Received: by mail-yb0-x234.google.com with SMTP id o14-v6so5315410ybq.3 for ; Wed, 25 Apr 2018 12:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=POaNA5xArn5faEBWRRUjI7rtRI5T96TfNl50JMtT9XA=; b=hAumUQKfwE1uBNR630h4XsIZClJ5CkivuZ93xzT6ppxFXCHDx7EQRei/iLmAssDQlZ MD7waYfzzKbW4ZSobHBbxKNkbKALI6fFAxhDgcmHz9hqiae5/oVxP1tMXaSBN2qfja2H Uxa4dcSQ9UbgADNdvOZKjfmoTlN3dmvP9BlFM3y9ffRyF4R2e9XXDbVhK+zKfrNayEl6 Ylf2cPhnM+6IbE2coosRtlJfn7TYvZH1tOhRm5GVvo96ADquhTdBmziGDKAbQPLWcsON dpDyXLXZZzq6NL8emTxF8TboaBTnOUBNjJBFxUB8L/TMMfYOLD4H04Q/aLvqsiMH4BrV NX7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=POaNA5xArn5faEBWRRUjI7rtRI5T96TfNl50JMtT9XA=; b=HOayTOnis1kFZuCZGseveVtjQ+zDdDTs2bN7JykoFg/mkt0uHK1nNoDIMEP06b9ruo fUTOW5pnQZDA2nOBvBUb9L3UzdzBS9k+5b0UD94SNYlUAK1g0Jo+Iqt0CDfaa/VDcSAc q2N+jTiRoV/3hSuxkFi0a2aehKbfR3cmpmnfnD968KvuiJgrU0w35zL/2+VhizA5/XoM BVtJu2QmWhp7/z3Zw6oycyxLhTaBWHCI59Qj1uF5ccRncoyZXyuUbrm7UFZWYwAdV3ts v6xJcwqLyPK5DGdmwk7kSMGw5yrMaBu+tGFI6azrUjz9GNdh2pZpHSY6eg4pwjaJuK6/ +7rQ== X-Gm-Message-State: ALQs6tCdBX5XIzJTu7yHvgPPAuHyj1RzyIS06I6IAchFGUBQBaWO6xsS LYK2TLHlwucn9Cl0meRiypT4FHE3 X-Google-Smtp-Source: AB8JxZqv6QlDWgwcp8RRZxaeqjcnSnDwV3r3IJH1oGbzjBEgXZb6INir5YbrDf9zBy6Txlic1dNXWg== X-Received: by 2002:a25:e78e:: with SMTP id e136-v6mr126180ybh.276.1524685715661; Wed, 25 Apr 2018 12:48:35 -0700 (PDT) Original-Received: from ?IPv6:2600:1700:78d0:a570:cdb5:7048:4071:1daf? ([2600:1700:78d0:a570:cdb5:7048:4071:1daf]) by smtp.gmail.com with ESMTPSA id v124-v6sm7686180ywb.82.2018.04.25.12.48.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 12:48:34 -0700 (PDT) X-Google-Original-From: Carlo Tambuatco X-Mailer: Apple Mail (2.3273) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c09::234 X-Mailman-Approved-At: Wed, 25 Apr 2018 16:41:40 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:116600 Archived-At: I=E2=80=99ve got some setup code for my org mode in emacs:=20 (defun org-summary-todo (n-done n-not-done) "Switch entry to DONE when all subentries are done, to TODO = otherwise." (let (org-log-done org-log-states) ; turn off logging (org-todo (if (=3D n-not-done 0) "DONE" "TODO")))) (add-hook 'org-after-todo-statistics-hook 'org-summary-todo nil t) that I want to run only in specific org buffers. I do not want to set = this globally. I do not want to turn off logging globally for all org buffers. This code will set TODO entries in an org buffer to DONE when all = children of the entry are DONE. This snippet is taken directly from the org manual website: https://orgmode.org/manual/Breaking-down-tasks.html#Breaking-down-tasks I want this to apply only to certain org buffers and to have it apply to = those certain buffers automatically=20 whenever I open those buffers. Do I place this code inside a #+STARTUP: tag, or inside some=20 #+BEGIN_SRC #+END_SRC tags=E2=80=A6?=20 Is there a better way to do this?=20 Thanks.=