Questions tagged [parentheses]

The tag has no usage guidance.

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

How to replace, in a simple way, pairs of parentheses?

It would be useful for me to be able to replace, in a simple way, with simple emacs commands, parenthese pairs, like: (text text) [text text] {text text} ... How to do it?
Salvo Micciché's user avatar
0 votes
1 answer
37 views

prevent emacs deleting ")"

I don't want to turn off entire smartparens or similar mode ((([cursor])) When I type ) at cursor location I expect it to be ((())) but it becomes ((()) How to find out which mode is causing it?
eugene's user avatar
  • 489
0 votes
0 answers
74 views

Why is autopairing for "<>" enabled in org-mode when I have electric-pair-mode enabled but do not have "<>" in electric-pair-pairs?

Here's a snippet of my config related to electric-mode: (setq electric-pair-pairs '( (?\{ . ?\}) (?\( . ?\)) (?\[ . ?\]) (?\&...
Sumadithya's user avatar
2 votes
2 answers
164 views

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 ...
gdonald's user avatar
  • 167
1 vote
1 answer
110 views

Identification of emacs error reporting invalid read syntax ")"

Have been debugging a minor-mode I am writing. After much torture spend locating the problem, I have now narrowed things down to the following function. Still, I have not been able to fix the ...
Dilna's user avatar
  • 1
1 vote
1 answer
48 views

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-...
Dilna's user avatar
  • 1
0 votes
1 answer
18 views

Introducing ability for interactive function to set show-paren-style

I am using the following interactive function to enable show-paren-mode. Would like to have the capability to change the style. What can I do for such functionality to work? (defun rk-bracemk-...
Dilna's user avatar
  • 1
0 votes
1 answer
68 views

Indicating parentheses

I have this piece that indicates an opening parenthesis by blinking it. Currently, if I want to mark an opening parenthesis, I have to do call M-x rk-blink-matching-open each time. I would like the ...
Dilna's user avatar
  • 1
1 vote
1 answer
120 views

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 ...
underflow's user avatar
  • 111
0 votes
2 answers
73 views

Lispy and Racket

I'm using lispy with Racket and having a tough time with some forms. Namely, if I with to a let or keyword argument I can't seem to type the inner [ character. For example, I want to define a ...
robertpostill's user avatar
0 votes
1 answer
169 views

rainbow-delimiters does not properly highlight unmatched parenthesis

Would it be possible to highlight unmatched parenthesis if they are at the beginning of a function like func((((()? Related: How can I find missing or mismatched braces / parens in emacs? minimal.el ...
alper's user avatar
  • 1,300
0 votes
1 answer
238 views

How to match a single ')' with replace-regex?

I want to replace a list in the form of 1) 2) 3) 4) with * * * I've tried using the regex [0-9]*\), but it gives Invalid regexp: "Unmatched ) or \\)" and [0-9]*\\) replaces 0 matches. in ...
Luctins's user avatar
  • 120
1 vote
2 answers
79 views

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 &...
hrkshr's user avatar
  • 133
0 votes
1 answer
91 views

Why I can't use `let` in this example?

I am learning Emacs lisp and wrote a function which takes as input a list of file name, and returns a list of numbers of each defun in a file (introduced in this tutorial) (lengths-list-file "/...
shpark's user avatar
  • 133
1 vote
1 answer
597 views

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 ...
Jason Hunter's user avatar
2 votes
0 answers
255 views

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&...
alper's user avatar
  • 1,300
2 votes
2 answers
174 views

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 ...
Max's user avatar
  • 341
0 votes
1 answer
126 views

Expand parentheses with smartparens

I want to expand else {|} (second parentheses generated by smartparens) into else { | } which is the best sequence of keys or options?
Francesco Cadei's user avatar
1 vote
1 answer
217 views

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)) ...
Student's user avatar
  • 225
1 vote
1 answer
81 views

show-paren-mode or similar to highlight multi-character parentheses

In latex, "parentheses" such as \(\), $$ and \[\] are constantly used. Is there a way to customize show-paren-mode or is there some other mode to highlight these multi-character parentheses in latex-...
Tohiko's user avatar
  • 1,609
3 votes
3 answers
340 views

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) ...
Sati's user avatar
  • 775
1 vote
4 answers
2k views

How to delete surrounding brackets?

I'd like to be able delete the innermost brackets around the current point. What's a good way to do this? While the evil-surround package can do this, it needs to take a bracket type as input, so ...
ideasman42's user avatar
  • 8,546
4 votes
3 answers
851 views

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 ...
yongjieyongjie's user avatar
1 vote
1 answer
143 views

Accessing next/previous parenthesis instead of just the outermost one? (as with `syntax-ppss`)

syntax-ppss gives the surrounding parenthesis. Is it possible to get the next/previous parenthesis using this API? (which has the advantage of caching the syntax tree and working with multiple ...
ideasman42's user avatar
  • 8,546
5 votes
4 answers
1k views

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 ...
147pm's user avatar
  • 2,937
4 votes
2 answers
332 views

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-...
ideasman42's user avatar
  • 8,546
2 votes
2 answers
1k views

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's user avatar
  • 328
1 vote
1 answer
1k views

emacs regex to match balanced parenthesis

How can emacs lisp match balanced parenthesis? for example: "foo(bar(),hee()) out()" should be match "foo(bar(),hee())". I try below statement but it doesn't work: #!/usr/bin/env emacs --script (...
beetlej's user avatar
  • 1,076
0 votes
1 answer
356 views

init.el file loads, but not evaluating all of the expressions

for example (show-paren-mode t) not getting evaluated, I have to run this function every time even though it is in my init.el file and other
RootOfMinusOne's user avatar
3 votes
1 answer
2k views

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 ...
Ness's user avatar
  • 165
3 votes
1 answer
565 views

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 ...
forthrin's user avatar
  • 451