commit 64c846738617d1d037eac0cefb6586c04317b0a1 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sat Jan 20 19:12:05 2018 -0800 Fix tempfile creation when byte compiling This improves on the recent fix for master failing to build on FreeBSD. Suggested by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Put tempfile next to the target file, as was the original intent. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 80eb6489c3..a64c88c4f0 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1933,17 +1933,7 @@ The value is non-nil if there were no errors, nil if errors." ;; parallel bootstrap), it does not risk getting a ;; half-finished file. (Bug#4196) (tempfile - (if (file-name-absolute-p target-file) - (make-temp-file target-file) - ;; If target-file is relative and includes - ;; leading directories, make-temp-file will - ;; assume those leading directories exist - ;; under temporary-file-directory, which might - ;; not be true. So strip leading directories - ;; from relative file names before calling - ;; make-temp-file. - (make-temp-file - (file-name-nondirectory target-file)))) + (make-temp-file (expand-file-name target-file))) (default-modes (default-file-modes)) (temp-modes (logand default-modes #o600)) (desired-modes (logand default-modes #o666)) commit f0c1277af5efafbc5e386affabc1ec3368e8a790 Author: Michael Albinus Date: Sun Jan 21 00:14:33 2018 +0100 Extend tramp-test02-file-name-dissect* tests * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate): Test also `tramp-default-method-alist', `tramp-default-user-alist' and `tramp-default-host-alist'. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 24dfee5513..d6c7d47842 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -372,7 +372,10 @@ handled properly. BODY shall not contain a timeout." "Check remote file name components." (let ((tramp-default-method "default-method") (tramp-default-user "default-user") - (tramp-default-host "default-host")) + (tramp-default-host "default-host") + tramp-default-method-alist + tramp-default-user-alist + tramp-default-host-alist) ;; Expand `tramp-default-user' and `tramp-default-host'. (should (string-equal (file-remote-p "/method::") @@ -722,7 +725,55 @@ handled properly. BODY shall not contain a timeout." "|method3:user3@host3:/path/to/file") 'hop) (format "%s:%s@%s|%s:%s@%s|" - "method1" "user1" "host1" "method2" "user2" "host2"))))) + "method1" "user1" "host1" "method2" "user2" "host2"))) + + ;; Expand `tramp-default-method-alist'. + (add-to-list 'tramp-default-method-alist '("host1" "user1" "method1")) + (add-to-list 'tramp-default-method-alist '("host2" "user2" "method2")) + (add-to-list 'tramp-default-method-alist '("host3" "user3" "method3")) + (should + (string-equal + (file-remote-p + (concat + "/-:user1@host1" + "|-:user2@host2" + "|-:user3@host3:/path/to/file")) + (format "/%s:%s@%s|%s:%s@%s|%s:%s@%s:" + "-" "user1" "host1" + "-" "user2" "host2" + "method3" "user3" "host3"))) + + ;; Expand `tramp-default-user-alist'. + (add-to-list 'tramp-default-user-alist '("method1" "host1" "user1")) + (add-to-list 'tramp-default-user-alist '("method2" "host2" "user2")) + (add-to-list 'tramp-default-user-alist '("method3" "host3" "user3")) + (should + (string-equal + (file-remote-p + (concat + "/method1:host1" + "|method2:host2" + "|method3:host3:/path/to/file")) + (format "/%s:%s|%s:%s|%s:%s@%s:" + "method1" "host1" + "method2" "host2" + "method3" "user3" "host3"))) + + ;; Expand `tramp-default-host-alist'. + (add-to-list 'tramp-default-host-alist '("method1" "user1" "host1")) + (add-to-list 'tramp-default-host-alist '("method2" "user2" "host2")) + (add-to-list 'tramp-default-host-alist '("method3" "user3" "host3")) + (should + (string-equal + (file-remote-p + (concat + "/method1:user1@" + "|method2:user2@" + "|method3:user3@:/path/to/file")) + (format "/%s:%s@|%s:%s@|%s:%s@%s:" + "method1" "user1" + "method2" "user2" + "method3" "user3" "host3"))))) (ert-deftest tramp-test02-file-name-dissect-simplified () "Check simplified file name components." @@ -730,6 +781,8 @@ handled properly. BODY shall not contain a timeout." (let ((tramp-default-method "default-method") (tramp-default-user "default-user") (tramp-default-host "default-host") + tramp-default-user-alist + tramp-default-host-alist (syntax tramp-syntax)) (unwind-protect (progn @@ -977,7 +1030,39 @@ handled properly. BODY shall not contain a timeout." "|user3@host3:/path/to/file") 'hop) (format "%s@%s|%s@%s|" - "user1" "host1" "user2" "host2")))) + "user1" "host1" "user2" "host2"))) + + ;; Expand `tramp-default-user-alist'. + (add-to-list 'tramp-default-user-alist '(nil "host1" "user1")) + (add-to-list 'tramp-default-user-alist '(nil "host2" "user2")) + (add-to-list 'tramp-default-user-alist '(nil "host3" "user3")) + (should + (string-equal + (file-remote-p + (concat + "/host1" + "|host2" + "|host3:/path/to/file")) + (format "/%s|%s|%s@%s:" + "host1" + "host2" + "user3" "host3"))) + + ;; Expand `tramp-default-host-alist'. + (add-to-list 'tramp-default-host-alist '(nil "user1" "host1")) + (add-to-list 'tramp-default-host-alist '(nil "user2" "host2")) + (add-to-list 'tramp-default-host-alist '(nil "user3" "host3")) + (should + (string-equal + (file-remote-p + (concat + "/user1@" + "|user2@" + "|user3@:/path/to/file")) + (format "/%s@|%s@|%s@%s:" + "user1" + "user2" + "user3" "host3")))) ;; Exit. (tramp-change-syntax syntax)))) @@ -988,6 +1073,9 @@ handled properly. BODY shall not contain a timeout." (let ((tramp-default-method "default-method") (tramp-default-user "default-user") (tramp-default-host "default-host") + tramp-default-method-alist + tramp-default-user-alist + tramp-default-host-alist (syntax tramp-syntax)) (unwind-protect (progn @@ -1545,7 +1633,55 @@ handled properly. BODY shall not contain a timeout." "|method3/user3@host3]/path/to/file") 'hop) (format "%s/%s@%s|%s/%s@%s|" - "method1" "user1" "host1" "method2" "user2" "host2")))) + "method1" "user1" "host1" "method2" "user2" "host2"))) + + ;; Expand `tramp-default-method-alist'. + (add-to-list 'tramp-default-method-alist '("host1" "user1" "method1")) + (add-to-list 'tramp-default-method-alist '("host2" "user2" "method2")) + (add-to-list 'tramp-default-method-alist '("host3" "user3" "method3")) + (should + (string-equal + (file-remote-p + (concat + "/[/user1@host1" + "|/user2@host2" + "|/user3@host3]/path/to/file")) + (format "/[/%s@%s|/%s@%s|%s/%s@%s]" + "user1" "host1" + "user2" "host2" + "method3" "user3" "host3"))) + + ;; Expand `tramp-default-user-alist'. + (add-to-list 'tramp-default-user-alist '("method1" "host1" "user1")) + (add-to-list 'tramp-default-user-alist '("method2" "host2" "user2")) + (add-to-list 'tramp-default-user-alist '("method3" "host3" "user3")) + (should + (string-equal + (file-remote-p + (concat + "/[method1/host1" + "|method2/host2" + "|method3/host3]/path/to/file")) + (format "/[%s/%s|%s/%s|%s/%s@%s]" + "method1" "host1" + "method2" "host2" + "method3" "user3" "host3"))) + + ;; Expand `tramp-default-host-alist'. + (add-to-list 'tramp-default-host-alist '("method1" "user1" "host1")) + (add-to-list 'tramp-default-host-alist '("method2" "user2" "host2")) + (add-to-list 'tramp-default-host-alist '("method3" "user3" "host3")) + (should + (string-equal + (file-remote-p + (concat + "/[method1/user1@" + "|method2/user2@" + "|method3/user3@]/path/to/file")) + (format "/[%s/%s@|%s/%s@|%s/%s@%s]" + "method1" "user1" + "method2" "user2" + "method3" "user3" "host3")))) ;; Exit. (tramp-change-syntax syntax)))) commit 3a34d1463081a9977c4d1dc4414a8591f622195f Author: Jarosław Rzeszótko Date: Sat Jan 20 12:51:06 2018 -0500 * lisp/ielm.el: Bring up the debugger when requested Copyright-paperwork-exempt: yes (ielm-eval-input): Don't catch errors during evaluation of the expression if debug-on-error is set. diff --git a/lisp/ielm.el b/lisp/ielm.el index 259e1b9f79..59e333f19c 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -384,7 +384,7 @@ nonempty, then flushes the buffer." (set-match-data ielm-match-data) (save-excursion (with-temp-buffer - (condition-case err + (condition-case-unless-debug err (unwind-protect ;; The next let form creates default ;; bindings for *, ** and ***. But @@ -528,9 +528,6 @@ causes output to be directed to the ielm buffer. set to a different value during evaluation. You can use (princ VALUE) or (pp VALUE) to write to the ielm buffer. -Expressions evaluated by IELM are not subject to `debug-on-quit' or -`debug-on-error'. - The behavior of IELM may be customized with the following variables: * To stop beeping on error, set `ielm-noisy' to nil. * If you don't like the prompt, you can change it by setting `ielm-prompt'. commit 60d5a13d28705e116e0a69c48f15d20aab9d3081 Merge: 194c530034 cfc94fd245 Author: Glenn Morris Date: Sat Jan 20 08:23:30 2018 -0800 Merge from origin/emacs-26 cfc94fd (origin/emacs-26) Don't mention 'vc-stay-local' in the user m... 8ce430b Fix a typo in calendar.texi bb748b3 Minor improvement in wording of the Emacs manual b603aff Revert "Fix tempfile creation when byte compiling" 4fd446e Fix tempfile creation when byte compiling 7f48a11 Improve the Emacs manual as suggested in emacs-manual-bugs 728ded0 * lisp/emacs-lisp/bytecomp.el: Tweak last change c6c05e2 Unbreak building Emacs on FreeBSD a41ad3d Don't unnecessarily use non-ASCII characters in C sources c28d4b6 Portability fixes in emacs-module-tests 1d50c18 Add tests for term.el commit 194c530034e9413071bcdc92d573b2916363ebf1 Merge: ec6ef1e38b 5472568a3c Author: Glenn Morris Date: Sat Jan 20 08:23:30 2018 -0800 ; Merge from origin/emacs-26 The following commit was skipped: 5472568 Handle split AnSiT messages for term.el (Bug#17231) commit ec6ef1e38b2618b3c5bdd28e2d4dac0afa2b3033 Merge: 530bb2dc68 297dc41e2c Author: Glenn Morris Date: Sat Jan 20 08:23:30 2018 -0800 Merge from origin/emacs-26 297dc41 * configure.ac (emacs_config_features): Add threads. Conflicts: configure.ac commit 530bb2dc68bbd8be8a90759992095cc2edc4efcf Author: Michael Albinus Date: Sat Jan 20 16:26:02 2018 +0100 Use file notification in autorevert also for recreated files * lisp/autorevert.el (auto-revert-mode) (global-auto-revert-mode, auto-revert-notify-add-watch) (auto-revert-notify-handler, auto-revert-handler): Do not use buffer local `auto-revert-use-notify' anymore. * test/lisp/autorevert-tests.el (auto-revert-test02-auto-revert-deleted-file): Adapt test in order to check, that file notification is reenabled when possible. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 7b8302695f..da8942664b 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -373,7 +373,7 @@ without being changed in the part that is already in the buffer." 'kill-buffer-hook #'auto-revert-remove-current-buffer nil t)) - (when auto-revert-use-notify (auto-revert-notify-rm-watch)) + (when auto-revert-notify-watch-descriptor (auto-revert-notify-rm-watch)) (auto-revert-remove-current-buffer)) (auto-revert-set-timer) (when auto-revert-mode @@ -486,7 +486,7 @@ specifies in the mode line." (auto-revert-buffers) (dolist (buf (buffer-list)) (with-current-buffer buf - (when auto-revert-use-notify + (when auto-revert-notify-watch-descriptor (auto-revert-notify-rm-watch)))))) (defun auto-revert-set-timer () @@ -524,38 +524,31 @@ will use an up-to-date value of `auto-revert-interval'" (defun auto-revert-notify-add-watch () "Enable file notification for current buffer's associated file." ;; We can assume that `buffer-file-name' and - ;; `auto-revert-use-notify' are non-nil. - (if (or (string-match auto-revert-notify-exclude-dir-regexp - (expand-file-name default-directory)) - (file-symlink-p (or buffer-file-name default-directory))) - - ;; Fallback to file checks. - (setq-local auto-revert-use-notify nil) - - (when (not auto-revert-notify-watch-descriptor) - (setq auto-revert-notify-watch-descriptor - (ignore-errors - (if buffer-file-name - (file-notify-add-watch - (expand-file-name buffer-file-name default-directory) - '(change attribute-change) - 'auto-revert-notify-handler) + ;; `auto-revert-notify-watch-descriptor' are non-nil. + (unless (or auto-revert-notify-watch-descriptor + (string-match auto-revert-notify-exclude-dir-regexp + (expand-file-name default-directory)) + (file-symlink-p (or buffer-file-name default-directory))) + (setq auto-revert-notify-watch-descriptor + (ignore-errors + (if buffer-file-name (file-notify-add-watch - (expand-file-name default-directory) - '(change) - 'auto-revert-notify-handler)))) - (if auto-revert-notify-watch-descriptor - (progn - (puthash - auto-revert-notify-watch-descriptor - (cons (current-buffer) - (gethash auto-revert-notify-watch-descriptor - auto-revert-notify-watch-descriptor-hash-list)) - auto-revert-notify-watch-descriptor-hash-list) - (add-hook 'kill-buffer-hook - #'auto-revert-notify-rm-watch nil t)) - ;; Fallback to file checks. - (setq-local auto-revert-use-notify nil))))) + (expand-file-name buffer-file-name default-directory) + '(change attribute-change) + 'auto-revert-notify-handler) + (file-notify-add-watch + (expand-file-name default-directory) + '(change) + 'auto-revert-notify-handler)))) + (when auto-revert-notify-watch-descriptor + (setq auto-revert-notify-modified-p t) + (puthash + auto-revert-notify-watch-descriptor + (cons (current-buffer) + (gethash auto-revert-notify-watch-descriptor + auto-revert-notify-watch-descriptor-hash-list)) + auto-revert-notify-watch-descriptor-hash-list) + (add-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch nil t)))) ;; If we have file notifications, we want to update the auto-revert buffers ;; immediately when a notification occurs. Since file updates can happen very @@ -611,8 +604,7 @@ no more reverts are possible until the next call of (file-name-nondirectory buffer-file-name))) ;; A buffer w/o a file, like dired. (null buffer-file-name))) - (auto-revert-notify-rm-watch) - (setq-local auto-revert-use-notify nil)))) + (auto-revert-notify-rm-watch)))) ;; Loop over all buffers, in order to find the intended one. (cl-dolist (buffer buffers) @@ -651,11 +643,9 @@ no more reverts are possible until the next call of "Check if auto-revert is active (in current buffer or globally)." (or auto-revert-mode auto-revert-tail-mode - (and - global-auto-revert-mode - (not global-auto-revert-ignore-buffer) - (not (memq major-mode - global-auto-revert-ignore-modes))))) + (and global-auto-revert-mode + (not global-auto-revert-ignore-buffer) + (not (memq major-mode global-auto-revert-ignore-modes))))) (defun auto-revert-handler () "Revert current buffer, if appropriate. @@ -669,7 +659,7 @@ This is an internal function used by Auto-Revert Mode." (if buffer-file-name (and (or auto-revert-remote-files (not (file-remote-p buffer-file-name))) - (or (not auto-revert-use-notify) + (or (not auto-revert-notify-watch-descriptor) auto-revert-notify-modified-p) (if auto-revert-tail-mode (and (file-readable-p buffer-file-name) diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 8f375b63a6..05d24b51ee 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -161,7 +161,7 @@ This expects `auto-revert--messages' to be bound by :tags '(:expensive-test) (let ((tmpfile (make-temp-file "auto-revert-test")) - buf) + buf desc) (unwind-protect (progn (write-region "any text" nil tmpfile nil 'no-message) @@ -174,6 +174,7 @@ This expects `auto-revert--messages' to be bound by (sleep-for 1) (auto-revert-mode 1) (should auto-revert-mode) + (setq desc auto-revert-notify-watch-descriptor) ;; Remove file while reverting. We simulate this by ;; modifying `before-revert-hook'. @@ -192,7 +193,7 @@ This expects `auto-revert--messages' to be bound by (should (string-match "any text" (buffer-string))) ;; With w32notify, the 'stopped' events are not sent. (or (eq file-notify--library 'w32notify) - (should-not auto-revert-use-notify)) + (should-not auto-revert-notify-watch-descriptor)) ;; Once the file has been recreated, the buffer shall be ;; reverted. @@ -203,6 +204,11 @@ This expects `auto-revert--messages' to be bound by (auto-revert--wait-for-revert buf)) ;; Check, that the buffer has been reverted. (should (string-match "another text" (buffer-string))) + ;; When file notification is used, it must be reenabled + ;; after recreation of the file. We cannot expect that + ;; the descriptor is the same, so we just check the + ;; existence. + (should (eq (null desc) (null auto-revert-notify-watch-descriptor))) ;; An empty file shall still be reverted. (ert-with-message-capture auto-revert--messages commit cfc94fd245076ee0fba49083a55b08bbadfec4eb Author: Eli Zaretskii Date: Sat Jan 20 14:44:01 2018 +0200 Don't mention 'vc-stay-local' in the user manual * doc/emacs/vc1-xtra.texi (CVS Options): * doc/emacs/maintaining.texi (VC Directory Buffer): Remove references to 'vc-stay-local', which no longer exists. (Bug#30138) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 0846440d1d..cb53529cea 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1206,11 +1206,9 @@ file. RCS and SCCS show the name of the user locking a file as its status. @ifnottex -@vindex vc-stay-local - On CVS and Subversion, the @code{vc-dir} command normally contacts -the repository, which may be on a remote machine, to check for -updates. If you change the variable @code{vc-stay-local} or -@code{vc-cvs-stay-local} (for CVS) to @code{nil} (@pxref{CVS + On CVS, the @code{vc-dir} command normally contacts the repository, +which may be on a remote machine, to check for updates. If you change +the variable @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}), then Emacs avoids contacting a remote repository when generating the VC Directory buffer (it will still contact it when necessary, e.g., when doing a commit). This may be desirable if you diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index 6c4e0770de..7a4b8e4701 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -364,18 +364,13 @@ the name of the operation to invoke. @cindex remote repositories (CVS) When using a CVS repository on a remote machine, VC can try keeping network interactions to a minimum. This is controlled by the variable -@code{vc-cvs-stay-local}. There is another variable, -@code{vc-stay-local}, which enables the feature also for other back -ends that support it, including CVS@. In the following, we will talk -only about @code{vc-cvs-stay-local}, but everything applies to -@code{vc-stay-local} as well. - - If @code{vc-cvs-stay-local} is @code{only-file} (the default), VC -determines the version control status of each file using only the -entry in the local CVS subdirectory and the information returned by -previous CVS commands. As a consequence, if you have modified a file -and somebody else has checked in other changes, you will not be -notified of the conflict until you try to commit. +@code{vc-cvs-stay-local}. If @code{vc-cvs-stay-local} is +@code{only-file} (the default), VC determines the version control +status of each file using only the entry in the local CVS subdirectory +and the information returned by previous CVS commands. As a +consequence, if you have modified a file and somebody else has checked +in other changes, you will not be notified of the conflict until you +try to commit. If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the remote repository @emph{before} it decides what to do in commit 5b64f1813476b681c10649e9aa0642af2c4ed845 Author: Michael Albinus Date: Sat Jan 20 13:30:20 2018 +0100 * doc/misc/tramp.texi: Highlight @cindex entries properly. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 5052b43653..f5dfef261f 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -467,10 +467,10 @@ this case it is written as @code{host#port}. @anchor{Quick Start Guide: @option{ssh} and @option{plink} methods} @section Using @option{ssh} and @option{plink} -@cindex method ssh -@cindex ssh method -@cindex method plink -@cindex plink method +@cindex method @option{ssh} +@cindex @option{ssh} method +@cindex method @option{plink} +@cindex @option{plink} method If your local host runs an SSH client, and the remote host runs an SSH server, the most simple remote file name is @@ -486,12 +486,12 @@ an @command{ssh} server: @anchor{Quick Start Guide: @option{su}, @option{sudo} and @option{sg} methods} @section Using @option{su}, @option{sudo} and @option{sg} -@cindex method su -@cindex su method -@cindex method sudo -@cindex sudo method -@cindex method sg -@cindex sg method +@cindex method @option{su} +@cindex @option{su} method +@cindex method @option{sudo} +@cindex @option{sudo} method +@cindex method @option{sg} +@cindex @option{sg} method Sometimes, it is necessary to work on your local host under different permissions. For this, you could use the @option{su} or @option{sudo} @@ -506,10 +506,10 @@ must be used here as user name. The default host name is the same. @anchor{Quick Start Guide: @option{smb} method} @section Using @command{smbclient} -@cindex method smb -@cindex smb method -@cindex ms windows (with smb method) -@cindex smbclient +@cindex method @option{smb} +@cindex @option{smb} method +@cindex ms windows (with @option{smb} method) +@cindex @command{smbclient} In order to access a remote MS Windows host or Samba server, the @command{smbclient} client is used. The remote file name syntax is @@ -522,14 +522,14 @@ of the local file name is the share exported by the remote host, @section Using GVFS-based methods @cindex methods, gvfs @cindex gvfs based methods -@cindex method sftp -@cindex sftp method -@cindex method afp -@cindex afp method -@cindex method dav -@cindex method davs -@cindex dav method -@cindex davs method +@cindex method @option{sftp} +@cindex @option{sftp} method +@cindex method @option{afp} +@cindex @option{afp} method +@cindex method @option{dav} +@cindex method @option{davs} +@cindex @option{dav} method +@cindex @option{davs} method On systems, which have installed the virtual file system for the @acronym{GNOME} Desktop (GVFS), its offered methods could be used by @@ -543,11 +543,11 @@ file system), @file{@trampfn{dav,user@@host,/path/to/file}} and @anchor{Quick Start Guide: GNOME Online Accounts based methods} @section Using @acronym{GNOME} Online Accounts based methods @cindex @acronym{GNOME} Online Accounts -@cindex method gdrive -@cindex gdrive method +@cindex method @option{gdrive} +@cindex @option{gdrive} method @cindex google drive -@cindex method owncloud -@cindex owncloud method +@cindex method @option{owncloud} +@cindex @option{owncloud} method @cindex nextcloud GVFS-based methods include also @acronym{GNOME} Online Accounts, which @@ -562,8 +562,8 @@ account), or @file{@trampfn{owncloud,user@@host#8081,/path/to/file}} @anchor{Quick Start Guide: Android} @section Using Android -@cindex method adb -@cindex adb method +@cindex method @option{adb} +@cindex @option{adb} method @cindex android An Android device, which is connected via USB to your local host, can @@ -667,8 +667,8 @@ Inline methods can work in situations where an external transfer program is unavailable. Inline methods also work when transferring files between different @emph{user identities} on the same host. -@cindex uuencode -@cindex mimencode +@cindex @command{uuencode} +@cindex @command{mimencode} @cindex base-64 encoding @value{tramp} checks the remote host for the availability and @@ -688,15 +688,15 @@ such optimization. @table @asis @item @option{rsh} -@cindex method rsh -@cindex rsh method +@cindex method @option{rsh} +@cindex @option{rsh} method @command{rsh} is an option for connecting to hosts within local networks since @command{rsh} is not as secure as other methods. @item @option{ssh} -@cindex method ssh -@cindex ssh method +@cindex method @option{ssh} +@cindex @option{ssh} method @command{ssh} is a more secure option than others to connect to a remote host. @@ -707,15 +707,15 @@ host name, a hash sign, then a port number). It is the same as passing @samp{-p 42} to the @command{ssh} command. @item @option{telnet} -@cindex method telnet -@cindex telnet method +@cindex method @option{telnet} +@cindex @option{telnet} method Connecting to a remote host with @command{telnet} is as insecure as the @option{rsh} method. @item @option{su} -@cindex method su -@cindex su method +@cindex method @option{su} +@cindex @option{su} method Instead of connecting to a remote host, @command{su} program allows editing as another user. The host can be either @samp{localhost} or @@ -723,21 +723,21 @@ the host returned by the function @command{(system-name)}. See @ref{Multi-hops} for an exception to this behavior. @item @option{sudo} -@cindex method sudo -@cindex sudo method +@cindex method @option{sudo} +@cindex @option{sudo} method Similar to @option{su} method, @option{sudo} uses @command{sudo}. @command{sudo} must have sufficient rights to start a shell. @item @option{doas} -@cindex method doas -@cindex doas method +@cindex method @option{doas} +@cindex @option{doas} method This method is used on OpenBSD like the @command{sudo} command. @item @option{sg} -@cindex method sg -@cindex sg method +@cindex method @option{sg} +@cindex @option{sg} method The @command{sg} program allows editing as different group. The host can be either @samp{localhost} or the host returned by the function @@ -746,8 +746,8 @@ denotes a group name. See @ref{Multi-hops} for an exception to this behavior. @item @option{sshx} -@cindex method sshx -@cindex sshx method +@cindex method @option{sshx} +@cindex @option{sshx} method Works like @option{ssh} but without the extra authentication prompts. @option{sshx} uses @samp{ssh -t -t @var{host} -l @var{user} /bin/sh} @@ -767,23 +767,23 @@ missing shell prompts that confuses @value{tramp}. @option{sshx} supports the @samp{-p} argument. @item @option{krlogin} -@cindex method krlogin -@cindex krlogin method -@cindex kerberos (with krlogin method) +@cindex method @option{krlogin} +@cindex @option{krlogin} method +@cindex kerberos (with @option{krlogin} method) This method is also similar to @option{ssh}. It uses the @command{krlogin -x} command only for remote host login. @item @option{ksu} -@cindex method ksu -@cindex ksu method -@cindex kerberos (with ksu method) +@cindex method @option{ksu} +@cindex @option{ksu} method +@cindex kerberos (with @option{ksu} method) This is another method from the Kerberos suite. It behaves like @option{su}. @item @option{plink} -@cindex method plink -@cindex plink method +@cindex method @option{plink} +@cindex @option{plink} method @option{plink} method is for MS Windows users with the PuTTY implementation of SSH@. It uses @samp{plink -ssh} to log in to the @@ -795,8 +795,8 @@ session. @option{plink} method supports the @samp{-P} argument. @item @option{plinkx} -@cindex method plinkx -@cindex plinkx method +@cindex method @option{plinkx} +@cindex @option{plinkx} method Another method using PuTTY on MS Windows with session names instead of host names. @option{plinkx} calls @samp{plink -load @var{session} @@ -826,10 +826,9 @@ methods. @table @asis @item @option{rcp} -@cindex method rcp -@cindex rcp method -@cindex rcp (with rcp method) -@cindex rsh (with rcp method) +@cindex method @option{rcp} +@cindex @option{rcp} method +@cindex @command{rsh} (with @option{rcp} method) This method uses the @command{rsh} and @command{rcp} commands to connect to the remote host and transfer files. This is the fastest @@ -839,10 +838,9 @@ The alternative method @option{remcp} uses the @command{remsh} and @command{rcp} commands. @item @option{scp} -@cindex method scp -@cindex scp method -@cindex scp (with scp method) -@cindex ssh (with scp method) +@cindex method @option{scp} +@cindex @option{scp} method +@cindex @command{ssh} (with @option{scp} method) Using a combination of @command{ssh} to connect and @command{scp} to transfer is the most secure. While the performance is good, it is @@ -856,10 +854,9 @@ argument list to @command{ssh}, and @samp{-P 42} in the argument list to @command{scp}. @item @option{rsync} -@cindex method rsync -@cindex rsync method -@cindex rsync (with rsync method) -@cindex ssh (with rsync method) +@cindex method @option{rsync} +@cindex @option{rsync} method +@cindex @command{ssh} (with @option{rsync} method) @command{ssh} command to connect in combination with @command{rsync} command to transfer is similar to the @option{scp} method. @@ -871,10 +868,9 @@ is lost if the file exists only on one side of the connection. This method supports the @samp{-p} argument. @item @option{scpx} -@cindex method scpx -@cindex scpx method -@cindex scp (with scpx method) -@cindex ssh (with scpx method) +@cindex method @option{scpx} +@cindex @option{scpx} method +@cindex @command{ssh} (with @option{scpx} method) @option{scpx} is useful to avoid login shell questions. It is similar in performance to @option{scp}. @option{scpx} uses @samp{ssh -t -t @@ -888,16 +884,14 @@ This method supports the @samp{-p} argument. @item @option{pscp} @item @option{psftp} -@cindex method pscp -@cindex pscp method -@cindex pscp (with pscp method) -@cindex plink (with pscp method) -@cindex putty (with pscp method) -@cindex method psftp -@cindex psftp method -@cindex pscp (with psftp method) -@cindex plink (with psftp method) -@cindex putty (with psftp method) +@cindex method @option{pscp} +@cindex @option{pscp} method +@cindex @command{plink} (with @option{pscp} method) +@cindex @command{putty} (with @option{pscp} method) +@cindex method @option{psftp} +@cindex @option{psftp} method +@cindex @command{plink} (with @option{psftp} method) +@cindex @command{putty} (with @option{psftp} method) These methods are similar to @option{scp} or @option{sftp}, but they use the @command{plink} command to connect to the remote host, and @@ -910,10 +904,9 @@ session. These methods support the @samp{-P} argument. @item @option{fcp} -@cindex method fcp -@cindex fcp method -@cindex fsh (with fcp method) -@cindex fcp (with fcp method) +@cindex method @option{fcp} +@cindex @option{fcp} method +@cindex @command{fsh} (with @option{fcp} method) This method is similar to @option{scp}, but uses @command{fsh} to connect and @command{fcp} to transfer files. @command{fsh/fcp}, a @@ -925,18 +918,17 @@ benefits. The command used for this connection is: @samp{fsh @var{host} -l @var{user} /bin/sh -i} -@cindex method fsh -@cindex fsh method +@cindex method @option{fsh} +@cindex @option{fsh} method @option{fsh} has no inline method since the multiplexing it offers is not useful for @value{tramp}. @command{fsh} connects to remote host and @value{tramp} keeps that one connection open. @item @option{nc} -@cindex method nc -@cindex nc method -@cindex nc (with nc method) -@cindex telnet (with nc method) +@cindex method @option{nc} +@cindex @option{nc} method +@cindex @command{telnet} (with @option{nc} method) Using @command{telnet} to connect and @command{nc} to transfer files is sometimes the only combination suitable for accessing routers or @@ -945,18 +937,18 @@ such as the @command{busybox} and do not host any other encode or decode programs. @item @option{ftp} -@cindex method ftp -@cindex ftp method +@cindex method @option{ftp} +@cindex @option{ftp} method When @value{tramp} uses @option{ftp}, it forwards requests to whatever ftp program is specified by Ange FTP. This external program must be capable of servicing requests from @value{tramp}. @item @option{smb} -@cindex method smb -@cindex smb method -@cindex ms windows (with smb method) -@cindex smbclient +@cindex method @option{smb} +@cindex @option{smb} method +@cindex ms windows (with @option{smb} method) +@cindex @command{smbclient} This non-native @value{tramp} method connects via the Server Message Block (SMB) networking protocol to hosts running file servers that are @@ -1027,9 +1019,9 @@ can. @item @option{adb} -@cindex method adb -@cindex adb method -@cindex android (with adb method) +@cindex method @option{adb} +@cindex @option{adb} method +@cindex android (with @option{adb} method) This method uses Android Debug Bridge program for accessing Android devices. The Android Debug Bridge must be installed locally for @@ -1081,8 +1073,8 @@ D-Bus, dbus}. @table @asis @item @option{afp} -@cindex method afp -@cindex afp method +@cindex method @option{afp} +@cindex @option{afp} method This method is for connecting to remote hosts with the Apple Filing Protocol for accessing files on macOS volumes. @value{tramp} access @@ -1091,18 +1083,18 @@ syntax requires a leading volume (share) name, for example: @item @option{dav} @item @option{davs} -@cindex method dav -@cindex method davs -@cindex dav method -@cindex davs method +@cindex method @option{dav} +@cindex method @option{davs} +@cindex @option{dav} method +@cindex @option{davs} method @option{dav} method provides access to WebDAV files and directories based on standard protocols, such as HTTP@. @option{davs} does the same but with SSL encryption. Both methods support the port numbers. @item @option{gdrive} -@cindex method gdrive -@cindex gdrive method +@cindex method @option{gdrive} +@cindex @option{gdrive} method @cindex google drive Via the @option{gdrive} method it is possible to access your Google @@ -1117,16 +1109,16 @@ could produce unexpected behavior in case two files in the same directory have the same @code{display-name}, such a situation must be avoided. @item @option{obex} -@cindex method obex -@cindex obex method +@cindex method @option{obex} +@cindex @option{obex} method OBEX is an FTP-like access protocol for cell phones and similar simple devices. @value{tramp} supports OBEX over Bluetooth. @item @option{owncloud} @cindex @acronym{GNOME} Online Accounts -@cindex method owncloud -@cindex owncloud method +@cindex method @option{owncloud} +@cindex @option{owncloud} method @cindex nextcloud As the name indicates, the method @option{owncloud} allows you to @@ -1136,16 +1128,16 @@ access OwnCloud or NextCloud hosted files and directories. Like the supports port numbers. @item @option{sftp} -@cindex method sftp -@cindex sftp method +@cindex method @option{sftp} +@cindex @option{sftp} method This method uses @command{sftp} in order to securely access remote hosts. @command{sftp} is a more secure option for connecting to hosts that for security reasons refuse @command{ssh} connections. @item @option{synce} -@cindex method synce -@cindex synce method +@cindex method @option{synce} +@cindex @option{synce} method @option{synce} method allows connecting to MS Windows Mobile devices. It uses GVFS for mounting remote files and directories via FUSE and @@ -1902,8 +1894,8 @@ Similar localization may be necessary for handling wrong password prompts, for which @value{tramp} uses @option{tramp-wrong-passwd-regexp}. @item @command{tset} and other questions -@cindex unix command tset -@cindex tset unix command +@cindex unix command @command{tset} +@cindex @command{tset} unix command @vindex tramp-terminal-type To suppress inappropriate prompts for terminal type, @value{tramp} @@ -2015,8 +2007,8 @@ fi @end ifinfo @item @command{busybox} / @command{nc} -@cindex unix command nc -@cindex nc unix command +@cindex unix command @command{nc} +@cindex @command{nc} unix command @value{tramp}'s @option{nc} method uses the @command{nc} command to install and execute a listener as follows (see @code{tramp-methods}): @@ -2232,8 +2224,8 @@ to direct all auto saves to that location. This section is incomplete. Please share your solutions. -@cindex method sshx with cygwin -@cindex sshx method with cygwin +@cindex method @option{sshx} with cygwin +@cindex @option{sshx} method with cygwin Cygwin's @command{ssh} works only with a Cygwin version of Emacs. To check for compatibility: type @kbd{M-x eshell}, and start @kbd{ssh @@ -2254,8 +2246,8 @@ On @uref{https://www.emacswiki.org/emacs/SshWithNTEmacs, the Emacs Wiki} it is explained how to use the helper program @code{fakecygpty} to fix this problem. -@cindex method scpx with cygwin -@cindex scpx method with cygwin +@cindex method @option{scpx} with cygwin +@cindex @option{scpx} method with cygwin When using the @option{scpx} access method, Emacs may call @command{scp} with MS Windows file naming, such as @code{c:/foo}. But @@ -2267,7 +2259,7 @@ A workaround: write a wrapper script for @option{scp} to convert Windows file names to Cygwin file names. @cindex cygwin and ssh-agent -@cindex SSH_AUTH_SOCK and emacs on ms windows +@cindex @env{SSH_AUTH_SOCK} and emacs on ms windows When using the @command{ssh-agent} on MS Windows for password-less interaction, @option{ssh} methods depend on the environment variable @@ -2579,8 +2571,8 @@ For ad-hoc definitions to be saved automatically in @node Remote processes @section Integration with other Emacs packages -@cindex compile -@cindex recompile +@cindex @code{compile} +@cindex @code{recompile} @value{tramp} supports starting new running processes on the remote host for discovering remote file names. Emacs packages on the remote @@ -2715,7 +2707,7 @@ local host. @subsection Running @code{shell} on a remote host -@cindex shell +@cindex @code{shell} Set @option{explicit-shell-file-name} to the appropriate shell name when using @value{tramp} between two hosts with different operating @@ -2763,7 +2755,7 @@ different remote hosts. @subsection Running @code{shell-command} on a remote host -@cindex shell-command +@cindex @code{shell-command} @code{shell-command} executes commands synchronously or asynchronously on remote hosts and displays output in buffers on the local @@ -2783,7 +2775,7 @@ host. Example: @subsection Running @code{eshell} on a remote host -@cindex eshell +@cindex @code{eshell} @value{tramp} is integrated into @file{eshell.el}, which enables interactive eshell sessions on remote hosts at the command prompt. @@ -2829,9 +2821,9 @@ uid=0(root) gid=0(root) groups=0(root) @anchor{Running a debugger on a remote host} @subsection Running a debugger on a remote host -@cindex gud -@cindex gdb -@cindex perldb +@cindex @file{gud.el} +@cindex @code{gdb} +@cindex @code{perldb} @file{gud.el} provides a unified interface to symbolic debuggers @ifinfo @@ -2878,8 +2870,8 @@ relative or absolute paths, but not remote paths. @subsection Running remote processes on MS Windows hosts -@cindex winexe -@cindex powershell +@cindex @command{winexe} +@cindex @command{powershell} @command{winexe} runs processes on a remote MS Windows host, and @value{tramp} can use it for @code{process-file} and @@ -2986,122 +2978,122 @@ file names. Accepted suffixes are listed in the constant @itemize @item @samp{.7z} --- 7-Zip archives -@cindex 7z, file archive suffix -@cindex file archive suffix 7z +@cindex @file{7z} file archive suffix +@cindex file archive suffix @file{7z} @item @samp{.apk} --- Android package kits -@cindex apk, file archive suffix -@cindex file archive suffix apk +@cindex @file{apk} file archive suffix +@cindex file archive suffix @file{apk} @item @samp{.ar} --- UNIX archiver formats -@cindex ar, file archive suffix -@cindex file archive suffix ar +@cindex @file{ar} file archive suffix +@cindex file archive suffix @file{ar} @item @samp{.cab}, @samp{.CAB} --- Microsoft Windows cabinets -@cindex cab, file archive suffix -@cindex CAB, file archive suffix -@cindex file archive suffix cab -@cindex file archive suffix CAB +@cindex @file{cab} file archive suffix +@cindex @file{CAB} file archive suffix +@cindex file archive suffix @file{cab} +@cindex file archive suffix @file{CAB} @item @samp{.cpio} --- CPIO archives -@cindex cpio, file archive suffix -@cindex file archive suffix cpio +@cindex @file{cpio} file archive suffix +@cindex file archive suffix @file{cpio} @item @samp{.deb} --- Debian packages -@cindex deb, file archive suffix -@cindex file archive suffix deb +@cindex @file{deb} file archive suffix +@cindex file archive suffix @file{deb} @item @samp{.depot} --- HP-UX SD depots -@cindex depot, file archive suffix -@cindex file archive suffix depot +@cindex @file{depot} file archive suffix +@cindex file archive suffix @file{depot} @item @samp{.exe} --- Self extracting Microsoft Windows EXE files -@cindex exe, file archive suffix -@cindex file archive suffix exe +@cindex @file{exe} file archive suffix +@cindex file archive suffix @file{exe} @item @samp{.iso} --- ISO 9660 images -@cindex iso, file archive suffix -@cindex file archive suffix iso +@cindex @file{iso} file archive suffix +@cindex file archive suffix @file{iso} @item @samp{.jar} --- Java archives -@cindex jar, file archive suffix -@cindex file archive suffix jar +@cindex @file{jar} file archive suffix +@cindex file archive suffix @file{jar} @item @samp{.lzh}, @samp{LZH} --- Microsoft Windows compressed LHA archives -@cindex lzh, file archive suffix -@cindex LZH, file archive suffix -@cindex file archive suffix lzh -@cindex file archive suffix LZH +@cindex @file{lzh} file archive suffix +@cindex @file{LZH} file archive suffix +@cindex file archive suffix @file{lzh} +@cindex file archive suffix @file{LZH} @item @samp{.mtree} --- BSD mtree format -@cindex mtree, file archive suffix -@cindex file archive suffix mtree +@cindex @file{mtree} file archive suffix +@cindex file archive suffix @file{mtree} @item @samp{.pax} --- Posix archives -@cindex pax, file archive suffix -@cindex file archive suffix pax +@cindex @file{pax} file archive suffix +@cindex file archive suffix @file{pax} @item @samp{.rar} --- RAR archives -@cindex rar, file archive suffix -@cindex file archive suffix rar +@cindex @file{rar} file archive suffix +@cindex file archive suffix @file{rar} @item @samp{.rpm} --- Red Hat packages -@cindex rpm, file archive suffix -@cindex file archive suffix rpm +@cindex @file{rpm} file archive suffix +@cindex file archive suffix @file{rpm} @item @samp{.shar} --- Shell archives -@cindex shar, file archive suffix -@cindex file archive suffix shar +@cindex @file{shar} file archive suffix +@cindex file archive suffix @file{shar} @item @samp{.tar}, @samp{tbz}, @samp{tgz}, @samp{tlz}, @samp{txz} --- (Compressed) tape archives -@cindex tar, file archive suffix -@cindex tbz, file archive suffix -@cindex tgz, file archive suffix -@cindex tlz, file archive suffix -@cindex txz, file archive suffix -@cindex file archive suffix tar -@cindex file archive suffix tbz -@cindex file archive suffix tgz -@cindex file archive suffix tlz -@cindex file archive suffix txz +@cindex @file{tar} file archive suffix +@cindex @file{tbz} file archive suffix +@cindex @file{tgz} file archive suffix +@cindex @file{tlz} file archive suffix +@cindex @file{txz} file archive suffix +@cindex file archive suffix @file{tar} +@cindex file archive suffix @file{tbz} +@cindex file archive suffix @file{tgz} +@cindex file archive suffix @file{tlz} +@cindex file archive suffix @file{txz} @item @samp{.warc} --- Web archives -@cindex warc, file archive suffix -@cindex file archive suffix warc +@cindex @file{warc} file archive suffix +@cindex file archive suffix @file{warc} @item @samp{.xar} --- macOS XAR archives -@cindex xar, file archive suffix -@cindex file archive suffix xar +@cindex @file{xar} file archive suffix +@cindex file archive suffix @file{xar} @item @samp{.xps} --- Open XML Paper Specification (OpenXPS) documents -@cindex xps, file archive suffix -@cindex file archive suffix xps +@cindex @file{xps} file archive suffix +@cindex file archive suffix @file{xps} @item @samp{.zip}, @samp{.ZIP} --- ZIP archives -@cindex zip, file archive suffix -@cindex ZIP, file archive suffix -@cindex file archive suffix zip -@cindex file archive suffix ZIP +@cindex @file{zip} file archive suffix +@cindex @file{ZIP} file archive suffix +@cindex file archive suffix @file{zip} +@cindex file archive suffix @file{ZIP} @end itemize @vindex tramp-archive-compression-suffixes commit b54a86000c9519b2826ed2bf7f4475763c9b43f6 Author: Basil L. Contovounesios Date: Sat Jan 20 14:23:08 2018 +0200 Improve and simplify 'map-y-or-n-p' * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Do not follow a definite article with an action verb in C-h help text. Use 'with-help-window' instead of 'with-output-to-temp-buffer'. Simplify string concatenation. (Bug#30064) diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index 2a7eddedad..dd80524a15 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el @@ -191,34 +191,30 @@ Returns the number of actions taken." (funcall actor elt) (setq actions (1+ actions)))))) ((eq def 'help) - (with-output-to-temp-buffer "*Help*" + (with-help-window (help-buffer) (princ - (let ((object (if help (nth 0 help) "object")) - (objects (if help (nth 1 help) "objects")) - (action (if help (nth 2 help) "act on"))) + (let ((object (or (nth 0 help) "object")) + (objects (or (nth 1 help) "objects")) + (action (or (nth 2 help) "act on"))) (concat - (format-message "\ + (format-message + "\ Type SPC or `y' to %s the current %s; DEL or `n' to skip the current %s; -RET or `q' to give up on the %s (skip all remaining %s); +RET or `q' to skip the current and all remaining %s; C-g to quit (cancel the whole command); ! to %s all remaining %s;\n" - action object object action objects action - objects) - (mapconcat (function - (lambda (elt) - (format "%s to %s" - (single-key-description - (nth 0 elt)) - (nth 2 elt)))) + action object object objects action objects) + (mapconcat (lambda (elt) + (format "%s to %s;\n" + (single-key-description + (nth 0 elt)) + (nth 2 elt))) action-alist - ";\n") - (if action-alist ";\n") - (format "or . (period) to %s \ -the current %s and exit." - action object)))) - (with-current-buffer standard-output - (help-mode))) + "") + (format + "or . (period) to %s the current %s and exit." + action object))))) (funcall try-again)) ((and (symbolp def) (commandp def)) commit 9e9b71189adaa559a7a6b2780ef25578980d9751 Author: Basil L. Contovounesios Date: Sat Jan 20 14:19:34 2018 +0200 Use map-y-or-n-p in bibtex.el * lisp/textmodes/bibtex.el (bibtex-reformat): Use map-y-or-n-p. (Bug#30065) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index f6cc98241c..15004ed9c4 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -4925,23 +4925,26 @@ If mark is active reformat entries in region, if not in whole buffer." (cond (read-options (if use-previous-options bibtex-reformat-previous-options - (setq bibtex-reformat-previous-options - (delq nil - (mapcar (lambda (option) - (if (y-or-n-p (car option)) (cdr option))) - `(("Realign entries (recommended)? " . realign) - ("Remove empty optional and alternative fields? " . opts-or-alts) - ("Remove delimiters around pure numerical fields? " . numerical-fields) - (,(concat (if bibtex-comma-after-last-field "Insert" "Remove") - " comma at end of entry? ") . last-comma) - ("Replace double page dashes by single ones? " . page-dashes) - ("Delete whitespace at the beginning and end of fields? " . whitespace) - ("Inherit booktitle? " . inherit-booktitle) - ("Force delimiters? " . delimiters) - ("Unify case of entry types and field names? " . unify-case) - ("Enclose parts of field entries by braces? " . braces) - ("Replace parts of field entries by string constants? " . strings) - ("Sort fields? " . sort-fields))))))) + (let (answers) + (map-y-or-n-p + #'car + (lambda (option) + (push (cdr option) answers)) + `(("Realign entries (recommended)? " . realign) + ("Remove empty optional and alternative fields? " . opts-or-alts) + ("Remove delimiters around pure numerical fields? " . numerical-fields) + (,(concat (if bibtex-comma-after-last-field "Insert" "Remove") + " comma at end of entry? ") . last-comma) + ("Replace double page dashes by single ones? " . page-dashes) + ("Delete whitespace at the beginning and end of fields? " . whitespace) + ("Inherit booktitle? " . inherit-booktitle) + ("Force delimiters? " . delimiters) + ("Unify case of entry types and field names? " . unify-case) + ("Enclose parts of field entries by braces? " . braces) + ("Replace parts of field entries by string constants? " . strings) + ("Sort fields? " . sort-fields)) + '("formatting action" "formatting actions" "perform")) + (setq bibtex-reformat-previous-options (nreverse answers))))) ;; Do not include required-fields because `bibtex-reformat' ;; cannot handle the error messages of `bibtex-format-entry'. ;; Use `bibtex-validate' to check for required fields. commit f1e4249e377cdb7f4136484925d89afa85a70477 Author: Basil L. Contovounesios Date: Sat Jan 20 14:11:55 2018 +0200 Reverse bibtex-reference-keys in 'bibtex-parse-keys' * lisp/textmodes/bibtex.el (bibtex-parse-keys): Reverse bibtex-reference-keys. (Bug#30048) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index a30e146892..f6cc98241c 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -2932,7 +2932,7 @@ for parsing BibTeX keys. If parsing fails, try to set this variable to nil." (if verbose (bibtex-progress-message 'done)) ;; successful operation --> return `bibtex-reference-keys' - (setq bibtex-reference-keys ref-keys))))))) + (setq bibtex-reference-keys (nreverse ref-keys)))))))) (defun bibtex-parse-strings (&optional add abortable) "Set `bibtex-strings' to the string definitions in the whole buffer. commit 8ce430bb5005267bdc2d9396f72036a6b9141416 Author: Eli Zaretskii Date: Sat Jan 20 10:56:15 2018 +0200 Fix a typo in calendar.texi * doc/emacs/calendar.texi (Writing Calendar Files): Capitalize "Filofax". Reported by Will Korteland in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index dd82678dcb..7ce73a662b 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -441,7 +441,7 @@ argument, which specifies how many days, weeks, months or years to print If the variable @code{cal-tex-holidays} is non-@code{nil} (the default), then the printed calendars show the holidays in @code{calendar-holidays}. If the variable @code{cal-tex-diary} is non-@code{nil} (the default is -@code{nil}), diary entries are included also (in monthly, filofax, and +@code{nil}), diary entries are included also (in monthly, Filofax, and iso-week calendars only). If the variable @code{cal-tex-rules} is non-@code{nil} (the default is @code{nil}), the calendar displays ruled pages in styles that have sufficient room. Consult the documentation of commit bb748b3640225b592c85b2dec6f080eeda9bd64f Author: Eli Zaretskii Date: Sat Jan 20 10:52:06 2018 +0200 Minor improvement in wording of the Emacs manual * doc/emacs/killing.texi (CUA Bindings): Improve wording. Suggested by Will Korteland in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 9c9b85aa3d..6efcc9d35d 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi @@ -909,8 +909,8 @@ any direction. Normal text you type is inserted to the left or right of each line in the rectangle (on the same side as the cursor). You can use this rectangle support without activating CUA by calling the -@code{cua-rectangle-mark-mode} command. But see also the standard -@code{rectangle-mark-mode}. @xref{Rectangles}. +@code{cua-rectangle-mark-mode} command. There's also the standard command +@code{rectangle-mark-mode}, see @ref{Rectangles}. With CUA you can easily copy text and rectangles into and out of registers by providing a one-digit numeric prefix to the kill, copy, commit b603affa1fdd6c85cb5513dcc9606fd0b82567f2 Author: Eli Zaretskii Date: Sat Jan 20 09:48:22 2018 +0200 Revert "Fix tempfile creation when byte compiling" This reverts commit 4fd446e9f65e5531b18d4a0c5e08a6eeabc292d8: * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Put tempfile next to the target file, as was the original intent. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f6d259ba9d..700a7c16b5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1933,7 +1933,17 @@ The value is non-nil if there were no errors, nil if errors." ;; parallel bootstrap), it does not risk getting a ;; half-finished file. (Bug#4196) (tempfile - (make-temp-file (expand-file-name target-file))) + (if (file-name-absolute-p target-file) + (make-temp-file target-file) + ;; If target-file is relative and includes + ;; leading directories, make-temp-file will + ;; assume those leading directories exist + ;; under temporary-file-directory, which might + ;; not be true. So strip leading directories + ;; from relative file names before calling + ;; make-temp-file. + (make-temp-file + (file-name-nondirectory target-file)))) (default-modes (default-file-modes)) (temp-modes (logand default-modes #o600)) (desired-modes (logand default-modes #o666)) commit 4fd446e9f65e5531b18d4a0c5e08a6eeabc292d8 Author: Paul Eggert Date: Fri Jan 19 14:37:31 2018 -0800 Fix tempfile creation when byte compiling This improves on the recent fix for master failing to build on FreeBSD. Suggested by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Put tempfile next to the target file, as was the original intent. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 700a7c16b5..f6d259ba9d 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1933,17 +1933,7 @@ The value is non-nil if there were no errors, nil if errors." ;; parallel bootstrap), it does not risk getting a ;; half-finished file. (Bug#4196) (tempfile - (if (file-name-absolute-p target-file) - (make-temp-file target-file) - ;; If target-file is relative and includes - ;; leading directories, make-temp-file will - ;; assume those leading directories exist - ;; under temporary-file-directory, which might - ;; not be true. So strip leading directories - ;; from relative file names before calling - ;; make-temp-file. - (make-temp-file - (file-name-nondirectory target-file)))) + (make-temp-file (expand-file-name target-file))) (default-modes (default-file-modes)) (temp-modes (logand default-modes #o600)) (desired-modes (logand default-modes #o666)) commit 7f48a11216fc12f1aef8158f82e5a0a0706f51af Author: Eli Zaretskii Date: Fri Jan 19 21:18:03 2018 +0200 Improve the Emacs manual as suggested in emacs-manual-bugs * doc/emacs/killing.texi (Deletion and Killing): Add cross-reference to "Kill Ring". * doc/emacs/help.texi (Help Mode, Package Keywords): Improve wording. Suggested by Will Korteland in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 0aa4c501c2..d4a03c746d 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -462,14 +462,14 @@ command (@pxref{Browse-URL}). @findex backward-button In a help buffer, @key{TAB} (@code{forward-button}) moves point forward to the next hyperlink, while @kbd{S-@key{TAB}} -(@code{backward-button}) point back to the previous hyperlink. These -commands act cyclically; for instance, typing @key{TAB} at the last -hyperlink moves back to the first hyperlink. +(@code{backward-button}) moves point back to the previous hyperlink. +These commands act cyclically; for instance, typing @key{TAB} at the +last hyperlink moves back to the first hyperlink. To view all documentation about any symbol in the text, move point -to there and type @kbd{C-c C-c} (@code{help-follow-symbol}). This -shows all available documentation about the symbol---as a variable, -function and/or face. +to the symbol and type @kbd{C-c C-c} (@code{help-follow-symbol}). +This shows all available documentation about the symbol---as a +variable, function and/or face. @node Package Keywords @section Keyword Search for Packages @@ -495,8 +495,8 @@ buffer (@pxref{Package Menu}). package (@pxref{Packages}, and displays a help buffer describing the attributes of the package and the features that it implements. The buffer lists the keywords that relate to the package in the form of -buttons. Click on a button to see other packages related to that -keyword. +buttons. Click on a button with @kbd{mouse-1} or @kbd{mouse-2} to see +the list of other packages related to that keyword. @node Language Help @section Help for International Language Support diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 7d95a440e3..9c9b85aa3d 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi @@ -33,13 +33,13 @@ killing many different types of syntactic units. @cindex cutting text @cindex deletion Most commands which erase text from the buffer save it in the kill -ring. These are known as @dfn{kill} commands, and their names -normally contain the word @samp{kill} (e.g., @code{kill-line}). The -kill ring stores several recent kills, not just the last one, so -killing is a very safe operation: you don't have to worry much about -losing text that you previously killed. The kill ring is shared by -all buffers, so text that is killed in one buffer can be yanked into -another buffer. +ring (@pxref{Kill Ring}). These are known as @dfn{kill} commands, and +their names normally contain the word @samp{kill} (e.g., +@code{kill-line}). The kill ring stores several recent kills, not +just the last one, so killing is a very safe operation: you don't have +to worry much about losing text that you previously killed. The kill +ring is shared by all buffers, so text that is killed in one buffer +can be yanked into another buffer. When you use @kbd{C-/} (@code{undo}) to undo a kill command (@pxref{Undo}), that brings the killed text back into the buffer, but commit 728ded05f617d48f4a693713d72af872395ebd55 Author: Stefan Monnier Date: Fri Jan 19 11:29:13 2018 -0500 * lisp/emacs-lisp/bytecomp.el: Tweak last change (byte-compile-file): Move comment closer to the code it describes. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 3c9c62eb23..700a7c16b5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1933,15 +1933,15 @@ The value is non-nil if there were no errors, nil if errors." ;; parallel bootstrap), it does not risk getting a ;; half-finished file. (Bug#4196) (tempfile - ;; If target-file is relative and includes - ;; leading directories, make-temp-file will - ;; assume those leading directories exist - ;; under temporary-file-directory, which might - ;; not be true. So strip leading directories - ;; from relative file names before calling - ;; make-temp-file. (if (file-name-absolute-p target-file) (make-temp-file target-file) + ;; If target-file is relative and includes + ;; leading directories, make-temp-file will + ;; assume those leading directories exist + ;; under temporary-file-directory, which might + ;; not be true. So strip leading directories + ;; from relative file names before calling + ;; make-temp-file. (make-temp-file (file-name-nondirectory target-file)))) (default-modes (default-file-modes)) commit c6c05e2aa9d28a74df0b61b4f56745f1248a779e Author: Eli Zaretskii Date: Fri Jan 19 17:31:54 2018 +0200 Unbreak building Emacs on FreeBSD * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't create the temporary file under temporary-file-directory if the file being compiled is specified by an absolute file name. This avoids problems with ACL copying from temporary-file-directory on FreeBSD. For the details, see http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00513.html. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index acba9e2df5..3c9c62eb23 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1933,7 +1933,17 @@ The value is non-nil if there were no errors, nil if errors." ;; parallel bootstrap), it does not risk getting a ;; half-finished file. (Bug#4196) (tempfile - (make-temp-file (file-name-nondirectory target-file))) + ;; If target-file is relative and includes + ;; leading directories, make-temp-file will + ;; assume those leading directories exist + ;; under temporary-file-directory, which might + ;; not be true. So strip leading directories + ;; from relative file names before calling + ;; make-temp-file. + (if (file-name-absolute-p target-file) + (make-temp-file target-file) + (make-temp-file + (file-name-nondirectory target-file)))) (default-modes (default-file-modes)) (temp-modes (logand default-modes #o600)) (desired-modes (logand default-modes #o666)) commit a41ad3df9ff4377a99439b4541535c522fe2f845 Author: Eli Zaretskii Date: Fri Jan 19 11:54:44 2018 +0200 Don't unnecessarily use non-ASCII characters in C sources * src/xwidget.c (webkit_javascript_finished_cb): * src/gtkutil.c (xg_check_special_colors): * src/emacs-module.c (module_make_string): * src/alloc.c (SET_STACK_TOP_ADDRESS): Don't use non-ASCII quote characters. diff --git a/src/alloc.c b/src/alloc.c index 6704c51a20..9d0e2d37e3 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5124,7 +5124,7 @@ typedef union #endif /* Set *P to the address of the top of the stack. This must be a - macro, not a function, so that it is executed in the caller’s + macro, not a function, so that it is executed in the caller's environment. It is not inside a do-while so that its storage survives the macro. Callers should be declared NO_INLINE. */ #ifdef HAVE___BUILTIN_UNWIND_INIT diff --git a/src/emacs-module.c b/src/emacs-module.c index 00f0e86d7d..1b19e8033d 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -574,7 +574,7 @@ module_make_string (emacs_env *env, const char *str, ptrdiff_t length) if (! (0 <= length && length <= STRING_BYTES_BOUND)) xsignal0 (Qoverflow_error); /* FIXME: AUTO_STRING_WITH_LEN requires STR to be null-terminated, - but we shouldn’t require that. */ + but we shouldn't require that. */ AUTO_STRING_WITH_LEN (lstr, str, length); return lisp_to_value (env, code_convert_string_norecord (lstr, Qutf_8, false)); diff --git a/src/gtkutil.c b/src/gtkutil.c index 3ef0fa00a2..123236f5f0 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -580,8 +580,8 @@ xg_check_special_colors (struct frame *f, { GdkRGBA *c; /* FIXME: Retrieving the background color is deprecated in - GTK+ 3.16. New versions of GTK+ don’t use the concept of a - single background color any more, so we shouldn’t query for + GTK+ 3.16. New versions of GTK+ don't use the concept of a + single background color any more, so we shouldn't query for it. */ gtk_style_context_get (gsty, state, GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &c, diff --git a/src/xwidget.c b/src/xwidget.c index e095b0be56..530d1af707 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -389,7 +389,7 @@ webkit_javascript_finished_cb (GObject *webview, /* Register an xwidget event here, which then runs the callback. This ensures that the callback runs in sync with the Emacs event loop. */ - /* FIXME: This might lead to disaster if LISP_CALLBACK’s object + /* FIXME: This might lead to disaster if LISP_CALLBACK's object was garbage collected before now. See the FIXME in Fxwidget_webkit_execute_script. */ store_xwidget_js_callback_event (xw, XIL ((intptr_t) lisp_callback), commit c28d4b6d8e1ad3d8c96329239a01af9d1dc048c5 Author: Eli Zaretskii Date: Fri Jan 19 11:20:12 2018 +0200 Portability fixes in emacs-module-tests * test/Makefile.in (abs_top_srcdir): Add variable, needed by CPPFLAGS. * test/data/emacs-module/mod-test.c: Include . (pT, pZ, T_TYPE, Z_TYPE): Compatibility macros, for systems that don't support %td and %zu format specs. (emacs_module_init): Use compatibility macros to make the error messages print meaningful values (and avoid compiler warnings). diff --git a/test/Makefile.in b/test/Makefile.in index e03ffc5ab0..e6b3f77523 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -31,6 +31,7 @@ SHELL = @SHELL@ srcdir = @srcdir@ +abs_top_srcdir=@abs_top_srcdir@ VPATH = $(srcdir) FIND_DELETE = @FIND_DELETE@ diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index c1b1cade04..a1c115f00d 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c @@ -20,10 +20,35 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include #include int plugin_is_GPL_compatible; +#if INTPTR_MAX <= 0 +# error "INTPTR_MAX misconfigured" +#elif INTPTR_MAX <= INT_MAX || INTPTR_MAX <= LONG_MAX +# define pT "ld" +# define pZ "lu" +# define T_TYPE long +# define Z_TYPE unsigned long +#elif INTPTR_MAX <= INT64_MAX +# ifdef __MINGW32__ +# define pT "lld" +# define pZ "llu" +# define T_TYPE long long +# define Z_TYPE unsigned long long +# else +# define pT "ld" +# define pZ "lu" +# define T_TYPE long +# define Z_TYPE unsigned long +# endif +#else +# error "INTPTR_MAX too large" +#endif + + /* Always return symbol 't'. */ static emacs_value Fmod_test_return_t (emacs_env *env, ptrdiff_t nargs, emacs_value args[], @@ -287,9 +312,9 @@ emacs_module_init (struct emacs_runtime *ert) { if (ert->size < sizeof *ert) { - fprintf (stderr, "Runtime size of runtime structure (%td bytes) " - "smaller than compile-time size (%zu bytes)", - ert->size, sizeof *ert); + fprintf (stderr, "Runtime size of runtime structure (%"pT" bytes) " + "smaller than compile-time size (%"pZ" bytes)", + (T_TYPE) ert->size, (Z_TYPE) sizeof (*ert)); return 1; } @@ -297,9 +322,9 @@ emacs_module_init (struct emacs_runtime *ert) if (env->size < sizeof *env) { - fprintf (stderr, "Runtime size of environment structure (%td bytes) " - "smaller than compile-time size (%zu bytes)", - env->size, sizeof *env); + fprintf (stderr, "Runtime size of environment structure (%"pT" bytes) " + "smaller than compile-time size (%"pZ" bytes)", + (T_TYPE) env->size, (Z_TYPE) sizeof (*env)); return 2; } commit 1d50c185f0c857bb1a85945314b522540071f796 Author: Noam Postavsky Date: Sat Jan 6 19:28:09 2018 -0500 Add tests for term.el * lisp/term.el (term-mode): Add `name' attribute to window-adjust-process-window-size-function value, so that it can be removed easily by tests. * test/lisp/term-tests.el: New tests. diff --git a/lisp/term.el b/lisp/term.el index e51b7669e1..0492763854 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1145,7 +1145,8 @@ Entry to this mode runs the hooks on `term-mode-hook'." (lambda (size) (when size (term-reset-size (cdr size) (car size))) - size)) + size) + '((name . term-maybe-reset-size))) (add-hook 'read-only-mode-hook #'term-line-mode-buffer-read-only-update nil t) diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el new file mode 100644 index 0000000000..16466ea3cd --- /dev/null +++ b/test/lisp/term-tests.el @@ -0,0 +1,137 @@ +;;; term-tests.el --- tests for term.el -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Free Software Foundation, Inc. + +;; 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 'term) +(eval-when-compile (require 'cl-lib)) + +(defvar term-height) ; Number of lines in window. +(defvar term-width) ; Number of columns in window. + +(defun term-test-screen-from-input (width height input &optional return-var) + (with-temp-buffer + (term-mode) + ;; Keep dimensions independent from window size. + (remove-function (local 'window-adjust-process-window-size-function) + 'term-maybe-reset-size) + (term-exec (current-buffer) "test" "cat" nil nil) + (term-char-mode) + (setq term-width width) + (setq term-height height) + ;; Pass input directly to `term-emulate-terminal', it's easier to + ;; control chunking, and we don't have to worry about wrestling + ;; with stty settings. + (let ((proc (get-buffer-process (current-buffer)))) + (unwind-protect + (prog2 (if (consp input) + (mapc (lambda (input) (term-emulate-terminal proc input)) input) + (term-emulate-terminal proc input)) + (if return-var (buffer-local-value return-var (current-buffer)) + (buffer-substring-no-properties (point-min) (point-max))) + ;; End the process to avoid query on buffer kill. + (process-send-eof proc) + (accept-process-output proc)) + ;; Make extra sure we don't get stuck in case we hit some + ;; error before sending eof. + (when (process-live-p proc) + (kill-process proc) + ;; Let Emacs update process status. + (accept-process-output proc)))))) + +(ert-deftest term-simple-lines () + (let ((str "\ +first line\r +next line\r\n")) + (should (equal (term-test-screen-from-input 40 12 str) + (replace-regexp-in-string "\r" "" str))))) + +(ert-deftest term-carriage-return () + (let ((str "\ +first line\r_next line\r\n")) + (should (equal (term-test-screen-from-input 40 12 str) + "_next line\n")))) + +(ert-deftest term-line-wrap () + (should (string-match-p + ;; Don't be strict about trailing whitespace. + "\\`a\\{40\\}\na\\{20\\} *\\'" + (term-test-screen-from-input 40 12 (make-string 60 ?a)))) + ;; Again, but split input into chunks. + (should (string-match-p + "\\`a\\{40\\}\na\\{20\\} *\\'" + (term-test-screen-from-input 40 12 (let ((str (make-string 30 ?a))) + (list str str)))))) + +(ert-deftest term-cursor-movement () + ;; Absolute positioning. + (should (equal "ab\ncd" + (term-test-screen-from-input + 40 12 (concat "\e[2;2Hd" + "\e[2;1Hc" + "\e[1;2Hb" + "\e[1;1Ha")))) + ;; Send one byte at a time. + (should (equal "ab\ncd" + (term-test-screen-from-input + 40 12 (split-string (concat "\e[2;2Hd" + "\e[2;1Hc" + "\e[1;2Hb" + "\e[1;1Ha") "" t)))) + ;; Relative positioning. + (should (equal "ab\ncd" + (term-test-screen-from-input + 40 12 (concat "\e[B\e[Cd" + "\e[D\e[Dc" + "\e[Ab" + "\e[D\e[Da"))))) + +(ert-deftest term-scrolling-region () + (should (equal "\ +line3 +line4 +line5 +line6 +" + (term-test-screen-from-input + 40 12 "\e[1;5r\ +line1\r +line2\r +line3\r +line4\r +line5\r +line6\r +")))) + +(ert-deftest term-set-directory () + (let ((term-ansi-at-user (user-real-login-name))) + (should (equal (term-test-screen-from-input + 40 12 "\eAnSiTc /foo/\n" 'default-directory) + "/foo/")) + ;; Split input (Bug#17231). + (should (equal (term-test-screen-from-input + 40 12 (list "\eAnSiTc /f" "oo/\n") 'default-directory) + "/foo/")))) + +(provide 'term-tests) + +;;; term-tests.el ends here commit 5472568a3c2338856d25380012ee4398e024c806 Author: Callum Cameron Date: Wed Apr 9 11:12:25 2014 +0100 Handle split AnSiT messages for term.el (Bug#17231) Check to see if there is an incomplete command at the end of term-emulate-terminal's input string, and, if so, save it so the whole command can be processed when the next string arrives. * lisp/term.el (term-partial-ansi-terminal-message): New variable. (term-mode): Make it buffer local. (term-handle-ansi-terminal-messages): Prepend it to the received message, and set it if a partial message was received. Copyright-paperwork-exempt: yes Do not merge to master, it will be solved differently there, see "Switch term.el to lexical binding, and clean up code a bit". diff --git a/lisp/term.el b/lisp/term.el index ca83b4f8dc..e51b7669e1 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -593,6 +593,9 @@ massage the input string, this is your hook. This is called from the user command `term-send-input'. `term-simple-send' just sends the string plus a newline.") +(defvar term-partial-ansi-terminal-message nil + "Keep partial ansi terminal messages for future processing.") + (defcustom term-eol-on-send t "Non-nil means go to the end of the line before sending input. See `term-send-input'." @@ -1077,6 +1080,8 @@ Entry to this mode runs the hooks on `term-mode-hook'." (make-local-variable 'ange-ftp-default-password) (make-local-variable 'ange-ftp-generate-anonymous-password) + (make-local-variable 'term-partial-ansi-terminal-message) + ;; You may want to have different scroll-back sizes -mm (make-local-variable 'term-buffer-maximum-size) @@ -2702,6 +2707,11 @@ See `term-prompt-regexp'." ;;difference ;-) -mm (defun term-handle-ansi-terminal-messages (message) + ;; Handle stored partial message + (when term-partial-ansi-terminal-message + (setq message (concat term-partial-ansi-terminal-message message)) + (setq term-partial-ansi-terminal-message nil)) + ;; Is there a command here? (while (string-match "\eAnSiT.+\n" message) ;; Extract the command code and the argument. @@ -2754,6 +2764,11 @@ See `term-prompt-regexp'." (setq ange-ftp-default-user nil) (setq ange-ftp-default-password nil) (setq ange-ftp-generate-anonymous-password nil))))) + ;; If there is a partial message at the end of the string, store it + ;; for future use. + (when (string-match "\eAnSiT.+$" message) + (setq term-partial-ansi-terminal-message (match-string 0 message)) + (setq message (replace-match "" t t message))) message) commit 297dc41e2c6e84efac092e2d6f69824cb3b6d98d Author: Glenn Morris Date: Thu Jan 18 18:09:15 2018 -0500 * configure.ac (emacs_config_features): Add threads. diff --git a/configure.ac b/configure.ac index ac158bd2d0..f9c7bb76e5 100644 --- a/configure.ac +++ b/configure.ac @@ -5364,12 +5364,13 @@ emacs_config_features= for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \ GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \ LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT OLDXMENU X11 NS MODULES \ - XWIDGETS LIBSYSTEMD CANNOT_DUMP LCMS2; do + THREADS XWIDGETS LIBSYSTEMD CANNOT_DUMP LCMS2; do case $opt in CANNOT_DUMP) eval val=\${$opt} ;; NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;; TOOLKIT_SCROLL_BARS|X_TOOLKIT) eval val=\${USE_$opt} ;; + THREADS) val=${threads_enabled} ;; *) eval val=\${HAVE_$opt} ;; esac case x$val in