From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: grep-program and grep-command Date: Thu, 25 Jan 2007 17:23:39 +0100 Message-ID: <45B8D98B.8020504@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169742256 31307 80.91.229.12 (25 Jan 2007 16:24:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Jan 2007 16:24:16 +0000 (UTC) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 25 17:23:57 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 1HA7OG-00009R-2p for ged-emacs-devel@m.gmane.org; Thu, 25 Jan 2007 17:23:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HA7OF-0003Qn-Fu for ged-emacs-devel@m.gmane.org; Thu, 25 Jan 2007 11:23:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HA7O5-0003Qi-Jm for emacs-devel@gnu.org; Thu, 25 Jan 2007 11:23:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HA7O3-0003QW-3S for emacs-devel@gnu.org; Thu, 25 Jan 2007 11:23:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HA7O2-0003QT-U0 for emacs-devel@gnu.org; Thu, 25 Jan 2007 11:23:42 -0500 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HA7O1-0002i6-JS for emacs-devel@gnu.org; Thu, 25 Jan 2007 11:23:41 -0500 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:63789 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1HA7Nz-0001rc-6b for emacs-devel@gnu.org; Thu, 25 Jan 2007 17:23:39 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 X-Antivirus: avast! (VPS 000706-1, 2007-01-24), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HA7Nz-0001rc-6b. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1HA7Nz-0001rc-6b 99f44b1dd3f6aa993fd247254dc72a5e X-detected-kernel: Linux 2.6? (barebone, rare!) 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:65460 Archived-At: The grep-command is a defcustom, but grep-program is a defvar. grep-command is computed by Emacs if its value is nil. This seems a bit akward to me. It tells the user to customize grep-command if things does not work by default. Would it not be better if they instead set grep-program and let Emacs compute grep-command? But since we want them to use customize we then should make grep-program into a defcustom. I suggest that grep-program is defined something like this (unfinished, and I I have renamed it to grep-program1 just for testing): (defcustom grep-program1 ;; Currently zgrep has trouble. It runs egrep instead of grep, ;; and it doesn't pass along long options right. "grep" ;; (if (equal (condition-case nil ; in case "zgrep" isn't in exec-path ;; (call-process "zgrep" nil nil nil ;; "foo" null-device) ;; (error nil)) ;; 1) ;; "zgrep" ;; "grep") "The default grep program for `grep-command' and `grep-find-command'. This variable's value takes effect when `grep-compute-defaults' is called." :type 'file :set (lambda(sym val) (unless (string= grep-command (car (get 'grep-command 'customized-value))) (setq grep-command nil)) ;; Add similar checks above for other computed values that ;; depends on this variable ... (set-default sym val)) :group 'grep)