emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8834776 3/4: Remove Emacs 20 compat code from idlwave.el


From: Stefan Kangas
Subject: master 8834776 3/4: Remove Emacs 20 compat code from idlwave.el
Date: Fri, 20 Nov 2020 10:12:52 -0500 (EST)

branch: master
commit 8834776b140c7ffec127316e53b778c15550d5e3
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Remove Emacs 20 compat code from idlwave.el
    
    * lisp/progmodes/idlwave.el (idlwave-indent-line)
    (idlwave-toggle-comment-region, idlwave-reset-sintern)
    (idlwave-unit-name, idlwave-mode-menu-def)
    (idlwave-create-customize-menu): Remove Emacs 20 compat code.
---
 lisp/progmodes/idlwave.el | 57 ++++++++++++++++-------------------------------
 1 file changed, 19 insertions(+), 38 deletions(-)

diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 6dd8853..44bdd91 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -2776,10 +2776,7 @@ If the optional argument EXPAND is non-nil then the 
actions in
         ;; Adjust parallel comment
        (end-of-line)
        (if (idlwave-in-comment)
-           ;; Emacs 21 is too smart with fill-column on comment indent
-           (let ((fill-column (if (fboundp 'comment-indent-new-line)
-                                  (1- (frame-width))
-                                fill-column)))
+            (let ((fill-column (1- (frame-width))))
              (indent-for-comment)))))
     (goto-char mloc)
     ;; Get rid of marker
@@ -3991,12 +3988,7 @@ blank lines."
       ;; skip blank lines
       (skip-chars-forward " \t\n")
       (if (looking-at (concat "[ \t]*\\(" comment-start "+\\)"))
-         (if (fboundp 'uncomment-region)
-             (uncomment-region beg end)
-           (comment-region beg end
-                           (- (length (buffer-substring
-                                       (match-beginning 1)
-                                       (match-end 1))))))
+          (uncomment-region beg end)
        (comment-region beg end)))))
 
 
@@ -4042,11 +4034,6 @@ blank lines."
 (defun idlwave-reset-sintern (&optional what)
   "Reset all sintern hashes."
   ;; Make sure the hash functions are accessible.
-  (unless (and (fboundp 'gethash)
-               (fboundp 'puthash))
-    (require 'cl)
-    (or (fboundp 'puthash)
-        (defalias 'puthash 'cl-puthash)))
   (let ((entries '((idlwave-sint-routines 1000 10)
                   (idlwave-sint-keywords 1000 10)
                   (idlwave-sint-methods   100 10)
@@ -8886,9 +8873,7 @@ Assumes that point is at the beginning of the unit as 
found by
   (let ((begin (point)))
     (re-search-forward
      "[a-zA-Z_][a-zA-Z0-9$_]+\\(::[a-zA-Z_][a-zA-Z0-9$_]+\\)?")
-    (if (fboundp 'buffer-substring-no-properties)
-        (buffer-substring-no-properties begin (point))
-      (buffer-substring begin (point)))))
+    (buffer-substring-no-properties begin (point))))
 
 (defalias 'idlwave-function-menu
   (condition-case nil
@@ -9004,8 +8989,7 @@ Assumes that point is at the beginning of the unit as 
found by
     ("Customize"
      ["Browse IDLWAVE Group" idlwave-customize t]
      "--"
-     ["Build Full Customize Menu" idlwave-create-customize-menu
-      (fboundp 'customize-menu-create)])
+     ["Build Full Customize Menu" idlwave-create-customize-menu t])
     ("Documentation"
      ["Describe Mode" describe-mode t]
      ["Abbreviation List" idlwave-list-abbrevs t]
@@ -9045,24 +9029,21 @@ Assumes that point is at the beginning of the unit as 
found by
 (defun idlwave-create-customize-menu ()
   "Create a full customization menu for IDLWAVE, insert it into the menu."
   (interactive)
-  (if (fboundp 'customize-menu-create)
-      (progn
-       ;; Try to load the code for the shell, so that we can customize it
-       ;; as well.
-       (or (featurep 'idlw-shell)
-           (load "idlw-shell" t))
-       (easy-menu-change
-        '("IDLWAVE") "Customize"
-        `(["Browse IDLWAVE group" idlwave-customize t]
-          "--"
-          ,(customize-menu-create 'idlwave)
-          ["Set" Custom-set t]
-          ["Save" Custom-save t]
-          ["Reset to Current" Custom-reset-current t]
-          ["Reset to Saved" Custom-reset-saved t]
-          ["Reset to Standard Settings" Custom-reset-standard t]))
-       (message "\"IDLWAVE\"-menu now contains full customization menu"))
-    (error "Cannot expand menu (outdated version of cus-edit.el)")))
+  ;; Try to load the code for the shell, so that we can customize it
+  ;; as well.
+  (or (featurep 'idlw-shell)
+      (load "idlw-shell" t))
+  (easy-menu-change
+   '("IDLWAVE") "Customize"
+   `(["Browse IDLWAVE group" idlwave-customize t]
+     "--"
+     ,(customize-menu-create 'idlwave)
+     ["Set" Custom-set t]
+     ["Save" Custom-save t]
+     ["Reset to Current" Custom-reset-current t]
+     ["Reset to Saved" Custom-reset-saved t]
+     ["Reset to Standard Settings" Custom-reset-standard t]))
+  (message "\"IDLWAVE\"-menu now contains full customization menu"))
 
 (defun idlwave-show-commentary ()
   "Use the finder to view the file documentation from `idlwave.el'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]