From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: Re: Interactive specs of C functions. Date: Sun, 09 Sep 2007 22:46:22 +0200 Organization: Epita/LRDE Message-ID: <87fy1nr2ht.fsf@cadilhac.name> References: <87sl5qr093.fsf@cadilhac.name> <87ps0tttkt.fsf@cadilhac.name> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1620937683==" X-Trace: sea.gmane.org 1189374703 14752 80.91.229.12 (9 Sep 2007 21:51:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2007 21:51:43 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 10 07:51:30 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IUbCx-0005Br-DF for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2007 06:49:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUTia-0004fz-S5 for ged-emacs-devel@m.gmane.org; Sun, 09 Sep 2007 16:49:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IUTiV-0004cl-G1 for emacs-devel@gnu.org; Sun, 09 Sep 2007 16:49:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IUTiT-0004Zj-M3 for emacs-devel@gnu.org; Sun, 09 Sep 2007 16:49:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUTiT-0004ZY-G5 for emacs-devel@gnu.org; Sun, 09 Sep 2007 16:49:13 -0400 Original-Received: from smtp3-g19.free.fr ([212.27.42.29]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IUTiO-000116-UU; Sun, 09 Sep 2007 16:49:09 -0400 Original-Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 3900E59FE1; Sun, 9 Sep 2007 22:49:08 +0200 (CEST) Original-Received: from localhost (ivr94-6-82-230-255-91.fbx.proxad.net [82.230.255.91]) by smtp3-g19.free.fr (Postfix) with ESMTP id 9B83C58C3E; Sun, 9 Sep 2007 22:49:07 +0200 (CEST) X-Website: http://michael.cadilhac.name Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAYFBMVEUWCwUyFQk6JBNLGglQK BVRMiRkHQtwMBZuOCRyRi1iQiZyUUCFNxuIPCKRTC2mVTSpZTqVVS2SW0OYZkixb0qraE/KeU7EcT +4h2bPhVfQkm7hlnDkvZjYqIjrwJnzwqB5+4wZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAACXZwQWc AAAAwAAAAMADO7oxXAAADvUlEQVRIx32Wi5ajIAyGRcCAchErVqu27/+W+wfbs724i3Mcz5n/S0JI wlTbyXrs+zrFEL1zPuIdY7xO6+PBf6u27f4DrFPO3jvoQYRYFoj9CXyu+7ZPEWrXUNM0zpEfgjuY9 RTY1hyg5qUNgMb44Dwiiz5OZ8DCwVCjpdLaGNOVtw+M+Lz+AlNwRAhGSamh1abrtFKmG0DkmL8BhE +GdCNlreChBaO7DpjpIvbv/fr4AnqErhoYF6KI4aPrLIeFQLGj6RO4JWLjtdZ1WQXhvegGG0EKyO/ vwH7xJBk4tLrW5UPxN3zAufHDO3Axh4MCMPLisKQyRuJo/Btw60gpWcu6OogjsmIeiRIKgUlj3oCp a1QtRP1ywT9VfXCiZMEg4X+BfYADAHhhdc+NV1UBBT9SIedvgFFwDFslkO7S8e+KtQcohJCyefdgt DoC4pe+FB8VL3bDeiGB/AVurZJCvY5AtdaSKpYLJArxCXCOlMUpiRpF0Sbb8nZYBnGBPoGZuOCGAd lTqgXRlrrDuUgpDh+VNPYN0IRALnkIFsVTiBanbBQbesYl1Num584iojnnHIPVJRSJvFnrrFHPmD6 yBKJVbZ+nKScjIVfatlSaJ9BBiIbcW1rnOSF4F/OYGiFLQaCXyAUsLTggnAN9VOuMaBtuX1QmHwok RD4CIHzXChG5z37oWkRhxx5tCmdKNUSp7/tUYlQwQ/6z424JPtr+mlwwwbbGQj5CXwBjyPj4NQRmJ J7GZez7mPpk02W+jvgMnFrUaozhE7jPF9va+QZinMaxn0dGMSy5ExuHmdZ8APf7felTv9zGccGal3 le2JdHt0lJaGklvjwA6JcVACwXpugd+gAJQvuIL2C7r9eJgQscXQH0I+sxkrBjjE0ukW9gui7rMo9 DAoGnTzyZceA8lYh+AMxWeFiu/ZhSLCeAUex4hhPr6XsPPAqu0xRxNVAaS0J58pODvhCN/AFWziLP rMtYjsxD6y0dDpDeH2Cf+sxEyPmSYuIJbOi1zCmQc/DkbQg2FQ/O2RfgDP0Aj8eU+VpDmlpLvBkqe kTJpe5+r6xtz9A7VnCxlthfAJkz4JGRJfzVcEiHHK36BOgE2PYRPpIna0K5wAzGCLcWN6A6A3CRRu SJWo+NoybQfag9TA/CxymwTdnDWkh4cPOweckTRCkhzgH8K+ChxkKG2L4oQBlPp8B2G/sc02CDKTp xXExlOJ3q79vcpyGYlmelFOXRxyj/hwe+XnBhw6osY17wJfB/IB/3o2a14Hl8jNfqDx44iLN4w0aG AAAAAElFTkSuQmCC In-Reply-To: (Richard Stallman's message of "Sat, 08 Sep 2007 22:13:04 -0400") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:78352 Archived-At: --===============1620937683== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Richard Stallman writes: > Your change in callint.c is the right idea. How about writing > documentation and then installing it in the trunk? I made the doc change in lisp.h, and renamed the `prompt' field of the Lisp_Subr struct to `intspec' (interactive spec): --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=callint.patch Content-Transfer-Encoding: quoted-printable Index: lisp.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/lisp.h,v retrieving revision 1.583 diff -c -r1.583 lisp.h *** lisp.h 29 Aug 2007 21:50:08 -0000 1.583 =2D-- lisp.h 9 Sep 2007 20:37:51 -0000 *************** *** 891,897 **** Lisp_Object (*function) (); short min_args, max_args; char *symbol_name; ! char *prompt; char *doc; }; =20=20 =2D-- 891,897 ---- Lisp_Object (*function) (); short min_args, max_args; char *symbol_name; ! char *intspec; char *doc; }; =20=20 *************** *** 1669,1698 **** followed by the address of a vector of Lisp_Objects which contains the argument values. UNEVALLED means pass the list of unevaluated arguments ! `prompt' says how to read arguments for an interactive call. ! See the doc string for `interactive'. A null string means call interactively with no arguments. `doc' is documentation for the user. */ =20=20 #if (!defined (__STDC__) && !defined (PROTOTYPES)) \ || defined (USE_NONANSI_DEFUN) =20=20 ! #define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \ Lisp_Object fnname (); \ DECL_ALIGN (struct Lisp_Subr, sname) =3D \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ ! fnname, minargs, maxargs, lname, prompt, 0}; \ Lisp_Object fnname =20=20 #else =20=20 /* This version of DEFUN declares a function prototype with the right arguments, so we can catch errors with maxargs at compile-time. */ ! #define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ DECL_ALIGN (struct Lisp_Subr, sname) =3D \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ ! fnname, minargs, maxargs, lname, prompt, 0}; \ Lisp_Object fnname =20=20 /* Note that the weird token-substitution semantics of ANSI C makes =2D-- 1669,1701 ---- followed by the address of a vector of Lisp_Objects which contains the argument values. UNEVALLED means pass the list of unevaluated arguments ! `intspec' says how interactive arguments are to be fetched. ! If the string starts with a `(', `intspec' is evaluated and the resul= ting ! list is the list of arguments. ! If it's a string that doesn't start with `(', the value should follow ! the one of the doc string for `interactive'. A null string means call interactively with no arguments. `doc' is documentation for the user. */ =20=20 #if (!defined (__STDC__) && !defined (PROTOTYPES)) \ || defined (USE_NONANSI_DEFUN) =20=20 ! #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname (); \ DECL_ALIGN (struct Lisp_Subr, sname) =3D \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ ! fnname, minargs, maxargs, lname, intspec, 0}; \ Lisp_Object fnname =20=20 #else =20=20 /* This version of DEFUN declares a function prototype with the right arguments, so we can catch errors with maxargs at compile-time. */ ! #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ DECL_ALIGN (struct Lisp_Subr, sname) =3D \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ ! fnname, minargs, maxargs, lname, intspec, 0}; \ Lisp_Object fnname =20=20 /* Note that the weird token-substitution semantics of ANSI C makes Index: callint.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/callint.c,v retrieving revision 1.154 diff -c -r1.154 callint.c *** callint.c 29 Aug 2007 05:27:56 -0000 1.154 =2D-- callint.c 9 Sep 2007 20:37:52 -0000 *************** *** 334,345 **** =20=20 if (SUBRP (fun)) { ! string =3D (unsigned char *) XSUBR (fun)->prompt; if (!string) { lose: wrong_type_argument (Qcommandp, function); } } else if (COMPILEDP (fun)) { =2D-- 334,353 ---- =20=20 if (SUBRP (fun)) { ! string =3D (unsigned char *) XSUBR (fun)->intspec; if (!string) { lose: wrong_type_argument (Qcommandp, function); } + /* The function has an interactive spec to evaluate. */ + if (*string =3D=3D '(') + { + specs =3D + Fcar (Fread_from_string (make_string (string, strlen (string)), + Qnil, Qnil)); + string =3D 0; + } } else if (COMPILEDP (fun)) { Index: data.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/data.c,v retrieving revision 1.277 diff -c -r1.277 data.c *** data.c 29 Aug 2007 05:27:58 -0000 1.277 =2D-- data.c 9 Sep 2007 20:37:53 -0000 *************** *** 770,777 **** =20=20 if (SUBRP (fun)) { ! if (XSUBR (fun)->prompt) ! return list2 (Qinteractive, build_string (XSUBR (fun)->prompt)); } else if (COMPILEDP (fun)) { =2D-- 770,777 ---- =20=20 if (SUBRP (fun)) { ! if (XSUBR (fun)->intspec) ! return list2 (Qinteractive, build_string (XSUBR (fun)->intspec)); } else if (COMPILEDP (fun)) { Index: eval.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/eval.c,v retrieving revision 1.287 diff -c -r1.287 eval.c *** eval.c 29 Aug 2007 05:27:57 -0000 1.287 =2D-- eval.c 9 Sep 2007 20:37:54 -0000 *************** *** 2078,2084 **** /* Emacs primitives are interactive if their DEFUN specifies an interactive spec. */ if (SUBRP (fun)) ! return XSUBR (fun)->prompt ? Qt : if_prop; =20=20 /* Bytecode objects are interactive if they are long enough to have an element whose index is COMPILED_INTERACTIVE, which is =2D-- 2078,2084 ---- /* Emacs primitives are interactive if their DEFUN specifies an interactive spec. */ if (SUBRP (fun)) ! return XSUBR (fun)->intspec ? Qt : if_prop; =20=20 /* Bytecode objects are interactive if they are long enough to have an element whose index is COMPILED_INTERACTIVE, which is --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable > As for Fset_file_modes, if we want to make it interactive it really > should handle chmod-style args to specify the modes, not just numbers. I revamped the code I first proposed (which was my very first proposal to Emacs!=A0:-)), here are the changes to files.el and fileio.c=A0: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=chmod.patch Content-Transfer-Encoding: quoted-printable Index: lisp/files.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/files.el,v retrieving revision 1.927 diff -c -B -w -r1.927 files.el *** lisp/files.el 31 Aug 2007 13:29:34 -0000 1.927 =2D-- lisp/files.el 9 Sep 2007 20:42:43 -0000 *************** *** 5407,5412 **** =2D-- 5407,5503 ---- (t (apply operation arguments))))) =20=20 + + ;; Symbolic modes and read-file-modes. +=20 + (defun char-to-who (char) + "Convert CHAR to a who-mask from a symbolic mode notation. + CHAR is in [ugoa] and represents the users on which rights are applied." + (cond ((=3D char ?u) #o4700) + ((=3D char ?g) #o2070) + ((=3D char ?o) #o1007) + ((=3D char ?a) #o7777) + (t (error "%c: bad `who' character" char)))) +=20 + (defun char-to-right (char &optional from) + "Convert CHAR to a right-mask from a symbolic mode notation. + CHAR is in [rwxXstugo] and represents a right. + If CHAR is in [Xugo], the value is extracted from FROM (or 0 if nil)." + (or from (setq from 0)) + (cond ((=3D char ?r) #o0444) + ((=3D char ?w) #o0222) + ((=3D char ?x) #o0111) + ((=3D char ?s) #o1000) + ((=3D char ?t) #o6000) + ;; Rights relative to the previous file modes. + ((=3D char ?X) (if (=3D (logand from #o111) 0) 0 #o0111)) + ((=3D char ?u) (let ((uright (logand #o4700 from))) + (+ uright (/ uright #o10) (/ uright #o100)))) + ((=3D char ?g) (let ((gright (logand #o2070 from))) + (+ gright (/ gright #o10) (* gright #o10)))) + ((=3D char ?o) (let ((oright (logand #o1007 from))) + (+ oright (* oright #o10) (* oright #o100)))) + (t (error "%c: bad right character" char)))) +=20 + (defun right-string-to-number (rights who-mask &optional from) + "Convert a right string to a right-mask from a symbolic modes notation. + RIGHTS is the right string, it should match \"([+=3D-][rwxXstugo]+)+\". + WHO-MASK is the mask number of the users on which the rights are to be ap= plied. + FROM (or 0 if nil) is the orginal modes of the file to be chmod'ed." + (let* ((num-rights (or from 0)) + (list-rights (string-to-list rights)) + (op (pop list-rights))) + (while (memq op '(?+ ?- ?=3D)) + (let ((num-right 0) + char-right) + (while (memq (setq char-right (pop list-rights)) + '(?r ?w ?x ?X ?s ?t ?u ?g ?o)) + (setq num-right + (logior num-right (char-to-right char-right num-rights)))) + (setq num-right (logand who-mask num-right) + num-rights + (cond ((=3D op ?+) (logior num-rights num-right)) + ((=3D op ?-) (logand num-rights (lognot num-right))) + (t (logior (logand num-rights (lognot who-mask)) num-right))) + op char-right))) + num-rights)) +=20 + (defun symbolic-file-modes-to-number (modes &optional from) + "Convert symbolic file modes to numeric file modes. + MODES is the string to convert, it should match + \"[ugoa]*([+-=3D][rwxXstugo]+)+,...\". + See (info \"(coreutils)File permissions\") for more information on this + notation. + FROM (or 0 if nil) is the orginal modes of the file to be chmod'ed." + (save-match-data + (let ((case-fold-search nil) + (num-modes (or from 0))) + (while (/=3D (string-to-char modes) 0) + (if (string-match "^\\([ugoa]*\\)\\([+=3D-][rwxXstugo]+\\)+\\(,\\|\\)" m= odes) + (let ((num-who (apply 'logior 0 + (mapcar 'char-to-who (match-string 1 modes))))) + (when (=3D num-who 0) + (setq num-who (default-file-modes))) + (setq num-modes + (right-string-to-number (substring modes (match-end 1)) + num-who num-modes) + modes (substring modes (match-end 3)))) + (error "Parse error in modes near %s" (substring modes 0)))) + num-modes))) +=20 + (defun read-file-modes (&optional prompt orig-file) + "Read file modes in octal or symbolic notation. + PROMPT is used as the prompt, default to `File modes (octal or symbolic):= '. + ORIG-FILE is the original file of which modes will be change." + (let* ((modes (or (if orig-file (file-modes orig-file) 0) + (error "File not found"))) + (value (read-string (or prompt "File modes (octal or symbolic): ")))) + (save-match-data + (if (string-match "^[0-7]+" value) + (string-to-number value 8) + (symbolic-file-modes-to-number value modes))))) +=20 + (define-key ctl-x-map "\C-f" 'find-file) (define-key ctl-x-map "\C-r" 'find-file-read-only) (define-key ctl-x-map "\C-v" 'find-alternate-file) Index: src/fileio.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/fileio.c,v retrieving revision 1.590 diff -c -B -w -r1.590 fileio.c *** src/fileio.c 29 Aug 2007 05:27:58 -0000 1.590 =2D-- src/fileio.c 9 Sep 2007 20:42:46 -0000 *************** *** 3435,3441 **** return make_number (st.st_mode & 07777); } =20=20 ! 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) =2D-- 3435,3443 ---- return make_number (st.st_mode & 07777); } =20=20 ! DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, ! "(let ((file (read-file-name \"File: \"))) \ ! (list file (read-file-modes nil file)))", doc: /* Set mode bits of file named FILENAME to MODE (an integer). Only the 12 low bits of MODE are used. */) (filename, mode) --=-=-= And why not change dired-do-chmod to use set-file-modes together with the symbolic mode parsing functions? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=dired.patch Content-Transfer-Encoding: quoted-printable Index: lisp/dired-aux.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/dired-aux.el,v retrieving revision 1.154 diff -c -r1.154 dired-aux.el *** lisp/dired-aux.el 13 Aug 2007 13:41:07 -0000 1.154 =2D-- lisp/dired-aux.el 9 Sep 2007 20:23:25 -0000 *************** *** 253,261 **** ;;;###autoload (defun dired-do-chmod (&optional arg) "Change the mode of the marked (or next ARG) files. ! This calls chmod, thus symbolic modes like `g+w' are allowed." (interactive "P") ! (dired-do-chxxx "Mode" dired-chmod-program 'chmod arg)) =20=20 ;;;###autoload (defun dired-do-chgrp (&optional arg) =2D-- 253,272 ---- ;;;###autoload (defun dired-do-chmod (&optional arg) "Change the mode of the marked (or next ARG) files. ! Symbolic modes like `g+w' are allowed." (interactive "P") ! (let* ((files (dired-get-marked-files t arg)) ! (modes (dired-mark-read-string ! "Change mode of %s to: " nil ! 'chmod arg files)) ! (num-modes (if (string-match "^[0-7]+" modes) ! (string-to-number modes 8)))) ! (dolist (file files) ! (set-file-modes ! file ! (if num-modes num-modes ! (symbolic-file-modes-to-number modes (file-modes file))))) ! (dired-do-redisplay arg))) =20=20 ;;;###autoload (defun dired-do-chgrp (&optional arg) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable =2D-=20 | Micha=EBl `Micha' Cadilhac | An error can become exact = | | http://michael.cadilhac.name | as the one who committed it = | | JID/MSN: | made a mistake or not. = | `---- michael.cadilhac@gmail.com | -- Pierre Dac - = --' --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.2 (GNU/Linux) iD8DBQFG5FuhUJhDmOfFA3URAq10AJoDCszqvaIflTmdvscziwUZhcUfywCg240E NhjzZ8sj0ktvuWm6lsM10VU= =D6ws -----END PGP SIGNATURE----- --==-=-=-- --===============1620937683== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1620937683==--