Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [programming]

The tag has no usage guidance.

3
votes
1answer
58 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
0answers
22 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
1answer
42 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
2answers
102 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
1answer
45 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
3answers
108 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 ...
3
votes
3answers
63 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
0answers
35 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 ...
3
votes
1answer
306 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
2answers
243 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 ...
3
votes
0answers
247 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
2answers
856 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
2answers
129 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
0answers
131 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....
4
votes
1answer
103 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-...
3
votes
1answer
507 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, ...
12
votes
9answers
1k 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
4answers
200 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
1answer
86 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
1answer
70 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
1answer
87 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
1answer
498 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. ...
5
votes
2answers
668 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 ...
11
votes
2answers
777 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
1answer
95 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 ...
1
vote
1answer
974 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 ...
17
votes
3answers
3k 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 ...
7
votes
2answers
2k 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 ...
73
votes
5answers
20k 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 ...