From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Edward O'Connor" Newsgroups: gmane.emacs.help Subject: Re: Hooks and c/c++-mode Date: Tue, 10 May 2011 17:23:43 -0700 Message-ID: References: <87k4dyp1gj.fsf@father.nostromo.wy> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1305073456 8293 80.91.229.12 (11 May 2011 00:24:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 May 2011 00:24:16 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "daniele.g" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 11 02:24:12 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QJxDn-0005Xu-QT for geh-help-gnu-emacs@m.gmane.org; Wed, 11 May 2011 02:24:11 +0200 Original-Received: from localhost ([::1]:34189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJxDn-0003KO-8p for geh-help-gnu-emacs@m.gmane.org; Tue, 10 May 2011 20:24:11 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJxDh-0003K0-Iq for help-gnu-emacs@gnu.org; Tue, 10 May 2011 20:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJxDg-0000Fn-PX for help-gnu-emacs@gnu.org; Tue, 10 May 2011 20:24:05 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:37987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJxDg-0000FN-Kl for help-gnu-emacs@gnu.org; Tue, 10 May 2011 20:24:04 -0400 Original-Received: by wwb39 with SMTP id 39so870wwb.30 for ; Tue, 10 May 2011 17:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=ruldNYaYHP31Rj/HbN+qVYILlwBw9EKfPoNbftdeMDg=; b=nynK+Trdi+jjGeMd7pgmQLPYA000w07znBtktoIUX38mpEr9vMw6C0yQEH0Ok4CZ8m GJgkEm6Jlp/HBohEwL+/eLcmk1uKUZUw7f8aBoeYoRiwqieQ28eGxzNRW5IlOyVogd2m AIQ3s8T23wzoSLMaZj+2TTQObtIBCF/CPNlaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=bP60fN0lsntERhxOlov0kQkvxWnBWo+vdGk097sHNnilfQkXQXnaMgsaZF+rAK33zt xadE6DIj8hkYxnYYb+a26oVifyzOciuAdS+tvL61TD9zL/ZpHIns0c4v3V6AhRcgpOpi 7dHzpmqUvoNRFxdbe3aH7I5eCuQCJ9G1kdDIQ= Original-Received: by 10.216.229.195 with SMTP id h45mr4759059weq.48.1305073443103; Tue, 10 May 2011 17:24:03 -0700 (PDT) Original-Received: by 10.216.90.1 with HTTP; Tue, 10 May 2011 17:23:43 -0700 (PDT) In-Reply-To: <87k4dyp1gj.fsf@father.nostromo.wy> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 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:80962 Archived-At: > Is there a smart way to set a hook for several modes at once? Maybe > using a regex or similar. > > For example: > > --8<---------------cut here---------------start------------->8--- > (add-hook '{c|c++}-mode-hook > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'(lambda () > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'do-something ))) > --8<---------------cut here---------------end--------------->8--- `c-mode-common-hook' is your friend. :) Ted