Questions tagged [cl]

21 questions
21
votes
1 answer

How do I debug `Package cl is deprecated`?

While compiling an Elisp package from github, I get the Warning: Package cl is deprecated How do I find out what triggers it? The specific file that triggers this is tiny and has no CL code. I think there should be a way to turn the warning into…
sds
  • 5,928
  • 20
  • 39
9
votes
3 answers

Package cl is deprecated, is there any easy fix for it?

For the warning of Package cl is deprecated is there any easy fix for it? Here is a piece of code I copied from somewhere (that I don't know how to fix): (eval-when-compile (require 'cl)) (defun sanityinc/add-subdirs-to-load-path (parent-dir) …
xpt
  • 447
  • 3
  • 16
4
votes
1 answer

Difference between pcase-let & cl-destructuring-bind?

I noticed both pcase-let and cl-destructuring-bind seem to perform the same operation. Is there any difference or reason to use one instead of the other? eg: (pcase-let ((`(,filename ,buf) (pop filename-and-buffer-list))) ;; do stuff. ) Seems…
ideasman42
  • 8,375
  • 1
  • 28
  • 105
3
votes
0 answers

How to advise a CL method?

I am familiar with setting advice on a function: (advice-add 'some-tag :before 'function-being-advised (lambda (arg) (message "In advice with arg: %s" arg))) How do you advise a CL method on a class? (cl-defmethod my-class-foo ((obj…
Troy Daniels
  • 487
  • 2
  • 13
2
votes
4 answers

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 functions for common lisp also. I realise that this may…
Vinn
  • 263
  • 2
  • 7
2
votes
1 answer

Setf and pushnew do not work on slot "options" of org-export-backend defined by cl-defstruct

Org-mode export backends are defined as instances of the cl structure org-export-backend: (cl-defstruct (org-export-backend (:constructor org-export-create-backend) (:copier nil)) name parent transcoders options filters blocks…
Tobias
  • 32,569
  • 1
  • 34
  • 75
1
vote
1 answer

How to override read-only slot of cl-defstruct?

I'm dealing with a third-party package that uses Structures - cl-defstructs. One of the slots is :read-only t. I need to override that. I need to find a way to change the value in that slot and then pass the structure to a function, essentially…
iLemming
  • 1,223
  • 9
  • 14
1
vote
1 answer

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 question about control flow, not jumping to locations in…
HappyFace
  • 751
  • 4
  • 16
1
vote
1 answer

Matching against variable keys in `cl-case`

In cl-case clauses (though naturally not the initial keyform), keys are apparently quoted: (let ((mark ?.)) (case mark (mark 'mark) (?. ?.))) ; 46 (?.) (let ((mark ?.)) (case 'mark (mark 'mark) (?. ?.))) ; mark My reading of…
outis
  • 178
  • 8
1
vote
2 answers

Debugger entered--Lisp error: (wrong-type-argument sequencep all) cl-intersection((all magit) all)

I am trying to use magit-delta (https://github.com/dandavison/magit-delta). I am using GNU Emacs 26.3. When I add following line ( (magit-delta-mode 1) )into the .emacs file, I get following error: Debugger entered--Lisp error: (wrong-type-argument…
alper
  • 1,238
  • 11
  • 30
1
vote
1 answer

Does declare-function recognize functions declared via cl-defun?

It seems that declare-function + check-declare-file do not recognize functions defined via cl-defun. I was happy using declare-function because it comes with check-declare-file that actually checks whether the declaration is consistent with the…
phs
  • 1,095
  • 6
  • 13
0
votes
1 answer

Using advice-add to redefine a function call within another function

The function outshine-cycle (part of Outshine) calls the function indent-relative. I would like that instead, it called the function indent-for-tab-command. To do this, I want to advise the function outshine-cycle. I imagine this could look like…
scaramouche
  • 1,772
  • 10
  • 24
0
votes
0 answers

When using `cl-labels` or `cl-flet` shouldn't the compiler catch signature msmatches

I was expecting a compilation error for the snippet below... unfortunately compilation goes through without any errors, but it errors during runtime. Run-time error is expected, so no surprise there. The surprise is in not getting a compilation…
user39778
0
votes
2 answers

How do I properly use keyword/named arguments in a macro with cl-defmacro?

I'm trying to use cl-defmacro, with the supposed benefit of having optional arguments specified with keywords. However, I'm not getting the outcome I would expect. (cl-defmacro asd (a &rest body &key b) (format "%s %s %s" a b body)) (asd 1 :b 2…
aaa
  • 426
  • 3
  • 9
0
votes
0 answers

Problem with remove-if and cl-remove-if

I have a very useful bit of code in my .emacs file which closes all buffers except the current one, and scratch and TeX_snippets.org buffers: (defun my/kill-all-buffers-except-toolbox () "Kill all buffers except current one and toolkit…
sgmoye
  • 179
  • 1
  • 8
1
2