Remove XEmacs and ancient Emacs compat code

* lisp/org-colview.el (org-columns-remove-overlays):
* lisp/org-ctags.el (org-ctags-find-tag-interactive):
* lisp/org-macs.el (org-fit-window-to-buffer):
* lisp/org-mouse.el (org-mouse-show-context-menu):
* lisp/org-table.el (org-table-fedit-lisp-indent):
* lisp/org.el (org-version, org-reload):
* lisp/ox-html.el (org-html-template, org-html--build-meta-info):
Remove Emacs 21 and 22 compat code.

* lisp/ol-eww.el (org-eww-copy-for-org-mode):
* lisp/ol-w3m.el (org-w3m-copy-for-org-mode):
* lisp/org-clock.el (org-clock-select-task):
* lisp/org-macs.el (org-fit-window-to-buffer):
* lisp/org-refile.el (org-refile):
* lisp/org.el (org-change-tag-in-region): Remove XEmacs compat code.

* lisp/org-goto.el (org-goto--set-map):
* lisp/org-macs.el (org-fit-window-to-buffer):
* lisp/org-table.el (orgtbl-mode):
* lisp/org.el (org-setup-filling): Remove XEmacs or Emacs 19 or 20
compat code.  (It is one of these; not clear which.)
This commit is contained in:
Stefan Kangas 2021-09-26 21:29:25 +02:00 committed by Ihor Radchenko
parent 9632401dc6
commit 45174d62b9
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
13 changed files with 28 additions and 46 deletions

View File

@ -107,7 +107,7 @@ keep the structure of the Org file."
(setq transform-start (region-beginning))
(setq transform-end (region-end))
;; Deactivate mark if current mark is activate.
(when (fboundp 'deactivate-mark) (deactivate-mark)))
(deactivate-mark))
(message "Transforming links...")
(save-excursion
(goto-char transform-start)

View File

@ -72,7 +72,7 @@ so that it can be yanked into an Org buffer with links working correctly."
(setq transform-start (region-beginning))
(setq transform-end (region-end))
;; Deactivate mark if current mark is activate.
(when (fboundp 'deactivate-mark) (deactivate-mark)))
(deactivate-mark))
(message "Transforming links...")
(save-excursion
(goto-char transform-start)

View File

@ -661,7 +661,6 @@ there is no recent clock to choose from."
(if (< i 10)
(+ i ?0)
(+ i (- ?A 10))) m))
(if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
(push s sel-list)))
(run-hooks 'org-clock-before-select-task-hook)
(goto-char (point-min))

View File

@ -513,8 +513,7 @@ for the duration of the command.")
(defun org-columns-remove-overlays ()
"Remove all currently active column overlays."
(interactive)
(when (and (fboundp 'face-remap-remove-relative)
org-columns-header-line-remap)
(when org-columns-header-line-remap
(face-remap-remove-relative org-columns-header-line-remap)
(setq org-columns-header-line-remap nil))
(when org-columns-overlays

View File

@ -509,10 +509,7 @@ Uses `ido-mode' if available.
If the user enters a string that does not match an existing tag, create
a new topic."
(interactive)
(let* ((completing-read-fn (if (fboundp 'ido-completing-read)
'ido-completing-read
'completing-read))
(tag (funcall completing-read-fn "Topic: " org-ctags-tag-list
(let* ((tag (ido-completing-read "Topic: " org-ctags-tag-list
nil 'confirm nil 'org-ctags-find-tag-history)))
(when tag
(cond

View File

@ -110,10 +110,8 @@ When nil, you can use these keybindings to navigate the buffer:
(org-defkey map [(down)] 'outline-next-visible-heading)
(org-defkey map [(up)] 'outline-previous-visible-heading)
(if org-goto-auto-isearch
(if (fboundp 'define-key-after)
(define-key-after map [t] 'org-goto-local-auto-isearch)
nil)
(org-defkey map "q" 'org-goto-quit)
(define-key-after map [t] 'org-goto-local-auto-isearch)
(org-defkey map "q" 'org-goto-quit)
(org-defkey map "n" 'outline-next-visible-heading)
(org-defkey map "p" 'outline-previous-visible-heading)
(org-defkey map "f" 'outline-forward-same-level)

View File

@ -70,6 +70,7 @@
,@body)
(set-buffer-modified-p ,was-modified)))))
;; FIXME: `partial-completion-mode' is obsolete since Emacs 24.1.
(defmacro org-without-partial-completion (&rest body)
(declare (debug (body)))
`(if (and (boundp 'partial-completion-mode)
@ -220,14 +221,12 @@ WINDOW defaults to the selected window. MAX-HEIGHT and MIN-HEIGHT are
passed through to `fit-window-to-buffer'. If SHRINK-ONLY is set, call
`shrink-window-if-larger-than-buffer' instead, the height limit is
ignored in this case."
(cond ((if (fboundp 'window-full-width-p)
(not (window-full-width-p window))
;; Do nothing if another window would suffer.
(> (frame-width) (window-width window))))
((and (fboundp 'fit-window-to-buffer) (not shrink-only))
(cond ((not (window-full-width-p window))
;; Do nothing if another window would suffer.
)
((not shrink-only)
(fit-window-to-buffer window max-height min-height))
((fboundp 'shrink-window-if-larger-than-buffer)
(shrink-window-if-larger-than-buffer window)))
(t (shrink-window-if-larger-than-buffer window)))
(or window (selected-window)))
(defun org-buffer-list (&optional predicate exclude-tmp)

View File

@ -217,10 +217,7 @@ this function is called. Otherwise, the current major mode menu is used."
(sit-for 0))
(if (functionp org-mouse-context-menu-function)
(funcall org-mouse-context-menu-function event)
(if (fboundp 'mouse-menu-major-mode-map)
(popup-menu (mouse-menu-major-mode-map) event prefix)
(with-no-warnings ; don't warn about fallback, obsolete since 23.1
(mouse-major-mode-menu event prefix)))))
(popup-menu (mouse-menu-major-mode-map) event prefix)))
(setq this-command 'mouse-save-then-kill)
(mouse-save-then-kill event)))

View File

@ -367,6 +367,7 @@ returned list."
ret)
l)))
;; `flatten-tree' was added in Emacs 27.1.
(defalias 'org-protocol-flatten
(if (fboundp 'flatten-tree) 'flatten-tree
(lambda (list)

View File

@ -577,7 +577,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
(with-demoted-errors "Bookmark set error: %S"
(bookmark-set bookmark-name))))
(move-marker org-capture-last-stored-marker (point)))
(when (fboundp 'deactivate-mark) (deactivate-mark))
(deactivate-mark)
(run-hooks 'org-after-refile-insert-hook)))
(unless org-refile-keep
(if regionp

View File

@ -3667,8 +3667,6 @@ With prefix ARG, apply the new formulas to the table."
(goto-char pos)
(call-interactively 'lisp-indent-line))
((looking-at "[$&@0-9a-zA-Z]+ *= *[^ \t\n']") (goto-char pos))
((not (fboundp 'pp-buffer))
(user-error "Cannot pretty-print. Command `pp-buffer' is not available"))
((looking-at "[$&@0-9a-zA-Z]+ *= *'(")
(goto-char (- (match-end 0) 2))
(setq beg (point))
@ -5167,15 +5165,13 @@ When LOCAL is non-nil, show references for the table at point."
(concat orgtbl-line-start-regexp "\\|"
auto-fill-inhibit-regexp)
orgtbl-line-start-regexp))
(when (fboundp 'font-lock-add-keywords)
(font-lock-add-keywords nil orgtbl-extra-font-lock-keywords)
(org-restart-font-lock)))
(font-lock-add-keywords nil orgtbl-extra-font-lock-keywords)
(org-restart-font-lock))
(t
(setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
(remove-hook 'before-change-functions 'org-before-change-function t)
(when (fboundp 'font-lock-remove-keywords)
(font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords)
(org-restart-font-lock))
(font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords)
(org-restart-font-lock)
(force-mode-line-update 'all))))
(defun orgtbl-make-binding (fun n &rest keys)

View File

@ -358,7 +358,7 @@ In non-interactive uses, a reduced version string is output unless
FULL is given."
(interactive (list current-prefix-arg t (not current-prefix-arg)))
(let ((org-dir (ignore-errors (org-find-library-dir "org")))
(save-load-suffixes (when (boundp 'load-suffixes) load-suffixes))
(save-load-suffixes load-suffixes)
(load-suffixes (list ".el"))
(org-install-dir
(ignore-errors (org-find-library-dir "org-loaddefs"))))
@ -11458,7 +11458,7 @@ This works in the agenda, and also in an Org buffer."
(progn
(message "[s]et or [r]emove? ")
(equal (read-char-exclusive) ?r))))
(when (fboundp 'deactivate-mark) (deactivate-mark))
(deactivate-mark)
(let ((agendap (equal major-mode 'org-agenda-mode))
l1 l2 m buf pos newhead (cnt 0))
(goto-char end)
@ -17908,7 +17908,6 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
feats)))
'string-lessp)
(list "org-version" "org")))
(load-suffixes (when (boundp 'load-suffixes) load-suffixes))
(load-suffixes (if uncompiled (reverse load-suffixes) load-suffixes))
load-uncore load-misses)
(setq load-misses
@ -18706,14 +18705,12 @@ assumed to be significant there."
(defun org-setup-filling ()
(require 'org-element)
;; Prevent auto-fill from inserting unwanted new items.
(when (boundp 'fill-nobreak-predicate)
(setq-local
fill-nobreak-predicate
(org-uniquify
(append fill-nobreak-predicate
'(org-fill-line-break-nobreak-p
org-fill-n-macro-as-item-nobreak-p
org-fill-paragraph-with-timestamp-nobreak-p)))))
(setq-local fill-nobreak-predicate
(org-uniquify
(append fill-nobreak-predicate
'(org-fill-line-break-nobreak-p
org-fill-n-macro-as-item-nobreak-p
org-fill-paragraph-with-timestamp-nobreak-p))))
(let ((paragraph-ending (substring org-element-paragraph-separate 1)))
(setq-local paragraph-start paragraph-ending)
(setq-local paragraph-separate paragraph-ending))

View File

@ -1884,7 +1884,6 @@ INFO is a plist used as a communication channel."
;; empty, which is invalid.
(title (if (org-string-nw-p title) title "&lrm;"))
(charset (or (and org-html-coding-system
(fboundp 'coding-system-get)
(symbol-name
(coding-system-get org-html-coding-system
'mime-charset)))
@ -2071,7 +2070,7 @@ holding export options."
(format "%s\n"
(format decl
(or (and org-html-coding-system
(fboundp 'coding-system-get)
;; FIXME: Use Emacs 22 style here, see `coding-system-get'.
(coding-system-get org-html-coding-system 'mime-charset))
"iso-8859-1"))))))
(org-html-doctype info)