From 16975078b421b6b88caecf6d6143789fb44f1ddc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 6 Mar 2021 13:03:12 -0500 Subject: * lisp/emulation/: Use lexical-binding * lisp/emulation/cua-base.el: Use lexical-binding. Remove redundant `:group` arguments. (cua-mode): Don't use `:require` since the autoload on `define-minor-mode` takes care of loading the mode when custom-setting it. * lisp/emulation/cua-gmrk.el: Use lexical-binding. (cua--copy-rectangle-to-global-mark): Remove unused var `src-buf`. * lisp/emulation/edt-mapper.el: Use lexical-binding. * lisp/emulation/edt.el: Use lexical-binding. Remove redundant `:group` arguments. (edt-with-position): Allow `top`, `left`, and `far` to be left unused in `body`. * lisp/emulation/keypad.el: Use lexical-binding. * lisp/emulation/viper-cmd.el: Move `provide` to the end. (viper-read-string-with-history): Strength reduce `eval` to `symbol-value`. * lisp/emulation/viper-ex.el: Use lexical-binding. Remove redundant `:group` arguments. Move `provide` to the end. * lisp/emulation/viper-init.el: Use lexical-binding. * lisp/emulation/viper-keym.el (viper-toggle-key): Use `dolist`. (viper-insert-diehard-map): Use `string`. (viper-modify-major-mode): Use `alist-get` and `setf`. * lisp/emulation/viper-macs.el (viper-ex-work-buf): Move `provide` to the end. (viper-record-kbd-macro): Strength reduce `eval` to `symbol-value`. (viper-describe-kbd-macros): Return value is not significant. (viper-keyseq-is-a-possible-macro): Use `seq-some`. (viper-common-seq-prefix): Use `seq-every-p`. * lisp/emulation/viper-mous.el: Use lexical-binding. Remove redundant `:group` arguments. Move `provide` to the end. (viper-remember-current-frame): Accept arbitrary ignored args. (viper-parse-mouse-key): Strength reduce `eval` to `symbol-value`. Remove unused var `key-spec`. (viper-bind-mouse-search-key, viper-bind-mouse-insert-key): Apply de Morgan. * lisp/emulation/viper-util.el: Move `provide` to the end. (viper-move-marker-locally, viper-push-onto-ring, viper-save-setting): Strength reduce `eval` to `symbol-value`. (viper-event-vector-p, viper-char-symbol-sequence-p, viper-char-array-p): Use `seq-every-p`. * lisp/emulation/viper.el (viper-non-hook-settings): Eta-reduce use of `viper-remember-current-frame`. --- lisp/emulation/edt-mapper.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/emulation/edt-mapper.el') diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index 98085c6214d..c1c17723a44 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -1,4 +1,4 @@ -;;; edt-mapper.el --- create an EDT LK-201 map file for X-Windows Emacs +;;; edt-mapper.el --- create an EDT LK-201 map file for X-Windows Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1994-1995, 2000-2021 Free Software Foundation, Inc. @@ -176,7 +176,7 @@ (mapc (lambda (function-key) (if (not (lookup-key (current-global-map) function-key)) - (define-key (current-global-map) function-key 'forward-char))) + (define-key (current-global-map) function-key #'forward-char))) '([kp-0] [kp-1] [kp-2] [kp-3] [kp-4] [kp-5] [kp-6] [kp-7] [kp-8] [kp-9] [kp-space] -- cgit v1.2.3 From 331ddd803a72056d0f0c70e5a677e0d4a6300584 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Fri, 26 Mar 2021 17:13:59 +0000 Subject: Address some --without-x byte-compilation warnings These came to light in the contexts of bug#29713 and bug#47234. * lisp/emulation/edt-mapper.el (edt-xserver): * lisp/emulation/edt.el (edt-xserver): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/nnimap.el (nnimap-map-port): * lisp/term/w32-win.el: * lisp/image.el (image--get-imagemagick-and-warn): * lisp/frame.el (frame-notice-user-settings): Declare functions that are known to be present at runtime in GUI builds. (make-frame-on-display): Signal more informative error when called interactively in a non-GUI build (bug#29713). * lisp/international/mule-diag.el (describe-font): * lisp/org/org-macs.el (org--string-from-props): Pacify warnings about unknown functions in non-GUI bilds. * lisp/mh-e/mh-mime.el (mh-small-image-p): Avoid eliminating fboundp check in non-GUI builds, to pacify unused lexical variable warning. * lisp/net/newst-plainview.el (newsticker--plainview-tool-bar-map): * lisp/net/newst-treeview.el (newsticker-treeview-tool-bar-map): Declare tool-bar-map as a special variable in non-GUI builds. --- lisp/emulation/edt-mapper.el | 2 ++ lisp/emulation/edt.el | 2 ++ lisp/frame.el | 9 ++++++--- lisp/gnus/gnus-util.el | 8 ++++---- lisp/gnus/nnimap.el | 1 + lisp/image.el | 1 + lisp/international/mule-diag.el | 2 ++ lisp/mh-e/mh-mime.el | 4 ++-- lisp/net/newst-plainview.el | 1 + lisp/net/newst-treeview.el | 1 + lisp/org/org-macs.el | 3 ++- lisp/term/w32-win.el | 3 +++ 12 files changed, 27 insertions(+), 10 deletions(-) (limited to 'lisp/emulation/edt-mapper.el') diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index c1c17723a44..0b152784252 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -101,6 +101,8 @@ (define-obsolete-variable-alias 'edt-window-system 'window-system "27.1") (defconst edt-xserver (when (eq window-system 'x) + (declare-function x-server-vendor "xfns.c" + (&optional terminal)) ;; The Cygwin window manager has a `/' in its ;; name, which breaks the generated file name of ;; the custom key map file. Replace `/' with a diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index 8f90ed28260..50979c4dbb3 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -299,6 +299,8 @@ This means that an edt-user.el file was found in the user's `load-path'.") ;;; o edt-emulation-on o edt-load-keys ;;; (defconst edt-xserver (when (eq window-system 'x) + (declare-function x-server-vendor "xfns.c" + (&optional terminal)) ;; The Cygwin window manager has a `/' in its ;; name, which breaks the generated file name of ;; the custom key map file. Replace `/' with a diff --git a/lisp/frame.el b/lisp/frame.el index 151aefb47a3..2b6e4a60b83 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -367,6 +367,7 @@ there (in decreasing order of priority)." ;; by the lines added in x-create-frame for the tab-bar and ;; switch `tab-bar-mode' off. (when (display-graphic-p) + (declare-function tab-bar-height "xdisp.c" (&optional frame pixelwise)) (let* ((init-lines (assq 'tab-bar-lines initial-frame-alist)) (other-lines @@ -708,9 +709,11 @@ Return nil if we don't know how to interpret DISPLAY." (defun make-frame-on-display (display &optional parameters) "Make a frame on display DISPLAY. The optional argument PARAMETERS specifies additional frame parameters." - (interactive (list (completing-read - (format "Make frame on display: ") - (x-display-list)))) + (interactive (if (fboundp 'x-display-list) + (list (completing-read + (format "Make frame on display: ") + (x-display-list))) + (user-error "This Emacs build does not support X displays"))) (make-frame (cons (cons 'display display) parameters))) (defun make-frame-on-current-monitor (&optional parameters) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index f80243cfedb..e558f639e46 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1612,8 +1612,8 @@ empty directories from OLD-PATH." "Rescale IMAGE to SIZE if possible. SIZE is in format (WIDTH . HEIGHT). Return a new image. Sizes are in pixels." - (if (not (display-graphic-p)) - image + (when (display-images-p) + (declare-function image-size "image.c" (spec &optional pixels frame)) (let ((new-width (car size)) (new-height (cdr size))) (when (> (cdr (image-size image t)) new-height) @@ -1621,8 +1621,8 @@ Sizes are in pixels." :max-height new-height))) (when (> (car (image-size image t)) new-width) (setq image (create-image (plist-get (cdr image) :data) nil t - :max-width new-width))) - image))) + :max-width new-width))))) + image) (defun gnus-recursive-directory-files (dir) "Return all regular files below DIR. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 93e1c47be70..f06959f65d9 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -440,6 +440,7 @@ during splitting, which may be slow." ;; This is only needed for Windows XP or earlier (defun nnimap-map-port (port) + (declare-function x-server-version "xfns.c" (&optional terminal)) (if (and (eq system-type 'windows-nt) (<= (car (x-server-version)) 5) (equal port "imaps")) diff --git a/lisp/image.el b/lisp/image.el index 4ede1fbf375..b802c1c906f 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -1130,6 +1130,7 @@ default is 20%." image)) (defun image--get-imagemagick-and-warn (&optional position) + (declare-function image-transforms-p "image.c" (&optional frame)) (unless (or (fboundp 'imagemagick-types) (image-transforms-p)) (error "Cannot rescale images on this terminal")) (let ((image (image--get-image position))) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index d97d090cd08..a0063c8dbb6 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -835,6 +835,8 @@ The IGNORED argument is ignored." (list (completing-read "Font name (default current choice for ASCII chars): " (and window-system + ;; Implied by `window-system'. + (fboundp 'x-list-fonts) (fboundp 'fontset-list) ;; The final element in `fontset-list' is a default ;; (generic) one, so don't include that. diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 5ffba8fe1a8..fec2293ff1f 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -777,7 +777,7 @@ This is only useful if a Content-Disposition header is not present." (funcall media-test handle) ; Since mm-inline-large-images is T, ; this only tells us if the image is ; something that emacs can display - (let* ((image (mm-get-image handle))) + (let ((image (mm-get-image handle))) (or (mh-do-in-xemacs (and (mh-funcall-if-exists glyphp image) (< (glyph-width image) @@ -786,7 +786,7 @@ This is only useful if a Content-Disposition header is not present." (or mh-max-inline-image-height (window-pixel-height))))) (mh-do-in-gnu-emacs - (let ((size (mh-funcall-if-exists image-size image))) + (let ((size (and (fboundp 'image-size) (image-size image)))) (and size (< (cdr size) (or mh-max-inline-image-height (1- (window-height)))) diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el index 76b1ef37640..420cf82e4d8 100644 --- a/lisp/net/newst-plainview.el +++ b/lisp/net/newst-plainview.el @@ -273,6 +273,7 @@ images." (defvar newsticker--plainview-tool-bar-map (when (boundp 'tool-bar-map) + (defvar tool-bar-map) (let ((tool-bar-map (make-sparse-keymap))) (tool-bar-add-item "newsticker/prev-feed" 'newsticker-previous-feed diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index d778cc17615..29c92d52dd8 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -1102,6 +1102,7 @@ Arguments are ignored." ;; ====================================================================== (defvar newsticker-treeview-tool-bar-map (when (boundp 'tool-bar-map) + (defvar tool-bar-map) (let ((tool-bar-map (make-sparse-keymap))) (tool-bar-add-item "newsticker/prev-feed" 'newsticker-treeview-prev-feed diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index ac6691db0d5..58d3fd39922 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -869,7 +869,8 @@ delimiting S." (let ((width (plist-get props :width))) (and (wholenump width) width))) (`(image . ,_) - (ceiling (car (image-size spec)))) + (and (fboundp 'image-size) + (ceiling (car (image-size spec))))) ((pred stringp) ;; Displayed string could contain invisible parts, ;; but no nested display. diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index e8451930133..687250fe46e 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -555,6 +555,9 @@ be found in this alist. This alist is used by w32font.c when it looks for fonts that can display characters from scripts for which no USBs are defined.") +(declare-function x-list-fonts "xfaces.c" + (pattern &optional face frame maximum width)) + (defun w32-find-non-USB-fonts (&optional frame size) "Compute the value of `w32-non-USB-fonts' for specified SIZE and FRAME. FRAME defaults to the selected frame. -- cgit v1.2.3 From fb9f5501d838f8b912ea33f9c34fdf6020c41f35 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 16 Apr 2021 14:35:25 +0200 Subject: ; Fix typos: emacs lisp -> Emacs Lisp --- lisp/cedet/semantic/bovine/el.el | 2 +- lisp/cedet/semantic/db-ebrowse.el | 2 +- lisp/emacs-lisp/cconv.el | 2 +- lisp/emacs-lisp/cl-indent.el | 2 +- lisp/emulation/edt-mapper.el | 2 +- lisp/ls-lisp.el | 2 +- lisp/mh-e/mh-show.el | 2 +- lisp/obsolete/tpu-mapper.el | 2 +- lisp/progmodes/cc-guess.el | 4 ++-- lisp/textmodes/artist.el | 2 +- lisp/textmodes/table.el | 2 +- lisp/textmodes/texinfmt.el | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) (limited to 'lisp/emulation/edt-mapper.el') diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el index 1170e716878..ebb20448ed5 100644 --- a/lisp/cedet/semantic/bovine/el.el +++ b/lisp/cedet/semantic/bovine/el.el @@ -585,7 +585,7 @@ Overrides `semantic-nonterminal-static'." ;;; Context parsing ;; -;; Emacs lisp is very different from C,C++ which most context parsing +;; Emacs Lisp is very different from C,C++ which most context parsing ;; functions are written. Support them here. (define-mode-local-override semantic-up-context emacs-lisp-mode (&optional _point _bounds-type) diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el index efdf3dfa47a..682a4ccac48 100644 --- a/lisp/cedet/semantic/db-ebrowse.el +++ b/lisp/cedet/semantic/db-ebrowse.el @@ -222,7 +222,7 @@ warn instead." ;JAVE this just instantiates a default empty ebrowse struct? ; how would new instances wind up here? -; the ebrowse class isn't singleton, unlike the emacs lisp one +; the ebrowse class isn't singleton, unlike the Emacs Lisp one (defvar-mode-local c++-mode semanticdb-project-system-databases () "Search Ebrowse for symbols.") diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index b37cfebab31..f6637109028 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -1,4 +1,4 @@ -;;; cconv.el --- Closure conversion for statically scoped Emacs lisp. -*- lexical-binding: t -*- +;;; cconv.el --- Closure conversion for statically scoped Emacs Lisp. -*- lexical-binding: t -*- ;; Copyright (C) 2011-2021 Free Software Foundation, Inc. diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index 7d0bfc88b15..c88e15d5a8b 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -27,7 +27,7 @@ ;; This package supplies a single entry point, common-lisp-indent-function, ;; which performs indentation in the preferred style for Common Lisp code. -;; It is also a suitable function for indenting Emacs lisp code. +;; It is also a suitable function for indenting Emacs Lisp code. ;; ;; To enable it: ;; diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index 0b152784252..a723dbdbb90 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -26,7 +26,7 @@ ;; [Part of the GNU Emacs EDT Emulation.] -;; This emacs lisp program can be used to create an emacs lisp file +;; This Emacs Lisp program can be used to create an Emacs Lisp file ;; that defines the mapping of the user's keyboard to the LK-201 ;; keyboard function keys and keypad keys (around which EDT has been ;; designed). Please read the "Usage" AND "Known Problems" sections diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 3721e86475c..24d49ea6d80 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -28,7 +28,7 @@ ;; OVERVIEW ========================================================== ;; This file advises the function `insert-directory' to implement it -;; directly from Emacs lisp, without running ls in a subprocess. +;; directly from Emacs Lisp, without running ls in a subprocess. ;; This is useful if you don't have ls installed (ie, on MS Windows). ;; This function can use regexps instead of shell wildcards. If you diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index 6134e8350c8..aa97f5cb383 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -185,7 +185,7 @@ Sets the current buffer to the show buffer." (set-buffer folder) ;; When Gnus uses external displayers it has to keep handles longer. So ;; we will delete these handles when mh-quit is called on the folder. It - ;; would be nicer if there are weak pointers in emacs lisp, then we could + ;; would be nicer if there are weak pointers in Emacs Lisp, then we could ;; get the garbage collector to do this for us. (unless (mh-buffer-data) (setf (mh-buffer-data) (mh-make-buffer-data))) diff --git a/lisp/obsolete/tpu-mapper.el b/lisp/obsolete/tpu-mapper.el index d23068ac469..5ae0a6558d5 100644 --- a/lisp/obsolete/tpu-mapper.el +++ b/lisp/obsolete/tpu-mapper.el @@ -69,7 +69,7 @@ ;;;###autoload (defun tpu-mapper () - "Create an Emacs lisp file defining the TPU-edt keypad for X-windows. + "Create an Emacs Lisp file defining the TPU-edt keypad for X-windows. This command displays an instruction screen showing the TPU-edt keypad and asks you to press the TPU-edt editing keys. It uses the keys you diff --git a/lisp/progmodes/cc-guess.el b/lisp/progmodes/cc-guess.el index 0824af66b43..9c88c14a6c1 100644 --- a/lisp/progmodes/cc-guess.el +++ b/lisp/progmodes/cc-guess.el @@ -58,7 +58,7 @@ ;; ;; If you want to reuse the guessed style in future emacs sessions, ;; you may want to put it to your .emacs. `c-guess-view' is for -;; you. It emits emacs lisp code which defines the last guessed +;; you. It emits Emacs Lisp code which defines the last guessed ;; style, in a temporary buffer. You can put the emitted code into ;; your .emacs. This command was suggested by Alan Mackenzie. @@ -527,7 +527,7 @@ is called with one argument, the guessed style." (cdr needs-markers))))) (defun c-guess-view (&optional with-name) - "Emit emacs lisp code which defines the last guessed style. + "Emit Emacs Lisp code which defines the last guessed style. So you can put the code into .emacs if you prefer the guessed code. \"STYLE NAME HERE\" is used as the name for the style in the diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index fbb9d2174fd..d9a83c566b4 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -33,7 +33,7 @@ ;; What is artist? ;; --------------- ;; -;; Artist is an Emacs lisp package that allows you to draw lines, +;; Artist is an Emacs Lisp package that allows you to draw lines, ;; rectangles and ellipses by using your mouse and/or keyboard. The ;; shapes are made up with the ascii characters |, -, / and \. ;; diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 13b4a6d05b0..2dd52b87b79 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -383,7 +383,7 @@ ;; There is no artificial-intelligence magic in this package. The ;; definition of a table and the cells inside the table is reasonably ;; limited in order to achieve acceptable performance in the -;; interactive operation under Emacs lisp implementation. A valid +;; interactive operation under Emacs Lisp implementation. A valid ;; table is a rectangular text area completely filled with valid ;; cells. A valid cell is a rectangle text area, which four borders ;; consist of valid border characters. Cells can not be nested one to diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 5ce39da7968..977f3bab6ce 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -23,7 +23,7 @@ ;;; Commentary: -;;; Emacs lisp functions to convert Texinfo files to Info files. +;;; Emacs Lisp functions to convert Texinfo files to Info files. ;;; Code: -- cgit v1.2.3