Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port interactive-form #1479

Open
brotzeit opened this issue May 6, 2019 · 4 comments
Open

Port interactive-form #1479

brotzeit opened this issue May 6, 2019 · 4 comments

Comments

@brotzeit
Copy link
Member

brotzeit commented May 6, 2019

DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0,
       doc: /* Return the interactive form of CMD or nil if none.
If CMD is not a command, the return value is nil.
Value, if non-nil, is a list (interactive SPEC).  */)
  (Lisp_Object cmd)
{
  Lisp_Object fun = indirect_function (cmd); /* Check cycles.  */

  if (NILP (fun))
    return Qnil;

  /* Use an `interactive-form' property if present, analogous to the
     function-documentation property.  */
  fun = cmd;
  while (SYMBOLP (fun))
    {
      Lisp_Object tmp = Fget (fun, Qinteractive_form);
      if (!NILP (tmp))
	return tmp;
      else
	fun = Fsymbol_function (fun);
    }

  if (SUBRP (fun))
    {
      const char *spec = XSUBR (fun)->intspec;
      if (spec)
	return list2 (Qinteractive,
		      (*spec != '(') ? build_string (spec) :
		      Fcar (Fread_from_string (build_string (spec), Qnil, Qnil)));
    }
  else if (COMPILEDP (fun))
    {
      if (PVSIZE (fun) > COMPILED_INTERACTIVE)
	return list2 (Qinteractive, AREF (fun, COMPILED_INTERACTIVE));
    }
  else if (AUTOLOADP (fun))
    return Finteractive_form (Fautoload_do_load (fun, cmd, Qnil));
  else if (CONSP (fun))
    {
      Lisp_Object funcar = XCAR (fun);
      if (EQ (funcar, Qclosure))
	return Fassq (Qinteractive, Fcdr (Fcdr (XCDR (fun))));
      else if (EQ (funcar, Qlambda))
	return Fassq (Qinteractive, Fcdr (XCDR (fun)));
    }
  return Qnil;
}
@agraven agraven added this to To do in Porting efforts via automation Jan 23, 2020
@yellowsquid
Copy link

yellowsquid commented Apr 25, 2020

I'll start working on a PR.

Edit: Someone else can claim this one. My attention has shifted away from remacs.

@brotzeit
Copy link
Member Author

brotzeit commented Apr 25, 2020

Thanks! But you should know that we are currently kind of stuck. Hopefully we will start another try some day. However I think there's no chance that we will succeed with this project without the help of the emacs maintainers. Maybe some day.

@shaleh
Copy link
Collaborator

shaleh commented Apr 27, 2020

@brotzeit I disagree strongly. We have had a too much work, not enough hands problem. We are able to make this work on our own. But there needs to be enough of us to carry the load. The master refresh branch is a step in that direction. We can re-examine the current port and compare it to the current Emacs line. There are likely more issues like #1574 waiting for us to discover them.

@yellowsquid https://github.com/remacs/remacs/tree/reset-to-emacs-27 is the branch I am referring to. What we need are people to help us get it compiling again. Initially this is a bunch of boring work wrapping ported C functions with IFDEFs. After that we need to do the examinations I mentioned above so we can get caught up to the top of Emacs 27. If you have time and interest we welcome the help.

If writing the Rust ports is what you want to do, then have fun and do it. Just know that these PRs will likely be left open until we make progress elsewhere.

@brotzeit
Copy link
Member Author

Worth a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants