From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: Move sha1 to C? Date: Mon, 23 May 2011 21:21:20 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306156904 12608 80.91.229.12 (23 May 2011 13:21:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 May 2011 13:21:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 23 15:21:40 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QOV4l-00029q-LE for ged-emacs-devel@m.gmane.org; Mon, 23 May 2011 15:21:39 +0200 Original-Received: from localhost ([::1]:34874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOV4l-0007nv-4a for ged-emacs-devel@m.gmane.org; Mon, 23 May 2011 09:21:39 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOV4i-0007lh-Hw for emacs-devel@gnu.org; Mon, 23 May 2011 09:21:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOV4e-0002Nw-CC for emacs-devel@gnu.org; Mon, 23 May 2011 09:21:36 -0400 Original-Received: from mail-px0-f171.google.com ([209.85.212.171]:57809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOV4e-0002Ns-7l for emacs-devel@gnu.org; Mon, 23 May 2011 09:21:32 -0400 Original-Received: by pxi7 with SMTP id 7so3830849pxi.30 for ; Mon, 23 May 2011 06:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:message-id :user-agent:mime-version:content-type; bh=tTFF8L48riTr4BmljuVY7wUY4P+40J7MGshfeBpnl+U=; b=xK/kW7fKpWBCYkaai0GaCGuiTarS34DjL/HZXCDSJtbrTsxCMrpBQaQ8LS5Q9VoX51 C+pxwu3IcLlYcZ2GjPP0oTW6oysNnsbO7FmCcC9+fvh77a4g1hxo+hUwkV1Bh1HlQQM+ CR4sNXcp6zlTaRiESAmbF8sd9Zqn3DwaExZGE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type; b=Z6aC7HF/p1I0vn5IRcK3OF2TxGtZiSlrjEAIhSAP8aYVuH0gpKYuOhlB2sa38+DLrr 2UbOTndCN6frQ1xsdhBs152xWN7010KWGPvl4ztEPFNQTHXhBT3pwhkXrA8FQWWjTu3G BXlm0MtxV7JfmHhhUjBt3WMjwl/Fvrwo9tZcI= Original-Received: by 10.68.29.9 with SMTP id f9mr2115974pbh.350.1306156891026; Mon, 23 May 2011 06:21:31 -0700 (PDT) Original-Received: from th041094.ip.tsinghua.edu.cn (th041142.ip.tsinghua.edu.cn [59.66.41.142]) by mx.google.com with ESMTPS id u1sm4338427pbm.41.2011.05.23.06.21.25 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2011 06:21:28 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.7) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.171 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139642 Archived-At: On 2011-05-23 20:04 +0800, Stefan Monnier wrote: >> In the patch attached in last post, feature sha1 is provided so >> (require 'sha1) should not load sha1.el but if people insist in using >> (load "sha1") then the primitive is overwritten. I hope this is OK. > > We can completely remove sha1.el then. I like this. vc-bzr.el uses the variable sha1-program. So I am thinking of moving it to vc.el as shown in the attached patch (full patch in http://paste.pocoo.org/show/393652). BTW, what to do with auto-generated files and files from gnulib when committing? Leo --- lisp/vc/vc-bzr.el 2011-03-12 15:26:33 +0000 +++ lisp/vc/vc-bzr.el 2011-05-23 13:07:11 +0000 @@ -156,12 +156,10 @@ (push (cons (match-string 1) (match-string 2)) settings))) settings)) -(require 'sha1) ;For sha1-program - (defun vc-bzr-sha1 (file) (with-temp-buffer (set-buffer-multibyte nil) - (let ((prog sha1-program) + (let ((prog vc-sha1-program) (args nil) process-file-side-effects) (when (consp prog) === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2011-04-20 23:34:00 +0000 +++ lisp/vc/vc.el 2011-05-23 13:06:39 +0000 @@ -752,6 +752,14 @@ :group 'vc :version "22.1") +(defcustom vc-sha1-program '("sha1sum") + "Name of program to compute SHA1. +It must be a string \(program name\) or list of strings \(name and its args\)." + :type '(repeat string) + :group 'vc) + +(define-obsolete-variable-alias 'sha1-program 'vc-sha1-program "24.1") + ;;;###autoload (defcustom vc-checkout-hook nil "Normal hook (list of functions) run after checking out a file.