Questions tagged [declare]

9 questions
3
votes
1 answer

How to access the declare specifications of a function

How does one access the declare specification of a function? Edit: After the answer of npostavs I have to correct myself. As long as a function is not byte-compiled the declare forms are still in its symbol-function. Where do they go after…
Tobias
  • 32,569
  • 1
  • 34
  • 75
1
vote
1 answer

`completion` In Declare Form Not Working

Why is this function: (defun shyn/func () (declare (completion (lambda (symbol current-buffer) nil))) (interactive)) still listed by pressing M-x TAB in buffer *scratch*? 13.14 The declare Form: (completion…
shynur
  • 4,065
  • 1
  • 3
  • 23
1
vote
0 answers

Effect of `modes` In Declare Form

13.14 The declare Form: (modes MODES) Specify that this command is meant to be applicable for MODES only. What is the practical effect of (modes ...) in declare form? I find that I can still call function shyn/func: (defun shyn/func () (declare…
shynur
  • 4,065
  • 1
  • 3
  • 23
1
vote
0 answers

How to change this slime configuration on the init file from the classic imperative installation to a declarative approach via use-package?

When I first installed Slime, I used to install things via the classic M-x and package-install. Then, I inserted the following configuration: (slime-setup '(slime-fancy slime-asdf slime-indentation slime-sbcl-exts slime-scratch)) (setq…
Pedro Delfino
  • 1,369
  • 3
  • 13
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
1
vote
0 answers

How do you debug edebug specs?

As I write progressively more ambitious macros I find my (declare (debug specs)) more involved. There're times where I really wish I could step debug the spec matching itself, or at least perform the match on some form given a spec. Looks like…
zeRusski
  • 335
  • 1
  • 8
1
vote
3 answers

Using 'package as a filename in a declare-function statement?

I just saw this line near the top of the file use-package.el: (declare-function package-installed-p 'package) How can 'package be a useful 2nd argument, when the doc for declare-function says that the third argument should be a filename?
Kevin
  • 1,308
  • 8
  • 20
1
vote
0 answers

How do I teach edebug to only evaluate some macro arguments?

Currently, edebug doesn't understand the ->> macro in dash.el. (defun foo () (->> (+ 1 1) (+ 2) (* 3) (format "%s"))) C-u M-x edebug-eval-defun followed by M-: (foo) does not step through the forms inside ->>. It just shows…
Wilfred Hughes
  • 6,890
  • 2
  • 29
  • 59
0
votes
2 answers

How to fix byte compiler warnings for "Unused lexical variable" in a macro?

I have a macro and a function which uses it: (defmacro oauth2-auto--query-case (&rest cases) "Handle HTTP queries based on the keys present in ‘query-alist’. ‘query-alist’ is a free variable, bound by the caller of this macro. Each element of…
telotortium
  • 233
  • 1
  • 7