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: Reverting *Locate* buffers. Date: Sun, 25 Jun 2006 22:27:41 -0500 (CDT) Message-ID: <200606260327.k5Q3Rfpd013691@jane.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1151292502 11675 80.91.229.2 (26 Jun 2006 03:28:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Jun 2006 03:28:22 +0000 (UTC) Cc: Peter Breton , emacs-pretesters@gnu.org, "T. V. Raman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 26 05:28:17 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 1Fuhlo-0005jk-Fy for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2006 05:28:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fuhln-0000c4-UQ for ged-emacs-devel@m.gmane.org; Sun, 25 Jun 2006 23:28:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fuhlb-0000ao-Hy for emacs-devel@gnu.org; Sun, 25 Jun 2006 23:28:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fuhla-0000aH-QL for emacs-devel@gnu.org; Sun, 25 Jun 2006 23:28:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fuhla-0000aD-Mx for emacs-devel@gnu.org; Sun, 25 Jun 2006 23:28:02 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FuhxI-000330-OK; Sun, 25 Jun 2006 23:40:08 -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 k5Q3RjKT010940; Sun, 25 Jun 2006 22:27:45 -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 k5Q3Rfbs013694; Sun, 25 Jun 2006 22:27:41 -0500 (CDT) Original-Received: (from teirllm@localhost) by jane.dms.auburn.edu (8.13.4+Sun/8.13.3/Submit) id k5Q3Rfpd013691; Sun, 25 Jun 2006 22:27:41 -0500 (CDT) X-Authentication-Warning: jane.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org 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:56181 Archived-At: There have been in the past several complaints about the fact that trying to revert a *Locate* buffers first asks whether you want to update the locate database. If you answer yes, then in my setup and I would guess in most setups, you get an error unless you are running as root, because you need to be root to update the locate database. As a result, the buffer does not get reverted. If you answer no, the *Locate* buffer does not get reverted either, whereas you might just have wanted to revert to undo manual changes to the buffer and whereas the locate database might have been updated by cron, or by the user, in the meantime anyway. A few days ago, I got a request to make this behavior customizable, which was CC-ed to emacs-pretesters instead of the more appropriate emacs-devel. The patch below introduces an option allowing the user to avoid the question. The default remains to ask the question. But, even for the default behavior there is a change: if the user answers no, the buffer gets reverted without updating the database. If there are no objections, I will install the patch below: ===File ~/locate-diff======================================= *** locate.el 15 Mar 2006 19:31:47 -0600 1.36 --- locate.el 25 Jun 2006 20:49:16 -0500 *************** *** 191,196 **** --- 191,204 ---- :group 'locate :version "22.1") + (defcustom locate-update-when-revert t + "This option affects how the *Locate* buffer gets reverted. + If non-nil, offer to update the locate database when reverting that buffer. + 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, --- 565,578 ---- ;; 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, ============================================================