1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

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
This commit is contained in:
John Wiegley 2016-03-03 23:52:26 -08:00
commit 2f3f7fcb57
7 changed files with 70 additions and 39 deletions

View file

@ -3034,7 +3034,11 @@ it is commonly assigned to the @code{mouse-face} property for cursor
highlighting (@pxref{Special Properties}).
@item match
For text matching a search command.
@itemx isearch
@itemx lazy-highlight
For text matching (respectively) permanent search matches, interactive
search matches, and lazy highlighting other matches than the current
interactive one.
@item error
@itemx warning

View file

@ -774,7 +774,7 @@ to avoid corrupting the original LIST1 and LIST2.
\nKeywords supported: :test :test-not :key
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)"
(cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1)
((equal cl-list1 cl-list2) cl-list1)
((and (not cl-keys) (equal cl-list1 cl-list2)) cl-list1)
(t
(or (>= (length cl-list1) (length cl-list2))
(setq cl-list1 (prog1 cl-list2 (setq cl-list2 cl-list1))))

View file

@ -27,8 +27,7 @@
;;; Code:
(eval-when-compile
(require 'cl))
(require 'cl-lib)
(defconst file-notify--library
(cond
@ -58,7 +57,7 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'.
If it is registered in `file-notify-descriptors', a stopped event is sent."
(let* ((desc (if (consp descriptor) (car descriptor) descriptor))
(registered (gethash desc file-notify-descriptors))
(file (if (consp descriptor) (cdr descriptor) (caadr registered)))
(file (if (consp descriptor) (cdr descriptor) (cl-caadr registered)))
(dir (car registered)))
(when (consp registered)
@ -104,7 +103,7 @@ It is a form ((DESCRIPTOR ACTION FILE [FILE1-OR-COOKIE]) CALLBACK).")
Could be different from the directory watched by the backend library."
(let* ((desc (if (consp (car event)) (caar event) (car event)))
(registered (gethash desc file-notify-descriptors))
(file (if (consp (car event)) (cdar event) (caadr registered)))
(file (if (consp (car event)) (cdar event) (cl-caadr registered)))
(dir (car registered)))
(if file (expand-file-name file dir) dir)))
@ -274,11 +273,13 @@ EVENT is the cadr of the event in `file-notify-handle-event'
`(,(file-notify--descriptor desc (car entry)) ,action ,file))))
;; Send `stopped' event.
(when (and (memq action '(deleted renamed))
;; Not, when a file is backed up.
(not (and (stringp file1) (backup-file-name-p file1)))
;; Watched file or directory is concerned.
(string-equal file (file-notify--event-watched-file event)))
(when (or stopped
(and (memq action '(deleted renamed))
;; Not, when a file is backed up.
(not (and (stringp file1) (backup-file-name-p file1)))
;; Watched file or directory is concerned.
(string-equal
file (file-notify--event-watched-file event))))
(file-notify-rm-watch (file-notify--descriptor desc (car entry))))))))
;; `kqueue', `gfilenotify' and `w32notify' return a unique descriptor

View file

@ -32,7 +32,7 @@
;; file after putting it on your load path:
;;
;; (autoload 'ruby-mode "ruby-mode" "Major mode for ruby files" t)
;; (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
;; (add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
;; (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
;;
;; 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'."
(modify-syntax-entry ?# "<" table)
(modify-syntax-entry ?\n ">" table)
(modify-syntax-entry ?\\ "\\" table)
(modify-syntax-entry ?$ "." table)
(modify-syntax-entry ?$ "'" table)
(modify-syntax-entry ?_ "_" table)
(modify-syntax-entry ?: "_" table)
(modify-syntax-entry ?: "'" table)
(modify-syntax-entry ?@ "'" table)
(modify-syntax-entry ?< "." table)
(modify-syntax-entry ?> "." table)
(modify-syntax-entry ?& "." table)
@ -1858,6 +1859,10 @@ It will be properly highlighted even when the call omits parens.")
(string-to-syntax "_"))))
;; Backtick method redefinition.
("^[ \t]*def +\\(`\\)" (1 "_"))
;; Ternary operator colon followed by opening paren or bracket
;; (semi-important for indentation).
("\\(:\\)\\(?:[\({]\\|\\[[^]]\\)"
(1 (string-to-syntax ".")))
;; Regular expressions. Start with matching unescaped slash.
("\\(?:\\=\\|[^\\]\\)\\(?:\\\\\\\\\\)*\\(/\\)"
(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.")
"The syntax table to use for fontifying Ruby mode buffers.
See `font-lock-syntax-table'.")
(defconst ruby-font-lock-keyword-beg-re "\\(?:^\\|[^.@$]\\|\\.\\.\\)")
(defconst ruby-font-lock-keyword-beg-re "\\(?:^\\|[^.@$:]\\|\\.\\.\\)")
(defconst ruby-font-lock-keywords
`(;; Functions.
@ -2196,7 +2201,7 @@ See `font-lock-syntax-table'.")
("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+"
0 font-lock-variable-name-face)
;; Constants.
("\\(?:\\_<\\|::\\)\\([A-Z]+\\(\\w\\|_\\)*\\)"
("\\_<\\([A-Z]+\\(\\w\\|_\\)*\\)"
1 (unless (eq ?\( (char-after)) font-lock-type-face))
;; Ruby 1.9-style symbol hash keys.
("\\(?:^\\s *\\|[[{(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+:\\)[^:]"

View file

@ -1268,6 +1268,7 @@ Compatibility function for \\[next-error] invocations."
(t :background "gray"))
"Face used to highlight matches permanently."
:group 'matching
:group 'basic-faces
:version "22.1")
(defcustom list-matching-lines-default-context-lines 0

View file

@ -2765,29 +2765,7 @@ See also `locate-user-emacs-file'.")
"Determine the boundaries of the default tag, based on text at point.
Return a cons cell with the beginning and end of the found tag.
If there is no plausible default, return nil."
(let (from to bound)
(when (or (progn
;; Look at text around `point'.
(save-excursion
(skip-syntax-backward "w_") (setq from (point)))
(save-excursion
(skip-syntax-forward "w_") (setq to (point)))
(> to from))
;; Look between `line-beginning-position' and `point'.
(save-excursion
(and (setq bound (line-beginning-position))
(skip-syntax-backward "^w_" bound)
(> (setq to (point)) bound)
(skip-syntax-backward "w_")
(setq from (point))))
;; Look between `point' and `line-end-position'.
(save-excursion
(and (setq bound (line-end-position))
(skip-syntax-forward "^w_" bound)
(< (setq from (point)) bound)
(skip-syntax-forward "w_")
(setq to (point)))))
(cons from to))))
(bounds-of-thing-at-point 'symbol))
(defun find-tag-default ()
"Determine default tag to search for, based on text at point.

View file

@ -0,0 +1,42 @@
;;; cl-seq-tests.el --- Tests for cl-seq.el functionality -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
;; Author: Nicolas Richard <youngfrog@members.fsf.org>
;; 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 <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(require 'ert)
(require 'cl-seq)
(ert-deftest cl-union-test-00 ()
(let ((str1 "foo")
(str2 (make-string 3 ?o)))
;; Emacs may make two string literals eql when reading.
(aset str2 0 ?f)
(should (not (eql str1 str2)))
(should (equal str1 str2))
(should (equal (cl-union (list str1) (list str2))
(list str2)))
(should (equal (cl-union (list str1) (list str2) :test 'eql)
(list str1 str2)))))
(provide 'cl-seq-tests)
;;; cl-seq-tests.el ends here