Questions tagged [major-mode]

The mode that determines the editing behavior of Emacs while that buffer is current. The mode line normally shows the name of the current major mode, in parentheses.

Filter by
Sorted by
Tagged with
1
vote
2answers
184 views

js-comint mode (node) returning too many undefined responses?

I am using js2-mode and comint-mode to run the Node REPL in emacs. For some reason the prompt is returning a lot of undefined and ...undefined responses, which it wouldn't do normally. for instance, ...
1
vote
0answers
24 views

Running logo program (ucblogo) in Emacs

I am trying to run logo programs (ucblogo version 5.5) on my emacs in Debian Linux (26.1). There is a currently a mode for it ( https://www.emacswiki.org/emacs/LogoMode ). I followed the instructions ...
1
vote
0answers
39 views

Change major-mode keymap char-table

I'm trying to write my own major mode, which I want to use under MS Windows. Unfortunately, Windows doesn't have my favourite keyboard layout, so I'm planning to implement this keyboard layout in my ...
1
vote
0answers
199 views

How to add additional comment syntax to a mode?

In general, given a major mode with a defined comment syntax, what do I have to define or change to add a new comment syntax? By "adding", I mean setting some new characters so that they work with ...
1
vote
0answers
71 views

How to disable code folding for coq?

When I do isearch on the buffer having coq mode it somehow executes code folding, something like (... *)... I have tried to use (setq company-coq-disabled-features '(code-folding)) for disabling code ...
1
vote
0answers
309 views

Enabling Company CAPF backend with timer in Major Mode

I've be working on a new major mode for a DSL. I'm planning to use the CAPF backend for company mode and would like to provide the integration. The completion at point functions produce the correct ...
1
vote
0answers
80 views

Keyword as comment ender (and starter)

In my previous question I asked about complex comment-start sequence and I think I figured it out, but now I have another problem. Let say we have this mode: (defconst test-font-lock-keywords '(("\\...
1
vote
1answer
73 views

Complex comment-start (and end) sequence

As far as I understand there is syntax flags only for comment delimiters made up of two characters but if I have comment delimiters of length greater than two characters is it possible to change ...
1
vote
0answers
22 views

Cperl font lock regions in here docs

I am having a problem in cperl-mode described in this question. Basically inserting a newline at the start of a line in here doc in cperl-mode is breaking the syntax highlighting. One of the answers ...
1
vote
0answers
90 views

How to save a yasnippet placeholder's final value in an Elisp variable?

In its more recent versions, shell-script mode tailors its behavior in response to the sh-shell variable's value, which indicates the shell variant (zsh, bash, etc.) that the script is for. I've ...
1
vote
0answers
27 views

Specify fallback possibilities for file-local variables?

It is clear from the manual how to set file variables: -*- mode: modename; var: value; … -*- For example, at the top of my ~/.gitconfig file, I have # -*- mode: conf; -*- I recently discovered ...
1
vote
0answers
101 views

Auto-indent problems related to syntax in Haxe-Mode

In the Haxe programming language, you can specify the type of the return value of a function with a colon. function funcName() : ReturnType { } This becomes a problem when using emacs with haxe-mode....
1
vote
0answers
64 views

Is there an existing function to add docstrings, relevant to the current major mode?

In emacs is there a function that I can invoke to add a docstring template based on the current major mode? eg: If I'm working on javascript, insert a javascript docstring template "here", like: /*...
0
votes
1answer
92 views

How does one change a .el file to lisp-interaction mode?

I've looked at the documentation, but I can't seem to figure out how to do it.
0
votes
1answer
141 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 ...
0
votes
1answer
91 views

Is there a mode for phpBB?

I'm using the "It's all Text" addon for Firefox so I can edit textarea's in Emacs. As I spend some time on a phpBB forum, I was wondering if there is an Emacs mode for phpBB with it's syntax of using [...
0
votes
1answer
43 views

Check whether buffer is in org-mode

I want to programmatically check whether the current buffer is in org mode. I know that major modes should usually define the variable <modename>-mode, i.e., org-mode should be a defined ...
0
votes
1answer
280 views

How to disable warning in js2-mode: function does not always return a value?

Is it possible to disable warning for functions that not always return value in js2-mode?
0
votes
1answer
92 views

pressing return in paragraph-indent-text-mode deletes whitespace indenting beginning of paragraph

I'm currently using emacs 25.3 on Mac OSX installed using Homebrew, and without any modifications in my .emacs file or anywhere else. I think I may be fundamentally misunderstanding what paragraph-...
0
votes
1answer
101 views

Switching buffer to special mode or any mode?

I have written some code to create a new buffer, it starts up in fundamental mode, the buffer is to display output from commands. I am using this to create the buffer (get-buffer-create "*My Buffer*"...
0
votes
1answer
332 views

Is there major mode for editting CQL?

I'm editting CQL(Cassandra Query Language) on emacs and came to wonder if there's any dedicated major mode for editting CQLs. Is there such one?
0
votes
1answer
124 views

Make major mode be used by default for new files in directory

I forget to enter sh-mode when I create new shell scripts in ~/.local/bin, so I want emacs to do this automatically. Because I have an advice set up to make them executable, this will have the effect ...
0
votes
1answer
73 views

Is it possible to auto select the mode depending on where the file is?

One can use auto-mode-alist to define modes based on the regex and the filename. However I want to use different modes for files depending on which folder they are in. So, for example, in a django ...
0
votes
1answer
53 views

How can a file be configured to recognized as a certain language only in that session?

I am editing a Drupal module file which doesn't use either a .php or .module extension. How can I configure emacs to recognize the file alone as a PHP file: regardless of the extension and only for ...
0
votes
1answer
481 views

major mode with irony warning message

Below major mode is a dummy mode just derived from c-mode: ;; a simple major mode, mylang-mode (define-derived-mode mylang-mode c-mode "major mode for editing mylang language code." (message "...
0
votes
2answers
377 views

How replace auto-complete-mode with company-mode in all major mode using it?

How I can replace auto-complete-mode with company-mode in all major mode using it? i.e. make all modes which activating auto-complete-mode (e.g. c-mode or sh-mode etc), activate company-mode instead ...
0
votes
1answer
186 views

Create a sub-mode of an existing mode which overrides certain functions?

I want to make a few customizations to cmake-model.el. The big-picture view of this lisp file is as follows: ... ;; This function I want to modify (defun cmake-indent () ... ) ... ;; Mode ...
0
votes
1answer
78 views

How to disable skeleton-pair-insert-maybe?

I recently got a new Chromebook and installed Ubuntu via crouton. I then installed Emacs 23 and transferred my .emacs file to the new machine. However, a few of my key rebindings have been ...
0
votes
1answer
62 views

different mode setting

I often use .c file and .txt file on the split emacs frame. I wrote a code such as the following to init.el. ;; change text-mode indent (add-hook 'text-mode-hook (lambda () (setq ...
0
votes
1answer
1k views

How to have emacs recognize Makefile as a prefix for makefile-mode?

I figured the following would tell emacs to recognize files starting with "Makefile" and start makefile-mode: (add-to-list 'auto-mode-alist '("\\`Makefile" . makefile-mode)) The \\` indicates the ...
0
votes
1answer
235 views

How to change the font-lock string definition?

I wrote a simple mode with the following font-lock definition, which defines just some keywords: (defvar marpa-mode-font-lock `((,(regexp-opt '(":default" "action" "lexeme" "default" "latm" "...
0
votes
1answer
201 views

How do I enable a mode, when another mode runs?

All I want to do is enable tern-mode, when I enter js-mode. I know that a hook called js-mode is run when I open a javascript file but for some reason tern-mode is not enabled. In my init.el file I ...
0
votes
1answer
222 views

Visual Basic mode doesn't work after update

I'm on Windows. I updated my emacs to 24.4. Now, when trying to open a file that has its extension mapped to the Visual Basic mode at http://www.emacswiki.org/emacs/visual-basic-mode.el, I get these ...
0
votes
1answer
15 views

Whitespace mode settings on per major mode basis

When I open the Linux Kernel code, my default indentation conflicts with the desired formatting of the Kernel. I use Emacs Prelude, so I added the settings from this link to my c-mode-common-hook. I ...
0
votes
1answer
27 views

how to bind custom commands to keys in existing mode map?

I wrote some extra commands for Python mode: python-insert-quote and python-insert-double-quote. I want to have these commands be available in the minibuffer when python-mode is active. How can I add ...
0
votes
0answers
17 views

Disable Flycheck for different file extensions with the same mode

I use verilog-mode for both Verilog (extension .v) and System Verilog (extension .sv). I want to disable flycheck for .v files only. (Because they are typically multi-gigabyte netlists that take lots ...
0
votes
0answers
43 views

Howto define TAB and S-TAB in keymap of custom mode

I'm trying to bind the TAB and shift TAB keys to a custom readonly buffer mode. The skeleton of the mode looks like this: ;; 8< --- exmode.el ------- (defun exmode-i () (interactive) (message ...
0
votes
0answers
16 views

Keybindigs conflict between minor modes

The configuration that I have for python mode implies loading both elpy.el and python.el. The things is that I found the python.el keybindings more natural than the elpy.el ones. And most of the ...
0
votes
0answers
104 views

Spacemacs - python mode

I have some problems with my spacemacs configuration. For instance, it's supposed to be globally set up with emacs editing mode and the line numbers as well dotspacemacs-editing-style 'emacs ...
0
votes
0answers
268 views

Spacemacs user-config error

I'm using Spacemacs to develop a laravel + Vue application and I followed the steps in this configuration example to highlight syntax in Vue, but now every time Spacemacs starts it gives me this error:...
0
votes
0answers
29 views

Get the syntax coloring of another mode for newly defined mode

I am defining a new mode in emacs, but I want to have the same syntax highlighting as Org mode. How can I do this?
0
votes
1answer
40 views

.emacs linked to emacs.link,open emacs.link in emacs-lisp mode

Say I have a symbolic link .emacs link to emacs.link,so when I open emacs.link,the associated buffer's major mode is Fundamental mode. I want emacs.link's major mode Emacs-Lisp. Another example is: ...
0
votes
0answers
24 views

wiki and twiki major modes

Is there an emacs mode for editing and typsetting wiki wiki modes? What I am looking for is something that could help me writing a properly formatted document for wikipedia.
0
votes
1answer
86 views

Json-Mode / Puppet-Mode unset common functions when installed with use-package

I'm facing a weird issue in my init.el. Installing packages such as json-mode or puppet-mode (from MELPA Stable) with use-package unsets common functions like forward-word or backward-kill-word. The ...
0
votes
1answer
112 views

Stop automatic indentation and cursor movement while typing in major mode

I've put together a simple major mode for syntax highlighting and indentation of AQL. This is my first, and I'm open to any suggestions there, but my question is more specific: When I type two ...
0
votes
0answers
177 views

font-lock problem of c++ mode

I recently notice that there's some strange behaviours of the font-lock of the c++-mode. Let's start emacs by emacs -Q in the terminal, edit a new file test.cpp and save the following contents Then ...
0
votes
0answers
107 views

scss-mode compile not reading config.rb

Just discovered scss-mode and it's concomitant compile-on-save (very cool). However, I keep getting errors because sass it is not reading ../config.rb. I can find no variables in scss-mode nor params ...
0
votes
0answers
59 views

Determine if emacs knows the mode for a file

I'd like to add another system to set the major modes of file visiting buffers. To do so, I need to know if any of the existing major mode setting systems know how to set the mode, and do my thing ...
0
votes
0answers
92 views

Is there a way for a display-buffer-base-action function to know the forthcoming major-mode?

I am writing a mode that implements a persistent horizontal window (very similar to the "persistence compile window" in ECB). While I did study the ECB code it is quite old and endeavored to work ...
-1
votes
1answer
74 views

How to specify the mode-name displayed in the buffer pop-up list?

I'm working on a couple of XML-format major modes, both of which are derived modes based on nXML, and I cannot get Emacs to display the mode names -- either in the minibuffer or in the buffer-list pop-...