From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dale Snell Newsgroups: gmane.emacs.help Subject: Re: make buffer be c++ mode? Date: Sat, 23 May 2015 18:20:36 -0700 Organization: Department of redundant redundancies and tautological pleonasms department Message-ID: <20150523182036.481b3264@zothique.localdomain> References: Reply-To: ddsnell@frontier.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/kWBf0LDFOWzudDKnldLjbtz"; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1432430547 30180 80.91.229.3 (24 May 2015 01:22:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2015 01:22:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 24 03:22:16 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 1YwKcJ-0002Nj-QU for geh-help-gnu-emacs@m.gmane.org; Sun, 24 May 2015 03:22:16 +0200 Original-Received: from localhost ([::1]:38983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwKcI-0005Gn-Nw for geh-help-gnu-emacs@m.gmane.org; Sat, 23 May 2015 21:22:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwKc5-0005Gd-9c for help-gnu-emacs@gnu.org; Sat, 23 May 2015 21:22:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwKbv-0007WH-Bq for help-gnu-emacs@gnu.org; Sat, 23 May 2015 21:22:01 -0400 Original-Received: from filter01.dlls.pa.frontiernet.net ([199.224.80.228]:58258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwKbv-0007Vs-8P for help-gnu-emacs@gnu.org; Sat, 23 May 2015 21:21:51 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by filter01.dlls.pa.frontiernet.net (Postfix) with ESMTP id 1EE7D1FE496 for ; Sun, 24 May 2015 01:21:50 +0000 (UTC) Original-Received: from relay02.dlls.pa.frontiernet.net ([199.224.80.245]) by localhost (filter01.dlls.pa.frontiernet.net [199.224.80.228]) (amavisd-new, port 10024) with LMTP id jCVjQlyUXMjX for ; Sun, 24 May 2015 01:21:38 +0000 (UTC) X-Originating-IP: [50.109.250.125] X-Previous-IP: 50.109.250.125 Original-Received: from zothique.localdomain (unknown [50.109.250.125]) by relay02.dlls.pa.frontiernet.net (Postfix) with ESMTPA id 7B7F34A0A7 for ; Sun, 24 May 2015 01:21:38 +0000 (UTC) In-Reply-To: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-redhat-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 199.224.80.228 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:104541 Archived-At: --Sig_/kWBf0LDFOWzudDKnldLjbtz Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 23 May 2015 17:30:57 -0400, in message CAMJ-YiSzJjOBwUfWvCrexzihW5zV8qJyKzKPyi4Ss8u1PR1dGg@mail.gmail.com, Jai Dayal wrote: > Hi, >=20 > I have a file that I've opened with a .cu extension. It's C++ code > written for Cuda. How do I force Emacs to display the buffer as if it > were C mode? I just want to do it just for this buffer. >=20 > Thanks For one-off editing of just one file, John's suggestion is fine. If you're going to be editing .cu files on more than an occasional basis, something along the line of Emanuel's suggestion is a good idea. On the third hand, if you're going to be editing this one file once in a while, stick a file-local variable in it. You can do this one of two ways. One: make the following the first line of your program: // -*- mode: c++; -*- Other settings can be added, thus: // -*- mode: c++; fill-column: 72; -*- (The "-*-" strings are required for this method.) Two: stick it at the end of the file, thusly: // Local variables: // mode: c++ // // // End: Note that in all cases, the local variable statements are entered as comments, so that the compiler won't see them. Hope this helps, and have fun! --Dale --=20 In Xanadu did Kubla Khan a stately pleasure dome decree But only if the NFL to a franchise would agree. --Sig_/kWBf0LDFOWzudDKnldLjbtz Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVYSehAAoJEB7OMKhvWRr8KyUH/1PpjBVHESLFlR133EYO89Ly l48ayKx643Hlf6OKEBK1hJGe/B+bJ/ozFVS2jcoiYt3zuBOSgIqMaXLnR7ig4e/8 R0eSaGgkjl00pFidhiFUv4c0NzUpDTCssYI5X0oaai1cjDTIt7e0dBVY58k+bZrg S9z0Fw2Fx4LHkvcVnsmJEM/oJmP6sERcmWfUmWLvWsx6ecHJvxR6fqiY7NcCrfSO noWLElHJCSrscnJXofOUtd+IY77eDXicnGsdfJF5EDVaq8BqNvHL+0wq4xh2hVYW Brt0pNPqLtzqsvKP68Q96rhWiSEL56LxIFqtGK8sZmNgXG/m4REb60inDdBvWTA= =7kiB -----END PGP SIGNATURE----- --Sig_/kWBf0LDFOWzudDKnldLjbtz--