Questions tagged [programming]
The programming tag has no summary.
43 questions
0
votes
1
answer
75
views
Is there a way to make dynamical representations of a visual type within emacs without the use of xwidgets?
I have been reading the emacs lisp introduction and emacs lisp manual. In the elisp introduction the author says that one should think of emacs as a "extensible computing environment" as ...
1
vote
1
answer
3k
views
Understanding company-mode, corfu, and lsp-mode
I'm trying to switch to Emacs for all my text-related tasks. I've set up org-mode for note-taking, but configuring it as a programming tool is overwhelming. I am aware of many questions here that ask ...
2
votes
2
answers
2k
views
Setting up Eglot in Emacs 30
I am trying to use emacs for programming python and c/c++. I recently upgraded my MacOS setup to emacs-plus@30 --with-ctags--with-dbus --with-debug --with-mailutils --with-no-frame-refocus --with-...
0
votes
1
answer
1k
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 ...
1
vote
3
answers
214
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 ...
3
votes
1
answer
342
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 ...
0
votes
0
answers
176
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' ...
1
vote
1
answer
307
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 ...
1
vote
0
answers
86
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 ...
1
vote
0
answers
37
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....
0
votes
0
answers
66
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.
0
votes
1
answer
645
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 ...
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 ...
3
votes
2
answers
113
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 ...
3
votes
1
answer
127
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....
0
votes
0
answers
33
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 ...
0
votes
1
answer
199
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 ...
0
votes
2
answers
561
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 ...
1
vote
1
answer
97
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, ...
1
vote
3
answers
191
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 ...
2
votes
3
answers
122
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 ...
0
votes
0
answers
49
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 ...
2
votes
1
answer
604
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 ...
1
vote
2
answers
697
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 ...
2
votes
0
answers
684
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 ...
6
votes
2
answers
3k
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 ...
1
vote
2
answers
317
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/...
1
vote
0
answers
175
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....
3
votes
1
answer
319
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-...
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, ...
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
...
2
votes
4
answers
431
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 ...
4
votes
1
answer
131
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-...
1
vote
1
answer
97
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: [...
2
votes
1
answer
136
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. ...
1
vote
1
answer
995
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.
...
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 are ...
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
... |
}* ...
8
votes
1
answer
152
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 ...
7
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 ...
21
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 ...
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 ...
120
votes
9
answers
51k
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 ...