Questions tagged [keywords]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
41 views

Does `:` as the first character of a symbol name have a special meaning?

If I run (plist-get '(A 4 B 3) 'B) I get 3 as expected. I understand that I must quote B, otherwise (plist-get '(A 4 B 3) B) causes an error: elisp--eval-last-sexp: Symbol’s value as variable ...
Picaud Vincent's user avatar
1 vote
1 answer
34 views

How to check if a symbol is a keyword?

Values typically passed as property keys are typed symbol, eg: (type-of :test) => symbol However symbol type also covers t, nil end 'test. Is there a convenient way to check for a colon prefixed ...
ideasman42's user avatar
  • 8,187
7 votes
1 answer
729 views

What does “:” mean in elisp?

Does the : have a special meaning in Elisp? (define-minor-mode dap-mode "Global minor mode for DAP mode." :init-value nil :group 'dap-mode :...
David's user avatar
  • 281
0 votes
1 answer
106 views

What is the difference between Workflow states vs Types in org-mode?

In org-mode, what is the difference between TODO workflow states and TODO types? They looks and seems the same. Here's a simple workflow states: (setq org-todo-keywords '((sequence &...
JB Juliano's user avatar
3 votes
1 answer
101 views

Adding new keywords delimeters

I am new to the Emacs (Doom Emacs to be precise) scene, and recently I came up with a minor mode that could come in handy for me so I decided to implement it. To achieve the full functionality of my ...
Marcos Álvarez's user avatar
1 vote
0 answers
233 views

Defining a function that takes keyword arguments and a variable number of positional ones

I want to define a function that takes both keyword arguments (as in &key) and a variable number of positional ones (&rest). They should be independent of each other, the keyword list should ...
Nova's user avatar
  • 1,049
9 votes
4 answers
2k views

How to use keyword symbols in Emacs Lisp?

According to Symbol Type A symbol whose name starts with a colon (‘:’) is called a keyword symbol. These symbols automatically act as constants, and are normally used only by comparing an unknown ...
Searene's user avatar
  • 469
0 votes
2 answers
102 views

How to raise an error when unrecogized keyword arguments are passed to a function?

With a function that uses keyword arguments using this style of function definition: (defun some-name (&rest kwargs) (plist-get kwargs 'example)) Is there a convenient way to ensure only ...
ideasman42's user avatar
  • 8,187
0 votes
1 answer
72 views

Inline elements of variable list value in rx() macro call [duplicate]

Is there a more compact way to make use of the rx macro in cases where we want to inline a list of strings from a variable? Such as (defconst c++20-new-keywords-list (list "char8_t" "import" ...
Nordlöw's user avatar
  • 467
1 vote
0 answers
600 views

Loading new agenda keywords (org-todo-keywords) is broken for me - bug in Emacs?

Objective I decided to add custom agenda keywords (I'm still setting up the environment, don't have any agenda files yet) and I used this example code from some tutorial: (setq org-todo-keywords ...
Patrick's user avatar
  • 11
1 vote
0 answers
50 views

Is there a canonical way to convert a keyword to a symbol with no :?

I want to convert keywords, e.g. :some-key to a plain symbol like some-key. I currently do this with: (intern-soft (substring (symbol-name :some-key) 1)) Is there a better way?
John Kitchin's user avatar
  • 11.5k
7 votes
1 answer
2k views

Use of keyword symbols in property lists

According to the Emacs Lisp manual http://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html A symbol whose name starts with a colon (‘:’) is called a keyword symbol. These ...
Håkon Hægland's user avatar