From: Stefan Kangas Date: Fri, 5 Feb 2021 00:33:25 +0000 (+0100) Subject: Remove Emacs 20 compat code for header-line-format X-Git-Tag: emacs-28.0.90~3929 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=574f71b739cf07aed1f2c8ba7e17cd12ae482c7c;p=emacs.git 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. --- diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el index f8d6bb759b0..0de66d29e3e 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 37e4cc39d53..dd7f50fb381 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 c0a6d16c6f8..6dc1c7ebc2b 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)