[ESS] Problems after Debian update

Vitalie Spinu spinuvit at gmail.com
Sat May 5 00:45:26 CEST 2012


Indeed, the right thing would be to set the secondary prompt to nil as
it's meaningless. As I don't have stata, your help is really, really
appreciated here. Please try

(setq STA-customize-alist
  '((ess-local-customize-alist     . 'STA-customize-alist)
    (ess-language                  . "STA")
    (ess-dialect                   . STA-dialect-name)
    (ess-suffix                    . "ado")
    (ess-mode-editing-alist        . STA-editing-alist)
    (ess-mode-syntax-table         . STA-syntax-table)
    (ess-mode-edit                 . 'STA-mode)
    (ess-help-sec-regex            . ess-help-STA-sec-regex)
    (ess-help-sec-keys-alist       . ess-help-STA-sec-keys-alist)
    (ess-loop-timeout              . 500000 )
    (ess-object-name-db-file       . "ess-sta-namedb.el" )
    (inferior-ess-font-lock-keywords . ess-STA-mode-font-lock-keywords)
    (inferior-ess-program          . inferior-STA-program-name)
    (inferior-ess-objects-command  . "description\n")
    (inferior-ess-help-command     . "set more off\n help %s\n")
    (inferior-ess-exit-command     . "exit\n")
    (inferior-ess-primary-prompt   . ". ")
    (inferior-ess-secondary-prompt . nil) 
    (comint-use-prompt-regexp      . t)
    (inferior-ess-start-file       . nil) 
    (inferior-ess-start-args       . "")) 
)

(defun inferior-ess--goto-input-start:regexp ()
  "Move point to the begining of input skiping all continuation lines.
If in the output field, goes to the begining of previous input.
"
  (beginning-of-line)
  (unless (looking-at inferior-ess-prompt)
    (re-search-backward (concat "^" inferior-ess-prompt)))
  (when inferior-ess-secondary-prompt
    (while (and (looking-at inferior-ess-secondary-prompt)
                (not (eq (point) (point-min))))
      (forward-line -1)))
  (if (looking-at inferior-ess-prompt)
      (comint-skip-prompt)
    (ess-error "Beggining of input not found"))
  )

I hope it solves both problems.

Vitalie.

>>>> brendan.halpin at ul.ie (Brendan Halpin)
>>>> on Fri, 04 May 2012 23:16:21 +0100 wrote:

  > Thanks, that works nicely for the first problem: I can now start Stata. 
  > However, the previous-input problem remains. It seems to be in this
  > function from ess-inf.el:

  > (defun inferior-ess--goto-input-start:regexp ()
  >   "Move point to the begining of input skiping all continuation lines.
  > If in the output field, goes to the begining of previous input.
  > "
  >   (beginning-of-line)
  >   (unless (looking-at inferior-ess-prompt)
  >     (re-search-backward (concat "^" inferior-ess-prompt)))
  >   (while (and (looking-at inferior-ess-secondary-prompt)
  >         (not (eq (point) (point-min))))
  >     (forward-line -1))
  >   (if (looking-at inferior-ess-prompt)
  >       (comint-skip-prompt)
  >     (ess-error "Beggining of input not found"))
  >   )

  > This seems to be looking for the secondary prompt, to backtrack from it
  > to the initial prompt. But it is defined the same as the primary prompt,
  > so if we're looking-at the primary prompt, (looking-at
  > inferior-ess-secondary-prompt) returns t. 

  > In interactive mode, Stata only accepts single lines, so there isn't a
  > secondary prompt. Perhaps this should be defined to nil?

  > Regards,

  > Brendan



More information about the ESS-help mailing list