Mercurial > hg > xemacs-beta
comparison lisp/simple.el @ 5655:b7ae5f44b950
Remove some redundant functions, change others to labels, lisp/
lisp/ChangeLog addition:
2012-05-05 Aidan Kehoe <kehoea@parhasard.net>
Remove some redundant functions; turn other utility functions into
labels, avoiding visibility in the global namespace, and reducing
the size of the dumped binary.
* auto-save.el (auto-save-unhex): Removed.
* auto-save.el (auto-save-unescape-name): Use #'string-to-number
instead of #'auto-save-unhex.
* files.el (save-some-buffers):
* files.el (save-some-buffers-1): Changed to a label.
* files.el (not-modified):
* gui.el (make-gui-button):
* gui.el (gui-button-action): Changed to a label.
* gui.el (insert-gui-button):
* indent.el (indent-for-tab-command):
* indent.el (insert-tab): Changed to a label.
* indent.el (indent-rigidly):
* isearch-mode.el:
* isearch-mode.el (isearch-ring-adjust):
* isearch-mode.el (isearch-ring-adjust1): Changed to a label.
* isearch-mode.el (isearch-pre-command-hook):
* isearch-mode.el (isearch-maybe-frob-keyboard-macros): Changed to
a label.
* isearch-mode.el (isearch-highlight):
* isearch-mode.el (isearch-make-extent): Changed to a label.
* itimer.el:
* itimer.el (itimer-decrement): Removed, replaced uses with decf.
* itimer.el (itimer-increment): Removed, replaced uses with incf.
* itimer.el (itimer-signum): Removed, replaced uses with minusp, plusp.
* itimer.el (itimer-name):
* itimer.el (check-itimer): Removed, replaced with #'check-type calls.
* itimer.el (itimer-value):
* itimer.el (check-itimer-coerce-string): Removed.
* itimer.el (itimer-restart):
* itimer.el (itimer-function):
* itimer.el (check-nonnegative-number): Removed.
* itimer.el (itimer-uses-arguments):
* itimer.el (check-string): Removed.
* itimer.el (itimer-function-arguments):
* itimer.el (itimer-recorded-run-time):
* itimer.el (set-itimer-name):
* itimer.el (set-itimer-value):
* itimer.el (set-itimer-value-internal):
* itimer.el (set-itimer-restart):
* itimer.el (set-itimer-function):
* itimer.el (set-itimer-is-idle):
* itimer.el (set-itimer-recorded-run-time):
* itimer.el (get-itimer):
* itimer.el (delete-itimer):
* itimer.el (start-itimer):
* itimer.el (activate-itimer):
* itimer.el (itimer-edit-set-field):
* itimer.el (itimer-edit-next-field):
* itimer.el (itimer-edit-previous-field):
Use incf, decf, plusp, minusp and the more general argument type
checking macros.
* lib-complete.el:
* lib-complete.el (lib-complete:better-root): Changed to a label.
* lib-complete.el (lib-complete:get-completion-table): Changed to
a label.
* lib-complete.el (read-library-internal): Include labels.
* lib-complete.el (lib-complete:cache-completions): Changed to a
label.
* minibuf.el (read-buffer): Use #'set-difference, don't reinvent it.
* newcomment.el (comment-padright): Use a label instead of
repeating a lambda expression.
* packages.el (package-get-key):
* packages.el (package-get-key-1): Removed, use #'getf instead.
* simple.el (kill-backward-chars): Removed; this isn't used.
* simple.el (what-cursor-position):
(lambda (arg) (format "%S" arg) -> #'prin1-to-string.
* simple.el (debug-print-1): Renamed to #'debug-print.
* simple.el (debug-print): Removed, #'debug-print-1 was equivalent.
* subr.el (integer-to-bit-vector): check-nonnegative-number no
longer available.
* widget.el (define-widget):
* widget.el (define-widget-keywords): Removed, this was long obsolete.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 05 May 2012 18:42:00 +0100 |
parents | cc6f0266bc36 |
children | 98f762d06c5f |
comparison
equal
deleted
inserted
replaced
5654:ddf56c45634e | 5655:b7ae5f44b950 |
---|---|
405 (defun kill-forward-chars (arg) | 405 (defun kill-forward-chars (arg) |
406 (if (listp arg) (setq arg (car arg))) | 406 (if (listp arg) (setq arg (car arg))) |
407 (if (eq arg '-) (setq arg -1)) | 407 (if (eq arg '-) (setq arg -1)) |
408 (kill-region (point) (+ (point) arg))) | 408 (kill-region (point) (+ (point) arg))) |
409 | 409 |
410 ;; Internal subroutine of backward-delete-char | |
411 (defun kill-backward-chars (arg) | |
412 (if (listp arg) (setq arg (car arg))) | |
413 (if (eq arg '-) (setq arg -1)) | |
414 (kill-region (point) (- (point) arg))) | |
415 | |
416 (defun backward-delete-char-untabify (arg &optional killp) | 410 (defun backward-delete-char-untabify (arg &optional killp) |
417 "Delete characters backward, changing tabs into spaces. | 411 "Delete characters backward, changing tabs into spaces. |
418 Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil. | 412 Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil. |
419 Interactively, ARG is the prefix arg (default 1) | 413 Interactively, ARG is the prefix arg (default 1) |
420 and KILLP is t if a prefix arg was specified." | 414 and KILLP is t if a prefix arg was specified." |
822 (message "Char: %s (0%o, %d, %x) point=%d of %d(%d%%)%s column %d %s" | 816 (message "Char: %s (0%o, %d, %x) point=%d of %d(%d%%)%s column %d %s" |
823 (text-char-description char) char char char pos total | 817 (text-char-description char) char char char pos total |
824 percent narrowed-details col hscroll) | 818 percent narrowed-details col hscroll) |
825 (message "Char: %s (%s %s) point=%d of %d(%d%%)%s column %d %s" | 819 (message "Char: %s (%s %s) point=%d of %d(%d%%)%s column %d %s" |
826 (text-char-description char) unicode-string | 820 (text-char-description char) unicode-string |
827 (mapconcat (lambda (arg) (format "%S" arg)) | 821 (mapconcat #'prin1-to-string (split-char char) " ") |
828 (split-char char) " ") | |
829 pos total | 822 pos total |
830 percent narrowed-details col hscroll))))) | 823 percent narrowed-details col hscroll))))) |
831 | 824 |
832 (defun fundamental-mode () | 825 (defun fundamental-mode () |
833 "Major mode not specialized for anything in particular. | 826 "Major mode not specialized for anything in particular. |
4764 (defun emacs-name () | 4757 (defun emacs-name () |
4765 "Return the printable name of this instance of Emacs." | 4758 "Return the printable name of this instance of Emacs." |
4766 (cond ((featurep 'xemacs) "XEmacs") | 4759 (cond ((featurep 'xemacs) "XEmacs") |
4767 (t "Emacs"))) | 4760 (t "Emacs"))) |
4768 | 4761 |
4769 (defun debug-print-1 (&rest args) | 4762 (defun debug-print (&rest args) |
4770 "Send a debugging-type string to standard output. | 4763 "Send a string to the debugging output. |
4771 If the first argument is a string, it is considered to be a format | 4764 If the first argument is a string, it is considered to be a format |
4772 specifier if there are sufficient numbers of other args, and the string is | 4765 specifier if there are sufficient numbers of other args, and the string is |
4773 formatted using (apply #'format args). Otherwise, each argument is printed | 4766 formatted using (apply #'format args). Otherwise, each argument is printed |
4774 individually in a numbered list." | 4767 individually in a numbered list." |
4775 (let ((standard-output 'external-debugging-output) | 4768 (let ((standard-output 'external-debugging-output) |
4788 (princ (format "%d. " i)) | 4781 (princ (format "%d. " i)) |
4789 (prin1 sgra) | 4782 (prin1 sgra) |
4790 (incf i)) | 4783 (incf i)) |
4791 (terpri))))) | 4784 (terpri))))) |
4792 | 4785 |
4793 (defun debug-print (&rest args) | |
4794 "Send a string to the debugging output. | |
4795 If the first argument is a string, it is considered to be a format | |
4796 specifier if there are sufficient numbers of other args, and the string is | |
4797 formatted using (apply #'format args). Otherwise, each argument is printed | |
4798 individually in a numbered list." | |
4799 (let ((standard-output 'external-debugging-output)) | |
4800 (apply #'debug-print-1 args))) | |
4801 | |
4802 (defun debug-backtrace () | 4786 (defun debug-backtrace () |
4803 "Send a backtrace to the debugging output." | 4787 "Send a backtrace to the debugging output." |
4804 (let ((standard-output 'external-debugging-output)) | 4788 (let ((standard-output 'external-debugging-output)) |
4805 (backtrace nil t) | 4789 (backtrace nil t) |
4806 (terpri))) | 4790 (terpri))) |