From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Colin Yates Newsgroups: gmane.emacs.help Subject: Doing things only in a particular mode Date: Mon, 24 Aug 2015 15:49:54 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1440431861 20707 80.91.229.3 (24 Aug 2015 15:57:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Aug 2015 15:57:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 24 17:57:41 2015 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 1ZTu7w-0001eC-8b for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Aug 2015 17:57:40 +0200 Original-Received: from localhost ([::1]:54156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTu7v-0004vN-Nv for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Aug 2015 11:57:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTt4S-0005kE-S1 for help-gnu-emacs@gnu.org; Mon, 24 Aug 2015 10:50:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTt4O-0004Ii-RW for help-gnu-emacs@gnu.org; Mon, 24 Aug 2015 10:50:00 -0400 Original-Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:33721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTt4O-0004I1-LM for help-gnu-emacs@gnu.org; Mon, 24 Aug 2015 10:49:56 -0400 Original-Received: by wijp15 with SMTP id p15so80365491wij.0 for ; Mon, 24 Aug 2015 07:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=4hj2ekABm3uRvl7K+UsGdN9xpuFg4FXKtSjQiNqwGh8=; b=CQ7L2nCn36pk7B6NRe1ZIZj1Cbs5X6oDQqCz5zK2MWrNiBkUdRYXObgvIbf6cHzPof NH5DvJZNcZOVSGUT+Zo4dLBIV5przd8W3UmaquMkBeZ1zXXIUSM+R3ZA+gbX6Thmb+29 zVE1US8LOy9B68CwTLSuHkulRVJEbjujuIQMLGSd5j7iuysKjeSaG4Kg2iGsEfiKzQj2 uHsqdGhQYodFQLNMm/zYbNyqUM6E9u4Oo0ZmQr/HZGaunr/FWQZ7D0I/3tzvKbCKfUf2 s63cgWYKtX9I5sZ9tAxlcuWKviftARb5CpNMC3PfJUHTUgWxGqX1KtHLb2TeHaqSRO92 Jj5w== X-Received: by 10.194.175.200 with SMTP id cc8mr42829771wjc.87.1440427795615; Mon, 24 Aug 2015 07:49:55 -0700 (PDT) Original-Received: from localhost (cpc13-leic14-2-0-cust169.8-1.cable.virginm.net. [86.24.148.170]) by smtp.gmail.com with ESMTPSA id du6sm16514790wib.24.2015.08.24.07.49.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2015 07:49:54 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22a 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:106796 Archived-At: (newbie warning). So I understand about (add-hook...) but I can't find the hook I want. Basically, I have visual-line-mode turned on globally, but I want to disable it when I view the headers in mu4e. The buffer is called *mu4e-headers* and I can see the major mode is mu4e-headers but the following code has no effect: (add-hook 'mu4e-headers-hook (lambda () (visual-line-mode 0))) I am not sure how 'hooks' are created - I searched through the source code for my4e-headers-hook but couldn't find it. Assuming this is the right approach, how can I say 'when the major mode is X then do this'. What is the idiomatic Emacs way? Thanks! Sent with my mu4e