[ESS-bugs] ess-mode 5.3.0; i/o-encoding

Jarle Tufto jarle.tufto at math.ntnu.no
Tue Oct 9 15:58:40 CEST 2007


Hi,

I'm having a few problems with norwegian (danish) letters and encoding 
of input and output to R via ess.  If I choose utf8 as encoding in the R 
session running in the *R*-buffer with

 > options(encoding="utf8")

or just keep the default "native.enc" and then change the i/o-encoding 
of the *R*-buffer to "utf-8" using the command

M-x set-buffer-process-coding-system

everything works fine, for example

 > cat("ø\n")
ø
 >

However, if I change the encoding in R to "latin1" and i/o in *R* buffer 
to "latin-1" I get an error:

 > cat("ø\n")
+

that is, the above command is interpreted as an incomplete expression 
(which it is not).  More complicated things like functions (pasted into 
*R* with C-c C-f) are typically interpreted with similar strange errors.

I would have thought that this should have worked since the encodings 
using by both the sender and receiver of the actual by sequence are the 
same...?

If it is of any importance, this happens on an ubuntu-7.04 box with the 
setup attached below.

Jarle Tufto


jarlet:~/prosjekt/fiskerispillet:$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Emacs  : GNU Emacs 21.4.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
  of 2007-08-28 on terranova, modified by Debian
Package: ess-mode 5.3.0

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
(S): ess-s-versions-create making M-x defuns for (R): 
ess-r-versions-create making M-x defuns for [ess-site.el]: 
ess-customize-alist=nil
[ess-site.el _2_]: ess-customize-alist=nil
(S): ess-s-versions-create making M-x defuns for (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=fiskerispillet.r
(ess-mode-1.5): alist=((ess-local-customize-alist quote 
R-customize-alist) (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-syntax-table . 
R-syntax-table) (ess-mode-editing-alist . R-editing-alist) 
(ess-change-sp-regexp . ess-R-change-sp-regexp) (ess-help-sec-regex . 
ess-help-R-sec-regex) (ess-help-sec-keys-alist . 
ess-help-R-sec-keys-alist) (ess-loop-timeout . ess-S-loop-timeout) 
(ess-cmd-delay . ess-R-cmd-delay) (ess-function-pattern . 
ess-R-function-pattern) (ess-object-name-db-file . ess-r-namedb.el) 
(ess-retr-lastvalue-command . assign(".Last.value", .ess.lvsave, 
envir=baseenv())
) (ess-save-lastvalue-command . assign(".ess.lvsave", get(".Last.value", 
envir=baseenv()))
) (ess-imenu-mode-function quote ess-imenu-R) (inferior-ess-program . 
inferior-R-program-name) (inferior-ess-objects-command . 
inferior-R-objects-command) (inferior-ess-font-lock-keywords . 
inferior-ess-R-font-lock-keywords) (inferior-ess-search-list-command . 
search()
) (inferior-ess-help-command . help("%s", htmlhelp=FALSE)
) (inferior-ess-help-filetype) (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 . + ?) (inferior-ess-start-file) 
(inferior-ess-start-args . ) (ess-STERM . iESS) (ess-editor . R-editor) 
(ess-pager . R-pager) (ess-language . S) (inferior-ess-exit-command . q()
) (inferior-ess-language-start eval inferior-S-language-start) 
(comint-use-prompt-regexp-instead-of-fields . t))
(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-add . 1) (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-R-mode-font-lock-keywords nil 
nil ((46 . w) (95 . w)))))
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, 
comint..echoes=nil, comint..sender=comint-simple-send

Finished setting up ESS-mode.
(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=fiskerispillet.R
(ess-mode-1.5): alist=((ess-local-customize-alist quote 
R-customize-alist) (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-syntax-table . 
R-syntax-table) (ess-mode-editing-alist . R-editing-alist) 
(ess-change-sp-regexp . ess-R-change-sp-regexp) (ess-help-sec-regex . 
ess-help-R-sec-regex) (ess-help-sec-keys-alist . 
ess-help-R-sec-keys-alist) (ess-loop-timeout . ess-S-loop-timeout) 
(ess-cmd-delay . ess-R-cmd-delay) (ess-function-pattern . 
ess-R-function-pattern) (ess-object-name-db-file . ess-r-namedb.el) 
(ess-retr-lastvalue-command . assign(".Last.value", .ess.lvsave, 
envir=baseenv())
) (ess-save-lastvalue-command . assign(".ess.lvsave", get(".Last.value", 
envir=baseenv()))
) (ess-imenu-mode-function quote ess-imenu-R) (inferior-ess-program . 
inferior-R-program-name) (inferior-ess-objects-command . 
inferior-R-objects-command) (inferior-ess-font-lock-keywords . 
inferior-ess-R-font-lock-keywords) (inferior-ess-search-list-command . 
search()
) (inferior-ess-help-command . help("%s", htmlhelp=FALSE)
) (inferior-ess-help-filetype) (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 . + ?) (inferior-ess-start-file) 
(inferior-ess-start-args . ) (ess-STERM . iESS) (ess-editor . R-editor) 
(ess-pager . R-pager) (ess-language . S) (inferior-ess-exit-command . q()
) (inferior-ess-language-start eval inferior-S-language-start) 
(comint-use-prompt-regexp-instead-of-fields . t))
(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-add . 1) (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-R-mode-font-lock-keywords nil 
nil ((46 . w) (95 . 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=fiskerispillet.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=fiskerispillet.R
(inf-ess 1.1): procname=R temp-dialect=R, buf-name=*R*
(inferior-ess) Method #3 start=/home/jarlet/prosjekt/fiskerispillet/ 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-BEG-of-fun after 'search-FWD (': Ini-pt 6391, (p)-Ini-pt = 5
ELSE  not in setMethod() header ...
	Match,Pt:(5705,5723),5705
	Match,Pt:(4771,4790),4771
ess-END-of-fun: S4=nil, beginning = 4771
ess-BEG-of-fun after 'search-FWD (': Ini-pt 7411, (p)-Ini-pt = 0
ELSE  not in setMethod() header ...
	Match,Pt:(5705,5723),5705
	Match,Pt:(4771,4790),4771
	Match,Pt:(633,651),633
	Match,Pt:(238,256),238
	Match,Pt:(84,101),84
	Match,Pt:(17,37),17
(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.r
(ess-mode-1.5): alist=((ess-local-customize-alist quote 
R-customize-alist) (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-syntax-table . 
R-syntax-table) (ess-mode-editing-alist . R-editing-alist) 
(ess-change-sp-regexp . ess-R-change-sp-regexp) (ess-help-sec-regex . 
ess-help-R-sec-regex) (ess-help-sec-keys-alist . 
ess-help-R-sec-keys-alist) (ess-loop-timeout . ess-S-loop-timeout) 
(ess-cmd-delay . ess-R-cmd-delay) (ess-function-pattern . 
ess-R-function-pattern) (ess-object-name-db-file . ess-r-namedb.el) 
(ess-retr-lastvalue-command . assign(".Last.value", .ess.lvsave, 
envir=baseenv())
) (ess-save-lastvalue-command . assign(".ess.lvsave", get(".Last.value", 
envir=baseenv()))
) (ess-imenu-mode-function quote ess-imenu-R) (inferior-ess-program . 
inferior-R-program-name) (inferior-ess-objects-command . 
inferior-R-objects-command) (inferior-ess-font-lock-keywords . 
inferior-ess-R-font-lock-keywords) (inferior-ess-search-list-command . 
search()
) (inferior-ess-help-command . help("%s", htmlhelp=FALSE)
) (inferior-ess-help-filetype) (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 . + ?) (inferior-ess-start-file) 
(inferior-ess-start-args . ) (ess-STERM . iESS) (ess-editor . R-editor) 
(ess-pager . R-pager) (ess-language . S) (inferior-ess-exit-command . q()
) (inferior-ess-language-start eval inferior-S-language-start) 
(comint-use-prompt-regexp-instead-of-fields . t))
(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-add . 1) (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-R-mode-font-lock-keywords nil 
nil ((46 . w) (95 . 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.r, start-arg=nil
  current-prefix-arg=nil
(inferior-ess 0): ess-start-args=--no-readline
ess-setq-vars-default 0: ess-language=S, -dialect=R, 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.r
(inf-ess 1.1): procname=R temp-dialect=R, buf-name=*R*
(inferior-ess) Method #3 start=/home/jarlet/prosjekt/fiskerispillet/ 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(R,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-BEG-of-fun after 'search-FWD (': Ini-pt 7250, (p)-Ini-pt = 0
ELSE  not in setMethod() header ...
	Match,Pt:(5705,5723),5705
	Match,Pt:(4771,4790),4771
ess-END-of-fun: S4=nil, beginning = 4771
ess-BEG-of-fun after 'search-FWD (': Ini-pt 44, (p)-Ini-pt = 7
ELSE  not in setMethod() header ...
	Match,Pt:(17,37),17
ess-END-of-fun: S4=nil, beginning = 17
ess-BEG-of-fun after 'search-FWD (': Ini-pt 178, (p)-Ini-pt = 7
ELSE  not in setMethod() header ...
	Match,Pt:(84,101),84
ess-END-of-fun: S4=nil, beginning = 84
ess-BEG-of-fun after 'search-FWD (': Ini-pt 380, (p)-Ini-pt = 23
ELSE  not in setMethod() header ...
	Match,Pt:(238,256),238
ess-END-of-fun: S4=nil, beginning = 238
ess-BEG-of-fun after 'search-FWD (': Ini-pt 7183, (p)-Ini-pt = 42
ELSE  not in setMethod() header ...
	Match,Pt:(5705,5723),5705
	Match,Pt:(4771,4790),4771
ess-END-of-fun: S4=nil, beginning = 4771
ess-BEG-of-fun after 'search-FWD (': Ini-pt 7183, (p)-Ini-pt = 42
ELSE  not in setMethod() header ...
	Match,Pt:(5705,5723),5705
	Match,Pt:(4771,4790),4771
ess-END-of-fun: S4=nil, beginning = 4771
ess-BEG-of-fun after 'search-FWD (': Ini-pt 7130, (p)-Ini-pt = 11
ELSE  not in setMethod() header ...
	Match,Pt:(5705,5723),5705
	Match,Pt:(4771,4790),4771
ess-END-of-fun: S4=nil, beginning = 4771
(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=.emacs
(ess-mode-1.5): alist=nil
(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-add . 1) (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-R-mode-font-lock-keywords nil 
nil ((46 . w) (95 . w)))))
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, 
comint..echoes=nil, comint..sender=comint-simple-send

Finished setting up ESS-mode.
(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=.Rprofile
(ess-mode-1.5): alist=((ess-local-customize-alist quote 
R-customize-alist) (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-syntax-table . 
R-syntax-table) (ess-mode-editing-alist . R-editing-alist) 
(ess-change-sp-regexp . ess-R-change-sp-regexp) (ess-help-sec-regex . 
ess-help-R-sec-regex) (ess-help-sec-keys-alist . 
ess-help-R-sec-keys-alist) (ess-loop-timeout . ess-S-loop-timeout) 
(ess-cmd-delay . ess-R-cmd-delay) (ess-function-pattern . 
ess-R-function-pattern) (ess-object-name-db-file . ess-r-namedb.el) 
(ess-retr-lastvalue-command . assign(".Last.value", .ess.lvsave, 
envir=baseenv())
) (ess-save-lastvalue-command . assign(".ess.lvsave", get(".Last.value", 
envir=baseenv()))
) (ess-imenu-mode-function quote ess-imenu-R) (inferior-ess-program . 
inferior-R-program-name) (inferior-ess-objects-command . 
inferior-R-objects-command) (inferior-ess-font-lock-keywords . 
inferior-ess-R-font-lock-keywords) (inferior-ess-search-list-command . 
search()
) (inferior-ess-help-command . help("%s", htmlhelp=FALSE)
) (inferior-ess-help-filetype) (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 . + ?) (inferior-ess-start-file) 
(inferior-ess-start-args . ) (ess-STERM . iESS) (ess-editor . R-editor) 
(ess-pager . R-pager) (ess-language . S) (inferior-ess-exit-command . q()
) (inferior-ess-language-start eval inferior-S-language-start) 
(comint-use-prompt-regexp-instead-of-fields . t))
(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-add . 1) (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-R-mode-font-lock-keywords nil 
nil ((46 . w) (95 . w)))))
(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, 
comint..echoes=nil, comint..sender=comint-simple-send

Finished setting up ESS-mode.



More information about the ESS-bugs mailing list