summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2018-10-28 17:55:00 +0200
committerEli Zaretskii <eliz@gnu.org>2018-10-28 17:55:00 +0200
commitf3050fc14e05a6eb18a70e0e7ce5d5302d5203e6 (patch)
treea5100f182b5bdbf0db39bc0c6b25d54e7df28690 /lisp
parent2fdae77eb6489a25a94f1d88a740a9672617d451 (diff)
parent3dd16a89bf410d77e9ddc41cbfbbd4b343928d6d (diff)
downloademacs-f3050fc14e05a6eb18a70e0e7ce5d5302d5203e6.tar.gz
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/cus-edit.el2
-rw-r--r--lisp/emacs-lisp/lisp-mode.el4
-rw-r--r--lisp/epg.el2
-rw-r--r--lisp/gnus/gnus-sum.el15
-rw-r--r--lisp/gnus/mm-util.el2
-rw-r--r--lisp/help.el2
-rw-r--r--lisp/isearch.el198
-rw-r--r--lisp/net/tramp-sh.el3
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/simple.el21
10 files changed, 184 insertions, 67 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 723cd5010df..b69a63b80f5 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -917,7 +917,7 @@ the current value of the variable, otherwise `symbol-value' is used.
If optional COMMENT argument is non-nil, also prompt for a comment and return
it as the third element in the list."
(let* ((var (read-variable prompt-var))
- (minibuffer-help-form '(describe-variable var))
+ (minibuffer-help-form `(describe-variable ',var))
(val
(let ((prop (get var 'variable-interactive))
(type (get var 'custom-type))
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index afb7cbd1dd7..46199196024 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -839,6 +839,10 @@ by more than one line to cross a string literal."
(prog1
(let (indent)
(cond ((= (forward-line 1) 1) nil)
+ ;; Negative depth, probably some kind of syntax error.
+ ((null indent-stack)
+ ;; Reset state.
+ (setq ppss (parse-partial-sexp (point) (point))))
((car indent-stack))
((integerp (setq indent (calculate-lisp-indent ppss)))
(setf (car indent-stack) indent))
diff --git a/lisp/epg.el b/lisp/epg.el
index 9d9bc9051da..c8f24eb39f7 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -655,7 +655,7 @@ callback data (if any)."
:command (cons (epg-context-program context)
args)
:connection-type 'pipe
- :coding '(binary . binary)
+ :coding 'raw-text
:filter #'epg--process-filter
:stderr error-process
:noquery t)))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index f56b822ac57..f9fae3792b1 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -83,12 +83,12 @@ If an unread article in the group refers to an older, already
read (or just marked as read) article, the old article will not
normally be displayed in the Summary buffer. If this variable is
t, Gnus will attempt to grab the headers to the old articles, and
-thereby build complete threads. If it has the value `some', all
-old headers will be fetched but only enough headers to connect
+thereby build complete threads. If the value is the symbol `some',
+all old headers will be fetched but only enough headers to connect
otherwise loose threads will be displayed. This variable can
also be a number. In that case, no more than that number of old
-headers will be fetched. If it has the value `invisible', all
-old headers will be fetched, but none will be displayed.
+headers will be fetched. If the value is the symbol `invisible',
+all old headers will be fetched, but none will be displayed.
The server has to support NOV for any of this to work.
@@ -203,9 +203,10 @@ Useful functions to put in this list include:
(defcustom gnus-build-sparse-threads nil
"If non-nil, fill in the gaps in threads.
-If `some', only fill in the gaps that are needed to tie loose threads
-together. If `more', fill in all leaf nodes that Gnus can find. If
-non-nil and non-`some', fill in all gaps that Gnus manages to guess."
+If set to the symbol `some', only fill in the gaps that are
+needed to tie loose threads together. If the symbol `more', fill
+in all leaf nodes that Gnus can find. If t (or any other value),
+fill in all gaps that Gnus manages to guess."
:group 'gnus-thread
:type '(choice (const :tag "off" nil)
(const some)
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 25b156803a6..14a232f706a 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -827,7 +827,7 @@ decompressed data. The buffer's multibyteness must be turned off."
(insert-file-contents err-file)
(buffer-string)
(erase-buffer))
- t)
+ nil t)
" ")
"\n")
(setq err-msg
diff --git a/lisp/help.el b/lisp/help.el
index 28288e57f6e..ad782f74cac 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1326,7 +1326,7 @@ puts the buffer specified by BUFFER-OR-NAME in `help-mode' and
displays a message about how to delete the help window when it's no
longer needed. The help window will be selected if
`help-window-select' is non-nil.
-Most of this is done by `help-window-setup', which see."
+Most of this is done by `help-window-setup', which see."
(declare (indent 1) (debug t))
`(progn
;; Make `help-window-point-marker' point nowhere. The only place
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 1e785a44c51..580b3ac40a6 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -304,9 +304,9 @@ are `word-search-regexp' \(`\\[isearch-toggle-word]'), `isearch-symbol-regexp'
(defcustom isearch-lazy-highlight t
"Controls the lazy-highlighting during incremental search.
-When non-nil, all text in the buffer matching the current search
-string is highlighted lazily (see `lazy-highlight-initial-delay'
-and `lazy-highlight-interval').
+When non-nil, all text currently visible on the screen
+matching the current search string is highlighted lazily
+(see `lazy-highlight-initial-delay' and `lazy-highlight-interval').
When multiple windows display the current buffer, the
highlighting is displayed only on the selected window, unless
@@ -351,6 +351,27 @@ A value of nil means highlight all matches shown on the screen."
(integer :tag "Some"))
:group 'lazy-highlight)
+(defcustom lazy-highlight-buffer-max-at-a-time 20
+ "Maximum matches to highlight at a time (for `lazy-highlight-buffer').
+Larger values may reduce Isearch's responsiveness to user input;
+smaller values make matches highlight slowly.
+A value of nil means highlight all matches in the buffer."
+ :type '(choice (const :tag "All" nil)
+ (integer :tag "Some"))
+ :group 'lazy-highlight
+ :version "27.1")
+
+(defcustom lazy-highlight-buffer nil
+ "Controls the lazy-highlighting of the full buffer.
+When non-nil, all text in the buffer matching the current search
+string is highlighted lazily (see `lazy-highlight-initial-delay',
+`lazy-highlight-interval' and `lazy-highlight-buffer-max-at-a-time').
+This is useful when `lazy-highlight-cleanup' is customized to nil
+and doesn't remove full-buffer highlighting after a search."
+ :type 'boolean
+ :group 'lazy-highlight
+ :version "27.1")
+
(defface lazy-highlight
'((((class color) (min-colors 88) (background light))
(:background "paleturquoise"))
@@ -1984,11 +2005,14 @@ and reads its face argument using `hi-lock-read-face-name'."
(defun isearch-delete-char ()
- "Discard last input item and move point back.
-Last input means the last character or the last isearch command
-that added or deleted characters from the search string,
-moved point, toggled regexp mode or case-sensitivity, etc.
-If no previous match was done, just beep."
+ "Undo last input item during a search.
+
+An input item is the result of a command that pushes a new state
+of isearch (as recorded by the `isearch--state' structure) to
+`isearch-cmds'. Info node `(emacs)Basic Isearch' explains when
+Emacs records a new input item.
+
+If no input items have been entered yet, just beep."
(interactive)
(if (null (cdr isearch-cmds))
(ding)
@@ -3178,6 +3202,7 @@ since they have special meaning in a regexp."
(defvar isearch-lazy-highlight-window-group nil)
(defvar isearch-lazy-highlight-window-start nil)
(defvar isearch-lazy-highlight-window-end nil)
+(defvar isearch-lazy-highlight-buffer nil)
(defvar isearch-lazy-highlight-case-fold-search nil)
(defvar isearch-lazy-highlight-regexp nil)
(defvar isearch-lazy-highlight-lax-whitespace nil)
@@ -3226,10 +3251,12 @@ by other Emacs features."
isearch-lax-whitespace))
(not (eq isearch-lazy-highlight-regexp-lax-whitespace
isearch-regexp-lax-whitespace))
- (not (= (window-group-start)
- isearch-lazy-highlight-window-start))
- (not (= (window-group-end) ; Window may have been split/joined.
- isearch-lazy-highlight-window-end))
+ (not (or lazy-highlight-buffer
+ (= (window-group-start)
+ isearch-lazy-highlight-window-start)))
+ (not (or lazy-highlight-buffer
+ (= (window-group-end) ; Window may have been split/joined.
+ isearch-lazy-highlight-window-end)))
(not (eq isearch-forward
isearch-lazy-highlight-forward))
;; In case we are recovering from an error.
@@ -3247,6 +3274,7 @@ by other Emacs features."
isearch-lazy-highlight-window-group (selected-window-group)
isearch-lazy-highlight-window-start (window-group-start)
isearch-lazy-highlight-window-end (window-group-end)
+ isearch-lazy-highlight-buffer lazy-highlight-buffer
;; Start lazy-highlighting at the beginning of the found
;; match (`isearch-other-end'). If no match, use point.
;; One of the next two variables (depending on search direction)
@@ -3264,12 +3292,22 @@ by other Emacs features."
isearch-lazy-highlight-regexp-lax-whitespace isearch-regexp-lax-whitespace
isearch-lazy-highlight-regexp-function isearch-regexp-function
isearch-lazy-highlight-forward isearch-forward)
+ ;; Extend start/end to match whole string at point (bug#19353)
+ (if isearch-lazy-highlight-forward
+ (setq isearch-lazy-highlight-start
+ (min (+ isearch-lazy-highlight-start
+ (1- (length isearch-lazy-highlight-last-string)))
+ (point-max)))
+ (setq isearch-lazy-highlight-end
+ (max (- isearch-lazy-highlight-end
+ (1- (length isearch-lazy-highlight-last-string)))
+ (point-min))))
(unless (equal isearch-string "")
(setq isearch-lazy-highlight-timer
(run-with-idle-timer lazy-highlight-initial-delay nil
'isearch-lazy-highlight-start)))))
-(defun isearch-lazy-highlight-search ()
+(defun isearch-lazy-highlight-search (string bound)
"Search ahead for the next or previous match, for lazy highlighting.
Attempt to do the search exactly the way the pending Isearch would."
(condition-case nil
@@ -3283,24 +3321,10 @@ Attempt to do the search exactly the way the pending Isearch would."
(isearch-forward isearch-lazy-highlight-forward)
(search-invisible nil) ; don't match invisible text
(retry t)
- (success nil)
- (bound (if isearch-lazy-highlight-forward
- (min (or isearch-lazy-highlight-end-limit (point-max))
- (if isearch-lazy-highlight-wrapped
- (+ isearch-lazy-highlight-start
- ;; Extend bound to match whole string at point
- (1- (length isearch-lazy-highlight-last-string)))
- (window-group-end)))
- (max (or isearch-lazy-highlight-start-limit (point-min))
- (if isearch-lazy-highlight-wrapped
- (- isearch-lazy-highlight-end
- ;; Extend bound to match whole string at point
- (1- (length isearch-lazy-highlight-last-string)))
- (window-group-start))))))
+ (success nil))
;; Use a loop like in `isearch-search'.
(while retry
- (setq success (isearch-search-string
- isearch-lazy-highlight-last-string bound t))
+ (setq success (isearch-search-string string bound t))
;; Clear RETRY unless the search predicate says
;; to skip this search hit.
(if (or (not success)
@@ -3312,6 +3336,17 @@ Attempt to do the search exactly the way the pending Isearch would."
success)
(error nil)))
+(defun isearch-lazy-highlight-match (mb me)
+ (let ((ov (make-overlay mb me)))
+ (push ov isearch-lazy-highlight-overlays)
+ ;; 1000 is higher than ediff's 100+,
+ ;; but lower than isearch main overlay's 1001
+ (overlay-put ov 'priority 1000)
+ (overlay-put ov 'face 'lazy-highlight)
+ (unless (or (eq isearch-lazy-highlight 'all-windows)
+ isearch-lazy-highlight-buffer)
+ (overlay-put ov 'window (selected-window)))))
+
(defun isearch-lazy-highlight-start ()
"Start a new lazy-highlight updating loop."
(lazy-highlight-cleanup t) ;remove old overlays
@@ -3321,19 +3356,32 @@ Attempt to do the search exactly the way the pending Isearch would."
"Update highlighting of other matches for current search."
(let ((max lazy-highlight-max-at-a-time)
(looping t)
- nomore)
+ nomore window-start window-end)
(with-local-quit
(save-selected-window
(if (and (window-live-p isearch-lazy-highlight-window)
(not (memq (selected-window) isearch-lazy-highlight-window-group)))
(select-window isearch-lazy-highlight-window))
+ (setq window-start (window-group-start))
+ (setq window-end (window-group-end))
(save-excursion
(save-match-data
(goto-char (if isearch-lazy-highlight-forward
isearch-lazy-highlight-end
isearch-lazy-highlight-start))
(while looping
- (let ((found (isearch-lazy-highlight-search)))
+ (let* ((bound (if isearch-lazy-highlight-forward
+ (min (or isearch-lazy-highlight-end-limit (point-max))
+ (if isearch-lazy-highlight-wrapped
+ isearch-lazy-highlight-start
+ window-end))
+ (max (or isearch-lazy-highlight-start-limit (point-min))
+ (if isearch-lazy-highlight-wrapped
+ isearch-lazy-highlight-end
+ window-start))))
+ (found (isearch-lazy-highlight-search
+ isearch-lazy-highlight-last-string
+ bound)))
(when max
(setq max (1- max))
(if (<= max 0)
@@ -3345,24 +3393,17 @@ Attempt to do the search exactly the way the pending Isearch would."
(if isearch-lazy-highlight-forward
(if (= mb (if isearch-lazy-highlight-wrapped
isearch-lazy-highlight-start
- (window-group-end)))
+ window-end))
(setq found nil)
(forward-char 1))
(if (= mb (if isearch-lazy-highlight-wrapped
isearch-lazy-highlight-end
- (window-group-start)))
+ window-start))
(setq found nil)
(forward-char -1)))
;; non-zero-length match
- (let ((ov (make-overlay mb me)))
- (push ov isearch-lazy-highlight-overlays)
- ;; 1000 is higher than ediff's 100+,
- ;; but lower than isearch main overlay's 1001
- (overlay-put ov 'priority 1000)
- (overlay-put ov 'face 'lazy-highlight)
- (unless (eq isearch-lazy-highlight 'all-windows)
- (overlay-put ov 'window (selected-window)))))
+ (isearch-lazy-highlight-match mb me))
;; Remember the current position of point for
;; the next call of `isearch-lazy-highlight-update'
;; when `lazy-highlight-max-at-a-time' is too small.
@@ -3378,17 +3419,82 @@ Attempt to do the search exactly the way the pending Isearch would."
(setq isearch-lazy-highlight-wrapped t)
(if isearch-lazy-highlight-forward
(progn
- (setq isearch-lazy-highlight-end (window-group-start))
+ (setq isearch-lazy-highlight-end window-start)
(goto-char (max (or isearch-lazy-highlight-start-limit (point-min))
- (window-group-start))))
- (setq isearch-lazy-highlight-start (window-group-end))
+ window-start)))
+ (setq isearch-lazy-highlight-start window-end)
(goto-char (min (or isearch-lazy-highlight-end-limit (point-max))
- (window-group-end))))))))
- (unless nomore
+ window-end)))))))
+ (if nomore
+ (when isearch-lazy-highlight-buffer
+ (if isearch-lazy-highlight-forward
+ (setq isearch-lazy-highlight-end (point-min))
+ (setq isearch-lazy-highlight-start (point-max)))
+ (run-at-time lazy-highlight-interval nil
+ 'isearch-lazy-highlight-buffer-update))
(setq isearch-lazy-highlight-timer
(run-at-time lazy-highlight-interval nil
'isearch-lazy-highlight-update)))))))))
+(defun isearch-lazy-highlight-buffer-update ()
+ "Update highlighting of other matches in the full buffer."
+ (let ((max lazy-highlight-buffer-max-at-a-time)
+ (looping t)
+ nomore window-start window-end)
+ (with-local-quit
+ (save-selected-window
+ (if (and (window-live-p isearch-lazy-highlight-window)
+ (not (memq (selected-window) isearch-lazy-highlight-window-group)))
+ (select-window isearch-lazy-highlight-window))
+ (setq window-start (window-group-start))
+ (setq window-end (window-group-end))
+ (save-excursion
+ (save-match-data
+ (goto-char (if isearch-lazy-highlight-forward
+ isearch-lazy-highlight-end
+ isearch-lazy-highlight-start))
+ (while looping
+ (let* ((bound (if isearch-lazy-highlight-forward
+ (or isearch-lazy-highlight-end-limit (point-max))
+ (or isearch-lazy-highlight-start-limit (point-min))))
+ (found (isearch-lazy-highlight-search
+ isearch-lazy-highlight-last-string
+ bound)))
+ (when max
+ (setq max (1- max))
+ (if (<= max 0)
+ (setq looping nil)))
+ (if found
+ (let ((mb (match-beginning 0))
+ (me (match-end 0)))
+ (if (= mb me) ;zero-length match
+ (if isearch-lazy-highlight-forward
+ (if (= mb (point-max))
+ (setq found nil)
+ (forward-char 1))
+ (if (= mb (point-min))
+ (setq found nil)
+ (forward-char -1)))
+ ;; Already highlighted by isearch-lazy-highlight-update
+ (unless (and (>= mb window-start) (<= me window-end))
+ ;; non-zero-length match
+ (isearch-lazy-highlight-match mb me)))
+ ;; Remember the current position of point for
+ ;; the next call of `isearch-lazy-highlight-update'
+ ;; when `lazy-highlight-buffer-max-at-a-time' is too small.
+ (if isearch-lazy-highlight-forward
+ (setq isearch-lazy-highlight-end (point))
+ (setq isearch-lazy-highlight-start (point)))))
+
+ ;; not found or zero-length match at the search bound
+ (if (not found)
+ (setq looping nil
+ nomore t))))
+ (unless nomore
+ (setq isearch-lazy-highlight-timer
+ (run-at-time lazy-highlight-interval nil
+ 'isearch-lazy-highlight-buffer-update)))))))))
+
(defun isearch-resume (string regexp word forward message case-fold)
"Resume an incremental search.
STRING is the string or regexp searched for.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 956fe2ddb73..11ee0639988 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4492,7 +4492,8 @@ means discard it)."
(if (stringp output) (concat " >" output) ""))))
(defconst tramp-inline-compress-commands
- '(("gzip" "gzip -d")
+ '(;; Suppress warnings about obsolete environment variable GZIP.
+ ("env GZIP= gzip" "env GZIP= gzip -d")
("bzip2" "bzip2 -d")
("xz" "xz -d")
("compress" "compress -d"))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 18a72324c65..7d0884389eb 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -8786,7 +8786,7 @@ do extra unwind via `cperl-unwind-to-safe'."
(goto-char new-beg)))
(setq beg (point))
(goto-char end)
- (while (and end
+ (while (and end (< end (point-max))
(progn
(or (bolp) (condition-case nil
(forward-line 1)
diff --git a/lisp/simple.el b/lisp/simple.el
index 562a9124b5c..6a7d210e483 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1071,13 +1071,16 @@ instead of deleted."
(filter-buffer-substring (region-beginning) (region-end) method)))))
"Function to get the region's content.
Called with one argument METHOD which can be:
-- nil: return the content as a string.
+- nil: return the content as a string (list of strings for
+ non-contiguous regions).
- `delete-only': delete the region; the return value is undefined.
-- `bounds': return the boundaries of the region as a list of cons
- cells of the form (START . END).
+- `bounds': return the boundaries of the region as a list of one
+ or more cons cells of the form (START . END).
- anything else: delete the region and return its content
- as a string, after filtering it with `filter-buffer-substring', which
- is called with METHOD as its 3rd argument.")
+ as a string (or list of strings for non-contiguous regions),
+ after filtering it with `filter-buffer-substring', which
+ is called, for each contiguous sub-region, with METHOD as its
+ 3rd argument.")
(defvar region-insert-function
(lambda (lines)
@@ -5527,8 +5530,10 @@ also checks the value of `use-empty-active-region'."
(progn (cl-assert (mark)) t)))
(defun region-bounds ()
- "Return the boundaries of the region as a pair of positions.
-Value is a list of cons cells of the form (START . END)."
+ "Return the boundaries of the region.
+Value is a list of one or more cons cells of the form (START . END).
+It will have more than one cons cell when the region is non-contiguous,
+see `region-noncontiguous-p' and `extract-rectangle-bounds'."
(funcall region-extract-function 'bounds))
(defun region-noncontiguous-p ()
@@ -7935,7 +7940,7 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
(read-variable (format "Set variable (default %s): " default-var)
default-var)
(read-variable "Set variable: ")))
- (minibuffer-help-form '(describe-variable var))
+ (minibuffer-help-form `(describe-variable ',var))
(prop (get var 'variable-interactive))
(obsolete (car (get var 'byte-obsolete-variable)))
(prompt (format "Set %s %s to value: " var