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: Bookmark Plus: Bookmarking "locate"d files Date: Tue, 3 Feb 2015 14:08:42 -0800 (PST) Message-ID: <7a4b475d-785c-44f9-ad98-1cc99dc62cc9@default> References: <87zj8ug0v6.fsf@gmail.com> 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 1423001353 11385 80.91.229.3 (3 Feb 2015 22:09:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Feb 2015 22:09:13 +0000 (UTC) To: torys.anderson@gmail.com, emacs list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 03 23:09:13 2015 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 1YIlei-000117-KT for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Feb 2015 23:09:12 +0100 Original-Received: from localhost ([::1]:33591 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIlei-0000r9-0S for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Feb 2015 17:09:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIleK-0000ka-PX for help-gnu-emacs@gnu.org; Tue, 03 Feb 2015 17:08:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIleH-0001uq-QY for help-gnu-emacs@gnu.org; Tue, 03 Feb 2015 17:08:48 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:48483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIleH-0001ud-KA for help-gnu-emacs@gnu.org; Tue, 03 Feb 2015 17:08:45 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t13M8hcp002636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Feb 2015 22:08:44 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id t13M8gf3022041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 3 Feb 2015 22:08:43 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t13M8gaJ000046; Tue, 3 Feb 2015 22:08:42 GMT In-Reply-To: <87zj8ug0v6.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:102464 Archived-At: > I follow a regular process in my note-taking and can create a locate comm= and > that returns a complete list of my note org files within a portion of my > directory heirarchy. I had hoped the results of (locate) would count as a= n > occur/compilation buffer; it even partially works as a dired buffer. But > whenever I try the dired bookmark command after marking the results, I am > told the command is only available in dired or dired-derived modes (which= , I > was sure, the results of locate were). >=20 > In following http://www.emacswiki.org/emacs/BookmarkPlus#toc33, How can I > bookmark such a list of files? Is it a bug that I cannot do it from the > "locate" buffer? I don't use Org (shameful confession, I know), and I'm not familiar with such buffers. But if the buffer normally exists or you can easily re-create it, then you can of course just bookmark it normally. You can also put the code to re-create it in a function bookmark (or in a separate command). But it sounds like your question is more about something like what `C-c C-M-b' does in occur mode or compilation mode: create bookmarks for the targets of all of the hits. (This is similar to what `M-b' does in Dired: bookmark each of the marked files.) If so, then you would need to create a command similar to the commands that `C-c C-M-b' is bound to there: `bmkp-occur-target-set-all' and `bmkp-compilation-target-set-all'. You can see that the code for those two commands is pretty much the same. This is the meat of it: (while (ignore-errors (occur-next) t) ; "No more matches" ends loop (ignore-errors (bmkp-occur-target-set prefix)) ; Ignore killed buf (setq count (1+ count))) That iterates over the hits, setting a bookmark for each one. You need a function that gives you the next hit, similar to `occur-next' and `compilation-next-error'. Probably your Org buffer's mode has such a function. And you need a function analogous to `bmkp-occur-target-set', to set a single such bookmark. For that, you need a function that follows a hit, similar to `occur-mode-find-occurrence' (and `find-file-noselect' for compilation mode). Probably your buffer's mode has that too. Try something similar for your context. Let me know what you find. (In principle, `next-error', with `next-error-function', provides a single, unified way to get the next hit but there are sometimes particularities to take into account, I think. Anyway, Bookmark+ supports older Emacs versions that do not unify this.)