From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Alexandre Oberlin" Newsgroups: gmane.emacs.help Subject: [SOLVED] Re: Enriched mode: avoid removing my manual indents Date: Sat, 15 Feb 2014 18:30:01 +0100 Organization: http://www.migo.info Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Trace: ger.gmane.org 1392485412 27090 80.91.229.3 (15 Feb 2014 17:30:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Feb 2014 17:30:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 15 18:30:21 2014 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 1WEj4H-0003Zu-5d for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Feb 2014 18:30:21 +0100 Original-Received: from localhost ([::1]:57654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEj4G-0000W2-Mx for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Feb 2014 12:30:20 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!proxad.net!feeder1-2.proxad.net!cleanfeed2-b.proxad.net!nnrp3-1.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Opera Mail/12.16 (Linux) Original-Lines: 81 Original-NNTP-Posting-Date: 15 Feb 2014 18:30:00 CET Original-NNTP-Posting-Host: 151.19.213.15 Original-X-Trace: 1392485400 news-4.free.fr 2372 151.19.213.15:22083 Original-X-Complaints-To: abuse@proxad.net Original-Xref: usenet.stanford.edu gnu.emacs.help:203827 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:96095 Archived-At: Hi all, Old issue solved, just in case someone else uses enriched-mode, which I personally find invaluable to highlight my notes with colours or styles.= Let=E2=80=99s recall the problem: On Fri, 24 May 2013 14:42:12 +0200, Alexandre Oberlin wrote: > I use enriched mode extensively but if I start a new line say on colum= n = > 8, then why does enriched mode think that is an error and put it back = to = > beginning of line as soon as I type return ? On Mon, 27 May 2013 20:55:37 +0200, Stefan Monnier wrote: > `enriched-mode' was the beginning of something that never materialized= , > so it's no wonder it doesn't work exactly like you want. > > It's not used very much as far as I know. But I think Drew's point is= > right, in that it would make sense to split enriched-mode into > sub-elements, such that the "save faces" part could be used separately= . Actually the annoyance was bigger than what I wrote in this thread, sinc= e you are virtually stuck to one indentation column once it is set. Howeve= r, getting rid of this was in fact dirty simple. Here=E2=80=99s what I did, while inside a buffer in enriched-mode: 1. Hit CTRL + h, k 2. Hit RETURN 3. Read the fine help: ############################################# RET (translated from ) runs the command reindent-then-newline-and-indent, which is an interactive Lisp function in `simple.el'. It is bound to RET. (reindent-then-newline-and-indent) Reindent current line, insert newline, then indent the new line. Indentation of both lines is done according to the current major mode, which means calling the current value of `indent-line-function'. In programming language modes, this is the same as TAB. In some text modes, where TAB inserts a tab, this indents to the column specified by the function `current-left-margin'. [back] ############################################# Of course there are several solutions once you know the above. A quick and dirty one is to overwrite the reindent-then-newline-and-inde= nt function=E2=80=99s definition by putting the following in your .emacs fi= le: (defun reindent-then-newline-and-indent () "No thanks" (interactive "*") = (newline) = (indent-according-to-mode)) Modifying /usr/share/emacs/23.4/lisp/textmodes/enriched.el might be a better solution, but it would take more time. I wish I had this flexibility in a few other software programs... Hope it helps, Alexandre