From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Reverting *Locate* buffers. Date: Mon, 26 Jun 2006 20:55:24 -0500 (CDT) Message-ID: <200606270155.k5R1tOlo019173@jane.dms.auburn.edu> References: <20060626131546.93100.qmail@web55513.mail.re4.yahoo.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1151373364 16784 80.91.229.2 (27 Jun 2006 01:56:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Jun 2006 01:56:04 +0000 (UTC) Cc: pbreton@cs.umb.edu, emacs-pretesters@gnu.org, raman@users.sourceforge.net, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 27 03:56:01 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fv2nw-0006wl-Ez for ged-emacs-devel@m.gmane.org; Tue, 27 Jun 2006 03:55:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fv2nv-0005lX-Fu for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2006 21:55:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fv2nk-0005lS-I9 for emacs-devel@gnu.org; Mon, 26 Jun 2006 21:55:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fv2nj-0005lG-1x for emacs-devel@gnu.org; Mon, 26 Jun 2006 21:55:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fv2ni-0005lD-Sa for emacs-devel@gnu.org; Mon, 26 Jun 2006 21:55:38 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fv2zh-0006jW-Kv; Mon, 26 Jun 2006 22:08:01 -0400 Original-Received: from jane.dms.auburn.edu (jane.dms.auburn.edu [131.204.53.201]) by manatee.dms.auburn.edu (8.13.6/8.13.6) with ESMTP id k5R1tThS013926; Mon, 26 Jun 2006 20:55:29 -0500 (CDT) Original-Received: from jane.dms.auburn.edu (localhost [127.0.0.1]) by jane.dms.auburn.edu (8.13.4+Sun/8.13.4) with ESMTP id k5R1tOqq019176; Mon, 26 Jun 2006 20:55:24 -0500 (CDT) Original-Received: (from teirllm@localhost) by jane.dms.auburn.edu (8.13.4+Sun/8.13.3/Submit) id k5R1tOlo019173; Mon, 26 Jun 2006 20:55:24 -0500 (CDT) X-Authentication-Warning: jane.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: peter_breton@yahoo.com In-reply-to: <20060626131546.93100.qmail@web55513.mail.re4.yahoo.com> (message from Peter Breton on Mon, 26 Jun 2006 06:15:46 -0700 (PDT)) 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:56207 Archived-At: Peter Breton wrote: I've never actually used the revert feature.. someone else sent me in a patch for it, and it seemed harmless enough so I added it. I find the idea of reverting the buffer by rebuilding the database to be a bit odd; I would just rerun the search, and have an additional function to rebuild the database. However, if people are happy with the existing feature, then it still seems harmless to me :) What about just setting the standard value of `locate-update-when-revert' to nil? Then the default behavior will make sense for most people and people who prefer the old behavior just have to customize an option to get it back. Having an additional warning when not running as root also sounds like a good idea. The problem is that there is not that much space in the minibuffer. But the docstring of `locate-update-when-revert' can mention the problem. Since one would need need to explicitly set this non-nil to get asked the question, presumably people will read the docstring before doing so. The following patches and NEWS entry implement this. I can install if we all agree on this. ===File ~/NEWS-diff========================================= *** NEWS 25 Jun 2006 09:51:35 -0500 1.1367 --- NEWS 26 Jun 2006 20:32:40 -0500 *************** *** 3494,3499 **** --- 3494,3508 ---- (defun PP (data) (insert (format "%S\n" data))) (ewoc-create 'PP "start\n\n" "\n" t) + ** Locate changes + + --- + *** By default, reverting the *Locate* buffer now just runs the last + `locate' command back over again without offering to update the locate + database (which normally only works if you have root privileges). If + you prefer the old behavior, set the new customizable option + `locate-update-when-revert' to t. + * Changes in Emacs 22.1 on non-free operating systems ============================================================ ===File ~/locate-diff======================================= *** locate.el 15 Mar 2006 19:31:47 -0600 1.36 --- locate.el 26 Jun 2006 20:11:34 -0500 *************** *** 191,196 **** --- 191,205 ---- :group 'locate :version "22.1") + (defcustom locate-update-when-revert nil + "This option affects how the *Locate* buffer gets reverted. + If non-nil, offer to update the locate database when reverting that buffer. + \(Normally, you need to have root privileges for this to work.) + If nil, reverting does not update the locate database." + :type 'boolean + :group 'locate + :version "22.1") + (defcustom locate-update-command "updatedb" "The executable program used to update the locate database." :type 'string *************** *** 557,568 **** ;; From Stephen Eglen (defun locate-update (ignore1 ignore2) ! "Update the locate database. ! Database is updated using the shell command in `locate-update-command'." (let ((str (car locate-history-list))) ! (cond ((yes-or-no-p "Update locate database (may take a few seconds)? ") ! (shell-command locate-update-command) ! (locate str))))) ;;; Modified three functions from `dired.el': ;;; dired-find-directory, --- 566,579 ---- ;; From Stephen Eglen (defun locate-update (ignore1 ignore2) ! "Revert the *Locate* buffer. ! If `locate-update-when-revert' is non-nil, offer to update the ! locate database using the shell command in `locate-update-command'." (let ((str (car locate-history-list))) ! (and locate-update-when-revert ! (yes-or-no-p "Update locate database (may take a few seconds)? ") ! (shell-command locate-update-command)) ! (locate str))) ;;; Modified three functions from `dired.el': ;;; dired-find-directory, ============================================================