Mercurial > hg > xemacs-beta
changeset 5368:ed74d2ca7082
Use ', not #', when a given symbol may not have a function binding at read time
2011-03-10 Aidan Kehoe <kehoea@parhasard.net>
* cmdloop.el (yes-or-no-p):
* cmdloop.el (y-or-n-p):
* descr-text.el (describe-char):
* diagnose.el (show-memory-usage):
* diagnose.el (show-object-memory-usage-stats):
* diagnose.el (show-mc-alloc-memory-usage):
* diagnose.el (show-gc-stats):
* faces.el (face-font-instance):
* gtk-font-menu.el (gtk-reset-device-font-menus):
* help.el (help-symbol-function-context-menu):
* help.el (help-symbol-variable-context-menu):
* help.el (help-symbol-function-and-variable-context-menu):
* help.el (help-find-source-or-scroll-up):
* help.el (help-mouse-find-source-or-track):
* help.el (temp-buffer-resize-mode):
* minibuf.el (mouse-read-file-name-1):
* obsolete.el (find-non-ascii-charset-string):
* obsolete.el (find-non-ascii-charset-region):
* occur.el (occur-engine):
* paragraphs.el (forward-paragraph):
* paragraphs.el (forward-sentence):
* select.el (activate-region-as-selection):
* select.el (select-make-extent-for-selection):
* simple.el (zmacs-make-extent-for-region):
Use quote, not function, for quoting symbols that may not be
fboundp at the point they are read (again, a style issue, since
Common Lisp throws an error on this, but we don't, and have no
plans to.)
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 10 Mar 2011 18:51:15 +0000 |
parents | 8b70d37ab80e |
children | 4141aeddc55b |
files | lisp/ChangeLog lisp/cmdloop.el lisp/descr-text.el lisp/diagnose.el lisp/faces.el lisp/gtk-font-menu.el lisp/help.el lisp/minibuf.el lisp/obsolete.el lisp/occur.el lisp/paragraphs.el lisp/select.el lisp/simple.el |
diffstat | 13 files changed, 61 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/ChangeLog Thu Mar 10 18:51:15 2011 +0000 @@ -1,3 +1,34 @@ +2011-03-10 Aidan Kehoe <kehoea@parhasard.net> + + * cmdloop.el (yes-or-no-p): + * cmdloop.el (y-or-n-p): + * descr-text.el (describe-char): + * diagnose.el (show-memory-usage): + * diagnose.el (show-object-memory-usage-stats): + * diagnose.el (show-mc-alloc-memory-usage): + * diagnose.el (show-gc-stats): + * faces.el (face-font-instance): + * gtk-font-menu.el (gtk-reset-device-font-menus): + * help.el (help-symbol-function-context-menu): + * help.el (help-symbol-variable-context-menu): + * help.el (help-symbol-function-and-variable-context-menu): + * help.el (help-find-source-or-scroll-up): + * help.el (help-mouse-find-source-or-track): + * help.el (temp-buffer-resize-mode): + * minibuf.el (mouse-read-file-name-1): + * obsolete.el (find-non-ascii-charset-string): + * obsolete.el (find-non-ascii-charset-region): + * occur.el (occur-engine): + * paragraphs.el (forward-paragraph): + * paragraphs.el (forward-sentence): + * select.el (activate-region-as-selection): + * select.el (select-make-extent-for-selection): + * simple.el (zmacs-make-extent-for-region): + Use quote, not function, for quoting symbols that may not be + fboundp at the point they are read (again, a style issue, since + Common Lisp throws an error on this, but we don't, and have no + plans to.) + 2011-03-08 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el:
--- a/lisp/cmdloop.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/cmdloop.el Thu Mar 10 18:51:15 2011 +0000 @@ -507,7 +507,7 @@ ;; and-fboundp is redundant, since yes-or-no-p-dialog-box is only ;; bound if (featurep 'dialog). But it eliminates a compile-time ;; warning. - (and-fboundp #'yes-or-no-p-dialog-box (yes-or-no-p-dialog-box prompt)) + (and-fboundp 'yes-or-no-p-dialog-box (yes-or-no-p-dialog-box prompt)) (yes-or-no-p-minibuf prompt))) (defun y-or-n-p (prompt)
--- a/lisp/descr-text.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/descr-text.el Thu Mar 10 18:51:15 2011 +0000 @@ -1120,7 +1120,7 @@ ; (push (format "%s;" (pop props)) ps)) ; (list (cons "Properties" (nreverse ps))))) ("to input" - ,@(let ((key-list (and-fboundp #'quail-find-key + ,@(let ((key-list (and-fboundp 'quail-find-key current-input-method (quail-find-key char)))) (if (consp key-list)
--- a/lisp/diagnose.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/diagnose.el Thu Mar 10 18:51:15 2011 +0000 @@ -147,7 +147,7 @@ (window-list fr t)) (frame-list)) 16)) - (when-fboundp #'sort-numeric-fields + (when-fboundp 'sort-numeric-fields (sort-numeric-fields -1 (save-excursion (goto-char begin) @@ -181,7 +181,7 @@ (princ "\n") (princ (format fmt "total" total)) (incf grandtotal total)) - (when-fboundp #'sort-numeric-fields + (when-fboundp 'sort-numeric-fields (sort-numeric-fields -1 (save-excursion (goto-char begin) @@ -289,7 +289,7 @@ total-non-lisp-use "")) (incf grandtotal total-use-with-overhead) (incf grandtotal total-non-lisp-use) - (when-fboundp #'sort-numeric-fields + (when-fboundp 'sort-numeric-fields (sort-numeric-fields -4 (save-excursion (goto-char begin) @@ -312,7 +312,7 @@ "Show statistics about memory usage of the new allocator." (interactive) (garbage-collect) - (if-fboundp #'mc-alloc-memory-usage + (if-fboundp 'mc-alloc-memory-usage (let* ((stats (mc-alloc-memory-usage)) (page-size (first stats)) (heap-sects (second stats)) @@ -465,7 +465,7 @@ (defun show-gc-stats () "Show statistics about garbage collection cycles." (interactive) - (if-fboundp #'gc-stats + (if-fboundp 'gc-stats (let ((buffer "*garbage collection statistics*") (plist (gc-stats)) (fmt "%-9s %16s %12s %12s %12s %12s\n"))
--- a/lisp/faces.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/faces.el Thu Mar 10 18:51:15 2011 +0000 @@ -478,7 +478,7 @@ (let (matchspec) ;; get-charset signals an error if its argument doesn't have an ;; associated charset. - (setq charset (if-fboundp #'get-charset + (setq charset (if-fboundp 'get-charset (get-charset charset) (error 'unimplemented "Charset support not available")) matchspec (cons charset nil))
--- a/lisp/gtk-font-menu.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/gtk-font-menu.el Thu Mar 10 18:51:15 2011 +0000 @@ -92,7 +92,7 @@ ;; #### - this should implement a `menus-only' option, which would ;; recalculate the menus from the cache w/o having to do font-list again. (unless gtk-font-regexp-ascii - (setq gtk-font-regexp-ascii (if-fboundp #'charset-registries + (setq gtk-font-regexp-ascii (if-fboundp 'charset-registries (aref (charset-registries 'ascii) 0) "iso8859-1"))) (setq gtk-font-menu-registry-encoding
--- a/lisp/help.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/help.el Thu Mar 10 18:51:15 2011 +0000 @@ -1300,14 +1300,14 @@ (defvar help-symbol-function-context-menu '(["View %_Documentation" (help-symbol-run-function 'describe-function)] ["Find %_Function Source" (help-symbol-run-function 'find-function) - (fboundp #'find-function)] + (fboundp 'find-function)] ["Find %_Tag" (help-symbol-run-function 'find-tag)] )) (defvar help-symbol-variable-context-menu '(["View %_Documentation" (help-symbol-run-function 'describe-variable)] ["Find %_Variable Source" (help-symbol-run-function 'find-variable) - (fboundp #'find-variable)] + (fboundp 'find-variable)] ["Find %_Tag" (help-symbol-run-function 'find-tag)] )) @@ -1317,9 +1317,9 @@ ["View Variable D%_ocumentation" (help-symbol-run-function 'describe-variable)] ["Find %_Function Source" (help-symbol-run-function 'find-function) - (fboundp #'find-function)] + (fboundp 'find-function)] ["Find %_Variable Source" (help-symbol-run-function 'find-variable) - (fboundp #'find-variable)] + (fboundp 'find-variable)] ["Find %_Tag" (help-symbol-run-function 'find-tag)] )) @@ -1858,12 +1858,12 @@ "Follow any cross reference to source code; if none, scroll up. " (interactive "d") (let ((e (extent-at pos nil 'find-function-symbol))) - (if (and-fboundp #'find-function e) - (with-fboundp #'find-function + (if (and-fboundp 'find-function e) + (with-fboundp 'find-function (find-function (extent-property e 'find-function-symbol))) (setq e (extent-at pos nil 'find-variable-symbol)) - (if (and-fboundp #'find-variable e) - (with-fboundp #'find-variable + (if (and-fboundp 'find-variable e) + (with-fboundp 'find-variable (find-variable (extent-property e 'find-variable-symbol))) (scroll-up 1))))) @@ -1873,12 +1873,12 @@ (interactive "e") (mouse-set-point event) (let ((e (extent-at (point) nil 'find-function-symbol))) - (if (and-fboundp #'find-function e) - (with-fboundp #'find-function + (if (and-fboundp 'find-function e) + (with-fboundp 'find-function (find-function (extent-property e 'find-function-symbol))) (setq e (extent-at (point) nil 'find-variable-symbol)) - (if (and-fboundp #'find-variable e) - (with-fboundp #'find-variable + (if (and-fboundp 'find-variable e) + (with-fboundp 'find-variable (find-variable (extent-property e 'find-variable-symbol))) (mouse-track event)))))
--- a/lisp/minibuf.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/minibuf.el Thu Mar 10 18:51:15 2011 +0000 @@ -2095,7 +2095,7 @@ ;; any more. --ben (lambda () (mouse-rfn-setup-vars prompt) - (when-boundp #'scrollbar-width + (when-boundp 'scrollbar-width (set-specifier scrollbar-width 0 (current-buffer))) (setq truncate-lines t))))
--- a/lisp/obsolete.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/obsolete.el Thu Mar 10 18:51:15 2011 +0000 @@ -402,7 +402,7 @@ "Return a list of charsets in the STRING except ascii. It might be available for compatibility with Mule 2.3, because its `find-charset-string' ignores ASCII charset." - (delq 'ascii (and-fboundp #'charsets-in-string (charsets-in-string string)))) + (delq 'ascii (and-fboundp 'charsets-in-string (charsets-in-string string)))) (make-obsolete 'find-non-ascii-charset-string "use (delq 'ascii (charsets-in-string STRING)) instead.") @@ -410,7 +410,7 @@ "Return a list of charsets except ascii in the region between START and END. It might be available for compatibility with Mule 2.3, because its `find-charset-string' ignores ASCII charset." - (delq 'ascii (and-fboundp #'charsets-in-region + (delq 'ascii (and-fboundp 'charsets-in-region (charsets-in-region start end)))) (make-obsolete 'find-non-ascii-charset-region "use (delq 'ascii (charsets-in-region START END)) instead.")
--- a/lisp/occur.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/occur.el Thu Mar 10 18:51:15 2011 +0000 @@ -469,7 +469,7 @@ (if (and keep-props (if-boundp 'jit-lock-mode jit-lock-mode) (text-property-not-all begpt endpt 'fontified t)) - (if-fboundp #'jit-lock-fontify-now + (if-fboundp 'jit-lock-fontify-now (jit-lock-fontify-now begpt endpt))) (setq curstring (buffer-substring begpt endpt)) ;; Depropertize the string, and maybe
--- a/lisp/paragraphs.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/paragraphs.el Thu Mar 10 18:51:15 2011 +0000 @@ -318,7 +318,7 @@ (forward-char 1)) (if (< (point) (point-max)) (goto-char start)))) - (if-fboundp #'constrain-to-field + (if-fboundp 'constrain-to-field (constrain-to-field nil opoint t) (error 'void-function @@ -437,7 +437,7 @@ (skip-chars-backward " \t\n") (goto-char par-end))) (setq arg (1- arg))) - (if-fboundp #'constrain-to-field + (if-fboundp 'constrain-to-field (constrain-to-field nil opoint t) (error 'void-function
--- a/lisp/select.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/select.el Thu Mar 10 18:51:15 2011 +0000 @@ -277,7 +277,7 @@ ;; application asserts the selection. This is probably not a big deal. (defun activate-region-as-selection () - (cond ((and-fboundp #'mouse-track-rectangle-p + (cond ((and-fboundp 'mouse-track-rectangle-p (mouse-track-rectangle-p (mouse-track-activate-rectangular-selection)))) ((marker-buffer (mark-marker t)) @@ -349,7 +349,7 @@ (set-extent-property previous-extent 'end-open nil) (cond - ((and-fboundp #'mouse-track-rectangle-p + ((and-fboundp 'mouse-track-rectangle-p (mouse-track-rectangle-p (setq previous-extent (list previous-extent)) (default-mouse-track-next-move-rect start end previous-extent)
--- a/lisp/simple.el Tue Mar 08 23:57:21 2011 +0000 +++ b/lisp/simple.el Thu Mar 10 18:51:15 2011 +0000 @@ -3981,7 +3981,7 @@ (cond (zmacs-region-rectangular-p (setq zmacs-region-extent (list zmacs-region-extent)) - (when-fboundp #'default-mouse-track-next-move-rect + (when-fboundp 'default-mouse-track-next-move-rect (default-mouse-track-next-move-rect start end zmacs-region-extent)) ))