all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tomas Hlavaty <tom@logand.com>
To: covici@ccs.covici.com
Cc: Emacs Devel <emacs-devel@gnu.org>, Anand Tamariya <atamariya@gmail.com>
Subject: Re: GNU Emacs: A multimedia editor
Date: Sat, 29 Jan 2022 20:25:32 +0100	[thread overview]
Message-ID: <87ilu2uyxf.fsf@logand.com> (raw)
In-Reply-To: <m3bkzvikjt.wl-covici@ccs.covici.com>

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

On Fri 28 Jan 2022 at 17:04, John Covici <covici@ccs.covici.com> wrote:
> Where can I get the smelt wrapper?

mlt-devel
message id:3d33cf6c-0b59-c8e4-2c10-ed7739c8984c@gmail.com
see attachment (also this message)


[-- Attachment #2: smelt --]
[-- Type: application/octet-stream, Size: 2557 bytes --]

#!/usr/bin/env perl

$ver=0.01;

#TODO:
#Add recursion loop detection.
#Add option to specify file name of written file via command line?
#Change all print's to send to STDERR?
#See if it works for melt to send to stdout, allowing smelt > filename.mp4 to work?

$ver=0.02;#2016/10/02 07:07PM: Changed it so the command line is melt syntax, added TODOs above.


if($#ARGV<0)
{
	print "\n";
	print "Smelt version $ver - recursive multiple file reader for melt.\n";
	print "By Jesse Gordon. Released as public domain.\n";
	print "Usage:\n";
	print "$0 [--showcommand] <melt argument> [more [and more melt arguments[...]]]\n";
	print "inside of a file:\n";
	print "	melt:<filename> to include another filename (Do not quote),\n";
	print "	# for a comment at any position in a line:\n";
	print "		Everything after the # is ignored.\n";
	print "	--showcommand: Show the melt command instead of running it.\n";
	print "		(Can be anyplace in command line parameters.)\n";
	print "\n";
	exit (0);
}

$deep=0;

sub readfile
{
	$deep++;
	my $filename=shift;
	my $fh;
	if (open($fh,$filename))
	{
		print '  ' x $deep;
		#print "Opened file '$filename' for reading..\n";
		print "Reading '$filename'\n";
		my $line;
		while($line=<$fh>)
		{
			$line=~s/[\r\n]//g;	#Drop all newlines stuff from end of line.
			$line=~s/#.*//g;	#Drop comment symbol and all following
			$line=~s/^[ \t]*//g;	#Drop leading tabs/spaces
			$line=~s/[ \t]*$//g;	#Drop trailing tabs/spaces
			if($line ne "")
			{
			#	print "line='$line'\n";
				if($line=~m/^melt:/i)
				{
					$line=~s/^melt://gi;
				#	print "including '$line'\n";
					readfile($line);
				}else{
					my $word;
					foreach $word (split(/ /,$line))
					{
					#	print "	word='$word'\n";
						push(@args,$word);
					}
				}
			}
		}
		close($fh);
		#print '  ' x $deep;
		#print "Closed file '$filename'\n";
	}else{
		print "ERROR: Unable to open '$filename' for reading!\n";
		print "Recursion level is $deep,\n";
		print "and if that is a high number, you may have an\n";
		print "include loop. (i.e. a file including itself.)\n";
	}
	$deep--;
}

foreach $arg (@ARGV)
{
	if($arg=~m/--showcommand/i)
	{
		$showcmd=1;
#	}
#	elsif($arg=~m/-h/i)	#Don't want to remap too many things, they might be used by melt..
#	{
#		print "For help, run $0 with no parameters.\n";
#		exit(0);
	}else{
		if($arg=~m/^melt:/i)
		{
			$arg=~s/^melt://ig;
			readfile($arg);
		}else{
			push(@args,$arg);
		}
	}
}

$cmd="melt";
foreach $arg (@args)
{
	$cmd="$cmd '$arg'";
}

if($showcmd)
{
	print "\n\n$cmd\n\n";
}else{
	system($cmd);
}

  reply	other threads:[~2022-01-29 19:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28  4:49 GNU Emacs: A multimedia editor Anand Tamariya
2022-01-28  4:57 ` Po Lu
2022-01-28 21:05 ` Tomas Hlavaty
2022-01-28 22:04   ` John Covici
2022-01-29 19:25     ` Tomas Hlavaty [this message]
2022-01-29 22:26       ` John Covici
2022-01-29 22:30         ` Tomas Hlavaty
2022-01-31  5:44   ` Anand Tamariya
2022-01-31 15:16     ` T.V Raman

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

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

  git send-email \
    --in-reply-to=87ilu2uyxf.fsf@logand.com \
    --to=tom@logand.com \
    --cc=atamariya@gmail.com \
    --cc=covici@ccs.covici.com \
    --cc=emacs-devel@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.