Re-worded skippable-bufers section.

This commit is contained in:
tastytea 2019-07-15 00:27:30 +02:00
parent e56a986046
commit c6a99e30d9

10
init.el
View File

@ -1,5 +1,5 @@
;;; init.el --- tastytea's Emacs init file. ;;; init.el --- tastytea's Emacs init file.
;; Time-stamp: <2019-07-13T19:28:42+00:00> ;; Time-stamp: <2019-07-14T22:25:59+00:00>
;;; Commentary: ;;; Commentary:
;; I am using this file with Emacs 26, but most of it will probably work with ;; I am using this file with Emacs 26, but most of it will probably work with
@ -137,17 +137,17 @@
(defvar my/never-skippable-buffers '("^\\*scratch\\*$") (defvar my/never-skippable-buffers '("^\\*scratch\\*$")
"Buffer names never ignored by `next-buffer' and `previous-buffer'.") "Buffer names never ignored by `next-buffer' and `previous-buffer'.")
(defun my/buffer-predicate (buffer) (defun my/buffer-predicate (buffer)
"Returns nil if `buffer'-name matches expression in `my/skippable-buffers'." "Returns nil if buffer-name matches expression in `my/skippable-buffers'."
(catch 'my-catch (catch 'return
;; Return t if buffer-name is on never-skippable list. ;; Return t if buffer-name is on never-skippable list.
(dolist (expression my/never-skippable-buffers) (dolist (expression my/never-skippable-buffers)
(if (string-match expression (buffer-name buffer)) (if (string-match expression (buffer-name buffer))
(throw 'my-catch t) (throw 'return t)
)) ))
;; Return nil if buffer-name is on skippable list. ;; Return nil if buffer-name is on skippable list.
(dolist (expression my/skippable-buffers) (dolist (expression my/skippable-buffers)
(if (string-match expression (buffer-name buffer)) (if (string-match expression (buffer-name buffer))
(throw 'my-catch nil) (throw 'return nil)
)) ))
t)) t))
(set-frame-parameter nil 'buffer-predicate 'my/buffer-predicate) (set-frame-parameter nil 'buffer-predicate 'my/buffer-predicate)