From: michael@cadilhac.name (Michaël Cadilhac)
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Interactive specs of C functions.
Date: Sat, 08 Sep 2007 11:06:10 +0200 [thread overview]
Message-ID: <87ps0tttkt.fsf@cadilhac.name> (raw)
In-Reply-To: <E1ITuJU-0003Fo-H7@fencepost.gnu.org> (Richard Stallman's message of "Sat, 08 Sep 2007 03:01:04 -0400")
[-- Attachment #1.1.1: Type: text/plain, Size: 261 bytes --]
Richard Stallman <rms@gnu.org> writes:
> An idea that occurs to me: if the interactive string of a subr starts
> with `(', read it to get a sexp and then eval that sexp.
This would be cool indeed! Something like that? (fileio.c is changed
for the example)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: c-interactive.patch --]
[-- Type: text/x-patch, Size: 1669 bytes --]
? keyboard.c.M-o
Index: callint.c
===================================================================
RCS file: /sources/emacs/emacs/src/callint.c,v
retrieving revision 1.153
diff -c -B -w -r1.153 callint.c
*** callint.c 26 Jul 2007 05:27:48 -0000 1.153
--- callint.c 8 Sep 2007 09:05:34 -0000
***************
*** 340,345 ****
--- 340,353 ----
lose:
wrong_type_argument (Qcommandp, function);
}
+ /* The function has an interactive spec to evaluate. */
+ if (*string == '(')
+ {
+ specs =
+ Fcar (Fread_from_string (make_string (string, strlen (string)),
+ Qnil, Qnil));
+ string = 0;
+ }
}
else if (COMPILEDP (fun))
{
Index: fileio.c
===================================================================
RCS file: /sources/emacs/emacs/src/fileio.c,v
retrieving revision 1.588
diff -c -B -w -r1.588 fileio.c
*** fileio.c 13 Aug 2007 13:41:17 -0000 1.588
--- fileio.c 8 Sep 2007 09:05:36 -0000
***************
*** 3433,3439 ****
return make_number (st.st_mode & 07777);
}
! DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, 0,
doc: /* Set mode bits of file named FILENAME to MODE (an integer).
Only the 12 low bits of MODE are used. */)
(filename, mode)
--- 3433,3441 ----
return make_number (st.st_mode & 07777);
}
! DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2,
! "(list (read-file-name \"File: \") \
! (read-number \"Modes: \"))",
doc: /* Set mode bits of file named FILENAME to MODE (an integer).
Only the 12 low bits of MODE are used. */)
(filename, mode)
[-- Attachment #1.1.3: Type: text/plain, Size: 327 bytes --]
--
| Michaël `Micha' Cadilhac | I cannot reproduce this bug, |
| http://michael.cadilhac.name | but I have installed a change |
| JID/MSN: | which I think will fix it. |
`---- michael.cadilhac@gmail.com | -- Kim F. Storm - --'
[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2007-09-08 9:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-07 14:58 Interactive specs of C functions Michaël Cadilhac
2007-09-07 18:01 ` Stefan Monnier
2007-09-07 21:52 ` Johan Bockgård
2007-09-08 2:18 ` Stefan Monnier
2007-09-08 19:48 ` Richard Stallman
2007-09-09 20:45 ` Stefan Monnier
2007-09-10 1:13 ` Richard Stallman
2007-09-10 2:29 ` Stefan Monnier
2007-09-12 23:59 ` Johan Bockgård
2007-09-08 7:01 ` Richard Stallman
2007-09-08 9:06 ` Michaël Cadilhac [this message]
[not found] ` <E1IUCIK-0008Ck-2z@fencepost.gnu.org>
2007-09-09 20:46 ` Michaël Cadilhac
2007-09-09 21:19 ` Stefan Monnier
2007-09-09 22:34 ` Michaël Cadilhac
2007-09-10 1:13 ` Richard Stallman
2007-09-10 11:06 ` Michaël Cadilhac
2007-09-10 14:52 ` Dan Nicolaescu
2007-09-10 15:05 ` Michaël Cadilhac
2007-09-10 15:13 ` Dan Nicolaescu
2007-09-10 15:27 ` Michaël Cadilhac
2007-09-10 15:39 ` Dan Nicolaescu
2007-09-10 15:55 ` Michaël Cadilhac
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=87ps0tttkt.fsf@cadilhac.name \
--to=michael@cadilhac.name \
--cc=emacs-devel@gnu.org \
--cc=rms@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.