From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "R. Diez via help-gnu-emacs" Newsgroups: gmane.emacs.help Subject: Indenting with the tab key like everyone else Date: Sun, 2 Jun 2019 21:19:45 +0000 (UTC) Message-ID: <1019418503.3900238.1559510385829@mail.yahoo.com> References: <1019418503.3900238.1559510385829.ref@mail.yahoo.com> Reply-To: "R. Diez" Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="130944"; mail-complaints-to="usenet@blaine.gmane.org" To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 02 23:20:15 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXXtn-000Xwo-5v for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Jun 2019 23:20:15 +0200 Original-Received: from localhost ([127.0.0.1]:53345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXXtk-00072N-WA for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Jun 2019 17:20:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXXtS-000710-Ok for help-gnu-emacs@gnu.org; Sun, 02 Jun 2019 17:19:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXXtR-0005QW-I6 for help-gnu-emacs@gnu.org; Sun, 02 Jun 2019 17:19:54 -0400 Original-Received: from sonic314-20.consmr.mail.ir2.yahoo.com ([77.238.177.146]:45755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hXXtP-0005Nm-KF for help-gnu-emacs@gnu.org; Sun, 02 Jun 2019 17:19:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1559510387; bh=SK0wNHYFGDgrnccyCnHLUE2D4YToBmIy+RGswjwjPJc=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=iw33ETio17aVB6IX2Nb7zC6E09O/BscJzA9m1IZHCH+O6ZronCVyoKXO9dHm8zk4ViW5mn8QrxpYq9ZEdHN/TFKUpVtvTuPMelICMr62Uh+6GRuPnZK/me12eTk2I1sTKAxM51Qc1QkdzWQa79X+9Oqv1ajtX7I/36UOO5H1E3kGt3GzTWmeXIskpjCjqGEpjScD02pj41qdSpeTKSmffT7Dv3y3DGESoz0NOqfnjDIHb6LGfjnZBRBgrTXsYN2PA9uaPoV4SodDUwcMMhizgAYCQn5bbcs50r50w1gF1eqhuoi2nivb+GCCHhFqptd7P26yrCHOCEyXqN2QjBfkVA== X-YMail-OSG: jdaFGLIVM1lb08x7zw1c1szzpnSvJOfzeopHiiFb0m.MulMLWz6_V4iLg3y1iaW o5vvOcP1GaWLi4F_45VAocxO7gqHSgYw5BeLtPt0lSDc5.fWnGzuuFMZJ.4l7KG7zFN0cuKTZwua RwtYhikw.poSO3JEm_2iaqFwyEO1eyrIE0h.simwIy1V2dJAEwZMFbUgFnwrRn_AZAMG88BPYKFi ZifPDuh4zve2S8Oh1juobmGMLdTDb.XHjCcqhpz1h.mV4xGgX1eerJVhOLMZqqdgT7wcV9ycJirC 9B6KDEH7TnvFEcRBIdYxOsarVOOcLvQPctu9eomSl0FUgLbrLggEqgHTG0B54zUWVaYNRNvvUp0C .uGvhYHzdWqYyDCT5jSMliej0XyVVeMD1ktcjNtvd9sisnEHctQTMS51izjstVTlUbwmnDZ4lrGb n2g_TfyKy55xJfHpJJV5cRWjqSNHRasrk550mhMKQJBrpyKo6luSTVjeAZ6iVNZYe_CHz5GNiO4G KUqttvUyFDtaQXZoanvOCh7ka3Qs8TUHY0EiMU2i7FivEQ40TfPSJ988ALV8Jit0aMX1FH0jIUuc mdJFtraeQ28vEev2uxf_7cLqQ1nGGmfOlOG9tYCs1fJ59V0BEOKVPP6PJM8deEFUpyo3T3lIQDHr 7Ej2A3fDKd0RT1CLvsaDBwANhg1JtqHvvn4jFr_PbYCNjaEIxZPaKOLO_re.j2PRdpyCZIj.1FA_ RQgcC6mL1bizUXEy4V.ts5MvvV_Cp7wMzhsZDGYKHaPSKEnor.S4zqID8fGRTJlGz0P_H.d1ZHnK rQU8f58RTNZEfxSrr2YnImPSi2Fk.hHUGkhr0CIkbZ Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ir2.yahoo.com with HTTP; Sun, 2 Jun 2019 21:19:47 +0000 X-Mailer: WebService/1.1.13634 YahooMailNeo Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.177.146 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:120726 Archived-At: Hi all: I want to change the indenting behaviour of the tab key when writing source code like C++, Perl or Bash. But I am a little confused, so I need some help. When in C mode, the Tab key is bound to c-indent-line-or-region . When in Perl mode, it is bound to indent-for-tab-command, which is a rather complicated function. I want the same behaviour as most other IDEs I know: If I just press tab, it should "intelligently" indent the current line of code as usual. But if I select several lines with the shift key, I want to rigidly indent the selected block of lines. At the moment, Emacs tries to reindent the selected lines, which often does nothing, because it thinks the lines are already properly indented. If I want to intelligently reindent a block of lines, I would rather manually call the right function, something like "reindent-code". I could create an alias or a new function just for that purpose. I never got used to Emacs "prefix" mechanism, so I do not want to use it. And I do not want to retrain my "muscle memory". I want the same behaviour as everywhere else. What would be the best way to achieve this? I know a little Lisp, but not enough for complex things. Many thanks in advance, rdiez