all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Alexander Klimov <alserkli@inbox.ru>
Cc: emacs-devel@gnu.org
Subject: Re: patch for completion in octave
Date: Tue, 08 Feb 2011 15:39:36 -0500	[thread overview]
Message-ID: <jwvzkq6xpyd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <TheMailAgent.92635356d5342c@1b5a67e4a859901070b32> (Alexander Klimov's message of "Tue, 8 Feb 2011 14:49:25 +0200")

> 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	other threads:[~2011-02-08 20:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08 12:49 patch for completion in octave Alexander Klimov
2011-02-08 20:39 ` Stefan Monnier [this message]
2011-02-09 14:00   ` Alexander Klimov
2011-04-25 16:32     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvzkq6xpyd.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=alserkli@inbox.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.