Browse Source

Add special commands for latin1 and utf8 export

Carsten Dominik 15 years ago
parent
commit
9a6113c505
4 changed files with 142 additions and 91 deletions
  1. 17 4
      doc/org.texi
  2. 41 12
      lisp/org-ascii.el
  3. 72 72
      lisp/org-entities.el
  4. 12 3
      lisp/org-exp.el

+ 17 - 4
doc/org.texi

@@ -9074,12 +9074,15 @@ Call an the exporter, but reverse the setting of
 not set, or force processing in the current Emacs process if set.
 not set, or force processing in the current Emacs process if set.
 @end table
 @end table
 
 
-@node ASCII export, HTML export, The export dispatcher, Exporting
-@section ASCII export
+@node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting
+@section ASCII/Latin-1/UTF-8 export
 @cindex ASCII export
 @cindex ASCII export
+@cindex Latin-1 export
+@cindex UTF-8 export
 
 
 ASCII export produces a simple and very readable version of an Org-mode
 ASCII export produces a simple and very readable version of an Org-mode
-file.
+file, containing only plain ASCII.  Latin-1 and UTF-8 export augment the file
+with special characters and symbols available in these encodings.
 
 
 @cindex region, active
 @cindex region, active
 @cindex active region
 @cindex active region
@@ -9100,8 +9103,18 @@ export.
 @kindex C-c C-e A
 @kindex C-c C-e A
 @item C-c C-e A
 @item C-c C-e A
 Export to a temporary buffer, do not create a file.
 Export to a temporary buffer, do not create a file.
+@kindex C-c C-e n
+@kindex C-c C-e N
+@item C-c C-e n @ @ @r{and} @ @ C-c C-e N
+Like the above commands, but use Latin-1 encoding.
+@kindex C-c C-e u
+@kindex C-c C-e U
+@item C-c C-e u @ @ @r{and} @ @ C-c C-e U
+Like the above commands, but use UTF-8 encoding.
 @kindex C-c C-e v a
 @kindex C-c C-e v a
-@item C-c C-e v a
+@kindex C-c C-e v n
+@kindex C-c C-e v u
+@item C-c C-e v a @ @ @r{and} @ @ C-c C-e v n @ @ @r{and} @ @ C-c C-e v u
 Export only the visible part of the document.
 Export only the visible part of the document.
 @end table
 @end table
 
 

+ 41 - 12
lisp/org-ascii.el

@@ -72,21 +72,14 @@ i.e. with \"=>\" as ellipsis."
   :group 'org-export-ascii
   :group 'org-export-ascii
   :type 'boolean)
   :type 'boolean)
 
 
-(defcustom org-export-ascii-entities 'ascii
+(defvar org-export-ascii-entities 'ascii
   "The ascii representation to be used during ascii export.
   "The ascii representation to be used during ascii export.
 Possible values are:
 Possible values are:
 
 
-ascii          Only use plain ASCII characters
-latin1         Include Latin-1 character
-utf8           Use all UTF-8 characters
-coding-system  Automatically adapt to the coding system of the output file
-               This setting is not yet implemented."
-  :group 'org-export-ascii
-  :type '(choice
-	  (const :tag "Use what the file coding system supports (not yet implemented)" coding-system)
-	  (const :tag "Plain ASCII only" ascii)
-	  (const :tag "Add Latin-1 characters" latin1)
-	  (const :tag "Use utf8 representations" utf8)))
+ascii     Only use plain ASCII characters
+latin1    Include Latin-1 character
+utf8      Use all UTF-8 characters")
+
 ;;; Hooks
 ;;; Hooks
 
 
 (defvar org-export-ascii-final-hook nil
 (defvar org-export-ascii-final-hook nil
@@ -96,6 +89,42 @@ coding-system  Automatically adapt to the coding system of the output file
 
 
 (defvar org-ascii-current-indentation nil) ; For communication
 (defvar org-ascii-current-indentation nil) ; For communication
 
 
+;;;###autoload
+(defun org-export-as-latin1 (&rest args)
+  "Like `org-export-as-ascii', use latin1 encoding for special symbols."
+  (interactive)
+  (org-export-as-encoding 'org-export-as-ascii (interactive-p)
+			  'latin1 args))
+
+;;;###autoload
+(defun org-export-as-latin1-to-buffer (&rest args)
+  "Like `org-export-as-ascii-to-buffer', use latin1 encoding for symbols."
+  (interactive)
+  (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p)
+			  'latin1 args))
+
+;;;###autoload
+(defun org-export-as-utf8 (&rest args)
+  "Like `org-export-as-ascii', use use encoding for special symbols."
+  (interactive)
+  (org-export-as-encoding 'org-export-as-ascii (interactive-p)
+			  'utf8 args))
+
+;;;###autoload
+(defun org-export-as-utf8-to-buffer (&rest args)
+  "Like `org-export-as-ascii-to-buffer', use utf8 encoding for symbols."
+  (interactive)
+  (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p)
+			  'utf8 args))
+
+(defun org-export-as-encoding (command interactivep encoding &rest args)
+  (debug)
+  (let ((org-export-ascii-entities encoding))
+    (if interactivep
+	(call-interactively command)
+      (apply command args))))
+  
+
 ;;;###autoload
 ;;;###autoload
 (defun org-export-as-ascii-to-buffer (arg)
 (defun org-export-as-ascii-to-buffer (arg)
   "Call `org-export-as-ascii` with output to a temporary buffer.
   "Call `org-export-as-ascii` with output to a temporary buffer.

+ 72 - 72
lisp/org-entities.el

@@ -73,45 +73,45 @@ utf-8 replacement    Use special character available in utf-8."
 (defconst org-entities
 (defconst org-entities
   '(("nbsp" "~" nil " " " " " " " ")
   '(("nbsp" "~" nil " " " " " " " ")
     ("iexcl" "!`" nil "¡" "!" "¡" "¡")
     ("iexcl" "!`" nil "¡" "!" "¡" "¡")
-    ("cent" "\\textcent" nil "¢" "cent" "¢" "¢")
-    ("pound" "\\pounds" nil "£" "pound" "£" "£")
-    ("curren" "\\textcurrency" nil "¤" "curr." "¤" "¤")
-    ("yen" "\\textyen" nil "¥" "yen" "¥" "¥")
-    ("brvbar" "\\textbrokenbar" nil "¦" "|" "¦" "¦")
-    ("vert" "\\vert" t "|" "|" "|" "|")
+    ("cent" "\\textcent{}" nil "¢" "cent" "¢" "¢")
+    ("pound" "\\pounds{}" nil "£" "pound" "£" "£")
+    ("curren" "\\textcurrency{}" nil "¤" "curr." "¤" "¤")
+    ("yen" "\\textyen{}" nil "¥" "yen" "¥" "¥")
+    ("brvbar" "\\textbrokenbar{}" nil "¦" "|" "¦" "¦")
+    ("vert" "\\vert{}" t "|" "|" "|" "|")
     ("sect" "\\S" nil "§" "paragraph" "§" "§")
     ("sect" "\\S" nil "§" "paragraph" "§" "§")
-    ("uml" "\\textasciidieresis" nil "¨" "[diaeresis]" "¨" "¨")
-    ("copy" "\\textcopyright" nil "©" "(c)" "©" "©")
-    ("ordf" "\\textordfeminine" nil "ª" "_a_" "ª" "ª")
-    ("laquo" "\\guillemotleft" nil "&laquo;" "<<" "«" "«")
-    ("not" "\\textlnot" nil "&not;" "[angled dash]" "¬" "¬")
+    ("uml" "\\textasciidieresis{}" nil "&uml;" "[diaeresis]" "¨" "¨")
+    ("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
+    ("ordf" "\\textordfeminine{}" nil "&ordf;" "_a_" "ª" "ª")
+    ("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
+    ("not" "\\textlnot{}" nil "&not;" "[angled dash]" "¬" "¬")
     ("shy" "\\-" nil "&shy;" "" "" "")
     ("shy" "\\-" nil "&shy;" "" "" "")
-    ("reg" "\\textregistered" nil "&reg;" "(r)" "®" "®")
-    ("macr" "\\textasciimacron" nil "&macr;" "[macron]" "¯" "¯")
-    ("deg" "\\textdegree" nil "deg" "degree" "°" "°")
-    ("pm" "\\textpm" nil "&plusmn;" "+-" "±" "±")
-    ("plusmn" "\\textpm" nil "&plusmn;" "+-" "±" "±")
-    ("sup2" "\\texttwosuperior" nil "&sup2;" "^2" "²" "²")
-    ("sup3" "\\textthreesuperior" nil "&sup3;" "^3" "³" "³")
+    ("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
+    ("macr" "\\textasciimacron{}" nil "&macr;" "[macron]" "¯" "¯")
+    ("deg" "\\textdegree{}" nil "deg" "degree" "°" "°")
+    ("pm" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
+    ("plusmn" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
+    ("sup2" "\\texttwosuperior{}" nil "&sup2;" "^2" "²" "²")
+    ("sup3" "\\textthreesuperior{}" nil "&sup3;" "^3" "³" "³")
     ("acutex" "\\acute x" t "&acute x;" "'x" "'x" "𝑥́")
     ("acutex" "\\acute x" t "&acute x;" "'x" "'x" "𝑥́")
-    ("micro" "\\textmu" nil "&micro;" "micro" "µ" "µ")
-    ("para" "\\P" nil "&para;" "[pilcrow]" "¶" "¶")
-    ("middot" "\\textperiodcentered" nil "&middot;" "." "·" "·")
+    ("micro" "\\textmu{}" nil "&micro;" "micro" "µ" "µ")
+    ("para" "\\P{}" nil "&para;" "[pilcrow]" "¶" "¶")
+    ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
     ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
     ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
     ("star" "\\star" t "*" "*" "*" "⋆")
     ("star" "\\star" t "*" "*" "*" "⋆")
-    ("cedil" "\\c" nil "&cedil;" "[cedilla]" "¸" "¸")
-    ("sup1" "\\textonesuperior" nil "&sup1;" "^1" "¹" "¹")
-    ("ordm" "\\textordmasculine" nil "&ordm;" "_o_" "º" "º")
-    ("raquo" "\\guillemotright" nil "&raquo;" ">>" "»" "»")
+    ("cedil" "\\c{}" nil "&cedil;" "[cedilla]" "¸" "¸")
+    ("sup1" "\\textonesuperior{}" nil "&sup1;" "^1" "¹" "¹")
+    ("ordm" "\\textordmasculine{}" nil "&ordm;" "_o_" "º" "º")
+    ("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
     ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
     ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
     ("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
     ("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
     ("Aacute" "\\'{A}" nil "&Aacute;" "A" "Á" "Á")
     ("Aacute" "\\'{A}" nil "&Aacute;" "A" "Á" "Á")
     ("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
     ("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
     ("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
     ("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
     ("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
     ("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
-    ("Aring" "\\AA" nil "&Aring;" "A" "Å" "Å")
-    ("AA" "\\AA" nil "&Aring;" "A" "Å" "Å")
-    ("AElig" "\\AE" nil "&AElig;" "AE" "Æ" "Æ")
+    ("Aring" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
+    ("AA" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
+    ("AElig" "\\AE{}" nil "&AElig;" "AE" "Æ" "Æ")
     ("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
     ("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
     ("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
     ("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
     ("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
     ("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
@@ -121,29 +121,29 @@ utf-8 replacement    Use special character available in utf-8."
     ("Iacute" "\\'{I}" nil "&Iacute;" "I" "Í" "Í")
     ("Iacute" "\\'{I}" nil "&Iacute;" "I" "Í" "Í")
     ("Icirc" "\\^{I}" nil "&Icirc;" "I" "Î" "Î")
     ("Icirc" "\\^{I}" nil "&Icirc;" "I" "Î" "Î")
     ("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ï" "Ï")
     ("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ï" "Ï")
-    ("ETH" "\\DH" nil "&ETH;" "D" "Ð" "Ð")
+    ("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
     ("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
     ("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
     ("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ò" "Ò")
     ("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ò" "Ò")
     ("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
     ("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
     ("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
     ("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
     ("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
     ("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
     ("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
     ("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
-    ("times" "\\texttimes" nil "&times;" "*" "×" "×")
+    ("times" "\\texttimes{}" nil "&times;" "*" "×" "×")
     ("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
     ("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
     ("Ugrave" "\\`{U}" nil "&Ugrave;" "U" "Ù" "Ù")
     ("Ugrave" "\\`{U}" nil "&Ugrave;" "U" "Ù" "Ù")
     ("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
     ("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
     ("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
     ("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
     ("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
     ("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
     ("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ý" "Ý")
     ("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ý" "Ý")
-    ("THORN" "\\TH" nil "&THORN;" "TH" "Þ" "Þ")
-    ("szlig" "\\ss" nil "&szlig;" "ss" "ß" "ß")
+    ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
+    ("szlig" "\\ss{}" nil "&szlig;" "ss" "ß" "ß")
     ("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
     ("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
     ("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
     ("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
     ("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
     ("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
     ("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
     ("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
     ("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
     ("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
-    ("aring" "\\aa" nil "&aring;" "a" "å" "å")
-    ("aelig" "\\ae" nil "&aelig;" "ae" "æ" "æ")
+    ("aring" "\\aa{}" nil "&aring;" "a" "å" "å")
+    ("aelig" "\\ae{}" nil "&aelig;" "ae" "æ" "æ")
     ("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
     ("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
     ("checkmark" "\\checkmark" t "&#10003;" "[checkmark]" "[checkmark]" "✓")
     ("checkmark" "\\checkmark" t "&#10003;" "[checkmark]" "[checkmark]" "✓")
     ("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
     ("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
@@ -154,20 +154,20 @@ utf-8 replacement    Use special character available in utf-8."
     ("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
     ("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
     ("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
     ("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
     ("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
     ("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
-    ("eth" "\\dh" nil "&eth;" "dh" "ð" "ð")
+    ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
     ("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
     ("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
     ("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
     ("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
     ("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
     ("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
     ("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
     ("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
     ("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
     ("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
     ("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
     ("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
-    ("oslash" "\\o" nil "&oslash;" "o" "ø" "ø")
+    ("oslash" "\\o{}" nil "&oslash;" "o" "ø" "ø")
     ("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
     ("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
     ("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
     ("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
     ("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
     ("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
     ("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
     ("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
     ("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
     ("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
-    ("thorn" "\\th" nil "&thorn;" "th" "þ" "þ")
+    ("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
     ("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
     ("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
     ("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "ƒ")
     ("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "ƒ")
     ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
     ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
@@ -225,10 +225,10 @@ utf-8 replacement    Use special character available in utf-8."
     ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
     ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
     ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
     ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
     ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
     ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
-    ("bull" "\\textbullet" nil "&bull;" "*" "*" "•")
-    ("bullet" "\\textbullet" nil "&bull;" "*" "*" "•")
-    ("hellip" "\\dots" nil "&hellip;" "..." "..." "…")
-    ("dots" "\\dots" nil "&hellip;" "..." "..." "…")
+    ("bull" "\\textbullet{}" nil "&bull;" "*" "*" "•")
+    ("bullet" "\\textbullet{}" nil "&bull;" "*" "*" "•")
+    ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
+    ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
     ("prime" "\\prime" t "&prime;" "'" "'" "′")
     ("prime" "\\prime" t "&prime;" "'" "'" "′")
     ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
     ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
     ("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "‾")
     ("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "‾")
@@ -236,7 +236,7 @@ utf-8 replacement    Use special character available in utf-8."
     ("weierp" "\\wp" t "&weierp;" "P" "P" "℘")
     ("weierp" "\\wp" t "&weierp;" "P" "P" "℘")
     ("image" "\\Im" t "&image;" "I" "I" "ℑ")
     ("image" "\\Im" t "&image;" "I" "I" "ℑ")
     ("real" "\\Re" t "&real;" "R" "R" "ℜ")
     ("real" "\\Re" t "&real;" "R" "R" "ℜ")
-    ("trade" "\\texttrademark" nil "&trade;" "TM" "TM" "™")
+    ("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "™")
     ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
     ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
     ("larr" "\\leftarrow" t "&larr;" "<-" "<-" "←")
     ("larr" "\\leftarrow" t "&larr;" "<-" "<-" "←")
     ("leftarrow" "\\leftarrow" t "&larr;"  "<-" "<-" "←")
     ("leftarrow" "\\leftarrow" t "&larr;"  "<-" "<-" "←")
@@ -334,14 +334,14 @@ utf-8 replacement    Use special character available in utf-8."
     ("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
     ("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
     ("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
     ("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
     ("smile" "\\smile" t "&#9786;" ":-)" ":-)" "⌣")
     ("smile" "\\smile" t "&#9786;" ":-)" ":-)" "⌣")
-    ("blacksmile" "\\blacksmiley" nil "&#9787;" ":-)" ":-)" "☻")
-    ("sad" "\\frownie" nil "&#9785;" ":-(" ":-(" "☹")
-    ("quot" "\\textquotedbl" nil "&quot;" "\"" "\"" "\"")
+    ("blacksmile" "\\blacksmiley{}" nil "&#9787;" ":-)" ":-)" "☻")
+    ("sad" "\\frownie{}" nil "&#9785;" ":-(" ":-(" "☹")
+    ("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
     ("amp" "\\&" nil "&amp;" "&" "&" "&")
     ("amp" "\\&" nil "&amp;" "&" "&" "&")
-    ("lt" "\\textless" nil "&lt;" "<" "<" "<")
-    ("gt" "\\textgreater" nil "&gt;" ">" ">" ">")
-    ("OElig" "\\OE" nil "&OElig;" "OE" "OE" "Œ")
-    ("oelig" "\\oe" nil "&oelig;" "oe" "oe" "œ")
+    ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
+    ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
+    ("OElig" "\\OE{}" nil "&OElig;" "OE" "OE" "Œ")
+    ("oelig" "\\oe{}" nil "&oelig;" "oe" "oe" "œ")
     ("Scaron" "\\v{S}" nil "&Scaron;" "S" "S" "Š")
     ("Scaron" "\\v{S}" nil "&Scaron;" "S" "S" "Š")
     ("scaron" "\\v{s}" nil "&scaron;" "s" "s" "š")
     ("scaron" "\\v{s}" nil "&scaron;" "s" "s" "š")
     ("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
     ("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
@@ -356,23 +356,23 @@ utf-8 replacement    Use special character available in utf-8."
     ("rlm" "" nil "&rlm;" "" "" "‏")
     ("rlm" "" nil "&rlm;" "" "" "‏")
     ("ndash" "--" nil "&ndash;" "-" "-" "–")
     ("ndash" "--" nil "&ndash;" "-" "-" "–")
     ("mdash" "---" nil "&mdash;" "--" "--" "—")
     ("mdash" "---" nil "&mdash;" "--" "--" "—")
-    ("lsquo" "\\textquoteleft" nil "&lsquo;" "`" "`" "‘")
-    ("rsquo" "\\textquoteright" nil "&rsquo;" "'" "'" "’")
-    ("sbquo" "\\quotesinglbase" nil "&sbquo;" "," "," "‚")
-    ("ldquo" "\\textquotedblleft" nil "&ldquo;" "\"" "\"" "“")
-    ("rdquo" "\\textquotedblright" nil "&rdquo;" "\"" "\"" "”")
-    ("bdquo" "\\quotedblbase" nil "&bdquo;" "\"" "\"" "„")
-    ("dagger" "\\textdagger" nil "&dagger;" "[dagger]" "[dagger]" "†")
-    ("Dagger" "\\textdaggerdbl" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
-    ("permil" "\\textperthousand" nil "&permil;" "per thousand" "per thousand" "‰")
-    ("lsaquo" "\\guilsinglleft" nil "&lsaquo;" "<" "<" "‹")
-    ("rsaquo" "\\guilsinglright" nil "&rsaquo;" ">" ">" "›")
-    ("euro" "\\texteuro" nil "&euro;" "EUR" "EUR" "€")
-    ("EUR" "\\EUR" nil "&euro;" "EUR" "EUR" "€")
-    ("EURdig" "\\EURdig" nil "&euro;" "EUR" "EUR" "€")
-    ("EURhv" "\\EURhv" nil "&euro;" "EUR" "EUR" "€")
-    ("EURcr" "\\EURcr" nil "&euro;" "EUR" "EUR" "€")
-    ("EURtm" "\\EURtm" nil "&euro;" "EUR" "EUR" "€")
+    ("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "‘")
+    ("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "’")
+    ("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "‚")
+    ("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "“")
+    ("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "”")
+    ("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "„")
+    ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
+    ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
+    ("permil" "\\textperthousand{}" nil "&permil;" "per thousand" "per thousand" "‰")
+    ("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "‹")
+    ("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "›")
+    ("euro" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
+    ("EUR" "\\EUR{}" nil "&euro;" "EUR" "EUR" "€")
+    ("EURdig" "\\EURdig{}" nil "&euro;" "EUR" "EUR" "€")
+    ("EURhv" "\\EURhv{}" nil "&euro;" "EUR" "EUR" "€")
+    ("EURcr" "\\EURcr{}" nil "&euro;" "EUR" "EUR" "€")
+    ("EURtm" "\\EURtm{}" nil "&euro;" "EUR" "EUR" "€")
     ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
     ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
     ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
     ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
     ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
     ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
@@ -405,13 +405,13 @@ utf-8 replacement    Use special character available in utf-8."
     ("sup" "\\sup" t "&sup;" "sup" "sup" "sup")
     ("sup" "\\sup" t "&sup;" "sup" "sup" "sup")
     ("tan" "\\tan" t "tan" "tan" "tan" "tan")
     ("tan" "\\tan" t "tan" "tan" "tan" "tan")
     ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
     ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
-    ("frac12" "\\textonehalf" nil "&frac12;" "1/2" "½" "½")
-    ("frac14" "\\textonequarter" nil "&frac14;" "1/4" "¼" "¼")
-    ("frac34" "\\textthreequarters" nil "&frac34;" "3/4" "¾" "¾")
-    ("div" "\\textdiv" nil "&divide;" "/" "÷" "÷")
-    ("acute" "\\textasciiacute" nil "&acute;" "'" "´" "´")
+    ("frac12" "\\textonehalf{}" nil "&frac12;" "1/2" "½" "½")
+    ("frac14" "\\textonequarter{}" nil "&frac14;" "1/4" "¼" "¼")
+    ("frac34" "\\textthreequarters{}" nil "&frac34;" "3/4" "¾" "¾")
+    ("div" "\\textdiv{}" nil "&divide;" "/" "÷" "÷")
+    ("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
     ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
     ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
-    ("smiley" "\\smiley" nil "&#9786;" ":-)" ":-)" "☺")
+    ("smiley" "\\smiley{}" nil "&#9786;" ":-)" ":-)" "☺")
     )
     )
   "Default entities used in Org-mode to preduce special characters.
   "Default entities used in Org-mode to preduce special characters.
 For details see `org-entities-user'.")
 For details see `org-entities-user'.")

+ 12 - 3
lisp/org-exp.el

@@ -883,7 +883,7 @@ value of `org-export-run-in-background'."
 \[1]   only export the current subtree
 \[1]   only export the current subtree
 \[SPC] publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME prop)
 \[SPC] publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME prop)
 
 
-\[a] export as ASCII     [A] to temporary buffer
+\[a/n/u] export as ASCII/Latin-1/UFT-8         [A/N/U] to temporary buffer
 
 
 \[h] export as HTML      [H] to temporary buffer   [R] export region
 \[h] export as HTML      [H] to temporary buffer   [R] export region
 \[b] export as HTML and open in browser
 \[b] export as HTML and open in browser
@@ -907,6 +907,10 @@ value of `org-export-run-in-background'."
 	    (?v org-export-visible nil)
 	    (?v org-export-visible nil)
 	    (?a org-export-as-ascii t)
 	    (?a org-export-as-ascii t)
 	    (?A org-export-as-ascii-to-buffer t)
 	    (?A org-export-as-ascii-to-buffer t)
+	    (?n org-export-as-latin1 t)
+	    (?N org-export-as-latin1-to-buffer t)
+	    (?u org-export-as-utf8 t)
+	    (?U org-export-as-utf8-to-buffer t)
 	    (?h org-export-as-html t)
 	    (?h org-export-as-html t)
 	    (?b org-export-as-html-and-open t)
 	    (?b org-export-as-html-and-open t)
 	    (?H org-export-as-html-to-buffer nil)
 	    (?H org-export-as-html-to-buffer nil)
@@ -2369,11 +2373,16 @@ command."
 	   (message "Export visible: [a]SCII  [h]tml  [b]rowse HTML [H/R]buffer with HTML  [D]ocBook  [l]atex  [p]df  [d]view pdf  [L]atex buffer  [x]OXO  [ ]keep buffer")
 	   (message "Export visible: [a]SCII  [h]tml  [b]rowse HTML [H/R]buffer with HTML  [D]ocBook  [l]atex  [p]df  [d]view pdf  [L]atex buffer  [x]OXO  [ ]keep buffer")
 	   (read-char-exclusive))
 	   (read-char-exclusive))
 	 current-prefix-arg))
 	 current-prefix-arg))
-  (if (not (member type '(?a ?\C-a ?b ?\C-b ?h ?D ?x ?\ ?l ?p ?d ?L)))
+  (if (not (member type '(?a ?n ?u ?\C-a ?b ?\C-b ?h ?D ?x ?\ ?l ?p ?d ?L)))
       (error "Invalid export key"))
       (error "Invalid export key"))
   (let* ((binding (cdr (assoc type
   (let* ((binding (cdr (assoc type
-			      '((?a . org-export-as-ascii)
+			      '(
+				(?a . org-export-as-ascii)
 				(?A . org-export-as-ascii-to-buffer)
 				(?A . org-export-as-ascii-to-buffer)
+				(?n . org-export-as-latin1)
+				(?N . org-export-as-latin1-to-buffer)
+				(?u . org-export-as-utf8)
+				(?U . org-export-as-utf8-to-buffer)
 				(?\C-a . org-export-as-ascii)
 				(?\C-a . org-export-as-ascii)
 				(?b . org-export-as-html-and-open)
 				(?b . org-export-as-html-and-open)
 				(?\C-b . org-export-as-html-and-open)
 				(?\C-b . org-export-as-html-and-open)