diff options
| author | Stefan Kangas | 2021-02-05 01:33:25 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2021-02-05 01:33:25 +0100 |
| commit | 574f71b739cf07aed1f2c8ba7e17cd12ae482c7c (patch) | |
| tree | 203018465e2e57a1f748476a70a791b1ccbaae39 | |
| parent | 1a35d2e67375f0ffe0a749a2488e13f9d96cd994 (diff) | |
| download | emacs-574f71b739cf07aed1f2c8ba7e17cd12ae482c7c.tar.gz emacs-574f71b739cf07aed1f2c8ba7e17cd12ae482c7c.zip | |
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.
| -rw-r--r-- | lisp/cedet/semantic/util-modes.el | 4 | ||||
| -rw-r--r-- | lisp/erc/erc.el | 51 | ||||
| -rw-r--r-- | 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 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." | |||
| 691 | ;; Disable minor mode if semantic stuff not available | 691 | ;; Disable minor mode if semantic stuff not available |
| 692 | (setq semantic-stickyfunc-mode nil) | 692 | (setq semantic-stickyfunc-mode nil) |
| 693 | (error "Buffer %s was not set up for parsing" (buffer-name))) | 693 | (error "Buffer %s was not set up for parsing" (buffer-name))) |
| 694 | (unless (boundp 'header-line-format) | ||
| 695 | ;; Disable if there are no header lines to use. | ||
| 696 | (setq semantic-stickyfunc-mode nil) | ||
| 697 | (error "Sticky Function mode requires Emacs")) | ||
| 698 | ;; Enable the mode | 694 | ;; Enable the mode |
| 699 | ;; Save previous buffer local value of header line format. | 695 | ;; Save previous buffer local value of header line format. |
| 700 | (when (and (local-variable-p 'header-line-format (current-buffer)) | 696 | (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." | |||
| 6464 | (setq mode-line-buffer-identification | 6464 | (setq mode-line-buffer-identification |
| 6465 | (list (format-spec erc-mode-line-format spec))) | 6465 | (list (format-spec erc-mode-line-format spec))) |
| 6466 | (setq mode-line-process (list process-status)) | 6466 | (setq mode-line-process (list process-status)) |
| 6467 | (when (boundp 'header-line-format) | 6467 | (let ((header (if erc-header-line-format |
| 6468 | (let ((header (if erc-header-line-format | 6468 | (format-spec erc-header-line-format spec) |
| 6469 | (format-spec erc-header-line-format spec) | 6469 | nil))) |
| 6470 | nil))) | 6470 | (cond (erc-header-line-uses-tabbar-p |
| 6471 | (cond (erc-header-line-uses-tabbar-p | 6471 | (setq-local tabbar--local-hlf header-line-format) |
| 6472 | (setq-local tabbar--local-hlf header-line-format) | 6472 | (kill-local-variable 'header-line-format)) |
| 6473 | (kill-local-variable 'header-line-format)) | 6473 | ((null header) |
| 6474 | ((null header) | 6474 | (setq header-line-format nil)) |
| 6475 | (setq header-line-format nil)) | 6475 | (erc-header-line-uses-help-echo-p |
| 6476 | (erc-header-line-uses-help-echo-p | 6476 | (let ((help-echo (with-temp-buffer |
| 6477 | (let ((help-echo (with-temp-buffer | 6477 | (insert header) |
| 6478 | (insert header) | 6478 | (fill-region (point-min) (point-max)) |
| 6479 | (fill-region (point-min) (point-max)) | 6479 | (buffer-string)))) |
| 6480 | (buffer-string)))) | 6480 | (setq header-line-format |
| 6481 | (setq header-line-format | 6481 | (replace-regexp-in-string |
| 6482 | (replace-regexp-in-string | 6482 | "%" |
| 6483 | "%" | 6483 | "%%" |
| 6484 | "%%" | 6484 | (if face |
| 6485 | (if face | 6485 | (propertize header 'help-echo help-echo |
| 6486 | (propertize header 'help-echo help-echo | 6486 | 'face face) |
| 6487 | 'face face) | 6487 | (propertize header 'help-echo help-echo)))))) |
| 6488 | (propertize header 'help-echo help-echo)))))) | 6488 | (t (setq header-line-format |
| 6489 | (t (setq header-line-format | 6489 | (if face |
| 6490 | (if face | 6490 | (propertize header 'face face) |
| 6491 | (propertize header 'face face) | 6491 | header)))))) |
| 6492 | header))))))) | ||
| 6493 | (force-mode-line-update))) | 6492 | (force-mode-line-update))) |
| 6494 | 6493 | ||
| 6495 | (defun erc-update-mode-line (&optional buffer) | 6494 | (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 | |||
| 303 | in completion lists of the `ibuffer-jump-to-buffer' command." | 303 | in completion lists of the `ibuffer-jump-to-buffer' command." |
| 304 | :type 'boolean) | 304 | :type 'boolean) |
| 305 | 305 | ||
| 306 | (defcustom ibuffer-use-header-line (boundp 'header-line-format) | 306 | (defcustom ibuffer-use-header-line t |
| 307 | "If non-nil, display a header line containing current filters." | 307 | "If non-nil, display a header line containing current filters." |
| 308 | :type 'boolean) | 308 | :type 'boolean) |
| 309 | 309 | ||