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
1 vote
1 answer
54 views

running emacs as daemon halts if adding read-only-mode to prog-mode-hook

I want to have "read-only-mode" enabled in all programming buffers, including the starting buffer "scratch". If I add the line (add-hook 'prog-mode-hook 'read-only-mode) Running ...
0 votes
1 answer
249 views

company-mode no popup graphics at completion-at-point

I tried to install company and lsp on running on Emacs v28.2 on 5.4.240-1-MANJARO for a handful of languages. Most of the stuff works fine, flycheck, linters,lsp-connection, the popup completion with ...
1 vote
0 answers
50 views

Highlight variables/functions in commens of all prog-modes

In lisp-mode, strings inside comments that are encapsulated by `' are highlighted with font-lock-constant-face. How can I make all prog-mode-derived modes do that by default?
0 votes
0 answers
41 views

indent-region inconsistent with existing code that's indented more than python-indent-offset

Say I have an existing, simple block of code that uses an indent width of 4, as such def incDictValue(d, k): if not k in d: d[k] = 1 else: d[k] += 1 return and setup ...
1 vote
1 answer
209 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 ...
0 votes
0 answers
74 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 ...
7 votes
1 answer
735 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 ...
10 votes
4 answers
414 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 ...
0 votes
1 answer
114 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 ....
1 vote
0 answers
226 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 ...
0 votes
0 answers
239 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 ...
3 votes
1 answer
147 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-...
6 votes
3 answers
763 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 ?
1 vote
0 answers
604 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 `...
3 votes
2 answers
283 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, ...
1 vote
0 answers
38 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* ...