From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uwe Brauer Subject: patch for BIDI support for org-mime.el Date: Sun, 29 Mar 2015 19:00:38 +0200 Message-ID: <87r3s7rb61.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcGa4-0006bq-0G for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 13:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcGZy-0004hw-RW for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 13:00:59 -0400 Received: from plane.gmane.org ([80.91.229.3]:41450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcGZy-0004hs-Kx for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 13:00:54 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YcGZw-0006AD-Pi for emacs-orgmode@gnu.org; Sun, 29 Mar 2015 19:00:52 +0200 Received: from 2.162.10.194 ([2.162.10.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 Mar 2015 19:00:52 +0200 Received: from oub by 2.162.10.194 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 Mar 2015 19:00:52 +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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello Attached you find a very small patch which adds BIDI support to org-mime.el basically it adds " --=-=-= Content-Type: text/html \n " instead of simply " --=-=-= Content-Type: text/html ") To the htmlized message. A new variable is introduced, namely: org-mime-bidi-support which is per default set to nil. I turn it on when switching to a BIDI language, as in the following function. (defun my-turn-bidi-on () "Just start with to R2L and turn the hebrew (qwerty) keyboard on" (interactive) (setq bidi-paragraph-direction 'right-to-left) (set-face-font 'default "-etl-*-*-*-*-*-*-240-*-*-*-*-ISO8859-8") (setq org-mime-bidi-support t) (set-input-method "hebrew-phonetic-qwerty" t) (message "R2L on and the hebrew qwerty keyboard!")) On off when switching back. Regards Uwe Brauer --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=org-mime-bidi.patch diff -u /home/oub/.emacs.d/elpa/org-plus-contrib-20130703/org-mime-org.el /home/oub/.emacs.d/elpa/org-plus-contrib-20130703/org-mime.el --- /home/oub/.emacs.d/elpa/org-plus-contrib-20130703/org-mime-org.el 2015-03-13 20:14:17.000000000 +0100 +++ /home/oub/.emacs.d/elpa/org-plus-contrib-20130703/org-mime.el 2015-03-29 18:55:08.733572911 +0200 @@ -147,6 +147,12 @@ (buffer-string))))) ('vm "?"))) +(defvar org-mime-bidi-support nil + "*Variable which controls the support for RTL BIDI. Default is + nil. It is recommendable to change this variable, once you + change, via `set-input-method' to a BIDI language.") + + (defun org-mime-multipart (plain html &optional images) "Markup a multipart/alternative with text/plain and text/html alternatives. If the html portion of the message includes images wrap the html @@ -155,10 +161,12 @@ ('mml (concat "<#multipart type=alternative><#part type=text/plain>" plain (when images "<#multipart type=related>") - "<#part type=text/html>" + (if org-mime-bidi-support ;add BIDI support + "<#part type=text/html>\n" + "<#part type=text/html>") html images - (when images "<#/multipart>\n") + (when images "\n<#/multipart>\n") "<#/multipart>\n")) ('semi (concat "--" "<>-{\n" Diff finished. Sun Mar 29 18:55:27 2015 --=-=-=--