auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX] Adding macro support, TeX-arg-file hook


From: Tyler Smith
Subject: [AUCTeX] Adding macro support, TeX-arg-file hook
Date: Wed, 14 Sep 2016 11:31:45 -0400

Hi,

I'm trying to define a style hook for a personal macro that takes a file
name, without the extension, as an argument. From the manual, I think
this should be possible via the `TeX-arg-file` argument hook:

'TeX-arg-file'
     Prompt for a filename in the current directory, and use it without
     the extension.

My style file looks like this:

(TeX-add-style-hook
 "cba"
 (lambda ()
   (TeX-add-symbols
    '("ColumnFigure" ["caption"] TeX-arg-file)
    '("ColumnPhoto" ["caption"] TeX-arg-file-name)
    '("FullPhoto" ["caption"] TeX-arg-file-name-sans-extension)
    '("featureAuthor" 1))))

The result is that \ColumnFigure prompts me for the caption, and
completes a file name, but the inserted file includes the extension. You
see I also tried 'TeX-arg-file-name', and
'TeX-arg-file-name-sans-extension', but those don't provide filename
completion, just a prompt. `TeX-arg-input-file` provides completion, but
only for items in TeX's search path, not the current directory.

Looking at the code for TeX-arg-file, neither the code or the doc string
indicate that the extension will be trimmed. 

1) Is this a bug in the documentation? 
2) Is there a way to prompt the user for an extension-less filename via
style hooks?

Thanks,

Tyler

-- 
plantarum.ca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]