aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2016-03-03 23:52:26 -0800
committerJohn Wiegley2016-03-03 23:52:26 -0800
commit2f3f7fcb576c333efd3c299b29fbbe05bd317d90 (patch)
tree477edea3845f30b4dd5b7ef308ce3a414d8c0f00
parent887f6126c5ce9084f93083765ac026ca6b28175c (diff)
parent6620944f8325101d6a0e01690aea7901a66f0461 (diff)
downloademacs-2f3f7fcb576c333efd3c299b29fbbe05bd317d90.tar.gz
emacs-2f3f7fcb576c333efd3c299b29fbbe05bd317d90.zip
Merge from origin/emacs-25
6620944 (cl-union): Do not ignore :test argument when lists are equal. 17dd3fb Add `isearch' to `basic-faces' c1ec743 Make $, : and @ "prefix characters" in ruby-mode e72a26e Make find-tag-default-bounds more strict 1bc0e0a Minor fixes in filenotify.el
-rw-r--r--doc/lispref/display.texi6
-rw-r--r--lisp/emacs-lisp/cl-seq.el2
-rw-r--r--lisp/filenotify.el19
-rw-r--r--lisp/progmodes/ruby-mode.el15
-rw-r--r--lisp/replace.el1
-rw-r--r--lisp/subr.el24
-rw-r--r--test/automated/cl-seq-tests.el42
7 files changed, 70 insertions, 39 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 457a53cbe8b..93c927cbe2a 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -3034,7 +3034,11 @@ it is commonly assigned to the @code{mouse-face} property for cursor
3034highlighting (@pxref{Special Properties}). 3034highlighting (@pxref{Special Properties}).
3035 3035
3036@item match 3036@item match
3037For text matching a search command. 3037@itemx isearch
3038@itemx lazy-highlight
3039For text matching (respectively) permanent search matches, interactive
3040search matches, and lazy highlighting other matches than the current
3041interactive one.
3038 3042
3039@item error 3043@item error
3040@itemx warning 3044@itemx warning
diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el
index 61ee5698435..21aec6cdfcd 100644
--- a/lisp/emacs-lisp/cl-seq.el
+++ b/lisp/emacs-lisp/cl-seq.el
@@ -774,7 +774,7 @@ to avoid corrupting the original LIST1 and LIST2.
774\nKeywords supported: :test :test-not :key 774\nKeywords supported: :test :test-not :key
775\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" 775\n(fn LIST1 LIST2 [KEYWORD VALUE]...)"
776 (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) 776 (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1)
777 ((equal cl-list1 cl-list2) cl-list1) 777 ((and (not cl-keys) (equal cl-list1 cl-list2)) cl-list1)
778 (t 778 (t
779 (or (>= (length cl-list1) (length cl-list2)) 779 (or (>= (length cl-list1) (length cl-list2))
780 (setq cl-list1 (prog1 cl-list2 (setq cl-list2 cl-list1)))) 780 (setq cl-list1 (prog1 cl-list2 (setq cl-list2 cl-list1))))
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 21046a85a7a..f8a53631135 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -27,8 +27,7 @@
27 27
28;;; Code: 28;;; Code:
29 29
30(eval-when-compile 30(require 'cl-lib)
31 (require 'cl))
32 31
33(defconst file-notify--library 32(defconst file-notify--library
34 (cond 33 (cond
@@ -58,7 +57,7 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'.
58If it is registered in `file-notify-descriptors', a stopped event is sent." 57If it is registered in `file-notify-descriptors', a stopped event is sent."
59 (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) 58 (let* ((desc (if (consp descriptor) (car descriptor) descriptor))
60 (registered (gethash desc file-notify-descriptors)) 59 (registered (gethash desc file-notify-descriptors))
61 (file (if (consp descriptor) (cdr descriptor) (caadr registered))) 60 (file (if (consp descriptor) (cdr descriptor) (cl-caadr registered)))
62 (dir (car registered))) 61 (dir (car registered)))
63 62
64 (when (consp registered) 63 (when (consp registered)
@@ -104,7 +103,7 @@ It is a form ((DESCRIPTOR ACTION FILE [FILE1-OR-COOKIE]) CALLBACK).")
104Could be different from the directory watched by the backend library." 103Could be different from the directory watched by the backend library."
105 (let* ((desc (if (consp (car event)) (caar event) (car event))) 104 (let* ((desc (if (consp (car event)) (caar event) (car event)))
106 (registered (gethash desc file-notify-descriptors)) 105 (registered (gethash desc file-notify-descriptors))
107 (file (if (consp (car event)) (cdar event) (caadr registered))) 106 (file (if (consp (car event)) (cdar event) (cl-caadr registered)))
108 (dir (car registered))) 107 (dir (car registered)))
109 (if file (expand-file-name file dir) dir))) 108 (if file (expand-file-name file dir) dir)))
110 109
@@ -274,11 +273,13 @@ EVENT is the cadr of the event in `file-notify-handle-event'
274 `(,(file-notify--descriptor desc (car entry)) ,action ,file)))) 273 `(,(file-notify--descriptor desc (car entry)) ,action ,file))))
275 274
276 ;; Send `stopped' event. 275 ;; Send `stopped' event.
277 (when (and (memq action '(deleted renamed)) 276 (when (or stopped
278 ;; Not, when a file is backed up. 277 (and (memq action '(deleted renamed))
279 (not (and (stringp file1) (backup-file-name-p file1))) 278 ;; Not, when a file is backed up.
280 ;; Watched file or directory is concerned. 279 (not (and (stringp file1) (backup-file-name-p file1)))
281 (string-equal file (file-notify--event-watched-file event))) 280 ;; Watched file or directory is concerned.
281 (string-equal
282 file (file-notify--event-watched-file event))))
282 (file-notify-rm-watch (file-notify--descriptor desc (car entry)))))))) 283 (file-notify-rm-watch (file-notify--descriptor desc (car entry))))))))
283 284
284;; `kqueue', `gfilenotify' and `w32notify' return a unique descriptor 285;; `kqueue', `gfilenotify' and `w32notify' return a unique descriptor
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index e3fe315f3bd..fb942b34ddc 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -32,7 +32,7 @@
32;; file after putting it on your load path: 32;; file after putting it on your load path:
33;; 33;;
34;; (autoload 'ruby-mode "ruby-mode" "Major mode for ruby files" t) 34;; (autoload 'ruby-mode "ruby-mode" "Major mode for ruby files" t)
35;; (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode)) 35;; (add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
36;; (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) 36;; (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
37;; 37;;
38;; Still needs more docstrings; search below for TODO. 38;; Still needs more docstrings; search below for TODO.
@@ -188,9 +188,10 @@ This should only be called after matching against `ruby-here-doc-beg-re'."
188 (modify-syntax-entry ?# "<" table) 188 (modify-syntax-entry ?# "<" table)
189 (modify-syntax-entry ?\n ">" table) 189 (modify-syntax-entry ?\n ">" table)
190 (modify-syntax-entry ?\\ "\\" table) 190 (modify-syntax-entry ?\\ "\\" table)
191 (modify-syntax-entry ?$ "." table) 191 (modify-syntax-entry ?$ "'" table)
192 (modify-syntax-entry ?_ "_" table) 192 (modify-syntax-entry ?_ "_" table)
193 (modify-syntax-entry ?: "_" table) 193 (modify-syntax-entry ?: "'" table)
194 (modify-syntax-entry ?@ "'" table)
194 (modify-syntax-entry ?< "." table) 195 (modify-syntax-entry ?< "." table)
195 (modify-syntax-entry ?> "." table) 196 (modify-syntax-entry ?> "." table)
196 (modify-syntax-entry ?& "." table) 197 (modify-syntax-entry ?& "." table)
@@ -1858,6 +1859,10 @@ It will be properly highlighted even when the call omits parens.")
1858 (string-to-syntax "_")))) 1859 (string-to-syntax "_"))))
1859 ;; Backtick method redefinition. 1860 ;; Backtick method redefinition.
1860 ("^[ \t]*def +\\(`\\)" (1 "_")) 1861 ("^[ \t]*def +\\(`\\)" (1 "_"))
1862 ;; Ternary operator colon followed by opening paren or bracket
1863 ;; (semi-important for indentation).
1864 ("\\(:\\)\\(?:[\({]\\|\\[[^]]\\)"
1865 (1 (string-to-syntax ".")))
1861 ;; Regular expressions. Start with matching unescaped slash. 1866 ;; Regular expressions. Start with matching unescaped slash.
1862 ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)" 1867 ("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)"
1863 (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1))))) 1868 (1 (let ((state (save-excursion (syntax-ppss (match-beginning 1)))))
@@ -2023,7 +2028,7 @@ It will be properly highlighted even when the call omits parens.")
2023 "The syntax table to use for fontifying Ruby mode buffers. 2028 "The syntax table to use for fontifying Ruby mode buffers.
2024See `font-lock-syntax-table'.") 2029See `font-lock-syntax-table'.")
2025 2030
2026(defconst ruby-font-lock-keyword-beg-re "\\(?:^\\|[^.@$]\\|\\.\\.\\)") 2031(defconst ruby-font-lock-keyword-beg-re "\\(?:^\\|[^.@$:]\\|\\.\\.\\)")
2027 2032
2028(defconst ruby-font-lock-keywords 2033(defconst ruby-font-lock-keywords
2029 `(;; Functions. 2034 `(;; Functions.
@@ -2196,7 +2201,7 @@ See `font-lock-syntax-table'.")
2196 ("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" 2201 ("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+"
2197 0 font-lock-variable-name-face) 2202 0 font-lock-variable-name-face)
2198 ;; Constants. 2203 ;; Constants.
2199 ("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)" 2204 ("\\_<\\([A-Z]+\\(\\w\\|_\\)*\\)"
2200 1 (unless (eq ?\( (char-after)) font-lock-type-face)) 2205 1 (unless (eq ?\( (char-after)) font-lock-type-face))
2201 ;; Ruby 1.9-style symbol hash keys. 2206 ;; Ruby 1.9-style symbol hash keys.
2202 ("\\(?:^\\s *\\|[[{(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+:\\)[^:]" 2207 ("\\(?:^\\s *\\|[[{(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+:\\)[^:]"
diff --git a/lisp/replace.el b/lisp/replace.el
index b7e26c96fc5..a2ce78a8bb2 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1268,6 +1268,7 @@ Compatibility function for \\[next-error] invocations."
1268 (t :background "gray")) 1268 (t :background "gray"))
1269 "Face used to highlight matches permanently." 1269 "Face used to highlight matches permanently."
1270 :group 'matching 1270 :group 'matching
1271 :group 'basic-faces
1271 :version "22.1") 1272 :version "22.1")
1272 1273
1273(defcustom list-matching-lines-default-context-lines 0 1274(defcustom list-matching-lines-default-context-lines 0
diff --git a/lisp/subr.el b/lisp/subr.el
index 447c3eb1a4f..6eea54f2a32 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2765,29 +2765,7 @@ See also `locate-user-emacs-file'.")
2765 "Determine the boundaries of the default tag, based on text at point. 2765 "Determine the boundaries of the default tag, based on text at point.
2766Return a cons cell with the beginning and end of the found tag. 2766Return a cons cell with the beginning and end of the found tag.
2767If there is no plausible default, return nil." 2767If there is no plausible default, return nil."
2768 (let (from to bound) 2768 (bounds-of-thing-at-point 'symbol))
2769 (when (or (progn
2770 ;; Look at text around `point'.
2771 (save-excursion
2772 (skip-syntax-backward "w_") (setq from (point)))
2773 (save-excursion
2774 (skip-syntax-forward "w_") (setq to (point)))
2775 (> to from))
2776 ;; Look between `line-beginning-position' and `point'.
2777 (save-excursion
2778 (and (setq bound (line-beginning-position))
2779 (skip-syntax-backward "^w_" bound)
2780 (> (setq to (point)) bound)
2781 (skip-syntax-backward "w_")
2782 (setq from (point))))
2783 ;; Look between `point' and `line-end-position'.
2784 (save-excursion
2785 (and (setq bound (line-end-position))
2786 (skip-syntax-forward "^w_" bound)
2787 (< (setq from (point)) bound)
2788 (skip-syntax-forward "w_")
2789 (setq to (point)))))
2790 (cons from to))))
2791 2769
2792(defun find-tag-default () 2770(defun find-tag-default ()
2793 "Determine default tag to search for, based on text at point. 2771 "Determine default tag to search for, based on text at point.
diff --git a/test/automated/cl-seq-tests.el b/test/automated/cl-seq-tests.el
new file mode 100644
index 00000000000..d2eb412eee3
--- /dev/null
+++ b/test/automated/cl-seq-tests.el
@@ -0,0 +1,42 @@
1;;; cl-seq-tests.el --- Tests for cl-seq.el functionality -*- lexical-binding: t; -*-
2
3;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
4
5;; Author: Nicolas Richard <youngfrog@members.fsf.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23
24;;; Code:
25
26(require 'ert)
27(require 'cl-seq)
28
29(ert-deftest cl-union-test-00 ()
30 (let ((str1 "foo")
31 (str2 (make-string 3 ?o)))
32 ;; Emacs may make two string literals eql when reading.
33 (aset str2 0 ?f)
34 (should (not (eql str1 str2)))
35 (should (equal str1 str2))
36 (should (equal (cl-union (list str1) (list str2))
37 (list str2)))
38 (should (equal (cl-union (list str1) (list str2) :test 'eql)
39 (list str1 str2)))))
40
41(provide 'cl-seq-tests)
42;;; cl-seq-tests.el ends here