(repeat . t)
(run-if . ,(lambda ()
(and (not (eq '- current-prefix-arg))
- (not (apply #'provided-mode-derived-p
- major-mode align-tex-modes))))))
+ (not (derived-mode-p align-tex-modes))))))
;; With a negative prefix argument, lists of dollar figures will
;; be aligned.
This is decided by the `modes' and `run-if' keys in the alist
RULE. Their meaning is documented in `align-rules-list' (which see)."
(let-alist rule
- (not (or (and .modes (not (apply #'derived-mode-p (eval .modes))))
+ (not (or (and .modes (not (derived-mode-p (eval .modes))))
(and .run-if (not (funcall .run-if)))))))
(defun align-region (beg end separate rules exclude-rules
(replace-match (nth 1 value) t t nil 2))
(forward-line)))
(if buf
- (when (derived-mode-p 'todo-mode 'todo-archive-mode)
+ (when (derived-mode-p '(todo-mode todo-archive-mode))
(todo-category-select))
(save-buffer)
(kill-buffer)))))))))
(replace-match value t t nil 1)
(forward-line)))
(if buf
- (when (derived-mode-p 'todo-mode 'todo-archive-mode)
+ (when (derived-mode-p '(todo-mode todo-archive-mode))
(todo-category-select))
(save-buffer)
(kill-buffer)))))))))
(replace-match value t t nil 1)
(forward-line)))
(if buf
- (when (derived-mode-p 'todo-mode 'todo-archive-mode)
+ (when (derived-mode-p '(todo-mode todo-archive-mode))
(todo-category-select))
(save-buffer)
(kill-buffer)))))))))
See options: `dired-hide-details-hide-symlink-targets' and
`dired-hide-details-hide-information-lines'."
:group 'dired
- (unless (derived-mode-p 'dired-mode 'wdired-mode)
+ (unless (derived-mode-p '(dired-mode wdired-mode))
(error "Not a Dired buffer"))
(dired-hide-details-update-invisibility-spec)
(if dired-hide-details-mode
completes."
:group 'dired
:lighter " Click-To-Select"
- (unless (derived-mode-p 'dired-mode 'wdired-mode)
+ (unless (derived-mode-p '(dired-mode wdired-mode))
(error "Not a Dired buffer"))
(if dired-click-to-select-mode
(setq-local tool-bar-map
(throw 'found nil))
((and (consp elem)
(eq (car elem) 'not))
- (when (apply #'derived-mode-p (cdr elem))
+ (when (derived-mode-p (cdr elem))
(throw 'found nil)))
((symbolp elem)
(when (derived-mode-p elem)
))
(viper-set-expert-level 'dont-change-unless)))
- (or (apply #'derived-mode-p viper-emacs-state-mode-list) ; don't switch to Vi
- (apply #'derived-mode-p viper-insert-state-mode-list) ; don't switch
+ (or (derived-mode-p viper-emacs-state-mode-list) ; don't switch to Vi
+ (derived-mode-p viper-insert-state-mode-list) ; don't switch
(viper-change-state-to-vi))
))
;; that are not listed in viper-vi-state-mode-list
(defun viper-this-major-mode-requires-vi-state (mode)
(let ((major-mode mode))
- (cond ((apply #'derived-mode-p viper-vi-state-mode-list) t)
- ((apply #'derived-mode-p viper-emacs-state-mode-list) nil)
- ((apply #'derived-mode-p viper-insert-state-mode-list) nil)
+ (cond ((derived-mode-p viper-vi-state-mode-list) t)
+ ((derived-mode-p viper-emacs-state-mode-list) nil)
+ ((derived-mode-p viper-insert-state-mode-list) nil)
(t (and (eq (key-binding "a") 'self-insert-command)
(eq (key-binding " ") 'self-insert-command))))))
(not (get sym 'byte-obsolete-info))
;; Ignore everything bound.
(not (where-is-internal sym nil t))
- (apply #'derived-mode-p (command-modes sym)))
+ (derived-mode-p (command-modes sym)))
(push sym functions))))
(with-temp-buffer
(when functions
(defun bug-reference--try-setup-gnus-article ()
(when (and bug-reference-mode ;; Only if enabled in article buffers.
(derived-mode-p
- 'gnus-article-mode
- ;; Apparently, gnus-article-prepare-hook is run in the
- ;; summary buffer...
- 'gnus-summary-mode)
+ '(gnus-article-mode
+ ;; Apparently, `gnus-article-prepare-hook' is run in the
+ ;; summary buffer...
+ gnus-summary-mode))
gnus-article-buffer
gnus-original-article-buffer
(buffer-live-p (get-buffer gnus-article-buffer))
res)
(let ((buffer (car buffers)))
(with-current-buffer buffer
- (if (derived-mode-p 'c-ts-mode 'c++-ts-mode)
+ (if (derived-mode-p '(c-ts-mode c++-ts-mode))
(loop (append res (list buffer)) (cdr buffers))
(loop res (cdr buffers))))))))
To set the default indent style globally, use
`c-ts-mode-set-global-style'."
(interactive (list (c-ts-mode--prompt-for-style)))
- (if (not (derived-mode-p 'c-ts-mode 'c++-ts-mode))
+ (if (not (derived-mode-p '(c-ts-mode c++-ts-mode)))
(user-error "The current buffer is not in `c-ts-mode' nor `c++-ts-mode'")
(setq-local c-ts-mode-indent-style style)
(setq treesit-simple-indent-rules
(gud-def gud-pp
(gud-call
(concat
- "pp " (if (eq (buffer-local-value
- 'major-mode (window-buffer)) 'speedbar-mode)
- (gdb-find-watch-expression) "%e")) arg)
+ "pp " (if (eq (buffer-local-value 'major-mode (window-buffer))
+ 'speedbar-mode)
+ (gdb-find-watch-expression) "%e"))
+ arg)
nil "Print the Emacs s-expression.")
(define-key gud-minor-mode-map [left-margin mouse-1]
(gdb-set-window-buffer
(gdb-get-buffer-create
'gdb-registers-buffer
- gdb-thread-number) t)))
+ gdb-thread-number)
+ t)))
map))
(define-derived-mode gdb-locals-mode gdb-parent-mode "Locals"
(gdb-set-window-buffer
(gdb-get-buffer-create
'gdb-locals-buffer
- gdb-thread-number) t)))
+ gdb-thread-number)
+ t)))
(define-key map "f" #'gdb-registers-toggle-filter)
map))
not including main command buffer (the one where you type GDB
commands) or source buffers (that display program source code)."
(with-current-buffer buffer
- (derived-mode-p 'gdb-parent-mode 'gdb-inferior-io-mode)))
+ (derived-mode-p '(gdb-parent-mode gdb-inferior-io-mode))))
(defun gdb--buffer-type (buffer)
"Return the type of BUFFER if it is a function buffer.
;; Display prompt and wait for quick reply
(message "%s[%s]" prompt
(mapconcat (lambda(x) (char-to-string (car x)))
- keys-alist ""))
+ keys-alist))
(if (sit-for delay)
;; No quick reply: Show help
(save-window-excursion
;; If this is the OBJ_NEW function, try to figure out the class and use
;; the keywords from the corresponding INIT method.
(if (and (equal (upcase name) "OBJ_NEW")
- (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
+ (derived-mode-p '(idlwave-mode idlwave-shell-mode)))
(let* ((bos (save-excursion (idlwave-beginning-of-statement) (point)))
(string (buffer-substring bos (point)))
(case-fold-search t)
If FLAG is nil, just uses `current-word'.
Otherwise scans backward for most likely Tcl command word."
(if (and flag
- (derived-mode-p 'tcl-mode 'inferior-tcl-mode))
+ (derived-mode-p '(tcl-mode inferior-tcl-mode)))
(condition-case nil
(save-excursion
;; Look backward for first word actually in alist.
(if (memq char '(?\[ ?\] ?{ ?} ?\\ ?\" ?$ ?\s ?\;))
(concat "\\" (char-to-string char))
(char-to-string char)))
- string ""))
+ string))
\f
"Say whether MODES are in action in BUFFER.
This is the case if either the major mode is derived from one of MODES,
or (if one of MODES is a minor mode), if it is switched on in BUFFER."
- (or (apply #'provided-mode-derived-p
- (buffer-local-value 'major-mode buffer)
- modes)
+ (or (provided-mode-derived-p (buffer-local-value 'major-mode buffer) modes)
;; It's a minor mode.
(seq-intersection modes
(buffer-local-value 'local-minor-modes buffer)
(not so-long--inhibited)
(not so-long--calling)
(or (eq so-long-target-modes t)
- (apply #'derived-mode-p so-long-target-modes))
+ (derived-mode-p so-long-target-modes))
(setq so-long-detected-p (funcall so-long-predicate))
;; `so-long' should be called; but only if and when the buffer is
;; displayed in a window. Long lines in invisible buffers are generally
(if-not-mode (not (if (atom if-not-mode)
(eq major-mode if-not-mode)
(memq major-mode if-not-mode))))
- (if-derived (if (atom if-derived)
+ (if-derived (if (or (atom if-derived) (>= emacs-major-version 30))
(derived-mode-p if-derived)
(apply #'derived-mode-p if-derived)))
- (if-not-derived (not (if (atom if-not-derived)
+ (if-not-derived (not (if (or (atom if-not-derived)
+ (>= emacs-major-version 30))
(derived-mode-p if-not-derived)
(apply #'derived-mode-p if-not-derived))))
(t default)))
((derived-mode-p 'log-edit-mode) log-edit-vc-backend)
((derived-mode-p 'diff-mode) diff-vc-backend)
((or (null vc-deduce-backend-nonvc-modes)
- (apply #'derived-mode-p vc-deduce-backend-nonvc-modes))
+ (derived-mode-p vc-deduce-backend-nonvc-modes))
(ignore-errors (vc-responsible-backend default-directory)))
(vc-mode (vc-backend buffer-file-name))))
((eq whitespace-global-modes t))
((listp whitespace-global-modes)
(if (eq (car-safe whitespace-global-modes) 'not)
- (not (apply #'derived-mode-p (cdr whitespace-global-modes)))
- (apply #'derived-mode-p whitespace-global-modes)))
+ (not (derived-mode-p (cdr whitespace-global-modes)))
+ (derived-mode-p whitespace-global-modes)))
(t nil))
;; ...we have a display (not running a batch job)
(not noninteractive)
(dolist (window windows)
(let ((mode?
(with-current-buffer (window-buffer window)
- (cond ((memq major-mode allowed-modes)
- 'same)
- ((apply #'derived-mode-p allowed-modes)
- 'derived)))))
+ (cond ((memq major-mode allowed-modes) 'same)
+ ((derived-mode-p allowed-modes) 'derived)))))
(when (and mode?
(not (and inhibit-same-window-p
(eq window curwin))))