emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastian Rose <sebastian_rose@gmx.de>
To: Andreas Burtzlaff <andy13@gmx.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: combine orgmode and file system browsing
Date: Mon, 23 Mar 2009 12:59:11 +0100	[thread overview]
Message-ID: <87ab7cxw3j.fsf@kassiopeya.MSHEIMNETZ> (raw)
In-Reply-To: 20090321061235.f08ba725.andy13@gmx.net

[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]

Andreas Burtzlaff <andy13@gmx.net> 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:



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-sh, Size: 1658 bytes --]

#!/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 )"

</#part>


--
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

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

  reply	other threads:[~2009-03-23 12:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-21  3:11 combine orgmode and file system browsing Andreas Burtzlaff
2009-03-21  2:20 ` Sebastian Rose
2009-03-21  5:12   ` Andreas Burtzlaff
2009-03-23 11:59     ` Sebastian Rose [this message]
2009-03-28 23:54       ` [ANN] org-fstree: insert directory subtrees into org buffers Andreas Burtzlaff
2009-03-29  1:30         ` Cameron Horsburgh
2009-03-29  1:57         ` Sebastian Rose
2009-03-29 12:41           ` [ANN] org-fstree 0.2 Andreas Burtzlaff
2009-03-29 17:10             ` Sebastian Rose
2009-03-30  6:39               ` Carsten Dominik
2009-03-31  9:48                 ` Alan E. Davis
2009-04-01  1:12                   ` Andreas Burtzlaff
2009-04-01  4:22                     ` Carsten Dominik
2009-04-01 23:50                       ` Andreas Burtzlaff
2009-04-03  9:45                         ` Carsten Dominik
2009-04-04  3:01                           ` Andreas Burtzlaff
2009-04-04  3:04                             ` Carsten Dominik
2009-06-10 19:14         ` [ANN] org-fstree: insert directory subtrees into org buffers Lindsay Todd
2009-06-12  3:56           ` [ANN] org-fstree: insert directory subtrees into org buffers / UPDATE Andreas Burtzlaff
2009-06-18 22:35             ` Lindsay Todd
2009-06-19 12:39               ` Andreas Burtzlaff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ab7cxw3j.fsf@kassiopeya.MSHEIMNETZ \
    --to=sebastian_rose@gmx.de \
    --cc=andy13@gmx.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).