Questions tagged [common-lisp]

Editing Common Lisp code and working with inferior Common Lisp read-eval-print loops. Note that Emacs's Lisp dialect is not Common Lisp; for Emacs Lisp, use the tag [elisp].

Filter by
Sorted by
Tagged with
0 votes
0 answers
34 views

Display function signature in completion popup menu instead of status line with SLIME/SLY in Emacs

What the title says. I'd like the function signature for functions in Common Lisp to display next to the function name in the company-mode autocomplete popup menu instead of at the bottom of the ...
Alexis Dumas's user avatar
2 votes
4 answers
124 views

Reading Common Lisp Source Code Inside Emacs?

I think emacs is just brilliant. The help functionality with C-h is extremely useful. Recently, I started coding in SB Common Lisp. It would be very useful if I could search the definitions of ...
Vinn's user avatar
  • 263
1 vote
1 answer
119 views

What's the purpose of `cl-lib` in emacs?

Why does emacs need the cl-lib Common Lisp compatibility? What is it used for?
Kolt Penny's user avatar
0 votes
1 answer
42 views

How can I configure Slime to use case sensitive symbols?

In emacs lisp variables are not case sensitive, so if I define a variable x, I can access it using X, but I can modify the elisp behavior by (setq readtable-case :preserve), is there something similar ...
Atreyagaurav's user avatar
1 vote
1 answer
184 views

Does elisp have a way to jump to (goto) labels in the code, ala common lisp's go?

Does elisp have a way to jump to (goto) labels in the code, ala common lisp's go? (tagbody (setq val 2) (go lp) (incf val 3) lp (incf val 4)) => NIL val => 6 PS: This is a ...
HappyFace's user avatar
  • 738
1 vote
0 answers
90 views

What's the value in using a REPL for ELISP development? [closed]

What's the value in using a REPL? I've always wondered the advantages/disadvantages of using a REPL are (if there are any) as opposed to eval-print-last-sexp and then undoing the text printed (or ...
John DeBord's user avatar
1 vote
0 answers
23 views

Is there a locate-library equivalent for Common Lisp files?

When editing Common Lisp code, is there an Emacs command that behaves like locate-library that would take a name and attempt to find the location for a Common Lisp file with that name? Looking at ...
PRouleau's user avatar
  • 724
1 vote
1 answer
252 views

Syntax Highlighting of Common Lisp User-Defined Macros in Emacs

I would like to start writing a few simple Domain Specific Languages in Common Lisp and would like the names of macros I define to be highlighted as if they were Common Lisp functions or macros in ...
Rama Lakshmanan's user avatar
0 votes
1 answer
49 views

How do I change the default indentation of 'if' for Common Lisp and Scheme?

When I am using (setq lisp-indent-function 'common-lisp-indent-function), the ifs are indented like this: (if x y z) For Scheme, (setq lisp-indent-function 'scheme-indent-function) also ...
Flux's user avatar
  • 583
1 vote
1 answer
587 views

Company-yasnippet doesn't see yasnippet template in lisp

Config: (use-package yasnippet :ensure t :hook (prog-mode . yas-minor-mode) ) (use-package yasnippet-snippets :ensure t :after yas) (use-package common-lisp-snippets :ensure t :after ...
C-Entropy's user avatar
  • 143
2 votes
1 answer
335 views

Adjusting indenting for lisp if statements

I am learning common lisp and am trying to follow the style guide suggested by lisp-lang.org. In this style guide is an if statement style that I think makes the code more readable: (if (cond) (...
CL40's user avatar
  • 123
4 votes
3 answers
209 views

idiomatic way to lexically scope variables in a cl-loop body

Here is some asynchronous code in a cl-loop: ;;; foo.el --- -*- lexical-binding: t; -*- (let ((my-list '(a b c))) (cl-loop for index below (length my-list) ...
Damien Cassou's user avatar
1 vote
0 answers
122 views

Looking for something like cl-applicable-method-p

I am looking for something that could be used like this: (when (cl-applicable-method-p 'foo "arg") ...) I vaguely remember that I have seen that once and that it came with a comment saying that one ...
tarsius's user avatar
  • 25.1k
18 votes
1 answer
4k views

require 'cl or require 'cl-lib

In order to include Common Lisp compatibility I've seen both (require 'cl) and (require 'cl-lib) Which is correct? As I understand the cl-lib is the later of the two, but is it safe to use just ...
147pm's user avatar
  • 2,887
1 vote
1 answer
98 views

Unexpected indentation in backquoted list starting with comma function call

When I write a backquotedlist that starts with ,( emacs aligns the remaining items to the parenthesis and not to the comma; e.g.: (defun kb-test1 () `(,(hello) fdefef ,(fefesd))) (...
Kasper van den Berg's user avatar
1 vote
1 answer
642 views

Highlight labels/flet/macrolet definitions in lisp-mode

I found this solution (https://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00322.html, fully cited below), but it isn't working as expected. It highlights only the first definition inside labels/...
Danylo Fedorov's user avatar
5 votes
2 answers
207 views

How can I define new places for setf?

Q: how do I teach setf about new places it can set? In common lisp, one uses the macro defsetf to tell setf about new places it can set. In elisp, that macro exists in in the cl library, but, as far ...
Dan's user avatar
  • 32.3k
2 votes
1 answer
196 views

Why does this function stub not work using cl-letf?

I have written this simple function and I want to stub out the last functions so I don't actually launch a process. (defun dc-test-stub-process (command &rest params) (interactive) (let ((...
Oly's user avatar
  • 563
7 votes
3 answers
1k views

Is there an equivalent for defparameter on emacs-lisp?

I know we have defvar and setq. defvar has a special meaning on defining global variables because the assignment only happens once. So I was thinking about use setq to get the desired behavior of ...
Manoel Vilela's user avatar
6 votes
2 answers
2k views

Why does Emacs indent my Lisp LOOP construct weirdly?

I'm using Emacs and SLIME to edit Lisp code. By default, Emacs indents my Lisp LOOP constructs like this: (loop for x across dna1 for y across dna2 count (not (eql x y))) But I expect it to ...
Gustav Bertram's user avatar
0 votes
1 answer
240 views

Slime inspector customization (Common Lisp development)

Here follows Common Lisp code, using a datastore library named bknr.datastore (ql:quickload :bknr.datastore) (defclass userdata (bknr.datastore:store-object) ((email :initarg :email :index-...
engineerX's user avatar
  • 123
7 votes
2 answers
3k views

`case` doesn't switch correctly with strings

I have the following code which doesn't work: (eval-when-compile (require 'cl)) (setq mymachine (system-name)) (case mymachine ("HP" (setq package-user-dir (concat user-emacs-directory "packages/...
NVaughan's user avatar
  • 1,461
1 vote
1 answer
368 views

Error while trying to set a slot of a cl-struct

Using Emacs 25.1.50.1 To set the slot of a structure, I believe the elisp manual says to use setq along with the accessor function for the slot. Though I am having trouble. The following code ...
lookyhooky's user avatar
10 votes
2 answers
840 views

cl-destructuring-bind on partial plist?

This causes an error (cl-destructuring-bind (&key a b) '(:a "foo" :b 13 :c "bar") (list a b)) because the :c key/value is not handled in the pattern match. Often I find myself ...
fommil's user avatar
  • 1,730
2 votes
1 answer
968 views

How to use cl-labels?

I am trying to use cl-labels, but i have run into errors i do not understand. Here is elisp code i am using: (defun nthelt (N ARRAY) "Behaves like nth but for arrays" (if (and (>= N 0) ...
Srv19's user avatar
  • 479
0 votes
0 answers
260 views

Slime fuzzy completion not working correctly in TTY mode

I have Slime configured with fuzzy completion and it works perfectly when I'm using it in X11 mode (M-TAB, list of completions pops up in a separate buffer, C-n/p allows to choose the right completion,...
Wojciech Gac's user avatar
6 votes
2 answers
434 views

Why doesn't "complement" work as a function?

I'm trying to implement the complement function from Common Lisp (CL) in Emacs Lisp, but I'm confused by why defining it as a function (as opposed to a macro) does not work. The macro definition is ...
Tianxiang Xiong's user avatar
3 votes
2 answers
1k views

How to change Org-mode Babel lisp source code block from SLIME to SLY?

I found ob-lisp.el use SLIME by default to evaluate lisp code. I want to use SLY to evaluate lisp code. How to change it? I found the file ob-lisp.el is short. I tried to change slime to sly. But it ...
stardiviner's user avatar
  • 1,848
0 votes
1 answer
157 views

Direx not working, cl-call-next-method only inside primary and around methods

Setup: GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL Compiled from EmacsW64. Direx, using the latest version of Direx from MELPA Windows 7 x64 bit. Situation: I ...
ReneFroger's user avatar
  • 3,855
3 votes
3 answers
1k views

Good elisp tutorial for thorough Lisp understanding? [closed]

I've been in this catch-22 for a while now: I don't have time to learn Common Lisp first, then elisp, but I don't want to learn elisp without understanding the basic capabilities of Lisp. People have ...
147pm's user avatar
  • 2,887
7 votes
3 answers
3k views

Is using cl-lib crucial for writing good Emacs Lisp code?

As a beginner I understand that including cl-lib will allow me to use some code from Common Lisp. However, whenever I see this included in elisp code I wonder again, Should I really start with Common ...
147pm's user avatar
  • 2,887
2 votes
1 answer
1k views

Zip/Map functions ending when shortest list runs out

I wanted a function in the style of zip, but rather than stopping when one of the supplied lists runs out, I wanted it to continue using zip on the rest of the lists. Looking around at a few Emacs ...
user avatar
9 votes
2 answers
2k views

Modifying the indentation of some Emacs Lisp forms

I would like some Emacs Lisp forms to be indented like Common Lisp. For instance, in Emacs Lisp, if is indented like this: (if COND THEN ELSE) whilst I would prefer it like this: (if COND ...
Eleno's user avatar
  • 1,418
6 votes
1 answer
776 views

writing emacs extensions in common lisp or other languages

Some years ago, I was working on a personal project that seemed to work best with Emacs as the user interface, and Common Lisp (SBCL) as the back-end. The accepted answer on How to use SLIME as a ...
Joe Corneli's user avatar
  • 1,786
4 votes
0 answers
316 views

Slime creates new window every time you interact with the debugger

While using slime+emacs, I'm having a problem when interacting with the debugger: every time that I choose one of the debugger's option, a new window pops up in Emacs. For example, when evaluating: (...
EuAndreh's user avatar
  • 141
1 vote
1 answer
83 views

both keywordp and macrop then eval from a functionp

'Hope it won't bother my using defmacros named in the style of keywords (colon-prefixed, e.g., :set-this or :get-that): it apparently tricks ELisp from otherwise requiring quoted symbols (') or ...
sjb's user avatar
  • 101
1 vote
1 answer
541 views

How to set up Emacs with Clozure CL but without SLIME

I want to manually set up my own Emacs CL environment on Mac OS X 7 without the SLIME package i.e. it will only use Clozure CL. To put it other way, I want to use the Emacs CL just like I use the "...
Terry's user avatar
  • 370
0 votes
0 answers
415 views

SBCL and Slime do strange things when I try to use Serapeum

I'm getting very strange behaviour when I try to C-c C-k the following code into the SLIME REPL running SBCL: (eval-when (:compile-toplevel :load-toplevel :execute) (ql:quickload "serapeum")) (...
Koz Ross's user avatar
  • 425
15 votes
1 answer
717 views

How to use SLIME as a proxy between Common Lisp program and Emacs Lisp?

I'm looking into doing the following: I have a program written in Common Lisp, which I want to be able to communicate with Emacs. The program deals with natural language parsing, so the things I'd ...
wvxvw's user avatar
  • 11.1k
4 votes
1 answer
379 views

Creating permanent fixed buffer for CLHS lookup

Suppose I open one window with a Common Lisp file in it, and a second window with SLIME REPL in it (using M-x slime or whatever). Now, doing C-c C-d h with point on a Common Lisp keyword brings up a ...
Faheem Mitha's user avatar