Questions tagged [sexp]

Originated from the Lisp “s-expression” (for an expression in Lisp), `sexp` in Emacs refers to an expression in any language your program is written in.

Originated from the Lisp “s-expression” (for an expression in Lisp), sexp in Emacs refers to an expression in any language your program is written in.

Source: https://www.emacswiki.org/emacs/Sexp

33 questions
8
votes
4 answers

Correct pronunciation of 'sexp'?

I apologize if this is a dumb question, but I'm just starting out in ELisp, and I'm wondering how you pronounce the word 'sexp'. I.e., if I was talking to someone, how does one say this word?
MikeTheTall
  • 659
  • 4
  • 11
8
votes
4 answers

How can I find surrounding parenthesis (from emacs lisp)?

Is there a way to find out the type of the surrounding parenthesis (i.e. '(', '[' or '{') around point? For example (using | to represent point) { abc, | df } should return '{', and { abc[ | ], 123 } should return '['. Ideally I would like it to…
dshepherd
  • 1,281
  • 6
  • 18
7
votes
2 answers

How can I view the full `package-alist` value (without the truncation characters "...")?

When I do C-h v package-alist, I see something like ((PACKAGE-NAME1 [cl-struct-package-desc PACKAGE-NAME1 (VERSION1) "DESCRIPTION1" (DEPENDENCIES-ALIST1) nil …
Kaushal Modi
  • 25,203
  • 3
  • 74
  • 179
7
votes
1 answer

fill-paragraph (`M-q`) for s-expressions?

With M-q (aka fill-paragraph), it is possible to format a single line of text nicely. Is there a command or function which does a similar thing for lisps s-expressions? It should break one-liner lisp expression where it is reasonable. A command or…
jue
  • 4,476
  • 8
  • 20
5
votes
1 answer

how to properly move forward to the next sexp

I was expecting a similar result with the two snippets below, but this is what I've got: (with-temp-buffer (insert "(a)(b)(c)") (goto-char (point-min)) (list (prog1 (cons (point) (cons (sexp-at-point) nil)) (forward-sexp)) (prog1 (cons…
alexgirao
  • 153
  • 4
5
votes
1 answer

How do I ignore comments with scan-sexps?

I have some lisp code that contains a comment: (while list ;; take the head of LIST (setq len 1)) I want to extract the positions of the sexps. I'm using scan-sexps. If I call M-: (scan-sexps 12 1) with the above code in a buffer, it returns…
Wilfred Hughes
  • 6,890
  • 2
  • 29
  • 59
4
votes
1 answer

Folding code between a literal "begin"/"end" block using Hideshow

A formatted input file (*.alm) often contains a large section of columned data. To fold this and improve navigation, I've tried to implement a hs-special-mode-alist entry from hideshow.el. (setq hs-special-modes-alist '((alamo-mode "begin_data"…
z-nut
  • 43
  • 5
3
votes
1 answer

How can I make `forward-sexp` handle other balanced character-pairs such as < and > or << and >>?

I am trying to find an easy and efficient way to modify the behaviour of forward-sexp to handle balanced pairs of characters not normally supported by it, such as balanced < and > and balanced << and >>. My specific case is to enhance the support of…
PRouleau
  • 744
  • 3
  • 10
3
votes
1 answer

How can I find corresponding balanced parentheses?

I have this LaTeX code: \caption{Lorem ipsum dolor sit amet: foo), bar), baz) and qux) consectetuer adipiscing elit.} I want to put a marker immediately before the first { and one immediately after its corresponding }. forward-list is my usual…
Onner Irotsab
  • 431
  • 2
  • 9
3
votes
1 answer

Pretty print s expressions from the command line

I've got a file containing an emacs s-expression and I want to pretty print it from the command line: Is there an easy way of doing this? Paranoia suggests I want to do as little parsing of this data as possible Context (stack exchange loves…
Att Righ
  • 725
  • 4
  • 14
3
votes
1 answer

forward-comment doesn't move the point

I tried running (forward-comment -1) by eval command, when the point is actually in the middle of a comment. Like forward-word (or) forward-line, i expected it move to the beginning of the comment & then to the previous comment etc... But, the point…
Madhavan
  • 1,957
  • 12
  • 28
2
votes
0 answers

Make a set of characters act as open/close syntax?

Is there a way to make a set of characters act syntactically as open/close brackets? For example, {a> as an opening bracket, and
John Kitchin
  • 11,555
  • 1
  • 19
  • 41
2
votes
0 answers

Marking sexp diary entries as done in org agenda

I often use sexp diary entries for events in ORG-AGENDA. Is there a way of marking them as "DONE" in agenda-view? E.g. %%(diary-float t 2 3) Send John info for Bulletin E.g. %%(diary-block 12 15 2018 1 8 2019) School Holidays
Edman
  • 1,167
  • 7
  • 13
2
votes
1 answer

Navigating lisp

I want to programmatically navigate emacs lisp (and similar "nested paren code"). Specific functions I want: Go to first child (which errors if there are no children (maybe lispy-outline-goto-child but better) Go to sibling Go to parent (already…
Att Righ
  • 725
  • 4
  • 14
2
votes
0 answers

Orgmode : exporting agenda with sexps to ics

This year, I am having classes with complex descriptions, such as "every 1st and 3rd friday between 2016-11-18 and 2017-5-19", so I chose to use org-mode agenda combined with sexps to describe them easily: *17:00-19:00 Name of the class <%%(and …
BenzoX
  • 83
  • 3
1
2 3