Re: Copy files to tmp

2024-03-21 Thread Jürgen Spitzmüller
Am Montag, dem 18.03.2024 um 22:55 +0100 schrieb Enrico Forestieri:
> Maybe you don't need to copy them to the tmp. We have an info inset
> that can be used to provide the full path to the files, wherever you
> move the directory containing the document. See the attached.

Sorry for the late response, Enrico. This is an interesting approach
indeed. For my use case, an external template is more practical,
though.

-- 
Jürgen
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Copy files to tmp

2024-03-19 Thread Richard Kimberly Heck

On 3/19/24 10:32, Scott Kostyshak wrote:

On Tue, Mar 19, 2024 at 09:49:59AM +, José Matos wrote:

On Tue, 2024-03-19 at 09:24 +0100, jspi...@gmail.com wrote:

Thanks, this does not seem to be related to external material,
AFAICS.
However, what would help me is a new placeholder, $$OrigAbsName, that
outputs the absolute path to the original filename (see attached). I
know that documenting this for 2.4 is too late, but would you be OK
if I submitted this as a hidden feature and document later?

Jürgen

I am suspicious, in any case it follows my opinion. :-)

I think that this is quite reasonable because the feature is self-
contained and it does not interfere with other features.

So IMHO +1.

+1


And me.

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Copy files to tmp

2024-03-19 Thread Scott Kostyshak
On Tue, Mar 19, 2024 at 09:49:59AM +, José Matos wrote:
> On Tue, 2024-03-19 at 09:24 +0100, jspi...@gmail.com wrote:
> > Thanks, this does not seem to be related to external material,
> > AFAICS.
> > However, what would help me is a new placeholder, $$OrigAbsName, that
> > outputs the absolute path to the original filename (see attached). I
> > know that documenting this for 2.4 is too late, but would you be OK
> > if I submitted this as a hidden feature and document later?
> > 
> > Jürgen
> 
> I am suspicious, in any case it follows my opinion. :-)
> 
> I think that this is quite reasonable because the feature is self-
> contained and it does not interfere with other features.
> 
> So IMHO +1.

+1

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Copy files to tmp

2024-03-19 Thread José Matos
On Tue, 2024-03-19 at 09:24 +0100, jspi...@gmail.com wrote:
> Thanks, this does not seem to be related to external material,
> AFAICS.
> However, what would help me is a new placeholder, $$OrigAbsName, that
> outputs the absolute path to the original filename (see attached). I
> know that documenting this for 2.4 is too late, but would you be OK
> if I submitted this as a hidden feature and document later?
> 
> Jürgen

I am suspicious, in any case it follows my opinion. :-)

I think that this is quite reasonable because the feature is self-
contained and it does not interfere with other features.

So IMHO +1.
-- 
José Abílio
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Copy files to tmp

2024-03-19 Thread jspitzm
Am Montag, dem 18.03.2024 um 18:26 -0400 schrieb Richard Kimberly Heck:
> On 3/18/24 13:01, Jürgen Spitzmüller wrote:
> > I am trying to set up a private external template for the inclusion
> > of
> > sound files to beamer slides. Could somebody please remind me what
> > needs to be done to get those files (e.g., mp3's) copied to the tmp
> > with their mangled file name?
> 
> I think this is done in the validation routine, by calling 
> features.includeFile().

Thanks, this does not seem to be related to external material, AFAICS.
However, what would help me is a new placeholder, $$OrigAbsName, that
outputs the absolute path to the original filename (see attached). I
know that documenting this for 2.4 is too late, but would you be OK if
I submitted this as a hidden feature and document later?

Jürgen
diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp
index 33c14d38be..5893a5d454 100644
--- a/src/insets/ExternalSupport.cpp
+++ b/src/insets/ExternalSupport.cpp
@@ -106,8 +106,10 @@ string const doSubstitution(InsetExternalParams const & params,
 		params.filename.mangledFileName() :
 		params.filename.outputFileName(parentpath);
 	string const basename = changeExtension(
-			onlyFileName(filename), string());
+		onlyFileName(filename), string());
 	string const absname = makeAbsPath(filename, parentpath).absFileName();
+	string const origabsname = makeAbsPath(params.filename.outputFileName(parentpath),
+	   parentpath).absFileName();
 
 	if (what != ALL_BUT_PATHS) {
 		string const filepath = onlyPath(filename);
@@ -136,6 +138,10 @@ string const doSubstitution(InsetExternalParams const & params,
 use_latex_path,
 PROTECT_EXTENSION,
 ESCAPE_DOTS);
+		result = subst_path(result, "$$OrigAbsName", origabsname,
+use_latex_path,
+PROTECT_EXTENSION,
+ESCAPE_DOTS);
 		result = subst_path(result, "$$RelPathMaster",
 relToMasterPath, use_latex_path,
 PROTECT_EXTENSION,
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Copy files to tmp

2024-03-18 Thread Richard Kimberly Heck

On 3/18/24 13:01, Jürgen Spitzmüller wrote:

I am trying to set up a private external template for the inclusion of
sound files to beamer slides. Could somebody please remind me what
needs to be done to get those files (e.g., mp3's) copied to the tmp
with their mangled file name?


I think this is done in the validation routine, by calling 
features.includeFile().


Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Copy files to tmp

2024-03-18 Thread Jürgen Spitzmüller
I am trying to set up a private external template for the inclusion of
sound files to beamer slides. Could somebody please remind me what
needs to be done to get those files (e.g., mp3's) copied to the tmp
with their mangled file name?

Thanks,
-- 
Jürgen
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel