From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Pank Roulund Subject: Re: nbsp and /italics/ Date: Wed, 17 Oct 2012 00:45:24 +0200 Message-ID: <87bog2c9yz.fsf@pank.iue.private> References: <87k3uqcgyn.fsf@pank.iue.private> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOFtD-0005bX-Ua for emacs-orgmode@gnu.org; Tue, 16 Oct 2012 18:45:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOFtC-00038x-VB for emacs-orgmode@gnu.org; Tue, 16 Oct 2012 18:45:31 -0400 Received: from mailout-eu.gmx.com ([213.165.64.43]:54821) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TOFtC-00038Z-LU for emacs-orgmode@gnu.org; Tue, 16 Oct 2012 18:45:30 -0400 In-Reply-To: <87k3uqcgyn.fsf@pank.iue.private> (rasmus@gmx.us's message of "Tue, 16 Oct 2012 22:14:24 +0200") 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: tsd@tsdye.com Cc: emacs-orgmode@gnu.org Rasmus writes: > Can anyone think of a clever regexp that recognizes the above pattern? > I tried, "\\.[ ]\{1\}" but it didn't work. And without the \{1\} it's > too strong. . . Here's one that seems to work in the primitive cases, but not when there's a link. Tested on test of tilde. small space fig. [[latex:ref][test]]. But here's a large space. the regexp recognizes both small spaces, but does not insert the tilde between "fig." and "[[". Could I add it to an earlier hook or something similar to make it work? #+begin_src emacs-lisp (defun ngz-latex-filter-nobreaks-double-space (text backend info) "Tries to export \"S1. S2\" as \"S1.~S2\" while letting \"S1. S2\" be exported without tilde" (when (memq backend '(e-beamer e-latex)) (replace-regexp-in-string "\\.[ ]\\{1\\}\\([^ ]\\)" ".~\\1" text))) (add-to-list 'org-export-filter-plain-text-functions 'ngz-latex-filter-nobreaks-double-space) #+end_src Thanks, Rasmus -- I almost cut my hair, it was happened just the other day