# HG changeset patch # User Aidan Kehoe # Date 1299783075 0 # Node ID ed74d2ca7082ba4e2478792b7ba2a70a34899d25 # Parent 8b70d37ab80e0e3c333f31b3e8f9cf6ee6315279 Use ', not #', when a given symbol may not have a function binding at read time 2011-03-10 Aidan Kehoe * 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.) diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/ChangeLog --- 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 + + * 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 * cl-macs.el: diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/cmdloop.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) diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/descr-text.el --- 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) diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/diagnose.el --- 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")) diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/faces.el --- 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)) diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/gtk-font-menu.el --- 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 diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/help.el --- 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))))) diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/minibuf.el --- 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)))) diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/obsolete.el --- 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.") diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/occur.el --- 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 diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/paragraphs.el --- 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 diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/select.el --- 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) diff -r 8b70d37ab80e -r ed74d2ca7082 lisp/simple.el --- 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)) ))