[ESS] Colors in noweb mode

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Fri Dec 2 16:56:19 CET 2011


Quick questions:

(1) are are using emacs in a terminal (-nw) or in an Xwindow?
(2) when you move around in noweb mode, does the modeline change
appropriately when you move from a latex chunk to an R chunk and back
again?

This is not too helpful, but I would consider upgrading Emacs.  In my
experience the newer Emacs (version 22 or 23) are much better at
handling this stuff (but this is purely anecdotal)

Kasper

On Fri, Dec 2, 2011 at 10:50 AM, Terry Therneau <therneau at mayo.edu> wrote:
> I have a colors problem for .Rnw files, but only on the servers at work.
>
> The problem: the code portions of the document are fine.  In the text
> portion I get coloring appropriate to the code portions though.  So for
> the text string
>      .... a second order Taylor series about it's value at ....
> the color changes to red at the single quote mark an persists until the
> next one.  Words like "for", "in", and "function" are hightlighted, etc.
>
> Versions:  ESS 5.14, emacs 21.4.1, running on CentOS.
>
> Suspicion: I have something in my startup files?  But I don't see
> anything about colors.  My customization file is listed below.  Any
> hints are welcome as this is very annoying.
>
> Note: I simply use this to edit files.  I don't run R or Sweave out of
> the emacs process.
>
>  Terry Therneau
>
> -----------------
>
> init.el file
>  ; load ESS (emacs speaks statistics)
> (load "~/ess-5.14/lisp/ess-site.el")
> (setq Info-additional-search-directory-list
>        '("~/ess-5.14/doc/"))
> ;(require 'ess-site)
>
> ---
> custom.el file
>
> (setq line-number-mode t)
> ;; Add in my key mappings
> (load-file "~/.emacs.d/x-keymap.el")
>
> ;; override the auto-fill-mode
> (setq default-major-mode 'text-mode)
> (setq text-mode-hook nil)
>
> (setq visible-bell nil)                ; override visual bell
> (show-paren-mode 1)                    ; don't blink parenthesis-
> highlight
> (setq scroll-step 0)                   ; scroll by half windows
> (setq tab-width 4)
> (setq fill-column 80)
> (setq truncate-line nil)               ; how this becomes non-nil
> escapes me
> (tool-bar-mode 0)                      ; remove the tool bar
> ;; turn off startup message
> (setq inhibit-startup-message t)
>
>
> ;; C variables
> ((add-hook 'c-mode-common-hook
>          (lambda()
>            (setq c-basic-offset 4)
>            (setq c-indent-level 0)
>            (setq c-brace-imaginary-offset 4)
>            (setq c-continued-statement-offset 4)
>            (setq c-argdecl-indent 0)
>            (setq c-else-offset 0)
>            (setq c-tab-always-indent nil)
>            (setq-default c-electric-flag nil)))
>
>  ;;; ESS variables
> (add-hook 'ess-mode-hook
>    (lambda()
>        (setq ess-tab-always-indent nil)
>        (setq ess-auto-newline nil)
>        (setq ess-indent-level 4)
>        (setq ess-brace-offset 4)
>        (setq ess-close-brace-offset 0)
>        (setq ess-continued-statement-offset 4)
>        (setq ess-arg-function-offset nil)
>        (setq ess-expression-offset nil)
>        (setq ess-else-offset 0)
>        (setq ess-return-indent nil)
>        (setq ess-fancy-comments nil)
>        (define-key ess-mode-map [return] 'newline)  ; turn off
> "electric" newline
>        (define-key ess-mode-map "_" 'self-insert-command)
>        ))
>
> ;;; SAS variables
> (setq sas-tab-always-indent nil)
> (setq sas-indent-level 4)
> (setq sas-auto-newline nil)
> (setq sas-electric-semi nil)
> (setq sas-undent-end nil)
>
> ; R noweb codes
> (defun Rnw-mode ()
>  (require 'ess-noweb)
>  (noweb-mode)
>  (if (fboundp 'R-mode)
>      (setq noweb-default-code-mode 'R-mode)))
>
> (custom-set-variables
>  '(buffers-menu-grouping-function nil)
>  '(buffers-menu-sort-function nil)
>  '(line-number-mode t))
>
> -----
> The x-keymap.el file binds some function keys to my favorite commands so
> is irrelevant
>
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list