commit c48f8fa51b51746ffd39f7b973c471cd60994c8e (HEAD, refs/remotes/origin/master) Author: Gemini Lasswell Date: Fri Feb 10 11:35:20 2017 +0200 Fix instrumenting code with propertized strings in Edebug * lisp/emacs-lisp/edebug.el (edebug-read-function): Allow 'read' to decide what is and isn't a syntax error. (Bug#25068) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index ec0f08de35..a8838046a4 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -880,11 +880,9 @@ Maybe clear the markers and delete the symbol's edebug property?" (list (edebug-storing-offsets (- (point) 2) 'function) (edebug-read-storing-offsets stream))) - ((memq (following-char) '(?: ?B ?O ?X ?b ?o ?x ?1 ?2 ?3 ?4 ?5 ?6 - ?7 ?8 ?9 ?0)) + (t (backward-char 1) - (read stream)) - (t (edebug-syntax-error "Bad char after #")))) + (read stream)))) (defun edebug-read-list (stream) (forward-char 1) ; skip \( commit 2d284db5c9c5ff23269e2ec277f5348abdf1cd47 Author: Vladimir Panteleev Date: Fri Feb 10 11:23:24 2017 +0200 Improve fontification in bat-mode * lisp/progmodes/bat-mode.el (bat-font-lock-keywords): Match word and symbol constituents when looking for variable names to fontify; also, correct the syntax table and mark the equal sign (=) character as punctuation. Improve fontification accuracy of iteration/positional variables. (bat-mode): Set comment-start-skip. (Bug#25541) * test/lisp/progmodes/bat-mode-tests.el: New file, tests for bat-mode.el. diff --git a/lisp/progmodes/bat-mode.el b/lisp/progmodes/bat-mode.el index 156331cf86..1dd2e3757e 100644 --- a/lisp/progmodes/bat-mode.el +++ b/lisp/progmodes/bat-mode.el @@ -82,12 +82,15 @@ (2 font-lock-constant-face t)) ("^:[^:].*" . 'bat-label-face) - ("\\_<\\(defined\\|set\\)\\_>[ \t]*\\(\\w+\\)" + ("\\_<\\(defined\\|set\\)\\_>[ \t]*\\(\\(\\sw\\|\\s_\\)+\\)" (2 font-lock-variable-name-face)) - ("%\\(\\w+\\)%?" + ("%\\(\\(\\sw\\|\\s_\\)+\\)%" (1 font-lock-variable-name-face)) - ("!\\(\\w+\\)!?" ; delayed-expansion !variable! + ("!\\(\\(\\sw\\|\\s_\\)+\\)!" ; delayed-expansion !variable! (1 font-lock-variable-name-face)) + ("%%\\(?:~[adfnpstxz]*\\(?:\\$\\(\\(?:\\sw\\|\\s_\\)+\\):\\)?\\)?\\([]!#$&-:?-[_-{}~]\\)" + (1 font-lock-variable-name-face nil t) ; PATH expansion + (2 font-lock-variable-name-face)) ; iteration variable or positional parameter ("[ =][-/]+\\(\\w+\\)" (1 font-lock-type-face append)) (,(concat "\\_<" (regexp-opt COMMANDS) "\\_>") . font-lock-builtin-face) @@ -130,6 +133,7 @@ (modify-syntax-entry ?{ "_" table) (modify-syntax-entry ?} "_" table) (modify-syntax-entry ?\\ "." table) + (modify-syntax-entry ?= "." table) table)) (defconst bat--syntax-propertize @@ -175,6 +179,7 @@ with `bat-cmd-help'. Navigate between sections using `imenu'. Run script using `bat-run' and `bat-run-args'.\n \\{bat-mode-map}" (setq-local comment-start "rem ") + (setq-local comment-start-skip "rem[ \t]+") (setq-local syntax-propertize-function bat--syntax-propertize) (setq-local font-lock-defaults '(bat-font-lock-keywords nil t)) ; case-insensitive keywords diff --git a/test/lisp/progmodes/bat-mode-tests.el b/test/lisp/progmodes/bat-mode-tests.el new file mode 100644 index 0000000000..565718eea4 --- /dev/null +++ b/test/lisp/progmodes/bat-mode-tests.el @@ -0,0 +1,86 @@ +;;; bat-mode-tests.el --- Tests for bat-mode.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2017 Free Software Foundation, Inc. + +;; Author: Vladimir Panteleev +;; Keywords: + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'ert) +(require 'bat-mode) +(require 'htmlfontify) + +(defun bat-test-fontify (str) + "Fontify STR in `bat-mode' to a HTML string using `htmlfontify' and return it." + (with-temp-buffer + (insert str) + (bat-mode) + (let ((hfy-optimizations '(body-text-only merge-adjacent-tags))) + (with-current-buffer (htmlfontify-buffer) (buffer-string))))) + +(ert-deftest bat-test-fontification-var-decl () + "Test fontification of variable declarations." + (should + (equal + (bat-test-fontify "set a_b-c{d}e=f") + "set a_b-c{d}e=f"))) + +(ert-deftest bat-test-fontification-var-exp () + "Test fontification of variable expansions." + (should + (equal + (bat-test-fontify "echo %a_b-c{d}e%") + "echo %a_b-c{d}e%"))) + +(ert-deftest bat-test-fontification-var-delayed-exp () + "Test fontification of delayed variable expansions." + (should + (equal + (bat-test-fontify "echo !a_b-c{d}e!") + "echo !a_b-c{d}e!"))) + +(ert-deftest bat-test-fontification-iter-var-1 () + "Test fontification of iteration variables." + (should + (equal + (bat-test-fontify "echo %%a\necho %%~dp1\necho %%~$PATH:I") + "echo %%a +echo %%~dp1 +echo %%~$PATH:I"))) + +(defun bat-test-fill-paragraph (str) + "Return the result of invoking `fill-paragraph' on STR in a `bat-mode' buffer." + (with-temp-buffer + (bat-mode) + (insert str) + (goto-char 1) + (font-lock-ensure) + (fill-paragraph) + (buffer-string))) + +(ert-deftest bat-test-fill-paragraph-comment () + "Test `fill-paragraph' in a comment block." + (should (equal (bat-test-fill-paragraph "rem foo\nrem bar\n") "rem foo bar\n"))) + +(provide 'bat-tests) +;;; bat-mode-tests.el ends here commit 937bf04804246c86a4b1bd55b506169f5a894e3b Author: Eli Zaretskii Date: Fri Feb 10 10:57:41 2017 +0200 Restore special setting of this-command-keys by M-x It was lost when execute-extended-command was reimplemented in Lisp. * src/keyboard.c (Fset__this_command_keys): New function. (syms_of_keyboard): Defsubr it. * lisp/simple.el (execute-extended-command): Set this-command-keys as novice.el expects. (Bug#25612) diff --git a/lisp/simple.el b/lisp/simple.el index 441713a18b..c0dad2d36e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1733,6 +1733,9 @@ invoking, give a prefix argument to `execute-extended-command'." (where-is-internal function overriding-local-map t)))) (unless (commandp function) (error "`%s' is not a valid command name" command-name)) + ;; Some features, such as novice.el, rely on this-command-keys + ;; including M-x COMMAND-NAME RET. + (set--this-command-keys (concat "\M-x" (symbol-name function) "\r")) (setq this-command function) ;; Normally `real-this-command' should never be changed, but here we really ;; want to pretend that M-x RET is nothing more than a "key diff --git a/src/keyboard.c b/src/keyboard.c index a86e7c5f8e..168232203f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -10001,6 +10001,30 @@ See also `this-command-keys-vector'. */) XVECTOR (this_command_keys)->contents); } +DEFUN ("set--this-command-keys", Fset__this_command_keys, + Sset__this_command_keys, 1, 1, 0, + doc: /* Set the vector to be returned by `this-command-keys'. +The argument KEYS must be a string. +Internal use only. */) + (Lisp_Object keys) +{ + CHECK_STRING (keys); + + this_command_key_count = 0; + this_single_command_key_start = 0; + int key0 = SREF (keys, 0); + + /* Kludge alert: this makes M-x be in the form expected by + novice.el. Any better ideas? */ + if (key0 == 248) + add_command_key (make_number ('x' | meta_modifier)); + else + add_command_key (make_number (key0)); + for (int i = 1; i < SCHARS (keys); i++) + add_command_key (make_number (SREF (keys, i))); + return Qnil; +} + DEFUN ("this-command-keys-vector", Fthis_command_keys_vector, Sthis_command_keys_vector, 0, 0, 0, doc: /* Return the key sequence that invoked this command, as a vector. However, if the command has called `read-key-sequence', it returns @@ -11211,6 +11235,7 @@ syms_of_keyboard (void) defsubr (&Sthis_command_keys_vector); defsubr (&Sthis_single_command_keys); defsubr (&Sthis_single_command_raw_keys); + defsubr (&Sset__this_command_keys); defsubr (&Sclear_this_command_keys); defsubr (&Ssuspend_emacs); defsubr (&Sabort_recursive_edit); commit d825d1f28decd671feb71c7657d41d0502ab5cf5 Author: Juri Linkov Date: Fri Feb 10 00:35:22 2017 +0200 * lisp/isearch.el (isearch-search-fun-default): Set isearch-adjusted to t to display "Pending" in the search prompt for lax word/symbol search (bug#25562). Don't use lax for lazy-highlighting when 'bound' is non-nil. (word-search-regexp, isearch-symbol-regexp): Don't depend on lax at the beginning of regexp (bug#22589). * lisp/info.el (Info-isearch-search): Use isearch--lax-regexp-function-p. * doc/emacs/search.texi (Word Search, Symbol Search): Mention "Pending" prompt for lax word/symbol search. diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index fa69ba48f6..77baae2a8f 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -609,6 +609,8 @@ string, its first and last words need not match whole words. This is so that the matching can proceed incrementally as you type. This additional laxity does not apply to the lazy highlight (@pxref{Incremental Search}), which always matches whole words. +While you are typing the search string, @samp{Pending} appears in the +search prompt until you use a search repeating key like @kbd{C-s}. The word search commands don't perform character folding, and toggling lax whitespace matching (@pxref{Lax Search, lax space @@ -661,8 +663,10 @@ search is not already active, this runs the command active, @kbd{M-s _} switches to a symbol search, preserving the direction of the search and the current search string; you can disable symbol search by typing @kbd{M-s _} again. In incremental symbol -search, only the beginning of the search string is required to match -the beginning of a symbol. +search, while you are typing the search string, only the beginning +of the search string is required to match the beginning of a symbol, +and @samp{Pending} appears in the search prompt until you use a search +repeating key like @kbd{C-s}. To begin a nonincremental symbol search, type @kbd{M-s _ @key{RET}} for a forward search, or @kbd{M-s _ C-r @key{RET}} or a backward diff --git a/lisp/info.el b/lisp/info.el index 0cfcec32f8..5f4ae5f0b0 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2118,10 +2118,9 @@ If DIRECTION is `backward', search in the reverse direction." (cond (isearch-regexp-function ;; Lax version of word search - (let ((lax (not (or isearch-nonincremental - (eq (length string) - (length (isearch--state-string - (car isearch-cmds)))))))) + (let ((lax (and (not bound) (isearch--lax-regexp-function-p)))) + (when lax + (setq isearch-adjusted t)) (if (functionp isearch-regexp-function) (funcall isearch-regexp-function string lax) (word-search-regexp string lax)))) diff --git a/lisp/isearch.el b/lisp/isearch.el index 5c48c30daa..4b35f25664 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1621,7 +1621,7 @@ Used in `word-search-forward', `word-search-backward', ((string-match-p "\\`\\W+\\'" string) "\\W+") (t (concat (if (string-match-p "\\`\\W" string) "\\W+" - (unless lax "\\<")) + "\\<") (mapconcat 'regexp-quote (split-string string "\\W+" t) "\\W+") (if (string-match-p "\\W\\'" string) "\\W+" (unless lax "\\>")))))) @@ -1749,7 +1749,7 @@ the beginning or the end of the string need not match a symbol boundary." ((string-match-p (format "\\`%s\\'" not-word-symbol-re) string) not-word-symbol-re) (t (concat (if (string-match-p (format "\\`%s" not-word-symbol-re) string) not-word-symbol-re - (unless lax "\\_<")) + "\\_<") (mapconcat 'regexp-quote (split-string string not-word-symbol-re t) not-word-symbol-re) (if (string-match-p (format "%s\\'" not-word-symbol-re) string) not-word-symbol-re (unless lax "\\_>"))))))) @@ -2740,7 +2740,9 @@ Can be changed via `isearch-search-fun-function' for special needs." (funcall (if isearch-forward #'re-search-forward #'re-search-backward) (cond (isearch-regexp-function - (let ((lax (isearch--lax-regexp-function-p))) + (let ((lax (and (not bound) (isearch--lax-regexp-function-p)))) + (when lax + (setq isearch-adjusted t)) (if (functionp isearch-regexp-function) (funcall isearch-regexp-function string lax) (word-search-regexp string lax)))) commit 35b9b7e751fdd8092048cb688e2f043f70912670 Author: Tino Calancha Date: Thu Feb 9 21:36:32 2017 +0900 Ibuffer: Update mode documentation * lisp/ibuffer.el (ibuffer-mode): List newest commands in mode documentation. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 71bf1d6dcc..eb821b257b 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -2564,18 +2564,26 @@ Marking commands: Filtering commands: + `\\[ibuffer-filter-chosen-by-completion]' - Select and apply filter chosen by completion. `\\[ibuffer-filter-by-mode]' - Add a filter by any major mode. `\\[ibuffer-filter-by-used-mode]' - Add a filter by a major mode now in use. `\\[ibuffer-filter-by-derived-mode]' - Add a filter by derived mode. `\\[ibuffer-filter-by-name]' - Add a filter by buffer name. `\\[ibuffer-filter-by-content]' - Add a filter by buffer content. + `\\[ibuffer-filter-by-basename]' - Add a filter by basename. + `\\[ibuffer-filter-by-directory]' - Add a filter by directory name. `\\[ibuffer-filter-by-filename]' - Add a filter by filename. + `\\[ibuffer-filter-by-file-extension]' - Add a filter by file extension. + `\\[ibuffer-filter-by-modified]' - Add a filter by modified buffers. + `\\[ibuffer-filter-by-predicate]' - Add a filter by an arbitrary Lisp predicate. `\\[ibuffer-filter-by-size-gt]' - Add a filter by buffer size. `\\[ibuffer-filter-by-size-lt]' - Add a filter by buffer size. - `\\[ibuffer-filter-by-predicate]' - Add a filter by an arbitrary Lisp predicate. + `\\[ibuffer-filter-by-starred-name]' - Add a filter by special buffers. + `\\[ibuffer-filter-by-visiting-file]' - Add a filter by buffers visiting files. `\\[ibuffer-save-filters]' - Save the current filters with a name. `\\[ibuffer-switch-to-saved-filters]' - Switch to previously saved filters. `\\[ibuffer-add-saved-filters]' - Add saved filters to current filters. + `\\[ibuffer-and-filter]' - Replace the top two filters with their logical AND. `\\[ibuffer-or-filter]' - Replace the top two filters with their logical OR. `\\[ibuffer-pop-filter]' - Remove the top filter. `\\[ibuffer-negate-filter]' - Invert the logical sense of the top filter. commit 3817a44a18fb911365b5899db8c84c7a87eb0f5d Author: Steven Allen Date: Wed Feb 8 22:08:09 2017 -0800 Fix environment variable for xdg-data-dirs * lisp/xdg.el (xdg-data-dirs): Use XDG_DATA_DIRS, not XDG_CONFIG_DIRS Copyright-paperwork-exempt: yes diff --git a/lisp/xdg.el b/lisp/xdg.el index 51218e339d..b11e104e2b 100644 --- a/lisp/xdg.el +++ b/lisp/xdg.el @@ -69,7 +69,7 @@ (defun xdg-data-dirs () "Return the data directory search path as a list." - (let ((env (getenv "XDG_CONFIG_DIRS"))) + (let ((env (getenv "XDG_DATA_DIRS"))) (if (or (null env) (string= env "")) '("/usr/local/share/" "/usr/share/") (parse-colon-path env)))) commit bbbfa31ed534cd4689ff5c3af0171778bebe3fc2 Author: Tassilo Horn Date: Thu Feb 9 12:02:43 2017 +0100 ; Theme updates ; * etc/themes/tsdh-light-theme.el (tsdh-light): Theme updates. diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el index f57bf92560..dac7ab888b 100644 --- a/etc/themes/tsdh-light-theme.el +++ b/etc/themes/tsdh-light-theme.el @@ -20,11 +20,12 @@ ;;; Code: (deftheme tsdh-light - "Minor tweaks to the Emacs white-background defaults. + "A light Emacs theme. Used and created by Tassilo Horn.") (custom-theme-set-faces 'tsdh-light + '(default ((t (:background "#fafafa" :foreground "#383a42")))) '(Info-quoted ((t (:underline "gray40" :weight bold)))) '(aw-leading-char-face ((t (:background "red" :foreground "white" :weight bold)))) '(default ((t (:background "white" :foreground "black")))) @@ -35,8 +36,18 @@ Used and created by Tassilo Horn.") '(diff-indicator-removed ((t (:inherit diff-indicator-changed)))) '(diff-removed ((t (:inherit diff-changed :background "sandy brown")))) '(dired-directory ((t (:inherit font-lock-function-name-face :weight bold)))) + '(font-lock-builtin-face ((t (:foreground "#e44649")))) + '(font-lock-comment-delimiter-face ((t (:inherit font-lock-comment-face :weight bold)))) + '(font-lock-comment-face ((t (:foreground "#a0a1a7")))) + '(font-lock-doc-face ((t (:inherit font-lock-string-face :slant italic)))) + '(font-lock-function-name-face ((t (:foreground "#0184bc")))) + '(font-lock-keyword-face ((t (:foreground "#a626a4")))) + '(font-lock-negation-char-face ((t (:weight bold)))) '(font-lock-regexp-grouping-backslash ((t (:inherit bold :foreground "black")))) '(font-lock-regexp-grouping-construct ((t (:inherit bold :foreground "black")))) + '(font-lock-string-face ((t (:foreground "#50a14f")))) + '(font-lock-type-face ((t (:foreground "#c18401")))) + '(font-lock-variable-name-face ((t (:foreground "#e45649")))) '(gnus-button ((t (:inherit button)))) '(gnus-header-name ((t (:box (:line-width 1 :style released-button) :weight bold)))) '(gnus-group-mail-1 ((t (:inherit gnus-group-mail-1-empty :weight bold)))) @@ -51,11 +62,11 @@ Used and created by Tassilo Horn.") '(gnus-group-news-2-empty ((t (:foreground "tomato3")))) '(gnus-group-news-3 ((t (:inherit gnus-group-news-3-empty :weight bold)))) '(gnus-group-news-3-empty ((t (:foreground "tomato2")))) '(header-line ((t (:inherit mode-line :inverse-video t)))) - '(hl-line ((t (:background "grey95")))) + '(hl-line ((t (:background "#f0f0f1")))) '(hl-paren-face ((t (:weight bold))) t) - '(minibuffer-prompt ((t (:background "yellow" :foreground "medium blue" :box (:line-width -1 :color "red" :style released-button) :weight bold)))) - '(mode-line ((t (:background "wheat" :foreground "black" :box (:line-width 1 :color "tan") :family "DejaVu Sans")))) - '(mode-line-inactive ((t (:inherit mode-line :foreground "dark gray")))) + '(minibuffer-prompt ((t (:foreground "#0184bc" :family "DeJaVu" :box (:line-width -1 :style released-button) :weight bold)))) + '(mode-line ((t (:background "#f0f0f1" :box (:line-width 1 :color "#383a42"))))) + '(mode-line-inactive ((t (:inherit mode-line :foreground "#a0a1a7")))) '(org-agenda-date ((t (:inherit org-agenda-structure)))) '(org-agenda-date-today ((t (:inherit org-agenda-date :underline t)))) '(org-agenda-date-weekend ((t (:inherit org-agenda-date :foreground "dark green"))))