emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interactive specs of C functions.


From: Michaël Cadilhac
Subject: Re: Interactive specs of C functions.
Date: Sat, 08 Sep 2007 11:06:10 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

Richard Stallman <address@hidden> 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)

? 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)
-- 
 |   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.        |
 `----  address@hidden  |          -- Kim F. Storm          -  --'

Attachment: pgp_Bbft_AzGJ.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]