From afda2e6a9ddff208fb7dbcda5043aa779ccfd2bc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 18 Jun 2015 21:51:39 -0400 Subject: [PATCH] * packages/ada-mode: Miscellaneous tweaks to fix warnings * packages/ada-mode/ada-mode.el (ada-in-numeric-literal-p): Refine call to looking-back. (): Fix broken use of cl-case. * packages/ada-mode/ada-skel.el: Use #' to quote function names. * packages/ada-mode/ada-wisi.el (ada-wisi-which-function-1): Remove unused var `region' and avoid unneeded setq. * packages/ada-mode/gnat-inspect.el (gnat-inspect-compilation): * packages/ada-mode/gpr-query.el (gpr-query-compilation): Silence warning. --- packages/ada-mode/ada-mode.el | 6 +++--- packages/ada-mode/ada-skel.el | 10 +++++----- packages/ada-mode/ada-wisi.el | 9 +++------ packages/ada-mode/gnat-inspect.el | 4 ++-- packages/ada-mode/gpr-query.el | 2 +- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/packages/ada-mode/ada-mode.el b/packages/ada-mode/ada-mode.el index 57e5ebc6a..fc3552efd 100644 --- a/packages/ada-mode/ada-mode.el +++ b/packages/ada-mode/ada-mode.el @@ -1071,7 +1071,7 @@ User is prompted to choose a file from project variable casing if it is a list." (defun ada-in-numeric-literal-p () "Return t if point is after a prefix of a numeric literal." ;; FIXME: this is actually a based numeric literal; excludes 1234 - (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)")) + (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)" (line-beginning-position))) (defvar ada-keywords nil "List of Ada keywords for current `ada-language-version'.") @@ -2818,8 +2818,8 @@ The paragraph is indented on the first line." (unless (featurep 'ada-xref-tool) (cl-case ada-xref-tool - ((nil 'gnat) (require 'ada-gnat-xref)) - ('gpr_query (require 'gpr-query)) + ((nil gnat) (require 'ada-gnat-xref)) + (gpr_query (require 'gpr-query)) )) (unless (featurep 'ada-compiler) diff --git a/packages/ada-mode/ada-skel.el b/packages/ada-mode/ada-skel.el index 95442226e..e6c543040 100644 --- a/packages/ada-mode/ada-skel.el +++ b/packages/ada-mode/ada-skel.el @@ -1,6 +1,6 @@ ;;; ada-skel.el --- an extension to Ada mode for inserting statement skeletons -;; Copyright (C) 1987, 1993, 1994, 1996-2014 Free Software Foundation, Inc. +;; Copyright (C) 1987, 1993, 1994, 1996-2015 Free Software Foundation, Inc. ;; Authors: Stephen Leake @@ -453,10 +453,10 @@ it is a name, and use the word before that as the token." (provide 'ada-skeletons) (provide 'ada-skel) -(setq ada-expand 'ada-skel-expand) -(setq ada-next-placeholder 'ada-skel-next-placeholder) -(setq ada-prev-placeholder 'ada-skel-prev-placeholder) +(setq ada-expand #'ada-skel-expand) +(setq ada-next-placeholder #'ada-skel-next-placeholder) +(setq ada-prev-placeholder #'ada-skel-prev-placeholder) -(add-hook 'ada-mode-hook 'ada-skel-setup) +(add-hook 'ada-mode-hook #'ada-skel-setup) ;;; ada-skel.el ends here diff --git a/packages/ada-mode/ada-wisi.el b/packages/ada-mode/ada-wisi.el index a325b0f48..7bb3bd9e5 100644 --- a/packages/ada-mode/ada-wisi.el +++ b/packages/ada-mode/ada-wisi.el @@ -1571,12 +1571,9 @@ Also return cache at start." paramlist)) (defun ada-wisi-which-function-1 (keyword add-body) - "used in `ada-wisi-which-function'." - (let (region - result - (cache (wisi-forward-find-class 'name (point-max)))) - - (setq result (wisi-cache-text cache)) + "Used in `ada-wisi-which-function'." + (let* ((cache (wisi-forward-find-class 'name (point-max))) + (result (wisi-cache-text cache))) (when (not ff-function-name) (setq ff-function-name diff --git a/packages/ada-mode/gnat-inspect.el b/packages/ada-mode/gnat-inspect.el index 5fb2d4ba5..eb1c48845 100644 --- a/packages/ada-mode/gnat-inspect.el +++ b/packages/ada-mode/gnat-inspect.el @@ -4,7 +4,7 @@ ;;; gnatinspect supports Ada and any gcc language that supports the ;;; -fdump-xref switch (which includes C, C++). ;; -;;; Copyright (C) 2013, 2014 Free Software Foundation, Inc. +;;; Copyright (C) 2013-2015 Free Software Foundation, Inc. ;; Author: Stephen Leake ;; Maintainer: Stephen Leake @@ -215,7 +215,7 @@ set compilation-mode with compilation-error-regexp-alist set to COMP-ERR." (setq result-count (- (line-number-at-pos) 1)) (if (fboundp 'font-lock-ensure) (font-lock-ensure) - (font-lock-fontify-buffer)) + (with-no-warnings (font-lock-fontify-buffer))) ;; font-lock-fontify-buffer applies compilation-message text properties ;; NOTE: Won't be needed in 24.5 any more, since compilation-next-error ;; will apply compilation-message text properties on the fly. diff --git a/packages/ada-mode/gpr-query.el b/packages/ada-mode/gpr-query.el index 06ebbb029..7fa91bdcd 100644 --- a/packages/ada-mode/gpr-query.el +++ b/packages/ada-mode/gpr-query.el @@ -256,7 +256,7 @@ set compilation-mode with compilation-error-regexp-alist set to COMP-ERR." (if (fboundp 'font-lock-ensure) (font-lock-ensure) - (font-lock-fontify-buffer)) + (with-no-warnings (font-lock-fontify-buffer))) ;; font-lock-fontify-buffer applies compilation-message text properties ;; FIXME: Won't be needed in 24.5 any more, since compilation-next-error ;; will apply compilation-message text properties on the fly. -- 2.39.2