Browse Source

Remove Emacs 22 related code

* contrib/lisp/htmlize.el (htmlize-face-color-internal):
(htmlize-face-to-fstruct):
* lisp/org-agenda.el (org-anniversary):
(org-cyclic):
(org-block):
(org-date):
* lisp/org-compat.el (org-region-active-p):
* lisp/org.el (org-use-extra-keys):
(occur-mode-find-occurrence-hook): Remove Emacs 22 related code and
comments.

(org-diary-class): Remove function.
Nicolas Goaziou 3 years ago
parent
commit
2f90a60bd8
5 changed files with 23 additions and 97 deletions
  1. 2 23
      contrib/lisp/htmlize.el
  2. 8 31
      lisp/org-agenda.el
  3. 4 6
      lisp/org-compat.el
  4. 2 2
      lisp/org-mouse.el
  5. 7 35
      lisp/org.el

+ 2 - 23
contrib/lisp/htmlize.el

@@ -943,18 +943,7 @@ If no rgb.txt file is found, return nil."
   ;; frame parameters.
   (let* ((function (if fg #'face-foreground #'face-background))
 	 color)
-    (if (>= emacs-major-version 22)
-	;; For GNU Emacs 22+ set INHERIT to get the inherited values.
-	(setq color (funcall function face nil t))
-      (setq color (funcall function face))
-      ;; For GNU Emacs 21 (which has `face-attribute'): if the color
-      ;; is nil, recursively check for the face's parent.
-      (when (and (null color)
-		 (fboundp 'face-attribute)
-		 (face-attribute face :inherit)
-		 (not (eq (face-attribute face :inherit) 'unspecified)))
-	(setq color (htmlize-face-color-internal
-		     (face-attribute face :inherit) fg))))
+    (setq color (funcall function face nil t))
     (when (and (eq face 'default) (null color))
       (setq color (cdr (assq (if fg 'foreground-color 'background-color)
 			     (frame-parameters)))))
@@ -1132,17 +1121,7 @@ If no rgb.txt file is found, return nil."
                 (face-underline-p face)))
       ;; GNU Emacs
       (dolist (attr '(:weight :slant :underline :overline :strike-through))
-        (let ((value (if (>= emacs-major-version 22)
-                         ;; Use the INHERIT arg in GNU Emacs 22.
-                         (face-attribute face attr nil t)
-                       ;; Otherwise, fake it.
-                       (let ((face face))
-                         (while (and (eq (face-attribute face attr)
-                                         'unspecified)
-                                     (not (eq (face-attribute face :inherit)
-                                              'unspecified)))
-                           (setq face (face-attribute face :inherit)))
-                         (face-attribute face attr)))))
+        (let ((value (face-attribute face attr nil t)))
           (when (and value (not (eq value 'unspecified)))
             (htmlize-face-emacs21-attr fstruct attr value))))
       (let ((size (htmlize-face-size face)))

+ 8 - 31
lisp/org-agenda.el

@@ -5762,29 +5762,26 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
 
 ;; Calendar sanity: define some functions that are independent of
 ;; `calendar-date-style'.
-;; Normally I would like to use ISO format when calling the diary functions,
-;; but to make sure we still have Emacs 22 compatibility we bind
-;; also `european-calendar-style' and use european format
 (defun org-anniversary (year month day &optional mark)
   "Like `diary-anniversary', but with fixed (ISO) order of arguments."
   (with-no-warnings
-   (let ((calendar-date-style 'european) (european-calendar-style t))
-     (diary-anniversary day month year mark))))
+    (let ((calendar-date-style 'iso))
+      (diary-anniversary year month day mark))))
 (defun org-cyclic (N year month day &optional mark)
   "Like `diary-cyclic', but with fixed (ISO) order of arguments."
   (with-no-warnings
-   (let ((calendar-date-style 'european)	(european-calendar-style t))
-     (diary-cyclic N day month year mark))))
+    (let ((calendar-date-style 'iso))
+      (diary-cyclic N year month day mark))))
 (defun org-block (Y1 M1 D1 Y2 M2 D2 &optional mark)
   "Like `diary-block', but with fixed (ISO) order of arguments."
   (with-no-warnings
-   (let ((calendar-date-style 'european)	(european-calendar-style t))
-     (diary-block D1 M1 Y1 D2 M2 Y2 mark))))
+    (let ((calendar-date-style 'iso))
+      (diary-block Y1 M1 D1 Y2 M2 D2 mark))))
 (defun org-date (year month day &optional mark)
   "Like `diary-date', but with fixed (ISO) order of arguments."
   (with-no-warnings
-   (let ((calendar-date-style 'european)	(european-calendar-style t))
-     (diary-date day month year mark))))
+    (let ((calendar-date-style 'iso))
+      (diary-date year month day mark))))
 
 ;; Define the `org-class' function
 (defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks)
@@ -5811,26 +5808,6 @@ then those holidays will be skipped."
 	      (delq nil (mapcar (lambda(g) (member g skip-weeks)) h))))
      entry)))
 
-(defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks)
-  "Like `org-class', but honor `calendar-date-style'.
-The order of the first 2 times 3 arguments depends on the variable
-`calendar-date-style' or, if that is not defined, on `european-calendar-style'.
-So for American calendars, give this as MONTH DAY YEAR, for European as
-DAY MONTH YEAR, and for ISO as YEAR MONTH DAY.
-DAYNAME is a number between 0 (Sunday) and 6 (Saturday).  SKIP-WEEKS
-is any number of ISO weeks in the block period for which the item should
-be skipped.
-
-This function is here only for backward compatibility and it is deprecated,
-please use `org-class' instead."
-  (let* ((date1 (org-order-calendar-date-args m1 d1 y1))
-	 (date2 (org-order-calendar-date-args m2 d2 y2)))
-    (org-class
-     (nth 2 date1) (car date1) (nth 1 date1)
-     (nth 2 date2) (car date2) (nth 1 date2)
-     dayname skip-weeks)))
-(make-obsolete 'org-diary-class 'org-class "")
-
 (defalias 'org-get-closed 'org-agenda-get-progress)
 (defun org-agenda-get-progress ()
   "Return the logged TODO entries for agenda display."

+ 4 - 6
lisp/org-compat.el

@@ -217,12 +217,10 @@ ignored in this case."
   "Non-nil means temporarily disable the active region.")
 
 (defun org-region-active-p ()
-  "Is `transient-mark-mode' on and the region active?"
-  (if org-ignore-region
-      nil
-    (if (fboundp 'use-region-p)
-	(use-region-p)
-      (and transient-mark-mode mark-active)))) ; Emacs 22 and before
+  "Non-nil when the region active.
+Unlike to `use-region-p', this function also checks
+`org-ignore-region'."
+  (and (not org-ignore-region) (use-region-p)))
 
 (defun org-cursor-to-region-beginning ()
   (when (and (org-region-active-p)

+ 2 - 2
lisp/org-mouse.el

@@ -26,8 +26,8 @@
 ;;
 ;; http://orgmode.org
 ;;
-;; Org-mouse implements the following features:
-;; * following links with the left mouse button (in Emacs 22)
+;; Org mouse implements the following features:
+;; * following links with the left mouse button
 ;; * subtree expansion/collapse (org-cycle) with the left mouse button
 ;; * several context menus on the right mouse button:
 ;;    + general text

+ 7 - 35
lisp/org.el

@@ -51,11 +51,11 @@
 ;;
 ;; Documentation
 ;; -------------
-;; The documentation of Org-mode can be found in the TeXInfo file.  The
+;; The documentation of Org mode can be found in the TeXInfo file.  The
 ;; distribution also contains a PDF version of it.  At the homepage of
-;; Org-mode, you can read the same text online as HTML.  There is also an
+;; Org mode, you can read the same text online as HTML.  There is also an
 ;; excellent reference card made by Philip Rooke.  This card can be found
-;; in the etc/ directory of Emacs 22.
+;; in the doc/ directory.
 ;;
 ;; A list of recent changes can be found at
 ;; http://orgmode.org/Changes.html
@@ -1068,12 +1068,7 @@ become effective."
   "Non-nil means use extra key sequence definitions for certain commands.
 This happens automatically if `window-system' is nil.  This
 variable lets you do the same manually.  You must set it before
-loading org.
-
-Example: on Carbon Emacs 22 running graphically, with an external
-keyboard on a Powerbook, the default way of setting M-left might
-not work for either Alt or ESC.  Setting this variable will make
-it work for ESC."
+loading Org."
   :group 'org-startup
   :type 'boolean)
 
@@ -5451,8 +5446,6 @@ This variable is set by `org-before-change-function'.
 (defvar buffer-face-mode-face)
 
 (require 'outline)
-(when (and (not (keymapp outline-mode-map)) (featurep 'allout))
-  (error "Conflict with outdated version of allout.el.  Load org.el before allout.el, or upgrade to newer allout, for example by switching to Emacs 22"))
 
 ;; Other stuff we need.
 (require 'time-date)
@@ -22644,27 +22637,8 @@ block from point."
 	     files)
      regexp)))
 
-(if (boundp 'occur-mode-find-occurrence-hook)
-    ;; Emacs 23
-    (add-hook 'occur-mode-find-occurrence-hook
-	      (lambda ()
-		(when (derived-mode-p 'org-mode)
-		  (org-reveal))))
-  ;; Emacs 22
-  (defadvice occur-mode-goto-occurrence
-      (after org-occur-reveal activate)
-    (and (derived-mode-p 'org-mode) (org-reveal)))
-  (defadvice occur-mode-goto-occurrence-other-window
-      (after org-occur-reveal activate)
-    (and (derived-mode-p 'org-mode) (org-reveal)))
-  (defadvice occur-mode-display-occurrence
-      (after org-occur-reveal activate)
-    (when (derived-mode-p 'org-mode)
-      (let ((pos (occur-mode-find-occurrence)))
-	(with-current-buffer (marker-buffer pos)
-	  (save-excursion
-	    (goto-char pos)
-	    (org-reveal)))))))
+(add-hook 'occur-mode-find-occurrence-hook
+	  (lambda () (when (derived-mode-p 'org-mode) (org-reveal))))
 
 (defun org-occur-link-in-agenda-files ()
   "Create a link and search for it in the agendas.
@@ -24285,9 +24259,7 @@ empty."
   "Move to the heading line of which the present line is a subheading.
 This function considers both visible and invisible heading lines.
 With argument, move up ARG levels."
-  (if (fboundp 'outline-up-heading-all)
-      (outline-up-heading-all arg)   ; emacs 21 version of outline.el
-    (outline-up-heading arg t)))     ; emacs 22 version of outline.el
+  (outline-up-heading arg t))
 
 (defun org-up-heading-safe ()
   "Move to the heading line of which the present line is a subheading.