unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Liu <sdl.web@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 14300@debbugs.gnu.org
Subject: bug#14300: 24.3; comint-dynamic-complete-functions breaks
Date: Tue, 07 May 2013 16:18:15 +0800	[thread overview]
Message-ID: <m1sj1zkxtk.fsf@gmail.com> (raw)
In-Reply-To: <jwvtxmggrss.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 06 May 2013 09:32:59 -0400")

On 2013-05-06 21:32 +0800, Stefan Monnier wrote:
> That's what ":exclusive t" does.  Of course "no match" is tricky to
> define: if you use a fancy completion style that tries really hard to
> find a match (ido-flex style, maybe even with "typo-correction"), then
> only trying the second table when "there's no match" for the first one
> might end up meaning that it never tries the second one.

I got a solution that seems good enough. Do you see any room for
improvement? Thanks.


diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 138c1948..3118f49e 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -741,13 +741,19 @@ (defun inferior-octave-completion-table ()
 
 (defun inferior-octave-completion-at-point ()
   "Return the data to complete the Octave symbol at point."
-  (let* ((end (point))
+  ;; http://debbugs.gnu.org/14300
+  (let* ((filecomp (string-match-p
+                    "/" (or (comint--match-partial-filename) "")))
+         (end (point))
 	 (start
-	  (save-excursion
-	    (skip-syntax-backward "w_" (comint-line-beginning-position))
-            (point))))
-    (when (> end start)
-      (list start end (inferior-octave-completion-table)))))
+	  (unless filecomp
+            (save-excursion
+              (skip-syntax-backward "w_" (comint-line-beginning-position))
+              (point)))))
+    (when (and start (> end start))
+      (list start end (completion-table-in-turn
+                       (inferior-octave-completion-table)
+                       'comint-completion-file-name-table)))))
 
 (define-obsolete-function-alias 'inferior-octave-complete
   'completion-at-point "24.1")





  reply	other threads:[~2013-05-07  8:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29  6:39 bug#14300: 24.3; comint-dynamic-complete-functions breaks Leo Liu
2013-05-04 20:08 ` Stefan Monnier
2013-05-05  1:55   ` Leo Liu
2013-05-05  6:39     ` Stefan Monnier
2013-05-05  7:02       ` Leo Liu
2013-05-06  2:38         ` Stefan Monnier
2013-05-06  3:40           ` Leo Liu
2013-05-06 13:32             ` Stefan Monnier
2013-05-07  8:18               ` Leo Liu [this message]
2013-05-10  1:21                 ` Leo Liu

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m1sj1zkxtk.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=14300@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).