At this point I want to use Emacs for only one file type with the extension ".fountain." The following is in my command line when clicking an icon on
the desktop (using Linux Mint Mate 19.3)...
/usr/bin/emacs25 %F /home/myname/Documents/scripts
What this does is opens Emacs and (in one window) lists all the files in the scripts sub-directory. Is there way to tell Emacs to just show the files that end with ".fountain"?
Is there way to tell Emacs to just show the
files that
end with ".fountain"?
Have a look at
M-: (info "(dired-x) Omitting Variables")
This would omit all filenames that do not end in 'n'^^^
(dired-omit-files "[^n]$")
(add-hook 'dired-mode-hook
(lambda ()
(dired-omit-mode 1)
))
Javier <javier@invalid.invalid> writes:
Is there way to tell Emacs to just show the
files that
end with ".fountain"?
Have a look at
M-: (info "(dired-x) Omitting Variables")
Yes, that also came to my mind first.
This would omit all filenames that do not end in 'n'^^^
(dired-omit-files "[^n]$")
Isn't there a `setq' missing (`dired-omit-files' is a variable)?
(add-hook 'dired-mode-hook
(lambda ()
(dired-omit-mode 1)
))
Of course this will effect the whole emacs session. The answer somewhat depends on how the OP wants to use the dired buffer and the session.
An alternative would be to mark by extension (* .), toggle marks (t) and
kill the marked files from the view (k). That could be done from Lisp,
too, of course. You need to require "dired-x" to do that. It's part of Emacs but not loaded by default.
It's also possible to invoke `dired' from Lisp with an explicit
precalculated list of files instead of a directory. This approach would
make it unnecessary to mess with dired options.
Michael.
RonB <ronb02NOSPAM@gmail.com> wrote:
At this point I want to use Emacs for only one file type with the extension >> ".fountain." The following is in my command line when clicking an icon on
the desktop (using Linux Mint Mate 19.3)...
/usr/bin/emacs25 %F /home/myname/Documents/scripts
What this does is opens Emacs and (in one window) lists all the files in the >> scripts sub-directory. Is there way to tell Emacs to just show the files that
end with ".fountain"?
Have a look at
M-: (info "(dired-x) Omitting Variables")
This would omit all filenames that do not end in 'n'
(dired-omit-files "[^n]$")
(add-hook 'dired-mode-hook
(lambda ()
(dired-omit-mode 1)
))
Thanks. I've copied this all down (appended to the past post in
Simplenote) and will study it when I get time. I'll admit that (right
now) it looks kind of like gobble-dee-gook to me, but that's only
because I'm ignorant of all things Emacs and Lisp. I can see that
Emacs is an extremely powerful application.
On 2020-02-04, Javier <javier@invalid.invalid> wrote:
RonB <ronb02NOSPAM@gmail.com> wrote:
At this point I want to use Emacs for only one file type with the extension >>> ".fountain." The following is in my command line when clicking an icon on >>> the desktop (using Linux Mint Mate 19.3)...
/usr/bin/emacs25 %F /home/myname/Documents/scripts
What this does is opens Emacs and (in one window) lists all the files in the
scripts sub-directory. Is there way to tell Emacs to just show the files that
end with ".fountain"?
Have a look at
M-: (info "(dired-x) Omitting Variables")
This would omit all filenames that do not end in 'n'
(dired-omit-files "[^n]$")
(add-hook 'dired-mode-hook
(lambda ()
(dired-omit-mode 1)
))
Thanks! I've copied your post into Simplenote and will study it to try to figure out what you're doing. (I think, when I get time, I'll probably work through some Emacs tutorials.) Right now, however, I'm just using Emacs for the one purpose.
Meanwhile, since I know a little more about shell scripts than Emacs (which is only slightly less than nothing), I found a solution that seems to work okay without having to mess with Emacs.
A shell script I named "emf" ("em" for Emacs and "f" for fountain).
#!/bin/bash
cd ~/Documents/scripts
ls -tl *.fountain
read -p 'file: ' uservar
emacs $uservar".fountain" &
exit
Since there should only be (maybe) ten to fifteen Fountain files at the most in my working directory at any one time, this should be sufficient. I also like the new files showing up at the top. Fountain-Mode is really nice in that all you have to do is open a ".fountain" file (or create one) to automatically be put in Fountain-Mode.
I run the above script with "source" (source emf) so it will exit out of the terminal when Emacs starts.
Thanks again.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 430 |
Nodes: | 16 (2 / 14) |
Uptime: | 149:45:10 |
Calls: | 9,065 |
Calls today: | 2 |
Files: | 13,402 |
Messages: | 6,019,909 |