[ESS] printting/plotting non-ascii characters under Emacs (but not XEmacs) generates extra characters in R

Markus Jantti markus.jantti at iki.fi
Tue Nov 30 21:29:34 CET 2004


Dear All:

I have discovered a minor nuisance when using ESS under Emacs that does
not appear when I am using ESS under XEmacs. I am not sure this should
be characterized as a bug, and am note sure it is a problem with ESS. 
I am approaching the list as some persons using non-ascii locales 
in Emacs and ESS may already have encountered this and may be able to
help. 

The following lines (using the locale fi_FI at euro)

plot(1:10, main = "Hello ÅÄÖ åäö")
dev.print(postscript, file = "test.eps", horizontal = FALSE)
dev.print(pdf, file = "test.pdf", horizontal = FALSE)

work fine in XEmacs and when using R from a terminal.

Reading in the same file under Emacs and sending it to R 
produces a plot where the non-ascii characters are preceded by
something, which  in the R X11 device shows up as a box and in the eps
and pdf output as non-printing characters. 

I am using the R 2.0.0 and Emacs and XEmacs under Debian testing. 


the pdf and eps files are available at: 

(Using emacs)

http://www.abo.fi/~mjantti/test-emacs.eps
http://www.abo.fi/~mjantti/test-emacs.pdf

(Using xemacs)

http://www.abo.fi/~mjantti/test-xemacs.eps
http://www.abo.fi/~mjantti/test-xemacs.pdf

I discovered the following lines in .emacs:

(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste
it!
  ;; Your init file should contain only one such instance.
 '(case-fold-search t)
 '(current-language-environment "Latin-1")
 '(default-input-method "latin-1-prefix")
 '(global-font-lock-mode t nil (font-lock))
 '(show-paren-mode t nil (paren))
 '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
 '(transient-mark-mode t))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )

Removing these and re-trying had pretty much the same effect.

Any tips would be appreciated.

Kindest regards,

Markus 
---------------------------
Versions on Emacs (see below for the full output that acocmpanies a bug
report):

Emacs  : GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll
bars)
of 2004-10-16 on raven, modified by Debian
Package: ess-mode 5.2.3

and XEmacs

Emacs  : XEmacs 21.4 (patch 15) "Security Through Obscurity" [Lucid]
(i386-debian-linux, Mule) of Sat Oct 23 2004 on penell
Package: ess-mode 5.2.3

Bug report output on Emacs (which puts non-printing characters before
non-ascii chacaters):

Emacs  : GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll
bars)
 of 2004-10-16 on raven, modified by Debian
Package: ess-mode 5.2.3

current state:
==============
(setq
 ess-language "S"
 ess-dialect "R"
 ess-ask-for-ess-directory t
 ess-ask-about-transfile nil
 ess-directory nil
 ess-keep-dump-files "always"
 ess-source-directory "/tmp/"
 )
[ess-site.el]: ess-customize-alist=nil 
[ess-site.el _2_]: ess-customize-alist=nil 
(R): ess-r-versions-create making M-x defuns for 
(R): ess-dialect=nil, buf=.emacs, start-arg=nil
 current-prefix-arg=nil
(inferior-ess 0): ess-start-args=--no-readline  
ess-setq-vars-default 0: ess-language=Initial, -dialect=nil, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send
ess-setq-vars-default 1: ess-language=S, -dialect=R, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send
(inf-ess 1): lang=S, dialect=R, tmp-dialect=R, buf=.emacs
(inf-ess 1.1): procname=R temp-dialect=R, buf-name=*R* 
(inferior-ess) Method #3 start=/home/markus/ buf=*R*
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send
(inf-ess 2.1): ess-language=S, ess-dialect=R buf=*R* 
(inf-ess 2.2): start args = --no-readline ,
inf-ess-start-args=--no-readline  
(inf-ess finish [S(R), R(nil,nil)]
(ess-multi 0):  inf-ess-start-args=--no-readline , comint-..echoes=nil
(i-ess 1): buf=*R*, lang=S, comint..echo=nil,
comint..sender=comint-simple-send,
(i-ess 2): buf=*R*, lang=S, comint..echo=t,
comint..sender=inferior-R-input-sender,
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t,
comint..sender=inferior-R-input-sender
(i-ess 3): curr-buf=*R*, comint..echo=t,
comint..sender=inferior-R-input-sender,
(ess-multi post inf-ess: start-args=--no-readline , comint-echoes=t
(ess-multi 1):  start-args=--no-readline  
Making Process...Buf *R*, Proc R, Prog R
 Start File=nil, Args= --no-readline .
(R): inferior-ess-language-start=options(STERM='iESS',
editor='emacsclient')
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send
(ess-mode-1): ess-language=S, ess-dialect=R buf=test-latin15.R 
(ess-mode-1.5): alist=((ess-local-customize-alist quote
R-customize-alist) (ess-language . S) (ess-dialect . R) (ess-suffix . R)
(ess-dump-filename-template ess-replace-regexp-in-string S$ ess-suffix
ess-dump-filename-template-proto) (ess-mode-editing-alist .
S-editing-alist) (ess-mode-syntax-table . R-syntax-table)
(ess-help-sec-regex . ess-help-R-sec-regex) (ess-help-sec-keys-alist .
R-help-sec-keys-alist) (ess-loop-timeout . ess-S-loop-timeout)
(ess-object-name-db-file . ess-r-namedb.el)
(ess-retr-lastvalue-command . assign(".Last.value", .ess.lvsave,
envir=NULL)
) (ess-save-lastvalue-command .
assign(".ess.lvsave",.Last.value,inherits=TRUE)
) (ess-imenu-mode-function quote ess-imenu-R) (inferior-ess-program .
inferior-R-program-name) (inferior-ess-objects-command . objects(pos = %
d)
) (inferior-ess-search-list-command . search()
) (inferior-ess-help-command . help("%s", htmlhelp=FALSE)
) (inferior-ess-exit-command . q()) (inferior-ess-exit-prompt . Save
workspace image? [y/n/c]: ) (inferior-ess-primary-prompt .
\([A-Z][][A-Za-z0-9.]*\)*> ) (inferior-ess-secondary-prompt . + ?)
(comint-use-prompt-regexp-instead-of-fields . t)
(inferior-ess-start-file) (inferior-ess-start-args . ) (ess-STERM .
iESS) (ess-editor . R-editor) (ess-pager . R-pager)
(inferior-ess-language-start eval inferior-S-language-start)) 
(ess-mode-1.6): editing-alist=((paragraph-start concat \s-*$\|
page-delimiter) (paragraph-separate concat \s-*$\| page-delimiter)
(paragraph-ignore-fill-prefix . t) (require-final-newline . t)
(comment-start . #) (comment-start-skip . #+ *) (comment-column . 40)
(indent-line-function quote S-indent-line) (parse-sexp-ignore-comments .
t) (ess-set-style . ess-default-style) (ess-local-process-name)
(ess-mode-syntax-table . S-syntax-table)
(add-log-current-defun-header-regexp . ^\(.+\)\s-+<-[ 	
]*function) (font-lock-defaults quote (ess-mode-font-lock-keywords nil
nil ((46 . w))))) 
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send

Finished setting up ESS-mode.
-------------------------
Bug report under XEmacs (which works):

Emacs  : XEmacs 21.4 (patch 15) "Security Through Obscurity" [Lucid]
(i386-debian-linux, Mule) of Sat Oct 23 2004 on penell
Package: ess-mode 5.2.3

current state:
==============
(setq
 ess-language "S"
 ess-dialect "R"
 ess-ask-for-ess-directory t
 ess-ask-about-transfile nil
 ess-directory nil
 ess-keep-dump-files "always"
 ess-source-directory "/tmp/"
 )
[ess-site.el]: ess-customize-alist=nil 
[ess-site.el _2_]: ess-customize-alist=nil 
(R): ess-r-versions-create making M-x defuns for (ess-setq-vars-LOCAL):
language=S, dialect=R, buf=nil, comint..echoes=nil,
comint..sender=comint-simple-send
(ess-mode-1): ess-language=S, ess-dialect=R buf=test-latin15.R 
(ess-mode-1.5): alist=((ess-local-customize-alist quote
R-customize-alist) (ess-language . S) (ess-dialect . R) (ess-suffix . R)
(ess-dump-filename-template ess-replace-regexp-in-string S$ ess-suffix
ess-dump-filename-template-proto) (ess-mode-editing-alist .
S-editing-alist) (ess-mode-syntax-table . R-syntax-table)
(ess-help-sec-regex . ess-help-R-sec-regex) (ess-help-sec-keys-alist .
R-help-sec-keys-alist) (ess-loop-timeout . ess-S-loop-timeout)
(ess-object-name-db-file . ess-r-namedb.el)
(ess-retr-lastvalue-command . assign(".Last.value", .ess.lvsave,
envir=NULL)
) (ess-save-lastvalue-command .
assign(".ess.lvsave",.Last.value,inherits=TRUE)
) (ess-imenu-mode-function quote ess-imenu-R) (inferior-ess-program .
inferior-R-program-name) (inferior-ess-objects-command . objects(pos = %
d)
) (inferior-ess-search-list-command . search()
) (inferior-ess-help-command . help("%s", htmlhelp=FALSE)
) (inferior-ess-exit-command . q()) (inferior-ess-exit-prompt . Save
workspace image? [y/n/c]: ) (inferior-ess-primary-prompt .
\([A-Z][][A-Za-z0-9.]*\)*> ) (inferior-ess-secondary-prompt . + ?)
(comint-use-prompt-regexp-instead-of-fields . t)
(inferior-ess-start-file) (inferior-ess-start-args . ) (ess-STERM .
iESS) (ess-editor . R-editor) (ess-pager . R-pager)
(inferior-ess-language-start eval inferior-S-language-start)) 
(ess-mode-1.6): editing-alist=((paragraph-start concat \s-*$\|
page-delimiter) (paragraph-separate concat \s-*$\| page-delimiter)
(paragraph-ignore-fill-prefix . t) (require-final-newline . t)
(comment-start . #) (comment-start-skip . #+ *) (comment-column . 40)
(indent-line-function quote S-indent-line) (parse-sexp-ignore-comments .
t) (ess-set-style . ess-default-style) (ess-local-process-name)
(ess-mode-syntax-table . S-syntax-table)
(add-log-current-defun-header-regexp . ^\(.+\)\s-+<-[ 	
]*function) (font-lock-defaults quote (ess-mode-font-lock-keywords nil
nil ((?\. . w))))) 
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send

Finished setting up ESS-mode.

(R): ess-dialect=R, buf=test-latin15.R, start-arg=nil
 current-prefix-arg=nil
(inferior-ess 0): ess-start-args=--no-readline  
ess-setq-vars-default 0: ess-language=Initial, -dialect=nil, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send
ess-setq-vars-default 1: ess-language=S, -dialect=R, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send
(inf-ess 1): lang=S, dialect=R, tmp-dialect=R, buf=test-latin15.R
(inf-ess 1.1): procname=R temp-dialect=R, buf-name=*R* 
(inferior-ess) Method #3 start=/home/markus/ buf=*R*
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil,
comint..echoes=nil, comint..sender=comint-simple-send
(inf-ess 2.1): ess-language=S, ess-dialect=R buf=*R* 
(inf-ess 2.2): start args = --no-readline ,
inf-ess-start-args=--no-readline  
(inf-ess finish [S(R), R(nil,nil)]
(ess-multi 0):  inf-ess-start-args=--no-readline , comint-..echoes=nil
(i-ess 1): buf=*R*, lang=S, comint..echo=nil,
comint..sender=comint-simple-send,
(i-ess 2): buf=*R*, lang=S, comint..echo=t,
comint..sender=inferior-R-input-sender,
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t,
comint..sender=inferior-R-input-sender
(i-ess 3): curr-buf=*R*, comint..echo=t,
comint..sender=inferior-R-input-sender,
(ess-multi post inf-ess: start-args=--no-readline , comint-echoes=t
(ess-multi 1):  start-args=--no-readline  
Making Process...Buf *R*, Proc R, Prog R
 Start File=nil, Args= --no-readline .
(R): inferior-ess-language-start=options(STERM='iESS', editor='gnuclient
-q')


-- 
Markus Jantti
Abo Akademi University
markus.jantti at iki.fi
http://www.iki.fi/~mjantti
-- 
Markus Jantti
Abo Akademi University
markus.jantti at iki.fi
http://www.iki.fi/~mjantti




More information about the ESS-help mailing list