Skip to main content

Questions tagged [auto-mode-alist]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 views

Can auto-mode-alist be used to have Emacs transparently encrypt and decrypt a non .gpg file?

I currently have Emacs encrypting a .gpg file transparently as is the expected behaviour and I'm wondering if this can be extended to all file types so that Emacs can attempt decryption on all files ...
V.H. Belvadi's user avatar
3 votes
2 answers
185 views

dir local “auto-mode-alist” sets wrong mode

;;; /tmp/test/.dir-locals.el ((auto-mode-alist . (("/\\.dir-locals\\(-2\\)?\\.el\\'" . lisp-data-mode) ("/[^/-][^/]*\\.el\\'" . emacs-lisp-mode))))...
shynur's user avatar
  • 5,473
0 votes
0 answers
43 views

auto-mode-alist for python files

Am doing the following for org files. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) What should I do for python ?
Dilna's user avatar
  • 1
0 votes
1 answer
250 views

How to load octave-mode

I'd like to use the octave mode for emacs. There is no octave-mode package in MELPA, but EmacsWiki (https://www.emacswiki.org/emacs/OctaveMode) and the emacs manual seem to suggest that it is built-in ...
point618's user avatar
  • 233
0 votes
1 answer
22 views

When is the major-mode assigned to an input file determined by its file extension?

How does Emacs determine the major-mode assigned to a file based on file extension, e.g. .txt or .odt? If the filename has no extension, and I don't do anything to tell Emacs how to treat it, what ...
daveboss's user avatar
0 votes
1 answer
19 views

Trim a suffix before applying auto-mode-alist

I am pretty sure there was a way to remove backup suffixes like ~ and .bak before mode detection, but I just can't find it anymore...
xeruf's user avatar
  • 354
0 votes
1 answer
111 views

`use-package` :defer prevents :mode from actually inserting something in auto-mode-alist

In my init.el, I have something like (use-package racket-mode :mode "\\.rkt\\'") However, when I open a .rkt file, racket-mode does not start. Running (alist-get "\\.rkt\\'" ...
jthulhu's user avatar
  • 225
0 votes
1 answer
47 views

same files.el.gz, different auto-mode-alist

Two Debian systems with different history of apt-based and local software installations. On one system, cmake-mode works, on the other not, though file /usr/local/share/emacs/site-lisp/cmake-mode.el ...
Joachim W's user avatar
  • 145
2 votes
1 answer
509 views

How to enable a major + a minor mode on loading a file?

Clojure files should open in Clojure-mode. I also have Clojure files that contain color info and are used to generate my styles; they live under a /styles path. For these files, I want them to have ...
Webdev Tory's user avatar
1 vote
1 answer
113 views

Using two programming languages with the same file extension

I am just starting to set up a perl environment in emacs but the problem is that I already program with prolog and both languages use the .pl file extension. I have two directory ~/src/prolog and ~/...
Nicholas Hubbard's user avatar
1 vote
2 answers
232 views

How can I make sure that Emacs opens files with extension `*.rec` as normal text files?

How can I make sure that Emacs opens files with extension *.rec as normal text files? When I try to open a file with the extnsion *.rec, I get the error message Running someFile.rec...done without the ...
Glory to Russia's user avatar
0 votes
1 answer
81 views

Do m-x command on entering buffer with a specific file type

Sorry if this is a really noob question. I have recently gotten into Emacs with the Spacemacs distribution and I installed a plugin called "focus." I want to be able to have the command &...
mochimochi's user avatar
1 vote
1 answer
71 views

How to stop Emacs from using LaTeX mode key bindings for `*.tex` files?

It seems that Emacs tries to autodetect the type of file and changes some of its behaviors accordingly. I don't want any of this behavior. I just want Emacs to treat every file as if it were some ...
user avatar
3 votes
1 answer
397 views

How do I associate a file such as git's `COMMIT_EDITMSG` with a specific mode?

I was doing following solution for markdown files: How do I associate a file extension with a specific mode? (autoload 'markdown-mode "markdown-mode.el" "Major mode for editing Markdown files" t) ...
alper's user avatar
  • 1,400
1 vote
1 answer
2k views

How to make Emacs edit JSON data in `json-mode`?

I am working with GNU Emacs 23.1.1. When working with a .json file it is treated in the Fundamental mode: How can I have the json file treated in the json mode? I note that GNU Emacs 24.3.1 opens ...
Viesturs's user avatar
  • 835
0 votes
1 answer
1k views

does one has to explicity enable python-mode etc. to work with python files?

Sometimes I see people talking about enabling python-mode and so on. Is that only necessary for older emacs versions? I thought, the respective mode is enabled automatically when opening a ...
CD86's user avatar
  • 573
1 vote
1 answer
75 views

Enable diff-mode for files with diff-ish content

How do I make Emacs automatically turn on diff-mode for any file with diff-looking content, eg. --- a.txt +++ b.txt @@ -1234,56 +1234,56 @@
forthrin's user avatar
  • 451
4 votes
1 answer
307 views

"Dissasociate" auto-mode for specific files (in ESS)

I'd like to keep ess as automatic major mode for R files and everything else, except for Julia, for which I want to use julia-mode alone. However, I cannot find out how to "unbind" the file ...
phipsgabler's user avatar
1 vote
1 answer
127 views

Is There a Way To Set "Lisp-Interaction-Mode" to be Default?

I'm using Emacs in the terminal of Mac. Each time I exist an .el file and reopen another, I have to set lisp-interaction-mode. Is there some sort of command or item I can place in the .emacs file to ...
JosephTLyons's user avatar