unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
blob 561e2ec7c8690ae58616e5fd51daa2b3cce2c85e 5710 bytes (raw)
name: lisp/mh-e/mh-compat.el 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
 
;;; mh-compat.el --- make MH-E compatible with various versions of Emacs  -*- lexical-binding: t; -*-

;; Copyright (C) 2006-2021 Free Software Foundation, Inc.

;; Author: Bill Wohler <wohler@newt.com>
;; Keywords: mail
;; See: mh-e.el

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;;; Code:

;; This is a good place to gather code that is used for compatibility
;; between different versions of Emacs. Please document which versions
;; of Emacs that the defsubst, defalias, or defmacro applies. That
;; way, it's easy to occasionally go through this file and see which
;; macros we can retire.

;; Please use mh-gnus.el when providing compatibility with different
;; versions of Gnus.

;; Items are listed alphabetically.

(eval-when-compile (require 'mh-acros))

(define-obsolete-function-alias 'mh-require #'require "29.1")
(define-obsolete-function-alias 'mh-assoc-string #'assoc-string "29.1")
(define-obsolete-function-alias 'mh-cancel-timer #'cancel-timer "29.1")

;; Emacs 24 made flet obsolete and suggested either cl-flet or
;; cl-letf. This macro is based upon gmm-flet from Gnus.
(defmacro mh-flet (bindings &rest body)
  "Make temporary overriding function definitions.
This is an analogue of a dynamically scoped `let' that operates on
the function cell of FUNCs rather than their value cell.

\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
  (declare (indent 1) (debug ((&rest (sexp sexp &rest form)) &rest form)))
  (if (fboundp 'cl-letf)
      `(cl-letf ,(mapcar (lambda (binding)
                           `((symbol-function ',(car binding))
                             (lambda ,@(cdr binding))))
                         bindings)
         ,@body)
    `(flet ,bindings ,@body)))

(define-obsolete-function-alias 'mh-display-color-cells
  #'display-color-cells "29.1")

(defmacro mh-display-completion-list (completions &optional common-substring)
  "Display the list of COMPLETIONS.
See documentation for `display-completion-list' for a description of the
arguments COMPLETIONS.
The optional argument COMMON-SUBSTRING, if non-nil, should be a string
specifying a common substring for adding the faces
`completions-first-difference' and `completions-common-part' to
the completions."
  (cond ((< emacs-major-version 22) `(display-completion-list ,completions))
        ((fboundp 'completion-hilit-commonality) ; Emacs 23.1 and later
         `(display-completion-list
           (completion-hilit-commonality ,completions
                                         ,(length common-substring) nil)))
        (t                              ; Emacs 22
         `(display-completion-list ,completions ,common-substring))))

(define-obsolete-function-alias 'mh-face-foreground
  #'face-foreground "29.1")

(define-obsolete-function-alias 'mh-face-background
  #'face-background "29.1")

(define-obsolete-function-alias 'mh-font-lock-add-keywords
  #'font-lock-add-keywords "29.1")

;; Not preloaded in without-x builds.
(declare-function image-load-path-for-library "image")
(define-obsolete-function-alias 'mh-image-load-path-for-library
  #'image-load-path-for-library "29.1")

;; Not preloaded in without-x builds.
(declare-function image-search-load-path "image")
(define-obsolete-function-alias 'mh-image-search-load-path
  #'image-search-load-path "29.1")

(define-obsolete-function-alias 'mh-line-beginning-position
  #'line-beginning-position "29.1")

(define-obsolete-function-alias 'mh-line-end-position
  #'line-end-position "29.1")

(require 'mailabbrev nil t)
(define-obsolete-function-alias 'mh-mail-abbrev-make-syntax-table
  #'mail-abbrev-make-syntax-table "29.1")

(define-obsolete-function-alias 'mh-define-obsolete-variable-alias
  #'define-obsolete-variable-alias "29.1")

(define-obsolete-function-alias 'mh-make-obsolete-variable
  #'make-obsolete-variable "29.1")

(define-obsolete-function-alias 'mh-match-string-no-properties
  #'match-string-no-properties "29.1")

(define-obsolete-function-alias 'mh-replace-regexp-in-string
  #'replace-regexp-in-string "29.1")

(define-obsolete-function-alias 'mh-test-completion
  #'test-completion "29.1")

(defconst mh-url-unreserved-chars
  '(
    ?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z
       ?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z
       ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9
       ?- ?_ ?. ?! ?~ ?* ?' ?\( ?\))
  "A list of characters that are _NOT_ reserved in the URL spec.
This is taken from RFC 2396.")
(make-obsolete-variable 'mh-url-unreserved-chars 'url-unreserved-chars "29.1")

(define-obsolete-function-alias 'mh-url-hexify-string
  #'url-hexify-string "29.1")

(define-obsolete-function-alias 'mh-view-mode-enter
  #'view-mode-enter "29.1")

(define-obsolete-function-alias 'mh-window-full-height-p
  #'window-full-height-p "29.1")

(defmacro mh-write-file-functions ()
  "Return `write-file-functions'. "
  (declare (obsolete nil "29.1"))
  ''write-file-functions)

(provide 'mh-compat)

;; Local Variables:
;; indent-tabs-mode: nil
;; sentence-end-double-space: nil
;; End:

;;; mh-compat.el ends here

debug log:

solving 561e2ec7c8 ...
found 561e2ec7c8 in https://yhetil.org/emacs-bugs/87a6jfkza3.fsf@tcd.ie/
found 839379857f in https://git.savannah.gnu.org/cgit/emacs.git
preparing index
index prepared:
100644 839379857f3c5770e9a1d3bbc89d55251dda6517	lisp/mh-e/mh-compat.el

applying [1/1] https://yhetil.org/emacs-bugs/87a6jfkza3.fsf@tcd.ie/
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 839379857f..561e2ec7c8 100644

Checking patch lisp/mh-e/mh-compat.el...
Applied patch lisp/mh-e/mh-compat.el cleanly.

index at:
100644 561e2ec7c8690ae58616e5fd51daa2b3cce2c85e	lisp/mh-e/mh-compat.el

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).