From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Quickly Viewing Files in a File List, and then Quickly Closing Date: Fri, 18 Oct 2013 07:23:53 -0700 (PDT) Message-ID: <70b8bb7d-6e1a-418d-af12-c122119094e5@default> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1382106264 27014 80.91.229.3 (18 Oct 2013 14:24:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Oct 2013 14:24:24 +0000 (UTC) To: Eric Brown , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 18 16:24:28 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VXAyU-0006Vu-Ru for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Oct 2013 16:24:23 +0200 Original-Received: from localhost ([::1]:58076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXAyU-0002dS-2i for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Oct 2013 10:24:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXAyC-0002dM-BC for help-gnu-emacs@gnu.org; Fri, 18 Oct 2013 10:24:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXAy4-0003es-Pp for help-gnu-emacs@gnu.org; Fri, 18 Oct 2013 10:24:04 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:42978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXAy4-0003en-Hv for help-gnu-emacs@gnu.org; Fri, 18 Oct 2013 10:23:56 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r9IENrtb014673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Oct 2013 14:23:54 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9IENrri004250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Oct 2013 14:23:53 GMT Original-Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9IENrjU020853; Fri, 18 Oct 2013 14:23:53 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94085 Archived-At: > I am looking for a "QuickLook" feature for Emacs. For example, when > scrolling through a file list in dired (or sunrise commander): >=20 > - is it possible to automatically show the contents of the file > under point in a second window? But if point is moved, quickly > move along and show the next file/image whatnot? >=20 > - is there a "hold-down-button" to view, and let off button to > resume browsing the file list? >=20 > I currently use C-x 1 or C-x o q approaches, but I usually end up > with e a bunch of buffers or sore fingers when going through many > files. >=20 > Does anyone have suggestions? I apologize if the answer is sitting > in the Emacs manual. Others have responded with various ways to accomplish what you want. Here is yet another. In Icicles, the commands that access files are multi-commands, which means that you can use various keys to act on different completion candidates. For example, you can cycle among the candidates that match your current minibuffer input, using the `up' and `down' arrows. If you hold down `Control' while doing that (i.e., `C-down') then you act on each file in turn. (You can use `C-RET' to act on a file that you have cycled to using just `up' or `down'.) For `C-x C-f', for instance, the action is to visit the file, so if you use `C-x C-f' and then hit `C-down' you will visit the next file. Holding down Control and repeating `down' visits successive files, in the current sort order. (You can change the sort order at any time during completion, using `C-,'.) The behavior is exactly as you described, with this exception: the file buffers remain. That is, the default action for `C-x C-f' only visits the file; it does not also kill the file's buffer later on. You could easily define a command that would do that, say putting the `kill-buffer' action on a timer or associating it with an event (e.g. visiting the next file). On the other hand, it is also easy to manually kill a lot of buffers at the same time. (BTW, when you use `C-x C-f' you can match not only the file names but also file contents, if you like. And `C-M-down', `C-RET' etc. displays metadata about a file, instead of visiting it: permissions, size, time of last this-and-that, etc.) Icicles is available at EmacsWiki and MELPA: http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Libraries#BulkIciclesDownlo= ad -- Here is the doc string for `icicle-find-file': Visit a file or dir whose name and/or content matches. Candidate files and directories for completion are examined, and those whose names and/or contents match your multi-completion input are available to visit. (Option `find-file-run-dired' determines whether you can actually visit a directory candidate that you choose.) If you use a prefix argument when you act on a completion candidate (see below for the use of a prefix arg for the command itself.), then you visit the file or dir in read-only mode. This includes when you act on all candidates using `C-!': precede the `C-!' with a prefix arg. This does not apply to the final candidate chosen (using `RET' or `mouse-2') - a prefix arg has no effect for that. Completion candidates are two-part multi-completions, with the second part optional. If both parts are present they are separated by `icicle-list-join-string' ("^G^J", by default). The first part is matched as a regexp against a file or directory name. The second part is matched as a regexp against the file or directory content. Candidates that do not match are filtered out. When matching file content, Icicles just looks for a single match. Visiting the file does not move to that match or to any other match. Matching is used only to filter candidate files. However, if your input includes a content-matching part and it matches, that part is automatically added to the Isearch regexp history, `regexp-search-ring' whenever you hit `S-TAB' to complete. This means that when you visit the file you can immediately search for matches using `C-M-s' or `C-M-r'. Your minibuffer input can match a name or content, or both. Use `C-M-j' (equivalent here to `C-q C-g C-j') to input the default separator. For example: To match `foo' against file and dir names, use input `foo'. To match `bar' against file and dir contents, use input `C-M-j bar'. To match both names and content, use input `foo C-M-j bar'. Only the matching file and directory names are shown in buffer `*Completions*', and only the chosen name is returned. The actual content matches are unimportant anyway: content matching is used only to filter the candidates. If your input does not include a content-matching part then this command acts similar to `icicle-find-file-no-search' (but with a different use of the prefix argument). If your input includes a content-matching part then all files and directories matching the name part of your input (or all, if no name part) are visited. This creates buffers visiting each matching candidate. For a directory, a Dired buffer is used - that is the content that is searched. (Actually, this is determined by option `find-directory-functions'.) As you would expect, content matching can be costly in time, even though it can be quite helpful. Use name matching to narrow the set of files that must be visited to search their contents. When this command is finished, any unused buffers that were created for content matching are killed, if option `icicle-kill-visited-buffers-flag' is non-nil. But a prefix argument flips the behavior specified by that option. During completion (`*' means this requires library `Bookmark+'), you can use the following keys: C-c + - create a new directory M-| - open Dired on the currently matching file names S-delete - delete candidate file or (empty) dir * C-x C-t * - narrow to files with all of the tags you specify * C-x C-t + - narrow to files with some of the tags you specify * C-x C-t % * - narrow to files with all tags matching a regexp * C-x C-t % + - narrow to files with some tags matching a regexp * C-x a + - add tags to current candidate * C-x a - - remove tags from current candidate * C-x m - access file bookmarks (not just autofiles) Read input, then act on it. Input-candidate completion and cycling are available. While cycling, these keys with prefix `C-' are active: `C-mouse-2', `C-return' - Act on current completion candidate only `C-down', `C-wheel-down' - Move to next completion candidate and act `C-up', `C-wheel-up' - Move to previous completion candidate and act `C-next' - Move to next apropos-completion candidate and act `C-prior' - Move to previous apropos-completion candidate and act `C-end' - Move to next prefix-completion candidate and act `C-home' - Move to previous prefix-completion candidate and act `C-!' - Act on *all* candidates, successively (careful!) When candidate action and cycling are combined (e.g. `C-next'), user option `icicle-act-before-cycle-flag' determines which occurs first. With prefix `C-M-' instead of `C-', the same keys (`C-M-mouse-2', `C-M-RET', `C-M-down', and so on) provide help about candidates. Use `mouse-2', `RET', or `S-RET' to finally choose a candidate, or `C-g' to quit. This is an Icicles command - see command `icicle-mode'.