comparison lisp/emacs-lisp/checkdoc.el @ 41222:3d601db16361

(princ-list, checkdoc-read-event, add-to-list): Delete compatibility code. (checkdoc-next-message-error): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Sat, 17 Nov 2001 22:51:11 +0000
parents 14c471312660
children 45db352a0971
comparison
equal deleted inserted replaced
41221:b6fd3363a398 41222:3d601db16361
447 (defalias 'checkdoc-overlay-end 'overlay-end) 447 (defalias 'checkdoc-overlay-end 'overlay-end)
448 (defalias 'checkdoc-mode-line-update 'force-mode-line-update) 448 (defalias 'checkdoc-mode-line-update 'force-mode-line-update)
449 (defalias 'checkdoc-call-eval-buffer 'eval-current-buffer) 449 (defalias 'checkdoc-call-eval-buffer 'eval-current-buffer)
450 ) 450 )
451 451
452 ;; Emacs 20 has this handy function.
453 (if (not (fboundp 'princ-list))
454 (defun princ-list (&rest args)
455 "Call `princ' on ARGS."
456 (mapcar 'princ args)))
457
458 ;; Emacs 20s have MULE characters which don't equate to numbers. 452 ;; Emacs 20s have MULE characters which don't equate to numbers.
459 (if (fboundp 'char=) 453 (if (fboundp 'char=)
460 (defalias 'checkdoc-char= 'char=) 454 (defalias 'checkdoc-char= 'char=)
461 (defalias 'checkdoc-char= '=)) 455 (defalias 'checkdoc-char= '=))
462 456
463 ;; Emacs 19.28 and earlier don't have the handy 'add-to-list function 457 ;; Read events, not characters
464 (if (fboundp 'add-to-list) 458 (defalias 'checkdoc-read-event 'read-event)
465
466 (defalias 'checkdoc-add-to-list 'add-to-list)
467
468 (defun checkdoc-add-to-list (list-var element)
469 "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet."
470 (if (not (member element (symbol-value list-var)))
471 (set list-var (cons element (symbol-value list-var)))))
472 )
473
474 ;; To be safe in new Emacsen, we want to read events, not characters
475 (if (fboundp 'read-event)
476 (defalias 'checkdoc-read-event 'read-event)
477 (defalias 'checkdoc-read-event 'read-char))
478 459
479 ;;; User level commands 460 ;;; User level commands
480 ;; 461 ;;
481 ;;;###autoload 462 ;;;###autoload
482 (defun checkdoc () 463 (defun checkdoc ()
762 ;; Quit.. restore position, Other errors, leave alone 743 ;; Quit.. restore position, Other errors, leave alone
763 (quit (goto-char p))) 744 (quit (goto-char p)))
764 msg))) 745 msg)))
765 746
766 (defun checkdoc-next-message-error (enable-fix) 747 (defun checkdoc-next-message-error (enable-fix)
767 "Find and return the next checkdoc mesasge related error list, or nil. 748 "Find and return the next checkdoc message related error list, or nil.
768 Only text for error and `y-or-n-p' strings are checked. See 749 Only text for error and `y-or-n-p' strings are checked. See
769 `checkdoc-next-error' for details on the return value. 750 `checkdoc-next-error' for details on the return value.
770 Argument ENABLE-FIX turns on the auto-fix feature. This argument 751 Argument ENABLE-FIX turns on the auto-fix feature. This argument
771 assumes that the cursor is already positioned to perform the fix." 752 assumes that the cursor is already positioned to perform the fix."
772 (if enable-fix 753 (if enable-fix