Questions tagged [boolean]
7 questions
24
votes
3 answers
How to choose between nil and 0, or t and 1 when setting variables or enabling modes
I understand that nil, 0 and/or -1 are used for disabling some features and t, 1 and/or +1 are used for enabling some features. When assigning variables or enabling/disabling minor modes, which should I choose?
I have seen all of these variations…

greduan
- 343
- 2
- 6
10
votes
3 answers
What Emacs Lisp boolean/logical convenience functions exist?
What boolean/logical convenience functions / macros are available for Emacs Lisp in either the core set of functions or external packages?
I'm interested in just about anything other than the built-in logical operators in and, or, not (null) and…

ebpa
- 7,449
- 29
- 55
9
votes
2 answers
Understanding elisp idiom(boolean values vs. quoted arguments)?
I have some basic questions about elisp.
I often see something like
(search-forward "something" nil 'noerror)
And sometimes I see something like
(search-forward "something" nil :noerror)
What is the difference and should I prefer one form over…

clemera
- 3,451
- 14
- 40
0
votes
1 answer
why does this function return integers instead of `t` or `nil`
Why does this function print non-zero integers on non-empty lines?
;; taken from https://emacs.stackexchange.com/a/16826/10896
(defun current-line-empty-p ()
(interactive)
(setq answer (string-match-p "^\\s-*$" (thing-at-point 'line)))
…

smilingbuddha
- 1,201
- 10
- 26