all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Ludlam <ericludlam@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs Development <emacs-devel@gnu.org>,
	Eric Ludlam <eric@siege-engine.com>
Subject: Re: completion-at-point + semantic : erroneous error
Date: Sun, 27 Oct 2019 18:31:19 -0400	[thread overview]
Message-ID: <52e166a2-1ec3-2674-298c-a39923d70860@gmail.com> (raw)
In-Reply-To: <jwvv9sfjla6.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1802 bytes --]

On 10/23/19 4:18 PM, Stefan Monnier wrote:
>> As a followup, I started using the shorter version of your patch, and found
>> there are additional errors thrown from
>> semantic-analyze-possible-completions-default (what will be a method in
>> your patch).  I had to eliminate those errors to fully clean up the original
>> problem that started this thread.
> [ Sorry for taking so long to get back to it.  ]
>
> After fighting for a while with your patch (it was full of NBSP chars
> and wrapped lines) and then looking at it some more, I decided to
> install the patch below instead which replaces the `catch` with
> a `with-demoted-errors` (and places it in the caller instead).
> Maybe those errors should indeed all be replaced by silently returning
> nil, but the code currently goes through the trouble of building
> more precise error messages, so I felt like maybe we should preserve
> that info.

Hi Stefan,

I pulled down the latest, and ran against a more extensive test suite 
I'm working on.  I found that the new version is always pushing down the 
optional 'flags input to overrides, which makes sense.  Several override 
methods don't accommodate this.  The attached patch adds that optional 
'flags' input to fix the error and allow the make, texi, and grammar 
modes run their specialization.

> Ah, right.  I too have debug-on-error non-nil of course.
> The `error`s should be turned into `user-error`s to avoid this problem.

> Tho of course, if the corresponding messages are not useful, returning
> nil is a better choice, indeed.

user-error sounds like the shortest path here.  The original purpose of 
the error was to provide a fine-grained reason for why something may 
have failed to complete.  I think most completion engines don't care 
about that.

Thanks

Eric




[-- Attachment #2: optflags.patch --]
[-- Type: text/x-patch, Size: 1761 bytes --]

diff --git a/lisp/cedet/semantic/bovine/make.el b/lisp/cedet/semantic/bovine/make.el
index 3676c6972f..01a15b8232 100644
--- a/lisp/cedet/semantic/bovine/make.el
+++ b/lisp/cedet/semantic/bovine/make.el
@@ -175,7 +175,7 @@ semantic-format-tag-uml-prototype
   (semantic-format-tag-prototype tag parent color))
 
 (define-mode-local-override semantic-analyze-possible-completions
-  makefile-mode (context)
+  makefile-mode (context &rest flags)
   "Return a list of possible completions in a Makefile.
 Uses default implementation, and also gets a list of filenames."
   (require 'semantic/analyze/complete)
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 813580ba6c..e1337b3eb9 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -1915,7 +1915,7 @@ semantic-analyze-current-context
       context-return)))
 
 (define-mode-local-override semantic-analyze-possible-completions
-  semantic-grammar-mode (context)
+  semantic-grammar-mode (context &rest flags)
   "Return a list of possible completions based on CONTEXT."
   (require 'semantic/analyze/complete)
   (if (semantic-grammar-in-lisp-p)
diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el
index 73f0e734f3..0fdc9ee8bc 100644
--- a/lisp/cedet/semantic/texi.el
+++ b/lisp/cedet/semantic/texi.el
@@ -413,7 +413,7 @@ semantic-texi-command-completion-list
   "List of commands that we might bother completing.")
 
 (define-mode-local-override semantic-analyze-possible-completions
-  texinfo-mode (context)
+  texinfo-mode (context &rest flags)
   "List smart completions at point.
 Since texinfo is not a programming language the default version is not
 useful.  Instead, look at the current symbol.  If it is a command

  parent reply	other threads:[~2019-10-27 22:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  2:33 completion-at-point + semantic : erroneous error Eric Ludlam
2019-10-11 17:04 ` Stefan Monnier
2019-10-11 17:34   ` Stefan Monnier
2019-10-12  1:06     ` Eric Ludlam
2019-10-24 20:17       ` Stefan Monnier
2019-10-27 12:35         ` Eric Ludlam
2019-10-27 20:38           ` Stefan Monnier
2019-10-27 23:36             ` Eric Ludlam
2019-10-12 11:56     ` Eric Ludlam
2019-10-23 20:18       ` Stefan Monnier
2019-10-27 11:52         ` Eric Ludlam
2019-10-27 21:54           ` Stefan Monnier
2019-10-27 22:31         ` Eric Ludlam [this message]
2019-10-23 20:22       ` Stefan Monnier
2019-10-27 11:53         ` Eric Ludlam

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=52e166a2-1ec3-2674-298c-a39923d70860@gmail.com \
    --to=ericludlam@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=eric@siege-engine.com \
    --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 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.