Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [programming]

The tag has no usage guidance.

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

How to use tree-sitter parser for syntax highlighting?

I'm trying to setup Emacs for editing Roc (https://www.roc-lang.org/) source code. I have an LSP server for Roc and tree-sitter parser for Roc installed. Unfortunately I failed to find tree-sitter ...
Yuriy Al. Shirokov's user avatar
1 vote
3 answers
139 views

Using Emacs to find and copy relevant database records

I have reduced a large text file to a 1.9GB size that Microsoft Access can handle, but only as a linked file. To permit full Access operations - to import the relevant data into Access - I need to ...
Ray Woodcock's user avatar
3 votes
1 answer
300 views

How can I have a bracket guide when programming?

What I am looking for is a guide to show what area of the code a set of brackets covers. I am not referring to highlighting the match between parentheses or brackets but instead outlining the field ...
qKweint's user avatar
  • 90
0 votes
0 answers
126 views

Detect whether a file is "binary" from elisp

I am wondering whether current versions of Emacs have any built in mechanism for guessing whether a file (that my elisp code is about to load, or perhaps has just loaded, into a buffer) is 'binary' ...
zwol's user avatar
  • 272
1 vote
1 answer
270 views

org-mode and export programming

Is it possible to program the export in org-mode in the following way? Say you'd like to export some org-mode text in latex or html but you'd like to program a kind of limited text loop with an ...
Laurent Jacques's user avatar
1 vote
0 answers
74 views

Run a TypeScript interpreter in an inferior process window

Are there any alternatives to ts-comint.el? https://github.com/emacs-typescript/ts-comint It's old and unmaintained. I'm using tide, but I don't see how I can transpile/evaluate the code directly from ...
Jason Hunter's user avatar
1 vote
0 answers
29 views

fork in org-mode babel source block executes incorrectly

I have this small piece of code on emacs org-mode : #+BEGIN_SRC C :eval #+BEGIN_SRC C :fork-example1.c :noweb no-export :eval :flags -Wall -Werror -pedantic //Fork-exemplec-cours.c #include <stdio....
Vincent's user avatar
  • 11
0 votes
0 answers
40 views

All of a sudden i started seeing an insertion of a period after two spaces, even in programming mode files

I started noticing this after an update, every two spaces at end of a word/symbol places a period at the end. I am not sure how to debug this or where to look. any pointers appreciated.
SFbay007's user avatar
  • 584
0 votes
1 answer
559 views

Tools to develop and debug ELISP code

I have some experience in Emacs-LISP. Today I spent 6 hours writing LISP code that I guess-timate would have taken 1h30 to write in Python because my workflow to develop and debug is very clunky. In ...
emonigma's user avatar
  • 1,907
6 votes
4 answers
1k views

Looking for a shortcut to select the function/method at point

I have this problem in JavaScript, but I understand the solution to it could be more general. My cursor (point) is on the name -or on the body- of a function, like this : function test() { // My ...
kotchwane's user avatar
  • 515
3 votes
2 answers
98 views

Retracing steps with emacs (When programming /exploring)

Often when fixing a bug or implementing a new feature in a code repository, I start off with an investigatory step. For example, I would have a lead, a word such as "Article" and I would start by ...
american-ninja-warrior's user avatar
3 votes
1 answer
109 views

How do I prevent backups of scripts from being made executable?

If I edit an executable script, say foo.sh, then upon saving emacs makes the backup file foo.sh~. That's all well and good, but if the original file has the executable bit set, then so does the backup....
greatBigDot's user avatar
0 votes
0 answers
30 views

Online code usage search in emacs

I am pretty sure I have seen some service, with an emacs plugin, that does something like the following: whenever you're programming and type a function name it'll show example usages of the function ...
Paulo Matos's user avatar
0 votes
1 answer
187 views

Ada-mode -- can't build gpr_query

I'm using the ada-mode 5.2.1, gnat GPL 2017. I've built and installed gnatcoll successfully. However, when I try to build gpr_query, I get the following error: $ gprbuild -p -P gpr_query.gpr ...
David Boshton's user avatar
0 votes
2 answers
486 views

Automatically break long function signatures, calls, etc

void parse(std::vector<float>& io_vertices, std::vector<unsigned>& io_indices) {} Oftentimes when we code we need to break lines repeatedly as new expressions and statements enter ...
Caterpillar's user avatar
1 vote
1 answer
88 views

fill-paragraph in programming

Is it possible, or does some function exists, to get the equivalent of the alt-q command, but in programming? Suppose I've just written this in python: group_parser.add_argument('-n',nargs=1, ...
Devilius's user avatar
  • 113
1 vote
3 answers
164 views

Disable loop completion when programming perl

When I type a loop keyword (for, while, do) in perl program, emacs automatically inserts brackets and parenthesizes to complete the loop structure. I would like to disable this but I'm not sure what ...
gogators's user avatar
  • 153
2 votes
3 answers
104 views

Rearranging whitespace in sexps

When writing Lisp, I often encounter a long line such as the following. (map function (|apply append long-list-name1 long-list-name2 long-list-name3)) (where '|' denotes the point). This can be a ...
Qudit's user avatar
  • 835
0 votes
0 answers
44 views

Bind a function-local variable to an asynchronous lambda [duplicate]

In wakatime-mode, there are a bunch of process calls that is done by the wakatime-call function. It calls a predefined shell command, so no real magic inside. Now I’d like to make it a bit more error ...
GergelyPolonkai's user avatar
2 votes
1 answer
592 views

change how initial parenthesis is highlighted

I recently installed a programming package, "Haskell mode," and apparently I changed how "initial parenthesis highlighting" works. I'm used to a quick black/white box superimposed on the initial ...
composerMike's user avatar
1 vote
2 answers
618 views

How to get an insert-text-button 'action property accessing a dynamically-bound buffer-local variable

In realgud I have a text button that needs access to a dynamically-bound buffer-local variable. The situation occurs like this. Inside one buffer that has the buffer local variable, there is a ...
rocky's user avatar
  • 898
2 votes
0 answers
620 views

Can emacs beautify existing tcl source code?

I'm just getting started with tcl; what sort of beautifier, or prettifier, or formatter, is there for tcl with emacs? My main interest would be to fix existing scripts so that particularly the ...
Thufir's user avatar
  • 121
5 votes
2 answers
2k views

How to show startup screen instead of scratch, when no file is opened?

Like a lot of people I think I activated inhibit-startup-screen because it’s ugly and tedious to always have your emacs horizontally split when you open a file with half taken by an useless startup ...
galex-713's user avatar
  • 245
1 vote
2 answers
264 views

How to make a Customize setting depend on another? or make a `setq` depend over a Customize setting?

I heard it’s better to use Customize to define variables/settings instead of just some setq inside .emacs.d… because it autoloads when loading packages, because it’s more consistent, more checked/...
galex-713's user avatar
  • 245
1 vote
0 answers
165 views

Dynamic background colour for code blocks

Years ago I saw a feature in XCode where nested code blocks (delimited by {}) containing my cursor had graded background shades, with the lightest at my cursor, and the darkest at the outer level. .e....
Alejandro Erickson's user avatar
3 votes
1 answer
291 views

How do I set a variable in all programming modes?

I'd like tab-width to be set to 2 in all programming modes. I use prelude (which might be one of the problems), but I have this in my custom.el (which is sort of the analogue to .emacs): (setq my-...
Son of the Wai-Pan's user avatar
5 votes
1 answer
2k views

Display function arguments in echo area?

Is there a package to let emacs display the parameters of a function while typing? For example, if I were to start typing printf( in C, I would like it to display the format taken from man pages, ...
CodeSammich's user avatar
15 votes
9 answers
3k views

How to edit elisp without getting lost in the parentheses

I'm modifying some elisp code from linum.el: (custom-set-variables '(linum-format 'dynamic)) (defadvice linum-update-window (around linum-dynamic activate) (let* ((w (length (number-to-string ...
Zhro's user avatar
  • 359
2 votes
4 answers
382 views

Compile Matlab Code

I am new to gnu Emacs and have a question. I created an M file to run in Matlab and I got it working fine. My question is, is there a way to compile my code in the Emacs editor or test out my ...
Jack's user avatar
  • 121
4 votes
1 answer
118 views

Sleep until predicate is true

I want to sleep until a predicate is true, without blocking the rest of Emacs from executing. For example: (defun clock-striking-one-p () (eq clock 1)) (defun hickory-dickory-dock () (run-up-...
Matthew Piziak's user avatar
1 vote
1 answer
81 views

How can I modify a variable in a javascript file that meets specific conditions?

Lets say I'm editing a javascript file in emacs that has objects as such scattered through out the file: foo: [1], foo: [2], foo: [3], foo: [4], foo: [5], foo: [6], foo: [7] obo: [1], obo: [2], obo: [...
user2522280's user avatar
2 votes
1 answer
130 views

How can one quickly remove ancillary snippets of code?

How can one quickly remove ancillary snippets of code in Python scripts under Emacs? For example, for debugging purposes, I often add some print statements to print out the values of some variables. ...
Tim's user avatar
  • 5,027
1 vote
1 answer
948 views

Extending autocomplete for Go to insert function arguments

Autocomplete for Go code (fantastically) suggests functions and helpfully shows the documentation for the function, e.g. arguments and return types. If I hit tab, the DialHTTP function is inserted. ...
Daniel Blezek's user avatar
8 votes
3 answers
2k views

How can I build a regexp insensitive to case?

I have a bunch of keywords: set write quit which each can be shortened down to one letter: s se set w wr wri writ write q qu qui quit Further, these keywords are case-insensitive, so the following ...
Sean Allred's user avatar
  • 6,941
12 votes
2 answers
2k views

Display the beginning of a scope when it is out of screen

I would like to display the opening part of a scope when this one get out of screen. Example: namespace a { ... --------------------- <- display frame ... | }* ...
log0's user avatar
  • 320
8 votes
1 answer
137 views

How should comint-derived modes keep track of buffers and processes?

Having written a couple of custom comint-derived modes, I often find it tricky to decide how to keep track of buffers and processes: for instance, to associate different source buffers with different ...
user avatar
5 votes
1 answer
3k views

Show current function in header line

I have used a package before which used the header line to show the name of the current function being edited. Whatever package it was, I don't have it installed now. What are my options for getting ...
nispio's user avatar
  • 8,235
20 votes
3 answers
5k views

Track "TODO" items when writing code

Is there an easy way to create a list of "to-do" items on-the-fly when writing code? For example, suppose that I am writing a function write-this-now when I realize that I am also going to need to ...
nispio's user avatar
  • 8,235
8 votes
2 answers
3k views

How to integrate SLIME with MIT Scheme?

I know basics of Common Lisp. I've learned it using Emacs + SLIME, and I must say that without these two I wouldn't learn too much - using bare REPL is tough job. However, SLIME makes a great job at ...
MatthewRock's user avatar
  • 1,483
116 votes
9 answers
47k views

How can I get a ruler at column 80?

As a programmer, I want to see a ruler at a specific column (usually 80), both so I see when I cross that column, but also to see how close I am getting to it so I can reformat my code early. The ...
Jorgen Schäfer's user avatar