Questions tagged [prog-mode]

Major mode for editing programming language source code. Typically, it is not used directly, instead many programming-related major modes are derived from this mode.

Filter by
Sorted by
Tagged with
10
votes
4answers
386 views

How do I inherit from prog-mode, whilst still supporting older emacsen?

I'm writing a major mode for a programming language, but I want to support older Emacs versions. prog-mode is relatively new. I want to inherit from prog-mode if it's defined, but still do something ...
7
votes
1answer
508 views

Is a Lisp program in both prog-mode and lisp-mode?

Upon reading (emacs) Program Modes: Entering a programming language mode runs the custom Lisp functions specified in the hook variable prog-mode-hook, followed by those specified in the mode's ...
6
votes
3answers
692 views

Turn a non prog-mode derived major-mode into a prog-mode derived major-mode

erlang-mode is not a derived prog-mode. Is there any way to make it part of the prog-mode-hook ?
3
votes
2answers
183 views

How to create a block from lines

In various programming modes, assuming I have a few lines of code like this : foo() bar() And I want to turn it into a block (say, and if of some sort) if (something) { foo() bar() } Is there, ...
3
votes
1answer
123 views

Variable assignment for programming modes not working

I want to set the variable truncate-lines to t in order to have truncated lines, but only in programming modes. So, following this thread, I put the following code in my configuration file: (defun my-...
1
vote
1answer
122 views

Run an external program with customized environment/options in current buffer

How can I organize Emacs to run a specific external program with some specific environment/options for the mode or the buffer currently open. My current solution is to use setenv before running the ...
1
vote
0answers
156 views

Emacs really laggy on prog-mode

I noticed Emacs was really laggy on any mode derived from prog-mode two days ago. Before that, everything was fine. I can navigate on a 1000+ lines org-mode file without problem, but I can't even type ...
1
vote
0answers
483 views

prog-mode-hook not run for C++ mode

I am trying to turn on linum-mode and fci-mode for C++ editing. Here is my configuration: ;; If non nil line numbers are turned on in all `prog-mode' and `text-mode' ;; derivatives. If set to `...
1
vote
0answers
28 views

find-file opens file but buries its buffer when ECB is activated

I have a hook in my .emacs file that activates ECB when prog-mode entered: (add-hook 'prog-mode-hook 'ecb-activate) When I open the first file that starts a prog-mode, it seems to cause find-file* ...
0
votes
0answers
48 views

Enable prog-mode when minor mode is activated

I created a minor mode for some specific file extension to fontify the syntax and provide correct indentation. 1)The indentation doesn't work for some reason. 2) How to enable prog-mode when the ...
0
votes
1answer
80 views

prog-mode-hook not recognizing .ex files in user-config

I'm trying to display prettify-symbols-mode to display for certain characters. I would like for this minor mode to be enabled across all programming languages - thus prog-mode. When I navigate to a ....
0
votes
0answers
155 views

Create a minor mode only for prog-mode major modes

I am working on a minor-mode and I'd like it to be active only for major modes derived from prog-mode. So far I know that the macro define-minor-mode takes a argument :global to decide whether or not ...