From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: verbatim/code text and line breaks with auto fill mode Date: Sat, 08 Mar 2014 13:12:07 +0100 Message-ID: References: <87y50l91i7.fsf@alphaville.bos.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMG72-0003Oa-CL for emacs-orgmode@gnu.org; Sat, 08 Mar 2014 07:12:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMG6w-0000DT-DS for emacs-orgmode@gnu.org; Sat, 08 Mar 2014 07:12:20 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:18281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMG6w-0000D0-7A for emacs-orgmode@gnu.org; Sat, 08 Mar 2014 07:12:14 -0500 In-Reply-To: <87y50l91i7.fsf@alphaville.bos.redhat.com> (Nick Dokos's message of "Fri, 07 Mar 2014 15:50:40 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Dokos Cc: emacs-orgmode@gnu.org Nick Dokos writes: > Alan Schmitt writes: > >> Hello, >> >> Is there a way to disable line breaks inside verbatim or code text when >> using auto fill? For instance, if I type the following: >> >> This is an example of a long line when some stuff is code: ~1 + 2 + 3 = >> 6~. >> > > Untested, but you might be able to do something with > auto-fill-inhibit-regexp. I've continued looking into this, and it seems that what I want is use `fill-nobreak-predicate'. This is what I ended up doing: #+begin_src emacs-lisp (add-hook 'org-mode-hook (lambda () (add-hook 'fill-nobreak-predicate 'org-in-verbatim-emphasis))) #+end_src All the pieces were already there, it just took me a while to put them together ;-) Best, Alan