commit 843f3d4f34c2f54fac19d97c32399671f98ccc51 (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Tue Jan 30 21:43:28 2018 -0500 automerge: handle upstream changes during operation * admin/automerge (merge): New function, split from pre-existing code. (main): If upstream changed during building and testing, reset local and try merging again. diff --git a/admin/automerge b/admin/automerge index 54ac88db4f..94b41d2cdc 100755 --- a/admin/automerge +++ b/admin/automerge @@ -1,5 +1,5 @@ #!/bin/bash -### automerge - merge the Emacs release branch to master +### automerge - automatically merge the Emacs release branch to master ## Copyright (C) 2018 Free Software Foundation, Inc. @@ -23,7 +23,12 @@ ### Commentary: ## Automatically merge the Emacs release branch to master. -## No warranty, etc. +## If the merge succeeds, optionally build and test the results, +## and then push it. +## Intended usage: +## Have a dedicated git directory just for this. +## Have a cron job that does a hard reset (to clean up after any +## previous failures), then a git pull, then calls this script with -p. die () # write error to stderr and exit { @@ -116,23 +121,35 @@ trap "rm -f $tempfile 2> /dev/null" EXIT } -echo "Merging..." +rev=$(git rev-parse HEAD) -if $emacs --batch -Q -l ./admin/gitmerge.el \ - --eval "(setq gitmerge-minimum-missing $nmin)" -f gitmerge \ - >| $tempfile 2>&1; then - echo "merged ok" +[ $(git rev-parse @{u}) = $rev ] || die "Local state does not match origin" -else - grep -qE "Nothing to merge|Number of missing commits" $tempfile && { - echo "Fewer than $nmin commits to merge" - exit 0 - } - cat "$tempfile" 1>&2 +merge () +{ + echo "Merging..." - die "merge error" -fi + if $emacs --batch -Q -l ./admin/gitmerge.el \ + --eval "(setq gitmerge-minimum-missing $nmin)" -f gitmerge \ + >| $tempfile 2>&1; then + echo "merged ok" + return 0 + + else + grep -qE "Nothing to merge|Number of missing commits" $tempfile && { + echo "Fewer than $nmin commits to merge" + exit 0 + } + + cat "$tempfile" 1>&2 + + die "merge error" + fi +} + + +merge [ "$build" ] || exit 0 @@ -181,14 +198,28 @@ echo "Tests finished ok" ## In case someone else pushed while we were working. -#echo "Checking for remote changes..." -#git fetch || die "fetch error" -## NB If there were remote changes, this would rewrite the release -## branch commits, which is not what we want. -## Ref eg http://lists.gnu.org/r/emacs-devel/2014-12/msg01435.html -## git >= 1.8.5 has "pull --rebase=preserve" -#git rebase --preserve-merges || die "rebase error" +echo "Checking for remote changes..." +git fetch || die "fetch error" + +[ $(git rev-parse @{u}) = $rev ] || { + + echo "Upstream has changed" + ## Rebasing would be incorrect, since it would rewrite the + ## (already published) release branch commits. + ## Ref eg http://lists.gnu.org/r/emacs-devel/2014-12/msg01435.html + ## Instead, we throw away what we just did, and do the merge again. + echo "Resetting..." + git reset --hard $rev + + echo "Pulling..." + git pull --ff-only || die "pull error" + + merge + + ## If the merge finished ok again, we don't bother doing a second + ## build and test. +} echo "Pushing..." git push || die "push error" commit 2b0bcbbaa64f95c14deed89fdf279d8be48ee352 Author: Stefan Monnier Date: Tue Jan 30 17:37:20 2018 -0500 * test/lisp/mouse-tests.el: Fix tests broken by mouse.el change * test/lisp/mouse-tests.el (bug23288-use-return-value) (bug23288-translate-to-mouse-2): Don't rely as much on details of the implementation, so it also works with the new code. diff --git a/test/lisp/mouse-tests.el b/test/lisp/mouse-tests.el index 639ccf78a9..909ba64a72 100644 --- a/test/lisp/mouse-tests.el +++ b/test/lisp/mouse-tests.el @@ -27,24 +27,22 @@ (ert-deftest bug23288-use-return-value () "If `mouse-on-link-p' returns a string, its first character is used." - (cl-letf ((last-input-event '(down-mouse-1 nil 1)) - (unread-command-events '((mouse-1 nil 1))) + (cl-letf ((unread-command-events '((down-mouse-1 nil 1) (mouse-1 nil 1))) (mouse-1-click-follows-link t) (mouse-1-click-in-non-selected-windows t) ((symbol-function 'mouse-on-link-p) (lambda (_pos) "abc"))) - (should-not (mouse--down-1-maybe-follows-link)) - (should (equal unread-command-events '(?a))))) + (should (eq 'down-mouse-1 (car-safe (aref (read-key-sequence "") 0)))) + (should (eq ?a (aref (read-key-sequence "") 0))))) (ert-deftest bug23288-translate-to-mouse-2 () "If `mouse-on-link-p' doesn't return a string or vector, translate `mouse-1' events into `mouse-2' events." - (cl-letf ((last-input-event '(down-mouse-1 nil 1)) - (unread-command-events '((mouse-1 nil 1))) + (cl-letf ((unread-command-events '((down-mouse-1 nil 1) (mouse-1 nil 1))) (mouse-1-click-follows-link t) (mouse-1-click-in-non-selected-windows t) ((symbol-function 'mouse-on-link-p) (lambda (_pos) t))) - (should-not (mouse--down-1-maybe-follows-link)) - (should (equal unread-command-events '((mouse-2 nil 1)))))) + (should (eq 'down-mouse-1 (car-safe (aref (read-key-sequence "") 0)))) + (should (eq 'mouse-2 (car-safe (aref (read-key-sequence "") 0)))))) (ert-deftest bug26816-mouse-frame-movement () "Mouse moves relative to frame." commit 386c2ebb58c403c647a1dae1314be4b9f2071f56 Author: Michael Albinus Date: Tue Jan 30 20:09:20 2018 +0100 Simplify last change in tramp-archive diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index ac8b76b944..51ee18fac7 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -315,26 +315,23 @@ name is kept in slot `hop'" (unless (tramp-archive-file-name-p name) (tramp-compat-user-error nil "Not an archive file name: \"%s\"" name)) ;; The `string-match' happened in `tramp-archive-file-name-p'. - (let ((archive (match-string 1 name)) - (localname (match-string 2 name)) - (tramp-verbose 0) - vec copy) - - (setq archive (file-truename archive)) + (let* ((localname (match-string 2 name)) + (archive (file-truename (match-string 1 name))) + (vec (make-tramp-file-name + :method tramp-archive-method :hop archive))) (cond ;; The value is already in the hash table. - ((setq vec (car (gethash archive tramp-archive-hash)))) + ((gethash archive tramp-archive-hash) + (setq vec (car (gethash archive tramp-archive-hash)))) ;; File archives inside file archives. ((tramp-archive-file-name-p archive) (let ((archive (tramp-make-tramp-file-name (tramp-archive-dissect-file-name archive) nil 'noarchive))) - (setq vec - (make-tramp-file-name - :method tramp-archive-method :hop archive - :host (url-hexify-string (tramp-gvfs-url-file-name archive))))) + (setf (tramp-file-name-host vec) + (url-hexify-string (tramp-gvfs-url-file-name archive)))) (puthash archive (list vec) tramp-archive-hash)) ;; http://... @@ -347,34 +344,29 @@ name is kept in slot `hop'" (url-type (url-generic-parse-url archive)) url-tramp-protocols)) (archive (url-tramp-convert-url-to-tramp archive))) - (setq vec - (make-tramp-file-name - :method tramp-archive-method :hop archive - :host (url-hexify-string (tramp-gvfs-url-file-name archive))))) - (puthash archive (list vec) tramp-archive-hash)) + (setf (tramp-file-name-host vec) + (url-hexify-string (tramp-gvfs-url-file-name archive)))) + (puthash archive (list vec) tramp-archive-hash)) ;; GVFS supported schemes. ((or (tramp-gvfs-file-name-p archive) (not (file-remote-p archive))) - (setq vec - (make-tramp-file-name - :method tramp-archive-method :hop archive - :host (url-hexify-string (tramp-gvfs-url-file-name archive)))) + (setf (tramp-file-name-host vec) + (url-hexify-string (tramp-gvfs-url-file-name archive))) (puthash archive (list vec) tramp-archive-hash)) ;; Anything else. Here we call `file-local-copy', which we ;; have avoided so far. - (t (let ((inhibit-file-name-operation 'file-local-copy) - (inhibit-file-name-handlers - (cons 'jka-compr-handler inhibit-file-name-handlers))) - (setq copy (file-local-copy archive) - vec - (make-tramp-file-name - :method tramp-archive-method :hop archive - :host (url-hexify-string (tramp-gvfs-url-file-name copy))))) - (puthash archive (cons vec copy) tramp-archive-hash))) - - ;; So far, `vec' handles just the mount point. Add `localname'. + (t (let* ((inhibit-file-name-operation 'file-local-copy) + (inhibit-file-name-handlers + (cons 'jka-compr-handler inhibit-file-name-handlers)) + (copy (file-local-copy archive))) + (setf (tramp-file-name-host vec) + (url-hexify-string (tramp-gvfs-url-file-name copy))) + (puthash archive (cons vec copy) tramp-archive-hash)))) + + ;; So far, `vec' handles just the mount point. Add `localname', + ;; which shouldn't be pushed to the hash. (setf (tramp-file-name-localname vec) localname) vec))) diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 82dd5de8b9..ecfee0c556 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -186,11 +186,7 @@ variables, so we check the Emacs version directly." (file-name-nondirectory tramp-archive-test-file-archive))))) (should-not port) (should (string-equal localname "/bar")) - ;; The `archive' component is now already a Tramp file name. - (should - (string-equal - archive - (tramp-archive-gvfs-file-name tramp-archive-test-file-archive)))) + (should (string-equal archive tramp-archive-test-file-archive))) ;; Cleanup. (tramp-archive-cleanup-hash)))) commit 3d5e31eceb9dc1fb62b2b27bcab549df3bd04ce9 Author: Stefan Monnier Date: Tue Jan 30 12:41:29 2018 -0500 * lisp/mouse.el: Rework the mouse-1-click remapping Avoid peeking ahead at the next event because this had undesirable effects, such as making 'this-single-command-raw-keys' return bogus information. (mouse--last-down): New variable. (mouse--down-1-maybe-follows-link): Don't do the remapping here. Instead, just keep track of the time when the down happened. (mouse--down-1-maybe-follows-link): Do the remapping here. (key-translation-map): Add bindings for (double-)mouse-1. diff --git a/lisp/mouse.el b/lisp/mouse.el index 9a3e2235ec..6a98ee7353 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -58,8 +58,8 @@ addition to mouse drags." With the default setting, an ordinary Mouse-1 click on a link performs the same action as Mouse-2 on that link, while a longer -Mouse-1 click \(hold down the Mouse-1 button for more than 450 -milliseconds) performs the original Mouse-1 binding \(which +Mouse-1 click (hold down the Mouse-1 button for more than 450 +milliseconds) performs the original Mouse-1 binding (which typically sets point where you click the mouse). If value is an integer, the time elapsed between pressing and @@ -96,55 +96,55 @@ point at the click position." :version "22.1" :group 'mouse) +(defvar mouse--last-down nil) + (defun mouse--down-1-maybe-follows-link (&optional _prompt) + (when mouse-1-click-follows-link + (setq mouse--last-down (cons (car-safe last-input-event) (float-time)))) + nil) + +(defun mouse--click-1-maybe-follows-link (&optional _prompt) "Turn `mouse-1' events into `mouse-2' events if follows-link. -Expects to be bound to `down-mouse-1' in `key-translation-map'." - (when (and mouse-1-click-follows-link - (eq (if (eq mouse-1-click-follows-link 'double) - 'double-down-mouse-1 'down-mouse-1) - (car-safe last-input-event))) - (let ((action (mouse-on-link-p (event-start last-input-event)))) - (when (and action - (or mouse-1-click-in-non-selected-windows - (eq (selected-window) - (posn-window (event-start last-input-event))))) - (let ((timedout - (sit-for (if (numberp mouse-1-click-follows-link) - (/ (abs mouse-1-click-follows-link) 1000.0) - 0)))) - (if (if (and (numberp mouse-1-click-follows-link) - (>= mouse-1-click-follows-link 0)) - timedout (not timedout)) - nil - ;; Use read-key so it works for xterm-mouse-mode! - (let ((event (read-key))) - (if (eq (car-safe event) - (if (eq mouse-1-click-follows-link 'double) - 'double-mouse-1 'mouse-1)) - (progn - ;; Turn the mouse-1 into a mouse-2 to follow links, - ;; but only if ‘mouse-on-link-p’ hasn’t returned a - ;; string or vector (see its docstring). - (if (or (stringp action) (vectorp action)) - (push (aref action 0) unread-command-events) - (let ((newup (if (eq mouse-1-click-follows-link 'double) - 'double-mouse-2 'mouse-2))) - ;; If mouse-2 has never been done by the user, it - ;; doesn't have the necessary property to be - ;; interpreted correctly. - (unless (get newup 'event-kind) - (put newup 'event-kind (get (car event) 'event-kind))) - (push (cons newup (cdr event)) unread-command-events))) - ;; Don't change the down event, only the up-event - ;; (bug#18212). - nil) - (push event unread-command-events) - nil)))))))) +Expects to be bound to `(double-)mouse-1' in `key-translation-map'." + (and mouse--last-down + (pcase mouse-1-click-follows-link + ('nil nil) + ('double (eq 'double-mouse-1 (car-safe last-input-event))) + (_ (and (eq 'mouse-1 (car-safe last-input-event)) + (or (not (numberp mouse-1-click-follows-link)) + (funcall (if (< mouse-1-click-follows-link 0) #'> #'<) + (- (float-time) (cdr mouse--last-down)) + (/ (abs mouse-1-click-follows-link) 1000.0)))))) + (eq (car mouse--last-down) + (event-convert-list (list 'down (car-safe last-input-event)))) + (let* ((action (mouse-on-link-p (event-start last-input-event)))) + (when (and action + (or mouse-1-click-in-non-selected-windows + (eq (selected-window) + (posn-window (event-start last-input-event))))) + ;; Turn the mouse-1 into a mouse-2 to follow links, + ;; but only if ‘mouse-on-link-p’ hasn’t returned a + ;; string or vector (see its docstring). + (if (arrayp action) + (vector (aref action 0)) + (let ((newup (if (eq mouse-1-click-follows-link 'double) + 'double-mouse-2 'mouse-2))) + ;; If mouse-2 has never been done by the user, it + ;; doesn't have the necessary property to be + ;; interpreted correctly. + (unless (get newup 'event-kind) + (put newup 'event-kind + (get (car last-input-event) 'event-kind))) + (vector (cons newup (cdr last-input-event))))))))) (define-key key-translation-map [down-mouse-1] #'mouse--down-1-maybe-follows-link) (define-key key-translation-map [double-down-mouse-1] #'mouse--down-1-maybe-follows-link) +(define-key key-translation-map [mouse-1] + #'mouse--click-1-maybe-follows-link) +(define-key key-translation-map [double-mouse-1] + #'mouse--click-1-maybe-follows-link) ;; Provide a mode-specific menu on a mouse button. @@ -1144,19 +1144,15 @@ The resulting value determine whether POS is inside a link: is a non-nil `mouse-face' property at POS. Return t in this case. - If the value is a function, FUNC, POS is inside a link if -the call \(FUNC POS) returns non-nil. Return the return value -from that call. Arg is \(posn-point POS) if POS is a mouse event. +the call (FUNC POS) returns non-nil. Return the return value +from that call. Arg is (posn-point POS) if POS is a mouse event. - Otherwise, return the value itself. The return value is interpreted as follows: -- If it is a string, the mouse-1 event is translated into the -first character of the string, i.e. the action of the mouse-1 -click is the local or global binding of that character. - -- If it is a vector, the mouse-1 event is translated into the -first element of that vector, i.e. the action of the mouse-1 +- If it is an array, the mouse-1 event is translated into the +first element of that array, i.e. the action of the mouse-1 click is the local or global binding of that event. - Otherwise, the mouse-1 event is translated into a mouse-2 event commit 9d4af3e6bdfac374f6c9591566c010e6a1514751 Author: Stefan Monnier Date: Tue Jan 30 11:57:40 2018 -0500 * lisp/help.el: Rework describe-key's handling of up and double clicks Use lexical-binding. (help--binding-undefined-p): New function, extracted from help--analyze-key. (help--analyze-key): Use it. (help--filter-info-list): New function. (describe-key-briefly): Change calling convention. Handle a list of key sequences now. (help--binding-locus): Remove unused var 'found'. (help--read-key-sequence): Rename from help-read-key-sequence. Almost complete rewrite, with a different return value. (help-downify-mouse-event-type): Remove. (describe-key): Change calling convention. Handle a list of key sequences now. diff --git a/lisp/help.el b/lisp/help.el index 014af5141e..4899bc44e0 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1,4 +1,4 @@ -;;; help.el --- help commands for Emacs +;;; help.el --- help commands for Emacs -*- lexical-binding:t -*- ;; Copyright (C) 1985-1986, 1993-1994, 1998-2018 Free Software ;; Foundation, Inc. @@ -593,19 +593,27 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer." string (format "%s (translated from %s)" string otherstring)))))) +(defun help--binding-undefined-p (defn) + (or (null defn) (integerp defn) (equal defn 'undefined))) + (defun help--analyze-key (key untranslated) "Get information about KEY its corresponding UNTRANSLATED events. Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)." (if (numberp untranslated) - (setq untranslated (this-single-command-raw-keys))) - (let* ((event (aref key (if (and (symbolp (aref key 0)) - (> (length key) 1) - (consp (aref key 1))) - 1 - 0))) + (error "Missing `untranslated'!")) + (let* ((event (when (> (length key) 0) + (aref key (if (and (symbolp (aref key 0)) + (> (length key) 1) + (consp (aref key 1))) + ;; Look at the second event when the first + ;; is a pseudo-event like `mode-line' or + ;; `left-fringe'. + 1 + 0)))) (modifiers (event-modifiers event)) (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers) - (memq 'drag modifiers)) " at that spot" "")) + (memq 'drag modifiers)) + " at that spot" "")) (defn (key-binding key t))) ;; Handle the case where we faked an entry in "Select and Paste" menu. (when (and (eq defn nil) @@ -621,27 +629,47 @@ Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)." (list ;; Now describe the key, perhaps as changed. (let ((key-desc (help-key-description key untranslated))) - (if (or (null defn) (integerp defn) (equal defn 'undefined)) + (if (help--binding-undefined-p defn) (format "%s%s is undefined" key-desc mouse-msg) (format "%s%s runs the command %S" key-desc mouse-msg defn))) defn event mouse-msg))) -(defun describe-key-briefly (&optional key insert untranslated) - "Print the name of the function KEY invokes. KEY is a string. +(defun help--filter-info-list (info-list i) + "Drop the undefined keys." + (or + ;; Remove all `undefined' keys. + (delq nil (mapcar (lambda (x) + (unless (help--binding-undefined-p (nth i x)) x)) + info-list)) + ;; If nothing left, then keep one (the last one). + (last info-list))) + +(defun describe-key-briefly (&optional key-list insert untranslated) + "Print the name of the functions KEY-LIST invokes. +KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where +RAW-SEQ is the untranslated form of the key sequence SEQ. If INSERT (the prefix arg) is non-nil, insert the message in the buffer. -If non-nil, UNTRANSLATED is a vector of the untranslated events. -It can also be a number in which case the untranslated events from -the last key hit are used. -If KEY is a menu item or a tool-bar button that is disabled, this command -temporarily enables it to allow getting help on disabled items and buttons." +While reading KEY-LIST interactively, this command temporarily enables +menu items or tool-bar buttons that are disabled to allow getting help +on them." + (declare (advertised-calling-convention (key-list &optional insert) "27.1")) (interactive ;; Ignore mouse movement events because it's too easy to miss the ;; message while moving the mouse. - (pcase-let ((`(,key ,_up-event) (help-read-key-sequence 'no-mouse-movement))) - `(,key ,current-prefix-arg 1))) - (princ (car (help--analyze-key key untranslated)) - (if insert (current-buffer) standard-output))) + (let ((key-list (help--read-key-sequence 'no-mouse-movement))) + `(,key-list ,current-prefix-arg))) + (when (arrayp key-list) + ;; Old calling convention, changed + (setq key-list (list (cons key-list + (if (numberp untranslated) + (this-single-command-raw-keys) + untranslated))))) + (let* ((info-list (mapcar (lambda (kr) + (help--analyze-key (car kr) (cdr kr))) + key-list)) + (msg (mapconcat #'car (help--filter-info-list info-list 1) "\n"))) + (if insert (insert msg) (message "%s" msg)))) (defun help--key-binding-keymap (key &optional accept-default no-remap position) "Return a keymap holding a binding for KEY within current keymaps. @@ -688,8 +716,7 @@ function `key-binding'." (format "%s-map" mode))))) minor-mode-map-alist)) (list 'global-map - (intern-soft (format "%s-map" major-mode))))) - found) + (intern-soft (format "%s-map" major-mode)))))) ;; Look into these advertised symbols first. (dolist (sym advertised-syms) (when (and @@ -706,225 +733,137 @@ function `key-binding'." (throw 'found x)))) nil))))) -(defun help-read-key-sequence (&optional no-mouse-movement) - "Reads a key sequence from the user. -Returns a list of the form (KEY UP-EVENT), where KEY is the key -sequence, and UP-EVENT is the up-event that was discarded by -reading KEY, or nil. +(defun help--read-key-sequence (&optional no-mouse-movement) + "Read a key sequence from the user. +Usually reads a single key sequence, except when that sequence might +hide another one (e.g. a down event, where the user is interested +in getting info about the up event, or a click event, where the user +wants to get info about the double click). +Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key +sequence, and RAW-SEQ is its untranslated form. If NO-MOUSE-MOVEMENT is non-nil, ignore key sequences starting with `mouse-movement' events." (let ((enable-disabled-menus-and-buttons t) (cursor-in-echo-area t) saved-yank-menu) (unwind-protect - (let (key keys down-ev discarded-up) + (let (last-modifiers key-list) ;; If yank-menu is empty, populate it temporarily, so that ;; "Select and Paste" menu can generate a complete event. (when (null (cdr yank-menu)) (setq saved-yank-menu (copy-sequence yank-menu)) (menu-bar-update-yank-menu "(any string)" nil)) (while - (pcase (setq key (read-key-sequence "\ + ;; Read at least one key-sequence. + (or (null key-list) + ;; After a down event, also read the (presumably) following + ;; up-event. + (memq 'down last-modifiers) + ;; After a click, see if a double click is on the way. + (and (memq 'click last-modifiers) + (not (sit-for (/ double-click-time 1000.0) t)))) + (let* ((seq (read-key-sequence "\ Describe the following key, mouse click, or menu item: ")) - ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0)) - (guard (symbolp key0)) (let keyname (symbol-name key0))) - (or - (and no-mouse-movement - (string-match "mouse-movement" keyname)) - (progn (push key keys) nil) - (and (string-match "\\(mouse\\|down\\|click\\|drag\\)" - keyname) - (progn - ;; Discard events (e.g. ) which might - ;; spuriously trigger the `sit-for'. - (sleep-for 0.01) - (while (read-event nil nil 0.01)) - (not (sit-for - (if (numberp double-click-time) - (/ double-click-time 1000.0) - 3.0) - t)))))))) - ;; When we have a sequence of mouse events, discard the most - ;; recent ones till we find one with a binding. - (let ((keys-1 keys)) - (while (and keys-1 - (not (key-binding (car keys-1)))) - ;; If we discard the last event, and this was a mouse - ;; up, remember this. - (if (and (eq keys-1 keys) - (vectorp (car keys-1)) - (let* ((last-idx (1- (length (car keys-1)))) - (last (aref (car keys-1) last-idx))) - (and (eventp last) - (memq 'click (event-modifiers last))))) - (setq discarded-up t)) - (setq keys-1 (cdr keys-1))) - (if keys-1 - (setq key (car keys-1)))) - (list - key - ;; If KEY is a down-event, read and include the - ;; corresponding up-event. Note that there are also - ;; down-events on scroll bars and mode lines: the actual - ;; event then is in the second element of the vector. - (and (not discarded-up) ; Don't attempt to ignore the up-event twice. - (vectorp key) - (let ((last-idx (1- (length key)))) - (and (eventp (aref key last-idx)) - (memq 'down (event-modifiers (aref key last-idx))))) - (or (and (eventp (setq down-ev (aref key 0))) - (memq 'down (event-modifiers down-ev)) - ;; However, for the C-down-mouse-2 popup - ;; menu, there is no subsequent up-event. In - ;; this case, the up-event is the next - ;; element in the supplied vector. - (= (length key) 1)) - (and (> (length key) 1) - (eventp (setq down-ev (aref key 1))) - (memq 'down (event-modifiers down-ev)))) - (if (and (terminal-parameter nil 'xterm-mouse-mode) - (equal (terminal-parameter nil 'xterm-mouse-last-down) - down-ev)) - (aref (read-key-sequence-vector nil) 0) - (read-event))))) + (raw-seq (this-single-command-raw-keys)) + (keyn (when (> (length seq) 0) + (aref seq (1- (length seq))))) + (base (event-basic-type keyn)) + (modifiers (event-modifiers keyn))) + (cond + ((zerop (length seq))) ;FIXME: Can this happen? + ((and no-mouse-movement (eq base 'mouse-movement)) nil) + ((eq base 'help-echo) nil) + (t + (setq last-modifiers modifiers) + (push (cons seq raw-seq) key-list))))) + (nreverse key-list)) ;; Put yank-menu back as it was, if we changed it. (when saved-yank-menu (setq yank-menu (copy-sequence saved-yank-menu)) (fset 'yank-menu (cons 'keymap yank-menu)))))) -(defun help-downify-mouse-event-type (base) - "Add \"down-\" to BASE if it is not already there. -BASE is a symbol, a mouse event type. If the modification is done, -return the new symbol. Otherwise return nil." - (let ((base-s (symbol-name base))) - ;; Note: the order of the components in the following string is - ;; determined by `apply_modifiers_uncached' in src/keyboard.c. - (string-match "\\(A-\\)?\ -\\(C-\\)?\ -\\(H-\\)?\ -\\(M-\\)?\ -\\(S-\\)?\ -\\(s-\\)?\ -\\(double-\\)?\ -\\(triple-\\)?\ -\\(up-\\)?\ -\\(\\(down-\\)?\\)\ -\\(drag-\\)?" base-s) - (when (and (null (match-beginning 11)) ; "down-" - (null (match-beginning 12))) ; "drag-" - (intern (replace-match "down-" t t base-s 10)) ))) - -(defun describe-key (&optional key untranslated up-event) - "Display documentation of the function invoked by KEY. -KEY can be any kind of a key sequence; it can include keyboard events, +(defun describe-key (&optional key-list buffer up-event) + "Display documentation of the function invoked by KEY-LIST. +KEY-LIST can be any kind of a key sequence; it can include keyboard events, mouse events, and/or menu events. When calling from a program, -pass KEY as a string or a vector. - -If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events. -It can also be a number, in which case the untranslated events from -the last key sequence entered are used. -UP-EVENT is the up-event that was discarded by reading KEY, or nil. - -If KEY is a menu item or a tool-bar button that is disabled, this command -temporarily enables it to allow getting help on disabled items and buttons." - (interactive - (pcase-let ((`(,key ,up-event) (help-read-key-sequence))) - `(,key ,(prefix-numeric-value current-prefix-arg) ,up-event))) - (pcase-let ((`(,brief-desc ,defn ,event ,mouse-msg) - (help--analyze-key key untranslated)) - (defn-up nil) (defn-up-tricky nil) - (key-locus-up nil) (key-locus-up-tricky nil) - (mouse-1-remapped nil) (mouse-1-tricky nil) - (ev-type nil)) - (if (or (null defn) - (integerp defn) - (equal defn 'undefined)) - (message "%s" brief-desc) - (help-setup-xref (list #'describe-function defn) - (called-interactively-p 'interactive)) - ;; Need to do this before erasing *Help* buffer in case event - ;; is a mouse click in an existing *Help* buffer. - (when up-event - (setq ev-type (event-basic-type up-event)) - (let ((sequence (vector up-event))) - (when (and (eq ev-type 'mouse-1) - mouse-1-click-follows-link - (not (eq mouse-1-click-follows-link 'double)) - (setq mouse-1-remapped - (mouse-on-link-p (event-start up-event)))) - (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link) - (> mouse-1-click-follows-link 0))) - (cond ((stringp mouse-1-remapped) - (setq sequence mouse-1-remapped)) - ((vectorp mouse-1-remapped) - (setcar up-event (elt mouse-1-remapped 0))) - (t (setcar up-event 'mouse-2)))) - (setq defn-up (key-binding sequence nil nil (event-start up-event))) - (setq key-locus-up (help--binding-locus sequence (event-start up-event))) - (when mouse-1-tricky - (setq sequence (vector up-event)) - (aset sequence 0 'mouse-1) - (setq defn-up-tricky (key-binding sequence nil nil (event-start up-event))) - (setq key-locus-up-tricky (help--binding-locus sequence (event-start up-event)))))) +pass KEY-LIST as a list of elements (SEQ . RAW-SEQ) where SEQ is +a key-sequence and RAW-SEQ is its untranslated form. + +While reading KEY-LIST interactively, this command temporarily enables +menu items or tool-bar buttons that are disabled to allow getting help +on them. + +BUFFER is the buffer in which to lookup those keys; it defaults to the +current buffer." + (declare (advertised-calling-convention (key-list &optional buffer) "27.1")) + (interactive (list (help--read-key-sequence))) + (when (arrayp key-list) + ;; Compatibility with old calling convention. + (setq key-list (cons (list key-list) (if up-event (list up-event)))) + (when buffer + (let ((raw (if (numberp buffer) (this-single-command-raw-keys) buffer))) + (setf (cdar (last key-list)) raw))) + (setq buffer nil)) + (let* ((buf (or buffer (current-buffer))) + (on-link + (mapcar (lambda (kr) + (let ((raw (cdr kr))) + (and (not (memq mouse-1-click-follows-link '(nil double))) + (> (length raw) 0) + (eq (car-safe (aref raw 0)) 'mouse-1) + (with-current-buffer buf + (mouse-on-link-p (event-start (aref raw 0))))))) + key-list)) + (info-list + (help--filter-info-list + (with-current-buffer buf + (mapcar (lambda (x) + (pcase-let* ((`(,seq . ,raw-seq) x) + (`(,brief-desc ,defn ,event ,_mouse-msg) + (help--analyze-key seq raw-seq)) + (locus + (help--binding-locus + seq (event-start event)))) + `(,seq ,brief-desc ,defn ,locus))) + key-list)) + 2))) + (help-setup-xref (list (lambda (key-list buf) + (describe-key key-list + (if (buffer-live-p buf) buf))) + key-list buf) + (called-interactively-p 'interactive)) + (if (and (<= (length info-list) 1) + (help--binding-undefined-p (nth 2 (car info-list)))) + (message "%s" (nth 1 (car info-list))) (with-help-window (help-buffer) - (princ brief-desc) - (let ((key-locus (help--binding-locus key (event-start event)))) - (when key-locus - (princ (format " (found in %s)" key-locus)))) - (princ ", which is ") - (describe-function-1 defn) - (when (vectorp key) - (let* ((last (1- (length key))) - (elt (aref key last)) - (elt-1 (if (listp elt) (copy-sequence elt) elt)) - key-1 down-event-type) - (when (and (listp elt-1) - (symbolp (car elt-1)) - (setq down-event-type (help-downify-mouse-event-type - (car elt-1)))) - (setcar elt-1 down-event-type) - (setq key-1 (vector elt-1)) - (when (key-binding key-1) - (princ (format " - -For documentation of the corresponding mouse down event <%s>, -click and hold the mouse button longer than %s second(s)." - down-event-type (if (numberp double-click-time) - (/ double-click-time 1000.0) - 3))))))) - (when up-event - (unless (or (null defn-up) - (integerp defn-up) - (equal defn-up 'undefined)) - (princ (format " - ------------------ up-event %s---------------- - -%s%s%s runs the command %S%s, which is " - (if mouse-1-tricky "(short click) " "") - (key-description (vector up-event)) - mouse-msg - (if mouse-1-remapped - " is remapped to , which" "") - defn-up (if key-locus-up - (format " (found in %s)" key-locus-up) - ""))) - (describe-function-1 defn-up)) - (unless (or (null defn-up-tricky) - (integerp defn-up-tricky) - (eq defn-up-tricky 'undefined)) - (princ (format " - ------------------ up-event (long click) ---------------- - -Pressing <%S>%s for longer than %d milli-seconds -runs the command %S%s, which is " - ev-type mouse-msg - mouse-1-click-follows-link - defn-up-tricky (if key-locus-up-tricky - (format " (found in %s)" key-locus-up-tricky) - ""))) - (describe-function-1 defn-up-tricky))))))) + (when (> (length info-list) 1) + ;; FIXME: Make this into clickable hyperlinks. + (princ "There were several key-sequences:\n\n") + (princ (mapconcat (lambda (info) + (pcase-let ((`(,_seq ,brief-desc ,_defn ,_locus) + info)) + (concat " " brief-desc))) + info-list + "\n")) + (when (delq nil on-link) + (princ "\n\nThose are influenced by `mouse-1-click-follows-link'")) + (princ "\n\nThey're all described below.")) + (pcase-dolist (`(,_seq ,brief-desc ,defn ,locus) + info-list) + (when defn + (when (> (length info-list) 1) + (with-current-buffer standard-output + (insert "\n\n" + ;; FIXME: Can't use eval-when-compile because purified + ;; strings lose their text properties :-( + (propertize "\n" 'face '(:height 0.1 :inverse-video t)) + "\n"))) + + (princ brief-desc) + (when locus + (princ (format " (found in %s)" locus))) + (princ ", which is ") + (describe-function-1 defn))))))) (defun describe-mode (&optional buffer) "Display documentation of current major mode and minor modes. @@ -1120,7 +1059,7 @@ is currently activated with completion." ;;; Automatic resizing of temporary buffers. (defcustom temp-buffer-max-height - (lambda (buffer) + (lambda (_buffer) (if (and (display-graphic-p) (eq (selected-window) (frame-root-window))) (/ (x-display-pixel-height) (frame-char-height) 2) (/ (- (frame-height) 2) 2))) @@ -1137,7 +1076,7 @@ function is called, the window to be resized is selected." :version "24.3") (defcustom temp-buffer-max-width - (lambda (buffer) + (lambda (_buffer) (if (and (display-graphic-p) (eq (selected-window) (frame-root-window))) (/ (x-display-pixel-width) (frame-char-width) 2) (/ (- (frame-width) 2) 2))) commit fd6972ac0720bde830728254b8d791c81e01d63f Author: Michael Albinus Date: Tue Jan 30 17:34:02 2018 +0100 Fix Bug#30262 * lisp/net/tramp-archive.el (tramp-archive-hash): Document (changed) layout. (tramp-archive-dissect-file-name): Merge with `tramp-archive-local-copy', which has been removed by this. (tramp-archive-cleanup-hash): Adapt to changed `tramp-archive-hash'. (Bug#30262) * lisp/net/tramp-gvfs.el (tramp-gvfs-unmount): Flush connection properties. * test/lisp/net/tramp-archive-tests.el (tramp-archive-test01-file-name-syntax) (tramp-archive-test02-file-name-dissect) (tramp-archive-test16-directory-files) (tramp-archive-test26-file-name-completion): Adapt to changed test file. (tramp-archive-test08-file-local-copy): Be more robust in cleanup. * test/lisp/net/tramp-archive-resources/foo.tar.gz: Adapt to extended test. diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 45e3bf0a60..ac8b76b944 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -301,27 +301,42 @@ pass to the OPERATION." t)) (defvar tramp-archive-hash (make-hash-table :test 'equal) - "Hash table for archive local copies.") - -(defun tramp-archive-local-copy (archive) - "Return copy of ARCHIVE, usable by GVFS. -ARCHIVE is the archive component of an archive file name." - (setq archive (file-truename archive)) - (let ((tramp-verbose 0)) - (with-tramp-connection-property - ;; This is just an auxiliary VEC for caching properties. - (make-tramp-file-name :method tramp-archive-method :host archive) - "archive" + "Hash table for archive local copies. +The hash key is the archive name. The value is a cons of the +used `tramp-file-name' structure for tramp-gvfs, and the file +name of a local copy, if any.") + +(defun tramp-archive-dissect-file-name (name) + "Return a `tramp-file-name' structure. +The structure consists of the `tramp-archive-method' method, the +hexlified archive name as host, and the localname. The archive +name is kept in slot `hop'" + (save-match-data + (unless (tramp-archive-file-name-p name) + (tramp-compat-user-error nil "Not an archive file name: \"%s\"" name)) + ;; The `string-match' happened in `tramp-archive-file-name-p'. + (let ((archive (match-string 1 name)) + (localname (match-string 2 name)) + (tramp-verbose 0) + vec copy) + + (setq archive (file-truename archive)) + (cond + ;; The value is already in the hash table. + ((setq vec (car (gethash archive tramp-archive-hash)))) + ;; File archives inside file archives. ((tramp-archive-file-name-p archive) (let ((archive (tramp-make-tramp-file-name (tramp-archive-dissect-file-name archive) nil 'noarchive))) - ;; We call `file-attributes' in order to mount the archive. - (file-attributes archive) - (puthash archive nil tramp-archive-hash) - archive)) + (setq vec + (make-tramp-file-name + :method tramp-archive-method :hop archive + :host (url-hexify-string (tramp-gvfs-url-file-name archive))))) + (puthash archive (list vec) tramp-archive-hash)) + ;; http://... ((and url-handler-mode tramp-compat-use-url-tramp-p @@ -332,26 +347,36 @@ ARCHIVE is the archive component of an archive file name." (url-type (url-generic-parse-url archive)) url-tramp-protocols)) (archive (url-tramp-convert-url-to-tramp archive))) - (puthash archive nil tramp-archive-hash) - archive)) + (setq vec + (make-tramp-file-name + :method tramp-archive-method :hop archive + :host (url-hexify-string (tramp-gvfs-url-file-name archive))))) + (puthash archive (list vec) tramp-archive-hash)) + ;; GVFS supported schemes. ((or (tramp-gvfs-file-name-p archive) (not (file-remote-p archive))) - (puthash archive nil tramp-archive-hash) - archive) + (setq vec + (make-tramp-file-name + :method tramp-archive-method :hop archive + :host (url-hexify-string (tramp-gvfs-url-file-name archive)))) + (puthash archive (list vec) tramp-archive-hash)) + ;; Anything else. Here we call `file-local-copy', which we ;; have avoided so far. (t (let ((inhibit-file-name-operation 'file-local-copy) (inhibit-file-name-handlers - (cons 'jka-compr-handler inhibit-file-name-handlers)) - result) - (or (and (setq result (gethash archive tramp-archive-hash nil)) - (file-readable-p result)) - (puthash - archive - (setq result (file-local-copy archive)) - tramp-archive-hash)) - result)))))) + (cons 'jka-compr-handler inhibit-file-name-handlers))) + (setq copy (file-local-copy archive) + vec + (make-tramp-file-name + :method tramp-archive-method :hop archive + :host (url-hexify-string (tramp-gvfs-url-file-name copy))))) + (puthash archive (cons vec copy) tramp-archive-hash))) + + ;; So far, `vec' handles just the mount point. Add `localname'. + (setf (tramp-file-name-localname vec) localname) + vec))) ;;;###tramp-autoload (defun tramp-archive-cleanup-hash () @@ -360,16 +385,10 @@ ARCHIVE is the archive component of an archive file name." (lambda (key value) ;; Unmount local copy. (ignore-errors - (let ((tramp-gvfs-methods tramp-archive-all-gvfs-methods) - (file-archive (file-name-as-directory key))) - (tramp-message - (and (tramp-tramp-file-p key) (tramp-dissect-file-name key)) 3 - "Unmounting %s" file-archive) - (tramp-gvfs-unmount - (tramp-dissect-file-name - (tramp-archive-gvfs-file-name file-archive))))) + (tramp-message (car value) 3 "Unmounting %s" (or (cdr value) key)) + (tramp-gvfs-unmount (car value))) ;; Delete local copy. - (ignore-errors (when value (delete-file value))) + (ignore-errors (delete-file (cdr value))) (remhash key tramp-archive-hash)) tramp-archive-hash) (clrhash tramp-archive-hash)) @@ -380,24 +399,6 @@ ARCHIVE is the archive component of an archive file name." (remove-hook 'kill-emacs-hook 'tramp-archive-cleanup-hash))) -(defun tramp-archive-dissect-file-name (name) - "Return a `tramp-file-name' structure. -The structure consists of the `tramp-archive-method' method, the -hexlified archive name as host, and the localname. The archive -name is kept in slot `hop'" - (save-match-data - (unless (tramp-archive-file-name-p name) - (tramp-compat-user-error nil "Not an archive file name: \"%s\"" name)) - ;; The `string-match' happened in `tramp-archive-file-name-p'. - (let ((archive (match-string 1 name)) - (localname (match-string 2 name)) - (tramp-verbose 0)) - (make-tramp-file-name - :method tramp-archive-method :user nil :domain nil :host - (url-hexify-string - (tramp-gvfs-url-file-name (tramp-archive-local-copy archive))) - :port nil :localname localname :hop archive)))) - (defsubst tramp-file-name-archive (vec) "Extract the archive file name from VEC. VEC is expected to be a `tramp-file-name', with the method being diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 6745ae02c7..70ac077a7c 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1778,13 +1778,16 @@ file-notify events." (defun tramp-gvfs-unmount (vec) "Unmount the object identified by VEC." - (let ((vec (copy-tramp-file-name vec))) - (setf (tramp-file-name-localname vec) "/" - (tramp-file-name-hop vec) nil) - (when (tramp-gvfs-connection-mounted-p vec) - (tramp-gvfs-send-command - vec "gvfs-mount" "-u" - (tramp-gvfs-url-file-name (tramp-make-tramp-file-name vec)))))) + (setf (tramp-file-name-localname vec) "/" + (tramp-file-name-hop vec) nil) + (when (tramp-gvfs-connection-mounted-p vec) + (tramp-gvfs-send-command + vec "gvfs-mount" "-u" + (tramp-gvfs-url-file-name (tramp-make-tramp-file-name vec)))) + (while (tramp-gvfs-connection-mounted-p vec) + (read-event nil nil 0.1)) + (tramp-flush-connection-properties vec) + (tramp-flush-connection-properties (tramp-get-connection-process vec))) (defun tramp-gvfs-mount-spec-entry (key value) "Construct a mount-spec entry to be used in a mount_spec. diff --git a/test/lisp/net/tramp-archive-resources/foo.tar.gz b/test/lisp/net/tramp-archive-resources/foo.tar.gz index 68925b147f..0d2e9878dd 100644 Binary files a/test/lisp/net/tramp-archive-resources/foo.tar.gz and b/test/lisp/net/tramp-archive-resources/foo.tar.gz differ diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 149ed37043..82dd5de8b9 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -99,9 +99,9 @@ variables, so we check the Emacs version directly." (tramp-archive-file-name-p (concat tramp-archive-test-archive "foo/bar"))) ;; A file archive inside a file archive. (should - (tramp-archive-file-name-p (concat tramp-archive-test-archive "foo.tar"))) + (tramp-archive-file-name-p (concat tramp-archive-test-archive "baz.tar"))) (should - (tramp-archive-file-name-p (concat tramp-archive-test-archive "foo.tar/")))) + (tramp-archive-file-name-p (concat tramp-archive-test-archive "baz.tar/")))) (ert-deftest tramp-archive-test02-file-name-dissect () "Check archive file name components." @@ -145,13 +145,14 @@ variables, so we check the Emacs version directly." ;; File archive in file archive. (let* ((tramp-archive-test-file-archive - (concat tramp-archive-test-archive "bar.tar")) + (concat tramp-archive-test-archive "baz.tar")) (tramp-archive-test-archive (file-name-as-directory tramp-archive-test-file-archive)) (tramp-methods (cons `(,tramp-archive-method) tramp-methods)) (tramp-gvfs-methods tramp-archive-all-gvfs-methods)) (unwind-protect - (with-parsed-tramp-archive-file-name tramp-archive-test-archive nil + (with-parsed-tramp-archive-file-name + (expand-file-name "bar" tramp-archive-test-archive) nil (should (string-equal method tramp-archive-method)) (should-not user) (should-not domain) @@ -184,8 +185,12 @@ variables, so we check the Emacs version directly." nil "/")) (file-name-nondirectory tramp-archive-test-file-archive))))) (should-not port) - (should (string-equal localname "/")) - (should (string-equal archive tramp-archive-test-file-archive))) + (should (string-equal localname "/bar")) + ;; The `archive' component is now already a Tramp file name. + (should + (string-equal + archive + (tramp-archive-gvfs-file-name tramp-archive-test-file-archive)))) ;; Cleanup. (tramp-archive-cleanup-hash)))) @@ -290,9 +295,8 @@ This checks also `file-name-as-directory', `file-name-directory', :type tramp-file-missing)) ;; Cleanup. - (ignore-errors - (tramp-archive--test-delete tmp-name) - (tramp-archive-cleanup-hash))))) + (ignore-errors (tramp-archive--test-delete tmp-name)) + (tramp-archive-cleanup-hash)))) (ert-deftest tramp-archive-test09-insert-file-contents () "Check `insert-file-contents'." @@ -444,7 +448,7 @@ This checks also `file-name-as-directory', `file-name-directory', (skip-unless tramp-gvfs-enabled) (let ((tmp-name tramp-archive-test-archive) - (files '("." ".." "bar" "foo.hrd" "foo.lnk" "foo.txt"))) + (files '("." ".." "bar" "baz.tar" "foo.hrd" "foo.lnk" "foo.txt"))) (unwind-protect (progn (should (file-directory-p tmp-name)) @@ -656,7 +660,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." ;; Local files. (should (equal (file-name-completion "fo" tmp-name) "foo.")) (should (equal (file-name-completion "foo.txt" tmp-name) t)) - (should (equal (file-name-completion "b" tmp-name) "bar/")) + (should (equal (file-name-completion "b" tmp-name) "ba")) (should-not (file-name-completion "a" tmp-name)) (should (equal @@ -668,18 +672,18 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (should (equal (sort (file-name-all-completions "b" tmp-name) 'string-lessp) - '("bar/"))) + '("bar/" "baz.tar"))) (should-not (file-name-all-completions "a" tmp-name)) ;; `completion-regexp-list' restricts the completion to ;; files which match all expressions in this list. (let ((completion-regexp-list `(,directory-files-no-dot-files-regexp "b"))) (should - (equal (file-name-completion "" tmp-name) "bar/")) + (equal (file-name-completion "" tmp-name) "ba")) (should (equal (sort (file-name-all-completions "" tmp-name) 'string-lessp) - '("bar/"))))) + '("bar/" "baz.tar"))))) ;; Cleanup. (tramp-archive-cleanup-hash)))) commit 084cfae0e624469ebca78b155ffe4e2c20f2b205 Merge: 84055bda91 bc8dc37f1c Author: Glenn Morris Date: Tue Jan 30 07:50:25 2018 -0800 Merge from origin/emacs-26 bc8dc37 (origin/emacs-26) Minor copyedits in "Distribution" chapter o... 1c7a936 Minor copyedits in "Entering" chapter of Emacs manual. 1d4498b Minor wording change in the Emacs manual 2bf49e7 Fix a typo in the Emacs manual f3546a2 Improve the "Basic" chapter of the Emacs manual 691431e Resurrect lost text in lispref 956807b * lisp/emacs-lisp/rx.el (rx): Fix the definition of 'blank'. 7d90d2e Proofread os.texi and files.texi 490c736 Minor improvements in the "International" chapter of Emacs ma... 79252d3 Minor improvement in "Text" chapter of Emacs manual commit bc8dc37f1cd6dcede1f5f409a3aeb8fb345d642e Author: Eli Zaretskii Date: Tue Jan 30 17:30:26 2018 +0200 Minor copyedits in "Distribution" chapter of the Emacs manual * doc/emacs/emacs.texi (Distrib): Minor wording changes. Suggested by oldgaro in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 09817080c5..5904740b1f 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -1345,7 +1345,7 @@ for documentation. @xref{GNU Free Documentation License}.}. @xref{Copying}. One way to get a copy of GNU Emacs is from someone else who has it. -You need not ask for our permission to do so, or tell any one else; +You need not ask for our permission to do so, or tell anyone else; just copy it. If you have access to the Internet, you can get the latest distribution version of GNU Emacs by anonymous FTP; see @url{https://www.gnu.org/software/emacs} on our website for more @@ -1361,7 +1361,7 @@ when you get it, not just free for the manufacturer. If you find GNU Emacs useful, please @strong{send a donation} to the Free Software Foundation to support our work. Donations to the Free -Software Foundation are tax deductible in the US@. If you use GNU Emacs +Software Foundation are tax-deductible in the US@. If you use GNU Emacs at your workplace, please suggest that the company make a donation. To donate, see @url{https://my.fsf.org/donate/}. For other ways in which you can help, see commit 1c7a936a947cbcf329042e5eb78be2eaf506ab9b Author: Eli Zaretskii Date: Tue Jan 30 17:20:14 2018 +0200 Minor copyedits in "Entering" chapter of Emacs manual. * doc/emacs/entering.texi (Entering Emacs): Add a cross-reference to MS-Windows startup procedures. Clarify wording. Suggested by Francis Wright in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/entering.texi b/doc/emacs/entering.texi index de0d781809..2ff258ffb0 100644 --- a/doc/emacs/entering.texi +++ b/doc/emacs/entering.texi @@ -18,10 +18,11 @@ @cindex starting Emacs The usual way to invoke Emacs is with the shell command -@command{emacs}. From a terminal window running in the X Window -System, you can run Emacs in the background with @command{emacs &}; -this way, Emacs won't tie up the terminal window, so you can use it to -run other shell commands. +@command{emacs}. From a terminal window running a Unix shell in the X +Window System, you can run Emacs in the background with @command{emacs +&}; this way, Emacs won't tie up the terminal window, so you can use +it to run other shell commands. (For comparable methods of starting +Emacs on MS-Windows, see @ref{Windows Startup}.) @cindex startup screen When Emacs starts up, the initial frame displays a special buffer commit 1d4498b57030ee0dbf9adf809363f9524f0c5562 Author: Eli Zaretskii Date: Tue Jan 30 17:04:12 2018 +0200 Minor wording change in the Emacs manual * doc/emacs/screen.texi (Screen): Minor wording change. Suggested by Wesley Ellis in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi index d00b74fa65..fb4eff9711 100644 --- a/doc/emacs/screen.texi +++ b/doc/emacs/screen.texi @@ -18,7 +18,7 @@ frames if you wish (@pxref{Frames}). Each frame consists of several distinct regions. At the top of the frame is a @dfn{menu bar}, which allows you to access commands via a series of menus. On a graphical display, directly below the menu bar -is a @dfn{tool bar}, a row of icons that perform editing commands if +is a @dfn{tool bar}, a row of icons that perform editing commands when you click on them. At the very bottom of the frame is an @dfn{echo area}, where informative messages are displayed and where you enter information when Emacs asks for it. commit 84055bda91d48dd603110b0805560cf1df205a83 Author: Stefan Monnier Date: Tue Jan 30 09:55:09 2018 -0500 * lisp/subr.el (atomic-change-group): Fix return value Suggested by Jarosław Rzeszótko . diff --git a/lisp/subr.el b/lisp/subr.el index 24bd28839f..00bab70e8a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2586,7 +2586,7 @@ is nil and `use-dialog-box' is non-nil." ;;; Atomic change groups. (defmacro atomic-change-group (&rest body) - "Perform BODY as an atomic change group. + "Like `progn' but perform BODY as an atomic change group. This means that if BODY exits abnormally, all of its changes to the current buffer are undone. This works regardless of whether undo is enabled in the buffer. @@ -2609,8 +2609,8 @@ user can undo the change normally." ;; it enables undo if that was disabled; we need ;; to make sure that it gets disabled again. (activate-change-group ,handle) - ,@body - (setq ,success t)) + (prog1 ,(macroexp-progn body) + (setq ,success t))) ;; Either of these functions will disable undo ;; if it was disabled before. (if ,success commit 2bf49e7a26861ba4f721eb81df8a18b114e8656e Author: Eli Zaretskii Date: Tue Jan 30 16:53:25 2018 +0200 Fix a typo in the Emacs manual * doc/emacs/custom.texi (Customization Groups): Fix a typo. Reported by Jonathan Kyle Mitchell in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index c58cc7ebd7..5b2ab8280d 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -127,7 +127,7 @@ brings up the customization buffer for that group. @kindex S-TAB @r{(customization buffer)} @findex widget-forward @findex widget-backward - In the customizable buffer, you can type @key{TAB} + In the customization buffer, you can type @key{TAB} (@code{widget-forward}) to move forward to the next button or editable field. @kbd{S-@key{TAB}} (@code{widget-backward}) moves back to the previous button or editable field. commit f3546a248509c74db1cc004e45216273d8c35166 Author: Eli Zaretskii Date: Tue Jan 30 16:31:27 2018 +0200 Improve the "Basic" chapter of the Emacs manual * doc/emacs/basic.texi (Inserting Text): De-confuse text. (Position Info): Add a cross-reference to where display-line-numbers-mode is described. Reported by Joshua Branson in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index b59ccf6ccf..edb3d08f68 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -131,12 +131,6 @@ Unicode), or a number with a specified radix, e.g., @code{#o23072} Manual}. The command then inserts the corresponding character into the buffer. - In some contexts, if you type a quotation using grave accent and -apostrophe @t{`like this'}, it is converted to a form @t{‘like this’} -using single quotation marks. Similarly, typing a quotation @t{``like -this''} using double grave accent and apostrophe converts it to a form -@t{“like this”} using double quotation marks. @xref{Quotation Marks}. - For example, the following all insert the same character: @example @@ -151,6 +145,13 @@ this''} using double grave accent and apostrophe converts it to a form A numeric argument to @kbd{C-q} or @kbd{C-x 8 ...} specifies how many copies of the character to insert (@pxref{Arguments}). + In addition, in some contexts, if you type a quotation using grave +accent and apostrophe @t{`like this'}, it is converted to a form +@t{‘like this’} using single quotation marks, even without @kbd{C-x 8} +commands. Similarly, typing a quotation @t{``like this''} using +double grave accent and apostrophe converts it to a form @t{“like +this”} using double quotation marks. @xref{Quotation Marks}. + @node Moving Point @section Changing the Location of Point @@ -711,6 +712,9 @@ where the two extra numbers give the smallest and largest character position that point is allowed to assume. The characters between those two positions are the accessible ones. @xref{Narrowing}. + Related, but different feature is @code{display-line-numbers-mode} +(@pxref{Display Custom}). + @node Arguments @section Numeric Arguments @cindex numeric arguments commit 691431eb09a18f9e677ee6064bdeedf35ab3e1c4 Author: Eli Zaretskii Date: Tue Jan 30 15:13:18 2018 +0200 Resurrect lost text in lispref * doc/lispref/files.texi (File Attributes): Resurrect inadvertently lost text. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 88c9d1f318..a5d0f9bda3 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1299,7 +1299,8 @@ The time of last access, as a list of four integers (@code{file-attribute-access-time}). (This is similar to the value of @code{current-time}; see @ref{Time of Day}.) The value is truncated to that of the filesystem's timestamp resolution; for example, on some -FAT-based filesystems, only the date of last access is recorded. +FAT-based filesystems, only the date of last access is recorded, so +this time will always hold the midnight of the day of the last access. @cindex modification time of file @item commit 956807bd1fc2d102714282fdfbb8d2a549dc8e17 Author: Philipp Stephani Date: Tue Jan 30 00:05:58 2018 +0100 * lisp/emacs-lisp/rx.el (rx): Fix the definition of 'blank'. diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 37aa25b556..c4f6d4f70e 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -57,7 +57,6 @@ ;; (rx (and line-start (0+ (in "a-z")))) ;; ;; "\n[^ \t]" -;; (rx (and "\n" (not blank))), or ;; (rx (and "\n" (not (any " \t")))) ;; ;; "\\*\\*\\* EOOH \\*\\*\\*\n" @@ -74,9 +73,9 @@ ;; "^content-transfer-encoding:\\(\n?[\t ]\\)*quoted-printable\\(\n?[\t ]\\)*" ;; (rx (and line-start ;; "content-transfer-encoding:" -;; (+ (? ?\n)) blank +;; (+ (? ?\n)) (any " \t") ;; "quoted-printable" -;; (+ (? ?\n)) blank)) +;; (+ (? ?\n)) (any " \t")) ;; ;; (concat "^\\(?:" something-else "\\)") ;; (rx (and line-start (eval something-else))), statically or @@ -962,7 +961,11 @@ CHAR matches 0 through 9, a through f and A through F. `blank' - matches space and tab only. + matches horizontal whitespace, as defined by Annex C of the + Unicode Technical Standard #18. In particular, it matches + spaces, tabs, and other characters whose Unicode + `general-category' property indicates they are spacing + separators. `graphic', `graph' matches graphic characters--everything except whitespace, ASCII commit 7d90d2ece041630e0c440a2b0216e43f82729844 Author: Paul Eggert Date: Mon Jan 29 10:35:53 2018 -0800 Proofread os.texi and files.texi diff --git a/doc/emacs/msdos-xtra.texi b/doc/emacs/msdos-xtra.texi index 43dc2654a6..541e29aa25 100644 --- a/doc/emacs/msdos-xtra.texi +++ b/doc/emacs/msdos-xtra.texi @@ -380,7 +380,7 @@ using an actual directory named @file{/dev} on any disk. (@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}) @end ifnottex can work on MS-DOS by sending the output to one of the printer ports, -if a Posix-style @code{lpr} program is unavailable. The same Emacs +if a POSIX-style @code{lpr} program is unavailable. The same Emacs variables control printing on all systems, but in some cases they have different default values on MS-DOS. @@ -567,7 +567,7 @@ asynchronous invocation on other platforms Instead of the Shell mode, which doesn't work on MS-DOS, you can use the @kbd{M-x eshell} command. This invokes the Eshell package that -implements a Posix-like shell entirely in Emacs Lisp. +implements a POSIX-like shell entirely in Emacs Lisp. By contrast, Emacs compiled as a native Windows application @strong{does} support asynchronous subprocesses. diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi index 25c3a567ed..9c47f47a73 100644 --- a/doc/emacs/msdos.texi +++ b/doc/emacs/msdos.texi @@ -129,7 +129,7 @@ window. @xref{emacsclient Options}. @cindex text and binary files on MS-DOS/MS-Windows GNU Emacs uses newline characters to separate text lines. This is the -convention used on GNU, Unix, and other Posix-compliant systems. +convention used on GNU, Unix, and other POSIX-compliant systems. @cindex end-of-line conversion on MS-DOS/MS-Windows By contrast, MS-DOS and MS-Windows normally use carriage-return linefeed, @@ -770,7 +770,7 @@ more details. Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and @code{ps-print-buffer} (@pxref{PostScript}) work in MS-DOS and MS-Windows by sending the output to one of the printer ports, if a -Posix-style @code{lpr} program is unavailable. The same Emacs +POSIX-style @code{lpr} program is unavailable. The same Emacs variables control printing on all systems, but in some cases they have different default values on MS-DOS and MS-Windows. diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index 05114c376c..2edeb05f9e 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -806,7 +806,7 @@ stimulates the bug. @item If non-@acronym{ASCII} text or internationalization is relevant, the locale that was current when you started Emacs. On GNU/Linux and Unix systems, or -if you use a Posix-style shell such as Bash, you can use this shell +if you use a POSIX-style shell such as Bash, you can use this shell command to view the relevant values: @smallexample diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 162fc1eb1e..88c9d1f318 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1170,14 +1170,14 @@ Sometimes file names or their parts need to be compared as strings, in which case it's important to know whether the underlying filesystem is case-insensitive. This function returns @code{t} if file @var{filename} is on a case-insensitive filesystem. It always returns -@code{t} on MS-DOS and MS-Windows. On Cygwin and Mac OS X, +@code{t} on MS-DOS and MS-Windows. On Cygwin and macOS, filesystems may or may not be case-insensitive, and the function tries to determine case-sensitivity by a runtime test. If the test is inconclusive, the function returns @code{t} on Cygwin and @code{nil} -on Mac OS X. +on macOS. Currently this function always returns @code{nil} on platforms other -than MS-DOS, MS-Windows, Cygwin, and Mac OS X. It does not detect +than MS-DOS, MS-Windows, Cygwin, and macOS. It does not detect case-insensitivity of mounted filesystems, such as Samba shares or NFS-mounted Windows volumes. On remote hosts, it assumes @code{t} for the @samp{smb} method. For all other connection methods, runtime @@ -1297,9 +1297,9 @@ The file's @acronym{GID}, likewise (@code{file-attribute-group-id}). The time of last access, as a list of four integers @code{(@var{sec-high} @var{sec-low} @var{microsec} @var{picosec})} (@code{file-attribute-access-time}). (This is similar to the value of -@code{current-time}; see @ref{Time of Day}.) Note that on some -FAT-based filesystems, only the date of last access is recorded, so -this time will always hold the midnight of the day of last access. +@code{current-time}; see @ref{Time of Day}.) The value is truncated +to that of the filesystem's timestamp resolution; for example, on some +FAT-based filesystems, only the date of last access is recorded. @cindex modification time of file @item diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 92b7e864ab..80b75729c1 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -1151,7 +1151,7 @@ extension, a.k.a.@: ``suffix''. This suffix is platform-dependent. @defvar module-file-suffix This variable holds the system-dependent value of the file-name -extension of the module files. Its value is @file{.so} on Posix hosts +extension of the module files. Its value is @file{.so} on POSIX hosts and @file{.dll} on MS-Windows. @end defvar diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 1a4e2db44a..9352a929a7 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -257,7 +257,7 @@ options were specified. @item If a daemon was requested, it calls @code{server-start}. -(On Posix systems, if a background daemon was requested, it then +(On POSIX systems, if a background daemon was requested, it then detaches from the controlling terminal.) @xref{Emacs Server,,, emacs, The GNU Emacs Manual}. @@ -888,7 +888,7 @@ IBM's AIX. Berkeley BSD and its variants. @item cygwin -Cygwin, a Posix layer on top of MS-Windows. +Cygwin, a POSIX layer on top of MS-Windows. @item darwin Darwin (macOS). @@ -1325,13 +1325,13 @@ omitted or @code{nil}, the conversion uses Emacs's default time zone. If it is @code{t}, the conversion uses Universal Time. If it is @code{wall}, the conversion uses the system wall clock time. If it is a string, the conversion uses the time zone rule equivalent to setting -@env{TZ} to that string. If it is an integer @var{offset}, the -conversion uses a fixed time zone with the given offset and a numeric -abbreviation on POSIX-compatible platforms and an unspecified abbreviation -on MS-Windows. If it is a list (@var{offset} @var{abbr}), where +@env{TZ} to that string. If it is a list (@var{offset} @var{abbr}), where @var{offset} is an integer number of seconds east of Universal Time and @var{abbr} is a string, the conversion uses a fixed time zone with -the given offset and abbreviation. +the given offset and abbreviation. An integer @var{offset} is treated +as if it were (@var{offset} @var{abbr}), where @var{abbr} is a numeric +abbreviation on POSIX-compatible platforms and is unspecified on +MS-Windows. @defun current-time-zone &optional time zone @cindex time zone, current @@ -1488,6 +1488,7 @@ This is a synonym for @samp{%x %X}. @item %C This stands for the century, that is, the year divided by 100, truncated toward zero. +The default field width is 2. @item %d This stands for the day of month, zero-padded. @item %D @@ -2398,7 +2399,7 @@ Emacs is restarted by the session manager. Emacs is able to send @dfn{notifications} on systems that support the freedesktop.org Desktop Notifications Specification and on MS-Windows. -In order to use this functionality on Posix hosts, Emacs must have +In order to use this functionality on POSIX hosts, Emacs must have been compiled with D-Bus support, and the @code{notifications} library must be loaded. @xref{Top, , D-Bus,dbus,D-Bus integration in Emacs}. The following function is supported when D-Bus support is available: diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index a25a5bfe84..bd7dc2d9af 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -344,7 +344,7 @@ When reading or writing from the standard input/output streams of the Emacs process in batch mode, it is sometimes required to make sure any arbitrary binary data will be read/written verbatim, and/or that no translation of newlines to or from CR-LF pairs is performed. This -issue does not exist on Posix hosts, only on MS-Windows and MS-DOS@. +issue does not exist on POSIX hosts, only on MS-Windows and MS-DOS@. The following function allows you to control the I/O mode of any standard stream of the Emacs process. @@ -354,7 +354,7 @@ non-@code{nil}, switch to binary mode, otherwise switch to text mode. The value of @var{stream} can be one of @code{stdin}, @code{stdout}, or @code{stderr}. This function flushes any pending output data of @var{stream} as a side effect, and returns the previous value of I/O -mode for @var{stream}. On Posix hosts, it always returns a +mode for @var{stream}. On POSIX hosts, it always returns a non-@code{nil} value and does nothing except flushing pending output. @end defun @@ -707,7 +707,7 @@ indent and fill the object to make it more readable for humans. If you need to use binary I/O in batch mode, e.g., use the functions described in this section to write out arbitrary binary data or avoid -conversion of newlines on non-Posix hosts, see @ref{Input Functions, +conversion of newlines on non-POSIX hosts, see @ref{Input Functions, set-binary-mode}. @node Output Variables diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 1144f2843c..40b16b0f3c 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -29128,7 +29128,7 @@ the X window system or MS-Windows, Calc will configure GNUPLOT for you automatically. If you have GNUPLOT 3.0 or later and you are using a Unix or GNU system without X, Calc will configure GNUPLOT to display graphs using simple character graphics that will work on any -Posix-compatible terminal. +POSIX-compatible terminal. @menu * Basic Graphics:: diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 37a9648bfb..6d152970fe 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -6752,7 +6752,7 @@ applying it to another one. @vindex org-clock-idle-time By customizing the variable @code{org-clock-idle-time} to some integer, such as 10 or 15, Emacs can alert you when you get back to your computer after -being idle for that many minutes@footnote{On computers using Mac OS X, +being idle for that many minutes@footnote{On computers using macOS, idleness is based on actual user idleness, not just Emacs' idle time. For X11, you can install a utility program @file{x11idle.c}, available in the @code{contrib/scripts} directory of the Org git distribution, or install the commit 490c73601310231de7c49eac040ae89bf11c7bf1 Author: Eli Zaretskii Date: Mon Jan 29 19:47:50 2018 +0200 Minor improvements in the "International" chapter of Emacs manual * doc/emacs/mule.texi (File Name Coding): Stop enumerating all the versions of MS-Windows. (Modifying Fontsets, Unibyte Mode, Bidirectional Editing): Improve wording. Reported by Francis Wright in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index fd25604c70..4989982eca 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -1207,13 +1207,13 @@ using the internal Emacs representation. @cindex file-name encoding, MS-Windows @vindex w32-unicode-filenames When Emacs runs on MS-Windows versions that are descendants of the -NT family (Windows 2000, XP, Vista, Windows 7, and Windows 8), the -value of @code{file-name-coding-system} is largely ignored, as Emacs -by default uses APIs that allow passing Unicode file names directly. -By contrast, on Windows 9X, file names are encoded using -@code{file-name-coding-system}, which should be set to the codepage -(@pxref{Coding Systems, codepage}) pertinent for the current system -locale. The value of the variable @code{w32-unicode-filenames} +NT family (Windows 2000, XP, Vista, Windows 7, and all the later +versions), the value of @code{file-name-coding-system} is largely +ignored, as Emacs by default uses APIs that allow passing Unicode file +names directly. By contrast, on Windows 9X, file names are encoded +using @code{file-name-coding-system}, which should be set to the +codepage (@pxref{Coding Systems, codepage}) pertinent for the current +system locale. The value of the variable @code{w32-unicode-filenames} controls whether Emacs uses the Unicode APIs when it calls OS functions that accept file names. This variable is set by the startup code to @code{nil} on Windows 9X, and to @code{t} on newer versions of @@ -1570,9 +1570,9 @@ used. Some examples are: unpleasant results for characters for which they are used, and you may wish to instruct Emacs to completely ignore them while searching for a suitable font required to display a character. You can do that by -adding the offending fonts to the value of @code{face-ignored-fonts} -variable, which is a list. Here's an example to put in your -@file{~/.emacs}: +adding the offending fonts to the value of the variable +@code{face-ignored-fonts}, which is a list. Here's an example to put +in your @file{~/.emacs}: @example (add-to-list 'face-ignored-fonts "Some Bad Font") @@ -1673,10 +1673,10 @@ should use the command @kbd{M-x set-keyboard-coding-system} or customize the variable @code{keyboard-coding-system} to specify which coding system your keyboard uses (@pxref{Terminal Coding}). Enabling this feature will probably require you to use @key{ESC} to type Meta -characters; however, on a console terminal or in @code{xterm}, you can -arrange for Meta to be converted to @key{ESC} and still be able to -type 8-bit characters present directly on the keyboard or using -@key{Compose} or @key{AltGr} keys. @xref{User Input}. +characters; however, on a console terminal or a terminal emulator such +as @code{xterm}, you can arrange for Meta to be converted to @key{ESC} +and still be able to type 8-bit characters present directly on the +keyboard or using @key{Compose} or @key{AltGr} keys. @xref{User Input}. @cindex @code{iso-transl} library @cindex compose character @@ -1777,13 +1777,13 @@ for editing bidirectional text. @dfn{logical} (or @dfn{reading}) order: the buffer or string position of the first character you read precedes that of the next character. Reordering of bidirectional text into the @dfn{visual} order happens -at display time. As result, character positions no longer increase +at display time. As a result, character positions no longer increase monotonically with their positions on display. Emacs implements the Unicode Bidirectional Algorithm (UBA) described in the Unicode Standard Annex #9, for reordering of bidirectional text for display. It deviates from the UBA only in how continuation lines are displayed when text direction is opposite to the base paragraph direction, -e.g. when a long line of English text appears in a right-to-left +e.g., when a long line of English text appears in a right-to-left paragraph. @vindex bidi-display-reordering @@ -1835,12 +1835,13 @@ thin blank characters; on text terminals they display as blanks. Because characters are reordered for display, Emacs commands that operate in the logical order or on stretches of buffer positions may -produce unusual effects. For example, @kbd{C-f} and @kbd{C-b} -commands move point in the logical order, so the cursor will sometimes -jump when point traverses reordered bidirectional text. Similarly, a -highlighted region covering a contiguous range of character positions -may look discontinuous if the region spans reordered text. This is -normal and similar to the behavior of other programs that support -bidirectional text. If you set @code{visual-order-cursor-movement} to -a non-@code{nil} value, cursor motion by the arrow keys follows the -visual order on screen (@pxref{Moving Point, visual-order movement}). +produce unusual effects. For example, the commands @kbd{C-f} and +@kbd{C-b} move point in the logical order, so the cursor will +sometimes jump when point traverses reordered bidirectional text. +Similarly, a highlighted region covering a contiguous range of +character positions may look discontinuous if the region spans +reordered text. This is normal and similar to the behavior of other +programs that support bidirectional text. If you set +@code{visual-order-cursor-movement} to a non-@code{nil} value, cursor +motion by the arrow keys follows the visual order on screen +(@pxref{Moving Point, visual-order movement}). commit 79252d31274990483c0104c51fb36bf6807b475e Author: Eli Zaretskii Date: Mon Jan 29 18:39:04 2018 +0200 Minor improvement in "Text" chapter of Emacs manual * doc/emacs/text.texi (Words): Improve wording. Reported by Marcin Borkowski in http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00784.html. diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 969548d38e..e3541a18df 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -101,7 +101,7 @@ Kill up to the end of a word (@code{kill-word}). @item M-@key{DEL} Kill back to the beginning of a word (@code{backward-kill-word}). @item M-@@ -Mark the end of the next word (@code{mark-word}). +Set mark at the end of the next word (@code{mark-word}). @item M-t Transpose two words or drag a word across others (@code{transpose-words}).