From mboxrd@z Thu Jan 1 00:00:00 1970 From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Subject: Re: Refile: refile to any open file. Date: Wed, 13 Aug 2014 17:24:14 -0400 Message-ID: <87zjf8hym9.fsf@yale.edu> References: <83r4xis8ah.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHg1y-0002r3-R2 for emacs-orgmode@gnu.org; Wed, 13 Aug 2014 17:24:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHg1p-0005Ze-N5 for emacs-orgmode@gnu.org; Wed, 13 Aug 2014 17:24:26 -0400 Received: from plane.gmane.org ([80.91.229.3]:47616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHg1p-0005ZX-HA for emacs-orgmode@gnu.org; Wed, 13 Aug 2014 17:24:17 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XHg1l-0004GG-6B for emacs-orgmode@gnu.org; Wed, 13 Aug 2014 23:24:13 +0200 Received: from nat-130-132-173-153.central.yale.edu ([130.132.173.153]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Aug 2014 23:24:13 +0200 Received: from jorge.alfaro-murillo by nat-130-132-173-153.central.yale.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Aug 2014 23:24:13 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Isaac writes: > Similar to this previous post, I am trying to file orgmode items > to files/buffers currently opened. Being elisp rookie, I tried > and came up with the following: > > (defun opened-buffer-files () > "Return the list of files currently opened in emacs" (delq nil > (mapcar (function buffer-file-name) (buffer-list))) ) Perhaps you should return instead only the org mode files that are opened, something like this: #+BEGIN_SRC emacs-lisp (delq nil (mapcar (lambda (x) (if (and (buffer-file-name x) (string-match "\\.org$" (buffer-file-name x))) (buffer-file-name x))) (buffer-list))) #+END_SRC Best, -- Jorge.