commit fc9dc032906d840f63d29fbdcfd25e36ca3451b8 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Sat Sep 12 10:37:32 2015 +0200 Fix tests in file-notify-tests.el * test/automated/file-notify-tests.el: Remove Tramp declarations. (file-notify-test00-availability): Print remote command w/o Tramp internal functions. (file-notify-test02-events, file-notify-test02-events-remote): Adapt docstring. (file-notify-test03-autorevert): Use `format-message' when inspecting *Messages* buffer. diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 99b0ebc..18e1b93 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -39,9 +39,6 @@ (require 'filenotify) (require 'tramp) -(declare-function tramp-get-remote-gvfs-monitor-dir "tramp-sh") -(declare-function tramp-get-remote-inotifywait "tramp-sh") - ;; There is no default value on w32 systems, which could work out of the box. (defconst file-notify-test-remote-temporary-file-directory (cond @@ -140,22 +137,12 @@ being the result.") "Test availability of `file-notify'." (skip-unless (file-notify--test-local-enabled)) ;; Report the native library which has been used. - (message - "%s library: `%s'" - (if (null (file-remote-p temporary-file-directory)) "Local" "Remote") - (if (null (file-remote-p temporary-file-directory)) - file-notify--library - ;; FIXME: This is rude, using Tramp internal functions. Maybe - ;; the upcoming `file-notify-available-p' could return the used - ;; native library. - (with-parsed-tramp-file-name temporary-file-directory nil - (cond - ;; gvfs-monitor-dir. - ((tramp-get-remote-gvfs-monitor-dir v) 'gfilenotify) - ;; inotifywait. - ((tramp-get-remote-inotifywait v) 'inotify) - ;; None. - (t (ert-fail "No remote library available")))))) + (if (null (file-remote-p temporary-file-directory)) + (message "Local library: `%s'" file-notify--library) + (message "Remote command: `%s'" + (replace-regexp-in-string + "<[[:digit:]]+>\\'" "" + (process-name (cdr file-notify--test-remote-enabled-checked))))) (should (setq file-notify--test-desc (file-notify-add-watch temporary-file-directory '(change) 'ignore))) @@ -261,7 +248,7 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." (setq file-notify--test-events ,outer)))) (ert-deftest file-notify-test02-events () - "Check file creation/removal notifications." + "Check file creation/change/removal notifications." (skip-unless (file-notify--test-local-enabled)) (unwind-protect (progn @@ -317,11 +304,12 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." (dolist (result file-notify--test-results) ;;(message "%s" (ert-test-result-messages result)) (when (ert-test-failed-p result) - (ert-fail (cadr (ert-test-result-with-condition-condition result)))))) + (ert-fail + (cadr (ert-test-result-with-condition-condition result)))))) (file-notify--test-cleanup))) (file-notify--deftest-remote file-notify-test02-events - "Check file creation/removal notifications for remote files.") + "Check file creation/change/removal notifications for remote files.") (require 'autorevert) (setq auto-revert-notify-exclude-dir-regexp "nothing-to-be-excluded" @@ -371,8 +359,9 @@ This test is skipped in batch mode." (with-current-buffer (get-buffer-create "*Messages*") (file-notify--wait-for-events timeout - (string-match (format "Reverting buffer `%s'." (buffer-name buf)) - (buffer-string)))) + (string-match + (format-message "Reverting buffer `%s'." (buffer-name buf)) + (buffer-string)))) (should (string-match "another text" (buffer-string))))) ;; Exit. commit 166812addb0a1b9b2258ef3ce76424cd7facfa8b Author: Stefan Monnier Date: Sat Sep 12 00:30:02 2015 -0400 Bind inhibit-modification-hooks rather than a/b-c-f * lisp/wid-edit.el (widget-editable-list-insert-before) (widget-editable-list-delete-at): * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres) (cperl-font-lock-unfontify-region-function): * lisp/progmodes/antlr-mode.el (save-buffer-state-x): * lisp/obsolete/longlines.el (longlines-mode): * lisp/obsolete/fast-lock.el (save-buffer-state): * lisp/mouse.el (mouse-save-then-kill-delete-region): * lisp/gnus/message.el (message-hide-headers): * lisp/eshell/esh-mode.el (eshell-send-input, eshell-output-filter): * lisp/ibuffer.el (ibuffer-update-title-and-summary) (ibuffer-redisplay-engine): Bind inhibit-modification-hooks to t rather than after/before-change-functions to nil. diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 22ccf4e..3df820d 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -627,10 +627,11 @@ newline." (let ((proc-running-p (and (eshell-interactive-process) (not queue-p))) (inhibit-point-motion-hooks t) - after-change-functions) + (inhibit-modification-hooks t)) (unless (and proc-running-p (not (eq (process-status - (eshell-interactive-process)) 'run))) + (eshell-interactive-process)) + 'run))) (if (or proc-running-p (>= (point) eshell-last-output-end)) (goto-char (point-max)) @@ -697,7 +698,7 @@ This is done after all necessary filtering has been done." (let ((oprocbuf (if process (process-buffer process) (current-buffer))) (inhibit-point-motion-hooks t) - after-change-functions) + (inhibit-modification-hooks t)) (let ((functions eshell-preoutput-filter-functions)) (while (and functions string) (setq string (funcall (car functions) string)) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 5ede15b..13ed8c0 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8329,7 +8329,7 @@ From headers in the original article." (list message-hidden-headers) message-hidden-headers)) (inhibit-point-motion-hooks t) - (after-change-functions nil) + (inhibit-modification-hooks t) (end-of-headers (point-min))) (when regexps (save-excursion diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 718471b..dc34a63 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -2037,7 +2037,7 @@ the value of point at the beginning of the line for that buffer." (defun ibuffer-update-title-and-summary (format) (ibuffer-assert-ibuffer-mode) ;; Don't do funky font-lock stuff here - (let ((after-change-functions nil)) + (let ((inhibit-modification-hooks t)) (if (get-text-property (point-min) 'ibuffer-title) (delete-region (point-min) (next-single-property-change @@ -2244,7 +2244,7 @@ If optional arg SILENT is non-nil, do not display progress messages." (orig (count-lines (point-min) (point))) ;; Inhibit font-lock caching tricks, since we're modifying the ;; entire buffer at once - (after-change-functions nil) + (inhibit-modification-hooks t) (ext-loaded (featurep 'ibuf-ext)) (bgroups (if ext-loaded (ibuffer-generate-filter-groups bmarklist) diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el index 31f841d..92e5522 100644 --- a/lisp/international/isearch-x.el +++ b/lisp/international/isearch-x.el @@ -71,6 +71,7 @@ (defun isearch-with-keyboard-coding () (interactive) + ;; FIXME: What does this after-change-functions binding do here? (let ((after-change-functions '(isearch-exit-recursive-edit))) (recursive-edit)) (exit-minibuffer)) diff --git a/lisp/mouse.el b/lisp/mouse.el index 6584733..d6ce31a 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1111,12 +1111,12 @@ This does not delete the region; it acts like \\[kill-ring-save]." ;; Delete, but make the undo-list entry share with the kill ring. ;; First, delete just one char, so in case buffer is being modified ;; for the first time, the undo list records that fact. - (let (before-change-functions after-change-functions) + (let ((inhibit-modification-hooks t)) (delete-region beg (+ beg (if (> end beg) 1 -1)))) (let ((buffer-undo-list buffer-undo-list)) ;; Undo that deletion--but don't change the undo list! - (let (before-change-functions after-change-functions) + (let ((inhibit-modification-hooks t)) (primitive-undo 1 buffer-undo-list)) ;; Now delete the rest of the specified region, ;; but don't record it. diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el index 7e3dd66..3985d51 100644 --- a/lisp/obsolete/fast-lock.el +++ b/lisp/obsolete/fast-lock.el @@ -200,7 +200,7 @@ `(let* (,@(append varlist '((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-point-motion-hooks t) - before-change-functions after-change-functions + (inhibit-modification-hooks t) deactivate-mark buffer-file-name buffer-file-truename))) ,@body (when (and (not modified) (buffer-modified-p)) diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el index 01939da..7cb13ce 100644 --- a/lisp/obsolete/longlines.el +++ b/lisp/obsolete/longlines.el @@ -143,7 +143,7 @@ newlines are indicated with a symbol." 'longlines-window-change-function nil t)) (let ((buffer-undo-list t) (inhibit-read-only t) - (after-change-functions nil) + (inhibit-modification-hooks t) (mod (buffer-modified-p)) buffer-file-name buffer-file-truename) ;; Turning off undo is OK since (spaces + newlines) is @@ -184,7 +184,7 @@ newlines are indicated with a symbol." (if longlines-showing (longlines-unshow-hard-newlines)) (let ((buffer-undo-list t) - (after-change-functions nil) + (inhibit-modification-hooks t) (inhibit-read-only t) buffer-file-name buffer-file-truename) (if longlines-decoded diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index d59948e..2d9bd48 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -171,7 +171,7 @@ (let ((buffer-undo-list t) (inhibit-read-only t) ,@(unless (featurep 'xemacs) '((inhibit-point-motion-hooks t) deactivate-mark)) - before-change-functions after-change-functions + (inhibit-modification-hooks t) buffer-file-name buffer-file-truename) ,@body) (and (not ,modified) (buffer-modified-p) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index b8ba170..5da6508 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3672,7 +3672,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', is-REx is-x-REx REx-subgr-start REx-subgr-end was-subgr i2 hairy-RE (case-fold-search nil) (inhibit-read-only t) (buffer-undo-list t) (modified (buffer-modified-p)) overshoot is-o-REx name - (after-change-functions nil) + (inhibit-modification-hooks t) (cperl-font-locking t) (use-syntax-state (and cperl-syntax-state (>= min (car cperl-syntax-state)))) @@ -8882,7 +8882,7 @@ Delay of auto-help controlled by `cperl-lazy-help-time'." (defun cperl-font-lock-unfontify-region-function (beg end) (let* ((modified (buffer-modified-p)) (buffer-undo-list t) (inhibit-read-only t) (inhibit-point-motion-hooks t) - before-change-functions after-change-functions + (inhibit-modification-hooks t) deactivate-mark buffer-file-name buffer-file-truename) (remove-text-properties beg end '(face nil)) (if (and (not modified) (buffer-modified-p)) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index b64de47..0d9157a 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -2654,8 +2654,7 @@ Return an alist of (TYPE MATCH)." (save-excursion (let ((children (widget-get widget :children)) (inhibit-read-only t) - before-change-functions - after-change-functions) + (inhibit-modification-hooks t)) (cond (before (goto-char (widget-get before :entry-from))) (t @@ -2679,8 +2678,7 @@ Return an alist of (TYPE MATCH)." (let ((buttons (copy-sequence (widget-get widget :buttons))) button (inhibit-read-only t) - before-change-functions - after-change-functions) + (inhibit-modification-hooks t)) (while buttons (setq button (car buttons) buttons (cdr buttons)) @@ -2691,8 +2689,7 @@ Return an alist of (TYPE MATCH)." (let ((entry-from (widget-get child :entry-from)) (entry-to (widget-get child :entry-to)) (inhibit-read-only t) - before-change-functions - after-change-functions) + (inhibit-modification-hooks t)) (widget-delete child) (delete-region entry-from entry-to) (set-marker entry-from nil) commit e125dce50b2fa1c5f57f6ca00ea679437593bdc4 Author: Stefan Monnier Date: Fri Sep 11 20:32:33 2015 -0400 (jit-lock-deferred-fontify): Pay attention to skipped redisplays * lisp/jit-lock.el (jit-lock-deferred-fontify): Make sure we refresh the buffers, even if the forced redisplay is interrupted. diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 5f9196d..8c798d5 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -583,11 +583,13 @@ non-nil in a repeated invocation of this function." 'fontified nil)) (setq pos (next-single-property-change pos 'fontified))))))))) - (setq jit-lock-defer-buffers nil) ;; Force fontification of the visible parts. - (let ((jit-lock-defer-timer nil)) + (let ((buffers jit-lock-defer-buffers) + (jit-lock-defer-timer nil)) + (setq jit-lock-defer-buffers nil) ;; (message "Jit-Defer Now") - (sit-for 0) + (unless (redisplay) ;FIXME: Should we `force'? + (setq jit-lock-defer-buffers buffers)) ;; (message "Jit-Defer Done") ))) commit b2615c753ba9b332b4062b3aef1bf96b57c18215 Author: Stefan Monnier Date: Fri Sep 11 20:30:31 2015 -0400 * lisp/emacs-lisp/eieio-core.el (class-p): Accept class objects diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 29c4467..f97667c 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -135,10 +135,10 @@ Currently under control of this var: (or (cl--find-class class) class) class)) -(defun class-p (class) - "Return non-nil if CLASS is a valid class vector. -CLASS is a symbol." ;FIXME: Is it a vector or a symbol? - (and (symbolp class) (eieio--class-p (cl--find-class class)))) +(defun class-p (x) + "Return non-nil if X is a valid class vector. +X can also be is a symbol." + (eieio--class-p (if (symbolp x) (cl--find-class x) x))) (defun eieio--class-print-name (class) "Return a printed representation of CLASS." commit 3928ef2dd5b8febf3b1d9c1bfb22af3698d16bea Author: Stefan Monnier Date: Fri Sep 11 20:00:05 2015 -0400 Merge syntax-propertize--done and parse-sexp-propertize-done * lisp/emacs-lisp/syntax.el (syntax-propertize--done): Remove. (syntax-propertize): Set syntax-propertize--done even if syntax-propertize-function is nil. Avoid recursive invocations. (syntax-propertize-chunks): New var. (internal--syntax-propertize): Use it. Rename from syntax--jit-propertize. Simplify. (parse-sexp-propertize-function): Don't set any more. * src/syntax.c (SETUP_SYNTAX_TABLE): Call parse_sexp_propertize as needed. (parse_sexp_propertize): Don't assume charpos is not yet propertized. Call Qinternal__syntax_propertize instead of Vparse_sexp_propertize_function. Truncate e_property if needed. (update_syntax_table_forward): Streamline. (syms_of_syntax): Define Qinternal__syntax_propertize. (syntax_propertize__done): Rename from parse_sexp_propertize_done. diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 6c9cba3..5101925 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -106,10 +106,6 @@ Put first the functions more likely to cause a change and cheaper to compute.") (point-max)))) (cons beg end)) -(defvar syntax-propertize--done -1 - "Position up to which syntax-table properties have been set.") -(make-variable-buffer-local 'syntax-propertize--done) - (defun syntax-propertize--shift-groups (re n) (replace-regexp-in-string "\\\\(\\?\\([0-9]+\\):" @@ -290,54 +286,59 @@ The return value is a function suitable for `syntax-propertize-function'." (defun syntax-propertize (pos) "Ensure that syntax-table properties are set until POS." - (when (and syntax-propertize-function - (< syntax-propertize--done pos)) - ;; (message "Needs to syntax-propertize from %s to %s" - ;; syntax-propertize--done pos) - (set (make-local-variable 'parse-sexp-lookup-properties) t) - (save-excursion - (with-silent-modifications - (make-local-variable 'parse-sexp-propertize-done) ;Just in case! - (let* ((start (max syntax-propertize--done (point-min))) - ;; Avoid recursion! - (parse-sexp-propertize-done most-positive-fixnum) - (end (max pos - (min (point-max) - (+ start syntax-propertize-chunk-size)))) - (funs syntax-propertize-extend-region-functions)) - (while funs - (let ((new (funcall (pop funs) start end))) - (if (or (null new) - (and (>= (car new) start) (<= (cdr new) end))) - nil - (setq start (car new)) - (setq end (cdr new)) - ;; If there's been a change, we should go through the - ;; list again since this new position may - ;; warrant a different answer from one of the funs we've - ;; already seen. - (unless (eq funs - (cdr syntax-propertize-extend-region-functions)) - (setq funs syntax-propertize-extend-region-functions))))) - ;; Move the limit before calling the function, so the function - ;; can use syntax-ppss. - (setq syntax-propertize--done end) - ;; (message "syntax-propertizing from %s to %s" start end) - (remove-text-properties start end - '(syntax-table nil syntax-multiline nil)) - (funcall syntax-propertize-function start end)))))) - -;;; Link syntax-propertize with the new parse-sexp-propertize. - -(setq-default parse-sexp-propertize-function #'syntax--jit-propertize) -(defun syntax--jit-propertize (charpos) - (if (not syntax-propertize-function) - (setq parse-sexp-propertize-done (1+ (point-max))) - (syntax-propertize charpos) - (setq parse-sexp-propertize-done - (if (= (point-max) syntax-propertize--done) - (1+ (point-max)) - syntax-propertize--done)))) + (when (< syntax-propertize--done pos) + (if (null syntax-propertize-function) + (setq syntax-propertize--done (max (point-max) pos)) + ;; (message "Needs to syntax-propertize from %s to %s" + ;; syntax-propertize--done pos) + (set (make-local-variable 'parse-sexp-lookup-properties) t) + (save-excursion + (with-silent-modifications + (make-local-variable 'syntax-propertize--done) ;Just in case! + (let* ((start (max (min syntax-propertize--done (point-max)) + (point-min))) + (end (max pos + (min (point-max) + (+ start syntax-propertize-chunk-size)))) + (funs syntax-propertize-extend-region-functions)) + (while funs + (let ((new (funcall (pop funs) start end)) + ;; Avoid recursion! + (syntax-propertize--done most-positive-fixnum)) + (if (or (null new) + (and (>= (car new) start) (<= (cdr new) end))) + nil + (setq start (car new)) + (setq end (cdr new)) + ;; If there's been a change, we should go through the + ;; list again since this new position may + ;; warrant a different answer from one of the funs we've + ;; already seen. + (unless (eq funs + (cdr syntax-propertize-extend-region-functions)) + (setq funs syntax-propertize-extend-region-functions))))) + ;; Move the limit before calling the function, so the function + ;; can use syntax-ppss. + (setq syntax-propertize--done end) + ;; (message "syntax-propertizing from %s to %s" start end) + (remove-text-properties start end + '(syntax-table nil syntax-multiline nil)) + ;; Avoid recursion! + (let ((syntax-propertize--done most-positive-fixnum)) + (funcall syntax-propertize-function start end)))))))) + +;;; Link syntax-propertize with syntax.c. + +(defvar syntax-propertize-chunks + ;; We're not sure how far we'll go. In my tests, using chunks of 20000 + ;; brings to overhead to something negligible. Passing ‘charpos’ directly + ;; also works (basically works line-by-line) but results in an overhead which + ;; I thought was a bit too high (like around 50%). + 2000) + +(defun internal--syntax-propertize (charpos) + ;; FIXME: Called directly from C. + (syntax-propertize (min (+ syntax-propertize-chunks charpos) (point-max)))) ;;; Incrementally compute and memoize parser state. diff --git a/src/syntax.c b/src/syntax.c index fcd6d01..de45c50 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -181,6 +181,7 @@ static void scan_sexps_forward (struct lisp_parse_state *, ptrdiff_t, ptrdiff_t, ptrdiff_t, EMACS_INT, bool, Lisp_Object, int); static bool in_classes (int, Lisp_Object); +static void parse_sexp_propertize (ptrdiff_t charpos); /* This setter is used only in this file, so it can be private. */ static void @@ -247,12 +248,12 @@ SETUP_SYNTAX_TABLE (ptrdiff_t from, ptrdiff_t count) gl_state.offset = 0; if (parse_sexp_lookup_properties) { - if (count > 0 || from > BEGV) - update_syntax_table (count > 0 ? from : from - 1, count, true, Qnil); - if (gl_state.e_property > parse_sexp_propertize_done) + if (count > 0) + update_syntax_table_forward (from, true, Qnil); + else if (from > BEGV) { - gl_state.e_property = parse_sexp_propertize_done; - gl_state.e_property_truncated = true; + update_syntax_table (from - 1, count, true, Qnil); + parse_sexp_propertize (from - 1); } } } @@ -478,33 +479,44 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, static void parse_sexp_propertize (ptrdiff_t charpos) { - EMACS_INT modiffs = CHARS_MODIFF; - safe_call1 (Vparse_sexp_propertize_function, - make_number (1 + charpos)); - if (modiffs != CHARS_MODIFF) - error ("parse-sexp-propertize-function modified the buffer!"); - if (parse_sexp_propertize_done <= charpos) - error ("parse-sexp-propertize-function did not move" - " parse-sexp-propertize-done"); - SETUP_SYNTAX_TABLE (charpos, 1); + EMACS_INT zv = ZV; + if (syntax_propertize__done <= charpos + && syntax_propertize__done < zv) + { + EMACS_INT modiffs = CHARS_MODIFF; + safe_call1 (Qinternal__syntax_propertize, + make_number (min (zv, 1 + charpos))); + if (modiffs != CHARS_MODIFF) + error ("parse-sexp-propertize-function modified the buffer!"); + if (syntax_propertize__done <= charpos + && syntax_propertize__done < zv) + error ("parse-sexp-propertize-function did not move" + " syntax-propertize--done"); + SETUP_SYNTAX_TABLE (charpos, 1); + } + else if (gl_state.e_property > syntax_propertize__done) + { + gl_state.e_property = syntax_propertize__done; + gl_state.e_property_truncated = true; + } } void update_syntax_table_forward (ptrdiff_t charpos, bool init, - Lisp_Object object) + Lisp_Object object) { - if (!(gl_state.e_property_truncated)) - update_syntax_table (charpos, 1, init, object); - if ((gl_state.e_property > parse_sexp_propertize_done - || gl_state.e_property_truncated) - && NILP (object)) + if (gl_state.e_property_truncated) { - if (parse_sexp_propertize_done > charpos) - { - gl_state.e_property = parse_sexp_propertize_done; - gl_state.e_property_truncated = true; - } - else + eassert (NILP (object)); + eassert (charpos >= gl_state.e_property); + eassert (charpos >= syntax_propertize__done); + parse_sexp_propertize (charpos); + } + else + { + update_syntax_table (charpos, 1, init, object); + if (gl_state.e_property > syntax_propertize__done + && NILP (object)) parse_sexp_propertize (charpos); } } @@ -2332,13 +2344,13 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ? (nesting > 0 && --nesting == 0) : nesting < 0)) - /* we have encountered a comment end of the same style + /* We have encountered a comment end of the same style as the comment sequence which began this comment - section */ + section. */ break; if (code == Scomment_fence && style == ST_COMMENT_STYLE) - /* we have encountered a comment end of the same style + /* We have encountered a comment end of the same style as the comment sequence which began this comment section. */ break; @@ -2346,8 +2358,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, && code == Scomment && SYNTAX_FLAGS_COMMENT_NESTED (syntax) && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style) - /* we have encountered a nested comment of the same style - as the comment sequence which began this comment section */ + /* We have encountered a nested comment of the same style + as the comment sequence which began this comment section. */ nesting++; INC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); @@ -2363,9 +2375,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, ? nesting > 0 : nesting < 0)) { if (--nesting <= 0) - /* we have encountered a comment end of the same style - as the comment sequence which began this comment - section */ + /* We have encountered a comment end of the same style + as the comment sequence which began this comment section. */ break; else { @@ -2382,9 +2393,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, && SYNTAX_FLAGS_COMSTART_SECOND (other_syntax)) && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) || SYNTAX_FLAGS_COMMENT_NESTED (other_syntax))) - /* we have encountered a nested comment of the same style - as the comment sequence which began this comment - section */ + /* We have encountered a nested comment of the same style + as the comment sequence which began this comment section. */ { INC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); @@ -2628,9 +2638,9 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag) bool quoted; bool mathexit = 0; enum syntaxcode code; - EMACS_INT min_depth = depth; /* Err out if depth gets less than this. */ - int comstyle = 0; /* style of comment encountered */ - bool comnested = 0; /* whether the comment is nestable or not */ + EMACS_INT min_depth = depth; /* Err out if depth gets less than this. */ + int comstyle = 0; /* Style of comment encountered. */ + bool comnested = 0; /* Whether the comment is nestable or not. */ ptrdiff_t temp_pos; EMACS_INT last_good = from; bool found; @@ -2674,11 +2684,11 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag) SYNTAX_FLAGS_COMSTART_SECOND (other_syntax)) && parse_sexp_ignore_comments) { - /* we have encountered a comment start sequence and we + /* We have encountered a comment start sequence and we are ignoring all text inside comments. We must record the comment style this sequence begins so that later, only a comment end of the same style actually ends - the comment section */ + the comment section. */ code = Scomment; comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax); comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax); @@ -2696,7 +2706,7 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag) if (from == stop) goto lose; INC_BOTH (from, from_byte); - /* treat following character as a word constituent */ + /* Treat following character as a word constituent. */ case Sword: case Ssymbol: if (depth || !sexpflag) break; @@ -3501,7 +3511,7 @@ Sixth arg COMMENTSTOP non-nil means stop at the start of a comment. target = XINT (targetdepth); } else - target = TYPE_MINIMUM (EMACS_INT); /* We won't reach this depth */ + target = TYPE_MINIMUM (EMACS_INT); /* We won't reach this depth. */ validate_region (&from, &to); scan_sexps_forward (&state, XINT (from), CHAR_TO_BYTE (XINT (from)), @@ -3650,19 +3660,10 @@ Otherwise, that text property is simply ignored. See the info node `(elisp)Syntax Properties' for a description of the `syntax-table' property. */); - DEFVAR_INT ("parse-sexp-propertize-done", parse_sexp_propertize_done, + DEFVAR_INT ("syntax-propertize--done", syntax_propertize__done, doc: /* Position up to which syntax-table properties have been set. */); - parse_sexp_propertize_done = -1; - - DEFVAR_LISP ("parse-sexp-propertize-function", - Vparse_sexp_propertize_function, - doc: /* Function to set the `syntax-table' text property. -Called with one argument, the position at which the property is needed. -After running it, `parse-sexp-propertize-done' should be strictly greater -than the argument passed. */); - /* Note: Qnil is a temporary (and invalid) value; it will be properly set in - syntax.el. */ - Vparse_sexp_propertize_function = Qnil; + syntax_propertize__done = -1; + DEFSYM (Qinternal__syntax_propertize, "internal--syntax-propertize"); words_include_escapes = 0; DEFVAR_BOOL ("words-include-escapes", words_include_escapes, diff --git a/src/syntax.h b/src/syntax.h index 9c44181..34b652b 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -174,9 +174,10 @@ SYNTAX_TABLE_BYTE_TO_CHAR (ptrdiff_t bytepos) INLINE void UPDATE_SYNTAX_TABLE_FORWARD (ptrdiff_t charpos) -{ +{ /* Performs just-in-time syntax-propertization. */ if (parse_sexp_lookup_properties && charpos >= gl_state.e_property) - update_syntax_table_forward (charpos + gl_state.offset, false, gl_state.object); + update_syntax_table_forward (charpos + gl_state.offset, + false, gl_state.object); } /* Make syntax table state (gl_state) good for CHARPOS, assuming it is commit 818f06eaa72d8e4f9ba314c1c2855613bf89f396 Author: Paul Eggert Date: Fri Sep 11 11:04:24 2015 -0700 Prefer straight quoting in some text files Mostly this just changes ` to ' in static text. Some exceptions: * INSTALL.REPO: Use curved quotes, as the diagnostic in question typically does that now. * admin/quick-install-emacs (TRY, top level): Use straight quoting in diagnostics. * src/README: Fix working-directory confusion. diff --git a/INSTALL.REPO b/INSTALL.REPO index 3431ee4..7c956f0 100644 --- a/INSTALL.REPO +++ b/INSTALL.REPO @@ -42,7 +42,7 @@ subdirectories of 'lisp/', e.g., 'mh-e/' and 'calendar/') will need to be updated to reflect new autoloaded functions. If you see errors (rather than warnings) about undefined lisp functions during compilation, that may be the reason. Finally, sometimes there can be build failures -related to '*loaddefs.el' (e.g., "required feature `esh-groups' was not +related to '*loaddefs.el' (e.g., "required feature ‘esh-groups’ was not provided"). In that case, follow the instructions below. To update loaddefs.el (and similar files), do: diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index bdd2694..327723f 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -72,7 +72,7 @@ pages of the manuals, and even if they do, the resulting page breaks depend on what paper and font size they use. This also means that if you _are_ going to do this, it should be done with the paper and font size that the GNU Press are going to use when they print the manuals. -I think this is different to what you get if you just use eg `make +I think this is different to what you get if you just use eg 'make emacs.pdf' (e.g., enable "smallbook"). ** Check the keybindings in the refcards are correct, and add any new ones. @@ -112,21 +112,21 @@ sk Miroslav Vaško ** Check for modes which bind M-s that conflicts with a new global binding M-s and change key bindings where necessary. The current list of modes: -1. Gnus binds `M-s' to `gnus-summary-search-article-forward'. +1. Gnus binds 'M-s' to 'gnus-summary-search-article-forward'. -2. Minibuffer binds `M-s' to `next-matching-history-element' +2. Minibuffer binds 'M-s' to 'next-matching-history-element' (not useful any more since C-s can now search in the history). -3. `center-line' in Text mode was already moved to the text formatting - keymap as `M-o M-s' (thus this binding is not necessary any more - in `nroff-mode-map' too and can be removed now from the nroff mode - because it can now use the global key binding `M-o M-s' `center-line'). +3. 'center-line' in Text mode was already moved to the text formatting + keymap as 'M-o M-s' (thus this binding is not necessary any more + in 'nroff-mode-map' too and can be removed now from the nroff mode + because it can now use the global key binding 'M-o M-s' 'center-line'). -4. PCL-CVS binds `M-s' to `cvs-status', and log-edit-mode binds it to - `log-edit-comment-search-forward'. Perhaps search commands - on the global key binding `M-s' are useless in these modes. +4. PCL-CVS binds 'M-s' to 'cvs-status', and log-edit-mode binds it to + 'log-edit-comment-search-forward'. Perhaps search commands + on the global key binding 'M-s' are useless in these modes. -5. Rmail binds `\es' to `rmail-search'/`rmail-summary-search'. +5. Rmail binds '\es' to 'rmail-search'/'rmail-summary-search'. * DOCUMENTATION diff --git a/admin/README b/admin/README index 786c502..2286e35 100644 --- a/admin/README +++ b/admin/README @@ -37,7 +37,7 @@ Build Emacs in various ways. ** quick-install-emacs -Install emacs quickly (`incrementally'). +Install emacs quickly ("incrementally"). ** alloc-colors.c diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index d326282..0730b94 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -13,13 +13,13 @@ Steps to take before starting on the first pretest in any release sequence: have them available for the duration of the release process. 2. Consider increasing the value of the variable - `customize-changed-options-previous-release' in cus-edit.el to + 'customize-changed-options-previous-release' in cus-edit.el to refer to a newer version of Emacs. (This is probably needed only when preparing the first pretest for a major Emacs release.) Commit cus-edit.el if changed. 3. Remove any old pretests from ftp://alpha.gnu.org/gnu/emacs/pretest. - You can use `gnupload --delete' (see below for more gnupload details). + You can use 'gnupload --delete' (see below for more gnupload details). General steps (for each step, check for possible errors): @@ -96,12 +96,12 @@ General steps (for each step, check for possible errors): If this is the first pretest of a major release, just comparing with the previous release may overlook many new files. You can try - something like `find . | sort' in a clean repository, and compare the + something like 'find . | sort' in a clean repository, and compare the results against the new tar contents. 7. tar -xf emacs-NEW.tar; cd emacs-NEW ./configure --prefix=/tmp/emacs && make && make install - Use `script' or M-x compile to save the compilation log in + Use 'script' or M-x compile to save the compilation log in compile-NEW.log and compare it against an old one. The easiest way to do that is to visit the old log in Emacs, change the version number of the old Emacs to __, do the same with the new log and do diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker index fd7bd08..fb65bbe 100644 --- a/admin/notes/bugtracker +++ b/admin/notes/bugtracker @@ -334,7 +334,7 @@ http://debbugs.gnu.org/cgi/pkgreport.cgi?users=emacs;tag=calendar *** To merge bugs: Eg when bad replies create a bunch of new bugs for the same report. Bugs must all be in the same state (e.g. same package(s) and severity --- see `reassign' and `severity' below), but need not have the same +-- see 'reassign' and 'severity' below), but need not have the same tags (tags are merged). E.g.: merge 123 124 125 ... @@ -343,8 +343,8 @@ Note that merging does not affect titles. In particular, a "retitle" of merged bugs only affects individual bugs, not all of them. *** Forcing a merge: -Like `merge', but bugs need not be in the same state. The packages -must still match though (see `reassign' below). The first one listed +Like 'merge', but bugs need not be in the same state. The packages +must still match though (see 'reassign' below). The first one listed is the master. E.g.: forcemerge 123 124 125 ... @@ -383,7 +383,7 @@ See http://debbugs.gnu.org/Developer#severities for the meanings. *** To set the owner of a bug: owner 123 A Hacker -The shorthand `!' means your own address. +The shorthand '!' means your own address. *** To remove the owner of a bug: noowner 123 @@ -408,7 +408,7 @@ reassign 1234 emacs Note that reassigning clears the list of found versions, even if the new packages includes the original one. -** To remove spam from the tracker, move it to the `spam' pseudo-package: +** To remove spam from the tracker, move it to the 'spam' pseudo-package: reassign 123 spam (Should not be necessary any more, now that the input is moderated.) @@ -468,10 +468,10 @@ time, rather than by increasing bug number *** When you fix a bug, it can be helpful to put the bug number in the change log entry, for example: - * foo.el (foofunc): Fix the `foo' case. (Bug#123) + * lisp/menu-bar.el (menu-set-font): Doc fix. (Bug#21303) Then the relevant bug can be found for easy reference. If it's an -obvious fix (e.g. a typo), there's no need to clutter the log with the +obvious fix (e.g., a typo), there's no need to clutter the log with the bug number. Similarly, when you close a bug, it can be helpful to include the @@ -480,7 +480,7 @@ can see exactly what the fix was. *** bug-reference-mode -Activate `bug-reference-mode' in ChangeLogs to get clickable links to +Activate 'bug-reference-mode' in ChangeLogs to get clickable links to the bug web-pages. *** Debian stuff diff --git a/admin/notes/copyright b/admin/notes/copyright index 45b7c61..3ba9c55 100644 --- a/admin/notes/copyright +++ b/admin/notes/copyright @@ -132,7 +132,7 @@ lib-src/rcs2log # Copyright Cocoa/Emacs.base/Contents/Info.plist Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings GNUstep/Emacs.base/Resources/Info-gnustep.plist - `set-copyright' in admin.el will do all the above. + 'set-copyright' in admin.el will do all the above. aclocal.m4 configure diff --git a/admin/notes/elpa b/admin/notes/elpa index 3922604..4c0f198 100644 --- a/admin/notes/elpa +++ b/admin/notes/elpa @@ -13,7 +13,7 @@ daily. This script (which is kept in elpa/admin/update-archive.sh) generates the content visible at http://elpa.gnu.org/packages. A new package is released as soon as the "version number" of that package is -changed. So you can use `elpa' to work on a package without fear of releasing +changed. So you can use 'elpa' to work on a package without fear of releasing those changes prematurely. And once the code is ready, just bump the version number to make a new release of the package. diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow index 92dc791..3c2c76c 100644 --- a/admin/notes/git-workflow +++ b/admin/notes/git-workflow @@ -33,7 +33,7 @@ You now have both branches conveniently accessible, and you can do Fixing bugs =========== -You edit the files in either branch, `M-x vc-dir', and check in your +You edit the files in either branch, 'M-x vc-dir', and check in your changes. Then you need to push the data to the main repository. This will usually fail, since somebody else has pushed other changes in the meantime. To fix this, say diff --git a/admin/notes/hydra b/admin/notes/hydra index 80ce787..ce4a683 100644 --- a/admin/notes/hydra +++ b/admin/notes/hydra @@ -16,8 +16,8 @@ http://lists.gnu.org/archive/html/hydra-users/2013-08/msg00000.html * Mail notifications In addition to the web interface, Hydra can send notifications by -email when the build status of a project changes—e.g., from -`SUCCEEDED' to `FAILED'. It sends notifications about build status in +email when the build status of a project changes, e.g., from +SUCCEEDED to FAILED. It sends notifications about build status in Emacs trunk to emacs-buildstatus@gnu.org. If you want to receive these notifications, please subscribe at @@ -25,16 +25,16 @@ http://lists.gnu.org/mailman/listinfo/emacs-buildstatus * The Emacs jobset consists of the following jobs: -** The `tarball' job +** The 'tarball' job which gets a checkout from the repository, and does a bootstrap followed by running make-dist to create a tarball. If this job fails, all the others will too (because they use the tarball as input). -** The `build' job +** The 'build' job which starts from the tarball and does a normal build ** The 'coverage' job -does a gcov build and then runs `make check'. Fails if any test fails. +does a gcov build and then runs 'make check'. Fails if any test fails. * Nix expressions The recipe for GNU Emacs are available via Git: diff --git a/admin/notes/multi-tty b/admin/notes/multi-tty index c547e14..868d451 100644 --- a/admin/notes/multi-tty +++ b/admin/notes/multi-tty @@ -82,7 +82,7 @@ Known problems: minibuffer prompt (which is a kind of recursive editing) on another display. To unfreeze your session, switch to that display and complete the recursive edit, for example by - pressing C-] (`abort-recursive-edit'). + pressing C-] ('abort-recursive-edit'). I am sorry to say that currently there is no way to break out of this "single-kboard mode" from a frozen display. If @@ -209,11 +209,11 @@ following: THINGS TO DO ------------ -** See if `tty-defined-color-alist' needs to be terminal-local. +** See if 'tty-defined-color-alist' needs to be terminal-local. Update: Dan says it should be, so convert it. ** Mikhail Gusarov suggest to add a hook akin to - `after-make-frame-functions' that is called whenever Emacs connects + 'after-make-frame-functions' that is called whenever Emacs connects to a new terminal. Good idea! ** emacsclient -t on the console does not work after su. You have to @@ -237,16 +237,16 @@ THINGS TO DO proxy idea. ** lisp/vc.el depends on the terminal type during load time. - `vc-annotate-color-map' is one example that needs to be fixed. + 'vc-annotate-color-map' is one example that needs to be fixed. -** Understand how `quit_throw_to_read_char' works, and fix any bugs +** Understand how 'quit_throw_to_read_char' works, and fix any bugs that come to light. ** See if getcjmp can be eliminated somehow. Why does Emacs allow asynchronous input processing while it's reading input anyway? -** `delete-frame' events are handled by `special-event-map' - immediately when read by `read_char'. This is fine but it prevents +** 'delete-frame' events are handled by 'special-event-map' + immediately when read by 'read_char'. This is fine but it prevents higher-level keymaps from binding that event to get notified of the deleted frame. @@ -254,26 +254,26 @@ THINGS TO DO deletions after they have happened, usually because they want to clean up after the deleted frame. Not all frame-local states can be stored as a frame parameter. For example, - `display-splash-screen' uses `recursive-edit' with a special keymap + 'display-splash-screen' uses 'recursive-edit' with a special keymap override to create its buffer---and it leads to all kinds of nastiness if Emacs stays in this recursive edit mode after the frame containing the splash screen is deleted. Basically, the splash-screen implementation wants to throw out of the recursive edit when the frame is deleted; however, it is not legal to throw - from `delete-frame-functions' because `delete-frame' must not fail. - (Introducing `delete-frame-after-functions' would not help either - because `delete-frame' may not fail at that time either.) + from 'delete-frame-functions' because 'delete-frame' must not fail. + (Introducing 'delete-frame-after-functions' would not help either + because 'delete-frame' may not fail at that time either.) - Currently `fancy-splash-screens' installs a - `delete-frame-functions' hook that sets up a timer to exit the + Currently 'fancy-splash-screens' installs a + 'delete-frame-functions' hook that sets up a timer to exit the recursive edit. This is an adequate solution, but it would perhaps - be better to have something like a `frame-deleted' event that could + be better to have something like a 'frame-deleted' event that could be bound in the normal way. -** Trouble: `setenv' doesn't actually set environment variables in the +** Trouble: 'setenv' doesn't actually set environment variables in the Emacs process. This defeats the purpose of the elaborate - `server-with-environment' magic around the `tgetent' call in - `init_tty'. D'oh. + 'server-with-environment' magic around the 'tgetent' call in + 'init_tty'. D'oh. ** (Possibly) create hooks in struct device for creating frames on a specific terminal, and eliminate the hackish terminal-related frame @@ -290,9 +290,9 @@ THINGS TO DO as static, removing it from dispextern.h. Move fatal to emacs.c and declare it somewhere. -** Search for `suspend-emacs' references and replace them with - `suspend-frame', if necessary. Ditto for `save-buffers-kill-emacs' - vs. `save-buffers-kill-display'. +** Search for 'suspend-emacs' references and replace them with + 'suspend-frame', if necessary. Ditto for 'save-buffers-kill-emacs' + vs. 'save-buffers-kill-display'. ** Emacs crashes when a tty frame is resized so that there is no space for all its windows. (Tom Schutzer-Weissmann) @@ -315,7 +315,7 @@ THINGS TO DO impression that the various multidisplay fixes will only get released in GTK+ 2.10. -** Audit `face-valid-attribute-values' usage in customize and +** Audit 'face-valid-attribute-values' usage in customize and elsewhere. Its return value depends on the current window system. Replace static initializers using it with runtime functions. For example, custom's buttons are broken on non-initial device types. @@ -325,9 +325,9 @@ THINGS TO DO ** frames-on-display-list should also accept frames. -** Consider the `tty-type' frame parameter and the `display-tty-type' +** Consider the 'tty-type' frame parameter and the 'display-tty-type' function. They serve the exact same purpose. I think it may be - a good idea to eliminate one of them, preferably `tty-type'. + a good idea to eliminate one of them, preferably 'tty-type'. ** The handling of lisp/term/*.el, and frame creation in general, is a big, big mess. How come the terminal-specific file is loaded by @@ -340,27 +340,23 @@ THINGS TO DO changed in CVS, and frame.el in multi-tty has not yet been adapted for the changes. (It needs to look at default-frame-background-mode.) (Update: maybe it is fixed now; - needs testing.) (Note that the byte compiler has this to say about - term/rxvt.el:) + needs testing.) - term/rxvt.el:309:17:Warning: assignment to free variable - `default-frame-background-mode' - -** I think `(set-)terminal-local-value' and the terminal parameter +** I think '(set-)terminal-local-value' and the terminal parameter mechanism should be integrated into a single framework. - (Update: `(set-)terminal-local-value' is now eliminated, but the + (Update: '(set-)terminal-local-value' is now eliminated, but the terminal-local variables should still be accessible as terminal - parameters. This also applies to `display-name' and similar + parameters. This also applies to 'display-name' and similar functions.) ** Add the following hooks: after-delete-frame-hook (for server.el, instead of delete-frame-functions), after-delete-terminal-functions, after-create-terminal-functions. -** BULK RENAME: The `display-' prefix of new Lisp-level functions - conflicts with stuff like `display-time-mode'. Use `device-' - or `terminal-' instead. I think I prefer `terminal-'. +** BULK RENAME: The 'display-' prefix of new Lisp-level functions + conflicts with stuff like 'display-time-mode'. Use 'device-' + or 'terminal-' instead. I think I prefer 'terminal-'. It turns out that most of the offending Lisp functions were defined in the trunk. Therefore, compatibility aliases should be defined @@ -466,7 +462,7 @@ THINGS TO DO ** With iswitchb-default-method set to 'always-frame, only frames on the current display should be considered. This might involve - extending `get-buffer-window'. + extending 'get-buffer-window'. ** Have a look at Vlocale_coding_system. Seems like it would be a tedious job to localize it, although most references use it for @@ -537,7 +533,7 @@ DIARY OF CHANGES -- Change make-terminal-frame to support specifying another tty. - (Done, new frame parameters: `tty' and `tty-type'.) + (Done, new frame parameters: 'tty' and 'tty-type'.) -- Implement support for reading from multiple terminals. @@ -549,7 +545,7 @@ DIARY OF CHANGES (Update2: After enabling X, they don't.) --- other-frame should cycle through the frames on the `current' +-- other-frame should cycle through the frames on the 'current' terminal only. (Done, by trivially modifying next_frame and prev_frame.) @@ -606,7 +602,7 @@ DIARY OF CHANGES (Update^3: Not any more.) --- Make make-terminal-frame look up the `tty' and `tty-type' frame +-- Make make-terminal-frame look up the 'tty' and 'tty-type' frame parameters from the currently selected terminal before the global default. @@ -824,7 +820,7 @@ DIARY OF CHANGES (Done, breaking interactive temacs.) --- The command `emacsclient -t -e '(delete-frame)'' fails to exit. +-- The command "emacsclient -t -e '(delete-frame)'" fails to exit. (Fixed.) @@ -934,7 +930,7 @@ DIARY OF CHANGES frame sets single_kboard). Update: the face problems are caused by bugs in term.el, not in multi-tty. The lockup is caused by single_kboard mode, and is not easily resolvable. The best thing to - do is to simply refuse to create a tty frame of type `eterm'. + do is to simply refuse to create a tty frame of type 'eterm'. (Fixed, changed emacsclient to check for TERM=eterm. The face complaints seem to be caused by bugs in term.el; they are not @@ -943,14 +939,14 @@ DIARY OF CHANGES -- Find out the best way to support suspending Emacs with multiple ttys. My guess: disable it on the controlling tty, but from other ttys pass it on to emacsclient somehow. (It is (I hope) trivial to - extend emacsclient to handle suspend/resume. A `kill -STOP' almost + extend emacsclient to handle suspend/resume. A 'kill -STOP' almost works right now.) (Done. I needed to play with signal handling and the server protocol a bit to make emacsclient behave as a normal UNIX program wrt foreground/background process groups.) --- There is a flicker during the startup of `emacs -nw'; it's as if +-- There is a flicker during the startup of 'emacs -nw'; it's as if the terminal is initialized, reset and then initialized again. Debug this. (Hint: narrow_foreground_group is called twice during startup.) @@ -973,7 +969,7 @@ DIARY OF CHANGES (It was an internal interface that may be changed when necessary.) --- Change Lisp code not to (getenv "TERM"); use the `tty-type' frame +-- Change Lisp code not to (getenv "TERM"); use the 'tty-type' frame parameter or the frame-tty-type function instead. (M-x tags-search "TERM" helps with this.) Update: Actually, all getenv invocations should be checked for multi-tty compatibility, and an interface @@ -983,7 +979,7 @@ DIARY OF CHANGES calls should be mostly left as they are.) -- Add an elaborate mechanism for display-local variables. (There are - already a few of these; search for `terminal-local' in the Elisp + already a few of these; search for 'terminal-local' in the Elisp manual.) (Not needed. Display-local variables could be emulated by @@ -1002,7 +998,7 @@ DIARY OF CHANGES emacsclient process for server tty frames.) (Update: Not really; Vlocale_coding_system is still global.) --- Make `struct display' accessible to Lisp programs. Accessor functions: +-- Make 'struct display' accessible to Lisp programs. Accessor functions: (displayp OBJECT): Returns t if OBJECT is a display. => Implemented as display-live-p. @@ -1020,7 +1016,7 @@ DIARY OF CHANGES => Already implemented, see frames-on-display-list. (display-type DISPLAY): Returns the type of DISPLAY, as a - symbol. (See `framep'.) + symbol. (See 'framep'.) => Implemented as display-live-p. (display-device DISPLAY): Returns the name of the device that @@ -1053,7 +1049,7 @@ DIARY OF CHANGES (Done.) -- Support multiple character locales. A version of - `set-locale-environment' needs to be written for setting up + 'set-locale-environment' needs to be written for setting up display-local settings on ttys. I think calling set-display-table-and-terminal-coding-system and set-keyboard-coding-system would be enough. The language @@ -1066,7 +1062,7 @@ DIARY OF CHANGES them to tweak only frame-local settings, if possible. (They tend to call define-key to set function key sequences a lot.) - (Done, by making `function-key-map' terminal-local (i.e., part of + (Done, by making 'function-key-map' terminal-local (i.e., part of struct kboard). This has probably covered all the remaining problems.) -- xt-mouse.el needs to be adapted for multi-tty. It currently @@ -1083,8 +1079,8 @@ DIARY OF CHANGES This only seems to affect displays that are of the same terminfo type as the selected one. Interestingly, in screen Emacs normally - reports the up arrow key as `M-o A', but after the above SNAFU, it - complains about `M-[ a'. UNIX ttys are a complete mystery to me, + reports the up arrow key as 'M-o A', but after the above SNAFU, it + complains about 'M-[ a'. UNIX ttys are a complete mystery to me, but it seems the reset-reinitialize cycle somehow leaves the non-selected terminals in a different state than usual. I have no idea how this could happen. @@ -1132,15 +1128,15 @@ DIARY OF CHANGES clear what binding is in effect in any given time. See if current_kboard (or at least the terminal-local bindings exported to Lisp) might be changed to be tied to the selected frame instead. - Currently, `function-key-map' and `key-translation-map' may be + Currently, 'function-key-map' and 'key-translation-map' may be accessed reliably only using the hackish - `(set-)terminal-local-value' functions. + '(set-)terminal-local-value' functions. - Perhaps there should be a difference between `last-command' &co. + Perhaps there should be a difference between 'last-command' &co. and these more conventional configuration variables. - (E.g. `symbol-value' would use current_kboard to access - `last-command', but SELECTED_FRAME()->display->kboard to get the - value of `function-key-map'. + (E.g. 'symbol-value' would use current_kboard to access + 'last-command', but SELECTED_FRAME()->display->kboard to get the + value of 'function-key-map'. (Fixed in patch-434.) @@ -1151,7 +1147,7 @@ DIARY OF CHANGES below" was the set-input-mode madness.) (Update: this bug was fixed for good in patch-449. It was tracked - down to a bug in `read_key_sequence': it failed to reinitialize its + down to a bug in 'read_key_sequence': it failed to reinitialize its local function-key-map/key-translation-map references when it switched keyboards. I don't understand why did this bug only appear on brand new frames, though!) @@ -1163,35 +1159,35 @@ DIARY OF CHANGES -- Implement automatic forwarding of client environment variables to forked processes, as discussed on the multi-tty list. Terminal parameters are now accessible in C code, so the biggest obstacle is - gone. The `getenv_internal' and `child_setup' functions in + gone. The 'getenv_internal' and 'child_setup' functions in callproc.c must be changed to support the following variable: terminal-local-environment-variables is a variable defined in ... Enable or disable terminal-local environment variables. - If set to t, `getenv', `setenv' and subprocess creation + If set to t, 'getenv', 'setenv' and subprocess creation functions use the environment variables of the emacsclient process that created the selected frame, ignoring - `process-environment'. + 'process-environment'. - If set to nil, Emacs uses `process-environment' and ignores + If set to nil, Emacs uses 'process-environment' and ignores the client environment. - Otherwise, `terminal-local-environment-variables' should be a + Otherwise, 'terminal-local-environment-variables' should be a list of variable names (represented by Lisp strings) to look up in the client environment. The rest will come from - `process-environment'. + 'process-environment'. - (Implemented in patch-461; `terminal-getenv', `terminal-setenv' and - `with-terminal-environment' are now replaced by extensions to - `getenv' and `setenv', and the new `local-environment-variables' + (Implemented in patch-461; 'terminal-getenv', 'terminal-setenv' and + 'with-terminal-environment' are now replaced by extensions to + 'getenv' and 'setenv', and the new 'local-environment-variables' facility. Yay!) (Updated in patch-465 to fix the semantics of let-binding - `process-environment'. `process-environment' was changed to + 'process-environment'. 'process-environment' was changed to override all local/global environment variables, and a new variable - `global-environment' was introduced to have `process-environment's + 'global-environment' was introduced to have 'process-environment's old meaning.) (Updated in patch-466 to fix the case when two emacsclient sessions @@ -1199,27 +1195,27 @@ DIARY OF CHANGES environment lists are now stored as frame parameters, so the C-level terminal parameters are not strictly necessary any more.) --- `Fdelete_frame' is called from various critical places where it is +-- 'Fdelete_frame' is called from various critical places where it is not acceptable for the frame deletion to fail, e.g. from - x_connection_closed after an X error. `Fdelete_frame' now protects - against `delete-frame-functions' throwing an error and preventing a + x_connection_closed after an X error. 'Fdelete_frame' now protects + against 'delete-frame-functions' throwing an error and preventing a frame delete. (patch-475) -- Fix set-input-mode for multi-tty. It's a truly horrible interface; what if we'd blow it up into several separate functions (with a compatibility definition)? - (Done. See `set-input-interrupt-mode', `set-output-flow-control', - `set-input-meta-mode' and `set-quit-char'.) (patch-457) + (Done. See 'set-input-interrupt-mode', 'set-output-flow-control', + 'set-input-meta-mode' and 'set-quit-char'.) (patch-457) --- Let-binding `overriding-terminal-local-map' on a brand new frame - does not seem to work correctly. (See `fancy-splash-screens'.) +-- Let-binding 'overriding-terminal-local-map' on a brand new frame + does not seem to work correctly. (See 'fancy-splash-screens'.) The keymap seems to be set up right, but events go to another - terminal. Or is it `unread-command-events' that gets Emacs + terminal. Or is it 'unread-command-events' that gets Emacs confused? Investigate. (Emacs was confused because a process filter entered - `recursive-edit' while Emacs was reading input. I added support + 'recursive-edit' while Emacs was reading input. I added support for this in the input system.) (patch-489) -- I smell something funny around pop_kboard's "deleted kboard" case. @@ -1244,7 +1240,7 @@ DIARY OF CHANGES synchronously (with wait_reading_process_input), or asynchronously by SIGIO or polling (SIGALRM). C-g either sets the Vquit_flag, signals a 'quit condition (when immediate_quit), or throws to - `getcjmp' when Emacs was waiting for input when the C-g event + 'getcjmp' when Emacs was waiting for input when the C-g event arrived.) -- Replace wrong_kboard_jmpbuf with a special return value of @@ -1253,7 +1249,7 @@ DIARY OF CHANGES (Done in patch-500.) --- `tool-bar-mode', `scroll-bar-mode', `menu-bar-mode' and +-- 'tool-bar-mode', 'scroll-bar-mode', 'menu-bar-mode' and 'fringe-mode' are modes global to the entire Emacs session, not just a single frame or a single terminal. This means that their status sometimes differs from what's actually displayed on the @@ -1266,7 +1262,7 @@ DIARY OF CHANGES (Done in patch-537.) --- The `default-directory' variable should somehow be set to the +-- The 'default-directory' variable should somehow be set to the cwd of the emacsclient process when the user runs emacsclient without file arguments. Perhaps it is OK to just override the directory of the *scratch* buffer. @@ -1278,9 +1274,9 @@ DIARY OF CHANGES frame parameter) is not filled with the correct background color. It seems the border contents are drawn onto by the - update_single_window call in `x-show-tip'. After some debugging, I + update_single_window call in 'x-show-tip'. After some debugging, I think the window's background color is not set up - correctly---calling `x_clear_area' fills the specified area with + correctly---calling 'x_clear_area' fills the specified area with black, not light yellow. (Done in patch-544. A background_pixel field was defined both in diff --git a/admin/notes/newfile b/admin/notes/newfile index a682fec..072e966 100644 --- a/admin/notes/newfile +++ b/admin/notes/newfile @@ -6,7 +6,7 @@ CHECKLIST FOR ADDING A NEW FILE TO EMACS -*- outline -*- format, copyright and license notice, etc). ** Make sure the filename does not cause the DOS port any problems (8+3). -Run the `doschk' program like this: +Run the 'doschk' program like this: find /path/to/emacs -print | doschk diff --git a/admin/notes/repo b/admin/notes/repo index f38fd2c..b27a3f4 100644 --- a/admin/notes/repo +++ b/admin/notes/repo @@ -73,7 +73,7 @@ removes a file, then remove the corresponding files by hand. You may see conflicts in autoload md5sums in comments. Strictly speaking, the right thing to do is merge everything else, resolve the conflict by choosing either the master or branch version, then run -`make -C lisp autoloads' to update the md5sums to the correct master +'make -C lisp autoloads' to update the md5sums to the correct master value before committing. * Re-adding a file that has been removed from the repository @@ -96,12 +96,12 @@ which is often more appropriate. * Undoing a commit (uncommitting) -If you have not pushed the commit, you may be able to use `git reset +If you have not pushed the commit, you may be able to use 'git reset --hard' with a hash argument to revert the your local repo copy to the pre-commit state. If you have pushed commit, resetting will be ineffective because it -will only vanish the commit in your local copy. Instead, use `git +will only vanish the commit in your local copy. Instead, use 'git revert', giving it the commit ID as argument. This will create a new commit that backs out the change. Then push that. @@ -115,7 +115,7 @@ again. * Bisecting This is a semi-automated way to find the revision that introduced a bug. -Browse `git help bisect' for technical instructions. +Browse 'git help bisect' for technical instructions. * Maintaining ChangeLog history diff --git a/admin/notes/unicode b/admin/notes/unicode index 079173f..bdef4cb 100644 --- a/admin/notes/unicode +++ b/admin/notes/unicode @@ -97,11 +97,11 @@ regard to completeness. * iso-2022 charsets get unified on i/o. - With the change on 2003-01-06, decoding routines put `charset' - property to decoded text, and iso-2022 encoder pay attention + With the change on 2003-01-06, decoding routines put the 'charset' + property onto decoded text, and iso-2022 encoder pay attention to it. Thus, for instance, reading and writing by iso-2022-7bit preserve the original designation sequences. - The property name `preferred-charset' may be better? + The property name 'preferred-charset' may be better? We may have to utilize this property to decide a font. diff --git a/admin/quick-install-emacs b/admin/quick-install-emacs index 911b39b..55510fb 100755 --- a/admin/quick-install-emacs +++ b/admin/quick-install-emacs @@ -40,7 +40,7 @@ VERBOSE='' me="`basename $0`" -# Install commands (if the user specifies the `--verbose' option, it is +# Install commands (if the user specifies the '--verbose' option, it is # passed to these commands, so that feature only works if these commands # implement it too) LINK='cp -lf' @@ -58,7 +58,7 @@ unset LANG LC_ALL LC_MESSAGES # Some messages USAGE="Usage: $me [OPTION...] BUILD_TREE [PREFIX]" -TRY="Try "\`"$me --help' for more information." +TRY="Try '$me --help' for more information." # Parse command-line options while :; do @@ -93,7 +93,7 @@ Install emacs quickly --help display this help and exit --version output version information and exit -$me install emacs \`incrementally,' that is, it will +$me install emacs "incrementally", that is, it will install only those files that have changed since the last time it was invoked, and remove any obsolete files from the installation directories. It also uses hard-links into the source and build trees to @@ -104,9 +104,9 @@ and build directories reside. Optionally, $me can also remove old versions of automatically generated files that are version-specific (such as the -versioned emacs executables in the \`src' directory). -The latter action is called \`pruning,' and -can be enabled using the \`-p' or \`--prune' options. +versioned emacs executables in the 'src' directory). +The latter action is called "pruning", and +can be enabled using the '-p' or '--prune' options. EOF exit 0 ;; @@ -124,7 +124,7 @@ EOF set -- `echo $FIRST | sed 's/-\(.\)\(.*\)/-\1 -\2/'` "$@" ;; -*) - echo 1>&2 "$me: unrecognized option "\`"$1'" + echo 1>&2 "$me: unrecognized option '$1'" echo 1>&2 "$TRY" exit 1 ;; diff --git a/leim/README b/leim/README index 6a1fb32..d37be97 100644 --- a/leim/README +++ b/leim/README @@ -12,13 +12,13 @@ CXTERM-DIC: This directory contains source dictionaries (TIT format) for Chinese input method distributed with cxterm (Chinese version xterm). These dictionaries are automatically converted to Quail packages (Emacs Lisp -source files) by `make'. +source files) by 'make'. MISC-DIC: This directory contains various dictionaries for Chinese input methods. These dictionaries are automatically converted to Quail -packages (Emacs Lisp source files) by `make'. +packages (Emacs Lisp source files) by 'make'. SKK-DIC: diff --git a/lib-src/rcs2log b/lib-src/rcs2log index 2427603..d1bd369 100755 --- a/lib-src/rcs2log +++ b/lib-src/rcs2log @@ -414,7 +414,7 @@ sort $SORT_K_OPTIONS /dev/null || SORT_K_OPTIONS='+2 -4r +4 +0' # Get the full name of each author the logs mention, and set initialize_fullname -# to awk code that initializes the `fullname' awk associative array. +# to awk code that initializes the 'fullname' awk associative array. # Warning: foreign authors (i.e. not known in the passwd file) are mishandled; # you have to fix the resulting output by hand. @@ -546,8 +546,8 @@ esac # Function to print a single log line. # We don't use awk functions, to stay compatible with old awk versions. -# `Log' is the log message. -# `files' contains the affected files. +# 'Log' is the log message. +# 'files' contains the affected files. printlogline='{ # Following the GNU coding standards, rewrite @@ -587,7 +587,7 @@ printlogline='{ } }' -# Pattern to match the `revision' line of rlog output. +# Pattern to match the 'revision' line of rlog output. rlog_revision_pattern='^revision [0-9]+\.[0-9]+(\.[0-9]+\.[0-9]+)*(['"$tab"' ]+locked by: [^'"$tab"' $,.0-9:;@]*[^'"$tab"' $,:;@][^'"$tab"' $,.0-9:;@]*;)?['"$tab"' ]*$' case $hostname in diff --git a/lisp/term/README b/lisp/term/README index 35715d9..d01f133 100644 --- a/lisp/term/README +++ b/lisp/term/README @@ -7,22 +7,22 @@ terminal types. When Emacs opens a new terminal, it checks the TERM environment variable to see what type of terminal the user is running on. (If there is an entry -for TERM in the `term-file-aliases' variable, Emacs uses the associated value +for TERM in the 'term-file-aliases' variable, Emacs uses the associated value in place of TERM in the following.) Emacs searches for an elisp file named "term/${TERM}.el", and if one exists, loads it. If Emacs finds no suitable file, then it strips the last hyphen and what follows it from TERM, and tries again. If that still doesn't yield a file, then the previous hyphen is stripped, and so on until all hyphens are gone. For example, if the -terminal type is `aaa-48-foo', Emacs will try first `term/aaa-48-foo.el', then -`term/aaa-48.el' and finally `term/aaa.el'. Emacs stops searching at the +terminal type is 'aaa-48-foo', Emacs will try first 'term/aaa-48-foo.el', then +'term/aaa-48.el' and finally 'term/aaa.el'. Emacs stops searching at the first file found, and will not load more than one file for any terminal. Note that it is not an error if Emacs is unable to find a terminal initialization file; in that case, it will simply proceed with the next step without loading any files. Once the file has been loaded (or the search failed), Emacs tries to call a -function named `terminal-init-TERMINALNAME' (eg `terminal-init-aaa-48' for the -`aaa-48' terminal) in order to initialize the terminal. Once again, if the +function named 'terminal-init-TERMINALNAME' (eg 'terminal-init-aaa-48' for the +'aaa-48' terminal) in order to initialize the terminal. Once again, if the function is not found, Emacs strips the last component of the name and tries again using the shorter name. This search is independent of the previous file search, so that you can have terminal initialization functions for a family of @@ -40,7 +40,7 @@ declaration. Simply loading the file should not have any side effect. given terminal, when the first frame is created on it. The function is not called for subsequent frames on the same terminal. Therefore, terminal-init-* functions should only modify terminal-local variables (such as -`local-function-key-map') and terminal parameters. For example, it is not +'local-function-key-map') and terminal parameters. For example, it is not correct to modify frame parameters, since the modifications will only be applied for the first frame opened on the terminal. @@ -51,7 +51,7 @@ mind. First, about keycap names. Your terminal package can create any keycap cookies it likes, but there are good reasons to stick to the set recognized by the X-windows code whenever possible. The key symbols recognized by Emacs -are listed in src/term.c; look for the string `keys' in that file. +are listed in src/term.c; look for the string 'keys' in that file. For one thing, it means that you'll have the same Emacs key bindings on in terminal mode as on an X console. If there are differences, you can bet @@ -61,7 +61,7 @@ they'll frustrate you after you've forgotten about them. about. It tries to bind many of them to useful things at startup, before your .emacs is read (so you can override them). In some ways, the X keysym standard is a admittedly poor one; it's incomplete, and not well matched to the set of -`virtual keys' that UNIX terminfo(3) provides. But, trust us, the alternatives +'virtual keys' that UNIX terminfo(3) provides. But, trust us, the alternatives were worse. This doesn't mean that if your terminal has a "Cokebottle" key you shouldn't @@ -70,7 +70,7 @@ that set, try to pattern them on the standard terminfo variable names for clarity; also, for a fighting chance that your binding may be useful to someone else someday. - For example, if your terminal has a `find' key, observe that terminfo + For example, if your terminal has a 'find' key, observe that terminfo supports a key_find capability and call your cookie [find]. Here is a complete list, with corresponding X keysyms. @@ -184,14 +184,14 @@ key_f36 FQ function key 36 key_f64 k1 function key 64 (1) The terminfo documentation says this may be the 'insert character' or - `enter insert mode' key. Accordingly, key_ic is mapped to the `insertchar' - keysym if there is also a key_dc key; otherwise it's mapped to `insert'. - The presumption is that keyboards with `insert character' keys usually - have `delete character' keys paired with them. + 'enter insert mode' key. Accordingly, key_ic is mapped to the 'insertchar' + keysym if there is also a key_dc key; otherwise it's mapped to 'insert'. + The presumption is that keyboards with 'insert character' keys usually + have 'delete character' keys paired with them. (2) If there is no key_next key but there is a key_npage key, key_npage - will be bound to the `next' keysym. If there is no key_previous key but - there is a key_ppage key, key_ppage will be bound to the `previous' keysym. + will be bound to the 'next' keysym. If there is no key_previous key but + there is a key_ppage key, key_ppage will be bound to the 'previous' keysym. (3) Sorry, these are not exact but they're the best we can do. @@ -242,7 +242,7 @@ the setup code to bind anything else. If your terminal's arrow key sequences are so funky that they conflict with normal Emacs key bindings, the package should set up a function called -(enable-foo-arrow-keys), where `foo' becomes the terminal name, and leave +(enable-foo-arrow-keys), where 'foo' becomes the terminal name, and leave it up to the user's .emacs file whether to call it. Before writing a terminal-support package, it's a good idea to read the diff --git a/src/README b/src/README index ef08d14..adc782c 100644 --- a/src/README +++ b/src/README @@ -4,16 +4,15 @@ See the end of the file for license conditions. This directory contains the source files for the C component of GNU Emacs. Nothing in this directory is needed for using Emacs once it is built -and installed, if the dumped Emacs (on Unix systems) is copied elsewhere. +and installed, if the dumped Emacs is copied elsewhere. See the files ../README and then ../INSTALL for installation instructions. -Under GNU and Unix systems, the file `Makefile.in' is used as a -template by the script `../configure' to produce `Makefile'. This -is the file which actually controls the compilation of Emacs. -All of this should work transparently to the user; you should only -need to run `../configure', and then type `make'. - +The file 'Makefile.in' is used as a template by the script +'../configure' to produce 'Makefile'. This is the file which actually +controls the compilation of Emacs C source files. All of this should +work transparently; you should only need to change to the parent +directory, run './configure', and then run 'make'. This file is part of GNU Emacs. commit 279303adfc6d6ba91db788c2b85333e3fc46f39b Author: Paul Eggert Date: Fri Sep 11 08:34:46 2015 -0700 * CONTRIBUTE: Move send-email here from git-workflow. diff --git a/CONTRIBUTE b/CONTRIBUTE index 7e697dd..5821ee5 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -234,7 +234,9 @@ by following links from http://savannah.gnu.org/mail/?group=emacs . To email a patch you can use a shell command like 'git format-patch -1' to create a file, and then attach the file to your email. This nicely -packages the patch's commit message and changes. +packages the patch's commit message and changes. To send just one +such patch without additional remarks, you can use a command like +'git send-email --to=bug-gnu-emacs@gnu.org 0001-DESCRIPTION.patch'. ** Document your changes. diff --git a/admin/notes/git-workflow b/admin/notes/git-workflow index 40dfa6b..92dc791 100644 --- a/admin/notes/git-workflow +++ b/admin/notes/git-workflow @@ -50,18 +50,8 @@ Sending patches =============== If you lack push access or would like feedback before pushing a patch, -you can send a patch file as a bug report. After committing your -change locally, do: - -git format-patch -1 - -This creates a file 0001-DESCRIPTION.patch containing the patch, where -DESCRIPTION comes from the first line of your patch's commit message. -You can attach the patch file to email that you send to -bug-gnu-emacs@gnu.org. You can also configure git to email patches -directly (see ) and do: - -git send-email --to=bug-gnu-emacs@gnu.org 0001-DESCRIPTION.patch +you commit your change locally and then send a patch file as a bug report +as described in ../../CONTRIBUTE. Backporting to emacs-24 commit a0ec54ae073abd671bd43002eff0267f5fe8b306 Merge: 58e79d7 2498790 Author: Michael Albinus Date: Fri Sep 11 11:40:47 2015 +0200 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 58e79d70dd4b778bfda6bacfa66b54d0f32816c8 Author: Michael Albinus Date: Fri Sep 11 11:40:33 2015 +0200 Improve file notifications in Tramp * lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch): Set proper events to watch for. (tramp-sh-file-gvfs-monitor-dir-process-filter): Report only watched events. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 79b024e..d9490a0 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3727,6 +3727,14 @@ Fall back to normal file name handler if no Tramp handler exists." ;; gvfs-monitor-dir. ((setq command (tramp-get-remote-gvfs-monitor-dir v)) (setq filter 'tramp-sh-file-gvfs-monitor-dir-process-filter + events + (cond + ((and (memq 'change flags) (memq 'attribute-change flags)) + '(created changed changes-done-hint moved deleted + attribute-changed)) + ((memq 'change flags) + '(created changed changes-done-hint moved deleted)) + ((memq 'attribute-change flags) '(attribute-changed))) sequence `(,command ,localname))) ;; inotifywait. ((setq command (tramp-get-remote-inotifywait v)) @@ -3734,8 +3742,11 @@ Fall back to normal file name handler if no Tramp handler exists." events (cond ((and (memq 'change flags) (memq 'attribute-change flags)) - "create,modify,move,delete,attrib") - ((memq 'change flags) "create,modify,move,delete") + (concat "create,modify,move,moved_from,moved_to,move_self," + "delete,delete_self,attrib")) + ((memq 'change flags) + (concat "create,modify,move,moved_from,moved_to,move_self," + "delete,delete_self")) ((memq 'attribute-change flags) "attrib")) sequence `(,command "-mq" "-e" ,events ,localname))) ;; None. @@ -3758,12 +3769,15 @@ Fall back to normal file name handler if no Tramp handler exists." (mapconcat 'identity sequence " ")) (tramp-message v 6 "Run `%s', %S" (mapconcat 'identity sequence " ") p) (tramp-set-connection-property p "vector" v) + ;; Needed for `tramp-sh-file-gvfs-monitor-dir-process-filter'. + (tramp-compat-process-put p 'events events) (tramp-compat-set-process-query-on-exit-flag p nil) (set-process-filter p filter) p)))) (defun tramp-sh-file-gvfs-monitor-dir-process-filter (proc string) - "Read output from \"gvfs-monitor-dir\" and add corresponding file-notify events." + "Read output from \"gvfs-monitor-dir\" and add corresponding \ +file-notify events." (let ((remote-prefix (with-current-buffer (process-buffer proc) (file-remote-p default-directory))) @@ -3798,7 +3812,8 @@ Fall back to normal file name handler if no Tramp handler exists." ;; Usually, we would add an Emacs event now. Unfortunately, ;; `unread-command-events' does not accept several events at ;; once. Therefore, we apply the callback directly. - (tramp-compat-funcall 'file-notify-callback object))) + (when (member (cadr object) (tramp-compat-process-get proc 'events)) + (tramp-compat-funcall 'file-notify-callback object)))) ;; Save rest of the string. (when (zerop (length string)) (setq string nil))