aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/Makefile.in13
-rw-r--r--lisp/abbrev.el10
-rw-r--r--lisp/bookmark.el13
-rw-r--r--lisp/buff-menu.el3
-rw-r--r--lisp/cedet/ede/make.el24
-rw-r--r--lisp/cedet/semantic/bovine/c.el25
-rw-r--r--lisp/cedet/semantic/dep.el18
-rw-r--r--lisp/cedet/semantic/lex-spp.el4
-rw-r--r--lisp/comint.el16
-rw-r--r--lisp/cus-edit.el27
-rw-r--r--lisp/descr-text.el3
-rw-r--r--lisp/desktop.el2
-rw-r--r--lisp/dirtrack.el3
-rw-r--r--lisp/doc-view.el46
-rw-r--r--lisp/emacs-lisp/bytecomp.el6
-rw-r--r--lisp/emacs-lisp/chart.el4
-rw-r--r--lisp/emacs-lisp/comp.el64
-rw-r--r--lisp/emacs-lisp/crm.el6
-rw-r--r--lisp/emacs-lisp/derived.el1
-rw-r--r--lisp/emacs-lisp/easymenu.el10
-rw-r--r--lisp/emacs-lisp/ert.el9
-rw-r--r--lisp/emacs-lisp/find-func.el11
-rw-r--r--lisp/emacs-lisp/lisp-mode.el6
-rw-r--r--lisp/emacs-lisp/rx.el4
-rw-r--r--lisp/emulation/viper-cmd.el27
-rw-r--r--lisp/emulation/viper-mous.el2
-rw-r--r--lisp/emulation/viper-util.el20
-rw-r--r--lisp/epa.el4
-rw-r--r--lisp/epg.el16
-rw-r--r--lisp/erc/erc-backend.el3
-rw-r--r--lisp/erc/erc-dcc.el8
-rw-r--r--lisp/erc/erc-fill.el2
-rw-r--r--lisp/erc/erc-goodies.el3
-rw-r--r--lisp/erc/erc-log.el2
-rw-r--r--lisp/erc/erc-match.el67
-rw-r--r--lisp/erc/erc-notify.el2
-rw-r--r--lisp/erc/erc-pcomplete.el1
-rw-r--r--lisp/erc/erc-stamp.el1
-rw-r--r--lisp/erc/erc-track.el12
-rw-r--r--lisp/erc/erc.el27
-rw-r--r--lisp/eshell/em-rebind.el1
-rw-r--r--lisp/eshell/esh-io.el7
-rw-r--r--lisp/eshell/esh-mode.el75
-rw-r--r--lisp/eshell/eshell.el9
-rw-r--r--lisp/ffap.el139
-rw-r--r--lisp/files.el13
-rw-r--r--lisp/forms.el25
-rw-r--r--lisp/gnus/gnus-sum.el3
-rw-r--r--lisp/gnus/message.el63
-rw-r--r--lisp/gnus/mml-smime.el1
-rw-r--r--lisp/gnus/mml1991.el1
-rw-r--r--lisp/gnus/mml2015.el1
-rw-r--r--lisp/gnus/smiley.el13
-rw-r--r--lisp/help-fns.el6
-rw-r--r--lisp/hi-lock.el6
-rw-r--r--lisp/hilit-chg.el16
-rw-r--r--lisp/htmlfontify.el5
-rw-r--r--lisp/icomplete.el11
-rw-r--r--lisp/ido.el12
-rw-r--r--lisp/image/gravatar.el111
-rw-r--r--lisp/international/mule-cmds.el5
-rw-r--r--lisp/international/mule-diag.el4
-rw-r--r--lisp/international/mule-util.el9
-rw-r--r--lisp/international/mule.el135
-rw-r--r--lisp/ldefs-boot.el6
-rw-r--r--lisp/loadup.el44
-rw-r--r--lisp/mail/binhex.el10
-rw-r--r--lisp/mail/emacsbug.el12
-rw-r--r--lisp/mail/flow-fill.el36
-rw-r--r--lisp/mail/rmail.el19
-rw-r--r--lisp/mail/rmailedit.el4
-rw-r--r--lisp/mail/uudecode.el14
-rw-r--r--lisp/minibuffer.el28
-rw-r--r--lisp/mouse.el28
-rw-r--r--lisp/mwheel.el29
-rw-r--r--lisp/net/eudc-bob.el130
-rw-r--r--lisp/net/eww.el25
-rw-r--r--lisp/net/newst-treeview.el30
-rw-r--r--lisp/net/ntlm.el44
-rw-r--r--lisp/net/tramp-sh.el98
-rw-r--r--lisp/net/tramp.el103
-rw-r--r--lisp/obsolete/erc-compat.el (renamed from lisp/erc/erc-compat.el)1
-rw-r--r--lisp/obsolete/tpu-edt.el12
-rw-r--r--lisp/password-cache.el16
-rw-r--r--lisp/progmodes/cc-engine.el2
-rw-r--r--lisp/progmodes/compile.el9
-rw-r--r--lisp/progmodes/cperl-mode.el3
-rw-r--r--lisp/progmodes/ebnf2ps.el4
-rw-r--r--lisp/progmodes/elisp-mode.el10
-rw-r--r--lisp/progmodes/etags.el4
-rw-r--r--lisp/progmodes/idlw-help.el3
-rw-r--r--lisp/progmodes/idlw-shell.el7
-rw-r--r--lisp/progmodes/idlwave.el193
-rw-r--r--lisp/progmodes/perl-mode.el4
-rw-r--r--lisp/progmodes/project.el22
-rw-r--r--lisp/progmodes/python.el19
-rw-r--r--lisp/progmodes/subword.el2
-rw-r--r--lisp/progmodes/xref.el43
-rw-r--r--lisp/ps-def.el18
-rw-r--r--lisp/ps-print.el8
-rw-r--r--lisp/savehist.el4
-rw-r--r--lisp/shell.el57
-rw-r--r--lisp/simple.el22
-rw-r--r--lisp/so-long.el64
-rw-r--r--lisp/speedbar.el28
-rw-r--r--lisp/startup.el14
-rw-r--r--lisp/subr.el10
-rw-r--r--lisp/t-mouse.el2
-rw-r--r--lisp/term.el32
-rw-r--r--lisp/term/w32-win.el4
-rw-r--r--lisp/textmodes/bibtex.el1
-rw-r--r--lisp/textmodes/flyspell.el61
-rw-r--r--lisp/textmodes/ispell.el16
-rw-r--r--lisp/textmodes/remember.el3
-rw-r--r--lisp/thingatpt.el2
-rw-r--r--lisp/time.el294
-rw-r--r--lisp/tooltip.el2
-rw-r--r--lisp/url/url-expand.el2
-rw-r--r--lisp/url/url-util.el25
-rw-r--r--lisp/url/url-vars.el7
-rw-r--r--lisp/vc/diff-mode.el2
-rw-r--r--lisp/vc/ediff-init.el5
-rw-r--r--lisp/vc/ediff-util.el22
-rw-r--r--lisp/vc/vc-git.el18
-rw-r--r--lisp/vc/vc-hooks.el8
-rw-r--r--lisp/vc/vc-mtn.el1
-rw-r--r--lisp/vc/vc.el3
-rw-r--r--lisp/vcursor.el3
-rw-r--r--lisp/vt-control.el2
-rw-r--r--lisp/window.el21
-rw-r--r--lisp/woman.el4
131 files changed, 1306 insertions, 1669 deletions
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 9bcceceb0ee..164e4a01f59 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -302,7 +302,7 @@ endif
302# subdirectories, to make sure require's and load's in the files being 302# subdirectories, to make sure require's and load's in the files being
303# compiled find the right files. 303# compiled find the right files.
304 304
305.SUFFIXES: .eln .elc .el 305.SUFFIXES: .elc .el
306 306
307# An old-fashioned suffix rule, which, according to the GNU Make manual, 307# An old-fashioned suffix rule, which, according to the GNU Make manual,
308# cannot have prerequisites. 308# cannot have prerequisites.
@@ -357,13 +357,6 @@ compile-main: gen-lisp compile-clean
357 TARGETS="$$chunk"; \ 357 TARGETS="$$chunk"; \
358 done 358 done
359 359
360.PHONY: native-compile-clean
361native-compile-clean:
362# Erase all eln output compilation folders.
363ifeq ($(HAVE_NATIVE_COMP),yes)
364 find $(lisp) -regex ".*/eln-.*-[0-9a-z]+\\'" -type d | xargs rm -rf
365endif
366
367.PHONY: compile-clean 360.PHONY: compile-clean
368# Erase left-over .elc files that do not have a corresponding .el file. 361# Erase left-over .elc files that do not have a corresponding .el file.
369compile-clean: 362compile-clean:
@@ -400,7 +393,7 @@ compile: $(LOADDEFS) autoloads compile-first
400# Compile all Lisp files. This is like 'compile' but compiles files 393# Compile all Lisp files. This is like 'compile' but compiles files
401# unconditionally. Some files don't actually get compiled because they 394# unconditionally. Some files don't actually get compiled because they
402# set the local variable no-byte-compile. 395# set the local variable no-byte-compile.
403compile-always: native-compile-clean 396compile-always:
404 find $(lisp) -name '*.elc' $(FIND_DELETE) 397 find $(lisp) -name '*.elc' $(FIND_DELETE)
405 $(MAKE) compile 398 $(MAKE) compile
406 399
@@ -490,7 +483,7 @@ $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(CAL_DIR)/diary-loaddefs.el
490 483
491.PHONY: bootstrap-clean distclean maintainer-clean extraclean 484.PHONY: bootstrap-clean distclean maintainer-clean extraclean
492 485
493bootstrap-clean: native-compile-clean 486bootstrap-clean:
494 find $(lisp) -name '*.elc' $(FIND_DELETE) 487 find $(lisp) -name '*.elc' $(FIND_DELETE)
495 rm -f $(AUTOGENEL) 488 rm -f $(AUTOGENEL)
496 489
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 2d61a96010e..468b0d995b3 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -517,14 +517,6 @@ It is nil if the abbrev has already been unexpanded.")
517;; "Local (mode-specific) abbrev table of current buffer.") 517;; "Local (mode-specific) abbrev table of current buffer.")
518;; (make-variable-buffer-local 'local-abbrev-table) 518;; (make-variable-buffer-local 'local-abbrev-table)
519 519
520(defcustom pre-abbrev-expand-hook nil
521 "Function or functions to be called before abbrev expansion is done.
522This is the first thing that `expand-abbrev' does, and so this may change
523the current abbrev table before abbrev lookup happens."
524 :type 'hook
525 :group 'abbrev-mode)
526(make-obsolete-variable 'pre-abbrev-expand-hook 'abbrev-expand-function "23.1")
527
528(defun clear-abbrev-table (table) 520(defun clear-abbrev-table (table)
529 "Undefine all abbrevs in abbrev table TABLE, leaving it empty." 521 "Undefine all abbrevs in abbrev table TABLE, leaving it empty."
530 (setq abbrevs-changed t) 522 (setq abbrevs-changed t)
@@ -836,12 +828,10 @@ Takes no argument and should return the abbrev symbol if expansion took place.")
836(defun expand-abbrev () 828(defun expand-abbrev ()
837 "Expand the abbrev before point, if there is an abbrev there. 829 "Expand the abbrev before point, if there is an abbrev there.
838Effective when explicitly called even when `abbrev-mode' is nil. 830Effective when explicitly called even when `abbrev-mode' is nil.
839Before doing anything else, runs `pre-abbrev-expand-hook'.
840Calls the value of `abbrev-expand-function' with no argument to do 831Calls the value of `abbrev-expand-function' with no argument to do
841the work, and returns whatever it does. (That return value should 832the work, and returns whatever it does. (That return value should
842be the abbrev symbol if expansion occurred, else nil.)" 833be the abbrev symbol if expansion occurred, else nil.)"
843 (interactive) 834 (interactive)
844 (run-hooks 'pre-abbrev-expand-hook)
845 (funcall abbrev-expand-function)) 835 (funcall abbrev-expand-function))
846 836
847(defun abbrev--default-expand () 837(defun abbrev--default-expand ()
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 36a361c3f4b..8a3bcf8e59d 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -923,8 +923,6 @@ annotations."
923 "# Date: " (current-time-string) "\n")) 923 "# Date: " (current-time-string) "\n"))
924 924
925 925
926(define-obsolete-variable-alias 'bookmark-read-annotation-text-func
927 'bookmark-edit-annotation-text-func "23.1")
928(defvar bookmark-edit-annotation-text-func 'bookmark-default-annotation-text 926(defvar bookmark-edit-annotation-text-func 'bookmark-default-annotation-text
929 "Function to return default text to use for a bookmark annotation. 927 "Function to return default text to use for a bookmark annotation.
930It takes one argument, the name of the bookmark, as a string.") 928It takes one argument, the name of the bookmark, as a string.")
@@ -1143,17 +1141,6 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'."
1143 (let ((pop-up-frames t)) 1141 (let ((pop-up-frames t))
1144 (bookmark-jump-other-window bookmark))) 1142 (bookmark-jump-other-window bookmark)))
1145 1143
1146(defun bookmark-jump-noselect (bookmark)
1147 "Return the location pointed to by BOOKMARK (see `bookmark-jump').
1148The return value has the form (BUFFER . POINT).
1149
1150Note: this function is deprecated and is present for Emacs 22
1151compatibility only."
1152 (declare (obsolete bookmark-handle-bookmark "23.1"))
1153 (save-excursion
1154 (bookmark-handle-bookmark bookmark)
1155 (cons (current-buffer) (point))))
1156
1157(defun bookmark-handle-bookmark (bookmark-name-or-record) 1144(defun bookmark-handle-bookmark (bookmark-name-or-record)
1158 "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler' 1145 "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler'
1159if it has none. This changes current buffer and point and returns nil, 1146if it has none. This changes current buffer and point and returns nil,
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index aa5c47ca7f4..d06ba287879 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -229,9 +229,6 @@ commands.")
229 map) 229 map)
230 "Local keymap for `Buffer-menu-mode' buffers.") 230 "Local keymap for `Buffer-menu-mode' buffers.")
231 231
232(define-obsolete-variable-alias 'buffer-menu-mode-hook
233 'Buffer-menu-mode-hook "23.1")
234
235(define-derived-mode Buffer-menu-mode tabulated-list-mode "Buffer Menu" 232(define-derived-mode Buffer-menu-mode tabulated-list-mode "Buffer Menu"
236 "Major mode for Buffer Menu buffers. 233 "Major mode for Buffer Menu buffers.
237The Buffer Menu is invoked by the commands \\[list-buffers], 234The Buffer Menu is invoked by the commands \\[list-buffers],
diff --git a/lisp/cedet/ede/make.el b/lisp/cedet/ede/make.el
index ecce3e7105b..140e7387a68 100644
--- a/lisp/cedet/ede/make.el
+++ b/lisp/cedet/ede/make.el
@@ -32,29 +32,15 @@
32 32
33(declare-function inversion-check-version "inversion") 33(declare-function inversion-check-version "inversion")
34 34
35(if (fboundp 'locate-file) 35(defsubst ede--find-executable (exec)
36 (defsubst ede--find-executable (exec) 36 "Return an expanded file name for a program EXEC on the exec path."
37 "Return an expanded file name for a program EXEC on the exec path." 37 (declare (obsolete locate-file "28.1"))
38 (locate-file exec exec-path)) 38 (locate-file exec exec-path))
39
40 ;; Else, older version of Emacs.
41
42 (defsubst ede--find-executable (exec)
43 "Return an expanded file name for a program EXEC on the exec path."
44 (let ((p exec-path)
45 (found nil))
46 (while (and p (not found))
47 (let ((f (expand-file-name exec (car p))))
48 (if (file-exists-p f)
49 (setq found f)))
50 (setq p (cdr p)))
51 found))
52 )
53 39
54(defvar ede-make-min-version "3.0" 40(defvar ede-make-min-version "3.0"
55 "Minimum version of GNU make required.") 41 "Minimum version of GNU make required.")
56 42
57(defcustom ede-make-command (cond ((ede--find-executable "gmake") 43(defcustom ede-make-command (cond ((executable-find "gmake")
58 "gmake") 44 "gmake")
59 (t "make")) ;; What to do? 45 (t "make")) ;; What to do?
60 "The MAKE command to use for EDE when compiling. 46 "The MAKE command to use for EDE when compiling.
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index 358829a4568..3649d1c2f1f 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -46,27 +46,10 @@
46(declare-function c-forward-conditional "cc-cmds") 46(declare-function c-forward-conditional "cc-cmds")
47(declare-function ede-system-include-path "ede") 47(declare-function ede-system-include-path "ede")
48 48
49;;; Compatibility
50;;
51(eval-when-compile (require 'cc-mode)) 49(eval-when-compile (require 'cc-mode))
52 50
53(if (fboundp 'c-end-of-macro) 51(define-obsolete-function-alias 'semantic-c-end-of-macro
54 (eval-and-compile 52 #'c-end-of-macro "28.1")
55 (defalias 'semantic-c-end-of-macro 'c-end-of-macro))
56 ;; From cc-mode 5.30
57 (defun semantic-c-end-of-macro ()
58 "Go to the end of a preprocessor directive.
59More accurately, move point to the end of the closest following line
60that doesn't end with a line continuation backslash.
61
62This function does not do any hidden buffer changes."
63 (while (progn
64 (end-of-line)
65 (when (and (eq (char-before) ?\\)
66 (not (eobp)))
67 (forward-char)
68 t))))
69 )
70 53
71;;; Code: 54;;; Code:
72(with-suppressed-warnings ((obsolete define-child-mode)) 55(with-suppressed-warnings ((obsolete define-child-mode))
@@ -266,7 +249,7 @@ Return the defined symbol as a special spp lex token."
266 (semantic-lex-analyzer #'semantic-cpp-lexer) 249 (semantic-lex-analyzer #'semantic-cpp-lexer)
267 (raw-stream 250 (raw-stream
268 (semantic-lex-spp-stream-for-macro (save-excursion 251 (semantic-lex-spp-stream-for-macro (save-excursion
269 (semantic-c-end-of-macro) 252 (c-end-of-macro)
270 ;; HACK - If there's a C comment after 253 ;; HACK - If there's a C comment after
271 ;; the macro, do not parse it. 254 ;; the macro, do not parse it.
272 (if (looking-back "/\\*.*" beginning-of-define) 255 (if (looking-back "/\\*.*" beginning-of-define)
@@ -590,7 +573,7 @@ case, we must skip it since it is the ELSE part."
590(define-lex-regex-analyzer semantic-lex-c-macrobits 573(define-lex-regex-analyzer semantic-lex-c-macrobits
591 "Ignore various forms of #if/#else/#endif conditionals." 574 "Ignore various forms of #if/#else/#endif conditionals."
592 "^\\s-*#\\s-*\\(if\\(n?def\\)?\\|endif\\|elif\\|else\\)" 575 "^\\s-*#\\s-*\\(if\\(n?def\\)?\\|endif\\|elif\\|else\\)"
593 (semantic-c-end-of-macro) 576 (c-end-of-macro)
594 (setq semantic-lex-end-point (point)) 577 (setq semantic-lex-end-point (point))
595 nil) 578 nil)
596 579
diff --git a/lisp/cedet/semantic/dep.el b/lisp/cedet/semantic/dep.el
index 47afa25dd74..60ab6033aec 100644
--- a/lisp/cedet/semantic/dep.el
+++ b/lisp/cedet/semantic/dep.el
@@ -183,16 +183,8 @@ macro `defcustom-mode-local-semantic-dependency-system-include-path'."
183;; 183;;
184;; methods for finding files on a provided path. 184;; methods for finding files on a provided path.
185(defmacro semantic--dependency-find-file-on-path (file path) 185(defmacro semantic--dependency-find-file-on-path (file path)
186 (if (fboundp 'locate-file) 186 (declare (obsolete locate-file "28.1"))
187 `(locate-file ,file ,path) 187 `(locate-file ,file ,path))
188 `(let ((p ,path)
189 (found nil))
190 (while (and p (not found))
191 (let ((f (expand-file-name ,file (car p))))
192 (if (file-exists-p f)
193 (setq found f)))
194 (setq p (cdr p)))
195 found)))
196 188
197(defvar ede-minor-mode) 189(defvar ede-minor-mode)
198(defvar ede-object) 190(defvar ede-object)
@@ -216,11 +208,11 @@ provided mode, not from the current major mode."
216 (when (file-exists-p file) 208 (when (file-exists-p file)
217 (setq found file)) 209 (setq found file))
218 (when (and (not found) (not systemp)) 210 (when (and (not found) (not systemp))
219 (setq found (semantic--dependency-find-file-on-path file locp))) 211 (setq found (locate-file file locp)))
220 (when (and (not found) edesys) 212 (when (and (not found) edesys)
221 (setq found (semantic--dependency-find-file-on-path file edesys))) 213 (setq found (locate-file file edesys)))
222 (when (not found) 214 (when (not found)
223 (setq found (semantic--dependency-find-file-on-path file sysp))) 215 (setq found (locate-file file sysp)))
224 (if found (expand-file-name found)))) 216 (if found (expand-file-name found))))
225 217
226 218
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el
index b8812de05b6..e6e124eb812 100644
--- a/lisp/cedet/semantic/lex-spp.el
+++ b/lisp/cedet/semantic/lex-spp.el
@@ -70,7 +70,7 @@
70(require 'semantic) 70(require 'semantic)
71(require 'semantic/lex) 71(require 'semantic/lex)
72 72
73(declare-function semantic-c-end-of-macro "semantic/bovine/c") 73(declare-function c-end-of-macro "cc-engine")
74 74
75;;; Code: 75;;; Code:
76(defvar semantic-lex-spp-macro-symbol-obarray nil 76(defvar semantic-lex-spp-macro-symbol-obarray nil
@@ -946,7 +946,7 @@ by another macro."
946 (save-excursion 946 (save-excursion
947 (let ((start (match-beginning 0)) 947 (let ((start (match-beginning 0))
948 (end (match-end 0)) 948 (end (match-end 0))
949 (peom (save-excursion (semantic-c-end-of-macro) (point)))) 949 (peom (save-excursion (c-end-of-macro) (point))))
950 (condition-case nil 950 (condition-case nil
951 (progn 951 (progn
952 ;; This will throw an error if no closing paren can be found. 952 ;; This will throw an error if no closing paren can be found.
diff --git a/lisp/comint.el b/lisp/comint.el
index c3cb439d8b8..092902d865e 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -223,6 +223,13 @@ This variable is buffer-local."
223 (other :tag "on" t)) 223 (other :tag "on" t))
224 :group 'comint) 224 :group 'comint)
225 225
226(defcustom comint-highlight-input t
227 "If non-nil, highlight input with `comint-highlight-input' face.
228Otherwise keep the original highlighting untouched."
229 :version "28.1"
230 :type 'boolean
231 :group 'comint)
232
226(defface comint-highlight-input '((t (:weight bold))) 233(defface comint-highlight-input '((t (:weight bold)))
227 "Face to use to highlight user input." 234 "Face to use to highlight user input."
228 :group 'comint) 235 :group 'comint)
@@ -1897,9 +1904,10 @@ Similarly for Soar, Scheme, etc."
1897 (end (if no-newline (point) (1- (point))))) 1904 (end (if no-newline (point) (1- (point)))))
1898 (with-silent-modifications 1905 (with-silent-modifications
1899 (when (> end beg) 1906 (when (> end beg)
1900 (add-text-properties beg end 1907 (when comint-highlight-input
1901 '(front-sticky t 1908 (add-text-properties beg end
1902 font-lock-face comint-highlight-input)) 1909 '( font-lock-face comint-highlight-input
1910 front-sticky t )))
1903 (unless comint-use-prompt-regexp 1911 (unless comint-use-prompt-regexp
1904 ;; Give old user input a field property of `input', to 1912 ;; Give old user input a field property of `input', to
1905 ;; distinguish it from both process output and unsent 1913 ;; distinguish it from both process output and unsent
@@ -3852,7 +3860,7 @@ REGEXP-GROUP is the regular expression group in REGEXP to use."
3852 (set-buffer output-buffer) 3860 (set-buffer output-buffer)
3853 (goto-char (point-min)) 3861 (goto-char (point-min))
3854 ;; Skip past the command, if it was echoed 3862 ;; Skip past the command, if it was echoed
3855 (and (looking-at command) 3863 (and (looking-at (regexp-quote command))
3856 (forward-line)) 3864 (forward-line))
3857 (while (and (not (eobp)) 3865 (while (and (not (eobp))
3858 (re-search-forward regexp nil t)) 3866 (re-search-forward regexp nil t))
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 16695967dfa..23ceb3a857a 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -801,16 +801,19 @@ has been executed, nil otherwise."
801If a setting was edited and set before, this saves it. If a 801If a setting was edited and set before, this saves it. If a
802setting was merely edited before, this sets it then saves it." 802setting was merely edited before, this sets it then saves it."
803 (interactive) 803 (interactive)
804 (when (custom-command-apply 804 (let (edited-widgets)
805 (lambda (child) 805 (when (custom-command-apply
806 (when (memq (widget-get child :custom-state) 806 (lambda (child)
807 '(modified set changed rogue)) 807 (when (memq (widget-get child :custom-state)
808 (widget-apply child :custom-mark-to-save))) 808 '(modified set changed rogue))
809 "Save all settings in this buffer? " t) 809 (push child edited-widgets)
810 ;; Save changes to buffer and redraw. 810 (widget-apply child :custom-mark-to-save)))
811 (custom-save-all) 811 "Save all settings in this buffer? " t)
812 (dolist (child custom-options) 812 ;; Save changes to buffer.
813 (widget-apply child :custom-state-set-and-redraw)))) 813 (custom-save-all)
814 ;; Redraw and recalculate the state when necessary.
815 (dolist (widget edited-widgets)
816 (widget-apply widget :custom-state-set-and-redraw)))))
814 817
815(defun custom-reset (_widget &optional event) 818(defun custom-reset (_widget &optional event)
816 "Select item from reset menu." 819 "Select item from reset menu."
@@ -4868,8 +4871,6 @@ If several parents are listed, go to the first of them."
4868 (parent (downcase (widget-get button :tag)))) 4871 (parent (downcase (widget-get button :tag))))
4869 (customize-group parent))))) 4872 (customize-group parent)))))
4870 4873
4871(define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1")
4872
4873(defcustom Custom-mode-hook nil 4874(defcustom Custom-mode-hook nil
4874 "Hook called when entering Custom mode." 4875 "Hook called when entering Custom mode."
4875 :type 'hook 4876 :type 'hook
@@ -4940,8 +4941,6 @@ if that value is non-nil."
4940 4941
4941(put 'Custom-mode 'mode-class 'special) 4942(put 'Custom-mode 'mode-class 'special)
4942 4943
4943(define-obsolete-function-alias 'custom-mode 'Custom-mode "23.1")
4944
4945;;; The End. 4944;;; The End.
4946 4945
4947(provide 'cus-edit) 4946(provide 'cus-edit)
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 55f0b7dcb40..d6da4280630 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -141,8 +141,7 @@ otherwise."
141 (wid-field (get-char-property pos 'field)) 141 (wid-field (get-char-property pos 'field))
142 (wid-button (get-char-property pos 'button)) 142 (wid-button (get-char-property pos 'button))
143 (wid-doc (get-char-property pos 'widget-doc)) 143 (wid-doc (get-char-property pos 'widget-doc))
144 ;; If button.el is not loaded, we have no buttons in the text. 144 (button (button-at pos))
145 (button (and (fboundp 'button-at) (button-at pos)))
146 (button-type (and button (button-type button))) 145 (button-type (and button (button-type button)))
147 (button-label (and button (button-label button))) 146 (button-label (and button (button-label button)))
148 (widget (or wid-field wid-button wid-doc))) 147 (widget (or wid-field wid-button wid-doc)))
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 7fe5f73b879..7a7f1d07c93 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1037,7 +1037,7 @@ file.
1037 1037
1038To upgrade a version 206 file to version 208, call this command 1038To upgrade a version 206 file to version 208, call this command
1039explicitly with a prefix argument: \\[universal-argument] \\[desktop-save]. 1039explicitly with a prefix argument: \\[universal-argument] \\[desktop-save].
1040If you are upgrading from Emacs 24 or older, we recommed to do 1040If you are upgrading from Emacs 24 or older, we recommend to do
1041this once you decide you no longer need compatibility with versions 1041this once you decide you no longer need compatibility with versions
1042of Emacs before 25.1. 1042of Emacs before 25.1.
1043 1043
diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el
index 3a0bbd2c9c2..ad0c18d1b38 100644
--- a/lisp/dirtrack.el
+++ b/lisp/dirtrack.el
@@ -196,9 +196,6 @@ directory."
196 (remove-hook 'comint-preoutput-filter-functions 'dirtrack t))) 196 (remove-hook 'comint-preoutput-filter-functions 'dirtrack t)))
197 197
198 198
199(define-obsolete-function-alias 'dirtrack-debug-toggle 'dirtrack-debug-mode
200 "23.1")
201(define-obsolete-variable-alias 'dirtrack-debug 'dirtrack-debug-mode "23.1")
202(define-minor-mode dirtrack-debug-mode 199(define-minor-mode dirtrack-debug-mode
203 "Toggle Dirtrack debugging." 200 "Toggle Dirtrack debugging."
204 nil nil nil 201 nil nil nil
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index de342f1519e..77c06a8eaf9 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -435,6 +435,9 @@ Typically \"page-%s.png\".")
435 (define-key map (kbd "c m") 'doc-view-set-slice-using-mouse) 435 (define-key map (kbd "c m") 'doc-view-set-slice-using-mouse)
436 (define-key map (kbd "c b") 'doc-view-set-slice-from-bounding-box) 436 (define-key map (kbd "c b") 'doc-view-set-slice-from-bounding-box)
437 (define-key map (kbd "c r") 'doc-view-reset-slice) 437 (define-key map (kbd "c r") 'doc-view-reset-slice)
438 ;; Centering the image
439 (define-key map (kbd "c h") 'doc-view-center-page-horizontally)
440 (define-key map (kbd "c v") 'doc-view-center-page-vertically)
438 ;; Searching 441 ;; Searching
439 (define-key map (kbd "C-s") 'doc-view-search) 442 (define-key map (kbd "C-s") 'doc-view-search)
440 (define-key map (kbd "<find>") 'doc-view-search) 443 (define-key map (kbd "<find>") 'doc-view-search)
@@ -740,8 +743,7 @@ It's a subdirectory of `doc-view-cache-directory'."
740Document types are symbols like `dvi', `ps', `pdf', or `odf' (any 743Document types are symbols like `dvi', `ps', `pdf', or `odf' (any
741OpenDocument format)." 744OpenDocument format)."
742 (and (display-graphic-p) 745 (and (display-graphic-p)
743 (or (image-type-available-p 'imagemagick) 746 (image-type-available-p 'png)
744 (image-type-available-p 'png))
745 (cond 747 (cond
746 ((eq type 'dvi) 748 ((eq type 'dvi)
747 (and (doc-view-mode-p 'pdf) 749 (and (doc-view-mode-p 'pdf)
@@ -769,10 +771,7 @@ OpenDocument format)."
769(defun doc-view-enlarge (factor) 771(defun doc-view-enlarge (factor)
770 "Enlarge the document by FACTOR." 772 "Enlarge the document by FACTOR."
771 (interactive (list doc-view-shrink-factor)) 773 (interactive (list doc-view-shrink-factor))
772 (if (and doc-view-scale-internally 774 (if doc-view-scale-internally
773 (eq (plist-get (cdr (doc-view-current-image)) :type)
774 'imagemagick))
775 ;; ImageMagick supports on-the-fly-rescaling.
776 (let ((new (ceiling (* factor doc-view-image-width)))) 775 (let ((new (ceiling (* factor doc-view-image-width))))
777 (unless (equal new doc-view-image-width) 776 (unless (equal new doc-view-image-width)
778 (setq-local doc-view-image-width new) 777 (setq-local doc-view-image-width new)
@@ -792,9 +791,7 @@ OpenDocument format)."
792(defun doc-view-scale-reset () 791(defun doc-view-scale-reset ()
793 "Reset the document size/zoom level to the initial one." 792 "Reset the document size/zoom level to the initial one."
794 (interactive) 793 (interactive)
795 (if (and doc-view-scale-internally 794 (if doc-view-scale-internally
796 (eq (plist-get (cdr (doc-view-current-image)) :type)
797 'imagemagick))
798 (progn 795 (progn
799 (kill-local-variable 'doc-view-image-width) 796 (kill-local-variable 'doc-view-image-width)
800 (doc-view-insert-image 797 (doc-view-insert-image
@@ -927,6 +924,32 @@ Resize the containing frame if needed."
927 (when new-frame-params 924 (when new-frame-params
928 (modify-frame-parameters (selected-frame) new-frame-params)))) 925 (modify-frame-parameters (selected-frame) new-frame-params))))
929 926
927(defun doc-view-center-page-horizontally ()
928 "Center page horizontally when page is wider than window."
929 (interactive)
930 (let ((page-width (car (image-size (doc-view-current-image) 'pixel)))
931 (window-width (window-body-width nil 'pixel))
932 ;; How much do we scroll in order to center the page?
933 (pixel-hscroll 0)
934 ;; How many pixels are there in a column?
935 (col-in-pixel (/ (window-body-width nil 'pixel)
936 (window-body-width nil))))
937 (when (> page-width window-width)
938 (setq pixel-hscroll (/ (- page-width window-width) 2))
939 (set-window-hscroll (selected-window)
940 (/ pixel-hscroll col-in-pixel)))))
941
942(defun doc-view-center-page-vertically ()
943 "Center page vertically when page is wider than window."
944 (interactive)
945 (let ((page-height (cdr (image-size (doc-view-current-image) 'pixel)))
946 (window-height (window-body-height nil 'pixel))
947 ;; How much do we scroll in order to center the page?
948 (pixel-scroll 0))
949 (when (> page-height window-height)
950 (setq pixel-scroll (/ (- page-height window-height) 2))
951 (set-window-vscroll (selected-window) pixel-scroll 'pixel))))
952
930(defun doc-view-reconvert-doc () 953(defun doc-view-reconvert-doc ()
931 "Reconvert the current document. 954 "Reconvert the current document.
932Should be invoked when the cached images aren't up-to-date." 955Should be invoked when the cached images aren't up-to-date."
@@ -1393,12 +1416,11 @@ ARGS is a list of image descriptors."
1393 ;; Only insert the image if the buffer is visible. 1416 ;; Only insert the image if the buffer is visible.
1394 (when (window-live-p (overlay-get ol 'window)) 1417 (when (window-live-p (overlay-get ol 'window))
1395 (let* ((image (if (and file (file-readable-p file)) 1418 (let* ((image (if (and file (file-readable-p file))
1396 (if (not (and doc-view-scale-internally 1419 (if (not doc-view-scale-internally)
1397 (fboundp 'imagemagick-types)))
1398 (apply #'create-image file doc-view--image-type nil args) 1420 (apply #'create-image file doc-view--image-type nil args)
1399 (unless (member :width args) 1421 (unless (member :width args)
1400 (setq args `(,@args :width ,doc-view-image-width))) 1422 (setq args `(,@args :width ,doc-view-image-width)))
1401 (apply #'create-image file 'imagemagick nil args)))) 1423 (apply #'create-image file doc-view--image-type nil args))))
1402 (slice (doc-view-current-slice)) 1424 (slice (doc-view-current-slice))
1403 (img-width (and image (car (image-size image)))) 1425 (img-width (and image (car (image-size image))))
1404 (displayed-img-width (if (and image slice) 1426 (displayed-img-width (if (and image slice)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 20a481a8a1c..507cfe76ffa 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2041,7 +2041,8 @@ The value is non-nil if there were no errors, nil if errors."
2041 (with-current-buffer output-buffer 2041 (with-current-buffer output-buffer
2042 (goto-char (point-max)) 2042 (goto-char (point-max))
2043 (insert "\n") ; aaah, unix. 2043 (insert "\n") ; aaah, unix.
2044 (if (file-writable-p target-file) 2044 (if (or (file-writable-p target-file)
2045 byte-native-compiling)
2045 ;; We must disable any code conversion here. 2046 ;; We must disable any code conversion here.
2046 (progn 2047 (progn
2047 (let* ((coding-system-for-write 'no-conversion) 2048 (let* ((coding-system-for-write 'no-conversion)
@@ -2050,7 +2051,8 @@ The value is non-nil if there were no errors, nil if errors."
2050 ;; parallel bootstrap), it does not risk getting a 2051 ;; parallel bootstrap), it does not risk getting a
2051 ;; half-finished file. (Bug#4196) 2052 ;; half-finished file. (Bug#4196)
2052 (tempfile 2053 (tempfile
2053 (make-temp-file (expand-file-name target-file))) 2054 (make-temp-file (when (file-writable-p target-file)
2055 (expand-file-name target-file))))
2054 (default-modes (default-file-modes)) 2056 (default-modes (default-file-modes))
2055 (temp-modes (logand default-modes #o600)) 2057 (temp-modes (logand default-modes #o600))
2056 (desired-modes (logand default-modes #o666)) 2058 (desired-modes (logand default-modes #o666))
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index 2321ac1ed50..964836a32ac 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -105,9 +105,7 @@ Useful if new Emacs is used on B&W display.")
105 (car cl) 105 (car cl)
106 "white")) 106 "white"))
107 (set-face-foreground nf "black") 107 (set-face-foreground nf "black")
108 (if (and chart-face-use-pixmaps 108 (if (and chart-face-use-pixmaps pl)
109 pl
110 (fboundp 'set-face-background-pixmap))
111 (condition-case nil 109 (condition-case nil
112 (set-face-background-pixmap nf (car pl)) 110 (set-face-background-pixmap nf (car pl))
113 (error (message "Cannot set background pixmap %s" (car pl))))) 111 (error (message "Cannot set background pixmap %s" (car pl)))))
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index a92392f63ac..3176351b37d 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -36,18 +36,12 @@
36(require 'gv) 36(require 'gv)
37(require 'rx) 37(require 'rx)
38(require 'subr-x) 38(require 'subr-x)
39(require 'warnings)
39 40
40(defgroup comp nil 41(defgroup comp nil
41 "Emacs Lisp native compiler." 42 "Emacs Lisp native compiler."
42 :group 'lisp) 43 :group 'lisp)
43 44
44(defcustom comp-deferred-compilation nil
45 "If non-nil compile asyncronously all .elc files being loaded.
46Once compilation happened each function definition is updated to
47the native compiled one."
48 :type 'boolean
49 :group 'comp)
50
51(defcustom comp-speed 2 45(defcustom comp-speed 2
52 "Compiler optimization level. From -1 to 3. 46 "Compiler optimization level. From -1 to 3.
53- -1 functions are kept in bytecode form and no native compilation is performed. 47- -1 functions are kept in bytecode form and no native compilation is performed.
@@ -143,6 +137,9 @@ before compilation. Usable to modify the compiler environment."
143(defvar comp-dry-run nil 137(defvar comp-dry-run nil
144 "When non nil run everything but the C back-end.") 138 "When non nil run everything but the C back-end.")
145 139
140(defconst comp-valid-source-re (rx ".el" (? ".gz") eos)
141 "Regexp to match filename of valid input source files.")
142
146(defconst comp-log-buffer-name "*Native-compile-Log*" 143(defconst comp-log-buffer-name "*Native-compile-Log*"
147 "Name of the native-compiler log buffer.") 144 "Name of the native-compiler log buffer.")
148 145
@@ -569,28 +566,6 @@ VERBOSITY is a number between 0 and 3."
569 566
570 567
571 568
572(defun comp-output-directory (src)
573 "Return the compilation direcotry for source SRC."
574 (let* ((src (if (symbolp src) (symbol-name src) src))
575 (expanded-filename (expand-file-name src)))
576 (file-name-as-directory
577 (concat (file-name-directory expanded-filename)
578 comp-native-path-postfix))))
579
580(defun comp-output-base-filename (src)
581 "Output filename sans extention for SRC file being native compiled."
582 (let* ((src (if (symbolp src) (symbol-name src) src))
583 (expanded-filename (expand-file-name src))
584 (output-dir (comp-output-directory src))
585 (output-filename
586 (file-name-sans-extension
587 (file-name-nondirectory expanded-filename))))
588 (expand-file-name output-filename output-dir)))
589
590(defun comp-output-filename (src)
591 "Output filename for SRC file being native compiled."
592 (concat (comp-output-base-filename src) ".eln"))
593
594(defmacro comp-loop-insn-in-block (basic-block &rest body) 569(defmacro comp-loop-insn-in-block (basic-block &rest body)
595 "Loop over all insns in BASIC-BLOCK executning BODY. 570 "Loop over all insns in BASIC-BLOCK executning BODY.
596Inside BODY `insn' can be used to read or set the current 571Inside BODY `insn' can be used to read or set the current
@@ -2486,7 +2461,7 @@ Prepare every function for final compilation and drive the C back-end."
2486 (unless (file-exists-p dir) 2461 (unless (file-exists-p dir)
2487 ;; In case it's created in the meanwhile. 2462 ;; In case it's created in the meanwhile.
2488 (ignore-error 'file-already-exists 2463 (ignore-error 'file-already-exists
2489 (make-directory dir))) 2464 (make-directory dir t)))
2490 (unless comp-dry-run 2465 (unless comp-dry-run
2491 (comp--compile-ctxt-to-file name)))) 2466 (comp--compile-ctxt-to-file name))))
2492 2467
@@ -2592,17 +2567,20 @@ display a message."
2592 (cl-loop 2567 (cl-loop
2593 for (source-file . load) = (pop comp-files-queue) 2568 for (source-file . load) = (pop comp-files-queue)
2594 while source-file 2569 while source-file
2595 do (cl-assert (string-match-p (rx ".el" eos) source-file) nil 2570 do (cl-assert (string-match-p comp-valid-source-re source-file) nil
2596 "`comp-files-queue' should be \".el\" files: %s" 2571 "`comp-files-queue' should be \".el\" files: %s"
2597 source-file) 2572 source-file)
2598 when (or comp-always-compile 2573 when (or comp-always-compile
2574 load ; Always compile when the compilation is
2575 ; commanded for late load.
2599 (file-newer-than-file-p source-file 2576 (file-newer-than-file-p source-file
2600 (comp-output-filename source-file))) 2577 (comp-el-to-eln-filename source-file)))
2601 do (let* ((expr `(progn 2578 do (let* ((expr `(progn
2602 (require 'comp) 2579 (require 'comp)
2603 (setf comp-speed ,comp-speed 2580 (setf comp-speed ,comp-speed
2604 comp-debug ,comp-debug 2581 comp-debug ,comp-debug
2605 comp-verbose ,comp-verbose 2582 comp-verbose ,comp-verbose
2583 comp-eln-load-path ',comp-eln-load-path
2606 load-path ',load-path) 2584 load-path ',load-path)
2607 ,comp-async-env-modifier-form 2585 ,comp-async-env-modifier-form
2608 (message "Compiling %s..." ,source-file) 2586 (message "Compiling %s..." ,source-file)
@@ -2636,7 +2614,7 @@ display a message."
2636 (when (and load1 2614 (when (and load1
2637 (zerop (process-exit-status process))) 2615 (zerop (process-exit-status process)))
2638 (native-elisp-load 2616 (native-elisp-load
2639 (comp-output-filename source-file1) 2617 (comp-el-to-eln-filename source-file1)
2640 (eq load1 'late))) 2618 (eq load1 'late)))
2641 (comp-run-async-workers))))) 2619 (comp-run-async-workers)))))
2642 (puthash source-file process comp-async-compilations)) 2620 (puthash source-file process comp-async-compilations))
@@ -2676,7 +2654,11 @@ Return the compilation unit file name."
2676 (byte-compile-debug t) 2654 (byte-compile-debug t)
2677 (comp-ctxt 2655 (comp-ctxt
2678 (make-comp-ctxt 2656 (make-comp-ctxt
2679 :output (comp-output-base-filename function-or-file) 2657 :output (comp-el-to-eln-filename (if (symbolp function-or-file)
2658 (symbol-name function-or-file)
2659 function-or-file)
2660 (when byte-native-for-bootstrap
2661 (car (last comp-eln-load-path))))
2680 :with-late-load with-late-load))) 2662 :with-late-load with-late-load)))
2681 (comp-log "\n \n" 1) 2663 (comp-log "\n \n" 1)
2682 (condition-case err 2664 (condition-case err
@@ -2746,8 +2728,8 @@ LOAD can be nil t or 'late."
2746 (dolist (path paths) 2728 (dolist (path paths)
2747 (cond ((file-directory-p path) 2729 (cond ((file-directory-p path)
2748 (dolist (file (if recursively 2730 (dolist (file (if recursively
2749 (directory-files-recursively path (rx ".el" eos)) 2731 (directory-files-recursively path comp-valid-source-re)
2750 (directory-files path t (rx ".el" eos)))) 2732 (directory-files path t comp-valid-source-re)))
2751 (push file files))) 2733 (push file files)))
2752 ((file-exists-p path) (push path files)) 2734 ((file-exists-p path) (push path files))
2753 (t (signal 'native-compiler-error 2735 (t (signal 'native-compiler-error
@@ -2770,11 +2752,11 @@ queued with LOAD %"
2770 (and (eq load 'late) 2752 (and (eq load 'late)
2771 (cl-some (lambda (re) (string-match re file)) 2753 (cl-some (lambda (re) (string-match re file))
2772 comp-deferred-compilation-black-list))) 2754 comp-deferred-compilation-black-list)))
2773 (let ((out-dir (comp-output-directory file)) 2755 (let* ((out-filename (comp-el-to-eln-filename file))
2774 (out-filename (comp-output-filename file))) 2756 (out-dir (file-name-directory out-filename)))
2775 (if (or (file-writable-p out-filename) 2757 (unless (file-exists-p out-dir)
2776 (and (not (file-exists-p out-dir)) 2758 (make-directory out-dir t))
2777 (file-writable-p (substring out-dir 0 -1)))) 2759 (if (file-writable-p out-filename)
2778 (setf comp-files-queue 2760 (setf comp-files-queue
2779 (append comp-files-queue `((,file . ,load)))) 2761 (append comp-files-queue `((,file . ,load))))
2780 (display-warning 'comp 2762 (display-warning 'comp
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 65483d0813a..89d106ee489 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -270,12 +270,6 @@ with empty strings removed."
270 (remove-hook 'choose-completion-string-functions 270 (remove-hook 'choose-completion-string-functions
271 'crm--choose-completion-string))) 271 'crm--choose-completion-string)))
272 272
273(define-obsolete-function-alias 'crm-minibuffer-complete 'crm-complete "23.1")
274(define-obsolete-function-alias
275 'crm-minibuffer-completion-help 'crm-completion-help "23.1")
276(define-obsolete-function-alias
277 'crm-minibuffer-complete-and-exit 'crm-complete-and-exit "23.1")
278
279;; testing and debugging 273;; testing and debugging
280;; (defun crm-init-test-environ () 274;; (defun crm-init-test-environ ()
281;; "Set up some variables for testing." 275;; "Set up some variables for testing."
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 3eafad177dd..6a11f1c3949 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -364,6 +364,7 @@ which more-or-less shadow%s %s's corresponding table%s."
364 364
365(defsubst derived-mode-setup-function-name (mode) 365(defsubst derived-mode-setup-function-name (mode)
366 "Construct a setup-function name based on a MODE name." 366 "Construct a setup-function name based on a MODE name."
367 (declare (obsolete nil "28.1"))
367 (intern (concat (symbol-name mode) "-setup"))) 368 (intern (concat (symbol-name mode) "-setup")))
368 369
369 370
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 6ba8b997f84..73dabef3fa5 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -29,16 +29,6 @@
29 29
30;;; Code: 30;;; Code:
31 31
32(defvar easy-menu-precalculate-equivalent-keybindings nil
33 "Determine when equivalent key bindings are computed for easy-menu menus.
34It can take some time to calculate the equivalent key bindings that are shown
35in a menu. If the variable is on, then this calculation gives a (maybe
36noticeable) delay when a mode is first entered. If the variable is off, then
37this delay will come when a menu is displayed the first time. If you never use
38menus, turn this variable off, otherwise it is probably better to keep it on.")
39(make-obsolete-variable
40 'easy-menu-precalculate-equivalent-keybindings nil "23.1")
41
42(defsubst easy-menu-intern (s) 32(defsubst easy-menu-intern (s)
43 (if (stringp s) (intern s) s)) 33 (if (stringp s) (intern s) s))
44 34
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 764354b03b7..241eece05b6 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -515,7 +515,14 @@ Returns nil if they are."
515 `(cdr ,cdr-x) 515 `(cdr ,cdr-x)
516 (cl-assert (equal a b) t) 516 (cl-assert (equal a b) t)
517 nil)))))))) 517 nil))))))))
518 ((pred arrayp) 518 ((pred cl-struct-p)
519 (cl-loop for slot in (cl-struct-slot-info (type-of a))
520 for ai across a
521 for bi across b
522 for xf = (ert--explain-equal-rec ai bi)
523 do (when xf (cl-return `(struct-field ,(car slot) ,xf)))
524 finally (cl-assert (equal a b) t)))
525 ((or (pred arrayp) (pred recordp))
519 ;; For mixed unibyte/multibyte string comparisons, make both multibyte. 526 ;; For mixed unibyte/multibyte string comparisons, make both multibyte.
520 (when (and (stringp a) 527 (when (and (stringp a)
521 (xor (multibyte-string-p a) (multibyte-string-p b))) 528 (xor (multibyte-string-p a) (multibyte-string-p b)))
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index efbcfb3a722..60b16257a3e 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -188,11 +188,7 @@ LIBRARY should be a string (the name of the library)."
188 ((string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library) 188 ((string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
189 (setq library (replace-match "" t t library))) 189 (setq library (replace-match "" t t library)))
190 ((string-match "\\.eln\\'" library) 190 ((string-match "\\.eln\\'" library)
191 ;; From help-fns.el. 191 (setq library (gethash (file-name-nondirectory library) comp-eln-to-el-h))))
192 (setq library (expand-file-name (concat (file-name-base library)
193 ".el")
194 (concat (file-name-directory library)
195 "..")))))
196 (or 192 (or
197 (locate-file library 193 (locate-file library
198 (or find-function-source-path load-path) 194 (or find-function-source-path load-path)
@@ -300,12 +296,13 @@ if non-nil)."
300 (find-library-suffixes) 296 (find-library-suffixes)
301 "\\|")) 297 "\\|"))
302 (table (cl-loop for dir in (or find-function-source-path load-path) 298 (table (cl-loop for dir in (or find-function-source-path load-path)
303 when (file-readable-p dir) 299 for dir-or-default = (or dir default-directory)
300 when (file-readable-p dir-or-default)
304 append (mapcar 301 append (mapcar
305 (lambda (file) 302 (lambda (file)
306 (replace-regexp-in-string suffix-regexp 303 (replace-regexp-in-string suffix-regexp
307 "" file)) 304 "" file))
308 (directory-files dir nil 305 (directory-files dir-or-default nil
309 suffix-regexp)))) 306 suffix-regexp))))
310 (def (if (eq (function-called-at-point) 'require) 307 (def (if (eq (function-called-at-point) 'require)
311 ;; `function-called-at-point' may return 'require 308 ;; `function-called-at-point' may return 'require
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 1311d94cb01..584ed8c6f90 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -200,7 +200,9 @@
200 (save-excursion 200 (save-excursion
201 (ignore-errors 201 (ignore-errors
202 (goto-char pos) 202 (goto-char pos)
203 (or (eql (char-before) ?\') 203 ;; '(lambda ..) is not a funcall position, but #'(lambda ...) is.
204 (or (and (eql (char-before) ?\')
205 (not (eql (char-before (1- (point))) ?#)))
204 (let* ((ppss (syntax-ppss)) 206 (let* ((ppss (syntax-ppss))
205 (paren-posns (nth 9 ppss)) 207 (paren-posns (nth 9 ppss))
206 (parent 208 (parent
@@ -785,8 +787,6 @@ or to switch back to an existing one."
785 nil))) 787 nil)))
786 (comment-indent-default))) 788 (comment-indent-default)))
787 789
788(define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1")
789
790(defcustom lisp-indent-offset nil 790(defcustom lisp-indent-offset nil
791 "If non-nil, indent second line of expressions that many more columns." 791 "If non-nil, indent second line of expressions that many more columns."
792 :group 'lisp 792 :group 'lisp
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 88bb0a8bd6c..8d8d071031c 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -255,9 +255,9 @@ Left-fold the list L, starting with X, by the binary function F."
255 x) 255 x)
256 256
257(defun rx--normalise-or-arg (form) 257(defun rx--normalise-or-arg (form)
258 "Normalise the `or' argument FORM. 258 "Normalize the `or' argument FORM.
259Characters become strings, user-definitions and `eval' forms are expanded, 259Characters become strings, user-definitions and `eval' forms are expanded,
260and `or' forms are normalised recursively." 260and `or' forms are normalized recursively."
261 (cond ((characterp form) 261 (cond ((characterp form)
262 (char-to-string form)) 262 (char-to-string form))
263 ((and (consp form) (memq (car form) '(or |))) 263 ((and (consp form) (memq (car form) '(or |)))
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 77f1b291043..dd7648c2b77 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -694,7 +694,7 @@
694ARG is used as the prefix value for the executed command. If 694ARG is used as the prefix value for the executed command. If
695EVENTS is a list of events, which become the beginning of the command." 695EVENTS is a list of events, which become the beginning of the command."
696 (interactive "P") 696 (interactive "P")
697 (if (viper= (viper-last-command-char) ?\\) 697 (if (viper= last-command-event ?\\)
698 (message "Switched to EMACS state for the next command...")) 698 (message "Switched to EMACS state for the next command..."))
699 (viper-escape-to-state arg events 'emacs-state)) 699 (viper-escape-to-state arg events 'emacs-state))
700 700
@@ -1149,7 +1149,7 @@ as a Meta key and any number of multiple escapes are allowed."
1149 "Begin numeric argument for the next command." 1149 "Begin numeric argument for the next command."
1150 (interactive "P") 1150 (interactive "P")
1151 (viper-prefix-arg-value 1151 (viper-prefix-arg-value
1152 (viper-last-command-char) (if (consp arg) (cdr arg) nil))) 1152 last-command-event (if (consp arg) (cdr arg) nil)))
1153 1153
1154(defun viper-command-argument (arg) 1154(defun viper-command-argument (arg)
1155 "Accept a motion command as an argument." 1155 "Accept a motion command as an argument."
@@ -1157,7 +1157,7 @@ as a Meta key and any number of multiple escapes are allowed."
1157 (let ((viper-intermediate-command 'viper-command-argument)) 1157 (let ((viper-intermediate-command 'viper-command-argument))
1158 (condition-case nil 1158 (condition-case nil
1159 (viper-prefix-arg-com 1159 (viper-prefix-arg-com
1160 (viper-last-command-char) 1160 last-command-event
1161 (cond ((null arg) nil) 1161 (cond ((null arg) nil)
1162 ((consp arg) (car arg)) 1162 ((consp arg) (car arg))
1163 ((integerp arg) arg) 1163 ((integerp arg) arg)
@@ -1564,7 +1564,7 @@ invokes the command before that, etc."
1564 1564
1565;; Hook used in viper-undo 1565;; Hook used in viper-undo
1566(defun viper-after-change-undo-hook (beg end _len) 1566(defun viper-after-change-undo-hook (beg end _len)
1567 (if (and (boundp 'undo-in-progress) undo-in-progress) 1567 (if undo-in-progress
1568 (setq undo-beg-posn beg 1568 (setq undo-beg-posn beg
1569 undo-end-posn (or end beg)) 1569 undo-end-posn (or end beg))
1570 ;; some other hooks may be changing various text properties in 1570 ;; some other hooks may be changing various text properties in
@@ -1598,9 +1598,9 @@ invokes the command before that, etc."
1598 (pos-visible-in-window-p before-undo-pt)) 1598 (pos-visible-in-window-p before-undo-pt))
1599 (progn 1599 (progn
1600 (push-mark (point-marker) t) 1600 (push-mark (point-marker) t)
1601 (viper-sit-for-short 300) 1601 (sit-for 0.3)
1602 (goto-char undo-end-posn) 1602 (goto-char undo-end-posn)
1603 (viper-sit-for-short 300) 1603 (sit-for 0.3)
1604 (if (pos-visible-in-window-p undo-beg-posn) 1604 (if (pos-visible-in-window-p undo-beg-posn)
1605 (goto-char before-undo-pt) 1605 (goto-char before-undo-pt)
1606 (goto-char undo-beg-posn))) 1606 (goto-char undo-beg-posn)))
@@ -1886,15 +1886,11 @@ Undo previous insertion and inserts new."
1886 (or unread-command-events 1886 (or unread-command-events
1887 executing-kbd-macro 1887 executing-kbd-macro
1888 (sit-for 840)) 1888 (sit-for 840))
1889 (if (fboundp 'minibuffer-prompt-end) 1889 (delete-region (minibuffer-prompt-end) (point-max))
1890 (delete-region (minibuffer-prompt-end) (point-max))
1891 (erase-buffer))
1892 (insert viper-initial))) 1890 (insert viper-initial)))
1893 1891
1894(defsubst viper-minibuffer-real-start () 1892(defsubst viper-minibuffer-real-start ()
1895 (if (fboundp 'minibuffer-prompt-end) 1893 (minibuffer-prompt-end))
1896 (minibuffer-prompt-end)
1897 (point-min)))
1898 1894
1899(defun viper-minibuffer-post-command-hook() 1895(defun viper-minibuffer-post-command-hook()
1900 (when (active-minibuffer-window) 1896 (when (active-minibuffer-window)
@@ -1908,7 +1904,7 @@ Undo previous insertion and inserts new."
1908 "Exit minibuffer Viper way." 1904 "Exit minibuffer Viper way."
1909 (interactive) 1905 (interactive)
1910 (let (command) 1906 (let (command)
1911 (setq command (local-key-binding (char-to-string (viper-last-command-char)))) 1907 (setq command (local-key-binding (char-to-string last-command-event)))
1912 (run-hooks 'viper-minibuffer-exit-hook) 1908 (run-hooks 'viper-minibuffer-exit-hook)
1913 (if command 1909 (if command
1914 (command-execute command) 1910 (command-execute command)
@@ -2883,7 +2879,7 @@ If point is on a widget or a button, simulate clicking on that widget/button."
2883 (and (consp widget) 2879 (and (consp widget)
2884 (get (widget-type widget) 'widget-type)))) 2880 (get (widget-type widget) 'widget-type))))
2885 (widget-button-press (point)) 2881 (widget-button-press (point))
2886 (if (and (fboundp 'button-at) (fboundp 'push-button) (button-at (point))) 2882 (if (button-at (point))
2887 (push-button) 2883 (push-button)
2888 ;; not a widget or a button 2884 ;; not a widget or a button
2889 (save-excursion 2885 (save-excursion
@@ -4738,8 +4734,7 @@ Please, specify your level now: "))
4738 (viper-color-display-p (if (viper-window-display-p) 4734 (viper-color-display-p (if (viper-window-display-p)
4739 (viper-color-display-p) 4735 (viper-color-display-p)
4740 'non-x)) 4736 'non-x))
4741 (viper-frame-parameters (if (fboundp 'frame-parameters) 4737 (viper-frame-parameters (frame-parameters (selected-frame)))
4742 (frame-parameters (selected-frame))))
4743 (viper-minibuffer-emacs-face (if (viper-has-face-support-p) 4738 (viper-minibuffer-emacs-face (if (viper-has-face-support-p)
4744 (facep 4739 (facep
4745 viper-minibuffer-emacs-face) 4740 viper-minibuffer-emacs-face)
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 6ecfec548cb..928a3ef00ee 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -98,7 +98,7 @@ considered related."
98;;; Code 98;;; Code
99 99
100(defsubst viper-multiclick-p () 100(defsubst viper-multiclick-p ()
101 (not (viper-sit-for-short viper-multiclick-timeout t))) 101 (not (sit-for (/ viper-multiclick-timeout 1000.0) t)))
102 102
103;; Returns window where click occurs 103;; Returns window where click occurs
104(defun viper-mouse-click-window (click) 104(defun viper-mouse-click-window (click)
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 1561204151d..83e45e1cd0c 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -786,14 +786,11 @@ Otherwise return the normal value."
786(defun viper-check-minibuffer-overlay () 786(defun viper-check-minibuffer-overlay ()
787 (if (overlayp viper-minibuffer-overlay) 787 (if (overlayp viper-minibuffer-overlay)
788 (move-overlay 788 (move-overlay
789 viper-minibuffer-overlay 789 viper-minibuffer-overlay (minibuffer-prompt-end) (1+ (buffer-size)))
790 (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1)
791 (1+ (buffer-size)))
792 (setq viper-minibuffer-overlay 790 (setq viper-minibuffer-overlay
793 ;; make overlay open-ended 791 ;; make overlay open-ended
794 (make-overlay 792 (make-overlay
795 (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1) 793 (minibuffer-prompt-end) (1+ (buffer-size))
796 (1+ (buffer-size))
797 (current-buffer) nil 'rear-advance)))) 794 (current-buffer) nil 'rear-advance))))
798 795
799 796
@@ -808,9 +805,8 @@ Otherwise return the normal value."
808(define-obsolete-function-alias 'viper-abbreviate-file-name 805(define-obsolete-function-alias 'viper-abbreviate-file-name
809 'abbreviate-file-name "27.1") 806 'abbreviate-file-name "27.1")
810 807
811;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg
812;; in sit-for, so this function smooths out the differences.
813(defsubst viper-sit-for-short (val &optional nodisp) 808(defsubst viper-sit-for-short (val &optional nodisp)
809 (declare (obsolete nil "28.1"))
814 (sit-for (/ val 1000.0) nodisp)) 810 (sit-for (/ val 1000.0) nodisp))
815 811
816;; EVENT may be a single event of a sequence of events 812;; EVENT may be a single event of a sequence of events
@@ -868,11 +864,10 @@ Otherwise return the normal value."
868 864
869;; Uses different timeouts for ESC-sequences and others 865;; Uses different timeouts for ESC-sequences and others
870(defun viper-fast-keysequence-p () 866(defun viper-fast-keysequence-p ()
871 (not (viper-sit-for-short 867 (not (sit-for (/ (if (viper-ESC-event-p last-input-event)
872 (if (viper-ESC-event-p last-input-event) 868 (viper-ESC-keyseq-timeout)
873 (viper-ESC-keyseq-timeout) 869 viper-fast-keyseq-timeout) 1000.0)
874 viper-fast-keyseq-timeout) 870 t)))
875 t)))
876 871
877(define-obsolete-function-alias 'viper-read-event-convert-to-char 872(define-obsolete-function-alias 'viper-read-event-convert-to-char
878 'read-event "27.1") 873 'read-event "27.1")
@@ -920,6 +915,7 @@ Otherwise return the normal value."
920 basis))) 915 basis)))
921 916
922(defun viper-last-command-char () 917(defun viper-last-command-char ()
918 (declare (obsolete nil "28.1"))
923 last-command-event) 919 last-command-event)
924 920
925(defun viper-key-to-emacs-key (key) 921(defun viper-key-to-emacs-key (key)
diff --git a/lisp/epa.el b/lisp/epa.el
index d190824293f..5140d3f0a69 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -666,10 +666,6 @@ If SECRET is non-nil, list secret keys instead of public keys."
666 (goto-char (point-min))) 666 (goto-char (point-min)))
667 (display-buffer buffer))))) 667 (display-buffer buffer)))))
668 668
669(defun epa-display-verify-result (verify-result)
670 (declare (obsolete epa-display-info "23.1"))
671 (epa-display-info (epg-verify-result-to-string verify-result)))
672
673(defun epa-passphrase-callback-function (context key-id handback) 669(defun epa-passphrase-callback-function (context key-id handback)
674 (if (eq key-id 'SYM) 670 (if (eq key-id 'SYM)
675 (read-passwd 671 (read-passwd
diff --git a/lisp/epg.el b/lisp/epg.el
index 96af3ad4bca..920b85398f3 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -190,6 +190,7 @@
190 (string nil :read-only t)) 190 (string nil :read-only t))
191 191
192;;;; Context Struct 192;;;; Context Struct
193(declare-function epa-passphrase-callback-function "epa.el")
193 194
194(cl-defstruct (epg-context 195(cl-defstruct (epg-context
195 (:constructor nil) 196 (:constructor nil)
@@ -215,7 +216,7 @@
215 cipher-algorithm 216 cipher-algorithm
216 digest-algorithm 217 digest-algorithm
217 compress-algorithm 218 compress-algorithm
218 (passphrase-callback (list #'epg-passphrase-callback-function)) 219 (passphrase-callback (list #'epa-passphrase-callback-function))
219 progress-callback 220 progress-callback
220 edit-callback 221 edit-callback
221 signers 222 signers
@@ -1246,19 +1247,6 @@ callback data (if any)."
1246 1247
1247;;; Functions 1248;;; Functions
1248 1249
1249(defun epg-passphrase-callback-function (context key-id _handback)
1250 (declare (obsolete epa-passphrase-callback-function "23.1"))
1251 (if (eq key-id 'SYM)
1252 (read-passwd "Passphrase for symmetric encryption: "
1253 (eq (epg-context-operation context) 'encrypt))
1254 (read-passwd
1255 (if (eq key-id 'PIN)
1256 "Passphrase for PIN: "
1257 (let ((entry (assoc key-id epg-user-id-alist)))
1258 (if entry
1259 (format "Passphrase for %s %s: " key-id (cdr entry))
1260 (format "Passphrase for %s: " key-id)))))))
1261
1262(defun epg--list-keys-1 (context name mode) 1250(defun epg--list-keys-1 (context name mode)
1263 (let ((args (append (if (epg-context-home-directory context) 1251 (let ((args (append (if (epg-context-home-directory context)
1264 (list "--homedir" 1252 (list "--homedir"
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 4f3d85ba3c8..1cf0bb49217 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -98,7 +98,6 @@
98 98
99;;; Code: 99;;; Code:
100 100
101(require 'erc-compat)
102(eval-when-compile (require 'cl-lib)) 101(eval-when-compile (require 'cl-lib))
103;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. 102;; There's a fairly strong mutual dependency between erc.el and erc-backend.el.
104;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the 103;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the
@@ -782,7 +781,7 @@ value of `erc-server-coding-system'."
782 (pop precedence)) 781 (pop precedence))
783 (when precedence 782 (when precedence
784 (setq coding (car precedence))))) 783 (setq coding (car precedence)))))
785 (erc-decode-coding-string str coding))) 784 (decode-coding-string str coding t)))
786 785
787;; proposed name, not used by anything yet 786;; proposed name, not used by anything yet
788(defun erc-send-line (text display-fn) 787(defun erc-send-line (text display-fn)
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index bf98eb818f3..477f148197b 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -419,7 +419,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
419 (pcomplete-here 419 (pcomplete-here
420 (pcase (intern (downcase (pcomplete-arg 1))) 420 (pcase (intern (downcase (pcomplete-arg 1)))
421 ('chat (mapcar (lambda (elt) (plist-get elt :nick)) 421 ('chat (mapcar (lambda (elt) (plist-get elt :nick))
422 (erc-remove-if-not 422 (cl-remove-if-not
423 #'(lambda (elt) 423 #'(lambda (elt)
424 (eq (plist-get elt :type) 'CHAT)) 424 (eq (plist-get elt :type) 'CHAT))
425 erc-dcc-list))) 425 erc-dcc-list)))
@@ -427,7 +427,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
427 (mapcar (lambda (elt) (symbol-name (plist-get elt :type))) 427 (mapcar (lambda (elt) (symbol-name (plist-get elt :type)))
428 erc-dcc-list))) 428 erc-dcc-list)))
429 ('get (mapcar #'erc-dcc-nick 429 ('get (mapcar #'erc-dcc-nick
430 (erc-remove-if-not 430 (cl-remove-if-not
431 #'(lambda (elt) 431 #'(lambda (elt)
432 (eq (plist-get elt :type) 'GET)) 432 (eq (plist-get elt :type) 'GET))
433 erc-dcc-list))) 433 erc-dcc-list)))
@@ -435,7 +435,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
435 (pcomplete-here 435 (pcomplete-here
436 (pcase (intern (downcase (pcomplete-arg 2))) 436 (pcase (intern (downcase (pcomplete-arg 2)))
437 ('get (mapcar (lambda (elt) (plist-get elt :file)) 437 ('get (mapcar (lambda (elt) (plist-get elt :file))
438 (erc-remove-if-not 438 (cl-remove-if-not
439 #'(lambda (elt) 439 #'(lambda (elt)
440 (and (eq (plist-get elt :type) 'GET) 440 (and (eq (plist-get elt :type) 'GET)
441 (erc-nick-equal-p (erc-extract-nick 441 (erc-nick-equal-p (erc-extract-nick
@@ -443,7 +443,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
443 (pcomplete-arg 1)))) 443 (pcomplete-arg 1))))
444 erc-dcc-list))) 444 erc-dcc-list)))
445 ('close (mapcar #'erc-dcc-nick 445 ('close (mapcar #'erc-dcc-nick
446 (erc-remove-if-not 446 (cl-remove-if-not
447 #'(lambda (elt) 447 #'(lambda (elt)
448 (eq (plist-get elt :type) 448 (eq (plist-get elt :type)
449 (intern (upcase (pcomplete-arg 1))))) 449 (intern (upcase (pcomplete-arg 1)))))
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index 39a8be5e0cf..d09caf7aa12 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -38,7 +38,7 @@
38 :group 'erc) 38 :group 'erc)
39 39
40;;;###autoload(autoload 'erc-fill-mode "erc-fill" nil t) 40;;;###autoload(autoload 'erc-fill-mode "erc-fill" nil t)
41(erc-define-minor-mode erc-fill-mode 41(define-minor-mode erc-fill-mode
42 "Toggle ERC fill mode. 42 "Toggle ERC fill mode.
43With a prefix argument ARG, enable ERC fill mode if ARG is 43With a prefix argument ARG, enable ERC fill mode if ARG is
44positive, and disable it otherwise. If called from Lisp, enable 44positive, and disable it otherwise. If called from Lisp, enable
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index ff7a77f1265..a475f0a1770 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -399,8 +399,7 @@ See `erc-interpret-controls-p' and `erc-interpret-mirc-color' for options."
399 (start (match-beginning 0)) 399 (start (match-beginning 0))
400 (end (+ (match-beginning 0) 400 (end (+ (match-beginning 0)
401 (length (match-string 5 s))))) 401 (length (match-string 5 s)))))
402 (setq s (erc-replace-match-subexpression-in-string 402 (setq s (replace-match "" nil nil s 1))
403 "" s control 1 start))
404 (cond ((and erc-interpret-mirc-color (or fg-color bg-color)) 403 (cond ((and erc-interpret-mirc-color (or fg-color bg-color))
405 (setq fg fg-color) 404 (setq fg fg-color)
406 (setq bg bg-color)) 405 (setq bg bg-color))
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index e2c066da9b1..2166123e674 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -267,7 +267,7 @@ The current buffer is given by BUFFER."
267 (with-current-buffer buffer 267 (with-current-buffer buffer
268 (auto-save-mode -1) 268 (auto-save-mode -1)
269 (setq buffer-file-name nil) 269 (setq buffer-file-name nil)
270 (erc-set-write-file-functions '(erc-save-buffer-in-logs)) 270 (set (make-local-variable 'write-file-functions) '(erc-save-buffer-in-logs))
271 (when erc-log-insert-log-on-open 271 (when erc-log-insert-log-on-open
272 (ignore-errors 272 (ignore-errors
273 (save-excursion 273 (save-excursion
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index 6e87a183fc1..b3145674f29 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -94,7 +94,9 @@ The following values are allowed:
94 `nick-or-keyword' - highlight the nick of the user who typed your nickname, 94 `nick-or-keyword' - highlight the nick of the user who typed your nickname,
95 or all instances of the current nickname if there was 95 or all instances of the current nickname if there was
96 no sending user 96 no sending user
97 `all' - highlight the entire message where current nickname occurs 97 `message' - highlight the entire message where current nickname occurs
98 `all' - highlight the entire message (including the nick) where
99 current nickname occurs
98 100
99Any other value disables highlighting of current nickname altogether." 101Any other value disables highlighting of current nickname altogether."
100 :group 'erc-match 102 :group 'erc-match
@@ -102,6 +104,7 @@ Any other value disables highlighting of current nickname altogether."
102 (const nick) 104 (const nick)
103 (const keyword) 105 (const keyword)
104 (const nick-or-keyword) 106 (const nick-or-keyword)
107 (const message)
105 (const all))) 108 (const all)))
106 109
107(defcustom erc-pal-highlight-type 'nick 110(defcustom erc-pal-highlight-type 'nick
@@ -110,14 +113,17 @@ See `erc-pals'.
110 113
111The following values are allowed: 114The following values are allowed:
112 115
113 nil - do not highlight the message at all 116 nil - do not highlight the message at all
114 `nick' - highlight pal's nickname only 117 `nick' - highlight pal's nickname only
115 `all' - highlight the entire message from pal 118 `message' - highlight the entire message from pal
119 `all' - highlight the entire message (including the nick)
120 from pal
116 121
117Any other value disables pal highlighting altogether." 122Any other value disables pal highlighting altogether."
118 :group 'erc-match 123 :group 'erc-match
119 :type '(choice (const nil) 124 :type '(choice (const nil)
120 (const nick) 125 (const nick)
126 (const message)
121 (const all))) 127 (const all)))
122 128
123(defcustom erc-fool-highlight-type 'nick 129(defcustom erc-fool-highlight-type 'nick
@@ -126,14 +132,17 @@ See `erc-fools'.
126 132
127The following values are allowed: 133The following values are allowed:
128 134
129 nil - do not highlight the message at all 135 nil - do not highlight the message at all
130 `nick' - highlight fool's nickname only 136 `nick' - highlight fool's nickname only
131 `all' - highlight the entire message from fool 137 `message' - highlight the entire message from fool
138 `all' - highlight the entire message (including the nick)
139 from fool
132 140
133Any other value disables fool highlighting altogether." 141Any other value disables fool highlighting altogether."
134 :group 'erc-match 142 :group 'erc-match
135 :type '(choice (const nil) 143 :type '(choice (const nil)
136 (const nick) 144 (const nick)
145 (const message)
137 (const all))) 146 (const all)))
138 147
139(defcustom erc-keyword-highlight-type 'keyword 148(defcustom erc-keyword-highlight-type 'keyword
@@ -143,12 +152,15 @@ See variable `erc-keywords'.
143The following values are allowed: 152The following values are allowed:
144 153
145 `keyword' - highlight keyword only 154 `keyword' - highlight keyword only
146 `all' - highlight the entire message containing keyword 155 `message' - highlight the entire message containing keyword
156 `all' - highlight the entire message (including the nick)
157 containing keyword
147 158
148Any other value disables keyword highlighting altogether." 159Any other value disables keyword highlighting altogether."
149 :group 'erc-match 160 :group 'erc-match
150 :type '(choice (const nil) 161 :type '(choice (const nil)
151 (const keyword) 162 (const keyword)
163 (const message)
152 (const all))) 164 (const all)))
153 165
154(defcustom erc-dangerous-host-highlight-type 'nick 166(defcustom erc-dangerous-host-highlight-type 'nick
@@ -157,13 +169,16 @@ See `erc-dangerous-hosts'.
157 169
158The following values are allowed: 170The following values are allowed:
159 171
160 `nick' - highlight nick from dangerous-host only 172 `nick' - highlight nick from dangerous-host only
161 `all' - highlight the entire message from dangerous-host 173 `message' - highlight the entire message from dangerous-host
174 `all' - highlight the entire message (including the nick)
175 from dangerous-host
162 176
163Any other value disables dangerous-host highlighting altogether." 177Any other value disables dangerous-host highlighting altogether."
164 :group 'erc-match 178 :group 'erc-match
165 :type '(choice (const nil) 179 :type '(choice (const nil)
166 (const nick) 180 (const nick)
181 (const message)
167 (const all))) 182 (const all)))
168 183
169 184
@@ -449,19 +464,18 @@ Use this defun with `erc-insert-modify-hook'."
449 (match-beginning 0))) 464 (match-beginning 0)))
450 (nick-end (when nick-beg 465 (nick-end (when nick-beg
451 (match-end 0))) 466 (match-end 0)))
452 (message (buffer-substring 467 (message-beg (if (and nick-end
453 (if (and nick-end 468 (<= (+ 2 nick-end) (point-max)))
454 (<= (+ 2 nick-end) (point-max))) 469 ;; Message starts 2 characters after the
455 ;; Message starts 2 characters after the nick 470 ;; nick except for CTCP ACTION messages.
456 ;; except for CTCP ACTION messages. Nick 471 ;; Nick surrounded by angle brackets only in
457 ;; surrounded by angle brackets only in normal 472 ;; normal messages.
458 ;; messages. 473 (+ nick-end
459 (+ nick-end 474 (if (eq ?> (char-after nick-end))
460 (if (eq ?> (char-after nick-end)) 475 2
461 2 476 1))
462 1)) 477 (point-min)))
463 (point-min)) 478 (message (buffer-substring message-beg (point-max))))
464 (point-max))))
465 (when (and vector 479 (when (and vector
466 (not (and erc-match-exclude-server-buffer 480 (not (and erc-match-exclude-server-buffer
467 (erc-server-buffer-p)))) 481 (erc-server-buffer-p))))
@@ -498,7 +512,12 @@ Use this defun with `erc-insert-modify-hook'."
498 (while (re-search-forward match-regex nil t) 512 (while (re-search-forward match-regex nil t)
499 (erc-put-text-property (match-beginning 0) (match-end 0) 513 (erc-put-text-property (match-beginning 0) (match-end 0)
500 'font-lock-face match-face)))) 514 'font-lock-face match-face))))
501 ;; Highlight the whole message 515 ;; Highlight the whole message (not including the nick)
516 ((eq match-htype 'message)
517 (erc-put-text-property
518 message-beg (point-max)
519 'font-lock-face match-face (current-buffer)))
520 ;; Highlight the whole message (including the nick)
502 ((eq match-htype 'all) 521 ((eq match-htype 'all)
503 (erc-put-text-property 522 (erc-put-text-property
504 (point-min) (point-max) 523 (point-min) (point-max)
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index 1b092c8a6a9..144a981f832 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/erc-notify.el
@@ -181,7 +181,7 @@ nick from `erc-last-ison' to prevent any further notifications."
181 (let ((nick (erc-extract-nick (erc-response.sender parsed)))) 181 (let ((nick (erc-extract-nick (erc-response.sender parsed))))
182 (when (and (erc-member-ignore-case nick erc-notify-list) 182 (when (and (erc-member-ignore-case nick erc-notify-list)
183 (erc-member-ignore-case nick erc-last-ison)) 183 (erc-member-ignore-case nick erc-last-ison))
184 (setq erc-last-ison (erc-delete-if 184 (setq erc-last-ison (cl-delete-if
185 (let ((nick-down (erc-downcase nick))) 185 (let ((nick-down (erc-downcase nick)))
186 (lambda (el) 186 (lambda (el)
187 (string= nick-down (erc-downcase el)))) 187 (string= nick-down (erc-downcase el))))
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index 7643fa85b96..f8b7e13be02 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -41,7 +41,6 @@
41 41
42(require 'pcomplete) 42(require 'pcomplete)
43(require 'erc) 43(require 'erc)
44(require 'erc-compat)
45(require 'time-date) 44(require 'time-date)
46 45
47(defgroup erc-pcomplete nil 46(defgroup erc-pcomplete nil
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index cbab2f9da2b..08970f2d70e 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -35,7 +35,6 @@
35;;; Code: 35;;; Code:
36 36
37(require 'erc) 37(require 'erc)
38(require 'erc-compat)
39 38
40(defgroup erc-stamp nil 39(defgroup erc-stamp nil
41 "For long conversation on IRC it is sometimes quite 40 "For long conversation on IRC it is sometimes quite
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 41d8fc1a98f..3398c8b9d0c 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -36,7 +36,6 @@
36 36
37(eval-when-compile (require 'cl-lib)) 37(eval-when-compile (require 'cl-lib))
38(require 'erc) 38(require 'erc)
39(require 'erc-compat)
40(require 'erc-match) 39(require 'erc-match)
41 40
42;;; Code: 41;;; Code:
@@ -329,9 +328,8 @@ important."
329 328
330(defun erc-track-remove-from-mode-line () 329(defun erc-track-remove-from-mode-line ()
331 "Remove `erc-track-modified-channels' from the mode-line." 330 "Remove `erc-track-modified-channels' from the mode-line."
332 (when (boundp 'mode-line-modes) 331 (setq mode-line-modes
333 (setq mode-line-modes 332 (remove '(t erc-modified-channels-object) mode-line-modes))
334 (remove '(t erc-modified-channels-object) mode-line-modes)))
335 (when (consp global-mode-string) 333 (when (consp global-mode-string)
336 (setq global-mode-string 334 (setq global-mode-string
337 (delq 'erc-modified-channels-object global-mode-string)))) 335 (delq 'erc-modified-channels-object global-mode-string))))
@@ -341,12 +339,10 @@ important."
341See `erc-track-position-in-mode-line' for possible values." 339See `erc-track-position-in-mode-line' for possible values."
342 ;; CVS Emacs has a new format string, and global-mode-string 340 ;; CVS Emacs has a new format string, and global-mode-string
343 ;; is very far to the right. 341 ;; is very far to the right.
344 (cond ((and (eq position 'before-modes) 342 (cond ((eq position 'before-modes)
345 (boundp 'mode-line-modes))
346 (add-to-list 'mode-line-modes 343 (add-to-list 'mode-line-modes
347 '(t erc-modified-channels-object))) 344 '(t erc-modified-channels-object)))
348 ((and (eq position 'after-modes) 345 ((eq position 'after-modes)
349 (boundp 'mode-line-modes))
350 (add-to-list 'mode-line-modes 346 (add-to-list 'mode-line-modes
351 '(t erc-modified-channels-object) t)) 347 '(t erc-modified-channels-object) t))
352 ((eq position t) 348 ((eq position t)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 41d7516fbb4..8712113790b 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -57,12 +57,12 @@
57 57
58(load "erc-loaddefs" nil t) 58(load "erc-loaddefs" nil t)
59 59
60(eval-when-compile (require 'cl-lib)) 60(require 'cl-lib)
61(require 'font-lock) 61(require 'font-lock)
62(require 'format-spec)
62(require 'pp) 63(require 'pp)
63(require 'thingatpt) 64(require 'thingatpt)
64(require 'auth-source) 65(require 'auth-source)
65(require 'erc-compat)
66(require 'time-date) 66(require 'time-date)
67(require 'iso8601) 67(require 'iso8601)
68(eval-when-compile (require 'subr-x)) 68(eval-when-compile (require 'subr-x))
@@ -877,8 +877,8 @@ See `erc-server-flood-margin' for other flood-related parameters.")
877;; Script parameters 877;; Script parameters
878 878
879(defcustom erc-startup-file-list 879(defcustom erc-startup-file-list
880 (list (concat erc-user-emacs-directory ".ercrc.el") 880 (list (concat user-emacs-directory ".ercrc.el")
881 (concat erc-user-emacs-directory ".ercrc") 881 (concat user-emacs-directory ".ercrc")
882 "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") 882 "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
883 "List of files to try for a startup script. 883 "List of files to try for a startup script.
884The first existent and readable one will get executed. 884The first existent and readable one will get executed.
@@ -1306,7 +1306,7 @@ Example:
1306 (enable (intern (format "erc-%s-enable" (downcase sn)))) 1306 (enable (intern (format "erc-%s-enable" (downcase sn))))
1307 (disable (intern (format "erc-%s-disable" (downcase sn))))) 1307 (disable (intern (format "erc-%s-disable" (downcase sn)))))
1308 `(progn 1308 `(progn
1309 (erc-define-minor-mode 1309 (define-minor-mode
1310 ,mode 1310 ,mode
1311 ,(format "Toggle ERC %S mode. 1311 ,(format "Toggle ERC %S mode.
1312With a prefix argument ARG, enable %s if ARG is positive, 1312With a prefix argument ARG, enable %s if ARG is positive,
@@ -1489,8 +1489,7 @@ Defaults to the server buffer."
1489(define-derived-mode erc-mode fundamental-mode "ERC" 1489(define-derived-mode erc-mode fundamental-mode "ERC"
1490 "Major mode for Emacs IRC." 1490 "Major mode for Emacs IRC."
1491 (setq local-abbrev-table erc-mode-abbrev-table) 1491 (setq local-abbrev-table erc-mode-abbrev-table)
1492 (when (boundp 'next-line-add-newlines) 1492 (set (make-local-variable 'next-line-add-newlines) nil)
1493 (set (make-local-variable 'next-line-add-newlines) nil))
1494 (setq line-move-ignore-invisible t) 1493 (setq line-move-ignore-invisible t)
1495 (set (make-local-variable 'paragraph-separate) 1494 (set (make-local-variable 'paragraph-separate)
1496 (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)")) 1495 (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)"))
@@ -2688,7 +2687,7 @@ displayed hostnames."
2688otherwise `erc-server-announced-name'. SERVER is matched against 2687otherwise `erc-server-announced-name'. SERVER is matched against
2689`erc-common-server-suffixes'." 2688`erc-common-server-suffixes'."
2690 (when server 2689 (when server
2691 (or (cdar (erc-remove-if-not 2690 (or (cdar (cl-remove-if-not
2692 (lambda (net) (string-match (car net) server)) 2691 (lambda (net) (string-match (car net) server))
2693 erc-common-server-suffixes)) 2692 erc-common-server-suffixes))
2694 erc-server-announced-name))) 2693 erc-server-announced-name)))
@@ -3725,8 +3724,9 @@ the message given by REASON."
3725 x-toolkit-scroll-bars))) 3724 x-toolkit-scroll-bars)))
3726 "") 3725 "")
3727 (if (featurep 'multi-tty) ", multi-tty" "")) 3726 (if (featurep 'multi-tty) ", multi-tty" ""))
3728 (if erc-emacs-build-time 3727 (if emacs-build-time
3729 (concat " of " erc-emacs-build-time) 3728 (concat " of " (format-time-string
3729 "%Y-%m-%d" emacs-build-time))
3730 ""))) 3730 "")))
3731 t) 3731 t)
3732 3732
@@ -4573,7 +4573,7 @@ See also: `erc-echo-notice-in-user-buffers',
4573 ((string-match "^-" mode) 4573 ((string-match "^-" mode)
4574 ;; Remove the unbanned masks from the ban list 4574 ;; Remove the unbanned masks from the ban list
4575 (setq erc-channel-banlist 4575 (setq erc-channel-banlist
4576 (erc-delete-if 4576 (cl-delete-if
4577 #'(lambda (y) 4577 #'(lambda (y)
4578 (member (upcase (cdr y)) 4578 (member (upcase (cdr y))
4579 (mapcar #'upcase 4579 (mapcar #'upcase
@@ -4594,7 +4594,7 @@ See also: `erc-echo-notice-in-user-buffers',
4594 "Group LIST into sublists of length N." 4594 "Group LIST into sublists of length N."
4595 (cond ((null list) nil) 4595 (cond ((null list) nil)
4596 ((null (nthcdr n list)) (list list)) 4596 ((null (nthcdr n list)) (list list))
4597 (t (cons (erc-subseq list 0 n) (erc-group-list (nthcdr n list) n))))) 4597 (t (cons (cl-subseq list 0 n) (erc-group-list (nthcdr n list) n)))))
4598 4598
4599 4599
4600;;; MOTD numreplies 4600;;; MOTD numreplies
@@ -6183,8 +6183,7 @@ non-nil value is found.
6183 output (apply #'format format-args)) 6183 output (apply #'format format-args))
6184 ;; Change all "1 units" to "1 unit". 6184 ;; Change all "1 units" to "1 unit".
6185 (while (string-match "\\([^0-9]\\|^\\)1 \\S-+\\(s\\)" output) 6185 (while (string-match "\\([^0-9]\\|^\\)1 \\S-+\\(s\\)" output)
6186 (setq output (erc-replace-match-subexpression-in-string 6186 (setq output (replace-match "" nil nil output 2)))
6187 "" output (match-string 2 output) 2 (match-beginning 2))))
6188 output)) 6187 output))
6189 6188
6190 6189
diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el
index bf5a4bf1afe..7991c631772 100644
--- a/lisp/eshell/em-rebind.el
+++ b/lisp/eshell/em-rebind.el
@@ -114,7 +114,6 @@ This is default behavior of shells like bash."
114 backward-list 114 backward-list
115 forward-page 115 forward-page
116 backward-page 116 backward-page
117 forward-point
118 forward-paragraph 117 forward-paragraph
119 backward-paragraph 118 backward-paragraph
120 backward-prefix-chars 119 backward-prefix-chars
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index 0aa4ec4d16c..b4154861908 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -382,12 +382,7 @@ it defaults to `insert'."
382 "Set handle INDEX, using MODE, to point to TARGET." 382 "Set handle INDEX, using MODE, to point to TARGET."
383 (when target 383 (when target
384 (if (and (stringp target) 384 (if (and (stringp target)
385 (or (cond 385 (or (string= target null-device)
386 ((boundp 'null-device)
387 (string= target null-device))
388 ((boundp 'grep-null-device)
389 (string= target grep-null-device))
390 (t nil))
391 (string= target "/dev/null"))) 386 (string= target "/dev/null")))
392 (aset eshell-current-handles index nil) 387 (aset eshell-current-handles index nil)
393 (let ((where (eshell-get-target target mode)) 388 (let ((where (eshell-get-target target mode))
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index d0147b345aa..8799007c596 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -690,46 +690,47 @@ newline."
690 "Send the output from PROCESS (STRING) to the interactive display. 690 "Send the output from PROCESS (STRING) to the interactive display.
691This is done after all necessary filtering has been done." 691This is done after all necessary filtering has been done."
692 (let ((oprocbuf (if process (process-buffer process) 692 (let ((oprocbuf (if process (process-buffer process)
693 (current-buffer))) 693 (current-buffer)))
694 (inhibit-point-motion-hooks t) 694 (inhibit-point-motion-hooks t)
695 (inhibit-modification-hooks t)) 695 (inhibit-modification-hooks t))
696 (let ((functions eshell-preoutput-filter-functions)) 696 (when (and string oprocbuf (buffer-name oprocbuf))
697 (while (and functions string) 697 (with-current-buffer oprocbuf
698 (setq string (funcall (car functions) string)) 698 (let ((functions eshell-preoutput-filter-functions))
699 (setq functions (cdr functions)))) 699 (while (and functions string)
700 (if (and string oprocbuf (buffer-name oprocbuf)) 700 (setq string (funcall (car functions) string))
701 (let (opoint obeg oend) 701 (setq functions (cdr functions))))
702 (with-current-buffer oprocbuf 702 (when string
703 (setq opoint (point)) 703 (let (opoint obeg oend)
704 (setq obeg (point-min)) 704 (setq opoint (point))
705 (setq oend (point-max)) 705 (setq obeg (point-min))
706 (let ((buffer-read-only nil) 706 (setq oend (point-max))
707 (nchars (length string)) 707 (let ((buffer-read-only nil)
708 (ostart nil)) 708 (nchars (length string))
709 (widen) 709 (ostart nil))
710 (goto-char eshell-last-output-end) 710 (widen)
711 (setq ostart (point)) 711 (goto-char eshell-last-output-end)
712 (if (<= (point) opoint) 712 (setq ostart (point))
713 (setq opoint (+ opoint nchars))) 713 (if (<= (point) opoint)
714 (if (< (point) obeg) 714 (setq opoint (+ opoint nchars)))
715 (setq obeg (+ obeg nchars))) 715 (if (< (point) obeg)
716 (if (<= (point) oend) 716 (setq obeg (+ obeg nchars)))
717 (setq oend (+ oend nchars))) 717 (if (<= (point) oend)
718 (setq oend (+ oend nchars)))
718 ;; Let the ansi-color overlay hooks run. 719 ;; Let the ansi-color overlay hooks run.
719 (let ((inhibit-modification-hooks nil)) 720 (let ((inhibit-modification-hooks nil))
720 (insert-before-markers string)) 721 (insert-before-markers string))
721 (if (= (window-start) (point)) 722 (if (= (window-start) (point))
722 (set-window-start (selected-window) 723 (set-window-start (selected-window)
723 (- (point) nchars))) 724 (- (point) nchars)))
724 (if (= (point) eshell-last-input-end) 725 (if (= (point) eshell-last-input-end)
725 (set-marker eshell-last-input-end 726 (set-marker eshell-last-input-end
726 (- eshell-last-input-end nchars))) 727 (- eshell-last-input-end nchars)))
727 (set-marker eshell-last-output-start ostart) 728 (set-marker eshell-last-output-start ostart)
728 (set-marker eshell-last-output-end (point)) 729 (set-marker eshell-last-output-end (point))
729 (force-mode-line-update)) 730 (force-mode-line-update))
730 (narrow-to-region obeg oend) 731 (narrow-to-region obeg oend)
731 (goto-char opoint) 732 (goto-char opoint)
732 (eshell-run-output-filters)))))) 733 (eshell-run-output-filters)))))))
733 734
734(defun eshell-run-output-filters () 735(defun eshell-run-output-filters ()
735 "Run the `eshell-output-filter-functions' on the current output." 736 "Run the `eshell-output-filter-functions' on the current output."
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index 5ffb159b575..6698ca45de4 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -384,15 +384,6 @@ corresponding to a successful execution."
384 (set status-var eshell-last-command-status)) 384 (set status-var eshell-last-command-status))
385 (cadr result)))))) 385 (cadr result))))))
386 386
387;;;_* Reporting bugs
388;;
389;; If you do encounter a bug, on any system, please report
390;; it -- in addition to any particular oddities in your configuration
391;; -- so that the problem may be corrected for the benefit of others.
392
393;;;###autoload
394(define-obsolete-function-alias 'eshell-report-bug 'report-emacs-bug "23.1")
395
396;;; Code: 387;;; Code:
397 388
398(defun eshell-unload-all-modules () 389(defun eshell-unload-all-modules ()
diff --git a/lisp/ffap.el b/lisp/ffap.el
index ceba9d26223..28f566dd93a 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1109,6 +1109,121 @@ The arguments CHARS, BEG and END are handled as described in
1109 ;; Added at suggestion of RHOGEE (for ff-paths), 7/24/95. 1109 ;; Added at suggestion of RHOGEE (for ff-paths), 7/24/95.
1110 "Last string returned by the function `ffap-string-at-point'.") 1110 "Last string returned by the function `ffap-string-at-point'.")
1111 1111
1112(defcustom ffap-file-name-with-spaces nil
1113 "If non-nil, enable looking for paths with spaces in `ffap-string-at-point'.
1114Enabling this variable may lead to `find-file-at-point' guessing
1115wrong more often when trying to find a file name intermingled
1116with normal text, but can be useful when working on systems that
1117normally use spaces in file names (like Microsoft Windows and the
1118like)."
1119 :type 'boolean
1120 :version "28.1")
1121
1122(defun ffap-search-backward-file-end (&optional dir-separator end)
1123 "Search backward position point where file would probably end.
1124Optional DIR-SEPARATOR defaults to \"/\". The search maximum is
1125`line-end-position' or optional END point.
1126
1127Suppose the cursor is somewhere that might be near end of file,
1128the guessing would position point before punctuation (like comma)
1129after the file extension:
1130
1131 C:\temp\file.log, which contain ....
1132 =============================== (before)
1133 ---------------- (after)
1134
1135
1136 C:\temp\file.log on Windows or /tmp/file.log on Unix
1137 =============================== (before)
1138 ---------------- (after)
1139
1140The strategy is to search backward until DIR-SEPARATOR which defaults to
1141\"/\" and then take educated guesses.
1142
1143Move point and return point if an adjustment was done."
1144 (unless dir-separator
1145 (setq dir-separator "/"))
1146 (let ((opoint (point))
1147 point punct end whitespace-p)
1148 (when (re-search-backward
1149 (regexp-quote dir-separator) (line-beginning-position) t)
1150 ;; Move to the beginning of the match..
1151 (forward-char 1)
1152 ;; ... until typical punctuation.
1153 (when (re-search-forward "\\([][<>()\"'`,.:;]\\)"
1154 (or end
1155 (line-end-position))
1156 t)
1157 (setq end (match-end 0))
1158 (setq punct (match-string 1))
1159 (setq whitespace-p (looking-at "[ \t\r\n]\\|$"))
1160 (goto-char end)
1161 (cond
1162 ((and (string-equal punct ".")
1163 whitespace-p) ;end of sentence
1164 (setq point (1- (point))))
1165 ((and (string-equal punct ".")
1166 (looking-at "[a-zA-Z0-9.]+")) ;possibly file extension
1167 (setq point (match-end 0)))
1168 (t
1169 (setq point (point)))))
1170 (goto-char opoint)
1171 (when point
1172 (goto-char point)
1173 point))))
1174
1175(defun ffap-search-forward-file-end (&optional dir-separator)
1176 "Search DIR-SEPARATOR and position point at file's maximum ending.
1177This includes spaces.
1178Optional DIR-SEPARATOR defaults to \"/\".
1179Call `ffap-search-backward-file-end' to refine the ending point."
1180 (unless dir-separator
1181 (setq dir-separator "/"))
1182 (let* ((chars ;expected chars in file name
1183 (concat "[^][^<>()\"'`;,#*|"
1184 ;; exclude the opposite as we know the separator
1185 (if (string-equal dir-separator "/")
1186 "\\\\"
1187 "/")
1188 "\t\r\n]"))
1189 (re (concat
1190 chars "*"
1191 (if dir-separator
1192 (regexp-quote dir-separator)
1193 "/")
1194 chars "*")))
1195 (when (looking-at re)
1196 (goto-char (match-end 0)))))
1197
1198(defun ffap-dir-separator-near-point ()
1199 "Search backward and forward for closest slash or backlash in line.
1200Return string slash or backslash. Point is moved to closest position."
1201 (let ((point (point))
1202 str pos)
1203 (when (looking-at ".*?/")
1204 (setq str "/"
1205 pos (match-end 0)))
1206 (when (and (looking-at ".*?\\\\")
1207 (or (null pos)
1208 (< (match-end 0) pos)))
1209 (setq str "\\"
1210 pos (match-end 0)))
1211 (goto-char point)
1212 (when (and (re-search-backward "/" (line-beginning-position) t)
1213 (or (null pos)
1214 (< (- point (point)) (- pos point))))
1215 (setq str "/"
1216 pos (1+ (point)))) ;1+ to keep cursor at the end of char
1217 (goto-char point)
1218 (when (and (re-search-backward "\\\\" (line-beginning-position) t)
1219 (or (null pos)
1220 (< (- point (point)) (- pos point))))
1221 (setq str "\\"
1222 pos (1+ (point))))
1223 (when pos
1224 (goto-char pos))
1225 str))
1226
1112(defun ffap-string-at-point (&optional mode) 1227(defun ffap-string-at-point (&optional mode)
1113 "Return a string of characters from around point. 1228 "Return a string of characters from around point.
1114 1229
@@ -1128,7 +1243,8 @@ Set the variables `ffap-string-at-point' and
1128 1243
1129When the region is active and larger than `ffap-max-region-length', 1244When the region is active and larger than `ffap-max-region-length',
1130return an empty string, and set `ffap-string-at-point-region' to '(1 1)." 1245return an empty string, and set `ffap-string-at-point-region' to '(1 1)."
1131 (let* ((args 1246 (let* (dir-separator
1247 (args
1132 (cdr 1248 (cdr
1133 (or (assq (or mode major-mode) ffap-string-at-point-mode-alist) 1249 (or (assq (or mode major-mode) ffap-string-at-point-mode-alist)
1134 (assq 'file ffap-string-at-point-mode-alist)))) 1250 (assq 'file ffap-string-at-point-mode-alist))))
@@ -1137,14 +1253,25 @@ return an empty string, and set `ffap-string-at-point-region' to '(1 1)."
1137 (beg (if region-selected 1253 (beg (if region-selected
1138 (region-beginning) 1254 (region-beginning)
1139 (save-excursion 1255 (save-excursion
1140 (skip-chars-backward (car args)) 1256 (if (and ffap-file-name-with-spaces
1141 (skip-chars-forward (nth 1 args) pt) 1257 (memq mode '(nil file)))
1258 (when (setq dir-separator (ffap-dir-separator-near-point))
1259 (while (re-search-backward
1260 (regexp-quote dir-separator)
1261 (line-beginning-position) t)
1262 (goto-char (match-beginning 0))))
1263 (skip-chars-backward (car args))
1264 (skip-chars-forward (nth 1 args) pt))
1142 (point)))) 1265 (point))))
1143 (end (if region-selected 1266 (end (if region-selected
1144 (region-end) 1267 (region-end)
1145 (save-excursion 1268 (save-excursion
1146 (skip-chars-forward (car args)) 1269 (skip-chars-forward (car args))
1147 (skip-chars-backward (nth 2 args) pt) 1270 (skip-chars-backward (nth 2 args) pt)
1271 (when (and ffap-file-name-with-spaces
1272 (memq mode '(nil file)))
1273 (ffap-search-forward-file-end dir-separator)
1274 (ffap-search-backward-file-end dir-separator))
1148 (point)))) 1275 (point))))
1149 (region-len (- (max beg end) (min beg end)))) 1276 (region-len (- (max beg end) (min beg end))))
1150 1277
@@ -1825,12 +1952,6 @@ Only intended for interactive use."
1825(defalias 'find-file-literally-at-point 'ffap-literally) 1952(defalias 'find-file-literally-at-point 'ffap-literally)
1826 1953
1827 1954
1828;;; Bug Reporter:
1829
1830(define-obsolete-function-alias 'ffap-bug 'report-emacs-bug "23.1")
1831(define-obsolete-function-alias 'ffap-submit-bug 'report-emacs-bug "23.1")
1832
1833
1834;;; Hooks for Gnus, VM, Rmail: 1955;;; Hooks for Gnus, VM, Rmail:
1835;; 1956;;
1836;; If you do not like these bindings, write versions with whatever 1957;; If you do not like these bindings, write versions with whatever
diff --git a/lisp/files.el b/lisp/files.el
index 9270f334afa..975f78e8527 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -926,7 +926,10 @@ one or more of those symbols."
926 (logior (if (memq 'executable predicate) 1 0) 926 (logior (if (memq 'executable predicate) 1 0)
927 (if (memq 'writable predicate) 2 0) 927 (if (memq 'writable predicate) 2 0)
928 (if (memq 'readable predicate) 4 0)))) 928 (if (memq 'readable predicate) 4 0))))
929 (locate-file-internal filename path suffixes predicate)) 929 (let ((file (locate-file-internal filename path suffixes predicate)))
930 (if (and file (string-match "\\.eln\\'" file))
931 (gethash (file-name-nondirectory file) comp-eln-to-el-h)
932 file)))
930 933
931(defun locate-file-completion-table (dirs suffixes string pred action) 934(defun locate-file-completion-table (dirs suffixes string pred action)
932 "Do completion for file names passed to `locate-file'." 935 "Do completion for file names passed to `locate-file'."
@@ -985,14 +988,6 @@ one or more of those symbols."
985 (completion-table-with-context 988 (completion-table-with-context
986 string-dir names string-file pred action))))) 989 string-dir names string-file pred action)))))
987 990
988(defun locate-file-completion (string path-and-suffixes action)
989 "Do completion for file names passed to `locate-file'.
990PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)."
991 (declare (obsolete locate-file-completion-table "23.1"))
992 (locate-file-completion-table (car path-and-suffixes)
993 (cdr path-and-suffixes)
994 string nil action))
995
996(defvar locate-dominating-stop-dir-regexp 991(defvar locate-dominating-stop-dir-regexp
997 (purecopy "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'") 992 (purecopy "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'")
998 "Regexp of directory names that stop the search in `locate-dominating-file'. 993 "Regexp of directory names that stop the search in `locate-dominating-file'.
diff --git a/lisp/forms.el b/lisp/forms.el
index fcb6075f94b..83daabdcd6e 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -504,12 +504,9 @@ Commands: Equivalent keys in read-only mode:
504 (setq forms-new-record-filter nil) 504 (setq forms-new-record-filter nil)
505 (setq forms-modified-record-filter nil) 505 (setq forms-modified-record-filter nil)
506 506
507 ;; If running Emacs 19 under X, setup faces to show read-only and 507 ;; Setup faces to show read-only and read-write fields.
508 ;; read-write fields. 508 (make-local-variable 'forms-ro-face)
509 (if (fboundp 'make-face) 509 (make-local-variable 'forms-rw-face)
510 (progn
511 (make-local-variable 'forms-ro-face)
512 (make-local-variable 'forms-rw-face)))
513 510
514 ;; eval the buffer, should set variables 511 ;; eval the buffer, should set variables
515 ;;(message "forms: processing control file...") 512 ;;(message "forms: processing control file...")
@@ -609,16 +606,14 @@ Commands: Equivalent keys in read-only mode:
609 (setq forms--mode-setup t) 606 (setq forms--mode-setup t)
610 607
611 ;; Copy desired faces to the actual variables used by the forms formatter. 608 ;; Copy desired faces to the actual variables used by the forms formatter.
612 (if (fboundp 'make-face) 609 (make-local-variable 'forms--ro-face)
610 (make-local-variable 'forms--rw-face)
611 (if forms-read-only
613 (progn 612 (progn
614 (make-local-variable 'forms--ro-face) 613 (setq forms--ro-face forms-ro-face)
615 (make-local-variable 'forms--rw-face) 614 (setq forms--rw-face forms-ro-face))
616 (if forms-read-only 615 (setq forms--ro-face forms-ro-face)
617 (progn 616 (setq forms--rw-face forms-rw-face))
618 (setq forms--ro-face forms-ro-face)
619 (setq forms--rw-face forms-ro-face))
620 (setq forms--ro-face forms-ro-face)
621 (setq forms--rw-face forms-rw-face))))
622 617
623 ;; Make more local variables. 618 ;; Make more local variables.
624 (make-local-variable 'forms--file-buffer) 619 (make-local-variable 'forms--file-buffer)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 4363860eac8..c53f81fe026 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1913,7 +1913,8 @@ increase the score of each group you read."
1913 "," gnus-summary-best-unread-article 1913 "," gnus-summary-best-unread-article
1914 "[" gnus-summary-prev-unseen-article 1914 "[" gnus-summary-prev-unseen-article
1915 "]" gnus-summary-next-unseen-article 1915 "]" gnus-summary-next-unseen-article
1916 "\M-s" gnus-summary-search-article-forward 1916 "\M-s\M-s" gnus-summary-search-article-forward
1917 "\M-s\M-r" gnus-summary-search-article-backward
1917 "\M-r" gnus-summary-search-article-backward 1918 "\M-r" gnus-summary-search-article-backward
1918 "\M-S" gnus-summary-repeat-search-article-forward 1919 "\M-S" gnus-summary-repeat-search-article-forward
1919 "\M-R" gnus-summary-repeat-search-article-backward 1920 "\M-R" gnus-summary-repeat-search-article-backward
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index ab625be9e37..07ff4890385 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -2751,16 +2751,17 @@ OpenPGP header will be left out. If all the values are nil,
2751or `message-openpgp-header' is itself nil, the OpenPGP header 2751or `message-openpgp-header' is itself nil, the OpenPGP header
2752will not be inserted." 2752will not be inserted."
2753 :type '(choice 2753 :type '(choice
2754 (const nil :tag "Don't add OpenPGP header") 2754 (const :tag "Don't add OpenPGP header" nil)
2755 (list (choice (string :tag "ID") 2755 (list :tag "Use OpenPGP header"
2756 (const nil :tag "No ID")) 2756 (choice (string :tag "ID")
2757 (const :tag "No ID" nil))
2757 (choice (string :tag "Key") 2758 (choice (string :tag "Key")
2758 (const nil :tag "No Key")) 2759 (const :tag "No Key" nil))
2759 (choice (other nil :tag "None") 2760 (choice (other :tag "None" nil)
2760 (const "unprotected" :tag "Unprotected") 2761 (const :tag "Unprotected" "unprotected")
2761 (const "sign" :tag "Sign") 2762 (const :tag "Sign" "sign")
2762 (const "encrypt" :tag "Encrypt") 2763 (const :tag "Encrypt" "encrypt")
2763 (const "signencrypt" :tag "Sign and Encrypt")))) 2764 (const :tag "Sign and Encrypt" "signencrypt"))))
2764 :version "28.1") 2765 :version "28.1")
2765 2766
2766(defun message-add-openpgp-header () 2767(defun message-add-openpgp-header ()
@@ -2768,32 +2769,34 @@ will not be inserted."
2768 2769
2769Header will be constructed as specified in `message-openpgp-header'. 2770Header will be constructed as specified in `message-openpgp-header'.
2770 2771
2771Consider adding this function to `message-send-hook'." 2772Consider adding this function to `message-header-setup-hook'"
2772 ;; See https://tools.ietf.org/html/draft-josefsson-openpgp-mailnews-header 2773 ;; See https://tools.ietf.org/html/draft-josefsson-openpgp-mailnews-header
2773 (when (and message-openpgp-header 2774 (when (and message-openpgp-header
2774 (or (nth 0 message-openpgp-header) 2775 (or (nth 0 message-openpgp-header)
2775 (nth 1 message-openpgp-header) 2776 (nth 1 message-openpgp-header)
2776 (nth 2 message-openpgp-header))) 2777 (nth 2 message-openpgp-header)))
2777 (with-temp-buffer 2778 (message-add-header
2778 (insert "OpenPGP: ") 2779 (with-temp-buffer
2779 ;; add ID 2780 (insert "OpenPGP: ")
2780 (let (need-sep) 2781 ;; add ID
2781 (when (nth 0 message-openpgp-header) 2782 (let (need-sep)
2782 (insert "id=" (nth 0 message-openpgp-header)) 2783 (when (nth 0 message-openpgp-header)
2783 (setq need-sep t)) 2784 (insert "id=" (nth 0 message-openpgp-header))
2784 ;; add URL 2785 (setq need-sep t))
2785 (when (nth 1 message-openpgp-header) 2786 ;; add URL
2786 (when need-sep (insert "; ")) 2787 (when (nth 1 message-openpgp-header)
2787 (if (string-match-p ";") 2788 (when need-sep (insert "; "))
2788 (insert "url=\"" (nth 1 message-openpgp-header) "\"") 2789 (if (string-match-p ";")
2789 (insert "url=\"" (nth 1 message-openpgp-header) "\"")) 2790 (insert "url=\"" (nth 1 message-openpgp-header) "\"")
2790 (setq need-sep t)) 2791 (insert "url=\"" (nth 1 message-openpgp-header) "\""))
2791 ;; add preference 2792 (setq need-sep t))
2792 (when (nth 2 message-openpgp-header) 2793 ;; add preference
2793 (when need-sep (insert "; ")) 2794 (when (nth 2 message-openpgp-header)
2794 (insert "preference=" (nth 2 message-openpgp-header)))) 2795 (when need-sep (insert "; "))
2795 ;; insert header 2796 (insert "preference=" (nth 2 message-openpgp-header))))
2796 (message-add-header (buffer-string))))) 2797 ;; insert header
2798 (buffer-string)))
2799 (message-sort-headers)))
2797 2800
2798 2801
2799 2802
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el
index 4754f37a2da..acddb300339 100644
--- a/lisp/gnus/mml-smime.el
+++ b/lisp/gnus/mml-smime.el
@@ -329,7 +329,6 @@ Whether the passphrase is cached at all is controlled by
329 (autoload 'epg-verify-string "epg") 329 (autoload 'epg-verify-string "epg")
330 (autoload 'epg-sign-string "epg") 330 (autoload 'epg-sign-string "epg")
331 (autoload 'epg-encrypt-string "epg") 331 (autoload 'epg-encrypt-string "epg")
332 (autoload 'epg-passphrase-callback-function "epg")
333 (autoload 'epg-context-set-passphrase-callback "epg") 332 (autoload 'epg-context-set-passphrase-callback "epg")
334 (autoload 'epg-sub-key-fingerprint "epg") 333 (autoload 'epg-sub-key-fingerprint "epg")
335 (autoload 'epg-configuration "epg-config") 334 (autoload 'epg-configuration "epg-config")
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 8be1b84e52f..88864ea3579 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -242,7 +242,6 @@ Whether the passphrase is cached at all is controlled by
242(defvar epg-user-id-alist) 242(defvar epg-user-id-alist)
243 243
244(autoload 'epg-make-context "epg") 244(autoload 'epg-make-context "epg")
245(autoload 'epg-passphrase-callback-function "epg")
246(autoload 'epa-select-keys "epa") 245(autoload 'epa-select-keys "epa")
247(autoload 'epg-list-keys "epg") 246(autoload 'epg-list-keys "epg")
248(autoload 'epg-context-set-armor "epg") 247(autoload 'epg-context-set-armor "epg")
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index d1d150ad2ee..45c9bbfe905 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -712,7 +712,6 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
712(autoload 'epg-verify-string "epg") 712(autoload 'epg-verify-string "epg")
713(autoload 'epg-sign-string "epg") 713(autoload 'epg-sign-string "epg")
714(autoload 'epg-encrypt-string "epg") 714(autoload 'epg-encrypt-string "epg")
715(autoload 'epg-passphrase-callback-function "epg")
716(autoload 'epg-context-set-passphrase-callback "epg") 715(autoload 'epg-context-set-passphrase-callback "epg")
717(autoload 'epg-key-sub-key-list "epg") 716(autoload 'epg-key-sub-key-list "epg")
718(autoload 'epg-sub-key-capability "epg") 717(autoload 'epg-sub-key-capability "epg")
diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el
index d41f32801ee..5504a520783 100644
--- a/lisp/gnus/smiley.el
+++ b/lisp/gnus/smiley.el
@@ -56,14 +56,11 @@
56 56
57(defvar smiley-data-directory) 57(defvar smiley-data-directory)
58 58
59(defcustom smiley-style 59;; In batch mode, attributes can be unspecified.
60 (if (and (fboundp 'face-attribute) 60(defcustom smiley-style (if (ignore-errors
61 ;; In batch mode, attributes can be unspecified. 61 (>= (face-attribute 'default :height) 160))
62 (condition-case nil 62 'medium
63 (>= (face-attribute 'default :height) 160) 63 'low-color)
64 (error nil)))
65 'medium
66 'low-color)
67 "Smiley style." 64 "Smiley style."
68 :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14 65 :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14
69 (const :tag "medium, ~10 colors" medium) ;; 16x16 66 (const :tag "medium, ~10 colors" medium) ;; 16x16
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index afca2cd932e..49cdb4ed5e4 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -333,10 +333,8 @@ suitable file is found, return nil."
333 object (or (if (symbolp type) type) 'defun)))) 333 object (or (if (symbolp type) type) 'defun))))
334 (file-name (if (and true-name 334 (file-name (if (and true-name
335 (string-match "[.]eln\\'" true-name)) 335 (string-match "[.]eln\\'" true-name))
336 (expand-file-name (concat (file-name-base true-name) 336 (gethash (file-name-nondirectory true-name)
337 ".el") 337 comp-eln-to-el-h)
338 (concat (file-name-directory true-name)
339 ".."))
340 true-name))) 338 true-name)))
341 (cond 339 (cond
342 (autoloaded 340 (autoloaded
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 33ca40f8dec..0ffe77d2763 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -237,17 +237,11 @@ Instead, each hi-lock command will cycle through the faces in
237 "Human-readable lighters for `hi-lock-interactive-patterns'.") 237 "Human-readable lighters for `hi-lock-interactive-patterns'.")
238(put 'hi-lock-interactive-lighters 'permanent-local t) 238(put 'hi-lock-interactive-lighters 'permanent-local t)
239 239
240(define-obsolete-variable-alias 'hi-lock-face-history
241 'hi-lock-face-defaults "23.1")
242(defvar hi-lock-face-defaults 240(defvar hi-lock-face-defaults
243 '("hi-yellow" "hi-pink" "hi-green" "hi-blue" "hi-salmon" "hi-aquamarine" 241 '("hi-yellow" "hi-pink" "hi-green" "hi-blue" "hi-salmon" "hi-aquamarine"
244 "hi-black-b" "hi-blue-b" "hi-red-b" "hi-green-b" "hi-black-hb") 242 "hi-black-b" "hi-blue-b" "hi-red-b" "hi-green-b" "hi-black-hb")
245 "Default faces for hi-lock interactive functions.") 243 "Default faces for hi-lock interactive functions.")
246 244
247(define-obsolete-variable-alias 'hi-lock-regexp-history
248 'regexp-history
249 "23.1")
250
251(defvar hi-lock-file-patterns-prefix "Hi-lock" 245(defvar hi-lock-file-patterns-prefix "Hi-lock"
252 "String used to identify hi-lock patterns at the start of files.") 246 "String used to identify hi-lock patterns at the start of files.")
253 247
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 04a5ccd8d59..ae97bb008af 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -224,9 +224,6 @@ colors then use this, if you want fancier faces then set
224;; When you invoke highlight-changes-mode, should highlight-changes-visible-mode 224;; When you invoke highlight-changes-mode, should highlight-changes-visible-mode
225;; be on or off? 225;; be on or off?
226 226
227(define-obsolete-variable-alias 'highlight-changes-initial-state
228 'highlight-changes-visibility-initial-state "23.1")
229
230(defcustom highlight-changes-visibility-initial-state t 227(defcustom highlight-changes-visibility-initial-state t
231 "Controls whether changes are initially visible in Highlight Changes mode. 228 "Controls whether changes are initially visible in Highlight Changes mode.
232 229
@@ -236,13 +233,7 @@ When a buffer is in Highlight Changes mode the function
236 :type 'boolean 233 :type 'boolean
237 :group 'highlight-changes) 234 :group 'highlight-changes)
238 235
239;; highlight-changes-global-initial-state has been removed
240
241
242
243;; These are the strings displayed in the mode-line for the minor mode: 236;; These are the strings displayed in the mode-line for the minor mode:
244(define-obsolete-variable-alias 'highlight-changes-active-string
245 'highlight-changes-visible-string "23.1")
246 237
247(defcustom highlight-changes-visible-string " +Chg" 238(defcustom highlight-changes-visible-string " +Chg"
248 "The string used when in Highlight Changes mode and changes are visible. 239 "The string used when in Highlight Changes mode and changes are visible.
@@ -252,9 +243,6 @@ a string with a leading space."
252 (const :tag "None" nil)) 243 (const :tag "None" nil))
253 :group 'highlight-changes) 244 :group 'highlight-changes)
254 245
255(define-obsolete-variable-alias 'highlight-changes-passive-string
256 'highlight-changes-invisible-string "23.1")
257
258(defcustom highlight-changes-invisible-string " -Chg" 246(defcustom highlight-changes-invisible-string " -Chg"
259 "The string used when in Highlight Changes mode and changes are hidden. 247 "The string used when in Highlight Changes mode and changes are hidden.
260This should be set to nil if no indication is desired, or to 248This should be set to nil if no indication is desired, or to
@@ -957,10 +945,6 @@ changes are made, so \\[highlight-changes-next-change] and
957(define-globalized-minor-mode global-highlight-changes-mode 945(define-globalized-minor-mode global-highlight-changes-mode
958 highlight-changes-mode highlight-changes-mode-turn-on) 946 highlight-changes-mode highlight-changes-mode-turn-on)
959 947
960(define-obsolete-function-alias
961 'global-highlight-changes
962 'global-highlight-changes-mode "23.1")
963
964(defun highlight-changes-mode-turn-on () 948(defun highlight-changes-mode-turn-on ()
965 "See if Highlight Changes mode should be turned on for this buffer. 949 "See if Highlight Changes mode should be turned on for this buffer.
966This is called when `global-highlight-changes-mode' is turned on." 950This is called when `global-highlight-changes-mode' is turned on."
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index 6265537e885..4d653972c95 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -556,10 +556,7 @@ If a window system is unavailable, calls `hfy-fallback-color-values'."
556 '(1 2 3)) 556 '(1 2 3))
557 ;;(message ">> %s" color) 557 ;;(message ">> %s" color)
558 (if window-system 558 (if window-system
559 (if (fboundp 'color-values) 559 (color-values color)
560 (color-values color)
561 ;;(message "[%S]" window-system)
562 (x-color-values color))
563 ;; blarg - tty colors are no good - go fetch some X colors: 560 ;; blarg - tty colors are no good - go fetch some X colors:
564 (hfy-fallback-color-values color)))) 561 (hfy-fallback-color-values color))))
565(define-obsolete-function-alias 'hfy-colour-vals #'hfy-color-vals "27.1") 562(define-obsolete-function-alias 'hfy-colour-vals #'hfy-color-vals "27.1")
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 3747ae3d281..8a68df876c1 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -75,7 +75,11 @@ everything preceding the ~/ is discarded so the interactive
75selection process starts again from the user's $HOME.") 75selection process starts again from the user's $HOME.")
76 76
77(defcustom icomplete-show-matches-on-no-input nil 77(defcustom icomplete-show-matches-on-no-input nil
78 "When non-nil, show completions when first prompting for input." 78 "When non-nil, show completions when first prompting for input.
79This also means that if you traverse the list of completions with
80commands like `C-.' and just hit `C-j' (enter) without typing any
81characters, the match under point will be chosen instead of the
82default."
79 :type 'boolean 83 :type 'boolean
80 :version "24.4") 84 :version "24.4")
81 85
@@ -709,7 +713,10 @@ matches exist."
709 (push comp prospects) 713 (push comp prospects)
710 (setq limit t)))) 714 (setq limit t))))
711 (setq prospects (nreverse prospects)) 715 (setq prospects (nreverse prospects))
712 ;; Decorate first of the prospects. 716 ;; Return the first match if the user hits enter.
717 (when icomplete-show-matches-on-no-input
718 (setq completion-content-when-empty (car prospects)))
719 ;; Decorate first of the prospects.
713 (when prospects 720 (when prospects
714 (let ((first (copy-sequence (pop prospects)))) 721 (let ((first (copy-sequence (pop prospects))))
715 (put-text-property 0 (length first) 722 (put-text-property 0 (length first)
diff --git a/lisp/ido.el b/lisp/ido.el
index e834916a6da..c83b700e656 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1523,8 +1523,10 @@ Removes badly formatted data and ignored directories."
1523 (remove-function read-file-name-function #'ido-read-file-name) 1523 (remove-function read-file-name-function #'ido-read-file-name)
1524 (remove-function read-buffer-function #'ido-read-buffer) 1524 (remove-function read-buffer-function #'ido-read-buffer)
1525 (when ido-everywhere 1525 (when ido-everywhere
1526 (add-function :override read-file-name-function #'ido-read-file-name) 1526 (if (not ido-mode)
1527 (add-function :override read-buffer-function #'ido-read-buffer))) 1527 (ido-mode 'both)
1528 (add-function :override read-file-name-function #'ido-read-file-name)
1529 (add-function :override read-buffer-function #'ido-read-buffer))))
1528 1530
1529(defvar ido-minor-mode-map-entry nil) 1531(defvar ido-minor-mode-map-entry nil)
1530 1532
@@ -2216,7 +2218,10 @@ If cursor is not at the end of the user input, move to end of input."
2216 ((and ido-enable-virtual-buffers 2218 ((and ido-enable-virtual-buffers
2217 ido-virtual-buffers 2219 ido-virtual-buffers
2218 (setq filename (assoc buf ido-virtual-buffers))) 2220 (setq filename (assoc buf ido-virtual-buffers)))
2219 (ido-visit-buffer (find-file-noselect (cdr filename)) method t)) 2221 (if (eq method 'kill)
2222 (setq recentf-list
2223 (delete (cdr filename) recentf-list))
2224 (ido-visit-buffer (find-file-noselect (cdr filename)) method t)))
2220 2225
2221 ((and (eq ido-create-new-buffer 'prompt) 2226 ((and (eq ido-create-new-buffer 'prompt)
2222 (null require-match) 2227 (null require-match)
@@ -4073,6 +4078,7 @@ Record command in `command-history' if optional RECORD is non-nil."
4073 (setq buffer (buffer-name buffer))) 4078 (setq buffer (buffer-name buffer)))
4074 (let (win newframe) 4079 (let (win newframe)
4075 (cond 4080 (cond
4081 ;; "Killing" of virtual buffers is handled in `ido-buffer-internal'.
4076 ((eq method 'kill) 4082 ((eq method 'kill)
4077 (if record 4083 (if record
4078 (ido-record-command 'kill-buffer buffer)) 4084 (ido-record-command 'kill-buffer buffer))
diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el
index d1091e57cb5..3543be6de91 100644
--- a/lisp/image/gravatar.el
+++ b/lisp/image/gravatar.el
@@ -39,6 +39,7 @@
39 "Whether to cache retrieved gravatars." 39 "Whether to cache retrieved gravatars."
40 :type 'boolean 40 :type 'boolean
41 :group 'gravatar) 41 :group 'gravatar)
42(make-obsolete-variable 'gravatar-automatic-caching nil "28.1")
42 43
43(defcustom gravatar-cache-ttl 2592000 44(defcustom gravatar-cache-ttl 2592000
44 "Time to live in seconds for gravatar cache entries. 45 "Time to live in seconds for gravatar cache entries.
@@ -48,6 +49,7 @@ is retrieved anew. The default value is 30 days."
48 ;; Restricted :type to number of seconds. 49 ;; Restricted :type to number of seconds.
49 :version "27.1" 50 :version "27.1"
50 :group 'gravatar) 51 :group 'gravatar)
52(make-obsolete-variable 'gravatar-cache-ttl nil "28.1")
51 53
52(defcustom gravatar-rating "g" 54(defcustom gravatar-rating "g"
53 "Most explicit Gravatar rating level to allow. 55 "Most explicit Gravatar rating level to allow.
@@ -156,18 +158,58 @@ to track whether you're reading a specific mail."
156 (setq func 158 (setq func
157 (lambda (result) 159 (lambda (result)
158 (cond 160 (cond
159 (result 161 ((and
160 (funcall callback (format "%s://%s/avatar" 162 result ;there is a result
161 (cdar records) result))) 163 (let* ((data (mapcar (lambda (record)
162 ((> (length records) 1) 164 (dns-get 'data (cdr record)))
163 (pop records) 165 (dns-get 'answers result)))
166 (priorities (mapcar (lambda (r)
167 (dns-get 'priority r))
168 data))
169 (max-priority (if priorities
170 (apply #'max priorities)
171 0))
172 (sum 0) top)
173 ;; Attempt to find all records with the same maximal
174 ;; priority, and calculate the sum of their weights.
175 (dolist (ent data)
176 (when (= max-priority (dns-get 'priority ent))
177 (setq sum (+ sum (dns-get 'weight ent)))
178 (push ent top)))
179 ;; In case there is more than one maximal priority
180 ;; record, choose one at random, while taking the
181 ;; individual record weights into consideration.
182 (catch 'done
183 (dolist (ent top)
184 (when (and (or (= 0 sum)
185 (<= 0 (random sum)
186 (dns-get 'weight ent)))
187 ;; Ensure that port and domain data are
188 ;; valid. In case non of the results
189 ;; were valid, `catch' will evaluate to
190 ;; nil, and the next cond clause will be
191 ;; tested.
192 (<= 1 (dns-get 'port ent) 65535)
193 (string-match-p "\\`[-.0-9A-Za-z]+\\'"
194 (dns-get 'target ent)))
195 (funcall callback
196 (url-normalize-url
197 (format "%s://%s:%s/avatar"
198 (cdar records)
199 (dns-get 'target ent)
200 (dns-get 'port ent))))
201 (throw 'done t))
202 (setq sum (- sum (dns-get 'weight ent))))))))
203 ((setq records (cdr records))
204 ;; In case there are at least two methods.
164 (dns-query-asynchronous 205 (dns-query-asynchronous
165 (concat (caar records) "._tcp." domain) 206 (concat (caar records) "._tcp." domain)
166 func 'SRV)) 207 func 'SRV))
167 (t 208 (t ;fallback
168 (funcall callback "https://seccdn.libravatar.org/avatar"))))) 209 (funcall callback "https://seccdn.libravatar.org/avatar")))))
169 (dns-query-asynchronous 210 (dns-query-asynchronous
170 (concat (caar records) "._tcp." domain) func 'SRV))))) 211 (concat (caar records) "._tcp." domain)
212 func 'SRV t)))))
171 213
172(defun gravatar-hash (mail-address) 214(defun gravatar-hash (mail-address)
173 "Return the Gravatar hash for MAIL-ADDRESS." 215 "Return the Gravatar hash for MAIL-ADDRESS."
@@ -206,19 +248,50 @@ to track whether you're reading a specific mail."
206 (search-forward "\n\n" nil t) 248 (search-forward "\n\n" nil t)
207 (buffer-substring (point) (point-max))))) 249 (buffer-substring (point) (point-max)))))
208 250
251(defvar gravatar--cache (make-hash-table :test 'equal)
252 "Cache for gravatars.")
253
209;;;###autoload 254;;;###autoload
210(defun gravatar-retrieve (mail-address callback &optional cbargs) 255(defun gravatar-retrieve (mail-address callback &optional cbargs)
211 "Asynchronously retrieve a gravatar for MAIL-ADDRESS. 256 "Asynchronously retrieve a gravatar for MAIL-ADDRESS.
212When finished, call CALLBACK as (apply CALLBACK GRAVATAR CBARGS), 257When finished, call CALLBACK as (apply CALLBACK GRAVATAR CBARGS),
213where GRAVATAR is either an image descriptor, or the symbol 258where GRAVATAR is either an image descriptor, or the symbol
214`error' if the retrieval failed." 259`error' if the retrieval failed."
215 (gravatar-build-url 260 (let ((cached (gethash mail-address gravatar--cache)))
216 mail-address 261 (gravatar--prune-cache)
217 (lambda (url) 262 (if cached
218 (if (url-cache-expired url gravatar-cache-ttl) 263 (apply callback (cdr cached) cbargs)
219 (url-retrieve url #'gravatar-retrieved (list callback cbargs) t) 264 ;; Nothing in the cache, fetch it.
220 (with-current-buffer (url-fetch-from-cache url) 265 (gravatar-build-url
221 (gravatar-retrieved () callback cbargs)))))) 266 mail-address
267 (lambda (url)
268 (url-retrieve
269 url
270 (lambda (status)
271 (let* ((data (and (not (plist-get status :error))
272 (gravatar-get-data)))
273 (image (and data (create-image data nil t))))
274 ;; Store the image in the cache.
275 (when image
276 (setf (gethash mail-address gravatar--cache)
277 (cons (time-convert (current-time) 'integer)
278 image)))
279 (prog1
280 (apply callback (if data image 'error) cbargs)
281 (kill-buffer))))
282 nil t))))))
283
284(defun gravatar--prune-cache ()
285 (let ((expired nil)
286 (time (- (time-convert (current-time) 'integer)
287 ;; Twelve hours.
288 (* 12 60 60))))
289 (maphash (lambda (key val)
290 (when (< (car val) time)
291 (push key expired)))
292 gravatar--cache)
293 (dolist (key expired)
294 (remhash key gravatar--cache))))
222 295
223;;;###autoload 296;;;###autoload
224(defun gravatar-retrieve-synchronously (mail-address) 297(defun gravatar-retrieve-synchronously (mail-address)
@@ -229,10 +302,8 @@ retrieval failed."
229 (gravatar-build-url mail-address (lambda (u) (setq url u))) 302 (gravatar-build-url mail-address (lambda (u) (setq url u)))
230 (while (not url) 303 (while (not url)
231 (sleep-for 0.01)) 304 (sleep-for 0.01))
232 (with-current-buffer (if (url-cache-expired url gravatar-cache-ttl) 305 (with-current-buffer (url-retrieve-synchronously url t)
233 (url-retrieve-synchronously url t) 306 (gravatar-retrieved nil #'identity))))
234 (url-fetch-from-cache url))
235 (gravatar-retrieved () #'identity))))
236 307
237(defun gravatar-retrieved (status cb &optional cbargs) 308(defun gravatar-retrieved (status cb &optional cbargs)
238 "Handle Gravatar response data in current buffer. 309 "Handle Gravatar response data in current buffer.
@@ -241,10 +312,6 @@ an image descriptor, or the symbol `error' on failure.
241This function is intended as a callback for `url-retrieve'." 312This function is intended as a callback for `url-retrieve'."
242 (let ((data (unless (plist-get status :error) 313 (let ((data (unless (plist-get status :error)
243 (gravatar-get-data)))) 314 (gravatar-get-data))))
244 (and data ; Only cache on success.
245 url-current-object ; Only cache if not already cached.
246 gravatar-automatic-caching
247 (url-store-in-cache))
248 (prog1 (apply cb (if data (create-image data nil t) 'error) cbargs) 315 (prog1 (apply cb (if data (create-image data nil t) 'error) cbargs)
249 (kill-buffer)))) 316 (kill-buffer))))
250 317
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 7714a778fcb..5fe931dd9bb 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2968,11 +2968,6 @@ on encoding."
2968;; Doc said "obsolete" in 23.1, this statement only added in 24.1. 2968;; Doc said "obsolete" in 23.1, this statement only added in 24.1.
2969(make-obsolete 'unify-8859-on-decoding-mode "don't use it." "23.1") 2969(make-obsolete 'unify-8859-on-decoding-mode "don't use it." "23.1")
2970 2970
2971(defvar nonascii-insert-offset 0)
2972(make-obsolete-variable 'nonascii-insert-offset "do not use it." "23.1")
2973(defvar nonascii-translation-table nil)
2974(make-obsolete-variable 'nonascii-translation-table "do not use it." "23.1")
2975
2976(defvar ucs-names nil 2971(defvar ucs-names nil
2977 "Hash table of cached CHAR-NAME keys to CHAR-CODE values.") 2972 "Hash table of cached CHAR-NAME keys to CHAR-CODE values.")
2978 2973
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 80e78ef7877..b13bde58ca1 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -200,10 +200,6 @@ Character sets for defining other charsets, or for backward compatibility
200;;; (charset-iso-graphic-plane charset) 200;;; (charset-iso-graphic-plane charset)
201 (charset-description charset))))) 201 (charset-description charset)))))
202 202
203(defvar non-iso-charset-alist nil
204 "Obsolete.")
205(make-obsolete-variable 'non-iso-charset-alist "no longer relevant." "23.1")
206
207;; A variable to hold charset input history. 203;; A variable to hold charset input history.
208(defvar charset-history nil) 204(defvar charset-history nil)
209 205
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 5cc10b1315a..660ac58e022 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -275,15 +275,6 @@ operations such as `find-coding-systems-region'."
275(put 'with-coding-priority 'edebug-form-spec t) 275(put 'with-coding-priority 'edebug-form-spec t)
276 276
277;;;###autoload 277;;;###autoload
278(defmacro detect-coding-with-priority (from to priority-list)
279 "Detect a coding system of the text between FROM and TO with PRIORITY-LIST.
280PRIORITY-LIST is an alist of coding categories vs the corresponding
281coding systems ordered by priority."
282 (declare (obsolete with-coding-priority "23.1"))
283 `(with-coding-priority (mapcar #'cdr ,priority-list)
284 (detect-coding-region ,from ,to)))
285
286;;;###autoload
287(defun detect-coding-with-language-environment (from to lang-env) 278(defun detect-coding-with-language-environment (from to lang-env)
288 "Detect a coding system for the text between FROM and TO with LANG-ENV. 279 "Detect a coding system for the text between FROM and TO with LANG-ENV.
289The detection takes into account the coding system priorities for the 280The detection takes into account the coding system priorities for the
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 5fb04bc464f..958fc0d3101 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -409,16 +409,6 @@ PLIST (property list) may contain any type of information a user
409;; because that makes a bootstrapping problem 409;; because that makes a bootstrapping problem
410;; if you need to recompile all the Lisp files using interpreted code. 410;; if you need to recompile all the Lisp files using interpreted code.
411 411
412(defun charset-id (_charset)
413 "Always return 0. This is provided for backward compatibility."
414 (declare (obsolete nil "23.1"))
415 0)
416
417(defmacro charset-bytes (_charset)
418 "Always return 0. This is provided for backward compatibility."
419 (declare (obsolete nil "23.1"))
420 0)
421
422(defun get-charset-property (charset propname) 412(defun get-charset-property (charset propname)
423 "Return the value of CHARSET's PROPNAME property. 413 "Return the value of CHARSET's PROPNAME property.
424This is the last value stored with 414This is the last value stored with
@@ -464,19 +454,8 @@ Return -1 if charset isn't an ISO 2022 one."
464 "Return long name of CHARSET." 454 "Return long name of CHARSET."
465 (plist-get (charset-plist charset) :long-name)) 455 (plist-get (charset-plist charset) :long-name))
466 456
467(defun charset-list ()
468 "Return list of all charsets ever defined."
469 (declare (obsolete charset-list "23.1"))
470 charset-list)
471
472 457
473;;; CHARACTER 458;;; CHARACTER
474(define-obsolete-function-alias 'char-valid-p 'characterp "23.1")
475
476(defun generic-char-p (_char)
477 "Always return nil. This is provided for backward compatibility."
478 (declare (obsolete nil "23.1"))
479 nil)
480 459
481(defun make-char-internal (charset-id &optional code1 code2) 460(defun make-char-internal (charset-id &optional code1 code2)
482 (let ((charset (aref emacs-mule-charset-table charset-id))) 461 (let ((charset (aref emacs-mule-charset-table charset-id)))
@@ -1086,14 +1065,11 @@ formats (e.g. iso-latin-1-unix, koi8-r-dos)."
1086 (setq codings (cons alias codings)))))) 1065 (setq codings (cons alias codings))))))
1087 codings)) 1066 codings))
1088 1067
1089(defconst char-coding-system-table nil
1090 "It exists just for backward compatibility, and the value is always nil.")
1091(make-obsolete-variable 'char-coding-system-table nil "23.1")
1092
1093(defun transform-make-coding-system-args (name type &optional doc-string props) 1068(defun transform-make-coding-system-args (name type &optional doc-string props)
1094 "For internal use only. 1069 "For internal use only.
1095Transform XEmacs style args for `make-coding-system' to Emacs style. 1070Transform XEmacs style args for `make-coding-system' to Emacs style.
1096Value is a list of transformed arguments." 1071Value is a list of transformed arguments."
1072 (declare (obsolete nil "28.1"))
1097 (let ((mnemonic (string-to-char (or (plist-get props 'mnemonic) "?"))) 1073 (let ((mnemonic (string-to-char (or (plist-get props 'mnemonic) "?")))
1098 (eol-type (plist-get props 'eol-type)) 1074 (eol-type (plist-get props 'eol-type))
1099 properties tmp) 1075 properties tmp)
@@ -1171,106 +1147,6 @@ Value is a list of transformed arguments."
1171 (error "unsupported XEmacs style make-coding-style arguments: %S" 1147 (error "unsupported XEmacs style make-coding-style arguments: %S"
1172 `(,name ,type ,doc-string ,props)))))) 1148 `(,name ,type ,doc-string ,props))))))
1173 1149
1174(defun make-coding-system (coding-system type mnemonic doc-string
1175 &optional
1176 flags
1177 properties
1178 eol-type)
1179 "Define a new coding system CODING-SYSTEM (symbol).
1180This function is provided for backward compatibility."
1181 (declare (obsolete define-coding-system "23.1"))
1182 ;; For compatibility with XEmacs, we check the type of TYPE. If it
1183 ;; is a symbol, perhaps, this function is called with XEmacs-style
1184 ;; arguments. Here, try to transform that kind of arguments to
1185 ;; Emacs style.
1186 (if (symbolp type)
1187 (let ((args (transform-make-coding-system-args coding-system type
1188 mnemonic doc-string)))
1189 (setq coding-system (car args)
1190 type (nth 1 args)
1191 mnemonic (nth 2 args)
1192 doc-string (nth 3 args)
1193 flags (nth 4 args)
1194 properties (nth 5 args)
1195 eol-type (nth 6 args))))
1196
1197 (setq type
1198 (cond ((eq type 0) 'emacs-mule)
1199 ((eq type 1) 'shift-jis)
1200 ((eq type 2) 'iso2022)
1201 ((eq type 3) 'big5)
1202 ((eq type 4) 'ccl)
1203 ((eq type 5) 'raw-text)
1204 (t
1205 (error "Invalid coding system type: %s" type))))
1206
1207 (setq properties
1208 (let ((plist nil) key)
1209 (dolist (elt properties)
1210 (setq key (car elt))
1211 (cond ((eq key 'post-read-conversion)
1212 (setq key :post-read-conversion))
1213 ((eq key 'pre-write-conversion)
1214 (setq key :pre-write-conversion))
1215 ((eq key 'translation-table-for-decode)
1216 (setq key :decode-translation-table))
1217 ((eq key 'translation-table-for-encode)
1218 (setq key :encode-translation-table))
1219 ((eq key 'safe-charsets)
1220 (setq key :charset-list))
1221 ((eq key 'mime-charset)
1222 (setq key :mime-charset))
1223 ((eq key 'valid-codes)
1224 (setq key :valids)))
1225 (setq plist (plist-put plist key (cdr elt))))
1226 plist))
1227 (setq properties (plist-put properties :mnemonic mnemonic))
1228 (plist-put properties :coding-type type)
1229 (cond ((eq eol-type 0) (setq eol-type 'unix))
1230 ((eq eol-type 1) (setq eol-type 'dos))
1231 ((eq eol-type 2) (setq eol-type 'mac))
1232 ((vectorp eol-type) (setq eol-type nil)))
1233 (plist-put properties :eol-type eol-type)
1234
1235 (cond
1236 ((eq type 'iso2022)
1237 (plist-put properties :flags
1238 (list (and (or (consp (nth 0 flags))
1239 (consp (nth 1 flags))
1240 (consp (nth 2 flags))
1241 (consp (nth 3 flags))) 'designation)
1242 (or (nth 4 flags) 'long-form)
1243 (and (nth 5 flags) 'ascii-at-eol)
1244 (and (nth 6 flags) 'ascii-at-cntl)
1245 (and (nth 7 flags) '7-bit)
1246 (and (nth 8 flags) 'locking-shift)
1247 (and (nth 9 flags) 'single-shift)
1248 (and (nth 10 flags) 'use-roman)
1249 (and (nth 11 flags) 'use-oldjis)
1250 (or (nth 12 flags) 'direction)
1251 (and (nth 13 flags) 'init-at-bol)
1252 (and (nth 14 flags) 'designate-at-bol)
1253 (and (nth 15 flags) 'safe)
1254 (and (nth 16 flags) 'latin-extra)))
1255 (plist-put properties :designation
1256 (let ((vec (make-vector 4 nil)))
1257 (dotimes (i 4)
1258 (let ((spec (nth i flags)))
1259 (if (eq spec t)
1260 (aset vec i '(94 96))
1261 (if (consp spec)
1262 (progn
1263 (if (memq t spec)
1264 (setq spec (append (delq t spec) '(94 96))))
1265 (aset vec i spec))))))
1266 vec)))
1267
1268 ((eq type 'ccl)
1269 (plist-put properties :ccl-decoder (car flags))
1270 (plist-put properties :ccl-encoder (cdr flags))))
1271
1272 (apply 'define-coding-system coding-system doc-string properties))
1273
1274(defun merge-coding-systems (first second) 1150(defun merge-coding-systems (first second)
1275 "Fill in any unspecified aspects of coding system FIRST from SECOND. 1151 "Fill in any unspecified aspects of coding system FIRST from SECOND.
1276Return the resulting coding system." 1152Return the resulting coding system."
@@ -1617,15 +1493,6 @@ This setting is effective for the next communication only."
1617 1493
1618 (setq next-selection-coding-system coding-system)) 1494 (setq next-selection-coding-system coding-system))
1619 1495
1620(defun set-coding-priority (arg)
1621 "Set priority of coding categories according to ARG.
1622ARG is a list of coding categories ordered by priority.
1623
1624This function is provided for backward compatibility."
1625 (declare (obsolete set-coding-system-priority "23.1"))
1626 (apply 'set-coding-system-priority
1627 (mapcar #'(lambda (x) (symbol-value x)) arg)))
1628
1629;;; X selections 1496;;; X selections
1630 1497
1631(defvar ctext-non-standard-encodings-alist 1498(defvar ctext-non-standard-encodings-alist
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index ae58bfc566b..7077925602c 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -31062,7 +31062,7 @@ values), despite potential performance issues, type \\[so-long-revert].
31062 31062
31063Use \\[so-long-commentary] for more information. 31063Use \\[so-long-commentary] for more information.
31064 31064
31065Use \\[so-long-customize] to configure the behavior. 31065Use \\[so-long-customize] to configure the behaviour.
31066 31066
31067\(fn)" t nil) 31067\(fn)" t nil)
31068 31068
@@ -31099,7 +31099,7 @@ or call the function `global-so-long-mode'.")
31099(custom-autoload 'global-so-long-mode "so-long" nil) 31099(custom-autoload 'global-so-long-mode "so-long" nil)
31100 31100
31101(autoload 'global-so-long-mode "so-long" "\ 31101(autoload 'global-so-long-mode "so-long" "\
31102Toggle automated performance mitigation for files with long lines. 31102Toggle automated performance mitigations for files with long lines.
31103 31103
31104If called interactively, enable Global So-Long mode if ARG is 31104If called interactively, enable Global So-Long mode if ARG is
31105positive, and disable it if ARG is zero or negative. If called from 31105positive, and disable it if ARG is zero or negative. If called from
@@ -31118,7 +31118,7 @@ When such files are detected by `so-long-predicate', we invoke the selected
31118 31118
31119Use \\[so-long-commentary] for more information. 31119Use \\[so-long-commentary] for more information.
31120 31120
31121Use \\[so-long-customize] to configure the behavior. 31121Use \\[so-long-customize] to configure the behaviour.
31122 31122
31123\(fn &optional ARG)" t nil) 31123\(fn &optional ARG)" t nil)
31124 31124
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 31843fc24d1..aaa5888bf92 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -449,33 +449,33 @@ lost after dumping")))
449;; At this point, we're ready to resume undo recording for scratch. 449;; At this point, we're ready to resume undo recording for scratch.
450(buffer-enable-undo "*scratch*") 450(buffer-enable-undo "*scratch*")
451 451
452(when (native-comp-available-p) 452(when (boundp 'comp-ctxt)
453 ;; Fix the compilation unit filename to have it working when 453 ;; Fix the compilation unit filename to have it working when
454 ;; when installed or if the source directory got moved. This is set to be 454 ;; when installed or if the source directory got moved. This is set to be
455 ;; a pair in the form: (rel-path-from-install-bin . rel-path-from-local-bin). 455 ;; a pair in the form: (rel-path-from-install-bin . rel-path-from-local-bin).
456 (let ((h (make-hash-table :test #'eq)) 456 (let ((h (make-hash-table :test #'eq))
457 (lisp-src-dir (expand-file-name (concat default-directory "../lisp")))
458 (bin-dest-dir (cadr (member "--bin-dest" command-line-args))) 457 (bin-dest-dir (cadr (member "--bin-dest" command-line-args)))
459 (lisp-dest-dir (cadr (member "--lisp-dest" command-line-args)))) 458 (eln-dest-dir (cadr (member "--eln-dest" command-line-args))))
460 (mapatoms (lambda (s) 459 (when (and bin-dest-dir eln-dest-dir)
461 (let ((f (symbol-function s))) 460 (setq eln-dest-dir
462 (when (subr-native-elisp-p f) 461 (concat eln-dest-dir "eln-cache/" comp-native-path-postfix "/"))
463 (puthash (subr-native-comp-unit f) nil h))))) 462 (mapatoms (lambda (s)
464 (maphash (lambda (cu _) 463 (let ((f (symbol-function s)))
465 (native-comp-unit-set-file 464 (when (subr-native-elisp-p f)
466 cu 465 (puthash (subr-native-comp-unit f) nil h)))))
467 (cons 466 (maphash (lambda (cu _)
468 ;; Relative path from the installed binary. 467 (native-comp-unit-set-file
469 (file-relative-name 468 cu
470 (concat lisp-dest-dir 469 (cons
471 (replace-regexp-in-string 470 ;; Relative path from the installed binary.
472 (regexp-quote lisp-src-dir) "" 471 (file-relative-name (concat eln-dest-dir
473 (native-comp-unit-file cu))) 472 (file-name-nondirectory
474 bin-dest-dir) 473 (native-comp-unit-file cu)))
475 ;; Relative path from the built uninstalled binary. 474 bin-dest-dir)
476 (file-relative-name (native-comp-unit-file cu) 475 ;; Relative path from the built uninstalled binary.
477 invocation-directory)))) 476 (file-relative-name (native-comp-unit-file cu)
478 h))) 477 invocation-directory))))
478 h))))
479 479
480(when (hash-table-p purify-flag) 480(when (hash-table-p purify-flag)
481 (let ((strings 0) 481 (let ((strings 0)
diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el
index 896f82d7bcc..2c77f88f97b 100644
--- a/lisp/mail/binhex.el
+++ b/lisp/mail/binhex.el
@@ -83,10 +83,8 @@ input and write the converted data to its standard output."
83 "^[^:]...............................................................$") 83 "^[^:]...............................................................$")
84(defconst binhex-end-line ":$") ; unused 84(defconst binhex-end-line ":$") ; unused
85 85
86(defvar binhex-temporary-file-directory 86(make-obsolete-variable 'binhex-temporary-file-directory
87 (cond ((fboundp 'temp-directory) (temp-directory)) 87 'temporary-file-directory "28.1")
88 ((boundp 'temporary-file-directory) temporary-file-directory)
89 ("/tmp/")))
90 88
91(defun binhex-insert-char (char &optional count ignored buffer) 89(defun binhex-insert-char (char &optional count ignored buffer)
92 "Insert COUNT copies of CHARACTER into BUFFER." 90 "Insert COUNT copies of CHARACTER into BUFFER."
@@ -285,7 +283,7 @@ If HEADER-ONLY is non-nil only decode header and return filename."
285 (file-name (expand-file-name 283 (file-name (expand-file-name
286 (concat (binhex-decode-region-internal start end t) 284 (concat (binhex-decode-region-internal start end t)
287 ".data") 285 ".data")
288 binhex-temporary-file-directory))) 286 temporary-file-directory)))
289 (save-excursion 287 (save-excursion
290 (goto-char start) 288 (goto-char start)
291 (when (re-search-forward binhex-begin-line nil t) 289 (when (re-search-forward binhex-begin-line nil t)
@@ -296,7 +294,7 @@ If HEADER-ONLY is non-nil only decode header and return filename."
296 (generate-new-buffer " *binhex-work*"))) 294 (generate-new-buffer " *binhex-work*")))
297 (buffer-disable-undo work-buffer) 295 (buffer-disable-undo work-buffer)
298 (insert-buffer-substring cbuf firstline end) 296 (insert-buffer-substring cbuf firstline end)
299 (cd binhex-temporary-file-directory) 297 (cd temporary-file-directory)
300 (apply 'call-process-region 298 (apply 'call-process-region
301 (point-min) 299 (point-min)
302 (point-max) 300 (point-max)
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index efbc0668553..6b9e1db5fc6 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -324,18 +324,6 @@ usually do not have translators for other languages.\n\n")))
324 (let ((os (ignore-errors (report-emacs-bug--os-description)))) 324 (let ((os (ignore-errors (report-emacs-bug--os-description))))
325 (if (stringp os) 325 (if (stringp os)
326 (insert "System Description: " os "\n\n"))) 326 (insert "System Description: " os "\n\n")))
327 (let ((message-buf (get-buffer "*Messages*")))
328 (if message-buf
329 (let (beg-pos
330 (end-pos message-end-point))
331 (with-current-buffer message-buf
332 (goto-char end-pos)
333 (forward-line -10)
334 (setq beg-pos (point)))
335 (terpri (current-buffer) t)
336 (insert "Recent messages:\n")
337 (insert-buffer-substring message-buf beg-pos end-pos))))
338 (insert "\n")
339 (when (and system-configuration-options 327 (when (and system-configuration-options
340 (not (equal system-configuration-options ""))) 328 (not (equal system-configuration-options "")))
341 (insert "Configured using:\n 'configure " 329 (insert "Configured using:\n 'configure "
diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el
index af3b493a08a..f4b55031194 100644
--- a/lisp/mail/flow-fill.el
+++ b/lisp/mail/flow-fill.el
@@ -131,31 +131,37 @@ lines."
131 (goto-char (match-end 0)) 131 (goto-char (match-end 0))
132 (unless (looking-at " ") 132 (unless (looking-at " ")
133 (insert " ")) 133 (insert " "))
134 (end-of-line) 134 (while (and (eq (char-before (line-end-position)) ?\s)
135 (when (and (not (eobp)) 135 (not (eobp))
136 (save-excursion 136 (save-excursion
137 (forward-line 1) 137 (forward-line 1)
138 (looking-at (format "\\(%s ?\\)[^>]" prefix)))) 138 (looking-at (format "\\(%s ?\\)[^>]" prefix))))
139 ;; Delete the newline and the quote at the start of the 139 (end-of-line)
140 ;; next line. 140 (when (and (not (eobp))
141 (delete-region (point) (match-end 1)) 141 (save-excursion
142 (ignore-errors 142 (forward-line 1)
143 (looking-at (format "\\(%s ?\\)[^>]" prefix))))
144 ;; Delete the newline and the quote at the start of the
145 ;; next line.
146 (delete-region (point) (match-end 1))))
147 (ignore-errors
143 (let ((fill-prefix (concat prefix " ")) 148 (let ((fill-prefix (concat prefix " "))
144 adaptive-fill-mode) 149 adaptive-fill-mode)
145 (fill-region (line-beginning-position) 150 (fill-region (line-beginning-position)
146 (line-end-position) 151 (line-end-position)
147 'left 'nosqueeze)))))) 152 'left 'nosqueeze)))))
148 (t 153 (t
149 ;; Delete the newline. 154 ;; Delete the newline.
150 (when (eq (following-char) ?\s) 155 (when (eq (following-char) ?\s)
151 (delete-char 1)) 156 (delete-char 1))
152 ;; Hack: Don't do the flowing on the signature line. 157 ;; Hack: Don't do the flowing on the signature line.
153 (when (and (not (looking-at "-- $")) 158 (when (and (not (looking-at "-- $"))
154 (eq (char-before (line-end-position)) ?\s)) 159 (eq (char-before (line-end-position)) ?\s))
155 (end-of-line) 160 (while (eq (char-before (line-end-position)) ?\s)
156 (when delete-space 161 (end-of-line)
157 (delete-char -1)) 162 (when delete-space
158 (delete-char 1) 163 (delete-char -1))
164 (delete-char 1))
159 (ignore-errors 165 (ignore-errors
160 (let ((fill-prefix "")) 166 (let ((fill-prefix ""))
161 (fill-region (line-beginning-position) 167 (fill-region (line-beginning-position)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 44cde7cb5a9..312baffb901 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -521,25 +521,6 @@ still the current message in the Rmail buffer.")
521(defvar rmail-mmdf-delim2 "^\001\001\001\001\n" 521(defvar rmail-mmdf-delim2 "^\001\001\001\001\n"
522 "Regexp marking the end of an mmdf message.") 522 "Regexp marking the end of an mmdf message.")
523 523
524;; FIXME Post-mbox, this is now unused.
525;; In Emacs-22, this was called:
526;; i) the very first time a message was shown.
527;; ii) when toggling the headers to the normal state, every time.
528;; It's not clear what it should do now, since there is nothing that
529;; records when a message is shown for the first time (unseen is not
530;; necessarily the same thing).
531;; See https://lists.gnu.org/r/emacs-devel/2009-03/msg00013.html
532(defcustom rmail-message-filter nil
533 "If non-nil, a filter function for new messages in RMAIL.
534Called with region narrowed to the message, including headers,
535before obeying `rmail-ignored-headers'."
536 :group 'rmail-headers
537 :type '(choice (const nil) function))
538
539(make-obsolete-variable 'rmail-message-filter
540 "it is not used (try `rmail-show-message-hook')."
541 "23.1")
542
543(defcustom rmail-automatic-folder-directives nil 524(defcustom rmail-automatic-folder-directives nil
544 "List of directives specifying how to automatically file messages. 525 "List of directives specifying how to automatically file messages.
545Whenever Rmail shows a message in the folder that `rmail-file-name' 526Whenever Rmail shows a message in the folder that `rmail-file-name'
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index ba6ebad082c..3026283a082 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -63,9 +63,7 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'.
63 (use-local-map rmail-edit-map) 63 (use-local-map rmail-edit-map)
64 (setq major-mode 'rmail-edit-mode) 64 (setq major-mode 'rmail-edit-mode)
65 (setq mode-name "RMAIL Edit") 65 (setq mode-name "RMAIL Edit")
66 (if (boundp 'mode-line-modified) 66 (setq mode-line-modified (default-value 'mode-line-modified))
67 (setq mode-line-modified (default-value 'mode-line-modified))
68 (setq mode-line-format (default-value 'mode-line-format)))
69 ;; Don't turn off auto-saving based on the size of the buffer 67 ;; Don't turn off auto-saving based on the size of the buffer
70 ;; because that code does not understand buffer-swapping. 68 ;; because that code does not understand buffer-swapping.
71 (make-local-variable 'auto-save-include-big-deletions) 69 (make-local-variable 'auto-save-include-big-deletions)
diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el
index 9423275b2e5..945bff35f79 100644
--- a/lisp/mail/uudecode.el
+++ b/lisp/mail/uudecode.el
@@ -61,10 +61,8 @@ input and write the converted data to its standard output."
61 (setq str (concat str "[^a-z]"))) 61 (setq str (concat str "[^a-z]")))
62 (concat str ".?$"))) 62 (concat str ".?$")))
63 63
64(defvar uudecode-temporary-file-directory 64(make-obsolete-variable 'uudecode-temporary-file-directory
65 (cond ((fboundp 'temp-directory) (temp-directory)) 65 'temporary-file-directory "28.1")
66 ((boundp 'temporary-file-directory) temporary-file-directory)
67 ("/tmp")))
68 66
69;;;###autoload 67;;;###autoload
70(defun uudecode-decode-region-external (start end &optional file-name) 68(defun uudecode-decode-region-external (start end &optional file-name)
@@ -86,13 +84,7 @@ used is specified by `uudecode-decoder-program'."
86 (match-string 1))))) 84 (match-string 1)))))
87 (setq tempfile (if file-name 85 (setq tempfile (if file-name
88 (expand-file-name file-name) 86 (expand-file-name file-name)
89 (if (fboundp 'make-temp-file) 87 (make-temp-file "uu")))
90 (let ((temporary-file-directory
91 uudecode-temporary-file-directory))
92 (make-temp-file "uu"))
93 (expand-file-name
94 (make-temp-name "uu")
95 uudecode-temporary-file-directory))))
96 (let ((cdir default-directory) 88 (let ((cdir default-directory)
97 (default-process-coding-system nil)) 89 (default-process-coding-system nil))
98 (unwind-protect 90 (unwind-protect
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index d2c3f9045e5..641a2e53152 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -685,13 +685,6 @@ for use at QPOS."
685 completions) 685 completions)
686 qboundary)))) 686 qboundary))))
687 687
688;; (defmacro complete-in-turn (a b) `(completion-table-in-turn ,a ,b))
689;; (defmacro dynamic-completion-table (fun) `(completion-table-dynamic ,fun))
690(define-obsolete-function-alias
691 'complete-in-turn #'completion-table-in-turn "23.1")
692(define-obsolete-function-alias
693 'dynamic-completion-table #'completion-table-dynamic "23.1")
694
695;;; Minibuffer completion 688;;; Minibuffer completion
696 689
697(defgroup minibuffer nil 690(defgroup minibuffer nil
@@ -1126,6 +1119,7 @@ completion candidates than this number."
1126(defvar-local completion-all-sorted-completions nil) 1119(defvar-local completion-all-sorted-completions nil)
1127(defvar-local completion--all-sorted-completions-location nil) 1120(defvar-local completion--all-sorted-completions-location nil)
1128(defvar completion-cycling nil) ;Function that takes down the cycling map. 1121(defvar completion-cycling nil) ;Function that takes down the cycling map.
1122(defvar completion-content-when-empty nil)
1129 1123
1130(defvar completion-fail-discreetly nil 1124(defvar completion-fail-discreetly nil
1131 "If non-nil, stay quiet when there is no match.") 1125 "If non-nil, stay quiet when there is no match.")
@@ -1510,8 +1504,13 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
1510COMPLETION-FUNCTION is called if the current buffer's content does not 1504COMPLETION-FUNCTION is called if the current buffer's content does not
1511appear to be a match." 1505appear to be a match."
1512 (cond 1506 (cond
1513 ;; Allow user to specify null string 1507 ;; Allow user to specify null string. In the case that
1514 ((= beg end) (funcall exit-function)) 1508 ;; `completion-content-when-empty' is set, use that instead.
1509 ((= beg end)
1510 (when completion-content-when-empty
1511 (completion--replace beg end completion-content-when-empty))
1512 (funcall exit-function))
1513
1515 ((test-completion (buffer-substring beg end) 1514 ((test-completion (buffer-substring beg end)
1516 minibuffer-completion-table 1515 minibuffer-completion-table
1517 minibuffer-completion-predicate) 1516 minibuffer-completion-predicate)
@@ -1770,9 +1769,6 @@ It also eliminates runs of equal strings."
1770 ;; Round up to a whole number of columns. 1769 ;; Round up to a whole number of columns.
1771 (* colwidth (ceiling length colwidth)))))))))))) 1770 (* colwidth (ceiling length colwidth))))))))))))
1772 1771
1773(defvar completion-common-substring nil)
1774(make-obsolete-variable 'completion-common-substring nil "23.1")
1775
1776(defvar completion-setup-hook nil 1772(defvar completion-setup-hook nil
1777 "Normal hook run at the end of setting up a completion list buffer. 1773 "Normal hook run at the end of setting up a completion list buffer.
1778When this hook is run, the current buffer is the one in which the 1774When this hook is run, the current buffer is the one in which the
@@ -1864,11 +1860,7 @@ It can find the completion buffer in `standard-output'."
1864 (insert "Possible completions are:\n") 1860 (insert "Possible completions are:\n")
1865 (completion--insert-strings completions)))) 1861 (completion--insert-strings completions))))
1866 1862
1867 ;; The hilit used to be applied via completion-setup-hook, so there 1863 (run-hooks 'completion-setup-hook)
1868 ;; may still be some code that uses completion-common-substring.
1869 (with-no-warnings
1870 (let ((completion-common-substring common-substring))
1871 (run-hooks 'completion-setup-hook)))
1872 nil) 1864 nil)
1873 1865
1874(defvar completion-extra-properties nil 1866(defvar completion-extra-properties nil
@@ -2374,8 +2366,6 @@ The completion method is determined by `completion-at-point-functions'."
2374Gets combined either with `minibuffer-local-completion-map' or 2366Gets combined either with `minibuffer-local-completion-map' or
2375with `minibuffer-local-must-match-map'.") 2367with `minibuffer-local-must-match-map'.")
2376 2368
2377(define-obsolete-variable-alias 'minibuffer-local-must-match-filename-map
2378 'minibuffer-local-filename-must-match-map "23.1")
2379(defvar minibuffer-local-filename-must-match-map (make-sparse-keymap)) 2369(defvar minibuffer-local-filename-must-match-map (make-sparse-keymap))
2380(make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1") 2370(make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1")
2381 2371
diff --git a/lisp/mouse.el b/lisp/mouse.el
index d369545f18e..a06ca2a56ca 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -274,34 +274,6 @@ not it is actually displayed."
274 local-menu 274 local-menu
275 minor-mode-menus))) 275 minor-mode-menus)))
276 276
277(defun mouse-major-mode-menu (event &optional prefix)
278 "Pop up a mode-specific menu of mouse commands.
279Default to the Edit menu if the major mode doesn't define a menu."
280 (declare (obsolete mouse-menu-major-mode-map "23.1"))
281 (interactive "@e\nP")
282 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
283 (popup-menu (mouse-menu-major-mode-map) event prefix))
284
285(defun mouse-popup-menubar (event prefix)
286 "Pop up a menu equivalent to the menu bar for keyboard EVENT with PREFIX.
287The contents are the items that would be in the menu bar whether or
288not it is actually displayed."
289 (declare (obsolete mouse-menu-bar-map "23.1"))
290 (interactive "@e \nP")
291 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
292 (popup-menu (mouse-menu-bar-map) (unless (integerp event) event) prefix))
293
294(defun mouse-popup-menubar-stuff (event prefix)
295 "Popup a menu like either `mouse-major-mode-menu' or `mouse-popup-menubar'.
296Use the former if the menu bar is showing, otherwise the latter."
297 (declare (obsolete nil "23.1"))
298 (interactive "@e\nP")
299 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
300 (popup-menu
301 (if (zerop (or (frame-parameter nil 'menu-bar-lines) 0))
302 (mouse-menu-bar-map)
303 (mouse-menu-major-mode-map))
304 event prefix))
305 277
306;; Commands that operate on windows. 278;; Commands that operate on windows.
307 279
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 317f2cd8edd..8e2039ba9d8 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -162,23 +162,18 @@ Also see `mouse-wheel-tilt-scroll'."
162 :type 'boolean 162 :type 'boolean
163 :version "26.1") 163 :version "26.1")
164 164
165(eval-and-compile 165(defun mwheel-event-button (event)
166 (if (fboundp 'event-button) 166 (let ((x (event-basic-type event)))
167 (fset 'mwheel-event-button 'event-button) 167 ;; Map mouse-wheel events to appropriate buttons
168 (defun mwheel-event-button (event) 168 (if (eq 'mouse-wheel x)
169 (let ((x (event-basic-type event))) 169 (let ((amount (car (cdr (cdr (cdr event))))))
170 ;; Map mouse-wheel events to appropriate buttons 170 (if (< amount 0)
171 (if (eq 'mouse-wheel x) 171 mouse-wheel-up-event
172 (let ((amount (car (cdr (cdr (cdr event)))))) 172 mouse-wheel-down-event))
173 (if (< amount 0) 173 x)))
174 mouse-wheel-up-event 174
175 mouse-wheel-down-event)) 175(defun mwheel-event-window (event)
176 x)))) 176 (posn-window (event-start event)))
177
178 (if (fboundp 'event-window)
179 (fset 'mwheel-event-window 'event-window)
180 (defun mwheel-event-window (event)
181 (posn-window (event-start event)))))
182 177
183(defvar mwheel-inhibit-click-event-timer nil 178(defvar mwheel-inhibit-click-event-timer nil
184 "Timer running while mouse wheel click event is inhibited.") 179 "Timer running while mouse wheel click event is inhibited.")
diff --git a/lisp/net/eudc-bob.el b/lisp/net/eudc-bob.el
index 56ea033a963..bb6682520ae 100644
--- a/lisp/net/eudc-bob.el
+++ b/lisp/net/eudc-bob.el
@@ -1,4 +1,4 @@
1;;; eudc-bob.el --- Binary Objects Support for EUDC 1;;; eudc-bob.el --- Binary Objects Support for EUDC -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 1999-2020 Free Software Foundation, Inc. 3;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
4 4
@@ -39,19 +39,41 @@
39 39
40(require 'eudc) 40(require 'eudc)
41 41
42(defvar eudc-bob-generic-keymap nil 42(defvar eudc-bob-generic-keymap
43 (let ((map (make-sparse-keymap)))
44 (define-key map "s" 'eudc-bob-save-object)
45 (define-key map "!" 'eudc-bob-pipe-object-to-external-program)
46 (define-key map [down-mouse-3] 'eudc-bob-popup-menu)
47 map)
43 "Keymap for multimedia objects.") 48 "Keymap for multimedia objects.")
44 49
45(defvar eudc-bob-image-keymap nil 50(defvar eudc-bob-image-keymap
51 (let ((map (make-sparse-keymap)))
52 (set-keymap-parent map eudc-bob-generic-keymap)
53 (define-key map "t" 'eudc-bob-toggle-inline-display)
54 map)
46 "Keymap for inline images.") 55 "Keymap for inline images.")
47 56
48(defvar eudc-bob-sound-keymap nil 57(defvar eudc-bob-sound-keymap
58 (let ((map (make-sparse-keymap)))
59 (set-keymap-parent map eudc-bob-generic-keymap)
60 (define-key map (kbd "RET") 'eudc-bob-play-sound-at-point)
61 (define-key map [down-mouse-2] 'eudc-bob-play-sound-at-mouse)
62 map)
49 "Keymap for inline sounds.") 63 "Keymap for inline sounds.")
50 64
51(defvar eudc-bob-url-keymap nil 65(defvar eudc-bob-url-keymap
66 (let ((map (make-sparse-keymap)))
67 (define-key map (kbd "RET") 'browse-url-at-point)
68 (define-key map [down-mouse-2] 'browse-url-at-mouse)
69 map)
52 "Keymap for inline urls.") 70 "Keymap for inline urls.")
53 71
54(defvar eudc-bob-mail-keymap nil 72(defvar eudc-bob-mail-keymap
73 (let ((map (make-sparse-keymap)))
74 (define-key map (kbd "RET") 'goto-address-at-point)
75 (define-key map [down-mouse-2] 'goto-address-at-point)
76 map)
55 "Keymap for inline e-mail addresses.") 77 "Keymap for inline e-mail addresses.")
56 78
57(defvar eudc-bob-generic-menu 79(defvar eudc-bob-generic-menu
@@ -74,13 +96,6 @@
74 (fboundp 'play-sound-internal)] 96 (fboundp 'play-sound-internal)]
75 ,@(cdr (cdr eudc-bob-generic-menu)))) 97 ,@(cdr (cdr eudc-bob-generic-menu))))
76 98
77(defun eudc-jump-to-event (event)
78 "Jump to the window and point where EVENT occurred."
79 (if (fboundp 'event-closest-point)
80 (goto-char (event-closest-point event))
81 (set-buffer (window-buffer (posn-window (event-start event))))
82 (goto-char (posn-point (event-start event)))))
83
84(defun eudc-bob-get-overlay-prop (prop) 99(defun eudc-bob-get-overlay-prop (prop)
85 "Get property PROP from one of the overlays around." 100 "Get property PROP from one of the overlays around."
86 (let ((overlays (append (overlays-at (1- (point))) 101 (let ((overlays (append (overlays-at (1- (point)))
@@ -205,42 +220,30 @@ display a button."
205 "Play the sound data contained in the button where EVENT occurred." 220 "Play the sound data contained in the button where EVENT occurred."
206 (interactive "e") 221 (interactive "e")
207 (save-excursion 222 (save-excursion
208 (eudc-jump-to-event event) 223 (mouse-set-point event)
209 (eudc-bob-play-sound-at-point))) 224 (eudc-bob-play-sound-at-point)))
210 225
211(defun eudc-bob-save-object () 226(defun eudc-bob-save-object (filename)
212 "Save the object data of the button at point." 227 "Save the object data of the button at point."
213 (interactive) 228 (interactive "fWrite file: ")
214 (let ((data (eudc-bob-get-overlay-prop 'object-data)) 229 (let ((data (eudc-bob-get-overlay-prop 'object-data))
215 (buffer (generate-new-buffer "*eudc-tmp*"))) 230 (coding-system-for-write 'binary)) ;Inhibit EOL conversion.
216 (save-excursion 231 (write-region data nil filename)))
217 (set-buffer-file-coding-system 'binary)
218 (set-buffer buffer)
219 (set-buffer-multibyte nil)
220 (insert data)
221 (save-buffer))
222 (kill-buffer buffer)))
223 232
224(defun eudc-bob-pipe-object-to-external-program () 233(defun eudc-bob-pipe-object-to-external-program (program)
225 "Pipe the object data of the button at point to an external program." 234 "Pipe the object data of the button at point to an external program."
226 (interactive) 235 (interactive (list (completing-read "Viewer: " eudc-external-viewers)))
227 (let ((data (eudc-bob-get-overlay-prop 'object-data)) 236 (let ((data (eudc-bob-get-overlay-prop 'object-data))
228 (buffer (generate-new-buffer "*eudc-tmp*")) 237 (viewer (assoc program eudc-external-viewers)))
229 program 238 (with-temp-buffer
230 viewer) 239 (set-buffer-multibyte nil)
231 (condition-case nil 240 (insert data)
232 (save-excursion 241 (let ((coding-system-for-write 'binary)) ;Inhibit EOL conversion
233 (set-buffer-file-coding-system 'binary) 242 (if viewer
234 (set-buffer buffer) 243 (call-process-region (point-min) (point-max)
235 (insert data) 244 (car (cdr viewer))
236 (setq program (completing-read "Viewer: " eudc-external-viewers)) 245 (cdr (cdr viewer)))
237 (if (setq viewer (assoc program eudc-external-viewers)) 246 (call-process-region (point-min) (point-max) program))))))
238 (call-process-region (point-min) (point-max)
239 (car (cdr viewer))
240 (cdr (cdr viewer)))
241 (call-process-region (point-min) (point-max) program)))
242 (error
243 (kill-buffer buffer)))))
244 247
245(defun eudc-bob-menu () 248(defun eudc-bob-menu ()
246 "Retrieve the menu attached to a binary object." 249 "Retrieve the menu attached to a binary object."
@@ -250,47 +253,8 @@ display a button."
250 "Pop-up a menu of EUDC multimedia commands." 253 "Pop-up a menu of EUDC multimedia commands."
251 (interactive "@e") 254 (interactive "@e")
252 (run-hooks 'activate-menubar-hook) 255 (run-hooks 'activate-menubar-hook)
253 (eudc-jump-to-event event) 256 (mouse-set-point event)
254 (let ((result (x-popup-menu t (eudc-bob-menu))) 257 (popup-menu (eudc-bob-menu) event))
255 command)
256 (if result
257 (progn
258 (setq command (lookup-key (eudc-bob-menu)
259 (apply 'vector result)))
260 (command-execute command)))))
261
262(setq eudc-bob-generic-keymap
263 (let ((map (make-sparse-keymap)))
264 (define-key map "s" 'eudc-bob-save-object)
265 (define-key map "!" 'eudc-bob-pipe-object-to-external-program)
266 (define-key map [down-mouse-3] 'eudc-bob-popup-menu)
267 map))
268
269(setq eudc-bob-image-keymap
270 (let ((map (make-sparse-keymap)))
271 (define-key map "t" 'eudc-bob-toggle-inline-display)
272 map))
273
274(setq eudc-bob-sound-keymap
275 (let ((map (make-sparse-keymap)))
276 (define-key map [return] 'eudc-bob-play-sound-at-point)
277 (define-key map [down-mouse-2] 'eudc-bob-play-sound-at-mouse)
278 map))
279
280(setq eudc-bob-url-keymap
281 (let ((map (make-sparse-keymap)))
282 (define-key map [return] 'browse-url-at-point)
283 (define-key map [down-mouse-2] 'browse-url-at-mouse)
284 map))
285
286(setq eudc-bob-mail-keymap
287 (let ((map (make-sparse-keymap)))
288 (define-key map [return] 'goto-address-at-point)
289 (define-key map [down-mouse-2] 'goto-address-at-point)
290 map))
291
292(set-keymap-parent eudc-bob-image-keymap eudc-bob-generic-keymap)
293(set-keymap-parent eudc-bob-sound-keymap eudc-bob-generic-keymap)
294 258
295;; If the first arguments can be nil here, then these 3 can be 259;; If the first arguments can be nil here, then these 3 can be
296;; defconsts once more. 260;; defconsts once more.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index e7170b3e6d1..04deb5bee05 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -672,9 +672,30 @@ Currently this means either text/html or application/xhtml+xml."
672 (setq header-line-format 672 (setq header-line-format
673 (and eww-header-line-format 673 (and eww-header-line-format
674 (let ((title (plist-get eww-data :title)) 674 (let ((title (plist-get eww-data :title))
675 (peer (plist-get eww-data :peer))) 675 (peer (plist-get eww-data :peer))
676 (url (plist-get eww-data :url)))
676 (when (zerop (length title)) 677 (when (zerop (length title))
677 (setq title "[untitled]")) 678 (setq title "[untitled]"))
679 ;; Limit the length of the title so that the host name
680 ;; of the URL is always visible.
681 (when url
682 (let* ((parsed (url-generic-parse-url url))
683 (host-length (length (format "%s://%s"
684 (url-type parsed)
685 (url-host parsed))))
686 (width (window-width)))
687 (cond
688 ;; The host bit is wider than the window, so nix
689 ;; the title.
690 ((> (+ host-length 5) width)
691 (setq title ""))
692 ;; Trim the title.
693 ((> (+ (length title) host-length 2) width)
694 (setq title (concat
695 (substring title 0 (- width
696 host-length
697 5))
698 "..."))))))
678 ;; This connection has is https. 699 ;; This connection has is https.
679 (when peer 700 (when peer
680 (setq title 701 (setq title
@@ -686,7 +707,7 @@ Currently this means either text/html or application/xhtml+xml."
686 "%" "%%" 707 "%" "%%"
687 (format-spec 708 (format-spec
688 eww-header-line-format 709 eww-header-line-format
689 `((?u . ,(or (plist-get eww-data :url) "")) 710 `((?u . ,(or url ""))
690 (?t . ,title)))))))) 711 (?t . ,title))))))))
691 712
692(defun eww-tag-title (dom) 713(defun eww-tag-title (dom)
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index 1bed61f3e7d..ff8a447c7c1 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -131,14 +131,6 @@ groupcontent := feedname | groupdefinition)
131Example: (\"Topmost group\" \"feed1\" (\"subgroup1\" \"feed 2\") 131Example: (\"Topmost group\" \"feed1\" (\"subgroup1\" \"feed 2\")
132\"feed3\")") 132\"feed3\")")
133 133
134(defcustom newsticker-groups-filename
135 nil
136 "Name of the newsticker groups settings file."
137 :version "25.1" ; changed default value to nil
138 :type '(choice (const nil) string)
139 :group 'newsticker-treeview)
140(make-obsolete-variable 'newsticker-groups-filename 'newsticker-dir "23.1")
141
142;; ====================================================================== 134;; ======================================================================
143;;; internal variables 135;;; internal variables
144;; ====================================================================== 136;; ======================================================================
@@ -1265,29 +1257,9 @@ Note: does not update the layout."
1265(defun newsticker--treeview-load () 1257(defun newsticker--treeview-load ()
1266 "Load treeview settings." 1258 "Load treeview settings."
1267 (let* ((coding-system-for-read 'utf-8) 1259 (let* ((coding-system-for-read 'utf-8)
1268 (filename 1260 (filename (concat newsticker-dir "/groups"))
1269 (or (and newsticker-groups-filename
1270 (not (string=
1271 (expand-file-name newsticker-groups-filename)
1272 (expand-file-name (concat newsticker-dir "/groups"))))
1273 (file-exists-p newsticker-groups-filename)
1274 (y-or-n-p
1275 (format-message
1276 (concat "Obsolete variable `newsticker-groups-filename' "
1277 "points to existing file \"%s\".\n"
1278 "Read it? ")
1279 newsticker-groups-filename))
1280 newsticker-groups-filename)
1281 (concat newsticker-dir "/groups")))
1282 (buf (and (file-exists-p filename) 1261 (buf (and (file-exists-p filename)
1283 (find-file-noselect filename)))) 1262 (find-file-noselect filename))))
1284 (and newsticker-groups-filename
1285 (file-exists-p newsticker-groups-filename)
1286 (y-or-n-p (format-message
1287 (concat "Delete the file \"%s\",\nto which the obsolete "
1288 "variable `newsticker-groups-filename' points ? ")
1289 newsticker-groups-filename))
1290 (delete-file newsticker-groups-filename))
1291 (when buf 1263 (when buf
1292 (set-buffer buf) 1264 (set-buffer buf)
1293 (goto-char (point-min)) 1265 (goto-char (point-min))
diff --git a/lisp/net/ntlm.el b/lisp/net/ntlm.el
index ebcd21948bf..9401430799c 100644
--- a/lisp/net/ntlm.el
+++ b/lisp/net/ntlm.el
@@ -69,7 +69,6 @@
69 69
70(require 'md4) 70(require 'md4)
71(require 'hmac-md5) 71(require 'hmac-md5)
72(require 'calc)
73 72
74(defgroup ntlm nil 73(defgroup ntlm nil
75 "NTLM (NT LanManager) authentication." 74 "NTLM (NT LanManager) authentication."
@@ -133,32 +132,27 @@ is not given."
133 domain ;buffer field 132 domain ;buffer field
134 )))) 133 ))))
135 134
136(defun ntlm-compute-timestamp () 135(defun ntlm--time-to-timestamp (time)
137 "Compute an NTLMv2 timestamp. 136 "Convert TIME to an NTLMv2 timestamp.
138Return a unibyte string representing the number of tenths of a 137Return a unibyte string representing the number of tenths of a
139microsecond since January 1, 1601 as a 64-bit little-endian 138microsecond since January 1, 1601 as a 64-bit little-endian
140signed integer." 139signed integer. TIME must be on the form (HIGH LOW USEC PSEC)."
141 ;; FIXME: This can likely be significantly simplified using the new 140 (let* ((s (+ (ash (nth 0 time) 16) (nth 1 time)))
142 ;; bignums support! 141 (us (nth 2 time))
143 (let* ((s-to-tenths-of-us "mul(add(lsh($1,16),$2),10000000)") 142 (ps (nth 3 time))
144 (us-to-tenths-of-us "mul($3,10)") 143 (tenths-of-us-since-jan-1-1601
145 (ps-to-tenths-of-us "idiv($4,100000)") 144 (+ (* s 10000000) (* us 10) (/ ps 100000)
146 (tenths-of-us-since-jan-1-1601 145 ;; tenths of microseconds between 1601-01-01 and 1970-01-01
147 (apply #'calc-eval (concat "add(add(add(" 146 116444736000000000)))
148 s-to-tenths-of-us "," 147 (apply #'unibyte-string
149 us-to-tenths-of-us ")," 148 (mapcar (lambda (i)
150 ps-to-tenths-of-us ")," 149 (logand (ash tenths-of-us-since-jan-1-1601 (* i -8))
151 ;; tenths of microseconds between 150 #xff))
152 ;; 1601-01-01 and 1970-01-01 151 (number-sequence 0 7)))))
153 "116444736000000000)") 152
154 'rawnum (time-convert nil 'list))) 153(defun ntlm-compute-timestamp ()
155 result-bytes) 154 "Current time as an NTLMv2 timestamp, as a unibyte string."
156 (dotimes (_byte 8) 155 (ntlm--time-to-timestamp (time-convert nil 'list)))
157 (push (calc-eval "and($1,16#FF)" 'rawnum tenths-of-us-since-jan-1-1601)
158 result-bytes)
159 (setq tenths-of-us-since-jan-1-1601
160 (calc-eval "rsh($1,8,64)" 'rawnum tenths-of-us-since-jan-1-1601)))
161 (apply #'unibyte-string (nreverse result-bytes))))
162 156
163(defun ntlm-generate-nonce () 157(defun ntlm-generate-nonce ()
164 "Generate a random nonce, not to be used more than once. 158 "Generate a random nonce, not to be used more than once.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index ca43475f453..fae15fe6a8e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4781,104 +4781,6 @@ Goes through the list `tramp-inline-compress-commands'."
4781 (tramp-message 4781 (tramp-message
4782 vec 2 "Couldn't find an inline transfer compress command"))))) 4782 vec 2 "Couldn't find an inline transfer compress command")))))
4783 4783
4784;;;###tramp-autoload
4785(defun tramp-multi-hop-p (vec)
4786 "Whether the method of VEC is capable of multi-hops."
4787 (and (tramp-sh-file-name-handler-p vec)
4788 (not (tramp-get-method-parameter vec 'tramp-copy-program))))
4789
4790(defun tramp-compute-multi-hops (vec)
4791 "Expands VEC according to `tramp-default-proxies-alist'."
4792 (let ((saved-tdpa tramp-default-proxies-alist)
4793 (target-alist `(,vec))
4794 (hops (or (tramp-file-name-hop vec) ""))
4795 (item vec)
4796 choices proxy)
4797
4798 ;; Ad-hoc proxy definitions.
4799 (dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit)))
4800 (let* ((host-port (tramp-file-name-host-port item))
4801 (user-domain (tramp-file-name-user-domain item))
4802 (proxy (concat
4803 tramp-prefix-format proxy tramp-postfix-host-format))
4804 (entry
4805 (list (and (stringp host-port)
4806 (concat "^" (regexp-quote host-port) "$"))
4807 (and (stringp user-domain)
4808 (concat "^" (regexp-quote user-domain) "$"))
4809 (propertize proxy 'tramp-ad-hoc t))))
4810 (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry)
4811 ;; Add the hop.
4812 (add-to-list 'tramp-default-proxies-alist entry)
4813 (setq item (tramp-dissect-file-name proxy))))
4814 ;; Save the new value.
4815 (when (and hops tramp-save-ad-hoc-proxies)
4816 (customize-save-variable
4817 'tramp-default-proxies-alist tramp-default-proxies-alist))
4818
4819 ;; Look for proxy hosts to be passed.
4820 (setq choices tramp-default-proxies-alist)
4821 (while choices
4822 (setq item (pop choices)
4823 proxy (eval (nth 2 item)))
4824 (when (and
4825 ;; Host.
4826 (string-match-p
4827 (or (eval (nth 0 item)) "")
4828 (or (tramp-file-name-host-port (car target-alist)) ""))
4829 ;; User.
4830 (string-match-p
4831 (or (eval (nth 1 item)) "")
4832 (or (tramp-file-name-user-domain (car target-alist)) "")))
4833 (if (null proxy)
4834 ;; No more hops needed.
4835 (setq choices nil)
4836 ;; Replace placeholders.
4837 (setq proxy
4838 (format-spec
4839 proxy
4840 (format-spec-make
4841 ?u (or (tramp-file-name-user (car target-alist)) "")
4842 ?h (or (tramp-file-name-host (car target-alist)) ""))))
4843 (with-parsed-tramp-file-name proxy l
4844 ;; Add the hop.
4845 (push l target-alist)
4846 ;; Start next search.
4847 (setq choices tramp-default-proxies-alist)))))
4848
4849 ;; Foreign and out-of-band methods are not supported for multi-hops.
4850 (when (cdr target-alist)
4851 (setq choices target-alist)
4852 (while (setq item (pop choices))
4853 (unless (tramp-multi-hop-p item)
4854 (setq tramp-default-proxies-alist saved-tdpa)
4855 (tramp-user-error
4856 vec "Method `%s' is not supported for multi-hops."
4857 (tramp-file-name-method item)))))
4858
4859 ;; Some methods ("su", "sg", "sudo", "doas", "ksu") do not use the
4860 ;; host name in their command template. In this case, the remote
4861 ;; file name must use either a local host name (first hop), or a
4862 ;; host name matching the previous hop.
4863 (let ((previous-host (or tramp-local-host-regexp "")))
4864 (setq choices target-alist)
4865 (while (setq item (pop choices))
4866 (let ((host (tramp-file-name-host item)))
4867 (unless
4868 (or
4869 ;; The host name is used for the remote shell command.
4870 (member
4871 '("%h") (tramp-get-method-parameter item 'tramp-login-args))
4872 ;; The host name must match previous hop.
4873 (string-match-p previous-host host))
4874 (setq tramp-default-proxies-alist saved-tdpa)
4875 (tramp-user-error
4876 vec "Host name `%s' does not match `%s'" host previous-host))
4877 (setq previous-host (concat "^" (regexp-quote host) "$")))))
4878
4879 ;; Result.
4880 target-alist))
4881
4882(defun tramp-ssh-controlmaster-options (vec) 4784(defun tramp-ssh-controlmaster-options (vec)
4883 "Return the Control* arguments of the local ssh." 4785 "Return the Control* arguments of the local ssh."
4884 (cond 4786 (cond
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index ab52bec39eb..83ade66ee14 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3634,12 +3634,109 @@ User is always nil."
3634 (delete-file local-copy))))) 3634 (delete-file local-copy)))))
3635 t))) 3635 t)))
3636 3636
3637(defun tramp-multi-hop-p (vec)
3638 "Whether the method of VEC is capable of multi-hops."
3639 (and (tramp-sh-file-name-handler-p vec)
3640 (not (tramp-get-method-parameter vec 'tramp-copy-program))))
3641
3642(defun tramp-compute-multi-hops (vec)
3643 "Expands VEC according to `tramp-default-proxies-alist'."
3644 (let ((saved-tdpa tramp-default-proxies-alist)
3645 (target-alist `(,vec))
3646 (hops (or (tramp-file-name-hop vec) ""))
3647 (item vec)
3648 choices proxy)
3649
3650 ;; Ad-hoc proxy definitions.
3651 (dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit)))
3652 (let* ((host-port (tramp-file-name-host-port item))
3653 (user-domain (tramp-file-name-user-domain item))
3654 (proxy (concat
3655 tramp-prefix-format proxy tramp-postfix-host-format))
3656 (entry
3657 (list (and (stringp host-port)
3658 (concat "^" (regexp-quote host-port) "$"))
3659 (and (stringp user-domain)
3660 (concat "^" (regexp-quote user-domain) "$"))
3661 (propertize proxy 'tramp-ad-hoc t))))
3662 (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry)
3663 ;; Add the hop.
3664 (add-to-list 'tramp-default-proxies-alist entry)
3665 (setq item (tramp-dissect-file-name proxy))))
3666 ;; Save the new value.
3667 (when (and hops tramp-save-ad-hoc-proxies)
3668 (customize-save-variable
3669 'tramp-default-proxies-alist tramp-default-proxies-alist))
3670
3671 ;; Look for proxy hosts to be passed.
3672 (setq choices tramp-default-proxies-alist)
3673 (while choices
3674 (setq item (pop choices)
3675 proxy (eval (nth 2 item)))
3676 (when (and
3677 ;; Host.
3678 (string-match-p
3679 (or (eval (nth 0 item)) "")
3680 (or (tramp-file-name-host-port (car target-alist)) ""))
3681 ;; User.
3682 (string-match-p
3683 (or (eval (nth 1 item)) "")
3684 (or (tramp-file-name-user-domain (car target-alist)) "")))
3685 (if (null proxy)
3686 ;; No more hops needed.
3687 (setq choices nil)
3688 ;; Replace placeholders.
3689 (setq proxy
3690 (format-spec
3691 proxy
3692 (format-spec-make
3693 ?u (or (tramp-file-name-user (car target-alist)) "")
3694 ?h (or (tramp-file-name-host (car target-alist)) ""))))
3695 (with-parsed-tramp-file-name proxy l
3696 ;; Add the hop.
3697 (push l target-alist)
3698 ;; Start next search.
3699 (setq choices tramp-default-proxies-alist)))))
3700
3701 ;; Foreign and out-of-band methods are not supported for multi-hops.
3702 (when (cdr target-alist)
3703 (setq choices target-alist)
3704 (while (setq item (pop choices))
3705 (unless (tramp-multi-hop-p item)
3706 (setq tramp-default-proxies-alist saved-tdpa)
3707 (tramp-user-error
3708 vec "Method `%s' is not supported for multi-hops."
3709 (tramp-file-name-method item)))))
3710
3711 ;; Some methods ("su", "sg", "sudo", "doas", "ksu") do not use the
3712 ;; host name in their command template. In this case, the remote
3713 ;; file name must use either a local host name (first hop), or a
3714 ;; host name matching the previous hop.
3715 (let ((previous-host (or tramp-local-host-regexp "")))
3716 (setq choices target-alist)
3717 (while (setq item (pop choices))
3718 (let ((host (tramp-file-name-host item)))
3719 (unless
3720 (or
3721 ;; The host name is used for the remote shell command.
3722 (member
3723 '("%h") (tramp-get-method-parameter item 'tramp-login-args))
3724 ;; The host name must match previous hop.
3725 (string-match-p previous-host host))
3726 (setq tramp-default-proxies-alist saved-tdpa)
3727 (tramp-user-error
3728 vec "Host name `%s' does not match `%s'" host previous-host))
3729 (setq previous-host (concat "^" (regexp-quote host) "$")))))
3730
3731 ;; Result.
3732 target-alist))
3733
3637(defun tramp-direct-async-process-p (&rest args) 3734(defun tramp-direct-async-process-p (&rest args)
3638 "Whether direct async `make-process' can be called." 3735 "Whether direct async `make-process' can be called."
3639 (let ((v (tramp-dissect-file-name default-directory))) 3736 (let ((v (tramp-dissect-file-name default-directory)))
3640 (and (tramp-get-connection-property v"direct-async-process" nil) 3737 (and (tramp-get-connection-property v "direct-async-process" nil)
3641 (not (tramp-multi-hop-p v)) 3738 (= (length (tramp-compute-multi-hops v)) 1)
3642 (not (plist-get args :stderr))))) 3739 (not (plist-get args :stderr)))))
3643 3740
3644;; We use BUFFER also as connection buffer during setup. Because of 3741;; We use BUFFER also as connection buffer during setup. Because of
3645;; this, its original contents must be saved, and restored once 3742;; this, its original contents must be saved, and restored once
diff --git a/lisp/erc/erc-compat.el b/lisp/obsolete/erc-compat.el
index d71221b2674..7ef30d822ff 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/obsolete/erc-compat.el
@@ -5,6 +5,7 @@
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Maintainer: Amin Bandali <bandali@gnu.org> 6;; Maintainer: Amin Bandali <bandali@gnu.org>
7;; URL: https://www.emacswiki.org/emacs/ERC 7;; URL: https://www.emacswiki.org/emacs/ERC
8;; Obsolete-since: 28.1
8 9
9;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
10 11
diff --git a/lisp/obsolete/tpu-edt.el b/lisp/obsolete/tpu-edt.el
index d71f79c87be..0de7aa096d6 100644
--- a/lisp/obsolete/tpu-edt.el
+++ b/lisp/obsolete/tpu-edt.el
@@ -287,14 +287,6 @@
287;;; 287;;;
288;;; User Configurable Variables 288;;; User Configurable Variables
289;;; 289;;;
290(defcustom tpu-have-ispell t
291 "Non-nil means `tpu-spell-check' uses `ispell-region' for spell checking.
292Otherwise, use `spell-region'."
293 :type 'boolean
294 :group 'tpu)
295(make-obsolete-variable 'tpu-have-ispell "the `spell' package is obsolete."
296 "23.1")
297
298(defcustom tpu-kill-buffers-silently nil 290(defcustom tpu-kill-buffers-silently nil
299 "If non-nil, TPU-edt kills modified buffers without asking." 291 "If non-nil, TPU-edt kills modified buffers without asking."
300 :type 'boolean 292 :type 'boolean
@@ -315,7 +307,6 @@ Otherwise, use `spell-region'."
315;;; Global Keymaps 307;;; Global Keymaps
316;;; 308;;;
317 309
318(define-obsolete-variable-alias 'GOLD-map 'tpu-gold-map "23.1")
319(defvar tpu-gold-map 310(defvar tpu-gold-map
320 (let ((map (make-keymap))) 311 (let ((map (make-keymap)))
321 ;; Previously we used escape sequences here. We now instead presume 312 ;; Previously we used escape sequences here. We now instead presume
@@ -892,8 +883,7 @@ With argument, fill and justify."
892if no region is selected." 883if no region is selected."
893 (interactive) 884 (interactive)
894 (let ((m (tpu-mark))) 885 (let ((m (tpu-mark)))
895 (apply (if tpu-have-ispell 'ispell-region 886 (apply 'ispell-region
896 'spell-region)
897 (if m 887 (if m
898 (if (> m (point)) (list (point) m) 888 (if (> m (point)) (list (point) m)
899 (list m (point))) 889 (list m (point)))
diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index f5007579a8a..2443f374a84 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -94,22 +94,6 @@ The variable `password-cache' control whether the cache is used."
94 (or (password-read-from-cache key) 94 (or (password-read-from-cache key)
95 (read-passwd prompt))) 95 (read-passwd prompt)))
96 96
97(defun password-read-and-add (prompt &optional key)
98 "Read password, for use with KEY, from user, or from cache if wanted.
99Then store the password in the cache. Uses `password-read' and
100`password-cache-add'. Custom variables `password-cache' and
101`password-cache-expiry' regulate cache behavior.
102
103Warning: the password is cached without checking that it is
104correct. It is better to check the password before caching. If
105you must use this function, take care to check passwords and
106remove incorrect ones from the cache."
107 (declare (obsolete password-read "23.1"))
108 (let ((password (password-read prompt key)))
109 (when (and password key)
110 (password-cache-add key password))
111 password))
112
113(defun password-cache-remove (key) 97(defun password-cache-remove (key)
114 "Remove password indexed by KEY from password cache. 98 "Remove password indexed by KEY from password cache.
115This is typically run by a timer setup from `password-cache-add', 99This is typically run by a timer setup from `password-cache-add',
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index c3a98d9c5cf..7b8b174c430 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -384,7 +384,7 @@ comment at the start of cc-engine.el for more info."
384 c-macro-cache-syntactic nil 384 c-macro-cache-syntactic nil
385 c-macro-cache-no-comment nil)) 385 c-macro-cache-no-comment nil))
386 (save-match-data 386 (save-match-data
387 (let ((safe-pos (point))) ; a point ouside any literal. 387 (let ((safe-pos (point))) ; a point outside any literal.
388 ;; Move over stuff followed by a multiline block comment lacking 388 ;; Move over stuff followed by a multiline block comment lacking
389 ;; escaped newlines each time around this loop. 389 ;; escaped newlines each time around this loop.
390 (while 390 (while
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0b9f417845f..a043bbcfa3c 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -316,8 +316,8 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
316 (gcc-include 316 (gcc-include
317 "^\\(?:In file included \\| \\|\t\\)from \ 317 "^\\(?:In file included \\| \\|\t\\)from \
318\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\ 318\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\
319\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\(:\\)\\|\\(,\\|$\\)\\)?" 319\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\([:,]\\|$\\)\\)?"
320 1 2 3 (4 . 5)) 320 1 2 3 (nil . 4))
321 321
322 (ruby-Test::Unit 322 (ruby-Test::Unit
323 "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2) 323 "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2)
@@ -2417,12 +2417,9 @@ and runs `compilation-filter-hook'."
2417 &optional object limit) 2417 &optional object limit)
2418 (let (parsed res) 2418 (let (parsed res)
2419 (while (progn 2419 (while (progn
2420 ;; We parse the buffer here "on-demand" by chunks of 500 chars.
2421 ;; But we could also just parse the whole buffer.
2422 (compilation--ensure-parse 2420 (compilation--ensure-parse
2423 (setq parsed (max compilation--parsed 2421 (setq parsed (max compilation--parsed
2424 (min (+ position 500) 2422 (or limit (point-max)))))
2425 (or limit (point-max))))))
2426 (and (or (not (setq res (next-single-property-change 2423 (and (or (not (setq res (next-single-property-change
2427 position prop object limit))) 2424 position prop object limit)))
2428 (eq res limit)) 2425 (eq res limit))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 6122caf5189..2d2713a36ab 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3979,6 +3979,9 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3979 (and (eq (preceding-char) ?.) 3979 (and (eq (preceding-char) ?.)
3980 (eq (char-after (- (point) 2)) ?.)) 3980 (eq (char-after (- (point) 2)) ?.))
3981 (bobp)) 3981 (bobp))
3982 ;; { $a++ / $b } doesn't start a regex, nor does $a--
3983 (not (and (memq (preceding-char) '(?+ ?-))
3984 (eq (preceding-char) (char-before (1- (point))))))
3982 ;; m|blah| ? foo : bar; 3985 ;; m|blah| ? foo : bar;
3983 (not 3986 (not
3984 (and (eq c ?\?) 3987 (and (eq c ?\?)
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 08cf802bcbe..22c70bf734d 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -4527,7 +4527,7 @@ end
4527 (let* ((ebnf-tree tree) 4527 (let* ((ebnf-tree tree)
4528 (ps-color-p (and ebnf-color-p (ps-color-device))) 4528 (ps-color-p (and ebnf-color-p (ps-color-device)))
4529 (ps-print-color-scale (if ps-color-p 4529 (ps-print-color-scale (if ps-color-p
4530 (float (car (ps-color-values "white"))) 4530 (float (car (color-values "white")))
4531 1.0)) 4531 1.0))
4532 (ebnf-total (length ebnf-tree)) 4532 (ebnf-total (length ebnf-tree))
4533 (ebnf-nprod 0) 4533 (ebnf-nprod 0)
@@ -4629,7 +4629,7 @@ end
4629 (let* ((ebnf-tree tree) 4629 (let* ((ebnf-tree tree)
4630 (ps-color-p (and ebnf-color-p (ps-color-device))) 4630 (ps-color-p (and ebnf-color-p (ps-color-device)))
4631 (ps-print-color-scale (if ps-color-p 4631 (ps-print-color-scale (if ps-color-p
4632 (float (car (ps-color-values "white"))) 4632 (float (car (color-values "white")))
4633 1.0)) 4633 1.0))
4634 ps-zebra-stripes ps-line-number ps-razzle-dazzle 4634 ps-zebra-stripes ps-line-number ps-razzle-dazzle
4635 ps-print-hook 4635 ps-print-hook
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2f44118edb5..21ba42a0fe1 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1420,10 +1420,12 @@ Intended for `eldoc-documentation-functions' (which see)."
1420(defun elisp-eldoc-var-docstring (callback &rest _ignored) 1420(defun elisp-eldoc-var-docstring (callback &rest _ignored)
1421 "Document variable at point. 1421 "Document variable at point.
1422Intended for `eldoc-documentation-functions' (which see)." 1422Intended for `eldoc-documentation-functions' (which see)."
1423 (let ((sym (elisp--current-symbol))) 1423 (let* ((sym (elisp--current-symbol))
1424 (when sym (funcall callback (elisp-get-var-docstring sym) 1424 (docstring (and sym (elisp-get-var-docstring sym))))
1425 :thing sym 1425 (when docstring
1426 :face 'font-lock-variable-name-face)))) 1426 (funcall callback docstring
1427 :thing sym
1428 :face 'font-lock-variable-name-face))))
1427 1429
1428(defun elisp-get-fnsym-args-string (sym &optional index) 1430(defun elisp-get-fnsym-args-string (sym &optional index)
1429 "Return a string containing the parameter list of the function SYM. 1431 "Return a string containing the parameter list of the function SYM.
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index edadbbdafc1..2c5c36504a9 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1424,6 +1424,10 @@ hits the start of file."
1424 (goto-func goto-tag-location-function) 1424 (goto-func goto-tag-location-function)
1425 tag tag-info pt) 1425 tag tag-info pt)
1426 (forward-line 1) 1426 (forward-line 1)
1427 ;; Exuberant ctags add a line starting with the DEL character;
1428 ;; skip past it.
1429 (when (looking-at "\177")
1430 (forward-line 1))
1427 (while (not (or (eobp) (looking-at "\f"))) 1431 (while (not (or (eobp) (looking-at "\f")))
1428 ;; We used to use explicit tags when available, but the current goto-func 1432 ;; We used to use explicit tags when available, but the current goto-func
1429 ;; can only handle implicit tags. 1433 ;; can only handle implicit tags.
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index d3a2308e06b..ec4fd58886a 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -267,7 +267,6 @@ support."
267(declare-function idlwave-find-class-definition "idlwave") 267(declare-function idlwave-find-class-definition "idlwave")
268(declare-function idlwave-find-inherited-class "idlwave") 268(declare-function idlwave-find-inherited-class "idlwave")
269(declare-function idlwave-find-struct-tag "idlwave") 269(declare-function idlwave-find-struct-tag "idlwave")
270(declare-function idlwave-get-buffer-visiting "idlwave")
271(declare-function idlwave-in-quote "idlwave") 270(declare-function idlwave-in-quote "idlwave")
272(declare-function idlwave-make-full-name "idlwave") 271(declare-function idlwave-make-full-name "idlwave")
273(declare-function idlwave-members-only "idlwave") 272(declare-function idlwave-members-only "idlwave")
@@ -880,7 +879,7 @@ This function can be used as `idlwave-extra-help-function'."
880 (setq in-buf ; structure-tag completion is always in current buffer 879 (setq in-buf ; structure-tag completion is always in current buffer
881 (if struct-tag 880 (if struct-tag
882 idlwave-current-tags-buffer 881 idlwave-current-tags-buffer
883 (idlwave-get-buffer-visiting file))) 882 (find-buffer-visiting file)))
884 ;; see if file is in a visited buffer, insert those contents 883 ;; see if file is in a visited buffer, insert those contents
885 (if in-buf 884 (if in-buf
886 (progn 885 (progn
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index f875915ca8e..99ac0877c8b 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -2640,7 +2640,7 @@ Assumes that `idlwave-shell-sources-alist' contains an entry for that module."
2640 (if (or (not source-file) 2640 (if (or (not source-file)
2641 (not (file-regular-p source-file)) 2641 (not (file-regular-p source-file))
2642 (not (setq buf 2642 (not (setq buf
2643 (or (idlwave-get-buffer-visiting source-file) 2643 (or (find-buffer-visiting source-file)
2644 (find-file-noselect source-file))))) 2644 (find-file-noselect source-file)))))
2645 (progn 2645 (progn
2646 (message "The source file for module %s is probably not compiled" 2646 (message "The source file for module %s is probably not compiled"
@@ -3241,8 +3241,7 @@ Does not work for a region with multiline blocks - use
3241 "Delete the temporary files and kill associated buffers." 3241 "Delete the temporary files and kill associated buffers."
3242 (if (stringp idlwave-shell-temp-pro-file) 3242 (if (stringp idlwave-shell-temp-pro-file)
3243 (condition-case nil 3243 (condition-case nil
3244 (let ((buf (idlwave-get-buffer-visiting 3244 (let ((buf (find-buffer-visiting idlwave-shell-temp-pro-file)))
3245 idlwave-shell-temp-pro-file)))
3246 (if (buffer-live-p buf) 3245 (if (buffer-live-p buf)
3247 (kill-buffer buf)) 3246 (kill-buffer buf))
3248 (delete-file idlwave-shell-temp-pro-file)) 3247 (delete-file idlwave-shell-temp-pro-file))
@@ -3788,7 +3787,7 @@ handled by this command."
3788 (save-buffer) 3787 (save-buffer)
3789 (setq idlwave-shell-last-save-and-action-file (buffer-file-name))) 3788 (setq idlwave-shell-last-save-and-action-file (buffer-file-name)))
3790 (idlwave-shell-last-save-and-action-file 3789 (idlwave-shell-last-save-and-action-file
3791 (if (setq buf (idlwave-get-buffer-visiting 3790 (if (setq buf (find-buffer-visiting
3792 idlwave-shell-last-save-and-action-file)) 3791 idlwave-shell-last-save-and-action-file))
3793 (with-current-buffer buf 3792 (with-current-buffer buf
3794 (save-buffer)))) 3793 (save-buffer))))
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index f7e53ec02d6..153f2578bf1 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -581,12 +581,7 @@ like this:
581MyMethod <Class1,Class2,Class3> 581MyMethod <Class1,Class2,Class3>
582 582
583The value of this variable may be nil to inhibit display, or an integer to 583The value of this variable may be nil to inhibit display, or an integer to
584indicate the maximum number of classes to display. 584indicate the maximum number of classes to display."
585
586On XEmacs, a full list of classes will also be placed into a `help-echo'
587property on the completion items, so that the list of classes for the current
588item is displayed in the echo area. If the value of this variable is a
589negative integer, the `help-echo' property will be suppressed."
590 :group 'idlwave-completion 585 :group 'idlwave-completion
591 :type '(choice (const :tag "Don't show" nil) 586 :type '(choice (const :tag "Don't show" nil)
592 (integer :tag "Number of classes shown" 1))) 587 (integer :tag "Number of classes shown" 1)))
@@ -1054,7 +1049,6 @@ goto Goto Statements
1054common-blocks Common Blocks 1049common-blocks Common Blocks
1055keyword-parameters Keyword Parameters in routine definitions and calls 1050keyword-parameters Keyword Parameters in routine definitions and calls
1056system-variables System Variables 1051system-variables System Variables
1057fixme FIXME: Warning in comments (on XEmacs only v. 21.0 and up)
1058class-arrows Object Arrows with class property" 1052class-arrows Object Arrows with class property"
1059 :group 'idlwave-misc 1053 :group 'idlwave-misc
1060 :type '(set 1054 :type '(set
@@ -1069,7 +1063,6 @@ class-arrows Object Arrows with class property"
1069 (const :tag "Common Blocks" common-blocks) 1063 (const :tag "Common Blocks" common-blocks)
1070 (const :tag "Keyword Parameters" keyword-parameters) 1064 (const :tag "Keyword Parameters" keyword-parameters)
1071 (const :tag "System Variables" system-variables) 1065 (const :tag "System Variables" system-variables)
1072 (const :tag "FIXME: Warning" fixme)
1073 (const :tag "Object Arrows with class property " class-arrows))) 1066 (const :tag "Object Arrows with class property " class-arrows)))
1074 1067
1075(defcustom idlwave-mode-hook nil 1068(defcustom idlwave-mode-hook nil
@@ -1138,23 +1131,16 @@ As a user, you should not set this to t.")
1138 ;; Common blocks 1131 ;; Common blocks
1139 (common-blocks 1132 (common-blocks
1140 '("\\<\\(common\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*,?" 1133 '("\\<\\(common\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*,?"
1141 (1 font-lock-keyword-face) ; "common" 1134 (1 font-lock-keyword-face) ; "common"
1142 (2 font-lock-constant-face nil t) ; block name 1135 (2 font-lock-constant-face nil t) ; block name
1143 ("[ \t]*\\(\\sw+\\)[ ,]*" 1136 ("[ \t]*\\(\\sw+\\)[ ,]*"
1144 ;; Start with point after block name and comma 1137 ;; Start with point after block name and comma
1145 (goto-char (match-end 0)) ; needed for XEmacs, could be nil 1138 nil nil (1 font-lock-variable-name-face)))) ; variable names
1146 nil
1147 (1 font-lock-variable-name-face) ; variable names
1148 )))
1149 1139
1150 ;; Batch files 1140 ;; Batch files
1151 (batch-files 1141 (batch-files
1152 '("^[ \t]*\\(@[^ \t\n]+\\)" (1 font-lock-string-face))) 1142 '("^[ \t]*\\(@[^ \t\n]+\\)" (1 font-lock-string-face)))
1153 1143
1154 ;; FIXME warning.
1155 (fixme
1156 '("\\<FIXME:" (0 font-lock-warning-face t)))
1157
1158 ;; Labels 1144 ;; Labels
1159 (label 1145 (label
1160 '("^[ \t]*\\([a-zA-Z]\\sw*:\\)" (1 font-lock-constant-face))) 1146 '("^[ \t]*\\([a-zA-Z]\\sw*:\\)" (1 font-lock-constant-face)))
@@ -1241,9 +1227,6 @@ As a user, you should not set this to t.")
1241 ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w")) 1227 ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w"))
1242 beginning-of-line)) 1228 beginning-of-line))
1243 1229
1244(put 'idlwave-mode 'font-lock-defaults
1245 idlwave-font-lock-defaults) ; XEmacs
1246
1247(defconst idlwave-comment-line-start-skip "^[ \t]*;" 1230(defconst idlwave-comment-line-start-skip "^[ \t]*;"
1248 "Regexp to match the start of a full-line comment. 1231 "Regexp to match the start of a full-line comment.
1249That is the _beginning_ of a line containing a comment delimiter `;' preceded 1232That is the _beginning_ of a line containing a comment delimiter `;' preceded
@@ -1479,9 +1462,7 @@ Otherwise ARGS forms a list that is evaluated."
1479 (define-key map "\M-\C-i" 'idlwave-complete) 1462 (define-key map "\M-\C-i" 'idlwave-complete)
1480 (define-key map "\C-c\C-i" 'idlwave-update-routine-info) 1463 (define-key map "\C-c\C-i" 'idlwave-update-routine-info)
1481 (define-key map "\C-c=" 'idlwave-resolve) 1464 (define-key map "\C-c=" 'idlwave-resolve)
1482 (define-key map 1465 (define-key map [(shift mouse-3)] 'idlwave-mouse-context-help)
1483 (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)])
1484 'idlwave-mouse-context-help)
1485 map) 1466 map)
1486 "Keymap used in IDL mode.") 1467 "Keymap used in IDL mode.")
1487 1468
@@ -1916,8 +1897,6 @@ The main features of this mode are
1916 (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS"))) 1897 (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS")))
1917 1898
1918 ;; Font-lock additions 1899 ;; Font-lock additions
1919 ;; Following line is for Emacs - XEmacs uses the corresponding property
1920 ;; on the `idlwave-mode' symbol.
1921 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults) 1900 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults)
1922 (set (make-local-variable 'font-lock-mark-block-function) 1901 (set (make-local-variable 'font-lock-mark-block-function)
1923 'idlwave-mark-subprogram) 1902 'idlwave-mark-subprogram)
@@ -3814,15 +3793,8 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
3814 (setq start (match-end 0))) 3793 (setq start (match-end 0)))
3815 (setq ret_string (concat ret_string (substring string start last))))) 3794 (setq ret_string (concat ret_string (substring string start last)))))
3816 3795
3817(defun idlwave-get-buffer-visiting (file) 3796(define-obsolete-function-alias 'idlwave-get-buffer-visiting
3818 ;; Return the buffer currently visiting FILE 3797 #'find-buffer-visiting "28.1")
3819 (cond
3820 ((boundp 'find-file-compare-truenames) ; XEmacs
3821 (let ((find-file-compare-truenames t))
3822 (get-file-buffer file)))
3823 ((fboundp 'find-buffer-visiting) ; Emacs
3824 (find-buffer-visiting file))
3825 (t (error "This should not happen (idlwave-get-buffer-visiting)"))))
3826 3798
3827(defvar idlwave-outlawed-buffers nil 3799(defvar idlwave-outlawed-buffers nil
3828 "List of buffers pulled up by IDLWAVE for special reasons. 3800 "List of buffers pulled up by IDLWAVE for special reasons.
@@ -3830,7 +3802,7 @@ Buffers in this list may be killed by `idlwave-kill-autoloaded-buffers'.")
3830 3802
3831(defun idlwave-find-file-noselect (file &optional why) 3803(defun idlwave-find-file-noselect (file &optional why)
3832 ;; Return a buffer visiting file. 3804 ;; Return a buffer visiting file.
3833 (or (idlwave-get-buffer-visiting file) 3805 (or (find-buffer-visiting file)
3834 (let ((buf (find-file-noselect file))) 3806 (let ((buf (find-file-noselect file)))
3835 (if why (add-to-list 'idlwave-outlawed-buffers (cons buf why))) 3807 (if why (add-to-list 'idlwave-outlawed-buffers (cons buf why)))
3836 buf))) 3808 buf)))
@@ -6618,7 +6590,6 @@ This function is not general, can only be used for completion stuff."
6618 "A form to evaluate after completion selection in *Completions* buffer.") 6590 "A form to evaluate after completion selection in *Completions* buffer.")
6619(defconst idlwave-completion-mark (make-marker) 6591(defconst idlwave-completion-mark (make-marker)
6620 "A mark pointing to the beginning of the completion string.") 6592 "A mark pointing to the beginning of the completion string.")
6621(defvar completion-highlight-first-word-only) ;XEmacs.
6622 6593
6623(defun idlwave-complete-in-buffer (type stype list selector prompt isa 6594(defun idlwave-complete-in-buffer (type stype list selector prompt isa
6624 &optional prepare-display-function 6595 &optional prepare-display-function
@@ -6697,12 +6668,7 @@ accumulate information on matching completions."
6697 list)) 6668 list))
6698 (let* ((list all-completions) 6669 (let* ((list all-completions)
6699 ;; "complete" means, this is already a valid completion 6670 ;; "complete" means, this is already a valid completion
6700 (complete (memq spart all-completions)) 6671 (complete (memq spart all-completions)))
6701 (completion-highlight-first-word-only t)) ; XEmacs
6702 ;; (completion-fixup-function ; Emacs
6703 ;; (lambda () (and (eq (preceding-char) ?>)
6704 ;; (re-search-backward " <" beg t)))))
6705
6706 (setq list (sort list (lambda (a b) 6672 (setq list (sort list (lambda (a b)
6707 (string< (downcase a) (downcase b))))) 6673 (string< (downcase a) (downcase b)))))
6708 (if prepare-display-function 6674 (if prepare-display-function
@@ -6764,7 +6730,6 @@ accumulate information on matching completions."
6764 (let* ((do-prop (and (>= show-classes 0) 6730 (let* ((do-prop (and (>= show-classes 0)
6765 (>= emacs-major-version 21))) 6731 (>= emacs-major-version 21)))
6766 (do-buf (not (= show-classes 0))) 6732 (do-buf (not (= show-classes 0)))
6767 ;; (do-dots (featurep 'xemacs))
6768 (do-dots t) 6733 (do-dots t)
6769 (inherit (if (and (not (eq type 'class-tag)) super-classes) 6734 (inherit (if (and (not (eq type 'class-tag)) super-classes)
6770 (cons class-selector super-classes))) 6735 (cons class-selector super-classes)))
@@ -6830,10 +6795,6 @@ accumulate information on matching completions."
6830;;---------------------------------------------------------------------- 6795;;----------------------------------------------------------------------
6831;;---------------------------------------------------------------------- 6796;;----------------------------------------------------------------------
6832;;---------------------------------------------------------------------- 6797;;----------------------------------------------------------------------
6833(when (featurep 'xemacs)
6834 (defvar rtn)
6835 (defun idlwave-pset (item)
6836 (set 'rtn item)))
6837 6798
6838(defun idlwave-popup-select (ev list title &optional sort) 6799(defun idlwave-popup-select (ev list title &optional sort)
6839 "Select an item in LIST with a popup menu. 6800 "Select an item in LIST with a popup menu.
@@ -6844,17 +6805,6 @@ sort the list before displaying."
6844 (cond ((null list)) 6805 (cond ((null list))
6845 ((= 1 (length list)) 6806 ((= 1 (length list))
6846 (setq rtn (car list))) 6807 (setq rtn (car list)))
6847 ((featurep 'xemacs)
6848 (if sort (setq list (sort list (lambda (a b)
6849 (string< (upcase a) (upcase b))))))
6850 (setq menu
6851 (append (list title)
6852 (mapcar (lambda (x) (vector x (list 'idlwave-pset
6853 x)))
6854 list)))
6855 (setq menu (idlwave-split-menu-xemacs menu maxpopup))
6856 (let ((resp (get-popup-menu-response menu)))
6857 (funcall (event-function resp) (event-object resp))))
6858 (t 6808 (t
6859 (if sort (setq list (sort list (lambda (a b) 6809 (if sort (setq list (sort list (lambda (a b)
6860 (string< (upcase a) (upcase b)))))) 6810 (string< (upcase a) (upcase b))))))
@@ -6862,36 +6812,14 @@ sort the list before displaying."
6862 (list 6812 (list
6863 (append (list "") 6813 (append (list "")
6864 (mapcar (lambda(x) (cons x x)) list))))) 6814 (mapcar (lambda(x) (cons x x)) list)))))
6865 (setq menu (idlwave-split-menu-emacs menu maxpopup)) 6815 (setq menu (idlwave-split-menu menu maxpopup))
6866 (setq rtn (x-popup-menu ev menu)))) 6816 (setq rtn (x-popup-menu ev menu))))
6867 rtn)) 6817 rtn))
6868 6818
6869(defun idlwave-split-menu-xemacs (menu N) 6819(define-obsolete-function-alias 'idlwave-split-menu-emacs
6870 "Split the MENU into submenus of maximum length N." 6820 #'idlwave-split-menu "28.1")
6871 (if (<= (length menu) (1+ N))
6872 ;; No splitting needed
6873 menu
6874 (let* ((title (car menu))
6875 (entries (cdr menu))
6876 (menu (list title))
6877 (cnt 0)
6878 (nextmenu nil))
6879 (while entries
6880 (while (and entries (< cnt N))
6881 (setq cnt (1+ cnt)
6882 nextmenu (cons (car entries) nextmenu)
6883 entries (cdr entries)))
6884 (setq nextmenu (nreverse nextmenu))
6885 (setq nextmenu (cons (format "%s...%s"
6886 (aref (car nextmenu) 0)
6887 (aref (nth (1- cnt) nextmenu) 0))
6888 nextmenu))
6889 (setq menu (cons nextmenu menu)
6890 nextmenu nil
6891 cnt 0))
6892 (nreverse menu))))
6893 6821
6894(defun idlwave-split-menu-emacs (menu N) 6822(defun idlwave-split-menu (menu N)
6895 "Split the MENU into submenus of maximum length N." 6823 "Split the MENU into submenus of maximum length N."
6896 (if (<= (length (nth 1 menu)) (1+ N)) 6824 (if (<= (length (nth 1 menu)) (1+ N))
6897 ;; No splitting needed 6825 ;; No splitting needed
@@ -6946,10 +6874,7 @@ sort the list before displaying."
6946 (move-marker idlwave-completion-mark beg) 6874 (move-marker idlwave-completion-mark beg)
6947 (setq idlwave-before-completion-wconf (current-window-configuration))) 6875 (setq idlwave-before-completion-wconf (current-window-configuration)))
6948 6876
6949 (if (featurep 'xemacs) 6877 (idlwave-display-completion-list-1 list)
6950 (idlwave-display-completion-list-xemacs
6951 list)
6952 (idlwave-display-completion-list-emacs list))
6953 6878
6954 ;; Store a special value in `this-command'. When `idlwave-complete' 6879 ;; Store a special value in `this-command'. When `idlwave-complete'
6955 ;; finds this in `last-command', it will scroll the *Completions* buffer. 6880 ;; finds this in `last-command', it will scroll the *Completions* buffer.
@@ -7007,8 +6932,7 @@ The key which is associated with each option is generated automatically.
7007First, the strings are checked for preselected keys, like in \"[P]rint\". 6932First, the strings are checked for preselected keys, like in \"[P]rint\".
7008If these don't exist, a letter in the string is automatically selected." 6933If these don't exist, a letter in the string is automatically selected."
7009 (let* ((alist (symbol-value sym)) 6934 (let* ((alist (symbol-value sym))
7010 (temp-buffer-show-hook (if (fboundp 'fit-window-to-buffer) 6935 (temp-buffer-show-hook '(fit-window-to-buffer))
7011 '(fit-window-to-buffer)))
7012 keys-alist char) 6936 keys-alist char)
7013 ;; First check the cache 6937 ;; First check the cache
7014 (if (and (eq (symbol-value sym) (get sym :one-key-alist-last))) 6938 (if (and (eq (symbol-value sym) (get sym :one-key-alist-last)))
@@ -7094,42 +7018,17 @@ If these don't exist, a letter in the string is automatically selected."
7094 (and (local-variable-p var (current-buffer)) 7018 (and (local-variable-p var (current-buffer))
7095 (symbol-value var)))) 7019 (symbol-value var))))
7096 7020
7097;; In XEmacs, we can use :activate-callback directly to advice the
7098;; choose functions. We use the private keymap only for the online
7099;; help feature.
7100
7101(defvar idlwave-completion-map nil 7021(defvar idlwave-completion-map nil
7102 "Keymap for `completion-list-mode' with `idlwave-complete'.") 7022 "Keymap for `completion-list-mode' with `idlwave-complete'.")
7103 7023
7104(defun idlwave-display-completion-list-xemacs (list &rest cl-args)
7105 (with-output-to-temp-buffer "*Completions*"
7106 (apply 'display-completion-list list
7107 ':activate-callback 'idlwave-default-choose-completion
7108 cl-args))
7109 (with-current-buffer "*Completions*"
7110 (use-local-map
7111 (or idlwave-completion-map
7112 (setq idlwave-completion-map
7113 (idlwave-make-modified-completion-map-xemacs
7114 (current-local-map)))))))
7115
7116(defun idlwave-default-choose-completion (&rest args) 7024(defun idlwave-default-choose-completion (&rest args)
7117 "Execute `default-choose-completion' and then restore the win-conf." 7025 "Execute `default-choose-completion' and then restore the win-conf."
7118 (apply 'idlwave-choose 'default-choose-completion args)) 7026 (apply 'idlwave-choose 'default-choose-completion args))
7119 7027
7120(defun idlwave-make-modified-completion-map-xemacs (old-map) 7028(define-obsolete-function-alias 'idlwave-display-completion-list-emacs
7121 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP." 7029 #'idlwave-display-completion-list-1 "28.1")
7122 (let ((new-map (copy-keymap old-map)))
7123 (define-key new-map [button3up] 'idlwave-mouse-completion-help)
7124 (define-key new-map [button3] (lambda ()
7125 (interactive)
7126 (setq this-command last-command)))
7127 new-map))
7128
7129;; In Emacs we also replace keybindings in the completion
7130;; map in order to install our wrappers.
7131 7030
7132(defun idlwave-display-completion-list-emacs (list) 7031(defun idlwave-display-completion-list-1 (list)
7133 "Display completion list and install the choose wrappers." 7032 "Display completion list and install the choose wrappers."
7134 (with-output-to-temp-buffer "*Completions*" 7033 (with-output-to-temp-buffer "*Completions*"
7135 (display-completion-list list)) 7034 (display-completion-list list))
@@ -7137,10 +7036,12 @@ If these don't exist, a letter in the string is automatically selected."
7137 (use-local-map 7036 (use-local-map
7138 (or idlwave-completion-map 7037 (or idlwave-completion-map
7139 (setq idlwave-completion-map 7038 (setq idlwave-completion-map
7140 (idlwave-make-modified-completion-map-emacs 7039 (idlwave-make-modified-completion-map (current-local-map)))))))
7141 (current-local-map)))))))
7142 7040
7143(defun idlwave-make-modified-completion-map-emacs (old-map) 7041(define-obsolete-function-alias 'idlwave-make-modified-completion-map-emacs
7042 #'idlwave-make-modified-completion-map "28.1")
7043
7044(defun idlwave-make-modified-completion-map (old-map)
7144 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP." 7045 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP."
7145 (let ((new-map (copy-keymap old-map))) 7046 (let ((new-map (copy-keymap old-map)))
7146 (substitute-key-definition 7047 (substitute-key-definition
@@ -7352,7 +7253,7 @@ class/struct definition."
7352 (file (idlwave-routine-source-file 7253 (file (idlwave-routine-source-file
7353 (nth 3 (idlwave-rinfo-assoc pro 'pro nil 7254 (nth 3 (idlwave-rinfo-assoc pro 'pro nil
7354 (idlwave-routines)))))) 7255 (idlwave-routines))))))
7355 (cons file (if file (idlwave-get-buffer-visiting file))))) 7256 (cons file (if file (find-buffer-visiting file)))))
7356 7257
7357 7258
7358(defun idlwave-scan-class-info (class) 7259(defun idlwave-scan-class-info (class)
@@ -8223,15 +8124,9 @@ If we do not know about MODULE, just return KEYWORD literally."
8223 8124
8224(defvar idlwave-rinfo-mouse-map 8125(defvar idlwave-rinfo-mouse-map
8225 (let ((map (make-sparse-keymap))) 8126 (let ((map (make-sparse-keymap)))
8226 (define-key map 8127 (define-key map [mouse-2] 'idlwave-mouse-active-rinfo)
8227 (if (featurep 'xemacs) [button2] [mouse-2]) 8128 (define-key map [(shift mouse-2)] 'idlwave-mouse-active-rinfo-shift)
8228 'idlwave-mouse-active-rinfo) 8129 (define-key map [mouse-3] 'idlwave-mouse-active-rinfo-right)
8229 (define-key map
8230 (if (featurep 'xemacs) [(shift button2)] [(shift mouse-2)])
8231 'idlwave-mouse-active-rinfo-shift)
8232 (define-key map
8233 (if (featurep 'xemacs) [button3] [mouse-3])
8234 'idlwave-mouse-active-rinfo-right)
8235 (define-key map " " 'idlwave-active-rinfo-space) 8130 (define-key map " " 'idlwave-active-rinfo-space)
8236 (define-key map "q" 'idlwave-quit-help) 8131 (define-key map "q" 'idlwave-quit-help)
8237 map)) 8132 map))
@@ -8283,7 +8178,6 @@ If we do not know about MODULE, just return KEYWORD literally."
8283 "Button2: Display info about same method in superclass") 8178 "Button2: Display info about same method in superclass")
8284 (col 0) 8179 (col 0)
8285 (data (list name type class (current-buffer) nil initial-class)) 8180 (data (list name type class (current-buffer) nil initial-class))
8286 (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
8287 (face 'idlwave-help-link) 8181 (face 'idlwave-help-link)
8288 beg props win cnt total) 8182 beg props win cnt total)
8289 ;; Fix keywords, but don't add chained super-classes, since these 8183 ;; Fix keywords, but don't add chained super-classes, since these
@@ -8308,7 +8202,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8308 idlwave-current-obj_new-class) 8202 idlwave-current-obj_new-class)
8309 (when superclasses 8203 (when superclasses
8310 (setq props (list 'mouse-face 'highlight 8204 (setq props (list 'mouse-face 'highlight
8311 km-prop idlwave-rinfo-mouse-map 8205 'local-map idlwave-rinfo-mouse-map
8312 'help-echo help-echo-class 8206 'help-echo help-echo-class
8313 'data (cons 'class data))) 8207 'data (cons 'class data)))
8314 (let ((classes (cons initial-class superclasses)) c) 8208 (let ((classes (cons initial-class superclasses)) c)
@@ -8324,7 +8218,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8324 (add-text-properties beg (point) props)))) 8218 (add-text-properties beg (point) props))))
8325 (insert "\n"))) 8219 (insert "\n")))
8326 (setq props (list 'mouse-face 'highlight 8220 (setq props (list 'mouse-face 'highlight
8327 km-prop idlwave-rinfo-mouse-map 8221 'local-map idlwave-rinfo-mouse-map
8328 'help-echo help-echo-use 8222 'help-echo help-echo-use
8329 'data (cons 'usage data))) 8223 'data (cons 'usage data)))
8330 (if html-file (setq props (append (list 'face face 'link html-file) 8224 (if html-file (setq props (append (list 'face face 'link html-file)
@@ -8352,7 +8246,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8352 (setq beg (point) 8246 (setq beg (point)
8353 ;; Relevant keywords already have link property attached 8247 ;; Relevant keywords already have link property attached
8354 props (list 'mouse-face 'highlight 8248 props (list 'mouse-face 'highlight
8355 km-prop idlwave-rinfo-mouse-map 8249 'local-map idlwave-rinfo-mouse-map
8356 'data (cons 'keyword data) 8250 'data (cons 'keyword data)
8357 'help-echo help-echo-kwd 8251 'help-echo help-echo-kwd
8358 'keyword (car x))) 8252 'keyword (car x)))
@@ -8366,7 +8260,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8366 ;; Here entry is (key file (list of type-conses)) 8260 ;; Here entry is (key file (list of type-conses))
8367 (while (setq entry (pop all)) 8261 (while (setq entry (pop all))
8368 (setq props (list 'mouse-face 'highlight 8262 (setq props (list 'mouse-face 'highlight
8369 km-prop idlwave-rinfo-mouse-map 8263 'local-map idlwave-rinfo-mouse-map
8370 'help-echo help-echo-src 8264 'help-echo help-echo-src
8371 'source (list (car (car (nth 2 entry))) ;type 8265 'source (list (car (car (nth 2 entry))) ;type
8372 (nth 1 entry) 8266 (nth 1 entry)
@@ -8471,8 +8365,7 @@ to it."
8471 (add-text-properties beg (point) (list 'face 'bold))) 8365 (add-text-properties beg (point) (list 'face 'bold)))
8472 (when (and file (not (equal file ""))) 8366 (when (and file (not (equal file "")))
8473 (setq beg (point)) 8367 (setq beg (point))
8474 (insert (apply 'abbreviate-file-name 8368 (insert (apply 'abbreviate-file-name (list file)))
8475 (if (featurep 'xemacs) (list file t) (list file))))
8476 (if file-props 8369 (if file-props
8477 (add-text-properties beg (point) file-props))))) 8370 (add-text-properties beg (point) file-props)))))
8478 8371
@@ -8632,10 +8525,9 @@ can be used to detect possible name clashes during this process."
8632 idlwave-user-catalog-routines 8525 idlwave-user-catalog-routines
8633 idlwave-buffer-routines 8526 idlwave-buffer-routines
8634 nil)) 8527 nil))
8635 (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
8636 (keymap (make-sparse-keymap)) 8528 (keymap (make-sparse-keymap))
8637 (props (list 'mouse-face 'highlight 8529 (props (list 'mouse-face 'highlight
8638 km-prop keymap 8530 'local-map keymap
8639 'help-echo "Mouse2: Find source")) 8531 'help-echo "Mouse2: Find source"))
8640 (nroutines (length (or special-routines routines))) 8532 (nroutines (length (or special-routines routines)))
8641 (step (/ nroutines 100)) 8533 (step (/ nroutines 100))
@@ -8658,7 +8550,7 @@ can be used to detect possible name clashes during this process."
8658 (nth 2 b) (car b))))))) 8550 (nth 2 b) (car b)))))))
8659 (message "Sorting routines...done") 8551 (message "Sorting routines...done")
8660 8552
8661 (define-key keymap (if (featurep 'xemacs) [(button2)] [(mouse-2)]) 8553 (define-key keymap [(mouse-2)]
8662 (lambda (ev) 8554 (lambda (ev)
8663 (interactive "e") 8555 (interactive "e")
8664 (mouse-set-point ev) 8556 (mouse-set-point ev)
@@ -9020,23 +8912,6 @@ Assumes that point is at the beginning of the unit as found by
9020 'imenu) 8912 'imenu)
9021 (error nil))))) 8913 (error nil)))))
9022 8914
9023;; Here we hack func-menu.el in order to support this new mode.
9024;; The latest versions of func-menu.el already have this stuff in, so
9025;; we hack only if it is not already there.
9026(when (featurep 'xemacs)
9027 (eval-after-load "func-menu"
9028 '(progn
9029 (or (assq 'idlwave-mode fume-function-name-regexp-alist)
9030 (not (boundp 'fume-function-name-regexp-idl)) ; avoid problems
9031 (setq fume-function-name-regexp-alist
9032 (cons '(idlwave-mode . fume-function-name-regexp-idl)
9033 fume-function-name-regexp-alist)))
9034 (or (assq 'idlwave-mode fume-find-function-name-method-alist)
9035 (not (fboundp 'fume-find-next-idl-function-name)) ; avoid problems
9036 (setq fume-find-function-name-method-alist
9037 (cons '(idlwave-mode . fume-find-next-idl-function-name)
9038 fume-find-function-name-method-alist))))))
9039
9040(defun idlwave-edit-in-idlde () 8915(defun idlwave-edit-in-idlde ()
9041 "Edit the current file in IDL Development environment." 8916 "Edit the current file in IDL Development environment."
9042 (interactive) 8917 (interactive)
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index ff0b6a331bc..127b24cb890 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -214,7 +214,9 @@
214 (defconst perl--syntax-exp-intro-regexp 214 (defconst perl--syntax-exp-intro-regexp
215 (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)" 215 (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
216 (regexp-opt perl--syntax-exp-intro-keywords) 216 (regexp-opt perl--syntax-exp-intro-keywords)
217 "\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*"))) 217 "\\|[?:.,;|&*=!~({[]"
218 "\\|[^-+][-+]" ;Bug#42168: `+' is intro but `++' isn't!
219 "\\|\\(^\\)\\)[ \t\n]*")))
218 220
219(defun perl-syntax-propertize-function (start end) 221(defun perl-syntax-propertize-function (start end)
220 (let ((case-fold-search nil)) 222 (let ((case-fold-search nil))
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index b6161351f0b..8afd5ce7959 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1,8 +1,8 @@
1;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- 1;;; project.el --- Operations on the current project -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2015-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
4;; Version: 0.5.0 4;; Version: 0.5.1
5;; Package-Requires: ((emacs "26.3")) 5;; Package-Requires: ((emacs "26.3") (xref "1.0.2"))
6 6
7;; This is a GNU ELPA :core package. Avoid using functionality that 7;; This is a GNU ELPA :core package. Avoid using functionality that
8;; not compatible with the version of Emacs recorded above. 8;; not compatible with the version of Emacs recorded above.
@@ -731,24 +731,6 @@ pattern to search for."
731 (user-error "No matches for: %s" regexp)) 731 (user-error "No matches for: %s" regexp))
732 xrefs)) 732 xrefs))
733 733
734(defun project--process-file-region (start end program
735 &optional buffer display
736 &rest args)
737 ;; FIXME: This branching shouldn't be necessary, but
738 ;; call-process-region *is* measurably faster, even for a program
739 ;; doing some actual work (for a period of time). Even though
740 ;; call-process-region also creates a temp file internally
741 ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html).
742 (if (not (file-remote-p default-directory))
743 (apply #'call-process-region
744 start end program nil buffer display args)
745 (let ((infile (make-temp-file "ppfr")))
746 (unwind-protect
747 (progn
748 (write-region start end infile nil 'silent)
749 (apply #'process-file program infile buffer display args))
750 (delete-file infile)))))
751
752(defun project--read-regexp () 734(defun project--read-regexp ()
753 (let ((sym (thing-at-point 'symbol))) 735 (let ((sym (thing-at-point 'symbol)))
754 (read-regexp "Find regexp" (and sym (regexp-quote sym))))) 736 (read-regexp "Find regexp" (and sym (regexp-quote sym)))))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 3af55be4a19..d83af83b32e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -283,24 +283,6 @@
283 :link '(emacs-commentary-link "python")) 283 :link '(emacs-commentary-link "python"))
284 284
285 285
286;;; 24.x Compat
287
288
289(eval-and-compile
290 (unless (fboundp 'prog-first-column)
291 (defun prog-first-column ()
292 0))
293 (unless (fboundp 'file-local-name)
294 (defun file-local-name (file)
295 "Return the local name component of FILE.
296It returns a file name which can be used directly as argument of
297`process-file', `start-file-process', or `shell-command'."
298 (or (file-remote-p file 'localname) file))))
299
300;; In Emacs 24.3 and earlier, `define-derived-mode' does not define
301;; the hook variable, it only puts documentation on the symbol.
302(defvar inferior-python-mode-hook)
303
304 286
305;;; Bindings 287;;; Bindings
306 288
@@ -2809,6 +2791,7 @@ variable.
2809 python-shell-comint-watch-for-first-prompt-output-filter 2791 python-shell-comint-watch-for-first-prompt-output-filter
2810 python-comint-postoutput-scroll-to-bottom 2792 python-comint-postoutput-scroll-to-bottom
2811 comint-watch-for-password-prompt)) 2793 comint-watch-for-password-prompt))
2794 (setq-local comint-highlight-input nil)
2812 (set (make-local-variable 'compilation-error-regexp-alist) 2795 (set (make-local-variable 'compilation-error-regexp-alist)
2813 python-shell-compilation-regexp-alist) 2796 python-shell-compilation-regexp-alist)
2814 (add-hook 'completion-at-point-functions 2797 (add-hook 'completion-at-point-functions
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index f9b069fd4e5..0f2c9431f6e 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -115,6 +115,8 @@ treat nomenclature boundaries as word boundaries."
115 (when subword-mode (superword-mode -1)) 115 (when subword-mode (superword-mode -1))
116 (subword-setup-buffer)) 116 (subword-setup-buffer))
117 117
118;; This is defined also in cc-cmds.el, but as obsolete since 24.3.
119;; Let's keep this until the other one can also be removed.
118(define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2") 120(define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2")
119 121
120;;;###autoload 122;;;###autoload
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 3e3a37f6da5..bbf899e7017 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1,8 +1,8 @@
1;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- 1;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*-
2 2
3;; Copyright (C) 2014-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
4;; Version: 1.0.1 4;; Version: 1.0.2
5;; Package-Requires: ((emacs "26.3") (project "0.1.1")) 5;; Package-Requires: ((emacs "26.3"))
6 6
7;; This is a GNU ELPA :core package. Avoid functionality that is not 7;; This is a GNU ELPA :core package. Avoid functionality that is not
8;; compatible with the version of Emacs recorded above. 8;; compatible with the version of Emacs recorded above.
@@ -263,13 +263,16 @@ be found, return nil.
263 263
264The default implementation uses `semantic-symref-tool-alist' to 264The default implementation uses `semantic-symref-tool-alist' to
265find a search tool; by default, this uses \"find | grep\" in the 265find a search tool; by default, this uses \"find | grep\" in the
266`project-current' roots." 266current project's main and external roots."
267 (mapcan 267 (mapcan
268 (lambda (dir) 268 (lambda (dir)
269 (xref-references-in-directory identifier dir)) 269 (xref-references-in-directory identifier dir))
270 (let ((pr (project-current t))) 270 (let ((pr (project-current t)))
271 (cons 271 (cons
272 (project-root pr) 272 (if (fboundp 'project-root)
273 (project-root pr)
274 (with-no-warnings
275 (project-roots pr)))
273 (project-external-roots pr))))) 276 (project-external-roots pr)))))
274 277
275(cl-defgeneric xref-backend-apropos (backend pattern) 278(cl-defgeneric xref-backend-apropos (backend pattern)
@@ -1281,13 +1284,13 @@ FILES must be a list of absolute file names."
1281 (insert (mapconcat #'identity files "\0")) 1284 (insert (mapconcat #'identity files "\0"))
1282 (setq default-directory dir) 1285 (setq default-directory dir)
1283 (setq status 1286 (setq status
1284 (project--process-file-region (point-min) 1287 (xref--process-file-region (point-min)
1285 (point-max) 1288 (point-max)
1286 shell-file-name 1289 shell-file-name
1287 output 1290 output
1288 nil 1291 nil
1289 shell-command-switch 1292 shell-command-switch
1290 command))) 1293 command)))
1291 (goto-char (point-min)) 1294 (goto-char (point-min))
1292 (when (and (/= (point-min) (point-max)) 1295 (when (and (/= (point-min) (point-max))
1293 (not (looking-at grep-re)) 1296 (not (looking-at grep-re))
@@ -1302,6 +1305,24 @@ FILES must be a list of absolute file names."
1302 hits))) 1305 hits)))
1303 (xref--convert-hits (nreverse hits) regexp))) 1306 (xref--convert-hits (nreverse hits) regexp)))
1304 1307
1308(defun xref--process-file-region ( start end program
1309 &optional buffer display
1310 &rest args)
1311 ;; FIXME: This branching shouldn't be necessary, but
1312 ;; call-process-region *is* measurably faster, even for a program
1313 ;; doing some actual work (for a period of time). Even though
1314 ;; call-process-region also creates a temp file internally
1315 ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html).
1316 (if (not (file-remote-p default-directory))
1317 (apply #'call-process-region
1318 start end program nil buffer display args)
1319 (let ((infile (make-temp-file "ppfr")))
1320 (unwind-protect
1321 (progn
1322 (write-region start end infile nil 'silent)
1323 (apply #'process-file program infile buffer display args))
1324 (delete-file infile)))))
1325
1305(defun xref--rgrep-command (regexp files dir ignores) 1326(defun xref--rgrep-command (regexp files dir ignores)
1306 (require 'find-dired) ; for `find-name-arg' 1327 (require 'find-dired) ; for `find-name-arg'
1307 (defvar grep-find-template) 1328 (defvar grep-find-template)
diff --git a/lisp/ps-def.el b/lisp/ps-def.el
index f532511b977..65e8011f771 100644
--- a/lisp/ps-def.el
+++ b/lisp/ps-def.el
@@ -58,21 +58,11 @@
58(define-obsolete-function-alias 'ps-frame-parameter #'frame-parameter "28.1") 58(define-obsolete-function-alias 'ps-frame-parameter #'frame-parameter "28.1")
59 59
60;; Return t if the device (which can be changed during an emacs session) can 60;; Return t if the device (which can be changed during an emacs session) can
61;; handle colors. This function is not yet implemented for GNU emacs. 61;; handle colors.
62(defun ps-color-device () 62(defun ps-color-device ()
63 (if (fboundp 'color-values) 63 (color-values "Green"))
64 (funcall 'color-values "Green") 64
65 t)) 65(define-obsolete-function-alias 'ps-color-values #'color-values "28.1")
66
67
68(defun ps-color-values (x-color)
69 (cond
70 ((fboundp 'color-values)
71 (funcall 'color-values x-color))
72 ((fboundp 'x-color-values)
73 (funcall 'x-color-values x-color))
74 (t
75 (error "No available function to determine X color values"))))
76 66
77 67
78(defun ps-face-bold-p (face) 68(defun ps-face-bold-p (face)
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 17b486bca11..1ca4a23ab2c 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -3856,7 +3856,7 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'."
3856(defun ps-color-scale (color) 3856(defun ps-color-scale (color)
3857 ;; Scale 16-bit X-COLOR-VALUE to PostScript color value in [0, 1] interval. 3857 ;; Scale 16-bit X-COLOR-VALUE to PostScript color value in [0, 1] interval.
3858 (mapcar #'(lambda (value) (/ value ps-print-color-scale)) 3858 (mapcar #'(lambda (value) (/ value ps-print-color-scale))
3859 (ps-color-values color))) 3859 (color-values color)))
3860 3860
3861 3861
3862(defun ps-face-underlined-p (face) 3862(defun ps-face-underlined-p (face)
@@ -5752,7 +5752,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5752 ;; evaluated at dump-time because X isn't initialized. 5752 ;; evaluated at dump-time because X isn't initialized.
5753 ps-color-p (and ps-print-color-p (ps-color-device)) 5753 ps-color-p (and ps-print-color-p (ps-color-device))
5754 ps-print-color-scale (if ps-color-p 5754 ps-print-color-scale (if ps-color-p
5755 (float (car (ps-color-values "white"))) 5755 (float (car (color-values "white")))
5756 1.0) 5756 1.0)
5757 ps-default-background (ps-rgb-color 5757 ps-default-background (ps-rgb-color
5758 (cond 5758 (cond
@@ -6275,10 +6275,6 @@ If FACE is not a valid face name, use default face."
6275 (goto-char to)) 6275 (goto-char to))
6276 6276
6277 6277
6278;; Ensure that face-list is fbound.
6279(or (fboundp 'face-list) (defalias 'face-list 'list-faces))
6280
6281
6282(defun ps-build-reference-face-lists () 6278(defun ps-build-reference-face-lists ()
6283 (setq ps-print-face-alist nil) 6279 (setq ps-print-face-alist nil)
6284 (if ps-auto-font-detect 6280 (if ps-auto-font-detect
diff --git a/lisp/savehist.el b/lisp/savehist.el
index fcfdb47c7e8..4e52efe7f1a 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Hrvoje Nikšić <hrvoje.niksic@avl.com> 5;; Author: Hrvoje Nikšić <hrvoje.niksic@avl.com>
6;; Maintainer: emacs-devel@gnu.org 6;; Maintainer: emacs-devel@gnu.org
7;; Keywords: minibuffer 7;; Keywords: convenience, minibuffer
8;; Version: 24 8;; Version: 24
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -27,7 +27,7 @@
27;; Many editors (e.g. Vim) have the feature of saving minibuffer 27;; Many editors (e.g. Vim) have the feature of saving minibuffer
28;; history to an external file after exit. This package provides the 28;; history to an external file after exit. This package provides the
29;; same feature in Emacs. When set up, it saves recorded minibuffer 29;; same feature in Emacs. When set up, it saves recorded minibuffer
30;; histories to a file (`~/.emacs-history' by default). Additional 30;; histories to a file (`~/.emacs.d/history' by default). Additional
31;; variables may be specified by customizing 31;; variables may be specified by customizing
32;; `savehist-additional-variables'. 32;; `savehist-additional-variables'.
33 33
diff --git a/lisp/shell.el b/lisp/shell.el
index f5e18bbc728..9667dab2afd 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -990,9 +990,6 @@ this feature; see the function `dirtrack-mode'."
990 (add-hook 'comint-input-filter-functions #'shell-directory-tracker nil t) 990 (add-hook 'comint-input-filter-functions #'shell-directory-tracker nil t)
991 (remove-hook 'comint-input-filter-functions #'shell-directory-tracker t))) 991 (remove-hook 'comint-input-filter-functions #'shell-directory-tracker t)))
992 992
993(define-obsolete-function-alias 'shell-dirtrack-toggle #'shell-dirtrack-mode
994 "23.1")
995
996(defun shell-cd (dir) 993(defun shell-cd (dir)
997 "Do normal `cd' to DIR, and set `list-buffers-directory'." 994 "Do normal `cd' to DIR, and set `list-buffers-directory'."
998 (cd dir) 995 (cd dir)
@@ -1038,25 +1035,41 @@ command again."
1038 (accept-process-output proc) 1035 (accept-process-output proc)
1039 (goto-char pt))) 1036 (goto-char pt)))
1040 (goto-char pmark) (delete-char 1) ; remove the extra newline 1037 (goto-char pmark) (delete-char 1) ; remove the extra newline
1041 ;; That's the dirlist. grab it & parse it. 1038 ;; That's the dirlist. Grab it & parse it.
1042 (let* ((dl (buffer-substring (match-beginning 2) (1- (match-end 2)))) 1039 (let* ((dls (buffer-substring-no-properties
1043 (dl-len (length dl)) 1040 (match-beginning 0) (1- (match-end 0))))
1044 (ds '()) ; new dir stack 1041 (dlsl nil)
1045 (i 0)) 1042 (pos 0)
1046 (while (< i dl-len) 1043 (ds nil))
1047 ;; regexp = optional whitespace, (non-whitespace), optional whitespace 1044 ;; Split the dirlist into whitespace and non-whitespace chunks.
1048 (string-match "\\s *\\(\\S +\\)\\s *" dl i) ; pick off next dir 1045 ;; dlsl will be a reversed list of tokens.
1049 (setq ds (cons (concat comint-file-name-prefix 1046 (while (string-match "\\(\\S-+\\|\\s-+\\)" dls pos)
1050 (substring dl (match-beginning 1) 1047 (push (match-string 1 dls) dlsl)
1051 (match-end 1))) 1048 (setq pos (match-end 1)))
1052 ds)) 1049
1053 (setq i (match-end 0))) 1050 ;; Prepend trailing entries until they form an existing directory,
1054 (let ((ds (nreverse ds))) 1051 ;; whitespace and all. Discard the next whitespace and repeat.
1055 (with-demoted-errors "Couldn't cd: %s" 1052 (while dlsl
1056 (shell-cd (car ds)) 1053 (let ((newelt "")
1057 (setq shell-dirstack (cdr ds) 1054 tem1 tem2)
1058 shell-last-dir (car shell-dirstack)) 1055 (while newelt
1059 (shell-dirstack-message))))) 1056 ;; We need tem1 because we don't want to prepend
1057 ;; `comint-file-name-prefix' repeatedly into newelt via tem2.
1058 (setq tem1 (pop dlsl)
1059 tem2 (concat comint-file-name-prefix tem1 newelt))
1060 (cond ((file-directory-p tem2)
1061 (push tem2 ds)
1062 (when (string= " " (car dlsl))
1063 (pop dlsl))
1064 (setq newelt nil))
1065 (t
1066 (setq newelt (concat tem1 newelt)))))))
1067
1068 (with-demoted-errors "Couldn't cd: %s"
1069 (shell-cd (car ds))
1070 (setq shell-dirstack (cdr ds)
1071 shell-last-dir (car shell-dirstack))
1072 (shell-dirstack-message))))
1060 (if started-at-pmark (goto-char (marker-position pmark))))) 1073 (if started-at-pmark (goto-char (marker-position pmark)))))
1061 1074
1062;; For your typing convenience: 1075;; For your typing convenience:
diff --git a/lisp/simple.el b/lisp/simple.el
index 6f72c3b81b9..f08015372af 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -247,7 +247,7 @@ from which next-error navigated, and a target buffer TO-BUFFER."
247 extra-test-exclusive) 247 extra-test-exclusive)
248 "Try the current buffer when outside navigation. 248 "Try the current buffer when outside navigation.
249But return nil if we navigated to the current buffer by the means 249But return nil if we navigated to the current buffer by the means
250of `next-error' command. Othewise, return it if it's next-error 250of `next-error' command. Otherwise, return it if it's next-error
251capable." 251capable."
252 ;; Check that next-error-buffer has no buffer-local value 252 ;; Check that next-error-buffer has no buffer-local value
253 ;; (i.e. we never navigated to the current buffer from another), 253 ;; (i.e. we never navigated to the current buffer from another),
@@ -1323,7 +1323,9 @@ If called from Lisp, return the number of words between START and
1323END, without printing any message." 1323END, without printing any message."
1324 (interactive (list nil nil)) 1324 (interactive (list nil nil))
1325 (cond ((not (called-interactively-p 'any)) 1325 (cond ((not (called-interactively-p 'any))
1326 (let ((words 0)) 1326 (let ((words 0)
1327 ;; Count across field boundaries. (Bug#41761)
1328 (inhibit-field-text-motion t))
1327 (save-excursion 1329 (save-excursion
1328 (save-restriction 1330 (save-restriction
1329 (narrow-to-region start end) 1331 (narrow-to-region start end)
@@ -1556,6 +1558,8 @@ in *Help* buffer. See also the command `describe-char'."
1556 ;; Might as well bind TAB to completion, since inserting a TAB char is 1558 ;; Might as well bind TAB to completion, since inserting a TAB char is
1557 ;; much too rarely useful. 1559 ;; much too rarely useful.
1558 (define-key m "\t" 'completion-at-point) 1560 (define-key m "\t" 'completion-at-point)
1561 (define-key m "\r" 'read--expression-try-read)
1562 (define-key m "\n" 'read--expression-try-read)
1559 (set-keymap-parent m minibuffer-local-map) 1563 (set-keymap-parent m minibuffer-local-map)
1560 m)) 1564 m))
1561 1565
@@ -1652,8 +1656,6 @@ function `read-from-minibuffer'."
1652 (set-syntax-table emacs-lisp-mode-syntax-table) 1656 (set-syntax-table emacs-lisp-mode-syntax-table)
1653 (add-hook 'completion-at-point-functions 1657 (add-hook 'completion-at-point-functions
1654 #'elisp-completion-at-point nil t) 1658 #'elisp-completion-at-point nil t)
1655 (local-set-key "\r" 'read--expression-try-read)
1656 (local-set-key "\n" 'read--expression-try-read)
1657 (run-hooks 'eval-expression-minibuffer-setup-hook)) 1659 (run-hooks 'eval-expression-minibuffer-setup-hook))
1658 (read-from-minibuffer prompt initial-contents 1660 (read-from-minibuffer prompt initial-contents
1659 read-expression-map t 1661 read-expression-map t
@@ -1845,9 +1847,15 @@ to get different commands to edit and resubmit."
1845 (lambda () 1847 (lambda ()
1846 ;; Get a command name at point in the original buffer 1848 ;; Get a command name at point in the original buffer
1847 ;; to propose it after M-n. 1849 ;; to propose it after M-n.
1848 (with-current-buffer (window-buffer (minibuffer-selected-window)) 1850 (let ((def (with-current-buffer
1849 (and (commandp (function-called-at-point)) 1851 (window-buffer (minibuffer-selected-window))
1850 (format "%S" (function-called-at-point))))))) 1852 (and (commandp (function-called-at-point))
1853 (format "%S" (function-called-at-point)))))
1854 (all (sort (minibuffer-default-add-completions)
1855 #'string<)))
1856 (if def
1857 (cons def (delete def all))
1858 all)))))
1851 ;; Read a string, completing from and restricting to the set of 1859 ;; Read a string, completing from and restricting to the set of
1852 ;; all defined commands. Don't provide any initial input. 1860 ;; all defined commands. Don't provide any initial input.
1853 ;; Save the command read on the extended-command history list. 1861 ;; Save the command read on the extended-command history list.
diff --git a/lisp/so-long.el b/lisp/so-long.el
index f2c078ba841..f8a5cc920d9 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -255,8 +255,7 @@
255;; `so-long-mode', completely bypassing the automated decision process. 255;; `so-long-mode', completely bypassing the automated decision process.
256;; Refer to M-: (info "(emacs) Specifying File Variables") RET 256;; Refer to M-: (info "(emacs) Specifying File Variables") RET
257;; 257;;
258;; If so-long itself is causing problems, it can be inhibited by setting the 258;; If so-long itself causes problems, disable the automated behaviour with
259;; `so-long-enabled' variable to nil, or by disabling the global mode with
260;; M-- M-x global-so-long-mode, or M-: (global-so-long-mode 0) 259;; M-- M-x global-so-long-mode, or M-: (global-so-long-mode 0)
261 260
262;; * Example configuration 261;; * Example configuration
@@ -282,6 +281,43 @@
282;; '((show-trailing-whitespace . nil) 281;; '((show-trailing-whitespace . nil)
283;; (truncate-lines . nil)))) 282;; (truncate-lines . nil))))
284 283
284;; * Mode-specific configuration
285;; -----------------------------
286;; The `so-long-predicate' function is called in the context of the buffer's
287;; original major mode, and therefore major mode hooks can be used to control
288;; the criteria for calling `so-long' in any given mode (plus its derivatives)
289;; by setting buffer-local values for the variables in question. This includes
290;; `so-long-predicate' itself, as well as any variables used by the predicate
291;; when determining the result. By default this means `so-long-max-lines',
292;; `so-long-skip-leading-comments', and `so-long-threshold'. E.g.:
293;;
294;; (add-hook 'js-mode-hook 'my-js-mode-hook)
295;;
296;; (defun my-js-mode-hook ()
297;; "Custom `js-mode' behaviours."
298;; (setq-local so-long-max-lines 100)
299;; (setq-local so-long-threshold 1000))
300;;
301;; `so-long-variable-overrides' and `so-long-minor-modes' may also be given
302;; buffer-local values in order to apply different settings to different types
303;; of file. For example, the Bidirectional Parentheses Algorithm does not apply
304;; to `<' and `>' characters by default, and therefore one might prefer to not
305;; set `bidi-inhibit-bpa' in XML files, on the basis that XML files with long
306;; lines are less likely to trigger BPA-related performance problems:
307;;
308;; (add-hook 'nxml-mode-hook 'my-nxml-mode-hook)
309;;
310;; (defun my-nxml-mode-hook ()
311;; "Custom `nxml-mode' behaviours."
312;; (require 'so-long)
313;; (setq-local so-long-variable-overrides
314;; (remove '(bidi-inhibit-bpa . t) so-long-variable-overrides)))
315;;
316;; Finally, note that setting `so-long-target-modes' to nil buffer-locally in
317;; a major mode hook would prevent that mode from ever being targeted. With
318;; `prog-mode' being targeted by default, specific derivatives of `prog-mode'
319;; could therefore be un-targeted if desired.
320
285;; * Other ways of using so-long 321;; * Other ways of using so-long
286;; ----------------------------- 322;; -----------------------------
287;; It may prove useful to automatically invoke major mode `so-long-mode' for 323;; It may prove useful to automatically invoke major mode `so-long-mode' for
@@ -376,7 +412,6 @@
376;; - Added mode-line indicator, user option `so-long-mode-line-label', 412;; - Added mode-line indicator, user option `so-long-mode-line-label',
377;; and faces `so-long-mode-line-active', `so-long-mode-line-inactive'. 413;; and faces `so-long-mode-line-active', `so-long-mode-line-inactive'.
378;; - New help commands `so-long-commentary' and `so-long-customize'. 414;; - New help commands `so-long-commentary' and `so-long-customize'.
379;; - Renamed `so-long-mode-enabled' to `so-long-enabled'.
380;; - Refactored the default hook values using variable overrides 415;; - Refactored the default hook values using variable overrides
381;; (and returning all the hooks to nil default values). 416;; (and returning all the hooks to nil default values).
382;; - Performance improvements for `so-long-detected-long-line-p'. 417;; - Performance improvements for `so-long-detected-long-line-p'.
@@ -416,9 +451,14 @@
416(declare-function longlines-mode "longlines") 451(declare-function longlines-mode "longlines")
417(defvar longlines-mode) 452(defvar longlines-mode)
418(defvar so-long-enabled nil 453(defvar so-long-enabled nil
419 "Set to nil to prevent `so-long' from being triggered automatically. 454 ;; This was initially a renaming of the old `so-long-mode-enabled' and
420 455 ;; documented as "Set to nil to prevent `so-long' from being triggered
421Has no effect if `global-so-long-mode' is not enabled.") 456 ;; automatically."; however `so-long--ensure-enabled' may forcibly re-enable
457 ;; it contrary to the user's expectations, so for the present this should be
458 ;; considered internal-use only (with `global-so-long-mode' the interface
459 ;; for enabling or disabling the automated behaviour). FIXME: Establish a
460 ;; way to support the original use-case, or rename to `so-long--enabled'.
461 "Internal use. Non-nil when any so-long functionality has been used.")
422 462
423(defvar-local so-long--active nil ; internal use 463(defvar-local so-long--active nil ; internal use
424 "Non-nil when `so-long' mitigations are in effect.") 464 "Non-nil when `so-long' mitigations are in effect.")
@@ -886,9 +926,15 @@ buffer-local."
886Stores the existing value for each entry in `so-long-variable-overrides'. 926Stores the existing value for each entry in `so-long-variable-overrides'.
887Stores the name of each enabled mode from the list `so-long-minor-modes'. 927Stores the name of each enabled mode from the list `so-long-minor-modes'.
888 928
929The lists themselves are also remembered, so that major mode hooks can
930provide buffer-local modifications which are still accessible after changing
931to `so-long-mode'.
932
889If RESET is non-nil, remove any existing values before storing the new ones." 933If RESET is non-nil, remove any existing values before storing the new ones."
890 (when reset 934 (when reset
891 (setq so-long-original-values nil)) 935 (setq so-long-original-values nil))
936 (so-long-remember 'so-long-variable-overrides)
937 (so-long-remember 'so-long-minor-modes)
892 (dolist (ovar so-long-variable-overrides) 938 (dolist (ovar so-long-variable-overrides)
893 (so-long-remember (car ovar))) 939 (so-long-remember (car ovar)))
894 (dolist (mode so-long-minor-modes) 940 (dolist (mode so-long-minor-modes)
@@ -1288,7 +1334,7 @@ Calls `so-long-disable-minor-modes' and `so-long-override-variables'."
1288 1334
1289(defun so-long-disable-minor-modes () 1335(defun so-long-disable-minor-modes ()
1290 "Disable any active minor modes listed in `so-long-minor-modes'." 1336 "Disable any active minor modes listed in `so-long-minor-modes'."
1291 (dolist (mode so-long-minor-modes) 1337 (dolist (mode (so-long-original 'so-long-minor-modes))
1292 (when (and (boundp mode) mode) 1338 (when (and (boundp mode) mode)
1293 (funcall mode 0)))) 1339 (funcall mode 0))))
1294 1340
@@ -1304,7 +1350,7 @@ The modes are enabled in accordance with what was remembered in `so-long'."
1304 1350
1305(defun so-long-override-variables () 1351(defun so-long-override-variables ()
1306 "Set the buffer-local values defined by `so-long-variable-overrides'." 1352 "Set the buffer-local values defined by `so-long-variable-overrides'."
1307 (dolist (ovar so-long-variable-overrides) 1353 (dolist (ovar (so-long-original 'so-long-variable-overrides))
1308 (set (make-local-variable (car ovar)) (cdr ovar)))) 1354 (set (make-local-variable (car ovar)) (cdr ovar))))
1309 1355
1310(defun so-long-restore-variables () 1356(defun so-long-restore-variables ()
@@ -1879,7 +1925,7 @@ If it appears in `%s', you should remove it."
1879; LocalWords: defadvice nadvice whitespace ie bos eos eobp origmode un Un setq 1925; LocalWords: defadvice nadvice whitespace ie bos eos eobp origmode un Un setq
1880; LocalWords: docstring auf Wiedersehen longlines alist autoload Refactored Inc 1926; LocalWords: docstring auf Wiedersehen longlines alist autoload Refactored Inc
1881; LocalWords: MERCHANTABILITY RET REGEXP VAR ELPA WS mitigations EmacsWiki eval 1927; LocalWords: MERCHANTABILITY RET REGEXP VAR ELPA WS mitigations EmacsWiki eval
1882; LocalWords: rx filename filenames bidi bpa 1928; LocalWords: rx filename filenames js defun bidi bpa prog FIXME
1883 1929
1884;; So long, farewell, auf Wiedersehen, goodbye 1930;; So long, farewell, auf Wiedersehen, goodbye
1885;; You have to go, this code is minified 1931;; You have to go, this code is minified
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index e9c15b71ce6..5b98eb36bb9 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -3240,19 +3240,21 @@ With universal argument ARG, flush cached data."
3240 "Expand the line under the cursor and all descendants. 3240 "Expand the line under the cursor and all descendants.
3241Optional argument ARG indicates that any cache should be flushed." 3241Optional argument ARG indicates that any cache should be flushed."
3242 (interactive "P") 3242 (interactive "P")
3243 (speedbar-expand-line arg) 3243 (save-restriction
3244 ;; Now, inside the area expanded here, expand all subnodes of 3244 (narrow-to-region (line-beginning-position)
3245 ;; the same descendant type. 3245 (line-beginning-position 2))
3246 (save-excursion 3246 (speedbar-expand-line arg)
3247 (speedbar-next 1) ;; Move into the list. 3247 ;; Now, inside the area expanded here, expand all subnodes of
3248 (let ((err nil)) 3248 ;; the same descendant type.
3249 (while (not err) 3249 (save-excursion
3250 (condition-case nil 3250 (speedbar-next 1) ;; Move into the list.
3251 (progn 3251 (let ((err nil))
3252 (speedbar-expand-line-descendants arg) 3252 (while (not err)
3253 (speedbar-restricted-next 1)) 3253 (condition-case nil
3254 (error (setq err t)))))) 3254 (progn
3255 ) 3255 (speedbar-expand-line-descendants arg)
3256 (speedbar-restricted-next 1))
3257 (error (setq err t))))))))
3256 3258
3257(defun speedbar-contract-line-descendants () 3259(defun speedbar-contract-line-descendants ()
3258 "Expand the line under the cursor and all descendants." 3260 "Expand the line under the cursor and all descendants."
diff --git a/lisp/startup.el b/lisp/startup.el
index e58f27e7ebc..536a3de17a7 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -537,6 +537,9 @@ It is the default value of the variable `top-level'."
537 (setq user-emacs-directory 537 (setq user-emacs-directory
538 (startup--xdg-or-homedot startup--xdg-config-home-emacs nil)) 538 (startup--xdg-or-homedot startup--xdg-config-home-emacs nil))
539 539
540 (when (boundp 'comp-eln-load-path)
541 (setq comp-eln-load-path (cons (concat user-emacs-directory "eln-cache/")
542 comp-eln-load-path)))
540 ;; Look in each dir in load-path for a subdirs.el file. If we 543 ;; Look in each dir in load-path for a subdirs.el file. If we
541 ;; find one, load it, which will add the appropriate subdirs of 544 ;; find one, load it, which will add the appropriate subdirs of
542 ;; that dir into load-path. This needs to be done before setting 545 ;; that dir into load-path. This needs to be done before setting
@@ -649,11 +652,12 @@ It is the default value of the variable `top-level'."
649 ;; Use FOO/., so that if FOO is a symlink, file-attributes 652 ;; Use FOO/., so that if FOO is a symlink, file-attributes
650 ;; describes the directory linked to, not FOO itself. 653 ;; describes the directory linked to, not FOO itself.
651 (or (and default-directory 654 (or (and default-directory
652 (equal (file-attributes 655 (ignore-errors
653 (concat (file-name-as-directory pwd) ".")) 656 (equal (file-attributes
654 (file-attributes 657 (concat (file-name-as-directory pwd) "."))
655 (concat (file-name-as-directory default-directory) 658 (file-attributes
656 ".")))) 659 (concat (file-name-as-directory default-directory)
660 ".")))))
657 (setq process-environment 661 (setq process-environment
658 (delete (concat "PWD=" pwd) 662 (delete (concat "PWD=" pwd)
659 process-environment))))) 663 process-environment)))))
diff --git a/lisp/subr.el b/lisp/subr.el
index 0ae636b68b4..093cacc8cb6 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1588,11 +1588,6 @@ be a list of the form returned by `event-start' and `event-end'."
1588(make-obsolete 'string-as-multibyte "use `decode-coding-string'." "26.1") 1588(make-obsolete 'string-as-multibyte "use `decode-coding-string'." "26.1")
1589(make-obsolete 'string-make-multibyte "use `decode-coding-string'." "26.1") 1589(make-obsolete 'string-make-multibyte "use `decode-coding-string'." "26.1")
1590 1590
1591(defun forward-point (n)
1592 "Return buffer position N characters after (before if N negative) point."
1593 (declare (obsolete "use (+ (point) N) instead." "23.1"))
1594 (+ (point) n))
1595
1596(defun log10 (x) 1591(defun log10 (x)
1597 "Return (log X 10), the log base 10 of X." 1592 "Return (log X 10), the log base 10 of X."
1598 (declare (obsolete log "24.4")) 1593 (declare (obsolete log "24.4"))
@@ -1617,8 +1612,6 @@ be a list of the form returned by `event-start' and `event-end'."
1617(make-obsolete 'set-window-redisplay-end-trigger nil "23.1") 1612(make-obsolete 'set-window-redisplay-end-trigger nil "23.1")
1618 1613
1619(make-obsolete 'run-window-configuration-change-hook nil "27.1") 1614(make-obsolete 'run-window-configuration-change-hook nil "27.1")
1620(make-obsolete 'process-filter-multibyte-p nil "23.1")
1621(make-obsolete 'set-process-filter-multibyte nil "23.1")
1622 1615
1623(make-obsolete-variable 'command-debug-status 1616(make-obsolete-variable 'command-debug-status
1624 "expect it to be removed in a future version." "25.2") 1617 "expect it to be removed in a future version." "25.2")
@@ -1661,7 +1654,8 @@ be a list of the form returned by `event-start' and `event-end'."
1661(defalias 'point-at-eol 'line-end-position) 1654(defalias 'point-at-eol 'line-end-position)
1662(defalias 'point-at-bol 'line-beginning-position) 1655(defalias 'point-at-bol 'line-beginning-position)
1663 1656
1664(defalias 'user-original-login-name 'user-login-name) 1657(define-obsolete-function-alias 'user-original-login-name
1658 'user-login-name "28.1")
1665 1659
1666 1660
1667;;;; Hook manipulation functions. 1661;;;; Hook manipulation functions.
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el
index a1af53d8c46..4feab71401e 100644
--- a/lisp/t-mouse.el
+++ b/lisp/t-mouse.el
@@ -63,8 +63,6 @@
63 (set-terminal-parameter nil 'gpm-mouse-active nil)) 63 (set-terminal-parameter nil 'gpm-mouse-active nil))
64 64
65;;;###autoload 65;;;###autoload
66(define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1")
67;;;###autoload
68(define-minor-mode gpm-mouse-mode 66(define-minor-mode gpm-mouse-mode
69 "Toggle mouse support in GNU/Linux consoles (GPM Mouse mode). 67 "Toggle mouse support in GNU/Linux consoles (GPM Mouse mode).
70 68
diff --git a/lisp/term.el b/lisp/term.el
index b990c83cfcb..99f1bf4f54f 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -467,6 +467,11 @@ Customize this option to nil if you want the previous behavior."
467 :type 'boolean 467 :type 'boolean
468 :group 'term) 468 :group 'term)
469 469
470(defcustom term-set-terminal-size nil
471 "If non-nil, set the LINES and COLUMNS environment variables."
472 :type 'boolean
473 :version "28.1")
474
470(defcustom term-char-mode-point-at-process-mark t 475(defcustom term-char-mode-point-at-process-mark t
471 "If non-nil, keep point at the process mark in char mode. 476 "If non-nil, keep point at the process mark in char mode.
472 477
@@ -501,6 +506,14 @@ This variable is buffer-local."
501 :type 'boolean 506 :type 'boolean
502 :group 'term) 507 :group 'term)
503 508
509(defcustom term-scroll-snap-to-bottom t
510 "Control whether to keep the prompt at the bottom of the window.
511If non-nil, when the prompt is visible within the window, then
512scroll so that the prompt is on the bottom on any input or
513output."
514 :version "28.1"
515 :type 'boolean)
516
504(defcustom term-scroll-show-maximum-output nil 517(defcustom term-scroll-show-maximum-output nil
505 "Controls how interpreter output causes window to scroll. 518 "Controls how interpreter output causes window to scroll.
506If non-nil, then show the maximum output when the window is scrolled. 519If non-nil, then show the maximum output when the window is scrolled.
@@ -1543,9 +1556,12 @@ Nil if unknown.")
1543 (format term-termcap-format "TERMCAP=" 1556 (format term-termcap-format "TERMCAP="
1544 term-term-name term-height term-width) 1557 term-term-name term-height term-width)
1545 1558
1546 (format "INSIDE_EMACS=%s,term:%s" emacs-version term-protocol-version) 1559 (format "INSIDE_EMACS=%s,term:%s"
1547 (format "LINES=%d" term-height) 1560 emacs-version term-protocol-version))
1548 (format "COLUMNS=%d" term-width)) 1561 (when term-set-terminal-size
1562 (list
1563 (format "LINES=%d" term-height)
1564 (format "COLUMNS=%d" term-width)))
1549 process-environment)) 1565 process-environment))
1550 (process-connection-type t) 1566 (process-connection-type t)
1551 ;; We should suppress conversion of end-of-line format. 1567 ;; We should suppress conversion of end-of-line format.
@@ -3108,15 +3124,19 @@ See `term-prompt-regexp'."
3108 (or (eq scroll 'this) (not save-point))) 3124 (or (eq scroll 'this) (not save-point)))
3109 (and (eq scroll 'others) 3125 (and (eq scroll 'others)
3110 (not (eq selected win)))) 3126 (not (eq selected win))))
3111 (goto-char term-home-marker) 3127 (when term-scroll-snap-to-bottom
3112 (recenter 0) 3128 (goto-char term-home-marker)
3129 (recenter 0))
3113 (goto-char (process-mark proc)) 3130 (goto-char (process-mark proc))
3114 (if (not (pos-visible-in-window-p (point) win)) 3131 (if (not (pos-visible-in-window-p (point) win))
3115 (recenter -1))) 3132 (recenter -1)))
3116 ;; Optionally scroll so that the text 3133 ;; Optionally scroll so that the text
3117 ;; ends at the bottom of the window. 3134 ;; ends at the bottom of the window.
3118 (when (and term-scroll-show-maximum-output 3135 (when (and term-scroll-show-maximum-output
3119 (>= (point) (process-mark proc))) 3136 (>= (point) (process-mark proc))
3137 (or term-scroll-snap-to-bottom
3138 (not (pos-visible-in-window-p
3139 (point-max) win))))
3120 (save-excursion 3140 (save-excursion
3121 (goto-char (point-max)) 3141 (goto-char (point-max))
3122 (recenter -1))))) 3142 (recenter -1)))))
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 6b9716ca307..f15337818b0 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -78,12 +78,8 @@
78(require 'dnd) 78(require 'dnd)
79(require 'w32-vars) 79(require 'w32-vars)
80 80
81;; Keep an obsolete alias for w32-focus-frame and w32-select-font in case
82;; they are used by code outside Emacs.
83(define-obsolete-function-alias 'w32-focus-frame 'x-focus-frame "23.1")
84(declare-function x-select-font "w32font.c" 81(declare-function x-select-font "w32font.c"
85 (&optional frame exclude-proportional)) 82 (&optional frame exclude-proportional))
86(define-obsolete-function-alias 'w32-select-font 'x-select-font "23.1")
87 83
88(defvar w32-color-map) ;; defined in w32fns.c 84(defvar w32-color-map) ;; defined in w32fns.c
89(make-obsolete 'w32-default-color-map nil "24.1") 85(make-obsolete 'w32-default-color-map nil "24.1")
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 0018b89d858..910bd7dbb9d 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -3445,6 +3445,7 @@ if that value is non-nil.
3445 (set (make-local-variable 'syntax-propertize-function) 3445 (set (make-local-variable 'syntax-propertize-function)
3446 (syntax-propertize-via-font-lock 3446 (syntax-propertize-via-font-lock
3447 bibtex-font-lock-syntactic-keywords)) 3447 bibtex-font-lock-syntactic-keywords))
3448 (bibtex-set-dialect nil t)
3448 ;; Allow `bibtex-dialect' as a file-local variable. 3449 ;; Allow `bibtex-dialect' as a file-local variable.
3449 (add-hook 'hack-local-variables-hook #'bibtex-set-dialect nil t)) 3450 (add-hook 'hack-local-variables-hook #'bibtex-set-dialect nil t))
3450 3451
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 39a1b488a74..23f96d7e0ee 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -57,7 +57,6 @@
57(defcustom flyspell-highlight-flag t 57(defcustom flyspell-highlight-flag t
58 "How Flyspell should indicate misspelled words. 58 "How Flyspell should indicate misspelled words.
59Non-nil means use highlight, nil means use minibuffer messages." 59Non-nil means use highlight, nil means use minibuffer messages."
60 :group 'flyspell
61 :type 'boolean) 60 :type 'boolean)
62 61
63(defcustom flyspell-mark-duplications-flag t 62(defcustom flyspell-mark-duplications-flag t
@@ -65,12 +64,10 @@ Non-nil means use highlight, nil means use minibuffer messages."
65See `flyspell-mark-duplications-exceptions' to add exceptions to this rule. 64See `flyspell-mark-duplications-exceptions' to add exceptions to this rule.
66Detection of repeated words is not implemented in 65Detection of repeated words is not implemented in
67\"large\" regions; see variable `flyspell-large-region'." 66\"large\" regions; see variable `flyspell-large-region'."
68 :group 'flyspell
69 :type 'boolean) 67 :type 'boolean)
70 68
71(defcustom flyspell-case-fold-duplications t 69(defcustom flyspell-case-fold-duplications t
72 "Non-nil means Flyspell matches duplicate words case-insensitively." 70 "Non-nil means Flyspell matches duplicate words case-insensitively."
73 :group 'flyspell
74 :type 'boolean 71 :type 'boolean
75 :version "27.1") 72 :version "27.1")
76 73
@@ -87,7 +84,6 @@ dictionary name (`ispell-local-dictionary' or
87 84
88EXCEPTION-LIST is a list of strings. The checked word is 85EXCEPTION-LIST is a list of strings. The checked word is
89downcased before comparing with these exceptions." 86downcased before comparing with these exceptions."
90 :group 'flyspell
91 :type '(alist :key-type (choice (const :tag "All dictionaries" nil) 87 :type '(alist :key-type (choice (const :tag "All dictionaries" nil)
92 regexp) 88 regexp)
93 :value-type (repeat string)) 89 :value-type (repeat string))
@@ -97,7 +93,6 @@ downcased before comparing with these exceptions."
97 "If non-nil, sort the corrections before popping them. 93 "If non-nil, sort the corrections before popping them.
98The sorting is controlled by the `flyspell-sort-corrections-function' 94The sorting is controlled by the `flyspell-sort-corrections-function'
99variable, and defaults to sorting alphabetically." 95variable, and defaults to sorting alphabetically."
100 :group 'flyspell
101 :version "21.1" 96 :version "21.1"
102 :type 'boolean) 97 :type 'boolean)
103 98
@@ -109,8 +104,7 @@ function takes three parameters -- the two correction candidates
109to be sorted, and the third parameter is the word that's being 104to be sorted, and the third parameter is the word that's being
110corrected." 105corrected."
111 :version "26.1" 106 :version "26.1"
112 :type 'function 107 :type 'function)
113 :group 'flyspell)
114 108
115(defun flyspell-sort-corrections-alphabetically (corr1 corr2 _) 109(defun flyspell-sort-corrections-alphabetically (corr1 corr2 _)
116 (string< corr1 corr2)) 110 (string< corr1 corr2))
@@ -130,14 +124,12 @@ Flyspell uses a different face (`flyspell-duplicate') to highlight it.
130This variable specifies how far to search to find such a duplicate. 124This variable specifies how far to search to find such a duplicate.
131-1 means no limit (search the whole buffer). 125-1 means no limit (search the whole buffer).
1320 means do not search for duplicate unrecognized spellings." 1260 means do not search for duplicate unrecognized spellings."
133 :group 'flyspell
134 :version "24.5" ; -1 -> 400000 127 :version "24.5" ; -1 -> 400000
135 :type '(choice (const :tag "no limit" -1) 128 :type '(choice (const :tag "no limit" -1)
136 number)) 129 number))
137 130
138(defcustom flyspell-delay 3 131(defcustom flyspell-delay 3
139 "The number of seconds to wait before checking, after a \"delayed\" command." 132 "The number of seconds to wait before checking, after a \"delayed\" command."
140 :group 'flyspell
141 :type 'number) 133 :type 'number)
142 134
143(defcustom flyspell-persistent-highlight t 135(defcustom flyspell-persistent-highlight t
@@ -147,12 +139,10 @@ is highlighted, and the highlight is turned off as soon as point moves
147off the misspelled word. 139off the misspelled word.
148 140
149Make sure this variable is non-nil if you use `flyspell-region'." 141Make sure this variable is non-nil if you use `flyspell-region'."
150 :group 'flyspell
151 :type 'boolean) 142 :type 'boolean)
152 143
153(defcustom flyspell-highlight-properties t 144(defcustom flyspell-highlight-properties t
154 "Non-nil means highlight incorrect words even if a property exists for this word." 145 "Non-nil means highlight incorrect words even if a property exists for this word."
155 :group 'flyspell
156 :type 'boolean) 146 :type 'boolean)
157 147
158(defcustom flyspell-default-delayed-commands 148(defcustom flyspell-default-delayed-commands
@@ -164,7 +154,6 @@ Make sure this variable is non-nil if you use `flyspell-region'."
164 backward-delete-char-untabify) 154 backward-delete-char-untabify)
165 "The standard list of delayed commands for Flyspell. 155 "The standard list of delayed commands for Flyspell.
166See `flyspell-delayed-commands'." 156See `flyspell-delayed-commands'."
167 :group 'flyspell
168 :version "21.1" 157 :version "21.1"
169 :type '(repeat (symbol))) 158 :type '(repeat (symbol)))
170 159
@@ -172,7 +161,6 @@ See `flyspell-delayed-commands'."
172 "List of commands that are \"delayed\" for Flyspell mode. 161 "List of commands that are \"delayed\" for Flyspell mode.
173After these commands, Flyspell checking is delayed for a short time, 162After these commands, Flyspell checking is delayed for a short time,
174whose length is specified by `flyspell-delay'." 163whose length is specified by `flyspell-delay'."
175 :group 'flyspell
176 :type '(repeat (symbol))) 164 :type '(repeat (symbol)))
177 165
178(defcustom flyspell-default-deplacement-commands 166(defcustom flyspell-default-deplacement-commands
@@ -182,7 +170,6 @@ whose length is specified by `flyspell-delay'."
182 scroll-down) 170 scroll-down)
183 "The standard list of deplacement commands for Flyspell. 171 "The standard list of deplacement commands for Flyspell.
184See variable `flyspell-deplacement-commands'." 172See variable `flyspell-deplacement-commands'."
185 :group 'flyspell
186 :version "21.1" 173 :version "21.1"
187 :type '(repeat (symbol))) 174 :type '(repeat (symbol)))
188 175
@@ -190,18 +177,15 @@ See variable `flyspell-deplacement-commands'."
190 "List of commands that are \"deplacement\" for Flyspell mode. 177 "List of commands that are \"deplacement\" for Flyspell mode.
191After these commands, Flyspell checking is performed only if the previous 178After these commands, Flyspell checking is performed only if the previous
192command was not the very same command." 179command was not the very same command."
193 :group 'flyspell
194 :version "21.1" 180 :version "21.1"
195 :type '(repeat (symbol))) 181 :type '(repeat (symbol)))
196 182
197(defcustom flyspell-issue-welcome-flag t 183(defcustom flyspell-issue-welcome-flag t
198 "Non-nil means that Flyspell should display a welcome message when started." 184 "Non-nil means that Flyspell should display a welcome message when started."
199 :group 'flyspell
200 :type 'boolean) 185 :type 'boolean)
201 186
202(defcustom flyspell-issue-message-flag t 187(defcustom flyspell-issue-message-flag t
203 "Non-nil means that Flyspell emits messages when checking words." 188 "Non-nil means that Flyspell emits messages when checking words."
204 :group 'flyspell
205 :type 'boolean) 189 :type 'boolean)
206 190
207(defcustom flyspell-incorrect-hook nil 191(defcustom flyspell-incorrect-hook nil
@@ -213,7 +197,6 @@ of possible corrections as returned by `ispell-parse-output'.
213 197
214If any of the functions return non-nil, the word is not highlighted as 198If any of the functions return non-nil, the word is not highlighted as
215incorrect." 199incorrect."
216 :group 'flyspell
217 :version "21.1" 200 :version "21.1"
218 :type 'hook) 201 :type 'hook)
219 202
@@ -225,14 +208,12 @@ when flyspell is started, the value of that variable is used instead
225of `flyspell-default-dictionary' to select the default dictionary. 208of `flyspell-default-dictionary' to select the default dictionary.
226Otherwise, if `flyspell-default-dictionary' is nil, it means to use 209Otherwise, if `flyspell-default-dictionary' is nil, it means to use
227Ispell's ultimate default dictionary." 210Ispell's ultimate default dictionary."
228 :group 'flyspell
229 :version "21.1" 211 :version "21.1"
230 :type '(choice string (const :tag "Default" nil))) 212 :type '(choice string (const :tag "Default" nil)))
231 213
232(defcustom flyspell-tex-command-regexp 214(defcustom flyspell-tex-command-regexp
233 "\\(\\(begin\\|end\\)[ \t]*{\\|\\(cite[a-z*]*\\|label\\|ref\\|eqref\\|usepackage\\|documentclass\\)[ \t]*\\(\\[[^]]*\\]\\)?{[^{}]*\\)" 215 "\\(\\(begin\\|end\\)[ \t]*{\\|\\(cite[a-z*]*\\|label\\|ref\\|eqref\\|usepackage\\|documentclass\\)[ \t]*\\(\\[[^]]*\\]\\)?{[^{}]*\\)"
234 "A string that is the regular expression that matches TeX commands." 216 "A string that is the regular expression that matches TeX commands."
235 :group 'flyspell
236 :version "21.1" 217 :version "21.1"
237 :type 'regexp) 218 :type 'regexp)
238 219
@@ -241,34 +222,29 @@ Ispell's ultimate default dictionary."
241TeX math environments are discovered by `texmathp', implemented 222TeX math environments are discovered by `texmathp', implemented
242inside AUCTeX package. That package may be found at 223inside AUCTeX package. That package may be found at
243URL `https://www.gnu.org/software/auctex/'" 224URL `https://www.gnu.org/software/auctex/'"
244 :group 'flyspell
245 :type 'boolean) 225 :type 'boolean)
246 226
247(defcustom flyspell-dictionaries-that-consider-dash-as-word-delimiter 227(defcustom flyspell-dictionaries-that-consider-dash-as-word-delimiter
248 '("francais" "deutsch8" "norsk") 228 '("francais" "deutsch8" "norsk")
249 "List of dictionary names that consider `-' as word delimiter." 229 "List of dictionary names that consider `-' as word delimiter."
250 :group 'flyspell
251 :version "21.1" 230 :version "21.1"
252 :type '(repeat (string))) 231 :type '(repeat (string)))
253 232
254(defcustom flyspell-abbrev-p 233(defcustom flyspell-abbrev-p
255 nil 234 nil
256 "If non-nil, add correction to abbreviation table." 235 "If non-nil, add correction to abbreviation table."
257 :group 'flyspell
258 :version "21.1" 236 :version "21.1"
259 :type 'boolean) 237 :type 'boolean)
260 238
261(defcustom flyspell-use-global-abbrev-table-p 239(defcustom flyspell-use-global-abbrev-table-p
262 nil 240 nil
263 "If non-nil, prefer global abbrev table to local abbrev table." 241 "If non-nil, prefer global abbrev table to local abbrev table."
264 :group 'flyspell
265 :version "21.1" 242 :version "21.1"
266 :type 'boolean) 243 :type 'boolean)
267 244
268(defcustom flyspell-mode-line-string " Fly" 245(defcustom flyspell-mode-line-string " Fly"
269 "String displayed on the mode line when flyspell is active. 246 "String displayed on the mode line when flyspell is active.
270Set this to nil if you don't want a mode line indicator." 247Set this to nil if you don't want a mode line indicator."
271 :group 'flyspell
272 :type '(choice string (const :tag "None" nil))) 248 :type '(choice string (const :tag "None" nil)))
273 249
274(defcustom flyspell-large-region 1000 250(defcustom flyspell-large-region 1000
@@ -282,30 +258,25 @@ Doubled words are not detected in a large region, because Ispell
282does not check for them. 258does not check for them.
283 259
284If this variable is nil, all regions are treated as small." 260If this variable is nil, all regions are treated as small."
285 :group 'flyspell
286 :version "21.1" 261 :version "21.1"
287 :type '(choice number (const :tag "All small" nil))) 262 :type '(choice number (const :tag "All small" nil)))
288 263
289(defcustom flyspell-insert-function (function insert) 264(defcustom flyspell-insert-function (function insert)
290 "Function for inserting word by flyspell upon correction." 265 "Function for inserting word by flyspell upon correction."
291 :group 'flyspell
292 :type 'function) 266 :type 'function)
293 267
294(defcustom flyspell-before-incorrect-word-string nil 268(defcustom flyspell-before-incorrect-word-string nil
295 "String used to indicate an incorrect word starting." 269 "String used to indicate an incorrect word starting."
296 :group 'flyspell
297 :type '(choice string (const nil))) 270 :type '(choice string (const nil)))
298 271
299(defcustom flyspell-after-incorrect-word-string nil 272(defcustom flyspell-after-incorrect-word-string nil
300 "String used to indicate an incorrect word ending." 273 "String used to indicate an incorrect word ending."
301 :group 'flyspell
302 :type '(choice string (const nil))) 274 :type '(choice string (const nil)))
303 275
304(defvar flyspell-mode-map) 276(defvar flyspell-mode-map)
305 277
306(defcustom flyspell-use-meta-tab t 278(defcustom flyspell-use-meta-tab t
307 "Non-nil means that flyspell uses M-TAB to correct word." 279 "Non-nil means that flyspell uses M-TAB to correct word."
308 :group 'flyspell
309 :type 'boolean 280 :type 'boolean
310 :initialize 'custom-initialize-default 281 :initialize 'custom-initialize-default
311 :set (lambda (sym val) 282 :set (lambda (sym val)
@@ -316,8 +287,7 @@ If this variable is nil, all regions are treated as small."
316(defcustom flyspell-auto-correct-binding 287(defcustom flyspell-auto-correct-binding
317 [(control ?\;)] 288 [(control ?\;)]
318 "The key binding for flyspell auto correction." 289 "The key binding for flyspell auto correction."
319 :type 'key-sequence 290 :type 'key-sequence)
320 :group 'flyspell)
321 291
322;;*---------------------------------------------------------------------*/ 292;;*---------------------------------------------------------------------*/
323;;* Mode specific options */ 293;;* Mode specific options */
@@ -475,6 +445,22 @@ like <img alt=\"Some thing.\">."
475 map) 445 map)
476 "Minor mode keymap for Flyspell mode--for the whole buffer.") 446 "Minor mode keymap for Flyspell mode--for the whole buffer.")
477 447
448;; correct on mouse 3
449(defun flyspell--set-use-mouse-3-for-menu (var value)
450 (set-default var value)
451 (if value
452 (progn (define-key flyspell-mouse-map [mouse-2] nil)
453 (define-key flyspell-mouse-map [down-mouse-3] 'flyspell-correct-word))
454 (define-key flyspell-mouse-map [mouse-2] 'flyspell-correct-word)
455 (define-key flyspell-mouse-map [down-mouse-3] nil)))
456
457(defcustom flyspell-use-mouse-3-for-menu nil
458 "Non-nil means to bind `mouse-3' to `flyspell-correct-word'.
459If this is set, also unbind `mouse-2'."
460 :type 'boolean
461 :set 'flyspell--set-use-mouse-3-for-menu
462 :version "28.1")
463
478;; dash character machinery 464;; dash character machinery
479(defvar flyspell-consider-dash-as-word-delimiter-flag nil 465(defvar flyspell-consider-dash-as-word-delimiter-flag nil
480 "Non-nil means that the `-' char is considered as a word delimiter.") 466 "Non-nil means that the `-' char is considered as a word delimiter.")
@@ -493,8 +479,7 @@ like <img alt=\"Some thing.\">."
493 (t 479 (t
494 :underline t :inherit error)) 480 :underline t :inherit error))
495 "Flyspell face for misspelled words." 481 "Flyspell face for misspelled words."
496 :version "24.4" 482 :version "24.4")
497 :group 'flyspell)
498 483
499(defface flyspell-duplicate 484(defface flyspell-duplicate
500 '((((supports :underline (:style wave))) 485 '((((supports :underline (:style wave)))
@@ -503,8 +488,7 @@ like <img alt=\"Some thing.\">."
503 :underline t :inherit warning)) 488 :underline t :inherit warning))
504 "Flyspell face for words that appear twice in a row. 489 "Flyspell face for words that appear twice in a row.
505See also `flyspell-duplicate-distance'." 490See also `flyspell-duplicate-distance'."
506 :version "24.4" 491 :version "24.4")
507 :group 'flyspell)
508 492
509(defvar flyspell-overlay nil) 493(defvar flyspell-overlay nil)
510 494
@@ -546,7 +530,10 @@ in your init file.
546 :group 'flyspell 530 :group 'flyspell
547 (if flyspell-mode 531 (if flyspell-mode
548 (condition-case err 532 (condition-case err
549 (flyspell-mode-on) 533 (progn
534 (when flyspell-use-mouse-3-for-menu
535 (flyspell--set-use-mouse-3-for-menu 'flyspell-use-mouse-3-for-menu t))
536 (flyspell-mode-on))
550 (error (message "Error enabling Flyspell mode:\n%s" (cdr err)) 537 (error (message "Error enabling Flyspell mode:\n%s" (cdr err))
551 (flyspell-mode -1))) 538 (flyspell-mode -1)))
552 (flyspell-mode-off))) 539 (flyspell-mode-off)))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 65f61644b6d..b2ccbc8da24 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -621,15 +621,6 @@ For Aspell, non-nil also means to try to automatically find its dictionaries.
621Earlier Aspell versions do not consistently support charset encoding. Handling 621Earlier Aspell versions do not consistently support charset encoding. Handling
622this would require some extra guessing in `ispell-aspell-find-dictionary'.") 622this would require some extra guessing in `ispell-aspell-find-dictionary'.")
623 623
624(defvar ispell-aspell-supports-utf8 nil
625 "Non-nil if Aspell has consistent command line UTF-8 support. Obsolete.
626ispell.el and flyspell.el will use for this purpose the more generic
627variable `ispell-encoding8-command' for both Aspell and Hunspell. Is left
628here just for backwards compatibility.")
629
630(make-obsolete-variable 'ispell-aspell-supports-utf8
631 'ispell-encoding8-command "23.1")
632
633(defvar ispell-dicts-name2locale-equivs-alist 624(defvar ispell-dicts-name2locale-equivs-alist
634 '(("american" "en_US") 625 '(("american" "en_US")
635 ("brasileiro" "pt_BR") 626 ("brasileiro" "pt_BR")
@@ -682,9 +673,7 @@ Otherwise returns the library directory name, if that is defined."
682 ;; all versions, since versions earlier than 3.0.09 didn't identify 673 ;; all versions, since versions earlier than 3.0.09 didn't identify
683 ;; themselves on startup. 674 ;; themselves on startup.
684 (interactive "p") 675 (interactive "p")
685 (let ((default-directory (or (and (boundp 'temporary-file-directory) 676 (let ((default-directory (or temporary-file-directory default-directory))
686 temporary-file-directory)
687 default-directory))
688 (get-config-var 677 (get-config-var
689 (lambda (var) 678 (lambda (var)
690 (when (re-search-forward 679 (when (re-search-forward
@@ -3734,8 +3723,7 @@ looking for a dictionary, please see the distribution of the GNU ispell
3734program, or do an Internet search; there are various dictionaries 3723program, or do an Internet search; there are various dictionaries
3735available on the net." 3724available on the net."
3736 (interactive) 3725 (interactive)
3737 (if (and (boundp 'transient-mark-mode) transient-mark-mode 3726 (if (and transient-mark-mode mark-active)
3738 (boundp 'mark-active) mark-active)
3739 (ispell-region (region-beginning) (region-end)) 3727 (ispell-region (region-beginning) (region-end))
3740 (ispell-buffer))) 3728 (ispell-buffer)))
3741 3729
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index 279dbb4450c..7bc7dc1762e 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -487,9 +487,6 @@ Most useful for remembering things from other applications."
487 (interactive) 487 (interactive)
488 (remember-region (point-min) (point-max))) 488 (remember-region (point-min) (point-max)))
489 489
490;; Org needs this
491(define-obsolete-function-alias 'remember-buffer 'remember-finalize "23.1")
492
493(defun remember-destroy () 490(defun remember-destroy ()
494 "Destroy the current *Remember* buffer." 491 "Destroy the current *Remember* buffer."
495 (interactive) 492 (interactive)
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 483a2c9bd83..3c2d766ffb1 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -258,7 +258,7 @@ E.g.:
258 258
259;; Filenames 259;; Filenames
260 260
261(defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:" 261(defvar thing-at-point-file-name-chars "-@~/[:alnum:]_.${}#%,:"
262 "Characters allowable in filenames.") 262 "Characters allowable in filenames.")
263 263
264(define-thing-chars filename thing-at-point-file-name-chars) 264(define-thing-chars filename thing-at-point-file-name-chars)
diff --git a/lisp/time.el b/lisp/time.el
index 44fd1a7e337..96b49ddabdd 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -25,8 +25,7 @@
25;; Facilities to display current time/date and a new-mail indicator 25;; Facilities to display current time/date and a new-mail indicator
26;; in the Emacs mode line. The entry point is `display-time'. 26;; in the Emacs mode line. The entry point is `display-time'.
27 27
28;; Display time world in a buffer, the entry point is 28;; Use `world-clock' to display world clock in a buffer.
29;; `display-time-world'.
30 29
31;;; Code: 30;;; Code:
32 31
@@ -35,23 +34,20 @@
35 :group 'mode-line 34 :group 'mode-line
36 :group 'mail) 35 :group 'mail)
37 36
38
39(defcustom display-time-mail-file nil 37(defcustom display-time-mail-file nil
40 "File name of mail inbox file, for indicating existence of new mail. 38 "File name of mail inbox file, for indicating existence of new mail.
41Non-nil and not a string means don't check for mail; nil means use 39Non-nil and not a string means don't check for mail; nil means use
42default, which is system-dependent, and is the same as used by Rmail." 40default, which is system-dependent, and is the same as used by Rmail."
43 :type '(choice (const :tag "None" none) 41 :type '(choice (const :tag "None" none)
44 (const :tag "Default" nil) 42 (const :tag "Default" nil)
45 (file :format "%v")) 43 (file :format "%v")))
46 :group 'display-time)
47 44
48(defcustom display-time-mail-directory nil 45(defcustom display-time-mail-directory nil
49 "Name of mail inbox directory, for indicating existence of new mail. 46 "Name of mail inbox directory, for indicating existence of new mail.
50Any nonempty regular file in the directory is regarded as newly arrived mail. 47Any nonempty regular file in the directory is regarded as newly arrived mail.
51If nil, do not check a directory for arriving mail." 48If nil, do not check a directory for arriving mail."
52 :type '(choice (const :tag "None" nil) 49 :type '(choice (const :tag "None" nil)
53 (directory :format "%v")) 50 (directory :format "%v")))
54 :group 'display-time)
55 51
56(defcustom display-time-mail-function nil 52(defcustom display-time-mail-function nil
57 "Function to call, for indicating existence of new mail. 53 "Function to call, for indicating existence of new mail.
@@ -59,8 +55,7 @@ If nil, that means use the default method: check that the file
59specified by `display-time-mail-file' is nonempty or that the 55specified by `display-time-mail-file' is nonempty or that the
60directory `display-time-mail-directory' contains nonempty files." 56directory `display-time-mail-directory' contains nonempty files."
61 :type '(choice (const :tag "Default" nil) 57 :type '(choice (const :tag "Default" nil)
62 (function)) 58 (function)))
63 :group 'display-time)
64 59
65(defcustom display-time-default-load-average 0 60(defcustom display-time-default-load-average 0
66 "Which load average value will be shown in the mode line. 61 "Which load average value will be shown in the mode line.
@@ -75,8 +70,7 @@ The value can be one of:
75 :type '(choice (const :tag "1 minute load" 0) 70 :type '(choice (const :tag "1 minute load" 0)
76 (const :tag "5 minutes load" 1) 71 (const :tag "5 minutes load" 1)
77 (const :tag "15 minutes load" 2) 72 (const :tag "15 minutes load" 2)
78 (const :tag "None" nil)) 73 (const :tag "None" nil)))
79 :group 'display-time)
80 74
81(defvar display-time-load-average nil 75(defvar display-time-load-average nil
82 "Value of the system's load average currently shown on the mode line. 76 "Value of the system's load average currently shown on the mode line.
@@ -86,27 +80,23 @@ This is an internal variable; setting it has no effect.")
86 80
87(defcustom display-time-load-average-threshold 0.1 81(defcustom display-time-load-average-threshold 0.1
88 "Load-average values below this value won't be shown in the mode line." 82 "Load-average values below this value won't be shown in the mode line."
89 :type 'number 83 :type 'number)
90 :group 'display-time)
91 84
92;;;###autoload 85;;;###autoload
93(defcustom display-time-day-and-date nil "\ 86(defcustom display-time-day-and-date nil "\
94Non-nil means \\[display-time] should display day and date as well as time." 87Non-nil means \\[display-time] should display day and date as well as time."
95 :type 'boolean 88 :type 'boolean)
96 :group 'display-time)
97 89
98(defvar display-time-timer nil) 90(defvar display-time-timer nil)
99 91
100(defcustom display-time-interval 60 92(defcustom display-time-interval 60
101 "Seconds between updates of time in the mode line." 93 "Seconds between updates of time in the mode line."
102 :type 'integer 94 :type 'integer)
103 :group 'display-time)
104 95
105(defcustom display-time-24hr-format nil 96(defcustom display-time-24hr-format nil
106 "Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23. 97 "Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23.
107A value of nil means 1 <= hh <= 12, and an AM/PM suffix is used." 98A value of nil means 1 <= hh <= 12, and an AM/PM suffix is used."
108 :type 'boolean 99 :type 'boolean)
109 :group 'display-time)
110 100
111(defvar display-time-string nil 101(defvar display-time-string nil
112 "String used in mode lines to display a time string. 102 "String used in mode lines to display a time string.
@@ -116,103 +106,12 @@ It should not be set directly, but is instead updated by the
116 106
117(defcustom display-time-hook nil 107(defcustom display-time-hook nil
118 "List of functions to be called when the time is updated on the mode line." 108 "List of functions to be called when the time is updated on the mode line."
119 :type 'hook 109 :type 'hook)
120 :group 'display-time)
121 110
122(defvar display-time-server-down-time nil 111(defvar display-time-server-down-time nil
123 "Time when mail file's file system was recorded to be down. 112 "Time when mail file's file system was recorded to be down.
124If that file system seems to be up, the value is nil.") 113If that file system seems to be up, the value is nil.")
125 114
126(defcustom zoneinfo-style-world-list
127 '(("America/Los_Angeles" "Seattle")
128 ("America/New_York" "New York")
129 ("Europe/London" "London")
130 ("Europe/Paris" "Paris")
131 ("Asia/Calcutta" "Bangalore")
132 ("Asia/Tokyo" "Tokyo"))
133 "Alist of zoneinfo-style time zones and places for `display-time-world'.
134Each element has the form (TIMEZONE LABEL).
135TIMEZONE should be a string of the form AREA/LOCATION, where AREA is
136the name of a region -- a continent or ocean, and LOCATION is the name
137of a specific location, e.g., a city, within that region.
138LABEL is a string to display as the label of that TIMEZONE's time."
139 :group 'display-time
140 :type '(repeat (list string string))
141 :version "23.1")
142
143(defcustom legacy-style-world-list
144 '(("PST8PDT" "Seattle")
145 ("EST5EDT" "New York")
146 ("GMT0BST" "London")
147 ("CET-1CDT" "Paris")
148 ("IST-5:30" "Bangalore")
149 ("JST-9" "Tokyo"))
150 "Alist of traditional-style time zones and places for `display-time-world'.
151Each element has the form (TIMEZONE LABEL).
152TIMEZONE should be a string of the form:
153
154 std[+|-]offset[dst[offset][,date[/time],date[/time]]]
155
156See the documentation of the TZ environment variable on your system,
157for more details about the format of TIMEZONE.
158LABEL is a string to display as the label of that TIMEZONE's time."
159 :group 'display-time
160 :type '(repeat (list string string))
161 :version "23.1")
162
163(defcustom display-time-world-list t
164 "Alist of time zones and places for `display-time-world' to display.
165Each element has the form (TIMEZONE LABEL).
166TIMEZONE should be in a format supported by your system. See the
167documentation of `zoneinfo-style-world-list' and
168`legacy-style-world-list' for two widely used formats. LABEL is
169a string to display as the label of that TIMEZONE's time.
170
171If the value is t instead of an alist, use the value of
172`zoneinfo-style-world-list' if it works on this platform, and of
173`legacy-style-world-list' otherwise."
174
175 :group 'display-time
176 :type '(choice (const :tag "Default" t)
177 (repeat :tag "List of zones and labels"
178 (list (string :tag "Zone") (string :tag "Label"))))
179 :version "23.1")
180
181(defun time--display-world-list ()
182 (if (listp display-time-world-list)
183 display-time-world-list
184 ;; Determine if zoneinfo style timezones are supported by testing that
185 ;; America/New York and Europe/London return different timezones.
186 (let ((nyt (format-time-string "%z" nil "America/New_York"))
187 (gmt (format-time-string "%z" nil "Europe/London")))
188 (if (string-equal nyt gmt)
189 legacy-style-world-list
190 zoneinfo-style-world-list))))
191
192(defcustom display-time-world-time-format "%A %d %B %R %Z"
193 "Format of the time displayed, see `format-time-string'."
194 :group 'display-time
195 :type 'string
196 :version "23.1")
197
198(defcustom display-time-world-buffer-name "*wclock*"
199 "Name of the world clock buffer."
200 :group 'display-time
201 :type 'string
202 :version "23.1")
203
204(defcustom display-time-world-timer-enable t
205 "If non-nil, a timer will update the world clock."
206 :group 'display-time
207 :type 'boolean
208 :version "23.1")
209
210(defcustom display-time-world-timer-second 60
211 "Interval in seconds for updating the world clock."
212 :group 'display-time
213 :type 'integer
214 :version "23.1")
215
216;;;###autoload 115;;;###autoload
217(defun display-time () 116(defun display-time ()
218 "Enable display of time, load level, and mail flag in mode lines. 117 "Enable display of time, load level, and mail flag in mode lines.
@@ -249,14 +148,12 @@ See `display-time-use-mail-icon' and `display-time-mail-face'.")
249 "Non-nil means use an icon as mail indicator on a graphic display. 148 "Non-nil means use an icon as mail indicator on a graphic display.
250Otherwise use `display-time-mail-string'. The icon may consume less 149Otherwise use `display-time-mail-string'. The icon may consume less
251of the mode line. It is specified by `display-time-mail-icon'." 150of the mode line. It is specified by `display-time-mail-icon'."
252 :group 'display-time
253 :type 'boolean) 151 :type 'boolean)
254 152
255;; Fixme: maybe default to the character if we can display Unicode. 153;; Fixme: maybe default to the character if we can display Unicode.
256(defcustom display-time-mail-string "Mail" 154(defcustom display-time-mail-string "Mail"
257 "String to use as the mail indicator in `display-time-string-forms'. 155 "String to use as the mail indicator in `display-time-string-forms'.
258This can use the Unicode letter character if you can display it." 156This can use the Unicode letter character if you can display it."
259 :group 'display-time
260 :version "22.1" 157 :version "22.1"
261 :type '(choice (const "Mail") 158 :type '(choice (const "Mail")
262 ;; Use :tag here because the Lucid menu won't display 159 ;; Use :tag here because the Lucid menu won't display
@@ -270,8 +167,7 @@ See the function `format-time-string' for an explanation of
270how to write this string. If this is nil, the defaults 167how to write this string. If this is nil, the defaults
271depend on `display-time-day-and-date' and `display-time-24hr-format'." 168depend on `display-time-day-and-date' and `display-time-24hr-format'."
272 :type '(choice (const :tag "Default" nil) 169 :type '(choice (const :tag "Default" nil)
273 string) 170 string))
274 :group 'display-time)
275 171
276(defcustom display-time-string-forms 172(defcustom display-time-string-forms
277 '((if (and (not display-time-format) display-time-day-and-date) 173 '((if (and (not display-time-format) display-time-day-and-date)
@@ -325,8 +221,7 @@ For example:
325 (if mail \" Mail\" \"\")) 221 (if mail \" Mail\" \"\"))
326 222
327would give mode line times like `94/12/30 21:07:48 (UTC)'." 223would give mode line times like `94/12/30 21:07:48 (UTC)'."
328 :type '(repeat sexp) 224 :type '(repeat sexp))
329 :group 'display-time)
330 225
331(defun display-time-event-handler () 226(defun display-time-event-handler ()
332 (display-time-update) 227 (display-time-update)
@@ -508,13 +403,129 @@ runs the normal hook `display-time-hook' after each update."
508 (remove-hook 'rmail-after-get-new-mail-hook 403 (remove-hook 'rmail-after-get-new-mail-hook
509 'display-time-event-handler))) 404 'display-time-event-handler)))
510 405
406
407;;; Obsolete names
408
409(define-obsolete-variable-alias 'display-time-world-list
410 'world-clock-list "28.1")
411(define-obsolete-variable-alias 'display-time-world-time-format
412 'world-clock-time-format "28.1")
413(define-obsolete-variable-alias 'display-time-world-buffer-name
414 'world-clock-buffer-name "28.1")
415(define-obsolete-variable-alias 'display-time-world-timer-enable
416 'world-clock-timer-enable "28.1")
417(define-obsolete-variable-alias 'display-time-world-timer-second
418 'world-clock-timer-second "28.1")
419
420(define-obsolete-function-alias 'display-time-world-mode
421 #'world-clock-mode "28.1")
422(define-obsolete-function-alias 'display-time-world-display
423 #'world-clock-display "28.1")
424(define-obsolete-function-alias 'display-time-world
425 #'world-clock "28.1")
426(define-obsolete-function-alias 'display-time-world-timer
427 #'world-clock-update "28.1")
428
429
430;;; World clock
431
432(defgroup world-clock nil
433 "Display a world clock."
434 :group 'display-time)
435
436(defcustom zoneinfo-style-world-list
437 '(("America/Los_Angeles" "Seattle")
438 ("America/New_York" "New York")
439 ("Europe/London" "London")
440 ("Europe/Paris" "Paris")
441 ("Asia/Calcutta" "Bangalore")
442 ("Asia/Tokyo" "Tokyo"))
443 "Alist of zoneinfo-style time zones and places for `world-clock'.
444Each element has the form (TIMEZONE LABEL).
445TIMEZONE should be a string of the form AREA/LOCATION, where AREA is
446the name of a region -- a continent or ocean, and LOCATION is the name
447of a specific location, e.g., a city, within that region.
448LABEL is a string to display as the label of that TIMEZONE's time."
449 :type '(repeat (list string string))
450 :version "23.1")
451
452(defcustom legacy-style-world-list
453 '(("PST8PDT" "Seattle")
454 ("EST5EDT" "New York")
455 ("GMT0BST" "London")
456 ("CET-1CDT" "Paris")
457 ("IST-5:30" "Bangalore")
458 ("JST-9" "Tokyo"))
459 "Alist of traditional-style time zones and places for `world-clock'.
460Each element has the form (TIMEZONE LABEL).
461TIMEZONE should be a string of the form:
462
463 std[+|-]offset[dst[offset][,date[/time],date[/time]]]
464
465See the documentation of the TZ environment variable on your system,
466for more details about the format of TIMEZONE.
467LABEL is a string to display as the label of that TIMEZONE's time."
468 :type '(repeat (list string string))
469 :version "23.1")
470
471(defcustom world-clock-list t
472 "Alist of time zones and places for `world-clock' to display.
473Each element has the form (TIMEZONE LABEL).
474TIMEZONE should be in a format supported by your system. See the
475documentation of `zoneinfo-style-world-list' and
476`legacy-style-world-list' for two widely used formats. LABEL is
477a string to display as the label of that TIMEZONE's time.
478
479If the value is t instead of an alist, use the value of
480`zoneinfo-style-world-list' if it works on this platform, and of
481`legacy-style-world-list' otherwise."
482 :type '(choice (const :tag "Default" t)
483 (repeat :tag "List of zones and labels"
484 (list (string :tag "Zone") (string :tag "Label"))))
485 :version "28.1")
486
487(defun time--display-world-list ()
488 (if (listp world-clock-list)
489 world-clock-list
490 ;; Determine if zoneinfo style timezones are supported by testing that
491 ;; America/New York and Europe/London return different timezones.
492 (let ((nyt (format-time-string "%z" nil "America/New_York"))
493 (gmt (format-time-string "%z" nil "Europe/London")))
494 (if (string-equal nyt gmt)
495 legacy-style-world-list
496 zoneinfo-style-world-list))))
497
498(defcustom world-clock-time-format "%A %d %B %R %Z"
499 "Time format for `world-clock', see `format-time-string'."
500 :type 'string
501 :version "28.1")
502
503(defcustom world-clock-buffer-name "*wclock*"
504 "Name of the `world-clock' buffer."
505 :type 'string
506 :version "28.1")
507
508(defcustom world-clock-timer-enable t
509 "If non-nil, a timer will update the `world-clock' buffer."
510 :type 'boolean
511 :version "28.1")
512
513(defcustom world-clock-timer-second 60
514 "Interval in seconds for updating the `world-clock' buffer."
515 :type 'integer
516 :version "28.1")
517
518(defface world-clock-label
519 '((t :inherit font-lock-variable-name-face))
520 "Face for time zone label in `world-clock' buffer.")
511 521
512(define-derived-mode display-time-world-mode special-mode "World clock" 522(define-derived-mode world-clock-mode special-mode "World clock"
513 "Major mode for buffer that displays times in various time zones. 523 "Major mode for buffer that displays times in various time zones.
514See `display-time-world'." 524See `world-clock'."
525 (setq revert-buffer-function #'world-clock-update)
515 (setq show-trailing-whitespace nil)) 526 (setq show-trailing-whitespace nil))
516 527
517(defun display-time-world-display (alist) 528(defun world-clock-display (alist)
518 "Replace current buffer text with times in various zones, based on ALIST." 529 "Replace current buffer text with times in various zones, based on ALIST."
519 (let ((inhibit-read-only t) 530 (let ((inhibit-read-only t)
520 (buffer-undo-list t) 531 (buffer-undo-list t)
@@ -526,42 +537,45 @@ See `display-time-world'."
526 (let* ((label (cadr zone)) 537 (let* ((label (cadr zone))
527 (width (string-width label))) 538 (width (string-width label)))
528 (push (cons label 539 (push (cons label
529 (format-time-string display-time-world-time-format 540 (format-time-string world-clock-time-format
530 now (car zone))) 541 now (car zone)))
531 result) 542 result)
532 (when (> width max-width) 543 (when (> width max-width)
533 (setq max-width width)))) 544 (setq max-width width))))
534 (setq fmt (concat "%-" (int-to-string max-width) "s %s\n")) 545 (setq fmt (concat "%-" (int-to-string max-width) "s %s\n"))
535 (dolist (timedata (nreverse result)) 546 (dolist (timedata (nreverse result))
536 (insert (format fmt (car timedata) (cdr timedata)))) 547 (insert (format fmt
548 (propertize (car timedata)
549 'face 'world-clock-label)
550 (cdr timedata))))
537 (delete-char -1)) 551 (delete-char -1))
538 (goto-char (point-min))) 552 (goto-char (point-min)))
539 553
540;;;###autoload 554;;;###autoload
541(defun display-time-world () 555(defun world-clock ()
542 "Enable updating display of times in various time zones. 556 "Display a world clock buffer with times in various time zones.
543`display-time-world-list' specifies the zones. 557The variable `world-clock-list' specifies which time zones to use.
544To turn off the world time display, go to that window and type `q'." 558To turn off the world time display, go to the window and type `\\[quit-window]'."
545 (interactive) 559 (interactive)
546 (when (and display-time-world-timer-enable 560 (when (and world-clock-timer-enable
547 (not (get-buffer display-time-world-buffer-name))) 561 (not (get-buffer world-clock-buffer-name)))
548 (run-at-time t display-time-world-timer-second 'display-time-world-timer)) 562 (run-at-time t world-clock-timer-second #'world-clock-update))
549 (with-current-buffer (get-buffer-create display-time-world-buffer-name) 563 (pop-to-buffer world-clock-buffer-name)
550 (display-time-world-display (time--display-world-list)) 564 (world-clock-display (time--display-world-list))
551 (display-buffer display-time-world-buffer-name 565 (world-clock-mode)
552 (cons nil '((window-height . fit-window-to-buffer)))) 566 (fit-window-to-buffer))
553 (display-time-world-mode))) 567
554 568(defun world-clock-update (&optional _arg _noconfirm)
555(defun display-time-world-timer () 569 "Update the `world-clock' buffer."
556 (if (get-buffer display-time-world-buffer-name) 570 (if (get-buffer world-clock-buffer-name)
557 (with-current-buffer (get-buffer display-time-world-buffer-name) 571 (with-current-buffer (get-buffer world-clock-buffer-name)
558 (display-time-world-display (time--display-world-list))) 572 (world-clock-display (time--display-world-list)))
559 ;; cancel timer 573 ;; cancel timer
560 (let ((list timer-list)) 574 (let ((list timer-list))
561 (while list 575 (while list
562 (let ((elt (pop list))) 576 (let ((elt (pop list)))
563 (when (equal (symbol-name (timer--function elt)) 577 (when (equal (symbol-name (timer--function elt))
564 "display-time-world-timer") 578 "world-clock-update")
565 (cancel-timer elt))))))) 579 (cancel-timer elt)))))))
566 580
567;;;###autoload 581;;;###autoload
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index f35f6b9a03e..5f5a4788b26 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -167,8 +167,6 @@ This variable has effect only on GUI frames."
167 167
168;;; Variables that are not customizable. 168;;; Variables that are not customizable.
169 169
170(define-obsolete-variable-alias 'tooltip-hook 'tooltip-functions "23.1")
171
172(defvar tooltip-functions nil 170(defvar tooltip-functions nil
173 "Functions to call to display tooltips. 171 "Functions to call to display tooltips.
174Each function is called with one argument EVENT which is a copy 172Each function is called with one argument EVENT which is a copy
diff --git a/lisp/url/url-expand.el b/lisp/url/url-expand.el
index f34ef810c4a..be9b5426dc4 100644
--- a/lisp/url/url-expand.el
+++ b/lisp/url/url-expand.el
@@ -120,7 +120,7 @@ path components followed by `..' are removed, along with the `..' itself."
120 ;; Well, they told us the scheme, let's just go with it. 120 ;; Well, they told us the scheme, let's just go with it.
121 nil 121 nil
122 (setf (url-type urlobj) (or (url-type urlobj) (url-type defobj))) 122 (setf (url-type urlobj) (or (url-type urlobj) (url-type defobj)))
123 (setf (url-port urlobj) (or (url-portspec urlobj) 123 (setf (url-portspec urlobj) (or (url-portspec urlobj)
124 (and (string= (url-type urlobj) 124 (and (string= (url-type urlobj)
125 (url-type defobj)) 125 (url-type defobj))
126 (url-port defobj)))) 126 (url-port defobj))))
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 6dd7a9c2aac..0a7e7e205e0 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -569,31 +569,6 @@ Has a preference for looking backward when not directly on a symbol."
569 (setq url nil)) 569 (setq url nil))
570 url))) 570 url)))
571 571
572(defun url-generate-unique-filename (&optional fmt)
573 "Generate a unique filename in `url-temporary-directory'."
574 (declare (obsolete make-temp-file "23.1"))
575 ;; This variable is obsolete, but so is this function.
576 (let ((tempdir (with-no-warnings url-temporary-directory)))
577 (if (not fmt)
578 (let ((base (format "url-tmp.%d" (user-real-uid)))
579 (fname "")
580 (x 0))
581 (setq fname (format "%s%d" base x))
582 (while (file-exists-p
583 (expand-file-name fname tempdir))
584 (setq x (1+ x)
585 fname (concat base (int-to-string x))))
586 (expand-file-name fname tempdir))
587 (let ((base (concat "url" (int-to-string (user-real-uid))))
588 (fname "")
589 (x 0))
590 (setq fname (format fmt (concat base (int-to-string x))))
591 (while (file-exists-p
592 (expand-file-name fname tempdir))
593 (setq x (1+ x)
594 fname (format fmt (concat base (int-to-string x)))))
595 (expand-file-name fname tempdir)))))
596
597(defun url-extract-mime-headers () 572(defun url-extract-mime-headers ()
598 "Set `url-current-mime-headers' in current buffer." 573 "Set `url-current-mime-headers' in current buffer."
599 (save-excursion 574 (save-excursion
diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el
index d9277cf6f42..e35823ab9af 100644
--- a/lisp/url/url-vars.el
+++ b/lisp/url/url-vars.el
@@ -312,13 +312,6 @@ Applies when a protected document is denied by the server."
312 :type 'integer 312 :type 'integer
313 :group 'url) 313 :group 'url)
314 314
315(defcustom url-temporary-directory (or (getenv "TMPDIR") "/tmp")
316 "Where temporary files go."
317 :type 'directory
318 :group 'url-file)
319(make-obsolete-variable 'url-temporary-directory
320 'temporary-file-directory "23.1")
321
322(defcustom url-show-status t 315(defcustom url-show-status t
323 "Whether to show a running total of bytes transferred. 316 "Whether to show a running total of bytes transferred.
324Can cause a large hit if using a remote X display over a slow link, or 317Can cause a large hit if using a remote X display over a slow link, or
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index d194d6c0a0e..bd5ac9b9a62 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2518,7 +2518,7 @@ fixed, visit it in a buffer."
2518 '((?+ . (left-fringe diff-fringe-add diff-indicator-added)) 2518 '((?+ . (left-fringe diff-fringe-add diff-indicator-added))
2519 (?- . (left-fringe diff-fringe-del diff-indicator-removed)) 2519 (?- . (left-fringe diff-fringe-del diff-indicator-removed))
2520 (?! . (left-fringe diff-fringe-rep diff-indicator-changed)) 2520 (?! . (left-fringe diff-fringe-rep diff-indicator-changed))
2521 (?\s . (left-fringe diff-fringe-nul)))))) 2521 (?\s . (left-fringe diff-fringe-nul fringe))))))
2522 (put-text-property (match-beginning 0) (match-end 0) 'display spec)))) 2522 (put-text-property (match-beginning 0) (match-end 0) 'display spec))))
2523 ;; Mimicks the output of Magit's diff. 2523 ;; Mimicks the output of Magit's diff.
2524 ;; FIXME: This has only been tested with Git's diff output. 2524 ;; FIXME: This has only been tested with Git's diff output.
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index f5177bca112..04926af16ef 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -1573,9 +1573,8 @@ This default should work without changes."
1573 1573
1574 1574
1575(defun ediff-convert-standard-filename (fname) 1575(defun ediff-convert-standard-filename (fname)
1576 (if (fboundp 'convert-standard-filename) 1576 (declare (obsolete convert-standard-filename "28.1"))
1577 (convert-standard-filename fname) 1577 (convert-standard-filename fname))
1578 fname))
1579 1578
1580(define-obsolete-function-alias 'ediff-with-syntax-table 1579(define-obsolete-function-alias 'ediff-with-syntax-table
1581 #'with-syntax-table "27.1") 1580 #'with-syntax-table "27.1")
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 4a84c1ecd9c..f56d31c7136 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -240,18 +240,16 @@ to invocation.")
240 startup-hooks setup-parameters 240 startup-hooks setup-parameters
241 &optional merge-buffer-file) 241 &optional merge-buffer-file)
242 (run-hooks 'ediff-before-setup-hook) 242 (run-hooks 'ediff-before-setup-hook)
243 ;; ediff-convert-standard-filename puts file names in the form appropriate 243 ;; convert-standard-filename puts file names in the form appropriate
244 ;; for the OS at hand. 244 ;; for the OS at hand.
245 (setq file-A (ediff-convert-standard-filename (expand-file-name file-A))) 245 (setq file-A (convert-standard-filename (expand-file-name file-A)))
246 (setq file-B (ediff-convert-standard-filename (expand-file-name file-B))) 246 (setq file-B (convert-standard-filename (expand-file-name file-B)))
247 (if (stringp file-C) 247 (if (stringp file-C)
248 (setq file-C 248 (setq file-C (convert-standard-filename (expand-file-name file-C))))
249 (ediff-convert-standard-filename (expand-file-name file-C))))
250 (if (stringp merge-buffer-file) 249 (if (stringp merge-buffer-file)
251 (progn 250 (progn
252 (setq merge-buffer-file 251 (setq merge-buffer-file
253 (ediff-convert-standard-filename 252 (convert-standard-filename (expand-file-name merge-buffer-file)))
254 (expand-file-name merge-buffer-file)))
255 ;; check the directory exists 253 ;; check the directory exists
256 (or (file-exists-p (file-name-directory merge-buffer-file)) 254 (or (file-exists-p (file-name-directory merge-buffer-file))
257 (error "Directory %s given as place to save the merge doesn't exist" 255 (error "Directory %s given as place to save the merge doesn't exist"
@@ -3069,10 +3067,8 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3069 3067
3070 3068
3071;; for compatibility 3069;; for compatibility
3072(defmacro ediff-minibuffer-with-setup-hook (fun &rest body) 3070(define-obsolete-function-alias 'ediff-minibuffer-with-setup-hook
3073 `(if (fboundp 'minibuffer-with-setup-hook) 3071 #'minibuffer-with-setup-hook "28.1")
3074 (minibuffer-with-setup-hook ,fun ,@body)
3075 ,@body))
3076 3072
3077;; This is adapted from a similar function in `emerge.el'. 3073;; This is adapted from a similar function in `emerge.el'.
3078;; PROMPT should not have a trailing ': ', so that it can be modified 3074;; PROMPT should not have a trailing ': ', so that it can be modified
@@ -3101,7 +3097,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3101 (and default-file (list default-file)) 3097 (and default-file (list default-file))
3102 default-dir))) 3098 default-dir)))
3103 f) 3099 f)
3104 (setq f (ediff-minibuffer-with-setup-hook 3100 (setq f (minibuffer-with-setup-hook
3105 (lambda () (when defaults 3101 (lambda () (when defaults
3106 (setq minibuffer-default defaults))) 3102 (setq minibuffer-default defaults)))
3107 (read-file-name 3103 (read-file-name
@@ -3134,7 +3130,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3134;; Also, save buffer from START to END in the file. 3130;; Also, save buffer from START to END in the file.
3135;; START defaults to (point-min), END to (point-max) 3131;; START defaults to (point-min), END to (point-max)
3136(defun ediff-make-temp-file (buff &optional prefix given-file start end) 3132(defun ediff-make-temp-file (buff &optional prefix given-file start end)
3137 (let* ((p (ediff-convert-standard-filename (or prefix "ediff"))) 3133 (let* ((p (convert-standard-filename (or prefix "ediff")))
3138 (short-p p) 3134 (short-p p)
3139 (coding-system-for-write ediff-coding-system-for-write) 3135 (coding-system-for-write ediff-coding-system-for-write)
3140 f short-f) 3136 f short-f)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 78a2fa08795..84aeb0a1105 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -210,6 +210,16 @@ toggle display of the entire list."
210 widget)))) 210 widget))))
211 :version "27.1") 211 :version "27.1")
212 212
213(defcustom vc-git-revision-complete-only-branches nil
214 "Control whether tags are returned by revision completion for Git.
215
216When non-nil, only branches and remotes will be returned by
217`vc-git-revision-completion-table'. This is used by various VC
218commands when completing branch names. When nil, tags are also
219included in the completions."
220 :type 'boolean
221 :version "28.1")
222
213;; History of Git commands. 223;; History of Git commands.
214(defvar vc-git-history nil) 224(defvar vc-git-history nil)
215 225
@@ -1415,9 +1425,11 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
1415 (with-temp-buffer 1425 (with-temp-buffer
1416 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)") 1426 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)")
1417 (goto-char (point-min)) 1427 (goto-char (point-min))
1418 (while (re-search-forward "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$" 1428 (let ((regexp (if vc-git-revision-complete-only-branches
1419 nil t) 1429 "^refs/\\(heads\\|remotes\\)/\\(.*\\)$"
1420 (push (match-string 2) table))) 1430 "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$")))
1431 (while (re-search-forward regexp nil t)
1432 (push (match-string 2) table))))
1421 table)) 1433 table))
1422 1434
1423(defun vc-git-revision-completion-table (files) 1435(defun vc-git-revision-completion-table (files)
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index ce72a49b955..f09ceddcb37 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -505,14 +505,6 @@ If FILE is not registered, this function always returns nil."
505 (vc-call-backend 505 (vc-call-backend
506 backend 'working-revision file)))))) 506 backend 'working-revision file))))))
507 507
508;; Backward compatibility.
509(define-obsolete-function-alias
510 'vc-workfile-version 'vc-working-revision "23.1")
511(defun vc-default-working-revision (backend file)
512 (message
513 "`working-revision' not found: using the old `workfile-version' instead")
514 (vc-call-backend backend 'workfile-version file))
515
516(defun vc-default-registered (backend file) 508(defun vc-default-registered (backend file)
517 "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates." 509 "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates."
518 (let ((sym (vc-make-backend-sym backend 'master-templates))) 510 (let ((sym (vc-make-backend-sym backend 'master-templates)))
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 092d8b53968..3c26ffc0e58 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -60,7 +60,6 @@ switches."
60 :version "25.1" 60 :version "25.1"
61 :group 'vc-mtn) 61 :group 'vc-mtn)
62 62
63(define-obsolete-variable-alias 'vc-mtn-command 'vc-mtn-program "23.1")
64(defcustom vc-mtn-program "mtn" 63(defcustom vc-mtn-program "mtn"
65 "Name of the monotone executable." 64 "Name of the monotone executable."
66 :type 'string 65 :type 'string
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 65775f8e46e..5561292d8c0 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2710,9 +2710,6 @@ to the working revision (except for keyword expansion)."
2710 (message "Reverting %s...done" (vc-delistify files))))) 2710 (message "Reverting %s...done" (vc-delistify files)))))
2711 2711
2712;;;###autoload 2712;;;###autoload
2713(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1")
2714
2715;;;###autoload
2716(defun vc-pull (&optional arg) 2713(defun vc-pull (&optional arg)
2717 "Update the current fileset or branch. 2714 "Update the current fileset or branch.
2718You must be visiting a version controlled file, or in a `vc-dir' buffer. 2715You must be visiting a version controlled file, or in a `vc-dir' buffer.
diff --git a/lisp/vcursor.el b/lisp/vcursor.el
index fa0cbb74b0d..3601abcd6e4 100644
--- a/lisp/vcursor.el
+++ b/lisp/vcursor.el
@@ -1132,9 +1132,6 @@ line is treated like ordinary characters."
1132 (vcursor-copy (if (or (= count 0) arg) (1+ count) count))) 1132 (vcursor-copy (if (or (= count 0) arg) (1+ count) count)))
1133 ) 1133 )
1134 1134
1135(define-obsolete-function-alias
1136 'vcursor-toggle-vcursor-map 'vcursor-use-vcursor-map "23.1")
1137
1138(defun vcursor-post-command () 1135(defun vcursor-post-command ()
1139 (and vcursor-auto-disable (not vcursor-last-command) 1136 (and vcursor-auto-disable (not vcursor-last-command)
1140 vcursor-overlay 1137 vcursor-overlay
diff --git a/lisp/vt-control.el b/lisp/vt-control.el
index fc3a514f921..d4c14197bdc 100644
--- a/lisp/vt-control.el
+++ b/lisp/vt-control.el
@@ -1,4 +1,4 @@
1;;; vt-control.el --- Common VTxxx control functions 1;;; vt-control.el --- Common VTxxx control functions -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc. 3;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
4 4
diff --git a/lisp/window.el b/lisp/window.el
index f20940fa0ea..bb34a6d7b4c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2642,12 +2642,17 @@ and no others."
2642 "Return t if WINDOW is the currently active minibuffer window." 2642 "Return t if WINDOW is the currently active minibuffer window."
2643 (and (window-live-p window) (eq window (active-minibuffer-window)))) 2643 (and (window-live-p window) (eq window (active-minibuffer-window))))
2644 2644
2645(defun count-windows (&optional minibuf) 2645(defun count-windows (&optional minibuf all-frames)
2646 "Return the number of live windows on the selected frame. 2646 "Return the number of live windows on the selected frame.
2647
2647The optional argument MINIBUF specifies whether the minibuffer 2648The optional argument MINIBUF specifies whether the minibuffer
2648window shall be counted. See `walk-windows' for the precise 2649window is included in the count.
2649meaning of this argument." 2650
2650 (length (window-list-1 nil minibuf))) 2651If ALL-FRAMES is non-nil, count the windows in all frames instead
2652just the selected frame.
2653
2654See `walk-windows' for the precise meaning of this argument."
2655 (length (window-list-1 nil minibuf all-frames)))
2651 2656
2652;;; Resizing windows. 2657;;; Resizing windows.
2653(defun window--size-to-pixel (window size &optional horizontal pixelwise round-maybe) 2658(defun window--size-to-pixel (window size &optional horizontal pixelwise round-maybe)
@@ -5729,10 +5734,10 @@ window."
5729WINDOW defaults to the selected window. DIRECTION can be 5734WINDOW defaults to the selected window. DIRECTION can be
5730nil (i.e. any), `height' or `width'." 5735nil (i.e. any), `height' or `width'."
5731 (with-current-buffer (window-buffer window) 5736 (with-current-buffer (window-buffer window)
5732 (when (and (boundp 'window-size-fixed) window-size-fixed) 5737 (and window-size-fixed
5733 (not (and direction 5738 (not (and direction
5734 (member (cons direction window-size-fixed) 5739 (member (cons direction window-size-fixed)
5735 '((height . width) (width . height)))))))) 5740 '((height . width) (width . height))))))))
5736 5741
5737;;; A different solution to balance-windows. 5742;;; A different solution to balance-windows.
5738(defvar window-area-factor 1 5743(defvar window-area-factor 1
diff --git a/lisp/woman.el b/lisp/woman.el
index c0e27c57077..891a1263ace 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -914,8 +914,8 @@ Troff emulation is experimental and largely untested.
914 :group 'faces) 914 :group 'faces)
915 915
916(defcustom woman-fontify 916(defcustom woman-fontify
917 (or (and (fboundp 'display-color-p) (display-color-p)) 917 (or (display-color-p)
918 (and (fboundp 'display-graphic-p) (display-graphic-p)) 918 (display-graphic-p)
919 (x-display-color-p)) 919 (x-display-color-p))
920 "If non-nil then WoMan assumes that face support is available. 920 "If non-nil then WoMan assumes that face support is available.
921It defaults to a non-nil value if the display supports either colors 921It defaults to a non-nil value if the display supports either colors