diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-01-09 15:29:25 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-01-09 15:29:25 -0800 |
commit | ddb26f79b20329ada5f5bc6e1742807d029e06c0 (patch) | |
tree | 4eb2572b11bba0c4fa7fc388dc2f65648be89b5e /lisp | |
parent | 0b33768053184ceadda0ca6dc431969e664cd17e (diff) | |
parent | 7668717d6fecd610d71b54a33708038b2ede8cce (diff) | |
download | emacs-ddb26f79b20329ada5f5bc6e1742807d029e06c0.tar.gz emacs-ddb26f79b20329ada5f5bc6e1742807d029e06c0.tar.bz2 emacs-ddb26f79b20329ada5f5bc6e1742807d029e06c0.zip |
Merge from origin/emacs-26
7668717d6f Merge from Gnulib
9e4d523427 * lisp/epg.el (epg-start-sign): Replace obsolete functions.
26c58f31a8 Small fix for erc-logging-enabled
34b41e3bc6 Quieten semantic normal usage
e25f961e37 Avoid irrelevant hyperlink in doc string of 'epa-pinentry-...
ec2636513c * doc/misc/tramp.texi (Remote processes): Mention gdb rest...
918a052a42 Query background for gnome terminal version 3.22 (Bug#29716)
1dfc27576a Make pixel-wise scrolling less laggy
f92264fc2a Fix child frame placement issues (bug#29953)
a5f718c4c5 ; * doc/lispref/text.texi (Change Hooks): Fix last change.
e876f5f9fb Describe the precise interaction of complex primitives wit...
3a22097cf6 Fix valgrind report in call-interactively
d5f1c87bfe * src/editfns.c (Fsave_excursion): Doc fix. (Bug#30001)
b8d74c4578 Fix mark-defun when there's no spaces between successive d...
a377c652b5 Fix Dired display and operations on file names with raw bytes
d9d6e8a04c ; Comments related to src/termcap.c
f8a07fa6b1 Improve documentation of 'gdb-many-windows'
f82400798e Fix failures in smerge-mode on MS-Windows
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/cedet/semantic/lex.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 18 | ||||
-rw-r--r-- | lisp/epa.el | 7 | ||||
-rw-r--r-- | lisp/epg.el | 4 | ||||
-rw-r--r-- | lisp/erc/erc-log.el | 5 | ||||
-rw-r--r-- | lisp/pixel-scroll.el | 71 | ||||
-rw-r--r-- | lisp/term/xterm.el | 7 | ||||
-rw-r--r-- | lisp/vc/smerge-mode.el | 6 |
8 files changed, 78 insertions, 43 deletions
diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el index 2f216e6e00c..0403e5e7f20 100644 --- a/lisp/cedet/semantic/lex.el +++ b/lisp/cedet/semantic/lex.el @@ -471,6 +471,7 @@ PROPERTY set." ;;; Lexical Analyzer framework settings ;; +;; FIXME change to non-obsolete default. (defvar semantic-lex-analyzer 'semantic-flex "The lexical analyzer used for a given buffer. See `semantic-lex' for documentation. @@ -1856,7 +1857,7 @@ end of the return token will be larger than END. To truly restrict scanning, use `narrow-to-region'. The last argument, LENGTH specifies that `semantic-flex' should only return LENGTH tokens." - (message "`semantic-flex' is an obsolete function. Use `define-lex' to create lexers.") + (declare (obsolete define-lex "23.2")) (if (not semantic-flex-keywords-obarray) (setq semantic-flex-keywords-obarray [ nil ])) (let ((ts nil) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 5aa3ac8742a..5a89923f8fb 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -411,12 +411,13 @@ whitespace." ;; See https://lists.gnu.org/r/help-gnu-emacs/2016-08/msg00141.html (save-excursion (forward-line 0) - (< (line-end-position) - (let ((ppss (syntax-ppss))) - (when (nth 4 ppss) - (goto-char (nth 8 ppss))) - (forward-comment (point-max)) - (point))))) + (let ((ppss (syntax-ppss))) + (and (null (nth 3 ppss)) + (< (line-end-position) + (progn (when (nth 4 ppss) + (goto-char (nth 8 ppss))) + (forward-comment (point-max)) + (point))))))) (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." @@ -434,10 +435,7 @@ whitespace." (progn (skip-syntax-backward "-" (line-beginning-position)) (not (bolp))) ; Check for blank line. - (progn (parse-partial-sexp - (line-beginning-position) (line-end-position) - nil t (syntax-ppss (line-beginning-position))) - (eolp))))) ; Check for non-comment text. + (beginning-of-defun--in-emptyish-line-p)))) ; Check for non-comment text. (forward-line (if first-line-p 0 1)))) (defvar end-of-defun-function diff --git a/lisp/epa.el b/lisp/epa.el index 2b14a003484..8694de48172 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -56,12 +56,15 @@ If neither t nor nil, ask user for confirmation." :type 'integer :group 'epa) +;; In the doc string below, we say "symbol `error'" to avoid producing +;; a hyperlink for `error' the function. (defcustom epa-pinentry-mode nil "The pinentry mode. GnuPG 2.1 or later has an option to control the behavior of -Pinentry invocation. Possible modes are: `ask', `cancel', -`error', and `loopback'. See the GnuPG manual for the meanings. +Pinentry invocation. The value should be the symbol `error', +`ask', `cancel', or `loopback'. See the GnuPG manual for the +meanings. In epa commands, a particularly useful mode is `loopback', which redirects all Pinentry queries to the caller, so Emacs can query diff --git a/lisp/epg.el b/lisp/epg.el index 3c20c270490..dc0e2df5838 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1676,8 +1676,8 @@ If you are unsure, use synchronous version of this function (setf (epg-context-operation context) 'sign) (setf (epg-context-result context) nil) (unless (memq mode '(t detached nil normal)) ;i.e. cleartext - (epg-context-set-armor context nil) - (epg-context-set-textmode context nil)) + (setf (epg-context-armor context) nil) + (setf (epg-context-textmode context) nil)) (epg--start context (append (list (if (memq mode '(t detached)) "--detach-sign" diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index de2fa16c50b..3294350b6ee 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -321,12 +321,13 @@ If BUFFER is nil, the value of `current-buffer' is used. Logging is enabled if `erc-log-channels-directory' is non-nil, the directory is writable (it will be created as necessary) and `erc-enable-logging' returns a non-nil value." + (or buffer (setq buffer (current-buffer))) (and erc-log-channels-directory (or (functionp erc-log-channels-directory) (erc-directory-writable-p erc-log-channels-directory)) (if (functionp erc-enable-logging) - (funcall erc-enable-logging (or buffer (current-buffer))) - erc-enable-logging))) + (funcall erc-enable-logging buffer) + (buffer-local-value 'erc-enable-logging buffer)))) (defun erc-log-standardize-name (filename) "Make FILENAME safe to use as the name of an ERC log. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index bfc48bac2e2..d362419e0fc 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -82,6 +82,27 @@ case you need scrolling resolution of a pixel, set to 1. After a pixel scroll, typing \\[next-line] or \\[previous-line] scrolls the window to make it fully visible, and undoes the effect of the pixel-level scroll.") +(defvar pixel-dead-time 0.1 + "Minimal interval in seconds before next smooth scrolling. +If another scrolling request arrives within this period, scrolling +will be carried out without pixel resolution. If zero, scrolling +is always with pixel resolution.") + +(defvar pixel-last-scroll-time 0 + "Time when the last scrolling was made, in second since the epoch.") + +(defun pixel-scroll-in-rush-p () + "Return non-nil if next scroll should be non-smooth. +When scrolling request is delivered soon after the previous one, +user is in hurry. When the time since last scroll is larger than +`pixel-dead-time', we are ready for another smooth scroll, and this +function returns nil." + (let* ((current-time (float-time)) + (scroll-in-rush-p (< (- current-time pixel-last-scroll-time) + pixel-dead-time))) + (setq pixel-last-scroll-time current-time) + scroll-in-rush-p)) + ;;;###autoload (define-minor-mode pixel-scroll-mode "A minor mode to scroll text pixel-by-pixel. @@ -104,35 +125,39 @@ if ARG is omitted or nil." This is an alternative of `scroll-up'. Scope moves downward." (interactive) (or arg (setq arg 1)) - (dotimes (ii arg) ; move scope downward - (let ((amt (if pixel-resolution-fine-flag - (if (integerp pixel-resolution-fine-flag) - pixel-resolution-fine-flag - (frame-char-height)) - (pixel-line-height)))) - (if (pixel-eob-at-top-p) ; when end-of-the-buffer is close - (scroll-up 1) ; relay on robust method - (while (pixel-point-at-top-p amt) ; prevent too late (multi tries) - (vertical-motion 1)) ; move point downward - (pixel-scroll-pixel-up amt))))) ; move scope downward + (if (pixel-scroll-in-rush-p) + (scroll-up arg) + (dotimes (ii arg) ; move scope downward + (let ((amt (if pixel-resolution-fine-flag + (if (integerp pixel-resolution-fine-flag) + pixel-resolution-fine-flag + (frame-char-height)) + (pixel-line-height)))) + (if (pixel-eob-at-top-p) ; when end-of-the-buffer is close + (scroll-up 1) ; relay on robust method + (while (pixel-point-at-top-p amt) ; prevent too late (multi tries) + (vertical-motion 1)) ; move point downward + (pixel-scroll-pixel-up amt)))))) ; move scope downward (defun pixel-scroll-down (&optional arg) "Scroll text of selected window down ARG lines. This is and alternative of `scroll-down'. Scope moves upward." (interactive) (or arg (setq arg 1)) - (dotimes (ii arg) - (let ((amt (if pixel-resolution-fine-flag - (if (integerp pixel-resolution-fine-flag) - pixel-resolution-fine-flag - (frame-char-height)) - (pixel-line-height -1)))) - (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries) - (vertical-motion -1)) ; move point upward - (if (or (pixel-bob-at-top-p amt) ; when beginning-of-the-buffer is seen - (pixel-eob-at-top-p)) ; for file with a long line - (scroll-down 1) ; relay on robust method - (pixel-scroll-pixel-down amt))))) + (if (pixel-scroll-in-rush-p) + (scroll-down arg) + (dotimes (ii arg) + (let ((amt (if pixel-resolution-fine-flag + (if (integerp pixel-resolution-fine-flag) + pixel-resolution-fine-flag + (frame-char-height)) + (pixel-line-height -1)))) + (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries) + (vertical-motion -1)) ; move point upward + (if (or (pixel-bob-at-top-p amt) ; when beginning-of-the-buffer is seen + (pixel-eob-at-top-p)) ; for file with a long line + (scroll-down 1) ; relay on robust method + (pixel-scroll-pixel-down amt)))))) (defun pixel-bob-at-top-p (amt) "Return non-nil if window-start is at beginning of the current buffer. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 2a982917a85..fea9851d720 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -675,8 +675,13 @@ Return the pasted text as a string." (when (and (> version 2000) (equal (match-string 1 str) "1")) ;; Hack attack! bug#16988: gnome-terminal reports "1;NNNN;0" ;; with a large NNNN but is based on a rather old xterm code. - ;; Gnome terminal 3.6.1 reports 1;3406;0 ;; Gnome terminal 2.32.1 reports 1;2802;0 + ;; Gnome terminal 3.6.1 reports 1;3406;0 + ;; Gnome terminal 3.22.2 reports 1;4601;0 and *does* support + ;; background color querying (Bug#29716). + (when (> version 4000) + (xterm--query "\e]11;?\e\\" + '(("\e]11;" . xterm--report-background-handler)))) (setq version 200)) (when (equal (match-string 1 str) "83") ;; `screen' (which returns 83;40003;0) seems to also lack support for diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index 761536745f4..ea99d31e898 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -1019,7 +1019,7 @@ chars to try and eliminate some spurious differences." (setq s short))) (dotimes (_i (1- len)) (insert s))))))) (unless (bolp) (error "Smerge refine internal error")) - (let ((coding-system-for-write 'emacs-internal)) + (let ((coding-system-for-write 'utf-8-emacs-unix)) (write-region (point-min) (point-max) file nil 'nomessage)))) (defun smerge--refine-highlight-change (beg match-num1 match-num2 props) @@ -1084,7 +1084,9 @@ used to replace chars to try and eliminate some spurious differences." ;; Call diff on those files. (unwind-protect (with-temp-buffer - (let ((coding-system-for-read 'emacs-internal)) + ;; Allow decoding the EOL format, as on MS-Windows the Diff + ;; utility might produce CR-LF EOLs. + (let ((coding-system-for-read 'utf-8-emacs)) (call-process diff-command nil t nil (if (and smerge-refine-ignore-whitespace (not smerge-refine-weight-hack)) |