Questions tagged [arguments]

"arguments" refer to those inputs to a function or program which are configurable by the caller, potentially differing on each call. Every argument is an input, but not every input is an argument -- for instance, a stream of data from a mouse could be an input and not an argument.

57 questions
8
votes
1 answer

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. I want to know if there is a way to wrap those…
shackra
  • 2,782
  • 19
  • 49
3
votes
2 answers

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 required packages. In the blog the author defines a…
user8
  • 171
  • 2
  • 11
1
vote
1 answer

Wrong type argument in conditional

I have the following code that counts the number of opening and closing braces, but getting the error and: Wrong type argument: stringp, 40 Here is the code: (defcustom rk-bracemk '("()" "[]" "{}" "<>") "Two-character strings of open and…
Dilna
  • 1
  • 3
  • 11
1
vote
1 answer

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 function evil-numbers/inc-at-pt: (defun…
ReneFroger
  • 3,850
  • 23
  • 66
0
votes
3 answers

Function with DEEP parameter that in body of other function gets list of the arguments of its ancestor functions

I need a function with DEEP parameter that if it is placed in the body of another function returns the list of the arguments of the ancestor function depending on DEEP parameter. If DEEP = 0 returns list arguments of its parent function IF DEEP = 1…
0
votes
1 answer

Using ignore function with a more appropriate name

I want to use the function ignore but I want a more meaningful name when using its functionality of not doing anything. Would like to make a function that takes the same argument possibilities as ignore and pass them to the ignare function. How can…
Dilna
  • 1
  • 3
  • 11
0
votes
1 answer

Printing an alist to a specific buffer

I have the following code to print an alist. But I now want to recode this in a way that one can specify the buffer used for display. In addition, I would like that whether on not to erase the buffer is optional (not erasing the buffer as…
Dilna
  • 1
  • 3
  • 11
0
votes
2 answers

How to write a function that handles its argument

I would like to implement a sensible strategy for handling optional arguments. In this instance, I want the function to be as for a function like abbrev-mode (although not in the context of a minor mode): If called interactively, toggle…
Dilna
  • 1
  • 3
  • 11
0
votes
3 answers

Handling empty function optional argument

This function starts a new named shell buffer. How can I handle the case where bufrnm set by interactive in empty? (defun galaxy-shell (&optional bufrnm) "TODO" (interactive "s Buffer_name: ") (if bufrnm (let ( (bufrnam…
Dilna
  • 1
  • 3
  • 11
0
votes
1 answer

Handling optional arguments

This function makes a new named buffer that can run shell commands. But it only works properly when no argument is passed. When an argument is passed or set through the interactive clause, I would like that the buffer name takes the argument value…
Dilna
  • 1
  • 3
  • 11
0
votes
1 answer

Set an empty string for function argument with list

I have a function argument and want to set an empty string for name and mode. What can I do? (defun bench (&optional name mode prefix) "DOCSTRING" (interactive (cond ((equal current-prefix-arg nil) (list …
Dilna
  • 1
  • 3
  • 11
0
votes
1 answer

Passing variable to a function consisting of multiple components

Consider the following example: (defun glue (str1 str2) (format "%s%s" str1 str2)) (setq str1 "Hello, ") (setq str2 "World!") (insert (glue str1 str2)) This inserts Hello, World! into a buffer. I want to let the user define the format set in…
-1
votes
1 answer

Changing of function arguments

I have a function workbench-named declared as follows, that calls another one called workbench. Have changed workbench to include a prefix argument. Thusly workbench-named is not calling workbench properly as it assumes that name is the first…
Dilna
  • 1
  • 3
  • 11