From mboxrd@z Thu Jan 1 00:00:00 1970 From: dieter@schoen.or.at Subject: Bug: org-use-sub-superscripts not working [8.2.3b (8.2.3b-elpa @ c:/Users/xxx/.emacs.d/elpa/org-20131112/)] Date: Thu, 14 Nov 2013 19:38:46 +0000 (GMT) Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--=_NextPart_53e9938ed040f236d91f1bebe6c751b1" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vh2kk-0001Qf-3J for emacs-orgmode@gnu.org; Thu, 14 Nov 2013 14:39:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vh2kc-0004tW-Jg for emacs-orgmode@gnu.org; Thu, 14 Nov 2013 14:38:57 -0500 Received: from postrelay108.edis.at ([91.227.204.8]:44361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vh2kc-0004sZ-17 for emacs-orgmode@gnu.org; Thu, 14 Nov 2013 14:38:50 -0500 Received: from mailrelay.edis.at (postrelay108.edis.at [91.227.204.8]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by postrelay108.edis.at (Postfix) with ESMTPS id 147322004279 for ; Thu, 14 Nov 2013 20:38:47 +0100 (CET) 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 ----=_NextPart_53e9938ed040f236d91f1bebe6c751b1 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: Quoted-Printable hi list, i am not sure whether i have discovered a bug or just using this not in the right way. i have an org document where i have lots of underscores in words (they are function names, e.g. BC_send) and do not want them to be interpreted= as subscripts. the documentation says that the variable org-use-sub-superscript can be used to customize this behaviour: - t..convert every underscore - {}..only convert when text is preprended by an underscore and within braces - nil..no conversion at all in my environment, this does not work. output is always the same. i exported to html. i have set the variable in my .emacs. i have also tried without my defs with emacs -q --no-desktop. i found a similar report on the list, where they tried #+OPTIONS, this d= oes also not fix my problem. finally i have wrote a little elisp file to programmatically reproduce my situation, here it is: ------------cut----------------------- (defun insert-version () "insert org and emacs version information" (interactive) (insert (concat "emacs-version: " emacs-version "n")) (insert (concat "org-version: " org-version "n"))) (defun insert-org-text () "insert some org text with sub and superscripts and select the org text" (interactive) (insert (concat "nnorg-use-sub-superscripts: ") (if (eq org-use-sub-superscripts t) "tn" (if (eq org-use-sub-superscripts '{}) "{}n" (if (eq org-use-sub-superscripts nil) "niln" "= not niln")))) (insert "plain underscore: X_sub 3^supern") (insert "braces : X_{sub} 3^{super}n") (push-mark) (insert "plain underscore: X_sub 3^supern") (insert "braces : X_{sub} 3^{super}n") (exchange-point-and-mark)) (progn (let ((orgfile "blaa.org")) (get-buffer-create orgfile) (set-buffer orgfile) (split-window-horizontally) (switch-to-buffer-other-window orgfile) (kill-region (point-min) (point-max)) (org-mode) (insert-version) (setq values '(t {} nil)) (while values (setq org-use-sub-superscripts (car values)) (insert-org-text) (org-html-convert-region-to-html) (setq values (cdr values))))) -------------cut--------- and here is my output: -------------cut--------- emacs-version: 24.3.1 org-version: 8.2.3b org-use-sub-superscripts: t plain underscore: X_sub 3^super braces : X_{sub} 3^{super} plain underscore: Xsub 3super braces : Xsub 3super org-use-sub-superscripts: {} plain underscore: X_sub 3^super braces : X_{sub} 3^{super} plain underscore: Xsub 3super braces : Xsub 3super org-use-sub-superscripts: nil plain underscore: X_sub 3^super braces : X_{sub} 3^{super} plain underscore: Xsub 3super braces : Xsub 3super -------------cut--------- Emacs : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN Package: Org-mode version 8.2.3b (8.2.3b-elpa @ c:/Users/atw113y5/AppData/Roaming/.emacs.d/elpa/org-20131112/) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-latex-format-headline-function 'org-latex-format-headline-default-function org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawer= s org-cycle-hide-inline-tasks org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-babel-pre-tangle-hook '(save-buffer) org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-mode-hook '(#[nil "300301302303304S207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5] #[nil "300301302303304S207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-export-dispatch-use-expert-ui t org-metadown-hook '(org-babel-pop-to-session-maybe) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-after-todo-state-change-hook '(org-clock-out-if-current) org-confirm-shell-link-function 'yes-or-no-p ) ----=_NextPart_53e9938ed040f236d91f1bebe6c751b1 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: Quoted-Printable
hi list,
i am not sure whether i have discovered a bug or jus= t using this not in
th= e right way.
i have an= org document where i have lots of underscores in words (they
are function names, e.g. BC_send= ) and do not want them to be interpreted
as subscripts.

the d= ocumentation says that the variable org-use-sub-superscript can be
used to customize this beha= viour:
- t..convert ev= ery underscore
- {}..o= nly convert when text is preprended by an underscore and within braces=
- nil..no conversion at all<= /font>

= in my environment, this does not work. = output is always the same.
i exported to html.
i have set the variable in my
.emacs. i have also tried without my defs with emacs -q --no-d= esktop.

i found a similar report on the= list, where they tried #+OPTIONS, this does also not fix
my problem.
finally i have wrote a little elisp file to pr= ogrammatically reproduce
my situation, here it is:
------------cut-----------------------
(defun insert-version ()
  "insert org and emacs version informat= ion"
  (interacti= ve)
  (insert (co= ncat "emacs-version: " emacs-version "\n"))
  (insert (concat "org-version: " org-version "= \n")))


(defun insert-org-text ()
  "insert some org text with sub and sup= erscripts
and select t= he org text"
  (i= nteractive)
  (in= sert (concat "\n\norg-use-sub-superscripts: ")
            (if
      &n= bsp;               (eq org-use-sub-su= perscripts t) "t\n"
&n= bsp;                 (if (eq org= -use-sub-superscripts '{}) "{}\n"
                &nbs= p;         (if (eq org-use-sub-superscripts nil) "ni= l\n" "not nil\n"))))
&= nbsp; (insert "plain underscore: X_sub 3^super\n")
  (insert "braces      =    : X_{sub} 3^{super}\n")
  (push-mark)
  (insert "plain underscore: X_sub 3^super\n")<= /div>
  (insert "braces  =        : X_{sub} 3^{super}\n")
  (exchange-point-and-mark))


(progn
  = (let ((orgfile "blaa.org"))
    (get-buffer-create orgfile)
    (set-buffer orgfile)
<= div>    (split-window-horizon= tally)
    (= switch-to-buffer-other-window orgfile)
    (kill-region (point-min) (point-max))
    (org-mode)<= /font>
    (insert-= version)
   = (setq values '(t {} nil))
    (while values
      (setq org-use-sub-superscripts (car value= s))
    &nbs= p; (insert-org-text)
&= nbsp;     (org-html-convert-region-to-html)
<= font face=3D"Tahoma" size=3D"2">      (setq values (cdr v= alues)))))
-----------= --cut---------
and her= e is my output:
------= -------cut---------
em= acs-version: 24.3.1
or= g-version: 8.2.3b

=

org-use-sub-superscripts: t
plain underscore: X_sub 3^super<= /font>
braces     &= nbsp;    : X_{sub} 3^{super}
<p>
plain underscore: X<sub>sub</sub> 3<sup>super</= sup>
braces   =        : X<sub>sub</sub> 3<sup>sup= er</sup>
</p&= gt;

<= div>
org-use-sub-superscripts: {}
plain underscore: X_sub 3^super
<= div>braces         =  : X_{sub} 3^{super}
<p>
plain un= derscore: X<sub>sub</sub> 3<sup>super</sup>
braces      = ;    : X<sub>sub</sub> 3<sup>super</sup&g= t;
</p>


org-use-sub-superscripts: nil
plain underscore: X_sub 3^super
braces          : X_{= sub} 3^{super}
<p&g= t;
plain underscore: X= <sub>sub</sub> 3<sup>super</sup>
braces         &n= bsp;: X<sub>sub</sub> 3<sup>super</sup>
</p>
-------------cut---------




Emacs  : GNU Emacs 24.3.1 (i= 386-mingw-nt6.1.7601)
=  of 2013-03-17 on MARVIN
Package: Org-mode version 8.2.3b (8.2.3b-elpa @ c:/Users/atw113y= 5/AppData/Roaming/.emacs.d/elpa/org-20131112/)

current state:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(setq
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
<= div>=09=09=09  org-babel-execute-safely-ma= ybe)
 org-latex-f= ormat-headline-function 'org-latex-format-headline-default-function
 org-tab-first-hook '= (org-hide-block-toggle-maybe
=09=09      org-src-native-tab-command-maybe
<= div>=09=09      org-babel-hide-r= esult-toggle-maybe
=09=09 &nbs= p;    org-babel-header-arg-expand)
 org-cycle-hook '(org-cycle-hide-archived-su= btrees org-cycle-hide-drawers
=09=09<= /span>  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
=09=09  org-optimize-window-a= fter-visibility-change)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)=
 org-speed-command-hook= '(org-speed-command-default-hook
=09= =09=09  org-babel-speed-command-hook)
 org-babel-pre-tangle-hook '(save-buffe= r)
 org-occur-hoo= k '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-elisp-li= nk-function 'yes-or-no-p
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-mode-hook '(#[nil= "\300\301\302\303\304$\207"
=09=09   [org-add-hook change-major-mode-hook org-show-block-all
=09=09    append local]=
=09=09   5]
=
=09=09 #[nil "\300\301\302\303\304$\207"
=09=09   [org-add-hook cha= nge-major-mode-hook
=09=09 &nb= sp;  org-babel-show-result-all append local]
=09=09   5]
= =09=09 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-export-dispatch-= use-expert-ui t
 = org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-src-mode-hook '(org-src-babel-co= nfigure-edit-buffer
=09=09 &nb= sp;   org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-cl= ock-out-if-current)
&n= bsp;org-confirm-shell-link-function 'yes-or-no-p
 )

----=_NextPart_53e9938ed040f236d91f1bebe6c751b1--