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: Remove `dired-chmod-program'. Date: Sat, 16 Feb 2008 19:50:06 -0500 Organization: Epita/LRDE Message-ID: <87hcg82ypt.fsf@cadilhac.name> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1203209487 14483 80.91.229.12 (17 Feb 2008 00:51:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Feb 2008 00:51:27 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 17 01:51:50 2008 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 1JQXkz-0005oD-Ac for ged-emacs-devel@m.gmane.org; Sun, 17 Feb 2008 01:51:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQXkV-000510-9q for ged-emacs-devel@m.gmane.org; Sat, 16 Feb 2008 19:51:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JQXkQ-00050v-Ik for emacs-devel@gnu.org; Sat, 16 Feb 2008 19:51:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JQXkP-00050j-5T for emacs-devel@gnu.org; Sat, 16 Feb 2008 19:51:14 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQXkO-00050g-VO for emacs-devel@gnu.org; Sat, 16 Feb 2008 19:51:13 -0500 Original-Received: from py-out-1112.google.com ([64.233.166.183]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JQXkO-0007BQ-66 for emacs-devel@gnu.org; Sat, 16 Feb 2008 19:51:12 -0500 Original-Received: by py-out-1112.google.com with SMTP id u52so1343012pyb.1 for ; Sat, 16 Feb 2008 16:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:organization:x-website:face:date:message-id:user-agent:mime-version:content-type:sender; bh=gLW5lCCDjvhFhtwOfu7KQ/JXZf5TxPBJA9/EZWVG100=; b=eElbWyCDW4NfkPUw4EivE+LxyLssZYtbrNXzQR9FUBFCQ9pwZPlPSFBA56nKpBADStQ9h79Wr3JUu6kztbcpSC9K6zfvfCOiyNoOYiBfX25S8U4XB06OOl2NYXUqWQIutND5TCbrYZAhRS+KMb3wZUAHgKl3F42+eEH68/4jbAE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:organization:x-website:face:date:message-id:user-agent:mime-version:content-type:sender; b=kXDb780OxnALkEy4WJw9fkSWY5cC/a3nshTac4S8ixiDkWSgu6eR3smyOPorUJCvAbAqMm/egP8kJq/jFWY4KOfKOLxHBq8rtRXNV06h6oKsMJt84lU29Q3nlxqyhg//CLkFf6c9OGzHMGqUPETL/b+OFmLqgPnR04Shq0/dKIs= Original-Received: by 10.35.92.18 with SMTP id u18mr4863147pyl.38.1203209470904; Sat, 16 Feb 2008 16:51:10 -0800 (PST) Original-Received: from mistral ( [76.67.143.122]) by mx.google.com with ESMTPS id x56sm13894926pyg.36.2008.02.16.16.51.08 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 16 Feb 2008 16:51:09 -0800 (PST) X-Website: http://michael.cadilhac.name Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVWPh+Tai+5r5YKBAEU CQQzGAtiq7gjAAACR0lEQVQ4jW2UzW7lIAyFzVW8BzTZX5DmCZLuU2H2pMXv/ypzbK7aSh2kRCRf /HNsE0q7Sg+RQ7JFKaqtrRNAl5AIIKe6D5DBqgbmUAe5hBI1wIRFAHjeM0RKtZi7XVVEpb0BSNfA IddChChT5DildSLWOWhY5IEItMnncZgFcUAc/5jjwCMsDosRNdfKPDTFEdVBW8C+RebDb4N5Orio RhM1+11IJyx0ng2+LryFHBMPDQDYHrY6IfGuU3ouiXTQNE8LIJDKOWpNxERTFrggQwRPd7USUsTW fJ0XbR3bdj5KgBYy4SACpxDeUYEUAzLmtJ1iIrD2gczPq8Qomjhsh/RjGIgKIO8p7NITjwlx7WID nsnQe5NeuTvoBpi8LX6vLLOh5icjOHqBypgnuSp7M+RE1agbQKHQr5E2z1WObhYW4gMqeGQL7joM jCf2DxSk5ApADSYHfFF4igNfJZL1z0GKP0FN02s4XiDXr7V5P94W6I9v8MfBOQDmfwAaVYt+x8Da v4DJvX8BAdin3Knm5yMZYAO4ABDkDniZLLfi4P40gP1F0TPGZOu0CGwA1lcowxwlGy6A9705mD0V jHCxwVZT/hYdRJVUGZNlx6l7ScQBTluof6Wj6bsPYlvpwoTvXFD9gHPn2TZPF3ntI2ecxVrW5MrV XiCie5EeNa7BlWu/HNSkprDUva163PHxAv5jyGV7gVzyAghSKOTnat85UIYFICXbD2NV9rRiv0BS tKQsg6OHH4A15F1WW+UHKHHa32h6aPnAm3/pUcWp+WYnTQAAAABJRU5ErkJggg== User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:89293 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi list=A0! A while ago, dired-do-chmod has been modified to not use an external chmod program any longer, but directly `set-file-modes'. Some other pieces of code still use the variable `dired-chmod-program', and it maybe a gain of consistency to remove it. Files modified=A0: dired.el, wdired.el, ange-ftp.el. --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=dired-chmod.patch Content-Transfer-Encoding: quoted-printable Index: dired.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.el,v retrieving revision 1.378 diff -c -r1.378 dired.el *** dired.el 8 Jan 2008 20:44:46 -0000 1.378 =2D-- dired.el 17 Feb 2008 00:44:56 -0000 *************** *** 80,88 **** (defvar dired-use-ls-dired (not (not (string-match "gnu" system-configura= tion))) "Non-nil means Dired should use `ls --dired'.") =20=20 =2D (defvar dired-chmod-program "chmod" =2D "Name of chmod command (usually `chmod').") =2D=20 (defvar dired-touch-program "touch" "Name of touch command (usually `touch').") =20=20 =2D-- 80,85 ---- Index: wdired.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/wdired.el,v retrieving revision 1.35 diff -c -r1.35 wdired.el *** wdired.el 17 Feb 2008 00:29:47 -0000 1.35 =2D-- wdired.el 17 Feb 2008 00:44:56 -0000 *************** *** 47,62 **** ;; ;; - To change the target of symbolic links. ;; ! ;; - To change the permission bits of the filenames (in systems with a ! ;; working unix-alike `dired-chmod-program'). See and customize the ! ;; variable `wdired-allow-to-change-permissions'. To change a single ! ;; char (toggling between its two more usual values) you can press ! ;; the space bar over it or left-click the mouse. To set any char to ! ;; an specific value (this includes the SUID, SGID and STI bits) you ! ;; can use the key labeled as the letter you want. Please note that ! ;; permissions of the links cannot be changed in that way, because ! ;; the change would affect to their targets, and this would not be ! ;; WYSIWYG :-). ;; ;; - To mark files for deletion, by deleting their whole filename. =20=20 =2D-- 47,61 ---- ;; ;; - To change the target of symbolic links. ;; ! ;; - To change the permission bits of the filenames. See and customize ! ;; the variable `wdired-allow-to-change-permissions'. To change a ! ;; single char (toggling between its two more usual values) you can ! ;; press the space bar over it or left-click the mouse. To set any ! ;; char to an specific value (this includes the SUID, SGID and STI ! ;; bits) you can use the key labeled as the letter you want. Please ! ;; note that permissions of the links cannot be changed in that way, ! ;; because the change would affect to their targets, and this would ! ;; not be WYSIWYG :-). ;; ;; - To mark files for deletion, by deleting their whole filename. =20=20 *************** *** 160,169 **** If `advanced', the bits are freely editable. You can use `string-rectangle', `query-replace', etc. You can put any value (even newlines), but if you want your changes to be useful, you better put a ! intelligible value. !=20 ! Anyway, the real change of the permissions is done by the external ! program `dired-chmod-program', which must exist." :type '(choice (const :tag "Not allowed" nil) (const :tag "Toggle/set bits" t) (other :tag "Bits freely editable" advanced)) =2D-- 159,165 ---- If `advanced', the bits are freely editable. You can use `string-rectangle', `query-replace', etc. You can put any value (even newlines), but if you want your changes to be useful, you better put a ! intelligible value." :type '(choice (const :tag "Not allowed" nil) (const :tag "Toggle/set bits" t) (other :tag "Bits freely editable" advanced)) *************** *** 726,747 **** ;; Allowed chars for 2000 bit are Ssl in position 6 ;; Allowed chars for 1000 bit are Tt in position 9 (defun wdired-perms-to-number (perms) ! (let ((nperm 0777)) ! (if (=3D (elt perms 1) ?-) (setq nperm (- nperm 400))) ! (if (=3D (elt perms 2) ?-) (setq nperm (- nperm 200))) (let ((p-bit (elt perms 3))) ! (if (memq p-bit '(?- ?S)) (setq nperm (- nperm 100))) ! (if (memq p-bit '(?s ?S)) (setq nperm (+ nperm 4000)))) ! (if (=3D (elt perms 4) ?-) (setq nperm (- nperm 40))) ! (if (=3D (elt perms 5) ?-) (setq nperm (- nperm 20))) (let ((p-bit (elt perms 6))) ! (if (memq p-bit '(?- ?S ?l)) (setq nperm (- nperm 10))) ! (if (memq p-bit '(?s ?S ?l)) (setq nperm (+ nperm 2000)))) ! (if (=3D (elt perms 7) ?-) (setq nperm (- nperm 4))) ! (if (=3D (elt perms 8) ?-) (setq nperm (- nperm 2))) (let ((p-bit (elt perms 9))) (if (memq p-bit '(?- ?T)) (setq nperm (- nperm 1))) ! (if (memq p-bit '(?t ?T)) (setq nperm (+ nperm 1000)))) nperm)) =20=20 ;; Perform the changes in the permissions of the files that have =2D-- 722,743 ---- ;; Allowed chars for 2000 bit are Ssl in position 6 ;; Allowed chars for 1000 bit are Tt in position 9 (defun wdired-perms-to-number (perms) ! (let ((nperm #o777)) ! (if (=3D (elt perms 1) ?-) (setq nperm (- nperm #o400))) ! (if (=3D (elt perms 2) ?-) (setq nperm (- nperm #o200))) (let ((p-bit (elt perms 3))) ! (if (memq p-bit '(?- ?S)) (setq nperm (- nperm #o100))) ! (if (memq p-bit '(?s ?S)) (setq nperm (+ nperm #o4000)))) ! (if (=3D (elt perms 4) ?-) (setq nperm (- nperm #o40))) ! (if (=3D (elt perms 5) ?-) (setq nperm (- nperm #o20))) (let ((p-bit (elt perms 6))) ! (if (memq p-bit '(?- ?S ?l)) (setq nperm (- nperm #o10))) ! (if (memq p-bit '(?s ?S ?l)) (setq nperm (+ nperm #o2000)))) ! (if (=3D (elt perms 7) ?-) (setq nperm (- nperm #o4))) ! (if (=3D (elt perms 8) ?-) (setq nperm (- nperm #o2))) (let ((p-bit (elt perms 9))) (if (memq p-bit '(?- ?T)) (setq nperm (- nperm 1))) ! (if (memq p-bit '(?t ?T)) (setq nperm (+ nperm #o1000)))) nperm)) =20=20 ;; Perform the changes in the permissions of the files that have *************** *** 751,757 **** (errors 0) (prop-wanted (if (eq wdired-allow-to-change-permissions 'advanced) 'old-perm 'perm-changed)) ! filename perms-ori perms-new perm-tmp) (goto-char (next-single-property-change (point-min) prop-wanted nil (point-max))) (while (not (eobp)) =2D-- 747,753 ---- (errors 0) (prop-wanted (if (eq wdired-allow-to-change-permissions 'advanced) 'old-perm 'perm-changed)) ! filename perms-ori perms-new) (goto-char (next-single-property-change (point-min) prop-wanted nil (point-max))) (while (not (eobp)) *************** *** 762,775 **** (setq changes t) (setq filename (wdired-get-filename nil t)) (if (=3D (length perms-new) 10) ! (progn ! (setq perm-tmp ! (int-to-string (wdired-perms-to-number perms-new))) ! (unless (equal 0 (process-file dired-chmod-program ! nil nil nil perm-tmp filename)) ! (setq errors (1+ errors)) ! (dired-log (concat dired-chmod-program " " perm-tmp ! " `" filename "' failed\n\n")))) (setq errors (1+ errors)) (dired-log (concat "Cannot parse permission `" perms-new "' for file `" filename "'\n\n")))) =2D-- 758,773 ---- (setq changes t) (setq filename (wdired-get-filename nil t)) (if (=3D (length perms-new) 10) ! (condition-case exception ! (set-file-modes filename ! (wdired-perms-to-number perms-new)) ! (error ! (setq errors (1+ errors)) ! (dired-log (concat "Changing mode of `" filename "' to " ! perms-new " failed" ! (when (eq (car oops 'file-error)) ! (concat ": " (nth 2 exception))) ! "\n\n")))) (setq errors (1+ errors)) (dired-log (concat "Cannot parse permission `" perms-new "' for file `" filename "'\n\n")))) Index: net/ange-ftp.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/net/ange-ftp.el,v retrieving revision 1.96 diff -c -r1.96 ange-ftp.el *** net/ange-ftp.el 13 Feb 2008 17:27:38 -0000 1.96 =2D-- net/ange-ftp.el 17 Feb 2008 00:44:58 -0000 *************** *** 979,984 **** =2D-- 979,988 ---- :group 'ange-ftp :type '(repeat string)) =20=20 + (defcustom ange-ftp-chmod-program "chmod" + "Name of `chmod' program, usually `chmod'. + This is executed on distant machines.") +=20 (defcustom ange-ftp-nslookup-program nil "*If non-nil, this is a string naming the nslookup program." :group 'ange-ftp *************** *** 4548,4554 **** ;; Can't use ange-ftp-dired-host-type here because the current ;; buffer is *dired-check-process output* (condition-case oops ! (cond ((equal dired-chmod-program program) (ange-ftp-call-chmod arguments)) ;; ((equal "chgrp" program)) ;; ((equal dired-chown-program program)) =2D-- 4552,4558 ---- ;; Can't use ange-ftp-dired-host-type here because the current ;; buffer is *dired-check-process output* (condition-case oops ! (cond ((equal ange-ftp-chmod-program program) (ange-ftp-call-chmod arguments)) ;; ((equal "chgrp" program)) ;; ((equal dired-chown-program program)) *************** *** 4588,4594 **** (or (car result) (call-process remote-shell-program ! nil t nil host dired-chmod-program mode name)))))) rest)) (setq ange-ftp-ls-cache-file nil) ;Stop confusing Dired. 0) =2D-- 4592,4598 ---- (or (car result) (call-process remote-shell-program ! nil t nil host ange-ftp-chmod-program mode name)))))) rest)) (setq ange-ftp-ls-cache-file nil) ;Stop confusing Dired. 0) Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ChangeLog,v retrieving revision 1.12810 diff -c -r1.12810 ChangeLog *** ChangeLog 17 Feb 2008 00:30:06 -0000 1.12810 =2D-- ChangeLog 17 Feb 2008 00:45:09 -0000 *************** *** 1,6 **** =2D-- 1,15 ---- 2008-02-17 Micha=EBl Cadilhac =20=20 + * dired.el (dired-chmod-program): Remove. +=20 * wdired.el (wdired-allow-to-change-permissions): Fix typo. + (wdired-perms-to-number): Return real octal value of modes. + (wdired-do-perm-changes): Use `set-file-modes'. +=20 + * net/ange-ftp.el (ange-ftp-chmod-program): New. Chmod program + used on distant machines. + (ange-ftp-process-file, ange-ftp-call-chmod): Use it instead of + the now defunct `dired-chmod-program'. =20=20 2008-02-16 Juri Linkov =20=20 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Any comment=A0? =2D-=20 | Micha=EBl `Micha' Cadilhac | Le copillage-collage = | | http://michael.cadilhac.name | tue le programmeur. = | | JID/MSN: | -- Dictons LRDE = | `---- michael.cadilhac@gmail.com | - = --' --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.2 (GNU/Linux) iD8DBQFHt4TAUJhDmOfFA3URAu94AKDRk+t92OiOIV8jyGIpNQfHxp2ZgACfVbaL 9DEQ7zAnWSFZQ1WE87JJk1A= =78vK -----END PGP SIGNATURE----- --==-=-=--