Skip to main content

Questions tagged [conditionals]

Questions about conditionals: cond, if, when, unless.

0 votes
1 answer
71 views

My minor-mode is inserting text in the current buffer. I want the default format of the text to be different depending on what major-mode the buffer is in, and to allow the user to override this ...
pelle's user avatar
  • 1
-1 votes
2 answers
72 views

Could I write the if condition on the same line. Is there any other way to include the equivalent of the if conditional in a more compact way ? (pcase grapheme ("dinkus" (if (...
user avatar
0 votes
2 answers
222 views

In the question Optional parameter defaults, the suggested way to set default value for the parameter of an elisp function is along the lines of: (defun my-command (a &optional b) (command-...
tinlyx's user avatar
  • 1,454
-2 votes
1 answer
51 views

Am using an optional argument and want to use cond to execute (do-this) if actm is present and matches 'regexp, and (do-that) otherwise. Is the following the correct way to do it, or am I missing ...
Dilna's user avatar
  • 1,473
0 votes
1 answer
26 views

Am doing the following computation where dmax is 8, whilst dcur start at 1 and increases bf increments of 1. I would like that when (mod dcur dmax) is 0, I use the value 8 rather than the value 0. (...
Dilna's user avatar
  • 1,473
0 votes
2 answers
58 views

This is the procedural logic I want to program in Elisp: def my_func(): v1; v2; if (some_condition): v1 = 2 v2 = 3 else: v1 = 4 v2 = 5 foo(v1) ...
Gradient's user avatar
  • 231
0 votes
1 answer
58 views

I am new to Emacs Lisp. I have this price table in Org mode. A small portion of it is shown here: *** Destinations en France | Destination | Distance Km | Temps de trajet | Prix | |-...
alikgator's user avatar
3 votes
2 answers
349 views

Consider the following form: (pcase '(:def "k" #'foo :wk "ho") (`(:def ,(and (or (pred stringp) (pred vectorp)) key) ,(and (pred xl-sharp-quoted-symbol-p) def) :wk ...
Aquaactress's user avatar
  • 1,503

15 30 50 per page