emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for completion in octave


From: Stefan Monnier
Subject: Re: patch for completion in octave
Date: Tue, 08 Feb 2011 15:39:36 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> The current version of inferior-octave-complete includes in the string
> for completion symbols like `=', e.g., after

>  M-x run-octave

>  x=lins<Tab>

> user gets an error

>  No completions of x=linsp

> Since in octave

>  The name of a variable must be a sequence of letters, digits and
>  underscores,

> the following patch corrects the problem:

> === modified file 'lisp/progmodes/octave-inf.el'
> --- lisp/progmodes/octave-inf.el        2011-01-26 08:36:39 +0000
> +++ lisp/progmodes/octave-inf.el        2011-02-08 12:45:02 +0000
> @@ -267,7 +267,7 @@
>    (let* ((end (point))
>          (command
>           (save-excursion
> -           (skip-syntax-backward "w_" (comint-line-beginning-position))
> +           (skip-chars-backward "a-zA-Z0-9_" 
> (comint-line-beginning-position))
>             (buffer-substring-no-properties (point) end)))
>          (proc (get-buffer-process inferior-octave-buffer)))
>      (cond (inferior-octave-complete-impossible

Thanks for your report.  Before going ahead and installing your patch,
I'd like to make sure I understand the problem: as far as I can tell,
the character = has syntax "." in octave-mode, but for some reason
octave-inf.el does not use octave-mode's syntax-table.

So, could you try the patch below instead for a little while and see if
it fixes your problem (it should) and if it doesn't introduce
other issues?


        Stefan


=== modified file 'lisp/progmodes/octave-inf.el'
--- lisp/progmodes/octave-inf.el        2011-01-26 08:36:39 +0000
+++ lisp/progmodes/octave-inf.el        2011-02-08 20:38:06 +0000
@@ -73,10 +73,7 @@
   "Keymap used in Inferior Octave mode.")
 
 (defvar inferior-octave-mode-syntax-table
-  (let ((table (make-syntax-table)))
-    (modify-syntax-entry ?\` "w" table)
-    (modify-syntax-entry ?\# "<" table)
-    (modify-syntax-entry ?\n ">" table)
+  (let ((table (make-syntax-table octave-mode-syntax-table)))
     table)
   "Syntax table in use in inferior-octave-mode buffers.")
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]