commit 5b774598f4911975444120f56e448c4ca5f8c11f (HEAD, refs/remotes/origin/master) Author: Philipp Stephani Date: Sat Oct 8 15:29:32 2016 +0200 Don’t consider nested let-alist forms See Bug#24641. * lisp/emacs-lisp/let-alist.el (let-alist--deep-dot-search): Don’t consider symbols in nested ‘let-alist’ forms. * test/lisp/emacs-lisp/let-alist-tests.el (let-alist--deep-dot-search--nested): Add a unit test. diff --git a/lisp/emacs-lisp/let-alist.el b/lisp/emacs-lisp/let-alist.el index 3507a39..d706917 100644 --- a/lisp/emacs-lisp/let-alist.el +++ b/lisp/emacs-lisp/let-alist.el @@ -76,6 +76,11 @@ symbol, and each cdr is the same symbol without the `.'." ;; with other results in the clause below. (list (cons data (intern (replace-match "" nil nil name))))))) ((not (consp data)) nil) + ((eq (car data) 'let-alist) + ;; For nested ‘let-alist’ forms, ignore symbols appearing in the + ;; inner body because they don’t refer to the alist currently + ;; being processed. See Bug#24641. + (let-alist--deep-dot-search (cadr data))) (t (append (let-alist--deep-dot-search (car data)) (let-alist--deep-dot-search (cdr data)))))) diff --git a/test/lisp/emacs-lisp/let-alist-tests.el b/test/lisp/emacs-lisp/let-alist-tests.el index 80d418c..657a27a 100644 --- a/test/lisp/emacs-lisp/let-alist-tests.el +++ b/test/lisp/emacs-lisp/let-alist-tests.el @@ -88,4 +88,12 @@ '(cdr (assq 'baz (cdr (assq 'bar (cdr (assq 'foo var)))))))) (should (equal (let-alist--access-sexp '..foo.bar.baz 'var) '.foo.bar.baz))) +(ert-deftest let-alist--deep-dot-search--nested () + "Check that nested `let-alist' forms don't generate spurious bindings. +See Bug#24641." + (should (equal (let-alist--deep-dot-search '(foo .bar (baz .qux))) + '((.bar . bar) (.qux . qux)))) + (should (equal (let-alist--deep-dot-search '(foo .bar (let-alist .qux .baz))) + '((.bar . bar) (.qux . qux))))) ; no .baz + ;;; let-alist.el ends here commit f3eedc7e68d0e8b97425b72d691593d06639df88 Author: Alain Schneble Date: Sat Oct 8 16:52:40 2016 +0300 Support SIGTRAP in kill emulation on Windows * src/w32proc.c (sys_kill): Translate SIGTRAP signal into a call to 'DebugBreakProcess' to cause a breakpoint exception to occur in the specified process. On Windows versions prior to Windows XP that do not support 'DebugBreakProcess' return -1 and set errno to ENOTSUP (as opposed to EINVAL before this change). * src/w32proc.c: Add typedef for 'DebugBreakProcess' function pointer and global variable to track state of run-time dynamic linking of this function. * etc/NEWS: Add entry to document that 'signal-process' now supports SIGTRAP. diff --git a/etc/NEWS b/etc/NEWS index 59fb72a..14450a6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -668,6 +668,16 @@ session and exits. In particular, this will happen if you start emacs.exe from the Windows shell, then type Ctrl-C into that shell's window. +--- +** 'signal-process' supports SIGTRAP on Windows XP and later. +The 'kill' emulation on Windows now maps SIGTRAP to a call to the +'DebugBreakProcess' API. This causes the receiving process to break +execution and return control to the debugger. If no debugger is +attached to the receiving process, the call is typically ignored. +This is in contrast to the default action on POSIX Systems, where it +causes the receiving process to terminate with a core dump if no +debugger has been attached to it. + ---------------------------------------------------------------------- This file is part of GNU Emacs. diff --git a/src/w32.c b/src/w32.c index f911085..517e286 100644 --- a/src/w32.c +++ b/src/w32.c @@ -334,6 +334,7 @@ static BOOL g_b_init_set_named_security_info_a; static BOOL g_b_init_get_adapters_info; BOOL g_b_init_compare_string_w; +BOOL g_b_init_debug_break_process; /* BEGIN: Wrapper functions around OpenProcessToken @@ -9657,6 +9658,7 @@ globals_of_w32 (void) g_b_init_set_named_security_info_a = 0; g_b_init_get_adapters_info = 0; g_b_init_compare_string_w = 0; + g_b_init_debug_break_process = 0; num_of_processors = 0; /* The following sets a handler for shutdown notifications for console apps. This actually applies to Emacs in both console and diff --git a/src/w32proc.c b/src/w32proc.c index aef4e44..189034c 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -69,6 +69,8 @@ along with GNU Emacs. If not, see . */ + (filedata).file_base)) extern BOOL g_b_init_compare_string_w; +extern BOOL g_b_init_debug_break_process; + int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *, struct timespec *, void *); @@ -2497,6 +2499,9 @@ find_child_console (HWND hwnd, LPARAM arg) return TRUE; } +typedef BOOL (WINAPI * DebugBreakProcess_Proc) ( + HANDLE hProcess); + /* Emulate 'kill', but only for other processes. */ int sys_kill (pid_t pid, int sig) @@ -2510,9 +2515,9 @@ sys_kill (pid_t pid, int sig) if (pid < 0) pid = -pid; - /* Only handle signals that will result in the process dying */ + /* Only handle signals that can be mapped to a similar behavior on Windows */ if (sig != 0 - && sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP) + && sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP && sig != SIGTRAP) { errno = EINVAL; return -1; @@ -2555,7 +2560,11 @@ sys_kill (pid_t pid, int sig) close the selected frame, which does not necessarily terminates Emacs. But then we are not supposed to call sys_kill with our own PID. */ - proc_hand = OpenProcess (PROCESS_TERMINATE, 0, pid); + + DWORD desiredAccess = + (sig == SIGTRAP) ? PROCESS_ALL_ACCESS : PROCESS_TERMINATE; + + proc_hand = OpenProcess (desiredAccess, 0, pid); if (proc_hand == NULL) { errno = EPERM; @@ -2651,6 +2660,43 @@ sys_kill (pid_t pid, int sig) rc = -1; } } + else if (sig == SIGTRAP) + { + static DebugBreakProcess_Proc s_pfn_Debug_Break_Process = NULL; + + if (g_b_init_debug_break_process == 0) + { + g_b_init_debug_break_process = 1; + s_pfn_Debug_Break_Process = (DebugBreakProcess_Proc) + GetProcAddress (GetModuleHandle ("kernel32.dll"), + "DebugBreakProcess"); + } + + if (s_pfn_Debug_Break_Process == NULL) + { + errno = ENOTSUP; + rc = -1; + } + else if (!s_pfn_Debug_Break_Process (proc_hand)) + { + DWORD err = GetLastError (); + + DebPrint (("sys_kill.DebugBreakProcess return %d " + "for pid %lu\n", err, pid)); + + switch (err) + { + case ERROR_ACCESS_DENIED: + errno = EPERM; + break; + default: + errno = EINVAL; + break; + } + + rc = -1; + } + } else { if (NILP (Vw32_start_process_share_console) && cp && cp->hwnd) commit 67d14c8222c05ac20229f71a2cf40eb9e3efa053 Author: Eli Zaretskii Date: Sat Oct 8 16:37:42 2016 +0300 Deprecate 'wp' group and introduce a new group 'text' * lisp/textmodes/tildify.el (tildify): * lisp/textmodes/text-mode.el (text-mode-hook): * lisp/textmodes/table.el (table): * lisp/textmodes/rst.el (rst): * lisp/textmodes/refer.el (refer): * lisp/textmodes/refbib.el (refbib): * lisp/textmodes/picture.el (picture): * lisp/textmodes/nroff-mode.el (nroff): * lisp/textmodes/enriched.el (enriched): * lisp/textmodes/bib-mode.el (bib): * lisp/progmodes/ebnf2ps.el (ebnf2ps): * lisp/nxml/rng-valid.el (relax-ng): * lisp/view.el (view): * lisp/ps-print.el (ps-print): * lisp/printing.el (printing): * lisp/outline.el (outlines): * lisp/lpr.el (lpr): * lisp/delim-col.el (columns): Use 'text' group instead of 'wp'. * lisp/cus-edit.el (wp): Remove the "text" tag. (text): New defgroup, inherits from the deprecated 'wp'. (outlines): Remove, in favor of the definition in outline.el. (tex): Inherit from 'text'. Suggested by Drew Adams . (Bug#24549) diff --git a/etc/NEWS b/etc/NEWS index 4268a40..59fb72a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -61,6 +61,10 @@ affected by this, as SGI stopped supporting IRIX in December 2013. * Changes in Emacs 26.1 +--- +The group 'wp', whose label was "text", is now deprecated. +Use the new group 'text', which inherits from 'wp', instead. + +++ ** The new function 'call-shell-region' executes a command in an inferior shell with the buffer region as input. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 2e39514..601445a 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -175,10 +175,16 @@ :group 'emacs) (defgroup wp nil - "Support for editing text files." - :tag "Text" + "Support for editing text files. +Use group `text' for this instead. This group is deprecated." :group 'emacs) +(defgroup text nil + "Support for editing text files." + :group 'emacs + ;; Inherit from deprecated `wp' for compatibility, for now. + :group 'wp) + (defgroup data nil "Support for editing binary data files." :group 'emacs) @@ -197,10 +203,6 @@ :link '(custom-manual "(emacs)Emulation") :group 'editing) -(defgroup outlines nil - "Support for hierarchical outlining." - :group 'wp) - (defgroup external nil "Interfacing to external utilities." :group 'emacs) @@ -313,7 +315,7 @@ (defgroup tex nil "Code related to the TeX formatter." :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) - :group 'wp) + :group 'text) (defgroup faces nil "Support for multiple fonts." diff --git a/lisp/delim-col.el b/lisp/delim-col.el index cfa7c76..dc637d5 100644 --- a/lisp/delim-col.el +++ b/lisp/delim-col.el @@ -125,7 +125,7 @@ "Prettify columns." :link '(emacs-library-link :tag "Source Lisp File" "delim-col.el") :prefix "delimit-columns-" - :group 'wp) + :group 'text) (defcustom delimit-columns-str-before "" "Specify a string to be inserted before all columns." diff --git a/lisp/lpr.el b/lisp/lpr.el index 2fe32c7..d09f779 100644 --- a/lisp/lpr.el +++ b/lisp/lpr.el @@ -42,7 +42,7 @@ (defgroup lpr nil "Print Emacs buffer on line printer." - :group 'wp) + :group 'text) ;;;###autoload diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el index 946bf79..239b1d1 100644 --- a/lisp/nxml/rng-valid.el +++ b/lisp/nxml/rng-valid.el @@ -101,7 +101,7 @@ (defgroup relax-ng nil "Validation of XML using RELAX NG." - :group 'wp + :group 'text :group 'nxml :group 'languages) diff --git a/lisp/outline.el b/lisp/outline.el index f6ab1e4..6345bb5 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -38,7 +38,7 @@ (defgroup outlines nil "Support for hierarchical outlining." :prefix "outline-" - :group 'wp) + :group 'text) (defvar outline-regexp "[*\^L]+" "Regular expression to match the beginning of a heading. diff --git a/lisp/printing.el b/lisp/printing.el index d9cc2a3..7cdfb49 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -1668,7 +1668,7 @@ separator; otherwise, ensure unix-style directory separator." :link '(emacs-library-link :tag "Source Lisp File" "printing.el") :prefix "pr-" :version "22.1" - :group 'wp + :group 'text :group 'postscript) diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index ffb93de..c4e6268 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -1191,7 +1191,7 @@ Elements of ALIST that are not conses are ignored." "Translate an EBNF to a syntactic chart on PostScript." :prefix "ebnf-" :version "20" - :group 'wp + :group 'text :group 'postscript) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 6c2a8c6..71523a9 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -1495,7 +1495,7 @@ Please send all bug fixes and enhancements to :link '(emacs-library-link :tag "Source Lisp File" "ps-print.el") :prefix "ps-" :version "20" - :group 'wp + :group 'text :group 'postscript) (defgroup ps-print-horizontal nil diff --git a/lisp/textmodes/bib-mode.el b/lisp/textmodes/bib-mode.el index 62b666b..8b40558 100644 --- a/lisp/textmodes/bib-mode.el +++ b/lisp/textmodes/bib-mode.el @@ -35,7 +35,7 @@ "Major mode for editing bib files." :prefix "bib-" :group 'external - :group 'wp) + :group 'text) (defcustom bib-file "~/my-bibliography.bib" "Default name of file used by `addbib'." diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el index 124be27..5562a75 100644 --- a/lisp/textmodes/enriched.el +++ b/lisp/textmodes/enriched.el @@ -46,7 +46,7 @@ (defgroup enriched nil "Read and save files in text/enriched format." - :group 'wp) + :group 'text) (defcustom enriched-verbose t "If non-nil, give status messages when reading and writing files." diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el index b064f6d..35996bc 100644 --- a/lisp/textmodes/nroff-mode.el +++ b/lisp/textmodes/nroff-mode.el @@ -37,7 +37,7 @@ (defgroup nroff nil "Nroff mode." :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces) - :group 'wp + :group 'text :prefix "nroff-") diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index b77f8e9..01d67b5 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -33,7 +33,7 @@ (defgroup picture nil "Editing text-based pictures (\"ASCII art\")." :prefix "picture-" - :group 'wp) + :group 'text) (defcustom picture-rectangle-ctl ?+ "Character `picture-draw-rectangle' uses for top left corners." diff --git a/lisp/textmodes/refbib.el b/lisp/textmodes/refbib.el index b73916a..46bf3c7 100644 --- a/lisp/textmodes/refbib.el +++ b/lisp/textmodes/refbib.el @@ -61,7 +61,7 @@ (defgroup refbib nil "Convert refer-style references to ones usable by Latex bib." :prefix "r2b-" - :group 'wp) + :group 'text) (defcustom r2b-trace-on nil "Non-nil means trace conversion." diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el index f2abf06..4c9e62b 100644 --- a/lisp/textmodes/refer.el +++ b/lisp/textmodes/refer.el @@ -73,7 +73,7 @@ (defgroup refer nil "Look up references in bibliography files." :prefix "refer-" - :group 'wp) + :group 'text) (defcustom refer-bib-directory nil "Directory, or list of directories, to search for \\.bib files. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 029139e..ddf8d3c 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -292,7 +292,7 @@ in parentheses follows the development revision and the time stamp.") ;; Initialize customization (defgroup rst nil "Support for reStructuredText documents." - :group 'wp + :group 'text :version "23.1" :link '(url-link "http://docutils.sourceforge.net/rst.html")) diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 8330e17..e12a340 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -641,7 +641,7 @@ "Text based table manipulation utilities." :tag "Table" :prefix "table-" - :group 'wp + :group 'text :version "22.1") (defgroup table-hooks nil diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index 731c2d2..c42eec0 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -35,7 +35,7 @@ "Normal hook run when entering Text mode and many related modes." :type 'hook :options '(turn-on-auto-fill turn-on-flyspell) - :group 'wp) + :group 'text) (defvar text-mode-variant nil "Non-nil if this buffer's major mode is a variant of Text mode. diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index 598060e..cd258b8 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -54,7 +54,7 @@ (defgroup tildify nil "Add hard spaces or other text fragments to text buffers." :version "21.1" - :group 'wp) + :group 'text) (defcustom tildify-pattern "\\(?:[,:;(][ \t]*[a]\\|\\<[AIKOSUVZikosuvz]\\)\\([ \t]+\\|[ \t]*\n[ \t]*\\)\\(?:\\w\\|[([{\\]\\|<[a-zA-Z]\\)" diff --git a/lisp/view.el b/lisp/view.el index ff7d2c9..92cbd14 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -48,7 +48,7 @@ "Peruse file or buffer without editing." :link '(function-link view-mode) :link '(custom-manual "(emacs)Misc File Ops") - :group 'wp) + :group 'text) (defcustom view-highlight-face 'highlight "The face used for highlighting the match found by View mode search." commit 2913fa2d478e1c717c15e9a4d978454b7161750d Author: Laimonas Vėbra Date: Sat Oct 8 15:15:22 2016 +0300 Extend dictionary and library-directory handling for Ispell * lisp/textmodes/ispell.el (ispell-check-version): Allow overriding LIBDIR via the variable defined by LIBRARYVAR (usually ISPELL_DICTDIR). (ispell-valid-dictionary-list): If the -d option to Ispell specifies an absolute file name, use that regardless of ispell-library-directory. (Bug#24439) Copyright-paperwork-exempt: yes diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 0ed6c68..5d5d422 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -838,7 +838,12 @@ Otherwise returns the library directory name, if that is defined." (let ((default-directory (or (and (boundp 'temporary-file-directory) temporary-file-directory) default-directory)) - result status ispell-program-version) + (get-config-var + (lambda (var) + (when (re-search-forward + (concat var " = \\\"\\(.+?\\)\\\"") nil t) + (match-string 1)))) + result libvar status ispell-program-version) (with-temp-buffer (setq status (ispell-call-process @@ -860,9 +865,13 @@ Otherwise returns the library directory name, if that is defined." ", " ispell-version)) (message "%s" result)) - ;; return library directory. - (if (re-search-forward "LIBDIR = \\\"\\([^ \t\n]*\\)\\\"" nil t) - (setq result (match-string 1)))) + ;; return LIBDIR or LIBRARYVAR (overrides LIBDIR) env. + (progn + (setq result (funcall get-config-var "LIBDIR") + libvar (funcall get-config-var "LIBRARYVAR")) + (when libvar + (setq libvar (getenv libvar)) + (unless (member libvar '(nil "")) (setq result libvar))))) (goto-char (point-min)) (if (not (memq status '(0 nil))) (error "%s exited with %s %s" ispell-program-name @@ -1490,23 +1499,29 @@ The variable `ispell-library-directory' defines their location." (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist)) (dict-list (cons "default" nil)) - name dict-bname) + (dict-locate + (lambda (dict &optional dir) + (locate-file (file-name-nondirectory dict) + `(,(or dir (file-name-directory dict))) + (unless (file-name-extension dict) '(".hash" ".has"))))) + name dict-explt dict-bname) (dolist (dict dicts) (setq name (car dict) - dict-bname (or (car (cdr (member "-d" (nth 5 dict)))) - name)) - ;; Include if the dictionary is in the library, or dir not defined. - (if (and - name - ;; For Aspell, we already know which dictionaries exist. - (or ispell-really-aspell - ;; Include all dictionaries if lib directory not known. - ;; Same for Hunspell, where ispell-library-directory is nil. - (not ispell-library-directory) - (file-exists-p (concat ispell-library-directory - "/" dict-bname ".hash")) - (file-exists-p (concat ispell-library-directory - "/" dict-bname ".has")))) + ;; Explicitly (via ispell-args) specified dictionary. + dict-explt (car (cdr (member "-d" (nth 5 dict)))) + dict-bname (or dict-explt name)) + (if (and name + (or + ;; Include all for Aspell (we already know existing dicts) + ispell-really-aspell + ;; Include all if `ispell-library-directory' is nil (Hunspell) + (not ispell-library-directory) + ;; If explicit (-d with an absolute path) and existing dict. + (and dict-explt + (file-name-absolute-p dict-explt) + (funcall dict-locate dict-explt)) + ;; If dict located in `ispell-library-directory'. + (funcall dict-locate dict-bname ispell-library-directory))) (push name dict-list))) dict-list))