From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenneth Wolcott Newsgroups: gmane.emacs.help Subject: Re: How to change Perl mode indentation to two spaces and no tabs? Date: Mon, 15 Jun 2015 13:53:40 -0700 Message-ID: References: <87d20wx1wz.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1434401637 28808 80.91.229.3 (15 Jun 2015 20:53:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Jun 2015 20:53:57 +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 Jun 15 22:53:54 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 1Z4bOD-0000la-6u for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Jun 2015 22:53:53 +0200 Original-Received: from localhost ([::1]:36410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4bOC-0001S8-Oo for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Jun 2015 16:53:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4bO2-0001Rx-Mc for help-gnu-emacs@gnu.org; Mon, 15 Jun 2015 16:53:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4bO1-0006lO-Pa for help-gnu-emacs@gnu.org; Mon, 15 Jun 2015 16:53:42 -0400 Original-Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:34019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4bO1-0006l9-Ic for help-gnu-emacs@gnu.org; Mon, 15 Jun 2015 16:53:41 -0400 Original-Received: by wicnd19 with SMTP id nd19so36208081wic.1 for ; Mon, 15 Jun 2015 13:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UlV+1XPnW8SeHQvlUYFhSebxxFpJdzcoBDSSDjxHGKo=; b=SN45V7JkplqW80Gd3qsZAZ6dTc3wbHrd4D5YYduK3DolhyiBG0Uvxt1v2hTyocp027 bIEcZjYLYN7JWap8JTELIKcYDKAfacEV7bgPc2/DakIeXN2U7n21L908zE6YOPatL2BV WSxcatfwDV2JljldHpHUSSuakoGdVJJpQjhQCUX/NDNvjbFCZ4AuDc9QaWWmZiwCc7DW tADtvng5Wt+aFolgqZrvZPactoJOQZamrbLcLGadnXqYduHDrDsZW+fTUbu12I18Tg9T bG2TLw/1zU9hchClBsZe8sPASl5xvJ+EOwA8/Gqq7c7zrryY5p2Pi39rOGjvZWgJ9Hbd YxFg== X-Received: by 10.194.123.4 with SMTP id lw4mr53718236wjb.94.1434401620654; Mon, 15 Jun 2015 13:53:40 -0700 (PDT) Original-Received: by 10.28.135.20 with HTTP; Mon, 15 Jun 2015 13:53:40 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::232 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:104958 Archived-At: On Mon, Jun 15, 2015 at 1:10 PM, Dan Espen wrote: > Kenneth Wolcott writes: > > R> On Mon, Jun 15, 2015 at 12:47 PM, John Mastro wrote: >>>> I like the syntax highlighting and the formatting (in general) of >>>> the perl mode, I just want multiples of two spaces for indentation >>>> rather than multiples of four. >>> >>> Then it looks like you'll want something like: >>> >>> (defun my-init-perl-mode () >>> (setq perl-indent-level 2 >>> perl-continued-statement-offset 2 >>> perl-continued-brace-offset -2)) >>> >>> (eval-after-load 'perl-mode >>> '(add-hook 'perl-mode-hook #'my-init-perl-mode)) >>> >>> See `C-h f perl-mode RET' for more information on those, and other, >>> options. I based the above on the "LW" style (the default) with every 4 >>> replaced by a 2. >>> >>> -- >>> john >> >> Thanks, John! >> >> I did as you suggested, looking at the built-in help for perl-mode. >> >> I'm now experimenting with these lines in my ~/.emacs file. >> >> Well, initial experiments still show that the default perl-mode still >> seems to override what I have in the ~/.emacs file, as the four-space >> indentation is still occurring. >> >> I'm still googling for this as well; haven't found the right info yet. > > Make sure you are in perl-mode. > You could be in cperl-mode. > > (Look at your mode line while editing a Perl file.) > > Then set either perl-indent-level or cperl-indent-level in a hook as > shown above. > > The technique above is going to require an Emacs restart to take effect. > > Stilll having issues? > Add a message to the defun to verify that the defun is being run: > > (message "defun has run") > > -- > Dan Espen Hi Dan; It does says "(Perl)" on the mode line, but even with the most recent idea submitted here (I love the support!) the indentation is still by multiplies of four spaces, not two spaces. I did exit emacs and come back in. GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0) Thanks, Ken Wolcott