Questions tagged [parentheses]
30 questions
5
votes
4 answers
org-mode code block parentheses mismatch
Here's some emacs-lisp code in a babel block:
#+begin_src emacs-lisp
(defun factor (number)
(labels
((*factor (divisor number)
(if (> (* divisor divisor) number)
(list number)
(if (= (mod number divisor) 0)
…

147pm
- 2,907
- 1
- 18
- 39
4
votes
3 answers
show-paren-mode only highlights when cursor is one character after closing parenthesis
Problem
I have show-paren-mode enabled, but the highlighting behavior unintuitive. In particular, the matching parentheses are only highlighted in two situations as shown below (the second of which is unintuitive):
Cursor on the opening parenthesis…

yongjieyongjie
- 286
- 1
- 5
4
votes
2 answers
How to highlight the current scope with C family languages?
While it's possible to highlight a block using the character under the cursor, is there a way to highlight the scope of the current cursor?
I'm interested in something like QtCreator's block-highlight feature:
Are there existing packages that do…

ideasman42
- 8,375
- 1
- 28
- 105
3
votes
3 answers
Move point inwards while counting number of nested parentheses without throwing an error
I would like to write a function that counts the number of nested parentheses while moving the cursor to the innermost bracket without throwing an error.
(defun count-and-move ()
(interactive)
(setq c 0)
(while t
(down-list)
…

Sati
- 775
- 6
- 21
3
votes
1 answer
How can I change the parentheses highlight style?
When the cursor in next to a parenthesis, bracket, or brace, it highlights it and the matching one (if any). This is expected.
But by "highlights", I mean it entirely hides the things under a small block of color that nearly matches the text, making…

Ness
- 165
- 7
3
votes
1 answer
Stop highlighting parentheses when I start typing
I use (show-paren-mode 1) to get help seeing where parentheses are. I have (setq show-paren-delay 2) to prevent intrusive highlighting when I don't need it. This is how it works now:
Put cursor on a parenthesis. After 2 seconds, both parentheses…

forthrin
- 451
- 2
- 10
2
votes
2 answers
How to set parentheses matching colors
When using parentheses matching, how can I set the color of the parenthesis my cursor is actually on?
I found I can use the below set-face-attribute to control the color of the other parenthesis, but I cannot find any info on how to control the…

gdonald
- 167
- 7
2
votes
0 answers
How to highlight matching brackets when the cursor is behind or in front of starting or ending brackets?
I am using Emacs: Highlight Brackets ()[]{}.
I want to highlight matching brackets when the cursor is behind and front of starting and ending brackets. How can I accomplish this?
foo ( "hello" )
^ ^ ^ ^
1 2 3 4 // cursor points
I…

alper
- 1,238
- 11
- 30
2
votes
2 answers
Background color of matching parentheses overlays the region background color
I have set lime as a background color for my region, and I also have enabled to highlight matching parens using (show-paren-mode 1).
The issue I have is that when I exactly select the contents between two parens, the light grey background color of…

Max
- 311
- 2
- 11
2
votes
2 answers
Spacemacs: How can I customize the highlight style of a matching parenthesis?
How do I change, in my .spacemacs, the style used to highlight the matching parenthesis?

Dionysis
- 328
- 3
- 11
1
vote
1 answer
Completion to set style
I have the following function, where I would like to use completion to set the style. But the way I have done does not reset the style using M-x rk-bracemk-companion.
(defcustom rk-bracemk-companion-style
'("parenthesis" "expression"…

Dilna
- 1,173
- 3
- 10
1
vote
1 answer
show line number when matching parathenses/braces
I work with latex/other documents with long nested of texts/codes are enclosed by paratheses or braces, like this:
{
long blocks of latex or other materials
(
another long blocks of texts
)
some text
}
In emacs, if e.g. I move…

underflow
- 111
- 3
1
vote
2 answers
Text editing with parentheses
I have a text like Code1. I want to convert from Code1 to Code2, including parentheses and removing some texts. How do I edit this efficiently?
Code 1
AAA & 0.076 & 0.053 & 0.053\\
AAA & 0.103 & 0.159 & 0.122\\
BBB & 0.036 & 0.037 & 0.037\\
BBB &…

hrkshr
- 113
- 8
1
vote
1 answer
Blinking Paren Mode
I'm trying to get Paren Mode to be a little more clear, cause I can hardly see the other matching pair of parenthesis.
Is there any way I could make this blinking yellow?;)
I'm in gnome-terminal.
Here it says it can be blinking:
Emacs Show Paren…

Jason Hunter
- 519
- 2
- 9
1
vote
1 answer
Check if a buffer's name ends with `.org`
I want to write a function to check if a buffer is an Org buffer. Here is my attempt.
(defun org_bufferp (buffer)
(if (bufferp buffer)
((setq buffer_name (buffer-file-name buffer))
(if (stringp buffer_name)
(if…

Student
- 225
- 1
- 7