From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: next-error refactoring Date: Wed, 15 Sep 2004 14:08:24 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <4nr7p3mmlj.fsf@lifelogs.com> References: <87isf6e7ji.fsf@mail.jurta.org> <87iseg4x5d.fsf@mail.jurta.org> <4npt8oeet9.fsf_-_@lifelogs.com> <4nd64j6u3p.fsf@lifelogs.com> <4n3c5c64mx.fsf@lifelogs.com> <4nhdtnqrek.fsf@lifelogs.com> <4n659yhrby.fsf@lifelogs.com> <4nzn6kc2fg.fsf@lifelogs.com> <87n02kl1in.fsf@mail.jurta.org> <4ny8je80b8.fsf@lifelogs.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1095272881 15399 80.91.229.6 (15 Sep 2004 18:28:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 15 Sep 2004 18:28:01 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 15 20:27:49 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C7eVQ-0008Df-00 for ; Wed, 15 Sep 2004 20:27:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C7eb3-0002M3-VY for ged-emacs-devel@m.gmane.org; Wed, 15 Sep 2004 14:33:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C7eaw-0002Lj-MV for emacs-devel@gnu.org; Wed, 15 Sep 2004 14:33:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C7eav-0002LJ-F3 for emacs-devel@gnu.org; Wed, 15 Sep 2004 14:33:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C7eav-0002L9-CI for emacs-devel@gnu.org; Wed, 15 Sep 2004 14:33:29 -0400 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C7eV5-0001um-VS for emacs-devel@gnu.org; Wed, 15 Sep 2004 14:27:28 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1C7eV5-00061B-00 for ; Wed, 15 Sep 2004 20:27:27 +0200 Original-Received: from asimov.bwh.harvard.edu ([134.174.9.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Sep 2004 20:27:27 +0200 Original-Received: from tzz by asimov.bwh.harvard.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Sep 2004 20:27:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 87 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: asimov.bwh.harvard.edu X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:7N3QzZeG5vVfbTgCPFFRl60ODYM= 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27145 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27145 --=-=-= On Tue, 14 Sep 2004, storm@cua.dk wrote: > I think dired-use-next-error would be a better name. > > First line of doc string should be on one line. Here's the corrected version of the patch. Thank you for the help. In case anyone is wondering, this is generally useful for visiting the next/previous file listed in dired (only next works now). Ted --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=dired-next-error.patch *** /usr/src/emacs/lisp/dired.el Wed Jul 14 18:59:08 2004 --- /home/tzz/emacs/mine/dired.el Wed Sep 15 14:13:25 2004 *************** *** 215,220 **** --- 215,228 ---- :type '(alist :key-type regexp :value-type string) :version "21.4") + ;; should we use next-error support? + (defcustom dired-use-next-error nil + "Non-nil means to enable `next-error' in dired buffers. + You can then use \\[next-error] to visit the matches + found by `grep-find-dired', `dired-do-search', etc." + :group 'dired + :type 'boolean) + ;; Internal variables (defvar dired-marker-char ?* ; the answer is 42 *************** *** 1397,1402 **** --- 1405,1412 ---- selective-display t ; for subdirectory hiding mode-line-buffer-identification (propertized-buffer-identification "%17b")) + (when dired-next-error-support + (setq next-error-function 'dired-next-error)) (set (make-local-variable 'revert-buffer-function) (function dired-revert)) (set (make-local-variable 'buffer-stale-function) *************** *** 1450,1455 **** --- 1460,1491 ---- (message "Change in Dired buffer undone. Actual changes in files cannot be undone by Emacs.")) + (defun dired-next-error (&optional argp reset) + "Move to the ARGP (default 1) next match in an Dired mode buffer. + When RESET is given, starts from the beginning. + Compatibility function for \\[next-error] invocations." + (interactive "p") + + (when reset + ;; go to beginning of buffer + (goto-char (point-min))) + + (dired-next-error-move-n-file-lines + (prefix-numeric-value argp)) + + ;; visit file if possible + (when (dired-get-filename nil t) + (dired-find-file))) + + (defun dired-next-error-move-n-file-lines (argp) + "Move ARGP file lines from the current line. + File lines are lines with a file listed in them. + ONLY SUPPORT POSITIVE MOTION FOR NOW" + (when (> argp 0) + (dotimes (n argp) + (forward-line 1) + (dired-goto-next-nontrivial-file)))) + (defun dired-next-line (arg) "Move down lines then position at filename. Optional prefix ARG says how many lines to move; default is one line." --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--