emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7191318b716 11/13: Merge from origin/emacs-29


From: Eli Zaretskii
Subject: master 7191318b716 11/13: Merge from origin/emacs-29
Date: Sat, 15 Apr 2023 13:06:30 -0400 (EDT)

branch: master
commit 7191318b716debaca15b56ebf7b13f5a1b07b0f9
Merge: febf4467bde 864a4dc2363
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Merge from origin/emacs-29
    
    864a4dc2363 Fix compilation of w32.c with old MinGW system headers
    a22eb9ae0f9 ruby-add-log-current-method: Reduce the use of 'nreverse'
    17d803d0a75 Fix detection of WebP images by their signature
    43290391ce2 ; Eglot: make version parseable by version-to-list
    6e6e8b5c974 Add more documentation for the keys of `package-vc-select...
    7972b76c2c7 ; vc-checkout: Wrap var lookup in 'bound-and-true-p'
    e9fef1d70ff vc-checkout: Try to use the vc-dir's backend first
    372e024accd ; Fix wallpaper-tests on XFCE
    7055fd8e43e Improve documentation related to 'ispell-complete-word'
    61fd017abde * configure.ac: Add -lbsd on Haiku.
    05971c4d9a4 Add menu to 'c-ts-mode' and 'c++-ts-mode'
    
    # Conflicts:
    #       lisp/progmodes/eglot.el
    #       lisp/progmodes/ruby-mode.el
---
 configure.ac                           |  3 +-
 doc/emacs/package.texi                 | 77 ++++++++++++++++++++++++++++++++++
 lisp/emacs-lisp/package-vc.el          | 30 ++-----------
 lisp/image.el                          |  2 +-
 lisp/progmodes/c-ts-mode.el            | 33 +++++++++++++++
 lisp/progmodes/ruby-mode.el            |  4 +-
 lisp/textmodes/ispell.el               | 17 ++++++--
 lisp/vc/vc.el                          |  2 +-
 src/w32.c                              |  9 +++-
 test/lisp/image/wallpaper-tests.el     | 12 ++++--
 test/lisp/progmodes/ruby-mode-tests.el | 16 +++++++
 11 files changed, 165 insertions(+), 40 deletions(-)

diff --git a/configure.ac b/configure.ac
index a9a8f10ec21..55396bdd6ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1643,7 +1643,8 @@ case "$opsys" in
   ## Motif needs -lgen.
   unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
 
-  haiku) LIBS_SYSTEM="-lnetwork" ;;
+  # Haiku needs -lbsd for cfsetspeed.
+  haiku) LIBS_SYSTEM="-lnetwork -lbsd" ;;
 esac
 
 AC_SUBST([LIBS_SYSTEM])
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi
index 7a2bc11d03c..2b03399b0a7 100644
--- a/doc/emacs/package.texi
+++ b/doc/emacs/package.texi
@@ -578,3 +578,80 @@ from the package directory (@pxref{Package Files}) to your 
checkout
 and initializes the code.  Note that you might have to use
 @code{package-vc-refresh} to repeat the initialization and update the
 autoloads.
+
+@subsection Specifying Package Sources
+@cindex package specification
+@cindex specification, for source packages
+
+  To install a package from source, Emacs must know where to get the
+package's source code (such as a code repository) and basic
+information about the structure of the code (such as the main file in
+a multi-file package).  A @dfn{package specification} describes these
+properties.
+
+  When supported by a package archive (@pxref{Package
+Archives,,,elisp, The Emacs Lisp Reference Manual}), Emacs can
+automatically download a package's specification from said archive.
+If the first argument passed to @code{package-vc-install} is a symbol
+naming a package, then Emacs will use the specification provided by
+the archive for that package.
+
+@example
+@group
+;; Emacs will download BBDB's specification from GNU ELPA:
+(package-vc-install 'bbdb)
+@end group
+@end example
+
+  The first argument to @code{package-vc-install} may also be a
+package specification.  This allows you to install source packages
+from locations other than the known archives listed in the user option
+@code{package-archives}.  A package specification is a list of the
+form @code{(@var{name} . @var{spec})}, in which @var{spec} should be a
+property list using any of the keys in the table below.
+
+For definitions of basic terms for working with code repositories and
+version control systems, see @ref{VCS Concepts,,,emacs, The GNU Emacs
+Manual}.
+
+@table @code
+@item :url
+A string providing the URL that specifies the repository from which to
+fetch the package's source code.
+
+@item :branch
+A string providing the revision of the code to install.  Do not
+confuse this with a package's version number.
+
+@item :lisp-dir
+A string providing the repository-relative name of the directory to
+use for loading the Lisp sources, which defaults to the root directory
+of the repository.
+
+@item :main-file
+A string providing the main file of the project, from which to gather
+package metadata.  If not given, the default is the package name with
+".el" appended to it.
+
+@item :doc
+A string providing the repository-relative name of the documentation
+file from which to build an Info file.  This can be a Texinfo file or
+an Org file.
+
+@item :vc-backend
+A symbol naming the VC backend to use for downloading a copy of the
+package's repository (@pxref{Version Control Systems,,,emacs, The GNU
+Emacs Manual}).  If omitted, Emacs will attempt to make a guess based
+on the provided URL, or, failing that, the process will fall back onto
+the value of @code{package-vc-default-backend}.
+@end table
+
+@example
+@group
+;; Specifying information manually:
+(package-vc-install
+  '(bbdb :url "https://git.savannah.nongnu.org/git/bbdb.git";
+         :lisp-dir "lisp"
+         :doc "doc/bbdb.texi"))
+@end group
+@end example
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index ddc7ec4679b..a72bb084d31 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -147,32 +147,9 @@ is a symbol designating the package and SPEC is one of:
 
 - nil, if any package version can be installed;
 - a version string, if that specific revision is to be installed;
-- a property list, describing a package specification.  Valid
-  key/value pairs are
-
-   `:url' (string)
-      The URL of the repository used to fetch the package source.
-
-   `:branch' (string)
-      If given, the name of the branch to checkout after cloning the directory.
-
-   `:lisp-dir' (string)
-      The repository-relative name of the directory to use for loading the Lisp
-      sources.  If not given, the value defaults to the root directory
-      of the repository.
-
-   `:main-file' (string)
-      The main file of the project, relevant to gather package metadata.
-      If not given, the assumed default is the package name with \".el\"
-      appended to it.
-
-   `:vc-backend' (symbol)
-      A symbol of the VC backend to use for cloning the package.  The
-      value ought to be a member of `vc-handled-backends'.  If omitted,
-      `vc-clone' will fall back onto the archive default or on
-      `package-vc-default-backend'.
-
-  All other keys are ignored.
+- a property list, describing a package specification.  For more
+  details, please consult the subsection \"Specifying Package
+  Sources\" in the Info node `(emacs)Fetching Package Sources'.
 
 This user option will be automatically updated to store package
 specifications for packages that are not specified in any
@@ -186,6 +163,7 @@ archive."
                                          (:branch string)
                                          (:lisp-dir string)
                                          (:main-file string)
+                                         (:doc string)
                                          (:vc-backend symbol)))))
   :version "29.1")
 
diff --git a/lisp/image.el b/lisp/image.el
index a32ff1a35bb..08190cf86bc 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -51,7 +51,7 @@ static \\(unsigned \\)?char \\1_bits" . xbm)
     ("\\`\\(?:MM\0\\*\\|II\\*\0\\)" . tiff)
     ("\\`[\t\n\r ]*%!PS" . postscript)
     ("\\`\xff\xd8" . jpeg)    ; used to be (image-jpeg-p . jpeg)
-    ("\\`RIFF....WEBPVP8" . webp)
+    ("\\`RIFF[^z-a][^z-a][^z-a][^z-a]WEBPVP8" . webp)
     (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
             (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)")))
        (concat "\\(?:<\\?xml[ \t\r\n]+[^>]*>\\)?[ \t\r\n]*<"
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 600650aadc1..5a38d714e5a 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -1070,6 +1070,39 @@ recommended to enable `electric-pair-mode' with this 
mode."
 
     (treesit-major-mode-setup)))
 
+(easy-menu-define c-ts-mode-menu (list c-ts-mode-map c++-ts-mode-map)
+  "Menu for `c-ts-mode' and `c++-ts-mode'."
+  '("C/C++"
+    ["Comment Out Region" comment-region
+     :enable mark-active
+     :help "Comment out the region between the mark and point"]
+    ["Uncomment Region" (comment-region (region-beginning)
+                                        (region-end) '(4))
+     :enable mark-active
+     :help "Uncomment the region between the mark and point"]
+    ["Indent Top-level Expression" c-ts-mode-indent-defun
+     :help "Indent/reindent top-level function, class, etc."]
+    ["Indent Line or Region" indent-for-tab-command
+     :help "Indent current line or region, or insert a tab"]
+    ["Forward Expression" forward-sexp
+     :help "Move forward across one balanced expression"]
+    ["Backward Expression" backward-sexp
+     :help "Move back across one balanced expression"]
+    "--"
+    ("Style..."
+     ["Set Indentation Style..." c-ts-mode-set-style
+      :help "Set C/C++ indentation style for current buffer"]
+     ["Show Current Indentation Style" (message "Indentation Style: %s"
+                                                c-ts-mode-indent-style)
+      :help "Show the name of the C/C++ indentation style for current buffer"]
+     ["Set Comment Style" c-ts-mode-toggle-comment-style
+      :help "Toglle C/C++ comment style between block and line comments"])
+    "--"
+    ("Toggle..."
+     ["SubWord Mode" subword-mode
+      :style toggle :selected subword-mode
+      :help "Toggle sub-word movement and editing mode"])))
+
 ;; We could alternatively use parsers, but if this works well, I don't
 ;; see the need to change.  This is copied verbatim from cc-guess.el.
 (defconst c-ts-mode--c-or-c++-regexp
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index d2c4da794ac..e441ffbbfe3 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1904,13 +1904,13 @@ See `add-log-current-defun-function'."
               (progn
                 (unless (string-equal "self" (car mn)) ; def self.foo
                   ;; def C.foo
-                  (let ((ml (nreverse mlist)))
+                  (let ((ml (reverse mlist)))
                     ;; If the method name references one of the
                     ;; containing modules, drop the more nested ones.
                     (while ml
                       (if (string-equal (car ml) (car mn))
                           (setq mlist (nreverse (cdr ml)) ml nil))
-                      (or (setq ml (cdr ml)) (nreverse mlist))))
+                      (setq ml (cdr ml))))
                   (if mlist
                       (setcdr (last mlist) (butlast mn))
                     (setq mlist (butlast mn))))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index bb2bcfd8052..97c4ce9f32d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -214,12 +214,14 @@ Must be greater than 1."
        ((file-readable-p "/usr/share/lib/dict/words")
         "/usr/share/lib/dict/words")
        ((file-readable-p "/sys/dict") "/sys/dict"))
-  "Alternate plain word-list dictionary for spelling help."
+  "Alternate plain word-list dictionary for spelling help.
+This is also used by `ispell-lookup-words' and `ispell-complete-word'."
   :type '(choice file (const :tag "None" nil)))
 
 (defcustom ispell-complete-word-dict nil
   "Plain word-list dictionary used for word completion if
-different from `ispell-alternate-dictionary'."
+different from `ispell-alternate-dictionary'.
+This is also used by `ispell-lookup-words' and `ispell-complete-word'."
   :type '(choice file (const :tag "None" nil)))
 
 (defcustom ispell-message-dictionary-alist nil
@@ -2510,7 +2512,9 @@ Otherwise the variable `ispell-grep-command' contains the 
command
 
 Optional second argument contains the dictionary to use; the default is
 `ispell-alternate-dictionary', overridden by `ispell-complete-word-dict'
-if defined."
+if defined.  If none of LOOKUP-DICT, `ispell-alternate-dictionary',
+and `ispell-complete-word-dict' name an existing word-list file,
+this function signals an error."
   ;; We don't use the filter for this function, rather the result is written
   ;; into a buffer.  Hence there is no need to save the filter values.
   (if (null lookup-dict)
@@ -3685,7 +3689,12 @@ If APPEND is non-nil, don't erase previous debugging 
output."
 If optional INTERIOR-FRAG is non-nil, then the word may be a character
 sequence inside of a word.
 
-Standard ispell choices are then available."
+Standard ispell choices are then available.
+
+This command uses a word-list file specified
+by `ispell-alternate-dictionary' or by `ispell-complete-word-dict';
+if none of those name an existing word-list file, this command
+signals an error."
   ;; FIXME: completion-at-point-function.
   (interactive "P")
   (let ((case-fold-search-val case-fold-search)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 90905edb887..32b0d5d7556 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1594,7 +1594,7 @@ After check-out, runs the normal hook `vc-checkout-hook'."
        (vc-call make-version-backups-p file)
        (vc-up-to-date-p file)
        (vc-make-version-backup file))
-  (let ((backend (vc-backend file)))
+  (let ((backend (or (bound-and-true-p vc-dir-backend) (vc-backend file))))
     (with-vc-properties (list file)
       (condition-case err
           (vc-call-backend backend 'checkout file rev)
diff --git a/src/w32.c b/src/w32.c
index 8d344d2e6da..a6bc0f4b2ee 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -543,7 +543,14 @@ typedef LANGID (WINAPI *GetUserDefaultUILanguage_Proc) 
(void);
 
 typedef COORD (WINAPI *GetConsoleFontSize_Proc) (HANDLE, DWORD);
 
-#if _WIN32_WINNT < 0x0501
+/* Old versions of mingw.org's MinGW, before v5.2.0, don't have a
+   _WIN32_WINNT guard for CONSOLE_FONT_INFO in wincon.h, and so don't
+   need the conditional definition below, which causes compilation
+   errors.  Note: MinGW64 sets _WIN32_WINNT to a higher version, and
+   its w32api.h version stays fixed at 3.14.  */
+#if _WIN32_WINNT < 0x0501 \
+    && (__W32API_MAJOR_VERSION > 5 \
+       || (__W32API_MAJOR_VERSION == 5 && __W32API_MINOR_VERSION >= 2))
 typedef struct
 {
   DWORD nFont;
diff --git a/test/lisp/image/wallpaper-tests.el 
b/test/lisp/image/wallpaper-tests.el
index 2e4e36030d4..c4167adbef2 100644
--- a/test/lisp/image/wallpaper-tests.el
+++ b/test/lisp/image/wallpaper-tests.el
@@ -129,12 +129,16 @@
       (should (equal called fil-jpg)))))
 
 (ert-deftest wallpaper--find-command/return-string ()
-  (should (or (not (wallpaper--find-command))
-              (stringp (wallpaper--find-command)))))
+  (let ((cmd (wallpaper--find-command)))
+    (should (or (not cmd)
+                (stringp cmd)))))
 
 (ert-deftest wallpaper--find-command-args/return-list ()
-  (should (or (not (wallpaper--find-command-args))
-              (listp (wallpaper--find-command-args)))))
+  (let ((cmdargs (wallpaper--find-command-args)))
+    (if (functionp cmdargs)
+        (setq cmdargs (funcall cmdargs)))
+    (should (or (not cmdargs)
+                (listp cmdargs)))))
 
 (ert-deftest wallpaper--image-file-regexp/return-string ()
   (should (stringp (wallpaper--image-file-regexp))))
diff --git a/test/lisp/progmodes/ruby-mode-tests.el 
b/test/lisp/progmodes/ruby-mode-tests.el
index 8a75c83d2c3..117385ea3e8 100644
--- a/test/lisp/progmodes/ruby-mode-tests.el
+++ b/test/lisp/progmodes/ruby-mode-tests.el
@@ -567,6 +567,22 @@ VALUES-PLIST is a list with alternating index and value 
elements."
     (search-backward "_")
     (should (string= (ruby-add-log-current-method) "C::D#foo"))))
 
+(ert-deftest ruby-add-log-current-method-singleton-referencing-outer ()
+  (ruby-with-temp-buffer (ruby-test-string
+                          "module M
+                          |  module N
+                          |    module C
+                          |      class D
+                          |        def C.foo
+                          |          _
+                          |        end
+                          |      end
+                          |    end
+                          |  end
+                          |end")
+    (search-backward "_")
+    (should (string= (ruby-add-log-current-method) "M::N::C.foo"))))
+
 (ert-deftest ruby-add-log-current-method-after-inner-class ()
   (ruby-with-temp-buffer (ruby-test-string
                           "module M



reply via email to

[Prev in Thread] Current Thread [Next in Thread]