commit d805757618092d5d46b8a95d2a046146c4916dc6 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Wed Feb 1 10:06:37 2017 +0100 Fix a subtle problem in Tramp with timers * lisp/net/tramp.el (tramp-accept-process-output): Change argument list. Make it work when called inside a timer. See . diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index fc7fdd3085..48dcd5edd1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3614,18 +3614,36 @@ connection buffer." ;;; Utility functions: -(defun tramp-accept-process-output (&optional proc timeout timeout-msecs) +(defun tramp-accept-process-output (proc timeout) "Like `accept-process-output' for Tramp processes. This is needed in order to hide `last-coding-system-used', which is set for process communication also." + ;; FIXME: There are problems, when an asynchronous process runs in + ;; parallel, and also timers are active. See + ;; . + (when (and timer-event-last + (string-prefix-p "*tramp/" (process-name proc)) + (let (result) + (maphash + (lambda (key _value) + (and (processp key) + (not (string-prefix-p "*tramp/" (process-name key))) + (tramp-compat-process-live-p key) + (setq result t))) + tramp-cache-data) + result)) + (sit-for 0.01 'nodisp)) (with-current-buffer (process-buffer proc) (let (buffer-read-only last-coding-system-used) ;; Under Windows XP, accept-process-output doesn't return - ;; sometimes. So we add an additional timeout. - (with-timeout ((or timeout 1)) - (accept-process-output proc timeout timeout-msecs (and proc t))) - (tramp-message proc 10 "%s %s\n%s" - proc (process-status proc) (buffer-string))))) + ;; sometimes. So we add an additional timeout. JUST-THIS-ONE + ;; is set due to Bug#12145. + (tramp-message + proc 10 "%s %s %s\n%s" + proc (process-status proc) + (with-timeout (timeout) + (accept-process-output proc timeout nil t)) + (buffer-string))))) (defun tramp-check-for-regexp (proc regexp) "Check, whether REGEXP is contained in process buffer of PROC. commit 12da2a5beafc4595fe4dd922431ba9f013b84830 Author: Mark Oteiza Date: Tue Jan 31 19:46:28 2017 -0500 ; Bump let-alist * lisp/emacs-lisp/let-alist.el: Bump micro version (bug#24641). diff --git a/lisp/emacs-lisp/let-alist.el b/lisp/emacs-lisp/let-alist.el index a45fc0a05c..cf82fe3ec6 100644 --- a/lisp/emacs-lisp/let-alist.el +++ b/lisp/emacs-lisp/let-alist.el @@ -4,7 +4,7 @@ ;; Author: Artur Malabarba ;; Package-Requires: ((emacs "24.1")) -;; Version: 1.0.4 +;; Version: 1.0.5 ;; Keywords: extensions lisp ;; Prefix: let-alist ;; Separator: - commit 5af51bd4451ae6d00ab878a7cfc6782280a81c84 Author: Ted Zlatanov Date: Tue Jan 31 14:17:58 2017 -0500 read-multiple-choice: explain dialog popups more * lisp/emacs-lisp/subr-x.el (read-multiple-choice): Explain when a graphical popup is used and how it can be avoided. diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 7736225b5f..52331b9ad3 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -214,6 +214,11 @@ user enters `recenter', `scroll-up', or `scroll-down' responses, perform the requested window recentering or scrolling and ask again. +When `use-dialog-box' is t (the default), this function can pop +up a dialog window to collect the user input. That functionality +requires `display-popup-menus-p' to return t. Otherwise, a text +dialog will be used. + The return value is the matching entry from the CHOICES list. Usage example: commit 52515f1133f2b87c573524d83c86b08e70ce1c30 Author: Ted Zlatanov Date: Tue Jan 31 14:12:41 2017 -0500 auth-source-user-and-password: add forgotten user parameter * lisp/auth-source.el (auth-source-user-and-password): Use accidentally unused "user" parameter. Reported by Oscar Najera . diff --git a/lisp/auth-source.el b/lisp/auth-source.el index c26935fcc9..7402ab21d7 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -2129,7 +2129,7 @@ MODE can be \"login\" or \"password\"." (if user (auth-source-search :host host - :user "yourusername" + :user user :max 1 :require '(:user :secret) :create nil) commit 5060ea50182f91695bb72622efcd4d1b69f56a1b Author: Simen Heggestøyl Date: Tue Jan 31 20:08:54 2017 +0100 Fix typo in a NEWS entry for CSS mode diff --git a/etc/NEWS b/etc/NEWS index 18ab162bd2..86a8385ae7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -614,7 +614,7 @@ Completion candidates for HTML classes and IDs are retrieved from open HTML mode buffers. --- -*** CSS mode now binds 'C-h s' to a function that will show +*** CSS mode now binds 'C-h S' to a function that will show information about a CSS construct (an at-rule, property, pseudo-class, pseudo-element, with the default being guessed from context). By default the information is looked up on the Mozilla Developer Network, commit d1c931009004aef847105b7bac6b6ffafd985b82 Author: Lars Ingebrigtsen Date: Tue Jan 31 17:52:51 2017 +0100 DOn't use string-as-unibyte in Gnus * lisp/gnus/nnmail.el (nnmail-parse-active): Don't use string-as-unibyte. (nnmail-insert-xref): Ditto. * lisp/gnus/canlock.el (canlock-make-cancel-key): Ditto. * lisp/gnus/gnus-art.el (gnus-article-browse-html-parts): Ditto. * lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Ditto. (gnus-browse-foreign-server): Ditto. (gnus-browse-foreign-server): Ditto. * lisp/gnus/gnus-start.el (gnus-update-active-hashtb-from-killed): Ditto. (gnus-read-newsrc-el-file): Ditto. * lisp/gnus/mml.el (mml-generate-mime-1): Ditto. * lisp/gnus/nnir.el (nnir-get-active): Ditto. (nnir-get-active): Ditto. diff --git a/lisp/gnus/canlock.el b/lisp/gnus/canlock.el index 9e13ced467..6c28b1c66d 100644 --- a/lisp/gnus/canlock.el +++ b/lisp/gnus/canlock.el @@ -90,7 +90,7 @@ buffer does not look like a news message." (canlock-sha1 (concat opad (canlock-sha1 - (concat ipad (string-as-unibyte message-id)))))))) + (concat ipad (encode-coding-string message-id 'utf-8)))))))) (defun canlock-narrow-to-header () "Narrow the buffer to the head of the message." diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index a4ff840f75..d96c511ec0 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2938,7 +2938,8 @@ message header will be added to the bodies of the \"text/html\" parts." (encode-coding-string title coding)) body content)) - (setq eheader (string-as-unibyte (buffer-string)) + (setq eheader (encode-coding-string + (buffer-string) 'utf-8) body content))) (erase-buffer) (mm-disable-multibyte) diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index bed5993b9c..67744cebc8 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -821,12 +821,13 @@ claim them." (while (not (eobp)) (ignore-errors (push (cons - (string-as-unibyte + (encode-coding-string (buffer-substring (point) (progn (skip-chars-forward "^ \t") - (point)))) + (point))) + 'utf-8) (let ((last (read cur))) (cons (read cur) last))) groups)) @@ -834,7 +835,7 @@ claim them." (while (not (eobp)) (ignore-errors (push (cons - (string-as-unibyte + (encode-coding-string (if (eq (char-after) ?\") (read cur) (let ((p (point)) (name "")) @@ -846,7 +847,8 @@ claim them." (skip-chars-forward "^ \t\\\\") (setq name (concat name (buffer-substring p (point))))) - name))) + name)) + 'utf-8) (let ((last (read cur))) (cons (read cur) last))) groups)) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index be46339cd3..2cefc78fb9 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -1990,7 +1990,7 @@ backend check whether the group actually exists." (while lists (setq killed (car lists)) (while killed - (gnus-sethash (string-as-unibyte (car killed)) nil hashtb) + (gnus-sethash (encode-coding-string (car killed) 'utf-8) nil hashtb) (setq killed (cdr killed))) (setq lists (cdr lists))))) @@ -2453,7 +2453,7 @@ If FORCE is non-nil, the .newsrc file is read." (dolist (elem gnus-newsrc-alist) ;; Protect against broken .newsrc.el files. (when (car elem) - (setcar elem (string-as-unibyte (car elem))))) + (setcar elem (encode-coding-string (car elem) 'utf-8)))) (gnus-make-hashtable-from-newsrc-alist) (when (file-newer-than-file-p file ding-file) ;; Old format quick file diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 3a31349d37..aaadf0c777 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -696,9 +696,10 @@ be \"related\" or \"alternate\"." (set-buffer-multibyte nil) (cond ((cdr (assq 'buffer cont)) - (insert (string-as-unibyte + (insert (encode-coding-string (with-current-buffer (cdr (assq 'buffer cont)) - (buffer-string))))) + (buffer-string)) + 'utf-8))) ((and filename (not (equal (cdr (assq 'nofile cont)) "yes"))) (let ((coding-system-for-read mm-binary-coding-system)) diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 9640f2c746..174be65035 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -1818,19 +1818,20 @@ article came from is also searched." (if (eq (car method) 'nntp) (while (not (eobp)) (ignore-errors - (push (string-as-unibyte + (push (encode-coding-string (gnus-group-full-name (buffer-substring (point) (progn (skip-chars-forward "^ \t") (point))) - method)) + method) + 'utf-8) groups)) (forward-line)) (while (not (eobp)) (ignore-errors - (push (string-as-unibyte + (push (encode-coding-string (if (eq (char-after) ?\") (gnus-group-full-name (read cur) method) (let ((p (point)) (name "")) @@ -1842,7 +1843,8 @@ article came from is also searched." (skip-chars-forward "^ \t\\\\") (setq name (concat name (buffer-substring p (point))))) - (gnus-group-full-name name method)))) + (gnus-group-full-name name method))) + 'utf-8) groups)) (forward-line))))) groups)) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 3f2e08171e..224d5db542 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -665,7 +665,7 @@ nn*-request-list should have been called before calling this function." (setq group (symbol-name group))) (if (and (numberp (setq max (read buffer))) (numberp (setq min (read buffer)))) - (push (list (string-as-unibyte group) (cons min max)) + (push (list (encode-coding-string group 'utf-8) (cons min max)) group-assoc))) (error nil)) (widen) @@ -1251,8 +1251,9 @@ Return the number of characters in the body." (insert (if (mm-multibyte-p) (string-as-multibyte (format " %s:%d" (caar group-alist) (cdar group-alist))) - (string-as-unibyte - (format " %s:%d" (caar group-alist) (cdar group-alist))))) + (encode-coding-string + (format " %s:%d" (caar group-alist) (cdar group-alist)) + 'utf-8))) (setq group-alist (cdr group-alist))) (insert "\n"))) commit 18a3fccd89d04afc13ce7b4561e224874c317283 Author: Juri Linkov Date: Tue Jan 31 17:36:06 2017 +0100 Allow C-s C-w to yank ' to the search ring in the Gnus article buffer * lisp/gnus/gnus-art.el (gnus-article-mode-syntax-table): Make M-. in article buffers work for `foo' strings, and still allow C-s C-w to yank ' to the search ring (bug#22248). diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 43e1231914..a4ff840f75 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -1713,9 +1713,10 @@ regexp." ;; (modify-syntax-entry ?- "w" table) (modify-syntax-entry ?> ")<" table) (modify-syntax-entry ?< "(>" table) - ;; make M-. in article buffers work for `foo' strings - (modify-syntax-entry ?' " " table) - (modify-syntax-entry ?` " " table) + ;; make M-. in article buffers work for `foo' strings, + ;; and still allow C-s C-w to yank ' to the search ring + (modify-syntax-entry ?' "'" table) + (modify-syntax-entry ?` "'" table) table) "Syntax table used in article mode buffers. Initialized from `text-mode-syntax-table'.") commit a727a0303eb34858389cb4331944e0e63411f2ff Author: Paul Eggert Date: Tue Jan 31 08:29:02 2017 -0800 * src/alloc.c, src/lisp.h: Fix minor glitches in recent changes. diff --git a/src/alloc.c b/src/alloc.c index dd2b688f91..b59220c5d8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5437,7 +5437,8 @@ make_pure_vector (ptrdiff_t len) /* Copy all contents and parameters of TABLE to a new table allocated from pure space, return the purified table. */ static struct Lisp_Hash_Table * -purecopy_hash_table (struct Lisp_Hash_Table *table) { +purecopy_hash_table (struct Lisp_Hash_Table *table) +{ eassert (NILP (table->weak)); eassert (!NILP (table->pure)); @@ -5480,14 +5481,12 @@ Does not copy symbols. Copies strings without text properties. */) return purecopy (obj); } -struct pinned_object +/* Pinned objects are marked before every GC cycle. */ +static struct pinned_object { Lisp_Object object; struct pinned_object *next; -}; - -/* Pinned objects are marked before every GC cycle. */ -static struct pinned_object *pinned_objects; +} *pinned_objects; static Lisp_Object purecopy (Lisp_Object obj) @@ -5519,13 +5518,13 @@ purecopy (Lisp_Object obj) else if (HASH_TABLE_P (obj)) { struct Lisp_Hash_Table *table = XHASH_TABLE (obj); - /* We cannot purify hash tables which haven't been defined with + /* Do not purify hash tables which haven't been defined with :purecopy as non-nil or are weak - they aren't guaranteed to not change. */ if (!NILP (table->weak) || NILP (table->pure)) { - /* Instead, the hash table is added to the list of pinned objects, - and is marked before GC. */ + /* Instead, add the hash table to the list of pinned objects, + so that it will be marked during GC. */ struct pinned_object *o = xmalloc (sizeof *o); o->object = obj; o->next = pinned_objects; @@ -5755,11 +5754,8 @@ compact_undo_list (Lisp_Object list) static void mark_pinned_objects (void) { - struct pinned_object *pobj; - for (pobj = pinned_objects; pobj; pobj = pobj->next) - { - mark_object (pobj->object); - } + for (struct pinned_object *pobj = pinned_objects; pobj; pobj = pobj->next) + mark_object (pobj->object); } static void diff --git a/src/lisp.h b/src/lisp.h index 91c430fe98..58e2288988 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1995,8 +1995,8 @@ struct Lisp_Hash_Table hash table size to reduce collisions. */ Lisp_Object index; - /* Non-nil if the table can be purecopied. Any changes the table after - purecopy will result in an error. */ + /* Non-nil if the table can be purecopied. The table cannot be + changed afterwards. */ Lisp_Object pure; /* Only the fields above are traced normally by the GC. The ones below commit 52a1ce65d693daaa395e7d594ec441ab7b652d70 Author: Tino Calancha Date: Wed Feb 1 01:20:46 2017 +0900 * test/lisp/vc/diff-mode-tests.el: Require diff-mode. diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el index 3887afb59b..807a411fa5 100644 --- a/test/lisp/vc/diff-mode-tests.el +++ b/test/lisp/vc/diff-mode-tests.el @@ -18,6 +18,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Code: + +(require 'diff-mode) + (ert-deftest diff-mode-test-ignore-trailing-dashes () "Check to make sure we successfully ignore trailing -- made by commit 3506ec2b110b7de75e9e41657d97d04b04b9e6ff Author: Dima Kogan Date: Mon Jan 30 23:40:54 2017 -0800 New test for diff-mode handling trailing -- test/lisp/vc/diff-mode-tests.el: New test file diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el new file mode 100644 index 0000000000..3887afb59b --- /dev/null +++ b/test/lisp/vc/diff-mode-tests.el @@ -0,0 +1,199 @@ +;; Copyright (C) 2017 Free Software Foundation, Inc + +;; Author: Dima Kogan +;; Maintainer: emacs-devel@gnu.org + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + + +(ert-deftest diff-mode-test-ignore-trailing-dashes () + "Check to make sure we successfully ignore trailing -- made by +'git format-patch'. This is bug #9597" + + ;; I made a test repo, put some files in it, made arbitrary changes + ;; and invoked 'git format-patch' to get a patch out of it. The + ;; patch and the before and after versions of the files appear here. + ;; The test simply tries to apply the patch. The patch contains + ;; trailing --, which confused diff-mode previously + (let ((patch "From 18ed35640be496647e0a02fc155b4ee4a0490eca Mon Sep 17 00:00:00 2001 +From: Dima Kogan +Date: Mon, 30 Jan 2017 22:24:13 -0800 +Subject: [PATCH] test commit + +--- + fil | 3 --- + fil2 | 4 ---- + 2 files changed, 7 deletions(-) + +diff --git a/fil b/fil +index 10344f1..2a56245 100644 +--- a/fil ++++ b/fil +@@ -2,10 +2,8 @@ Afrocentrism + Americanisms + Americanization + Americanizations +-Americanized + Americanizes + Americanizing +-Andrianampoinimerina + Anglicanisms + Antananarivo + Apalachicola +@@ -15,6 +13,5 @@ Aristophanes + Aristotelian + Ashurbanipal + Australopithecus +-Austronesian + Bangladeshis + Barquisimeto +diff --git a/fil2 b/fil2 +index 8858f0d..86e8ea5 100644 +--- a/fil2 ++++ b/fil2 +@@ -1,20 +1,16 @@ + whippoorwills + whitewashing + wholehearted +-wholeheartedly + wholesomeness + wildernesses + windbreakers + wisecracking + withstanding +-woodcarvings + woolgathering + workstations + worthlessness + wretchedness + wristwatches +-wrongfulness + wrongheadedly + wrongheadedness +-xylophonists + youthfulness +-- +2.11.0 + +") + (fil_before "Afrocentrism +Americanisms +Americanization +Americanizations +Americanized +Americanizes +Americanizing +Andrianampoinimerina +Anglicanisms +Antananarivo +Apalachicola +Appalachians +Argentinians +Aristophanes +Aristotelian +Ashurbanipal +Australopithecus +Austronesian +Bangladeshis +Barquisimeto +") + (fil_after "Afrocentrism +Americanisms +Americanization +Americanizations +Americanizes +Americanizing +Anglicanisms +Antananarivo +Apalachicola +Appalachians +Argentinians +Aristophanes +Aristotelian +Ashurbanipal +Australopithecus +Bangladeshis +Barquisimeto +") + (fil2_before "whippoorwills +whitewashing +wholehearted +wholeheartedly +wholesomeness +wildernesses +windbreakers +wisecracking +withstanding +woodcarvings +woolgathering +workstations +worthlessness +wretchedness +wristwatches +wrongfulness +wrongheadedly +wrongheadedness +xylophonists +youthfulness +") + (fil2_after "whippoorwills +whitewashing +wholehearted +wholesomeness +wildernesses +windbreakers +wisecracking +withstanding +woolgathering +workstations +worthlessness +wretchedness +wristwatches +wrongheadedly +wrongheadedness +youthfulness +") + (temp-dir (make-temp-file "diff-mode-test" 'dir))) + + (let ((buf (find-file-noselect (format "%s/%s" temp-dir "fil" ))) + (buf2 (find-file-noselect (format "%s/%s" temp-dir "fil2")))) + (unwind-protect + (progn + (with-current-buffer buf (insert fil_before) (save-buffer)) + (with-current-buffer buf2 (insert fil2_before) (save-buffer)) + + (with-temp-buffer + (cd temp-dir) + (insert patch) + (beginning-of-buffer) + (diff-apply-hunk) + (diff-apply-hunk) + (diff-apply-hunk)) + + (should (equal (with-current-buffer buf (buffer-string)) + fil_after)) + (should (equal (with-current-buffer buf2 (buffer-string)) + fil2_after))) + + (ignore-errors + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf) + (with-current-buffer buf2 (set-buffer-modified-p nil)) + (kill-buffer buf2) + (delete-directory temp-dir 'recursive)))))) + + +(provide 'diff-mode-tests) commit 189df8262e54c486658784801da3e90b29a548df Author: Dima Kogan Date: Mon Jan 30 21:43:32 2017 -0800 Handle patch terminators produced by git and bzr patch export Patch by Juri Linkov posted in the #9597 bug report * lisp/vc/diff-mode.el (diff-sanity-check-hunk): Find and ignore terminator (Bug #9597, #5302) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index e609ca9f94..7ffa115bde 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -437,6 +437,9 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html") (defconst diff-hunk-header-re (concat "^\\(?:" diff-hunk-header-re-unified ".*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$")) (defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+ \\|\\*\\*\\* .+\n--- \\|[^-+!<>0-9@* \n]\\).+\n" (substring diff-hunk-header-re 1))) + +(defconst diff-separator-re "^--+ ?$") + (defvar diff-narrowed-to nil) (defun diff-hunk-style (&optional style) @@ -1537,15 +1540,20 @@ Only works for unified diffs." (pcase (char-after) (?\s (cl-decf before) (cl-decf after) t) (?- - (if (and (looking-at diff-file-header-re) - (zerop before) (zerop after)) - ;; No need to query: this is a case where two patches - ;; are concatenated and only counting the lines will - ;; give the right result. Let's just add an empty - ;; line so that our code which doesn't count lines - ;; will not get confused. - (progn (save-excursion (insert "\n")) nil) - (cl-decf before) t)) + (cond + ((and (looking-at diff-separator-re) + (zerop before) (zerop after)) + nil) + ((and (looking-at diff-file-header-re) + (zerop before) (zerop after)) + ;; No need to query: this is a case where two patches + ;; are concatenated and only counting the lines will + ;; give the right result. Let's just add an empty + ;; line so that our code which doesn't count lines + ;; will not get confused. + (save-excursion (insert "\n")) nil) + (t + (cl-decf before) t))) (?+ (cl-decf after) t) (_ (cond commit fbf74c158ea81ff6349f68760f8861c1c497c989 Author: Dima Kogan Date: Tue Jan 31 07:46:10 2017 -0800 Revert two accidental commits This reverts commit f3c77d11af65f3b319b1784b4c3cf08c51aa7997. This reverts commit 3c941b900007c9e79c00af0f21d88154f6d8af1a. diff --git a/lisp/comint.el b/lisp/comint.el index c82c3d09df..830f4ca88f 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1879,7 +1879,6 @@ Similarly for Soar, Scheme, etc." (let ((echo-len (- comint-last-input-end comint-last-input-start))) ;; Wait for all input to be echoed: - (while (and (> (+ comint-last-input-end echo-len) (point-max)) (accept-process-output proc) @@ -1891,7 +1890,6 @@ Similarly for Soar, Scheme, etc." ;; (+ comint-last-input-start ;; (- (point-max) comint-last-input-end)) nil comint-last-input-end (point-max))))) - (if (and (<= (+ comint-last-input-end echo-len) (point-max)) @@ -1903,7 +1901,6 @@ Similarly for Soar, Scheme, etc." ;; Certain parts of the text to be deleted may have ;; been mistaken for prompts. We have to prevent ;; problems when `comint-prompt-read-only' is non-nil. - (let ((inhibit-read-only t)) (delete-region comint-last-input-end (+ comint-last-input-end echo-len)) @@ -1912,7 +1909,6 @@ Similarly for Soar, Scheme, etc." (goto-char comint-last-input-end) (comint-update-fence))))))) - ;; This used to call comint-output-filter-functions, ;; but that scrolled the buffer in undesirable ways. (run-hook-with-args 'comint-output-filter-functions ""))))) @@ -2243,7 +2239,10 @@ the current line with any initial string matching the regexp (null (get-char-property (setq bof (field-beginning)) 'field))) (field-string-no-properties bof) (comint-bol) - (buffer-substring-no-properties (point) (line-end-position))))) + (buffer-substring-no-properties (point) + (if comint-use-prompt-regexp + (line-end-position) + (field-end)))))) (defun comint-copy-old-input () "Insert after prompt old input at point as new input to be edited. @@ -2670,7 +2669,7 @@ This command is like `M-.' in bash." (set-marker comint-insert-previous-argument-last-start-pos (point)) ;; Insert the argument. (let ((input-string (comint-previous-input-string 0))) - (when (string-match "[ \t\n]*&[ \t\n]*$" input-string) + (when (string-match "[ \t\n]*&" input-string) ;; strip terminating '&' (setq input-string (substring input-string 0 (match-beginning 0)))) (insert (comint-arguments input-string index index))) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index faa323f733..cb77148c28 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -816,60 +816,6 @@ Redefining FUNCTION also cancels it." '((depth . -100))) function) -;;;###autoload -;; (defun debug-on-set (symbol) -;; "Request FUNCTION to invoke debugger each time it is called. - -;; When called interactively, prompt for FUNCTION in the minibuffer. - -;; This works by modifying the definition of FUNCTION. If you tell the -;; debugger to continue, FUNCTION's execution proceeds. If FUNCTION is a -;; normal function or a macro written in Lisp, you can also step through -;; its execution. FUNCTION can also be a primitive that is not a special -;; form, in which case stepping is not possible. Break-on-entry for -;; primitive functions only works when that function is called from Lisp. - -;; Use \\[cancel-debug-on-entry] to cancel the effect of this command. -;; Redefining FUNCTION also cancels it." -;; (interactive -;; (let ((v (variable-at-point)) -;; (enable-recursive-minibuffers t) -;; (orig-buffer (current-buffer)) -;; val) -;; (setq val (completing-read -;; (if (symbolp v) -;; (format -;; "Debug on set to symbol (default %s): " v) -;; "Debug on set to symbol: ") -;; #'help--symbol-completion-table -;; (lambda (vv) -;; ;; In case the variable only exists in the buffer -;; ;; the command we switch back to that buffer before -;; ;; we examine the variable. -;; (with-current-buffer orig-buffer -;; (or (get vv 'variable-documentation) -;; (and (boundp vv) (not (keywordp vv)))))) -;; t nil nil -;; (if (symbolp v) (symbol-name v)))) -;; (list (if (equal val "") -;; v (intern val))))) - - - -;; (interactive -;; (let* ((var-default (variable-at-point)) -;; (var (completing-read -;; (if var-default -;; (format "Debug on set to symbol (default %s): " var-default) -;; "Debug on set to symbol: ") -;; nil -;; #'boundp -;; t nil nil (symbol-name var-default)))) -;; (list (if (equal var "") var-default (intern var))))) -;; (advice-add function :before #'debug--implement-debug-on-entry -;; '((depth . -100))) -;; function) - (defun debug--function-list () "List of functions currently set for debug on entry." (let ((funs '())) diff --git a/lisp/shell.el b/lisp/shell.el index c7ba64ecf4..c8a8555d63 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -1000,8 +1000,6 @@ command again." (let ((pt (point)) (regexp (concat - ;; comint-process-echoes is the thing that breaks the - ;; throbber (if comint-process-echoes ;; Skip command echo if the process echoes (concat "\\(" (regexp-quote shell-dirstack-query) "\n\\)") diff --git a/src/data.c b/src/data.c index 26ff994882..8e07bf01b4 100644 --- a/src/data.c +++ b/src/data.c @@ -1304,56 +1304,6 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, default: emacs_abort (); } - - const char* symname = SDATA(sym->name); - - if( EQ(Vwatch_object, symbol) ) - { - static int nest_level = 0; - if(nest_level++ == 0) - { - switch(sym->redirect) - { - case SYMBOL_PLAINVAL: - { - AUTO_STRING (format, "Setting symbol '%s'; redirect: SYMBOL_PLAINVAL"); - CALLN (Fmessage, format, SYMBOL_NAME (symbol)); - break; - } - case SYMBOL_VARALIAS: - { - AUTO_STRING (format, "Setting symbol '%s'; redirect: SYMBOL_VARALIAS"); - CALLN (Fmessage, format, SYMBOL_NAME (symbol)); - break; - } - case SYMBOL_LOCALIZED: - { - AUTO_STRING (format, "Setting symbol '%s'; redirect: SYMBOL_LOCALIZED"); - CALLN (Fmessage, format, SYMBOL_NAME (symbol)); - break; - } - case SYMBOL_FORWARDED: - { - AUTO_STRING (format, "Setting symbol '%s'; redirect: SYMBOL_FORWARDED"); - CALLN (Fmessage, format, SYMBOL_NAME (symbol)); - break; - } - - default: - { - AUTO_STRING (format, "Setting symbol '%s'; redirect: UNKNOWN"); - CALLN (Fmessage, format, SYMBOL_NAME (symbol)); - break; - } - } - } - nest_level--; - } - - - - - start: switch (sym->redirect) { diff --git a/src/fns.c b/src/fns.c index 9eabc1414f..136a2198c2 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5120,10 +5120,6 @@ On some platforms, file selection dialogs are also enabled if this is non-nil. */); use_dialog_box = 1; - DEFVAR_LISP("watch-object", Vwatch_object, - doc: /* Symbol to watch. */); - Vwatch_object = Qnil; - DEFVAR_BOOL ("use-file-dialog", use_file_dialog, doc: /* Non-nil means mouse commands use a file dialog to ask for files. This applies to commands from menus and tool bar buttons even when