[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 574f71b 2/5: Remove Emacs 20 compat code for header-line-format
From: |
Stefan Kangas |
Subject: |
master 574f71b 2/5: Remove Emacs 20 compat code for header-line-format |
Date: |
Thu, 4 Feb 2021 21:10:54 -0500 (EST) |
branch: master
commit 574f71b739cf07aed1f2c8ba7e17cd12ae482c7c
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Remove Emacs 20 compat code for header-line-format
* lisp/cedet/semantic/util-modes.el (semantic-stickyfunc-mode):
* lisp/erc/erc.el (erc-update-mode-line-buffer):
* lisp/ibuffer.el (ibuffer-use-header-line): Remove Emacs 20 compat
code; header-line-format is always defined starting with Emacs 21.
---
lisp/cedet/semantic/util-modes.el | 4 ---
lisp/erc/erc.el | 51 +++++++++++++++++++--------------------
lisp/ibuffer.el | 2 +-
3 files changed, 26 insertions(+), 31 deletions(-)
diff --git a/lisp/cedet/semantic/util-modes.el
b/lisp/cedet/semantic/util-modes.el
index f8d6bb7..0de66d2 100644
--- a/lisp/cedet/semantic/util-modes.el
+++ b/lisp/cedet/semantic/util-modes.el
@@ -691,10 +691,6 @@ non-nil if the minor mode is enabled."
;; Disable minor mode if semantic stuff not available
(setq semantic-stickyfunc-mode nil)
(error "Buffer %s was not set up for parsing" (buffer-name)))
- (unless (boundp 'header-line-format)
- ;; Disable if there are no header lines to use.
- (setq semantic-stickyfunc-mode nil)
- (error "Sticky Function mode requires Emacs"))
;; Enable the mode
;; Save previous buffer local value of header line format.
(when (and (local-variable-p 'header-line-format (current-buffer))
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 37e4cc3..dd7f50f 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -6464,32 +6464,31 @@ if `erc-away' is non-nil."
(setq mode-line-buffer-identification
(list (format-spec erc-mode-line-format spec)))
(setq mode-line-process (list process-status))
- (when (boundp 'header-line-format)
- (let ((header (if erc-header-line-format
- (format-spec erc-header-line-format spec)
- nil)))
- (cond (erc-header-line-uses-tabbar-p
- (setq-local tabbar--local-hlf header-line-format)
- (kill-local-variable 'header-line-format))
- ((null header)
- (setq header-line-format nil))
- (erc-header-line-uses-help-echo-p
- (let ((help-echo (with-temp-buffer
- (insert header)
- (fill-region (point-min) (point-max))
- (buffer-string))))
- (setq header-line-format
- (replace-regexp-in-string
- "%"
- "%%"
- (if face
- (propertize header 'help-echo help-echo
- 'face face)
- (propertize header 'help-echo help-echo))))))
- (t (setq header-line-format
- (if face
- (propertize header 'face face)
- header)))))))
+ (let ((header (if erc-header-line-format
+ (format-spec erc-header-line-format spec)
+ nil)))
+ (cond (erc-header-line-uses-tabbar-p
+ (setq-local tabbar--local-hlf header-line-format)
+ (kill-local-variable 'header-line-format))
+ ((null header)
+ (setq header-line-format nil))
+ (erc-header-line-uses-help-echo-p
+ (let ((help-echo (with-temp-buffer
+ (insert header)
+ (fill-region (point-min) (point-max))
+ (buffer-string))))
+ (setq header-line-format
+ (replace-regexp-in-string
+ "%"
+ "%%"
+ (if face
+ (propertize header 'help-echo help-echo
+ 'face face)
+ (propertize header 'help-echo help-echo))))))
+ (t (setq header-line-format
+ (if face
+ (propertize header 'face face)
+ header))))))
(force-mode-line-update)))
(defun erc-update-mode-line (&optional buffer)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index c0a6d16..6dc1c7e 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -303,7 +303,7 @@ This variable takes precedence over filtering, and even
in completion lists of the `ibuffer-jump-to-buffer' command."
:type 'boolean)
-(defcustom ibuffer-use-header-line (boundp 'header-line-format)
+(defcustom ibuffer-use-header-line t
"If non-nil, display a header line containing current filters."
:type 'boolean)