aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-03-30 09:34:05 +0300
committerEli Zaretskii2013-03-30 09:34:05 +0300
commit627d532608d03416763595cb5077dacb1238f948 (patch)
tree9bbae3791997f19b1a93645131deb1027d77dd64
parenta433a2a74329d1125b5976bb5c4f1ea2d3ab7a84 (diff)
parent668284362c4189f6de2c617902f73725a59adfaf (diff)
downloademacs-627d532608d03416763595cb5077dacb1238f948.tar.gz
emacs-627d532608d03416763595cb5077dacb1238f948.zip
Merge from trunk.
-rw-r--r--ChangeLog6
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/ChangeLog32
-rw-r--r--lisp/emacs-lisp/edebug.el51
-rw-r--r--lisp/gnus/ChangeLog8
-rw-r--r--lisp/gnus/nnir.el50
-rw-r--r--lisp/kmacro.el21
-rw-r--r--lisp/mpc.el162
-rw-r--r--lisp/progmodes/subword.el20
-rw-r--r--lisp/subr.el52
-rw-r--r--lisp/thingatpt.el49
-rw-r--r--nt/ChangeLog12
-rw-r--r--nt/config.nt6
-rw-r--r--nt/inc/ms-w32.h1
-rw-r--r--src/ChangeLog23
-rw-r--r--src/indent.c11
-rw-r--r--src/keyboard.c11
-rw-r--r--src/lisp.h113
-rw-r--r--src/makefile.w32-in2
-rw-r--r--src/xdisp.c4
20 files changed, 383 insertions, 258 deletions
diff --git a/ChangeLog b/ChangeLog
index d245f6e2f9b..5bd1570c9e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,13 @@
12013-03-29 Aidan Gauland <aidalgol@no8wireless.co.nz>
2
3 * etc/NEWS: Added entry for em-tramp change in 2013-03-26T22:08:58Z!aidalgol@no8wireless.co.nz
4
12013-03-27 Paul Eggert <eggert@cs.ucla.edu> 52013-03-27 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * configure.ac (HAVE_XKBGETKEYBOARD): Remove. 7 * configure.ac (HAVE_XKBGETKEYBOARD): Remove.
4 Subsumed by HAVE_XKB. All uses changed. 8 Subsumed by HAVE_XKB. All uses changed.
5 9
62013-03-27 Aidan Gauland <aidalgol@no8wireless.co.nz 102013-03-27 Aidan Gauland <aidalgol@no8wireless.co.nz>
7 11
8 * lisp/eshell/em-unix.el: Moved su and sudo to... 12 * lisp/eshell/em-unix.el: Moved su and sudo to...
9 * lisp/eshell/em-tramp.el: ...Eshell tramp module 13 * lisp/eshell/em-tramp.el: ...Eshell tramp module
diff --git a/etc/NEWS b/etc/NEWS
index 74badc6bbef..06a5db2b1bd 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -239,6 +239,13 @@ which support POSIX ACLs.
239*** The commands `woman-default-faces' and `woman-monochrome-faces' 239*** The commands `woman-default-faces' and `woman-monochrome-faces'
240are obsolete. Customize the `woman-* faces instead. 240are obsolete. Customize the `woman-* faces instead.
241 241
242** Eshell
243
244*** Added Eshell-TRAMP module
245External su and sudo commands are now the default; the internal,
246TRAMP-using variants can still be used by enabling the eshell-tramp
247module.
248
242** Obsolete packages: 249** Obsolete packages:
243 250
244*** longlines.el is obsolete; use visual-line-mode instead. 251*** longlines.el is obsolete; use visual-line-mode instead.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6ba1ace546a..737a91e2e4a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,35 @@
12013-03-30 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * progmodes/subword.el: Back to using `forward-symbol'.
4
5 * subr.el (forward-whitespace, forward-symbol)
6 (forward-same-syntax): Move from thingatpt.el.
7
82013-03-29 Leo Liu <sdl.web@gmail.com>
9
10 * kmacro.el (kmacro-to-register): New command.
11 (kmacro-execute-from-register): New function.
12 (kmacro-keymap): Bind to 'x'. (Bug#14071)
13
142013-03-29 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * mpc.el: Use defvar-local and setq-local.
17 (mpc--proc-connect): Connection failures are not bugs.
18 (mpc-mode-map): `follow-link' only applies to the buffer's content.
19 (mpc-volume-map): Bind to the up-events.
20
212013-03-29 Teodor Zlatanov <tzz@lifelogs.com>
22
23 * progmodes/subword.el (superword-mode): Use `forward-sexp'
24 instead of `forward-symbol'.
25
262013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
27
28 * emacs-lisp/edebug.el (edebug-mode): Make it a minor mode.
29 (edebug--recursive-edit): Use it.
30 (edebug-kill-buffer): Don't let-bind kill-buffer-hook.
31 (edebug-temp-display-freq-count): Don't let-bind buffer-read-only.
32
12013-03-28 Leo Liu <sdl.web@gmail.com> 332013-03-28 Leo Liu <sdl.web@gmail.com>
2 34
3 * vc/vc-bzr.el (vc-bzr-revert): Don't backup. (Bug#14066) 35 * vc/vc-bzr.el (vc-bzr-revert): Don't backup. (Bug#14066)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 5a6fd4a0a22..4ecd244ebf2 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -54,6 +54,7 @@
54 54
55(require 'macroexp) 55(require 'macroexp)
56(eval-when-compile (require 'cl-lib)) 56(eval-when-compile (require 'cl-lib))
57(eval-when-compile (require 'pcase))
57 58
58;;; Options 59;;; Options
59 60
@@ -2072,11 +2073,6 @@ expressions; a `progn' form will be returned enclosing these forms."
2072 2073
2073(defvar edebug-active nil) ;; Non-nil when edebug is active 2074(defvar edebug-active nil) ;; Non-nil when edebug is active
2074 2075
2075;;; add minor-mode-alist entry
2076(or (assq 'edebug-active minor-mode-alist)
2077 (setq minor-mode-alist (cons (list 'edebug-active " *Debugging*")
2078 minor-mode-alist)))
2079
2080(defvar edebug-stack nil) 2076(defvar edebug-stack nil)
2081;; Stack of active functions evaluated via edebug. 2077;; Stack of active functions evaluated via edebug.
2082;; Should be nil at the top level. 2078;; Should be nil at the top level.
@@ -2715,8 +2711,7 @@ MSG is printed after `::::} '."
2715 ;; Start up a recursive edit inside of edebug. 2711 ;; Start up a recursive edit inside of edebug.
2716 ;; The current buffer is the edebug-buffer, which is put into edebug-mode. 2712 ;; The current buffer is the edebug-buffer, which is put into edebug-mode.
2717 ;; Assume that none of the variables below are buffer-local. 2713 ;; Assume that none of the variables below are buffer-local.
2718 (let ((edebug-buffer-read-only buffer-read-only) 2714 (let (;; match-data must be done in the outside buffer
2719 ;; match-data must be done in the outside buffer
2720 (edebug-outside-match-data 2715 (edebug-outside-match-data
2721 (with-current-buffer edebug-outside-buffer ; in case match buffer different 2716 (with-current-buffer edebug-outside-buffer ; in case match buffer different
2722 (match-data))) 2717 (match-data)))
@@ -2730,8 +2725,6 @@ MSG is printed after `::::} '."
2730 ;; during a recursive-edit 2725 ;; during a recursive-edit
2731 edebug-inside-windows 2726 edebug-inside-windows
2732 2727
2733 (edebug-outside-map (current-local-map))
2734
2735 ;; Save the outside value of executing macro. (here??) 2728 ;; Save the outside value of executing macro. (here??)
2736 (edebug-outside-executing-macro executing-kbd-macro) 2729 (edebug-outside-executing-macro executing-kbd-macro)
2737 (edebug-outside-pre-command-hook 2730 (edebug-outside-pre-command-hook
@@ -2804,10 +2797,9 @@ MSG is printed after `::::} '."
2804 (not (memq arg-mode '(after error)))) 2797 (not (memq arg-mode '(after error))))
2805 (message "Break")) 2798 (message "Break"))
2806 2799
2807 (setq buffer-read-only t)
2808 (setq signal-hook-function nil) 2800 (setq signal-hook-function nil)
2809 2801
2810 (edebug-mode) 2802 (edebug-mode 1)
2811 (unwind-protect 2803 (unwind-protect
2812 (recursive-edit) ; <<<<<<<<<< Recursive edit 2804 (recursive-edit) ; <<<<<<<<<< Recursive edit
2813 2805
@@ -2828,10 +2820,7 @@ MSG is printed after `::::} '."
2828 (set-buffer edebug-buffer) 2820 (set-buffer edebug-buffer)
2829 (if (memq edebug-execution-mode '(go Go-nonstop)) 2821 (if (memq edebug-execution-mode '(go Go-nonstop))
2830 (edebug-overlay-arrow)) 2822 (edebug-overlay-arrow))
2831 (setq buffer-read-only edebug-buffer-read-only) 2823 (edebug-mode -1))
2832 (use-local-map edebug-outside-map)
2833 (remove-hook 'kill-buffer-hook 'edebug-kill-buffer t)
2834 )
2835 ;; gotta have a buffer to let its buffer local variables be set 2824 ;; gotta have a buffer to let its buffer local variables be set
2836 (get-buffer-create " bogus edebug buffer")) 2825 (get-buffer-create " bogus edebug buffer"))
2837 ));; inner let 2826 ));; inner let
@@ -3773,7 +3762,9 @@ be installed in `emacs-lisp-mode-map'.")
3773 (interactive) 3762 (interactive)
3774 (describe-function 'edebug-mode)) 3763 (describe-function 'edebug-mode))
3775 3764
3776(defun edebug-mode () 3765(defvar edebug--mode-saved-vars nil)
3766
3767(define-minor-mode edebug-mode
3777 "Mode for Emacs Lisp buffers while in Edebug. 3768 "Mode for Emacs Lisp buffers while in Edebug.
3778 3769
3779In addition to all Emacs Lisp commands (except those that modify the 3770In addition to all Emacs Lisp commands (except those that modify the
@@ -3807,20 +3798,32 @@ Options:
3807`edebug-on-signal' 3798`edebug-on-signal'
3808`edebug-unwrap-results' 3799`edebug-unwrap-results'
3809`edebug-global-break-condition'" 3800`edebug-global-break-condition'"
3801 :lighter " *Debugging*"
3802 :keymap edebug-mode-map
3810 ;; If the user kills the buffer in which edebug is currently active, 3803 ;; If the user kills the buffer in which edebug is currently active,
3811 ;; exit to top level, because the edebug command loop can't usefully 3804 ;; exit to top level, because the edebug command loop can't usefully
3812 ;; continue running in such a case. 3805 ;; continue running in such a case.
3813 ;; 3806 ;;
3814 ;; Append `edebug-kill-buffer' to the hook to avoid interfering with 3807 (if (not edebug-mode)
3815 ;; other entries that are ungarded against deleted buffer. 3808 (progn
3816 (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t) 3809 (while edebug--mode-saved-vars
3817 (use-local-map edebug-mode-map)) 3810 (let ((setting (pop edebug--mode-saved-vars)))
3811 (if (consp setting)
3812 (set (car setting) (cdr setting))
3813 (kill-local-variable setting))))
3814 (remove-hook 'kill-buffer-hook 'edebug-kill-buffer t))
3815 (pcase-dolist (`(,var . ,val) '((buffer-read-only . t)))
3816 (push
3817 (if (local-variable-p var) var (cons var (symbol-value var)))
3818 edebug--mode-saved-vars)
3819 (set (make-local-variable var) val))
3820 ;; Append `edebug-kill-buffer' to the hook to avoid interfering with
3821 ;; other entries that are ungarded against deleted buffer.
3822 (add-hook 'kill-buffer-hook 'edebug-kill-buffer t t)))
3818 3823
3819(defun edebug-kill-buffer () 3824(defun edebug-kill-buffer ()
3820 "Used on `kill-buffer-hook' when Edebug is operating in a buffer of Lisp code." 3825 "Used on `kill-buffer-hook' when Edebug is operating in a buffer of Lisp code."
3821 (let (kill-buffer-hook) 3826 (run-with-timer 0 nil #'top-level))
3822 (kill-buffer (current-buffer)))
3823 (top-level))
3824 3827
3825;;; edebug eval list mode 3828;;; edebug eval list mode
3826 3829
@@ -4143,7 +4146,7 @@ reinstrument it."
4143It is removed when you hit any char." 4146It is removed when you hit any char."
4144 ;; This seems not to work with Emacs 18.59. It undoes too far. 4147 ;; This seems not to work with Emacs 18.59. It undoes too far.
4145 (interactive) 4148 (interactive)
4146 (let ((buffer-read-only nil)) 4149 (let ((inhibit-read-only t))
4147 (undo-boundary) 4150 (undo-boundary)
4148 (edebug-display-freq-count) 4151 (edebug-display-freq-count)
4149 (setq unread-command-events 4152 (setq unread-command-events
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index e42e7606313..3ea10f55df2 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,11 @@
12013-03-29 Andrew Cohen <cohen@bu.edu>
2
3 * nnir.el: Define 'number-sequence for xemacs.
4 (gnus-summary-create-nnir-group): New function to create an nnir group
5 from an nnir summary buffer based on the current query.
6 (nnir-request-create-group): Update to allow nnir group creation based
7 on the current query.
8
12013-03-28 Katsumi Yamaoka <yamaoka@jpl.org> 92013-03-28 Katsumi Yamaoka <yamaoka@jpl.org>
2 10
3 * nndraft.el (nndraft-request-expire-articles): 11 * nndraft.el (nndraft-request-expire-articles):
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index a48c6043e82..cf9de09eaa2 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -173,7 +173,15 @@
173 173
174;; For Emacs <22.2 and XEmacs. 174;; For Emacs <22.2 and XEmacs.
175(eval-and-compile 175(eval-and-compile
176 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) 176 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
177 (unless (fboundp 'number-sequence)
178 (defun number-sequence (from to)
179 (let (seq (n 0) (next from))
180 (while (<= next to)
181 (setq seq (cons next seq)
182 n (1+ n)
183 next (+ from n )))
184 (nreverse seq)))))
177 185
178(require 'nnoo) 186(require 'nnoo)
179(require 'gnus-group) 187(require 'gnus-group)
@@ -1840,24 +1848,38 @@ article came from is also searched."
1840 (add-hook 'gnus-summary-article-expire-hook 'nnir-registry-action t t)))) 1848 (add-hook 'gnus-summary-article-expire-hook 'nnir-registry-action t t))))
1841 1849
1842 1850
1851(defun gnus-summary-create-nnir-group ()
1852 (interactive)
1853 (let ((name (gnus-read-group "Group name: "))
1854 (method "nnir")
1855 (pgroup (if (gnus-group-prefixed-p gnus-newsgroup-name)
1856 gnus-newsgroup-name
1857 (gnus-group-prefixed-name
1858 gnus-newsgroup-name '(nnir "nnir")))))
1859 (with-current-buffer gnus-group-buffer
1860 (gnus-group-make-group
1861 name method nil
1862 (gnus-group-find-parameter pgroup)))))
1863
1843 1864
1844(deffoo nnir-request-create-group (group &optional server args) 1865(deffoo nnir-request-create-group (group &optional server args)
1845 (message "Creating nnir group %s" group) 1866 (message "Creating nnir group %s" group)
1846 (let ((group (gnus-group-prefixed-name group '(nnir "nnir"))) 1867 (let* ((group (gnus-group-prefixed-name group '(nnir "nnir")))
1847 (query-spec 1868 (specs (assoc 'nnir-specs args))
1848 (list (cons 'query 1869 (query-spec
1849 (read-string "Query: " nil 'nnir-search-history)))) 1870 (or (cdr (assoc 'nnir-query-spec specs))
1850 (group-spec (list (list (read-string "Server: " nil nil))))) 1871 (list (cons 'query
1851 (gnus-group-set-parameter 1872 (read-string "Query: " nil 'nnir-search-history)))))
1852 group 'nnir-specs 1873 (group-spec
1853 (list (cons 'nnir-query-spec query-spec) 1874 (or (cdr (assoc 'nnir-group-spec specs))
1854 (cons 'nnir-group-spec group-spec))) 1875 (list (list (read-string "Server: " nil nil)))))
1876 (nnir-specs (list (cons 'nnir-query-spec query-spec)
1877 (cons 'nnir-group-spec group-spec))))
1878 (gnus-group-set-parameter group 'nnir-specs nnir-specs)
1855 (gnus-group-set-parameter 1879 (gnus-group-set-parameter
1856 group 'nnir-artlist 1880 group 'nnir-artlist
1857 (setq nnir-artlist 1881 (or (cdr (assoc 'nnir-artlist args))
1858 (nnir-run-query 1882 (nnir-run-query nnir-specs)))
1859 (list (cons 'nnir-query-spec query-spec)
1860 (cons 'nnir-group-spec group-spec)))))
1861 (nnir-request-update-info group (gnus-get-info group))) 1883 (nnir-request-update-info group (gnus-get-info group)))
1862 t) 1884 t)
1863 1885
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index d573bd02397..4253fb87d5c 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -202,6 +202,7 @@ macro to be executed before appending to it."
202 ;; naming and binding 202 ;; naming and binding
203 (define-key map "b" 'kmacro-bind-to-key) 203 (define-key map "b" 'kmacro-bind-to-key)
204 (define-key map "n" 'kmacro-name-last-macro) 204 (define-key map "n" 'kmacro-name-last-macro)
205 (define-key map "x" 'kmacro-to-register)
205 map) 206 map)
206 "Keymap for keyboard macro commands.") 207 "Keymap for keyboard macro commands.")
207(defalias 'kmacro-keymap kmacro-keymap) 208(defalias 'kmacro-keymap kmacro-keymap)
@@ -836,6 +837,26 @@ Such a \"function\" cannot be called from Lisp, but it is a valid editor command
836 (put symbol 'kmacro t)) 837 (put symbol 'kmacro t))
837 838
838 839
840(defun kmacro-execute-from-register (k)
841 (let ((last-kbd-macro k))
842 (kmacro-call-macro current-prefix-arg)))
843
844(defun kmacro-to-register (r)
845 "Store the last keyboard macro in register R."
846 (interactive
847 (progn
848 (or last-kbd-macro (error "No keyboard macro defined"))
849 (list (read-char "Save to register: "))))
850 (set-register r (registerv-make
851 last-kbd-macro
852 :jump-func 'kmacro-execute-from-register
853 :print-func (lambda (k)
854 (princ (format "a keyboard macro:\n %s"
855 (format-kbd-macro k))))
856 :insert-func (lambda (k)
857 (insert (format-kbd-macro k))))))
858
859
839(defun kmacro-view-macro (&optional _arg) 860(defun kmacro-view-macro (&optional _arg)
840 "Display the last keyboard macro. 861 "Display the last keyboard macro.
841If repeated, it shows previous elements in the macro ring." 862If repeated, it shows previous elements in the macro ring."
diff --git a/lisp/mpc.el b/lisp/mpc.el
index a6494575a43..9d9da27f6da 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -192,7 +192,7 @@ numerically rather than lexicographically."
192;; to the fact that MPD tends to disconnect fairly often, although our 192;; to the fact that MPD tends to disconnect fairly often, although our
193;; constant polling often prevents disconnection. 193;; constant polling often prevents disconnection.
194(defvar mpc--find-memoize (make-hash-table :test 'equal)) ;; :weakness t 194(defvar mpc--find-memoize (make-hash-table :test 'equal)) ;; :weakness t
195(defvar mpc-tag nil) (make-variable-buffer-local 'mpc-tag) 195(defvar-local mpc-tag nil)
196 196
197;;; Support for the actual connection and MPD command execution ;;;;;;;;;;;; 197;;; Support for the actual connection and MPD command execution ;;;;;;;;;;;;
198 198
@@ -279,7 +279,9 @@ defaults to 6600 and HOST defaults to localhost."
279 (erase-buffer) 279 (erase-buffer)
280 (let* ((coding-system-for-read 'utf-8-unix) 280 (let* ((coding-system-for-read 'utf-8-unix)
281 (coding-system-for-write 'utf-8-unix) 281 (coding-system-for-write 'utf-8-unix)
282 (proc (open-network-stream "MPC" (current-buffer) host port))) 282 (proc (condition-case err
283 (open-network-stream "MPC" (current-buffer) host port)
284 (error (user-error (error-message-string err))))))
283 (when (processp mpc-proc) 285 (when (processp mpc-proc)
284 ;; Inherit the properties of the previous connection. 286 ;; Inherit the properties of the previous connection.
285 (let ((plist (process-plist mpc-proc))) 287 (let ((plist (process-plist mpc-proc)))
@@ -1079,7 +1081,11 @@ If PLAYLIST is t or nil or missing, use the main playlist."
1079 (define-key map [C-mouse-2] 'mpc-select-toggle) 1081 (define-key map [C-mouse-2] 'mpc-select-toggle)
1080 (define-key map [drag-mouse-2] 'mpc-drag-n-drop) 1082 (define-key map [drag-mouse-2] 'mpc-drag-n-drop)
1081 ;; We use `always' because a binding to t is like a binding to nil. 1083 ;; We use `always' because a binding to t is like a binding to nil.
1082 (define-key map [follow-link] 'always) 1084 (define-key map [follow-link] :always)
1085 ;; But follow-link doesn't apply blindly to header-line and
1086 ;; mode-line clicks.
1087 (define-key map [header-line follow-link] 'ignore)
1088 (define-key map [mode-line follow-link] 'ignore)
1083 ;; Doesn't work because the first click changes the buffer, so the second 1089 ;; Doesn't work because the first click changes the buffer, so the second
1084 ;; is applied elsewhere :-( 1090 ;; is applied elsewhere :-(
1085 ;; (define-key map [(double mouse-2)] 'mpc-play-at-point) 1091 ;; (define-key map [(double mouse-2)] 'mpc-play-at-point)
@@ -1136,17 +1142,18 @@ If PLAYLIST is t or nil or missing, use the main playlist."
1136 "Major mode for the features common to all buffers of MPC." 1142 "Major mode for the features common to all buffers of MPC."
1137 (buffer-disable-undo) 1143 (buffer-disable-undo)
1138 (setq buffer-read-only t) 1144 (setq buffer-read-only t)
1139 (set (make-local-variable 'tool-bar-map) mpc-tool-bar-map) 1145 (setq-local tool-bar-map mpc-tool-bar-map)
1140 (set (make-local-variable 'truncate-lines) t)) 1146 (setq-local truncate-lines t))
1141 1147
1142;;; The mpc-status-mode buffer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1148;;; The mpc-status-mode buffer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1143 1149
1144(define-derived-mode mpc-status-mode mpc-mode "MPC-Status" 1150(define-derived-mode mpc-status-mode mpc-mode "MPC-Status"
1145 "Major mode to display MPC status info." 1151 "Major mode to display MPC status info."
1146 (set (make-local-variable 'mode-line-format) 1152 (setq-local mode-line-format
1147 '("%e" mode-line-frame-identification mode-line-buffer-identification)) 1153 '("%e" mode-line-frame-identification
1148 (set (make-local-variable 'window-area-factor) 3) 1154 mode-line-buffer-identification))
1149 (set (make-local-variable 'header-line-format) '("MPC " mpc-volume))) 1155 (setq-local window-area-factor 3)
1156 (setq-local header-line-format '("MPC " mpc-volume)))
1150 1157
1151(defvar mpc-status-buffer-format 1158(defvar mpc-status-buffer-format
1152 '("%-5{Time} / %{Duration} %2{Disc--}%4{Track}" "%{Title}" "%{Album}" "%{Artist}" "%128{Cover}")) 1159 '("%-5{Time} / %{Duration} %2{Disc--}%4{Track}" "%{Title}" "%{Album}" "%{Artist}" "%128{Cover}"))
@@ -1188,8 +1195,7 @@ If PLAYLIST is t or nil or missing, use the main playlist."
1188 1195
1189(defvar mpc-separator-ol nil) 1196(defvar mpc-separator-ol nil)
1190 1197
1191(defvar mpc-select nil) 1198(defvar-local mpc-select nil)
1192(make-variable-buffer-local 'mpc-select)
1193 1199
1194(defmacro mpc-select-save (&rest body) 1200(defmacro mpc-select-save (&rest body)
1195 "Execute BODY and restore the selection afterwards." 1201 "Execute BODY and restore the selection afterwards."
@@ -1420,20 +1426,18 @@ when constructing the set of constraints."
1420;;; The TagBrowser mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1426;;; The TagBrowser mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1421 1427
1422(defconst mpc-tagbrowser-all-name (propertize "*ALL*" 'face 'italic)) 1428(defconst mpc-tagbrowser-all-name (propertize "*ALL*" 'face 'italic))
1423(defvar mpc-tagbrowser-all-ol nil) 1429(defvar-local mpc-tagbrowser-all-ol nil)
1424(make-variable-buffer-local 'mpc-tagbrowser-all-ol) 1430(defvar-local mpc-tag-name nil)
1425(defvar mpc-tag-name nil) (make-variable-buffer-local 'mpc-tag-name)
1426(defun mpc-tagbrowser-all-p () 1431(defun mpc-tagbrowser-all-p ()
1427 (and (eq (point-min) (line-beginning-position)) 1432 (and (eq (point-min) (line-beginning-position))
1428 (equal mpc-tagbrowser-all-name 1433 (equal mpc-tagbrowser-all-name
1429 (buffer-substring (point-min) (line-end-position))))) 1434 (buffer-substring (point-min) (line-end-position)))))
1430 1435
1431(define-derived-mode mpc-tagbrowser-mode mpc-mode '("MPC-" mpc-tag-name) 1436(define-derived-mode mpc-tagbrowser-mode mpc-mode '("MPC-" mpc-tag-name)
1432 (set (make-local-variable 'mode-line-process) '("" mpc-tag-name)) 1437 (setq-local mode-line-process '("" mpc-tag-name))
1433 (set (make-local-variable 'mode-line-format) nil) 1438 (setq-local mode-line-format nil)
1434 (set (make-local-variable 'header-line-format) '("" mpc-tag-name ;; "s" 1439 (setq-local header-line-format '("" mpc-tag-name)) ;; "s"
1435 )) 1440 (setq-local buffer-undo-list t)
1436 (set (make-local-variable 'buffer-undo-list) t)
1437 ) 1441 )
1438 1442
1439(defun mpc-tagbrowser-refresh () 1443(defun mpc-tagbrowser-refresh ()
@@ -1539,14 +1543,14 @@ when constructing the set of constraints."
1539 (let ((ol (make-overlay (point) (line-beginning-position 2)))) 1543 (let ((ol (make-overlay (point) (line-beginning-position 2))))
1540 (overlay-put ol 'face 'region) 1544 (overlay-put ol 'face 'region)
1541 (overlay-put ol 'evaporate t) 1545 (overlay-put ol 'evaporate t)
1542 (set (make-local-variable 'mpc-tagbrowser-all-ol) ol)))))) 1546 (setq-local mpc-tagbrowser-all-ol ol))))))
1543 1547
1544;; (defvar mpc-constraints nil) 1548;; (defvar mpc-constraints nil)
1545(defun mpc-separator (active) 1549(defun mpc-separator (active)
1546 ;; Place a separator mark. 1550 ;; Place a separator mark.
1547 (unless mpc-separator-ol 1551 (unless mpc-separator-ol
1548 (set (make-local-variable 'mpc-separator-ol) 1552 (setq-local mpc-separator-ol
1549 (make-overlay (point) (point))) 1553 (make-overlay (point) (point)))
1550 (overlay-put mpc-separator-ol 'after-string 1554 (overlay-put mpc-separator-ol 'after-string
1551 (propertize "\n" 1555 (propertize "\n"
1552 'face '(:height 0.05 :inverse-video t)))) 1556 'face '(:height 0.05 :inverse-video t))))
@@ -1605,7 +1609,7 @@ Return non-nil if a selection was deactivated."
1605 (let ((constraints (mpc-constraints-get-current (current-buffer))) 1609 (let ((constraints (mpc-constraints-get-current (current-buffer)))
1606 (active 'all)) 1610 (active 'all))
1607 ;; (unless (equal constraints mpc-constraints) 1611 ;; (unless (equal constraints mpc-constraints)
1608 ;; (set (make-local-variable 'mpc-constraints) constraints) 1612 ;; (setq-local mpc-constraints constraints)
1609 (dolist (cst constraints) 1613 (dolist (cst constraints)
1610 (let ((vals (apply 'mpc-union 1614 (let ((vals (apply 'mpc-union
1611 (mapcar (lambda (val) 1615 (mapcar (lambda (val)
@@ -1672,7 +1676,7 @@ Return non-nil if a selection was deactivated."
1672;; '(mpc-tagbrowser-dir-hide-prefix)) 1676;; '(mpc-tagbrowser-dir-hide-prefix))
1673 1677
1674(define-derived-mode mpc-tagbrowser-dir-mode mpc-tagbrowser-mode '("MPC-" mpc-tag-name) 1678(define-derived-mode mpc-tagbrowser-dir-mode mpc-tagbrowser-mode '("MPC-" mpc-tag-name)
1675 ;; (set (make-local-variable 'font-lock-defaults) 1679 ;; (setq-local font-lock-defaults
1676 ;; '(mpc-tagbrowser-dir-keywords t)) 1680 ;; '(mpc-tagbrowser-dir-keywords t))
1677 ) 1681 )
1678 1682
@@ -1705,10 +1709,9 @@ Return non-nil if a selection was deactivated."
1705 1709
1706;;; Playlist management ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1710;;; Playlist management ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1707 1711
1708(defvar mpc-songs-playlist nil 1712(defvar-local mpc-songs-playlist nil
1709 "Name of the currently selected playlist, if any. 1713 "Name of the currently selected playlist, if any.
1710A value of t means the main playlist.") 1714A value of t means the main playlist.")
1711(make-variable-buffer-local 'mpc-songs-playlist)
1712 1715
1713(defun mpc-playlist-create (name) 1716(defun mpc-playlist-create (name)
1714 "Save current playlist under name NAME." 1717 "Save current playlist under name NAME."
@@ -1775,12 +1778,14 @@ A value of t means the main playlist.")
1775 1778
1776(defvar mpc-volume-map 1779(defvar mpc-volume-map
1777 (let ((map (make-sparse-keymap))) 1780 (let ((map (make-sparse-keymap)))
1778 (define-key map [down-mouse-1] 'mpc-volume-mouse-set) 1781 ;; Bind the up-events rather than the down-event, so the
1779 (define-key map [mouse-1] 'ignore) 1782 ;; `message' isn't canceled by the subsequent up-event binding.
1780 (define-key map [header-line down-mouse-1] 'mpc-volume-mouse-set) 1783 (define-key map [down-mouse-1] 'ignore)
1781 (define-key map [header-line mouse-1] 'ignore) 1784 (define-key map [mouse-1] 'mpc-volume-mouse-set)
1782 (define-key map [mode-line down-mouse-1] 'mpc-volume-mouse-set) 1785 (define-key map [header-line mouse-1] 'mpc-volume-mouse-set)
1783 (define-key map [mode-line mouse-1] 'ignore) 1786 (define-key map [header-line down-mouse-1] 'ignore)
1787 (define-key map [mode-line mouse-1] 'mpc-volume-mouse-set)
1788 (define-key map [mode-line down-mouse-1] 'ignore)
1784 map)) 1789 map))
1785 1790
1786(defvar mpc-volume nil) (put 'mpc-volume 'risky-local-variable t) 1791(defvar mpc-volume nil) (put 'mpc-volume 'risky-local-variable t)
@@ -1945,9 +1950,9 @@ This is used so that they can be compared with `eq', which is needed for
1945 (search-backward (cdr curline) nil t)) 1950 (search-backward (cdr curline) nil t))
1946 (beginning-of-line) 1951 (beginning-of-line)
1947 (goto-char (point-min))) 1952 (goto-char (point-min)))
1948 (set (make-local-variable 'mpc-songs-totaltime) 1953 (setq-local mpc-songs-totaltime
1949 (unless (zerop totaltime) 1954 (unless (zerop totaltime)
1950 (list " " (mpc-secs-to-time totaltime)))) 1955 (list " " (mpc-secs-to-time totaltime))))
1951 )))) 1956 ))))
1952 (let ((mpc-songpointer-set-visible t)) 1957 (let ((mpc-songpointer-set-visible t))
1953 (mpc-songpointer-refresh))) 1958 (mpc-songpointer-refresh)))
@@ -2056,46 +2061,47 @@ This is used so that they can be compared with `eq', which is needed for
2056(define-derived-mode mpc-songs-mode mpc-mode "MPC-song" 2061(define-derived-mode mpc-songs-mode mpc-mode "MPC-song"
2057 (setq mpc-songs-format-description 2062 (setq mpc-songs-format-description
2058 (with-temp-buffer (mpc-format mpc-songs-format 'self) (buffer-string))) 2063 (with-temp-buffer (mpc-format mpc-songs-format 'self) (buffer-string)))
2059 (set (make-local-variable 'header-line-format) 2064 (setq-local header-line-format
2060 ;; '("MPC " mpc-volume " " mpc-current-song) 2065 ;; '("MPC " mpc-volume " " mpc-current-song)
2061 (list (propertize " " 'display '(space :align-to 0)) 2066 (list (propertize " " 'display '(space :align-to 0))
2062 ;; 'mpc-songs-format-description 2067 ;; 'mpc-songs-format-description
2063 '(:eval 2068 '(:eval
2064 (let ((hscroll (window-hscroll))) 2069 (let ((hscroll (window-hscroll)))
2065 (with-temp-buffer 2070 (with-temp-buffer
2066 (mpc-format mpc-songs-format 'self hscroll) 2071 (mpc-format mpc-songs-format 'self hscroll)
2067 ;; That would be simpler than the hscroll handling in 2072 ;; That would be simpler than the hscroll handling in
2068 ;; mpc-format, but currently move-to-column does not 2073 ;; mpc-format, but currently move-to-column does not
2069 ;; recognize :space display properties. 2074 ;; recognize :space display properties.
2070 ;; (move-to-column hscroll) 2075 ;; (move-to-column hscroll)
2071 ;; (delete-region (point-min) (point)) 2076 ;; (delete-region (point-min) (point))
2072 (buffer-string)))))) 2077 (buffer-string))))))
2073 (set (make-local-variable 'mode-line-format) 2078 (setq-local
2074 '("%e" mode-line-frame-identification mode-line-buffer-identification 2079 mode-line-format
2075 #(" " 0 3 2080 '("%e" mode-line-frame-identification mode-line-buffer-identification
2076 (help-echo "mouse-1: Select (drag to resize)\nmouse-2: Make current window occupy the whole frame\nmouse-3: Remove current window from display")) 2081 #(" " 0 3
2077 mode-line-position 2082 (help-echo "mouse-1: Select (drag to resize)\nmouse-2: Make current window occupy the whole frame\nmouse-3: Remove current window from display"))
2078 #(" " 0 2 2083 mode-line-position
2079 (help-echo "mouse-1: Select (drag to resize)\nmouse-2: Make current window occupy the whole frame\nmouse-3: Remove current window from display")) 2084 #(" " 0 2
2080 mpc-songs-totaltime 2085 (help-echo "mouse-1: Select (drag to resize)\nmouse-2: Make current window occupy the whole frame\nmouse-3: Remove current window from display"))
2081 mpc-current-updating 2086 mpc-songs-totaltime
2082 #(" " 0 2 2087 mpc-current-updating
2083 (help-echo "mouse-1: Select (drag to resize)\nmouse-2: Make current window occupy the whole frame\nmouse-3: Remove current window from display")) 2088 #(" " 0 2
2084 (mpc--song-search 2089 (help-echo "mouse-1: Select (drag to resize)\nmouse-2: Make current window occupy the whole frame\nmouse-3: Remove current window from display"))
2085 (:propertize 2090 (mpc--song-search
2086 ("Search=\"" mpc--song-search "\"") 2091 (:propertize
2087 help-echo "mouse-2: kill this search" 2092 ("Search=\"" mpc--song-search "\"")
2088 follow-link t 2093 help-echo "mouse-2: kill this search"
2089 mouse-face mode-line-highlight 2094 follow-link t
2090 keymap (keymap (mode-line keymap 2095 mouse-face mode-line-highlight
2091 (mouse-2 . mpc-songs-kill-search)))) 2096 keymap (keymap (mode-line keymap
2092 (:propertize "NoSearch" 2097 (mouse-2 . mpc-songs-kill-search))))
2093 help-echo "mouse-2: set a search restriction" 2098 (:propertize "NoSearch"
2094 follow-link t 2099 help-echo "mouse-2: set a search restriction"
2095 mouse-face mode-line-highlight 2100 follow-link t
2096 keymap (keymap (mode-line keymap (mouse-2 . mpc-songs-search))))))) 2101 mouse-face mode-line-highlight
2097 2102 keymap (keymap (mode-line keymap (mouse-2 . mpc-songs-search)))))))
2098 ;; (set (make-local-variable 'mode-line-process) 2103
2104 ;; (setq-local mode-line-process
2099 ;; '("" ;; mpc-volume " " 2105 ;; '("" ;; mpc-volume " "
2100 ;; mpc-songs-totaltime 2106 ;; mpc-songs-totaltime
2101 ;; mpc-current-updating)) 2107 ;; mpc-current-updating))
@@ -2111,7 +2117,7 @@ This is used so that they can be compared with `eq', which is needed for
2111 (<= (window-start win) overlay-arrow-position) 2117 (<= (window-start win) overlay-arrow-position)
2112 (< overlay-arrow-position (window-end win))))))) 2118 (< overlay-arrow-position (window-end win)))))))
2113 (unless (local-variable-p 'overlay-arrow-position) 2119 (unless (local-variable-p 'overlay-arrow-position)
2114 (set (make-local-variable 'overlay-arrow-position) (make-marker))) 2120 (setq-local overlay-arrow-position (make-marker)))
2115 (move-marker overlay-arrow-position pos) 2121 (move-marker overlay-arrow-position pos)
2116 ;; If the arrow was visible, try to keep it that way. 2122 ;; If the arrow was visible, try to keep it that way.
2117 (if (and visible pos 2123 (if (and visible pos
@@ -2613,8 +2619,8 @@ This is used so that they can be compared with `eq', which is needed for
2613 (window-minibuffer-p)) 2619 (window-minibuffer-p))
2614 (ignore-errors (select-frame (make-frame mpc-frame-alist))) 2620 (ignore-errors (select-frame (make-frame mpc-frame-alist)))
2615 (with-current-buffer song-buf 2621 (with-current-buffer song-buf
2616 (set (make-local-variable 'mpc-previous-window-config) 2622 (setq-local mpc-previous-window-config
2617 (current-window-configuration)))) 2623 (current-window-configuration))))
2618 (let* ((win1 (selected-window)) 2624 (let* ((win1 (selected-window))
2619 (win2 (split-window)) 2625 (win2 (split-window))
2620 (tags mpc-browser-tags)) 2626 (tags mpc-browser-tags))
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index 24abfa8a053..6cb4713885e 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -154,7 +154,7 @@ as words.
154 "Do the same as `forward-word' but on subwords. 154 "Do the same as `forward-word' but on subwords.
155See the command `subword-mode' for a description of subwords. 155See the command `subword-mode' for a description of subwords.
156Optional argument ARG is the same as for `forward-word'." 156Optional argument ARG is the same as for `forward-word'."
157 (interactive "p") 157 (interactive "^p")
158 (unless arg (setq arg 1)) 158 (unless arg (setq arg 1))
159 (cond 159 (cond
160 ((< 0 arg) 160 ((< 0 arg)
@@ -168,16 +168,26 @@ Optional argument ARG is the same as for `forward-word'."
168 168
169(put 'subword-forward 'CUA 'move) 169(put 'subword-forward 'CUA 'move)
170 170
171(defalias 'subword-right 'subword-forward)
172
173(defun subword-backward (&optional arg) 171(defun subword-backward (&optional arg)
174 "Do the same as `backward-word' but on subwords. 172 "Do the same as `backward-word' but on subwords.
175See the command `subword-mode' for a description of subwords. 173See the command `subword-mode' for a description of subwords.
176Optional argument ARG is the same as for `backward-word'." 174Optional argument ARG is the same as for `backward-word'."
177 (interactive "p") 175 (interactive "^p")
178 (subword-forward (- (or arg 1)))) 176 (subword-forward (- (or arg 1))))
179 177
180(defalias 'subword-left 'subword-backward) 178(defun subword-right (&optional arg)
179 "Do the same as `right-word' but on subwords."
180 (interactive "^p")
181 (if (eq (current-bidi-paragraph-direction) 'left-to-right)
182 (subword-forward arg)
183 (subword-backward arg)))
184
185(defun subword-left (&optional arg)
186 "Do the same as `left-word' but on subwords."
187 (interactive "^p")
188 (if (eq (current-bidi-paragraph-direction) 'left-to-right)
189 (subword-backward arg)
190 (subword-forward arg)))
181 191
182(defun subword-mark (arg) 192(defun subword-mark (arg)
183 "Do the same as `mark-word' but on subwords. 193 "Do the same as `mark-word' but on subwords.
diff --git a/lisp/subr.el b/lisp/subr.el
index 4eb46ec2b01..0fed34cfe1e 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3839,6 +3839,58 @@ node `(elisp)Syntax Table Internals' for a list of codes.
3839If SYNTAX is nil, return nil." 3839If SYNTAX is nil, return nil."
3840 (and syntax (logand (car syntax) 65535))) 3840 (and syntax (logand (car syntax) 65535)))
3841 3841
3842;; Utility motion commands
3843
3844;; Whitespace
3845
3846(defun forward-whitespace (arg)
3847 "Move point to the end of the next sequence of whitespace chars.
3848Each such sequence may be a single newline, or a sequence of
3849consecutive space and/or tab characters.
3850With prefix argument ARG, do it ARG times if positive, or move
3851backwards ARG times if negative."
3852 (interactive "^p")
3853 (if (natnump arg)
3854 (re-search-forward "[ \t]+\\|\n" nil 'move arg)
3855 (while (< arg 0)
3856 (if (re-search-backward "[ \t]+\\|\n" nil 'move)
3857 (or (eq (char-after (match-beginning 0)) ?\n)
3858 (skip-chars-backward " \t")))
3859 (setq arg (1+ arg)))))
3860
3861;; Symbols
3862
3863(defun forward-symbol (arg)
3864 "Move point to the next position that is the end of a symbol.
3865A symbol is any sequence of characters that are in either the
3866word constituent or symbol constituent syntax class.
3867With prefix argument ARG, do it ARG times if positive, or move
3868backwards ARG times if negative."
3869 (interactive "^p")
3870 (if (natnump arg)
3871 (re-search-forward "\\(\\sw\\|\\s_\\)+" nil 'move arg)
3872 (while (< arg 0)
3873 (if (re-search-backward "\\(\\sw\\|\\s_\\)+" nil 'move)
3874 (skip-syntax-backward "w_"))
3875 (setq arg (1+ arg)))))
3876
3877;; Syntax blocks
3878
3879(defun forward-same-syntax (&optional arg)
3880 "Move point past all characters with the same syntax class.
3881With prefix argument ARG, do it ARG times if positive, or move
3882backwards ARG times if negative."
3883 (interactive "^p")
3884 (or arg (setq arg 1))
3885 (while (< arg 0)
3886 (skip-syntax-backward
3887 (char-to-string (char-syntax (char-before))))
3888 (setq arg (1+ arg)))
3889 (while (> arg 0)
3890 (skip-syntax-forward (char-to-string (char-syntax (char-after))))
3891 (setq arg (1- arg))))
3892
3893
3842;;;; Text clones 3894;;;; Text clones
3843 3895
3844(defun text-clone-maintain (ol1 after beg end &optional _len) 3896(defun text-clone-maintain (ol1 after beg end &optional _len)
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 259cd772b12..f71a0d4647c 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -529,60 +529,11 @@ with angle brackets.")
529 (buffer-substring-no-properties 529 (buffer-substring-no-properties
530 (car boundary-pair) (cdr boundary-pair)))))) 530 (car boundary-pair) (cdr boundary-pair))))))
531 531
532;; Whitespace
533
534(defun forward-whitespace (arg)
535 "Move point to the end of the next sequence of whitespace chars.
536Each such sequence may be a single newline, or a sequence of
537consecutive space and/or tab characters.
538With prefix argument ARG, do it ARG times if positive, or move
539backwards ARG times if negative."
540 (interactive "p")
541 (if (natnump arg)
542 (re-search-forward "[ \t]+\\|\n" nil 'move arg)
543 (while (< arg 0)
544 (if (re-search-backward "[ \t]+\\|\n" nil 'move)
545 (or (eq (char-after (match-beginning 0)) ?\n)
546 (skip-chars-backward " \t")))
547 (setq arg (1+ arg)))))
548
549;; Buffer 532;; Buffer
550 533
551(put 'buffer 'end-op (lambda () (goto-char (point-max)))) 534(put 'buffer 'end-op (lambda () (goto-char (point-max))))
552(put 'buffer 'beginning-op (lambda () (goto-char (point-min)))) 535(put 'buffer 'beginning-op (lambda () (goto-char (point-min))))
553 536
554;; Symbols
555
556(defun forward-symbol (arg)
557 "Move point to the next position that is the end of a symbol.
558A symbol is any sequence of characters that are in either the
559word constituent or symbol constituent syntax class.
560With prefix argument ARG, do it ARG times if positive, or move
561backwards ARG times if negative."
562 (interactive "p")
563 (if (natnump arg)
564 (re-search-forward "\\(\\sw\\|\\s_\\)+" nil 'move arg)
565 (while (< arg 0)
566 (if (re-search-backward "\\(\\sw\\|\\s_\\)+" nil 'move)
567 (skip-syntax-backward "w_"))
568 (setq arg (1+ arg)))))
569
570;; Syntax blocks
571
572(defun forward-same-syntax (&optional arg)
573 "Move point past all characters with the same syntax class.
574With prefix argument ARG, do it ARG times if positive, or move
575backwards ARG times if negative."
576 (interactive "p")
577 (or arg (setq arg 1))
578 (while (< arg 0)
579 (skip-syntax-backward
580 (char-to-string (char-syntax (char-before))))
581 (setq arg (1+ arg)))
582 (while (> arg 0)
583 (skip-syntax-forward (char-to-string (char-syntax (char-after))))
584 (setq arg (1- arg))))
585
586;; Aliases 537;; Aliases
587 538
588(defun word-at-point () 539(defun word-at-point ()
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 03bd86a3216..59e8ec5b95a 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,15 @@
12013-03-29 Eli Zaretskii <eliz@gnu.org>
2
3 * inc/ms-w32.h (copysign) [_MSC_VER]: Redirect to _copysign.
4
5 * config.nt (HAVE_COPYSIGN): Define.
6
72013-03-29 Juanma Barranquero <lekktu@gmail.com>
8
9 * config.nt: Sync with autogen/config.in.
10 (HAVE_XKBGETKEYBOARD): Remove.
11 (HAVE_XKB): New macro.
12
12013-03-27 Eli Zaretskii <eliz@gnu.org> 132013-03-27 Eli Zaretskii <eliz@gnu.org>
2 14
3 * makefile.w32-in (all-other-dirs-nmake, all-other-dirs-gmake) 15 * makefile.w32-in (all-other-dirs-nmake, all-other-dirs-gmake)
diff --git a/nt/config.nt b/nt/config.nt
index 3d606258fc0..a7e2dce3e06 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -251,7 +251,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
251#undef HAVE_COM_ERR_H 251#undef HAVE_COM_ERR_H
252 252
253/* Define to 1 if you have the `copysign' function. */ 253/* Define to 1 if you have the `copysign' function. */
254#undef HAVE_COPYSIGN 254#define HAVE_COPYSIGN 1
255 255
256/* Define to 1 if data_start is the address of the start of the main data 256/* Define to 1 if data_start is the address of the start of the main data
257 segment. */ 257 segment. */
@@ -1113,8 +1113,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1113/* Define to 1 if XIM is available */ 1113/* Define to 1 if XIM is available */
1114#undef HAVE_XIM 1114#undef HAVE_XIM
1115 1115
1116/* Define to 1 if you have the XkbGetKeyboard function. */ 1116/* Define to 1 if you have the Xkb extension. */
1117#undef HAVE_XKBGETKEYBOARD 1117#undef HAVE_XKB
1118 1118
1119/* Define to 1 if you have the Xpm library (-lXpm). */ 1119/* Define to 1 if you have the Xpm library (-lXpm). */
1120#undef HAVE_XPM 1120#undef HAVE_XPM
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 46e47c5c4e8..a6a16111ddd 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -268,6 +268,7 @@ extern int sys_unlink (const char *);
268typedef int pid_t; 268typedef int pid_t;
269#define snprintf _snprintf 269#define snprintf _snprintf
270#define strtoll _strtoi64 270#define strtoll _strtoi64
271#define copysign _copysign
271#endif 272#endif
272#define isatty _isatty 273#define isatty _isatty
273#define _longjmp longjmp 274#define _longjmp longjmp
diff --git a/src/ChangeLog b/src/ChangeLog
index 77338e6c46f..14e21e402d6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,26 @@
12013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * indent.c (current_column_bol_cache): Remove leftover which is not
4 used in Fmove_to_column any more.
5 (current_column, scan_for_column): Adjust users.
6 * keyboard.c (last_point_position_buffer, last_point_position_window):
7 Remove leftovers which are not used for recording undo any more.
8 (command_loop_1, syms_of_keyboard): Adjust users.
9 * xdisp.c (last_max_ascent): Remove leftover which is not used in
10 redisplay_window any more.
11 (move_it_to): Adjust user.
12
132013-03-29 Juanma Barranquero <lekktu@gmail.com>
14
15 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
16 Update dependencies.
17
182013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19
20 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
21 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
22 forward references.
23
12013-03-28 Dmitry Antipov <dmantipov@yandex.ru> 242013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
2 25
3 * window.h (struct window): Replace hchild, vchild and buffer slots 26 * window.h (struct window): Replace hchild, vchild and buffer slots
diff --git a/src/indent.c b/src/indent.c
index 1493e1d5ee5..345dfaa9ce3 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -56,11 +56,6 @@ static EMACS_INT last_known_column_modified;
56static ptrdiff_t current_column_1 (void); 56static ptrdiff_t current_column_1 (void);
57static ptrdiff_t position_indentation (ptrdiff_t); 57static ptrdiff_t position_indentation (ptrdiff_t);
58 58
59/* Cache of beginning of line found by the last call of
60 current_column. */
61
62static ptrdiff_t current_column_bol_cache;
63
64/* Get the display table to use for the current buffer. */ 59/* Get the display table to use for the current buffer. */
65 60
66struct Lisp_Char_Table * 61struct Lisp_Char_Table *
@@ -439,11 +434,6 @@ current_column (void)
439 col += post_tab; 434 col += post_tab;
440 } 435 }
441 436
442 if (ptr == BEGV_ADDR)
443 current_column_bol_cache = BEGV;
444 else
445 current_column_bol_cache = BYTE_TO_CHAR (PTR_BYTE_POS (ptr));
446
447 last_known_column = col; 437 last_known_column = col;
448 last_known_column_point = PT; 438 last_known_column_point = PT;
449 last_known_column_modified = MODIFF; 439 last_known_column_modified = MODIFF;
@@ -525,7 +515,6 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, ptrdiff_t *prevcol)
525 { 515 {
526 ptrdiff_t opoint = PT, opoint_byte = PT_BYTE; 516 ptrdiff_t opoint = PT, opoint_byte = PT_BYTE;
527 scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1); 517 scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1);
528 current_column_bol_cache = PT;
529 scan = PT, scan_byte = PT_BYTE; 518 scan = PT, scan_byte = PT_BYTE;
530 SET_PT_BOTH (opoint, opoint_byte); 519 SET_PT_BOTH (opoint, opoint_byte);
531 next_boundary = scan; 520 next_boundary = scan;
diff --git a/src/keyboard.c b/src/keyboard.c
index 5b2eb8c7cd2..beba3025887 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -210,12 +210,6 @@ static EMACS_INT last_auto_save;
210/* The value of point when the last command was started. */ 210/* The value of point when the last command was started. */
211static ptrdiff_t last_point_position; 211static ptrdiff_t last_point_position;
212 212
213/* The buffer that was current when the last command was started. */
214static Lisp_Object last_point_position_buffer;
215
216/* The window that was selected when the last command was started. */
217static Lisp_Object last_point_position_window;
218
219/* The frame in which the last input event occurred, or Qmacro if the 213/* The frame in which the last input event occurred, or Qmacro if the
220 last event came from a macro. We use this to determine when to 214 last event came from a macro. We use this to determine when to
221 generate switch-frame events. This may be cleared by functions 215 generate switch-frame events. This may be cleared by functions
@@ -1512,8 +1506,6 @@ command_loop_1 (void)
1512 prev_buffer = current_buffer; 1506 prev_buffer = current_buffer;
1513 prev_modiff = MODIFF; 1507 prev_modiff = MODIFF;
1514 last_point_position = PT; 1508 last_point_position = PT;
1515 last_point_position_window = selected_window;
1516 XSETBUFFER (last_point_position_buffer, prev_buffer);
1517 1509
1518 /* By default, we adjust point to a boundary of a region that 1510 /* By default, we adjust point to a boundary of a region that
1519 has such a property that should be treated intangible 1511 has such a property that should be treated intangible
@@ -11047,9 +11039,6 @@ syms_of_keyboard (void)
11047 Fset (Qinput_method_exit_on_first_char, Qnil); 11039 Fset (Qinput_method_exit_on_first_char, Qnil);
11048 Fset (Qinput_method_use_echo_area, Qnil); 11040 Fset (Qinput_method_use_echo_area, Qnil);
11049 11041
11050 last_point_position_buffer = Qnil;
11051 last_point_position_window = Qnil;
11052
11053 { 11042 {
11054 int i; 11043 int i;
11055 int len = sizeof (head_table) / sizeof (head_table[0]); 11044 int len = sizeof (head_table) / sizeof (head_table[0]);
diff --git a/src/lisp.h b/src/lisp.h
index 897addc90c1..4481a2e3373 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -552,11 +552,6 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
552} 552}
553 553
554 554
555/* Forward declarations. */
556
557LISP_INLINE bool SAVE_VALUEP (Lisp_Object);
558LISP_INLINE struct Lisp_Save_Value *XSAVE_VALUE (Lisp_Object);
559
560/* Extract a value or address from a Lisp_Object. */ 555/* Extract a value or address from a Lisp_Object. */
561 556
562#define XCONS(a) (eassert (CONSP (a)), \ 557#define XCONS(a) (eassert (CONSP (a)), \
@@ -1487,53 +1482,6 @@ struct Lisp_Save_Value
1487 } data[SAVE_VALUE_SLOTS]; 1482 } data[SAVE_VALUE_SLOTS];
1488 }; 1483 };
1489 1484
1490/* Return the type of V's Nth saved value. */
1491LISP_INLINE int
1492save_type (struct Lisp_Save_Value *v, int n)
1493{
1494 eassert (0 <= n && n < SAVE_VALUE_SLOTS);
1495 return (v->save_type >> (SAVE_SLOT_BITS * n) & ((1 << SAVE_SLOT_BITS) - 1));
1496}
1497
1498/* Get and set the Nth saved pointer. */
1499
1500LISP_INLINE void *
1501XSAVE_POINTER (Lisp_Object obj, int n)
1502{
1503 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER);
1504 return XSAVE_VALUE (obj)->data[n].pointer;;
1505}
1506LISP_INLINE void
1507set_save_pointer (Lisp_Object obj, int n, void *val)
1508{
1509 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER);
1510 XSAVE_VALUE (obj)->data[n].pointer = val;
1511}
1512
1513/* Likewise for the saved integer. */
1514
1515LISP_INLINE ptrdiff_t
1516XSAVE_INTEGER (Lisp_Object obj, int n)
1517{
1518 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER);
1519 return XSAVE_VALUE (obj)->data[n].integer;
1520}
1521LISP_INLINE void
1522set_save_integer (Lisp_Object obj, int n, ptrdiff_t val)
1523{
1524 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER);
1525 XSAVE_VALUE (obj)->data[n].integer = val;
1526}
1527
1528/* Extract Nth saved object. */
1529
1530LISP_INLINE Lisp_Object
1531XSAVE_OBJECT (Lisp_Object obj, int n)
1532{
1533 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_OBJECT);
1534 return XSAVE_VALUE (obj)->data[n].object;
1535}
1536
1537/* A miscellaneous object, when it's on the free list. */ 1485/* A miscellaneous object, when it's on the free list. */
1538struct Lisp_Free 1486struct Lisp_Free
1539 { 1487 {
@@ -1555,13 +1503,6 @@ union Lisp_Misc
1555 struct Lisp_Save_Value u_save_value; 1503 struct Lisp_Save_Value u_save_value;
1556 }; 1504 };
1557 1505
1558LISP_INLINE struct Lisp_Save_Value *
1559XSAVE_VALUE (Lisp_Object a)
1560{
1561 eassert (SAVE_VALUEP (a));
1562 return & XMISC (a)->u_save_value;
1563}
1564
1565/* Forwarding pointer to an int variable. 1506/* Forwarding pointer to an int variable.
1566 This is allowed only in the value cell of a symbol, 1507 This is allowed only in the value cell of a symbol,
1567 and it means that the symbol's value really lives in the 1508 and it means that the symbol's value really lives in the
@@ -1854,6 +1795,60 @@ SAVE_VALUEP (Lisp_Object x)
1854 return MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value; 1795 return MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value;
1855} 1796}
1856 1797
1798LISP_INLINE struct Lisp_Save_Value *
1799XSAVE_VALUE (Lisp_Object a)
1800{
1801 eassert (SAVE_VALUEP (a));
1802 return & XMISC (a)->u_save_value;
1803}
1804
1805/* Return the type of V's Nth saved value. */
1806LISP_INLINE int
1807save_type (struct Lisp_Save_Value *v, int n)
1808{
1809 eassert (0 <= n && n < SAVE_VALUE_SLOTS);
1810 return (v->save_type >> (SAVE_SLOT_BITS * n) & ((1 << SAVE_SLOT_BITS) - 1));
1811}
1812
1813/* Get and set the Nth saved pointer. */
1814
1815LISP_INLINE void *
1816XSAVE_POINTER (Lisp_Object obj, int n)
1817{
1818 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER);
1819 return XSAVE_VALUE (obj)->data[n].pointer;;
1820}
1821LISP_INLINE void
1822set_save_pointer (Lisp_Object obj, int n, void *val)
1823{
1824 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER);
1825 XSAVE_VALUE (obj)->data[n].pointer = val;
1826}
1827
1828/* Likewise for the saved integer. */
1829
1830LISP_INLINE ptrdiff_t
1831XSAVE_INTEGER (Lisp_Object obj, int n)
1832{
1833 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER);
1834 return XSAVE_VALUE (obj)->data[n].integer;
1835}
1836LISP_INLINE void
1837set_save_integer (Lisp_Object obj, int n, ptrdiff_t val)
1838{
1839 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER);
1840 XSAVE_VALUE (obj)->data[n].integer = val;
1841}
1842
1843/* Extract Nth saved object. */
1844
1845LISP_INLINE Lisp_Object
1846XSAVE_OBJECT (Lisp_Object obj, int n)
1847{
1848 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_OBJECT);
1849 return XSAVE_VALUE (obj)->data[n].object;
1850}
1851
1857#define AUTOLOADP(x) (CONSP (x) && EQ (Qautoload, XCAR (x))) 1852#define AUTOLOADP(x) (CONSP (x) && EQ (Qautoload, XCAR (x)))
1858 1853
1859#define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int) 1854#define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int)
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 93f12900dde..aacc258cd11 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -873,6 +873,7 @@ $(BLD)/filelock.$(O) : \
873 $(CHARACTER_H) \ 873 $(CHARACTER_H) \
874 $(CODING_H) \ 874 $(CODING_H) \
875 $(CONFIG_H) \ 875 $(CONFIG_H) \
876 $(C_CTYPE_H) \
876 $(LISP_H) \ 877 $(LISP_H) \
877 $(SYSTIME_H) 878 $(SYSTIME_H)
878 879
@@ -1398,6 +1399,7 @@ $(BLD)/sysdep.$(O) : \
1398 $(NT_INC)/netdb.h \ 1399 $(NT_INC)/netdb.h \
1399 $(NT_INC)/pwd.h \ 1400 $(NT_INC)/pwd.h \
1400 $(NT_INC)/sys/file.h \ 1401 $(NT_INC)/sys/file.h \
1402 $(NT_INC)/sys/param.h \
1401 $(NT_INC)/sys/stat.h \ 1403 $(NT_INC)/sys/stat.h \
1402 $(NT_INC)/unistd.h \ 1404 $(NT_INC)/unistd.h \
1403 $(GNU_LIB)/execinfo.h \ 1405 $(GNU_LIB)/execinfo.h \
diff --git a/src/xdisp.c b/src/xdisp.c
index 27987c69b19..32c8224cf04 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -580,7 +580,7 @@ static struct glyph scratch_glyphs[MAX_SCRATCH_GLYPHS];
580 580
581/* Ascent and height of the last line processed by move_it_to. */ 581/* Ascent and height of the last line processed by move_it_to. */
582 582
583static int last_max_ascent, last_height; 583static int last_height;
584 584
585/* Non-zero if there's a help-echo in the echo area. */ 585/* Non-zero if there's a help-echo in the echo area. */
586 586
@@ -8925,7 +8925,6 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
8925 it->current_y += it->max_ascent + it->max_descent; 8925 it->current_y += it->max_ascent + it->max_descent;
8926 ++it->vpos; 8926 ++it->vpos;
8927 last_height = it->max_ascent + it->max_descent; 8927 last_height = it->max_ascent + it->max_descent;
8928 last_max_ascent = it->max_ascent;
8929 it->max_ascent = it->max_descent = 0; 8928 it->max_ascent = it->max_descent = 0;
8930 } 8929 }
8931 8930
@@ -8952,7 +8951,6 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
8952 it->current_y += it->max_ascent + it->max_descent; 8951 it->current_y += it->max_ascent + it->max_descent;
8953 ++it->vpos; 8952 ++it->vpos;
8954 last_height = it->max_ascent + it->max_descent; 8953 last_height = it->max_ascent + it->max_descent;
8955 last_max_ascent = it->max_ascent;
8956 } 8954 }
8957 8955
8958 if (backup_data) 8956 if (backup_data)