From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: combine orgmode and file system browsing Date: Mon, 23 Mar 2009 12:59:11 +0100 Message-ID: <87ab7cxw3j.fsf@kassiopeya.MSHEIMNETZ> References: <20090321041113.686f8bba.andy13@gmx.net> <878wmz4nwq.fsf@kassiopeya.MSHEIMNETZ> <20090321061235.f08ba725.andy13@gmx.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LljCn-0001Zj-6U for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 08:24:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LljCi-0001Yg-PX for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 08:24:36 -0400 Received: from [199.232.76.173] (port=36021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LljCi-0001Ya-J8 for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 08:24:32 -0400 Received: from mail.gmx.net ([213.165.64.20]:37305) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LljCh-0000dy-UX for emacs-orgmode@gnu.org; Mon, 23 Mar 2009 08:24:32 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Burtzlaff Cc: emacs-orgmode@gnu.org --=-=-= Andreas Burtzlaff writes: > The script does not generate the backlinks only the file system > structure, so it's not really useful, sorry. > It would make more sense to implement that properly as a major-mode and > make each directory update its state from the filesystem and the org file whenever it > becomes visible than to have to manually recreate the static representation > everytime the filesystem's structure or the org file's content changes. I know, but still. I have lot's of small to medium projects here and an Org-mode file for each project. All ressources are listed in the Org-file. To have the filetree in there is a good way to jump the source file in question and remember the code's structure easily a few weeks/months later. * Customer calls * `C-,' until I see the Org-file * M-RET to record the BUG/feature request * Jump to file in question easily. Another nice thing about it is, that the tree shows up in speedbar too. Maybe the idea could make a nice contribution too? `C-c C-c' to update the tree or include it dynamically. :) I modified the script a bit to exclude some files and directories: --=-=-= Content-Type: text/x-sh Content-Disposition: inline #!/bin/bash DIR=$1 # Define sufixes for directory names, that shouldn't be moved to the server: declare -a exclude_dirs exclude_dirs=('RCS' 'CVS' '.git' '_MTN' '.hg') # define suffixes for files, that should not be moved to the server: declare -a exclude_files exclude_files=('.jpg' '.png' '.gif') # This checks wether we have to run for this directory function exclude_directory () { for suf in ${exclude_dirs[@]} ; do is_excluded=${1%$suf} if [ "$is_excluded" != "$1" ] ; then return 0 fi done return 1 } # This checks wether we have to run for this file function exclude_file () { for suf in ${exclude_files[@]} do is_excluded=${1%$suf} if [ "$is_excluded" != "$1" ] ; then return 0 fi done return 1 } function toOrgRec { local BUFFER="" for d in $( echo "$(find $1 -maxdepth 1 -type d )" | tail -n +2 ); do if ! exclude_directory "$d"; then BUFFER="${BUFFER} * [[file:${d}][$(basename ${d})]]" toOrgRec ${d} BUFFER=${BUFFER}$( echo "${RETURN_BUFFER}" | sed "s/^\*/**/" | sed "s/^ / /" ) fi done for f in $(find $1 -maxdepth 1 -not -type d); do if ! exclude_file "${f}"; then BUFFER="${BUFFER} * [[file:${f}][$(basename "${f}" )]]" fi done RETURN_BUFFER=${BUFFER} } toOrgRec ${DIR} echo "$( echo "${RETURN_BUFFER}" | tail -n +2 )" -- Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover Tel.: +49 (0)511 - 36 58 472 Fax: +49 (0)1805 - 233633 - 11044 mobil: +49 (0)173 - 83 93 417 Http: www.emma-stil.de --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--