Questions tagged [arguments]
The arguments tag has no usage guidance.
24
questions
2
votes
1answer
40 views
How to introspect function & macro arguments in elisp?
Is there a programmatic way to access function/macro arguments,
Something like this, which returns the the arg count and true if it accepts any number of additional arguments.
eg:
(number-of-...
1
vote
1answer
24 views
Use Elisp macro instead of two function arguments?
Is the following sort of shortcut macro possible to implement?
(defmacro region-end-beg ()
"Replacement for '(region-end) (region-begin)' in source code"
(...))
So that
(buffer-substring (region-...
1
vote
2answers
95 views
Problem with giving inputs to a function programmatically
Some programs take user inputs, for example by calling the interactive function `sunrise-sunset', two arguments are taken from the user. Assume that the inputs are 0.0098 and 51.4934 (these are ...
0
votes
1answer
27 views
How to check whether an optional param was input?
I have a command with an optional argument whose value is a number.
I need:
If no input argument then use default value (1000) else use input arg.
(random t)
(defun insert-random-number-at-point(&...
5
votes
2answers
63 views
What is a good strategy to locating function arguments in a buffer?
I'd like to create a few routines for manipulating function arguments in buffers, which of course requires me to first locate the arguments. Suppose that I'm operating on a buffer with a programming ...
0
votes
0answers
43 views
How to pass an argument to an object constructor that's NOT a slot?
Q: how can I pass an argument to an object constructor that
won't be interpreted as a slot?
I am creating an instance of a class. The value of one of its
slots depends on another slot and auxiliary ...
1
vote
2answers
37 views
advice-add FOR function dired-do-copy
I got a problem for an advice-add inside Dired's copy function (dired-do-copy).
My object is it to filter all marked files/directories in Dired, which should be copied to an other location within ...
2
votes
2answers
49 views
Arbitrary length lists as argument for interactive function
Say I have a defun with a dolist inside that I want to be able to pass a string that is then converted to a list with a length equal to the number of words in said string via the minibuffer, so ...
1
vote
1answer
174 views
Show constructor arguments for c++
Is there a package that can tell me the arguments for c++ constructor?
class T1 {
public:
T1(int x, int y);
};
T1::T1(int x, int y) {
std::cout << x+y << std::endl;
}
...
2
votes
1answer
65 views
Find out about arguments passed to functions
When I press C-h k C-SPC, Emacs shows me:
C-SPC runs the command set-mark-command (found in global-map), which
is an interactive compiled Lisp function.
It is bound to C-@, C-SPC.
(set-...
3
votes
1answer
74 views
Was Emacs launched with a filename argument?
Suppose I want Emacs to be configured differently depending on whether or not it was launched with a filename as an argument.
Is there a way I can deduce this as part of my init file?
One way is to ...
4
votes
2answers
269 views
Reflection on function argument signatures
Is there anything built into elisp for reflection on function argument signatures?
I have used (length (cadr (symbol-function #'my/function))), but this notably fails on built-in C functions.
I'm ...
4
votes
2answers
153 views
Calling a function with a shorter but unknown argument signature length
Is there a terse idiomatic way of calling a function in the manner of funcall (dereferencing function symbols) when that function may have a variably shorter function signature?
Say for example: a ...
2
votes
2answers
134 views
Can I pass an arbitrary symbol/keyword as a non-nil argument?
If a function takes a parameter whose only significance is in whether it's nil or non-nil, is there any reason not to pass it a well-named symbol to clarify what's going on in the calling code?
For ...
6
votes
2answers
81 views
Is there a way to only accept certain arguments to a function?
I want to write a function where the only two valid values for the input argument are "dag" or "rulegraph". Is there a way to specify that only these two arguments are accepted this in the elisp ...
1
vote
1answer
135 views
How does (org-agenda-todo arg) work? What does the argument mean?
By trial and error I have found that in org-agenda (org-agenda-todo 'done) marks the entry at point as "DONE".
Can you explain why?
How can I modify the argument to the org-agenda-todo function (or ...
0
votes
1answer
80 views
How can I use a var to provide multiple arguments to a function? [duplicate]
Here is a simple example in which I would like to replace
(start-process "ls" "*temp*" "ls" "-l" "-a" "-t" "-r") ; this works
with
(setq some-var ????) ; <-- Need to figure this part out
(start-...
2
votes
2answers
227 views
How to pass an argument from command to another command?
From the package Neotree, I want to bind a key, that moves to the upper directory.
The upper directory is always on the top with .. (up a dir). So I go to the first line of the neotree buffer, and ...
3
votes
2answers
3k views
Error: Wrong type argument: symbolp, (t)
I'm new to emacs and try to learn elisp. I've read some tutorials and try to build now my own customized emacs. Looking at this blog I want to write a similar script for automatically installing ...
12
votes
2answers
670 views
How to manipulate argument list in nadvice.el?
Following on from an answer to another question about the new advice system:
In old-style advice.el, it was possible to manipulate individual members of an advised function's argument list, without ...
10
votes
3answers
943 views
How to write a transparent “pass-through” function wrapper?
What I mean by a "transparent 'pass-through' function wrapper" is a function, let's call it wrapper, that returns the result from passing all its argument to some other function, let's call it wrappee....
8
votes
1answer
503 views
How to programmatically answer “yes” to those commands that prompt for a decision from the user?
I made a custom function that combines two functions of twittering-mode , twittering-favorite and twittering-native-retweet, however these two needs input from me by answering an yes or no question.
...
1
vote
1answer
88 views
How to figure out which parameters a function actually need?
I would like to insert the number 1, and then increase the number with calling
the function evil-numbers/inc-at-pt from the package evil-numbers.
So I went looking into the source code of the ...
2
votes
1answer
109 views
turn a list into a set of arguments for a function [duplicate]
I have a defun get-quotes with one mandatory and 2 optional arguments. I would like to do something like this:
(let ((articles
'("/home/matt/art/mice.pdf" '("/home/matt/art/cats.pdf" "Smith, ...