Post by RonBPost by JavierPost by RonBAt 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.
I've refined the process a little by automatically opening Atril with Emacs
(after choosing a file). This works well for what I need. (Made a short
video in Vokoscreen to show what I'm talking about.) The new script looks
like this...
#!/bin/bash
cd ~/Documents/scripts
clear
lst lfount # or ls -tl *.fountain
read -p 'file: ' uservar
wrxr $uservar >2 errors.txt
em $uservar 2> errors.txt & # or emacs $uservar".fountain"
exit
(Calling a couple other scripts here, but doing the same as above (put what
the scripts do in the remarks). The X Windows applications throw errors when
started from a terminal, so I just redirect them to a file (though it
probably doesn't matter since I'm closing the terminal anyhow)).
https://drive.google.com/open?id=1JoXrJpkQVj0LezVGnS4JiFPSrGcgzy5M
--
The fabulous Latitude D430, running
Linux Mint Mate 19.3 on 2GBs of RAM