57
votes
How can I get a ruler at column 80?
Are there any better alternatives?
Emacs 27 (officially released 2020-08-11) added support for a fill-column indicator natively by way of the buffer-local minor mode[1] display-fill-column-indicator-...
6
votes
Looking for a shortcut to select the function/method at point
Emacs calls a function definition a “defun”, because defun is the keyword¹ that starts a function definition starts in Lisp. Commands to move by defuns use the modifiers Ctrl+Alt:
C-M-a and C-M-e to ...
4
votes
Accepted
How can I have a bracket guide when programming?
It's based more on indentation level than "brackets", but does DarthFennec/highlight-indent-guides provide what you're looking for?
From the README:
This minor mode highlights indentation ...
4
votes
Accepted
org-mode and export programming
I don't think you can do exactly what you want. But there are a few options that come close.
If you don't want the source block included in your output, you can do this with the following block:
#+...
3
votes
Accepted
Using Emacs to find and copy relevant database records
While, as others have pointed out, other tools might be more suitable for this job, it can certainly be done with Emacs. 1.9GB is not an unreasonably large file size for Emacs to handle on a somewhat ...
3
votes
Accepted
Looking for a shortcut to select the function/method at point
See this part of the manual. Marking with C-M-h should work just fine. This runs mark-defun and marks the complete current function definition around point.
Some nifty details:
If your mark was ...
2
votes
How can I build a regexp insensitive to case?
I have exactly the same issue in a different language (but similarly odd, from the sound of it).
Let's start with a single keyword to match: "write"
You can build up a solution starting with ...
2
votes
Disable loop completion when programming perl
cperl creates abbreviations for perl keywords into ~/.emacs.d/abbrev_defs that trigger function cperl-electric-keyword that does the expansion.
To remove the offending entries, call M-x edit-abbrevs,
...
2
votes
Using Emacs to find and copy relevant database records
I am sharing my solution mainly for the comparison with AWK (see comments under NickD's answer), but also because it takes a slightly different approach than the solution by @orgtre:
This solution '...
1
vote
Is there a way to make dynamical representations of a visual type within emacs without the use of xwidgets?
Your question is not really answerable, but I’ll give you some background information. Emacs buffers can already display graphics. These can be raster graphics in several formats (such as gif, jpeg, ...
1
vote
Using Emacs to find and copy relevant database records
Using Emacs for this problem is just not a good way to go about it. You can learn enough about awk in a few hours to deal with such problems
and the advantage is a short program that runs relatively ...
1
vote
Looking for a shortcut to select the function/method at point
I think I found it. Use C-M h, which is bound to mark-defun.
The beauty of it is that it works not only on JavaScript, but also on Python, Elisp, or seemingly any other language. I found the solution ...
1
vote
Accepted
Tools to develop and debug ELISP code
Here is the beginnings of a list of useful techniques culled from the comments. Please add any others that you find useful by editing this answer:
The elisp analog of sprinkling printfs in a program ...
Community wiki
1
vote
Looking for a shortcut to select the function/method at point
Install evil, evil-matchit, then press %. It supports many programming language, not just javascript. It can be extended easily by user to support new syntax and new languages.
1
vote
Retracing steps with emacs (When programming /exploring)
Yes, Emacs bookmarks are a good answer for getting back to places later (and for restoring contexts later).
But that means that you need to create a bookmark, e.g., perhaps guessing that you might ...
1
vote
Accepted
How do I prevent backups of scripts from being made executable?
The variable backup-directory-alist tells emacs where to save the backups. Adding the following to your init file will set its value only if the executable bit is set.
(defun make-executable-backup-...
1
vote
Accepted
Automatically break long function signatures, calls, etc
I've had good luck with multi-line
which, without configuration, allows you to cycle through different white space policies with a single repeated key press.
(use-package "multi-line" :bind ("C-;"))...
1
vote
Automatically break long function signatures, calls, etc
CC mode provides for automatically filling text in comments and strings out-of-the-box. See the description in the manual: Filling and Breaking
By default, filling in CC mode ignores code. If you ...
1
vote
Accepted
Disable loop completion when programming perl
Since it looks like cperl-mode always rewrites its abbreviations, my previous answer is not a long term solution.
A better solution is to run a hook after cperl has been loaded and redefine the cperl-...
1
vote
Rearranging whitespace in sexps
You can use the command special-lispy-alt-multiline from abo-abo's lispy. In lispy-mode, it is bound to M. There is also a special-lispy-oneline command bound to O.
If you are not familiar with lispy,...
1
vote
Rearranging whitespace in sexps
I "translate" manual steps into Emacs Lisp. It works in the following demos but it is not reliable (that is, it will produce unexpected results or even block your Emacs, if you run the commands at the ...
1
vote
How to make a Customize setting depend on another? or make a `setq` depend over a Customize setting?
Take a look at the keywords for defcustom:
In particular, :set allows you to specify a function for setting the value of a variable. This means you can set the value of a variable based on that of ...
1
vote
How can I get a ruler at column 80?
Updated Answer
Since Emacs 27, use display-fill-column-indicator-mode.
In practice, one may utilize it by toggling the mode with a custom keybinding, like shown below:
;; Mnemonics: `b' Buffer, `i' ...
1
vote
How can I get a ruler at column 80?
In Spacemacs this functionality is easily toggled using SPC t f.
I'm not sure exactly how it is implemented but Spacemacs seems to use the fill-column-indicator package (defined in the .emacs.d/...
1
vote
How can I get a ruler at column 80?
Since fill-column-indicator is quite heavy, this solution shows a character to the right of the current line.
So when you're typing you can see the line limit before you exceed it.
This defines the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
programming × 43elisp × 3
formatting × 3
org-mode × 2
search × 2
font-lock × 2
syntax-highlighting × 2
customize × 2
text-editing × 2
highlighting × 2
auto-complete-mode × 2
display × 2
ide × 2
tree-sitter × 2
org-export × 1
python × 1
package × 1
debugging × 1
regular-expressions × 1
osx × 1
files × 1
company-mode × 1
functions × 1
minibuffer × 1
start-up × 1