summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-07-18 16:45:15 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-07-18 16:45:15 -0700
commit6c5fa0d7286d47b36e08a4cd9378892adbe15e2f (patch)
treea65706a8d4cbb5a95b2741d19721c738b7f81ddd
parent7ceaba292642da5776b3c03d3da0a839c7db91da (diff)
parent736075bab9e0299fdfe4384030ca54c31fb358fb (diff)
downloademacs-6c5fa0d7286d47b36e08a4cd9378892adbe15e2f.tar.gz
Merge branch 'athena/unstable' into athena/bullseye-backports
-rw-r--r--ChangeLog.26
-rw-r--r--ChangeLog.3470
-rw-r--r--admin/admin.el9
-rw-r--r--admin/gitmerge.el2
-rw-r--r--admin/make-tarball.txt34
-rwxr-xr-xadmin/merge-gnulib2
-rw-r--r--admin/notes/multi-tty2
-rw-r--r--admin/notes/spelling2
-rw-r--r--admin/nt/dist-build/README-scripts2
-rwxr-xr-xadmin/nt/dist-build/build-zips.sh2
-rwxr-xr-xadmin/quick-install-emacs4
-rwxr-xr-xautogen.sh2
-rwxr-xr-xbuild-aux/config.guess9
-rwxr-xr-xbuild-aux/config.sub6
-rw-r--r--configure.ac1506
-rw-r--r--debian/changelog6
-rw-r--r--doc/emacs/ChangeLog.12
-rw-r--r--doc/emacs/abbrevs.texi6
-rw-r--r--doc/emacs/buffers.texi13
-rw-r--r--doc/emacs/dired.texi47
-rw-r--r--doc/emacs/display.texi17
-rw-r--r--doc/emacs/files.texi23
-rw-r--r--doc/emacs/frames.texi7
-rw-r--r--doc/emacs/glossary.texi1
-rw-r--r--doc/emacs/killing.texi23
-rw-r--r--doc/emacs/misc.texi6
-rw-r--r--doc/lispref/commands.texi15
-rw-r--r--doc/lispref/compile.texi4
-rw-r--r--doc/lispref/display.texi11
-rw-r--r--doc/lispref/edebug.texi1
-rw-r--r--doc/lispref/files.texi9
-rw-r--r--doc/lispref/frames.texi45
-rw-r--r--doc/lispref/hooks.texi1
-rw-r--r--doc/lispref/keymaps.texi23
-rw-r--r--doc/lispref/loading.texi2
-rw-r--r--doc/lispref/modes.texi18
-rw-r--r--doc/lispref/processes.texi2
-rw-r--r--doc/lispref/searching.texi4
-rw-r--r--doc/lispref/sequences.texi14
-rw-r--r--doc/lispref/text.texi32
-rw-r--r--doc/lispref/variables.texi6
-rw-r--r--doc/lispref/windows.texi20
-rw-r--r--doc/misc/cl.texi14
-rw-r--r--doc/misc/dired-x.texi64
-rw-r--r--doc/misc/erc.texi73
-rw-r--r--doc/misc/ert.texi4
-rw-r--r--doc/misc/eshell.texi76
-rw-r--r--doc/misc/gnus.texi2
-rw-r--r--doc/misc/modus-themes.org16
-rw-r--r--doc/misc/org.org6
-rw-r--r--doc/misc/rcirc.texi6
-rw-r--r--doc/misc/texinfo.tex2
-rw-r--r--doc/misc/tramp.texi64
-rw-r--r--etc/DEBUG36
-rw-r--r--etc/NEWS236
-rw-r--r--etc/NEWS.288
-rw-r--r--etc/ORG-NEWS20
-rw-r--r--etc/PROBLEMS113
-rw-r--r--etc/TODO2
-rw-r--r--etc/compilation.txt13
-rw-r--r--etc/emacs_lldb.py238
-rw-r--r--etc/images/README2
-rw-r--r--etc/publicsuffix.txt40
-rw-r--r--etc/srecode/ede-autoconf.srt4
-rw-r--r--etc/themes/leuven-dark-theme.el2
-rw-r--r--etc/themes/manoj-dark-theme.el2
-rw-r--r--etc/tutorials/TUTORIAL.nl2
-rw-r--r--lib-src/etags.c11
-rw-r--r--lib/fchmodat.c59
-rw-r--r--lib/filevercmp.c18
-rw-r--r--lib/filevercmp.h4
-rw-r--r--lib/gnulib.mk.in6
-rw-r--r--lib/lchmod.c84
-rw-r--r--lib/mini-gmp.h2
-rw-r--r--lib/str-two-way.h4
-rw-r--r--lib/string.in.h16
-rw-r--r--lib/sys_stat.in.h28
-rw-r--r--lisp/ChangeLog.172
-rw-r--r--lisp/ChangeLog.92
-rw-r--r--lisp/abbrev.el30
-rw-r--r--lisp/align.el18
-rw-r--r--lisp/allout.el10
-rw-r--r--lisp/ansi-color.el3
-rw-r--r--lisp/auth-source.el85
-rw-r--r--lisp/autoinsert.el5
-rw-r--r--lisp/bindings.el8
-rw-r--r--lisp/bookmark.el18
-rw-r--r--lisp/buff-menu.el4
-rw-r--r--lisp/calc/calc-embed.el3
-rw-r--r--lisp/calc/calc-misc.el62
-rw-r--r--lisp/calc/calc-prog.el4
-rw-r--r--lisp/calc/calc-yank.el4
-rw-r--r--lisp/calc/calc.el2
-rw-r--r--lisp/calendar/calendar.el18
-rw-r--r--lisp/calendar/diary-lib.el10
-rw-r--r--lisp/calendar/time-date.el2
-rw-r--r--lisp/calendar/timeclock.el2
-rw-r--r--lisp/cedet/data-debug.el16
-rw-r--r--lisp/cedet/ede/emacs.el2
-rw-r--r--lisp/cedet/semantic/edit.el2
-rw-r--r--lisp/cedet/semantic/grammar.el4
-rw-r--r--lisp/cedet/semantic/java.el37
-rw-r--r--lisp/cedet/semantic/lex-spp.el2
-rw-r--r--lisp/cedet/semantic/lex.el37
-rw-r--r--lisp/chistory.el6
-rw-r--r--lisp/comint.el83
-rw-r--r--lisp/completion.el4
-rw-r--r--lisp/cus-edit.el1
-rw-r--r--lisp/cus-start.el3
-rw-r--r--lisp/custom.el14
-rw-r--r--lisp/descr-text.el1
-rw-r--r--lisp/desktop.el2
-rw-r--r--lisp/dired-aux.el118
-rw-r--r--lisp/dired-x.el206
-rw-r--r--lisp/dired.el91
-rw-r--r--lisp/dirtrack.el21
-rw-r--r--lisp/dnd.el10
-rw-r--r--lisp/doc-view.el9
-rw-r--r--lisp/dos-fns.el16
-rw-r--r--lisp/elec-pair.el82
-rw-r--r--lisp/emacs-lisp/backtrace.el117
-rw-r--r--lisp/emacs-lisp/byte-opt.el36
-rw-r--r--lisp/emacs-lisp/bytecomp.el23
-rw-r--r--lisp/emacs-lisp/cconv.el3
-rw-r--r--lisp/emacs-lisp/chart.el1
-rw-r--r--lisp/emacs-lisp/checkdoc.el62
-rw-r--r--lisp/emacs-lisp/cl-indent.el7
-rw-r--r--lisp/emacs-lisp/cl-preloaded.el2
-rw-r--r--lisp/emacs-lisp/comp.el36
-rw-r--r--lisp/emacs-lisp/crm.el51
-rw-r--r--lisp/emacs-lisp/debug.el93
-rw-r--r--lisp/emacs-lisp/easy-mmode.el2
-rw-r--r--lisp/emacs-lisp/edebug.el213
-rw-r--r--lisp/emacs-lisp/eieio-core.el5
-rw-r--r--lisp/emacs-lisp/eieio-custom.el12
-rw-r--r--lisp/emacs-lisp/eieio-opt.el4
-rw-r--r--lisp/emacs-lisp/eldoc.el2
-rw-r--r--lisp/emacs-lisp/elp.el12
-rw-r--r--lisp/emacs-lisp/ert-x.el11
-rw-r--r--lisp/emacs-lisp/ert.el24
-rw-r--r--lisp/emacs-lisp/helper.el50
-rw-r--r--lisp/emacs-lisp/lisp-mode.el206
-rw-r--r--lisp/emacs-lisp/lisp.el9
-rw-r--r--lisp/emacs-lisp/loaddefs-gen.el4
-rw-r--r--lisp/emacs-lisp/macroexp.el2
-rw-r--r--lisp/emacs-lisp/nadvice.el4
-rw-r--r--lisp/emacs-lisp/package.el22
-rw-r--r--lisp/emacs-lisp/re-builder.el60
-rw-r--r--lisp/emacs-lisp/seq.el15
-rw-r--r--lisp/emacs-lisp/shortdoc.el15
-rw-r--r--lisp/emacs-lisp/shorthands.el3
-rw-r--r--lisp/emacs-lisp/subr-x.el88
-rw-r--r--lisp/emacs-lisp/tabulated-list.el49
-rw-r--r--lisp/emacs-lisp/timer-list.el13
-rw-r--r--lisp/emacs-lisp/trace.el9
-rw-r--r--lisp/emacs-lock.el11
-rw-r--r--lisp/emulation/viper-macs.el8
-rw-r--r--lisp/emulation/viper.el10
-rw-r--r--lisp/env.el2
-rw-r--r--lisp/epa-mail.el28
-rw-r--r--lisp/erc/erc-backend.el17
-rw-r--r--lisp/erc/erc-button.el2
-rw-r--r--lisp/erc/erc-dcc.el2
-rw-r--r--lisp/erc/erc-track.el14
-rw-r--r--lisp/erc/erc.el9
-rw-r--r--lisp/eshell/em-cmpl.el11
-rw-r--r--lisp/eshell/em-dirs.el41
-rw-r--r--lisp/eshell/esh-mode.el2
-rw-r--r--lisp/eshell/esh-util.el9
-rw-r--r--lisp/eshell/esh-var.el125
-rw-r--r--lisp/face-remap.el97
-rw-r--r--lisp/faces.el2
-rw-r--r--lisp/ffap.el71
-rw-r--r--lisp/files-x.el31
-rw-r--r--lisp/files.el121
-rw-r--r--lisp/filesets.el22
-rw-r--r--lisp/find-dired.el7
-rw-r--r--lisp/font-core.el5
-rw-r--r--lisp/font-lock.el46
-rw-r--r--lisp/format.el1
-rw-r--r--lisp/frame.el2
-rw-r--r--lisp/gnus/ChangeLog.32
-rw-r--r--lisp/gnus/gnus-art.el8
-rw-r--r--lisp/gnus/gnus-cus.el2
-rw-r--r--lisp/gnus/gnus-eform.el2
-rw-r--r--lisp/gnus/gnus-logic.el4
-rw-r--r--lisp/gnus/gnus-msg.el44
-rw-r--r--lisp/gnus/gnus-range.el12
-rw-r--r--lisp/gnus/gnus-registry.el3
-rw-r--r--lisp/gnus/gnus-search.el46
-rw-r--r--lisp/gnus/gnus-sum.el6
-rw-r--r--lisp/gnus/gnus.el25
-rw-r--r--lisp/gnus/message.el2
-rw-r--r--lisp/gnus/mm-decode.el6
-rw-r--r--lisp/gnus/mm-view.el4
-rw-r--r--lisp/gnus/nnimap.el34
-rw-r--r--lisp/gnus/spam-stat.el2
-rw-r--r--lisp/help-fns.el16
-rw-r--r--lisp/help-mode.el36
-rw-r--r--lisp/help.el8
-rw-r--r--lisp/hi-lock.el9
-rw-r--r--lisp/icomplete.el12
-rw-r--r--lisp/ido.el2
-rw-r--r--lisp/iimage.el3
-rw-r--r--lisp/image-mode.el4
-rw-r--r--lisp/image.el26
-rw-r--r--lisp/image/gravatar.el2
-rw-r--r--lisp/image/image-converter.el81
-rw-r--r--lisp/imenu.el6
-rw-r--r--lisp/indent.el7
-rw-r--r--lisp/info.el6
-rw-r--r--lisp/informat.el2
-rw-r--r--lisp/international/emoji.el30
-rw-r--r--lisp/international/iso-transl.el4
-rw-r--r--lisp/international/mule-cmds.el1
-rw-r--r--lisp/isearch.el266
-rw-r--r--lisp/jit-lock.el2
-rw-r--r--lisp/jsonrpc.el12
-rw-r--r--lisp/kmacro.el8
-rw-r--r--lisp/language/ind-util.el16
-rw-r--r--lisp/language/indian.el2
-rw-r--r--lisp/ldefs-boot.el324
-rw-r--r--lisp/leim/quail/indian.el308
-rw-r--r--lisp/leim/quail/persian.el90
-rw-r--r--lisp/longlines.el (renamed from lisp/obsolete/longlines.el)134
-rw-r--r--lisp/mail/emacsbug.el5
-rw-r--r--lisp/mail/hashcash.el12
-rw-r--r--lisp/mail/mail-extr.el113
-rw-r--r--lisp/mail/mail-hist.el2
-rw-r--r--lisp/mail/mail-utils.el13
-rw-r--r--lisp/mail/mailalias.el37
-rw-r--r--lisp/mail/rmail.el19
-rw-r--r--lisp/mail/sendmail.el44
-rw-r--r--lisp/mail/smtpmail.el37
-rw-r--r--lisp/mail/supercite.el16
-rw-r--r--lisp/mail/undigest.el4
-rw-r--r--lisp/mail/unrmail.el2
-rw-r--r--lisp/menu-bar.el7
-rw-r--r--lisp/mh-e/mh-funcs.el6
-rw-r--r--lisp/mh-e/mh-mime.el10
-rw-r--r--lisp/midnight.el4
-rw-r--r--lisp/minibuffer.el35
-rw-r--r--lisp/misc.el2
-rw-r--r--lisp/mouse.el6
-rw-r--r--lisp/msb.el9
-rw-r--r--lisp/mwheel.el41
-rw-r--r--lisp/net/ange-ftp.el10
-rw-r--r--lisp/net/browse-url.el100
-rw-r--r--lisp/net/dictionary.el62
-rw-r--r--lisp/net/dig.el39
-rw-r--r--lisp/net/eudc-capf.el2
-rw-r--r--lisp/net/eudc-hotlist.el16
-rw-r--r--lisp/net/eudc.el63
-rw-r--r--lisp/net/eww.el12
-rw-r--r--lisp/net/imap.el7
-rw-r--r--lisp/net/ldap.el2
-rw-r--r--lisp/net/mailcap.el1
-rw-r--r--lisp/net/mairix.el29
-rw-r--r--lisp/net/net-utils.el116
-rw-r--r--lisp/net/newst-backend.el1
-rw-r--r--lisp/net/newst-plainview.el17
-rw-r--r--lisp/net/newst-reader.el10
-rw-r--r--lisp/net/newst-treeview.el87
-rw-r--r--lisp/net/pop3.el4
-rw-r--r--lisp/net/quickurl.el24
-rw-r--r--lisp/net/rcirc.el80
-rw-r--r--lisp/net/secrets.el15
-rw-r--r--lisp/net/shr.el24
-rw-r--r--lisp/net/sieve-manage.el2
-rw-r--r--lisp/net/sieve-mode.el12
-rw-r--r--lisp/net/sieve.el52
-rw-r--r--lisp/net/snmp-mode.el14
-rw-r--r--lisp/net/socks.el9
-rw-r--r--lisp/net/telnet.el31
-rw-r--r--lisp/net/tramp-adb.el5
-rw-r--r--lisp/net/tramp-cache.el8
-rw-r--r--lisp/net/tramp-cmds.el4
-rw-r--r--lisp/net/tramp-compat.el6
-rw-r--r--lisp/net/tramp-crypt.el2
-rw-r--r--lisp/net/tramp-ftp.el2
-rw-r--r--lisp/net/tramp-fuse.el4
-rw-r--r--lisp/net/tramp-gvfs.el114
-rw-r--r--lisp/net/tramp-integration.el2
-rw-r--r--lisp/net/tramp-sh.el37
-rw-r--r--lisp/net/tramp-smb.el8
-rw-r--r--lisp/net/tramp-sshfs.el2
-rw-r--r--lisp/net/tramp.el51
-rw-r--r--lisp/net/trampver.el10
-rw-r--r--lisp/net/webjump.el46
-rw-r--r--lisp/nxml/nxml-mode.el48
-rw-r--r--lisp/nxml/nxml-outln.el54
-rw-r--r--lisp/nxml/nxml-parse.el2
-rw-r--r--lisp/nxml/rng-valid.el4
-rw-r--r--lisp/obsolete/eieio-compat.el20
-rw-r--r--lisp/obsolete/info-edit.el1
-rw-r--r--lisp/obsolete/rlogin.el (renamed from lisp/net/rlogin.el)34
-rw-r--r--lisp/obsolete/starttls.el3
-rw-r--r--lisp/org/ChangeLog.14
-rw-r--r--lisp/org/ob-comint.el2
-rw-r--r--lisp/org/ol-doi.el2
-rw-r--r--lisp/org/ol.el8
-rw-r--r--lisp/org/org-feed.el2
-rw-r--r--lisp/org/org-plot.el6
-rw-r--r--lisp/outline.el9
-rw-r--r--lisp/pcmpl-unix.el14
-rw-r--r--lisp/play/gomoku.el5
-rw-r--r--lisp/play/spook.el2
-rw-r--r--lisp/play/tetris.el12
-rw-r--r--lisp/plstore.el1
-rw-r--r--lisp/profiler.el2
-rw-r--r--lisp/progmodes/bug-reference.el2
-rw-r--r--lisp/progmodes/cc-fonts.el23
-rw-r--r--lisp/progmodes/cfengine.el9
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/progmodes/cwarn.el3
-rw-r--r--lisp/progmodes/ebrowse.el2
-rw-r--r--lisp/progmodes/elisp-mode.el1
-rw-r--r--lisp/progmodes/flymake.el4
-rw-r--r--lisp/progmodes/gdb-mi.el6
-rw-r--r--lisp/progmodes/grep.el10
-rw-r--r--lisp/progmodes/gud.el23
-rw-r--r--lisp/progmodes/idlw-shell.el4
-rw-r--r--lisp/progmodes/idlwave.el8
-rw-r--r--lisp/progmodes/make-mode.el5
-rw-r--r--lisp/progmodes/meta-mode.el44
-rw-r--r--lisp/progmodes/modula2.el5
-rw-r--r--lisp/progmodes/octave.el4
-rw-r--r--lisp/progmodes/pascal.el15
-rw-r--r--lisp/progmodes/prolog.el10
-rw-r--r--lisp/progmodes/python.el29
-rw-r--r--lisp/progmodes/ruby-mode.el7
-rw-r--r--lisp/progmodes/sh-script.el33
-rw-r--r--lisp/progmodes/sql.el4
-rw-r--r--lisp/progmodes/tcl.el8
-rw-r--r--lisp/progmodes/which-func.el3
-rw-r--r--lisp/ps-print.el17
-rw-r--r--lisp/recentf.el4
-rw-r--r--lisp/repeat.el21
-rw-r--r--lisp/replace.el62
-rw-r--r--lisp/ruler-mode.el45
-rw-r--r--lisp/savehist.el3
-rw-r--r--lisp/select.el113
-rw-r--r--lisp/ses.el2
-rw-r--r--lisp/shell.el11
-rw-r--r--lisp/simple.el127
-rw-r--r--lisp/so-long.el10
-rw-r--r--lisp/speedbar.el7
-rw-r--r--lisp/startup.el21
-rw-r--r--lisp/strokes.el4
-rw-r--r--lisp/subr.el69
-rw-r--r--lisp/tab-bar.el150
-rw-r--r--lisp/tab-line.el2
-rw-r--r--lisp/term.el6
-rw-r--r--lisp/term/haiku-win.el22
-rw-r--r--lisp/term/ns-win.el6
-rw-r--r--lisp/term/w32-win.el1
-rw-r--r--lisp/term/x-win.el3
-rw-r--r--lisp/term/xterm.el2
-rw-r--r--lisp/textmodes/bibtex.el17
-rw-r--r--lisp/textmodes/emacs-news-mode.el49
-rw-r--r--lisp/textmodes/fill.el4
-rw-r--r--lisp/textmodes/page-ext.el15
-rw-r--r--lisp/textmodes/paragraphs.el30
-rw-r--r--lisp/textmodes/reftex-index.el8
-rw-r--r--lisp/textmodes/reftex-sel.el4
-rw-r--r--lisp/textmodes/reftex-toc.el41
-rw-r--r--lisp/textmodes/rst.el197
-rw-r--r--lisp/textmodes/sgml-mode.el15
-rw-r--r--lisp/textmodes/tex-mode.el35
-rw-r--r--lisp/textmodes/texinfo.el2
-rw-r--r--lisp/textmodes/texnfo-upd.el2
-rw-r--r--lisp/textmodes/tildify.el5
-rw-r--r--lisp/thingatpt.el2
-rw-r--r--lisp/thumbs.el103
-rw-r--r--lisp/time.el4
-rw-r--r--lisp/tooltip.el11
-rw-r--r--lisp/transient.el2
-rw-r--r--lisp/type-break.el8
-rw-r--r--lisp/url/url-cache.el2
-rw-r--r--lisp/url/url-cookie.el2
-rw-r--r--lisp/url/url-history.el2
-rw-r--r--lisp/url/url-http.el2
-rw-r--r--lisp/url/url-queue.el4
-rw-r--r--lisp/url/url-vars.el4
-rw-r--r--lisp/url/url.el2
-rw-r--r--lisp/vc/add-log.el3
-rw-r--r--lisp/vc/compare-w.el5
-rw-r--r--lisp/vc/diff-mode.el2
-rw-r--r--lisp/vc/emerge.el6
-rw-r--r--lisp/vc/vc-annotate.el3
-rw-r--r--lisp/vc/vc-bzr.el8
-rw-r--r--lisp/vc/vc-hooks.el13
-rw-r--r--lisp/vc/vc.el2
-rw-r--r--lisp/view.el68
-rw-r--r--lisp/whitespace.el2
-rw-r--r--lisp/wid-edit.el1
-rw-r--r--lisp/widget.el1
-rw-r--r--lisp/windmove.el4
-rw-r--r--lisp/window.el41
-rw-r--r--lisp/winner.el6
-rw-r--r--lisp/woman.el12
-rw-r--r--lisp/x-dnd.el405
-rw-r--r--lisp/xdg.el13
-rw-r--r--lisp/xwidget.el2
-rw-r--r--lwlib/xlwmenu.c4
-rw-r--r--m4/fchmodat.m44
-rw-r--r--m4/lchmod.m46
-rw-r--r--m4/sys_stat_h.m46
-rwxr-xr-xmake-dist2
-rw-r--r--msdos/sedlibmk.inp3
-rw-r--r--src/.lldbinit33
-rw-r--r--src/alloc.c5
-rw-r--r--src/buffer.c5
-rw-r--r--src/character.c66
-rw-r--r--src/character.h5
-rw-r--r--src/comp.c2
-rw-r--r--src/composite.c56
-rw-r--r--src/data.c9
-rw-r--r--src/dired.c24
-rw-r--r--src/dispextern.h1
-rw-r--r--src/editfns.c2
-rw-r--r--src/fileio.c22
-rw-r--r--src/fns.c330
-rw-r--r--src/frame.c81
-rw-r--r--src/gtkutil.c2
-rw-r--r--src/haiku_io.c2
-rw-r--r--src/haiku_select.cc84
-rw-r--r--src/haiku_support.cc109
-rw-r--r--src/haiku_support.h11
-rw-r--r--src/haikufns.c11
-rw-r--r--src/haikumenu.c4
-rw-r--r--src/haikuselect.c81
-rw-r--r--src/haikuselect.h7
-rw-r--r--src/haikuterm.c11
-rw-r--r--src/haikuterm.h2
-rw-r--r--src/image.c144
-rw-r--r--src/json.c6
-rw-r--r--src/keyboard.c136
-rw-r--r--src/keymap.c10
-rw-r--r--src/lisp.h19
-rw-r--r--src/lread.c29
-rw-r--r--src/minibuf.c38
-rw-r--r--src/nsmenu.m2
-rw-r--r--src/nsselect.m2
-rw-r--r--src/nsterm.h6
-rw-r--r--src/nsterm.m70
-rw-r--r--src/pgtkfns.c8
-rw-r--r--src/pgtkmenu.c2
-rw-r--r--src/pgtkselect.c31
-rw-r--r--src/pgtkterm.c27
-rw-r--r--src/print.c5
-rw-r--r--src/process.c9
-rw-r--r--src/sheap.h2
-rw-r--r--src/sqlite.c6
-rw-r--r--src/systime.h3
-rw-r--r--src/termhooks.h24
-rw-r--r--src/undo.c2
-rw-r--r--src/w32fns.c8
-rw-r--r--src/window.c5
-rw-r--r--src/xdisp.c3
-rw-r--r--src/xfaces.c224
-rw-r--r--src/xfns.c109
-rw-r--r--src/xmenu.c28
-rw-r--r--src/xselect.c100
-rw-r--r--src/xterm.c1558
-rw-r--r--src/xterm.h39
-rw-r--r--test/ChangeLog.12
-rw-r--r--test/Makefile.in8
-rw-r--r--test/lisp/calc/calc-tests.el2
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp2
-rw-r--r--test/lisp/dnd-tests.el26
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el8
-rw-r--r--test/lisp/emacs-lisp/seq-tests.el21
-rw-r--r--test/lisp/emacs-lisp/subr-x-tests.el23
-rw-r--r--test/lisp/erc/erc-networks-tests.el6
-rw-r--r--test/lisp/erc/erc-scenarios-base-reuse-buffers.el2
-rw-r--r--test/lisp/erc/erc-tests.el1
-rw-r--r--test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld2
-rw-r--r--test/lisp/erc/resources/base/assoc/reconplay/foonet.eld2
-rw-r--r--test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld2
-rw-r--r--test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld2
-rw-r--r--test/lisp/erc/resources/base/netid/bouncer/foonet.eld2
-rw-r--r--test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld2
-rw-r--r--test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld4
-rw-r--r--test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld2
-rw-r--r--test/lisp/erc/resources/erc-d/erc-d-i.el8
-rw-r--r--test/lisp/erc/resources/erc-d/erc-d-tests.el2
-rw-r--r--test/lisp/erc/resources/erc-d/resources/incremental.eld2
-rw-r--r--test/lisp/erc/resources/erc-d/resources/no-block.eld2
-rw-r--r--test/lisp/eshell/em-alias-tests.el87
-rw-r--r--test/lisp/eshell/em-dirs-tests.el102
-rw-r--r--test/lisp/eshell/em-script-tests.el62
-rw-r--r--test/lisp/eshell/esh-var-tests.el43
-rw-r--r--test/lisp/eshell/eshell-tests.el7
-rw-r--r--test/lisp/filenotify-tests.el4
-rw-r--r--test/lisp/isearch-tests.el80
-rw-r--r--test/lisp/mail/mail-extr-tests.el41
-rw-r--r--test/lisp/net/browse-url-tests.el2
-rw-r--r--test/lisp/net/tramp-tests.el27
-rw-r--r--test/lisp/progmodes/autoconf-tests.el8
-rw-r--r--test/lisp/progmodes/compile-tests.el5
-rw-r--r--test/lisp/progmodes/python-tests.el83
-rw-r--r--test/lisp/shadowfile-tests.el4
-rw-r--r--test/lisp/so-long-tests/spelling-tests.el2
-rw-r--r--test/lisp/textmodes/emacs-news-mode-resources/toggle-tag.erts131
-rw-r--r--test/lisp/textmodes/emacs-news-mode-tests.el32
-rw-r--r--test/lisp/time-stamp-tests.el17
-rw-r--r--test/lisp/x-dnd-tests.el125
-rw-r--r--test/manual/etags/ETAGS.good_1280
-rw-r--r--test/manual/etags/ETAGS.good_2376
-rw-r--r--test/manual/etags/ETAGS.good_3280
-rw-r--r--test/manual/etags/ETAGS.good_4280
-rw-r--r--test/manual/etags/ETAGS.good_5376
-rw-r--r--test/manual/etags/ETAGS.good_6376
-rw-r--r--test/manual/etags/cp-src/clheir.hpp2
-rw-r--r--test/manual/etags/merc-src/accumulator.m2
-rw-r--r--test/manual/etags/prol-src/natded.prolog2
-rwxr-xr-xtest/manual/indent/perl.perl2
-rw-r--r--test/manual/process-callout-tests.el64
-rw-r--r--test/src/buffer-tests.el8
-rw-r--r--test/src/comp-resources/comp-test-funcs.el2
-rw-r--r--test/src/comp-tests.el10
-rw-r--r--test/src/fileio-tests.el16
-rw-r--r--test/src/fns-tests.el21
-rw-r--r--test/src/json-tests.el7
-rw-r--r--test/src/keymap-tests.el8
-rw-r--r--test/src/process-tests.el29
527 files changed, 11024 insertions, 8031 deletions
diff --git a/ChangeLog.2 b/ChangeLog.2
index cf19abaa138..5a73d53b8bf 100644
--- a/ChangeLog.2
+++ b/ChangeLog.2
@@ -4040,7 +4040,7 @@
* lisp/progmodes/xref.el (xref--query-replace-1):
Say 'All results processed' at the end if the user hadn't
- cancelled the process (bug#23284).
+ canceled the process (bug#23284).
2016-05-07 Eli Zaretskii <eliz@gnu.org>
@@ -12542,7 +12542,7 @@
* lisp/erc/erc-backend.el (erc-server-setup-periodical-ping): Checks
for existing timers in the alist before adding new ones. If a
- timer already exists, it is cancelled and
+ timer already exists, it is canceled and
overwritten. (bug#19292).
2015-12-27 Jens Lechtenboerger <jens.lechtenboerger@fsfe.org>
@@ -22108,7 +22108,7 @@
* src/gfilenotify.c (dir_monitor_callback): Cancel the monitor if
the file or directory to be watched is deleted.
(Fgfile_add_watch): Make watch_object a triple.
- (Fgfile_rm_watch): Check, whether watch is cancelled already.
+ (Fgfile_rm_watch): Check, whether watch is canceled already.
(Fgfile_valid_p): New defun.
(syms_of_gfilenotify): Declare Sgfile_valid_p.
diff --git a/ChangeLog.3 b/ChangeLog.3
index d0ff14117be..c48c0ab2a3f 100644
--- a/ChangeLog.3
+++ b/ChangeLog.3
@@ -740,7 +740,7 @@
This is a partial backport from master: it only includes the changes below.
* lib/mini-gmp.c (gmp_assert_nocarry): Avoid many Clang
- unused-variable warnings when building with optimisation.
+ unused-variable warnings when building with optimization.
* lib/verify.h (_GL_HAVE__STATIC_ASSERT): Modify condition for using
_Static_assert to cope with older Apple builds of Clang exposing
misleading compiler version numbers. See discussion starting at
@@ -1381,10 +1381,10 @@
2022-03-06 Lars Ingebrigtsen <larsi@gnus.org>
- Restore documented Emacs 27.2 behaviour of browse-url-of-dired-file
+ Restore documented Emacs 27.2 behavior of browse-url-of-dired-file
* lisp/net/browse-url.el (browse-url-of-dired-file): Restore the
- documented behaviour -- open a web browser instead of passing to
+ documented behavior -- open a web browser instead of passing to
the various handlers.
2022-03-06 Kyle Meyer <kyle@kyleam.com>
@@ -2244,7 +2244,7 @@
This fixes bug #52796.
* lisp/progmodes/cc-engine.el (c-update-brace-stack): Handle a "*" like a
- semicolon, cancelling the expectation of a brace.
+ semicolon, canceling the expectation of a brace.
* lisp/progmodes/cc-langs.el (c-brace-stack-thing-key): Add a "*" into the
sets of significant characters.
@@ -2276,7 +2276,7 @@
2021-12-27 Eli Zaretskii <eliz@gnu.org>
- Fix typos in in 'reset-language-environment'
+ Fix typos in 'reset-language-environment'
* lisp/international/mule-cmds.el (reset-language-environment):
Fix a typo in 'windows-nt'. (Bug#52816)
@@ -2818,7 +2818,7 @@
2021-12-01 Alan Mackenzie <acm@muc.de>
- CC Mode: Recognise "struct foo {" as introducing a type declaration
+ CC Mode: Recognize "struct foo {" as introducing a type declaration
This fixes bug #52157.
@@ -2904,7 +2904,7 @@
2021-11-29 Andreas Schwab <schwab@linux-m68k.org>
- Avoid undefined behaviour when copying part of structure
+ Avoid undefined behavior when copying part of structure
* src/dispnew.c (copy_row_except_pointers): Don't use address of
subobject as starting point.
@@ -6061,14 +6061,14 @@
Fix previous `newline' patch
* lisp/simple.el (newline): Signal an error earlier to avoid
- peculiar behaviour after getting a backtrace (bug#50900).
+ peculiar behavior after getting a backtrace (bug#50900).
2021-09-30 Lars Ingebrigtsen <larsi@gnus.org>
Make `newline' check the argument earlier
* lisp/simple.el (newline): Signal an error earlier to avoid
- peculiar behaviour after getting a backtrace (bug#50900).
+ peculiar behavior after getting a backtrace (bug#50900).
2021-09-30 akater <nuclearspace@gmail.com>
@@ -6249,7 +6249,7 @@
etc/themes/modus-vivendi-theme.el: Bump file version.
* etc/themes/modus-themes.el (modus-themes-operandi-colors)
- (modus-themes-vivendi-colors): Recalibrate some colour values and add
+ (modus-themes-vivendi-colors): Recalibrate some color values and add
a few new ones.
(modus-themes-slanted-constructs): Remove obsolete user option.
Superseded by the alias 'modus-themes-italic-constructs'.
@@ -7105,11 +7105,11 @@
Fix byte-compiler crash for legal dynamic-binding code
- This should really be taken care of by a syntax normalisation step in
+ This should really be taken care of by a syntax normalization step in
the frontend, but there is no such step for non-lexbind code yet.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Tolerate bindingsa
- without initialising expressions.
+ without initializing expressions.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
@@ -8168,7 +8168,7 @@
This reverts commit 7e395a59b025c7f4be49294ad806addf5b1a25c9.
- The behaviour change isn't good for the majority of tar files.
+ The behavior change isn't good for the majority of tar files.
2021-09-21 Lars Ingebrigtsen <larsi@gnus.org>
@@ -8180,10 +8180,10 @@
2021-09-21 Lars Ingebrigtsen <larsi@gnus.org>
- Restore some of the previous behaviour in whitespace-display-window
+ Restore some of the previous behavior in whitespace-display-window
* lisp/whitespace.el (whitespace-display-window): Emulate previous
- behaviour (bug#50716). Code from martin rudalics <rudalics@gmx.at>.
+ behavior (bug#50716). Code from martin rudalics <rudalics@gmx.at>.
2021-09-21 Lars Ingebrigtsen <larsi@gnus.org>
@@ -8400,7 +8400,7 @@
Add docstring for 'electric-pair-p-s-i-f' and minor refactor
- Extract the "open newline between pairs behaviour" into its own
+ Extract the "open newline between pairs behavior" into its own
function, electric-pair-open-newline-between-pairs-psif.
* lisp/elec-pair.el (electric-pair-post-self-insert-function): Add
@@ -8640,7 +8640,7 @@
2021-09-20 Philip Kaludercic <philipk@posteo.net>
- Fix dolist-with-progress-reporter behaviour
+ Fix dolist-with-progress-reporter behavior
* lisp/subr.el (dolist-with-progress-reporter): Use the length of
list argument as maximal value the reporter with reach.
@@ -8725,17 +8725,17 @@
2021-09-19 Mattias Engdegård <mattiase@acm.org>
- Initialise unread buffer
+ Initialize unread buffer
The reader has an extra 1-char unread buffer that was incorrectly
- initialised to 0, which means that the first character read would
+ initialized to 0, which means that the first character read would
always be NUL. As this is often the code that looks for the
lexical-binding cookie, the first loaded source module would be
treated as dynamically bound. During bootstrapping this is loadup.el
and so its local variables got dumped into the global environment.
- * src/lread.c (unread_char): Initialise to empty.
- (Fload): Initialise here too just in case.
+ * src/lread.c (unread_char): Initialize to empty.
+ (Fload): Initialize here too just in case.
2021-09-19 Stefan Kangas <stefan@marxist.se>
@@ -10710,11 +10710,11 @@
Replace uses of a variable aliasing another variable with that aliased
variable, to allow for variable removal when possible. This also
- enables opportunities for other optimisations. Example:
+ enables opportunities for other optimizations. Example:
(let ((y x)) (f y)) => (f x)
- The optimisation is only performed if both aliased and aliasing
+ The optimization is only performed if both aliased and aliasing
variables are lexically bound. Shadowing bindings are α-renamed when
necessary for correctness. Example:
@@ -10724,7 +10724,7 @@
* lisp/emacs-lisp/byte-opt.el (byte-optimize--aliased-vars): New.
(byte-optimize-form-code-walker): Cancel aliasing upon mutation.
(byte-optimize--rename-var-body, byte-optimize--rename-var): New.
- (byte-optimize-let-form): Add the optimisation.
+ (byte-optimize-let-form): Add the optimization.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add relevant test cases.
@@ -11458,31 +11458,31 @@
2021-09-06 Mattias Engdegård <mattiase@acm.org>
- Normalise nested `progn` forms in byte-code optimiser
+ Normalize nested `progn` forms in byte-code optimizer
* lisp/emacs-lisp/byte-opt.el (byte-optimize-body): Flatten body.
This simplifies the source tree and reduces the number of different
- cases that other optimisations need to take into account.
+ cases that other optimizations need to take into account.
2021-09-06 Mattias Engdegård <mattiase@acm.org>
- More robust optimisation of `ignore`
+ More robust optimization of `ignore`
- Treat `ignore` as any other function during source-level optimisation,
- to avoid having its warning-suppression effects cancelled by repeated
+ Treat `ignore` as any other function during source-level optimization,
+ to avoid having its warning-suppression effects canceled by repeated
passes. Instead, define a custom code generation function.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't treat `ignore' specially here.
(side-effect-free-fns): Don't mark `ignore` as side-effect-free
- or error-free (although it is), since that would allow the optimiser
+ or error-free (although it is), since that would allow the optimizer
to elide calls.
* lisp/emacs-lisp/bytecomp.el (ignore, byte-compile-ignore):
Define and register a code-gen function.
2021-09-06 Mattias Engdegård <mattiase@acm.org>
- Optimise `member` and `assoc` (etc) with constant empty list
+ Optimize `member` and `assoc` (etc) with constant empty list
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-assq): New.
@@ -12720,7 +12720,7 @@
This reverts commit c8e3347ec01a9ed6dc8d88c2dbbb3a08497e8eb2.
- Jim Porter's paperwork isn't finalised yet.
+ Jim Porter's paperwork isn't finalized yet.
2021-08-26 Lars Ingebrigtsen <larsi@gnus.org>
@@ -15459,7 +15459,7 @@
Fix automatic hscrolling when line numbers are displayed
* src/xdisp.c (hscroll_window_tree): When line numbers are
- displayed, account for the the line-number space when calculating
+ displayed, account for the line-number space when calculating
the desired X coordinate on the left. (Bug#49891)
2021-08-06 Eli Zaretskii <eliz@gnu.org>
@@ -15567,11 +15567,11 @@
The current method of propagating constants through setq was unsound
because it relied on each setq form only being traversed at most once
- during optimisation, which isn't necessarily true in general; it could
+ during optimization, which isn't necessarily true in general; it could
be made to miscompile code in rare cases.
Since it was only used in limited circumstances, disabling this
- optimisation doesn't cost us much.
+ optimization doesn't cost us much.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't update the known value when traversing `setq`.
@@ -15809,7 +15809,7 @@
2021-08-03 Phil Sainty <psainty@orcon.net.nz>
- Make `global-so-long-mode' handle unrecognised file types
+ Make `global-so-long-mode' handle unrecognized file types
* lisp/so-long.el (so-long-target-modes): Add `fundamental-mode'
@@ -16299,16 +16299,16 @@
Ensure in cconv that let-bindings have the normal form (VAR EXPR)
where VAR is a valid variable name, so that we don't need to keep
- re-checking this all the time in the optimiser.
+ re-checking this all the time in the optimizer.
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-enable-variable-constprop)
(byte-optimize-warn-eliminated-variable): Remove; these were mainly
used for debugging.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form):
- Assume normalised let-bindings (with lexical-binding).
+ Assume normalized let-bindings (with lexical-binding).
Stop using the variables removed above.
- * lisp/emacs-lisp/cconv.el (cconv-convert): Ensure normalised
+ * lisp/emacs-lisp/cconv.el (cconv-convert): Ensure normalized
let-bindings. Malformed bindings are dropped after warning.
remove byte-optimize-warn-eliminated-variable
@@ -16400,7 +16400,7 @@
2021-07-30 Mattias Engdegård <mattiase@acm.org>
- Optimise let and let* whose body is constant or the last variable
+ Optimize let and let* whose body is constant or the last variable
Simplify (let ((X1 E1) ... (Xn En)) Xn)
=> (progn E1 ... En)
@@ -16409,9 +16409,9 @@
=> (let* ((X1 E1) ... (Xn-1 En-1)) En)
and similarly the case where the body is a constant, extending a
- previous optimisation that only applied to the constant nil.
+ previous optimization that only applied to the constant nil.
This reduces the number of bound variables, shortens the code, and
- enables further optimisations.
+ enables further optimizations.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Rewrite using
`pcase` and add the aforementioned transformations.
@@ -16420,7 +16420,7 @@
2021-07-30 Mattias Engdegård <mattiase@acm.org>
- Move warnings about bad let-bindings from source optimiser to cconv
+ Move warnings about bad let-bindings from source optimizer to cconv
* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form): Move warnings...
* lisp/emacs-lisp/cconv.el (cconv-convert): ...here, which is an
@@ -16428,7 +16428,7 @@
2021-07-30 Mattias Engdegård <mattiase@acm.org>
- Optimise prog1 better
+ Optimize prog1 better
Rewrite (prog1 CONST FORMS...) => (progn FORMS... CONST)
where CONST is a compile-time constant, because putting the value last
@@ -16440,23 +16440,23 @@
2021-07-30 Mattias Engdegård <mattiase@acm.org>
- Elide lexical variables in for-effect context in source optimiser
+ Elide lexical variables in for-effect context in source optimizer
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Remove for-effect uses of lexical variables. We previously relied on
- this being done by the lapcode peephole optimiser but at source level
- it enables more optimisation opportunities.
+ this being done by the lapcode peephole optimizer but at source level
+ it enables more optimization opportunities.
Keywords are elided for the same reason.
2021-07-30 Mattias Engdegård <mattiase@acm.org>
- Single source optimiser entry point
+ Single source optimizer entry point
- Make the optimiser aware of lexical arguments. Otherwise we cannot
+ Make the optimizer aware of lexical arguments. Otherwise we cannot
know for sure whether a variable is lexical or dynamic during
traversal.
- * lisp/emacs-lisp/byte-opt.el (byte-optimize-one-form): New optimiser
+ * lisp/emacs-lisp/byte-opt.el (byte-optimize-one-form): New optimizer
entry point, replacing the recursive byte-optimize-form.
* lisp/emacs-lisp/bytecomp.el (byte-optimize-one-form): Autoload.
(byte-compile-keep-pending, byte-compile-top-level):
@@ -17377,7 +17377,7 @@
`term-char-mode' doc string clarification
- * lisp/term.el (term-char-mode): Document behaviour (bug#49186).
+ * lisp/term.el (term-char-mode): Document behavior (bug#49186).
2021-07-22 Dmitry Gutov <dgutov@yandex.ru>
@@ -17614,14 +17614,14 @@
2021-07-21 Mattias Engdegård <mattiase@acm.org>
- Fix mistake in `quote` optimiser
+ Fix mistake in `quote` optimizer
Found by Pip Cet.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-quote): Fix mistake that
- made this optimiser ineffective at removing quoting of nil, t, and
+ made this optimizer ineffective at removing quoting of nil, t, and
keywords. The only obvious consequence is that we no longer need...
- (byte-optimize-form): ...a 'nil => nil normalising step here; remove.
+ (byte-optimize-form): ...a 'nil => nil normalizing step here; remove.
(byte-optimize-form-code-walker): Make the compiler warn about (quote).
2021-07-20 Juri Linkov <juri@linkov.net>
@@ -17650,7 +17650,7 @@
Strength-reduce (eq X nil) to (not X)
- * lisp/emacs-lisp/byte-opt.el (byte-optimize-eq): New optimisation,
+ * lisp/emacs-lisp/byte-opt.el (byte-optimize-eq): New optimization,
which results in better test and branch code generation where it
applies.
@@ -18263,7 +18263,7 @@
(Full support for packages or face groups): Include new items.
- (Notes on individual packages): Add notes on Avy hints, the colour of
+ (Notes on individual packages): Add notes on Avy hints, the color of
days in 'M-x calendar', and underlines in 'compilation-mode' buffers.
(What is the best setup for legibility?): Remove single word.
@@ -19806,7 +19806,7 @@
* etc/emacs-mail.desktop:
* etc/emacsclient.desktop: Automatically try to
reuse an existing frame, open a new frame, or start a new Emacs
- daemon. Add actions for specific behaviours (bug#49195).
+ daemon. Add actions for specific behaviors (bug#49195).
2021-06-30 Peter Oliver <git@mavit.org.uk>
@@ -21873,7 +21873,7 @@
2021-06-03 Mattias Engdegård <mattiase@acm.org>
- Optimise (cons X nil) to (list X)
+ Optimize (cons X nil) to (list X)
* lisp/emacs-lisp/byte-opt.el (byte-optimize-cons): New function.
@@ -22136,7 +22136,7 @@
When used with Fido, completions scroll like a typical dropdown
widget.
- If the dropdown behaviour is desired for Icomplete (instead of
+ If the dropdown behavior is desired for Icomplete (instead of
rotation), icomplete-scroll can be adjusted separately by the user.
* etc/NEWS (icomplete-vertical-mode): Reword.
@@ -22784,7 +22784,7 @@
Don't propagate lexical variables into inlined functions
- Functions compiled when inlined (thus from inside the optimiser)
+ Functions compiled when inlined (thus from inside the optimizer)
mustn't retain the lexical environment of the caller or there will be
tears. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg01227.html .
@@ -23028,7 +23028,7 @@
2021-05-25 Miha Rihtaršič <miha@kamnitnik.top>
- Try to not prioritise reading from lower file descriptors
+ Try to not prioritize reading from lower file descriptors
* src/process.c (wait_reading_process_output): When looping through
fds, continue from where we left off.
@@ -25525,7 +25525,7 @@
2021-05-04 Lars Ingebrigtsen <larsi@gnus.org>
- Fix inconsistent behaviour in find-file-noselect when using nowarn
+ Fix inconsistent behavior in find-file-noselect when using nowarn
* lisp/files.el (after-find-file): Behave the same in when
warning/not warning (bug#47850). This fixes this test case:
@@ -25595,7 +25595,7 @@
2021-05-03 Alan Third <alan@idiocy.org>
martin rudalics <rudalics@gmx.at>
- Fix incorrect resizing behaviour on macOS (bug#48157, bug#48162)
+ Fix incorrect resizing behavior on macOS (bug#48157, bug#48162)
* src/nsterm.m ([EmacsView viewDidResize:]): The drawing buffer can be
resized independently of Emacs's idea of the frame size.
@@ -27169,7 +27169,7 @@
* lisp/minibuffer.el (minibuffer--sort-by-length-alpha): New function.
(minibuffer--sort-by-position): New function extracted from
`completion-all-sorted-completions`.
- (completion-all-sorted-completions): Use use them.
+ (completion-all-sorted-completions): Use them.
2021-04-19 Daniel Mendler <mail@daniel-mendler.de>
@@ -28650,10 +28650,10 @@
2021-04-09 Mattias Engdegård <mattiase@acm.org>
- Fix condition-case optimiser bug
+ Fix condition-case optimizer bug
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't
- perform incorrect optimisations when a condition-case variable shadows
+ perform incorrect optimizations when a condition-case variable shadows
another lexical variable.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
New test case.
@@ -28762,7 +28762,7 @@
Self-TCO in `condition-case` error handlers
- * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Recognise
+ * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Recognize
`condition-case` handlers as being in the tail position.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels):
Extend test.
@@ -29248,7 +29248,7 @@
2021-04-05 Stefan Kangas <stefan@marxist.se>
- Remove local uniquify functions in favour of seq-uniq
+ Remove local uniquify functions in favor of seq-uniq
* lisp/emacs-lisp/seq.el (seq-uniq): Add autoload cookie.
* lisp/pcomplete.el: (pcomplete-uniquify-list): Use seq-uniq.
@@ -29274,7 +29274,7 @@
Obsolete local list functions in shadowfile.el
- * lisp/shadowfile.el (shadow-union): Make obsolete in favour of
+ * lisp/shadowfile.el (shadow-union): Make obsolete in favor of
cl-union. Update callers.
(shadow-find): Make into obsolete function alias for seq-find.
Update callers.
@@ -31577,7 +31577,7 @@
2021-03-18 Mattias Engdegård <mattiase@acm.org>
- Optimise tail calls in `and` and `or` forms in `cl-labels` functions
+ Optimize tail calls in `and` and `or` forms in `cl-labels` functions
* lisp/emacs-lisp/cl-macs.el (cl--self-tco): Handle `and` and `or`.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels):
@@ -31695,7 +31695,7 @@
2021-03-18 Lars Ingebrigtsen <larsi@gnus.org>
- Recognise "Verify password" as a password prompt
+ Recognize "Verify password" as a password prompt
* lisp/comint.el (comint-password-prompt-regexp): Also react to
"Verify password" (output by "zip -e") (bug#47209).
@@ -35655,7 +35655,7 @@
* lisp/emacs-lisp/rx.el (rx): Add (pred stringp) to avoid type errors,
and replace the `pred` clause for the actual match with something that
- works with pcase-let(*) without being optimised away.
+ works with pcase-let(*) without being optimized away.
* test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test cases.
2021-02-26 Stefan Kangas <stefan@marxist.se>
@@ -37602,7 +37602,7 @@
test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso:
*
test/lisp/calendar/icalendar-tests.el (icalendar-convert-anniversary-to-ical):
- Match new diary-anniversary/yearly-rrule behaviour.
+ Match new diary-anniversary/yearly-rrule behavior.
* lisp/calendar/icalendar.el (icalendar--datestring-to-isodate): Add
year-shift option. (icalendar--convert-anniversary-to-ical): Shift
@@ -38022,7 +38022,7 @@
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Keep
`minor-modes' updated.
* src/buffer.c (bset_minor_modes, Fmake_indirect_buffer)
- (reset_buffer, init_buffer_once): Initialise `minor-modes'.
+ (reset_buffer, init_buffer_once): Initialize `minor-modes'.
(syms_of_buffer): Add `minor-modes' as a new permanently-local
variable.
@@ -38399,10 +38399,10 @@
2021-02-12 Mattias Engdegård <mattiase@acm.org>
- Avoid traversing dead `if` branches in bytecode optimiser
+ Avoid traversing dead `if` branches in bytecode optimizer
There is no point in traversing conditional branches that are
- statically known never to be executed. This saves some optimisation
+ statically known never to be executed. This saves some optimization
effort, but more importantly prevents variable assignments and
references in those branches from blocking effective constant
propagation.
@@ -38412,9 +38412,9 @@
assignments.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
- Rewrite the (tail) recursion into an explicit loop. Normalise a
+ Rewrite the (tail) recursion into an explicit loop. Normalize a
return value of (quote nil) to nil, for easier subsequent
- optimisations.
+ optimizations.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't
traverse dead `if` branches. Use unconditional traversion context
when possible.
@@ -38974,7 +38974,7 @@
Make texinfmt-version variable obsolete
* lisp/textmodes/texinfmt.el (texinfmt-version): Make variable and
- command obsolete in favour of 'emacs-version'.
+ command obsolete in favor of 'emacs-version'.
(texinfo-format-region, texinfo-format-buffer-1): Use
'emacs-version' instead of above obsolete variable.
@@ -39645,7 +39645,7 @@
(let ((x (+ 2 3))) (f x)) => (f 5)
This reduces code size, eliminates stack operations, and enables
- further optimisations. The implementation is conservative, and is
+ further optimizations. The implementation is conservative, and is
strongly curtailed by the presence of variable mutation, conditions
and loops.
@@ -40828,7 +40828,7 @@
2021-01-31 Alan Mackenzie <acm@muc.de>
- Minimise the time Vminibuffer_list is in an inconsistent state (src/minibuf.c)
+ Minimize the time Vminibuffer_list is in an inconsistent state (src/minibuf.c)
src/minibuf.c (get_minibuffer): Move the XSETCAR which writes the new
minibuffer into Vminibuffer_list to immediately after the MB's creation, so
@@ -42218,7 +42218,7 @@
string in the byte-code (so the two branches return `eq` strings).
So, I think using `iso-2022-jp` is a bad idea here: it gives the
- illusion that the the `charset` info exists, even it will be lost.
+ illusion that the `charset` info exists, even it will be lost.
Eli discussed it with Handa-san a year ago, and they arrived at the
conclusion that the charset information is indeed no longer important.
@@ -43203,7 +43203,7 @@
* lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-init): Always send
the Lisp words to the process (bug#6221). This allows an existing
- ispell process to be correctly initialised.
+ ispell process to be correctly initialized.
2021-01-20 Juri Linkov <juri@linkov.net>
@@ -43500,7 +43500,7 @@
Parse square root sign in embedded Calc mode
- * lisp/calc/calc-lang.el (math-read-big-rec): Recognise √ since it may
+ * lisp/calc/calc-lang.el (math-read-big-rec): Recognize √ since it may
be used in Big mode.
2021-01-19 Mattias Engdegård <mattiase@acm.org>
@@ -45070,7 +45070,7 @@
* lisp/textmodes/paragraphs.el (mark-paragraph): Revert
eb090f65ceb0ae8a90829e911694348583135ba5 (bug#45318). This restores
- the behaviour from Emacs 27 -- further work is needed on this patch.
+ the behavior from Emacs 27 -- further work is needed on this patch.
2021-01-07 Michael Albinus <michael.albinus@gmx.de>
@@ -47854,7 +47854,7 @@
c-laomib-loop. Insert code which calls c-laomib-loop minimally, with the help
of the new cache.
- * lisp/progmodes/cc-mode.el (c-basic-common-init): Initialise the new cach
+ * lisp/progmodes/cc-mode.el (c-basic-common-init): Initialize the new cach
(at mode start).
(c-before-change): Invalidate the new cache.
(c-fl-decl-start): Add an extra check (> (point) bod-lim) to prevent looping.
@@ -49336,7 +49336,7 @@
2020-12-14 Alan Mackenzie <acm@muc.de>
- Optimise c-font-lock-<>-arglists, particularly for buffers with few <..> pairs
+ Optimize c-font-lock-<>-arglists, particularly for buffers with few <..> pairs
* lisp/progmodes/cc-fonts.el (c-font-lock-<>-arglists): In place of a regexp
search for a complicated and slow regexp, search simply for "<" outside of
@@ -49357,7 +49357,7 @@
2020-12-14 Alan Mackenzie <acm@muc.de>
- Optimise c-parse-state for large buffers with few (if any) braces.
+ Optimize c-parse-state for large buffers with few (if any) braces.
* lisp/progmodes/cc-engine.el (c-get-fallback-scan-pos): Search a maximum of
50,000 characters back for the two BODs. Return nil if we dont' find them.
@@ -50555,7 +50555,7 @@
* test/src/casefiddle-tests.el (casefiddle-tests-char-casing):
(upcase ?ß) now returns ?ẞ (U+7838), partly for technical reasons but
- the previous behaviour was arbitrary and arguably less useful.
+ the previous behavior was arbitrary and arguably less useful.
Correct upcasing of ß is normally SS, which is what Fupcase returns if
given a string, or (for special purposes) ẞ.
@@ -50644,7 +50644,7 @@
exactly what the output looks like (see
https://github.com/JetBrains/kotlin/commit/\
ffe8ae3840d7b9bdc82170c8181031f05ced68bd) and there is no reason to
- risk mismatches or expensive backtracking (bug#18109). Recognise
+ risk mismatches or expensive backtracking (bug#18109). Recognize
'info' level messages. Convert to rx.
2020-12-09 Lars Ingebrigtsen <larsi@gnus.org>
@@ -50724,7 +50724,7 @@
2020-12-09 Mattias Engdegård <mattiase@acm.org>
- Recognise ß properly as a lower-case letter (bug#11309)
+ Recognize ß properly as a lower-case letter (bug#11309)
ß was incorrectly treated as a caseless character and thus not matched
by the regexp [[:lower:]] (or, in case-folding mode, [[:upper:]]).
@@ -52985,7 +52985,7 @@
Remove keyboard anachronisms from tutorial
* etc/tutorials/TUTORIAL: Don't keep referring to EDIT as if it were a
- common name for the Meta key; since a few decades back it's labelled
+ common name for the Meta key; since a few decades back it's labeled
Alt (or Option or ⌥ but those keys usually also have 'alt' engraved on
them). Similarly, CTL is practically extinct and not worth
mentioning.
@@ -54086,7 +54086,7 @@
2020-11-19 Mattias Engdegård <mattiase@acm.org>
- More string-search optimisations
+ More string-search optimizations
All-ASCII strings cannot have substrings with non-ASCII characters in
them; use this fact to avoid searching entirely.
@@ -55761,7 +55761,7 @@
2020-11-09 Harald Jörg <haj@posteo.de>
- cperl-mode: Indentation of ')' follows customisation
+ cperl-mode: Indentation of ')' follows customization
* lisp/progmodes/cperl-mode.el (cperl-style-alist): Add
cperl-close-paren-offset to the settings for PBP style.
@@ -56835,7 +56835,7 @@
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring):
Only document the values we want to support, not the ones we
actually support.
- (define-minor-mode): Partially revert to previous behaviour.
+ (define-minor-mode): Partially revert to previous behavior.
2020-11-01 Stefan Kangas <stefan@marxist.se>
@@ -57163,7 +57163,7 @@
Since a supplied test function can do anything, assoc is not
side-effect-free (bug#44018). However, with only two arguments it is
- pure and should be optimised accordingly.
+ pure and should be optimized accordingly.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Remove 'assoc'.
(byte-optimize-assoc): Constant-propagate through 2-arg assoc calls.
@@ -57767,7 +57767,7 @@
Remove unused function in gdb-mi.el
* lisp/progmodes/gdb-mi.el (gdb-var-evaluate-expression-handler):
- Remove. (It was left behind in an old code reorganisation.)
+ Remove. (It was left behind in an old code reorganization.)
2020-10-27 Lars Ingebrigtsen <larsi@gnus.org>
@@ -58100,7 +58100,7 @@
(shortdoc-section): Remove colors.
(shortdoc-separator): New face.
(shortdoc-display-group, shortdoc--display-function): Don't use
- background colours, because that makes things harder to read.
+ background colors, because that makes things harder to read.
Separate with a horizontal line instead.
2020-10-26 Andrea Corallo <akrl@sdf.org>
@@ -58386,7 +58386,7 @@
* lisp/emacs-lisp/eldoc.el:
(eldoc-echo-area-prefer-doc-buffer): Rename from
eldoc-echo-area-prefer-doc-buffer
- (eldoc-display-in-echo-area): Rework to honour
+ (eldoc-display-in-echo-area): Rework to honor
eldoc-echo-area-prefer-doc-buffer.
2020-10-24 João Távora <joaotavora@gmail.com>
@@ -59827,7 +59827,7 @@
mixal-mode: add missed instructions
- Synchronises with latest released GNU MDK 1.2.11
+ Synchronizes with latest released GNU MDK 1.2.11
* lisp/progmodes/mixal-mode.el (mixal-operation-codes-alist):
Add missed instructions: SLB,SRB,JAE,JAO,JXE,JXO.
@@ -60030,7 +60030,7 @@
(No mixed fonts): Remove references to MELPA.
(How do the themes look like)
(Enable and load, Load automatically)
- (Configure options prior to loading, Customisation Options)
+ (Configure options prior to loading, Customization Options)
(No mixed fonts, Command prompts, Mode line, Completion UIs)
(Fringes, Line highlighting, Matching parentheses, Diffs)
(Org mode blocks, Heading styles, Tweak colors (DIY))
@@ -60212,7 +60212,7 @@
Sanitize ical data in gnus-icalendar-event-from-ical
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical):
- Sanitise the data before passing it on to the constructor. This
+ Sanitize the data before passing it on to the constructor. This
avoids backtraces on icals with extra, unknown slots (bug#43057).
2020-10-16 Basil L. Contovounesios <contovob@tcd.ie>
@@ -60262,7 +60262,7 @@
2020-10-16 Lars Ingebrigtsen <larsi@gnus.org>
- Restore vc-revision-other-window buffer-changing behaviour
+ Restore vc-revision-other-window buffer-changing behavior
* lisp/vc/vc.el (vc-revision-other-window): This function used to
change the current buffer, but this was changed in the previous
@@ -60950,14 +60950,14 @@
Add more numeric shortdocs
* lisp/emacs-lisp/shortdoc.el (shortdoc-section)
- (shortdoc-example): Lighten up colours on light backgrounds.
+ (shortdoc-example): Lighten up colors on light backgrounds.
2020-10-11 Lars Ingebrigtsen <larsi@gnus.org>
- Tweak shortdoc colours on light backgrounds
+ Tweak shortdoc colors on light backgrounds
* lisp/emacs-lisp/shortdoc.el (shortdoc-section)
- (shortdoc-example): Lighten up colours on light backgrounds.
+ (shortdoc-example): Lighten up colors on light backgrounds.
2020-10-11 Lars Ingebrigtsen <larsi@gnus.org>
@@ -62739,10 +62739,10 @@
2020-09-30 Lars Ingebrigtsen <larsi@gnus.org>
- Fix isearch-group-* colours on low-colour displays
+ Fix isearch-group-* colors on low-colour displays
* lisp/isearch.el (isearch-group-1): On low-colour displays, just
- use the normal isearch colour (bug#43702).
+ use the normal isearch color (bug#43702).
(isearch-group-2 etc): Ditto.
2020-09-30 Lars Ingebrigtsen <larsi@gnus.org>
@@ -62818,13 +62818,13 @@
2020-09-29 Lars Ingebrigtsen <larsi@gnus.org>
- Fix emacsclient -c foo.txt behaviour with many frames
+ Fix emacsclient -c foo.txt behavior with many frames
* lisp/server.el (server-execute): Pass in whether we opened a new
frame or not (bug#43645).
(server-switch-buffer): Use this to switch to the requested buffer
in the new frame if we have "emacsclient -c foo.txt", and retain
- the old behaviour if it's "emacsclient foo.txt".
+ the old behavior if it's "emacsclient foo.txt".
2020-09-29 Lars Ingebrigtsen <larsi@gnus.org>
@@ -63038,7 +63038,7 @@
2020-09-27 Mattias Engdegård <mattiase@acm.org>
- Minor string-search optimisations (bug#43598)
+ Minor string-search optimizations (bug#43598)
* src/fns.c (Fstring_search): Perform cheap all-ASCII checks before more
expensive ones. Use a faster loop when searching for non-ASCII
@@ -63896,7 +63896,7 @@
Speed up shr-insert slightly
- * lisp/net/shr.el (shr-insert): Speed up regularising spaces --
+ * lisp/net/shr.el (shr-insert): Speed up regularizing spaces --
the vast majority of the spaces are already OK, so transforming
" " to " " just takes time.
@@ -65867,7 +65867,7 @@
2020-09-11 Mattias Engdegård <mattiase@acm.org>
- Calc: regularise test names
+ Calc: regularize test names
* test/lisp/calc/calc-tests.el (calc-remove-units, calc-extract-units)
(calc-convert-units, calc-bug-23889, calc-trig, calc-format-radix)
@@ -66416,7 +66416,7 @@
2020-09-08 João Távora <joaotavora@gmail.com>
- Change icomplete-show-matches-on-no-input behaviour for Icomplete only
+ Change icomplete-show-matches-on-no-input behavior for Icomplete only
(Bug#19032), bug#43120
@@ -66552,7 +66552,7 @@
2020-09-07 João Távora <joaotavora@gmail.com>
- Better explain behaviour of icomplete--sorted-completions
+ Better explain behavior of icomplete--sorted-completions
* lisp/icomplete.el (icomplete--sorted-completions): Overhaul comment
@@ -67358,7 +67358,7 @@
wdired-do-renames: Speed up for long Emacs sessions
`dired-rename-file' calls unconditionally `dired-rename-subdir'.
- The second function performs performs a loop on all the Emacs
+ The second function performs a loop on all the Emacs
buffers; this step is only needed if FILE is a directory (bug#32899).
In a long lived Emacs session, this can make a difference
@@ -67923,9 +67923,9 @@
2020-08-30 Lars Ingebrigtsen <larsi@gnus.org>
- Tweak background colours in shr when there's indentation
+ Tweak background colors in shr when there's indentation
- * lisp/net/shr.el (shr-fill-line): Get the background colour right
+ * lisp/net/shr.el (shr-fill-line): Get the background color right
for the indentation, too.
2020-08-30 Mauro Aranda <maurooaranda@gmail.com>
@@ -68838,7 +68838,7 @@
2020-08-25 Lars Ingebrigtsen <larsi@gnus.org>
- Extend background colours in shr
+ Extend background colors in shr
* lisp/net/shr.el (shr-colorize-region): Extend backgrounds to the
end (bug#43031). This avoid ragged edges to the right when, for
@@ -69800,7 +69800,7 @@
* lisp/simple.el (read-extended-command): Allow doing interactive
searches over the completions (bug#12490). This restores the
- behaviour from Emacs 23 that was lost in Emacs 24.
+ behavior from Emacs 23 that was lost in Emacs 24.
2020-08-19 Grégoire Jadi <gregoire.jadi@univ-nantes.fr>
@@ -69870,7 +69870,7 @@
2020-08-19 Tino Calancha <tino.calancha@gmail.com>
- Make thingatpt recognise files names with @ in them
+ Make thingatpt recognize files names with @ in them
* lisp/thingatpt.el (thing-at-point-file-name-chars): Add @
(Bug#24606).
@@ -72775,7 +72775,7 @@
Tweak how whitespace-mode marks the end of the buffer
* lisp/whitespace.el (whitespace-missing-newline-at-eof): Change
- the colours to not be as angry.
+ the colors to not be as angry.
(whitespace-color-on): Don't mark the end of the buffer if point
is there.
@@ -74306,7 +74306,7 @@
(Bug#42563)
- For some time, Eldoc has has some Elisp-specific code that shouldn't
+ For some time, Eldoc has some Elisp-specific code that shouldn't
live there, but in elisp-mode.el. This can be fixed in Emacs master,
but since ElDoc is distributed in GNU Elpa and is meant to work with
Emacs 26 and 27, this means that that elisp-specific code must still
@@ -74455,11 +74455,11 @@
2020-07-25 Mattias Engdegård <mattiase@acm.org>
- Optimise 3-arg +, - and *
+ Optimize 3-arg +, - and *
Turn (+ a b c) into (+ (+ a b) c), and do the same for - and *.
The 2-arg operations have their own bytecode which results in a 1.5×
- speed-up. Furthermore, the transform enables other optimisations; for
+ speed-up. Furthermore, the transform enables other optimizations; for
example, (+ a 1 b) -> (+ (1+ a) b).
* lisp/emacs-lisp/byte-opt.el (byte-optimize-plus, byte-optimize-minus)
@@ -74558,7 +74558,7 @@
Do this conservatively for now: if the ElDoc helper buffer (as
returned by eldoc--doc-buffer) is visible and showing documentation
- for the very same "situation" (as computed by the the new
+ for the very same "situation" (as computed by the new
eldoc--request-state helper), don't request that documentation from
sources again.
@@ -74914,12 +74914,12 @@
2020-07-17 Lars Ingebrigtsen <larsi@gnus.org>
- Fix NOT-CURRENT behaviour in text-property-search-backward
+ Fix NOT-CURRENT behavior in text-property-search-backward
* lisp/emacs-lisp/text-property-search.el
- (text-property-search-backward): Fix inconsistent behaviour of
+ (text-property-search-backward): Fix inconsistent behavior of
S-TAB in eww (and other callers that use the NOT-CURRENT
- behaviour) when there are adjacent elements
+ behavior) when there are adjacent elements
(bug#39239).
2020-07-17 Xu Chunyang <xuchunyang56@gmail.com>
@@ -75842,7 +75842,7 @@
(eldoc-documentation-compose, eldoc-documentation-default): Handle
non-nil, non-string values of elements of
eldoc-documentation-functions. Use eldoc--handle-multiline.
- (eldoc-print-current-symbol-info): Honour non-nil, non-string
+ (eldoc-print-current-symbol-info): Honor non-nil, non-string
values returned by eldoc-documentation-callback.
(eldoc--make-callback): Now also a function.
(eldoc-documentation-default, eldoc-documentation-compose): Tweak docstring.
@@ -75894,7 +75894,7 @@
2020-07-07 Mattias Engdegård <mattiase@acm.org>
- Optimise assoc and rassoc with symbol key to assq and rassq
+ Optimize assoc and rassoc with symbol key to assq and rassq
This is the same transformation made for member to memq.
@@ -75926,9 +75926,9 @@
2020-07-06 Mattias Engdegård <mattiase@acm.org>
- Simplify byte-code optimisation of pure functions
+ Simplify byte-code optimization of pure functions
- Most pure functions need no explicit optimisation; we can do away with
+ Most pure functions need no explicit optimization; we can do away with
almost all uses of byte-optimize-predicate (now renamed to
byte-optimize-constant-args, since it is not just for predicates).
Also remove some superfluous arity warnings.
@@ -76176,7 +76176,7 @@
CC Mode: optimize for repeated simple operations.
- Do this by recognising that unterminated strings in a buffer are typically
+ Do this by recognizing that unterminated strings in a buffer are typically
going to be few and close together. Also optimize code for C++ attributes.
* lisp/progmodes/cc-defs.el (c-previous-single-property-change): New macro.
@@ -76492,7 +76492,7 @@
* lisp/gnus/gnus-cloud.el (gnus-cloud-download-data): Return the
result of calling `gnus-cloud-update-all' when UPDATE is t, as per the
- documented behaviour. (Bug#40280)
+ documented behavior. (Bug#40280)
2020-06-23 Andrea Corallo <akrl@sdf.org>
@@ -76795,7 +76795,7 @@
* lisp/progmodes/project.el (project-shell): Improve docstring to
include information about an implementation detail.
- * lisp/progmodes/project.el (project-eshell): Modelled after
+ * lisp/progmodes/project.el (project-eshell): Modeled after
'project-shell', change default behavior such that we don't create too
many eshell buffers by default. Use universal argument to create
subsequent buffers.
@@ -77656,14 +77656,14 @@
2020-06-10 Mattias Engdegård <mattiase@acm.org>
- Improved light/dark colour predicate (bug#41544)
+ Improved light/dark color predicate (bug#41544)
- Add a predicate, color-dark-p, for deciding whether a colour is more
+ Add a predicate, color-dark-p, for deciding whether a color is more
readable with black or white as contrast. It has experimentally been
shown to be more accurate and robust than the various methods
currently employed.
- The new predicate compares the relative luminance of the colour to an
+ The new predicate compares the relative luminance of the color to an
empirically determined cut-off value, and it seems to get it right in
almost all cases, with no value leading to outright bad results.
@@ -77825,14 +77825,14 @@
2020-06-08 Mattias Engdegård <mattiase@acm.org>
- More robust NS hex colour string parsing
+ More robust NS hex color string parsing
Invalid arguments to color-values, such as "#abcdefg" or "#1234", or
valid ones like "#111222333", should not yield nonsense values.
* src/nsterm.m (ns_get_color):
Only accept "#RGB" strings with 1-4 digits per components, equal number
- of digits each, and no trailing characters. Parse 12-bit colours
+ of digits each, and no trailing characters. Parse 12-bit colors
correctly.
2020-06-08 Michael Albinus <michael.albinus@gmx.de>
@@ -77976,7 +77976,7 @@
* lisp/emacs-lisp/comp.el (comp-symbol-values-optimizable): New
defconst.
- (comp-function-call-maybe-remove): New logic to to remove
+ (comp-function-call-maybe-remove): New logic to remove
unnecessary `symbol-value' calls.
2020-06-07 Juri Linkov <juri@linkov.net>
@@ -78280,7 +78280,7 @@
Make color-distance symmetric and more accurate
* src/xfaces.c (color_distance): Don't throw away the low 8 bits of
- the colours, and make the function symmetric (bug41544)
+ the colors, and make the function symmetric (bug41544)
(Fcolor_distance): Add caution about this not being a true metric.
* test/src/xfaces-tests.el: New file.
@@ -78808,7 +78808,7 @@
* lisp/international/ucs-normalize.el
(ucs-normalize-hfs-nfd-post-read-conversion)
(ucs-normalize-hfs-nfd-pre-write-conversion):
- Use save-match-data to avoid match data clobber in normalisation.
+ Use save-match-data to avoid match data clobber in normalization.
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-save-match-data): New test.
@@ -80375,7 +80375,7 @@
2020-05-14 Mattias Engdegård <mattiase@acm.org>
- Fix customisation of mouse-drag-and-drop-region (bug#41251)
+ Fix customization of mouse-drag-and-drop-region (bug#41251)
Reported by David Ponce.
@@ -80811,12 +80811,12 @@
cc-mode: extend regexp used by ‘c-or-c++-mode’
* lisp/progmodes/cc-mode.el (c-or-c++-mode--regexp): Expand the regexp to
- match some more C++-only constructs and recognise a few more standard
+ match some more C++-only constructs and recognize a few more standard
C++ header files. Also make sure identifiers start with non-digit.
(c-or-c++-mode): Add ‘(interactive)’ declaration.
* test/lisp/progmodes/cc-mode-tests.el (c-or-c++-mode): Add test case
- for the newly recognised constructs.
+ for the newly recognized constructs.
2020-05-09 Michal Nazarewicz <mina86@mina86.com>
@@ -82585,7 +82585,7 @@
* src/nsterm.m (ns_parent_window_rect): New function.
(NS_PARENT_WINDOW_LEFT_POS):
(NS_PARENT_WINDOW_TOP_POS): Move to nsterm.m and simplify.
- (ns_set_offset): Fix strange behaviours when using negative values.
+ (ns_set_offset): Fix strange behaviors when using negative values.
(ns_set_window_size):
(ns_set_undecorated):
([EmacsView windowDidResize:]):
@@ -82701,7 +82701,7 @@
2020-04-16 Mattias Engdegård <mattiase@acm.org>
- Regularise some file-matching regexps
+ Regularize some file-matching regexps
* admin/authors.el (authors-obsolete-files-regexps)
(authors-renamed-files-regexps): Replace ^ and $ with \` and \'.
@@ -83231,7 +83231,7 @@
* lisp/progmodes/cl-font-lock.el: Fix header and make it a minor mode
- Change copyright to FSF and licence to GPLv3+.
+ Change copyright to FSF and license to GPLv3+.
Tweak Commentary (the code doesn't seem to provide the lambda
prettification mentioned).
@@ -83624,7 +83624,7 @@
Avoid expensive recoding for ASCII identity cases (bug#40407)
- Optimise for the common case of encoding or decoding an ASCII-only
+ Optimize for the common case of encoding or decoding an ASCII-only
string using an ASCII-compatible coding, for file names in particular.
* src/coding.c (string_ascii_p): New function.
@@ -83956,7 +83956,7 @@
2020-04-03 Ashish SHUKLA <ashish.is@lostca.se>
- configure.ac: switch to POSIX sh behaviour
+ configure.ac: switch to POSIX sh behavior
2020-04-03 Federico Tedin <federicotedin@gmail.com>
@@ -85368,7 +85368,7 @@
2020-03-10 AndreaCorallo <akrl@sdf.org>
- * Fix store_function_docstring for for native functions
+ * Fix store_function_docstring for native functions
Do not Nil native_doc fields. This will be naturally dumped by
pdumper. This was affecting dumped functions.
@@ -85925,7 +85925,7 @@
(ns_dumpglyphs_stretch): Remove unused variable.
(ns_term_init):
([EmacsWindow setAppearance]): Only compile on macOS.
- (ns_mouse_position): Make sure f is initialised on GNUstep.
+ (ns_mouse_position): Make sure f is initialized on GNUstep.
* src/emacs.c (main): Move allocation of autorelease pool to before
first use.
@@ -87644,7 +87644,7 @@
2019-11-17 Prepend "unsigned" to MINI_GMP_LIMB_TYPE
2019-11-17 Enable testing with different limb sizes (types)
2019-11-20 Use already defined constants
- 2019-11-09 Avoid undefined behaviour with small limb sizes
+ 2019-11-09 Avoid undefined behavior with small limb sizes
2020-01-26 Paul Eggert <eggert@cs.ucla.edu>
@@ -91015,7 +91015,7 @@
2019-12-26 Mattias Engdegård <mattiase@acm.org>
- Optimise 'while' bodies for effect
+ Optimize 'while' bodies for effect
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Treat all expressions in the body of 'while' as for-effect,
@@ -96974,7 +96974,7 @@
* lisp/progmodes/compile.el (compilation-parse-errors):
When 'omake' is enabled, allow error messages to be indented by 0 or 6
spaces instead of any number of spaces, to avoid pathological
- behaviour.
+ behavior.
(compilation-error-regexp-alist-alist): Anchor the 'omake' pattern to
bol for performance. Repair the 'ruby-Test::Unit' pattern, which
relied on the previously over-generous 'omake' hack.
@@ -96997,7 +96997,7 @@
Speed up 'maven' compilation error message regexp
- Anchor the regexp at line-start to prevent quadratic behaviour when
+ Anchor the regexp at line-start to prevent quadratic behavior when
it doesn't match (bug#39595). It's unclear whether the type tag, like
[ERROR], is always present; we keep it optional just in case.
@@ -98121,7 +98121,7 @@
Calc: fix interval entry (bug#39040)
- * lisp/calc/calc.el (calcDigit-start): Initialise calc-prev-char to
+ * lisp/calc/calc.el (calcDigit-start): Initialize calc-prev-char to
something more reasonable, so that non-algebraic entry of intervals
whose start is a single digit, like (1..10), works properly.
Reported by Michel Schinz.
@@ -98137,7 +98137,7 @@
flymake: fix typo in variable binding (bug#38752)
- This mistake was found by an experimental elisp optimiser.
+ This mistake was found by an experimental elisp optimizer.
* lisp/progmodes/flymake-proc.el (flymake-proc-stop-all-syntax-checks):
Add missing brackets.
@@ -99239,7 +99239,7 @@
Improve sorting of flex completion style with non-nil minibuffer-default
- This affects the behaviour of flex completion when there is a default
+ This affects the behavior of flex completion when there is a default
completion and the user hasn't entered any input pattern to flex-match
against. It is most visible when icomplete-mode or fido-mode are
being used in conjunctio.
@@ -99417,7 +99417,7 @@
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
* doc/lispref/searching.texi (Regexp Functions):
Be more specific about how the KEEP-ORDER argument actually works.
- If nil, the regexp guarantees a longest match; this is the behaviour
+ If nil, the regexp guarantees a longest match; this is the behavior
that many callers implicitly rely on.
2019-12-18 Michael Albinus <michael.albinus@gmx.de>
@@ -101996,7 +101996,7 @@
Handle FC_CHARCELL in xftfont_open
* src/xftfont.c (xftfont_open): FC_CHARCELL is apparently an alias
- for FC_DUAL used in some east Asian fonts (bug#35079). Modelled
+ for FC_DUAL used in some east Asian fonts (bug#35079). Modeled
after a patch suggested by Kenichi Handa.
2019-11-17 Eli Zaretskii <eliz@gnu.org>
@@ -102147,7 +102147,7 @@
When using this option and editing input, some transient situations
may arise that lead to file-name shadowing, but that shouldn't
- necessarily lead to auto-delete behaviour, which will be surprising.
+ necessarily lead to auto-delete behavior, which will be surprising.
In '/foo/x/bar', if the user deletes the 'x', shadowing occurs, but
probably shouldn't. So, somewhat like ido-mode, only auto-tidy
@@ -102863,7 +102863,7 @@
Add extra bindings to fido-mode.
* lisp/icomplete.el (icomplete-fido-mode-map) : Add arrows and other
- bindings to reproduce ido behaviour.
+ bindings to reproduce ido behavior.
2019-11-09 Glenn Morris <rgm@gnu.org>
@@ -105275,9 +105275,9 @@
2019-10-23 Lars Ingebrigtsen <larsi@gnus.org>
- Make Gnus recognise "git am" diffs in all groups
+ Make Gnus recognize "git am" diffs in all groups
- * lisp/gnus/mm-uu.el (mm-uu-diff-groups-regexp): Recognise diffs
+ * lisp/gnus/mm-uu.el (mm-uu-diff-groups-regexp): Recognize diffs
in all groups (bug#32730).
2019-10-22 Stefan Kangas <stefankangas@gmail.com>
@@ -107975,7 +107975,7 @@
2019-10-09 Lars Ingebrigtsen <larsi@gnus.org>
- Fix possible initialisation error in shell-mode-map
+ Fix possible initialization error in shell-mode-map
* lisp/shell.el (shell-mode-map): Comint is the parent mode, so
there's no need to explicitly make it a parent map here (bug#25187).
@@ -108323,10 +108323,10 @@
2019-10-06 Lars Ingebrigtsen <larsi@gnus.org>
- Fix the colours on Motif horizontal scroll bars
+ Fix the colors on Motif horizontal scroll bars
* src/xterm.c (x_create_horizontal_toolkit_scroll_bar): Use the
- same foreground/background colours as the vertical scroll bar
+ same foreground/background colors as the vertical scroll bar
(bug#37359).
2019-10-06 Lars Ingebrigtsen <larsi@gnus.org>
@@ -109177,7 +109177,7 @@
C++ Mode: Fontify correctly declarators with identifier preceded by &
- The problem was bar in the following being spuriously recognised as a
+ The problem was bar in the following being spuriously recognized as a
function, and foo as a type, as though the & were a *: Foo foo (&bar);.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): New variable
@@ -109644,9 +109644,9 @@
2019-09-29 Lars Ingebrigtsen <larsi@gnus.org>
- Allow customising pdf-to-text parameters
+ Allow customizing pdf-to-text parameters
- * lisp/doc-view.el (doc-view-pdf->txt): Allow customising the
+ * lisp/doc-view.el (doc-view-pdf->txt): Allow customizing the
parameters (bug#8519).
(doc-view-pdftotext-program-args): New variable.
@@ -112145,12 +112145,12 @@
2019-09-14 Lars Ingebrigtsen <larsi@gnus.org>
- Add default foreground colours to SVG images
+ Add default foreground colors to SVG images
- * lisp/net/shr.el (svg--wrap-svg): Add a default foreground colour
+ * lisp/net/shr.el (svg--wrap-svg): Add a default foreground color
to SVG images (bug#37159). This helps with images like the ones
in https://en.wikipedia.org/wiki/Banach_fixed-point_theorem that
- specify no foreground or background colours.
+ specify no foreground or background colors.
(shr-parse-image-data): Use it.
2019-09-14 Lars Ingebrigtsen <larsi@gnus.org>
@@ -112955,7 +112955,7 @@
* lisp/epa-file.el (epa-file--replace-text): Gingerly replace the
text in the buffer to preserve as many markers as possible
- (bug#34720). This emulates the behaviour of Finsert_file_contents
+ (bug#34720). This emulates the behavior of Finsert_file_contents
more accurately.
(epa-file-decode-and-insert): Remove compat code.
(epa-file-insert-file-contents): Use the new function.
@@ -112967,7 +112967,7 @@
Repair change to compilation-context-lines (bug#36832)
* lisp/progmodes/compile.el (compilation-set-window):
- Restore proper behaviour when compilation-context-lines is nil,
+ Restore proper behavior when compilation-context-lines is nil,
which is the default.
2019-09-04 Michael Albinus <michael.albinus@gmx.de>
@@ -113647,7 +113647,7 @@
2019-08-29 Lars Ingebrigtsen <larsi@gnus.org>
- Tweak shr background colour handling
+ Tweak shr background color handling
* lisp/net/shr.el (shr-fill-line): Extend the background to the
end of the line when folding lines.
@@ -114426,7 +114426,7 @@
2019-08-21 Nicolas Petton <nicolas@petton.fr>
- * etc/HISTORY: Add Emacs 26.3 release release date.
+ * etc/HISTORY: Add Emacs 26.3 release date.
2019-08-21 Nicolas Petton <nicolas@petton.fr>
@@ -115755,7 +115755,7 @@
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): Check for
operators which cannot start a statement, which may follow a closing brace.
- Don't recognise an end of statement in such a case.
+ Don't recognize an end of statement in such a case.
* lisp/progmodes/cc-langs.el (c-operator-re, c-bin-tern-operators)
(c-unary-operators, c-non-after-{}-operators, c-non-after-{}-ops-re): New lang
@@ -116230,11 +116230,11 @@
2019-08-04 Lars Ingebrigtsen <larsi@gnus.org>
- Capitalise a couple of node names
+ Capitalize a couple of node names
- * doc/lispref/functions.texi (Advising Functions): Capitalise node
+ * doc/lispref/functions.texi (Advising Functions): Capitalize node
names (bug#17717).
- (Advice Combinators, Porting Old Advice): Capitalise.
+ (Advice Combinators, Porting Old Advice): Capitalize.
2019-08-04 Michael Heerdegen <michael_heerdegen@web.de>
@@ -116624,9 +116624,9 @@
2019-08-02 Lars Ingebrigtsen <larsi@gnus.org>
- Make Info-find-file ensure that Info is initialised
+ Make Info-find-file ensure that Info is initialized
- * lisp/info.el (Info-find-file): Ensure that Info is initialised,
+ * lisp/info.el (Info-find-file): Ensure that Info is initialized,
because libraries call that function (bug#19880).
2019-08-02 Lars Ingebrigtsen <larsi@gnus.org>
@@ -116743,7 +116743,7 @@
This fixes bug #36801.
* lisp/progmodes/cc-langs.el (c-pre-lambda-tokens-re): Use c-make-keywords-re
- rather than regexp-opt to make an optimised regexp out of a list of tokens.
+ rather than regexp-opt to make an optimized regexp out of a list of tokens.
2019-08-02 Lars Ingebrigtsen <larsi@gnus.org>
@@ -116843,7 +116843,7 @@
Document batch-byte-compile directory behavior
* lisp/emacs-lisp/bytecomp.el (batch-byte-compile): Document the
- behaviour with directories (bug#20867).
+ behavior with directories (bug#20867).
2019-08-01 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -117408,7 +117408,7 @@
2019-07-30 Lars Ingebrigtsen <larsi@gnus.org>
- Use decoded time accessors in in em-ls
+ Use decoded time accessors in em-ls
* lisp/eshell/em-ls.el (eshell-ls-file): Use decoded time
accessors.
@@ -118335,7 +118335,7 @@
2019-07-25 Lars Ingebrigtsen <larsi@gnus.org>
- Tweak the behaviour of thing-at-point--end-of-sexp
+ Tweak the behavior of thing-at-point--end-of-sexp
* lisp/thingatpt.el (thing-at-point--end-of-sexp): Don't return
nil when called with point between two parentheses (bug#29499).
@@ -118387,7 +118387,7 @@
Make `C-u w' in the Gnus Summary buffer open externally
- * doc/misc/gnus.texi (Article Commands): Document new behaviour.
+ * doc/misc/gnus.texi (Article Commands): Document new behavior.
* lisp/gnus/gnus-sum.el (gnus-shorten-url): New function.
(gnus-summary-browse-url): Change function to make `C-u' use the
@@ -118983,7 +118983,7 @@
* doc/lispref/hash.texi (Creating Hash, Defining Hash):
* src/fns.c (Fsxhash_eq, Fsxhash_eql, Fsxhash_equal):
Say that hashes are fixnums.
- (Fmake_hash_table): Say that that an integer rehash-size
+ (Fmake_hash_table): Say that an integer rehash-size
should be a fixnum.
* doc/lispref/hash.texi (Defining Hash): Say that hash and
comparison functions should be consistent and pure, and should
@@ -119763,9 +119763,9 @@
2019-07-14 Lars Ingebrigtsen <larsi@gnus.org>
- Tweak background colour handling in shr
+ Tweak background color handling in shr
- * lisp/net/shr.el (shr-fill-line): Keep the background colour on
+ * lisp/net/shr.el (shr-fill-line): Keep the background color on
the newline and the indentation.
2019-07-14 Lars Ingebrigtsen <larsi@gnus.org>
@@ -120232,7 +120232,7 @@
* lisp/epg.el (epg-start-encrypt)
* lisp/gnus/mml-sec.el (mml-secure-epg-encrypt): When
'mml-secure-openpgp-sign-with-sender' is non-nil message sender's
- email address (in addition to its old behaviour) will also be used
+ email address (in addition to its old behavior) will also be used
to set gpg's "--sender email@domain" option.
2019-07-12 Paul Eggert <eggert@cs.ucla.edu>
@@ -120443,7 +120443,7 @@
Support program switches in 'comint-run' command
* etc/NEWS:
- * doc/emacs/misc.texi: Describe new behaviour (bug#33037).
+ * doc/emacs/misc.texi: Describe new behavior (bug#33037).
* lisp/comint.el (comint-run): Add optional SWITCHES argument.
With prefix argument C-u, prompt for SWITCHES.
@@ -121588,11 +121588,11 @@
2019-07-04 Mattias Engdegård <mattiase@acm.org>
- Optimise more inputs to `regexp-opt' (bug#36444)
+ Optimize more inputs to `regexp-opt' (bug#36444)
Use a more precise test to determine whether the input to `regexp-opt'
- is safe to optimise when KEEP-ORDER is non-nil, permitting more inputs
- to be optimised than before. For example, ("good" "goal" "go") is now
+ is safe to optimize when KEEP-ORDER is non-nil, permitting more inputs
+ to be optimized than before. For example, ("good" "goal" "go") is now
accepted.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
@@ -122390,7 +122390,7 @@
2019-06-27 Lars Ingebrigtsen <larsi@gnus.org>
- Mention the new emacsclient -a/--eval behaviour
+ Mention the new emacsclient -a/--eval behavior
2019-06-27 Lars Ingebrigtsen <larsi@gnus.org>
@@ -122568,11 +122568,11 @@
`replace-regexp-in-string' omits the first START characters of the
input string in its return value. This is a clear bug, but fixing it
- probably causes more trouble; document the behaviour instead (bug#36372).
+ probably causes more trouble; document the behavior instead (bug#36372).
* doc/lispref/searching.texi (Search and Replace)
* lisp/subr.el (replace-regexp-in-string):
- Document current behaviour.
+ Document current behavior.
2019-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -122835,7 +122835,7 @@
* lisp/view.el (view-search): Jump to the next/prev occurrence of
the search, even if it's displayed in the buffer (bug#18131).
- This seems more logical than the previous (undocumented) behaviour.
+ This seems more logical than the previous (undocumented) behavior.
2019-06-25 Paul Eggert <eggert@cs.ucla.edu>
@@ -123019,7 +123019,7 @@
(goto-address-uri-schemes): Ditto.
(goto-address-url-regexp): Use them to compose the final regexp.
- * lisp/net/goto-addr.el: The URI schemes to be recognised by
+ * lisp/net/goto-addr.el: The URI schemes to be recognized by
`goto-address-mode' were not regexp-quoted (Bug#23343).
2019-06-25 Tino Calancha <f92capac@gmail.com>
@@ -123607,7 +123607,7 @@
Make ls-lisp--dired ape dired-noselect more closely
- * lisp/ls-lisp.el (ls-lisp--dired): Emulate the behaviour of
+ * lisp/ls-lisp.el (ls-lisp--dired): Emulate the behavior of
non-ls-lisp.el dired better by defaulting to default-directory as
dired-noselect does (bug#35390).
@@ -126549,7 +126549,7 @@
(global-auto-revert-mode): Don't use
`after-set-visited-file-name-hook' here.
(auto-revert-set-visited-file-name): Rename from
- `auto-revert--global-set-visited-file-name' and generalise.
+ `auto-revert--global-set-visited-file-name' and generalize.
* test/lisp/autorevert-tests.el (auto-revert-test06-write-file): New.
2019-06-11 Michael Albinus <michael.albinus@gmx.de>
@@ -128629,7 +128629,7 @@
* lisp/emacs-lisp/package.el (package-install-from-archive): Fix last change
- Don't place the unibyte content of of the downloaded file into
+ Don't place the unibyte content of the downloaded file into
a multibyte buffer.
2019-05-24 Michael Albinus <michael.albinus@gmx.de>
@@ -130991,10 +130991,10 @@
2019-05-05 Mattias Engdegård <mattiase@acm.org>
- Reorganise (auto-)revert nodes in the manual
+ Reorganize (auto-)revert nodes in the manual
Put all information about auto-revert into a section of its own, and
- organise the text in a more logical way. Previously it was mainly
+ organize the text in a more logical way. Previously it was mainly
described in the section about reverting (bug#35418).
* doc/emacs/files.texi (Files): Adjust menu.
@@ -133936,7 +133936,7 @@
* lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): On
detection of such a ref-qualifier, set braceassignp to nil. When this
variable has a nil value, return nil as the value of the function. On
- encountering a } when scanning backwards, recognise this as the end of a
+ encountering a } when scanning backwards, recognize this as the end of a
previous construct and stop the scan.
2019-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -138187,7 +138187,7 @@
* doc/lispref/searching.texi (Regular Expression Functions):
* etc/NEWS:
- Document the new behaviour.
+ Document the new behavior.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
Return a never-match regexp for empty inputs.
@@ -139904,7 +139904,7 @@
xref-find-definitions or xref-find-definitions-other-window how to
choose a window for the *xref* buffer or how to find windows for
displaying the results after choosing a candidate. This patch makes
- that task easier, but keeps the current behaviour intact.
+ that task easier, but keeps the current behavior intact.
* lisp/progmodes/xref.el (xref--show-pos-in-buf): Simplify.
@@ -140664,7 +140664,7 @@
image-mode: Make parameters buffer-local
Image parameters were treated as image specific, but because they
- actually were global variables, their behaviour transferred to new
+ actually were global variables, their behavior transferred to new
images.
* lisp/image-mode.el (image-transform-resize, image-transform-scale)
(image-transform-rotation): Declare with defvar-local. (Bug#33990)
@@ -140804,7 +140804,7 @@
To resolve this confusion, never cycle with C-M-i in icomplete:
non-ambiguous cycling can be achieved with C-. and C-,
- The former behaviour can still be restored with:
+ The former behavior can still be restored with:
(define-key icomplete-minibuffer-map (kbd "C-M-i") 'minibuffer-force-complete)
@@ -140929,7 +140929,7 @@
really reindented. Rewrite comment.
(electric-layout-allow-duplicate-newlines): New variable.
(electric-layout-post-self-insert-function-1): Rewrite comments.
- Honours electric-layout-allow-duplicate-newlines. Don't reindent
+ Honors electric-layout-allow-duplicate-newlines. Don't reindent
previous line because racecar.
* test/lisp/electric-tests.el: New test.
@@ -140944,7 +140944,7 @@
Remove tests of electric-pair-mode and CC-based modes
- The behaviour previously observed in cc-mode-based-modes (and every
+ The behavior previously observed in cc-mode-based-modes (and every
other major-mode) when electric-pair-mode or electric-layout-mode is
turned on may no longer be observed: this because CC-mode goes around
the generic implementation of electric-pair-mode.
@@ -142071,10 +142071,10 @@
2019-01-10 Alan Third <alan@idiocy.org>
- Fix drag and drop behaviour on NS (bug#30929)
+ Fix drag and drop behavior on NS (bug#30929)
* doc/emacs/macos.texi (Mac / GNUstep Events): Describe the new drag
- and drop behaviour.
+ and drop behavior.
* lisp/term/ns-win.el (ns-drag-n-drop): Handle the new event format.
(ns-drag-n-drop-other-frame):
(ns-drag-n-drop-as-text):
@@ -148771,7 +148771,7 @@
2018-09-09 mktime: simplify in prep for glibc merge
2018-09-07 intprops: minor clarification of code
2018-09-06 stddef: Override max_align_t on NetBSD 8.0/x86
- 2018-09-06 fcntl: Fix F_DUPFD_CLOEXEC behaviour on Haiku
+ 2018-09-06 fcntl: Fix F_DUPFD_CLOEXEC behavior on Haiku
2018-09-06 strtoll, strtoull: Rely on limits-h module
2018-09-06 limits-h: Provide numerical limits macros
2018-09-06 fcntl: Don't access nonexistent optional argument
@@ -149671,7 +149671,7 @@
* lisp/textmodes/bibtex.el (bibtex-next-entry)
(bibtex-previous-entry): New commands.
- (bibtex-mode-map): Bind to to forward-paragraph and
+ (bibtex-mode-map): Bind to forward-paragraph and
backward-paragraph. Add to menu under "Moving inside an Entry".
2018-08-27 Noam Postavsky <npostavs@gmail.com>
@@ -151024,7 +151024,7 @@
2018-08-09 João Távora <joaotavora@gmail.com>
- Synchronous JSONRPC requests can be cancelled on user input
+ Synchronous JSONRPC requests can be canceled on user input
This allows building more responsive interfaces, such as a snappier
completion backend.
@@ -154022,7 +154022,7 @@
Tweak previous gnutls change for efficiency
- * src/gnutls.c (Fgnutls_peer_status): Minor optimisation to avoid
+ * src/gnutls.c (Fgnutls_peer_status): Minor optimization to avoid
computing the topmost certificate twice.
2018-06-24 Lars Ingebrigtsen <larsi@gnus.org>
@@ -157117,7 +157117,7 @@
* lisp/window.el (scroll-other-window-down):
Move to src/window.c as Fscroll_other_window_down.
- * src/window.c (scroll_command): Generalise for arbitrary windows.
+ * src/window.c (scroll_command): Generalize for arbitrary windows.
(Fscroll_up, Fscroll_down): Use scroll_command with selected_window.
(Fscroll_other_window, Fscroll_other_window_down):
Rewrite in terms of scroll_command.
@@ -157841,7 +157841,7 @@
326a296 ; * etc/NEWS: Mention 'display-buffer-in-major-side-window' c...
3bdc9a1 Fix flyspell-auto-correct-previous-word broken by recent change
a539eb5 * test/src/lread-tests.el (lread-test-bug-31186): New test.
- 3fa472b Fix undefined behaviour while looking for lexical-binding fil...
+ 3fa472b Fix undefined behavior while looking for lexical-binding fil...
4341aac Minor wording improvement in "Bookmarks"
Conflicts:
@@ -158441,7 +158441,7 @@
* lisp/gnus/gnus-group.el (gnus-update-group-mark-positions):
Rewrite a call to string-to-multibyte that didn't even work.
After the rewrite it gives the correct result and should allow
- people to customise Gnus group process mark positions (but that's
+ people to customize Gnus group process mark positions (but that's
a pretty obscure feature).
2018-04-14 Lars Ingebrigtsen <larsi@gnus.org>
@@ -158767,9 +158767,9 @@
From the discussion on the ding mailing list, I said:
- I think the colours should be reverted back to what they were before the
+ I think the colors should be reverted back to what they were before the
change. Normal text should be white on black (if you have a dark
- background), and colours should be used to emphasise or de-emphasise
+ background), and colors should be used to emphasize or de-emphasize
certain text. Following that principle, normal Gnus groups should be
white, not ... er... what are they now? Teal?
@@ -160198,8 +160198,8 @@
and numeric conversion in function in order to parse -signal and
-SIGNALNAME correctly.
* doc/misc/eshell.texi (kill): Update docs to reflect new function
- behaviour.
- * etc/NEWS: Mention new eshell/kill behaviour.
+ behavior.
+ * etc/NEWS: Mention new eshell/kill behavior.
2018-03-25 Noam Postavsky <npostavs@gmail.com>
@@ -164749,7 +164749,7 @@
2018-01-16 Alan Mackenzie <acm@muc.de>
- C++ Mode: Fontify correctly uniform initialisation with inner parentheses.
+ C++ Mode: Fontify correctly uniform initialization with inner parentheses.
E.g.: someStruct x ( (nullptr != y) ? 3 : 4 )
Also fontify declarations of function pointers correctly.
@@ -168798,7 +168798,7 @@
413978727c Simplify Flymake user documentation
6ff18c3995 * etc/NEWS: Mention the new version of Org.
b78332c3c6 Don't use (format "%s" ...) for string copying (Bug#28774)
- 078fb7f6df Make frame-list-z-order on NS match Windows behaviour (bug...
+ 078fb7f6df Make frame-list-z-order on NS match Windows behavior (bug...
# Conflicts:
# etc/NEWS
@@ -186364,7 +186364,7 @@
* lisp/progmodes/flymake-proc.el
(flymake-proc--diagnostics-for-pattern): Rewrite (using cl-loop) to
- honour more sophisticated flymake-proc-diagnostic-type-pred.
+ honor more sophisticated flymake-proc-diagnostic-type-pred.
(flymake-warning-re): Is now an obsolete alias for
flymake-proc-diagnostic-type-pred.
(flymake-proc-diagnostic-type-pred): Rename and augment from
@@ -186529,7 +186529,7 @@
Lay some groundwork for a more flexible approach that allows for
different classes of diagnostics, not necessarily line-based.
Importantly, one overlay per diagnostic is created, whereas the
- original implementation had one per line, and on it it concatenated
+ original implementation had one per line, and on it concatenated
the results of errors and warnings.
This means that currently, an error and warning on the same line are
@@ -202820,7 +202820,7 @@
titlecase_char_table member. It’s set to the ‘titlecase’ Unicode
property table if capitalization has been requested.
(case_character): Make use of the titlecase_char_table to title-case
- initial characters when capitalising.
+ initial characters when capitalizing.
* test/src/casefiddle-tests.el (casefiddle-tests--characters,
casefiddle-tests-casing): Update test cases which are now passing.
@@ -205075,7 +205075,7 @@
* lisp/net/tramp.el (tramp-completion-mode): Fix docstring.
(tramp-completion-mode-p): Optional parameter VEC. Replace
- check for `last-input-event' by analysing VEC argument.
+ check for `last-input-event' by analyzing VEC argument.
(tramp-error-with-buffer, tramp-file-name-handler)
(tramp-connectable-p, tramp-handle-file-name-as-directory):
* lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use it.
diff --git a/admin/admin.el b/admin/admin.el
index 6be378b9246..c84287a7024 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -488,10 +488,11 @@ the @import directive."
(delete-region opoint (point))
(search-forward "<meta http-equiv=\"Content-Style")
(setq opoint (match-beginning 0)))
+ (search-forward "<title>")
+ (delete-region opoint (match-beginning 0))
(search-forward "</title>\n")
- (delete-region opoint (point))
- (search-forward "<link href=")
- (goto-char (match-beginning 0))
+ (when (search-forward "<link href=" nil t)
+ (goto-char (match-beginning 0)))
(insert manual-links-string)
(setq opoint (point))
(search-forward "</head>")
@@ -617,7 +618,7 @@ style=\"text-align:left\">")
;; its original form.
(when (or (search-forward "<ul class=\"menu\">" nil t)
;; FIXME? The following search seems dangerously lax.
- (search-forward "<ul>"))
+ (search-forward "<ul>" nil t))
;; Convert the list that Makeinfo made into a table.
(replace-match "<table style=\"float:left\" width=\"100%\">")
(forward-line 1)
diff --git a/admin/gitmerge.el b/admin/gitmerge.el
index 5da70a40285..a214dcbcb74 100644
--- a/admin/gitmerge.el
+++ b/admin/gitmerge.el
@@ -124,7 +124,7 @@ If nil, the function `gitmerge-default-branch' guesses.")
(let ((coding-system-for-read vc-git-log-output-coding-system))
(call-process "git" nil t nil "show" (format "%s:configure.ac" branch)))
(goto-char (point-min)))
- (re-search-forward "^AC_INIT([^,]+, \\([0-9]+\\)\\.")
+ (re-search-forward "^AC_INIT([^,]+, \\[?\\([0-9]+\\)\\.")
(string-to-number (match-string 1))))
(defun gitmerge-default-branch ()
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 98001e24e7d..6990f27bfa0 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -15,8 +15,8 @@ Steps to take before starting on the first pretest in any release sequence:
2. Consider increasing the value of the variable
'customize-changed-options-previous-release' in cus-edit.el to
refer to a newer version of Emacs. (This is now done when cutting
- the release branch, see admin/release-branch.txt.)
- Commit cus-edit.el if changed.
+ the release branch, see admin/release-branch.txt, but it can't
+ hurt to double check its value.) Commit cus-edit.el if changed.
3. Remove any old pretests from https://alpha.gnu.org/gnu/emacs/pretest.
You can use 'gnupload --delete' (see below for more gnupload details).
@@ -24,8 +24,8 @@ Steps to take before starting on the first pretest in any release sequence:
General steps (for each step, check for possible errors):
-1. git pull # fetch from the repository
- git status # check for locally modified files
+1. git pull # fetch from the repository
+ git status # check for locally modified files
Ensure that you have a clean, unmodified state.
If you switched in-place from another branch to the release branch,
@@ -49,6 +49,9 @@ General steps (for each step, check for possible errors):
files will end up in the tarball. Otherwise, the *.eln files
might not build correctly on the user's system.
+ ./autogen.sh
+ ./configure --with-native-compilation && make
+
For a release (as opposed to pretest), delete any left-over "---"
and "+++" markers from etc/NEWS, as well as the "Temporary note"
section at the beginning of that file, and commit etc/NEWS if it
@@ -284,7 +287,8 @@ General steps (for each step, check for possible errors):
https://alpha.gnu.org/gnu/emacs/pretest/ for a pretest, or
https://ftp.gnu.org/gnu/emacs/ for a release.
- Download them and check the signatures. Check they build.
+ Download them and check the signatures and SHA1/SHA256 checksums.
+ Check they build.
11. Send an announcement to: emacs-devel, and bcc: info-gnu-emacs@gnu.org.
For a pretest, also bcc: platform-testers@gnu.org.
@@ -302,12 +306,20 @@ General steps (for each step, check for possible errors):
To create the included SHA1 and SHA256 checksums, run:
- sha1sum emacs-NEW.tar.xz
- sha256sum emacs-NEW.tar.xz
+ sha1sum emacs-NEW.tar.xz
+ sha256sum emacs-NEW.tar.xz
+
+ You can optionally sign the announcement email, probably using the
+ same PGP key that you used for signing the tarball.
+ (Use e.g. `M-x mml-secure-message-sign' in `message-mode' to sign
+ an email.)
12. After a release, update the Emacs pages as described below.
-13. Bump the Emacs version on the release branch.
+13. After a release, bump the Emacs version on the release branch.
+ There is no need to bump the version after a pretest; the version
+ is bumped before the next pretest or release instead.
+
If the released version was XX.Y, use 'set-version' from
admin/admin.el to bump the version on the release branch to
XX.Y.50. Commit the changes.
@@ -315,8 +327,8 @@ General steps (for each step, check for possible errors):
UPDATING THE EMACS WEB PAGES AFTER A RELEASE
As soon as possible after a release, the Emacs web pages at
-https://www.gnu.org/software/emacs/ should be updated. (See
-admin/notes/www for general information.)
+https://www.gnu.org/software/emacs/ should be updated.
+(See admin/notes/www for general information.)
The pages to update are:
@@ -332,7 +344,7 @@ looks like this:
<div class="release-banner">
<div class="container">
- <h2><em>Emacs 27.1 is out</em>, download it <a href="download.html">here</a>!</h2>
+ <h2><em>Emacs 28.1 is out</em>, download it <a href="download.html">here</a>!</h2>
</div>
</div>
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index ea3d23686f4..4dd6a4d222f 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -51,7 +51,7 @@ GNULIB_MODULES='
'
AVOIDED_MODULES='
- btowc close crypto/af_alg dup fchdir fstat langinfo lock
+ btowc chmod close crypto/af_alg dup fchdir fstat langinfo lock
mbrtowc mbsinit memchr mkdir msvc-inval msvc-nothrow nl_langinfo
openat-die opendir pthread-h raise
save-cwd select setenv sigprocmask stat stdarg stdbool
diff --git a/admin/notes/multi-tty b/admin/notes/multi-tty
index 9b3f1606a1b..84bc1b77d4e 100644
--- a/admin/notes/multi-tty
+++ b/admin/notes/multi-tty
@@ -474,7 +474,7 @@ THINGS TO DO
definition.
Exceptions found so far: x-select-text and
- x-selection-value (old name: x-cut-buffer-or-selection-value).
+ x-selection-value.
** Have a look at fatal_error_hook.
diff --git a/admin/notes/spelling b/admin/notes/spelling
index b783227a37a..b20f68bf624 100644
--- a/admin/notes/spelling
+++ b/admin/notes/spelling
@@ -6,6 +6,6 @@ Re "behavior" vs "behaviour", etc.
for new text (code, docs), choose the US variant.
- It's probably (IMHO --ttn, 2017-10-13) not a high priority to
- change existing text; use your best judgement (ask if unsure).
+ change existing text; use your best judgment (ask if unsure).
- https://lists.gnu.org/r/emacs-devel/2005-06/msg00489.html
diff --git a/admin/nt/dist-build/README-scripts b/admin/nt/dist-build/README-scripts
index 6b1adbe03e1..e99fbe07062 100644
--- a/admin/nt/dist-build/README-scripts
+++ b/admin/nt/dist-build/README-scripts
@@ -131,7 +131,7 @@ The process is the same as for building from the master branch, except
that the release branch should already exist as a worktree, and the
version number must be added to the command line with `build-zips.sh
-V 27 -s`. The final zips will be named after the branch rather than
-the version (e.g emacs-27-2019-12-26.zip) rather than than the Emacs
+the version (e.g emacs-27-2019-12-26.zip) rather than the Emacs
version (e.g emacs-27.0.50.zip).
diff --git a/admin/nt/dist-build/build-zips.sh b/admin/nt/dist-build/build-zips.sh
index 77d20a5a7b9..39ac1fde604 100755
--- a/admin/nt/dist-build/build-zips.sh
+++ b/admin/nt/dist-build/build-zips.sh
@@ -148,7 +148,7 @@ done
if [ -z $ACTUAL_VERSION ];
then
ACTUAL_VERSION=`
- sed -n 's/^AC_INIT(GNU Emacs,[ ]*\([^ ,)]*\).*/\1/p' < ../../../configure.ac
+ sed -n 's/^AC_INIT(\[*GNU Emacs]*,[ ]*\[*\([^] ,)]*\).*/\1/p' < ../../../configure.ac
`
fi
diff --git a/admin/quick-install-emacs b/admin/quick-install-emacs
index 9a73cf5a401..b0a1d342518 100755
--- a/admin/quick-install-emacs
+++ b/admin/quick-install-emacs
@@ -172,10 +172,10 @@ test x"$prefix" = x && { prefix="`get_config_var prefix`" || exit 4 ; }
test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; }
VERSION=`
- sed -n 's/^AC_INIT([ ]*emacs[ ]*,[ ]*\([^ ),]*\).*/\1/p' <$SRC/configure.ac
+ sed -n 's/^AC_INIT([ ]*\[*emacs]*[ ]*,[ ]*\[*\([^] ),]*\).*/\1/p' <$SRC/configure.ac
` || exit 4
test -n "$VERSION" || VERSION=`
- sed -n 's/^AC_INIT([ ]*GNU Emacs[ ]*,[ ]*\([^ ),]*\).*/\1/p' <$SRC/configure.ac
+ sed -n 's/^AC_INIT([ ]*\[*GNU Emacs]*[ ]*,[ ]*\[*\([^] ),]*\).*/\1/p' <$SRC/configure.ac
` || exit 4
test -n "$VERSION" || { printf '%s\n' >&2 "$me: no version in configure.ac"; exit 4; }
diff --git a/autogen.sh b/autogen.sh
index 03f647e576c..041468edcd9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -35,7 +35,7 @@
progs="autoconf"
## Minimum versions we need:
-autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.ac`
+autoconf_min=`sed -n 's/^ *AC_PREREQ(\[\([0-9\.]*\)]).*/\1/p' configure.ac`
## $1 = program, eg "autoconf".
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 160ecf0951b..1817bdce90d 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -4,7 +4,7 @@
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2022-05-08'
+timestamp='2022-05-25'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -1378,8 +1378,11 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
GUESS=i586-pc-haiku
;;
- x86_64:Haiku:*:*)
- GUESS=x86_64-unknown-haiku
+ ppc:Haiku:*:*) # Haiku running on Apple PowerPC
+ GUESS=powerpc-apple-haiku
+ ;;
+ *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
+ GUESS=$UNAME_MACHINE-unknown-haiku
;;
SX-4:SUPER-UX:*:*)
GUESS=sx4-nec-superux$UNAME_RELEASE
diff --git a/build-aux/config.sub b/build-aux/config.sub
index 9b62e37c43c..dba16e84c77 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2021 Free Software Foundation, Inc.
+# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2021-12-25'
+timestamp='2022-01-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -76,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2021 Free Software Foundation, Inc.
+Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
diff --git a/configure.ac b/configure.ac
index 17f86627a7d..45b62647e71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,9 +21,10 @@ dnl
dnl You should have received a copy of the GNU General Public License
dnl along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
-AC_PREREQ(2.65)
+AC_PREREQ([2.65])
dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el.
-AC_INIT(GNU Emacs, 29.0.50, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/)
+AC_INIT([GNU Emacs], [29.0.50], [bug-gnu-emacs@gnu.org], [],
+ [https://www.gnu.org/software/emacs/])
dnl Set emacs_config_options to the options of 'configure', quoted for the shell,
dnl and then quoted again for a C string. Separate options with spaces.
@@ -64,13 +65,13 @@ for opt in "$@" CFLAGS CPPFLAGS LDFLAGS; do
optsep=' '
done
-AC_CONFIG_HEADERS(src/config.h:src/config.in)
-AC_CONFIG_SRCDIR(src/lisp.h)
-AC_CONFIG_AUX_DIR(build-aux)
-AC_CONFIG_MACRO_DIR(m4)
+AC_CONFIG_HEADERS([src/config.h:src/config.in])
+AC_CONFIG_SRCDIR([src/lisp.h])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
xcsdkdir=
-AC_CHECK_PROGS(XCRUN, [xcrun])
+AC_CHECK_PROGS([XCRUN], [xcrun])
if test -n "$XCRUN"; then
if test -z "$MAKE"; then
dnl Call the variable MAKE_PROG, not MAKE, to avoid confusion with
@@ -199,7 +200,7 @@ etcdocdir='${datadir}/emacs/${version}/etc'
gamedir='${localstatedir}/games/emacs'
dnl Special option to disable the most of other options.
-AC_ARG_WITH(all,
+AC_ARG_WITH([all],
[AS_HELP_STRING([--without-all],
[omit almost all features and build
small executable with minimal dependencies])],
@@ -278,41 +279,45 @@ AC_ARG_WITH([pop],
*) with_pop=no-by-default;;
esac])
if test "$with_pop" = yes; then
- AC_DEFINE(MAIL_USE_POP)
+ AC_DEFINE([MAIL_USE_POP])
fi
-AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl
+AH_TEMPLATE([MAIL_USE_POP], [Define to support POP mail retrieval.])dnl
OPTION_DEFAULT_OFF([kerberos],[support Kerberos-authenticated POP])
if test "$with_kerberos" != no; then
- AC_DEFINE(KERBEROS)
+ AC_DEFINE([KERBEROS])
fi
-AH_TEMPLATE(KERBEROS,
+AH_TEMPLATE([KERBEROS],
[Define to support Kerberos-authenticated POP mail retrieval.])dnl
OPTION_DEFAULT_OFF([kerberos5],[support Kerberos version 5 authenticated POP])
if test "${with_kerberos5}" != no; then
if test "${with_kerberos}" = no; then
with_kerberos=yes
- AC_DEFINE(KERBEROS)
+ AC_DEFINE([KERBEROS])
fi
- AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])
+ AC_DEFINE([KERBEROS5], [1],
+ [Define to use Kerberos 5 instead of Kerberos 4.])
fi
OPTION_DEFAULT_OFF([hesiod],[support Hesiod to get the POP server host])
dnl FIXME hesiod support may not be present, so it seems like an error
dnl to define, or at least use, this unconditionally.
if test "$with_hesiod" != no; then
- AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])
+ AC_DEFINE([HESIOD], [1],
+ [Define to support using a Hesiod database to find the POP server.])
fi
OPTION_DEFAULT_OFF([mail-unlink],[unlink, rather than empty, mail spool after reading])
if test "$with_mail_unlink" != no; then
- AC_DEFINE(MAIL_UNLINK_SPOOL, 1, [Define to unlink, rather than empty, mail spool after reading.])
+ AC_DEFINE([MAIL_UNLINK_SPOOL], [1],
+ [Define to unlink, rather than empty, mail spool after reading.])
fi
AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME],
[string giving default POP mail host])],
- AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.]))
+ AC_DEFINE_UNQUOTED([MAILHOST], ["$withval"],
+ [String giving fallback POP mail host.]))
AC_ARG_WITH([sound],[AS_HELP_STRING([--with-sound=VALUE],
[compile with sound support (VALUE one of: yes, alsa, oss, bsd-ossaudio, no;
@@ -395,7 +400,8 @@ if test "$with_dumping" = "unexec" && test "$with_unexec" = "no"; then
fi
if test "$with_pdumper" = "yes"; then
- AC_DEFINE([HAVE_PDUMPER], 1, [Define to build with portable dumper support])
+ AC_DEFINE([HAVE_PDUMPER], [1],
+ [Define to build with portable dumper support])
HAVE_PDUMPER=yes
else
HAVE_PDUMPER=no
@@ -403,7 +409,7 @@ fi
AC_SUBST([HAVE_PDUMPER])
DUMPING=$with_dumping
-AC_SUBST(DUMPING)
+AC_SUBST([DUMPING])
dnl FIXME currently it is not the last.
dnl This should be the last --with option, because --with-x is
@@ -436,7 +442,7 @@ OPTION_DEFAULT_OFF([wide-int],
at the cost of 10% to 30% slowdown of Lisp interpreter
and larger memory footprint])
if test "$with_wide_int" = yes; then
- AC_DEFINE([WIDE_EMACS_INT], 1, [Use long long for EMACS_INT if available.])
+ AC_DEFINE([WIDE_EMACS_INT], [1], [Use long long for EMACS_INT if available.])
fi
dnl _ON results in a '--without' option in the --help output, so
@@ -522,7 +528,7 @@ OPTION_DEFAULT_OFF([be-cairo],
[enable use of cairo under Haiku's Application Kit])
## Makefile.in needs the cache file name.
-AC_SUBST(cache_file)
+AC_SUBST([cache_file])
## This is an option because I do not know if all info/man support
## compressed files, nor how to test if they do so.
@@ -530,7 +536,7 @@ OPTION_DEFAULT_ON([compress-install],
[don't compress some files (.el, .info, etc.) when installing. Equivalent to:
make GZIP_PROG= install])
-AC_ARG_WITH(gameuser,dnl
+AC_ARG_WITH([gameuser],
[AS_HELP_STRING([--with-gameuser=USER_OR_GROUP],
[user for shared game score files.
An argument prefixed by ':' specifies a group instead.])])
@@ -543,7 +549,7 @@ case ${with_gameuser} in
*) gameuser=${with_gameuser} ;;
esac
-AC_ARG_WITH([gnustep-conf],dnl
+AC_ARG_WITH([gnustep-conf],
[AS_HELP_STRING([--with-gnustep-conf=FILENAME],
[name of GNUstep configuration file to use on systems where the command
'gnustep-config' does not work; default $GNUSTEP_CONFIG_FILE, or
@@ -553,24 +559,24 @@ test "X${with_gnustep_conf}" != X && test "${with_gnustep_conf}" != yes && \
test "X$GNUSTEP_CONFIG_FILE" = "X" && \
GNUSTEP_CONFIG_FILE=/etc/GNUstep/GNUstep.conf
-AC_ARG_ENABLE(ns-self-contained,
+AC_ARG_ENABLE([ns-self-contained],
[AS_HELP_STRING([--disable-ns-self-contained],
[disable self contained build under NeXTstep])],
- EN_NS_SELF_CONTAINED=$enableval,
- EN_NS_SELF_CONTAINED=yes)
+ [EN_NS_SELF_CONTAINED=$enableval],
+ [EN_NS_SELF_CONTAINED=yes])
locallisppathset=no
-AC_ARG_ENABLE(locallisppath,
+AC_ARG_ENABLE([locallisppath],
[AS_HELP_STRING([--enable-locallisppath=PATH],
[directories Emacs should search for lisp files specific
to this site])],
-if test "${enableval}" = "no"; then
+[if test "${enableval}" = "no"; then
locallisppath=
elif test "${enableval}" != "yes"; then
locallisppath=${enableval} locallisppathset=yes
-fi)
+fi])
-AC_ARG_ENABLE(checking,
+AC_ARG_ENABLE([checking],
[AS_HELP_STRING([--enable-checking@<:@=LIST@:>@],
[enable expensive checks. With LIST,
enable only specific categories of checks.
@@ -603,17 +609,17 @@ do
stringfreelist) ac_gc_check_string_free_list=1 ;;
structs) CHECK_STRUCTS=true ;;
glyphs) ac_glyphs_debug=1 ;;
- *) AC_MSG_ERROR(unknown check category $check) ;;
+ *) AC_MSG_ERROR([unknown check category $check]) ;;
esac
done
IFS="$ac_save_IFS"
if test x$ac_enable_checking != x ; then
- AC_DEFINE(ENABLE_CHECKING, 1,
+ AC_DEFINE([ENABLE_CHECKING], [1],
[Define to 1 if expensive run-time data type and consistency checks are enabled.])
fi
if $CHECK_STRUCTS; then
- AC_DEFINE([CHECK_STRUCTS], 1,
+ AC_DEFINE([CHECK_STRUCTS], [1],
[Define this to check whether someone updated the portable dumper
code after changing the layout of a structure that it uses.
If you change one of these structures, check that the pdumper.c
@@ -622,21 +628,21 @@ if $CHECK_STRUCTS; then
fi
AC_SUBST([CHECK_STRUCTS])
if test x$ac_gc_check_stringbytes != x ; then
- AC_DEFINE(GC_CHECK_STRING_BYTES, 1,
+ AC_DEFINE([GC_CHECK_STRING_BYTES], [1],
[Define this temporarily to hunt a bug. If defined, the size of
strings is redundantly recorded in sdata structures so that it can
be compared to the sizes recorded in Lisp strings.])
fi
if test x$ac_gc_check_string_overrun != x ; then
- AC_DEFINE(GC_CHECK_STRING_OVERRUN, 1,
+ AC_DEFINE([GC_CHECK_STRING_OVERRUN], [1],
[Define this to check for short string overrun.])
fi
if test x$ac_gc_check_string_free_list != x ; then
- AC_DEFINE(GC_CHECK_STRING_FREE_LIST, 1,
+ AC_DEFINE([GC_CHECK_STRING_FREE_LIST], [1],
[Define this to check the string free list.])
fi
if test x$ac_glyphs_debug != x ; then
- AC_DEFINE(GLYPH_DEBUG, 1,
+ AC_DEFINE([GLYPH_DEBUG], [1],
[Define this to enable glyphs debugging code.])
fi
@@ -644,7 +650,7 @@ dnl The name of this option is unfortunate. It predates, and has no
dnl relation to, the "sampling-based elisp profiler" added in 24.3.
dnl Actually, it stops it working.
dnl https://lists.gnu.org/r/emacs-devel/2012-11/msg00393.html
-AC_ARG_ENABLE(profiling,
+AC_ARG_ENABLE([profiling],
[AS_HELP_STRING([--enable-profiling],
[build emacs with low-level, gprof profiling support.
Mainly useful for debugging Emacs itself. May not work on
@@ -655,15 +661,15 @@ if test x$ac_enable_profiling != x ; then
else
PROFILING_CFLAGS=
fi
-AC_SUBST(PROFILING_CFLAGS)
+AC_SUBST([PROFILING_CFLAGS])
-AC_ARG_ENABLE(autodepend,
+AC_ARG_ENABLE([autodepend],
[AS_HELP_STRING([--enable-autodepend],
[automatically generate dependencies to .h-files.
Requires gcc, enabled if found.])],
[ac_enable_autodepend="${enableval}"],[ac_enable_autodepend=yes])
-AC_ARG_ENABLE(gtk-deprecation-warnings,
+AC_ARG_ENABLE([gtk-deprecation-warnings],
[AS_HELP_STRING([--enable-gtk-deprecation-warnings],
[Show Gtk+/Gdk deprecation warnings for Gtk+ >= 3.0])],
[ac_enable_gtk_deprecation_warnings="${enableval}"],[])
@@ -866,7 +872,7 @@ AC_DEFUN([_AC_PROG_CC_C89], [$2])
dnl Sets GCC=yes if using gcc.
AC_PROG_CC([gcc cc cl clang "$XCRUN gcc" "$XCRUN clang"])
if test -n "$XCRUN"; then
- AC_CHECK_PROGS(AR, [ar "$XCRUN ar"])
+ AC_CHECK_PROGS([AR], [ar "$XCRUN ar"])
test -n "$AR" && export AR
fi
@@ -1008,7 +1014,7 @@ AC_ARG_ENABLE([check-lisp-object-type],
[Enable compile time checks for the Lisp_Object data type,
which can catch some bugs during development.])])
if test "$enable_check_lisp_object_type" = yes; then
- AC_DEFINE([CHECK_LISP_OBJECT_TYPE], 1,
+ AC_DEFINE([CHECK_LISP_OBJECT_TYPE], [1],
[Define to enable compile-time checks for the Lisp_Object data type.])
fi
@@ -1157,7 +1163,7 @@ edit_cflags="
s/^ //
"
-AC_ARG_ENABLE(link-time-optimization,
+AC_ARG_ENABLE([link-time-optimization],
[AS_HELP_STRING([--enable-link-time-optimization],
[build with link-time optimization
(experimental; see INSTALL)])],
@@ -1267,7 +1273,7 @@ fi
rm -f conf$$ conf$$.file])
LN_S_FILEONLY=$emacs_cv_ln_s_fileonly
-AC_SUBST(LN_S_FILEONLY)
+AC_SUBST([LN_S_FILEONLY])
dnl AC_PROG_LN_S sets LN_S to 'cp -pR' for MinGW, on the premise that 'ln'
@@ -1286,13 +1292,13 @@ dnl if called via an absolute file name.
dnl Use the entirely-identical-but-quieter ginstall-info instead if present.
dnl Sadly some people may have an old ginstall-info installed on
dnl non-Debian systems, so we can't use this.
-dnl AC_PATH_PROGS(INSTALL_INFO, [ginstall-info install-info], :,
-dnl $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
+dnl AC_PATH_PROGS([INSTALL_INFO], [ginstall-info install-info], [:],
+dnl [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
-AC_PATH_PROG(INSTALL_INFO, install-info, :,
- $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
+AC_PATH_PROG([INSTALL_INFO], [install-info], [:],
+ [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
dnl Don't use GZIP, which is used by gzip for additional parameters.
-AC_PATH_PROG(GZIP_PROG, gzip)
+AC_PATH_PROG([GZIP_PROG], [gzip])
test $with_compress_install != yes && test -n "$GZIP_PROG" && \
GZIP_PROG=" # $GZIP_PROG # (disabled by configure --without-compress-install)"
@@ -1361,7 +1367,7 @@ AC_SUBST([SETFATTR])
# Makeinfo on macOS is ancient, check whether there is a more recent
# version installed by Homebrew.
-AC_CHECK_PROGS(BREW, [brew])
+AC_CHECK_PROGS([BREW], [brew])
if test -n "$BREW"; then
AC_PATH_PROG([MAKEINFO], [makeinfo], [],
[`$BREW --prefix texinfo 2>/dev/null`/bin$PATH_SEPARATOR$PATH])
@@ -1369,7 +1375,7 @@ fi
# Check MacPorts on macOS.
if test $opsys = darwin; then
- AC_PATH_PROG(HAVE_MACPORTS, port)
+ AC_PATH_PROG([HAVE_MACPORTS], [port])
fi
## Require makeinfo >= 4.13 (last of the 4.x series) to build the manuals.
@@ -1409,7 +1415,7 @@ if test $opsys = mingw32; then
else
DOCMISC_W32=
fi
-AC_SUBST(DOCMISC_W32)
+AC_SUBST([DOCMISC_W32])
dnl Add our options to ac_link now, after it is set up.
@@ -1468,7 +1474,7 @@ AC_CACHE_CHECK([whether addresses are sanitized],
[emacs_cv_sanitize_address=no])])
if test $with_unexec = yes; then
- AC_DEFINE([HAVE_UNEXEC], 1, [Define if Emacs supports unexec.])
+ AC_DEFINE([HAVE_UNEXEC], [1], [Define if Emacs supports unexec.])
if test "$emacs_cv_sanitize_address" = yes; then
AC_MSG_WARN([[Addresses are sanitized; suggest --without-unexec]])
fi
@@ -1505,7 +1511,7 @@ case "$opsys" in
UNEXEC_OBJ=unexelf.o
;;
esac
-AC_SUBST(UNEXEC_OBJ)
+AC_SUBST([UNEXEC_OBJ])
LD_SWITCH_SYSTEM=
test "$with_unexec" = no || case "$opsys" in
@@ -1535,7 +1541,7 @@ test "$with_unexec" = no || case "$opsys" in
LD_SWITCH_SYSTEM="-Z"
;;
esac
-AC_SUBST(LD_SWITCH_SYSTEM)
+AC_SUBST([LD_SWITCH_SYSTEM])
ac_link="$ac_link $LD_SWITCH_SYSTEM"
@@ -1571,7 +1577,7 @@ case $canonical in
fi
;;
esac
-AC_SUBST(C_SWITCH_MACHINE)
+AC_SUBST([C_SWITCH_MACHINE])
C_SWITCH_SYSTEM=
## Some programs in src produce warnings saying certain subprograms
@@ -1587,7 +1593,7 @@ if test "$opsys" = "mingw32"; then
fi
## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
## It is redundant in glibc2, since we define _GNU_SOURCE.
-AC_SUBST(C_SWITCH_SYSTEM)
+AC_SUBST([C_SWITCH_SYSTEM])
LIBS_SYSTEM=
@@ -1609,7 +1615,7 @@ case "$opsys" in
haiku) LIBS_SYSTEM="-lnetwork" ;;
esac
-AC_SUBST(LIBS_SYSTEM)
+AC_SUBST([LIBS_SYSTEM])
### Make sure subsequent tests use flags consistent with the build flags.
@@ -1717,8 +1723,8 @@ case $opsys in
esac
-AC_SUBST(LIB_MATH)
-AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE",
+AC_SUBST([LIB_MATH])
+AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
[The type of system you are compiling for; sets 'system-type'.])
AC_SUBST([SYSTEM_TYPE])
@@ -1726,11 +1732,11 @@ AC_SUBST([SYSTEM_TYPE])
pre_PKG_CONFIG_CFLAGS=$CFLAGS
pre_PKG_CONFIG_LIBS=$LIBS
-PKG_PROG_PKG_CONFIG(0.9.0)
+PKG_PROG_PKG_CONFIG([0.9.0])
-dnl EMACS_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4)
-dnl acts like PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4,
-dnl HAVE_GSTUFF=yes, HAVE_GSTUFF=no) -- see pkg-config man page --
+dnl EMACS_CHECK_MODULES([GSTUFF], [gtk+-2.0 >= 1.3 glib = 1.3.4])
+dnl acts like PKG_CHECK_MODULES([GSTUFF], [gtk+-2.0 >= 1.3 glib = 1.3.4],
+dnl [HAVE_GSTUFF=yes], [HAVE_GSTUFF=no]) -- see pkg-config man page --
dnl except that it postprocesses CFLAGS as needed for --enable-gcc-warnings.
dnl EMACS_CHECK_MODULES accepts optional 3rd and 4th arguments that
dnl can take the place of the default HAVE_GSTUFF=yes and HAVE_GSTUFF=no
@@ -1745,7 +1751,7 @@ HAVE_SOUND=no
if test "${with_sound}" != "no"; then
# Sound support for GNU/Linux, the free BSDs, MinGW, and Cygwin.
AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h mmsystem.h],
- have_sound_header=yes, [], [
+ [have_sound_header=yes], [], [
#ifdef __MINGW32__
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -1756,13 +1762,13 @@ if test "${with_sound}" != "no"; then
if test "${with_sound}" = "bsd-ossaudio" || test "${with_sound}" = "yes"; then
# Emulation library used on NetBSD.
- AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
+ AC_CHECK_LIB([ossaudio], [_oss_ioctl], [LIBSOUND=-lossaudio], [LIBSOUND=])
test "${with_sound}" = "bsd-ossaudio" && test -z "$LIBSOUND" && \
AC_MSG_ERROR([bsd-ossaudio sound support requested but not found.])
dnl FIXME? If we did find ossaudio, should we set with_sound=bsd-ossaudio?
dnl Traditionally, we go on to check for alsa too. Does that make sense?
fi
- AC_SUBST(LIBSOUND)
+ AC_SUBST([LIBSOUND])
if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes"; then
ALSA_REQUIRED=1.0.0
@@ -1771,7 +1777,7 @@ if test "${with_sound}" != "no"; then
if test $HAVE_ALSA = yes; then
LIBSOUND="$LIBSOUND $ALSA_LIBS"
CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
- AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.])
+ AC_DEFINE([HAVE_ALSA], [1], [Define to 1 if ALSA is available.])
elif test "${with_sound}" = "alsa"; then
AC_MSG_ERROR([ALSA sound support requested but not found.])
fi
@@ -1787,25 +1793,25 @@ if test "${with_sound}" != "no"; then
dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
dnl Adjust the --with-sound help text if you change this.
gnu-linux|freebsd|netbsd|mingw32|cygwin)
- AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.])
+ AC_DEFINE([HAVE_SOUND], [1], [Define to 1 if you have sound support.])
HAVE_SOUND=yes
;;
esac
fi
- AC_SUBST(CFLAGS_SOUND)
+ AC_SUBST([CFLAGS_SOUND])
fi
dnl checks for header files
AC_CHECK_HEADERS_ONCE(
- linux/fs.h
+ [linux/fs.h
malloc.h
sys/systeminfo.h
sys/sysinfo.h
coff.h pty.h
sys/resource.h
sys/utsname.h pwd.h utmp.h util.h
- sanitizer/lsan_interface.h)
+ sanitizer/lsan_interface.h])
AC_CACHE_CHECK([for ADDR_NO_RANDOMIZE],
[emacs_cv_personality_addr_no_randomize],
@@ -1832,10 +1838,11 @@ if test "$ac_cv_header_sys_sysinfo_h" = yes; then
emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no)])
if test $emacs_cv_linux_sysinfo = yes; then
- AC_DEFINE([HAVE_LINUX_SYSINFO], 1, [Define to 1 if you have Linux sysinfo function.])
+ AC_DEFINE([HAVE_LINUX_SYSINFO], [1],
+ [Define to 1 if you have Linux sysinfo function.])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]],
[[struct sysinfo si; return si.mem_unit]])],
- AC_DEFINE(LINUX_SYSINFO_UNIT, 1,
+ AC_DEFINE([LINUX_SYSINFO_UNIT], [1],
[Define to 1 if Linux sysinfo sizes are in multiples of mem_unit bytes.]))
fi
fi
@@ -1843,19 +1850,20 @@ fi
dnl On Solaris 8 there's a compilation warning for term.h because
dnl it doesn't define 'bool'.
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <term.h>]],[[]])],
- AC_DEFINE(HAVE_TERM_H, 1, [Define to 1 if you have the <term.h> header file.]))
+ [AC_DEFINE([HAVE_TERM_H], [1],
+ [Define to 1 if you have the <term.h> header file.])])
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS_ONCE(sys/socket.h)
-AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT
+AC_CHECK_HEADERS_ONCE([sys/socket.h])
+AC_CHECK_HEADERS([net/if.h], [], [], [AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif])
-AC_CHECK_HEADERS(ifaddrs.h, , , [AC_INCLUDES_DEFAULT
+AC_CHECK_HEADERS([ifaddrs.h], [], [], [AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif])
-AC_CHECK_HEADERS(net/if_dl.h, , , [AC_INCLUDES_DEFAULT
+AC_CHECK_HEADERS([net/if_dl.h], [], [], [AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif])
@@ -1864,7 +1872,7 @@ dnl checks for structure members
AC_CHECK_MEMBERS([struct ifreq.ifr_flags, struct ifreq.ifr_hwaddr,
struct ifreq.ifr_netmask, struct ifreq.ifr_broadaddr,
struct ifreq.ifr_addr,
- struct ifreq.ifr_addr.sa_len], , ,
+ struct ifreq.ifr_addr.sa_len], [], [],
[AC_INCLUDES_DEFAULT
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -1894,7 +1902,7 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
AUTO_DEPEND=yes
fi
fi
-AC_SUBST(AUTO_DEPEND)
+AC_SUBST([AUTO_DEPEND])
#### Choose a window system.
@@ -1944,7 +1952,7 @@ ${x_library}/X11/%T/%N%S"
fi
done
fi
-AC_SUBST(LD_SWITCH_X_SITE_RPATH)
+AC_SUBST([LD_SWITCH_X_SITE_RPATH])
if test "${x_includes}" != NONE && test -n "${x_includes}"; then
C_SWITCH_X_SITE=$isystem`AS_ECHO(["$x_includes"]) | sed -e "s/:/ $isystem/g"`
@@ -2028,17 +2036,20 @@ if test "${with_ns}" != no; then
dnl GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS to 0 or 1.
dnl If they had chosen to either define it or not, we could have
dnl just used AC_CHECK_DECL here.
- AC_CACHE_CHECK(if GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS,
- emacs_cv_objc_exceptions,
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <GNUstepBase/GSConfig.h>]],
+ AC_CACHE_CHECK([if GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS],
+ [emacs_cv_objc_exceptions],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <GNUstepBase/GSConfig.h>]],
[[#if defined BASE_NATIVE_OBJC_EXCEPTIONS && BASE_NATIVE_OBJC_EXCEPTIONS > 0
1;
#else
fail;
-#endif]])], emacs_cv_objc_exceptions=yes, emacs_cv_objc_exceptions=no ) )
+#endif]])],
+ [emacs_cv_objc_exceptions=yes],
+ [emacs_cv_objc_exceptions=no])])
if test $emacs_cv_objc_exceptions = yes; then
dnl _NATIVE_OBJC_EXCEPTIONS is used by the GNUstep headers.
- AC_DEFINE(_NATIVE_OBJC_EXCEPTIONS, 1,
+ AC_DEFINE([_NATIVE_OBJC_EXCEPTIONS], [1],
[Define if GNUstep uses ObjC exceptions.])
GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -fobjc-exceptions"
fi
@@ -2075,8 +2086,8 @@ Either fix this, or re-configure with the option '--without-ns'.])])
#endif
#endif
])],
- ns_osx_have_106=yes,
- ns_osx_have_106=no)
+ [ns_osx_have_106=yes],
+ [ns_osx_have_106=no])
AC_MSG_RESULT([$ns_osx_have_106])
if test $ns_osx_have_106 = no; then
@@ -2095,12 +2106,13 @@ Mac OS X 12.x or later.
[emacs_cv_macosx_12_0=yes]))
if test "${with_native_image_api}" = yes; then
- AC_DEFINE(HAVE_NATIVE_IMAGE_API, 1, [Define to use native OS APIs for images.])
+ AC_DEFINE([HAVE_NATIVE_IMAGE_API], [1],
+ [Define to use native OS APIs for images.])
NATIVE_IMAGE_API="yes (ns)"
fi
fi
-AC_SUBST(LIBS_GNUSTEP)
+AC_SUBST([LIBS_GNUSTEP])
INSTALL_ARCH_INDEP_EXTRA=install-etc
ns_self_contained=no
@@ -2114,7 +2126,7 @@ if test "${HAVE_NS}" = yes; then
window_system=nextstep
# set up packaging dirs
if test "${EN_NS_SELF_CONTAINED}" = yes; then
- AC_DEFINE(NS_SELF_CONTAINED, 1, [Build an NS bundled app])
+ AC_DEFINE([NS_SELF_CONTAINED], [1], [Build an NS bundled app])
ns_self_contained=yes
prefix=${ns_appresdir}
exec_prefix=${ns_appbindir}
@@ -2137,10 +2149,10 @@ if test "${HAVE_NS}" = yes; then
fi
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"
-AC_SUBST(INSTALL_ARCH_INDEP_EXTRA)
-AC_SUBST(ns_self_contained)
-AC_SUBST(NS_OBJ)
-AC_SUBST(NS_OBJC_OBJ)
+AC_SUBST([INSTALL_ARCH_INDEP_EXTRA])
+AC_SUBST([ns_self_contained])
+AC_SUBST([NS_OBJ])
+AC_SUBST([NS_OBJC_OBJ])
if test "${HAVE_NS}" = yes; then
AC_CACHE_CHECK(
@@ -2151,12 +2163,12 @@ if test "${HAVE_NS}" = yes; then
[AC_LANG_SOURCE([[@interface Test
+ (instancetype)test;
@end]])],
- emacs_cv_objc_instancetype=yes,
- emacs_cv_objc_instancetype=no)
+ [emacs_cv_objc_instancetype=yes],
+ [emacs_cv_objc_instancetype=no])
AC_LANG_POP([Objective C])])
if test x$emacs_cv_objc_instancetype = xyes ; then
- AC_DEFINE(NATIVE_OBJC_INSTANCETYPE, 1,
+ AC_DEFINE([NATIVE_OBJC_INSTANCETYPE], [1],
[Define if ObjC compiler supports instancetype natively.])
fi
@@ -2166,8 +2178,8 @@ if test "${HAVE_NS}" = yes; then
[AC_LANG_PUSH([Objective C])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[for (int i = 0;;);]])],
- emacs_cv_objc_c99=yes,
- emacs_cv_objc_c99=no)
+ [emacs_cv_objc_c99=yes],
+ [emacs_cv_objc_c99=no])
AC_LANG_POP([Objective C])])
if test x$emacs_cv_objc_c99 = xno ; then
@@ -2189,7 +2201,7 @@ re-configure with the option '--without-be-app'.])])
AC_LANG_POP([C++])
fi
-AC_SUBST(HAVE_BE_APP)
+AC_SUBST([HAVE_BE_APP])
HAVE_W32=no
W32_OBJ=
@@ -2237,11 +2249,11 @@ NTLIB=
CM_OBJ="cm.o"
XARGS_LIMIT=
if test "${HAVE_W32}" = "yes"; then
- AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
+ AC_DEFINE([HAVE_NTGUI], [1], [Define to use native MS Windows GUI.])
if test "$with_toolkit_scroll_bars" = "no"; then
AC_MSG_ERROR([Non-toolkit scroll bars are not implemented for w32 build.])
fi
- AC_CHECK_TOOL(WINDRES, [windres],
+ AC_CHECK_TOOL([WINDRES], [windres],
[AC_MSG_ERROR([No resource compiler found.])])
W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o w32cygwinx.o"
@@ -2254,8 +2266,8 @@ if test "${HAVE_W32}" = "yes"; then
comma_version=`echo "${PACKAGE_VERSION}.0.0" | sed -e 's/\./,/g' -e 's/^\([[^,]]*,[[^,]]*,[[^,]]*,[[^,]]*\).*/\1/'`
comma_space_version=`echo "$comma_version" | sed 's/,/, /g'`
- AC_SUBST(comma_version)
- AC_SUBST(comma_space_version)
+ AC_SUBST([comma_version])
+ AC_SUBST([comma_space_version])
AC_CONFIG_FILES([nt/emacs.rc nt/emacsclient.rc])
if test "${opsys}" = "cygwin"; then
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lusp10 -lgdi32"
@@ -2268,7 +2280,8 @@ if test "${HAVE_W32}" = "yes"; then
dnl FIXME: This should probably be supported for Cygwin/w32 as
dnl well, but the Cygwin build needs to link against -lgdiplus
if test "${with_native_image_api}" = yes; then
- AC_DEFINE(HAVE_NATIVE_IMAGE_API, 1, [Define to use native OS APIs for images.])
+ AC_DEFINE([HAVE_NATIVE_IMAGE_API], [1],
+ [Define to use native OS APIs for images.])
NATIVE_IMAGE_API="yes (w32)"
W32_OBJ="$W32_OBJ w32image.o"
fi
@@ -2292,20 +2305,20 @@ if test "${HAVE_W32}" = "no" && test "${opsys}" = "cygwin"; then
W32_OBJ="w32cygwinx.o"
fi
-AC_SUBST(W32_OBJ)
-AC_SUBST(W32_LIBS)
-AC_SUBST(EMACSRES)
-AC_SUBST(EMACS_MANIFEST)
-AC_SUBST(CLIENTRES)
-AC_SUBST(CLIENTW)
-AC_SUBST(W32_RES_LINK)
-AC_SUBST(FIRSTFILE_OBJ)
-AC_SUBST(NTDIR)
-AC_SUBST(CM_OBJ)
-AC_SUBST(LIBS_ECLIENT)
-AC_SUBST(LIB_WSOCK32)
-AC_SUBST(NTLIB)
-AC_SUBST(XARGS_LIMIT)
+AC_SUBST([W32_OBJ])
+AC_SUBST([W32_LIBS])
+AC_SUBST([EMACSRES])
+AC_SUBST([EMACS_MANIFEST])
+AC_SUBST([CLIENTRES])
+AC_SUBST([CLIENTW])
+AC_SUBST([W32_RES_LINK])
+AC_SUBST([FIRSTFILE_OBJ])
+AC_SUBST([NTDIR])
+AC_SUBST([CM_OBJ])
+AC_SUBST([LIBS_ECLIENT])
+AC_SUBST([LIB_WSOCK32])
+AC_SUBST([NTLIB])
+AC_SUBST([XARGS_LIMIT])
if test "${HAVE_W32}" = "yes"; then
window_system=w32
@@ -2322,7 +2335,7 @@ if test "$opsys" = "haiku"; then
fi
if test "${HAVE_BE_APP}" = "yes"; then
- AC_DEFINE([HAVE_HAIKU], 1,
+ AC_DEFINE([HAVE_HAIKU], [1],
[Define if Emacs will be built with Haiku windowing support])
fi
@@ -2334,16 +2347,17 @@ if test "${HAVE_BE_APP}" = "yes"; then
HAIKU_LIBS="-lbe -lgame -ltranslation -ltracker" # -lgame is needed for set_mouse_position.
if test "${with_native_image_api}" = yes; then
- AC_DEFINE(HAVE_NATIVE_IMAGE_API, 1, [Define to use native OS APIs for images.])
+ AC_DEFINE([HAVE_NATIVE_IMAGE_API], [1],
+ [Define to use native OS APIs for images.])
NATIVE_IMAGE_API="yes (haiku)"
HAIKU_OBJ="$HAIKU_OBJ haikuimage.o"
fi
fi
-AC_SUBST(HAIKU_LIBS)
-AC_SUBST(HAIKU_OBJ)
-AC_SUBST(HAIKU_CXX_OBJ)
-AC_SUBST(HAIKU_CFLAGS)
+AC_SUBST([HAIKU_LIBS])
+AC_SUBST([HAIKU_OBJ])
+AC_SUBST([HAIKU_CXX_OBJ])
+AC_SUBST([HAIKU_CFLAGS])
## $window_system is now set to the window system we will
## ultimately use.
@@ -2390,16 +2404,16 @@ dnl use the toolkit if we have gtk, or X11R5 or newer.
with_gtk3=yes
USE_X_TOOLKIT=none
HAVE_PGTK=yes
- AC_DEFINE([HAVE_PGTK], 1, [Define to 1 if you have pure Gtk+-3.])
+ AC_DEFINE([HAVE_PGTK], [1], [Define to 1 if you have pure Gtk+-3.])
;;
haiku )
term_header=haikuterm.h
;;
esac
-AC_SUBST(HAVE_PGTK)
+AC_SUBST([HAVE_PGTK])
if test "$window_system" = none && test "X$with_x" != "Xno"; then
- AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
+ AC_CHECK_PROG([HAVE_XSERVER], [X], [true], [false])
if test "$HAVE_XSERVER" = true ||
test -n "$DISPLAY" ||
{
@@ -2463,7 +2477,7 @@ fi
GMALLOC_OBJ=
HYBRID_MALLOC=
if test "${system_malloc}" = "yes"; then
- AC_DEFINE([SYSTEM_MALLOC], 1,
+ AC_DEFINE([SYSTEM_MALLOC], [1],
[Define to 1 to use the system memory allocator, even if it is not
Doug Lea style.])
GNU_MALLOC=no
@@ -2471,7 +2485,7 @@ if test "${system_malloc}" = "yes"; then
(The GNU allocators don't work with this system configuration.)"
VMLIMIT_OBJ=
elif test "$hybrid_malloc" = yes; then
- AC_DEFINE(HYBRID_MALLOC, 1,
+ AC_DEFINE([HYBRID_MALLOC], [1],
[Define to use gmalloc before dumping and the system malloc after.])
HYBRID_MALLOC=1
GNU_MALLOC=no
@@ -2491,21 +2505,21 @@ else
[emacs_cv_data_start=yes],
[emacs_cv_data_start=no])])
if test $emacs_cv_data_start = yes; then
- AC_DEFINE([HAVE_DATA_START], 1,
+ AC_DEFINE([HAVE_DATA_START], [1],
[Define to 1 if data_start is the address of the start
of the main data segment.])
fi
fi
AC_SUBST([HYBRID_MALLOC])
-AC_SUBST(GMALLOC_OBJ)
-AC_SUBST(VMLIMIT_OBJ)
+AC_SUBST([GMALLOC_OBJ])
+AC_SUBST([VMLIMIT_OBJ])
if test "$doug_lea_malloc" = "yes" && test "$hybrid_malloc" != yes; then
if test "$GNU_MALLOC" = yes ; then
GNU_MALLOC_reason="
(Using Doug Lea's new malloc from the GNU C Library.)"
fi
- AC_DEFINE(DOUG_LEA_MALLOC, 1,
+ AC_DEFINE([DOUG_LEA_MALLOC], [1],
[Define to 1 if the system memory allocator is Doug Lea style,
with malloc hooks and malloc_set_state.])
@@ -2529,18 +2543,19 @@ esac
AC_FUNC_MMAP
if test $use_mmap_for_buffers = yes; then
- AC_DEFINE(USE_MMAP_FOR_BUFFERS, 1, [Define to use mmap to allocate buffer text.])
+ AC_DEFINE([USE_MMAP_FOR_BUFFERS], [1],
+ [Define to use mmap to allocate buffer text.])
REL_ALLOC=no
fi
LIBS="$LIBS_SYSTEM $LIBS"
dnl FIXME replace main with a function we actually want from this library.
-AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
+AC_CHECK_LIB([Xbsd], [main], [LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd"])
dnl Check for the POSIX thread library.
LIB_PTHREAD=
-AC_CHECK_HEADERS_ONCE(pthread.h)
+AC_CHECK_HEADERS_ONCE([pthread.h])
if test "$ac_cv_header_pthread_h" && test "$opsys" != "mingw32"; then
AC_CACHE_CHECK([for pthread library],
[emacs_cv_pthread_lib],
@@ -2575,7 +2590,7 @@ if test "$ac_cv_header_pthread_h" && test "$opsys" != "mingw32"; then
fi
done])
if test "$emacs_cv_pthread_lib" != no; then
- AC_DEFINE([HAVE_PTHREAD], 1, [Define to 1 if you have POSIX threads.])
+ AC_DEFINE([HAVE_PTHREAD], [1], [Define to 1 if you have POSIX threads.])
case $emacs_cv_pthread_lib in
-*) LIB_PTHREAD=$emacs_cv_pthread_lib;;
esac
@@ -2585,10 +2600,10 @@ if test "$ac_cv_header_pthread_h" && test "$opsys" != "mingw32"; then
# definition of 'errno' in <errno.h>.
case $opsys in
hpux* | solaris)
- AC_DEFINE([_REENTRANT], 1,
+ AC_DEFINE([_REENTRANT], [1],
[Define to 1 if your system requires this in multithreaded code.]);;
aix4-2)
- AC_DEFINE([_THREAD_SAFE], 1,
+ AC_DEFINE([_THREAD_SAFE], [1],
[Define to 1 if your system requires this in multithreaded code.]);;
esac
fi
@@ -2599,12 +2614,12 @@ AC_MSG_CHECKING([for thread support])
threads_enabled=no
if test "$with_threads" = yes; then
if test "$emacs_cv_pthread_lib" != no; then
- AC_DEFINE(THREADS_ENABLED, 1,
+ AC_DEFINE([THREADS_ENABLED], [1],
[Define to 1 if you want elisp thread support.])
threads_enabled=yes
elif test "${opsys}" = "mingw32"; then
dnl MinGW can do native Windows threads even without pthreads
- AC_DEFINE(THREADS_ENABLED, 1,
+ AC_DEFINE([THREADS_ENABLED], [1],
[Define to 1 if you want elisp thread support.])
threads_enabled=yes
fi
@@ -2689,40 +2704,42 @@ if test "${HAVE_X11}" = "yes"; then
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
#include <X11/XKBlib.h>]],
[[XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);]])],
- emacs_cv_xkb=yes, emacs_cv_xkb=no)])
+ [emacs_cv_xkb=yes],
+ [emacs_cv_xkb=no])])
if test $emacs_cv_xkb = yes; then
- AC_DEFINE(HAVE_XKB, 1, [Define to 1 if you have the Xkb extension.])
- AC_CHECK_FUNCS(XkbRefreshKeyboardMapping XkbFreeNames)
+ AC_DEFINE([HAVE_XKB], [1], [Define to 1 if you have the Xkb extension.])
+ AC_CHECK_FUNCS([XkbRefreshKeyboardMapping XkbFreeNames])
fi
- AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString XScreenNumberOfScreen)
- AC_CHECK_FUNCS(XDisplayCells XDestroySubwindows)
+ AC_CHECK_FUNCS([XrmSetDatabase XScreenResourceString XScreenNumberOfScreen])
+ AC_CHECK_FUNCS([XDisplayCells XDestroySubwindows])
fi
if test "${window_system}" = "x11"; then
- AC_MSG_CHECKING(X11 version 6)
- AC_CACHE_VAL(emacs_cv_x11_version_6,
+ AC_MSG_CHECKING([X11 version 6])
+ AC_CACHE_VAL([emacs_cv_x11_version_6],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]],
[[#if XlibSpecificationRelease < 6
fail;
#endif
-]])], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)])
+]])], [emacs_cv_x11_version_6=yes],
+ [emacs_cv_x11_version_6=no])])
if test $emacs_cv_x11_version_6 = yes; then
- AC_MSG_RESULT(6 or newer)
- AC_DEFINE(HAVE_X11R6, 1,
+ AC_MSG_RESULT([6 or newer])
+ AC_DEFINE([HAVE_X11R6], [1],
[Define to 1 if you have the X11R6 or newer version of Xlib.])
- AC_DEFINE(HAVE_X_I18N, 1, [Define if you have usable i18n support.])
+ AC_DEFINE([HAVE_X_I18N], [1], [Define if you have usable i18n support.])
AC_CHECK_MEMBERS([XICCallback.callback], [], [], [#include <X11/Xlib.h>])
## inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
## XIM support.
case "$opsys" in
solaris) : ;;
- *) AC_DEFINE(HAVE_X11R6_XIM, 1,
+ *) AC_DEFINE([HAVE_X11R6_XIM], [1],
[Define if you have usable X11R6-style XIM support.])
;;
esac
else
- AC_MSG_RESULT(before 6)
+ AC_MSG_RESULT([before 6])
fi
fi
@@ -2737,11 +2754,11 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" \
RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
EMACS_CHECK_MODULES([RSVG], [$RSVG_MODULE])
- AC_SUBST(RSVG_CFLAGS)
- AC_SUBST(RSVG_LIBS)
+ AC_SUBST([RSVG_CFLAGS])
+ AC_SUBST([RSVG_LIBS])
if test $HAVE_RSVG = yes; then
- AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.])
+ AC_DEFINE([HAVE_RSVG], [1], [Define to 1 if using librsvg.])
CFLAGS="$CFLAGS $RSVG_CFLAGS"
# Windows loads librsvg dynamically
if test "${opsys}" = "mingw32"; then
@@ -2764,11 +2781,11 @@ if test "${with_webp}" != "no"; then
if test "$HAVE_WEBP" = "yes"; then
WEBP_LIBS="-lwebp -lwebpdemux"
fi
- AC_SUBST(WEBP_CFLAGS)
- AC_SUBST(WEBP_LIBS)
+ AC_SUBST([WEBP_CFLAGS])
+ AC_SUBST([WEBP_LIBS])
fi
if test $HAVE_WEBP = yes; then
- AC_DEFINE(HAVE_WEBP, 1, [Define to 1 if using libwebp.])
+ AC_DEFINE([HAVE_WEBP], [1], [Define to 1 if using libwebp.])
CFLAGS="$CFLAGS $WEBP_CFLAGS"
# Windows loads libwebp dynamically
if test "${opsys}" = "mingw32"; then
@@ -2780,20 +2797,25 @@ fi
### Use -lsqlite3 if available, unless '--with-sqlite3=no'
HAVE_SQLITE3=no
if test "${with_sqlite3}" != "no"; then
- AC_CHECK_LIB(sqlite3, sqlite3_open_v2, HAVE_SQLITE3=yes, HAVE_SQLITE3=no)
+ AC_CHECK_LIB([sqlite3], [sqlite3_open_v2],
+ [HAVE_SQLITE3=yes],
+ [HAVE_SQLITE3=no])
if test "$HAVE_SQLITE3" = "yes"; then
SQLITE3_LIBS=-lsqlite3
- AC_SUBST(SQLITE3_LIBS)
+ AC_SUBST([SQLITE3_LIBS])
LIBS="$SQLITE3_LIBS $LIBS"
- AC_DEFINE(HAVE_SQLITE3, 1, [Define to 1 if you have the libsqlite3 library (-lsqlite).])
+ AC_DEFINE([HAVE_SQLITE3], [1],
+ [Define to 1 if you have the libsqlite3 library (-lsqlite).])
# Windows loads libsqlite dynamically
if test "${opsys}" = "mingw32"; then
SQLITE3_LIBS=
fi
- AC_CHECK_LIB(sqlite3, sqlite3_load_extension,
- HAVE_SQLITE3_LOAD_EXTENSION=yes, HAVE_SQLITE3_LOAD_EXTENSION=no)
+ AC_CHECK_LIB([sqlite3], [sqlite3_load_extension],
+ [HAVE_SQLITE3_LOAD_EXTENSION=yes],
+ [HAVE_SQLITE3_LOAD_EXTENSION=no])
if test "$HAVE_SQLITE3_LOAD_EXTENSION" = "yes"; then
- AC_DEFINE(HAVE_SQLITE3_LOAD_EXTENSION, 1, [Define to 1 if sqlite3 supports loading extensions.])
+ AC_DEFINE([HAVE_SQLITE3_LOAD_EXTENSION], [1],
+ [Define to 1 if sqlite3 supports loading extensions.])
fi
fi
fi
@@ -2810,7 +2832,8 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}"
EMACS_CHECK_MODULES([IMAGEMAGICK], [MagickWand >= 7])
if test $HAVE_IMAGEMAGICK = yes; then
- AC_DEFINE([HAVE_IMAGEMAGICK7], 1, [Define to 1 if using ImageMagick7.])
+ AC_DEFINE([HAVE_IMAGEMAGICK7], [1],
+ [Define to 1 if using ImageMagick7.])
else
## 6.3.5 is the earliest version known to work; see Bug#17339.
## 6.8.2 makes Emacs crash; see Bug#13867.
@@ -2834,7 +2857,7 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}"
fi
fi
if test $HAVE_IMAGEMAGICK = yes; then
- AC_DEFINE([HAVE_IMAGEMAGICK], 1, [Define to 1 if using ImageMagick.])
+ AC_DEFINE([HAVE_IMAGEMAGICK], [1], [Define to 1 if using ImageMagick.])
else
if test "${with_imagemagick}" != "no"; then
AC_MSG_ERROR([ImageMagick wanted, but it does not compile. Maybe some library files are missing?]);
@@ -2847,12 +2870,12 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}"
fi
fi
-AC_CHECK_LIB(anl, getaddrinfo_a, HAVE_GETADDRINFO_A=yes)
+AC_CHECK_LIB([anl], [getaddrinfo_a], [HAVE_GETADDRINFO_A=yes])
if test "${HAVE_GETADDRINFO_A}" = "yes"; then
- AC_DEFINE(HAVE_GETADDRINFO_A, 1,
+ AC_DEFINE([HAVE_GETADDRINFO_A], [1],
[Define to 1 if you have getaddrinfo_a for asynchronous DNS resolution.])
GETADDRINFO_A_LIBS="-lanl"
- AC_SUBST(GETADDRINFO_A_LIBS)
+ AC_SUBST([GETADDRINFO_A_LIBS])
fi
HAVE_GTK=no
@@ -2866,7 +2889,7 @@ if test "${opsys}" != "mingw32"; then
if test "${window_system}" = "x11"; then
GTK_REQUIRED=3.10
else
- GTK_REQUIRED=3.20
+ GTK_REQUIRED=3.22.23
fi
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
@@ -2874,10 +2897,10 @@ if test "${opsys}" != "mingw32"; then
EMACS_CHECK_MODULES([GTK], [$GTK_MODULES],
[pkg_check_gtk=yes], [pkg_check_gtk=no])
if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then
- AC_MSG_ERROR($GTK_PKG_ERRORS)
+ AC_MSG_ERROR([$GTK_PKG_ERRORS])
fi
if test "$pkg_check_gtk" = "yes"; then
- AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
+ AC_DEFINE([HAVE_GTK3], [1], [Define to 1 if using GTK 3 or later.])
GTK_OBJ=emacsgtkfixed.o
gtk_term_header=gtkutil.h
USE_GTK_TOOLKIT="GTK3"
@@ -2904,7 +2927,7 @@ if test "${opsys}" != "mingw32"; then
if test "$pkg_check_gtk" = "no" &&
{ test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
then
- AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
+ AC_MSG_ERROR([$gtk3_pkg_errors$GTK_PKG_ERRORS])
fi
test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
fi
@@ -2915,7 +2938,7 @@ OLD_LIBS=$LIBS
if test x"$pkg_check_gtk" = xyes; then
- AC_SUBST(GTK_LIBS)
+ AC_SUBST([GTK_LIBS])
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$GTK_LIBS $LIBS"
dnl Try to compile a simple GTK program.
@@ -2947,7 +2970,7 @@ if test x"$pkg_check_gtk" = xyes; then
else
C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
HAVE_GTK=yes
- AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
+ AC_DEFINE([USE_GTK], [1], [Define to 1 if using GTK.])
GTK_OBJ="gtkutil.o $GTK_OBJ"
term_header=$gtk_term_header
USE_X_TOOLKIT=none
@@ -2959,7 +2982,7 @@ if test x"$pkg_check_gtk" = xyes; then
fi
fi
-AC_SUBST(GTK_OBJ)
+AC_SUBST([GTK_OBJ])
if test "${HAVE_GTK}" = "yes"; then
@@ -2979,15 +3002,17 @@ if test "${HAVE_GTK}" = "yes"; then
dnl but not declared if deprecated featured has been selected out.
dnl AC_CHECK_DECL checks for a macro, so check for GTK_TYPE_FILE_SELECTION.
HAVE_GTK_FILE_SELECTION=no
- AC_CHECK_DECL(GTK_TYPE_FILE_SELECTION, HAVE_GTK_FILE_SELECTION=yes,
- HAVE_GTK_FILE_SELECTION=no, [AC_INCLUDES_DEFAULT
+ AC_CHECK_DECL([GTK_TYPE_FILE_SELECTION],
+ [HAVE_GTK_FILE_SELECTION=yes],
+ [HAVE_GTK_FILE_SELECTION=no],
+ [AC_INCLUDES_DEFAULT
#include <gtk/gtk.h>])
if test "$HAVE_GTK_FILE_SELECTION" = yes; then
- AC_CHECK_FUNCS(gtk_file_selection_new)
+ AC_CHECK_FUNCS([gtk_file_selection_new])
fi
dnl This procedure causes a bug on certain Ubuntu GTK+2 builds
- AC_CHECK_FUNCS(gtk_window_set_has_resize_grip)
+ AC_CHECK_FUNCS([gtk_window_set_has_resize_grip])
fi
fi
@@ -3000,10 +3025,10 @@ if test "$window_system" = "pgtk"; then
PGTK_OBJ="pgtkfns.o pgtkterm.o pgtkselect.o pgtkmenu.o pgtkim.o xsettings.o"
PGTK_LIBS="$GTK_LIBS"
fi
-AC_SUBST(PGTK_OBJ)
-AC_SUBST(PGTK_LIBS)
+AC_SUBST([PGTK_OBJ])
+AC_SUBST([PGTK_LIBS])
-AC_CHECK_FUNCS(malloc_trim)
+AC_CHECK_FUNCS([malloc_trim])
dnl D-Bus has been tested under GNU/Linux only. Must be adapted for
dnl other platforms.
@@ -3012,25 +3037,25 @@ DBUS_OBJ=
if test "${with_dbus}" = "yes"; then
EMACS_CHECK_MODULES([DBUS], [dbus-1 >= 1.0])
if test "$HAVE_DBUS" = yes; then
- AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
+ AC_DEFINE([HAVE_DBUS], [1], [Define to 1 if using D-Bus.])
dnl dbus_watch_get_unix_fd has been introduced in D-Bus 1.1.1.
dnl dbus_type_is_valid and dbus_validate_* have been introduced in
dnl D-Bus 1.5.12.
OLD_LIBS=$LIBS
LIBS="$LIBS $DBUS_LIBS"
- AC_CHECK_FUNCS(dbus_watch_get_unix_fd \
+ AC_CHECK_FUNCS([dbus_watch_get_unix_fd \
dbus_type_is_valid \
dbus_validate_bus_name \
dbus_validate_path \
dbus_validate_interface \
- dbus_validate_member)
+ dbus_validate_member])
LIBS=$OLD_LIBS
DBUS_OBJ=dbusbind.o
fi
fi
-AC_SUBST(DBUS_CFLAGS)
-AC_SUBST(DBUS_LIBS)
-AC_SUBST(DBUS_OBJ)
+AC_SUBST([DBUS_CFLAGS])
+AC_SUBST([DBUS_LIBS])
+AC_SUBST([DBUS_OBJ])
dnl GSettings has been tested under GNU/Linux only.
HAVE_GSETTINGS=no
@@ -3055,7 +3080,7 @@ if test "${HAVE_X11}" = "yes" -o "${window_system}" = "pgtk" && test "${with_gse
[emacs_cv_gsettings_in_gio=yes], [emacs_cv_gsettings_in_gio=no])])
if test "$emacs_cv_gsettings_in_gio" = "yes"; then
- AC_DEFINE(HAVE_GSETTINGS, 1, [Define to 1 if using GSettings.])
+ AC_DEFINE([HAVE_GSETTINGS], [1], [Define to 1 if using GSettings.])
SETTINGS_CFLAGS="$GSETTINGS_CFLAGS"
SETTINGS_LIBS="$GSETTINGS_LIBS"
test "$with_gconf" = "yes" || with_gconf=no
@@ -3064,7 +3089,7 @@ if test "${HAVE_X11}" = "yes" -o "${window_system}" = "pgtk" && test "${with_gse
LIBS=$old_LIBS
fi
fi
-AC_SUBST(HAVE_GSETTINGS)
+AC_SUBST([HAVE_GSETTINGS])
dnl GConf has been tested under GNU/Linux only.
dnl The version is really arbitrary, it is about the same age as Gtk+ 2.6.
@@ -3072,7 +3097,7 @@ HAVE_GCONF=no
if test "${HAVE_X11}" = "yes" -o "${window_system}" = "pgtk" && test "${with_gconf}" != "no"; then
EMACS_CHECK_MODULES([GCONF], [gconf-2.0 >= 2.13])
if test "$HAVE_GCONF" = yes; then
- AC_DEFINE(HAVE_GCONF, 1, [Define to 1 if using GConf.])
+ AC_DEFINE([HAVE_GCONF], [1], [Define to 1 if using GConf.])
dnl Newer GConf doesn't link with g_objects, so this is not defined.
SETTINGS_CFLAGS="$SETTINGS_CFLAGS $GCONF_CFLAGS"
SETTINGS_LIBS="$SETTINGS_LIBS $GCONF_LIBS"
@@ -3092,33 +3117,35 @@ if test "$HAVE_GSETTINGS" = "yes" || test "$HAVE_GCONF" = "yes"; then
CFLAGS="$SAVE_CFLAGS"
LIBS="$SAVE_LIBS"
fi
-AC_SUBST(SETTINGS_CFLAGS)
-AC_SUBST(SETTINGS_LIBS)
+AC_SUBST([SETTINGS_CFLAGS])
+AC_SUBST([SETTINGS_LIBS])
USE_STARTUP_NOTIFICATION=no
if test "${HAVE_GTK}" = "yes"; then
USE_STARTUP_NOTIFICATION=yes
fi
-AC_SUBST(USE_STARTUP_NOTIFICATION)
+AC_SUBST([USE_STARTUP_NOTIFICATION])
dnl SELinux is available for GNU/Linux only.
HAVE_LIBSELINUX=no
LIBSELINUX_LIBS=
if test "${with_selinux}" = "yes"; then
- AC_CHECK_LIB([selinux], [lgetfilecon], HAVE_LIBSELINUX=yes, HAVE_LIBSELINUX=no)
+ AC_CHECK_LIB([selinux], [lgetfilecon],
+ [HAVE_LIBSELINUX=yes],
+ [HAVE_LIBSELINUX=no])
if test "$HAVE_LIBSELINUX" = yes; then
- AC_DEFINE(HAVE_LIBSELINUX, 1, [Define to 1 if using SELinux.])
+ AC_DEFINE([HAVE_LIBSELINUX], [1], [Define to 1 if using SELinux.])
LIBSELINUX_LIBS=-lselinux
fi
fi
-AC_SUBST(LIBSELINUX_LIBS)
+AC_SUBST([LIBSELINUX_LIBS])
HAVE_GNUTLS=no
if test "${with_gnutls}" != "no" ; then
EMACS_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.2],
[HAVE_GNUTLS=yes], [HAVE_GNUTLS=no])
if test "${HAVE_GNUTLS}" = "yes"; then
- AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.])
+ AC_DEFINE([HAVE_GNUTLS], [1], [Define if using GnuTLS.])
fi
# Windows loads GnuTLS dynamically
@@ -3127,8 +3154,8 @@ if test "${with_gnutls}" != "no" ; then
fi
fi
-AC_SUBST(LIBGNUTLS_LIBS)
-AC_SUBST(LIBGNUTLS_CFLAGS)
+AC_SUBST([LIBGNUTLS_LIBS])
+AC_SUBST([LIBGNUTLS_CFLAGS])
HAVE_LIBSYSTEMD=no
if test "${with_libsystemd}" = "yes" ; then
@@ -3138,12 +3165,12 @@ if test "${with_libsystemd}" = "yes" ; then
EMACS_CHECK_MODULES([LIBSYSTEMD], [libsystemd >= 222],
[HAVE_LIBSYSTEMD=yes], [HAVE_LIBSYSTEMD=no])
if test "${HAVE_LIBSYSTEMD}" = "yes"; then
- AC_DEFINE(HAVE_LIBSYSTEMD, 1, [Define if using libsystemd.])
+ AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if using libsystemd.])
fi
fi
-AC_SUBST(LIBSYSTEMD_LIBS)
-AC_SUBST(LIBSYSTEMD_CFLAGS)
+AC_SUBST([LIBSYSTEMD_LIBS])
+AC_SUBST([LIBSYSTEMD_CFLAGS])
HAVE_JSON=no
JSON_OBJ=
@@ -3152,7 +3179,7 @@ if test "${with_json}" != no; then
EMACS_CHECK_MODULES([JSON], [jansson >= 2.7],
[HAVE_JSON=yes], [HAVE_JSON=no])
if test "${HAVE_JSON}" = yes; then
- AC_DEFINE(HAVE_JSON, 1, [Define if using Jansson.])
+ AC_DEFINE([HAVE_JSON], [1], [Define if using Jansson.])
JSON_OBJ=json.o
fi
@@ -3162,9 +3189,9 @@ if test "${with_json}" != no; then
fi
fi
-AC_SUBST(JSON_LIBS)
-AC_SUBST(JSON_CFLAGS)
-AC_SUBST(JSON_OBJ)
+AC_SUBST([JSON_LIBS])
+AC_SUBST([JSON_CFLAGS])
+AC_SUBST([JSON_OBJ])
NOTIFY_OBJ=
NOTIFY_SUMMARY=no
@@ -3177,9 +3204,9 @@ case $with_file_notification,$opsys in
Consider using gfile instead.])
;;
w32,* | yes,mingw32)
- AC_CHECK_HEADER(windows.h)
+ AC_CHECK_HEADER([windows.h])
if test "$ac_cv_header_windows_h" = yes ; then
- AC_DEFINE(HAVE_W32NOTIFY, 1, [Define to 1 to use w32notify.])
+ AC_DEFINE([HAVE_W32NOTIFY], [1], [Define to 1 to use w32notify.])
NOTIFY_OBJ=w32notify.o
NOTIFY_SUMMARY="yes (w32)"
fi ;;
@@ -3188,11 +3215,11 @@ esac
dnl inotify is available only on GNU/Linux.
case $with_file_notification,$NOTIFY_OBJ in
inotify, | yes,)
- AC_CHECK_HEADER(sys/inotify.h)
+ AC_CHECK_HEADER([sys/inotify.h])
if test "$ac_cv_header_sys_inotify_h" = yes ; then
- AC_CHECK_FUNC(inotify_init1)
+ AC_CHECK_FUNC([inotify_init1])
if test "$ac_cv_func_inotify_init1" = yes; then
- AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.])
+ AC_DEFINE([HAVE_INOTIFY], [1], [Define to 1 to use inotify.])
NOTIFY_OBJ=inotify.o
NOTIFY_SUMMARY="yes -lglibc (inotify)"
fi
@@ -3204,16 +3231,16 @@ case $with_file_notification,$NOTIFY_OBJ in
kqueue,* | yes,)
EMACS_CHECK_MODULES([KQUEUE], [libkqueue])
if test "$HAVE_KQUEUE" = "yes"; then
- AC_DEFINE(HAVE_KQUEUE, 1, [Define to 1 to use kqueue.])
+ AC_DEFINE([HAVE_KQUEUE], [1], [Define to 1 to use kqueue.])
CPPFLAGS="$CPPFLAGS -I/usr/include/kqueue"
NOTIFY_CFLAGS=$KQUEUE_CFLAGS
NOTIFY_LIBS=$KQUEUE_LIBS
NOTIFY_OBJ=kqueue.o
NOTIFY_SUMMARY="yes -lkqueue"
else
- AC_SEARCH_LIBS(kqueue, [])
+ AC_SEARCH_LIBS([kqueue], [])
if test "$ac_cv_search_kqueue" != no; then
- AC_DEFINE(HAVE_KQUEUE, 1, [Define to 1 to use kqueue.])
+ AC_DEFINE([HAVE_KQUEUE], [1], [Define to 1 to use kqueue.])
NOTIFY_OBJ=kqueue.o
NOTIFY_SUMMARY="yes (kqueue)"
fi
@@ -3231,7 +3258,7 @@ Consider kqueue instead.])
else
EMACS_CHECK_MODULES([GFILENOTIFY], [gio-2.0 >= 2.24])
if test "$HAVE_GFILENOTIFY" = "yes"; then
- AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
+ AC_DEFINE([HAVE_GFILENOTIFY], [1], [Define to 1 if using GFile.])
NOTIFY_CFLAGS=$GFILENOTIFY_CFLAGS
NOTIFY_LIBS=$GFILENOTIFY_LIBS
NOTIFY_OBJ=gfilenotify.o
@@ -3246,11 +3273,12 @@ case $with_file_notification,$NOTIFY_OBJ in
esac
if test -n "$NOTIFY_OBJ"; then
- AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.])
+ AC_DEFINE([USE_FILE_NOTIFY], [1],
+ [Define to 1 if using file notifications.])
fi
-AC_SUBST(NOTIFY_CFLAGS)
-AC_SUBST(NOTIFY_LIBS)
-AC_SUBST(NOTIFY_OBJ)
+AC_SUBST([NOTIFY_CFLAGS])
+AC_SUBST([NOTIFY_LIBS])
+AC_SUBST([NOTIFY_OBJ])
dnl Do not put whitespace before the #include statements below.
dnl Older compilers (eg sunos4 cc) choke on it.
@@ -3258,36 +3286,37 @@ HAVE_XAW3D=no
LUCID_LIBW=
if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
if test "$with_xaw3d" != no; then
- AC_CACHE_VAL(emacs_cv_xaw3d,
+ AC_CACHE_VAL([emacs_cv_xaw3d],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Intrinsic.h>
#include <X11/Xaw3d/Simple.h>]],
[[]])],
- [AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb,
- emacs_cv_xaw3d=yes, emacs_cv_xaw3d=no)],
- emacs_cv_xaw3d=no)])
+ [AC_CHECK_LIB([Xaw3d], [XawScrollbarSetThumb],
+ [emacs_cv_xaw3d=yes],
+ [emacs_cv_xaw3d=no])],
+ [emacs_cv_xaw3d=no])])
else
emacs_cv_xaw3d=no
fi
if test $emacs_cv_xaw3d = yes; then
- AC_MSG_CHECKING(for xaw3d)
+ AC_MSG_CHECKING([for xaw3d])
AC_MSG_RESULT([yes; using Lucid toolkit])
USE_X_TOOLKIT=LUCID
HAVE_XAW3D=yes
LUCID_LIBW=-lXaw3d
- AC_DEFINE(HAVE_XAW3D, 1,
+ AC_DEFINE([HAVE_XAW3D], [1],
[Define to 1 if you have the Xaw3d library (-lXaw3d).])
else
- AC_MSG_CHECKING(for xaw3d)
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING(for libXaw)
- AC_CACHE_VAL(emacs_cv_xaw,
+ AC_MSG_CHECKING([for xaw3d])
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for libXaw])
+ AC_CACHE_VAL([emacs_cv_xaw],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Intrinsic.h>
#include <X11/Xaw/Simple.h>]],
[[]])],
- emacs_cv_xaw=yes,
- emacs_cv_xaw=no)])
+ [emacs_cv_xaw=yes],
+ [emacs_cv_xaw=no])])
if test $emacs_cv_xaw = yes; then
AC_MSG_RESULT([yes; using Lucid toolkit])
USE_X_TOOLKIT=LUCID
@@ -3309,17 +3338,18 @@ X_TOOLKIT_TYPE=$USE_X_TOOLKIT
LIBXTR6=
LIBXMU=
if test "${USE_X_TOOLKIT}" != "none"; then
- AC_MSG_CHECKING(X11 toolkit version)
- AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
+ AC_MSG_CHECKING([X11 toolkit version])
+ AC_CACHE_VAL([emacs_cv_x11_toolkit_version_6],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Intrinsic.h>]],
[[#if XtSpecificationRelease < 6
fail;
#endif
-]])], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)])
+]])], [emacs_cv_x11_toolkit_version_6=yes],
+ [emacs_cv_x11_toolkit_version_6=no])])
HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
if test $emacs_cv_x11_toolkit_version_6 = yes; then
- AC_MSG_RESULT(6 or newer)
- AC_DEFINE(HAVE_X11XTR6, 1,
+ AC_MSG_RESULT([6 or newer])
+ AC_DEFINE([HAVE_X11XTR6], [1],
[Define to 1 if you have the X11R6 or newer version of Xt.])
LIBXTR6="-lSM -lICE"
case "$opsys" in
@@ -3327,7 +3357,7 @@ fail;
unixware) LIBXTR6="$LIBXTR6 -lw" ;;
esac
else
- AC_MSG_RESULT(before 6)
+ AC_MSG_RESULT([before 6])
fi
dnl If using toolkit, check whether libXmu.a exists.
@@ -3345,8 +3375,8 @@ dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
LIBS=$OLDLIBS
dnl ac_cv_search_XmuConvertStandardSelection is also referenced below.
fi
-AC_SUBST(LIBXTR6)
-AC_SUBST(LIBXMU)
+AC_SUBST([LIBXTR6])
+AC_SUBST([LIBXMU])
LIBXP=
if test "${USE_X_TOOLKIT}" = "MOTIF"; then
@@ -3364,21 +3394,21 @@ if test "${USE_X_TOOLKIT}" = "MOTIF"; then
else
emacs_cv_openmotif=no
fi
- AC_CACHE_CHECK(for (Open)Motif version 2.1, emacs_cv_motif_version_2_1,
+ AC_CACHE_CHECK([for (Open)Motif version 2.1], [emacs_cv_motif_version_2_1],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Xm/Xm.h>]],
[[#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
int x = 5;
#else
Motif version prior to 2.1.
#endif]])],
- emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)])
+ [emacs_cv_motif_version_2_1=yes],
+ [emacs_cv_motif_version_2_1=no])])
if test $emacs_cv_motif_version_2_1 = yes; then
- AC_CHECK_LIB(Xp, XpCreateContext, LIBXP=-lXp)
+ AC_CHECK_LIB([Xp], [XpCreateContext], [LIBXP=-lXp])
if test x$emacs_cv_openmotif = xyes; then
REAL_CPPFLAGS="-I/usr/include/openmotif $REAL_CPPFLAGS"
fi
else
- AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif,
# We put this in CFLAGS temporarily to precede other -I options
# that might be in CFLAGS temporarily.
# We put this in CPPFLAGS where it precedes the other -I options.
@@ -3386,9 +3416,14 @@ Motif version prior to 2.1.
OLD_CFLAGS=$CFLAGS
CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>]],
- [[int x = 5;]])],
- emacs_cv_lesstif=yes, emacs_cv_lesstif=no)])
+ AC_CACHE_CHECK([for LessTif where some systems put it], [emacs_cv_lesstif],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>
+ ]],
+ [[int x = 5;]])],
+ [emacs_cv_lesstif=yes],
+ [emacs_cv_lesstif=no])])
if test $emacs_cv_lesstif = yes; then
# Make sure this -I option remains in CPPFLAGS after it is set
# back to REAL_CPPFLAGS.
@@ -3410,34 +3445,34 @@ dnl Use toolkit scroll bars if configured for GTK or X toolkit and either
dnl using Motif or Xaw3d is available, and unless
dnl --with-toolkit-scroll-bars=no was specified.
-AH_TEMPLATE(USE_TOOLKIT_SCROLL_BARS,
+AH_TEMPLATE([USE_TOOLKIT_SCROLL_BARS],
[Define to 1 if we should use toolkit scroll bars.])dnl
USE_TOOLKIT_SCROLL_BARS=no
if test "${with_toolkit_scroll_bars}" != "no"; then
if test "${USE_X_TOOLKIT}" != "none"; then
if test "${USE_X_TOOLKIT}" = "MOTIF"; then
- AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
+ AC_DEFINE([USE_TOOLKIT_SCROLL_BARS])
HAVE_XAW3D=no
USE_TOOLKIT_SCROLL_BARS=yes
elif test "${HAVE_XAW3D}" = "yes" || test "${USE_X_TOOLKIT}" = "LUCID"; then
- AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
+ AC_DEFINE([USE_TOOLKIT_SCROLL_BARS])
USE_TOOLKIT_SCROLL_BARS=yes
fi
elif test "${HAVE_GTK}" = "yes"; then
- AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
+ AC_DEFINE([USE_TOOLKIT_SCROLL_BARS])
USE_TOOLKIT_SCROLL_BARS=yes
elif test "${HAVE_NS}" = "yes"; then
- AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
+ AC_DEFINE([USE_TOOLKIT_SCROLL_BARS])
USE_TOOLKIT_SCROLL_BARS=yes
elif test "${HAVE_W32}" = "yes"; then
- AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
+ AC_DEFINE([USE_TOOLKIT_SCROLL_BARS])
USE_TOOLKIT_SCROLL_BARS=yes
elif test "${HAVE_BE_APP}" = "yes"; then
- AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
+ AC_DEFINE([USE_TOOLKIT_SCROLL_BARS])
USE_TOOLKIT_SCROLL_BARS=yes
fi
elif test "${window_system}" != "x11" && test "${window_system}" != "none"; then
- AC_MSG_ERROR(Non-toolkit scroll bars are not implemented for your system)
+ AC_MSG_ERROR([Non-toolkit scroll bars are not implemented for your system])
fi
dnl See if XIM is available.
@@ -3446,14 +3481,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Xresource.h>]],
[[XIMProc callback;]])],
[HAVE_XIM=yes
- AC_DEFINE(HAVE_XIM, 1, [Define to 1 if XIM is available])],
- HAVE_XIM=no)
+ AC_DEFINE([HAVE_XIM], [1], [Define to 1 if XIM is available])],
+ [HAVE_XIM=no])
dnl Note this is non-standard. --with-xim does not control whether
dnl XIM support is compiled in, it only affects the runtime default of
dnl use_xim in xterm.c.
if test "${with_xim}" != "no"; then
- AC_DEFINE(USE_XIM, 1,
+ AC_DEFINE([USE_XIM], [1],
[Define to 1 to default runtime use of XIM to on.])
fi
@@ -3469,8 +3504,8 @@ if test "${HAVE_X11}" = "yes"; then
[AC_CHECK_LIB([Xrender], [XRenderQueryExtension], [HAVE_XRENDER=yes])])
if test $HAVE_XRENDER = yes; then
XRENDER_LIBS="-lXrender"
- AC_SUBST(XRENDER_LIBS)
- AC_DEFINE([HAVE_XRENDER], 1, [Define to 1 if XRender is available.])
+ AC_SUBST([XRENDER_LIBS])
+ AC_DEFINE([HAVE_XRENDER], [1], [Define to 1 if XRender is available.])
fi
fi
@@ -3479,20 +3514,21 @@ if test "${HAVE_X11}" = "yes"; then
if test "${with_cairo}" != "no"; then
CAIRO_REQUIRED=1.8.0
CAIRO_MODULE="cairo >= $CAIRO_REQUIRED"
- EMACS_CHECK_MODULES(CAIRO, $CAIRO_MODULE)
+ EMACS_CHECK_MODULES([CAIRO], [$CAIRO_MODULE])
if test $HAVE_CAIRO = yes; then
CAIRO_XCB_MODULE="cairo-xcb >= $CAIRO_REQUIRED"
- EMACS_CHECK_MODULES(CAIRO_XCB, $CAIRO_XCB_MODULE)
+ EMACS_CHECK_MODULES([CAIRO_XCB], [$CAIRO_XCB_MODULE])
if test $HAVE_CAIRO_XCB = yes; then
CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XCB_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XCB_LIBS"
- AC_DEFINE(USE_CAIRO_XCB, 1, [Define to 1 if cairo XCB surfaces are available.])
+ AC_DEFINE([USE_CAIRO_XCB], [1],
+ [Define to 1 if cairo XCB surfaces are available.])
fi
- AC_DEFINE(USE_CAIRO, 1, [Define to 1 if using cairo.])
+ AC_DEFINE([USE_CAIRO], [1], [Define to 1 if using cairo.])
CFLAGS="$CFLAGS $CAIRO_CFLAGS"
LIBS="$LIBS $CAIRO_LIBS"
- AC_SUBST(CAIRO_CFLAGS)
- AC_SUBST(CAIRO_LIBS)
+ AC_SUBST([CAIRO_CFLAGS])
+ AC_SUBST([CAIRO_LIBS])
else
AC_MSG_WARN([cairo requested but not found.])
fi
@@ -3512,12 +3548,12 @@ if test "$with_xwidgets" != "no"; then
XWIDGETS_OBJ="xwidget.o"
if test "$HAVE_X_WINDOWS" = "yes" && test "${with_cairo}" = "no"; then
CAIRO_XLIB_MODULES="cairo >= 1.8.0 cairo-xlib >= 1.8.0"
- EMACS_CHECK_MODULES(CAIRO_XLIB, $CAIRO_XLIB_MODULES)
+ EMACS_CHECK_MODULES([CAIRO_XLIB], [$CAIRO_XLIB_MODULES])
if test $HAVE_CAIRO_XLIB = "yes"; then
CAIRO_CFLAGS="$CAIRO_XLIB_CFLAGS"
CAIRO_LIBS="$CAIRO_XLIB_LIBS"
- AC_SUBST(CAIRO_CFLAGS)
- AC_SUBST(CAIRO_LIBS)
+ AC_SUBST([CAIRO_CFLAGS])
+ AC_SUBST([CAIRO_LIBS])
else
AC_MSG_ERROR([xwidgets requested, but a suitable cairo installation wasn't found])
fi
@@ -3532,7 +3568,7 @@ if test "$with_xwidgets" != "no"; then
XWIDGETS_OBJ="xwidget.o"
NS_OBJC_OBJ="$NS_OBJC_OBJ nsxwidget.o"
dnl Update NS_OBJC_OBJ with added nsxwidget.o
- AC_SUBST(NS_OBJC_OBJ)
+ AC_SUBST([NS_OBJC_OBJ])
else
AC_MSG_ERROR([xwidgets requested, it requires GTK3 as X window toolkit or macOS Cocoa as window system.])
fi
@@ -3540,37 +3576,37 @@ if test "$with_xwidgets" != "no"; then
test $HAVE_XWIDGETS = yes ||
AC_MSG_ERROR([xwidgets requested but WebKitGTK+ or WebKit framework not found.])
- AC_DEFINE([HAVE_XWIDGETS], 1, [Define to 1 if you have xwidgets support.])
+ AC_DEFINE([HAVE_XWIDGETS], [1], [Define to 1 if you have xwidgets support.])
fi
-AC_SUBST(XWIDGETS_OBJ)
+AC_SUBST([XWIDGETS_OBJ])
if test "$window_system" = "pgtk"; then
CAIRO_REQUIRED=1.12.0
CAIRO_MODULE="cairo >= $CAIRO_REQUIRED"
- EMACS_CHECK_MODULES(CAIRO, $CAIRO_MODULE)
+ EMACS_CHECK_MODULES([CAIRO], [$CAIRO_MODULE])
if test $HAVE_CAIRO = yes; then
- AC_DEFINE(USE_CAIRO, 1, [Define to 1 if using cairo.])
+ AC_DEFINE([USE_CAIRO], [1], [Define to 1 if using cairo.])
else
AC_MSG_ERROR([cairo required but not found.])
fi
CFLAGS="$CFLAGS $CAIRO_CFLAGS"
LIBS="$LIBS $CAIRO_LIBS"
- AC_SUBST(CAIRO_CFLAGS)
- AC_SUBST(CAIRO_LIBS)
+ AC_SUBST([CAIRO_CFLAGS])
+ AC_SUBST([CAIRO_LIBS])
fi
if test "${HAVE_BE_APP}" = "yes"; then
if test "${with_be_cairo}" != "no"; then
CAIRO_REQUIRED=1.8.0
CAIRO_MODULE="cairo >= $CAIRO_REQUIRED"
- EMACS_CHECK_MODULES(CAIRO, $CAIRO_MODULE)
+ EMACS_CHECK_MODULES([CAIRO], [$CAIRO_MODULE])
if test $HAVE_CAIRO = yes; then
- AC_DEFINE(USE_BE_CAIRO, 1, [Define to 1 if using cairo on Haiku.])
+ AC_DEFINE([USE_BE_CAIRO], [1], [Define to 1 if using cairo on Haiku.])
CFLAGS="$CFLAGS $CAIRO_CFLAGS"
LIBS="$LIBS $CAIRO_LIBS"
- AC_SUBST(CAIRO_CFLAGS)
- AC_SUBST(CAIRO_LIBS)
+ AC_SUBST([CAIRO_CFLAGS])
+ AC_SUBST([CAIRO_LIBS])
else
AC_MSG_WARN([cairo requested but not found.])
fi
@@ -3590,11 +3626,12 @@ if test "${HAVE_X11}" = "yes"; then
dnl The following is needed to set FREETYPE_LIBS.
EMACS_CHECK_MODULES([FREETYPE], [freetype2])
- test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(cairo requires libfreetype)
+ test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR([cairo requires libfreetype])
EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
- test "$HAVE_FONTCONFIG" = "no" && AC_MSG_ERROR(cairo requires libfontconfig)
+ test "$HAVE_FONTCONFIG" = "no" &&
+ AC_MSG_ERROR([cairo requires libfontconfig])
dnl For the "Does Emacs use" message at the end.
HAVE_XFT=no
else
@@ -3621,13 +3658,15 @@ if test "${HAVE_X11}" = "yes"; then
CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
CFLAGS="$CFLAGS $XFT_CFLAGS"
LIBS="$XFT_LIBS $LIBS"
- AC_CHECK_HEADER(X11/Xft/Xft.h,
- [AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS)] , ,
+ AC_CHECK_HEADER([X11/Xft/Xft.h],
+ [AC_CHECK_LIB([Xft], [XftFontOpen], [HAVE_XFT=yes],
+ [], [$XFT_LIBS])],
+ [],
[[#include <X11/X.h>]])
if test "${HAVE_XFT}" = "yes"; then
- AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
- AC_SUBST(XFT_LIBS)
+ AC_DEFINE([HAVE_XFT], [1], [Define to 1 if you have the Xft library.])
+ AC_SUBST([XFT_LIBS])
C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
fi # "${HAVE_XFT}" = "yes"
CPPFLAGS=$OLD_CPPFLAGS
@@ -3650,34 +3689,35 @@ if test "${HAVE_X11}" = "yes"; then
dnl The following is needed to set FREETYPE_LIBS.
EMACS_CHECK_MODULES([FREETYPE], [freetype2])
- test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype)
+ test "$HAVE_FREETYPE" = "no" &&
+ AC_MSG_ERROR([libxft requires libfreetype])
fi
fi # $HAVE_CAIRO != yes
HAVE_LIBOTF=no
if test "${HAVE_FREETYPE}" = "yes"; then
- AC_DEFINE(HAVE_FREETYPE, 1,
+ AC_DEFINE([HAVE_FREETYPE], [1],
[Define to 1 if using the freetype and fontconfig libraries.])
OLD_CFLAGS=$CFLAGS
OLD_LIBS=$LIBS
CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
LIBS="$FREETYPE_LIBS $LIBS"
- AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex)
+ AC_CHECK_FUNCS([FT_Face_GetCharVariantIndex])
CFLAGS=$OLD_CFLAGS
LIBS=$OLD_LIBS
if test "${with_libotf}" != "no"; then
EMACS_CHECK_MODULES([LIBOTF], [libotf])
if test "$HAVE_LIBOTF" = "yes"; then
- AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.])
- AC_CHECK_LIB(otf, OTF_get_variation_glyphs,
- HAVE_OTF_GET_VARIATION_GLYPHS=yes,
- HAVE_OTF_GET_VARIATION_GLYPHS=no)
+ AC_DEFINE([HAVE_LIBOTF], [1], [Define to 1 if using libotf.])
+ AC_CHECK_LIB([otf], [OTF_get_variation_glyphs],
+ [HAVE_OTF_GET_VARIATION_GLYPHS=yes],
+ [HAVE_OTF_GET_VARIATION_GLYPHS=no])
if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then
- AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1,
+ AC_DEFINE([HAVE_OTF_GET_VARIATION_GLYPHS], [1],
[Define to 1 if libotf has OTF_get_variation_glyphs.])
fi
if ! $PKG_CONFIG --atleast-version=0.9.16 libotf; then
- AC_DEFINE(HAVE_OTF_KANNADA_BUG, 1,
+ AC_DEFINE([HAVE_OTF_KANNADA_BUG], [1],
[Define to 1 if libotf is affected by https://debbugs.gnu.org/28110.])
fi
fi
@@ -3691,7 +3731,7 @@ if test "${HAVE_X11}" = "yes"; then
if test "${with_m17n_flt}" != "no"; then
EMACS_CHECK_MODULES([M17N_FLT], [m17n-flt])
if test "$HAVE_M17N_FLT" = "yes"; then
- AC_DEFINE(HAVE_M17N_FLT, 1, [Define to 1 if using libm17n-flt.])
+ AC_DEFINE([HAVE_M17N_FLT], [1], [Define to 1 if using libm17n-flt.])
fi
fi
fi
@@ -3700,20 +3740,20 @@ else # "${HAVE_X11}" != "yes"
EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
EMACS_CHECK_MODULES([FREETYPE], [freetype2])
if test "$HAVE_FONTCONFIG" != yes -o "$HAVE_FREETYPE" != yes; then
- AC_MSG_ERROR(fontconfig and freetype is required.)
+ AC_MSG_ERROR([fontconfig and freetype is required.])
fi
HAVE_LIBOTF=no
- AC_DEFINE(HAVE_FREETYPE, 1,
+ AC_DEFINE([HAVE_FREETYPE], [1],
[Define to 1 if using the freetype and fontconfig libraries.])
if test "${with_libotf}" != "no"; then
EMACS_CHECK_MODULES([LIBOTF], [libotf])
if test "$HAVE_LIBOTF" = "yes"; then
- AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.])
- AC_CHECK_LIB(otf, OTF_get_variation_glyphs,
- HAVE_OTF_GET_VARIATION_GLYPHS=yes,
- HAVE_OTF_GET_VARIATION_GLYPHS=no)
+ AC_DEFINE([HAVE_LIBOTF], [1], [Define to 1 if using libotf.])
+ AC_CHECK_LIB([otf], [OTF_get_variation_glyphs],
+ [HAVE_OTF_GET_VARIATION_GLYPHS=yes],
+ [HAVE_OTF_GET_VARIATION_GLYPHS=no])
if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then
- AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1,
+ AC_DEFINE([HAVE_OTF_GET_VARIATION_GLYPHS], [1],
[Define to 1 if libotf has OTF_get_variation_glyphs.])
fi
fi
@@ -3740,7 +3780,7 @@ if test "${HAVE_X11}" = "yes" && test "${HAVE_FREETYPE}" = "yes" \
if test "${with_harfbuzz}" != "no"; then
EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= $harfbuzz_required_ver])
if test "$HAVE_HARFBUZZ" = "yes"; then
- AC_DEFINE(HAVE_HARFBUZZ, 1, [Define to 1 if using HarfBuzz.])
+ AC_DEFINE([HAVE_HARFBUZZ], [1], [Define to 1 if using HarfBuzz.])
### mingw32 and Cygwin-w32 don't use -lharfbuzz, since they load
### the library dynamically.
if test "${HAVE_W32}" = "yes"; then
@@ -3754,36 +3794,38 @@ fi
if test "${HAVE_BE_APP}" = "yes"; then
if test $HAVE_CAIRO = "yes"; then
EMACS_CHECK_MODULES([FREETYPE], [freetype2 >= 2.5.0])
- test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(cairo on Haiku requires libfreetype)
+ test "$HAVE_FREETYPE" = "no" &&
+ AC_MSG_ERROR([cairo on Haiku requires libfreetype])
EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
- test "$HAVE_FONTCONFIG" = "no" && AC_MSG_ERROR(cairo on Haiku requires libfontconfig)
+ test "$HAVE_FONTCONFIG" = "no" &&
+ AC_MSG_ERROR([cairo on Haiku requires libfontconfig])
fi
HAVE_LIBOTF=no
if test "${HAVE_FREETYPE}" = "yes"; then
- AC_DEFINE(HAVE_FREETYPE, 1,
+ AC_DEFINE([HAVE_FREETYPE], [1],
[Define to 1 if using the freetype and fontconfig libraries.])
OLD_CFLAGS=$CFLAGS
OLD_LIBS=$LIBS
CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
LIBS="$FREETYPE_LIBS $LIBS"
- AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex)
+ AC_CHECK_FUNCS([FT_Face_GetCharVariantIndex])
CFLAGS=$OLD_CFLAGS
LIBS=$OLD_LIBS
if test "${with_libotf}" != "no"; then
EMACS_CHECK_MODULES([LIBOTF], [libotf])
if test "$HAVE_LIBOTF" = "yes"; then
- AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.])
- AC_CHECK_LIB(otf, OTF_get_variation_glyphs,
- HAVE_OTF_GET_VARIATION_GLYPHS=yes,
- HAVE_OTF_GET_VARIATION_GLYPHS=no)
+ AC_DEFINE([HAVE_LIBOTF], [1], [Define to 1 if using libotf.])
+ AC_CHECK_LIB([otf], [OTF_get_variation_glyphs],
+ [HAVE_OTF_GET_VARIATION_GLYPHS=yes],
+ [HAVE_OTF_GET_VARIATION_GLYPHS=no])
if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then
- AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1,
+ AC_DEFINE([HAVE_OTF_GET_VARIATION_GLYPHS], [1],
[Define to 1 if libotf has OTF_get_variation_glyphs.])
fi
if ! $PKG_CONFIG --atleast-version=0.9.16 libotf; then
- AC_DEFINE(HAVE_OTF_KANNADA_BUG, 1,
+ AC_DEFINE([HAVE_OTF_KANNADA_BUG], [1],
[Define to 1 if libotf is affected by https://debbugs.gnu.org/28110.])
fi
fi
@@ -3797,41 +3839,41 @@ if test "${HAVE_BE_APP}" = "yes" && test "${HAVE_FREETYPE}" = "yes"; then
if test "${with_harfbuzz}" != "no"; then
EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= $harfbuzz_required_ver])
if test "$HAVE_HARFBUZZ" = "yes"; then
- AC_DEFINE(HAVE_HARFBUZZ, 1, [Define to 1 if using HarfBuzz.])
+ AC_DEFINE([HAVE_HARFBUZZ], [1], [Define to 1 if using HarfBuzz.])
fi
fi
fi
### End of font-backend section.
-AC_SUBST(FREETYPE_CFLAGS)
-AC_SUBST(FREETYPE_LIBS)
-AC_SUBST(FONTCONFIG_CFLAGS)
-AC_SUBST(FONTCONFIG_LIBS)
-AC_SUBST(HARFBUZZ_CFLAGS)
-AC_SUBST(HARFBUZZ_LIBS)
-AC_SUBST(LIBOTF_CFLAGS)
-AC_SUBST(LIBOTF_LIBS)
-AC_SUBST(M17N_FLT_CFLAGS)
-AC_SUBST(M17N_FLT_LIBS)
+AC_SUBST([FREETYPE_CFLAGS])
+AC_SUBST([FREETYPE_LIBS])
+AC_SUBST([FONTCONFIG_CFLAGS])
+AC_SUBST([FONTCONFIG_LIBS])
+AC_SUBST([HARFBUZZ_CFLAGS])
+AC_SUBST([HARFBUZZ_LIBS])
+AC_SUBST([LIBOTF_CFLAGS])
+AC_SUBST([LIBOTF_LIBS])
+AC_SUBST([M17N_FLT_CFLAGS])
+AC_SUBST([M17N_FLT_LIBS])
XCB_LIBS=
if test "${HAVE_X11}" = "yes"; then
- AC_CHECK_HEADER(X11/Xlib-xcb.h,
- [AC_CHECK_LIB(xcb, xcb_translate_coordinates, HAVE_XCB=yes)])
+ AC_CHECK_HEADER([X11/Xlib-xcb.h],
+ [AC_CHECK_LIB([xcb], [xcb_translate_coordinates], [HAVE_XCB=yes])])
if test "${HAVE_XCB}" = "yes"; then
- AC_CHECK_LIB(X11-xcb, XGetXCBConnection, HAVE_X11_XCB=yes)
+ AC_CHECK_LIB([X11-xcb], [XGetXCBConnection], [HAVE_X11_XCB=yes])
if test "${HAVE_X11_XCB}" = "yes"; then
- AC_CHECK_LIB(xcb-util, xcb_aux_sync, HAVE_XCB_UTIL=yes)
+ AC_CHECK_LIB([xcb-util], [xcb_aux_sync], [HAVE_XCB_UTIL=yes])
if test "${HAVE_XCB_UTIL}" = "yes"; then
- AC_DEFINE(USE_XCB, 1,
+ AC_DEFINE([USE_XCB], [1],
[Define to 1 if you have the XCB library and X11-XCB library for mixed
X11/XCB programming.])
XCB_LIBS="-lX11-xcb -lxcb -lxcb-util"
else
- AC_CHECK_LIB(xcb-aux, xcb_aux_sync, HAVE_XCB_AUX=yes)
+ AC_CHECK_LIB([xcb-aux], [xcb_aux_sync], [HAVE_XCB_AUX=yes])
if test "${HAVE_XCB_AUX}" = "yes"; then
- AC_DEFINE(USE_XCB, 1,
+ AC_DEFINE([USE_XCB], [1],
[Define to 1 if you have the XCB library and X11-XCB library for mixed
X11/XCB programming.])
XCB_LIBS="-lX11-xcb -lxcb -lxcb-aux"
@@ -3840,7 +3882,7 @@ if test "${HAVE_X11}" = "yes"; then
fi
fi
fi
-AC_SUBST(XCB_LIBS)
+AC_SUBST([XCB_LIBS])
### Use -lXpm if available, unless '--with-xpm=no'.
### mingw32 doesn't use -lXpm, since it loads the library dynamically.
@@ -3852,18 +3894,18 @@ if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then
if test "${with_xpm}" != "no"; then
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L/usr/lib/noX"
- AC_CHECK_HEADER(noX/xpm.h,
- [AC_CHECK_LIB(Xpm, XpmReadFileToImage, HAVE_XPM=yes)])
+ AC_CHECK_HEADER([noX/xpm.h],
+ [AC_CHECK_LIB([Xpm], [XpmReadFileToImage], [HAVE_XPM=yes])])
if test "${HAVE_XPM}" = "yes"; then
AC_CACHE_CHECK([for XpmReturnAllocPixels preprocessor define],
[emacs_cv_cpp_xpm_return_alloc_pixels],
- [AC_EGREP_CPP(no_return_alloc_pixels,
+ [AC_EGREP_CPP([no_return_alloc_pixels],
[#include "noX/xpm.h"
#ifndef XpmReturnAllocPixels
no_return_alloc_pixels
#endif
- ], emacs_cv_cpp_xpm_return_alloc_pixels=no,
- emacs_cv_cpp_xpm_return_alloc_pixels=yes)])
+ ], [emacs_cv_cpp_xpm_return_alloc_pixels=no],
+ [emacs_cv_cpp_xpm_return_alloc_pixels=yes])])
if test "$emacs_cv_cpp_xpm_return_alloc_pixels" = "no"; then
HAVE_XPM=no
@@ -3873,7 +3915,8 @@ no_return_alloc_pixels
fi
if test "${HAVE_XPM}" = "yes"; then
- AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
+ AC_DEFINE([HAVE_XPM], [1],
+ [Define to 1 if you have the Xpm library (-lXpm).])
LIBXPM=-lXpm
fi
fi
@@ -3886,18 +3929,19 @@ if test "${HAVE_X11}" = "yes"; then
esac
if test "${with_xpm}" != "no"; then
- AC_CHECK_HEADER(X11/xpm.h,
- [AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11)])
+ AC_CHECK_HEADER([X11/xpm.h],
+ [AC_CHECK_LIB([Xpm], [XpmReadFileToPixmap],
+ [HAVE_XPM=yes], [], [-lX11])])
if test "${HAVE_XPM}" = "yes"; then
AC_CACHE_CHECK([for XpmReturnAllocPixels preprocessor define],
[emacs_cv_cpp_xpm_return_alloc_pixels],
- [AC_EGREP_CPP(no_return_alloc_pixels,
+ [AC_EGREP_CPP([no_return_alloc_pixels],
[#include "X11/xpm.h"
#ifndef XpmReturnAllocPixels
no_return_alloc_pixels
#endif
- ], emacs_cv_cpp_xpm_return_alloc_pixels=no,
- emacs_cv_cpp_xpm_return_alloc_pixels=yes)])
+ ], [emacs_cv_cpp_xpm_return_alloc_pixels=no],
+ [emacs_cv_cpp_xpm_return_alloc_pixels=yes])])
if test "$emacs_cv_cpp_xpm_return_alloc_pixels" = "no"; then
HAVE_XPM=no
@@ -3906,7 +3950,8 @@ no_return_alloc_pixels
fi
if test "${HAVE_XPM}" = "yes"; then
- AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
+ AC_DEFINE([HAVE_XPM], [1],
+ [Define to 1 if you have the Xpm library (-lXpm).])
LIBXPM=-lXpm
elif test "$opsys,$LUCID_LIBW" = aix4-2,-lXaw; then
dnl AIX -lXaw needs -lXpm linked too; see Bug#17598 Message#152.
@@ -3920,16 +3965,17 @@ fi
### run time).
if test "${opsys}" = "mingw32"; then
if test "${with_xpm}" != "no"; then
- AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [
+ AC_CHECK_HEADER([X11/xpm.h], [HAVE_XPM=yes], [HAVE_XPM=no], [
#define FOR_MSW 1])
fi
if test "${HAVE_XPM}" = "yes"; then
- AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
+ AC_DEFINE([HAVE_XPM], [1],
+ [Define to 1 if you have the Xpm library (-lXpm).])
fi
fi
-AC_SUBST(LIBXPM)
+AC_SUBST([LIBXPM])
### Use -ljpeg if available, unless '--with-jpeg=no'.
HAVE_JPEG=no
@@ -3968,7 +4014,7 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes" \
done])
if test "$emacs_cv_jpeglib" != no; then
HAVE_JPEG=yes
- AC_DEFINE([HAVE_JPEG], 1,
+ AC_DEFINE([HAVE_JPEG], [1],
[Define to 1 if you have the jpeg library (typically -ljpeg).])
### mingw32 doesn't use -ljpeg, since it loads the library
### dynamically when needed, and doesn't want a run-time
@@ -3978,7 +4024,7 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes" \
fi
fi
fi
-AC_SUBST(LIBJPEG)
+AC_SUBST([LIBJPEG])
HAVE_LCMS2=no
LCMS2_CFLAGS=
@@ -3987,14 +4033,15 @@ if test "${with_lcms2}" != "no"; then
EMACS_CHECK_MODULES([LCMS2], [lcms2])
fi
if test "${HAVE_LCMS2}" = "yes"; then
- AC_DEFINE([HAVE_LCMS2], 1, [Define to 1 if you have the lcms2 library (-llcms2).])
+ AC_DEFINE([HAVE_LCMS2], [1],
+ [Define to 1 if you have the lcms2 library (-llcms2).])
### mingw32 doesn't use -llcms2, since it loads the library dynamically.
if test "${opsys}" = "mingw32"; then
LCMS2_LIBS=
fi
fi
-AC_SUBST(LCMS2_CFLAGS)
-AC_SUBST(LCMS2_LIBS)
+AC_SUBST([LCMS2_CFLAGS])
+AC_SUBST([LCMS2_LIBS])
HAVE_ZLIB=no
LIBZ=
@@ -4007,13 +4054,14 @@ if test "${with_zlib}" != "no"; then
esac
fi
if test "${HAVE_ZLIB}" = "yes"; then
- AC_DEFINE([HAVE_ZLIB], 1, [Define to 1 if you have the zlib library (-lz).])
+ AC_DEFINE([HAVE_ZLIB], [1],
+ [Define to 1 if you have the zlib library (-lz).])
### mingw32 doesn't use -lz, since it loads the library dynamically.
if test "${opsys}" = "mingw32"; then
LIBZ=
fi
fi
-AC_SUBST(LIBZ)
+AC_SUBST([LIBZ])
### Dynamic modules support
LIBMODULES=
@@ -4067,19 +4115,20 @@ fi
if test "${HAVE_MODULES}" = yes; then
MODULES_OBJ="emacs-module.o"
NEED_DYNLIB=yes
- AC_DEFINE(HAVE_MODULES, 1, [Define to 1 if dynamic modules are enabled])
- AC_DEFINE_UNQUOTED(MODULES_SUFFIX, "$MODULES_SUFFIX",
+ AC_DEFINE([HAVE_MODULES], [1], [Define to 1 if dynamic modules are enabled])
+ AC_DEFINE_UNQUOTED([MODULES_SUFFIX], ["$MODULES_SUFFIX"],
[System extension for dynamic libraries])
if test -n "${MODULES_SECONDARY_SUFFIX}"; then
- AC_DEFINE_UNQUOTED(MODULES_SECONDARY_SUFFIX, "$MODULES_SECONDARY_SUFFIX",
+ AC_DEFINE_UNQUOTED([MODULES_SECONDARY_SUFFIX],
+ ["$MODULES_SECONDARY_SUFFIX"],
[Alternative system extension for dynamic libraries.])
fi
fi
-AC_SUBST(MODULES_OBJ)
-AC_SUBST(LIBMODULES)
-AC_SUBST(HAVE_MODULES)
-AC_SUBST(MODULES_SUFFIX)
-AC_SUBST(MODULES_SECONDARY_SUFFIX)
+AC_SUBST([MODULES_OBJ])
+AC_SUBST([LIBMODULES])
+AC_SUBST([HAVE_MODULES])
+AC_SUBST([MODULES_SUFFIX])
+AC_SUBST([MODULES_SECONDARY_SUFFIX])
AC_CONFIG_FILES([src/emacs-module.h])
AC_SUBST_FILE([module_env_snippet_25])
@@ -4093,7 +4142,7 @@ module_env_snippet_27="$srcdir/src/module-env-27.h"
module_env_snippet_28="$srcdir/src/module-env-28.h"
module_env_snippet_29="$srcdir/src/module-env-29.h"
emacs_major_version="${PACKAGE_VERSION%%.*}"
-AC_SUBST(emacs_major_version)
+AC_SUBST([emacs_major_version])
### Emacs Lisp native compiler support
@@ -4220,8 +4269,9 @@ if test "${with_native_compilation}" != "no"; then
fi
# Check if libgccjit is available.
- AC_CHECK_LIB(gccjit, gcc_jit_context_acquire, [], [libgccjit_not_found])
- AC_CHECK_HEADERS(libgccjit.h, [], [libgccjit_dev_not_found])
+ AC_CHECK_LIB([gccjit], [gcc_jit_context_acquire],
+ [], [libgccjit_not_found])
+ AC_CHECK_HEADERS([libgccjit.h], [], [libgccjit_dev_not_found])
# Check if libgccjit really works.
AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken])
HAVE_NATIVE_COMP=yes
@@ -4238,22 +4288,23 @@ if test "${with_native_compilation}" != "no"; then
LIBGCCJIT_LIBS="-lgccjit -ldl" ;;
esac
NEED_DYNLIB=yes
- AC_DEFINE(HAVE_NATIVE_COMP, 1, [Define to 1 if native compiler is available.])
+ AC_DEFINE([HAVE_NATIVE_COMP], [1],
+ [Define to 1 if native compiler is available.])
CFLAGS=$SAVE_CFLAGS
LIBS=$SAVE_LIBS
fi
-AC_DEFINE_UNQUOTED(NATIVE_ELISP_SUFFIX, ".eln",
+AC_DEFINE_UNQUOTED([NATIVE_ELISP_SUFFIX], [".eln"],
[System extension for native compiled elisp])
-AC_SUBST(HAVE_NATIVE_COMP)
-AC_SUBST(LIBGCCJIT_CFLAGS)
-AC_SUBST(LIBGCCJIT_LIBS)
+AC_SUBST([HAVE_NATIVE_COMP])
+AC_SUBST([LIBGCCJIT_CFLAGS])
+AC_SUBST([LIBGCCJIT_LIBS])
DYNLIB_OBJ=
if test "${NEED_DYNLIB}" = yes; then
DYNLIB_OBJ="dynlib.o"
fi
-AC_SUBST(DYNLIB_OBJ)
+AC_SUBST([DYNLIB_OBJ])
### Use -lpng if available, unless '--with-png=no'.
HAVE_PNG=no
@@ -4325,8 +4376,8 @@ if test $HAVE_PNG = yes; then
]])
CFLAGS=$SAVE_CFLAGS
fi
-AC_SUBST(LIBPNG)
-AC_SUBST(PNG_CFLAGS)
+AC_SUBST([LIBPNG])
+AC_SUBST([PNG_CFLAGS])
### Use -ltiff if available, unless '--with-tiff=no'.
### mingw32 doesn't use -ltiff, since it loads the library dynamically.
@@ -4334,29 +4385,32 @@ HAVE_TIFF=no
LIBTIFF=
if test "${opsys}" = "mingw32"; then
if test "${with_tiff}" != "no"; then
- AC_CHECK_HEADER(tiffio.h, HAVE_TIFF=yes, HAVE_TIFF=no)
+ AC_CHECK_HEADER([tiffio.h], [HAVE_TIFF=yes], [HAVE_TIFF=no])
fi
if test "${HAVE_TIFF}" = "yes"; then
- AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
+ AC_DEFINE([HAVE_TIFF], [1],
+ [Define to 1 if you have the tiff library (-ltiff).])
fi
elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes" \
|| test "${HAVE_NS}" = "yes" || test "${HAVE_BE_APP}" = "yes" \
|| test "$window_system" = "pgtk"; then
if test "${with_tiff}" != "no"; then
- AC_CHECK_HEADER(tiffio.h,
+ AC_CHECK_HEADER([tiffio.h],
[tifflibs="-lz -lm"
# At least one tiff package requires the jpeg library.
if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
- AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs)])
+ AC_CHECK_LIB([tiff], [TIFFGetVersion], [HAVE_TIFF=yes], [],
+ [$tifflibs])])
fi
if test "${HAVE_TIFF}" = "yes"; then
- AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
+ AC_DEFINE([HAVE_TIFF], [1],
+ [Define to 1 if you have the tiff library (-ltiff).])
dnl FIXME -lz -lm, as per libpng?
LIBTIFF=-ltiff
fi
fi
-AC_SUBST(LIBTIFF)
+AC_SUBST([LIBTIFF])
### Use -lgif or -lungif if available, unless '--with-gif=no'.
### mingw32 doesn't use -lgif/-lungif, since it loads the library dynamically.
@@ -4364,34 +4418,40 @@ HAVE_GIF=no
LIBGIF=
if test "${opsys}" = "mingw32"; then
if test "${with_gif}" != "no"; then
- AC_CHECK_HEADER(gif_lib.h, HAVE_GIF=yes, HAVE_GIF=no)
+ AC_CHECK_HEADER([gif_lib.h], [HAVE_GIF=yes], [HAVE_GIF=no])
fi
if test "${HAVE_GIF}" = "yes"; then
- AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.])
+ AC_DEFINE([HAVE_GIF], [1],
+ [Define to 1 if you have a gif (or ungif) library.])
fi
elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
|| test "${HAVE_W32}" = "yes" || test "${HAVE_NS}" = "yes" \
|| test "${HAVE_BE_APP}" = "yes" || test "$window_system" = "pgtk" \
&& test "${with_gif}" != "no"; then
- AC_CHECK_HEADER(gif_lib.h,
+ AC_CHECK_HEADER([gif_lib.h],
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
# Earlier versions can crash Emacs, but version 5.0 removes EGifPutExtensionLast.
- [AC_CHECK_LIB(gif, GifMakeMapObject, HAVE_GIF=yes,
- [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])])
+ [AC_CHECK_LIB([gif], [GifMakeMapObject], [HAVE_GIF=yes],
+ [AC_CHECK_LIB([gif], [EGifPutExtensionLast],
+ [HAVE_GIF=yes],
+ [HAVE_GIF=maybe])])])
if test "$HAVE_GIF" = yes; then
LIBGIF=-lgif
elif test "$HAVE_GIF" = maybe; then
# If gif_lib.h but no libgif, try libungif.
- AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=no)
+ AC_CHECK_LIB([ungif], [EGifPutExtensionLast],
+ [HAVE_GIF=yes],
+ [HAVE_GIF=no])
test "$HAVE_GIF" = yes && LIBGIF=-lungif
fi
if test "${HAVE_GIF}" = "yes"; then
- AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.])
+ AC_DEFINE([HAVE_GIF], [1],
+ [Define to 1 if you have a gif (or ungif) library.])
fi
fi
-AC_SUBST(LIBGIF)
+AC_SUBST([LIBGIF])
dnl Check for required libraries.
MISSING=
@@ -4451,28 +4511,33 @@ fi
HAVE_GPM=no
LIBGPM=
if test "${with_gpm}" != "no"; then
- AC_CHECK_HEADER(gpm.h,
- [AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)])
+ AC_CHECK_HEADER([gpm.h],
+ [AC_CHECK_LIB([gpm], [Gpm_Open], [HAVE_GPM=yes])])
if test "${HAVE_GPM}" = "yes"; then
- AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
+ AC_DEFINE([HAVE_GPM], [1],
+ [Define to 1 if you have the gpm library (-lgpm).])
LIBGPM=-lgpm
fi
fi
-AC_SUBST(LIBGPM)
+AC_SUBST([LIBGPM])
dnl Check for malloc/malloc.h on darwin
-AC_CHECK_HEADERS_ONCE(malloc/malloc.h)
+AC_CHECK_HEADERS_ONCE([malloc/malloc.h])
GNUSTEP_CFLAGS=
### Use NeXTstep API to implement GUI.
if test "${HAVE_NS}" = "yes"; then
- AC_DEFINE(HAVE_NS, 1, [Define to 1 if you are using the NeXTstep API, either GNUstep or Cocoa on macOS.])
+ AC_DEFINE([HAVE_NS], [1],
+ [Define to 1 if you are using the NeXTstep API,
+ either GNUstep or Cocoa on macOS.])
if test "${NS_IMPL_COCOA}" = "yes"; then
- AC_DEFINE(NS_IMPL_COCOA, 1, [Define to 1 if you are using NS windowing under macOS.])
+ AC_DEFINE([NS_IMPL_COCOA], [1],
+ [Define to 1 if you are using NS windowing under macOS.])
fi
if test "${NS_IMPL_GNUSTEP}" = "yes"; then
- AC_DEFINE(NS_IMPL_GNUSTEP, 1, [Define to 1 if you are using NS windowing under GNUstep.])
+ AC_DEFINE([NS_IMPL_GNUSTEP], [1],
+ [Define to 1 if you are using NS windowing under GNUstep.])
if test $NS_GNUSTEP_CONFIG != yes; then
# See also .m.o rule in src/Makefile.in. */
# FIXME: are all these flags really needed? Document here why. */
@@ -4488,15 +4553,16 @@ fi
HAVE_X_SM=no
LIBXSM=
if test "${HAVE_X11}" = "yes"; then
- AC_CHECK_HEADER(X11/SM/SMlib.h,
- [AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, , -lICE)])
+ AC_CHECK_HEADER([X11/SM/SMlib.h],
+ [AC_CHECK_LIB([SM], [SmcOpenConnection], [HAVE_X_SM=yes], [], [-lICE])])
if test "${HAVE_X_SM}" = "yes"; then
- AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
+ AC_DEFINE([HAVE_X_SM], [1],
+ [Define to 1 if you have the SM library (-lSM).])
LIBXSM="-lSM -lICE"
fi
fi
-AC_SUBST(LIBXSM)
+AC_SUBST([LIBXSM])
### Use XRandr (-lXrandr) if available
HAVE_XRANDR=no
@@ -4508,8 +4574,8 @@ if test "${HAVE_X11}" = "yes"; then
# Test old way in case pkg-config doesn't have it (older machines).
# Include Xrender.h by hand to work around bug in older Xrandr.h
# (e.g. RHEL5) and silence (harmless) configure warning (bug#18465).
- AC_CHECK_HEADER(X11/extensions/Xrandr.h,
- [AC_CHECK_LIB(Xrandr, XRRGetScreenResources, HAVE_XRANDR=yes)],
+ AC_CHECK_HEADER([X11/extensions/Xrandr.h],
+ [AC_CHECK_LIB([Xrandr], [XRRGetScreenResources], [HAVE_XRANDR=yes])],
[], [AC_INCLUDES_DEFAULT
#include <X11/extensions/Xrender.h>])
if test $HAVE_XRANDR = yes; then
@@ -4517,11 +4583,12 @@ if test "${HAVE_X11}" = "yes"; then
fi
fi
if test $HAVE_XRANDR = yes; then
- AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have the XRandr extension.])
+ AC_DEFINE([HAVE_XRANDR], [1],
+ [Define to 1 if you have the XRandr extension.])
fi
fi
-AC_SUBST(XRANDR_CFLAGS)
-AC_SUBST(XRANDR_LIBS)
+AC_SUBST([XRANDR_CFLAGS])
+AC_SUBST([XRANDR_LIBS])
### Use Xinerama (-lXinerama) if available
HAVE_XINERAMA=no
@@ -4531,18 +4598,20 @@ if test "${HAVE_X11}" = "yes"; then
EMACS_CHECK_MODULES([XINERAMA], [$XINERAMA_MODULES])
if test $HAVE_XINERAMA = no; then
# Test old way in case pkg-config doesn't have it (older machines).
- AC_CHECK_HEADER(X11/extensions/Xinerama.h,
- [AC_CHECK_LIB(Xinerama, XineramaQueryExtension, HAVE_XINERAMA=yes)])
+ AC_CHECK_HEADER([X11/extensions/Xinerama.h],
+ [AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
+ [HAVE_XINERAMA=yes])])
if test $HAVE_XINERAMA = yes; then
XINERAMA_LIBS=-lXinerama
fi
fi
if test $HAVE_XINERAMA = yes; then
- AC_DEFINE(HAVE_XINERAMA, 1, [Define to 1 if you have the Xinerama extension.])
+ AC_DEFINE([HAVE_XINERAMA], [1],
+ [Define to 1 if you have the Xinerama extension.])
fi
fi
-AC_SUBST(XINERAMA_CFLAGS)
-AC_SUBST(XINERAMA_LIBS)
+AC_SUBST([XINERAMA_CFLAGS])
+AC_SUBST([XINERAMA_LIBS])
### Use Xfixes (-lXfixes) if available
HAVE_XFIXES=no
@@ -4552,18 +4621,19 @@ if test "${HAVE_X11}" = "yes"; then
EMACS_CHECK_MODULES([XFIXES], [$XFIXES_MODULES])
if test $HAVE_XFIXES = no; then
# Test old way in case pkg-config doesn't have it (older machines).
- AC_CHECK_HEADER(X11/extensions/Xfixes.h,
- [AC_CHECK_LIB(Xfixes, XFixesHideCursor, HAVE_XFIXES=yes)])
+ AC_CHECK_HEADER([X11/extensions/Xfixes.h],
+ [AC_CHECK_LIB([Xfixes], [XFixesHideCursor], [HAVE_XFIXES=yes])])
if test $HAVE_XFIXES = yes; then
XFIXES_LIBS=-lXfixes
fi
fi
if test $HAVE_XFIXES = yes; then
- AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have the Xfixes extension.])
+ AC_DEFINE([HAVE_XFIXES], [1],
+ [Define to 1 if you have the Xfixes extension.])
fi
fi
-AC_SUBST(XFIXES_CFLAGS)
-AC_SUBST(XFIXES_LIBS)
+AC_SUBST([XFIXES_CFLAGS])
+AC_SUBST([XFIXES_LIBS])
## Use XInput 2.0 if available
HAVE_XINPUT2=no
@@ -4571,11 +4641,12 @@ if test "${HAVE_X11}" = "yes" && test "${with_xinput2}" != "no"; then
EMACS_CHECK_MODULES([XINPUT], [xi])
if test $HAVE_XINPUT = yes; then
# Now check for XInput2.h
- AC_CHECK_HEADER(X11/extensions/XInput2.h,
- [AC_CHECK_LIB(Xi, XIGrabButton, HAVE_XINPUT2=yes)])
+ AC_CHECK_HEADER([X11/extensions/XInput2.h],
+ [AC_CHECK_LIB([Xi], [XIGrabButton], [HAVE_XINPUT2=yes])])
fi
if test $HAVE_XINPUT2 = yes; then
- AC_DEFINE(HAVE_XINPUT2, 1, [Define to 1 if the X Input Extension version 2.0 or later is present.])
+ AC_DEFINE([HAVE_XINPUT2], [1],
+ [Define to 1 if the X Input Extension version 2.0 or later is present.])
if test "$USE_GTK_TOOLKIT" = "GTK2"; then
AC_MSG_WARN([You are building Emacs with GTK+ 2 and the X Input Extension version 2.
This might lead to problems if your version of GTK+ is not built with support for XInput 2.])
@@ -4589,31 +4660,32 @@ This might lead to problems if your version of GTK+ is not built with support fo
[], [], [#include <X11/extensions/XInput2.h>])
fi
fi
-AC_SUBST(XINPUT_CFLAGS)
-AC_SUBST(XINPUT_LIBS)
+AC_SUBST([XINPUT_CFLAGS])
+AC_SUBST([XINPUT_LIBS])
XSYNC_LIBS=
XSYNC_CFLAGS=
HAVE_XSYNC=no
if test "${HAVE_X11}" = "yes"; then
- AC_CHECK_HEADER(X11/extensions/sync.h,
- [AC_CHECK_LIB(Xext, XSyncQueryExtension, HAVE_XSYNC=yes)],
+ AC_CHECK_HEADER([X11/extensions/sync.h],
+ [AC_CHECK_LIB([Xext], [XSyncQueryExtension], [HAVE_XSYNC=yes])],
[], [#include <X11/Xlib.h>])
if test "${HAVE_XSYNC}" = "yes"; then
- AC_DEFINE(HAVE_XSYNC, 1, [Define to 1 if the X Synchronization Extension is available.])
+ AC_DEFINE([HAVE_XSYNC], [1],
+ [Define to 1 if the X Synchronization Extension is available.])
XSYNC_LIBS="-lXext"
fi
fi
-AC_SUBST(XSYNC_LIBS)
-AC_SUBST(XSYNC_CFLAGS)
+AC_SUBST([XSYNC_LIBS])
+AC_SUBST([XSYNC_CFLAGS])
### Use Xdbe (-lXdbe) if available
HAVE_XDBE=no
if test "${HAVE_X11}" = "yes"; then
if test "${with_xdbe}" != "no"; then
- AC_CHECK_HEADER(X11/extensions/Xdbe.h,
- [AC_CHECK_LIB(Xext, XdbeAllocateBackBufferName, HAVE_XDBE=yes)],
+ AC_CHECK_HEADER([X11/extensions/Xdbe.h],
+ [AC_CHECK_LIB([Xext], [XdbeAllocateBackBufferName], [HAVE_XDBE=yes])],
[],
[#include <X11/Xlib.h>
])
@@ -4622,44 +4694,49 @@ if test "${HAVE_X11}" = "yes"; then
XDBE_LIBS=-lXext
fi
if test $HAVE_XDBE = yes; then
- AC_DEFINE(HAVE_XDBE, 1, [Define to 1 if you have the Xdbe extension.])
+ AC_DEFINE([HAVE_XDBE], [1], [Define to 1 if you have the Xdbe extension.])
fi
fi
-AC_SUBST(XDBE_CFLAGS)
-AC_SUBST(XDBE_LIBS)
+AC_SUBST([XDBE_CFLAGS])
+AC_SUBST([XDBE_LIBS])
### Use the Nonrectangular Window Shape extension if available.
HAVE_XSHAPE=no
HAVE_XCB_SHAPE=no
if test "${HAVE_X11}" = "yes"; then
- AC_CHECK_HEADER(X11/extensions/shape.h,
- [AC_CHECK_LIB(Xext, XShapeQueryVersion, HAVE_XSHAPE=yes)],
+ AC_CHECK_HEADER([X11/extensions/shape.h],
+ [AC_CHECK_LIB([Xext], [XShapeQueryVersion], [HAVE_XSHAPE=yes])],
[],
[#include <X11/extensions/shape.h>
])
if test $HAVE_XSHAPE = yes; then
XSHAPE_LIBS=-lXext
- AC_CHECK_HEADER(xcb/shape.h,
- [AC_CHECK_LIB(xcb-shape, xcb_shape_combine, HAVE_XCB_SHAPE=yes)], [],
+ AC_CHECK_HEADER([xcb/shape.h],
+ [AC_CHECK_LIB([xcb-shape], [xcb_shape_combine], [HAVE_XCB_SHAPE=yes])],
+ [],
[#include <xcb/shape.h>])
if test $HAVE_XCB_SHAPE = yes && test "$XCB_LIBS" != ""; then
XSHAPE_LIBS="$XSHAPE_LIBS -lxcb-shape"
- AC_DEFINE(HAVE_XCB_SHAPE, 1, [Define to 1 if XCB supports the Nonrectangular Window Shape extension.])
+ AC_DEFINE([HAVE_XCB_SHAPE], [1],
+ [Define to 1 if XCB supports the
+ Nonrectangular Window Shape extension.])
fi
fi
if test $HAVE_XSHAPE = yes; then
- AC_DEFINE(HAVE_XSHAPE, 1, [Define to 1 if you have the Nonrectangular Window Shape extension.])
+ AC_DEFINE([HAVE_XSHAPE], [1],
+ [Define to 1 if you have the Nonrectangular Window Shape extension.])
fi
fi
-AC_SUBST(XSHAPE_CFLAGS)
-AC_SUBST(XSHAPE_LIBS)
+AC_SUBST([XSHAPE_CFLAGS])
+AC_SUBST([XSHAPE_LIBS])
### Use Xcomposite (-lXcomposite) if available
HAVE_XCOMPOSITE=no
if test "${HAVE_X11}" = "yes"; then
- AC_CHECK_HEADER(X11/extensions/Xcomposite.h,
- [AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, HAVE_XCOMPOSITE=yes)],
+ AC_CHECK_HEADER([X11/extensions/Xcomposite.h],
+ [AC_CHECK_LIB([Xcomposite], [XCompositeRedirectWindow],
+ [HAVE_XCOMPOSITE=yes])],
[],
[#include <X11/extensions/Xcomposite.h>
])
@@ -4667,11 +4744,12 @@ if test "${HAVE_X11}" = "yes"; then
XCOMPOSITE_LIBS=-lXcomposite
fi
if test $HAVE_XCOMPOSITE = yes; then
- AC_DEFINE(HAVE_XCOMPOSITE, 1, [Define to 1 if you have the XCOMPOSITE extension.])
+ AC_DEFINE([HAVE_XCOMPOSITE], [1],
+ [Define to 1 if you have the XCOMPOSITE extension.])
fi
fi
-AC_SUBST(XCOMPOSITE_CFLAGS)
-AC_SUBST(XCOMPOSITE_LIBS)
+AC_SUBST([XCOMPOSITE_CFLAGS])
+AC_SUBST([XCOMPOSITE_LIBS])
### Use libxml (-lxml2) if available
### mingw32 doesn't use -lxml2, since it loads the library dynamically.
@@ -4691,8 +4769,8 @@ if test "${with_xml2}" != "no"; then
esac
fi
CPPFLAGS="$CPPFLAGS -isystem${xcsdkdir}/usr/include/libxml2"
- AC_CHECK_HEADER(libxml/HTMLparser.h,
- [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, ,
+ AC_CHECK_HEADER([libxml/HTMLparser.h],
+ [AC_CHECK_DECL([HTML_PARSE_RECOVER], [HAVE_LIBXML2=yes], [],
[#include <libxml/HTMLparser.h>])])
CPPFLAGS="$SAVE_CPPFLAGS"
if test "${HAVE_LIBXML2}" = "yes"; then
@@ -4702,21 +4780,24 @@ if test "${with_xml2}" != "no"; then
fi
if test "${HAVE_LIBXML2}" = "yes"; then
if test "${opsys}" != "mingw32"; then
- AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no,
+ AC_CHECK_LIB([xml2], [htmlReadMemory],
+ [HAVE_LIBXML2=yes],
+ [HAVE_LIBXML2=no],
[$LIBXML2_LIBS])
else
LIBXML2_LIBS=""
fi
if test "${HAVE_LIBXML2}" = "yes"; then
- AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).])
+ AC_DEFINE([HAVE_LIBXML2], [1],
+ [Define to 1 if you have the libxml library (-lxml2).])
else
LIBXML2_LIBS=""
LIBXML2_CFLAGS=""
fi
fi
fi
-AC_SUBST(LIBXML2_LIBS)
-AC_SUBST(LIBXML2_CFLAGS)
+AC_SUBST([LIBXML2_LIBS])
+AC_SUBST([LIBXML2_CFLAGS])
BLESSMAIL_TARGET=
LIBS_MAIL=
@@ -4822,7 +4903,7 @@ AC_SUBST([LIBSECCOMP_CFLAGS])
OLD_LIBS=$LIBS
LIBS="$LIB_PTHREAD $LIB_MATH $LIBS"
-AC_CHECK_FUNCS(accept4 fchdir gethostname \
+AC_CHECK_FUNCS([accept4 fchdir gethostname \
getrusage get_current_dir_name \
lrand48 random rint trunc \
select getpagesize setlocale newlocale \
@@ -4832,7 +4913,7 @@ sendto recvfrom getsockname getifaddrs freeifaddrs \
gai_strerror sync \
getpwent endpwent getgrent endgrent \
cfmakeraw cfsetspeed __executable_start log2 pthread_setname_np \
-pthread_set_name_np)
+pthread_set_name_np])
LIBS=$OLD_LIBS
if test "$ac_cv_func_pthread_setname_np" = "yes"; then
@@ -4847,7 +4928,7 @@ if test "$ac_cv_func_pthread_setname_np" = "yes"; then
[emacs_cv_pthread_setname_np_1arg=no])])
if test "$emacs_cv_pthread_setname_np_1arg" = "yes"; then
AC_DEFINE(
- HAVE_PTHREAD_SETNAME_NP_1ARG, 1,
+ [HAVE_PTHREAD_SETNAME_NP_1ARG], [1],
[Define to 1 if pthread_setname_np takes a single argument.])
else
AC_CACHE_CHECK(
@@ -4861,7 +4942,7 @@ if test "$ac_cv_func_pthread_setname_np" = "yes"; then
[emacs_cv_pthread_setname_np_3arg=no])])
if test "$emacs_cv_pthread_setname_np_3arg" = "yes"; then
AC_DEFINE(
- HAVE_PTHREAD_SETNAME_NP_3ARG, 1,
+ [HAVE_PTHREAD_SETNAME_NP_3ARG], [1],
[Define to 1 if pthread_setname_np takes three arguments.])
fi
fi
@@ -4894,28 +4975,28 @@ AC_CACHE_CHECK([for __builtin_frame_address],
[emacs_cv_func___builtin_frame_address=yes],
[emacs_cv_func___builtin_frame_address=no])])
if test $emacs_cv_func___builtin_frame_address = yes; then
- AC_DEFINE([HAVE___BUILTIN_FRAME_ADDRESS], 1,
+ AC_DEFINE([HAVE___BUILTIN_FRAME_ADDRESS], [1],
[Define to 1 if you have the '__builtin_frame_address' function.])
fi
AC_CACHE_CHECK([for __builtin_unwind_init],
- emacs_cv_func___builtin_unwind_init,
+ [emacs_cv_func___builtin_unwind_init],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_unwind_init ();])],
- emacs_cv_func___builtin_unwind_init=yes,
- emacs_cv_func___builtin_unwind_init=no)])
+ [emacs_cv_func___builtin_unwind_init=yes],
+ [emacs_cv_func___builtin_unwind_init=no])])
if test $emacs_cv_func___builtin_unwind_init = yes; then
- AC_DEFINE(HAVE___BUILTIN_UNWIND_INIT, 1,
+ AC_DEFINE([HAVE___BUILTIN_UNWIND_INIT], [1],
[Define to 1 if you have the '__builtin_unwind_init' function.])
fi
-AC_CHECK_HEADERS_ONCE(sys/un.h)
+AC_CHECK_HEADERS_ONCE([sys/un.h])
AC_FUNC_FSEEKO
# UNIX98 PTYs.
-AC_CHECK_FUNCS(grantpt)
+AC_CHECK_FUNCS([grantpt])
# PTY-related GNU extensions.
-AC_CHECK_FUNCS(getpt posix_openpt)
+AC_CHECK_FUNCS([getpt posix_openpt])
dnl Run a test program that contains a call to tputs, a call that is
dnl never executed. This tests whether a pre-'main' dynamic linker
@@ -4987,14 +5068,15 @@ case "$opsys" in
freebsd)
AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo])
- AC_CACHE_VAL(emacs_cv_freebsd_terminfo,
+ AC_CACHE_VAL([emacs_cv_freebsd_terminfo],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <osreldate.h>]],
[[#if __FreeBSD_version < 400000
fail;
#endif
-]])], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)])
+]])], [emacs_cv_freebsd_terminfo=yes],
+ [emacs_cv_freebsd_terminfo=no])])
- AC_MSG_RESULT($emacs_cv_freebsd_terminfo)
+ AC_MSG_RESULT([$emacs_cv_freebsd_terminfo])
if test $emacs_cv_freebsd_terminfo = yes; then
LIBS_TERMCAP="-lncurses"
@@ -5029,7 +5111,8 @@ esac
TERMCAP_OBJ=tparam.o
if test $TERMINFO = yes; then
- AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.])
+ AC_DEFINE([TERMINFO], [1],
+ [Define to 1 if you use terminfo instead of termcap.])
TERMCAP_OBJ=terminfo.o
AC_CACHE_CHECK([whether $LIBS_TERMCAP library defines BC],
[emacs_cv_terminfo_defines_BC],
@@ -5040,15 +5123,15 @@ if test $TERMINFO = yes; then
[emacs_cv_terminfo_defines_BC=no])
LIBS=$OLD_LIBS])
if test "$emacs_cv_terminfo_defines_BC" = yes; then
- AC_DEFINE([TERMINFO_DEFINES_BC], 1, [Define to 1 if the
+ AC_DEFINE([TERMINFO_DEFINES_BC], [1], [Define to 1 if the
terminfo library defines the variables BC, PC, and UP.])
fi
fi
if test "X$LIBS_TERMCAP" = "X-lncurses"; then
- AC_DEFINE(USE_NCURSES, 1, [Define to 1 if you use ncurses.])
+ AC_DEFINE([USE_NCURSES], [1], [Define to 1 if you use ncurses.])
fi
-AC_SUBST(LIBS_TERMCAP)
-AC_SUBST(TERMCAP_OBJ)
+AC_SUBST([LIBS_TERMCAP])
+AC_SUBST([TERMCAP_OBJ])
# GNU/Linux-specific timer functions.
AC_CACHE_CHECK([for timerfd interface], [emacs_cv_have_timerfd],
@@ -5061,7 +5144,7 @@ AC_CACHE_CHECK([for timerfd interface], [emacs_cv_have_timerfd],
[emacs_cv_have_timerfd=yes],
[emacs_cv_have_timerfd=no])])
if test "$emacs_cv_have_timerfd" = yes; then
- AC_DEFINE([HAVE_TIMERFD], 1,
+ AC_DEFINE([HAVE_TIMERFD], [1],
[Define to 1 if timerfd functions are supported as in GNU/Linux.])
fi
@@ -5088,25 +5171,26 @@ LIBRESOLV=
if test "$with_hesiod" != no ; then
# Don't set $LIBS here -- see comments above. FIXME which comments?
resolv=no
- AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
- [AC_CHECK_LIB(resolv, res_send, resolv=yes,
- [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
+ AC_CHECK_FUNC([res_send], [], [AC_CHECK_FUNC([__res_send], [],
+ [AC_CHECK_LIB([resolv], [res_send], [resolv=yes],
+ [AC_CHECK_LIB([resolv], [__res_send], [resolv=yes])])])])
if test "$resolv" = yes ; then
RESOLVLIB=-lresolv
else
RESOLVLIB=
fi
hesiod=no
- AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
- hesiod=yes, :, $RESOLVLIB)])
+ AC_CHECK_FUNC([hes_getmailhost], [],
+ [AC_CHECK_LIB([hesiod], [hes_getmailhost],
+ [hesiod=yes], [:], [$RESOLVLIB])])
if test x"$hesiod" = xyes; then
LIBHESIOD=-lhesiod
LIBRESOLV=$RESOLVLIB
fi
fi
-AC_SUBST(LIBHESIOD)
-AC_SUBST(LIBRESOLV)
+AC_SUBST([LIBHESIOD])
+AC_SUBST([LIBRESOLV])
# These tell us which Kerberos-related libraries to use.
COM_ERRLIB=
@@ -5117,45 +5201,51 @@ KRB4LIB=
if test "${with_kerberos}" != no; then
OLD_LIBS=$LIBS
- AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no)
+ AC_CHECK_LIB([com_err], [com_err], [have_com_err=yes], [have_com_err=no])
if test $have_com_err = yes; then
COM_ERRLIB=-lcom_err
LIBS="$COM_ERRLIB $LIBS"
fi
- AC_CHECK_LIB(crypto, mit_des_cbc_encrypt, have_crypto=yes, have_crypto=no)
+ AC_CHECK_LIB([crypto], [mit_des_cbc_encrypt],
+ [have_crypto=yes],
+ [have_crypto=no])
if test $have_crypto = yes; then
CRYPTOLIB=-lcrypto
LIBS="$CRYPTOLIB $LIBS"
fi
- AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt, have_k5crypto=yes, have_k5crypto=no)
+ AC_CHECK_LIB([k5crypto], [mit_des_cbc_encrypt],
+ [have_k5crypto=yes],
+ [have_k5crypto=no])
if test $have_k5crypto = yes; then
CRYPTOLIB=-lk5crypto
LIBS="$CRYPTOLIB $LIBS"
fi
- AC_CHECK_LIB(krb5, krb5_init_context, have_krb5=yes, have_krb5=no)
+ AC_CHECK_LIB([krb5], [krb5_init_context], [have_krb5=yes], [have_krb5=no])
if test $have_krb5=yes; then
KRB5LIB=-lkrb5
LIBS="$KRB5LIB $LIBS"
fi
dnl FIXME Simplify. Does not match 22 logic, thanks to default_off?
if test "${with_kerberos5}" = no; then
- AC_CHECK_LIB(des425, des_cbc_encrypt, have_des425=yes, have_des425=no )
+ AC_CHECK_LIB([des425], [des_cbc_encrypt],
+ [have_des425=yes],
+ [have_des425=no])
if test $have_des425 = yes; then
DESLIB=-ldes425
LIBS="$DESLIB $LIBS"
else
- AC_CHECK_LIB(des, des_cbc_encrypt, have_des=yes, have_des=no)
+ AC_CHECK_LIB([des], [des_cbc_encrypt], [have_des=yes], [have_des=no])
if test $have_des = yes; then
DESLIB=-ldes
LIBS="$DESLIB $LIBS"
fi
fi
- AC_CHECK_LIB(krb4, krb_get_cred, have_krb4=yes, have_krb4=no)
+ AC_CHECK_LIB([krb4], [krb_get_cred], [have_krb4=yes], [have_krb4=no])
if test $have_krb4 = yes; then
KRB4LIB=-lkrb4
LIBS="$KRB4LIB $LIBS"
else
- AC_CHECK_LIB(krb, krb_get_cred, have_krb=yes, have_krb=no)
+ AC_CHECK_LIB([krb], [krb_get_cred], [have_krb=yes], [have_krb=no])
if test $have_krb = yes; then
KRB4LIB=-lkrb
LIBS="$KRB4LIB $LIBS"
@@ -5164,25 +5254,25 @@ if test "${with_kerberos}" != no; then
fi
if test "${with_kerberos5}" != no; then
- AC_CHECK_HEADERS(krb5.h,
- [AC_CHECK_MEMBERS([krb5_error.text, krb5_error.e_text],,,
+ AC_CHECK_HEADERS([krb5.h],
+ [AC_CHECK_MEMBERS([krb5_error.text, krb5_error.e_text], [], [],
[#include <krb5.h>])])
else
- AC_CHECK_HEADERS(krb.h,,
- [AC_CHECK_HEADERS(kerberosIV/krb.h,,
- [AC_CHECK_HEADERS(kerberos/krb.h)])])
+ AC_CHECK_HEADERS([krb.h], [],
+ [AC_CHECK_HEADERS([kerberosIV/krb.h], [],
+ [AC_CHECK_HEADERS([kerberos/krb.h])])])
fi
- AC_CHECK_HEADERS(com_err.h)
+ AC_CHECK_HEADERS([com_err.h])
LIBS=$OLD_LIBS
fi
-AC_SUBST(COM_ERRLIB)
-AC_SUBST(CRYPTOLIB)
-AC_SUBST(KRB5LIB)
-AC_SUBST(DESLIB)
-AC_SUBST(KRB4LIB)
+AC_SUBST([COM_ERRLIB])
+AC_SUBST([CRYPTOLIB])
+AC_SUBST([KRB5LIB])
+AC_SUBST([DESLIB])
+AC_SUBST([KRB4LIB])
-AC_CHECK_HEADERS(valgrind/valgrind.h)
+AC_CHECK_HEADERS([valgrind/valgrind.h])
AC_CHECK_MEMBERS([struct unipair.unicode], [], [], [[#include <linux/kd.h>]])
@@ -5192,7 +5282,7 @@ AC_FUNC_FORK
dnl AC_CHECK_FUNCS_ONCE wouldn’t be right for snprintf, which needs
dnl the current CFLAGS etc.
-AC_CHECK_FUNCS(snprintf)
+AC_CHECK_FUNCS([snprintf])
dnl posix_spawn. The chdir and setsid functionality is relatively
dnl recent, so we check for it specifically.
@@ -5236,12 +5326,12 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM(
CFLAGS="$OLDCFLAGS"
LIBS="$OLDLIBS"])
if test "${emacs_cv_links_glib}" = "yes"; then
- AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if GLib is linked in.])
+ AC_DEFINE([HAVE_GLIB], [1], [Define to 1 if GLib is linked in.])
if test "$HAVE_NS" = no ; then
XGSELOBJ=xgselect.o
fi
fi
-AC_SUBST(XGSELOBJ)
+AC_SUBST([XGSELOBJ])
dnl Adapted from Haible's version.
AC_CACHE_CHECK([for nl_langinfo and CODESET], [emacs_cv_langinfo_codeset],
@@ -5251,7 +5341,7 @@ AC_CACHE_CHECK([for nl_langinfo and CODESET], [emacs_cv_langinfo_codeset],
[emacs_cv_langinfo_codeset=no])
])
if test "$emacs_cv_langinfo_codeset" = yes; then
- AC_DEFINE([HAVE_LANGINFO_CODESET], 1,
+ AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
[Define if you have <langinfo.h> and nl_langinfo (CODESET).])
AC_CACHE_CHECK([for nl_langinfo and _NL_PAPER_WIDTH],
@@ -5262,7 +5352,7 @@ if test "$emacs_cv_langinfo_codeset" = yes; then
[emacs_cv_langinfo__nl_paper_width=no])
])
if test "$emacs_cv_langinfo__nl_paper_width" = yes; then
- AC_DEFINE([HAVE_LANGINFO__NL_PAPER_WIDTH], 1,
+ AC_DEFINE([HAVE_LANGINFO__NL_PAPER_WIDTH], [1],
[Define if you have <langinfo.h> and nl_langinfo (_NL_PAPER_WIDTH).])
fi
fi
@@ -5275,15 +5365,17 @@ dnl The following looks like a useful start.
dnl
dnl AC_SYS_POSIX_TERMIOS
dnl if test $ac_cv_sys_posix_termios = yes; then
-dnl AC_DEFINE(HAVE_TERMIOS, 1, [Define to 1 if you have POSIX-style functions
-dnl and macros for terminal control.])
-dnl AC_DEFINE(HAVE_TCATTR, 1, [Define to 1 if you have tcgetattr and tcsetattr.])
+dnl AC_DEFINE([HAVE_TERMIOS], [1],
+dnl [Define to 1 if you have POSIX-style
+dnl functions and macros for terminal control.])
+dnl AC_DEFINE([HAVE_TCATTR], [1],
+dnl [Define to 1 if you have tcgetattr and tcsetattr.])
dnl fi
dnl Turned on June 1996 supposing nobody will mind it.
dnl MinGW emulates passwd database, so this feature doesn't make sense there.
if test "${opsys}" != "mingw32"; then
- AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that &
+ AC_DEFINE([AMPERSAND_FULL_NAME], [1], [Define to use the convention that &
in the full name stands for the login id.])
fi
@@ -5291,22 +5383,23 @@ dnl Everybody supports this, except MS.
dnl Seems like the kind of thing we should be testing for, though.
## Note: PTYs are broken on darwin <6. Use at your own risk.
if test "${opsys}" != "mingw32"; then
- AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.])
+ AC_DEFINE([HAVE_PTYS], [1], [Define if the system supports pty devices.])
fi
dnl Everybody supports this, except MS-DOS.
dnl Seems like the kind of thing we should be testing for, though.
-AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports
+AC_DEFINE([HAVE_SOCKETS], [1], [Define if the system supports
4.2-compatible sockets.])
-AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".])
+AH_TEMPLATE([INTERNAL_TERMINAL],
+ [This is substituted when $TERM is "internal".])
-AH_TEMPLATE(NULL_DEVICE, [Name of the file to open to get
+AH_TEMPLATE([NULL_DEVICE], [Name of the file to open to get
a null file, or a data sink.])
if test "${opsys}" = "mingw32"; then
- AC_DEFINE(NULL_DEVICE, ["NUL:"])
+ AC_DEFINE([NULL_DEVICE], ["NUL:"])
else
- AC_DEFINE(NULL_DEVICE, ["/dev/null"])
+ AC_DEFINE([NULL_DEVICE], ["/dev/null"])
fi
if test "${opsys}" = "mingw32"; then
@@ -5314,7 +5407,8 @@ if test "${opsys}" = "mingw32"; then
else
SEPCHAR=':'
fi
-AC_DEFINE_UNQUOTED(SEPCHAR, ['$SEPCHAR'], [Character that separates PATH elements.])
+AC_DEFINE_UNQUOTED([SEPCHAR], ['$SEPCHAR'],
+ [Character that separates PATH elements.])
dnl This is for MinGW, and is used in test/Makefile.in.
dnl The MSYS Bash has heuristics for replacing ':' with ';' when it
dnl decides that a command-line argument to be passed to a MinGW program
@@ -5324,34 +5418,35 @@ dnl sees a colon-separated list of file names; e.g. ":." is left alone,
dnl which breaks in-tree builds. So we do this manually instead.
dnl Note that we cannot rely on PATH_SEPARATOR, as that one will always
dnl be computed as ':' in MSYS Bash.
-AC_SUBST(SEPCHAR)
+AC_SUBST([SEPCHAR])
dnl Everybody supports this, except MS-DOS.
-AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.])
+AC_DEFINE([subprocesses], [1], [Define to enable asynchronous subprocesses.])
-AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.])
+AC_DEFINE([USER_FULL_NAME], [pw->pw_gecos], [How to get a user's full name.])
-AC_DEFINE(DIRECTORY_SEP, ['/'],
+AC_DEFINE([DIRECTORY_SEP], ['/'],
[Character that separates directories in a file name.])
if test "${opsys}" = "mingw32"; then
- AC_DEFINE(IS_DEVICE_SEP(_c_), [((_c_) == ':')],
+ AC_DEFINE([IS_DEVICE_SEP(_c_)], [((_c_) == ':')],
[Returns true if character is a device separator.])
- AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == '/' || (_c_) == '\\')],
+ AC_DEFINE([IS_DIRECTORY_SEP(_c_)], [((_c_) == '/' || (_c_) == '\\')],
[Returns true if character is a directory separator.])
- AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP(_c_))],
+ AC_DEFINE([IS_ANY_SEP(_c_)],
+ [(IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))],
[Returns true if character is any form of separator.])
else
- AC_DEFINE(IS_DEVICE_SEP(_c_), 0,
+ AC_DEFINE([IS_DEVICE_SEP(_c_)], 0,
[Returns true if character is a device separator.])
- AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
+ AC_DEFINE([IS_DIRECTORY_SEP(_c_)], [((_c_) == DIRECTORY_SEP)],
[Returns true if character is a directory separator.])
- AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))],
+ AC_DEFINE([IS_ANY_SEP(_c_)], [(IS_DIRECTORY_SEP (_c_))],
[Returns true if character is any form of separator.])
fi
@@ -5376,7 +5471,7 @@ if test "$USE_X_TOOLKIT" != "none"; then
[[#include <X11/Intrinsic.h>
#include <X11/Xmu/Editres.h>]],
[[_XEditResCheckMessages (0, 0, 0, 0);]])],
- [AC_DEFINE([X_TOOLKIT_EDITRES], 1,
+ [AC_DEFINE([X_TOOLKIT_EDITRES], [1],
[Define to 1 if we should use XEditRes.])])
LIBS=$OLDLIBS
fi
@@ -5388,7 +5483,7 @@ case $opsys in
dnl instead, there's a system variable _sys_nsig. Unfortunately, we
dnl need the constant to dimension an array. So wire in the appropriate
dnl value here.
- AC_DEFINE(NSIG_MINIMUM, 32, [Minimum value of NSIG.])
+ AC_DEFINE([NSIG_MINIMUM], [32], [Minimum value of NSIG.])
;;
esac
@@ -5421,7 +5516,7 @@ case $opsys in
dnl of this file, so that we do not check for get_current_dir_name
dnl on AIX. But that might be fragile if something else ends
dnl up testing for get_current_dir_name as a dependency.
- AC_DEFINE(BROKEN_GET_CURRENT_DIR_NAME, 1, [Define if
+ AC_DEFINE([BROKEN_GET_CURRENT_DIR_NAME], [1], [Define if
get_current_dir_name should not be used.])
;;
@@ -5439,7 +5534,7 @@ case $opsys in
dnl successfully after processing (for example with CRs added if the
dnl terminal is set up that way which it is here). The same bytes will
dnl be seen again in a later read(2), without the CRs.
- AC_DEFINE(BROKEN_PTY_READ_AFTER_EAGAIN, 1, [Define on FreeBSD to
+ AC_DEFINE([BROKEN_PTY_READ_AFTER_EAGAIN], [1], [Define on FreeBSD to
work around an issue when reading from a PTY.])
;;
esac
@@ -5447,13 +5542,13 @@ esac
case $opsys in
gnu-* | solaris )
dnl FIXME Can't we test if this exists (eg /proc/$$)?
- AC_DEFINE(HAVE_PROCFS, 1, [Define if you have the /proc filesystem.])
+ AC_DEFINE([HAVE_PROCFS], [1], [Define if you have the /proc filesystem.])
;;
esac
case $opsys in
darwin | dragonfly | freebsd | netbsd | openbsd )
- AC_DEFINE(DONT_REOPEN_PTY, 1, [Define if process.c does not need to
+ AC_DEFINE([DONT_REOPEN_PTY], [1], [Define if process.c does not need to
close a pty to make it a controlling terminal (it is already a
controlling terminal of the subprocess, because we did ioctl TIOCSCTTY).])
;;
@@ -5466,7 +5561,7 @@ case $opsys in
esac
dnl Used in sound.c
-AC_DEFINE_UNQUOTED(DEFAULT_SOUND_DEVICE, "$sound_device",
+AC_DEFINE_UNQUOTED([DEFAULT_SOUND_DEVICE], ["$sound_device"],
[Name of the default sound device.])
@@ -5493,7 +5588,7 @@ dnl to read the input and send it to the true Emacs process
dnl through a pipe.
case $opsys in
darwin | gnu-linux | gnu-kfreebsd)
- AC_DEFINE(INTERRUPT_INPUT, 1, [Define to read input using SIGIO.])
+ AC_DEFINE([INTERRUPT_INPUT], [1], [Define to read input using SIGIO.])
;;
esac
@@ -5505,73 +5600,78 @@ dnl NARROWPROTO, we will see the wrong function prototypes for X functions
dnl taking float or double parameters.
case $opsys in
cygwin|gnu|gnu-linux|gnu-kfreebsd|freebsd|netbsd|openbsd)
- AC_DEFINE(NARROWPROTO, 1, [Define if system's imake configuration
+ AC_DEFINE([NARROWPROTO], [1], [Define if system's imake configuration
file defines 'NeedWidePrototypes' as 'NO'.])
;;
esac
dnl Used in process.c, this must be a loop, even if it only runs once.
-AH_TEMPLATE(PTY_ITERATION, [How to iterate over PTYs.])
+AH_TEMPLATE([PTY_ITERATION], [How to iterate over PTYs.])
dnl Only used if !PTY_ITERATION. Iterate from FIRST_PTY_LETTER to z,
dnl trying suffixes 0-16.
-AH_TEMPLATE(FIRST_PTY_LETTER, [Letter to use in finding device name of
+AH_TEMPLATE([FIRST_PTY_LETTER], [Letter to use in finding device name of
first PTY, if PTYs are supported.])
-AH_TEMPLATE(PTY_OPEN, [How to open a PTY, if non-standard.])
-AH_TEMPLATE(PTY_NAME_SPRINTF, [How to get the device name of the control
+AH_TEMPLATE([PTY_OPEN], [How to open a PTY, if non-standard.])
+AH_TEMPLATE([PTY_NAME_SPRINTF], [How to get the device name of the control
end of a PTY, if non-standard.])
-AH_TEMPLATE(PTY_TTY_NAME_SPRINTF, [How to get device name of the tty
+AH_TEMPLATE([PTY_TTY_NAME_SPRINTF], [How to get device name of the tty
end of a PTY, if non-standard.])
case $opsys in
aix4-2 )
- AC_DEFINE(PTY_ITERATION, [int c; for (c = 0; !c ; c++)])
+ AC_DEFINE([PTY_ITERATION], [int c; for (c = 0; !c ; c++)])
dnl You allocate a pty by opening /dev/ptc to get the master side.
dnl To get the name of the slave side, you just ttyname() the master side.
- AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");])
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));])
+ AC_DEFINE([PTY_NAME_SPRINTF], [strcpy (pty_name, "/dev/ptc");])
+ AC_DEFINE([PTY_TTY_NAME_SPRINTF], [strcpy (pty_name, ttyname (fd));])
;;
cygwin )
- AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
+ AC_DEFINE([PTY_ITERATION], [int i; for (i = 0; i < 1; i++)])
dnl multi-line AC_DEFINEs are hard. :(
- AC_DEFINE(PTY_OPEN, [ do { int dummy; sigset_t blocked, procmask; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, &procmask); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; pthread_sigmask (SIG_SETMASK, &procmask, 0); if (fd >= 0) emacs_close (dummy); } while (false)])
- AC_DEFINE(PTY_NAME_SPRINTF, [])
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
+ AC_DEFINE([PTY_OPEN],
+ [ do { int dummy; sigset_t blocked, procmask; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, &procmask); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; pthread_sigmask (SIG_SETMASK, &procmask, 0); if (fd >= 0) emacs_close (dummy); } while (false)])
+ AC_DEFINE([PTY_NAME_SPRINTF], [])
+ AC_DEFINE([PTY_TTY_NAME_SPRINTF], [])
;;
gnu | qnxnto )
- AC_DEFINE(FIRST_PTY_LETTER, ['p'])
+ AC_DEFINE([FIRST_PTY_LETTER], ['p'])
;;
gnu-linux | gnu-kfreebsd | dragonfly | freebsd | openbsd | netbsd | darwin | nacl )
dnl if HAVE_GRANTPT
if test "x$ac_cv_func_grantpt" = xyes; then
- AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.])
- AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)])
+ AC_DEFINE([UNIX98_PTYS], [1], [Define if the system has Unix98 PTYs.])
+ AC_DEFINE([PTY_ITERATION], [int i; for (i = 0; i < 1; i++)])
dnl Note that grantpt and unlockpt may fork. We must block SIGCHLD
dnl to prevent sigchld_handler from intercepting the child's death.
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
+ AC_DEFINE([PTY_TTY_NAME_SPRINTF],
+ [{ char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
dnl if HAVE_POSIX_OPENPT
if test "x$ac_cv_func_posix_openpt" = xyes; then
- AC_DEFINE(PTY_OPEN, [do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (false)])
- AC_DEFINE(PTY_NAME_SPRINTF, [])
+ AC_DEFINE([PTY_OPEN],
+ [do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (false)])
+ AC_DEFINE([PTY_NAME_SPRINTF], [])
dnl if HAVE_GETPT
elif test "x$ac_cv_func_getpt" = xyes; then
- AC_DEFINE(PTY_OPEN, [fd = getpt ()])
- AC_DEFINE(PTY_NAME_SPRINTF, [])
+ AC_DEFINE([PTY_OPEN], [fd = getpt ()])
+ AC_DEFINE([PTY_NAME_SPRINTF], [])
else
- AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");])
+ AC_DEFINE([PTY_NAME_SPRINTF], [strcpy (pty_name, "/dev/ptmx");])
fi
else
- AC_DEFINE(FIRST_PTY_LETTER, ['p'])
+ AC_DEFINE([FIRST_PTY_LETTER], ['p'])
fi
;;
hpux*)
- AC_DEFINE(FIRST_PTY_LETTER, ['p'])
- AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);])
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);])
+ AC_DEFINE([FIRST_PTY_LETTER], ['p'])
+ AC_DEFINE([PTY_NAME_SPRINTF],
+ [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);])
+ AC_DEFINE([PTY_TTY_NAME_SPRINTF],
+ [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);])
;;
solaris )
@@ -5579,22 +5679,25 @@ case $opsys in
dnl O_CLOEXEC when opening the pty, and keep the SIGCHLD handler
dnl from intercepting that death. If any child but grantpt's should die
dnl within, it should be caught after sigrelse(2).
- AC_DEFINE(PTY_OPEN, [fd = open (pty_name, O_RDWR | O_NONBLOCK)])
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
+ AC_DEFINE([PTY_OPEN], [fd = open (pty_name, O_RDWR | O_NONBLOCK)])
+ AC_DEFINE([PTY_TTY_NAME_SPRINTF],
+ [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
;;
unixware )
dnl Comments are as per solaris.
- AC_DEFINE(PTY_OPEN, [fd = open (pty_name, O_RDWR | O_NONBLOCK)])
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
+ AC_DEFINE([PTY_OPEN], [fd = open (pty_name, O_RDWR | O_NONBLOCK)])
+ AC_DEFINE([PTY_TTY_NAME_SPRINTF],
+ [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
;;
haiku*)
- AC_DEFINE(FIRST_PTY_LETTER, ['s'])
- AC_DEFINE(PTY_NAME_SPRINTF, [])
+ AC_DEFINE([FIRST_PTY_LETTER], ['s'])
+ AC_DEFINE([PTY_NAME_SPRINTF], [])
dnl on Haiku pty names aren't distinctive, thus the use of posix_openpt
- AC_DEFINE(PTY_OPEN, [fd = posix_openpt (O_RDWR | O_NONBLOCK)])
- AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
+ AC_DEFINE([PTY_OPEN], [fd = posix_openpt (O_RDWR | O_NONBLOCK)])
+ AC_DEFINE([PTY_TTY_NAME_SPRINTF],
+ [{ char *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }])
;;
esac
@@ -5603,21 +5706,22 @@ case $opsys in
solaris | unixware )
dnl This change means that we don't loop through allocate_pty too
dnl many times in the (rare) event of a failure.
- AC_DEFINE(FIRST_PTY_LETTER, ['z'])
- AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");])
+ AC_DEFINE([FIRST_PTY_LETTER], ['z'])
+ AC_DEFINE([PTY_NAME_SPRINTF], [strcpy (pty_name, "/dev/ptmx");])
dnl Push various streams modules onto a PTY channel. Used in process.c.
- AC_DEFINE(SETUP_SLAVE_PTY, [if (ioctl (std_in, I_PUSH, "ptem") == -1) fatal ("ioctl I_PUSH ptem"); if (ioctl (std_in, I_PUSH, "ldterm") == -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (std_in, I_PUSH, "ttcompat") == -1) fatal ("ioctl I_PUSH ttcompat");], [How to set up a slave PTY, if needed.])
+ AC_DEFINE([SETUP_SLAVE_PTY],
+ [if (ioctl (std_in, I_PUSH, "ptem") == -1) fatal ("ioctl I_PUSH ptem"); if (ioctl (std_in, I_PUSH, "ldterm") == -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (std_in, I_PUSH, "ttcompat") == -1) fatal ("ioctl I_PUSH ttcompat");], [How to set up a slave PTY, if needed.])
;;
esac
-AH_TEMPLATE(SIGNALS_VIA_CHARACTERS, [Make process_send_signal work by
+AH_TEMPLATE([SIGNALS_VIA_CHARACTERS], [Make process_send_signal work by
"typing" a signal character on the pty.])
case $opsys in
dnl Perry Smith <pedz@ddivt1.austin.ibm.com> says this is correct for AIX.
aix4-2 | cygwin | gnu | dragonfly | freebsd | netbsd | openbsd | darwin )
- AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1)
+ AC_DEFINE([SIGNALS_VIA_CHARACTERS], [1])
;;
dnl 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works.
@@ -5630,35 +5734,41 @@ case $opsys in
#if LINUX_VERSION_CODE < 0x20400
# error "Linux version too old"
#endif
- ]], [[]])], emacs_cv_signals_via_chars=yes, emacs_cv_signals_via_chars=no)])
+ ]], [[]])],
+ [emacs_cv_signals_via_chars=yes],
+ [emacs_cv_signals_via_chars=no])])
- test "$emacs_cv_signals_via_chars" = yes && AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1)
+ test "$emacs_cv_signals_via_chars" = yes &&
+ AC_DEFINE([SIGNALS_VIA_CHARACTERS], [1])
;;
esac
-AH_TEMPLATE(TAB3, [Undocumented.])
+AH_TEMPLATE([TAB3], [Undocumented.])
case $opsys in
- darwin) AC_DEFINE(TAB3, OXTABS) ;;
+ darwin) AC_DEFINE([TAB3], [OXTABS]) ;;
gnu | dragonfly | freebsd | netbsd | openbsd )
- AC_DEFINE(TABDLY, OXTABS, [Undocumented.])
- AC_DEFINE(TAB3, OXTABS)
+ AC_DEFINE([TABDLY], [OXTABS], [Undocumented.])
+ AC_DEFINE([TAB3], [OXTABS])
;;
gnu-linux | gnu-kfreebsd )
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+ AC_PREPROC_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
#ifndef __ia64__
# error "not ia64"
#endif
- ]], [[]])], AC_DEFINE(GC_MARK_SECONDARY_STACK(),
+ ]], [[]])],
+ [AC_DEFINE([GC_MARK_SECONDARY_STACK()],
[do { extern void *__libc_ia64_register_backing_store_base; __builtin_ia64_flushrs (); mark_memory (__libc_ia64_register_backing_store_base, __builtin_ia64_bsp ());} while (false)],
- [Mark a secondary stack, like the register stack on the ia64.]), [])
+ [Mark a secondary stack, like the register stack on the ia64.])], [])
;;
hpux*)
- AC_DEFINE(RUN_TIME_REMAP, 1, [Define if emacs.c needs to call
+ AC_DEFINE([RUN_TIME_REMAP], [1], [Define if emacs.c needs to call
run_time_remap; for HPUX.])
;;
esac
@@ -5666,7 +5776,7 @@ esac
dnl This won't be used automatically yet. We also need to know, at least,
dnl that the stack is continuous.
-AH_TEMPLATE(GC_SETJMP_WORKS, [Define if setjmp is known to save all
+AH_TEMPLATE([GC_SETJMP_WORKS], [Define if setjmp is known to save all
registers relevant for conservative garbage collection in the jmp_buf.])
@@ -5686,18 +5796,18 @@ case $opsys in
#else
# error "setjmp not known to work on this arch"
#endif
- ]], [[]])], AC_DEFINE(GC_SETJMP_WORKS, 1))
+ ]], [[]])], [AC_DEFINE([GC_SETJMP_WORKS], [1])])
;;
esac
if test x$GCC = xyes; then
dnl GC_SETJMP_WORKS is nearly always appropriate for GCC.
- AC_DEFINE(GC_SETJMP_WORKS, 1)
+ AC_DEFINE([GC_SETJMP_WORKS], [1])
else
case $opsys in
aix* | dragonfly | freebsd | netbsd | openbsd | solaris )
- AC_DEFINE(GC_SETJMP_WORKS, 1)
+ AC_DEFINE([GC_SETJMP_WORKS], [1])
;;
esac
fi dnl GCC?
@@ -5717,7 +5827,7 @@ AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp],
[emacs_cv_func__setjmp=yes],
[emacs_cv_func__setjmp=no])])
if test $emacs_cv_func__setjmp = yes; then
- AC_DEFINE([HAVE__SETJMP], 1, [Define to 1 if _setjmp and _longjmp work.])
+ AC_DEFINE([HAVE__SETJMP], [1], [Define to 1 if _setjmp and _longjmp work.])
fi
# We need to preserve signal mask to handle C stack overflows.
@@ -5732,13 +5842,13 @@ AC_CACHE_CHECK([for sigsetjmp], [emacs_cv_func_sigsetjmp],
[emacs_cv_func_sigsetjmp=yes],
[emacs_cv_func_sigsetjmp=no])])
if test $emacs_cv_func_sigsetjmp = yes; then
- AC_DEFINE([HAVE_SIGSETJMP], 1,
+ AC_DEFINE([HAVE_SIGSETJMP], [1],
[Define to 1 if sigsetjmp and siglongjmp work.])
fi
case $emacs_cv_func_sigsetjmp,$emacs_cv_alternate_stack,$opsys in
yes,yes,* | *,*,mingw32)
- AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], 1,
+ AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], [1],
[Define to 1 if C stack overflow can be handled in some cases.]);;
esac
@@ -5747,7 +5857,7 @@ case $opsys in
dnl TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
dnl subprocesses the usual way. But TIOCSIGNAL does work for PTYs,
dnl and this is all we need.
- AC_DEFINE(TIOCSIGSEND, TIOCSIGNAL, [Some platforms redefine this.])
+ AC_DEFINE([TIOCSIGSEND], [TIOCSIGNAL], [Some platforms redefine this.])
;;
esac
@@ -5755,7 +5865,7 @@ esac
case $opsys in
hpux* | solaris )
dnl Used in xfaces.c.
- AC_DEFINE(XOS_NEEDS_TIME_H, 1, [Compensate for a bug in Xos.h on
+ AC_DEFINE([XOS_NEEDS_TIME_H], [1], [Compensate for a bug in Xos.h on
some systems, where it requires time.h.])
;;
esac
@@ -5763,64 +5873,67 @@ esac
dnl Define symbols to identify the version of Unix this is.
dnl Define all the symbols that apply correctly.
-AH_TEMPLATE(DOS_NT, [Define if the system is MS DOS or MS Windows.])
-AH_TEMPLATE(MSDOS, [Define if the system is MS DOS.])
-AH_TEMPLATE(USG, [Define if the system is compatible with System III.])
-AH_TEMPLATE(USG5_4, [Define if the system is compatible with System V Release 4.])
+AH_TEMPLATE([DOS_NT], [Define if the system is MS DOS or MS Windows.])
+AH_TEMPLATE([MSDOS], [Define if the system is MS DOS.])
+AH_TEMPLATE([USG], [Define if the system is compatible with System III.])
+AH_TEMPLATE([USG5_4],
+ [Define if the system is compatible with System V Release 4.])
case $opsys in
aix4-2)
- AC_DEFINE(USG, [])
+ AC_DEFINE([USG], [])
dnl This symbol should be defined on AIX Version 3 ???????
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#ifndef _AIX
# error "_AIX not defined"
#endif
- ]], [[]])], [], AC_DEFINE(_AIX, [], [Define if the system is AIX.]))
+ ]], [[]])], [], [AC_DEFINE([_AIX], [], [Define if the system is AIX.])])
;;
cygwin)
- AC_DEFINE(CYGWIN, 1, [Define if the system is Cygwin.])
+ AC_DEFINE([CYGWIN], [1], [Define if the system is Cygwin.])
;;
darwin)
dnl Not __APPLE__, as this may not be defined on non-macOS Darwin.
dnl Not DARWIN, because Panther and lower CoreFoundation.h use DARWIN to
dnl distinguish macOS from pure Darwin.
- AC_DEFINE(DARWIN_OS, [], [Define if the system is Darwin.])
+ AC_DEFINE([DARWIN_OS], [], [Define if the system is Darwin.])
;;
gnu-linux | gnu-kfreebsd )
- AC_DEFINE(USG, [])
- AC_DEFINE(GNU_LINUX, [], [Define if ths system is compatible with GNU/Linux.])
+ AC_DEFINE([USG], [])
+ AC_DEFINE([GNU_LINUX], [],
+ [Define if ths system is compatible with GNU/Linux.])
;;
hpux*)
- AC_DEFINE(USG, [])
- AC_DEFINE(HPUX, [], [Define if the system is HPUX.])
+ AC_DEFINE([USG], [])
+ AC_DEFINE([HPUX], [], [Define if the system is HPUX.])
;;
mingw32)
- AC_DEFINE(DOS_NT, [])
- AC_DEFINE(WINDOWSNT, 1, [Define if compiling for native MS Windows.])
+ AC_DEFINE([DOS_NT], [])
+ AC_DEFINE([WINDOWSNT], [1], [Define if compiling for native MS Windows.])
if test "x$ac_enable_checking" != "x" ; then
- AC_DEFINE(EMACSDEBUG, 1, [Define to 1 to enable w32 debug facilities.])
+ AC_DEFINE([EMACSDEBUG], [1],
+ [Define to 1 to enable w32 debug facilities.])
fi
;;
solaris)
- AC_DEFINE(USG, [])
- AC_DEFINE(USG5_4, [])
- AC_DEFINE(SOLARIS2, [], [Define if the system is Solaris.])
+ AC_DEFINE([USG], [])
+ AC_DEFINE([USG5_4], [])
+ AC_DEFINE([SOLARIS2], [], [Define if the system is Solaris.])
;;
unixware)
- AC_DEFINE(USG, [])
- AC_DEFINE(USG5_4, [])
+ AC_DEFINE([USG], [])
+ AC_DEFINE([USG5_4], [])
;;
haiku)
- AC_DEFINE(HAIKU, [], [Define if the system is Haiku.])
+ AC_DEFINE([HAIKU], [], [Define if the system is Haiku.])
;;
esac
@@ -5901,13 +6014,13 @@ case $opsys in
hpux11)
dnl It works to open the pty's tty in the parent (Emacs), then
dnl close and reopen it in the child.
- AC_DEFINE(USG_SUBTTY_WORKS, 1, [Define for USG systems where it
+ AC_DEFINE([USG_SUBTTY_WORKS], [1], [Define for USG systems where it
works to open a pty's tty in the parent process, then close and
reopen it in the child.])
;;
solaris)
- AC_DEFINE(_STRUCTURED_PROC, 1, [Needed for system_process_attributes
+ AC_DEFINE([_STRUCTURED_PROC], [1], [Needed for system_process_attributes
on Solaris.])
;;
esac
@@ -5930,72 +6043,72 @@ fi
version=$PACKAGE_VERSION
copyright="Copyright (C) 2022 Free Software Foundation, Inc."
-AC_DEFINE_UNQUOTED(COPYRIGHT, ["$copyright"],
+AC_DEFINE_UNQUOTED([COPYRIGHT], ["$copyright"],
[Short copyright string for this version of Emacs.])
-AC_SUBST(copyright)
+AC_SUBST([copyright])
### Specify what sort of things we'll be editing into Makefile and config.h.
### Use configuration here uncanonicalized to avoid exceeding size limits.
-AC_SUBST(version)
-AC_SUBST(configuration)
+AC_SUBST([version])
+AC_SUBST([configuration])
## Unused?
-AC_SUBST(canonical)
-AC_SUBST(srcdir)
-AC_SUBST(prefix)
-AC_SUBST(exec_prefix)
-AC_SUBST(bindir)
-AC_SUBST(datadir)
-AC_SUBST(gsettingsschemadir)
-AC_SUBST(sharedstatedir)
-AC_SUBST(libexecdir)
-AC_SUBST(mandir)
-AC_SUBST(infodir)
-AC_SUBST(lispdirrel)
-AC_SUBST(lispdir)
-AC_SUBST(standardlisppath)
-AC_SUBST(locallisppath)
-AC_SUBST(lisppath)
-AC_SUBST(x_default_search_path)
-AC_SUBST(etcdir)
-AC_SUBST(archlibdir)
-AC_SUBST(etcdocdir)
-AC_SUBST(bitmapdir)
-AC_SUBST(gamedir)
-AC_SUBST(gameuser)
-AC_SUBST(gamegroup)
+AC_SUBST([canonical])
+AC_SUBST([srcdir])
+AC_SUBST([prefix])
+AC_SUBST([exec_prefix])
+AC_SUBST([bindir])
+AC_SUBST([datadir])
+AC_SUBST([gsettingsschemadir])
+AC_SUBST([sharedstatedir])
+AC_SUBST([libexecdir])
+AC_SUBST([mandir])
+AC_SUBST([infodir])
+AC_SUBST([lispdirrel])
+AC_SUBST([lispdir])
+AC_SUBST([standardlisppath])
+AC_SUBST([locallisppath])
+AC_SUBST([lisppath])
+AC_SUBST([x_default_search_path])
+AC_SUBST([etcdir])
+AC_SUBST([archlibdir])
+AC_SUBST([etcdocdir])
+AC_SUBST([bitmapdir])
+AC_SUBST([gamedir])
+AC_SUBST([gameuser])
+AC_SUBST([gamegroup])
## FIXME? Nothing uses @LD_SWITCH_X_SITE@.
## src/Makefile.in did add LD_SWITCH_X_SITE (as a cpp define) to the
## end of LIBX_BASE, but nothing ever set it.
-AC_SUBST(LD_SWITCH_X_SITE)
-AC_SUBST(C_SWITCH_X_SITE)
-AC_SUBST(GNUSTEP_CFLAGS)
-AC_SUBST(CFLAGS)
+AC_SUBST([LD_SWITCH_X_SITE])
+AC_SUBST([C_SWITCH_X_SITE])
+AC_SUBST([GNUSTEP_CFLAGS])
+AC_SUBST([CFLAGS])
## Used in lwlib/Makefile.in.
-AC_SUBST(X_TOOLKIT_TYPE)
-AC_SUBST(ns_appdir)
-AC_SUBST(ns_appbindir)
-AC_SUBST(ns_applibexecdir)
-AC_SUBST(ns_applibdir)
-AC_SUBST(ns_appresdir)
-AC_SUBST(ns_appsrc)
-AC_SUBST(GNU_OBJC_CFLAGS)
-AC_SUBST(OTHER_FILES)
+AC_SUBST([X_TOOLKIT_TYPE])
+AC_SUBST([ns_appdir])
+AC_SUBST([ns_appbindir])
+AC_SUBST([ns_applibexecdir])
+AC_SUBST([ns_applibdir])
+AC_SUBST([ns_appresdir])
+AC_SUBST([ns_appsrc])
+AC_SUBST([GNU_OBJC_CFLAGS])
+AC_SUBST([OTHER_FILES])
if test -n "${term_header}"; then
- AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
+ AC_DEFINE_UNQUOTED([TERM_HEADER], ["${term_header}"],
[Define to the header for the built-in window system.])
fi
-AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
+AC_DEFINE_UNQUOTED([EMACS_CONFIGURATION], ["${canonical}"],
[Define to the canonical Emacs configuration name.])
-AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}",
+AC_DEFINE_UNQUOTED([EMACS_CONFIG_OPTIONS], "${emacs_config_options}",
[Define to the options passed to configure.])
XMENU_OBJ=
XOBJ=
FONT_OBJ=
if test "${HAVE_X_WINDOWS}" = "yes" ; then
- AC_DEFINE(HAVE_X_WINDOWS, 1,
+ AC_DEFINE([HAVE_X_WINDOWS], [1],
[Define to 1 if you want to use the X window system.])
XMENU_OBJ=xmenu.o
XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o"
@@ -6022,20 +6135,20 @@ fi
if test "${HAVE_HARFBUZZ}" = "yes" ; then
FONT_OBJ="$FONT_OBJ hbfont.o"
fi
-AC_SUBST(FONT_OBJ)
-AC_SUBST(XMENU_OBJ)
-AC_SUBST(XOBJ)
-AC_SUBST(FONT_OBJ)
+AC_SUBST([FONT_OBJ])
+AC_SUBST([XMENU_OBJ])
+AC_SUBST([XOBJ])
+AC_SUBST([FONT_OBJ])
WIDGET_OBJ=
MOTIF_LIBW=
if test "${USE_X_TOOLKIT}" != "none" ; then
WIDGET_OBJ=widget.o
- AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.])
+ AC_DEFINE([USE_X_TOOLKIT], [1], [Define to 1 if using an X toolkit.])
if test "${USE_X_TOOLKIT}" = "LUCID"; then
- AC_DEFINE(USE_LUCID, 1, [Define to 1 if using the Lucid X toolkit.])
+ AC_DEFINE([USE_LUCID], [1], [Define to 1 if using the Lucid X toolkit.])
elif test "${USE_X_TOOLKIT}" = "MOTIF"; then
- AC_DEFINE(USE_MOTIF, 1, [Define to 1 if using the Motif X toolkit.])
+ AC_DEFINE([USE_MOTIF], [1], [Define to 1 if using the Motif X toolkit.])
MOTIF_LIBW=-lXm
case "$opsys" in
gnu-linux)
@@ -6057,7 +6170,7 @@ if test "${USE_X_TOOLKIT}" != "none" ; then
MOTIF_LIBW="$MOTIF_LIBW $LIBXP"
fi
fi
-AC_SUBST(WIDGET_OBJ)
+AC_SUBST([WIDGET_OBJ])
TOOLKIT_LIBW=
case "$USE_X_TOOLKIT" in
@@ -6068,7 +6181,7 @@ esac
if test "$HAVE_XWIDGETS" = "yes"; then
TOOLKIT_LIBW="$TOOLKIT_LIBW -lXcomposite"
fi
-AC_SUBST(TOOLKIT_LIBW)
+AC_SUBST([TOOLKIT_LIBW])
if test "${opsys}" != "mingw32"; then
if test "$USE_X_TOOLKIT" = "none"; then
@@ -6077,16 +6190,16 @@ if test "${opsys}" != "mingw32"; then
LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
fi
fi
-AC_SUBST(LIBXT_OTHER)
+AC_SUBST([LIBXT_OTHER])
if test "${HAVE_X11}" = "yes" ; then
- AC_DEFINE(HAVE_X11, 1,
+ AC_DEFINE([HAVE_X11], [1],
[Define to 1 if you want to use version 11 of X windows.])
LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)"
else
LIBX_OTHER=
fi
-AC_SUBST(LIBX_OTHER)
+AC_SUBST([LIBX_OTHER])
HAVE_OLDXMENU=no
if test "$HAVE_GTK" = yes || test "$HAVE_X11" != yes; then
@@ -6099,7 +6212,7 @@ else
LIBXMENU='$(lwlibdir)/liblw.a'
AUTODEPEND_PARENTS="$AUTODEPEND_PARENTS lwlib"
fi
-AC_SUBST(LIBXMENU)
+AC_SUBST([LIBXMENU])
AC_CACHE_CHECK([for struct alignment],
[emacs_cv_struct_alignment],
@@ -6112,7 +6225,7 @@ AC_CACHE_CHECK([for struct alignment],
[emacs_cv_struct_alignment=yes],
[emacs_cv_struct_alignment=no])])
if test "$emacs_cv_struct_alignment" = yes; then
- AC_DEFINE([HAVE_STRUCT_ATTRIBUTE_ALIGNED], 1,
+ AC_DEFINE([HAVE_STRUCT_ATTRIBUTE_ALIGNED], [1],
[Define to 1 if 'struct __attribute__ ((aligned (N)))' aligns the
structure to an N-byte boundary.])
fi
@@ -6126,24 +6239,24 @@ AC_CACHE_CHECK([for statement expressions],
[emacs_cv_statement_expressions=yes],
[emacs_cv_statement_expressions=no])])
if test "$emacs_cv_statement_expressions" = yes; then
- AC_DEFINE([HAVE_STATEMENT_EXPRESSIONS], 1,
+ AC_DEFINE([HAVE_STATEMENT_EXPRESSIONS], [1],
[Define to 1 if statement expressions work.])
fi
if test "${GNU_MALLOC}" = "yes" ; then
- AC_DEFINE(GNU_MALLOC, 1,
+ AC_DEFINE([GNU_MALLOC], [1],
[Define to 1 if you want to use the GNU memory allocator.])
fi
RALLOC_OBJ=
if test "${REL_ALLOC}" = "yes" ; then
- AC_DEFINE(REL_ALLOC, 1,
+ AC_DEFINE([REL_ALLOC], [1],
[Define REL_ALLOC if you want to use the relocating allocator for
buffer space.])
test "$system_malloc" != "yes" && RALLOC_OBJ=ralloc.o
fi
-AC_SUBST(RALLOC_OBJ)
+AC_SUBST([RALLOC_OBJ])
if test "$opsys" = "cygwin"; then
CYGWIN_OBJ="cygw32.o"
@@ -6159,9 +6272,9 @@ else
PRE_ALLOC_OBJ=lastfile.o
POST_ALLOC_OBJ=
fi
-AC_SUBST(CYGWIN_OBJ)
-AC_SUBST(PRE_ALLOC_OBJ)
-AC_SUBST(POST_ALLOC_OBJ)
+AC_SUBST([CYGWIN_OBJ])
+AC_SUBST([PRE_ALLOC_OBJ])
+AC_SUBST([POST_ALLOC_OBJ])
dnl Call this 'FORTIFY_SOUR' so that it sorts before the 'FORTIFY_SOURCE'
dnl verbatim defined above. The tricky name is apropos, as this hack
@@ -6209,7 +6322,7 @@ LIBS=$SAVE_LIBS
# timer_getoverrun needs the same library as timer_settime
OLD_LIBS=$LIBS
LIBS="$LIB_TIMER_TIME $LIBS"
-AC_CHECK_FUNCS(timer_getoverrun)
+AC_CHECK_FUNCS([timer_getoverrun])
LIBS=$OLD_LIBS
if test "${opsys}" = "mingw32"; then
@@ -6323,16 +6436,17 @@ fi
LD_SWITCH_SYSTEM_TEMACS="$LDFLAGS_NOCOMBRELOC $LD_SWITCH_SYSTEM_TEMACS"
-AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
+AC_SUBST([LD_SWITCH_SYSTEM_TEMACS])
## Common for all window systems
if test "$window_system" != "none"; then
- AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
- AC_DEFINE(POLL_FOR_INPUT, 1, [Define if you poll periodically to detect C-g.])
+ AC_DEFINE([HAVE_WINDOW_SYSTEM], [1], [Define if you have a window system.])
+ AC_DEFINE([POLL_FOR_INPUT], [1],
+ [Define if you poll periodically to detect C-g.])
WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o"
fi
-AC_SUBST(WINDOW_SYSTEM_OBJ)
+AC_SUBST([WINDOW_SYSTEM_OBJ])
AH_TOP([/* GNU Emacs site configuration template file.
@@ -6449,7 +6563,7 @@ for opt in ACL BE_APP CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTING
AS_VAR_APPEND([emacs_config_features], ["$optsep$opt"])
optsep=' '
done
-AC_DEFINE_UNQUOTED(EMACS_CONFIG_FEATURES, "${emacs_config_features}",
+AC_DEFINE_UNQUOTED([EMACS_CONFIG_FEATURES], ["${emacs_config_features}"],
[Summary of some of the main features enabled by configure.])
AS_ECHO([" Does Emacs use -lXaw3d? ${HAVE_XAW3D}
@@ -6492,7 +6606,7 @@ AS_ECHO([" Does Emacs use -lXaw3d? ${HAVE_XAW3D
Does Emacs support legacy unexec dumping? ${with_unexec}
Which dumping strategy does Emacs use? ${with_dumping}
Does Emacs have native lisp compiler? ${HAVE_NATIVE_COMP}
- Does Emacs use version 2 of the the X Input Extension? ${HAVE_XINPUT2}
+ Does Emacs use version 2 of the X Input Extension? ${HAVE_XINPUT2}
Does Emacs generate a smaller-size Japanese dictionary? ${with_small_ja_dic}
"])
@@ -6527,7 +6641,7 @@ case $opsys,$emacs_uname_r in
echo
;;
cygwin,3.0.[[0-7]]'('* | cygwin,3.1.[[0-2]]'('*)
- AC_DEFINE([HAVE_CYGWIN_O_PATH_BUG], 1,
+ AC_DEFINE([HAVE_CYGWIN_O_PATH_BUG], [1],
[Define to 1 if opening a FIFO, socket, or symlink with O_PATH is buggy.]);;
esac
@@ -6549,7 +6663,7 @@ if test "$HAVE_NS" = "yes"; then
nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in])
ns_check_file=Contents/Info.plist
fi
- AC_SUBST(ns_check_file)
+ AC_SUBST([ns_check_file])
fi
AC_CONFIG_FILES([Makefile lib/gnulib.mk])
@@ -6590,10 +6704,10 @@ fi dnl -d admin
SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'`
-AC_SUBST(SUBDIR_MAKEFILES_IN)
+AC_SUBST([SUBDIR_MAKEFILES_IN])
SMALL_JA_DIC=$with_small_ja_dic
-AC_SUBST(SMALL_JA_DIC)
+AC_SUBST([SMALL_JA_DIC])
dnl You might wonder (I did) why epaths.h is generated by running make,
dnl rather than just letting configure generate it from epaths.in.
diff --git a/debian/changelog b/debian/changelog
index bdd537b65a6..be6bed835e6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+emacs-snapshot (29~git20220714.1) unstable; urgency=medium
+
+ * Package git snapshot.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Mon, 18 Jul 2022 16:18:38 -0700
+
emacs-snapshot (29~git20220630.1~bpo11+1~athena1) bullseye-backports; urgency=medium
* Rebuild for athena's apt repository.
diff --git a/doc/emacs/ChangeLog.1 b/doc/emacs/ChangeLog.1
index c1c5f5407da..048b7bd99a5 100644
--- a/doc/emacs/ChangeLog.1
+++ b/doc/emacs/ChangeLog.1
@@ -8529,7 +8529,7 @@
* text.texi (Cell Justification):
* trouble.texi (After a Crash):
* xresources.texi (GTK styles):
- Delete duplicate duplicate words.
+ Delete duplicate words.
2005-07-17 Richard M. Stallman <rms@gnu.org>
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi
index 07f66ec10ac..77f40c7df2d 100644
--- a/doc/emacs/abbrevs.texi
+++ b/doc/emacs/abbrevs.texi
@@ -106,8 +106,10 @@ taken as the expansion. For example, to define the abbrev @samp{foo} as
mentioned above, insert the text @samp{find outer otter} and then type
@kbd{C-u 3 C-x a g f o o @key{RET}}.
- An argument of zero to @kbd{C-x a g} means to use the contents of the
-region as the expansion of the abbrev being defined.
+ If you're using @code{transient-mark-mode} (which is the default),
+the active region will be used as the expansion of the abbrev being
+defined. If not, an argument of zero to @kbd{C-x a g} means to use
+the contents of the region.
@kindex C-x a l
@findex add-mode-abbrev
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index 94e9d2760ec..120c957ff86 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -616,10 +616,11 @@ select it in another window (@code{clone-indirect-buffer-other-window}).
The text of the indirect buffer is always identical to the text of its
base buffer; changes made by editing either one are visible immediately
-in the other. But in all other respects, the indirect buffer and its
+in the other. ``Text'' here includes both the characters and their text
+properties. But in all other respects, the indirect buffer and its
base buffer are completely separate. They can have different names,
different values of point, different narrowing, different markers,
-different major modes, and different local variables.
+different overlays, different major modes, and different local variables.
An indirect buffer cannot visit a file, but its base buffer can. If
you try to save the indirect buffer, that actually works by saving the
@@ -649,6 +650,14 @@ both using the minibuffer.
When this hook runs, the newly created indirect buffer is the current
buffer.
+Note: When a modification is made to the text of a buffer, the
+modification hooks are run only in the base buffer, because most of
+the functions on those hooks are not prepared to work correctly in
+indirect buffers. So if you need a modification hook function in an
+indirect buffer, you need to manually add that function to the hook
+@emph{in the base buffer} and then make the function operate in the
+desired indirect buffer.
+
@node Buffer Convenience
@section Convenience Features and Customization of Buffer Handling
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index 9e14e0f9a99..292c986c1c6 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -844,6 +844,26 @@ This is like @samp{ln -s}. The argument @var{new} is the directory to
make the links in, or (if making just one link) the name to give the
link.
+@findex dired-do-relsymlink
+@kindex Y @r{(Dired)}
+@item Y @var{new} @key{RET}
+Make relative symbolic links to the specified files
+(@code{dired-do-relsymlink}). The argument @var{new} is the directory
+to make the links in, or (if making just one link) the name to give
+the link. This is like @code{dired-do-symlink} but creates relative
+symbolic links. For example:
+
+@example
+ foo -> ../bar/foo
+@end example
+
+@noindent
+It does not create absolute ones like:
+
+@example
+ foo -> /path/that/may/change/any/day/bar/foo
+@end example
+
@findex dired-do-chmod
@kindex M @r{(Dired)}
@cindex changing file permissions (in Dired)
@@ -963,6 +983,18 @@ Byte compile the specified Emacs Lisp files
(@code{dired-do-byte-compile}). @xref{Byte Compilation,, Byte
Compilation, elisp, The Emacs Lisp Reference Manual}.
+@findex dired-do-info
+@kindex I @r{(Dired)}
+@cindex running info on files (in Dired)
+@item I
+Run Info on this file (assumed to be a file in Info format).
+
+@findex dired-do-man
+@kindex N @r{(Dired)}
+@cindex running man on files (in Dired)
+@item N
+Run man on this file (assumed to be a file in @code{nroff} format).
+
@kindex A @r{(Dired)}
@findex dired-do-find-regexp
@cindex search multiple files (in Dired)
@@ -1138,9 +1170,12 @@ Rename each of the selected files to a lower-case name
@itemx % S @var{from} @key{RET} @var{to} @key{RET}
@kindex % S @r{(Dired)}
@findex dired-do-symlink-regexp
-These four commands rename, copy, make hard links and make soft links,
-in each case computing the new name by regular-expression substitution
-from the name of the old file.
+@itemx % Y @var{from} @key{RET} @var{to} @key{RET}
+@kindex % Y @r{(Dired)}
+@findex dired-do-relsymlink-regexp
+These five commands rename, copy, make hard links, make soft links,
+and make relative soft links, in each case computing the new name by
+regular-expression substitution from the name of the old file.
@end table
The four regular-expression substitution commands effectively
@@ -1298,6 +1333,12 @@ parent directory.
@kindex > @r{(Dired)}
@item >
Move down to the next directory-file line (@code{dired-next-dirline}).
+
+@findex dired-goto-subdir
+@kindex M-G @r{(Dired)}
+@item M-G
+Prompt for a directory and move to its directory-file line
+(@code{dired-goto-subdir}).
@end table
@node Hiding Subdirectories
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index fbff1d4eb69..96e05a902d6 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -893,6 +893,23 @@ of 1.2; to change this factor, customize the variable
to the @code{text-scale-adjust} command restores the default height,
the same as typing @kbd{C-x C-0}.
+@cindex adjust global font size
+@findex global-text-scale-adjust
+@vindex global-text-scale-adjust-resizes-frames
+@kindex C-x C-M-+
+@kindex C-x C-M-=
+@kindex C-x C-M--
+@kindex C-x C-M-0
+@kindex C-M-wheel-down
+@kindex C-M-wheel-up
+ Similarly, to change the sizes of the fonts globally, type @kbd{C-x
+C-M-+}, @kbd{C-x C-M-=}, @kbd{C-x C-M--} or @kbd{C-x C-M-0}, or scroll
+the mouse wheel with both the @kbd{Ctrl} and @kbd{Meta} modifiers
+pressed. To enable frame resizing when the font size is changed
+globally, customize the variable
+@code{global-text-scale-adjust-resizes-frames} (@pxref{Easy
+Customization}).
+
@cindex increase buffer font size
@findex text-scale-increase
@cindex decrease buffer font size
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 7b4e31e5f84..404978b315d 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -2355,6 +2355,29 @@ can be used to transform the image in question to @acronym{PNG} before
displaying. GraphicsMagick, ImageMagick and @command{ffmpeg} are
currently supported for image conversions.
+@findex image-converter-add-handler
+ In addition, you may wish to add special handlers for certain image
+formats. These can be added with the
+@code{image-converter-add-handler} function. For instance, to allow
+viewing Krita files as simple images, you could say something like:
+
+@lisp
+(image-converter-add-handler
+ "kra"
+ (lambda (file data-p)
+ (if data-p
+ (error "Can't decode non-files")
+ (call-process "unzip" nil t nil
+ "-qq" "-c" "-x" file "mergedimage.png"))))
+@end lisp
+
+The function takes two parameters, where the first is a file name
+suffix, and the second is a function to do the ``conversion''. This
+function takes two parameters, where the first is the file name or a
+string with the data, and the second says whether the first parameter
+is data or not, and should output an image in
+@code{image-convert-to-format} format in the current buffer.
+
@findex thumbs-mode
@cindex mode, Thumbs
The Image-Dired package can also be used to view images as
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index d90a6ac6729..d78cbffaa71 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -1249,6 +1249,13 @@ To drag text from Emacs to other programs, set the option
@code{mouse-drag-and-drop-region-cross-program} to a non-@code{nil}
value.
+ On the X window system, some programs can drop files on Emacs,
+expecting Emacs to save them. Normally, Emacs will prompt for a file
+name under which the file will be saved, and then open the file, but
+that behavior can be changed by changing the variable
+@code{x-dnd-direct-save-function}. @xref{Drag and Drop,,, elisp, The
+Emacs Lisp Reference Manual}.
+
@node Menu Bars
@section Menu Bars
@cindex menu bar mode
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
index a78a2c9e2d7..5224e313407 100644
--- a/doc/emacs/glossary.texi
+++ b/doc/emacs/glossary.texi
@@ -182,6 +182,7 @@ corresponding Control character. @xref{User Input,C-M-}.
Case conversion means changing text from upper case to lower case or
vice versa. @xref{Case}.
+@cindex ignore case
@item Case Folding
Case folding means ignoring the differences between case variants of
the same letter: upper-case, lower-case, and title-case. Emacs
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 4435f6e4946..bb8d51158ae 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -610,14 +610,14 @@ yanks the contents of the clipboard at point.
@cindex primary selection
@cindex selection, primary
- Under the X Window System, there exists a @dfn{primary selection}
-containing the last stretch of text selected in an X application
-(usually by dragging the mouse). Typically, this text can be inserted
-into other X applications by @kbd{mouse-2} clicks. The primary
-selection is separate from the clipboard. Its contents are more
-fragile; they are overwritten each time you select text with the
-mouse, whereas the clipboard is only overwritten by explicit cut
-or copy commands.
+ Under the X Window System, PGTK and Haiku, there exists a
+@dfn{primary selection} containing the last stretch of text selected
+in an X application (usually by dragging the mouse). Typically, this
+text can be inserted into other X applications by @kbd{mouse-2}
+clicks. The primary selection is separate from the clipboard. Its
+contents are more fragile; they are overwritten each time you select
+text with the mouse, whereas the clipboard is only overwritten by
+explicit cut or copy commands.
Under X, whenever the region is active (@pxref{Mark}), the text in
the region is saved in the primary selection. This applies regardless
@@ -639,6 +639,13 @@ regions to the primary selection entirely.
(@kbd{C-y}) to insert this text if @code{select-enable-primary} is set
(@pxref{Clipboard}).
+@cindex lost-selection-mode
+ By default, Emacs keeps the region active even after text is
+selected in another program; this is contrary to typical X behavior.
+To make Emacs deactivate the region after another program places data
+in the primary selection, enable the global minor mode
+@code{lost-selection-mode}.
+
@cindex MS-Windows, and primary selection
MS-Windows provides no primary selection, but Emacs emulates it
within a single Emacs session by storing the selected text internally.
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 9709c6ddc1f..841a285520a 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -1643,11 +1643,11 @@ interface is similar to the @code{more} program.
@cindex remote host
@cindex connecting to remote host
@cindex Telnet
-@cindex Rlogin
+@cindex SSH
You can login to a remote computer, using whatever commands you
-would from a regular terminal (e.g., using the @command{ssh} or
-@command{telnet} or @code{rlogin} commands), from a Term window.
+would from a regular terminal (e.g., the @command{ssh} command), from
+a Term window.
A program that asks you for a password will normally suppress
echoing of the password, so the password will not show up in the
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index ed32814329b..e37f6002430 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -2078,7 +2078,7 @@ and @var{kind} as arguments.
@item load-changed
This xwidget event indicates that the @var{xwidget} has reached a
particular point of the page-loading process. When these events are
-sent, @var{arg} will contain a string that futher describes the status
+sent, @var{arg} will contain a string that further describes the status
of the widget:
@table @samp
@@ -2212,6 +2212,17 @@ and @code{mouse-wheel-down-alternate-event} defined in
@file{mwheel.el} to determine what event types to expect for the mouse
wheel.
+@vindex mouse-wheel-left-event
+@vindex mouse-wheel-right-event
+Similarly, some mice can generate @code{mouse-wheel-left-event} and
+@code{mouse-wheel-right-event} and can be used to scroll if
+@code{mouse-wheel-tilt-scroll} is non-@code{nil}. However, some mice
+also generate other events at the same time as they're generating
+these scroll events which may get in the way. The way to fix this is
+generally to unbind these events (for instance, @code{mouse-6} or
+@code{mouse-7}, but this is very hardware and operating system
+dependent).
+
@cindex @code{pinch} event
@item (pinch @var{position} @var{dx} @var{dy} @var{scale} @var{angle})
This kind of event is generated by the user performing a ``pinch''
@@ -2966,7 +2977,7 @@ returns the key sequence as a vector, never as a string.
If an input character is upper-case (or has the shift modifier) and
has no key binding, but its lower-case equivalent has one, then
@code{read-key-sequence} converts the character to lower case. (This
-behaviour can be disabled by setting the
+behavior can be disabled by setting the
@code{translate-upper-case-key-bindings} user option to @code{nil}.)
Note that @code{lookup-key} does not perform case conversion in this
way.
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 3670225dc49..9bb7b590a2c 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -979,7 +979,9 @@ Its value should be a number between @minus{}1 and 3. Values between
0 and 3 specify the optimization levels equivalent to the
corresponding compiler @option{-O0}, @option{-O1}, etc.@: command-line
options of the compiler. The value @minus{}1 means disable
-native-compilation; functions and files will be only byte-compiled.
+native-compilation: functions and files will be only byte-compiled;
+however, the @file{*.eln} files will still be produced, they will just
+contain the compiled code in bytecode form.
The default value is 2.
@end defopt
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index e85d492bbb5..08bf7441df0 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2474,6 +2474,7 @@ Otherwise, it returns @code{nil}.
The following table lists all the face attributes, their possible
values, and their effects.
+@cindex unspecified, face attribute value
Apart from the values given below, each face attribute can have the
value @code{unspecified}. This special value means that the face
doesn't specify that attribute directly. An @code{unspecified}
@@ -2482,7 +2483,13 @@ description @code{:inherit} attribute below); or, failing that, to an
underlying face (@pxref{Displaying Faces}). (However,
@code{unspecified} is not a valid value in @code{defface}.)
- The @code{default} face must specify all attributes.
+@cindex reset, face attribute value
+ A face attribute can also have the value @code{reset}. This special
+value stands for the value of the corresponding attribute of the
+@code{default} face.
+
+ The @code{default} face must explicitly specify all attributes, and
+cannot use the special value @code{reset}.
Some of these attributes are meaningful only on certain kinds of
displays. If your display cannot handle a certain attribute, the
@@ -8551,7 +8558,7 @@ displayed in the echo area.
@vindex use-system-tooltips
When Emacs is built with the GTK+ toolkit or Haiku windowing support,
it by default displays tooltips using toolkit functions, and the
-appearance of the tooltips is then controlled by by the toolkit's
+appearance of the tooltips is then controlled by the toolkit's
settings. Toolkit-provided tooltips can be disabled by changing the
value of the variable @code{use-system-tooltips} to @code{nil}. The
rest of this subsection describes how to control non-toolkit tooltips,
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi
index 622578bcf1c..56f7b7bdfad 100644
--- a/doc/lispref/edebug.texi
+++ b/doc/lispref/edebug.texi
@@ -841,7 +841,6 @@ you continue execution, and recreated next time it is needed.
@cindex printing (Edebug)
@cindex printing circular structures
-@pindex cust-print
If an expression in your program produces a value containing circular
list structure, you may get an error when Edebug attempts to print it.
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index ea8683a6d8e..986fb22c75b 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2445,6 +2445,15 @@ You can use this function for directory names and for file names,
because it recognizes abbreviations even as part of the name.
@end defun
+@defun file-parent-directory filename
+This function returns the directory name of the parent directory of
+@var{filename}. If @var{filename} is at the root directory of the
+filesystem, it returns @code{nil}. A relative @var{filename} is
+assumed to be relative to @code{default-directory}, and the return
+value will also be relative in that case. If the return value is
+non-@code{nil}, it ends in a slash.
+@end defun
+
@node File Name Expansion
@subsection Functions that Expand Filenames
@cindex expansion of file names
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 720753edad6..ed56fa777d2 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1746,15 +1746,16 @@ fit will be clipped by the window manager.
@item fullscreen
This parameter specifies whether to maximize the frame's width, height
or both. Its value can be @code{fullwidth}, @code{fullheight},
-@code{fullboth}, or @code{maximized}. A @dfn{fullwidth} frame is as
-wide as possible, a @dfn{fullheight} frame is as tall as possible, and
-a @dfn{fullboth} frame is both as wide and as tall as possible. A
-@dfn{maximized} frame is like a ``fullboth'' frame, except that it
-usually keeps its title bar and the buttons for resizing and closing
-the frame. Also, maximized frames typically avoid hiding any task bar
-or panels displayed on the desktop. A ``fullboth'' frame, on the
-other hand, usually omits the title bar and occupies the entire
-available screen space.
+@code{fullboth}, or @code{maximized}.@footnote{On PGTK frames, setting
+the values @code{fullheight} and @code{fullwidth} has no effect.} A
+@dfn{fullwidth} frame is as wide as possible, a @dfn{fullheight} frame
+is as tall as possible, and a @dfn{fullboth} frame is both as wide and
+as tall as possible. A @dfn{maximized} frame is like a ``fullboth''
+frame, except that it usually keeps its title bar and the buttons for
+resizing and closing the frame. Also, maximized frames typically
+avoid hiding any task bar or panels displayed on the desktop. A
+``fullboth'' frame, on the other hand, usually omits the title bar and
+occupies the entire available screen space.
Full-height and full-width frames are more similar to maximized
frames in this regard. However, these typically display an external
@@ -4090,6 +4091,20 @@ They can either be the same data types that are typically accepted by
specific drag-n-drop protocol being used. Plain text may be
@code{"STRING"} or @code{"text/plain"}, for example.
+@vindex x-dnd-direct-save-function
+ However, @code{x-dnd-types-alist} does not handle a special kind of
+drop sent by a program which wants Emacs to save a file in a location
+Emacs must determine by itself. These drops are handled via the
+variable @code{x-dnd-direct-save-function}, which should be a function
+that accepts two arguments. If the first argument is non-@code{nil},
+then the second argument is a string describing the name (with no
+leading directory) that the other program recommends the file be saved
+under, and the function should return the complete file name under
+which it will be saved. Otherwise, the file has already been saved,
+and the second argument is the complete name of the file. The
+function should then perform whatever action is appropriate (i.e.,
+open the file or refresh the directory listing.)
+
@cindex initiating drag-and-drop
On capable window systems, Emacs also supports dragging contents
from its frames to windows of other applications.
@@ -4280,6 +4295,18 @@ will only be used if @code{"FILE_NAME"} is one of the targets given to
to drop all supported content.
@end defvar
+@defvar x-dnd-use-unsupported-drop
+When one of the @code{"STRING"}, @code{"UTF8_STRING"},
+@code{"COMPOUND_TEXT"} or @code{"TEXT"} targets is present in the list
+given to @code{x-begin-drag}, Emacs will try to use synthesized mouse
+events and the primary selection to insert the text if the drop target
+doesn't support any drag-and-drop protocol at all.
+
+A side effect is that Emacs will become the owner of the primary
+selection upon such a drop. If that is not desired, then the drop
+emulation can be disabled by setting this variable to @code{nil}.
+@end defvar
+
@node Color Names
@section Color Names
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi
index 107d036202e..59b7930732f 100644
--- a/doc/lispref/hooks.texi
+++ b/doc/lispref/hooks.texi
@@ -290,7 +290,6 @@ auto-fill-function
command-error-function
compose-chars-after-function
composition-function-table
-deferred-action-function
input-method-function
load-read-function
load-source-file-function
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index a27b0ea366c..f5341f40f0a 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -579,11 +579,10 @@ override any non-@code{nil} binding in any other of the @var{maps}.
@code{button-buffer-map} and @code{special-mode-map}:
@example
-(defvar help-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map
- (make-composed-keymap button-buffer-map special-mode-map))
- ... map) ... )
+(defvar-keymap help-mode-map
+ :parent (make-composed-keymap button-buffer-map
+ special-mode-map)
+ ...)
@end example
@@ -1064,6 +1063,20 @@ The optional argument @var{on-exit}, if non-@code{nil}, specifies a
function that is called, with no arguments, after @var{keymap} is
deactivated.
+The optional argument @var{message} specifies the message to display
+after activating the transient map. If @var{message} is a string, it
+is the format string for the message, and any @samp{%k} specifier in
+that string is replaced with the list of keys from the transient map.
+Any other non-@code{nil} value of @var{message} stands for the default
+message format @samp{Repeat with %k}.
+
+@vindex set-transient-map-timeout
+If the optional argument @var{timeout} is non-@code{nil}, it should be
+a number that specifies how many seconds of idle time to wait before
+deactivating @var{keymap}. The value of the variable
+@code{set-transient-map-timeout}, if non-@code{nil}, overrides the
+value of this argument.
+
This function works by adding and removing @var{keymap} from the
variable @code{overriding-terminal-local-map}, which takes precedence
over all other active keymaps (@pxref{Searching Keymaps}).
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 00a1fe05fdd..54fc16ec9f0 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -728,7 +728,7 @@ variables to control this:
The value of this constant is a regexp that matches autoload cookies.
@code{loaddefs-generate} copies the Lisp form that follows the
cookie into the autoload file it generates. This will match comments
-like like @samp{;;;###autoload} and @samp{;;;###calc-autoload}.
+like @samp{;;;###autoload} and @samp{;;;###calc-autoload}.
@end defvar
@defvar generated-autoload-file
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 4f40f35ff45..e94093318fc 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -271,7 +271,7 @@ normal-mode}), but tries to force it not to choose any modes in
@defun clean-mode
Changing the major mode clears out most local variables, but it
-doesn't remove all artefacts in the buffer (like text properties and
+doesn't remove all artifacts in the buffer (like text properties and
overlays). It's rare to change a buffer from one major mode to
another (except from @code{fundamental-mode} to everything else), so
this is usually not a concern. It can sometimes be convenient (mostly
@@ -3473,7 +3473,8 @@ fontification functions, and gives it two arguments, @var{start} and
@var{end}, which specify the region to be fontified or refontified.
If @var{function} performs fontifications, it can return a list of the
form @w{@code{(jit-lock-bounds @var{beg} . @var{end})}}, to indicate
-the bounds of the region it actually fontified; JIT font-lock will use
+the bounds of the region it actually fontified; Just-In-Time (a.k.a.@:
+@acronym{``JIT''}) font-lock will use
this information to optimize subsequent redisplay cycles and regions
of buffer text it will pass to future calls to @var{function}.
@@ -3493,6 +3494,19 @@ If @var{function} was previously registered as a fontification
function using @code{jit-lock-register}, this function unregisters it.
@end defun
+@cindex debugging font-lock
+@cindex jit-lock functions, debugging
+@deffn Command jit-lock-debug-mode &optional arg
+This is a minor mode whose purpose is to help in debugging code that
+is run by JIT font-lock. When this mode is enabled, most of the code
+that JIT font-lock normally runs during redisplay cycles, where Lisp
+errors are suppressed, is instead run by a timer. Thus, this mode
+allows using debugging aids such as @code{debug-on-error}
+(@pxref{Error Debugging}) and Edebug (@pxref{Edebug}) for finding and
+fixing problems in font-lock code and any other code run by JIT
+font-lock.
+@end deffn
+
@node Levels of Font Lock
@subsection Levels of Font Lock
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 14856b9e050..80c371e1c6a 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -3547,7 +3547,7 @@ and @code{#x1c} @code{#x28} to @w{@code{(3 5 10 11 12)}}.
@item fill @var{len}
@var{len} bytes used as a mere filler. In packing, these bytes are
-are left unchanged, which normally means they remain zero.
+left unchanged, which normally means they remain zero.
When unpacking, this just returns nil.
@item align @var{len}
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 21a2c6c51e4..5ee139a11d3 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1898,7 +1898,7 @@ attempts. Other zero-width assertions may also bring benefits by
causing a match to fail early.
@item
-Avoid or-patterns in favour of character alternatives: write
+Avoid or-patterns in favor of character alternatives: write
@samp{[ab]} instead of @samp{a\|b}. Recall that @samp{\s-} and @samp{\sw}
are equivalent to @samp{[[:space:]]} and @samp{[[:word:]]}, respectively.
@@ -1933,7 +1933,7 @@ purposes.
@ifnottex
@item
-Consider using @code{rx} (@pxref{Rx Notation}); it can optimise some
+Consider using @code{rx} (@pxref{Rx Notation}); it can optimize some
or-patterns automatically and will never introduce capturing groups
unless explicitly requested.
@end ifnottex
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index c3f4cff3015..39230d0adc4 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -577,6 +577,20 @@ starting from the first one for which @var{predicate} returns @code{nil}.
@end example
@end defun
+@defun seq-split sequence length
+ This function returns a list consisting of sub-sequences of
+@var{sequence} of (at most) length @var{length}. (The final element
+may be shorter than @var{length} if the length of @var{sequence} isn't
+a multiple of @var{length}.
+
+@example
+@group
+(seq-split [0 1 2 3 4] 2)
+@result{} ([0 1] [2 3] [4])
+@end group
+@end example
+@end defun
+
@defun seq-do function sequence
This function applies @var{function} to each element of
@var{sequence} in turn (presumably for side effects), and returns
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 622f03d2a85..8b0e1981955 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -243,10 +243,8 @@ using a function specified by the variable
The default filter function consults the obsolete wrapper hook
@code{filter-buffer-substring-functions} (see the documentation string
of the macro @code{with-wrapper-hook} for the details about this
-obsolete facility), and the obsolete variable
-@code{buffer-substring-filters}. If both of these are @code{nil}, it
-returns the unaltered text from the buffer, i.e., what
-@code{buffer-substring} would return.
+obsolete facility). If it is @code{nil}, it returns the unaltered
+text from the buffer, i.e., what @code{buffer-substring} would return.
If @var{delete} is non-@code{nil}, the function deletes the text
between @var{start} and @var{end} after copying it, like
@@ -282,22 +280,12 @@ the same as those of @code{filter-buffer-substring}.
The first hook function is passed a @var{fun} that is equivalent to
the default operation of @code{filter-buffer-substring}, i.e., it
-returns the buffer-substring between @var{start} and @var{end}
-(processed by any @code{buffer-substring-filters}) and optionally
-deletes the original text from the buffer. In most cases, the hook
-function will call @var{fun} once, and then do its own processing of
-the result. The next hook function receives a @var{fun} equivalent to
-this, and so on. The actual return value is the result of all the
-hook functions acting in sequence.
-@end defvar
-
-@defvar buffer-substring-filters
-The value of this obsolete variable should be a list of functions
-that accept a single string argument and return another string.
-The default @code{filter-buffer-substring} function passes the buffer
-substring to the first function in this list, and the return value of
-each function is passed to the next function. The return value of the
-last function is passed to @code{filter-buffer-substring-functions}.
+returns the buffer-substring between @var{start} and @var{end} and
+optionally deletes the original text from the buffer. In most cases,
+the hook function will call @var{fun} once, and then do its own
+processing of the result. The next hook function receives a @var{fun}
+equivalent to this, and so on. The actual return value is the result
+of all the hook functions acting in sequence.
@end defvar
@defun current-word &optional strict really-word
@@ -3406,7 +3394,7 @@ for @var{object} is the current buffer.
Search for the next region that has text property @var{prop} set to
@var{value} according to @var{predicate}.
-This function is modelled after @code{search-forward} and friends in
+This function is modeled after @code{search-forward} and friends in
that it moves point, but it returns a structure that describes the
match instead of returning it in @code{match-beginning} and friends.
@@ -3485,7 +3473,7 @@ This will give you a list of all those URLs.
@end defun
@defun text-property-search-backward prop &optional value predicate not-current
-This is just like @code{text-property-search-backward}, but searches
+This is just like @code{text-property-search-forward}, but searches
backward instead. Point is placed at the beginning of the matched
region instead of the end, though.
@end defun
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index c29547d00db..242b1a3be93 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -327,7 +327,7 @@ Example of a loop summing a list of numbers:
@anchor{Tail recursion}
Recursive calls to @var{name} that occur in @emph{tail
-positions} in @var{body} are guaranteed to be optimised as @emph{tail
+positions} in @var{body} are guaranteed to be optimized as @emph{tail
calls}, which means that they will not consume any additional stack
space no matter how deeply the recursion runs. Such recursive calls
will effectively jump to the top of the loop with new values for the
@@ -1363,7 +1363,7 @@ disappear without prior notice.
The byte-compiler can also warn about lexical variables that are
special in other Emacs Lisp files, often indicating a missing
-@code{defvar} declaration. This useful but somewhat specialised check
+@code{defvar} declaration. This useful but somewhat specialized check
requires three steps:
@enumerate
@@ -2843,7 +2843,7 @@ Common Lisp, this is not an error since the function @code{(setf
it, that value won't be automatically restored. Users usually set
normal variables in their startup files, or use Customize
(@pxref{Customization}) to set user options permanently, and various
-packages have various files wher they store the data (e.g., Gnus
+packages have various files where they store the data (e.g., Gnus
stores this in @file{.newsrc.eld} and the URL library stores cookies
in @file{~/.emacs.d/url/cookies}).
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 704ed30366c..535571b3161 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -1158,11 +1158,13 @@ frame to its buffer using the command @code{fit-frame-to-buffer}.
This command adjusts the size of @var{frame} to display the contents of
its buffer exactly. @var{frame} can be any live frame and defaults to
the selected one. Fitting is done only if @var{frame}'s root window is
-live. The arguments @var{max-height}, @var{min-height}, @var{max-width}
-and @var{min-width} specify bounds on the new total size of
-@var{frame}'s root window. @var{min-height} and @var{min-width} default
-to the values of @code{window-min-height} and @code{window-min-width}
-respectively.
+live.
+
+The arguments @var{max-height}, @var{min-height}, @var{max-width} and
+@var{min-width}, if non-@code{nil}, specify bounds on the new body size
+of @var{frame}'s root window. A non-@code{nil} value specified by any
+of these arguments overrides the corresponding value specified by
+the option @code{fit-frame-to-buffer-sizes} described below.
If the optional argument @var{only} is @code{vertically}, this function
may resize the frame vertically only. If @var{only} is
@@ -1187,10 +1189,10 @@ here can be overridden for a specific frame by that frame's
@defopt fit-frame-to-buffer-sizes
This option specifies size boundaries for @code{fit-frame-to-buffer}.
-It specifies the total maximum and minimum lines and maximum and minimum
-columns of the root window of any frame that shall be fit to its buffer.
-If any of these values is non-@code{nil}, it overrides the corresponding
-argument of @code{fit-frame-to-buffer}.
+It specifies the maximum and minimum lines and maximum and minimum
+columns of the root window's body of any frame that shall be fit to its
+buffer. Any value this option specifies will be overridden by the
+corresponding argument of @code{fit-frame-to-buffer}, if non-@code{nil}.
@end defopt
@deffn Command shrink-window-if-larger-than-buffer &optional window
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 6134b977517..07c19e37ce4 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -3756,7 +3756,7 @@ a merged sequence which is (stably) sorted according to
The functions described here operate on lists.
@menu
-* List Functions:: @code{cl-caddr}, @code{cl-first}, @code{cl-list*}, etc.
+* List Functions:: @code{cl-first}, @code{cl-list*}, etc.
* Substitution of Expressions:: @code{cl-subst}, @code{cl-sublis}, etc.
* Lists as Sets:: @code{cl-member}, @code{cl-adjoin}, @code{cl-union}, etc.
* Association Lists:: @code{cl-assoc}, @code{cl-acons}, @code{cl-pairlis}, etc.
@@ -3769,14 +3769,6 @@ The functions described here operate on lists.
This section describes a number of simple operations on lists,
i.e., chains of cons cells.
-@defun cl-caddr x
-This function is equivalent to @code{(car (cdr (cdr @var{x})))}.
-Likewise, this package aliases all 24 @code{c@var{xxx}r} functions
-where @var{xxx} is up to four @samp{a}s and/or @samp{d}s.
-All of these functions are @code{setf}-able, and calls to them
-are expanded inline by the byte-compiler for maximum efficiency.
-@end defun
-
@defun cl-first x
This function is a synonym for @code{(car @var{x})}. Likewise,
the functions @code{cl-second}, @code{cl-third}, @dots{}, through
@@ -4553,8 +4545,8 @@ For example,
@end example
@end ignore
-Note that @code{cl-adjoin}, @code{cl-caddr}, and @code{cl-member} all
-have built-in compiler macros to optimize them in common cases.
+Note that @code{cl-adjoin} and @code{cl-member} have built-in compiler
+macros to optimize them in common cases.
@end defun
@appendixsec Error Checking
diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi
index 754ccf4065c..50d9914081c 100644
--- a/doc/misc/dired-x.texi
+++ b/doc/misc/dired-x.texi
@@ -165,10 +165,8 @@ When @file{dired-x.el} is loaded, some standard Dired functions from
Dired}), if it is active. @code{dired-find-buffer-nocreate} and
@code{dired-initial-position} respect the value of
@code{dired-find-subdir} (@pxref{Miscellaneous Commands}).
-@code{dired-clean-up-after-deletion} respects the value of
-@code{dired-clean-up-buffers-too}. @code{dired-read-shell-command} uses
-@code{dired-guess-shell-command} (@pxref{Shell Command Guessing}) to
-offer a smarter default command.
+@code{dired-read-shell-command} uses @code{dired-guess-shell-command}
+(@pxref{Shell Command Guessing}) to offer a smarter default command.
@node Installation
@chapter Installation
@@ -884,15 +882,6 @@ normal and a wildcard buffer for the same directory, @kbd{C-x d @key{RET}}
will toggle between those two.
@end table
-@table @kbd
-@findex dired-goto-subdir
-@kindex M-G
-@item M-G
-(@code{dired-goto-subdir}) Go to the header line of an inserted directory.
-This command reads its argument, with completion derived from the names of the
-inserted subdirectories.
-@end table
-
@table @code
@item dired-vm
@@ -920,55 +909,6 @@ to @kbd{V}. Otherwise, @code{dired-bind-rmail} will be bound.
@findex dired-rmail
Bound to @kbd{V} if @code{dired-bind-vm} is @code{nil}. Run Rmail on this
file (assumed to be mail folder in Rmail format).
-
-@item dired-info
-@kindex I
-@cindex running info.
-@findex dired-info
-Bound to @kbd{I}. Run Info on this file (assumed to be a file in Info
-format).
-
-@vindex dired-bind-info
-If the variable @code{dired-bind-info} is @code{nil}, @code{dired-info} will
-not be bound to @kbd{I}.
-
-@item dired-man
-@cindex running man.
-@kindex N
-@findex dired-man
-Bound to @kbd{N}. Run man on this file (assumed to be a file in @code{nroff}
-format).
-
-@vindex dired-bind-man
-If the variable @code{dired-bind-man} is @code{nil}, @code{dired-man} will not
-be bound to @kbd{N}.
-
-@item dired-do-relsymlink
-@cindex relative symbolic links.
-@kindex Y
-@findex dired-do-relsymlink
-Bound to @kbd{Y}. Relative symlink all marked (or next ARG) files into a
-directory, or make a relative symbolic link to the current file. This creates
-relative symbolic links like
-
-@example
- foo -> ../bar/foo
-@end example
-
-@noindent
-not absolute ones like
-
-@example
- foo -> /ugly/path/that/may/change/any/day/bar/foo
-@end example
-
-@item dired-do-relsymlink-regexp
-@kindex %Y
-@findex dired-do-relsymlink-regexp
-Bound to @kbd{%Y}. Relative symlink all marked files containing
-@var{regexp} to @var{newname}. See functions
-@code{dired-do-rename-regexp} and @code{dired-do-relsymlink} for more
-info.
@end table
@node Bugs
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi
index 6daa54d956a..3db83197f9e 100644
--- a/doc/misc/erc.texi
+++ b/doc/misc/erc.texi
@@ -557,6 +557,7 @@ For example, calling the command like so
(erc :server "irc.libera.chat" :full-name "J. Random Hacker")
@end example
+@noindent
sets @var{server} and @var{full-name} directly while leaving the rest
up to functions like @code{erc-compute-port}. Note that some
arguments can't be specified interactively. @var{id}, in particular,
@@ -589,6 +590,7 @@ That is, if called in the following manner
(erc-tls :server "irc.libera.chat" :full-name "J. Random Hacker")
@end example
+@noindent
the command will set @var{server} and @var{full-name} accordingly,
while helpers, like @code{erc-compute-nick}, will determine other
parameters, and some, like @code{client-certificate}, will just be
@@ -730,14 +732,17 @@ You can manually set another nickname with the /NICK command.
@subheading User
@defun erc-compute-user &optional user
-Determine a suitable value to send for the first argument to the
+Determine a suitable value to send as the first argument of the
opening @samp{USER} IRC command by consulting the following sources:
@itemize
-@item @var{user}, the argument passed to this function
-@item The option @code{erc-email-userid}, assuming @code{erc-anonymous-login}
+@item
+@var{user}, the argument passed to this function
+@item
+The option @code{erc-email-userid}, assuming @code{erc-anonymous-login}
is non-@code{nil}
-@item The result of calling the function @code{user-login-name}
+@item
+The result of calling the function @code{user-login-name}
@end itemize
@end defun
@@ -751,9 +756,9 @@ a string abiding by the rules of the network.
@cindex password
@defopt erc-prompt-for-password
-If non-@code{nil} (the default), @kbd{M-x erc} prompts for a server
-password. This only affects interactive invocations of @code{erc} and
-@code{erc-tls}.
+If non-@code{nil} (the default), @kbd{M-x erc} and @kbd{M-x erc-tls}
+prompt for a server password. This only affects interactive
+invocations of @code{erc} and @code{erc-tls}.
@end defopt
@noindent
@@ -768,32 +773,33 @@ machine irc.example.net login mynick password sEcReT
@noindent
For server passwords, that is, passwords sent for the IRC @samp{PASS}
-command, the @samp{host} field, here @code{machine irc.example.net},
+command, the @samp{host} field (@w{@code{machine irc.example.net}} in
+the above example)
corresponds to the @var{server} parameter used by @code{erc} and
@code{erc-tls}. Unfortunately, specifying a network, like
@samp{Libera.Chat}, or a specific network server, like
-@samp{platinum.libera.chat}, won't work OOTB for looking up a server
+@samp{platinum.libera.chat}, won't normally work for looking up a server
password because such information isn't available during opening
-introductions. Actually, ERC @emph{can} find entries with arbitrary
+introductions. (Actually, ERC @emph{can} find entries with arbitrary
@samp{host} values for any context, including server passwords, but
-that requires messing with the more advanced options below.
+that requires customizing the more advanced options below.)
-If ERC can't find a suitable server password, it'll just skip the IRC
+If ERC can't find a suitable server password, it will just skip the IRC
@samp{PASS} command altogether, something users may want when using
-CertFP or engaging NickServ via ERC's ``services'' module. If that
-sounds like you, you can also set the option
+CertFP or engaging NickServ via ERC's ``services'' module. If that is
+what you'd like to do, you can also customize the option
@code{erc-auth-source-server-function} to @code{nil} to skip
-server-passwork lookup for all servers. Note that some networks and
+server-password lookup for all servers. Note that some networks and
IRCds may accept account-services authentication via server password
-using the nonstandard ``mynick:sEcReT'' convention.
+using the nonstandard @samp{mynick:sEcReT} convention.
As just mentioned, you can also use @code{auth-source} to authenticate
to account services the traditional way, through a bot called
-``NickServ''. To tell ERC to do that, set
+@samp{NickServ}. To tell ERC to do that, set
@code{erc-use-auth-source-for-nickserv-password} to @code{t}. For
these and most other queries, entries featuring custom identifiers and
networks are matched first, followed by network-specific servers and
-dialed endpoints (typically, the @var{SERVER} passed to
+dialed endpoints (typically, the @var{server} argument passed to
@code{erc}). The following netrc-style entries appear in order of
precedence:
@@ -807,12 +813,12 @@ machine irc.libera.chat login MyNick password sEcReT
@noindent
Remember that field labels vary per backend, so @samp{machine} (in
netrc's case) maps to auth-source's generalized notion of a host,
-hence the @samp{:host} keyword property. Also, be sure and mind the
+hence the @samp{:host} keyword property. Also, be sure to mind the
syntax of your chosen backend medium. For example, always quote
channel names in a netrc file.
If this all seems overly nuanced or just plain doesn't appeal to you,
-see options @code{erc-auth-source-services-function} and friends just
+see options @code{erc-auth-source-services-function} and friends, described
below. These let you query auth-source your way. Most users can
simply ignore the passed-in arguments and get by with something like
the following:
@@ -830,7 +836,7 @@ Lastly, ERC also consults @code{auth-source} to find ``keys'' that may
be required by certain channels you join. When modifying a
traditional @code{auth-source} entry for this purpose, put the channel
name in the @samp{user} field (for example, @samp{login "#fsf"}, in
-netrc's case). The actual key goes in the @samp{password} (or
+netrc's case). The actual key goes in the @samp{password} (or
@samp{secret}) field.
@noindent
@@ -850,9 +856,10 @@ Generalized names, like @code{:user} and @code{:host}, are always used
over back-end specific ones, like @code{:login} or @code{:machine}.
ERC expects a string to use as the secret or nil, if the search fails.
+@findex erc-auth-source-search
The default value for all three options is the function
@code{erc-auth-source-search}. It tries to merge relevant contextual
-params with those provided or discovered from the logical connection
+parameters with those provided or discovered from the logical connection
or the underlying transport. Some auth-source back ends may not be
compatible; netrc, plstore, json, and secrets are currently supported.
@end defopt
@@ -866,10 +873,14 @@ This tries a number of increasingly more default methods until a
non-@code{nil} value is found.
@itemize @bullet
-@item @var{full-name} (the argument passed to this function)
-@item The @code{erc-user-full-name} option
-@item The value of the IRCNAME environment variable
-@item The result from the @code{user-full-name} function
+@item
+@var{full-name} (the argument passed to this function)
+@item
+The @code{erc-user-full-name} option
+@item
+The value of the IRCNAME environment variable
+@item
+The result from the @code{user-full-name} function
@end itemize
@end defun
@@ -884,20 +895,20 @@ This can be either a string or a function to call.
@subheading ID
@anchor{Network Identifier}
-ERC uses an abstract designation called a @dfn{network context
-identifier} for referring to a connection internally. While normally
+ERC uses an abstract designation, called @dfn{network context
+identifier}, for referring to a connection internally. While normally
derived from a combination of logical and physical connection
parameters, an ID can also be explicitly provided via an entry-point
-command (like @code{erc-tls}). Use this in rare situations where ERC
+command (like @code{erc-tls}). Use this in rare situations where ERC
would otherwise have trouble discerning between connections.
One such situation might arise when using multiple connections to the
-same network with the same nick but different (nonstandard) "device"
+same network with the same nick but different (nonstandard) @samp{device}
identifiers, which some bouncers may support. Another might be when
mimicking the experience offered by popular standalone clients, which
normally offer ``named'' persistent configurations with server buffers
reflecting those names. Yet another use case might involve
-third-party code needing to identify a connection unequivocally but in
+third-party code needing to identify a connection unequivocally, but in
a human-friendly way suitable for UI components.
When providing an ID as an entry-point argument, strings and symbols
diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index 91288db45a2..1b7f38daadf 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -321,7 +321,7 @@ Show the list of @code{should} forms executed in the test
@kindex m@r{, in ert results buffer}
@findex ert-results-pop-to-messages-for-test-at-point
Show any messages that were generated (with the Lisp function
-@code{message}) in in a test or any of the code that it invoked
+@code{message}) in a test or any of the code that it invoked
(@code{ert-results-pop-to-messages-for-test-at-point}).
@item L
@@ -822,7 +822,7 @@ that's pretty difficult to read and write, especially when the text in
question is multi-line.
So ert provides a function called @code{ert-test-erts-file} that takes
-two parameters: The name of a specially-formatted @dfn{erts} file, and
+two parameters: the name of a specially-formatted @dfn{erts} file, and
(optionally) a function that performs the transform.
@findex erts-mode
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index 2e3ba4c273b..9f9c88582f3 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -354,11 +354,11 @@ Giving the command @kbd{cd -} changes back to the previous working
directory (this is the same as @kbd{cd $-}).
@item
-The command @kbd{cd =} shows the directory stack. Each line is
+The command @kbd{cd =} shows the directory ring. Each line is
numbered.
@item
-With @kbd{cd =foo}, Eshell searches the directory stack for a directory
+With @kbd{cd =foo}, Eshell searches the directory ring for a directory
matching the regular expression @samp{foo}, and changes to that
directory.
@@ -845,46 +845,73 @@ For example, you could handle a subset of the options for the
@end defmac
+@node Variables
+@section Variables
+Since Eshell is just an Emacs @acronym{REPL}@footnote{
+Short for ``Read-Eval-Print Loop''.
+}
+, it does not have its own scope, and simply stores variables the same
+you would in an Elisp program. Eshell provides a command version of
+@code{setq} for convenience.
+
@subsection Built-in variables
Eshell knows a few built-in variables:
@table @code
-@item $+
+@vindex $PWD
@vindex $+
+@item $PWD
+@itemx $+
This variable always contains the current working directory.
-@item $-
+@vindex $OLDPWD
@vindex $-
+@item $OLDPWD
+@itemx $-
This variable always contains the previous working directory (the
current working directory from before the last @code{cd} command).
+When using @code{$-}, you can also access older directories in the
+directory ring via subscripting, e.g.@: @samp{$-[1]} refers to the
+working directory @emph{before} the previous one.
-@item $_
@vindex $_
-It refers to the last argument of the last command.
+@item $_
+This refers to the last argument of the last command. With a
+subscript, you can access any argument of the last command. For
+example, @samp{$_[1]} refers to the second argument of the last
+command (excluding the command name itself).
-@item $$
@vindex $$
+@item $$
This is the result of the last command. In case of an external
command, it is @code{t} or @code{nil}.
-@item $?
@vindex $?
-This variable contains the exit code of the last command (0 or 1 for
-Lisp functions, based on successful completion).
+@item $?
+This variable contains the exit code of the last command. If the last
+command was a Lisp function, it is 0 for successful completion or 1
+otherwise.
+
+@vindex $COLUMNS
+@vindex $LINES
+@item $COLUMNS
+@itemx $LINES
+These variables tell the number of columns and lines, respectively,
+that are currently visible in the Eshell window. They are both
+copied to the environment, so external commands invoked from
+Eshell can consult them to do the right thing.
+
+@item $INSIDE_EMACS
+This variable indicates to external commands that they are being
+invoked from within Emacs so they can adjust their behavior if
+necessary. Its value is @code{@var{emacs-version},eshell}.
@end table
@xref{Aliases}, for the built-in variables @samp{$*}, @samp{$1},
@samp{$2}, @dots{}, in alias definitions.
-@node Variables
-@section Variables
-Since Eshell is just an Emacs REPL@footnote{Read-Eval-Print Loop}, it
-does not have its own scope, and simply stores variables the same you
-would in an Elisp program. Eshell provides a command version of
-@code{setq} for convenience.
-
@node Aliases
@section Aliases
@@ -1045,7 +1072,7 @@ back to a number as above). For example, @samp{$list("a" "b")c}
returns @samp{("a" "bc")}.
@item anything else
-Concatenate the string represenation of each value.
+Concatenate the string representation of each value.
@end table
@@ -1570,7 +1597,7 @@ integration: using the remote shell's pipelining avoids copying the
data which will flow through the pipeline to local Emacs buffers and
then right back again.
-Eshell recognises a special syntax to make it easier to convert
+Eshell recognizes a special syntax to make it easier to convert
pipelines so as to bypass Eshell's pipelining. Prefixing at least one
@code{|}, @code{<} or @code{>} with an asterisk marks a command as
intended for the operating system shell. To make it harder to invoke
@@ -1588,7 +1615,7 @@ nor the decoded data, into Emacs buffers, as would normally happen.
The command is interpreted as extending up to the next @code{|}
character which is not preceded by an unescaped asterisk following
whitespace, or the end of the input if there is no such character.
-Thus, all @code{<} and @code{>} redirections occuring before the next
+Thus, all @code{<} and @code{>} redirections occurring before the next
asterisk-unprefixed @code{|} are implicitly prefixed with (whitespace
and) asterisks. An exception is that Eshell-specific redirects right
at the end of the command are excluded. This allows input like this:
@@ -2077,11 +2104,10 @@ it).
@item Make the shell spawning commands be visual
-That is, make (@command{su}, @command{bash}, @command{telnet},
-@command{rlogin}, @command{rsh}, etc.)@: be part of
-@code{eshell-visual-commands}. The only exception is if the shell is
-being used to invoke a single command. Then, the behavior should be
-based on what that command is.
+That is, make (@command{su}, @command{bash}, @command{ssh}, etc.)@: be
+part of @code{eshell-visual-commands}. The only exception is if the
+shell is being used to invoke a single command. Then, the behavior
+should be based on what that command is.
@item Create a smart viewing command named @command{open}
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index a0be13dac88..6b5173d3c2f 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -5070,7 +5070,7 @@ Opening bracket for adopted articles. The default is @samp{<}.
@item ]
Closing bracket, which is normally @samp{]}, but can also be @samp{>}
-for adopted articles. This can be customised using following settings:
+for adopted articles. This can be customized using following settings:
@table @code
@item gnus-sum-closing-bracket
diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org
index 446bfaa422a..943294b626c 100644
--- a/doc/misc/modus-themes.org
+++ b/doc/misc/modus-themes.org
@@ -1252,7 +1252,7 @@ accepts is as follows (order is not significant):
The ~popup~ key takes the same values as ~selection~.
-Apart from specfying each key separately, a fallback list is accepted.
+Apart from specifying each key separately, a fallback list is accepted.
This is only useful when the desired aesthetic is the same across all
keys that are not explicitly referenced. For example, this:
@@ -2162,7 +2162,7 @@ things with precision ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization
This section is of interest only to users who are prepared to maintain
their own local tweaks and who are willing to deal with any possible
incompatibilities between versioned releases of the themes. As such,
-they are labelled as "do-it-yourself" or "DIY".
+they are labeled as "do-it-yourself" or "DIY".
** More accurate colors in terminal emulators
:PROPERTIES:
@@ -2605,7 +2605,7 @@ this example:
Whenever we enter a ~diff-mode~ buffer, we now get a magenta-colored
region.
-Perhaps you may wish to generalise those findings in to a set of
+Perhaps you may wish to generalize those findings in to a set of
functions that also accept an arbitrary face. We shall leave the
experimentation up to you.
@@ -3347,7 +3347,7 @@ it if you plan to control face attributes.
:end:
#+cindex: Org custom emphasis faces
-Org provides the user option ~org-emphasis-alist~ which assosiates a
+Org provides the user option ~org-emphasis-alist~ which associates a
character with a face, list of faces, or face attributes. The default
specification of that variable looks like this:
@@ -4542,7 +4542,7 @@ The =git-gutter= and =git-gutter-fr= packages default to drawing bitmaps
for the indicators they display (e.g. bitmap of a plus sign for added
lines). In Doom Emacs, these bitmaps are replaced with contiguous lines
which may look nicer, but require a change to the foreground of the
-relevant faces to yield the desired colour combinations.
+relevant faces to yield the desired color combinations.
Since this is Doom-specific, we urge users to apply changes in their
local setup. Below is some sample code, based on what we cover at
@@ -5519,7 +5519,7 @@ interface virtually unusable.
[[#h:5808be52-361a-4d18-88fd-90129d206f9b][Option for links]].
-Again, one must exercise judgement in order to avoid discrimination,
+Again, one must exercise judgment in order to avoid discrimination,
where "discrimination" refers to:
+ The treatment of substantially different magnitudes as if they were of
@@ -5535,11 +5535,11 @@ usability beyond matters of color---they would be making a
not-so-obvious error of treating different cases as if they were the
same.
-The Modus themes prioritise "thematic consistency" over abstract harmony
+The Modus themes prioritize "thematic consistency" over abstract harmony
or regularity among their applicable colors. In concrete terms, we do
not claim that, say, our yellows are the best complements for our blues
because we generally avoid using complementary colors side-by-side, so
-it is wrong to optimise for a decontextualised blue+yellow combination.
+it is wrong to optimize for a decontextualised blue+yellow combination.
Not to imply that our colors do not work well together because they do,
just to clarify that consistency of context is what themes must strive
for, and that requires widening the scope of the design beyond the
diff --git a/doc/misc/org.org b/doc/misc/org.org
index b1dc7084986..7971c417a52 100644
--- a/doc/misc/org.org
+++ b/doc/misc/org.org
@@ -2866,12 +2866,12 @@ For more information and examples see the [[https://orgmode.org/worg/org-tutoria
- transpose ::
When =y=, =yes=, or =t= attempt to transpose the table data before
- plotting. Also recognises the shorthand option =trans=.
+ plotting. Also recognizes the shorthand option =trans=.
- =type= ::
Specify the type of the plot, by default one of =2d=, =3d=, =radar=, or =grid=.
- Available types can be customised with ~org-plot/preset-plot-types~.
+ Available types can be customized with ~org-plot/preset-plot-types~.
- =with= ::
@@ -3352,7 +3352,7 @@ current buffer:
~org-link-email-description-format~. By default, it refers to the
addressee and the subject.
-- /Web browsers: W3, W3M and EWW/ ::
+- /Web browsers: W3M and EWW/ ::
Here the link is the current URL, with the page title as the
description.
diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi
index 8253e404084..8c798d6c33b 100644
--- a/doc/misc/rcirc.texi
+++ b/doc/misc/rcirc.texi
@@ -639,9 +639,9 @@ password to use.
@item certfp
@cindex certfp authentication
Use this symbol if you want to use CertFP authentication. The
-necessary arguments are the path to the client certificate key and
-password. The CertFP authentication requires a @acronym{TLS}
-connection.
+necessary arguments are the path to the key and to the client
+certificate associated with the account. The CertFP authentication
+requires a @acronym{TLS} connection.
@end table
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index aa16f51aa4e..8872e5e055f 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -7651,7 +7651,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% If SUBTOPIC is present, precede it with a space, and call \doind.
% (At some time during the 20th century, this made a two-level entry in an
% index such as the operation index. Nobody seemed to notice the change in
-% behavior though.)
+% behaviour though.)
\def\dosubind#1#2#3{%
\def\thirdarg{#3}%
\ifx\thirdarg\empty
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index a8230ac9451..cfbc96f4692 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -50,13 +50,10 @@ This file documents @w{@value{tramp} @value{trampver}}, a remote file
editing package for Emacs.
@value{tramp} stands for ``Transparent Remote (file) Access, Multiple
-Protocol''. This package provides remote file editing, similar to
-Ange FTP@.
-
-The difference is that Ange FTP uses FTP to transfer files between the
-local and the remote host, whereas @value{tramp} uses a combination of
-@command{rsh} and @command{rcp} or other work-alike programs, such as
-@command{ssh}/@command{scp}.
+Protocol''. This package provides an easy, convenient, and consistent
+interface to editing remote files transparently, just as if they are
+local files. This extends to editing, version control, @code{dired},
+and more.
You can find the latest version of this document on the web at
@uref{@value{trampurl}}.
@@ -182,10 +179,10 @@ interface to remote files as if they are local files. @value{tramp}'s
transparency extends to editing, version control, and @code{dired}.
@value{tramp} can access remote hosts using any number of access
-methods, such as @command{rsh}, @command{rlogin}, @command{telnet},
-and related programs. If these programs can successfully pass
-@acronym{ASCII} characters, @value{tramp} can use them.
-@value{tramp} does not require or mandate 8-bit clean connections.
+methods, such as @command{ssh}, @command{scp}, @command{telnet}, and
+related programs. If these programs can successfully pass
+@acronym{ASCII} characters, @value{tramp} can use them. @value{tramp}
+does not require or mandate 8-bit clean connections.
@value{tramp}'s most common access method is through @command{ssh}, a
more secure alternative to @command{ftp} and other older access
@@ -233,10 +230,10 @@ first time connecting to that host, here's what happens:
@itemize
@item
-@value{tramp} invokes @samp{telnet @var{host}} or @samp{rsh @var{host}
--l @var{user}} and establishes an external process to connect to the
-remote host. @value{tramp} communicates with the process through an
-Emacs buffer, which also shows output from the remote host.
+@value{tramp} invokes @samp{telnet @var{host}} or @samp{ssh -l
+@var{user} @var{host}} and establishes an external process to connect
+to the remote host. @value{tramp} communicates with the process
+through an Emacs buffer, which also shows output from the remote host.
@item
The remote host may prompt for a login name (for @command{telnet}, for
@@ -246,7 +243,7 @@ followed by a newline.
@item
The remote host may then prompt for a password or passphrase (for
-@command{rsh} or for @command{telnet}). @value{tramp} displays the
+@command{ssh} or for @command{telnet}). @value{tramp} displays the
password prompt in the minibuffer. @value{tramp} then sends whatever
is entered to the remote host, followed by a newline.
@@ -312,7 +309,7 @@ I hope this has provided you with a basic overview of what happens
behind the scenes when you open a file with @value{tramp}.
-@c For the end user
+@c For the end user.
@node Obtaining @value{tramp}
@chapter Obtaining @value{tramp}
@cindex obtaining @value{tramp}
@@ -670,6 +667,11 @@ may be used in your init file:
(with-eval-after-load 'tramp (tramp-change-syntax 'simplified))
@end lisp
+@vindex enable-remote-dir-locals
+Changing other variables via directory-local variables on a remote
+directory must be enabled by setting @code{enable-remote-dir-locals}
+to non-@code{nil}, @xref{Directory Variables, , , emacs}.
+
@menu
* Connection types:: Types of connections to remote hosts.
@@ -2430,7 +2432,7 @@ example below:
@end lisp
@vindex password-word-equivalents
-This user option is, by default, initialised from
+This user option is, by default, initialized from
@code{password-word-equivalents} when @value{tramp} is loaded, and it
is usually more convenient to add new passphrases to that user option
instead of altering this user option.
@@ -3124,6 +3126,14 @@ auto-saved files to the same directory as the original file.
Alternatively, set the user option @code{tramp-auto-save-directory}
to direct all auto saves to that location.
+@c Since Emacs 29.
+@vindex remote-file-name-inhibit-auto-save-visited
+An alternative to @code{auto-save-mode} is
+@code{auto-save-visited-mode}. In this mode, auto-saving is identical
+to explicit saving. If you want to disable this behavior for remote
+files, set user option
+@code{remote-file-name-inhibit-auto-save-visited} to non-@code{nil}.
+
@vindex lock-file-name-transforms
And still more issues to handle. Since @w{Emacs 28}, file locks use a
similar user option as auto-save files, called
@@ -5614,6 +5624,7 @@ Disable @value{tramp} file name completion:
(customize-set-variable 'ido-enable-tramp-completion nil)
@end lisp
+@c Obsolete since Emacs 29.1.
@item
@file{rlogin.el}
@@ -5672,10 +5683,19 @@ local host's root directory as @file{/ssh:example.com:}.
To unload @value{tramp}, type @kbd{M-x tramp-unload-tramp @key{RET}}.
Unloading @value{tramp} resets Ange FTP plugins also.
@end itemize
+
+
+@item
+What is the difference between Ange FTP and @value{tramp}?
+
+The difference is that Ange FTP uses @command{ftp} to transfer files
+between the local and the remote host, whereas @value{tramp} uses a
+combination of @command{ssh} and @command{scp} or other work-alike
+programs.
@end itemize
-@c For the developer
+@c For the developer.
@node Files directories and localnames
@chapter How file names, directories and localnames are mangled and managed
@@ -5804,15 +5824,15 @@ The verbosity levels are
@*@indent @w{ 4} activities
@*@indent @w{ 5} internal
@*@indent @w{ 6} sent and received strings
-@*@indent @w{ 7} file caching
-@*@indent @w{ 8} connection properties
+@*@indent @w{ 7} connection properties
+@*@indent @w{ 8} file caching
@*@indent @w{ 9} test commands
@*@indent @w{10} traces (huge)
@*@indent @w{11} call traces (maintainer only)
With @code{tramp-verbose} greater than or equal to 4, messages are
also written to a @value{tramp} debug buffer. Such debug buffers are
-essential to bug and problem analyses. For @value{tramp} bug reports,
+essential to bug and problem analyzes. For @value{tramp} bug reports,
set the @code{tramp-verbose} level to 6 (@pxref{Bug Reports}).
The debug buffer is in
diff --git a/etc/DEBUG b/etc/DEBUG
index 7d2f810d078..df289310f9f 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -1036,6 +1036,42 @@ recovering the contents of Emacs buffers from a core dump file. You
might also find those commands useful for displaying the list of
buffers in human-readable format from within the debugger.
+*** Debugging Emacs with LLDB
+
+On systems where GDB is not available, like macOS with M1 chip, you
+can also use LLDB for Emacs debugging.
+
+To start LLDB to debug Emacs, you can simply type "lldb ./emacs RET"
+at the shell prompt in directory of the Emacs executable, usually the
+'src' sub-directory of the Emacs tree).
+
+When you debug Emacs with LLDB, you should start LLDB in the directory
+where the Emacs executable was built. That directory has an .lldbinit
+file that loads a Python module emacs_lldb.py from the 'etc' directory
+of the Emacs source tree. The Python module defines "user-defined"
+commands for debugging Emacs.
+
+LLDB by default does not automatically load .lldbinit files in the
+current directory. The simplest way to fix this is to add the
+following line to your ~/.lldbinit file (creating such a file if it
+doesn't already exist):
+
+ settings set target.load-cwd-lldbinit true
+
+Alternatively, you can type "lldb --local-lldbinit ./emacs RET".
+
+If everything worked, you should see something like "Emacs debugging
+support has been installed" after starting LLDB. You can see which
+Emacs-specific commands are defined with
+
+ (lldb) help
+
+User-defined commands for Emacs debugging start with an "x".
+
+Please refer to the LLDB reference on the web for more information
+about LLDB. If you already know GDB, you will also find a mapping
+from GDB commands to corresponding LLDB commands there.
+
This file is part of GNU Emacs.
diff --git a/etc/NEWS b/etc/NEWS
index d3dd8965267..57845df9792 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -85,7 +85,7 @@ after deleting lisp/leim/ja-dic/ja-dic.el.
+++
** Emacs now supports being built with pure GTK.
-To use this option, make sure the GTK 3 (version 3.20 or later) and
+To use this option, make sure the GTK 3 (version 3.22.23 or later) and
Cairo development files are installed, and configure Emacs with the
option '--with-pgtk'. Unlike the default X and GTK build, the
resulting Emacs binary will work on any underlying window system
@@ -148,8 +148,15 @@ This is run at the end of the Emacs startup process, and is meant to
be used to reinitialize structures that would normally be done at load
time.
+** Native Compilation
+
+---
+*** New command 'native-compile-prune-cache'.
+This command deletes older .eln cache entries (but not the ones for
+the current Emacs version).
+
---
-** New function 'startup-redirect-eln-cache'.
+*** New function 'startup-redirect-eln-cache'.
This function can be called in your init files to change the
user-specific directory where Emacs stores the "*.eln" files produced
by native compilation of Lisp packages Emacs loads. The default
@@ -314,9 +321,32 @@ the major mode according to 'initial-major-mode', like at Emacs
startup. Previously, these functions ignored
'initial-scratch-message' and left "*scratch*" in 'fundamental-mode'.
+---
+** The rlogin.el library and 'rsh' command are now obsolete.
+Use something like 'M-x shell RET ssh <host> RET' instead.
+
* Changes in Emacs 29.1
+---
+** 'longlines-mode' is no longer obsolete.
+
++++
+** New command to change the font size globally.
+To increase the font size, type 'C-x C-M-+' or 'C-x C-M-='; to
+decrease it, type 'C-x C-M--'; to restore the font size, type 'C-x
+C-M-0'. The final key in these commands may be repeated without the
+leading 'C-x' and without the modifiers, e.g. 'C-x C-M-+ C-M-+ C-M-+'
+and 'C-x C-M-+ + +' increase the font size by three steps. When
+mouse-wheel-mode is enabled, 'C-M-wheel-up' and 'C-M-wheel-down' also
+increase and decrease the font size globally. Additionally, the
+variable 'global-text-scale-adjust-resizes-frames' controls whether
+the frames are resized when the font size is changed.
+
++++
+** New function 'file-parent-directory'.
+Get the parent directory of a file.
+
** New config variable 'syntax-wholeline-max' to reduce the cost of long lines.
This variable is used by some operations (mostly syntax-propertization
and font-locking) to treat lines longer than this variable as if they
@@ -424,6 +454,12 @@ These options allow adjusting point and scrolling a window when
dragging items from another program.
+++
+** The X Direct Save (XDS) protocol is now supported.
+This means dropping an image or file link from programs such as
+Firefox will no longer create a temporary file in a random directory,
+instead asking you where to save the file first.
+
++++
** New user option 'record-all-keys'.
If non-nil, this option will force recording of all input keys,
including those typed in response to passwords prompt (this was the
@@ -431,6 +467,11 @@ previous behavior). The default is nil, which inhibits recording of
passwords.
+++
+** New user option 'longlines-break-chars'.
+This is a string containing chars that could be used as break point in
+longlines mode.
+
++++
** New function 'command-query'.
This function makes its argument command prompt the user for
confirmation before executing.
@@ -483,6 +524,12 @@ This inherits from the 'mode-line' face, but is the face actually used
on the mode lines (along with 'mode-line-inactive').
+++
+** New face attribute pseudo-value 'reset'.
+This value stands for the value of the corresponding attribute of the
+'default' face. It can be used to reset attribute values produced by
+inheriting from other faces.
+
++++
** New function 'buffer-text-pixel-size'.
This is similar to 'window-text-pixel-size', but can be used when the
buffer isn't displayed.
@@ -829,7 +876,7 @@ are met. The conditions are given by the argument, which can be
+++
*** New user option 'rcirc-cycle-completion-flag'.
Rcirc will use the default 'completion-at-point' mechanism. The
-conventional IRC behaviour of completing by cycling through the
+conventional IRC behavior of completing by cycling through the
available options can be restored by enabling this option.
** Imenu
@@ -1000,13 +1047,66 @@ supported.
Type 'C-u C-h t' to select it in case your language setup does not do
so automatically.
+---
+*** New default phonetic input method for the Tamil language environment.
+The default input method for the Tamil language environment is now
+"tamil-phonetic" which is a customizable phonetic input method. To
+change the input method's translation rules, customize the user option
+'tamil-translation-rules'.
+
* Changes in Specialized Modes and Packages in Emacs 29.1
+** Dired
+
+---
+*** 'dired-clean-up-buffers-too' moved from dired-x to dired.
+This means that Dired now offers to kill buffers visiting files and
+dirs when they are deleted in Dired. Before, you had to require
+'dired-x' to enable this behavior. To disable this behavior,
+customize the user option 'dired-clean-up-buffers-too' to nil. The
+related user option 'dired-clean-confirm-killing-deleted-buffers'
+(which see) has also been moved to 'dired'.
+
++++
+*** 'dired-do-relsymlink' moved from dired-x to dired.
+The corresponding key "Y" is now bound by default in Dired.
+
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+---
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+Before, that binding was only available if the 'dired-x' package was
+loaded.
+
++++
+*** 'dired-info' and 'dired-man' moved from dired-x to dired.
+The 'dired-info' and 'dired-man' commands have been moved from the
+'dired-x' package to 'dired'. They have also been renamed to
+'dired-do-info' and 'dired-do-man'; the old command names are obsolete
+aliases.
+
+The keys 'I' ('dired-do-info') and 'N' ('dired-do-man') are now bound
+in Dired mode by default. The user options 'dired-bind-man' and
+'dired-bind-info' no longer have any effect and are obsolete.
+
+To get the old behavior back and unbind these keys in Dired mode, add
+the following to your Init file:
+
+(with-eval-after-load 'dired
+ (keymap-set dired-mode-map "N" nil)
+ (keymap-set dired-mode-map "I" nil))
+
+---
+*** New command 'dired-do-eww'.
+This command visits the file on the current line with EWW.
+
** Elisp
*** New command 'elisp-eval-buffer' (bound to 'C-c C-e').
-This command evals the forms in the the current buffer.
+This command evals the forms in the current buffer.
*** New commands 'elisp-byte-compile-file' and 'elisp-byte-compile-buffer'.
These commands (bound to 'C-c C-f' and 'C-c C-b', respectively)
@@ -1121,7 +1221,7 @@ longer available after exiting the recursive edit.
This user option controls whether the 'e' (in a "*Backtrace*"
buffer or while edebugging) and 'C-x C-e' (while edebugging) commands
lead to a (further) backtrace. By default, this variable is nil,
-which is a change in behaviour from previous Emacs versions.
+which is a change in behavior from previous Emacs versions.
+++
*** 'e' in edebug can now take a prefix arg to pretty-print the results.
@@ -1352,7 +1452,7 @@ header before sending a message.
** Texinfo Mode
---
-*** 'texinfo-mode' now has a specialised 'narrow-to-defun' definition.
+*** 'texinfo-mode' now has a specialized 'narrow-to-defun' definition.
It narrows to the current node.
** EUDC
@@ -1616,6 +1716,12 @@ this message for SVG and XPM.
*** New commands: 'image-flip-horizontally' and 'image-flip-vertically'.
These commands horizontally and vertically flip the image under point.
+** Images
+
++++
+*** Users can now add special image conversion functions.
+This is done via 'image-converter-add-handler'.
+
** Image-Dired
+++
@@ -1836,6 +1942,12 @@ related 'auth-sources' entry were wrong.
** Browse URL
---
+*** New user option 'browse-url-default-scheme'.
+This user option decides which URL scheme that 'browse-url' and
+related functions will use by default. For example, you could
+customize this to "https" to always prefer HTTPS URLs.
+
+---
*** Support for the Netscape web browser has been removed.
This support has been obsolete since Emacs 25.1. The final version of
the Netscape web browser was released in February, 2008.
@@ -1845,6 +1957,11 @@ the Netscape web browser was released in February, 2008.
This support has been obsolete since Emacs 25.1. The final version of
the Galeon web browser was released in September, 2008.
+---
+*** Support for the "Mozilla" web browser is now obsolete.
+Note that this historical web browser is different from Mozilla
+Firefox; it is its predecessor.
+
** Ruby Mode
---
@@ -1920,11 +2037,28 @@ Set it to nil to exclude line numbering from kills and copies.
** Miscellaneous
+---
+*** New user option 'webjump-use-internal-browser'.
+When non-nil, WebJump will use an internal browser to open web pages,
+instead of the default external browser.
+
+++
*** New user option 'font-lock-ignore'.
This option provides a mechanism to selectively disable font-lock
keyword-driven fontifications.
+---
+*** New user option 'auto-save-visited-predicate'.
+This user option is a predicate function which is called by
+'auto-save-visited-mode' to decide whether or not to save a buffer.
+You can use it to automatically save only specific buffers, for
+example buffers using a particular mode or in some directory.
+
+---
+*** New user option 'remote-file-name-inhibit-auto-save-visited'.
+If this user option is non-nil, 'auto-save-visited-mode' will not
+auto-save remote buffers. The default is nil.
+
+++
*** New package vtable.el for formatting tabular data.
This package allows formatting data using variable-pitch fonts.
@@ -1955,6 +2089,15 @@ This command prompts for a recently opened file in the minibuffer, and
visits it.
---
+*** 'ffap-machine-at-point' no longer pings hosts by default.
+It will now simply look at a hostname to determine if it is valid,
+instead of also trying to ping it. Customize the user option
+'ffap-machine-p-known' to 'ping' to get the old behavior back.
+
+---
+*** The 'run-dig' command is now obsolete; use 'dig' instead.
+
+---
** The autoarg.el library is now marked obsolete.
This library provides the 'autoarg-mode' and 'autoarg-kp-mode' minor
modes to emulate the behavior of the historical editor Twenex Emacs.
@@ -2151,6 +2294,55 @@ Use 'exif-parse-file' and 'exif-field' instead.
This change is now applied in 'dired-insert-directory'.
---
+** Some functions and variables obsolete since Emacs 24 have been removed:
+'Info-edit-map', 'allout-abbreviate-flattened-numbering',
+'allout-mode-deactivate-hook', 'ansi-color-unfontify-region',
+'auth-source-forget-user-or-password', 'auth-source-hide-passwords',
+'auth-source-user-or-password', 'bibtex-complete',
+'bibtex-entry-field-alist', 'buffer-substring-filters',
+'byte-compile-disable-print-circle', 'cfengine-mode-abbrevs',
+'chart-map', 'comint-dynamic-complete',
+'comint-dynamic-complete-as-filename',
+'comint-dynamic-simple-complete', 'command-history-map',
+'completion-annotate-function', 'condition-case-no-debug',
+'count-lines-region', 'data-debug-map', 'deferred-action-list',
+'deferred-action-function', 'dired-x-submit-report',
+'eieio-defgeneric', 'eieio-defmethod', 'emacs-lock-from-exiting',
+'erc-complete-word', 'eshell-cmpl-suffix-list', 'eshell-for',
+'font-lock-maximum-size', 'gnus-carpal',
+'gnus-debug-exclude-variables', 'gnus-debug-files',
+'gnus-local-domain', 'gnus-outgoing-message-group',
+'gnus-registry-user-format-function-M', 'image-extension-data',
+'image-library-alist', 'inhibit-first-line-modes-regexps',
+'inhibit-first-line-modes-suffixes', 'intdos',
+'mail-complete-function', 'mail-completion-at-point-function',
+'mail-mailer-swallows-blank-line', 'mail-sent-via', 'make-register',
+'makefile-complete', 'menu-bar-kill-ring-save',
+'meta-complete-symbol', 'meta-mode-map',
+'minibuffer-completing-symbol',
+'minibuffer-local-filename-must-match-map', 'mode25', 'mode4350',
+'msb-after-load-hooks', 'nnimap-split-rule', 'ns-alternatives-map',
+'ns-store-cut-buffer-internal', 'package-menu-view-commentary',
+'pascal-last-completions', 'pascal-show-completions',
+'pascal-toggle-completions', 'prolog-char-quote-workaround',
+'read-filename-at-point', 'reftex-index-map',
+'reftex-index-phrases-map', 'reftex-select-bib-map',
+'reftex-select-label-map', 'reftex-toc-map', 'register-name-alist',
+'register-value', 'report-emacs-bug-pretest-address',
+'rmail-default-dont-reply-to-names', 'rmail-dont-reply-to',
+'rmail-dont-reply-to-names', 'rst-block-face', 'rst-comment-face',
+'rst-definition-face', 'rst-directive-face', 'rst-emphasis1-face',
+'rst-emphasis2-face', 'rst-external-face', 'rst-literal-face',
+'rst-reference-face', 'semantic-grammar-map',
+'semantic-grammar-syntax-table', 'set-register-value',
+'speedbar-key-map', 'speedbar-syntax-table',
+'starttls-any-program-available', 'strokes-report-bug',
+'toggle-emacs-lock', 'tooltip-use-echo-area', 'turn-on-cwarn-mode',
+'turn-on-iimage-mode', 'vc-toggle-read-only', 'view-return-to-alist',
+'view-return-to-alist-update', 'w32-default-color-map' (function),
+'which-func-mode' (function), 'x-cut-buffer-or-selection-value'.
+
+---
** Some functions and variables obsolete since Emacs 23 have been removed:
'find-emacs-lisp-shadows', 'newsticker-cache-filename',
'unify-8859-on-decoding-mode', 'unify-8859-on-encoding-mode',
@@ -2190,6 +2382,18 @@ patcomp.el, pc-mode.el, pc-select.el, s-region.el, and sregex.el.
* Lisp Changes in Emacs 29.1
+++
+** New arguments MESSAGE and TIMEOUT of 'set-transient-map'.
+MESSAGE specifies a message to display after activating the transient
+map, including a special formatting spec to list available keys.
+TIMEOUT is the idle time after which to deactivate the transient map.
+The default timeout value can be defined by the new variable
+'set-transient-map-timeout'.
+
++++
+** New function 'seq-split'.
+This returns a list of sub-sequences of the specified sequence.
+
++++
** 'plist-get', 'plist-put' and 'plist-member' are no longer limited to 'eq'.
These function now take an optional comparison predicate argument.
@@ -2197,7 +2401,7 @@ These function now take an optional comparison predicate argument.
** 'read-multiple-choice' can now use long-form answers.
+++
-** 'read-regexp' now allows the user to indicate whether to use case folding.
+** 'M-c' in 'read-regexp' now toggles case folding.
+++
** 'completing-read' now allows a function as its REQUIRE-MATCH argument.
@@ -2258,6 +2462,20 @@ be kept aligned with the buffer contents when the user switches
'display-line-numbers-mode' on or off.
+++
+** New minor mode 'lost-selection-mode'.
+This minor mode makes Emacs deactivate the mark in all buffers when
+the primary selection is obtained by another program.
+
+---
+** On X, Emacs will try to preserve selection ownership when a frame is deleted.
+This means that if you make Emacs the owner of a selection, such as by
+selecting some text into the clipboard or primary selection, and then
+delete the current frame, you will still be able to insert the
+contents of that selection into other programs as long as another
+frame is open on the same display. This behavior can be disabled by
+setting the variable 'x-auto-preserve-selections' to nil.
+
++++
** New predicate 'char-uppercase-p'.
This returns non-nil if its argument its an uppercase character.
@@ -2478,6 +2696,10 @@ them towards or away from each other.
This hook is run before 'x-popup-menu' is about to display a
deck-of-cards menu on screen.
+** New hook 'post-select-region-hook'.
+This hook is run immediately after 'select-active-regions' causes the
+region to be set as the primary selection.
+
** New function 'buffer-match-p'.
Check if a buffer satisfies some condition. Some examples for
conditions can be regular expressions that match a buffer name, a
diff --git a/etc/NEWS.28 b/etc/NEWS.28
index 7409e428de9..5b8a431ec83 100644
--- a/etc/NEWS.28
+++ b/etc/NEWS.28
@@ -1449,7 +1449,7 @@ the entire buffer.
*** 'so-long-target-modes' now includes 'fundamental-mode' by default.
This means that 'global-so-long-mode' will also process files which were
-not recognised. (This only has an effect if 'set-auto-mode' chooses
+not recognized. (This only has an effect if 'set-auto-mode' chooses
'fundamental-mode'; buffers which are simply in 'fundamental-mode' by
default are unaffected.)
@@ -1763,8 +1763,8 @@ If non-nil (the default), create registry entries for all messages.
If nil, don't automatically create entries, they must be created
manually.
-*** New user options to customise the summary line specs "%[" and "%]".
-Four new options introduced in customisation group
+*** New user options to customize the summary line specs "%[" and "%]".
+Four new options introduced in customization group
'gnus-summary-format'. These are 'gnus-sum-opening-bracket',
'gnus-sum-closing-bracket', 'gnus-sum-opening-bracket-adopted', and
'gnus-sum-closing-bracket-adopted'. Their default values are "[", "]",
@@ -2102,7 +2102,7 @@ modified flag. The default is nil, to preserve the old behavior.
** CC mode
*** Added support for Doxygen documentation style.
-'doxygen' is now a valid 'c-doc-comment-style' which recognises all
+'doxygen' is now a valid 'c-doc-comment-style' which recognizes all
comment styles supported by Doxygen (namely '///', '//!', '/** … */'
and '/*! … */'. 'gtkdoc' remains the default for C and C++ modes; to
use 'doxygen' by default one might evaluate:
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 37a39131d93..3c164b1282f 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -293,7 +293,7 @@ with width equal to the pixel-width of the buffer text multiplied by 0.7.
This functionality is implemented in a new function,
~org-display-inline-image--width~ which contains the width
determination logic previously in ~org-display-inline-images~ and the
-new behaviour.
+new behavior.
** New options
*** Option ~org-hidden-keywords~ now also applies to #+SUBTITLE:
@@ -311,7 +311,7 @@ descriptions.
*** New option ~org-id-ts-format~
Earlier, IDs generated using =ts= method had a hard-coded format (i.e. =20200923T160237.891616=).
-The new option allows user to customise the format.
+The new option allows user to customize the format.
Defaults are unchanged.
*** New argument for ~file-desc~ babel header
@@ -503,16 +503,16 @@ heading, except return nil.
*** Faces of all the heading text elements now conform to the headline face
-In the past, faces of todo keywords, emphasised text, tags, and
+In the past, faces of todo keywords, emphasized text, tags, and
priority cookies inherited =default= face. The resulting headline
fontification was not always consistent, as discussed in [[msg::87h7sawubl.fsf@protesilaos.com][this bug
report]]. Now, the relevant faces adapt to face used to fontify the
current headline level.
-Users who prefer to keep the old behaviour should change their face
-customisation explicitly stating that =default= face is inherited.
+Users who prefer to keep the old behavior should change their face
+customization explicitly stating that =default= face is inherited.
-Example of old face customisation:
+Example of old face customization:
#+begin_src emacs-lisp
(setq org-todo-keyword-faces '(("TODO"
@@ -520,7 +520,7 @@ Example of old face customisation:
:height 0.75)))
#+end_src
-To preserve the old behaviour the above customisation should be
+To preserve the old behavior the above customization should be
changed to
#+begin_src emacs-lisp
@@ -543,7 +543,7 @@ The function does not allow for a third optional parameter anymore.
*** LaTeX environment =#+results= are now removed
If a babel src block produces a raw LaTeX environment, it will now be
-recognised as a result, and so replaced when re-evaluated.
+recognized as a result, and so replaced when re-evaluated.
*** Tag completion now uses =completing-read-multiple=
@@ -681,7 +681,7 @@ enabled, and point is neither in a table nor on a timestamp or a link:
- =C-j= (bound to the new command ~org-return-and-maybe-indent~)
merely inserts a newline.
-To get the previous behaviour back, disable ~electric-indent-mode~
+To get the previous behavior back, disable ~electric-indent-mode~
explicitly:
#+begin_src emacs-lisp
@@ -1029,7 +1029,7 @@ Previously all session names had ~org-babel-session-~ prepended.
*** Forward/backward paragraph functions in line with the rest of Emacs
~org-forward-paragraph~ and ~org-backward-paragraph~, bound to
-~<C-UP>~ and ~<C-DOWN>~ functions mimic more closely behaviour of
+~<C-UP>~ and ~<C-DOWN>~ functions mimic more closely behavior of
~forward-paragraph~ and ~backward-paragraph~ functions when
available.
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 14c1df25b16..924e1effa71 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -729,6 +729,53 @@ time. Possible reasons for this include:
To work around the problem, you could use Git or some other
free-software program, instead of ClearCase.
+*** Various commands that visit files on networked filesystems fail.
+
+This could happen if the filesystem of those files is mounted in a way
+that causes the files to be accessed via a symlink. One such example
+is the 'amd' automounter, which unmounts the filesystem after some
+period of lack of use. Another example is Emacs running on MS-Windows
+that accesses files on remote server via symlinks whose target is a
+UNC of the form '\\server\share'.
+
+The reason for these problems is that some Emacs commands visit files
+via their truename, resolving the symlink, which causes these files'
+default-directory to also have the symlink resolved. If the resolved
+directory has access problems, subsequent commands from that file's
+buffer could fail. For example, the stock MS-Windows shell 'cmd.exe'
+is unable to use a UNC-form directory as the current directory, so
+'shell-command' and its callers will typically fail. Similarly with
+using targets of symlinks which no longer mount the remote filesystem
+will fail.
+
+You can solve these problems in several ways:
+
+ - Write a 'find-file'hook' function which will change the value of
+ 'default-directory' to reference the symlink instead of its
+ target.
+
+ - Set up 'directory-abbrev-alist' to automatically convert the
+ 'default-directory' of such files in the same manner.
+
+ - On MS-Windows, map a drive letter to the '\\server\share'
+ directory and point your symlinks to a directory name that uses
+ the drive letter.
+
+*** On MS-Windows, visiting files in OneDrive fails.
+
+This is known to happen when OneDrive is accessed via the so-called
+"metered connections", whose use is charged by the volume of
+transferred data. Those are typically wireless links using a modem or
+a mobile phone. In these cases, files that are left in the cloud and
+not downloaded to the local computer can produce various failures in
+system calls that access the files or their meta-data.
+
+The solution is to disable the "metered connection" status from the
+WiFi properties (reachable from the Windows Settings menu). This will
+cause files to be downloaded to the local computer when they are
+accessed (which could take some time, and Emacs functions accessing
+the file will wait for that), avoiding the errors.
+
*** ps-print commands fail to find prologue files ps-prin*.ps.
This can happen if you use an old version of X-Symbol package: it
@@ -2970,6 +3017,72 @@ please call support for your X-server and see if you can get a fix.
If you do, please send it to bug-gnu-emacs@gnu.org so we can list it here.
+* Runtime problems specific to Cygwin
+
+** Fork failures in a build with native compilation
+
+To prevent fork failures, shared libraries on Cygwin need to be
+rebased occasionally, for the reasons explained here:
+
+ https://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-process-problems
+
+This includes the .eln files produced by an Emacs built with native
+compilation.
+
+Rebasing is handled by Cygwin's autorebase postinstall script every
+time you run the Cygwin setup program (which you should do with no
+Cygwin processes running). This script knows about the .eln files
+installed in the standard places (e.g.,
+/usr/lib/emacs/28.1/native-lisp), but it does not know about those in
+your user cache (e.g., /home/<username>/.emacs.d/eln-cache). In order
+for these to be automatically rebased, you must create a file
+
+ /var/lib/rebase/userpath.d/<username>
+
+with one line for each directory containing .eln files. If you are
+running an installed Emacs, it should suffice to list your cache
+directory. For example, if there is an Emacs user "kbrown", then
+there should be a file
+
+ /var/lib/rebase/userpath.d/kbrown
+
+containing the single line
+
+ /home/kbrown/.emacs.d/eln-cache
+
+If you are running an Emacs that you have built but not installed,
+then you will need an additional line giving the path to the
+native-lisp subdirectory of your build directory.
+
+If more than one user will be using Emacs on your system, there should
+be a file like this for each user.
+
+Rebasing is not currently done when new .eln files are created, so
+fork failures are still possible between runs of Cygwin's setup
+program. If you ever see a fork failure whose error message refers to
+a .eln file, you should be able to fix it temporarily by exiting emacs
+and issuing the command
+
+ find ~/.emacs.d/eln-cache -name '*.eln' | rebase -O -T -
+
+This is called an "ephemeral" rebase. Again, if you are running an
+Emacs that has not been installed, you need to add the native-lisp
+subdirectory of your build directory to this command. Alternatively,
+stop all Cygwin processes and run Cygwin's setup program to let the
+autorebase postinstall script run.
+
+It is hoped that the measures above will make native compilation
+usable on 64-bit Cygwin, with only an occasional minor annoyance. In
+the 32-bit case, however, the limited address space makes frequent
+fork failures extremely likely. It is therefore strongly recommended
+that you not build Emacs with native compilation on 32-bit Cygwin.
+Indeed, the configure script will not allow this unless you use the
+--with-cygwin32-native-compilation option.
+
+See bug#50666 (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50666)
+for further discussion.
+
+
* Runtime problems specific to macOS
** Error message when opening Emacs on macOS
diff --git a/etc/TODO b/etc/TODO
index 7ab913f779a..5c55a8b9992 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -722,8 +722,6 @@ bar. In the mean time, it should process other messages.
** Get some major packages installed
-*** W3 (development version needs significant work)
-
*** PSGML, _possibly_ ECB
https://lists.gnu.org/r/emacs-devel/2007-05/msg01493.html Check the
assignments file for other packages which might go in and have been
diff --git a/etc/compilation.txt b/etc/compilation.txt
index 5601ce272aa..fc254dd3d77 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -193,6 +193,15 @@ symbol: gradle-kotlin
e: /src/Test.kt: (34, 15): foo: bar
w: /src/Test.kt: (34, 15): foo: bar
+* Gradle Android resource linking
+
+symbol: gradle-android
+
+Execution failed for task ':app:processDebugResources'.
+> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
+ > Android resource linking failed
+ ERROR:/Users/salutis/src/AndroidSchemeExperiment/app/build/intermediates/incremental/debug/mergeDebugResources/stripped.dir/layout/item.xml:3: AAPT: error: '16dpw' is incompatible with attribute padding (attr) dimension.
+
* IAR Systems C Compiler
@@ -424,7 +433,7 @@ symbol: oracle
This stupid precompiler wraps lines at column 80 in the middle of a file name.
There is no obvious way of detecting this or turning it off. But if you
-delete the newline (probably needs M-x toggle-read-only), the file name will
+delete the newline (probably needs M-x read-only-mode), the file name will
automatically be reparsed, so that you can then go there.
Semantic error at line 528, column 5, file erosacqdb.pc:
@@ -542,7 +551,7 @@ cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3
* ShellCheck
In autogen.sh line 38:
-autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.ac`
+autoconf_min=`sed -n 's/^ *AC_PREREQ(\[\([0-9\.]*\)]).*/\1/p' configure.ac`
^----------^ SC2034: autoconf_min appears unused. Verify use (or export if used externally).
^-- SC2006: Use $(...) notation instead of legacy backticked `...`.
diff --git a/etc/emacs_lldb.py b/etc/emacs_lldb.py
new file mode 100644
index 00000000000..b8530915f81
--- /dev/null
+++ b/etc/emacs_lldb.py
@@ -0,0 +1,238 @@
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of GNU Emacs.
+#
+# GNU Emacs is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+# Load this module in LLDB with
+#
+# (lldb) command script import emacs_lldb
+#
+# Available commands start with 'x' and can be seen with
+#
+# (lldb) help
+
+import lldb
+
+
+########################################################################
+# Utilities
+########################################################################
+
+# Return the name of enumerator ENUM as a string.
+def enumerator_name(enum):
+ enumerators = enum.GetType().GetEnumMembers()
+ return enumerators[enum.GetValueAsUnsigned()].GetName()
+
+# A class wrapping an SBValue for a Lisp_Object, providing convenience
+# functions.
+class Lisp_Object:
+ # Map pvec_type enumerators to corresponding C types.
+ pvec2type = {
+ "PVEC_FRAME": "struct frame",
+ "PVEC_WINDOW": "struct window",
+ "PVEC_BIGNUM": "struct Lisp_Bignum",
+ "PVEC_MARKER": "struct Lisp_Marker",
+ "PVEC_OVERLAY": "struct Lisp_Overlay",
+ "PVEC_FINALIZER": "struct Lisp_Finalizer",
+ "PVEC_SYMBOL_WITH_POS": "struct Lisp_Symbol_With_Pos",
+ "PVEC_MISC_PTR": "",
+ "PVEC_USER_PTR": "struct Lisp_User_Ptr",
+ "PVEC_PROCESS": "struct Lisp_Process",
+ "PVEC_BOOL_VECTOR": "struct Lisp_Bool_Vector",
+ "PVEC_BUFFER": "struct buffer",
+ "PVEC_HASH_TABLE": "struct Lisp_Hash_Table",
+ "PVEC_TERMINAL": "struct terminal",
+ "PVEC_WINDOW_CONFIGURATION": "struct save_window_data",
+ "PVEC_SUBR": "struct Lisp_Subr",
+ "PVEC_OTHER": "void",
+ "PVEC_XWIDGET": "void",
+ "PVEC_XWIDGET_VIEW": "void",
+ "PVEC_THREAD": "struct thread_state",
+ "PVEC_MUTEX": "Lisp_Mutex",
+ "PVEC_CONDVAR": "Lisp_CondVar",
+ "PVEC_MODULE_FUNCTION": "struct Lisp_Module_Function",
+ "PVEC_NATIVE_COMP_UNIT": "struct Lisp_Native_Comp_Unit",
+ "PVEC_SQLITE": "struct Lisp_Sqlite",
+ "PVEC_COMPILED": "struct Lisp_Vector",
+ "PVEC_CHAR_TABLE": "struct Lisp_Vector",
+ "PVEC_SUB_CHAR_TABLE": "void",
+ "PVEC_RECORD": "struct Lisp_Vector",
+ "PVEC_FONT": "struct font",
+ "PVEC_NORMAL_VECTOR": "struct Lisp_Vector"
+ }
+
+ # Object construction/initialization.
+ def __init__(self, lisp_obj):
+ self.frame = lisp_obj.GetFrame()
+ self.lisp_obj = lisp_obj
+ self.unsigned = lisp_obj.GetValueAsUnsigned()
+ self.lisp_type = None
+ self.pvec_type = None
+ self.value = None
+ self.init_lisp_types()
+ self.init_values()
+
+ # Initialize self.lisp_type to the C Lisp_Type enumerator of the
+ # Lisp_Object, as a string. Initialize self.pvec_type likewise to
+ # the pvec_type enumerator if the object is a vector-like, as a
+ # string.
+ def init_lisp_types(self):
+ t = self.eval(f"(enum Lisp_Type)"
+ f"((EMACS_INT) {self.unsigned} "
+ f"& (1 << GCTYPEBITS) - 1)")
+ self.lisp_type = enumerator_name(t)
+ if self.lisp_type == "Lisp_Vectorlike":
+ self.pvec_type = "PVEC_NORMAL_VECTOR"
+ vector = self.get_lisp_pointer("struct Lisp_Vector")
+ size = vector.GetValueForExpressionPath("->header.size")
+ size = size.GetValueAsUnsigned()
+ pseudo = self.eval(f"{size} & PSEUDOVECTOR_FLAG")
+ if pseudo.GetValueAsUnsigned() != 0:
+ typ = self.eval(
+ f"(enum pvec_type) (({size} "
+ f"& More_Lisp_Bits::PVEC_TYPE_MASK) "
+ f">> More_Lisp_Bits::PSEUDOVECTOR_AREA_BITS)")
+ self.pvec_type = enumerator_name(typ)
+
+ # Initialize self.value according to lisp_type and pvec_type.
+ def init_values(self):
+ if self.lisp_type == "Lisp_Symbol":
+ offset = self.get_lisp_pointer("char").GetValueAsUnsigned()
+ self.value = self.eval(f"(struct Lisp_Symbol *)"
+ f" ((char *) &lispsym + {offset})")
+ elif self.lisp_type == "Lisp_String":
+ self.value = self.get_lisp_pointer("struct Lisp_String")
+ elif self.lisp_type == "Lisp_Vectorlike":
+ c_type = Lisp_Object.pvec2type[self.pvec_type]
+ self.value = self.get_lisp_pointer(c_type)
+ elif self.lisp_type == "Lisp_Cons":
+ self.value = self.get_lisp_pointer("struct Lisp_Cons")
+ elif self.lisp_type == "Lisp_Float":
+ self.value = self.get_lisp_pointer("struct Lisp_Float")
+ elif self.lisp_type in ("Lisp_Int0", "Lisp_Int1"):
+ self.value = self.eval(f"((EMACS_INT) {self.unsigned}) "
+ f">> (GCTYPEBITS - 1)")
+ else:
+ assert False, "Unknown Lisp type"
+
+ # Create an SBValue for EXPR with name NAME.
+ def create_value(self, name, expr):
+ return self.lisp_obj.CreateValueFromExpression(name, expr)
+
+ # Evaluate EXPR in the context of the current frame.
+ def eval(self, expr):
+ return self.frame.EvaluateExpression(expr)
+
+ # Return an SBValue for this object denoting a pointer of type
+ # TYP*.
+ def get_lisp_pointer(self, typ):
+ return self.eval(f"({typ}*) (((EMACS_INT) "
+ f"{self.unsigned}) & VALMASK)")
+
+ # If this is a Lisp_String, return an SBValue for its string data.
+ # Return None otherwise.
+ def get_string_data(self):
+ if self.lisp_type == "Lisp_String":
+ return self.value.GetValueForExpressionPath("->u.s.data")
+ return None
+
+ # if this is a Lisp_Symbol, return an SBBalue for its name.
+ # Return None otherwise.
+ def get_symbol_name(self):
+ if self.lisp_type == "Lisp_Symbol":
+ name = self.value.GetValueForExpressionPath("->u.s.name")
+ return Lisp_Object(name).get_string_data()
+ return None
+
+ # Return a summary string for this object.
+ def summary(self):
+ return str(self.value)
+
+
+########################################################################
+# LLDB Commands
+########################################################################
+
+def xbacktrace(debugger, command, ctx, result, internal_dict):
+ """Print Emacs Lisp backtrace"""
+ frame = ctx.GetFrame()
+ n = frame.EvaluateExpression(
+ "current_thread->m_specpdl_ptr - current_thread->m_specpdl")
+ for i in reversed(range(0, n.GetValueAsUnsigned())):
+ s = frame.EvaluateExpression(f"current_thread->m_specpdl[{i}]")
+ kind = enumerator_name(s.GetChildMemberWithName("kind"))
+ if kind == "SPECPDL_BACKTRACE":
+ function = Lisp_Object(s.GetValueForExpressionPath(".bt.function"))
+ if function.lisp_type == "Lisp_Symbol":
+ sym_name = function.get_symbol_name()
+ result.AppendMessage(str(sym_name))
+ elif function.lisp_type == "Lisp_Vectorlike":
+ result.AppendMessage(function.pvec_type)
+ else:
+ result.AppendMessage(function.lisp_type)
+
+def xdebug_print(debugger, command, result, internal_dict):
+ """Print Lisp_Objects using safe_debug_print()"""
+ debugger.HandleCommand(f"expr safe_debug_print({command})")
+
+
+########################################################################
+# Formatters
+########################################################################
+
+def type_summary_Lisp_Object(obj, internal_dict):
+ return "-> " + Lisp_Object(obj).summary()
+
+
+########################################################################
+# Initialization
+########################################################################
+
+# Define Python FUNCTION as an LLDB command.
+def define_command (debugger, function):
+ lldb_command = function.__name__
+ python_function = __name__ + "." + function.__name__
+ interpreter = debugger.GetCommandInterpreter()
+ def define(overwrite):
+ res = lldb.SBCommandReturnObject()
+ interpreter.HandleCommand(f"command script add "
+ f"{overwrite} "
+ f"--function {python_function} "
+ f"{lldb_command}",
+ res)
+ return res.Succeeded()
+ if not define("--overwrite"):
+ define("")
+
+# Define Python FUNCTION as an LLDB type summary provider for types
+# matching REGEX. Type summaries defined here are defined in the
+# category Emacs, and can be seen with 'type summary list -w Emacs',
+# and deleted in a similar way.
+def define_type_summary(debugger, regex, function):
+ python_function = __name__ + "." + function.__name__
+ debugger.HandleCommand(f"type summary add "
+ f"--cascade true "
+ f"--category Emacs "
+ f'--regex "{regex}" '
+ f"--python-function {python_function}")
+
+# This function is called by LLDB to initialize the module.
+def __lldb_init_module(debugger, internal_dict):
+ define_command(debugger, xbacktrace)
+ define_command(debugger, xdebug_print)
+ define_type_summary(debugger, "Lisp_Object", type_summary_Lisp_Object)
+ print('Emacs debugging support has been installed.')
+
+# end.
diff --git a/etc/images/README b/etc/images/README
index 72da92427b4..858f33e40ba 100644
--- a/etc/images/README
+++ b/etc/images/README
@@ -112,7 +112,7 @@ GNOME project). They are not part of Emacs, but are distributed and
used by Emacs. They are licensed under either the GNU LGPL v3 or the
Creative Commons Attribution-Share Alike 3.0 United States License.
-To view a copy of the CC-BY-SA licence, visit
+To view a copy of the CC-BY-SA license, visit
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.
diff --git a/etc/publicsuffix.txt b/etc/publicsuffix.txt
index f52169116ec..18cb313a321 100644
--- a/etc/publicsuffix.txt
+++ b/etc/publicsuffix.txt
@@ -1340,7 +1340,7 @@ tt.im
tv.im
// in : https://en.wikipedia.org/wiki/.in
-// see also: https://registry.in/Policies
+// see also: https://registry.in/policies
// Please note, that nic.in is not an official eTLD, but used by most
// government institutions.
in
@@ -7130,7 +7130,7 @@ org.zw
// newGTLDs
-// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2022-05-18T15:16:02Z
+// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2022-06-14T15:15:19Z
// This list is auto-generated, don't edit it manually.
// aaa : 2015-02-26 American Automobile Association, Inc.
aaa
@@ -7687,7 +7687,7 @@ chanel
// channel : 2014-05-08 Charleston Road Registry Inc.
channel
-// charity : 2018-04-11 Binky Moon, LLC
+// charity : 2018-04-11 Public Interest Registry
charity
// chase : 2015-04-30 JPMorgan Chase Bank, National Association
@@ -7834,7 +7834,7 @@ coupon
// coupons : 2015-03-26 Binky Moon, LLC
coupons
-// courses : 2014-12-04 OPEN UNIVERSITIES AUSTRALIA PTY LTD
+// courses : 2014-12-04 Registry Services, LLC
courses
// cpa : 2019-06-10 American Institute of Certified Public Accountants
@@ -8227,7 +8227,7 @@ forsale
// forum : 2015-04-02 Fegistry, LLC
forum
-// foundation : 2013-12-05 Binky Moon, LLC
+// foundation : 2013-12-05 Public Interest Registry
foundation
// fox : 2015-09-11 FOX Registry, LLC
@@ -8326,7 +8326,7 @@ gift
// gifts : 2014-07-03 Binky Moon, LLC
gifts
-// gives : 2014-03-06 Dog Beach, LLC
+// gives : 2014-03-06 Public Interest Registry
gives
// giving : 2014-11-13 Giving Limited
@@ -8452,7 +8452,7 @@ health
// healthcare : 2014-06-12 Binky Moon, LLC
healthcare
-// help : 2014-06-26 UNR Corp.
+// help : 2014-06-26 Innovation service Limited
help
// helsinki : 2015-02-05 City of Helsinki
@@ -8866,7 +8866,7 @@ living
// llc : 2017-12-14 Afilias Limited
llc
-// llp : 2019-08-26 UNR Corp.
+// llp : 2019-08-26 Intercap Registry Inc.
llp
// loan : 2014-11-20 dot Loan Limited
@@ -9841,7 +9841,7 @@ stream
// studio : 2015-02-11 Dog Beach, LLC
studio
-// study : 2014-12-11 OPEN UNIVERSITIES AUSTRALIA PTY LTD
+// study : 2014-12-11 Registry Services, LLC
study
// style : 2014-12-04 Binky Moon, LLC
@@ -12111,6 +12111,7 @@ kill.jp
kilo.jp
kuron.jp
littlestar.jp
+lolipopmc.jp
lolitapunk.jp
lomo.jp
lovepop.jp
@@ -12378,6 +12379,11 @@ moonscale.net
// Submitted by Hannu Aronsson <haa@iki.fi>
iki.fi
+// iliad italia: https://www.iliad.it
+// Submitted by Marios Makassikis <mmakassikis@freebox.fr>
+ibxos.it
+iliadboxos.it
+
// Impertrix Solutions : <https://impertrixcdn.com>
// Submitted by Zhixiang Zhao <csuite@impertrix.com>
impertrixcdn.com
@@ -12458,9 +12464,11 @@ iopsys.se
// Submitted by Matthew Hardeman <mhardeman@ipifony.com>
ipifony.net
-// IServ GmbH : https://iserv.eu
-// Submitted by Kim-Alexander Brodowski <info@iserv.eu>
+// IServ GmbH : https://iserv.de
+// Submitted by Mario Hoberg <info@iserv.de>
+iservschule.de
mein-iserv.de
+schulplattform.de
schulserver.de
test-iserv.de
iserv.dev
@@ -12782,6 +12790,10 @@ hra.health
miniserver.com
memset.net
+// Messerli Informatik AG : https://www.messerli.ch/
+// Submitted by Ruben Schmidmeister <psl-maintainers@messerli.ch>
+messerli.app
+
// MetaCentrum, CESNET z.s.p.o. : https://www.metacentrum.cz/en/
// Submitted by Zdeněk Šustr <zdenek.sustr@cesnet.cz>
*.cloud.metacentrum.cz
@@ -13394,9 +13406,9 @@ rocky.page
// Salesforce.com, Inc. https://salesforce.com/
// Submitted by Michael Biven <mbiven@salesforce.com>
-builder.code.com
-dev-builder.code.com
-stg-builder.code.com
+*.builder.code.com
+*.dev-builder.code.com
+*.stg-builder.code.com
// Sandstorm Development Group, Inc. : https://sandcats.io/
// Submitted by Asheesh Laroia <asheesh@sandstorm.io>
diff --git a/etc/srecode/ede-autoconf.srt b/etc/srecode/ede-autoconf.srt
index 19dc14202de..ecca7afd007 100644
--- a/etc/srecode/ede-autoconf.srt
+++ b/etc/srecode/ede-autoconf.srt
@@ -44,10 +44,10 @@ template ede-empty :project
AC_INIT({{PROJECT_NAME}}, {{PROJECT_VERSION}})
AM_INIT_AUTOMAKE([{{PROGRAM}}], 0)
-AM_CONFIG_HEADER(config.h)
+AM_CONFIG_HEADER([config.h])
{{comment_prefix}} End the configure script.
-AC_OUTPUT(Makefile, [date > stamp-h] )
+AC_OUTPUT([Makefile], [date > stamp-h] )
----
diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el
index 3fbb9d6c995..0e162c8bab9 100644
--- a/etc/themes/leuven-dark-theme.el
+++ b/etc/themes/leuven-dark-theme.el
@@ -792,7 +792,7 @@ more...")
`(org-example ((,class (:foreground "#ffff0b" :background "#38203d"))))
`(org-footnote ((,class (:underline t :foreground "#ff7138"))))
`(org-formula ((,class (:foreground "#0680e1"))))
- ;; org-habit colours are thanks to zenburn
+ ;; org-habit colors are thanks to zenburn
`(org-habit-ready-face ((t :background "#7F9F7F"))) ; ,zenburn-green
`(org-habit-alert-face ((t :background "#E0CF9F" :foreground "#3F3F3F"))) ; ,zenburn-yellow-1 fg ,zenburn-bg
`(org-habit-clear-face ((t :background "#5C888B"))) ; ,zenburn-blue-3
diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el
index c7d2d3fee5d..af5576386c6 100644
--- a/etc/themes/manoj-dark-theme.el
+++ b/etc/themes/manoj-dark-theme.el
@@ -380,7 +380,7 @@ jarring angry fruit salad look to reduce eye fatigue.")
:foreground "black" :background "grey"
:weight bold ))))
'(calendar-today-face ((t (:underline t :bold t :foreground "cornsilk"))))
- '(change-log-acknowledgement-face ((t (:italic t :slant oblique :foreground "AntiqueWhite3"))))
+ '(change-log-acknowledgment ((t (:italic t :slant oblique :foreground "AntiqueWhite3"))))
'(change-log-conditionals-face ((t (:foreground "Aquamarine"))))
'(change-log-date-face ((t (:italic t :slant oblique :foreground "BurlyWood"))))
'(change-log-email-face ((t (:foreground "Aquamarine"))))
diff --git a/etc/tutorials/TUTORIAL.nl b/etc/tutorials/TUTORIAL.nl
index 2ec3fac11bd..7aaed218ff6 100644
--- a/etc/tutorials/TUTORIAL.nl
+++ b/etc/tutorials/TUTORIAL.nl
@@ -1158,7 +1158,7 @@ overeenkomende commandonaam zoals find-file.
--------------------
Je kunt meer over Emacs leren door haar handleiding te lezen. Deze is
-zowel als boek als in in Emacs beschikbaar (gebruik het Help menu of
+zowel als boek als in Emacs beschikbaar (gebruik het Help menu of
tik C-h r). Kijk bijvoorbeeld eens naar "completion", wat minder
tikwerk oplevert, of "dired" wat het omgaan met bestanden
vereenvoudigt.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 9a60714ecab..ef112579264 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -1431,6 +1431,16 @@ main (int argc, char **argv)
setenv ("LC_COLLATE", "C", 1);
setenv ("LC_ALL", "C", 1); */
char *cmd = xmalloc (8 * strlen (tagfile) + sizeof "sort -u -o '' ''");
+#if defined WINDOWSNT || defined MSDOS
+ /* Quote "like this". No need to escape the quotes in the file name,
+ since it is not allowed in file names on these systems. */
+ char *z = stpcpy (cmd, "sort -u -o \"");
+ z = stpcpy (z, tagfile);
+ z = stpcpy (z, "\" \"");
+ z = stpcpy (z, tagfile);
+ stpcpy (z, "\"");
+#else
+ /* Quote 'like this', and escape the apostrophe in the file name. */
char *z = stpcpy (cmd, "sort -u -o '");
char *escaped_tagfile = z;
for (; *tagfile; *z++ = *tagfile++)
@@ -1440,6 +1450,7 @@ main (int argc, char **argv)
z = stpcpy (z, "' '");
z = mempcpy (z, escaped_tagfile, escaped_tagfile_len);
strcpy (z, "'");
+#endif
return system (cmd);
}
return EXIT_SUCCESS;
diff --git a/lib/fchmodat.c b/lib/fchmodat.c
index dc535833660..164e2c4a95f 100644
--- a/lib/fchmodat.c
+++ b/lib/fchmodat.c
@@ -83,9 +83,10 @@ fchmodat (int dir, char const *file, mode_t mode, int flags)
# if NEED_FCHMODAT_NONSYMLINK_FIX
if (flags == AT_SYMLINK_NOFOLLOW)
{
- struct stat st;
+# if HAVE_READLINKAT
+ char readlink_buf[1];
-# if defined O_PATH && defined AT_EMPTY_PATH
+# ifdef O_PATH
/* Open a file descriptor with O_NOFOLLOW, to make sure we don't
follow symbolic links, if /proc is mounted. O_PATH is used to
avoid a failure if the file is not readable.
@@ -94,49 +95,29 @@ fchmodat (int dir, char const *file, mode_t mode, int flags)
if (fd < 0)
return fd;
- /* Up to Linux 5.3 at least, when FILE refers to a symbolic link, the
- chmod call below will change the permissions of the symbolic link
- - which is undesired - and on many file systems (ext4, btrfs, jfs,
- xfs, ..., but not reiserfs) fail with error EOPNOTSUPP - which is
- misleading. Therefore test for a symbolic link explicitly.
- Use fstatat because fstat does not work on O_PATH descriptors
- before Linux 3.6. */
- if (fstatat (fd, "", &st, AT_EMPTY_PATH) != 0)
+ int err;
+ if (0 <= readlinkat (fd, "", readlink_buf, sizeof readlink_buf))
+ err = EOPNOTSUPP;
+ else if (errno == EINVAL)
{
- int stat_errno = errno;
- close (fd);
- errno = stat_errno;
- return -1;
- }
- if (S_ISLNK (st.st_mode))
- {
- close (fd);
- errno = EOPNOTSUPP;
- return -1;
+ static char const fmt[] = "/proc/self/fd/%d";
+ char buf[sizeof fmt - sizeof "%d" + INT_BUFSIZE_BOUND (int)];
+ sprintf (buf, fmt, fd);
+ err = chmod (buf, mode) == 0 ? 0 : errno == ENOENT ? -1 : errno;
}
+ else
+ err = errno == ENOENT ? -1 : errno;
-# if defined __linux__ || defined __ANDROID__ || defined __CYGWIN__
- static char const fmt[] = "/proc/self/fd/%d";
- char buf[sizeof fmt - sizeof "%d" + INT_BUFSIZE_BOUND (int)];
- sprintf (buf, fmt, fd);
- int chmod_result = chmod (buf, mode);
- int chmod_errno = errno;
close (fd);
- if (chmod_result == 0)
- return chmod_result;
- if (chmod_errno != ENOENT)
- {
- errno = chmod_errno;
- return chmod_result;
- }
+
+ errno = err;
+ if (0 <= err)
+ return err == 0 ? 0 : -1;
# endif
- /* /proc is not mounted or would not work as in GNU/Linux. */
-# else
- int fstatat_result = fstatat (dir, file, &st, AT_SYMLINK_NOFOLLOW);
- if (fstatat_result != 0)
- return fstatat_result;
- if (S_ISLNK (st.st_mode))
+ /* O_PATH + /proc is not supported. */
+
+ if (0 <= readlinkat (dir, file, readlink_buf, sizeof readlink_buf))
{
errno = EOPNOTSUPP;
return -1;
diff --git a/lib/filevercmp.c b/lib/filevercmp.c
index d546e790548..7e54793e613 100644
--- a/lib/filevercmp.c
+++ b/lib/filevercmp.c
@@ -29,6 +29,8 @@
/* Return the length of a prefix of S that corresponds to the suffix
defined by this extended regular expression in the C locale:
(\.[A-Za-z~][A-Za-z0-9~]*)*$
+ Use the longest suffix matching this regular expression,
+ except do not use all of S as a suffix if S is nonempty.
If *LEN is -1, S is a string; set *LEN to S's length.
Otherwise, *LEN should be nonnegative, S is a char array,
and *LEN does not change. */
@@ -36,20 +38,22 @@ static idx_t
file_prefixlen (char const *s, ptrdiff_t *len)
{
size_t n = *len; /* SIZE_MAX if N == -1. */
+ idx_t prefixlen = 0;
- for (idx_t i = 0; ; i++)
+ for (idx_t i = 0; ; )
{
- idx_t prefixlen = i;
- while (i + 1 < n && s[i] == '.' && (c_isalpha (s[i + 1])
- || s[i + 1] == '~'))
- for (i += 2; i < n && (c_isalnum (s[i]) || s[i] == '~'); i++)
- continue;
-
if (*len < 0 ? !s[i] : i == n)
{
*len = i;
return prefixlen;
}
+
+ i++;
+ prefixlen = i;
+ while (i + 1 < n && s[i] == '.' && (c_isalpha (s[i + 1])
+ || s[i + 1] == '~'))
+ for (i += 2; i < n && (c_isalnum (s[i]) || s[i] == '~'); i++)
+ continue;
}
}
diff --git a/lib/filevercmp.h b/lib/filevercmp.h
index 5a336776719..57949760b25 100644
--- a/lib/filevercmp.h
+++ b/lib/filevercmp.h
@@ -61,7 +61,9 @@
without them, using version sort without special priority;
if they do not compare equal, this comparison result is used and
the suffixes are effectively ignored. Otherwise, the entire
- strings are compared using version sort.
+ strings are compared using version sort. When removing a suffix
+ from a nonempty string, remove the maximal-length suffix such that
+ the remaining string is nonempty.
This function is intended to be a replacement for strverscmp. */
int filevercmp (char const *a, char const *b) _GL_ATTRIBUTE_PURE;
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index bf0df878a5b..2ffe89d4239 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -35,6 +35,7 @@
# --macro-prefix=gl \
# --no-vc-files \
# --avoid=btowc \
+# --avoid=chmod \
# --avoid=close \
# --avoid=crypto/af_alg \
# --avoid=dup \
@@ -327,6 +328,7 @@ GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
GL_GNULIB_CLOSEDIR = @GL_GNULIB_CLOSEDIR@
@@ -1029,6 +1031,7 @@ REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CHMOD = @REPLACE_CHMOD@
REPLACE_CHOWN = @REPLACE_CHOWN@
REPLACE_CLOSE = @REPLACE_CLOSE@
REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
@@ -1196,6 +1199,7 @@ SETTINGS_LIBS = @SETTINGS_LIBS@
SHELL = @SHELL@
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SMALL_JA_DIC = @SMALL_JA_DIC@
SQLITE3_LIBS = @SQLITE3_LIBS@
STDALIGN_H = @STDALIGN_H@
STDDEF_H = @STDDEF_H@
@@ -3497,6 +3501,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
-e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \
+ -e 's/@''GNULIB_CHMOD''@/$(GL_GNULIB_CHMOD)/g' \
-e 's/@''GNULIB_FCHMODAT''@/$(GL_GNULIB_FCHMODAT)/g' \
-e 's/@''GNULIB_FSTAT''@/$(GL_GNULIB_FSTAT)/g' \
-e 's/@''GNULIB_FSTATAT''@/$(GL_GNULIB_FSTATAT)/g' \
@@ -3528,6 +3533,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
-e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
-e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
-e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+ -e 's|@''REPLACE_CHMOD''@|$(REPLACE_CHMOD)|g' \
-e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \
-e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
-e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
diff --git a/lib/lchmod.c b/lib/lchmod.c
index 706dddff7bb..8410a2d835f 100644
--- a/lib/lchmod.c
+++ b/lib/lchmod.c
@@ -25,17 +25,9 @@
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <string.h>
#include <unistd.h>
-#ifdef __osf__
-/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
- eliminates this include because of the preliminary #include <sys/stat.h>
- above. */
-# include "sys/stat.h"
-#else
-# include <sys/stat.h>
-#endif
-
#include <intprops.h>
/* Work like chmod, except when FILE is a symbolic link.
@@ -45,7 +37,9 @@
int
lchmod (char const *file, mode_t mode)
{
-#if defined O_PATH && defined AT_EMPTY_PATH
+ char readlink_buf[1];
+
+#ifdef O_PATH
/* Open a file descriptor with O_NOFOLLOW, to make sure we don't
follow symbolic links, if /proc is mounted. O_PATH is used to
avoid a failure if the file is not readable.
@@ -54,56 +48,46 @@ lchmod (char const *file, mode_t mode)
if (fd < 0)
return fd;
- /* Up to Linux 5.3 at least, when FILE refers to a symbolic link, the
- chmod call below will change the permissions of the symbolic link
- - which is undesired - and on many file systems (ext4, btrfs, jfs,
- xfs, ..., but not reiserfs) fail with error EOPNOTSUPP - which is
- misleading. Therefore test for a symbolic link explicitly.
- Use fstatat because fstat does not work on O_PATH descriptors
- before Linux 3.6. */
- struct stat st;
- if (fstatat (fd, "", &st, AT_EMPTY_PATH) != 0)
+ int err;
+ if (0 <= readlinkat (fd, "", readlink_buf, sizeof readlink_buf))
+ err = EOPNOTSUPP;
+ else if (errno == EINVAL)
{
- int stat_errno = errno;
- close (fd);
- errno = stat_errno;
- return -1;
- }
- if (S_ISLNK (st.st_mode))
- {
- close (fd);
- errno = EOPNOTSUPP;
- return -1;
+ static char const fmt[] = "/proc/self/fd/%d";
+ char buf[sizeof fmt - sizeof "%d" + INT_BUFSIZE_BOUND (int)];
+ sprintf (buf, fmt, fd);
+ err = chmod (buf, mode) == 0 ? 0 : errno == ENOENT ? -1 : errno;
}
+ else
+ err = errno == ENOENT ? -1 : errno;
-# if defined __linux__ || defined __ANDROID__ || defined __CYGWIN__
- static char const fmt[] = "/proc/self/fd/%d";
- char buf[sizeof fmt - sizeof "%d" + INT_BUFSIZE_BOUND (int)];
- sprintf (buf, fmt, fd);
- int chmod_result = chmod (buf, mode);
- int chmod_errno = errno;
close (fd);
- if (chmod_result == 0)
- return chmod_result;
- if (chmod_errno != ENOENT)
+
+ errno = err;
+ if (0 <= err)
+ return err == 0 ? 0 : -1;
+#endif
+
+ size_t len = strlen (file);
+ if (len && file[len - 1] == '/')
{
- errno = chmod_errno;
- return chmod_result;
+ struct stat st;
+ if (lstat (file, &st) < 0)
+ return -1;
+ if (!S_ISDIR (st.st_mode))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
}
-# endif
- /* /proc is not mounted or would not work as in GNU/Linux. */
-
-#elif HAVE_LSTAT
- struct stat st;
- int lstat_result = lstat (file, &st);
- if (lstat_result != 0)
- return lstat_result;
- if (S_ISLNK (st.st_mode))
+
+ /* O_PATH + /proc is not supported. */
+
+ if (0 <= readlink (file, readlink_buf, sizeof readlink_buf))
{
errno = EOPNOTSUPP;
return -1;
}
-#endif
/* Fall back on chmod, despite a possible race. */
return chmod (file, mode);
diff --git a/lib/mini-gmp.h b/lib/mini-gmp.h
index 508712d235b..59c24cf5111 100644
--- a/lib/mini-gmp.h
+++ b/lib/mini-gmp.h
@@ -8,7 +8,7 @@ The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your
+ Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
diff --git a/lib/str-two-way.h b/lib/str-two-way.h
index 7ee344aea14..b00017c0b4b 100644
--- a/lib/str-two-way.h
+++ b/lib/str-two-way.h
@@ -231,7 +231,7 @@ critical_factorization (const unsigned char *needle, size_t needle_len,
most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching.
If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */
-static RETURN_TYPE
+static RETURN_TYPE _GL_ATTRIBUTE_PURE
two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
const unsigned char *needle, size_t needle_len)
{
@@ -325,7 +325,7 @@ two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and
sublinear performance is not possible. */
-static RETURN_TYPE
+static RETURN_TYPE _GL_ATTRIBUTE_PURE
two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
const unsigned char *needle, size_t needle_len)
{
diff --git a/lib/string.in.h b/lib/string.in.h
index 33160b25254..3996da9fcb5 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -122,8 +122,12 @@ _GL_EXTERN_C void rpl_free (void *);
# undef _GL_ATTRIBUTE_DEALLOC_FREE
# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
# else
-# if defined _MSC_VER
-_GL_EXTERN_C void __cdecl free (void *);
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
# else
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
_GL_EXTERN_C void free (void *) throw ();
@@ -133,8 +137,12 @@ _GL_EXTERN_C void free (void *);
# endif
# endif
#else
-# if defined _MSC_VER
-_GL_EXTERN_C void __cdecl free (void *);
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
# else
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
_GL_EXTERN_C void free (void *) throw ();
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 28ddd42f818..714c3cb189e 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -391,7 +391,33 @@ struct stat
#endif
-#if @GNULIB_MDA_CHMOD@
+#if @GNULIB_CHMOD@
+# if @REPLACE_CHMOD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod rpl_chmod
+# endif
+_GL_FUNCDECL_RPL (chmod, int, (const char *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (chmod, int, (const char *filename, mode_t mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod _chmod
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (chmod);
+#elif defined GNULIB_POSIXCHECK
+# undef chmod
+# if HAVE_RAW_DECL_CHMOD
+_GL_WARN_ON_USE (chmod, "chmod has portability problems - "
+ "use gnulib module chmod for portability");
+# endif
+#elif @GNULIB_MDA_CHMOD@
/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::chmod always. */
diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17
index 6333d1dadd2..cebafe18aa0 100644
--- a/lisp/ChangeLog.17
+++ b/lisp/ChangeLog.17
@@ -825,7 +825,7 @@
2015-03-10 Paul Eggert <eggert@cs.ucla.edu>
- Prefer "initialize" to "initialise"
+ Prefer "initialize"
* progmodes/js.el (js-indent-first-init):
Rename from js-indent-first-initialiser, to avoid worrying about
American vs British spelling. All uses changed.
diff --git a/lisp/ChangeLog.9 b/lisp/ChangeLog.9
index 00c81337439..a8ebe81e7d7 100644
--- a/lisp/ChangeLog.9
+++ b/lisp/ChangeLog.9
@@ -5165,7 +5165,7 @@
* sql.el (sql-interbase): New function.
(sql-interbase-program): New option.
(sql-interbase-options): New option.
- And some typos fixed: "customise" to "customize".
+ And some typos fixed: "customize".
2001-03-06 Dave Love <fx@gnu.org>
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index e875d77faae..718938df0cb 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -292,8 +292,11 @@ The saved abbrevs are written to the file specified by
(defun add-mode-abbrev (arg)
"Define a mode-specific abbrev whose expansion is the last word before point.
+If there's an active region, use that as the expansion.
+
Prefix argument ARG says how many words before point to use for the expansion;
zero means the entire region is the expansion.
+
A negative ARG means to undefine the specified abbrev.
This command reads the abbreviation from the minibuffer.
@@ -303,7 +306,7 @@ if the abbreviation is already in the buffer, use that command to define
a mode-specific abbrev by specifying its expansion in the minibuffer.
Don't use this function in a Lisp program; use `define-abbrev' instead."
- (interactive "p")
+ (interactive "P")
(add-abbrev
(if only-global-abbrevs
global-abbrev-table
@@ -313,8 +316,11 @@ Don't use this function in a Lisp program; use `define-abbrev' instead."
(defun add-global-abbrev (arg)
"Define a global (all modes) abbrev whose expansion is last word before point.
+If there's an active region, use that as the expansion.
+
Prefix argument ARG says how many words before point to use for the expansion;
zero means the entire region is the expansion.
+
A negative ARG means to undefine the specified abbrev.
This command reads the abbreviation from the minibuffer.
@@ -324,15 +330,21 @@ if the abbreviation is already in the buffer, use that command to define
a global abbrev by specifying its expansion in the minibuffer.
Don't use this function in a Lisp program; use `define-abbrev' instead."
- (interactive "p")
+ (interactive "P")
(add-abbrev global-abbrev-table "Global" arg))
(defun add-abbrev (table type arg)
- (let ((exp (and (>= arg 0)
- (buffer-substring-no-properties
- (point)
- (if (= arg 0) (mark)
- (save-excursion (forward-word (- arg)) (point))))))
+ (let ((exp
+ (cond
+ ((or (and (null arg) (use-region-p))
+ (zerop (prefix-numeric-value arg)))
+ (buffer-substring-no-properties (region-beginning) (region-end)))
+ ((> (prefix-numeric-value arg) 0)
+ (buffer-substring-no-properties
+ (point)
+ (save-excursion
+ (forward-word (- (prefix-numeric-value arg)))
+ (point))))))
name)
(setq name
(read-string (format (if exp "%s abbrev that expands into \"%s\": "
@@ -885,8 +897,8 @@ longer than the abbrev, the benefit of informing the user is not
significant. If you always want to be informed about existing
abbrevs for the text you type, set this value to zero or less.
This setting only applies if `abbrev-suggest' is non-nil."
- :type 'number
- :version "28.1")
+ :type 'natnum
+ :version "28.1")
(defun abbrev--suggest-get-active-tables-including-parents ()
"Return a list of all active abbrev tables, including parent tables."
diff --git a/lisp/align.el b/lisp/align.el
index 9364d546654..be70f8f9d4f 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -86,10 +86,9 @@
;; '((my-rule
;; (regexp . "Sample")))
;; :type align-rules-list-type
+;; :risky t
;; :group 'my-package)
;;
-;; (put 'my-align-rules-list 'risky-local-variable t)
-;;
;; (add-to-list 'align-dq-string-modes 'my-package-mode)
;; (add-to-list 'align-open-comment-modes 'my-package-mode)
;;
@@ -319,10 +318,9 @@ The possible settings for `align-region-separate' are:
; (const largest)
(regexp :tag "Regexp defines section boundaries")
(function :tag "Function defines section boundaries"))
+ :risky t
:group 'align)
-(put 'align-region-separate 'risky-local-variable t)
-
(defvar align-rules-list-type
'(repeat
(cons
@@ -699,10 +697,9 @@ The following attributes are meaningful:
(see the documentation of that variable for possible
values), and any separation argument passed to `align'."
:type align-rules-list-type
+ :risky t
:group 'align)
-(put 'align-rules-list 'risky-local-variable t)
-
(defvar align-exclude-rules-list-type
'(repeat
(cons
@@ -770,10 +767,9 @@ The following attributes are meaningful:
"A list describing text that should be excluded from alignment.
See the documentation for `align-rules-list' for more info."
:type align-exclude-rules-list-type
+ :risky t
:group 'align)
-(put 'align-exclude-rules-list 'risky-local-variable t)
-
;;; Internal Variables:
(defvar-local align-mode-rules-list nil
@@ -823,8 +819,8 @@ See the variable `align-exclude-rules-list' for more details.")
(regexp . "\\(\\s-+\\)use\\s-+entity")))
"Alignment rules for `vhdl-mode'. See `align-rules-list' for more info."
:type align-rules-list-type
+ :risky t
:group 'align)
-(put 'align-vhdl-rules-list 'risky-local-variable t)
(make-obsolete-variable 'align-vhdl-rules-list "no longer used." "27.1")
(defun align-set-vhdl-rules ()
@@ -841,8 +837,8 @@ Interactively, BEG and END are the mark/point of the current region.
Many modes define specific alignment rules, and some of these
rules in some modes react to the current prefix argument. For
-instance, in `text-mode', `M-x align' will align into columns
-based on space delimiters, while `C-u - M-x align' will align
+instance, in `text-mode', \\`M-x align' will align into columns
+based on space delimiters, while \\`C-u -' \\`M-x align' will align
into columns based on the \"$\" character. See the
`align-rules-list' variable definition for the specific rules.
diff --git a/lisp/allout.el b/lisp/allout.el
index 4624c236f5a..e07bac4ef99 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -26,7 +26,7 @@
;;; Commentary:
;; Allout outline minor mode provides extensive outline formatting and
-;; and manipulation beyond standard Emacs outline mode. Some features:
+;; manipulation beyond standard Emacs outline mode. Some features:
;;
;; - Classic outline-mode topic-oriented navigation and exposure adjustment
;; - Topic-oriented editing including coherent topic and subtopic
@@ -733,8 +733,6 @@ Set this var to the bullet you want to use for file cross-references."
(put 'allout-presentation-padding 'safe-local-variable #'integerp)
;;;_ = allout-flattened-numbering-abbreviation
-(define-obsolete-variable-alias 'allout-abbreviate-flattened-numbering
- 'allout-flattened-numbering-abbreviation "24.1")
(defcustom allout-flattened-numbering-abbreviation nil
"If non-nil, `allout-flatten-exposed-to-buffer' abbreviates topic
numbers to minimal amount with some context. Otherwise, entire
@@ -1350,11 +1348,6 @@ their settings before `allout-mode' was started."
;;;_ = allout-mode-hook
(defvar allout-mode-hook nil
"Hook run when allout mode starts.")
-;;;_ = allout-mode-deactivate-hook
-(define-obsolete-variable-alias 'allout-mode-deactivate-hook
- 'allout-mode-off-hook "24.1")
-(defvar allout-mode-deactivate-hook nil
- "Hook run when allout mode ends.")
;;;_ = allout-exposure-category
(defvar allout-exposure-category nil
"Symbol for use as allout invisible-text overlay category.")
@@ -1779,7 +1772,6 @@ hooks, by which independent code can cooperate with allout
without changes to the allout core. Here are key ones:
`allout-mode-hook'
-`allout-mode-deactivate-hook' (deprecated)
`allout-mode-off-hook'
`allout-exposure-change-functions'
`allout-structure-added-functions'
diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el
index d5db9ecfed0..6f1c270c239 100644
--- a/lisp/ansi-color.el
+++ b/lisp/ansi-color.el
@@ -456,9 +456,6 @@ variable, and is meant to be used in `compilation-filter-hook'."
(_
(ansi-color-apply-on-region compilation-filter-start (point))))))
-(define-obsolete-function-alias 'ansi-color-unfontify-region
- 'font-lock-default-unfontify-region "24.1")
-
;; Working with strings
(defvar-local ansi-color-context nil
"Context saved between two calls to `ansi-color-apply'.
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index fc62e36dfc2..12da2c3d73d 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -164,8 +164,6 @@ Overrides `password-cache-expiry' through a let-binding."
(defvar auth-source-creation-prompts nil
"Default prompts for token values. Usually let-bound.")
-(make-obsolete 'auth-source-hide-passwords nil "24.1")
-
(defcustom auth-source-save-behavior 'ask
"If set, auth-source will respect it for save behavior."
:version "23.2" ;; No Gnus
@@ -2325,89 +2323,6 @@ See `auth-source-search' for details on SPEC."
(push item all)))
(nreverse all)))
-;;; older API
-
-;; (auth-source-user-or-password '("login" "password") "imap.myhost.com" t "tzz")
-
-;; deprecate the old interface
-(make-obsolete 'auth-source-user-or-password
- 'auth-source-search "24.1")
-(make-obsolete 'auth-source-forget-user-or-password
- 'auth-source-forget "24.1")
-
-(defun auth-source-user-or-password
- (mode host port &optional username create-missing delete-existing)
- "Find MODE (string or list of strings) matching HOST and PORT.
-
-DEPRECATED in favor of `auth-source-search'!
-
-USERNAME is optional and will be used as \"login\" in a search
-across the Secret Service API (see secrets.el) if the resulting
-items don't have a username. This means that if you search for
-username \"joe\" and it matches an item but the item doesn't have
-a :user attribute, the username \"joe\" will be returned.
-
-A non-nil DELETE-EXISTING means deleting any matching password
-entry in the respective sources. This is useful only when
-CREATE-MISSING is non-nil as well; the intended use case is to
-remove wrong password entries.
-
-If no matching entry is found, and CREATE-MISSING is non-nil,
-the password will be retrieved interactively, and it will be
-stored in the password database which matches best (see
-`auth-sources').
-
-MODE can be \"login\" or \"password\"."
- (auth-source-do-debug
- "auth-source-user-or-password: DEPRECATED get %s for %s (%s) + user=%s"
- mode host port username)
-
- (let* ((listy (listp mode))
- (mode (if listy mode (list mode)))
- ;; (cname (if username
- ;; (format "%s %s:%s %s" mode host port username)
- ;; (format "%s %s:%s" mode host port)))
- (search (list :host host :port port))
- (search (if username (append search (list :user username)) search))
- (search (if create-missing
- (append search (list :create t))
- search))
- (search (if delete-existing
- (append search (list :delete t))
- search))
- ;; (found (if (not delete-existing)
- ;; (gethash cname auth-source-cache)
- ;; (remhash cname auth-source-cache)
- ;; nil)))
- (found nil))
- (if found
- (progn
- (auth-source-do-debug
- "auth-source-user-or-password: DEPRECATED cached %s=%s for %s (%s) + %s"
- mode
- ;; don't show the password
- (if (and (member "password" mode) t)
- "SECRET"
- found)
- host port username)
- found) ; return the found data
- ;; else, if not found, search with a max of 1
- (let ((choice (nth 0 (apply #'auth-source-search
- (append '(:max 1) search)))))
- (when choice
- (dolist (m mode)
- (cond
- ((equal "password" m)
- (push (if (plist-get choice :secret)
- (funcall (plist-get choice :secret))
- nil) found))
- ((equal "login" m)
- (push (plist-get choice :user) found)))))
- (setq found (nreverse found))
- (setq found (if listy found (car-safe found)))))
-
- found))
-
(defun auth-source-user-and-password (host &optional user)
(let* ((auth-info (car
(if user
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index c12c554498b..29d10bc6295 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -67,7 +67,7 @@ Possible values:
other insert if possible, but mark as unmodified.
Insertion is possible when something appropriate is found in
`auto-insert-alist'. When the insertion is marked as unmodified, you can
-save it with \\[write-file] RET.
+save it with \\[write-file] \\`RET'.
This variable is used when the function `auto-insert' is called, e.g.
when you do (add-hook \\='find-file-hook \\='auto-insert).
With \\[auto-insert], this is always treated as if it were t."
@@ -76,6 +76,9 @@ With \\[auto-insert], this is always treated as if it were t."
(other :tag "insert if possible, mark as unmodified."
not-modified)))
+;;;###autoload
+(put 'auto-insert 'safe-local-variable #'null)
+
(defcustom auto-insert-query 'function
"Non-nil means ask user before auto-inserting.
When this is `function', only ask when called non-interactively."
diff --git a/lisp/bindings.el b/lisp/bindings.el
index c67a104b4c1..14ab69b8f02 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1,7 +1,6 @@
;;; bindings.el --- define standard key bindings and some variables -*- lexical-binding: t; -*-
-;; Copyright (C) 1985-1987, 1992-1996, 1999-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: internal
@@ -231,6 +230,7 @@ mnemonics of the following coding systems:
(:propertize ("" (:eval (if (frame-parameter nil 'client) "@" "")))
help-echo ,(purecopy "emacsclient frame")))
"Mode line construct for identifying emacsclient frames.")
+;; Autoload if this file no longer dumped.
;;;###autoload
(put 'mode-line-client 'risky-local-variable t)
@@ -458,8 +458,8 @@ displayed in `mode-line-position', a component of the default
(const :tag "\"%q\": Offsets of both top and bottom of window"
(6 "%q")))
:version "26.1"
+ :risky t
:group 'mode-line)
-(put 'mode-line-percent-position 'risky-local-variable t)
(defcustom mode-line-position-line-format '(" L%l")
"Format used to display line numbers in the mode line.
@@ -1013,7 +1013,7 @@ if `inhibit-field-text-motion' is non-nil."
(let ((map (make-sparse-keymap)))
(define-key map "u" 'undo)
map)
- "Keymap to repeat undo key sequences `C-x u u'. Used in `repeat-mode'.")
+ "Keymap to repeat undo key sequences \\`C-x u u'. Used in `repeat-mode'.")
(put 'undo 'repeat-map 'undo-repeat-map)
(define-key global-map '[(control ??)] 'undo-redo)
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 126c25966cb..b2130557dcc 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -160,7 +160,7 @@ This includes the annotations column.")
(defcustom bookmark-bmenu-file-column 30
"Column at which to display filenames in a buffer listing bookmarks.
You can toggle whether files are shown with \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-toggle-filenames]."
- :type 'integer)
+ :type 'natnum)
(defcustom bookmark-bmenu-toggle-filenames t
@@ -174,7 +174,7 @@ A non-nil value may result in truncated bookmark names."
(defcustom bookmark-menu-length 70
"Maximum length of a bookmark name displayed on a popup menu."
- :type 'integer)
+ :type 'natnum)
;; FIXME: Is it really worth a customization option?
(defcustom bookmark-search-delay 0.2
@@ -216,10 +216,10 @@ A non-nil value may result in truncated bookmark names."
;; Set up these bindings dumping time *only*;
;; if the user alters them, don't override the user when loading bookmark.el.
-;;;###autoload (define-key ctl-x-r-map "b" 'bookmark-jump)
-;;;###autoload (define-key ctl-x-r-map "m" 'bookmark-set)
-;;;###autoload (define-key ctl-x-r-map "M" 'bookmark-set-no-overwrite)
-;;;###autoload (define-key ctl-x-r-map "l" 'bookmark-bmenu-list)
+;;;###autoload (keymap-set ctl-x-r-map "b" #'bookmark-jump)
+;;;###autoload (keymap-set ctl-x-r-map "m" #'bookmark-set)
+;;;###autoload (keymap-set ctl-x-r-map "M" #'bookmark-set-no-overwrite)
+;;;###autoload (keymap-set ctl-x-r-map "l" #'bookmark-bmenu-list)
;;;###autoload
(defvar-keymap bookmark-map
@@ -1436,9 +1436,9 @@ name."
(read-from-minibuffer
"New name: "
nil
- (let ((now-map (copy-keymap minibuffer-local-map)))
- (define-key now-map "\C-w" 'bookmark-yank-word)
- now-map)
+ (define-keymap
+ :parent minibuffer-local-map
+ "C-w" #'bookmark-yank-word)
nil
'bookmark-history))))
(bookmark-set-name old-name final-new-name)
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 179cc5484cd..539ef673f0b 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -92,13 +92,13 @@ number."
(defcustom Buffer-menu-size-width 7
"Width of buffer size column in the Buffer Menu."
- :type 'number
+ :type 'natnum
:group 'Buffer-menu
:version "24.3")
(defcustom Buffer-menu-mode-width 16
"Width of mode name column in the Buffer Menu."
- :type 'number
+ :type 'natnum
:group 'Buffer-menu)
(defcustom Buffer-menu-use-frame-buffer-list t
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 9a580d9602a..bb427ef86e6 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -335,7 +335,8 @@
(message (concat
"Embedded Calc mode enabled; "
(if calc-embedded-quiet
- "Type `C-x * x'"
+ (substitute-command-keys
+ "Type \\`C-x * x'")
"Give this command again")
" to return to normal")))))
(scroll-down 0))) ; fix a bug which occurs when truncate-lines is changed.
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index bd1635f2bf4..7c75e79a268 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -61,48 +61,48 @@
;;;###autoload
(defun calc-dispatch-help (arg)
- "C-x* is a prefix key sequence; follow it with one of these letters:
+ "\\`C-x *' is a prefix key sequence; follow it with one of these letters:
For turning Calc on and off:
- C calc. Start the Calculator in a window at the bottom of the screen.
- O calc-other-window. Start the Calculator but don't select its window.
- B calc-big-or-small. Control whether to use the full Emacs screen for Calc.
- Q quick-calc. Use the Calculator in the minibuffer.
- K calc-keypad. Start the Calculator in keypad mode (X window system only).
- E calc-embedded. Use the Calculator on a formula in this editing buffer.
- J calc-embedded-select. Like E, but select appropriate half of => or :=.
- W calc-embedded-word. Like E, but activate a single word, i.e., a number.
- Z calc-user-invocation. Invoke Calc in the way you defined with `Z I' cmd.
- X calc-quit. Turn Calc off.
+ \\`C' calc. Start the Calculator in a window at the bottom of the screen.
+ \\`O' calc-other-window. Start the Calculator but don't select its window.
+ \\`B' calc-big-or-small. Toggle using the full Emacs screen for Calc.
+ \\`Q' quick-calc. Use the Calculator in the minibuffer.
+ \\`K' calc-keypad. Start the Calculator in keypad mode (X window system only).
+ \\`E' calc-embedded. Use the Calculator on a formula in this editing buffer.
+ \\`J' calc-embedded-select. Like \\`E', but select appropriate half of => or :=.
+ \\`W' calc-embedded-word. Like \\`E', but activate a single word, i.e., a number.
+ \\`Z' calc-user-invocation. Invoke Calc in the way you defined with `Z I' cmd.
+ \\`X' calc-quit. Turn Calc off.
For moving data into and out of Calc:
- G calc-grab-region. Grab the region defined by mark and point into Calc.
- R calc-grab-rectangle. Grab the rectangle defined by mark, point into Calc.
- : calc-grab-sum-down. Grab a rectangle and sum the columns.
- _ calc-grab-sum-across. Grab a rectangle and sum the rows.
- Y calc-copy-to-buffer. Copy a value from the stack into the editing buffer.
+ \\`G' calc-grab-region. Grab the region defined by mark and point into Calc.
+ \\`R' calc-grab-rectangle. Grab the rectangle defined by mark, point into Calc.
+ \\`:' calc-grab-sum-down. Grab a rectangle and sum the columns.
+ \\`_' calc-grab-sum-across. Grab a rectangle and sum the rows.
+ \\`Y' calc-copy-to-buffer. Copy a value from the stack into the editing buffer.
For use with Embedded mode:
- A calc-embedded-activate. Find and activate all :='s and =>'s in buffer.
- D calc-embedded-duplicate. Make a copy of this formula and select it.
- F calc-embedded-new-formula. Insert a new formula at current point.
- N calc-embedded-next. Advance cursor to next known formula in buffer.
- P calc-embedded-previous. Advance cursor to previous known formula.
- U calc-embedded-update-formula. Re-evaluate formula at point.
- \\=` calc-embedded-edit. Use calc-edit to edit formula at point.
+ \\`A' calc-embedded-activate. Find and activate all :='s and =>'s in buffer.
+ \\`D' calc-embedded-duplicate. Make a copy of this formula and select it.
+ \\`F' calc-embedded-new-formula. Insert a new formula at current point.
+ \\`N' calc-embedded-next. Advance cursor to next known formula in buffer.
+ \\`P' calc-embedded-previous. Advance cursor to previous known formula.
+ \\`U' calc-embedded-update-formula. Re-evaluate formula at point.
+ \\``' calc-embedded-edit. Use calc-edit to edit formula at point.
Documentation:
- I calc-info. Read the Calculator manual in the Emacs Info system.
- T calc-tutorial. Run the Calculator Tutorial using the Emacs Info system.
- S calc-summary. Read the Summary from the Calculator manual in Info.
+ \\`I' calc-info. Read the Calculator manual in the Emacs Info system.
+ \\`T' calc-tutorial. Run the Calculator Tutorial using the Emacs Info system.
+ \\`S' calc-summary. Read the Summary from the Calculator manual in Info.
Miscellaneous:
- L calc-load-everything. Load all parts of the Calculator into memory.
- M read-kbd-macro. Read a region of keystroke names as a keyboard macro.
- 0 (zero) calc-reset. Reset Calc stack and modes to default state.
+ \\`L' calc-load-everything. Load all parts of the Calculator into memory.
+ \\`M' read-kbd-macro. Read a region of keystroke names as a keyboard macro.
+ \\`0' (zero) calc-reset. Reset Calc stack and modes to default state.
-Press `*' twice (`C-x * *') to turn Calc on or off using the same
-Calc user interface as before (either C-x * C or C-x * K; initially C-x * C)."
+Press \\`*' twice (\\`C-x * *') to turn Calc on or off using the same
+Calc user interface as before (either \\`C-x * C' or \\`C-x * K'; initially \\`C-x * C')."
(interactive "P")
(calc-check-defines)
(if calc-dispatch-help
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index dc2a086bbd7..f11d9741ec7 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -678,7 +678,7 @@
(or last-kbd-macro
(error "No keyboard macro defined"))
(setq calc-invocation-macro last-kbd-macro)
- (message "Use `C-x * Z' to invoke this macro"))
+ (message (substitute-command-keys "Use \\`C-x * Z' to invoke this macro")))
(defun calc-user-define-edit ()
(interactive) ; but no calc-wrapper!
@@ -1949,7 +1949,7 @@ Redefine the corresponding command."
;; The variable math-exp-env is local to math-define-body, but is
;; used by math-define-exp, which is called (indirectly) by
-;; by math-define-body.
+;; math-define-body.
(defvar math-exp-env)
(defun math-define-body (body exp-env)
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index c98505a0b1d..71cc68b0c20 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -715,9 +715,9 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
(insert (propertize
(concat
(or title title "Calc Edit Mode. ")
- (format-message "Press `C-c C-c'")
+ (substitute-command-keys "Press \\`C-c C-c'")
(if allow-ret "" " or RET")
- (format-message " to finish, `C-x k RET' to cancel.\n\n"))
+ (substitute-command-keys " to finish, \\`C-x k RET' to cancel.\n\n"))
'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t))
(setq-local calc-edit-top (point))))
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index b03dcfeb5b7..254c703ee22 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -412,7 +412,7 @@ and deleted by `calc-pop'."
(defcustom calc-undo-length 100
"The number of undo steps that will be preserved when Calc is quit."
- :type 'integer)
+ :type 'natnum)
(defcustom calc-highlight-selections-with-faces nil
"If non-nil, use a separate face to indicate selected sub-formulas.
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 9a77ae72d02..c1f176050c2 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -211,7 +211,7 @@ If you change this variable directly (without using customize)
after starting `calendar', you should call `calendar-redraw' to
update the calendar display to reflect the change, otherwise
movement commands will not work correctly."
- :type 'integer
+ :type 'natnum
;; Change the initialize so that if you reload calendar.el, it will not
;; cause a redraw.
:initialize 'custom-initialize-default
@@ -511,7 +511,7 @@ Then redraw the calendar, if necessary."
:initialize #'custom-initialize-default
:set (lambda (sym val)
(calendar-set-layout-variable sym val 1))
- :type 'integer
+ :type 'natnum
:version "23.1")
;; FIXME calendar-month-column-width?
@@ -520,7 +520,7 @@ Then redraw the calendar, if necessary."
:initialize #'custom-initialize-default
:set (lambda (sym val)
(calendar-set-layout-variable sym val 3))
- :type 'integer
+ :type 'natnum
:version "23.1")
(defun calendar-day-header-construct (&optional width)
@@ -553,7 +553,7 @@ Must be at least one less than `calendar-column-width'."
:initialize #'custom-initialize-default
:set (lambda (sym val)
(calendar-set-layout-variable sym val 2))
- :type 'integer
+ :type 'natnum
:version "23.1")
(defcustom calendar-intermonth-header nil
@@ -565,7 +565,7 @@ See `calendar-intermonth-text'."
:set (lambda (sym val)
(set sym val)
(calendar-redraw))
- :type '(choice (const nil :tag "Nothing")
+ :type '(choice (const :value nil :tag "Nothing")
(string :tag "Fixed string")
(sexp :value
(propertize "WK" 'font-lock-face
@@ -597,7 +597,7 @@ See also `calendar-intermonth-header'."
:set (lambda (sym val)
(set sym val)
(calendar-redraw))
- :type '(choice (const nil :tag "Nothing")
+ :type '(choice (const :value nil :tag "Nothing")
(string :tag "Fixed string")
(sexp :value
(propertize
@@ -742,9 +742,9 @@ Setting this variable directly does not take effect (if the
calendar package is already loaded). Rather, use either
\\[customize] or the function `calendar-set-date-style'."
:version "23.1"
- :type '(choice (const american :tag "Month/Day/Year")
- (const european :tag "Day/Month/Year")
- (const iso :tag "Year/Month/Day"))
+ :type '(choice (const :value american :tag "American (Month/Day/Year)")
+ (const :value european :tag "European (Day/Month/Year)")
+ (const :value iso :tag "ISO 8601 (Year/Month/Day)"))
:initialize 'custom-initialize-default
:set (lambda (_symbol value)
(calendar-set-date-style value))
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 48dbf33adff..084d2d7d55e 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -100,11 +100,11 @@ are: `string', `symbol', `int', `tnil', `stringtnil'."
:type '(repeat (list (regexp :tag "Regular expression")
(integer :tag "Sub-expression")
(symbol :tag "Attribute (e.g. :foreground)")
- (choice (const string :tag "A string")
- (const symbol :tag "A symbol")
- (const int :tag "An integer")
- (const tnil :tag "t or nil")
- (const stringtnil
+ (choice (const :value string :tag "A string")
+ (const :value symbol :tag "A symbol")
+ (const :value int :tag "An integer")
+ (const :value tnil :tag "t or nil")
+ (const :value stringtnil
:tag "A string, t, or nil"))))
:group 'diary)
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index d19134db832..d1afd8ce95a 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -590,7 +590,7 @@ TIME is modified and returned."
time)
(defun decoded-time-period (time)
- "Interpret DECODED as a period and return its length in seconds.
+ "Interpret TIME as a period and return its length in seconds.
For computational purposes, years are 365 days long and months
are 30 days long."
(+ (if (consp (decoded-time-second time))
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index 1c6a557a0d3..7bdaf7ceff6 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -86,7 +86,7 @@
(defcustom timeclock-workday (* 8 60 60)
"The length of a work period in seconds."
- :type 'integer)
+ :type 'natnum)
(defvar timeclock--previous-workday nil)
diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el
index 0edc853edda..e7635c0aec5 100644
--- a/lisp/cedet/data-debug.el
+++ b/lisp/cedet/data-debug.el
@@ -854,7 +854,6 @@ If PARENT is non-nil, it is somehow related as a parent to thing."
table)
"Syntax table used in data-debug macro buffers.")
-(define-obsolete-variable-alias 'data-debug-map 'data-debug-mode-map "24.1")
(defvar data-debug-mode-map
(let ((km (make-sparse-keymap)))
(suppress-keymap km)
@@ -1028,11 +1027,9 @@ Do nothing if already contracted."
(defun data-debug-edebug-expr (expr)
"Dump out the contents of some expression EXPR in edebug with ddebug."
(interactive
- (list (let ((minibuffer-completing-symbol t))
- (read-from-minibuffer "Eval: "
- nil read-expression-map t
- 'read-expression-history))
- ))
+ (list (read-from-minibuffer "Eval: "
+ nil read-expression-map t
+ 'read-expression-history)))
(let ((v (eval expr t)))
(if (not v)
(message "Expression %s is nil." expr)
@@ -1043,10 +1040,9 @@ Do nothing if already contracted."
If the result is something simple, show it in the echo area.
If the result is a list or vector, then use the data debugger to display it."
(interactive
- (list (let ((minibuffer-completing-symbol t))
- (read-from-minibuffer "Eval: "
- nil read-expression-map t
- 'read-expression-history))))
+ (list (read-from-minibuffer "Eval: "
+ nil read-expression-map t
+ 'read-expression-history)))
(let (result)
(if (null eval-expression-debug-on-error)
diff --git a/lisp/cedet/ede/emacs.el b/lisp/cedet/ede/emacs.el
index 5a23f504f78..cbe766cedb6 100644
--- a/lisp/cedet/ede/emacs.el
+++ b/lisp/cedet/ede/emacs.el
@@ -59,7 +59,7 @@ Return a tuple of ( EMACSNAME . VERSION )."
(file-exists-p (setq configure_ac "configure.in")))
(insert-file-contents configure_ac)
(goto-char (point-min))
- (re-search-forward "AC_INIT(\\(?:GNU \\)?[eE]macs,\\s-*\\([0-9.]+\\)\\s-*[,)]")
+ (re-search-forward "AC_INIT(\\[?\\(?:GNU \\)?[eE]macs]?,\\s-*\\[?\\([0-9.]+\\)]?\\s-*[,)]")
(setq ver (match-string 1))
)
)
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el
index 76230d438a1..4679500ed99 100644
--- a/lisp/cedet/semantic/edit.el
+++ b/lisp/cedet/semantic/edit.el
@@ -610,7 +610,7 @@ This function is for internal use by `semantic-edits-incremental-parser'."
(setq last-cond "Beginning of buffer")
(setq parse-start
;; Don't worry about parents since
- ;; there there would be an exact
+ ;; there would be an exact
;; match in the tag list otherwise
;; and the routine would fail.
(point-min)
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 74d4a229fac..97456265ead 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -1123,8 +1123,6 @@ END is the limit of the search."
;;;; Define major mode
;;;;
-(define-obsolete-variable-alias 'semantic-grammar-syntax-table
- 'semantic-grammar-mode-syntax-table "24.1")
(defvar semantic-grammar-mode-syntax-table
(let ((table (make-syntax-table (standard-syntax-table))))
(modify-syntax-entry ?\: "." table) ;; COLON
@@ -1197,8 +1195,6 @@ END is the limit of the search."
semantic-grammar-mode-keywords-1
"Font Lock keywords used to highlight Semantic grammar buffers.")
-(define-obsolete-variable-alias 'semantic-grammar-map
- 'semantic-grammar-mode-map "24.1")
(defvar semantic-grammar-mode-map
(let ((km (make-sparse-keymap)))
diff --git a/lisp/cedet/semantic/java.el b/lisp/cedet/semantic/java.el
index 9b70afd0a33..53fd4de2975 100644
--- a/lisp/cedet/semantic/java.el
+++ b/lisp/cedet/semantic/java.el
@@ -37,25 +37,24 @@
;;; Lexical analysis
;;
(defconst semantic-java-number-regexp
- (eval-when-compile
- (concat "\\("
- "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[.][fFdD]\\>"
- "\\|"
- "\\<[0-9]+[.]"
- "\\|"
- "[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
- "\\|"
- "\\<0[xX][[:xdigit:]]+[lL]?\\>"
- "\\|"
- "\\<[0-9]+[lLfFdD]?\\>"
- "\\)"
- ))
+ (concat "\\("
+ "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[.][fFdD]\\>"
+ "\\|"
+ "\\<[0-9]+[.]"
+ "\\|"
+ "[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
+ "\\|"
+ "\\<0[xX][[:xdigit:]]+[lL]?\\>"
+ "\\|"
+ "\\<[0-9]+[lLfFdD]?\\>"
+ "\\)"
+ )
"Lexer regexp to match Java number terminals.
Following is the specification of Java number literals.
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el
index 57e59f4e9fe..4bdaaf77acf 100644
--- a/lisp/cedet/semantic/lex-spp.el
+++ b/lisp/cedet/semantic/lex-spp.el
@@ -1074,7 +1074,7 @@ and variable state from the current buffer."
))
;; Second Cheat: copy key variables regarding macro state from the
- ;; the originating buffer we are parsing. We need to do this every time
+ ;; originating buffer we are parsing. We need to do this every time
;; since the state changes.
(dolist (V important-vars)
(set V (buffer-local-value V origbuff)))
diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el
index 885ffbf5a73..9c64cc9f7e5 100644
--- a/lisp/cedet/semantic/lex.el
+++ b/lisp/cedet/semantic/lex.el
@@ -574,25 +574,24 @@ may need to be overridden for some special languages.")
(defvar-local semantic-lex-number-expression
;; This expression was written by David Ponce for Java, and copied
;; here for C and any other similar language.
- (eval-when-compile
- (concat "\\("
- "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[.][fFdD]\\>"
- "\\|"
- "\\<[0-9]+[.]"
- "\\|"
- "[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
- "\\|"
- "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
- "\\|"
- "\\<0[xX][[:xdigit:]]+[lL]?\\>"
- "\\|"
- "\\<[0-9]+[lLfFdD]?\\>"
- "\\)"
- ))
+ (concat "\\("
+ "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[.][fFdD]\\>"
+ "\\|"
+ "\\<[0-9]+[.]"
+ "\\|"
+ "[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+ "\\|"
+ "\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
+ "\\|"
+ "\\<0[xX][[:xdigit:]]+[lL]?\\>"
+ "\\|"
+ "\\<[0-9]+[lLfFdD]?\\>"
+ "\\)"
+ )
"Regular expression for matching a number.
If this value is nil, no number extraction is done during lex.
This expression tries to match C and Java like numbers.
diff --git a/lisp/chistory.el b/lisp/chistory.el
index dd0f4997433..9dce60a19fe 100644
--- a/lisp/chistory.el
+++ b/lisp/chistory.el
@@ -119,8 +119,6 @@ The buffer is left in Command History mode."
(error "No command history")
(command-history-mode)))))
-(define-obsolete-variable-alias 'command-history-map
- 'command-history-mode-map "24.1")
(defvar command-history-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map (make-composed-keymap lisp-mode-shared-map
@@ -165,11 +163,11 @@ The buffer for that command is the previous current buffer."
"Examine commands from variable `command-history' in a buffer.
The number of commands listed is controlled by `list-command-history-max'.
The command history is filtered by `list-command-history-filter' if non-nil.
-Use \\<command-history-map>\\[command-history-repeat] to repeat the command on the current line.
+Use \\<command-history-mode-map>\\[command-history-repeat] to repeat the command on the current line.
Otherwise much like Emacs-Lisp Mode except that there is no self-insertion
and digits provide prefix arguments. Tab does not indent.
-\\{command-history-map}
+\\{command-history-mode-map}
This command always recompiles the Command History listing
and runs the normal hook `command-history-hook'."
diff --git a/lisp/comint.el b/lisp/comint.el
index 3da61fb992f..d52623c00ae 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -330,12 +330,12 @@ This variable is buffer-local in all Comint buffers."
"The maximum size in lines for Comint buffers.
Comint buffers are truncated from the top to be no greater than this number, if
the function `comint-truncate-buffer' is on `comint-output-filter-functions'."
- :type 'integer
+ :type 'natnum
:group 'comint)
(defcustom comint-input-ring-size 500
"Size of the input history ring in `comint-mode'."
- :type 'integer
+ :type 'natnum
:group 'comint
:version "23.2")
@@ -1466,7 +1466,7 @@ A useful command to bind to SPC. See `comint-replace-by-expanded-history'."
(defcustom comint-history-isearch nil
"Non-nil to Isearch in input history only, not in comint buffer output.
-If t, usual Isearch keys like `C-r' and `C-M-r' in comint mode search
+If t, usual Isearch keys like \\`C-r' and \\`C-M-r' in comint mode search
in the input history.
If `dwim', Isearch keys search in the input history only when initial
point position is at the comint command line. When starting Isearch
@@ -2515,8 +2515,9 @@ This function could be in the list `comint-output-filter-functions'."
(1+ comint--prompt-recursion-depth)))
(if (> comint--prompt-recursion-depth 10)
(message "Password prompt recursion too deep")
- (comint-send-invisible
- (string-trim string "[ \n\r\t\v\f\b\a]+" "\n+"))))))
+ (when (get-buffer-process (current-buffer))
+ (comint-send-invisible
+ (string-trim string "[ \n\r\t\v\f\b\a]+" "\n+")))))))
(current-buffer))))
;; Low-level process communication
@@ -2811,7 +2812,7 @@ Interactively, if no prefix argument is given, the last argument is inserted.
Repeated interactive invocations will cycle through the same argument
from progressively earlier commands (using the value of INDEX specified
with the first command). Values of INDEX < 0 count from the end, so
-INDEX = -1 is the last argument. This command is like `M-.' in
+INDEX = -1 is the last argument. This command is like \"M-.\" in
Bash and zsh."
(interactive "P")
(unless (null index)
@@ -3298,10 +3299,6 @@ Magic characters are those in `comint-file-name-quote-list'."
(defun comint-completion-at-point ()
(run-hook-with-args-until-success 'comint-dynamic-complete-functions))
-(define-obsolete-function-alias
- 'comint-dynamic-complete
- 'completion-at-point "24.1")
-
(defun comint-dynamic-complete-filename ()
"Dynamically complete the filename at point.
Completes if after a filename.
@@ -3382,13 +3379,6 @@ See `completion-table-with-quoting' and `comint-unquote-function'.")
(goto-char (match-end 0))
(insert filesuffix)))))))))
-(defun comint-dynamic-complete-as-filename ()
- "Dynamically complete at point as a filename.
-See `comint-dynamic-complete-filename'. Returns t if successful."
- (declare (obsolete comint-filename-completion "24.1"))
- (let ((data (comint--complete-file-name-data)))
- (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data))))
-
(defun comint-replace-by-expanded-filename ()
"Dynamically expand and complete the filename at point.
Replace the filename with an expanded, canonicalized and
@@ -3403,65 +3393,6 @@ filename absolute. For expansion see `expand-file-name' and
(replace-match (expand-file-name filename) t t)
(comint-dynamic-complete-filename))))
-
-(defun comint-dynamic-simple-complete (stub candidates)
- "Dynamically complete STUB from CANDIDATES list.
-This function inserts completion characters at point by
-completing STUB from the strings in CANDIDATES. If completion is
-ambiguous, possibly show a completions listing in a separate
-buffer.
-
-Return nil if no completion was inserted.
-Return `sole' if completed with the only completion match.
-Return `shortest' if completed with the shortest match.
-Return `partial' if completed as far as possible.
-Return `listed' if a completion listing was shown.
-
-See also `comint-dynamic-complete-filename'."
- (declare (obsolete completion-in-region "24.1"))
- (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin)))
- (minibuffer-p (window-minibuffer-p))
- (suffix (cond ((not comint-completion-addsuffix) "")
- ((not (consp comint-completion-addsuffix)) " ")
- (t (cdr comint-completion-addsuffix))))
- (completions (all-completions stub candidates)))
- (cond ((null completions)
- (if minibuffer-p
- (minibuffer-message "No completions of %s" stub)
- (message "No completions of %s" stub))
- nil)
- ((= 1 (length completions)) ; Gotcha!
- (let ((completion (car completions)))
- (if (string-equal completion stub)
- (unless minibuffer-p
- (message "Sole completion"))
- (insert (substring completion (length stub)))
- (unless minibuffer-p
- (message "Completed")))
- (insert suffix)
- 'sole))
- (t ; There's no unique completion.
- (let ((completion (try-completion stub candidates)))
- ;; Insert the longest substring.
- (insert (substring completion (length stub)))
- (cond ((and comint-completion-recexact comint-completion-addsuffix
- (string-equal stub completion)
- (member completion completions))
- ;; It's not unique, but user wants shortest match.
- (insert suffix)
- (unless minibuffer-p
- (message "Completed shortest"))
- 'shortest)
- ((or comint-completion-autolist
- (string-equal stub completion))
- ;; It's not unique, list possible completions.
- (comint-dynamic-list-completions completions stub)
- 'listed)
- (t
- (unless minibuffer-p
- (message "Partially completed"))
- 'partial)))))))
-
(defun comint-dynamic-list-filename-completions ()
"Display a list of possible completions for the filename at point."
(interactive)
diff --git a/lisp/completion.el b/lisp/completion.el
index fb700954b0e..2e486b6a50d 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -926,10 +926,6 @@ Each symbol is bound to a single completion entry.")
"Return a completion entry."
(list string 0 nil current-completion-source))
-;; Obsolete
-;;(defmacro cmpl-prefix-entry-symbol (completion-entry)
-;; (list 'car (list 'cdr completion-entry)))
-
;;-----------------------------------------------
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 1f496af7d57..50dce5ee285 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1075,6 +1075,7 @@ plain variables. This means that `setopt' will execute any
(when-let ((type (get variable 'custom-type)))
(unless (widget-apply (widget-convert type) :match value)
(user-error "Value `%S' does not match type %s" value type)))
+ (put variable 'custom-check-value (list value))
(funcall (or (get variable 'custom-set) #'set-default) variable value))
;;;###autoload
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index ca2fca4eb77..df919fd7155 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -834,6 +834,7 @@ since it could result in memory overflow and make Emacs crash."
(x-scroll-event-delta-factor mouse float "29.1")
(x-gtk-use-native-input keyboard boolean "29.1")
(x-dnd-disable-motif-drag dnd boolean "29.1")
+ (x-auto-preserve-selections x boolean "29.1")
;; xselect.c
(x-select-enable-clipboard-manager killing boolean "24.1")
;; xsettings.c
@@ -874,6 +875,8 @@ since it could result in memory overflow and make Emacs crash."
(equal "x-scroll-event-delta-factor"
(symbol-name symbol))
(equal "x-dnd-disable-motif-drag"
+ (symbol-name symbol))
+ (equal "x-auto-preserve-selections"
(symbol-name symbol)))
(featurep 'x))
((string-match "\\`x-" (symbol-name symbol))
diff --git a/lisp/custom.el b/lisp/custom.el
index 2b7621229d9..bbbe70c5ea8 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -90,6 +90,20 @@ The value is either the symbol's current value
(as obtained using the `:get' function), if any,
or the value in the symbol's `saved-value' property if any,
or (last of all) the value of EXP."
+ ;; If this value has been set with `setopt' (for instance in
+ ;; ~/.emacs), we didn't necessarily know the type of the user option
+ ;; then. So check now, and issue a warning if it's wrong.
+ (let ((value (get symbol 'custom-check-value)))
+ (when value
+ (let ((type (get symbol 'custom-type)))
+ (when (and type
+ (boundp symbol)
+ (eq (car value) (symbol-value symbol))
+ ;; Check that the type is correct.
+ (not (widget-apply (widget-convert type)
+ :match (car value))))
+ (warn "Value `%S' for `%s' does not match type %s"
+ value symbol type)))))
(funcall (or (get symbol 'custom-set) #'set-default-toplevel-value)
symbol
(condition-case nil
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 0f01ad676ae..16971aa6611 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -701,6 +701,7 @@ The character information includes:
(looking-at-p "[ \t]+$")))
'trailing-whitespace)
((and nobreak-char-display char
+ (> char 127)
(eq (get-char-code-property char 'general-category) 'Zs))
'nobreak-space)
((and nobreak-char-display char
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 947f7cff5cb..850d2a86efa 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -481,7 +481,7 @@ If value is t, all buffers are restored immediately."
(defcustom desktop-lazy-idle-delay 5
"Idle delay before starting to create buffers.
See `desktop-restore-eager'."
- :type 'integer
+ :type 'natnum
:group 'desktop
:version "22.1")
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 095f8001701..b9f33036e31 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1056,18 +1056,19 @@ Return the result of `process-file' - zero for success."
(dir default-directory))
(with-current-buffer (get-buffer-create out-buffer)
(erase-buffer)
- (let* ((default-directory dir)
- (res (process-file
- shell-file-name
- nil
- t
- nil
- shell-command-switch
- cmd)))
- (dired-uncache dir)
- (unless (zerop res)
- (pop-to-buffer out-buffer))
- res))))
+ (let ((default-directory dir) res)
+ (with-connection-local-variables
+ (setq res (process-file
+ shell-file-name
+ nil
+ t
+ nil
+ shell-command-switch
+ cmd))
+ (dired-uncache dir)
+ (unless (zerop res)
+ (pop-to-buffer out-buffer))
+ res)))))
;;; Commands that delete or redisplay part of the dired buffer
@@ -2521,6 +2522,73 @@ Also see `dired-do-revert-buffer'."
"Symlink" arg dired-keep-marker-symlink))
;;;###autoload
+(defun dired-do-relsymlink (&optional arg)
+ "Relative symlink all marked (or next ARG) files into a directory.
+Otherwise make a relative symbolic link to the current file.
+This creates relative symbolic links like
+
+ foo -> ../bar/foo
+
+not absolute ones like
+
+ foo -> /ugly/file/name/that/may/change/any/day/bar/foo
+
+For absolute symlinks, use \\[dired-do-symlink]."
+ (interactive "P")
+ (dired-do-create-files 'relsymlink #'dired-make-relative-symlink
+ "RelSymLink" arg dired-keep-marker-relsymlink))
+
+(defun dired-make-relative-symlink (file1 file2 &optional ok-if-already-exists)
+ "Make a symbolic link (pointing to FILE1) in FILE2.
+The link is relative (if possible), for example
+
+ \"/vol/tex/bin/foo\" \"/vol/local/bin/foo\"
+
+results in
+
+ \"../../tex/bin/foo\" \"/vol/local/bin/foo\""
+ (interactive "FRelSymLink: \nFRelSymLink %s: \np")
+ (let (name1 name2 len1 len2 (index 0) sub)
+ (setq file1 (expand-file-name file1)
+ file2 (expand-file-name file2)
+ len1 (length file1)
+ len2 (length file2))
+ ;; Find common initial file name components:
+ (let (next)
+ (while (and (setq next (string-search "/" file1 index))
+ (< (setq next (1+ next)) (min len1 len2))
+ ;; For the comparison, both substrings must end in
+ ;; `/', so NEXT is *one plus* the result of the
+ ;; string-search.
+ ;; E.g., consider the case of linking "/tmp/a/abc"
+ ;; to "/tmp/abc" erroneously giving "/tmp/a" instead
+ ;; of "/tmp/" as common initial component
+ (string-equal (substring file1 0 next)
+ (substring file2 0 next)))
+ (setq index next))
+ (setq name2 file2
+ sub (substring file1 0 index)
+ name1 (substring file1 index)))
+ (if (string-equal sub "/")
+ ;; No common initial file name found
+ (setq name1 file1)
+ ;; Else they have a common parent directory
+ (let ((tem (substring file2 index))
+ (start 0)
+ (count 0))
+ ;; Count number of slashes we must compensate for ...
+ (while (setq start (string-search "/" tem start))
+ (setq count (1+ count)
+ start (1+ start)))
+ ;; ... and prepend a "../" for each slash found:
+ (dotimes (_ count)
+ (setq name1 (concat "../" name1)))))
+ (make-symbolic-link
+ (directory-file-name name1) ; must not link to foo/
+ ; (trailing slash!)
+ name2 ok-if-already-exists)))
+
+;;;###autoload
(defun dired-do-hardlink (&optional arg)
"Add names (hard links) current file or all marked (or next ARG) files.
When operating on just the current file, you specify the new name.
@@ -2680,6 +2748,16 @@ See function `dired-do-rename-regexp' for more info."
#'make-symbolic-link
"SymLink" arg regexp newname whole-name dired-keep-marker-symlink))
+;;;###autoload
+(defun dired-do-relsymlink-regexp (regexp newname &optional arg whole-name)
+ "RelSymlink all marked files containing REGEXP to NEWNAME.
+See functions `dired-do-rename-regexp' and `dired-do-relsymlink'
+for more info."
+ (interactive (dired-mark-read-regexp "RelSymLink"))
+ (dired-do-create-files-regexp
+ #'dired-make-relative-symlink
+ "RelSymLink" arg regexp newname whole-name dired-keep-marker-relsymlink))
+
;;; Change case of file names
@@ -3022,18 +3100,20 @@ When called interactively and not on a subdir line, go to this subdir's line."
;;;###autoload
(defun dired-goto-subdir (dir)
- "Go to end of header line of DIR in this dired buffer.
+ "Go to end of header line of inserted directory DIR in this Dired buffer.
+When called interactively, prompt for the inserted subdirectory
+to go to.
+
Return value of point on success, otherwise return nil.
The next char is \\n."
(interactive
(prog1 ; let push-mark display its message
(list (expand-file-name
- (completing-read "Goto in situ directory: " ; prompt
- dired-subdir-alist ; table
- nil ; predicate
- t ; require-match
- (dired-current-directory))))
- (push-mark)))
+ (completing-read "Goto inserted directory: "
+ dired-subdir-alist nil t
+ (dired-current-directory))))
+ (push-mark))
+ dired-mode)
(setq dir (file-name-as-directory dir))
(let ((elt (assoc dir dired-subdir-alist)))
(and elt
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index ed7f71e0069..9edf8374815 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1,7 +1,6 @@
;;; dired-x.el --- extra Dired functionality -*- lexical-binding:t -*-
-;; Copyright (C) 1993-1994, 1997, 2001-2022 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1993-2022 Free Software Foundation, Inc.
;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
;; Lawrence R. Dodd <dodd@roebling.poly.edu>
@@ -51,11 +50,6 @@
"Extended directory editing (dired-x)."
:group 'dired)
-(defgroup dired-keys nil
- "Dired keys customizations."
- :prefix "dired-"
- :group 'dired-x)
-
(defcustom dired-bind-vm nil
"Non-nil means \"V\" runs `dired-vm', otherwise \"V\" runs `dired-rmail'.
RMAIL files in the old Babyl format (used before Emacs 23.1)
@@ -63,34 +57,16 @@ contain \"-*- rmail -*-\" at the top, so `dired-find-file'
will run `rmail' on these files. New RMAIL files use the standard
mbox format, and so cannot be distinguished in this way."
:type 'boolean
- :group 'dired-keys)
+ :group 'dired-x)
(defvar dired-bind-jump t)
(make-obsolete-variable 'dired-bind-jump "not used." "28.1")
-(defcustom dired-bind-man t
- "Non-nil means bind `dired-man' to \"N\" in Dired, otherwise do not.
-Setting this variable directly after dired-x is loaded has no effect -
-use \\[customize]."
- :type 'boolean
- :set (lambda (sym val)
- (if (set sym val)
- (define-key dired-mode-map "N" 'dired-man)
- (if (eq 'dired-man (lookup-key dired-mode-map "N"))
- (define-key dired-mode-map "N" nil))))
- :group 'dired-keys)
-
-(defcustom dired-bind-info t
- "Non-nil means bind `dired-info' to \"I\" in Dired, otherwise do not.
-Setting this variable directly after dired-x is loaded has no effect -
-use \\[customize]."
- :type 'boolean
- :set (lambda (sym val)
- (if (set sym val)
- (define-key dired-mode-map "I" 'dired-info)
- (if (eq 'dired-info (lookup-key dired-mode-map "I"))
- (define-key dired-mode-map "I" nil))))
- :group 'dired-keys)
+(defvar dired-bind-man t)
+(make-obsolete-variable 'dired-bind-man "not used." "29.1")
+
+(defvar dired-bind-info t)
+(make-obsolete-variable 'dired-bind-info "not used." "29.1")
(defcustom dired-vm-read-only-folders nil
"If non-nil, \\[dired-vm] will visit all folders read-only.
@@ -101,11 +77,12 @@ files not writable by you are visited read-only."
(other :tag "non-writable only" if-file-read-only))
:group 'dired-x)
-(defcustom dired-omit-size-limit 30000
+(defcustom dired-omit-size-limit 100000
"Maximum size for the \"omitting\" feature.
If nil, there is no maximum size."
:type '(choice (const :tag "no maximum" nil) integer)
- :group 'dired-x)
+ :group 'dired-x
+ :version "29.1")
(defcustom dired-omit-case-fold 'filesystem
"Determine whether \"omitting\" patterns are case-sensitive.
@@ -248,17 +225,6 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used."
(string :tag "Switches"))
:group 'dired-x)
-(defcustom dired-clean-up-buffers-too t
- "Non-nil means offer to kill buffers visiting files and dirs deleted in Dired."
- :type 'boolean
- :group 'dired-x)
-
-(defcustom dired-clean-confirm-killing-deleted-buffers t
- "If nil, don't ask whether to kill buffers visiting deleted files."
- :version "26.1"
- :type 'boolean
- :group 'dired-x)
-
;;; Key bindings
@@ -267,15 +233,10 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used."
(define-key dired-mode-map "*O" 'dired-mark-omitted)
(define-key dired-mode-map "*." 'dired-mark-extension))
-(when (keymapp (lookup-key dired-mode-map "%"))
- (define-key dired-mode-map "%Y" 'dired-do-relsymlink-regexp))
-
(define-key dired-mode-map "\C-x\M-o" 'dired-omit-mode)
(define-key dired-mode-map "\M-(" 'dired-mark-sexp)
(define-key dired-mode-map "\M-!" 'dired-smart-shell-command)
-(define-key dired-mode-map "\M-G" 'dired-goto-subdir)
(define-key dired-mode-map "F" 'dired-do-find-marked-files)
-(define-key dired-mode-map "Y" 'dired-do-relsymlink)
(define-key dired-mode-map "V" 'dired-do-run-mail)
@@ -286,12 +247,6 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used."
["Find Files" dired-do-find-marked-files
:help "Find current or marked files"]
"Shell Command...")
- (easy-menu-add-item menu '("Operate")
- ["Relative Symlink to..." dired-do-relsymlink
- :visible (fboundp 'make-symbolic-link)
- :help "Make relative symbolic links for current or \
-marked files"]
- "Hardlink to...")
(easy-menu-add-item menu '("Mark")
["Flag Extension..." dired-flag-extension
:help "Flag files with a certain extension for deletion"]
@@ -305,12 +260,6 @@ marked files"]
:help "Mark files matching `dired-omit-files' \
and `dired-omit-extensions'"]
"Unmark All")
- (easy-menu-add-item menu '("Regexp")
- ["Relative Symlink..." dired-do-relsymlink-regexp
- :visible (fboundp 'make-symbolic-link)
- :help "Make relative symbolic links for files \
-matching regexp"]
- "Hardlink...")
(easy-menu-add-item menu '("Immediate")
["Omit Mode" dired-omit-mode
:style toggle :selected dired-omit-mode
@@ -328,8 +277,6 @@ files"]
"Automatically put on `dired-mode-hook' to get extra Dired features:
\\<dired-mode-map>
\\[dired-do-run-mail]\t-- run mail on folder (see `dired-bind-vm')
- \\[dired-info]\t-- run info on file
- \\[dired-man]\t-- run man on file
\\[dired-do-find-marked-files]\t-- visit all marked files simultaneously
\\[dired-omit-mode]\t-- toggle omitting of files
\\[dired-mark-sexp]\t-- mark by Lisp expression
@@ -338,10 +285,8 @@ To see the options you can set, use \\[customize-group] RET dired-x RET.
See also the functions:
`dired-flag-extension'
`dired-virtual'
- `dired-man'
`dired-vm'
`dired-rmail'
- `dired-info'
`dired-do-find-marked-files'"
(interactive)
;; These must be done in each new dired buffer.
@@ -1078,95 +1023,6 @@ See `dired-guess-shell-alist-user'."
(if (equal val "") default val))))
-;;; Relative symbolic links
-
-(declare-function make-symbolic-link "fileio.c")
-
-(defvar dired-keep-marker-relsymlink ?S
- "See variable `dired-keep-marker-move'.")
-
-(defun dired-make-relative-symlink (file1 file2 &optional ok-if-already-exists)
- "Make a symbolic link (pointing to FILE1) in FILE2.
-The link is relative (if possible), for example
-
- \"/vol/tex/bin/foo\" \"/vol/local/bin/foo\"
-
-results in
-
- \"../../tex/bin/foo\" \"/vol/local/bin/foo\""
- (interactive "FRelSymLink: \nFRelSymLink %s: \np")
- (let (name1 name2 len1 len2 (index 0) sub)
- (setq file1 (expand-file-name file1)
- file2 (expand-file-name file2)
- len1 (length file1)
- len2 (length file2))
- ;; Find common initial file name components:
- (let (next)
- (while (and (setq next (string-search "/" file1 index))
- (< (setq next (1+ next)) (min len1 len2))
- ;; For the comparison, both substrings must end in
- ;; `/', so NEXT is *one plus* the result of the
- ;; string-search.
- ;; E.g., consider the case of linking "/tmp/a/abc"
- ;; to "/tmp/abc" erroneously giving "/tmp/a" instead
- ;; of "/tmp/" as common initial component
- (string-equal (substring file1 0 next)
- (substring file2 0 next)))
- (setq index next))
- (setq name2 file2
- sub (substring file1 0 index)
- name1 (substring file1 index)))
- (if (string-equal sub "/")
- ;; No common initial file name found
- (setq name1 file1)
- ;; Else they have a common parent directory
- (let ((tem (substring file2 index))
- (start 0)
- (count 0))
- ;; Count number of slashes we must compensate for ...
- (while (setq start (string-search "/" tem start))
- (setq count (1+ count)
- start (1+ start)))
- ;; ... and prepend a "../" for each slash found:
- (dotimes (_ count)
- (setq name1 (concat "../" name1)))))
- (make-symbolic-link
- (directory-file-name name1) ; must not link to foo/
- ; (trailing slash!)
- name2 ok-if-already-exists)))
-
-(autoload 'dired-do-create-files "dired-aux")
-
-;;;###autoload
-(defun dired-do-relsymlink (&optional arg)
- "Relative symlink all marked (or next ARG) files into a directory.
-Otherwise make a relative symbolic link to the current file.
-This creates relative symbolic links like
-
- foo -> ../bar/foo
-
-not absolute ones like
-
- foo -> /ugly/file/name/that/may/change/any/day/bar/foo
-
-For absolute symlinks, use \\[dired-do-symlink]."
- (interactive "P")
- (dired-do-create-files 'relsymlink #'dired-make-relative-symlink
- "RelSymLink" arg dired-keep-marker-relsymlink))
-
-(autoload 'dired-mark-read-regexp "dired-aux")
-(autoload 'dired-do-create-files-regexp "dired-aux")
-
-(defun dired-do-relsymlink-regexp (regexp newname &optional arg whole-name)
- "RelSymlink all marked files containing REGEXP to NEWNAME.
-See functions `dired-do-rename-regexp' and `dired-do-relsymlink'
-for more info."
- (interactive (dired-mark-read-regexp "RelSymLink"))
- (dired-do-create-files-regexp
- #'dired-make-relative-symlink
- "RelSymLink" arg regexp newname whole-name dired-keep-marker-relsymlink))
-
-
;;; Visit all marked files simultaneously
;; Brief Description:
@@ -1238,31 +1094,6 @@ NOSELECT the files are merely found but not selected."
;;; Miscellaneous commands
-;; Run man on files.
-
-(declare-function Man-getpage-in-background "man" (topic))
-
-(defvar manual-program) ; from man.el
-
-(defun dired-man ()
- "Run `man' on this file."
- ;; Used also to say: "Display old buffer if buffer name matches filename."
- ;; but I have no idea what that means.
- (interactive)
- (require 'man)
- (let* ((file (dired-get-filename))
- (manual-program (string-replace "*" "%s"
- (dired-guess-shell-command
- "Man command: " (list file)))))
- (Man-getpage-in-background file)))
-
-;; Run Info on files.
-
-(defun dired-info ()
- "Run `info' on this file."
- (interactive)
- (info (dired-get-filename)))
-
;; Run mail on mail folders.
(declare-function vm-visit-folder "ext:vm" (folder &optional read-only))
@@ -1306,14 +1137,6 @@ otherwise."
;;; Miscellaneous internal functions
-;; This should be a builtin
-(defun dired-buffer-more-recently-used-p (buffer1 buffer2)
- "Return t if BUFFER1 is more recently used than BUFFER2.
-Considers buffers closer to the car of `buffer-list' to be more recent."
- (and (not (equal buffer1 buffer2))
- (memq buffer1 (buffer-list))
- (not (memq buffer1 (memq buffer2 (buffer-list))))))
-
;; Needed if ls -lh is supported and also for GNU ls -ls.
(defun dired-x--string-to-number (str)
"Like `string-to-number' but recognize a trailing unit prefix.
@@ -1589,13 +1412,8 @@ If `current-prefix-arg' is non-nil, uses name at point as guess."
nil (file-name-nondirectory guess)))
(read-file-name prompt default-directory)))
-(define-obsolete-function-alias 'read-filename-at-point
- 'dired-x-read-filename-at-point "24.1") ; is this even needed?
-
-
-;;; Epilog
-
-(define-obsolete-function-alias 'dired-x-submit-report 'report-emacs-bug "24.1")
+(define-obsolete-function-alias 'dired-man #'dired-do-man "29.1")
+(define-obsolete-function-alias 'dired-info #'dired-do-info "29.1")
;; As Barry Warsaw would say: "This might be useful..."
diff --git a/lisp/dired.el b/lisp/dired.el
index 55e150e9e04..43563d969f1 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -40,9 +40,6 @@
(require 'dired-loaddefs nil t)
(require 'dnd)
-(declare-function dired-buffer-more-recently-used-p
- "dired-x" (buffer1 buffer2))
-
;;; Customizable variables
@@ -106,10 +103,10 @@ If `dired-maybe-use-globstar' is non-nil, then `dired-insert-directory'
checks this alist to enable globstar in the shell subprocess.")
(defcustom dired-chown-program
- (purecopy (cond ((executable-find "chown") "chown")
- ((file-executable-p "/usr/sbin/chown") "/usr/sbin/chown")
- ((file-executable-p "/etc/chown") "/etc/chown")
- (t "chown")))
+ (cond ((executable-find "chown") "chown")
+ ((file-executable-p "/usr/sbin/chown") "/usr/sbin/chown")
+ ((file-executable-p "/etc/chown") "/etc/chown")
+ (t "chown"))
"Name of chown command (usually `chown')."
:group 'dired
:type 'file)
@@ -164,7 +161,7 @@ always set this variable to t."
:type 'boolean
:group 'dired-mark)
-(defcustom dired-trivial-filenames (purecopy "\\`\\.\\.?\\'\\|\\`\\.?#")
+(defcustom dired-trivial-filenames "\\`\\.\\.?\\'\\|\\`\\.?#"
"Regexp of files to skip when finding first file of a directory.
A value of nil means move to the subdir line.
A value of t means move to first file."
@@ -210,6 +207,11 @@ If a character, new links are unconditionally marked with that character."
(character :tag "Mark"))
:group 'dired-mark)
+(defvar dired-keep-marker-relsymlink ?S
+ "Controls marking of newly made relative symbolic links.
+If t, they are marked if and as the files linked to were marked.
+If a character, new links are unconditionally marked with that character.")
+
(defcustom dired-free-space 'first
"Whether and how to display the amount of free disk space in Dired buffers.
If nil, don't display.
@@ -2079,8 +2081,10 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
"D" #'dired-do-delete
"G" #'dired-do-chgrp
"H" #'dired-do-hardlink
+ "I" #'dired-do-info
"L" #'dired-do-load
"M" #'dired-do-chmod
+ "N" #'dired-do-man
"O" #'dired-do-chown
"P" #'dired-do-print
"Q" #'dired-do-find-regexp-and-replace
@@ -2088,6 +2092,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
"S" #'dired-do-symlink
"T" #'dired-do-touch
"X" #'dired-do-shell-command
+ "Y" #'dired-do-relsymlink
"Z" #'dired-do-compress
"c" #'dired-do-compress-to
"!" #'dired-do-shell-command
@@ -2117,6 +2122,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
"% H" #'dired-do-hardlink-regexp
"% R" #'dired-do-rename-regexp
"% S" #'dired-do-symlink-regexp
+ "% Y" #'dired-do-relsymlink-regexp
"% &" #'dired-flag-garbage-files
;; Commands for marking and unmarking.
"* *" #'dired-mark-executables
@@ -2168,6 +2174,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
"S-SPC" #'dired-previous-line
"<remap> <next-line>" #'dired-next-line
"<remap> <previous-line>" #'dired-previous-line
+ "M-G" #'dired-goto-subdir
;; hiding
"$" #'dired-hide-subdir
"M-$" #'dired-hide-all
@@ -2294,6 +2301,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
["Symlink..." dired-do-symlink-regexp
:visible (fboundp 'make-symbolic-link)
:help "Make symbolic links for files matching regexp"]
+ ["Relative Symlink..." dired-do-relsymlink-regexp
+ :visible (fboundp 'make-symbolic-link)
+ :help "Make relative symbolic links for files matching regexp"]
["Hardlink..." dired-do-hardlink-regexp
:help "Make hard links for files matching regexp"]
["Upcase" dired-upcase
@@ -2363,6 +2373,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
["Symlink to..." dired-do-symlink
:visible (fboundp 'make-symbolic-link)
:help "Make symbolic links for current or marked files"]
+ ["Relative Symlink to..." dired-do-relsymlink
+ :visible (fboundp 'make-symbolic-link)
+ :help "Make relative symbolic links for current or marked files"]
["Hardlink to..." dired-do-hardlink
:help "Make hard links for current or marked files"]
["Print..." dired-do-print
@@ -2467,7 +2480,7 @@ Type \\[dired-do-copy] to Copy files.
Type \\[dired-sort-toggle-or-edit] to toggle Sorting by name/date or change the `ls' switches.
Type \\[revert-buffer] to read all currently expanded directories aGain.
This retains all marks and hides subdirs again that were hidden before.
-Use `SPC' and `DEL' to move down and up by lines.
+Use \\`SPC' and \\`DEL' to move down and up by lines.
If Dired ever gets confused, you can either type \\[revert-buffer] \
to read the
@@ -3490,6 +3503,14 @@ is the directory where the file on this line resides."
(point-max)
(point))))
+;; This should be a builtin
+(defun dired-buffer-more-recently-used-p (buffer1 buffer2)
+ "Return t if BUFFER1 is more recently used than BUFFER2.
+Considers buffers closer to the car of `buffer-list' to be more recent."
+ (and (not (equal buffer1 buffer2))
+ (memq buffer1 (buffer-list))
+ (not (memq buffer1 (memq buffer2 (buffer-list))))))
+
;;; Deleting files
@@ -3690,13 +3711,21 @@ See `dired-delete-file' in case you wish that."
(dired-remove-entry file)
(dired-clean-up-after-deletion file))
-(defvar dired-clean-up-buffers-too)
-(defvar dired-clean-confirm-killing-deleted-buffers)
+(defcustom dired-clean-up-buffers-too t
+ "Non-nil means offer to kill buffers visiting files and dirs deleted in Dired."
+ :type 'boolean
+ :group 'dired)
+
+(defcustom dired-clean-confirm-killing-deleted-buffers t
+ "If nil, don't ask whether to kill buffers visiting deleted files."
+ :type 'boolean
+ :group 'dired
+ :version "26.1")
(defun dired-clean-up-after-deletion (fn)
"Clean up after a deleted file or directory FN.
-Removes any expanded subdirectory of deleted directory. If
-`dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil,
+Removes any expanded subdirectory of deleted directory.
+If `dired-clean-up-buffers-too' is non-nil,
kill any buffers visiting those files, prompting for
confirmation. To disable the confirmation, see
`dired-clean-confirm-killing-deleted-buffers'."
@@ -4795,6 +4824,42 @@ Interactively with prefix argument, read FILE-NAME."
(read-file-name "Jump to Dired file: "))))
(dired-jump t file-name))
+(defvar-keymap dired-jump-map
+ :doc "Keymap to repeat `dired-jump'. Used in `repeat-mode'."
+ "j" #'dired-jump
+ "C-j" #'dired-jump)
+(put 'dired-jump 'repeat-map 'dired-jump-map)
+
+
+;;; Miscellaneous commands
+
+(declare-function Man-getpage-in-background "man" (topic))
+(declare-function dired-guess-shell-command "dired-x" (prompt files))
+(defvar manual-program) ; from man.el
+
+(defun dired-do-man ()
+ "In Dired, run `man' on this file."
+ (interactive nil dired-mode)
+ (require 'man)
+ ;; FIXME: Move `dired-guess-shell-command' to dired.el to remove the
+ ;; need for requiring `dired-x'.
+ (require 'dired-x)
+ (let* ((file (dired-get-file-for-visit))
+ (manual-program (string-replace "*" "%s"
+ (dired-guess-shell-command
+ "Man command: " (list file)))))
+ (Man-getpage-in-background file)))
+
+(defun dired-do-info ()
+ "In Dired, run `info' on this file."
+ (interactive nil dired-mode)
+ (info (dired-get-file-for-visit)))
+
+(defun dired-do-eww ()
+ "In Dired, visit file in EWW."
+ (interactive nil dired-mode)
+ (eww-open-file (dired-get-file-for-visit)))
+
(provide 'dired)
(run-hooks 'dired-load-hook) ; for your customizations
diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el
index da60840f8b2..4f092f95e06 100644
--- a/lisp/dirtrack.el
+++ b/lisp/dirtrack.el
@@ -26,13 +26,14 @@
;; Shell directory tracking by watching the prompt.
;;
;; This is yet another attempt at a directory-tracking package for
-;; Emacs shell-mode. However, this package makes one strong assumption:
-;; that you can customize your shell's prompt to contain the
-;; current working directory. Most shells do support this, including
-;; almost every type of Bourne and C shell on Unix, the native shells on
-;; Windows95 (COMMAND.COM) and Windows NT (CMD.EXE), and most 3rd party
-;; Windows shells. If you cannot do this, or do not wish to, this package
-;; will be useless to you.
+;; Emacs shell-mode. However, this package makes one strong
+;; assumption: that you can customize your shell's prompt to contain
+;; the current working directory. Most shells do support this,
+;; including almost every type of Bourne and C shell on Unix, the
+;; native shells on Windows 9X (COMMAND.COM) and modern MS-Windows
+;; systems (cmd.exe), and most 3rd party MS-Windows shells. If you
+;; cannot do this, or do not wish to, this package will be useless to
+;; you.
;;
;; Installation:
;;
@@ -63,7 +64,7 @@
;;
;; Examples:
;;
-;; 1) On Windows NT, my prompt is set to emacs$S$P$G.
+;; 1) On MS-Windows, my prompt is set to emacs$S$P$G.
;; 'dirtrack-list' is set to (list "^emacs \\([a-zA-Z]:.*\\)>" 1)
;;
;; 2) On Solaris running bash, my prompt is set like this:
@@ -92,7 +93,7 @@
;; A final note:
;;
;; I run LOTS of shell buffers through Emacs, sometimes as different users
-;; (eg, when logged in as myself, I'll run a root shell in the same Emacs).
+;; (e.g., when logged in as myself, I'll run a root shell in the same Emacs).
;; If you do this, and the shell prompt contains a ~, Emacs will interpret
;; this relative to the user which owns the Emacs process, not the user
;; who owns the shell buffer. This may cause dirtrack to behave strangely
@@ -100,7 +101,7 @@
;; with a ~ in it).
;;
;; The same behavior can occur if you use dirtrack with remote filesystems
-;; (using telnet, rlogin, etc) as Emacs will be checking the local
+;; (using telnet, ssh, etc.) as Emacs will be checking the local
;; filesystem, not the remote one. This problem is not specific to dirtrack,
;; but also affects file completion, etc.
diff --git a/lisp/dnd.el b/lisp/dnd.el
index 29f4ca98ec8..70852885a86 100644
--- a/lisp/dnd.el
+++ b/lisp/dnd.el
@@ -327,7 +327,7 @@ in that list instead."
"Begin dragging TEXT from FRAME.
Initate a drag-and-drop operation allowing the user to drag text
from Emacs to another program (the drop target), then block until
-the drop is completed or is cancelled.
+the drop is completed or is canceled.
If the drop completed, return the action that the drop target
actually performed, which can be one of the following symbols:
@@ -341,14 +341,14 @@ actually performed, which can be one of the following symbols:
- `private', which means the drop target chose to perform an
unspecified action.
-Return nil if the drop was cancelled.
+Return nil if the drop was canceled.
TEXT is a string containing text that will be inserted by the
program where the drop happened. FRAME is the frame where the
mouse is currently held down, or nil, which stands for the
current frame. ACTION is one of the symbols `copy' or `move',
where `copy' means that the text should be inserted by the drop
-target, and `move' means the the same as `copy', but in addition
+target, and `move' means the same as `copy', but in addition
the caller might have to delete TEXT from its source after this
function returns. If ALLOW-SAME-FRAME is nil, ignore any drops
on FRAME itself.
@@ -383,7 +383,7 @@ currently being held down. It should only be called upon a
"Begin dragging FILE from FRAME.
Initate a drag-and-drop operation allowing the user to drag a file
from Emacs to another program (the drop target), then block until
-the drop happens or is cancelled.
+the drop happens or is canceled.
Return the action that the drop target actually performed, which
can be one of the following symbols:
@@ -399,7 +399,7 @@ can be one of the following symbols:
- `private', which means the drop target chose to perform an
unspecified action.
-Return nil if the drop was cancelled.
+Return nil if the drop was canceled.
FILE is the file name that will be sent to the program where the
drop happened. If it is a remote file, Emacs will make a
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 63be1b16f3d..f05ec938e55 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -225,7 +225,7 @@ are available (see Info node `(emacs)Document View')"
(defcustom doc-view-resolution 100
"Dots per inch resolution used to render the documents.
Higher values result in larger images."
- :type 'number)
+ :type 'natnum)
(defvar doc-view-doc-type nil
"The type of document in the current buffer.
@@ -238,7 +238,7 @@ Can be `dvi', `pdf', `ps', `djvu', `odf', `epub', `cbz', `fb2',
(defun doc-view--epub-reconvert (&optional _event)
"Reconvert all epub buffers.
-EVENT is unused, but neccesary to work with the filenotify API"
+EVENT is unused, but necessary to work with the filenotify API."
(dolist (x (buffer-list))
(with-current-buffer x
(when (eq doc-view-doc-type 'epub)
@@ -301,7 +301,7 @@ scaling."
Has only an effect if `doc-view-scale-internally' is non-nil and support for
scaling is compiled into Emacs."
:version "24.1"
- :type 'number)
+ :type 'natnum)
(defcustom doc-view-dvipdfm-program "dvipdfm"
"Program to convert DVI files to PDF.
@@ -378,7 +378,8 @@ After such a refresh newly converted pages will be available for
viewing. If set to nil there won't be any refreshes and the
pages won't be displayed before conversion of the whole document
has finished."
- :type 'integer)
+ :type '(choice natnum
+ (const :value nil :tag "No refreshes")))
(defcustom doc-view-continuous nil
"In Continuous mode reaching the page edge advances to next/previous page.
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index ea54eea6036..edbe9e494f1 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -231,9 +231,6 @@ returned unaltered."
(add-hook 'before-init-hook 'dos-reevaluate-defcustoms)
-(define-obsolete-variable-alias
- 'register-name-alist 'dos-register-name-alist "24.1")
-
(defvar dos-register-name-alist
'((ax . 0) (bx . 1) (cx . 2) (dx . 3) (si . 4) (di . 5)
(cflag . 6) (flags . 7)
@@ -243,8 +240,6 @@ returned unaltered."
(defun dos-make-register ()
(make-vector 8 0))
-(define-obsolete-function-alias 'make-register 'dos-make-register "24.1")
-
(defun dos-register-value (regs name)
(let ((where (cdr (assoc name dos-register-name-alist))))
(cond ((consp where)
@@ -256,8 +251,6 @@ returned unaltered."
(aref regs where))
(t nil))))
-(define-obsolete-function-alias 'register-value 'dos-register-value "24.1")
-
(defun dos-set-register-value (regs name value)
(and (numberp value)
(>= value 0)
@@ -274,9 +267,6 @@ returned unaltered."
(aset regs where (logand value 65535))))))
regs)
-(define-obsolete-function-alias
- 'set-register-value 'dos-set-register-value "24.1")
-
(defsubst dos-intdos (regs)
"Issue the DOS Int 21h with registers REGS.
@@ -284,8 +274,6 @@ REGS should be a vector produced by `dos-make-register'
and `dos-set-register-value', which see."
(int86 33 regs))
-(define-obsolete-function-alias 'intdos 'dos-intdos "24.1")
-
;; Backward compatibility for obsolescent functions which
;; set screen size.
@@ -294,8 +282,6 @@ and `dos-set-register-value', which see."
(interactive)
(set-frame-size (selected-frame) 80 25))
-(define-obsolete-function-alias 'mode25 'dos-mode25 "24.1")
-
(defun dos-mode4350 ()
"Change the number of rows to 43 or 50.
Emacs always tries to set the screen height to 50 rows first.
@@ -307,8 +293,6 @@ that your video hardware might not support 50-line mode."
nil ; the original built-in function returned nil
(set-frame-size (selected-frame) 80 43)))
-(define-obsolete-function-alias 'mode4350 'dos-mode4350 "24.1")
-
(provide 'dos-fns)
;;; dos-fns.el ends here
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index fa4d6d9849c..e5adb0dda73 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -188,6 +188,30 @@ be considered.")
;; I also find it often preferable not to pair next to a word.
(eq (char-syntax (following-char)) ?w)))
+(defmacro electric-pair--with-syntax (string-or-comment &rest body)
+ "Run BODY with appropriate syntax table active.
+STRING-OR-COMMENT is the start position of the string/comment
+in which we are, if applicable.
+Uses the text-mode syntax table if within a string or a comment."
+ (declare (debug t) (indent 1))
+ `(electric-pair--with-syntax-1 ,string-or-comment (lambda () ,@body)))
+
+(defun electric-pair--with-syntax-1 (string-or-comment body-fun)
+ (if (not string-or-comment)
+ (funcall body-fun)
+ ;; Here we assume that the `syntax-ppss' cache has already been filled
+ ;; past `string-or-comment' with data corresponding to the "normal" syntax
+ ;; (this should be the case because STRING-OR-COMMENT was returned
+ ;; in the `nth 8' of `syntax-ppss').
+ ;; Maybe we should narrow-to-region so that `syntax-ppss' uses the narrow
+ ;; cache?
+ (syntax-ppss-flush-cache string-or-comment)
+ (let ((syntax-propertize-function nil))
+ (unwind-protect
+ (with-syntax-table electric-pair-text-syntax-table
+ (funcall body-fun))
+ (syntax-ppss-flush-cache string-or-comment)))))
+
(defun electric-pair-syntax-info (command-event)
"Calculate a list (SYNTAX PAIR UNCONDITIONAL STRING-OR-COMMENT-START).
@@ -202,13 +226,11 @@ inside a comment or string."
(post-string-or-comment (nth 8 (syntax-ppss (point))))
(string-or-comment (and post-string-or-comment
pre-string-or-comment))
- (table (if string-or-comment
- electric-pair-text-syntax-table
- (syntax-table)))
- (table-syntax-and-pair (with-syntax-table table
- (list (char-syntax command-event)
- (or (matching-paren command-event)
- command-event))))
+ (table-syntax-and-pair
+ (electric-pair--with-syntax string-or-comment
+ (list (char-syntax command-event)
+ (or (matching-paren command-event)
+ command-event))))
(fallback (if string-or-comment
(append electric-pair-text-pairs
electric-pair-pairs)
@@ -237,22 +259,6 @@ inside a comment or string."
(electric-layout-allow-duplicate-newlines t))
(self-insert-command 1)))
-(cl-defmacro electric-pair--with-uncached-syntax ((table &optional start) &rest body)
- "Like `with-syntax-table', but flush the `syntax-ppss' cache afterwards.
-Use this instead of (with-syntax-table TABLE BODY) when BODY
-contains code which may update the `syntax-ppss' cache. This
-includes calling `parse-partial-sexp' and any sexp-based movement
-functions when `parse-sexp-lookup-properties' is non-nil. The
-cache is flushed from position START, defaulting to point."
- (declare (debug ((form &optional form) body)) (indent 1))
- (let ((start-var (make-symbol "start")))
- `(let ((syntax-propertize-function #'ignore)
- (,start-var ,(or start '(point))))
- (unwind-protect
- (with-syntax-table ,table
- ,@body)
- (syntax-ppss-flush-cache ,start-var)))))
-
(defun electric-pair--syntax-ppss (&optional pos where)
"Like `syntax-ppss', but sometimes fallback to `parse-partial-sexp'.
@@ -271,8 +277,7 @@ when to fallback to `parse-partial-sexp'."
(skip-syntax-forward " >!")
(point)))))
(if s-or-c-start
- (electric-pair--with-uncached-syntax (electric-pair-text-syntax-table
- s-or-c-start)
+ (electric-pair--with-syntax s-or-c-start
(parse-partial-sexp s-or-c-start pos))
;; HACK! cc-mode apparently has some `syntax-ppss' bugs
(if (memq major-mode '(c-mode c++ mode))
@@ -290,7 +295,8 @@ when to fallback to `parse-partial-sexp'."
(defun electric-pair--balance-info (direction string-or-comment)
"Examine lists forward or backward according to DIRECTION's sign.
-STRING-OR-COMMENT is info suitable for running `parse-partial-sexp'.
+STRING-OR-COMMENT is the position of the start of the comment/string
+in which we are, if applicable.
Return a cons of two descriptions (MATCHED-P . PAIR) for the
innermost and outermost lists that enclose point. The outermost
@@ -301,9 +307,6 @@ If the outermost list is matched, don't rely on its PAIR.
If point is not enclosed by any lists, return ((t) . (t))."
(let* (innermost
outermost
- (table (if string-or-comment
- electric-pair-text-syntax-table
- (syntax-table)))
(at-top-level-or-equivalent-fn
;; called when `scan-sexps' ran perfectly, when it found
;; a parenthesis pointing in the direction of travel.
@@ -325,11 +328,11 @@ If point is not enclosed by any lists, return ((t) . (t))."
(cond ((< direction 0)
(condition-case nil
(eq (char-after pos)
- (electric-pair--with-uncached-syntax
- (table)
- (matching-paren
- (char-before
- (scan-sexps (point) 1)))))
+ (electric-pair--with-syntax
+ string-or-comment
+ (matching-paren
+ (char-before
+ (scan-sexps (point) 1)))))
(scan-error nil)))
(t
;; In this case, no need to use
@@ -343,7 +346,8 @@ If point is not enclosed by any lists, return ((t) . (t))."
(opener (char-after start)))
(and start
(eq (char-before pos)
- (or (with-syntax-table table
+ (or (electric-pair--with-syntax
+ string-or-comment
(matching-paren opener))
opener))))))))
(actual-pair (if (> direction 0)
@@ -356,7 +360,7 @@ If point is not enclosed by any lists, return ((t) . (t))."
(save-excursion
(while (not outermost)
(condition-case err
- (electric-pair--with-uncached-syntax (table)
+ (electric-pair--with-syntax string-or-comment
(scan-sexps (point) (if (> direction 0)
(point-max)
(- (point-max))))
@@ -503,8 +507,8 @@ The decision is taken by order of preference:
* According to C's syntax and the syntactic state of the buffer
(both as defined by the major mode's syntax table). This is
- done by looking up up the variables
- `electric-pair-inhibit-predicate', `electric-pair-skip-self'
+ done by looking up the variables
+ `electric-pair-inhibit-predicate', `electric-pair-skip-self'
and `electric-pair-skip-whitespace' (which see)."
(let* ((pos (and electric-pair-mode (electric--after-char-pos)))
(skip-whitespace-info))
@@ -575,7 +579,7 @@ The decision is taken by order of preference:
(save-excursion (electric-pair--insert pair))))))))
(defun electric-pair-open-newline-between-pairs-psif ()
- "Honour `electric-pair-open-newline-between-pairs'.
+ "Honor `electric-pair-open-newline-between-pairs'.
Member of `post-self-insert-hook' if `electric-pair-mode' is on."
(when (and (if (functionp electric-pair-open-newline-between-pairs)
(funcall electric-pair-open-newline-between-pairs)
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 3231877a30c..4f98bf3f4f5 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -58,7 +58,8 @@ Backtrace mode will attempt to abbreviate printing of backtrace
frames by setting `print-level' and `print-length' to make them
shorter than this, but success is not guaranteed. If set to nil
or zero, backtrace mode will not abbreviate the forms it prints."
- :type 'integer
+ :type '(choice natnum
+ (const :value nil :tag "Don't abbreviate"))
:group 'backtrace
:version "27.1")
@@ -199,63 +200,63 @@ functions returns non-nil. When adding a function to this hook,
you should also set the :source-available flag for the backtrace
frames where the source code location is known.")
-(defvar backtrace-mode-map
- (let ((map (copy-keymap special-mode-map)))
- (set-keymap-parent map button-buffer-map)
- (define-key map "n" 'backtrace-forward-frame)
- (define-key map "p" 'backtrace-backward-frame)
- (define-key map "v" 'backtrace-toggle-locals)
- (define-key map "#" 'backtrace-toggle-print-circle)
- (define-key map ":" 'backtrace-toggle-print-gensym)
- (define-key map "s" 'backtrace-goto-source)
- (define-key map "\C-m" 'backtrace-help-follow-symbol)
- (define-key map "+" 'backtrace-multi-line)
- (define-key map "-" 'backtrace-single-line)
- (define-key map "." 'backtrace-expand-ellipses)
- (define-key map [follow-link] 'mouse-face)
- (define-key map [mouse-2] 'mouse-select-window)
- (easy-menu-define nil map ""
- '("Backtrace"
- ["Next Frame" backtrace-forward-frame
- :help "Move cursor forwards to the start of a backtrace frame"]
- ["Previous Frame" backtrace-backward-frame
- :help "Move cursor backwards to the start of a backtrace frame"]
- "--"
- ["Show Variables" backtrace-toggle-locals
- :style toggle
- :active (backtrace-get-index)
- :selected (plist-get (backtrace-get-view) :show-locals)
- :help "Show or hide the local variables for the frame at point"]
- ["Show Circular Structures" backtrace-toggle-print-circle
- :style toggle
- :active (backtrace-get-index)
- :selected (plist-get (backtrace-get-view) :print-circle)
- :help
- "Condense or expand shared or circular structures in the frame at point"]
- ["Show Uninterned Symbols" backtrace-toggle-print-gensym
- :style toggle
- :active (backtrace-get-index)
- :selected (plist-get (backtrace-get-view) :print-gensym)
- :help
- "Toggle unique printing of uninterned symbols in the frame at point"]
- ["Expand \"...\"s" backtrace-expand-ellipses
- :help "Expand all the abbreviated forms in the current frame"]
- ["Show on Multiple Lines" backtrace-multi-line
- :help "Use line breaks and indentation to make a form more readable"]
- ["Show on Single Line" backtrace-single-line]
- "--"
- ["Go to Source" backtrace-goto-source
- :active (and (backtrace-get-index)
- (plist-get (backtrace-frame-flags
- (nth (backtrace-get-index) backtrace-frames))
- :source-available))
- :help "Show the source code for the current frame"]
- ["Help for Symbol" backtrace-help-follow-symbol
- :help "Show help for symbol at point"]
- ["Describe Backtrace Mode" describe-mode
- :help "Display documentation for backtrace-mode"]))
- map)
- "Local keymap for `backtrace-mode' buffers.")
+(defvar-keymap backtrace-mode-map
+ :doc "Local keymap for `backtrace-mode' buffers."
+ :parent (make-composed-keymap special-mode-map
+ button-buffer-map)
+ "n" #'backtrace-forward-frame
+ "p" #'backtrace-backward-frame
+ "v" #'backtrace-toggle-locals
+ "#" #'backtrace-toggle-print-circle
+ ":" #'backtrace-toggle-print-gensym
+ "s" #'backtrace-goto-source
+ "RET" #'backtrace-help-follow-symbol
+ "+" #'backtrace-multi-line
+ "-" #'backtrace-single-line
+ "." #'backtrace-expand-ellipses
+ "<follow-link>" 'mouse-face
+ "<mouse-2>" #'mouse-select-window
+
+ :menu
+ '("Backtrace"
+ ["Next Frame" backtrace-forward-frame
+ :help "Move cursor forwards to the start of a backtrace frame"]
+ ["Previous Frame" backtrace-backward-frame
+ :help "Move cursor backwards to the start of a backtrace frame"]
+ "--"
+ ["Show Variables" backtrace-toggle-locals
+ :style toggle
+ :active (backtrace-get-index)
+ :selected (plist-get (backtrace-get-view) :show-locals)
+ :help "Show or hide the local variables for the frame at point"]
+ ["Show Circular Structures" backtrace-toggle-print-circle
+ :style toggle
+ :active (backtrace-get-index)
+ :selected (plist-get (backtrace-get-view) :print-circle)
+ :help
+ "Condense or expand shared or circular structures in the frame at point"]
+ ["Show Uninterned Symbols" backtrace-toggle-print-gensym
+ :style toggle
+ :active (backtrace-get-index)
+ :selected (plist-get (backtrace-get-view) :print-gensym)
+ :help
+ "Toggle unique printing of uninterned symbols in the frame at point"]
+ ["Expand \"...\"s" backtrace-expand-ellipses
+ :help "Expand all the abbreviated forms in the current frame"]
+ ["Show on Multiple Lines" backtrace-multi-line
+ :help "Use line breaks and indentation to make a form more readable"]
+ ["Show on Single Line" backtrace-single-line]
+ "--"
+ ["Go to Source" backtrace-goto-source
+ :active (and (backtrace-get-index)
+ (plist-get (backtrace-frame-flags
+ (nth (backtrace-get-index) backtrace-frames))
+ :source-available))
+ :help "Show the source code for the current frame"]
+ ["Help for Symbol" backtrace-help-follow-symbol
+ :help "Show help for symbol at point"]
+ ["Describe Backtrace Mode" describe-mode
+ :help "Display documentation for backtrace-mode"]))
(defconst backtrace--flags-width 2
"Width in characters of the flags for a backtrace frame.")
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 352ac40663c..a24a5044562 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -171,7 +171,7 @@ Earlier variables shadow later ones with the same name.")
(if (eq fn localfn)
;; From the same file => same mode.
(macroexp--unfold-lambda `(,fn ,@(cdr form)))
- ;; Since we are called from inside the optimiser, we need to make
+ ;; Since we are called from inside the optimizer, we need to make
;; sure not to propagate lexvar values.
(let ((byte-optimize--lexvars nil)
;; Silence all compilation warnings: the useful ones should
@@ -204,7 +204,7 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.")
This indicates the loop discovery phase.")
(defvar byte-optimize--dynamic-vars nil
- "List of variables declared as dynamic during optimisation.")
+ "List of variables declared as dynamic during optimization.")
(defvar byte-optimize--aliased-vars nil
"List of variables which may be aliased by other lexical variables.
@@ -315,7 +315,7 @@ for speeding up processing.")
(`(cond . ,clauses)
;; FIXME: The condition in the first clause is always executed, and
;; clause bodies are mutually exclusive -- use this for improved
- ;; optimisation (see comment about `if' below).
+ ;; optimization (see comment about `if' below).
(cons fn
(mapcar (lambda (clause)
(if (consp clause)
@@ -364,9 +364,9 @@ for speeding up processing.")
;; FIXME: We have to traverse the expressions in left-to-right
;; order (because that is the order of evaluation and variable
;; mutations must be found prior to their use), but doing so we miss
- ;; some optimisation opportunities:
+ ;; some optimization opportunities:
;; consider (and A B) in a for-effect context, where B => nil.
- ;; Then A could be optimised in a for-effect context too.
+ ;; Then A could be optimized in a for-effect context too.
(let ((tail exps)
(args nil))
(while tail
@@ -380,19 +380,19 @@ for speeding up processing.")
;; FIXME: If the loop condition is statically nil after substitution
;; of surrounding variables then we can eliminate the whole loop,
;; even if those variables are mutated inside the loop.
- ;; We currently don't perform this important optimisation.
+ ;; We currently don't perform this important optimization.
(let* ((byte-optimize--vars-outside-loop byte-optimize--lexvars)
(condition-body
(if byte-optimize--inhibit-outside-loop-constprop
;; We are already inside the discovery phase of an outer
;; loop so there is no need for traversing this loop twice.
(cons exp exps)
- ;; Discovery phase: run optimisation without substitution
+ ;; Discovery phase: run optimization without substitution
;; of variables bound outside this loop.
(let ((byte-optimize--inhibit-outside-loop-constprop t))
(cons (byte-optimize-form exp nil)
(byte-optimize-body exps t)))))
- ;; Optimise again, this time with constprop enabled (unless
+ ;; Optimize again, this time with constprop enabled (unless
;; we are in discovery of an outer loop),
;; as mutated variables have been marked as non-substitutable.
(condition (byte-optimize-form (car condition-body) nil))
@@ -425,7 +425,7 @@ for speeding up processing.")
;; `unwind-protect' is a special form which here takes the shape
;; (unwind-protect EXPR :fun-body UNWIND-FUN).
;; We can treat it as if it were a plain function at this point,
- ;; although there are specific optimisations possible.
+ ;; although there are specific optimizations possible.
;; In particular, the return value of UNWIND-FUN is never used
;; so its body should really be compiled for-effect, but we
;; don't do that right now.
@@ -438,12 +438,12 @@ for speeding up processing.")
(`(internal-make-closure . ,_)
(and (not for-effect)
(progn
- ;; Look up free vars and mark them to be kept, so that they
- ;; won't be optimised away.
- (dolist (var (caddr form))
- (let ((lexvar (assq var byte-optimize--lexvars)))
- (when lexvar
- (setcar (cdr lexvar) t))))
+ ;; Look up free vars and mark them to be kept, so that they
+ ;; won't be optimized away.
+ (dolist (var (caddr form))
+ (let ((lexvar (assq var byte-optimize--lexvars)))
+ (when lexvar
+ (setcar (cdr lexvar) t))))
form)))
(`((lambda . ,_) . ,_)
@@ -513,7 +513,7 @@ for speeding up processing.")
(defun byte-optimize-one-form (form &optional for-effect)
"The source-level pass of the optimizer."
- ;; Make optimiser aware of lexical arguments.
+ ;; Make optimizer aware of lexical arguments.
(let ((byte-optimize--lexvars
(mapcar (lambda (v) (list (car v) t))
byte-compile--lexical-environment)))
@@ -525,7 +525,7 @@ for speeding up processing.")
;; First, optimize all sub-forms of this one.
(setq form (byte-optimize-form-code-walker form for-effect))
- ;; If a form-specific optimiser is available, run it and start over
+ ;; If a form-specific optimizer is available, run it and start over
;; until a fixpoint has been reached.
(and (consp form)
(symbolp (car form))
@@ -1288,8 +1288,6 @@ See Info node `(elisp) Integer Basics'."
form))
;; Fixme: delete-char -> delete-region (byte-coded)
-;; optimize string-as-unibyte, string-as-multibyte, string-make-unibyte,
-;; string-make-multibyte for constant args.
(put 'set 'byte-optimizer #'byte-optimize-set)
(defun byte-optimize-set (form)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index bd3db85c148..86681cf4dd4 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -244,11 +244,6 @@ the functions you loaded will not be able to run.")
(make-obsolete-variable 'byte-compile-dynamic "not worthwhile any more." "27.1")
;;;###autoload(put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
-(defvar byte-compile-disable-print-circle nil
- "If non-nil, disable `print-circle' on printing a byte-compiled code.")
-(make-obsolete-variable 'byte-compile-disable-print-circle nil "24.1")
-;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
-
(defcustom byte-compile-dynamic-docstrings t
"If non-nil, compile doc strings for lazy access.
We bury the doc strings of functions and variables inside comments in
@@ -1123,10 +1118,8 @@ message buffer `default-directory'."
:type '(repeat (choice (const :tag "Default" nil)
(string :tag "Directory"))))
-(defvar emacs-lisp-compilation-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "g" 'emacs-lisp-compilation-recompile)
- map))
+(defvar-keymap emacs-lisp-compilation-mode-map
+ "g" #'emacs-lisp-compilation-recompile)
(defvar emacs-lisp-compilation--current-file nil)
@@ -1727,8 +1720,8 @@ The byte-compiler will emit a warning for documentation strings
containing lines wider than this. If `fill-column' has a larger
value, it will override this variable."
:group 'bytecomp
- :type 'integer
- :safe #'integerp
+ :type 'natnum
+ :safe #'natnump
:version "28.1")
(define-obsolete-function-alias 'byte-compile-docstring-length-warn
@@ -2425,8 +2418,7 @@ Call from the source buffer."
(print-level nil)
(print-quoted t)
(print-gensym t)
- (print-circle ; Handle circular data structures.
- (not byte-compile-disable-print-circle)))
+ (print-circle t)) ; Handle circular data structures.
(if (and (memq (car-safe form) '(defvar defvaralias defconst
autoload custom-declare-variable))
(stringp (nth 3 form)))
@@ -2484,8 +2476,7 @@ list that represents a doc string reference.
(print-level nil)
(print-quoted t)
(print-gensym t)
- (print-circle ; Handle circular data structures.
- (not byte-compile-disable-print-circle)))
+ (print-circle t)) ; Handle circular data structures.
(if preface
(progn
;; FIXME: We don't handle uninterned names correctly.
@@ -4238,7 +4229,7 @@ This function is never called when `lexical-binding' is nil."
(byte-defop-compiler-1 quote)
(defun byte-compile-setq (form)
- (cl-assert (= (length form) 3)) ; normalised in macroexp
+ (cl-assert (= (length form) 3)) ; normalized in macroexp
(let ((var (nth 1 form))
(expr (nth 2 form)))
(byte-compile-form expr)
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index eca1123899c..7f95fa94fa1 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -267,8 +267,7 @@ Returns a form where all lambdas don't have any free variables."
(define-inline cconv--var-classification (binder form)
(inline-quote
- (alist-get (cons ,binder ,form) cconv-var-classification
- nil nil #'equal)))
+ (cdr (assoc (cons ,binder ,form) cconv-var-classification))))
(defun cconv--convert-funcbody (funargs funcbody env parentform)
"Run `cconv-convert' on FUNCBODY, the forms of a lambda expression.
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index 29fbcce7734..716b236d3ab 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -63,7 +63,6 @@
(eval-when-compile (require 'cl-generic))
;;; Code:
-(define-obsolete-variable-alias 'chart-map 'chart-mode-map "24.1")
(defvar chart-mode-map (make-sparse-keymap) "Keymap used in chart mode.")
(defvar-local chart-local-object nil
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 2cb5fa120e0..611f32e23c6 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -165,7 +165,7 @@
(require 'cl-lib)
(require 'help-mode) ;; for help-xref-info-regexp
(require 'thingatpt) ;; for handy thing-at-point-looking-at
-(require 'lisp-mode) ;; for lisp-mode-symbol-regexp
+(require 'lisp-mode) ;; for lisp-mode-symbol regexp
(eval-when-compile (require 'dired)) ;; for dired-map-over-marks
(require 'lisp-mnt)
@@ -1279,38 +1279,30 @@ TEXT, START, END and UNFIXABLE conform to
;;; Minor Mode specification
;;
-(defvar checkdoc-minor-mode-map
- (let ((map (make-sparse-keymap))
- (pmap (make-sparse-keymap)))
- ;; Override some bindings
- (define-key map "\C-\M-x" #'checkdoc-eval-defun)
- (define-key map "\C-x`" #'checkdoc-continue)
- (define-key map [menu-bar emacs-lisp eval-buffer]
- #'checkdoc-eval-current-buffer)
- ;; Add some new bindings under C-c ?
- (define-key pmap "x" #'checkdoc-defun)
- (define-key pmap "X" #'checkdoc-ispell-defun)
- (define-key pmap "`" #'checkdoc-continue)
- (define-key pmap "~" #'checkdoc-ispell-continue)
- (define-key pmap "s" #'checkdoc-start)
- (define-key pmap "S" #'checkdoc-ispell-start)
- (define-key pmap "d" #'checkdoc)
- (define-key pmap "D" #'checkdoc-ispell)
- (define-key pmap "b" #'checkdoc-current-buffer)
- (define-key pmap "B" #'checkdoc-ispell-current-buffer)
- (define-key pmap "e" #'checkdoc-eval-current-buffer)
- (define-key pmap "m" #'checkdoc-message-text)
- (define-key pmap "M" #'checkdoc-ispell-message-text)
- (define-key pmap "c" #'checkdoc-comments)
- (define-key pmap "C" #'checkdoc-ispell-comments)
- (define-key pmap " " #'checkdoc-rogue-spaces)
-
- ;; bind our submap into map
- (define-key map "\C-c?" pmap)
- map)
- "Keymap used to override evaluation key-bindings for documentation checking.")
-
-;; Add in a menubar with easy-menu
+(defvar-keymap checkdoc-minor-mode-map
+ :doc "Keymap used to override evaluation key-bindings for documentation checking."
+ ;; Override some bindings
+ "C-M-x" #'checkdoc-eval-defun
+ "C-x `" #'checkdoc-continue
+ "<menu-bar> <emacs-lisp> <eval-buffer>" #'checkdoc-eval-current-buffer
+
+ ;; Add some new bindings under C-c ?
+ "C-c ? x" #'checkdoc-defun
+ "C-c ? X" #'checkdoc-ispell-defun
+ "C-c ? `" #'checkdoc-continue
+ "C-c ? ~" #'checkdoc-ispell-continue
+ "C-c ? s" #'checkdoc-start
+ "C-c ? S" #'checkdoc-ispell-start
+ "C-c ? d" #'checkdoc
+ "C-c ? D" #'checkdoc-ispell
+ "C-c ? b" #'checkdoc-current-buffer
+ "C-c ? B" #'checkdoc-ispell-current-buffer
+ "C-c ? e" #'checkdoc-eval-current-buffer
+ "C-c ? m" #'checkdoc-message-text
+ "C-c ? M" #'checkdoc-ispell-message-text
+ "C-c ? c" #'checkdoc-comments
+ "C-c ? C" #'checkdoc-ispell-comments
+ "C-c ? SPC" #'checkdoc-rogue-spaces)
(easy-menu-define nil checkdoc-minor-mode-map
"Checkdoc Minor Mode Menu."
@@ -2604,13 +2596,13 @@ The correct format is \"Foo\" or \"some-symbol: Foo\". See also
(unless (let ((case-fold-search nil))
(looking-at (rx (or upper-case "%s"))))
;; A defined Lisp symbol is always okay.
- (unless (and (looking-at (rx (group (regexp lisp-mode-symbol-regexp))))
+ (unless (and (looking-at (rx (group lisp-mode-symbol)))
(or (fboundp (intern (match-string 1)))
(boundp (intern (match-string 1)))))
;; Other Lisp symbols are sometimes okay.
(rx-let ((c (? "\\\n"))) ; `c' is for a continued line
(let ((case-fold-search nil)
- (some-symbol (rx (regexp lisp-mode-symbol-regexp)
+ (some-symbol (rx lisp-mode-symbol
c ":" c (+ (any " \t\n"))))
(lowercase-str (rx c (group (any "a-z") (+ wordchar)))))
(if (looking-at some-symbol)
diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el
index 213eecf88d4..fe7e4506d7c 100644
--- a/lisp/emacs-lisp/cl-indent.el
+++ b/lisp/emacs-lisp/cl-indent.el
@@ -378,10 +378,9 @@ instead."
function)
(setq tentative-defun t))
((string-match
- (eval-when-compile
- (concat "\\`\\("
- (regexp-opt '("with" "without" "do"))
- "\\)-"))
+ (concat "\\`\\("
+ (regexp-opt '("with" "without" "do"))
+ "\\)-")
function)
(setq method '(&lambda &body))))))
;; backwards compatibility. Bletch.
diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el
index ec9fd86a55c..94f9654b239 100644
--- a/lisp/emacs-lisp/cl-preloaded.el
+++ b/lisp/emacs-lisp/cl-preloaded.el
@@ -146,7 +146,7 @@ supertypes from the most specific to least specific.")
(while (recordp parent)
(add-to-list (cl--struct-class-children-sym parent) tag)
;; Only register ourselves as a child of the leftmost parent since structs
- ;; can only only have one parent.
+ ;; can only have one parent.
(setq parent (car (cl--struct-class-parents parent)))))
;;;###autoload
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 4ce2ce75e10..9a635a47763 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -45,7 +45,9 @@
(defcustom native-comp-speed 2
"Optimization level for native compilation, a number between -1 and 3.
- -1 functions are kept in bytecode form and no native compilation is performed.
+ -1 functions are kept in bytecode form and no native compilation is performed
+ (but *.eln files are still produced, and include the compiled code in
+ bytecode form).
0 native compilation is performed with no optimizations.
1 light optimizations.
2 max optimization level fully adherent to the language semantic.
@@ -63,7 +65,7 @@ This is intended for debugging the compiler itself.
2 emit debug symbols and dump pseudo C code.
3 emit debug symbols and dump: pseudo C code, GCC intermediate
passes and libgccjit log file."
- :type 'integer
+ :type 'natnum
:safe #'natnump
:version "28.1")
@@ -74,7 +76,7 @@ This is intended for debugging the compiler itself.
1 final LIMPLE is logged.
2 LAP, final LIMPLE, and some pass info are logged.
3 max verbosity."
- :type 'integer
+ :type 'natnum
:risky t
:version "28.1")
@@ -111,7 +113,7 @@ during bootstrap."
"Default number of subprocesses used for async native compilation.
Value of zero means to use half the number of the CPU's execution units,
or one if there's just one execution unit."
- :type 'integer
+ :type 'natnum
:risky t
:version "28.1")
@@ -3693,7 +3695,7 @@ Prepare every function for final compilation and drive the C back-end."
(file-name-base output) "-")
nil ".el")))
(with-temp-file temp-file
- (insert ";; -*-coding: nil; -*-\n")
+ (insert ";; -*-coding: utf-8-emacs-unix; -*-\n")
(mapc (lambda (e)
(insert (prin1-to-string e)))
expr))
@@ -4288,6 +4290,30 @@ of (commands) to run simultaneously."
(let ((load (not (not load))))
(native--compile-async files recursively load selector)))
+(defun native-compile-prune-cache ()
+ "Remove .eln files that aren't applicable to the current Emacs invocation."
+ (interactive)
+ (dolist (dir native-comp-eln-load-path)
+ ;; If a directory is non absolute it is assumed to be relative to
+ ;; `invocation-directory'.
+ (setq dir (expand-file-name dir invocation-directory))
+ (when (file-exists-p dir)
+ (dolist (subdir (directory-files dir t))
+ (when (and (file-directory-p subdir)
+ (file-writable-p subdir)
+ (not (equal (file-name-nondirectory
+ (directory-file-name subdir))
+ comp-native-version-dir)))
+ (message "Deleting %s..." subdir)
+ ;; We're being overly cautious here -- there shouldn't be
+ ;; anything but .eln files in these directories.
+ (dolist (eln (directory-files subdir t "\\.eln\\(\\.tmp\\)?\\'"))
+ (when (file-writable-p eln)
+ (delete-file eln)))
+ (when (directory-empty-p subdir)
+ (delete-directory subdir))))))
+ (message "Cache cleared"))
+
(provide 'comp)
;; LocalWords: limplified limplified limplification limplify Limple LIMPLE libgccjit elc eln
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 8a5c3d3730c..6d4b29b552c 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -77,38 +77,29 @@
;;; Code:
-;; FIXME I don't see that this needs to exist as a separate variable.
-;; crm-separator should suffice.
-(defconst crm-default-separator "[ \t]*,[ \t]*"
- "Default value of `crm-separator'.")
+(define-obsolete-variable-alias 'crm-default-separator 'crm-separator "29.1")
-(defvar crm-separator crm-default-separator
+(defvar crm-separator "[ \t]*,[ \t]*"
"Separator regexp used for separating strings in `completing-read-multiple'.
-It should be a regexp that does not match the list of completion candidates.
-The default value is `crm-default-separator'.")
-
-(defvar crm-local-completion-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map minibuffer-local-completion-map)
- (define-key map [remap minibuffer-complete] #'crm-complete)
- (define-key map [remap minibuffer-complete-word] #'crm-complete-word)
- (define-key map [remap minibuffer-completion-help] #'crm-completion-help)
- map)
- "Local keymap for minibuffer multiple input with completion.
-Analog of `minibuffer-local-completion-map'.")
-
-(defvar crm-local-must-match-map
- (let ((map (make-sparse-keymap)))
- ;; We'd want to have multiple inheritance here.
- (set-keymap-parent map minibuffer-local-must-match-map)
- (define-key map [remap minibuffer-complete] #'crm-complete)
- (define-key map [remap minibuffer-complete-word] #'crm-complete-word)
- (define-key map [remap minibuffer-completion-help] #'crm-completion-help)
- (define-key map [remap minibuffer-complete-and-exit]
- #'crm-complete-and-exit)
- map)
- "Local keymap for minibuffer multiple input with exact match completion.
-Analog of `minibuffer-local-must-match-map' for crm.")
+It should be a regexp that does not match the list of completion candidates.")
+
+(defvar-keymap crm-local-completion-map
+ :doc "Local keymap for minibuffer multiple input with completion.
+Analog of `minibuffer-local-completion-map'."
+ :parent minibuffer-local-completion-map
+ "<remap> <minibuffer-complete>" #'crm-complete
+ "<remap> <minibuffer-complete-word>" #'crm-complete-word
+ "<remap> <minibuffer-completion-help>" #'crm-completion-help)
+
+(defvar-keymap crm-local-must-match-map
+ :doc "Local keymap for minibuffer multiple input with exact match completion.
+Analog of `minibuffer-local-must-match-map' for crm."
+ ;; We'd want to have multiple inheritance here.
+ :parent minibuffer-local-must-match-map
+ "<remap> <minibuffer-complete>" #'crm-complete
+ "<remap> <minibuffer-complete-word>" #'crm-complete-word
+ "<remap> <minibuffer-completion-help>" #'crm-completion-help
+ "<remap> <minibuffer-complete-and-exit>" #'crm-complete-and-exit)
(defvar crm-completion-table nil
"An alist whose elements' cars are strings, or an obarray.
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index c4929eb2b01..460057b3afd 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -560,52 +560,53 @@ The environment used is the one when entering the activation frame at point."
'backtrace-toggle-locals "28.1")
-(defvar debugger-mode-map
- (let ((map (make-keymap)))
- (set-keymap-parent map backtrace-mode-map)
- (define-key map "b" 'debugger-frame)
- (define-key map "c" 'debugger-continue)
- (define-key map "j" 'debugger-jump)
- (define-key map "r" 'debugger-return-value)
- (define-key map "u" 'debugger-frame-clear)
- (define-key map "d" 'debugger-step-through)
- (define-key map "l" 'debugger-list-functions)
- (define-key map "q" 'debugger-quit)
- (define-key map "e" 'debugger-eval-expression)
- (define-key map "R" 'debugger-record-expression)
- (define-key map [mouse-2] 'push-button)
- (easy-menu-define nil map ""
- '("Debugger"
- ["Step through" debugger-step-through
- :help "Proceed, stepping through subexpressions of this expression"]
- ["Continue" debugger-continue
- :help "Continue, evaluating this expression without stopping"]
- ["Jump" debugger-jump
- :help "Continue to exit from this frame, with all debug-on-entry suspended"]
- ["Eval Expression..." debugger-eval-expression
- :help "Eval an expression, in an environment like that outside the debugger"]
- ["Display and Record Expression" debugger-record-expression
- :help "Display a variable's value and record it in `*Backtrace-record*' buffer"]
- ["Return value..." debugger-return-value
- :help "Continue, specifying value to return."]
- "--"
- ["Debug frame" debugger-frame
- :help "Request entry to debugger when this frame exits"]
- ["Cancel debug frame" debugger-frame-clear
- :help "Do not enter debugger when this frame exits"]
- ["List debug on entry functions" debugger-list-functions
- :help "Display a list of all the functions now set to debug on entry"]
- "--"
- ["Next Line" next-line
- :help "Move cursor down"]
- ["Help for Symbol" backtrace-help-follow-symbol
- :help "Show help for symbol at point"]
- ["Describe Debugger Mode" describe-mode
- :help "Display documentation for debugger-mode"]
- "--"
- ["Quit" debugger-quit
- :help "Quit debugging and return to top level"]))
- map))
+(defvar-keymap debugger-mode-map
+ :full t
+ :parent backtrace-mode-map
+ "b" #'debugger-frame
+ "c" #'debugger-continue
+ "j" #'debugger-jump
+ "r" #'debugger-return-value
+ "u" #'debugger-frame-clear
+ "d" #'debugger-step-through
+ "l" #'debugger-list-functions
+ "q" #'debugger-quit
+ "e" #'debugger-eval-expression
+ "R" #'debugger-record-expression
+
+ "<mouse-2>" #'push-button
+
+ :menu
+ '("Debugger"
+ ["Step through" debugger-step-through
+ :help "Proceed, stepping through subexpressions of this expression"]
+ ["Continue" debugger-continue
+ :help "Continue, evaluating this expression without stopping"]
+ ["Jump" debugger-jump
+ :help "Continue to exit from this frame, with all debug-on-entry suspended"]
+ ["Eval Expression..." debugger-eval-expression
+ :help "Eval an expression, in an environment like that outside the debugger"]
+ ["Display and Record Expression" debugger-record-expression
+ :help "Display a variable's value and record it in `*Backtrace-record*' buffer"]
+ ["Return value..." debugger-return-value
+ :help "Continue, specifying value to return."]
+ "--"
+ ["Debug frame" debugger-frame
+ :help "Request entry to debugger when this frame exits"]
+ ["Cancel debug frame" debugger-frame-clear
+ :help "Do not enter debugger when this frame exits"]
+ ["List debug on entry functions" debugger-list-functions
+ :help "Display a list of all the functions now set to debug on entry"]
+ "--"
+ ["Next Line" next-line
+ :help "Move cursor down"]
+ ["Help for Symbol" backtrace-help-follow-symbol
+ :help "Show help for symbol at point"]
+ ["Describe Debugger Mode" describe-mode
+ :help "Display documentation for debugger-mode"]
+ "--"
+ ["Quit" debugger-quit
+ :help "Quit debugging and return to top level"]))
(put 'debugger-mode 'mode-class 'special)
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index f35362b371c..c3a4e9fc7ab 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -408,7 +408,7 @@ or call the function `%s'."))))
No problems result if this variable is not bound.
`add-hook' automatically binds it. (This is true for all hook variables.)"
modefun)))
- ;; Allow using using `M-x customize-variable' on the hook.
+ ;; Allow using `M-x customize-variable' on the hook.
(put ',hook 'custom-type 'hook)
(put ',hook 'standard-value (list nil))
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index b05ec3a7683..1a1d58d6e36 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -3809,74 +3809,72 @@ be installed in `emacs-lisp-mode-map'.")
;; The following isn't a GUD binding.
(define-key emacs-lisp-mode-map "\C-x\C-a\C-m" 'edebug-set-initial-mode))
-(defvar edebug-mode-map
- (let ((map (copy-keymap emacs-lisp-mode-map)))
- ;; control
- (define-key map " " 'edebug-step-mode)
- (define-key map "n" 'edebug-next-mode)
- (define-key map "g" 'edebug-go-mode)
- (define-key map "G" 'edebug-Go-nonstop-mode)
- (define-key map "t" 'edebug-trace-mode)
- (define-key map "T" 'edebug-Trace-fast-mode)
- (define-key map "c" 'edebug-continue-mode)
- (define-key map "C" 'edebug-Continue-fast-mode)
-
- ;;(define-key map "f" 'edebug-forward) not implemented
- (define-key map "f" 'edebug-forward-sexp)
- (define-key map "h" 'edebug-goto-here)
-
- (define-key map "I" 'edebug-instrument-callee)
- (define-key map "i" 'edebug-step-in)
- (define-key map "o" 'edebug-step-out)
-
- ;; quitting and stopping
- (define-key map "q" 'top-level)
- (define-key map "Q" 'edebug-top-level-nonstop)
- (define-key map "a" 'abort-recursive-edit)
- (define-key map "S" 'edebug-stop)
-
- ;; breakpoints
- (define-key map "b" 'edebug-set-breakpoint)
- (define-key map "u" 'edebug-unset-breakpoint)
- (define-key map "U" 'edebug-unset-breakpoints)
- (define-key map "B" 'edebug-next-breakpoint)
- (define-key map "x" 'edebug-set-conditional-breakpoint)
- (define-key map "X" 'edebug-set-global-break-condition)
- (define-key map "D" 'edebug-toggle-disable-breakpoint)
-
- ;; evaluation
- (define-key map "r" 'edebug-previous-result)
- (define-key map "e" 'edebug-eval-expression)
- (define-key map "\C-x\C-e" 'edebug-eval-last-sexp)
- (define-key map "E" 'edebug-visit-eval-list)
-
- ;; views
- (define-key map "w" 'edebug-where)
- (define-key map "v" 'edebug-view-outside) ;; maybe obsolete??
- (define-key map "p" 'edebug-bounce-point)
- (define-key map "P" 'edebug-view-outside) ;; same as v
- (define-key map "W" 'edebug-toggle-save-windows)
-
- ;; misc
- (define-key map "?" 'edebug-help)
- (define-key map "d" 'edebug-pop-to-backtrace)
-
- (define-key map "-" 'negative-argument)
-
- ;; statistics
- (define-key map "=" 'edebug-temp-display-freq-count)
-
- ;; GUD bindings
- (define-key map "\C-c\C-s" 'edebug-step-mode)
- (define-key map "\C-c\C-n" 'edebug-next-mode)
- (define-key map "\C-c\C-c" 'edebug-go-mode)
-
- (define-key map "\C-x " 'edebug-set-breakpoint)
- (define-key map "\C-c\C-d" 'edebug-unset-breakpoint)
- (define-key map "\C-c\C-t"
- (lambda () (interactive) (edebug-set-breakpoint t)))
- (define-key map "\C-c\C-l" 'edebug-where)
- map))
+(defvar-keymap edebug-mode-map
+ :parent emacs-lisp-mode-map
+ ;; control
+ "SPC" #'edebug-step-mode
+ "n" #'edebug-next-mode
+ "g" #'edebug-go-mode
+ "G" #'edebug-Go-nonstop-mode
+ "t" #'edebug-trace-mode
+ "T" #'edebug-Trace-fast-mode
+ "c" #'edebug-continue-mode
+ "C" #'edebug-Continue-fast-mode
+
+ ;;"f" #'edebug-forward ; not implemented
+ "f" #'edebug-forward-sexp
+ "h" #'edebug-goto-here
+
+ "I" #'edebug-instrument-callee
+ "i" #'edebug-step-in
+ "o" #'edebug-step-out
+
+ ;; quitting and stopping
+ "q" #'top-level
+ "Q" #'edebug-top-level-nonstop
+ "a" #'abort-recursive-edit
+ "S" #'edebug-stop
+
+ ;; breakpoints
+ "b" #'edebug-set-breakpoint
+ "u" #'edebug-unset-breakpoint
+ "U" #'edebug-unset-breakpoints
+ "B" #'edebug-next-breakpoint
+ "x" #'edebug-set-conditional-breakpoint
+ "X" #'edebug-set-global-break-condition
+ "D" #'edebug-toggle-disable-breakpoint
+
+ ;; evaluation
+ "r" #'edebug-previous-result
+ "e" #'edebug-eval-expression
+ "C-x C-e" #'edebug-eval-last-sexp
+ "E" #'edebug-visit-eval-list
+
+ ;; views
+ "w" #'edebug-where
+ "v" #'edebug-view-outside ; maybe obsolete??
+ "p" #'edebug-bounce-point
+ "P" #'edebug-view-outside ; same as v
+ "W" #'edebug-toggle-save-windows
+
+ ;; misc
+ "?" #'edebug-help
+ "d" #'edebug-pop-to-backtrace
+
+ "-" #'negative-argument
+
+ ;; statistics
+ "=" #'edebug-temp-display-freq-count
+
+ ;; GUD bindings
+ "C-c C-s" #'edebug-step-mode
+ "C-c C-n" #'edebug-next-mode
+ "C-c C-c" #'edebug-go-mode
+
+ "C-x SPC" #'edebug-set-breakpoint
+ "C-c C-d" #'edebug-unset-breakpoint
+ "C-c C-t" (lambda () (interactive) (edebug-set-breakpoint t))
+ "C-c C-l" #'edebug-where)
;; Autoloading these global bindings doesn't make sense because
;; they cannot be used anyway unless Edebug is already loaded and active.
@@ -3891,38 +3889,35 @@ be installed in `emacs-lisp-mode-map'.")
(define-obsolete-variable-alias 'global-edebug-map
'edebug-global-map "28.1")
-(defvar edebug-global-map
- (let ((map (make-sparse-keymap)))
-
- (define-key map " " 'edebug-step-mode)
- (define-key map "g" 'edebug-go-mode)
- (define-key map "G" 'edebug-Go-nonstop-mode)
- (define-key map "t" 'edebug-trace-mode)
- (define-key map "T" 'edebug-Trace-fast-mode)
- (define-key map "c" 'edebug-continue-mode)
- (define-key map "C" 'edebug-Continue-fast-mode)
-
- ;; breakpoints
- (define-key map "b" 'edebug-set-breakpoint)
- (define-key map "u" 'edebug-unset-breakpoint)
- (define-key map "U" 'edebug-unset-breakpoints)
- (define-key map "x" 'edebug-set-conditional-breakpoint)
- (define-key map "X" 'edebug-set-global-break-condition)
- (define-key map "D" 'edebug-toggle-disable-breakpoint)
-
- ;; views
- (define-key map "w" 'edebug-where)
- (define-key map "W" 'edebug-toggle-save-windows)
-
- ;; quitting
- (define-key map "q" 'top-level)
- (define-key map "Q" 'edebug-top-level-nonstop)
- (define-key map "a" 'abort-recursive-edit)
-
- ;; statistics
- (define-key map "=" 'edebug-display-freq-count)
- map)
- "Global map of edebug commands, available from any buffer.")
+(defvar-keymap edebug-global-map
+ :doc "Global map of edebug commands, available from any buffer."
+ "SPC" #'edebug-step-mode
+ "g" #'edebug-go-mode
+ "G" #'edebug-Go-nonstop-mode
+ "t" #'edebug-trace-mode
+ "T" #'edebug-Trace-fast-mode
+ "c" #'edebug-continue-mode
+ "C" #'edebug-Continue-fast-mode
+
+ ;; breakpoints
+ "b" #'edebug-set-breakpoint
+ "u" #'edebug-unset-breakpoint
+ "U" #'edebug-unset-breakpoints
+ "x" #'edebug-set-conditional-breakpoint
+ "X" #'edebug-set-global-break-condition
+ "D" #'edebug-toggle-disable-breakpoint
+
+ ;; views
+ "w" #'edebug-where
+ "W" #'edebug-toggle-save-windows
+
+ ;; quitting
+ "q" #'top-level
+ "Q" #'edebug-top-level-nonstop
+ "a" #'abort-recursive-edit
+
+ ;; statistics
+ "=" #'edebug-display-freq-count)
(when edebug-global-prefix
(global-unset-key edebug-global-prefix)
@@ -4093,16 +4088,14 @@ May only be called from within `edebug--recursive-edit'."
-(defvar edebug-eval-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map lisp-interaction-mode-map)
- (define-key map "\C-c\C-w" 'edebug-where)
- (define-key map "\C-c\C-d" 'edebug-delete-eval-item)
- (define-key map "\C-c\C-u" 'edebug-update-eval-list)
- (define-key map "\C-x\C-e" 'edebug-eval-last-sexp)
- (define-key map "\C-j" 'edebug-eval-print-last-sexp)
- map)
- "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.")
+(defvar-keymap edebug-eval-mode-map
+ :doc "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode."
+ :parent lisp-interaction-mode-map
+ "C-c C-w" #'edebug-where
+ "C-c C-d" #'edebug-delete-eval-item
+ "C-c C-u" #'edebug-update-eval-list
+ "C-x C-e" #'edebug-eval-last-sexp
+ "C-j" #'edebug-eval-print-last-sexp)
(put 'edebug-eval-mode 'mode-class 'special)
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index d9864e6965d..5e7b5cbfb2f 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -24,15 +24,14 @@
;;; Commentary:
;;
;; The "core" part of EIEIO is the implementation for the object
-;; system (such as eieio-defclass, or eieio-defmethod) but not the
-;; base classes for the object system, which are defined in EIEIO.
+;; system (such as eieio-defclass-internal, or cl-defmethod) but not
+;; the base classes for the object system, which are defined in EIEIO.
;;
;; See the commentary for eieio.el for more about EIEIO itself.
;;; Code:
(require 'cl-lib)
-(require 'eieio-loaddefs nil t)
;;;
;; A few functions that are better in the official EIEIO src, but
diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el
index ebb6f2cd8c8..0bec3bb0d59 100644
--- a/lisp/emacs-lisp/eieio-custom.el
+++ b/lisp/emacs-lisp/eieio-custom.el
@@ -329,11 +329,9 @@ Argument OBJ is the object that has been customized."
Optional argument GROUP is the sub-group of slots to display."
(eieio-customize-object obj group))
-(defvar eieio-custom-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-keymap)
- map)
- "Keymap for EIEIO Custom mode.")
+(defvar-keymap eieio-custom-mode-map
+ :doc "Keymap for EIEIO Custom mode."
+ :parent widget-keymap)
(define-derived-mode eieio-custom-mode fundamental-mode "EIEIO Custom"
"Major mode for customizing EIEIO objects.
@@ -469,8 +467,4 @@ Return the symbol for the group, or nil."
(provide 'eieio-custom)
-;; Local variables:
-;; generated-autoload-file: "eieio-loaddefs.el"
-;; End:
-
;;; eieio-custom.el ends here
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 72108f807f9..5f67263f177 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -348,8 +348,4 @@ INDENT is the current indentation level."
(provide 'eieio-opt)
-;; Local variables:
-;; generated-autoload-file: "eieio-loaddefs.el"
-;; End:
-
;;; eieio-opt.el ends here
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 0b8078579cc..b08a268c90f 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -812,7 +812,7 @@ function passes responsibility to the functions in
Other third-party values of `eldoc-documentation-strategy' should
not use `eldoc--make-callback'. They must find some alternate
way to produce callbacks to feed to
-`eldoc-documentation-functions' and should endeavour to display
+`eldoc-documentation-functions' and should endeavor to display
the docstrings eventually produced, using
`eldoc-display-functions'."
(let* (;; How many callbacks have been created by the strategy
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index 385ddb3f414..03c5b94e3b4 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -472,13 +472,11 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]."
(insert atstr))
(insert "\n"))))
-(defvar elp-results-symname-map
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-2] 'elp-results-jump-to-definition)
- (define-key map [follow-link] 'mouse-face)
- (define-key map "\C-m" 'elp-results-jump-to-definition)
- map)
- "Keymap used on the function name column." )
+(defvar-keymap elp-results-symname-map
+ :doc "Keymap used on the function name column."
+ "<mouse-2>" #'elp-results-jump-to-definition
+ "<follow-link>" 'mouse-face
+ "RET" #'elp-results-jump-to-definition)
(defun elp-results-jump-to-definition (&optional event)
"Jump to the definition of the function at point."
diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el
index de18adff5b8..4436d0a4b16 100644
--- a/lisp/emacs-lisp/ert-x.el
+++ b/lisp/emacs-lisp/ert-x.el
@@ -158,9 +158,6 @@ test for `called-interactively' in the command will fail."
(run-hooks 'pre-command-hook)
(setq return-value (apply (car command) (cdr command)))
(run-hooks 'post-command-hook)
- (and (boundp 'deferred-action-list)
- deferred-action-list
- (run-hooks 'deferred-action-function))
(setq real-last-command (car command)
last-command this-command)
(when (boundp 'last-repeatable-command)
@@ -491,9 +488,13 @@ The same keyword arguments are supported as in
(string-match "Apple \\(LLVM\\|[Cc]lang\\)\\|Xcode\\.app"
(shell-command-to-string "gcc --version")))
-
-(defvar tramp-methods)
(defvar tramp-default-host-alist)
+(defvar tramp-methods)
+(defvar tramp-remote-path)
+
+;; This should happen on hydra only.
+(when (and (featurep 'tramp) (getenv "EMACS_HYDRA_CI"))
+ (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
;; If this defconst is used in a test file, `tramp' shall be loaded
;; prior `ert-x'. There is no default value on w32 systems, which
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 82722add42a..49b54c2d00f 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1,6 +1,6 @@
;;; ert.el --- Emacs Lisp Regression Testing -*- lexical-binding: t -*-
-;; Copyright (C) 2007-2008, 2010-2022 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2022 Free Software Foundation, Inc.
;; Author: Christian Ohler <ohler@gnu.org>
;; Keywords: lisp, tools
@@ -46,14 +46,10 @@
;; processing further, this is useful for checking the test
;; environment (like availability of features, external binaries, etc).
;;
-;; See ERT's info manual as well as the docstrings for more details.
-;; To compile the manual, run `makeinfo ert.texinfo' in the ERT
-;; directory, then C-u M-x info ert.info in Emacs to view it.
-;;
-;; To see some examples of tests written in ERT, see its self-tests in
-;; ert-tests.el. Some of these are tricky due to the bootstrapping
-;; problem of writing tests for a testing tool, others test simple
-;; functions and are straightforward.
+;; See ERT's Info manual `(ert) Top' as well as the docstrings for
+;; more details. To see some examples of tests written in ERT, see
+;; the test suite distributed with the Emacs source distribution (in
+;; the "test" directory).
;;; Code:
@@ -2884,8 +2880,14 @@ To be used in the ERT results buffer."
nil)
(defun ert-test-erts-file (file &optional transform)
- "Parse FILE as a file containing before/after parts.
-TRANSFORM will be called to get from before to after."
+ "Parse FILE as a file containing before/after parts (an erts file).
+
+This function puts the \"before\" section of an .erts file into a
+temporary buffer, calls the TRANSFORM function, and then compares
+the result with the \"after\" section.
+
+See Info node `(ert) erts files' for more information on how to
+write erts files."
(with-temp-buffer
(insert-file-contents file)
(let ((gen-specs (list (cons 'dummy t)
diff --git a/lisp/emacs-lisp/helper.el b/lisp/emacs-lisp/helper.el
index 930dbfe6c49..654dbbc5fef 100644
--- a/lisp/emacs-lisp/helper.el
+++ b/lisp/emacs-lisp/helper.el
@@ -1,6 +1,6 @@
;;; helper.el --- utility help package supporting help in electric modes -*- lexical-binding: t; -*-
-;; Copyright (C) 1985, 2001-2022 Free Software Foundation, Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
;; Author: K. Shane Hartman
;; Maintainer: emacs-devel@gnu.org
@@ -39,19 +39,16 @@
;; keymap either.
-(defvar Helper-help-map
- (let ((map (make-sparse-keymap)))
- ;(fillarray map 'undefined)
- (define-key map "m" 'Helper-describe-mode)
- (define-key map "b" 'Helper-describe-bindings)
- (define-key map "c" 'Helper-describe-key-briefly)
- (define-key map "k" 'Helper-describe-key)
- ;(define-key map "f" 'Helper-describe-function)
- ;(define-key map "v" 'Helper-describe-variable)
- (define-key map "?" 'Helper-help-options)
- (define-key map (char-to-string help-char) 'Helper-help-options)
- (fset 'Helper-help-map map)
- map))
+(defvar-keymap Helper-help-map
+ "m" #'Helper-describe-mode
+ "b" #'Helper-describe-bindings
+ "c" #'Helper-describe-key-briefly
+ "k" #'Helper-describe-key
+ ;;"f" #'Helper-describe-function
+ ;;"v" #'Helper-describe-variable
+ "?" #'Helper-help-options
+ (key-description (char-to-string help-char)) #'Helper-help-options)
+(fset 'Helper-help-map Helper-help-map)
(defun Helper-help-scroller ()
(let ((blurb (or (and (boundp 'Helper-return-blurb)
@@ -68,26 +65,30 @@
(setq state (+ (* 2 (if (pos-visible-in-window-p (point-max)) 1 0))
(if (pos-visible-in-window-p (point-min)) 1 0)))
(message
- (nth state
- '("Space forward, Delete back. Other keys %s"
- "Space scrolls forward. Other keys %s"
- "Delete scrolls back. Other keys %s"
- "Type anything to %s"))
+ (nth state
+ (mapcar
+ #'substitute-command-keys
+ '("\\`SPC' forward, \\`DEL' back. Other keys %s"
+ "\\`SPC' scrolls forward. Other keys %s"
+ "\\`DEL' scrolls back. Other keys %s"
+ "Type anything to %s")))
blurb)
(setq continue (read-event))
(cond ((and (memq continue '(?\s ?\C-v)) (< state 2))
(scroll-up))
- ((= continue ?\C-l)
+ ((eq continue ?\C-l)
(recenter))
- ((and (= continue ?\177) (zerop (% state 2)))
+ ((and (or (eq continue 'backspace)
+ (eq continue ?\177))
+ (zerop (% state 2)))
(scroll-down))
(t (setq continue nil))))))))
(defun Helper-help-options ()
"Describe help options."
(interactive)
- (message "c (key briefly), m (mode), k (key), b (bindings)")
- ;(message "c (key briefly), m (mode), k (key), v (variable), f (function)")
+ (message (substitute-command-keys
+ "\\`c' (key briefly), \\`m' (mode), \\`k' (key), \\`b' (bindings)"))
(sit-for 4))
(defun Helper-describe-key-briefly (key)
@@ -140,7 +141,8 @@
(interactive)
(let ((continue t) c)
(while continue
- (message "Help (Type ? for further options)")
+ (message (substitute-command-keys
+ "Help (Type \\`?' for further options)"))
(setq c (read-key-sequence nil))
(setq c (lookup-key Helper-help-map c))
(cond ((eq c 'Helper-help-options)
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 6d5391d1e90..c906ee6e31d 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -89,78 +89,78 @@
table)
"Syntax table used in `lisp-mode'.")
+(rx-define lisp-mode-symbol (+ (| (syntax word)
+ (syntax symbol)
+ (: "\\" nonl))))
+
(eval-and-compile
- (defconst lisp-mode-symbol-regexp "\\(?:\\sw\\|\\s_\\|\\\\.\\)+"))
+ (defconst lisp-mode-symbol-regexp (rx lisp-mode-symbol)))
(defvar lisp-imenu-generic-expression
(list
(list nil
(purecopy (concat "^\\s-*("
- (eval-when-compile
- (regexp-opt
- '("defun" "defmacro"
- ;; Elisp.
- "defun*" "defsubst" "define-inline"
- "define-advice" "defadvice" "define-skeleton"
- "define-compilation-mode" "define-minor-mode"
- "define-global-minor-mode"
- "define-globalized-minor-mode"
- "define-derived-mode" "define-generic-mode"
- "ert-deftest"
- "cl-defun" "cl-defsubst" "cl-defmacro"
- "cl-define-compiler-macro" "cl-defgeneric"
- "cl-defmethod"
- ;; CL.
- "define-compiler-macro" "define-modify-macro"
- "defsetf" "define-setf-expander"
- "define-method-combination"
- ;; CLOS and EIEIO
- "defgeneric" "defmethod")
- t))
- "\\s-+\\(" lisp-mode-symbol-regexp "\\)"))
+ (regexp-opt
+ '("defun" "defmacro"
+ ;; Elisp.
+ "defun*" "defsubst" "define-inline"
+ "define-advice" "defadvice" "define-skeleton"
+ "define-compilation-mode" "define-minor-mode"
+ "define-global-minor-mode"
+ "define-globalized-minor-mode"
+ "define-derived-mode" "define-generic-mode"
+ "ert-deftest"
+ "cl-defun" "cl-defsubst" "cl-defmacro"
+ "cl-define-compiler-macro" "cl-defgeneric"
+ "cl-defmethod"
+ ;; CL.
+ "define-compiler-macro" "define-modify-macro"
+ "defsetf" "define-setf-expander"
+ "define-method-combination"
+ ;; CLOS and EIEIO
+ "defgeneric" "defmethod")
+ t)
+ "\\s-+\\(" (rx lisp-mode-symbol) "\\)"))
2)
;; Like the previous, but uses a quoted symbol as the name.
(list nil
(purecopy (concat "^\\s-*("
- (eval-when-compile
- (regexp-opt
- '("defalias" "define-obsolete-function-alias")
- t))
- "\\s-+'\\(" lisp-mode-symbol-regexp "\\)"))
+ (regexp-opt
+ '("defalias" "define-obsolete-function-alias")
+ t)
+ "\\s-+'\\(" (rx lisp-mode-symbol) "\\)"))
2)
(list (purecopy "Variables")
(purecopy (concat "^\\s-*("
- (eval-when-compile
- (regexp-opt
- '(;; Elisp
- "defconst" "defcustom"
- ;; CL
- "defconstant"
- "defparameter" "define-symbol-macro")
- t))
- "\\s-+\\(" lisp-mode-symbol-regexp "\\)"))
+ (regexp-opt
+ '(;; Elisp
+ "defconst" "defcustom"
+ ;; CL
+ "defconstant"
+ "defparameter" "define-symbol-macro")
+ t)
+ "\\s-+\\(" (rx lisp-mode-symbol) "\\)"))
2)
;; For `defvar'/`defvar-local', we ignore (defvar FOO) constructs.
(list (purecopy "Variables")
(purecopy (concat "^\\s-*(defvar\\(?:-local\\)?\\s-+\\("
- lisp-mode-symbol-regexp "\\)"
+ (rx lisp-mode-symbol) "\\)"
"[[:space:]\n]+[^)]"))
1)
(list (purecopy "Types")
(purecopy (concat "^\\s-*("
- (eval-when-compile
- (regexp-opt
- '(;; Elisp
- "defgroup" "deftheme"
- "define-widget" "define-error"
- "defface" "cl-deftype" "cl-defstruct"
- ;; CL
- "deftype" "defstruct"
- "define-condition" "defpackage"
- ;; CLOS and EIEIO
- "defclass")
- t))
- "\\s-+'?\\(" lisp-mode-symbol-regexp "\\)"))
+ (regexp-opt
+ '(;; Elisp
+ "defgroup" "deftheme"
+ "define-widget" "define-error"
+ "defface" "cl-deftype" "cl-defstruct"
+ ;; CL
+ "deftype" "defstruct"
+ "define-condition" "defpackage"
+ ;; CLOS and EIEIO
+ "defclass")
+ t)
+ "\\s-+'?\\(" (rx lisp-mode-symbol) "\\)"))
2))
"Imenu generic expression for Lisp mode. See `imenu-generic-expression'.")
@@ -269,8 +269,7 @@ to a package-local <package>-loaddefs.el file.")
;; FIXME: Move to elisp-mode.el.
(catch 'found
(while (re-search-forward
- (eval-when-compile
- (concat "(\\(" lisp-mode-symbol-regexp "\\)\\_>"))
+ (concat "(\\(" (rx lisp-mode-symbol) "\\)\\_>")
limit t)
(let ((sym (intern-soft (match-string 1))))
(when (and (or (special-form-p sym) (macrop sym))
@@ -419,8 +418,8 @@ This will generate compile-time constants from BINDINGS."
;; Any whitespace and defined object.
"[ \t']*"
"\\(([ \t']*\\)?" ;; An opening paren.
- "\\(\\(setf\\)[ \t]+" lisp-mode-symbol-regexp
- "\\|" lisp-mode-symbol-regexp "\\)?")
+ "\\(\\(setf\\)[ \t]+" (rx lisp-mode-symbol)
+ "\\|" (rx lisp-mode-symbol) "\\)?")
(1 font-lock-keyword-face)
(3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type)))
(cond ((eq type 'var) font-lock-variable-name-face)
@@ -446,8 +445,8 @@ This will generate compile-time constants from BINDINGS."
;; Any whitespace and defined object.
"[ \t']*"
"\\(([ \t']*\\)?" ;; An opening paren.
- "\\(\\(setf\\)[ \t]+" lisp-mode-symbol-regexp
- "\\|" lisp-mode-symbol-regexp "\\)?")
+ "\\(\\(setf\\)[ \t]+" (rx lisp-mode-symbol)
+ "\\|" (rx lisp-mode-symbol) "\\)?")
(1 font-lock-keyword-face)
(3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type)))
(cond ((eq type 'var) font-lock-variable-name-face)
@@ -473,26 +472,34 @@ This will generate compile-time constants from BINDINGS."
(lisp--el-match-keyword . 1)
;; Exit/Feature symbols as constants.
(,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>"
- "[ \t']*\\(" lisp-mode-symbol-regexp "\\)?")
+ "[ \t']*\\(" (rx lisp-mode-symbol) "\\)?")
(1 font-lock-keyword-face)
(2 font-lock-constant-face nil t))
- ;; Words inside \\[] tend to be for `substitute-command-keys'.
- (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]")
+ ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for
+ ;; `substitute-command-keys'.
+ (,(rx "\\\\" (or (seq "[" (group-n 1 lisp-mode-symbol) "]")
+ (seq "`" (group-n 1
+ ;; allow multiple words, e.g. "C-x a"
+ lisp-mode-symbol (* " " lisp-mode-symbol))
+ "'")))
(1 font-lock-constant-face prepend))
+ (,(rx "\\\\" (or (seq "<" (group-n 1 lisp-mode-symbol) ">")
+ (seq "{" (group-n 1 lisp-mode-symbol) "}")))
+ (1 font-lock-variable-name-face prepend))
;; Ineffective backslashes (typically in need of doubling).
("\\(\\\\\\)\\([^\"\\]\\)"
(1 (elisp--font-lock-backslash) prepend))
;; Words inside ‘’, '' and `' tend to be symbol names.
- (,(concat "[`‘']\\(" lisp-mode-symbol-regexp "\\)['’]")
+ (,(concat "[`‘']\\(" (rx lisp-mode-symbol) "\\)['’]")
(1 font-lock-constant-face prepend))
;; \\= tends to be an escape in doc strings.
- ("\\\\\\\\="
+ (,(rx "\\\\=")
(0 font-lock-builtin-face prepend))
;; Constant values.
- (,(concat "\\_<:" lisp-mode-symbol-regexp "\\_>")
+ (,(concat "\\_<:" (rx lisp-mode-symbol) "\\_>")
(0 font-lock-builtin-face))
;; ELisp and CLisp `&' keywords as types.
- (,(concat "\\_<&" lisp-mode-symbol-regexp "\\_>")
+ (,(concat "\\_<&" (rx lisp-mode-symbol) "\\_>")
. font-lock-type-face)
;; ELisp regexp grouping constructs
(,(lambda (bound)
@@ -529,30 +536,30 @@ This will generate compile-time constants from BINDINGS."
(,(concat "(" cl-kws-re "\\_>") . 1)
;; Exit/Feature symbols as constants.
(,(concat "(\\(catch\\|throw\\|provide\\|require\\)\\_>"
- "[ \t']*\\(" lisp-mode-symbol-regexp "\\)?")
+ "[ \t']*\\(" (rx lisp-mode-symbol) "\\)?")
(1 font-lock-keyword-face)
(2 font-lock-constant-face nil t))
;; Erroneous structures.
(,(concat "(" cl-errs-re "\\_>")
(1 font-lock-warning-face))
;; Words inside ‘’ and `' tend to be symbol names.
- (,(concat "[`‘]\\(" lisp-mode-symbol-regexp "\\)['’]")
+ (,(concat "[`‘]\\(" (rx lisp-mode-symbol) "\\)['’]")
(1 font-lock-constant-face prepend))
;; Uninterned symbols, e.g., (defpackage #:my-package ...)
;; must come before keywords below to have effect
- (,(concat "#:" lisp-mode-symbol-regexp "") 0 font-lock-builtin-face)
+ (,(concat "#:" (rx lisp-mode-symbol) "") 0 font-lock-builtin-face)
;; Constant values.
- (,(concat "\\_<:" lisp-mode-symbol-regexp "\\_>")
+ (,(concat "\\_<:" (rx lisp-mode-symbol) "\\_>")
(0 font-lock-builtin-face))
;; ELisp and CLisp `&' keywords as types.
- (,(concat "\\_<&" lisp-mode-symbol-regexp "\\_>")
+ (,(concat "\\_<&" (rx lisp-mode-symbol) "\\_>")
. font-lock-type-face)
;; This is too general -- rms.
;; A user complained that he has functions whose names start with `do'
;; and that they get the wrong color.
;; That user has violated the https://www.cliki.net/Naming+conventions:
;; CL (but not EL!) `with-' (context) and `do-' (iteration)
- (,(concat "(\\(\\(do-\\|with-\\)" lisp-mode-symbol-regexp "\\)")
+ (,(concat "(\\(\\(do-\\|with-\\)" (rx lisp-mode-symbol) "\\)")
(1 font-lock-keyword-face))
(lisp--match-hidden-arg
(0 '(face font-lock-warning-face
@@ -579,16 +586,15 @@ This will generate compile-time constants from BINDINGS."
"Gaudy highlighting from Emacs Lisp mode used in Backtrace mode.")
(defun lisp-string-in-doc-position-p (listbeg startpos)
- "Return non-nil if a doc string may occur at STARTPOS inside a list.
+ "Return non-nil if a doc string may occur at STARTPOS inside a list.
LISTBEG is the position of the start of the innermost list
containing STARTPOS."
(let* ((firstsym (and listbeg
(save-excursion
(goto-char listbeg)
(and (looking-at
- (eval-when-compile
- (concat "([ \t\n]*\\("
- lisp-mode-symbol-regexp "\\)")))
+ (concat "([ \t\n]*\\("
+ (rx lisp-mode-symbol) "\\)"))
(match-string 1)))))
(docelt (and firstsym
(function-get (intern-soft firstsym)
@@ -747,17 +753,16 @@ font-lock keywords will not be case sensitive."
(progn (forward-sexp 1)
(point)))))))
-(defvar lisp-mode-shared-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map prog-mode-map)
- (define-key map "\e\C-q" 'indent-sexp)
- (define-key map "\177" 'backward-delete-char-untabify)
- ;; This gets in the way when viewing a Lisp file in view-mode. As
- ;; long as [backspace] is mapped into DEL via the
- ;; function-key-map, this should remain disabled!!
- ;;;(define-key map [backspace] 'backward-delete-char-untabify)
- map)
- "Keymap for commands shared by all sorts of Lisp modes.")
+(defvar-keymap lisp-mode-shared-map
+ :doc "Keymap for commands shared by all sorts of Lisp modes."
+ :parent prog-mode-map
+ "C-M-q" #'indent-sexp
+ "DEL" #'backward-delete-char-untabify
+ ;; This gets in the way when viewing a Lisp file in view-mode. As
+ ;; long as [backspace] is mapped into DEL via the
+ ;; function-key-map, this should remain disabled!!
+ ;;;"<backspace>" #'backward-delete-char-untabify
+ )
(defcustom lisp-mode-hook nil
"Hook run when entering Lisp mode."
@@ -773,14 +778,12 @@ font-lock keywords will not be case sensitive."
;;; Generic Lisp mode.
-(defvar lisp-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map lisp-mode-shared-map)
- (define-key map "\e\C-x" 'lisp-eval-defun)
- (define-key map "\C-c\C-z" 'run-lisp)
- map)
- "Keymap for ordinary Lisp mode.
-All commands in `lisp-mode-shared-map' are inherited by this map.")
+(defvar-keymap lisp-mode-map
+ :doc "Keymap for ordinary Lisp mode.
+All commands in `lisp-mode-shared-map' are inherited by this map."
+ :parent lisp-mode-shared-map
+ "C-M-x" #'lisp-eval-defun
+ "C-c C-z" #'run-lisp)
(easy-menu-define lisp-mode-menu lisp-mode-map
"Menu for ordinary Lisp mode."
@@ -835,9 +838,8 @@ or to switch back to an existing one."
(defcustom lisp-indent-offset nil
"If non-nil, indent second line of expressions that many more columns."
:group 'lisp
- :type '(choice (const nil) integer))
-(put 'lisp-indent-offset 'safe-local-variable
- (lambda (x) (or (null x) (integerp x))))
+ :type '(choice (const nil) integer)
+ :safe (lambda (x) (or (null x) (integerp x))))
(defcustom lisp-indent-function 'lisp-indent-function
"A function to be called by `calculate-lisp-indent'.
@@ -1249,8 +1251,8 @@ Lisp function does not specify a special indentation."
(defcustom lisp-body-indent 2
"Number of columns to indent the second line of a `(def...)' form."
:group 'lisp
- :type 'integer)
-(put 'lisp-body-indent 'safe-local-variable 'integerp)
+ :type 'integer
+ :safe #'integerp)
(defun lisp-indent-specform (count state indent-point normal-indent)
(let ((containing-form-start (elt state 1))
@@ -1411,9 +1413,8 @@ Any non-integer value means do not use a different value of
`fill-column' when filling docstrings."
:type '(choice (integer)
(const :tag "Use the current `fill-column'" t))
+ :safe (lambda (x) (or (eq x t) (integerp x)))
:group 'lisp)
-(put 'emacs-lisp-docstring-fill-column 'safe-local-variable
- (lambda (x) (or (eq x t) (integerp x))))
(defun lisp-fill-paragraph (&optional justify)
"Like \\[fill-paragraph], but handle Emacs Lisp comments and docstrings.
@@ -1465,7 +1466,10 @@ and initial semicolons."
emacs-lisp-docstring-fill-column
fill-column)))
(let ((ppss (syntax-ppss))
- (start (point)))
+ (start (point))
+ ;; Avoid recursion if we're being called directly with
+ ;; `M-x lisp-fill-paragraph' in an `emacs-lisp-mode' buffer.
+ (fill-paragraph-function t))
(save-excursion
(save-restriction
;; If we're not inside a string, then do very basic
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 641ce0d5c02..4b85414943a 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -943,14 +943,7 @@ character."
(defun field-complete (table &optional predicate)
(declare (obsolete completion-in-region "24.4"))
(let ((minibuffer-completion-table table)
- (minibuffer-completion-predicate predicate)
- ;; This made sense for lisp-complete-symbol, but for
- ;; field-complete, this is out of place. --Stef
- ;; (completion-annotate-function
- ;; (unless (eq predicate 'fboundp)
- ;; (lambda (str)
- ;; (if (fboundp (intern-soft str)) " <f>"))))
- )
+ (minibuffer-completion-predicate predicate))
(call-interactively 'minibuffer-complete)))
(defun lisp-complete-symbol (&optional _predicate)
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 2c92a8e7fe8..8a50b777da1 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -329,9 +329,9 @@ expression, in which case we want to handle forms differently."
'string<))))))
(defun loaddefs-generate--parse-file (file main-outfile &optional package-data)
- "Examing FILE for ;;;###autoload statements.
+ "Examining FILE for ;;;###autoload statements.
MAIN-OUTFILE is the main loaddefs file these statements are
-destined for, but this can be overriden by the buffer-local
+destined for, but this can be overridden by the buffer-local
setting of `generated-autoload-file' in FILE, and
by ;;;###foo-autoload statements.
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 4db50bbaa9b..6a193a56d2d 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -378,7 +378,7 @@ Assumes the caller has bound `macroexpand-all-environment'."
form
`(,fn ,var ,new-expr))))
(`(setq . ,args)
- ;; Normalise to a sequence of (setq SYM EXPR).
+ ;; Normalize to a sequence of (setq SYM EXPR).
;; Malformed code is translated to code that signals an error
;; at run time.
(let ((nargs (length args)))
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index 00c9e5438b8..2d5a1b5e77b 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -313,7 +313,7 @@ different, but `function-equal' will hopefully ignore those differences.")
(defmacro add-function (how place function &optional props)
;; TODO:
;; - maybe let `how' specify some kind of predicate and use it
- ;; to implement things like mode-local or eieio-defmethod.
+ ;; to implement things like mode-local or cl-defmethod.
;; Of course, that only makes sense if the predicates of all advices can
;; be combined and made more efficient.
;; :before is like a normal add-hook on a normal hook.
@@ -352,7 +352,7 @@ is also interactive. There are 3 cases:
(declare
;;(indent 2)
(debug (form [&or symbolp ("local" form) ("var" sexp) gv-place]
- form &optional form)))
+ form &optional form)))
`(advice--add-function ,how (gv-ref ,(advice--normalize-place place))
,function ,props))
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 5649b2db614..f9600675998 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -356,10 +356,10 @@ More specifically the value can be:
This also applies to the \"archive-contents\" file that lists the
contents of the archive."
- :type '(choice (const nil :tag "Never")
- (const allow-unsigned :tag "Allow unsigned")
- (const t :tag "Check always")
- (const all :tag "Check all signatures"))
+ :type '(choice (const :value nil :tag "Never")
+ (const :value allow-unsigned :tag "Allow unsigned")
+ (const :value t :tag "Check always")
+ (const :value all :tag "Check all signatures"))
:risky t
:version "27.1")
@@ -419,22 +419,22 @@ synchronously."
(defcustom package-name-column-width 30
"Column width for the Package name in the package menu."
- :type 'number
+ :type 'natnum
:version "28.1")
(defcustom package-version-column-width 14
"Column width for the Package version in the package menu."
- :type 'number
+ :type 'natnum
:version "28.1")
(defcustom package-status-column-width 12
"Column width for the Package status in the package menu."
- :type 'number
+ :type 'natnum
:version "28.1")
(defcustom package-archive-column-width 8
"Column width for the Package archive in the package menu."
- :type 'number
+ :type 'natnum
:version "28.1")
@@ -721,8 +721,7 @@ REQUIREMENTS is a list of dependencies on other packages.
where OTHER-VERSION is a string.
EXTRA-PROPERTIES is currently unused."
- (declare (indent defun))
- ;; FIXME: Placeholder! Should we keep it?
+ (declare (obsolete nil "29.1") (indent defun))
(error "Don't call me!"))
@@ -3521,9 +3520,6 @@ The full list of keys can be viewed with \\[describe-mode]."
(message (mapconcat #'package--prettify-quick-help-key
package--quick-help-keys "\n")))
-(define-obsolete-function-alias
- 'package-menu-view-commentary 'package-menu-describe-package "24.1")
-
(defun package-menu-get-status ()
"Return status text of package at point in Package Menu."
(package--ensure-package-menu-mode)
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 24770fac67f..46b429ce6fe 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -216,19 +216,17 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
"Buffer to use for the RE Builder.")
;; Define the local "\C-c" keymap
-(defvar reb-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" 'reb-toggle-case)
- (define-key map "\C-c\C-q" 'reb-quit)
- (define-key map "\C-c\C-w" 'reb-copy)
- (define-key map "\C-c\C-s" 'reb-next-match)
- (define-key map "\C-c\C-r" 'reb-prev-match)
- (define-key map "\C-c\C-i" 'reb-change-syntax)
- (define-key map "\C-c\C-e" 'reb-enter-subexp-mode)
- (define-key map "\C-c\C-b" 'reb-change-target-buffer)
- (define-key map "\C-c\C-u" 'reb-force-update)
- map)
- "Keymap used by the RE Builder.")
+(defvar-keymap reb-mode-map
+ :doc "Keymap used by the RE Builder."
+ "C-c C-c" #'reb-toggle-case
+ "C-c C-q" #'reb-quit
+ "C-c C-w" #'reb-copy
+ "C-c C-s" #'reb-next-match
+ "C-c C-r" #'reb-prev-match
+ "C-c C-i" #'reb-change-syntax
+ "C-c C-e" #'reb-enter-subexp-mode
+ "C-c C-b" #'reb-change-target-buffer
+ "C-c C-u" #'reb-force-update)
(easy-menu-define reb-mode-menu reb-mode-map
"Menu for the RE Builder."
@@ -263,12 +261,10 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
(setq-local blink-matching-paren nil)
(reb-mode-common))
-(defvar reb-lisp-mode-map
- (let ((map (make-sparse-keymap)))
- ;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from
- ;; `emacs-lisp-mode'
- (define-key map "\C-c" (lookup-key reb-mode-map "\C-c"))
- map))
+(defvar-keymap reb-lisp-mode-map
+ ;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from
+ ;; `emacs-lisp-mode'
+ "C-c" (keymap-lookup reb-mode-map "C-c"))
(define-derived-mode reb-lisp-mode
emacs-lisp-mode "RE Builder Lisp"
@@ -278,16 +274,22 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
(require 'rx)) ; require rx anyway
(reb-mode-common))
-(defvar reb-subexp-mode-map
- (let ((m (make-keymap)))
- (suppress-keymap m)
- ;; Again share the "\C-c" keymap for the commands
- (define-key m "\C-c" (lookup-key reb-mode-map "\C-c"))
- (define-key m "q" 'reb-quit-subexp-mode)
- (dotimes (digit 10)
- (define-key m (int-to-string digit) 'reb-display-subexp))
- m)
- "Keymap used by the RE Builder for the subexpression mode.")
+(defvar-keymap reb-subexp-mode-map
+ :doc "Keymap used by the RE Builder for the subexpression mode."
+ :full t :suppress t
+ ;; Again share the "\C-c" keymap for the commands
+ "C-c" (keymap-lookup reb-mode-map "C-c")
+ "q" #'reb-quit-subexp-mode
+ "0" #'reb-display-subexp
+ "1" #'reb-display-subexp
+ "2" #'reb-display-subexp
+ "3" #'reb-display-subexp
+ "4" #'reb-display-subexp
+ "5" #'reb-display-subexp
+ "6" #'reb-display-subexp
+ "7" #'reb-display-subexp
+ "8" #'reb-display-subexp
+ "9" #'reb-display-subexp)
(defun reb-mode-common ()
"Setup functions common to functions `reb-mode' and `reb-lisp-mode'."
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 947b64e8687..36c17f4cd5e 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -632,5 +632,20 @@ Signal an error if SEQUENCE is empty."
;; we automatically highlight macros.
(add-hook 'emacs-lisp-mode-hook #'seq--activate-font-lock-keywords))
+(defun seq-split (sequence length)
+ "Split SEQUENCE into a list of sub-sequences of at most LENGTH.
+All the sub-sequences will be of LENGTH, except the last one,
+which may be shorter."
+ (when (< length 1)
+ (error "Sub-sequence length must be larger than zero"))
+ (let ((result nil)
+ (seq-length (length sequence))
+ (start 0))
+ (while (< start seq-length)
+ (push (seq-subseq sequence start
+ (setq start (min seq-length (+ start length))))
+ result))
+ (nreverse result)))
+
(provide 'seq)
;;; seq.el ends here
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index c82aa3365cd..a2d954cadbb 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -353,6 +353,13 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
(abbreviate-file-name
:no-eval (abbreviate-file-name "/home/some-user")
:eg-result "~some-user")
+ (file-parent-directory
+ :eval (file-parent-directory "/foo/bar")
+ :eval (file-parent-directory "~")
+ :eval (file-parent-directory "/tmp/")
+ :eval (file-parent-directory "foo/bar")
+ :eval (file-parent-directory "foo")
+ :eval (file-parent-directory "/"))
"Quoted File Names"
(file-name-quote
:args (name)
@@ -889,6 +896,8 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
:eval (seq-subseq '(a b c d e) 2 4))
(seq-take
:eval (seq-take '(a b c d e) 3))
+ (seq-split
+ :eval (seq-split [0 1 2 3 5] 2))
(seq-take-while
:eval (seq-take-while #'cl-evenp [2 4 9 6 5]))
(seq-uniq
@@ -1358,15 +1367,15 @@ If SAME-WINDOW, don't pop to a new window."
'action (lambda (_)
(describe-function function))
'follow-link t
- 'help-echo (purecopy "mouse-1, RET: describe function"))
+ 'help-echo "mouse-1, RET: describe function")
(insert-text-button
(symbol-name function)
'face 'button
'action (lambda (_)
(info-lookup-symbol function 'emacs-lisp-mode))
'follow-link t
- 'help-echo (purecopy "mouse-1, RET: show \
-function's documentation in the Info manual")))
+ 'help-echo "mouse-1, RET: show \
+function's documentation in the Info manual"))
(setq arglist-start (point))
(insert ")\n")
;; Doc string.
diff --git a/lisp/emacs-lisp/shorthands.el b/lisp/emacs-lisp/shorthands.el
index a9e4343715c..ffd3856db6c 100644
--- a/lisp/emacs-lisp/shorthands.el
+++ b/lisp/emacs-lisp/shorthands.el
@@ -61,8 +61,7 @@
(defun shorthands-font-lock-shorthands (limit)
(when read-symbol-shorthands
(while (re-search-forward
- (eval-when-compile
- (concat "\\_<\\(" lisp-mode-symbol-regexp "\\)\\_>"))
+ (concat "\\_<\\(" (rx lisp-mode-symbol) "\\)\\_>")
limit t)
(let* ((existing (get-text-property (match-beginning 1) 'face))
(probe (and (not (memq existing '(font-lock-comment-face
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 390e505f009..5037ae47e83 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -167,9 +167,13 @@ non-nil, return the last LENGTH characters instead.
If CODING-SYSTEM is non-nil, STRING will be encoded before
limiting, and LENGTH is interpreted as the number of bytes to
limit the string to. The result will be a unibyte string that is
-shorter than LENGTH, but will not contain \"partial\" characters,
-even if CODING-SYSTEM encodes characters with several bytes per
-character.
+shorter than LENGTH, but will not contain \"partial\"
+characters (or glyphs), even if CODING-SYSTEM encodes characters
+with several bytes per character. If the coding system specifies
+prefix like the byte order mark (aka \"BOM\") or a shift-in sequence,
+their bytes will be normally counted as part of LENGTH. This is
+the case, for instance, with `utf-16'. If this isn't desired, use a
+coding system that doesn't specify a BOM, like `utf-16le' or `utf-16be'.
When shortening strings for display purposes,
`truncate-string-to-width' is almost always a better alternative
@@ -177,34 +181,55 @@ than this function."
(unless (natnump length)
(signal 'wrong-type-argument (list 'natnump length)))
(if coding-system
- (let ((result nil)
- (result-length 0)
- (index (if end (1- (length string)) 0)))
- ;; FIXME: This implementation, which uses encode-coding-char
- ;; to encode the string one character at a time, is in general
- ;; incorrect: coding-systems that produce prefix or suffix
- ;; bytes, such as ISO-2022-based or UTF-8/16 with BOM, will
- ;; produce those bytes for each character, instead of just
- ;; once for the entire string. encode-coding-char attempts to
- ;; remove those extra bytes at least in some situations, but
- ;; it cannot do that in all cases. And in any case, producing
- ;; what is supposed to be a UTF-16 or ISO-2022-CN encoded
- ;; string which lacks the BOM bytes at the beginning and the
- ;; charset designation sequences at the head and tail of the
- ;; result will definitely surprise the callers in some cases.
- (while (let ((encoded (encode-coding-char
- (aref string index) coding-system)))
- (and (<= (+ (length encoded) result-length) length)
- (progn
- (push encoded result)
- (cl-incf result-length (length encoded))
- (setq index (if end (1- index)
- (1+ index))))
- (if end (> index -1)
- (< index (length string)))))
- ;; No body.
- )
- (apply #'concat (if end result (nreverse result))))
+ ;; The previous implementation here tried to encode char by
+ ;; char, and then adding up the length of the encoded octets,
+ ;; but that's not reliably in the presence of BOM marks and
+ ;; ISO-2022-CN which may add charset designations at the
+ ;; start/end of each encoded char (which we don't want). So
+ ;; iterate (with a binary search) instead to find the desired
+ ;; length.
+ (let* ((glyphs (string-glyph-split string))
+ (nglyphs (length glyphs))
+ (too-long (1+ nglyphs))
+ (stop (max (/ nglyphs 2) 1))
+ (gap stop)
+ candidate encoded found candidate-stop)
+ ;; We're returning the end of the string.
+ (when end
+ (setq glyphs (nreverse glyphs)))
+ (while (and (not found)
+ (< stop too-long))
+ (setq encoded
+ (encode-coding-string (string-join (seq-take glyphs stop))
+ coding-system))
+ (cond
+ ((= (length encoded) length)
+ (setq found encoded
+ candidate-stop stop))
+ ;; Too long; try shortening.
+ ((> (length encoded) length)
+ (setq too-long stop
+ stop (max (- stop gap) 1)))
+ ;; Too short; try lengthening.
+ (t
+ (setq candidate encoded
+ candidate-stop stop)
+ (setq stop
+ (if (>= stop nglyphs)
+ too-long
+ (min (+ stop gap) nglyphs)))))
+ (setq gap (max (/ gap 2) 1)))
+ (cond
+ ((not (or found candidate))
+ "")
+ ;; We're returning the end, so redo the encoding.
+ (end
+ (encode-coding-string
+ (string-join (nreverse (seq-take glyphs candidate-stop)))
+ coding-system))
+ (t
+ (or found candidate))))
+ ;; Char-based version.
(cond
((<= (length string) length) string)
(end (substring string (- (length string) length)))
@@ -265,6 +290,7 @@ it makes no sense to convert it to a string using
(set-buffer source-buffer)
(replace-buffer-contents tmp-buffer max-secs max-costs)))))))))
+;;;###autoload
(defmacro named-let (name bindings &rest body)
"Looping construct taken from Scheme.
Like `let', bind variables in BINDINGS and then evaluate BODY,
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 7d815a3cedc..9868d8c4ec0 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -216,33 +216,28 @@ If ADVANCE is non-nil, move forward by one line afterwards."
(while (re-search-forward re nil 'noerror)
(tabulated-list-put-tag empty)))))
-(defvar tabulated-list-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map (make-composed-keymap
- button-buffer-map
- special-mode-map))
- (define-key map "n" 'next-line)
- (define-key map "p" 'previous-line)
- (define-key map (kbd "M-<left>") 'tabulated-list-previous-column)
- (define-key map (kbd "M-<right>") 'tabulated-list-next-column)
- (define-key map "S" 'tabulated-list-sort)
- (define-key map "}" 'tabulated-list-widen-current-column)
- (define-key map "{" 'tabulated-list-narrow-current-column)
- (define-key map [follow-link] 'mouse-face)
- (define-key map [mouse-2] 'mouse-select-window)
- map)
- "Local keymap for `tabulated-list-mode' buffers.")
-
-(defvar tabulated-list-sort-button-map
- (let ((map (make-sparse-keymap)))
- (define-key map [header-line mouse-1] 'tabulated-list-col-sort)
- (define-key map [header-line mouse-2] 'tabulated-list-col-sort)
- (define-key map [mouse-1] 'tabulated-list-col-sort)
- (define-key map [mouse-2] 'tabulated-list-col-sort)
- (define-key map "\C-m" 'tabulated-list-sort)
- (define-key map [follow-link] 'mouse-face)
- map)
- "Local keymap for `tabulated-list-mode' sort buttons.")
+(defvar-keymap tabulated-list-mode-map
+ :doc "Local keymap for `tabulated-list-mode' buffers."
+ :parent (make-composed-keymap button-buffer-map
+ special-mode-map)
+ "n" #'next-line
+ "p" #'previous-line
+ "M-<left>" #'tabulated-list-previous-column
+ "M-<right>" #'tabulated-list-next-column
+ "S" #'tabulated-list-sort
+ "}" #'tabulated-list-widen-current-column
+ "{" #'tabulated-list-narrow-current-column
+ "<follow-link>" 'mouse-face
+ "<mouse-2>" #'mouse-select-window)
+
+(defvar-keymap tabulated-list-sort-button-map
+ :doc "Local keymap for `tabulated-list-mode' sort buttons."
+ "<header-line> <mouse-1>" #'tabulated-list-col-sort
+ "<header-line> <mouse-2>" #'tabulated-list-col-sort
+ "<mouse-1>" #'tabulated-list-col-sort
+ "<mouse-2>" #'tabulated-list-col-sort
+ "RET" #'tabulated-list-sort
+ "<follow-link>" 'mouse-face)
(defun tabulated-list-make-glyphless-char-display-table ()
"Make the `glyphless-char-display' table used for text-mode frames.
diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el
index aef18d0ba27..d48698234fc 100644
--- a/lisp/emacs-lisp/timer-list.el
+++ b/lisp/emacs-lisp/timer-list.el
@@ -81,13 +81,12 @@
;; doing. Kids, don't try this at home!
;;;###autoload (put 'list-timers 'disabled "Beware: manually canceling timers can ruin your Emacs session.")
-(defvar timer-list-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "c" 'timer-list-cancel)
- (easy-menu-define nil map ""
- '("Timers"
- ["Cancel" timer-list-cancel t]))
- map))
+(defvar-keymap timer-list-mode-map
+ "c" #'timer-list-cancel
+ :menu
+ '("Timers"
+ ["Cancel" timer-list-cancel t]
+ ["Quit" quit-window]))
(define-derived-mode timer-list-mode tabulated-list-mode "Timer-List"
"Mode for listing and controlling timers."
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 165f5c7bfe2..c2f6c162269 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -273,12 +273,11 @@ If `current-prefix-arg' is non-nil, also read a buffer and a \"context\"
(if default (symbol-name default)))))
(when current-prefix-arg
(list
- (read-buffer (format-prompt "Output to buffer" trace-buffer))
+ (read-buffer "Output to buffer" trace-buffer)
(let ((exp
- (let ((minibuffer-completing-symbol t))
- (read-from-minibuffer "Context expression: "
- nil read-expression-map t
- 'read-expression-history))))
+ (read-from-minibuffer "Context expression: "
+ nil read-expression-map t
+ 'read-expression-history)))
(lambda ()
(let ((print-circle t)
(print-escape-newlines t))
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index 3d2eda99a9c..1818e22a923 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -88,9 +88,6 @@ The functions get one argument, the first locked buffer found."
:group 'emacs-lock
:version "24.3")
-(define-obsolete-variable-alias 'emacs-lock-from-exiting
- 'emacs-lock-mode "24.1")
-
(defvar-local emacs-lock-mode nil
"If non-nil, the current buffer is locked.
It can be one of the following values:
@@ -247,14 +244,6 @@ some major modes from being locked under some circumstances."
;; continue standard unloading
nil))
-;;; Compatibility
-
-(defun toggle-emacs-lock ()
- "Toggle `emacs-lock-from-exiting' for the current buffer."
- (declare (obsolete emacs-lock-mode "24.1"))
- (interactive)
- (call-interactively 'emacs-lock-mode))
-
(provide 'emacs-lock)
;;; emacs-lock.el ends here
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index c4eb183ce44..06130afa7da 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -105,7 +105,8 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
#'viper-end-mapping-kbd-macro)
(define-key viper-emacs-intercept-map "\C-x)"
#'viper-end-mapping-kbd-macro)
- (message "Mapping %S in %s state. Type macro definition followed by `C-x )'"
+ (message (substitute-command-keys "Mapping %S in %s state. \
+Type macro definition followed by \\[kmacro-end-macro]")
(viper-display-macro macro-name)
(if ins "Insert" "Vi")))
))
@@ -886,8 +887,9 @@ mistakes in macro names to be passed to this function is to use
(if (get-register reg)
(if (y-or-n-p "Register contains data. Overwrite? ")
()
- (error
- "Macro not saved in register. Can still be invoked via `C-x e'")))
+ (error
+ (substitute-command-keys
+ "Macro not saved in register. Can still be invoked via \\[kmacro-end-and-call-macro]"))))
(set-register reg last-kbd-macro))
(defun viper-register-macro (count)
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index b1c361145ca..be87d788e92 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -559,10 +559,10 @@ and improving upon much of it.
2. Vi exit functions (e.g., :wq, ZZ) work on INDIVIDUAL files -- they
do not cause Emacs to quit, except at user level 1 (for a novice).
3. ^X^C EXITS EMACS.
- 4. Viper supports multiple undo: `u' will undo. Typing `.' will repeat
- undo. Another `u' changes direction.
+ 4. Viper supports multiple undo: \\`u' will undo. Typing \\`.' will repeat
+ undo. Another \\`u' changes direction.
- 6. Emacs Meta key is `C-\\' (in all modes) or `\\ ESC' (in Vi command mode).
+ 6. Emacs Meta key is \\`C-\\' (in all modes) or \\`\\ ESC' (in Vi command mode).
On a window system, the best way is to use the Meta-key on your keyboard.
7. Try \\[keyboard-quit] and \\[abort-recursive-edit] repeatedly,if
something funny happens. This would abort the current editing command.
@@ -573,12 +573,12 @@ For more information on Viper:
b. Print Viper manual, found in ./etc/viper.dvi
c. Print the Quick Reference, found in ./etc/viperCard.dvi
-To submit a bug report or to contact the author, type :submitReport in Vi
+To submit a bug report or to contact the author, type \\`:submitReport' in Vi
command mode. To shoo Viper away and return to pure Emacs (horror!), type:
\\[viper-go-away]
-This startup message appears whenever you load Viper, unless you type `y' now."
+This startup message appears whenever you load Viper, unless you type \\`y' now."
))
(goto-char (point-min))
(if (y-or-n-p "Inhibit Viper startup message? ")
diff --git a/lisp/env.el b/lisp/env.el
index a630bf120f8..a35383a13b1 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -225,7 +225,7 @@ VARIABLES is a list of variable settings of the form (VAR VALUE),
where VAR is the name of the variable (a string) and VALUE
is its value (also a string).
-The previous values will be be restored upon exit."
+The previous values will be restored upon exit."
(declare (indent 1) (debug (sexp body)))
(unless (consp variables)
(error "Invalid VARIABLES: %s" variables))
diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el
index 6170dcb6116..bb34ca72d6b 100644
--- a/lisp/epa-mail.el
+++ b/lisp/epa-mail.el
@@ -30,21 +30,19 @@
;;; Local Mode
-(defvar epa-mail-mode-map
- (let ((keymap (make-sparse-keymap)))
- (define-key keymap "\C-c\C-ed" 'epa-mail-decrypt)
- (define-key keymap "\C-c\C-ev" 'epa-mail-verify)
- (define-key keymap "\C-c\C-es" 'epa-mail-sign)
- (define-key keymap "\C-c\C-ee" 'epa-mail-encrypt)
- (define-key keymap "\C-c\C-ei" 'epa-mail-import-keys)
- (define-key keymap "\C-c\C-eo" 'epa-insert-keys)
- (define-key keymap "\C-c\C-e\C-d" 'epa-mail-decrypt)
- (define-key keymap "\C-c\C-e\C-v" 'epa-mail-verify)
- (define-key keymap "\C-c\C-e\C-s" 'epa-mail-sign)
- (define-key keymap "\C-c\C-e\C-e" 'epa-mail-encrypt)
- (define-key keymap "\C-c\C-e\C-i" 'epa-mail-import-keys)
- (define-key keymap "\C-c\C-e\C-o" 'epa-insert-keys)
- keymap))
+(defvar-keymap epa-mail-mode-map
+ "C-c C-e d" #'epa-mail-decrypt
+ "C-c C-e v" #'epa-mail-verify
+ "C-c C-e s" #'epa-mail-sign
+ "C-c C-e e" #'epa-mail-encrypt
+ "C-c C-e i" #'epa-mail-import-keys
+ "C-c C-e o" #'epa-insert-keys
+ "C-c C-e C-d" #'epa-mail-decrypt
+ "C-c C-e C-v" #'epa-mail-verify
+ "C-c C-e C-s" #'epa-mail-sign
+ "C-c C-e C-e" #'epa-mail-encrypt
+ "C-c C-e C-i" #'epa-mail-import-keys
+ "C-c C-e C-o" #'epa-insert-keys)
(defvar epa-mail-mode-hook nil)
(defvar epa-mail-mode-on-hook nil)
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index bee2551d76e..8be4894ecbb 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1644,7 +1644,7 @@ Then display the welcome message."
"Return list of unescaped components from an \"ISUPPORT\" VALUE."
;; https://tools.ietf.org/html/draft-brocklesby-irc-isupport-03#section-2
;;
- ;; > The server SHOULD send "X", not "X="; this is the normalised form.
+ ;; > The server SHOULD send "X", not "X="; this is the normalized form.
;;
;; Note: for now, assume the server will only send non-empty values,
;; possibly with printable ASCII escapes. Though in practice, the
@@ -1673,12 +1673,15 @@ Then display the welcome message."
(split-string value ",")
(list value)))))
-;; FIXME move to erc-compat (once we decide how to load it)
-(defalias 'erc--with-memoization
- (cond
- ((fboundp 'with-memoization) #'with-memoization) ; 29.1
- ((fboundp 'cl--generic-with-memoization) #'cl--generic-with-memoization)
- (t (lambda (_ v) v))))
+(defmacro erc--with-memoization (table &rest forms)
+ "Adapter to be migrated to erc-compat."
+ (declare (indent defun))
+ `(cond
+ ((fboundp 'with-memoization)
+ (with-memoization ,table ,@forms)) ; 29.1
+ ((fboundp 'cl--generic-with-memoization)
+ (cl--generic-with-memoization ,table ,@forms))
+ (t ,@forms)))
(defun erc--get-isupport-entry (key &optional single)
"Return an item for \"ISUPPORT\" token KEY, a symbol.
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index aeada705c4a..bccf0e6f1f5 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -71,7 +71,7 @@
"Face used for highlighting buttons in ERC buffers.
A button is a piece of text that you can activate by pressing
-`RET' or `mouse-2' above it. See also `erc-button-keymap'."
+\\`RET' or `mouse-2' above it. See also `erc-button-keymap'."
:type 'face
:group 'erc-faces)
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index ff486b2d4ea..d0e1848e0eb 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -391,7 +391,7 @@ the accepted connection."
(defcustom erc-dcc-get-default-directory nil
"Default directory for incoming DCC file transfers.
If this is nil, then the current value of `default-directory' is used."
- :type '(choice (const nil :tag "Default directory") directory))
+ :type '(choice (const :value nil :tag "Default directory") directory))
;;;###autoload
(defun erc-cmd-DCC (cmd &rest args)
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index e8117f9a89b..ef9a8c243e9 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -46,7 +46,7 @@
(defcustom erc-track-enable-keybindings 'ask
"Whether to enable the ERC track keybindings, namely:
-`C-c C-SPC' and `C-c C-@', which both do the same thing.
+\\`C-c C-SPC' and \\`C-c C-@', which both do the same thing.
The default is to check to see whether these keys are used
already: if not, then enable the ERC track minor mode, which
@@ -453,12 +453,12 @@ START is the minimum length of the name used."
;; Play nice with other IRC clients (and Emacs development rules) by
;; making this a minor mode
-(defvar erc-track-minor-mode-map (make-sparse-keymap)
- "Keymap for rcirc track minor mode.")
-
-(define-key erc-track-minor-mode-map (kbd "C-c C-@") #'erc-track-switch-buffer)
-(define-key erc-track-minor-mode-map (kbd "C-c C-SPC")
- #'erc-track-switch-buffer)
+(defvar erc-track-minor-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "C-c C-@") #'erc-track-switch-buffer)
+ (define-key map (kbd "C-c C-SPC") #'erc-track-switch-buffer)
+ map)
+ "Keymap for ERC track minor mode.")
;;;###autoload
(define-minor-mode erc-track-minor-mode
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 6f17e4ee7b7..0a16831fba3 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -261,15 +261,16 @@ node `(auth) Top' and info node `(erc) Connecting'.")
:type 'boolean)
(defcustom erc-inhibit-multiline-input nil
- "Conditionally disallow input consisting of multiple lines.
+ "When non-nil, conditionally disallow input consisting of multiple lines.
Issue an error when the number of input lines submitted for
-sending exceeds this value."
+sending exceeds this value. The value t means disallow more
+than 1 line of input."
:package-version '(ERC . "5.4.1") ; FIXME match to next release
:group 'erc
:type '(choice integer boolean))
(defcustom erc-ask-about-multiline-input nil
- "Ask to ignore `erc-inhibit-multiline-input' when tripped."
+ "Whether to ask to ignore `erc-inhibit-multiline-input' when tripped."
:package-version '(ERC . "5.4.1") ; FIXME match to next release
:group 'erc
:type 'boolean)
@@ -4565,8 +4566,6 @@ This places `point' just after the prompt, or at the beginning of the line."
(defun erc-complete-word-at-point ()
(run-hook-with-args-until-success 'erc-complete-functions))
-(define-obsolete-function-alias 'erc-complete-word #'completion-at-point "24.1")
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; IRC SERVER INPUT HANDLING
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index f4c1302629b..822cc941491 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -158,14 +158,6 @@ to writing a completion function."
(eshell-cmpl--custom-variable-docstring 'pcomplete-autolist)
:type (get 'pcomplete-autolist 'custom-type))
-(defcustom eshell-cmpl-suffix-list (list ?/ ?:)
- (eshell-cmpl--custom-variable-docstring 'pcomplete-suffix-list)
- :type (get 'pcomplete-suffix-list 'custom-type)
- :group 'pcomplete)
-;; Only labeled obsolete in 26.1, but all it does it set
-;; pcomplete-suffix-list, which is itself obsolete since 24.1.
-(make-obsolete-variable 'eshell-cmpl-suffix-list nil "24.1")
-
(defcustom eshell-cmpl-recexact nil
(eshell-cmpl--custom-variable-docstring 'pcomplete-recexact)
:type (get 'pcomplete-recexact 'custom-type))
@@ -262,9 +254,6 @@ to writing a completion function."
eshell-cmpl-ignore-case)
(setq-local pcomplete-autolist
eshell-cmpl-autolist)
- (if (boundp 'pcomplete-suffix-list)
- (setq-local pcomplete-suffix-list
- eshell-cmpl-suffix-list))
(setq-local pcomplete-recexact
eshell-cmpl-recexact)
(setq-local pcomplete-man-function
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index 5396044d8ca..00880b9f281 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -168,9 +168,6 @@ Thus, this does not include the current directory.")
(defvar eshell-last-dir-ring nil
"The last directory that Eshell was in.")
-(defconst eshell-inside-emacs (format "%s,eshell" emacs-version)
- "Value for the `INSIDE_EMACS' environment variable.")
-
;;; Functions:
(defun eshell-dirs-initialize () ;Called from `eshell-mode' via intern-soft!
@@ -178,24 +175,26 @@ Thus, this does not include the current directory.")
(setq-local eshell-variable-aliases-list
(append
eshell-variable-aliases-list
- `(("-" ,(lambda (indices)
- (if (not indices)
- (unless (ring-empty-p eshell-last-dir-ring)
- (expand-file-name
- (ring-ref eshell-last-dir-ring 0)))
- (expand-file-name
- (eshell-apply-indices eshell-last-dir-ring indices)))))
- ("+" "PWD")
- ("PWD" ,(lambda (_indices)
- (expand-file-name (eshell/pwd)))
- t)
- ("OLDPWD" ,(lambda (_indices)
- (unless (ring-empty-p eshell-last-dir-ring)
- (expand-file-name
- (ring-ref eshell-last-dir-ring 0))))
- t)
- ("INSIDE_EMACS" eshell-inside-emacs
- t))))
+ `(("-" ,(lambda (indices quoted)
+ (if (not indices)
+ (unless (ring-empty-p eshell-last-dir-ring)
+ (expand-file-name
+ (ring-ref eshell-last-dir-ring 0)))
+ ;; Apply the first index, expand the file name,
+ ;; and then apply the rest of the indices.
+ (eshell-apply-indices
+ (expand-file-name
+ (eshell-apply-indices eshell-last-dir-ring
+ (list (car indices)) quoted))
+ (cdr indices) quoted))))
+ ("+" "PWD")
+ ("PWD" ,(lambda () (expand-file-name (eshell/pwd)))
+ t t)
+ ("OLDPWD" ,(lambda ()
+ (unless (ring-empty-p eshell-last-dir-ring)
+ (expand-file-name
+ (ring-ref eshell-last-dir-ring 0))))
+ t t))))
(when eshell-cd-on-directory
(setq-local eshell-interpreter-alist
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index db36909fb86..972d4f9df00 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -146,7 +146,7 @@ See variable `eshell-scroll-to-bottom-on-output' and function
Eshell buffers are truncated from the top to be no greater than this
number, if the function `eshell-truncate-buffer' is on
`eshell-output-filter-functions'."
- :type 'integer)
+ :type 'natnum)
(defcustom eshell-output-filter-functions
'(eshell-postoutput-scroll-to-bottom
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 6b864983995..5144e305121 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -301,15 +301,6 @@ Prepend remote identification of `default-directory', if any."
(setq text (replace-match " " t t text)))
text))
-(defmacro eshell-for (for-var for-list &rest forms)
- "Iterate through a list."
- (declare (obsolete dolist "24.1") (indent 2))
- `(let ((list-iter ,for-list))
- (while list-iter
- (let ((,for-var (car list-iter)))
- ,@forms)
- (setq list-iter (cdr list-iter)))))
-
(define-obsolete-function-alias 'eshell-flatten-list #'flatten-tree "27.1")
(defun eshell-stringify (object)
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 17add9b6685..2c92567773e 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -113,6 +113,9 @@
(require 'pcomplete)
(require 'ring)
+(defconst eshell-inside-emacs (format "%s,eshell" emacs-version)
+ "Value for the `INSIDE_EMACS' environment variable.")
+
(defgroup eshell-var nil
"Variable interpolation is introduced whenever the `$' character
appears unquoted in any argument (except when that argument is
@@ -149,58 +152,64 @@ if they are quoted with a backslash."
(defcustom eshell-variable-aliases-list
`(;; for eshell.el
- ("COLUMNS" ,(lambda (_indices) (window-body-width nil 'remap)) t)
- ("LINES" ,(lambda (_indices) (window-body-height nil 'remap)) t)
+ ("COLUMNS" ,(lambda () (window-body-width nil 'remap)) t t)
+ ("LINES" ,(lambda () (window-body-height nil 'remap)) t t)
+ ("INSIDE_EMACS" eshell-inside-emacs t)
;; for eshell-cmd.el
- ("_" ,(lambda (indices)
+ ("_" ,(lambda (indices quoted)
(if (not indices)
(car (last eshell-last-arguments))
(eshell-apply-indices eshell-last-arguments
- indices))))
+ indices quoted))))
("?" eshell-last-command-status)
("$" eshell-last-command-result)
+
+ ;; for em-alias.el and em-script.el
("0" eshell-command-name)
- ("1" ,(lambda (_indices) (nth 0 eshell-command-arguments)))
- ("2" ,(lambda (_indices) (nth 1 eshell-command-arguments)))
- ("3" ,(lambda (_indices) (nth 2 eshell-command-arguments)))
- ("4" ,(lambda (_indices) (nth 3 eshell-command-arguments)))
- ("5" ,(lambda (_indices) (nth 4 eshell-command-arguments)))
- ("6" ,(lambda (_indices) (nth 5 eshell-command-arguments)))
- ("7" ,(lambda (_indices) (nth 6 eshell-command-arguments)))
- ("8" ,(lambda (_indices) (nth 7 eshell-command-arguments)))
- ("9" ,(lambda (_indices) (nth 8 eshell-command-arguments)))
- ("*" ,(lambda (indices)
- (if (not indices)
- eshell-command-arguments
- (eshell-apply-indices eshell-command-arguments
- indices)))))
+ ("1" ,(lambda () (nth 0 eshell-command-arguments)) nil t)
+ ("2" ,(lambda () (nth 1 eshell-command-arguments)) nil t)
+ ("3" ,(lambda () (nth 2 eshell-command-arguments)) nil t)
+ ("4" ,(lambda () (nth 3 eshell-command-arguments)) nil t)
+ ("5" ,(lambda () (nth 4 eshell-command-arguments)) nil t)
+ ("6" ,(lambda () (nth 5 eshell-command-arguments)) nil t)
+ ("7" ,(lambda () (nth 6 eshell-command-arguments)) nil t)
+ ("8" ,(lambda () (nth 7 eshell-command-arguments)) nil t)
+ ("9" ,(lambda () (nth 8 eshell-command-arguments)) nil t)
+ ("*" eshell-command-arguments))
"This list provides aliasing for variable references.
-Each member defines the name of a variable, and a Lisp value used to
+Each member is of the following form:
+
+ (NAME VALUE [COPY-TO-ENVIRONMENT] [SIMPLE-FUNCTION])
+
+NAME defines the name of the variable, VALUE is a Lisp value used to
compute the string value that will be returned when the variable is
accessed via the syntax `$NAME'.
-If the value is a function, call that function with two arguments: the
-list of the indices that was used in the reference, and whether the
-user is requesting the length of the ultimate element. For example, a
-reference of `$NAME[10][20]' would result in the function for alias
-`NAME' being called (assuming it were aliased to a function), and the
-arguments passed to this function would be the list `(10 20)', and
+If VALUE is a function, its behavior depends on the value of
+SIMPLE-FUNCTION. If SIMPLE-FUNCTION is nil, call VALUE with two
+arguments: the list of the indices that were used in the reference,
+and either t or nil depending on whether or not the variable was
+quoted with double quotes. For example, if `NAME' were aliased
+to a function, a reference of `$NAME[10][20]' would result in that
+function being called with the arguments `((\"10\") (\"20\"))' and
nil.
+If SIMPLE-FUNCTION is non-nil, call the function with no arguments
+and then pass its return value to `eshell-apply-indices'.
-If the value is a string, return the value for the variable with that
+If VALUE is a string, return the value for the variable with that
name in the current environment. If no variable with that name exists
in the environment, but if a symbol with that same name exists and has
-a value bound to it, return its value instead. You can prioritize
-symbol values over environment values by setting
-`eshell-prefer-lisp-variables' to t.
+a value bound to it, return that symbol's value instead. You can
+prefer symbol values over environment values by setting the value
+of `eshell-prefer-lisp-variables' to t.
-If the value is a symbol, return the value bound to it.
+If VALUE is a symbol, return the value bound to it.
-If the value has any other type, signal an error.
+If VALUE has any other type, signal an error.
-Additionally, each member may specify if it should be copied to the
-environment of created subprocesses."
+Additionally, if COPY-TO-ENVIRONMENT is non-nil, the alias should be
+copied (a.k.a. \"exported\") to the environment of created subprocesses."
:type '(repeat (list string sexp
(choice (const :tag "Copy to environment" t)
(const :tag "Use only in Eshell" nil))))
@@ -545,27 +554,35 @@ For example, \"[0 1][2]\" becomes:
"Get the value for the variable NAME.
INDICES is a list of index-lists (see `eshell-parse-indices').
If QUOTED is non-nil, this was invoked inside double-quotes."
- (let* ((alias (assoc name eshell-variable-aliases-list))
- (var (if alias
- (cadr alias)
- name)))
- (if (and alias (functionp var))
- (funcall var indices)
- (eshell-apply-indices
- (cond
- ((stringp var)
- (let ((sym (intern-soft var)))
- (if (and sym (boundp sym)
- (or eshell-prefer-lisp-variables
- (memq sym eshell--local-vars) ; bug#15372
- (not (getenv var))))
- (symbol-value sym)
- (getenv var))))
- ((symbolp var)
- (symbol-value var))
- (t
- (error "Unknown variable `%s'" (eshell-stringify var))))
- indices quoted))))
+ (if-let ((alias (assoc name eshell-variable-aliases-list)))
+ (let ((target (nth 1 alias)))
+ (cond
+ ((functionp target)
+ (if (nth 3 alias)
+ (eshell-apply-indices (funcall target) indices quoted)
+ (condition-case nil
+ (funcall target indices quoted)
+ (wrong-number-of-arguments
+ (display-warning
+ :warning (concat "Function for `eshell-variable-aliases-list' "
+ "entry should accept two arguments: INDICES "
+ "and QUOTED.'"))
+ (funcall target indices)))))
+ ((symbolp target)
+ (eshell-apply-indices (symbol-value target) indices quoted))
+ (t
+ (eshell-get-variable target indices quoted))))
+ (unless (stringp name)
+ (error "Unknown variable `%s'" (eshell-stringify name)))
+ (eshell-apply-indices
+ (let ((sym (intern-soft name)))
+ (if (and sym (boundp sym)
+ (or eshell-prefer-lisp-variables
+ (memq sym eshell--local-vars) ; bug#15372
+ (not (getenv name))))
+ (symbol-value sym)
+ (getenv name)))
+ indices quoted)))
(defun eshell-apply-indices (value indices &optional quoted)
"Apply to VALUE all of the given INDICES, returning the sub-result.
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index d6116714082..432385587b4 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -372,9 +372,9 @@ INC may be passed as a numeric prefix argument.
The actual adjustment made depends on the final component of the
keybinding used to invoke the command, with all modifiers removed:
- +, = Increase font size in current buffer by one step
- - Decrease font size in current buffer by one step
- 0 Reset the font size to the global default
+ \\`+', \\`=' Increase font size in current buffer by one step
+ \\`-' Decrease font size in current buffer by one step
+ \\`0' Reset the font size to the global default
After adjusting, continue to read input events and further adjust
the font size as long as the input event read
@@ -394,7 +394,9 @@ a top-level keymap, `text-scale-increase' or
Most faces are affected by these font size changes, but not faces
that have an explicit `:height' setting. The two exceptions to
this are the `default' and `header-line' faces: they will both be
-scaled even if they have an explicit `:height' setting."
+scaled even if they have an explicit `:height' setting.
+
+See also the related command `global-text-scale-adjust'."
(interactive "p")
(let ((ev last-command-event)
(echo-keystrokes nil))
@@ -406,19 +408,15 @@ scaled even if they have an explicit `:height' setting."
(?0 0)
(_ inc))))
(text-scale-increase step)
- ;; (unless (zerop step)
- (message "Use +,-,0 for further adjustment")
(set-transient-map
(let ((map (make-sparse-keymap)))
(dolist (mods '(() (control)))
- (dolist (key '(?- ?+ ?= ?0)) ;; = is often unshifted +.
+ (dolist (key '(?+ ?= ?- ?0)) ;; = is often unshifted +.
(define-key map (vector (append mods (list key)))
(lambda () (interactive) (text-scale-adjust (abs inc))))))
map)
- nil
- ;; Clear the prompt after exiting.
- (lambda ()
- (message ""))))))
+ nil nil
+ "Use %k for further adjustment"))))
(defvar-local text-scale--pinch-start-scale 0
"The text scale at the start of a pinch sequence.")
@@ -445,6 +443,83 @@ scaled even if they have an explicit `:height' setting."
(+ text-scale--pinch-start-scale
(round (log scale text-scale-mode-step)))))))
+(defcustom global-text-scale-adjust-resizes-frames nil
+ "Whether `global-text-scale-adjust' resizes the frames."
+ :type '(choice (const :tag "Off" nil)
+ (const :tag "On" t))
+ :group 'display
+ :version "29.1")
+
+(defcustom global-text-scale-adjust-limits '(10 . 500)
+ "Min/max values for `global-text-scale-adjust'.
+This is a cons cell where the `car' has the minimum font size and
+the `cdr' has the maximum font size, in units of 1/10 pt."
+ :version "29.1"
+ :group 'display
+ :type '(cons (integer :tag "Min")
+ (integer :tag "Max")))
+
+(defvar global-text-scale-adjust--default-height nil)
+
+;;;###autoload (define-key ctl-x-map [(control meta ?+)] 'global-text-scale-adjust)
+;;;###autoload (define-key ctl-x-map [(control meta ?=)] 'global-text-scale-adjust)
+;;;###autoload (define-key ctl-x-map [(control meta ?-)] 'global-text-scale-adjust)
+;;;###autoload (define-key ctl-x-map [(control meta ?0)] 'global-text-scale-adjust)
+;;;###autoload
+(defun global-text-scale-adjust (increment)
+ "Globally adjust the font size by INCREMENT.
+
+Interactively, INCREMENT may be passed as a numeric prefix argument.
+
+The adjustment made depends on the final component of the key binding
+used to invoke the command, with all modifiers removed:
+
+ \\`+', \\`=' Globally increase the height of the default face
+ \\`-' Globally decrease the height of the default face
+ \\`0' Globally reset the height of the default face
+
+After adjusting, further adjust the font size as long as the key,
+with all modifiers removed, is one of the above characters.
+
+Buffer-local face adjustments have higher priority than global
+face adjustments.
+
+The variable `global-text-scale-adjust-resizes-frames' controls
+whether the frames are resized to keep the same number of lines
+and characters per line when the font size is adjusted.
+
+See also the related command `text-scale-adjust'."
+ (interactive "p")
+ (when (display-graphic-p)
+ (unless global-text-scale-adjust--default-height
+ (setq global-text-scale-adjust--default-height
+ (face-attribute 'default :height)))
+ (let* ((key (event-basic-type last-command-event))
+ (echo-keystrokes nil)
+ (cur (face-attribute 'default :height))
+ (inc
+ (pcase key
+ (?- (* (- increment) 5))
+ (?0 (- global-text-scale-adjust--default-height cur))
+ (_ (* increment 5))))
+ (new (+ cur inc)))
+ (when (< (car global-text-scale-adjust-limits)
+ new
+ (cdr global-text-scale-adjust-limits))
+ (let ((frame-inhibit-implied-resize
+ (not global-text-scale-adjust-resizes-frames)))
+ (set-face-attribute 'default nil :height new)))
+ (when (characterp key)
+ (set-transient-map
+ (let ((map (make-sparse-keymap)))
+ (dolist (mod '(() (control meta)))
+ (dolist (key '(?+ ?= ?- ?0))
+ (define-key map (vector (append mod (list key)))
+ 'global-text-scale-adjust)))
+ map)
+ nil nil
+ "Use %k for further adjustment")))))
+
;; ----------------------------------------------------------------
;; buffer-face-mode
diff --git a/lisp/faces.el b/lisp/faces.el
index d104fdbc2fc..f04ea9115ee 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1883,7 +1883,7 @@ This value was determined experimentally.")
"Whether RGB is more readable against white than black.
RGB is a 3-element list (R G B), each component in the range [0,1].
This predicate can be used both for determining a suitable (black or white)
-contrast colour with RGB as background and as foreground."
+contrast color with RGB as background and as foreground."
(unless (<= 0 (apply #'min rgb) (apply #'max rgb) 1)
(error "RGB components %S not in [0,1]" rgb))
;; Compute the relative luminance after gamma-correcting (assuming sRGB),
diff --git a/lisp/ffap.el b/lisp/ffap.el
index ae86e554906..9de0dd40d16 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1,6 +1,6 @@
;;; ffap.el --- find file (or url) at point -*- lexical-binding: t -*-
-;; Copyright (C) 1995-1997, 2000-2022 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2022 Free Software Foundation, Inc.
;; Author: Michelangelo Grigni <mic@mathcs.emory.edu>
;; Maintainer: emacs-devel@gnu.org
@@ -68,8 +68,8 @@
;; If you do not like these bindings, modify the variable
;; `ffap-bindings', or write your own.
;;
-;; If you use ange-ftp, browse-url, complete, efs, or w3, it is best
-;; to load or autoload them before ffap. If you use ff-paths, load it
+;; If you use ange-ftp, browse-url, complete, efs, it is best to load
+;; or autoload them before ffap. If you use ff-paths, load it
;; afterwards. Try apropos {C-h a ffap RET} to get a list of the many
;; option variables. In particular, if ffap is slow, try these:
;;
@@ -79,7 +79,7 @@
;; (setq ffap-shell-prompt-regexp nil) ; disable shell prompt stripping
;; (setq ffap-gopher-regexp nil) ; disable gopher bookmark matching
;;
-;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URLs.
+;; ffap uses `browse-url' to fetch URLs.
;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site).
;; Also, you can add `ffap-menu-rescan' to various hooks to fontify
;; the file and URL references within a buffer.
@@ -97,7 +97,6 @@
;; * break long menus into multiple panes (like imenu?)
;; * notice node in "(dired)Virtual Dired" (quotes, parentheses, whitespace)
;; * notice "machine.dom blah blah blah dir/file" (how?)
-;; * as w3 becomes standard, rewrite to rely more on its functions
;; * regexp options for ffap-string-at-point, like font-lock (MCOOK)
;; * v19: could replace `ffap-locate-file' with a quieter `locate-library'
;; * handle "$(VAR)" in Makefiles
@@ -377,6 +376,12 @@ Actual search is done by the function `ffap-next-guess'."
;;; Machines (`ffap-machine-p'):
+(defun ffap-accept-or-reject-p (symbol)
+ "Return non-nil if SYMBOL is `accept' or `reject'.
+Otherwise, return nil. This is intended for use as the
+predicate in the `:safe' property of user options."
+ (memq symbol '(accept reject)))
+
;; I cannot decide a "best" strategy here, so these are variables. In
;; particular, if `Pinging...' is broken or takes too long on your
;; machine, try setting these all to accept or reject.
@@ -385,16 +390,21 @@ Actual search is done by the function `ffap-next-guess'."
Value should be a symbol, one of `ping', `accept', and `reject'."
:type '(choice (const ping)
(const accept)
- (const reject))
+ (const reject))
+ :safe #'ffap-accept-or-reject-p
:group 'ffap)
-(defcustom ffap-machine-p-known 'ping ; `accept' for higher speed
+
+(defcustom ffap-machine-p-known 'accept
"What `ffap-machine-p' does with hostnames that have a known domain.
Value should be a symbol, one of `ping', `accept', and `reject'.
See `mail-extr.el' for the known domains."
:type '(choice (const ping)
(const accept)
- (const reject))
- :group 'ffap)
+ (const reject))
+ :safe #'ffap-accept-or-reject-p
+ :group 'ffap
+ :version "29.1")
+
(defcustom ffap-machine-p-unknown 'reject
"What `ffap-machine-p' does with hostnames that have an unknown domain.
Value should be a symbol, one of `ping', `accept', and `reject'.
@@ -402,6 +412,7 @@ See `mail-extr.el' for the known domains."
:type '(choice (const ping)
(const accept)
(const reject))
+ :safe #'ffap-accept-or-reject-p
:group 'ffap)
(defun ffap-what-domain (domain)
@@ -544,6 +555,7 @@ The optional NOMODIFY argument suppresses the extra search."
(string-match ffap-rfs-regexp filename)
filename)))
+;;;###autoload
(defun ffap-machine-at-point ()
"Return machine name at point if it exists, or nil."
(let ((mach (ffap-string-at-point 'machine)))
@@ -1326,29 +1338,25 @@ Assumes the buffer has not changed."
;; Older: (apply 'copy-region-as-kill ffap-string-at-point-region)
(message "Copied to kill ring: %s" str))))
-;; External.
-(declare-function w3-view-this-url "ext:w3" (&optional no-show))
-
+;;;###autoload
(defun ffap-url-at-point ()
"Return URL from around point if it exists, or nil.
Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any."
(when ffap-url-regexp
- (or (and (eq major-mode 'w3-mode) ; In a w3 buffer button?
- (w3-view-this-url t))
- (let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp)
- (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix)
- val)
- (setq val (thing-at-point-url-at-point ffap-lax-url
- (if (use-region-p)
- (cons (region-beginning)
- (region-end)))))
- (if val
- (let ((bounds (thing-at-point-bounds-of-url-at-point
- ffap-lax-url)))
- (setq ffap-string-at-point-region
- (list (car bounds) (cdr bounds)))))
- val))))
+ (let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp)
+ (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix)
+ val)
+ (setq val (thing-at-point-url-at-point ffap-lax-url
+ (if (use-region-p)
+ (cons (region-beginning)
+ (region-end)))))
+ (if val
+ (let ((bounds (thing-at-point-bounds-of-url-at-point
+ ffap-lax-url)))
+ (setq ffap-string-at-point-region
+ (list (car bounds) (cdr bounds)))))
+ val)))
(defvar ffap-gopher-regexp
"\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *"
@@ -1489,12 +1497,7 @@ which may actually result in an URL rather than a filename."
((and (eq major-mode 'internal-ange-ftp-mode)
(string-match "^\\*ftp \\(.*\\)@\\(.*\\)\\*$"
(buffer-name)))
- (concat "/" (substring (buffer-name) 5 -1) ":"))
- ;; This is too often a bad idea:
- ;;((and (eq major-mode 'w3-mode)
- ;; (stringp url-current-server))
- ;; (host-to-ange-path url-current-server))
- )))
+ (concat "/" (substring (buffer-name) 5 -1) ":")))))
(and remote-dir
(or
(and (string-match "\\`\\(/?~?ftp\\)/" name)
@@ -1868,7 +1871,7 @@ Return value:
;;; ffap-other-*, ffap-read-only-*, ffap-alternate-* commands:
;; There could be a real `ffap-noselect' function, but we would need
-;; at least two new user variables, and there is no w3-fetch-noselect.
+;; at least two new user variables.
;; So instead, we just fake it with a slow save-window-excursion.
(defun ffap-other-window (filename)
diff --git a/lisp/files-x.el b/lisp/files-x.el
index 4db6fbd22cc..da1e44e2504 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -81,8 +81,7 @@ Intended to be used in the `interactive' spec of
(let ((default (format "%S"
(cond ((eq variable 'unibyte) t)
((boundp variable)
- (symbol-value variable)))))
- (minibuffer-completing-symbol t))
+ (symbol-value variable))))))
(read-from-minibuffer (format "Add %s with value: " variable)
nil read-expression-map t
'set-variable-value-history
@@ -502,24 +501,26 @@ from the MODE alist ignoring the input argument VALUE."
((and (symbolp (car b)) (stringp (car a))) nil)
(t (string< (car a) (car b)))))))
(current-buffer))
+ (when (eobp) (insert "\n"))
(goto-char (point-min))
(indent-sexp))))
(defun dir-locals-to-string (variables)
"Output alists of VARIABLES to string in dotted pair notation syntax."
- (format "(%s)" (mapconcat
- (lambda (mode-variables)
- (format "(%S . %s)"
- (car mode-variables)
- (format "(%s)" (mapconcat
- (lambda (variable-value)
- (format "(%S . %s)"
- (car variable-value)
- (string-trim-right
- (pp-to-string
- (cdr variable-value)))))
- (cdr mode-variables) "\n"))))
- variables "\n")))
+ (format "(%s)"
+ (mapconcat
+ (lambda (mode-variables)
+ (format "(%S . %s)"
+ (car mode-variables)
+ (format "(%s)" (mapconcat
+ (lambda (variable-value)
+ (format "(%S . %s)"
+ (car variable-value)
+ (string-trim-right
+ (pp-to-string
+ (cdr variable-value)))))
+ (cdr mode-variables) "\n"))))
+ variables "\n")))
;;;###autoload
(defun add-dir-local-variable (mode variable value)
diff --git a/lisp/files.el b/lisp/files.el
index 1295c24c933..25b58423649 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -304,19 +304,17 @@ When nil, make them for files that have some already.
The value `never' means do not make them."
:type '(choice (const :tag "Never" never)
(const :tag "If existing" nil)
- (other :tag "Always" t))
+ (other :tag "Always" t))
+ :safe #'version-control-safe-local-p
:group 'backup)
(defun version-control-safe-local-p (x)
"Return whether X is safe as local value for `version-control'."
(or (booleanp x) (equal x 'never)))
-(put 'version-control 'safe-local-variable
- #'version-control-safe-local-p)
-
(defcustom dired-kept-versions 2
"When cleaning directory, number of versions to keep."
- :type 'integer
+ :type 'natnum
:group 'backup
:group 'dired)
@@ -330,16 +328,16 @@ If nil, ask confirmation. Any other value prevents any trimming."
(defcustom kept-old-versions 2
"Number of oldest versions to keep when a new numbered backup is made."
- :type 'integer
+ :type 'natnum
+ :safe #'natnump
:group 'backup)
-(put 'kept-old-versions 'safe-local-variable 'integerp)
(defcustom kept-new-versions 2
"Number of newest versions to keep when a new numbered backup is made.
Includes the new backup. Must be greater than 0."
- :type 'integer
+ :type 'natnum
+ :safe #'natnump
:group 'backup)
-(put 'kept-new-versions 'safe-local-variable 'integerp)
(defcustom require-final-newline nil
"Whether to add a newline automatically at the end of the file.
@@ -443,18 +441,60 @@ idle for `auto-save-visited-interval' seconds."
(when auto-save--timer
(timer-set-idle-time auto-save--timer value :repeat))))
+(defcustom auto-save-visited-predicate nil
+ "Predicate function for `auto-save-visited-mode'.
+
+If non-nil, the value should be a function of no arguments; it
+will be called once in each file-visiting buffer when the time
+comes to auto-save. A buffer will be saved only if the predicate
+function returns a non-nil value.
+
+For example, you could add this to your Init file to only save
+files that are both in Org mode and in a particular directory:
+
+ (setq auto-save-visited-predicate
+ (lambda () (and (eq major-mode \\='org-mode)
+ (string-match \"^/home/skangas/org/\"
+ buffer-file-name))))
+
+If the value of this variable is not a function, it is ignored.
+This is the same as having a predicate that always returns
+non-nil."
+ :group 'auto-save
+ :type '(choice :tag "Function:"
+ (const :tag "No extra predicate" :value nil)
+ (function :tag "Predicate function" :value always))
+ :risky t
+ :version "29.1")
+
+(defcustom remote-file-name-inhibit-auto-save-visited nil
+ "When nil, `auto-save-visited-mode' will auto-save remote files.
+Any other value means that it will not."
+ :group 'auto-save
+ :type 'boolean
+ :version "29.1")
+
(define-minor-mode auto-save-visited-mode
- "Toggle automatic saving to file-visiting buffers on or off.
+ "Toggle automatic saving of file-visiting buffers to their files.
+
+When this mode is enabled, file-visiting buffers are automatically
+saved to their files. This is in contrast to `auto-save-mode', which
+auto-saves those buffers to a separate file, leaving the original
+file intact. See Info node `Saving' for details of the save process.
-Unlike `auto-save-mode', this mode will auto-save buffer contents
-to the visited files directly and will also run all save-related
-hooks. See Info node `Saving' for details of the save process.
+The user option `auto-save-visited-interval' controls how often to
+auto-save a buffer into its visited file.
+
+You can use `auto-save-visited-predicate' to control which
+buffers are saved.
You can also set the buffer-local value of the variable
`auto-save-visited-mode' to nil. A buffer where the buffer-local
value of this variable is nil is ignored for the purpose of
`auto-save-visited-mode', even if `auto-save-visited-mode' is
-enabled."
+enabled.
+
+For more details, see Info node `(emacs) Auto Save Files'."
:group 'auto-save
:global t
(when auto-save--timer (cancel-timer auto-save--timer))
@@ -467,7 +507,11 @@ enabled."
(and buffer-file-name
auto-save-visited-mode
(not (and buffer-auto-save-file-name
- auto-save-visited-file-name))))))))
+ auto-save-visited-file-name))
+ (or (not (file-remote-p buffer-file-name))
+ (not remote-file-name-inhibit-auto-save-visited))
+ (or (not (functionp auto-save-visited-predicate))
+ (funcall auto-save-visited-predicate))))))))
;; The 'set' part is so we don't get a warning for using this variable
;; above, while still catching code that _sets_ the variable to get
@@ -1230,28 +1274,17 @@ Tip: You can use this expansion of remote identifier components
;; It's not clear what the best file for this to be in is, but given
;; it uses custom-initialize-delay, it is easier if it is preloaded
;; rather than autoloaded.
-(defcustom remote-shell-program
- ;; This used to try various hard-coded places for remsh, rsh, and
- ;; rcmd, trying to guess based on location whether "rsh" was
- ;; "restricted shell" or "remote shell", but I don't see the point
- ;; in this day and age. Almost everyone will use ssh, and have
- ;; whatever command they want to use in PATH.
- (purecopy
- (let ((list '("ssh" "remsh" "rcmd" "rsh")))
- (while (and list
- (not (executable-find (car list)))
- (setq list (cdr list))))
- (or (car list) "ssh")))
- "Program to use to execute commands on a remote host (e.g. ssh or rsh)."
- :version "24.3" ; ssh rather than rsh, etc
+(defcustom remote-shell-program (or (executable-find "ssh") "ssh")
+ "Program to use to execute commands on a remote host (i.e. ssh)."
+ :version "29.1"
:initialize 'custom-initialize-delay
:group 'environment
:type 'file)
(defcustom remote-file-name-inhibit-cache 10
"Whether to use the remote file-name cache for read access.
-When nil, never expire cached values (caution)
-When t, never use the cache (safe, but may be slow)
+When nil, never expire cached values (caution).
+When t, never use the cache (safe, but may be slow).
A number means use cached values for that amount of seconds since caching.
The attributes of remote files are cached for better performance.
@@ -3118,9 +3151,6 @@ major mode MODE.
See also `auto-mode-alist'.")
-(define-obsolete-variable-alias 'inhibit-first-line-modes-regexps
- 'inhibit-file-local-variables-regexps "24.1")
-
;; TODO really this should be a list of modes (eg tar-mode), not regexps,
;; because we are duplicating info from auto-mode-alist.
;; TODO many elements of this list are also in auto-coding-alist.
@@ -3141,9 +3171,6 @@ member files with their own local variable sections, which are
not appropriate for the containing file.
The function `inhibit-local-variables-p' uses this.")
-(define-obsolete-variable-alias 'inhibit-first-line-modes-suffixes
- 'inhibit-local-variables-suffixes "24.1")
-
(defvar inhibit-local-variables-suffixes nil
"List of regexps matching suffixes to remove from file names.
The function `inhibit-local-variables-p' uses this: when checking
@@ -5145,6 +5172,24 @@ On most systems, this will be true:
(setq filename nil))))
components))
+(defun file-parent-directory (filename)
+ "Return the directory name of the parent directory of FILENAME.
+If FILENAME is at the root of the filesystem, return nil.
+If FILENAME is relative, it is interpreted to be relative
+to `default-directory', and the result will also be relative."
+ (let* ((expanded-filename (expand-file-name filename))
+ (parent (file-name-directory (directory-file-name expanded-filename))))
+ (cond
+ ;; filename is at top-level, therefore no parent
+ ((or (null parent)
+ (file-equal-p parent expanded-filename))
+ nil)
+ ;; filename is relative, return relative parent
+ ((not (file-name-absolute-p filename))
+ (file-relative-name parent))
+ (t
+ parent))))
+
(defcustom make-backup-file-name-function
#'make-backup-file-name--default-function
"A function that `make-backup-file-name' uses to create backup file names.
@@ -7955,7 +8000,7 @@ If RESTART, restart Emacs after killing the current Emacs process."
("Close Without Saving" . no-save)
("Save All" . save-all)
("Cancel" . cancel)))
- ('cancel (user-error "Exit cancelled"))
+ ('cancel (user-error "Exit canceled"))
('save-all (save-some-buffers t)))
(save-some-buffers arg t)))
(let ((confirm confirm-kill-emacs))
diff --git a/lisp/filesets.el b/lisp/filesets.el
index b97dda3cd61..a8d837e7e15 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -326,8 +326,8 @@ See `easy-menu-add-item' for documentation."
Set this to \"\", to disable caching of menus.
Don't forget to check out `filesets-menu-ensure-use-cached'."
:set #'filesets-set-default
- :type 'file)
-(put 'filesets-menu-cache-file 'risky-local-variable t)
+ :type 'file
+ :risky t)
(defcustom filesets-menu-cache-contents
'(filesets-be-docile-flag
@@ -414,12 +414,12 @@ time to time or if the fileset cache causes troubles."
Set this value to 0 to turn menu splitting off. BTW, parts of submenus
will not be rewrapped if their length exceeds this value."
:set #'filesets-set-default
- :type 'integer)
+ :type 'natnum)
(defcustom filesets-max-entry-length 50
"Truncate names of split submenus to this length."
:set #'filesets-set-default
- :type 'integer)
+ :type 'natnum)
(defcustom filesets-browse-dir-function #'dired
"A function or command used for browsing directories.
@@ -518,7 +518,7 @@ i.e. how deep the menu should be. Try something like
and it should become clear what this option is about. In any case,
including directory trees to the menu can take a lot of memory."
:set #'filesets-set-default
- :type 'integer)
+ :type 'natnum)
(defcustom filesets-commands
'(("Isearch"
@@ -546,6 +546,7 @@ function that returns one) to be run on a filesets' files.
The argument <file-name> or <<file-name>> (quoted) will be replaced with
the filename."
:set #'filesets-set-default+
+ :risky t
:type '(repeat :tag "Commands"
(list :tag "Definition" :value ("")
(string "Name")
@@ -561,8 +562,7 @@ the filename."
(string :tag "Quoted File Name"
:value "<<file-name>>")
(function :tag "Function"
- :value nil))))))
-(put 'filesets-commands 'risky-local-variable t)
+ :value nil))))))
(defcustom filesets-external-viewers
(let
@@ -651,6 +651,7 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
(and (filesets-which-command-p \"rtf2htm\")
(filesets-which-command-p \"w3m\"))))))"
:set #'filesets-set-default
+ :risky t
:type '(repeat :tag "Viewer"
(list :tag "Definition"
:value ("^.+\\.suffix$" "")
@@ -707,7 +708,6 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
(const :format ""
:value :capture-output)
(boolean :tag "Boolean")))))))
-(put 'filesets-external-viewers 'risky-local-variable t)
(defcustom filesets-ingroup-patterns
'(("^.+\\.tex$" t
@@ -848,6 +848,7 @@ With duplicates removed, it would be:
M + A - X
B"
:set #'filesets-set-default
+ :risky t
:type '(repeat
:tag "Include"
(list
@@ -894,7 +895,6 @@ With duplicates removed, it would be:
:value (:preprocess)
(const :format "" :value :preprocess)
(function :tag "Function"))))))))
-(put 'filesets-ingroup-patterns 'risky-local-variable t)
(defcustom filesets-data nil
"Fileset definitions.
@@ -965,6 +965,7 @@ is used.
Before using :ingroup, make sure that the file type is already
defined in `filesets-ingroup-patterns'."
:set #'filesets-data-set-default
+ :risky t
:type '(repeat
(cons :tag "Fileset"
(string :tag "Name" :value "")
@@ -1021,13 +1022,12 @@ defined in `filesets-ingroup-patterns'."
:value (:open)
(const :format "" :value :open)
(function :tag "Function")))))))
-(put 'filesets-data 'risky-local-variable t)
(defcustom filesets-query-user-limit 15
"Query the user before opening a fileset with that many files."
:set #'filesets-set-default
- :type 'integer)
+ :type 'natnum)
(defun filesets-filter-dir-names (lst &optional negative)
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 2f3f6b689aa..63f2148e47c 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -170,7 +170,12 @@ except that the car of the variable `find-ls-option' specifies what to
use in place of \"-ls\" as the final argument.
Collect output in the \"*Find*\" buffer. To kill the job before
-it finishes, type \\[kill-find]."
+it finishes, type \\[kill-find].
+
+For more information on how to write valid find expressions for
+ARGS, see Info node `(find) Finding Files'. If you are not
+using GNU findutils (on macOS and *BSD systems), see instead the
+man page for \"find\"."
(interactive (list (read-directory-name "Run find in directory: " nil "" t)
(read-string "Run find (with args): " find-args
'(find-args-history . 1))))
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 2b75309ff3f..f92d1e38306 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -66,6 +66,8 @@ Other variables include that for syntactic keyword fontification,
functions, `font-lock-fontify-buffer-function',
`font-lock-unfontify-buffer-function', `font-lock-fontify-region-function',
`font-lock-unfontify-region-function', and `font-lock-inhibit-thing-lock'.")
+;; Autoload if this file no longer dumped.
+;;;###autoload
(put 'font-lock-defaults 'risky-local-variable t)
(defvar font-lock-function 'font-lock-default-function
@@ -105,8 +107,7 @@ example, put in your ~/.emacs:
Where major modes support different levels of fontification, you
can use the variable `font-lock-maximum-decoration' to specify
which level you generally prefer. When you turn Font Lock mode
-on/off the buffer is fontified/defontified, though fontification
-occurs only if the buffer is less than `font-lock-maximum-size'.
+on/off the buffer is fontified/defontified.
To add your own highlighting for some major mode, and modify the
highlighting selected automatically via the variable
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 7eeaf2f547f..181a7dc90ef 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -47,9 +47,9 @@
;;
;; Fontification for a particular mode may be available in a number of levels
;; of decoration. The higher the level, the more decoration, but the more time
-;; it takes to fontify. See the variable `font-lock-maximum-decoration', and
-;; also the variable `font-lock-maximum-size'. Support modes for Font Lock
-;; mode can be used to speed up Font Lock mode. See `font-lock-support-mode'.
+;; it takes to fontify. See the variable `font-lock-maximum-decoration'.
+;; Support modes for Font Lock mode can be used to speed up Font Lock
+;; mode. See `font-lock-support-mode'.
;;;; How Font Lock mode fontifies:
@@ -228,32 +228,6 @@
;; User variables.
-(defcustom font-lock-maximum-size 256000
- "Maximum buffer size for unsupported buffer fontification.
-When `font-lock-support-mode' is nil, only buffers smaller than
-this are fontified. This variable has no effect if a Font Lock
-support mode (usually `jit-lock-mode') is enabled.
-
-If nil, means size is irrelevant.
-If a list, each element should be a cons pair of the form (MAJOR-MODE . SIZE),
-where MAJOR-MODE is a symbol or t (meaning the default). For example:
- ((c-mode . 256000) (c++-mode . 256000) (rmail-mode . 1048576))
-means that the maximum size is 250K for buffers in C or C++ modes, one megabyte
-for buffers in Rmail mode, and size is irrelevant otherwise."
- :type '(choice (const :tag "none" nil)
- (integer :tag "size")
- (repeat :menu-tag "mode specific" :tag "mode specific"
- :value ((t . nil))
- (cons :tag "Instance"
- (radio :tag "Mode"
- (const :tag "all" t)
- (symbol :tag "name"))
- (radio :tag "Size"
- (const :tag "none" nil)
- (integer :tag "size")))))
- :group 'font-lock)
-(make-obsolete-variable 'font-lock-maximum-size nil "24.1")
-
(defcustom font-lock-maximum-decoration t
"Maximum decoration level for fontification.
If nil, use the default decoration (typically the minimum available).
@@ -695,15 +669,9 @@ be enabled."
;; The first fontification after turning the mode on. This must
;; only be called after the mode hooks have been run.
(when (and font-lock-mode
- (font-lock-specified-p t))
- (let ((max-size (font-lock-value-in-major-mode font-lock-maximum-size)))
- (cond (font-lock-fontified
- nil)
- ((or (null max-size) (> max-size (buffer-size)))
- (with-no-warnings (font-lock-fontify-buffer)))
- (font-lock-verbose
- (message "Fontifying %s...buffer size greater than font-lock-maximum-size"
- (buffer-name)))))))
+ (font-lock-specified-p t)
+ (not font-lock-fontified))
+ (with-no-warnings (font-lock-fontify-buffer))))
(defun font-lock-mode-internal (arg)
;; Turn on Font Lock mode.
@@ -2361,7 +2329,7 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
;; e.g. assembler code and GNU linker script in Linux kernel.
;; `cpp-font-lock-keywords' is handy for modes for the files.
;;
-;; Here we cannot use `regexp-opt' because because regex-opt is not preloaded
+;; Here we cannot use `regexp-opt' because regex-opt is not preloaded
;; while font-lock.el is preloaded to emacs. So values pre-calculated with
;; regexp-opt are used here.
diff --git a/lisp/format.el b/lisp/format.el
index 6c7524891e4..2c368b8f9c7 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -139,6 +139,7 @@ MODE-FN, if specified, is called when visiting a file with that format.
PRESERVE, if non-nil, means that `format-write-file' should not remove
this format from `buffer-file-format'.")
+;; Autoload if this file no longer dumped.
;;;###autoload
(put 'format-alist 'risky-local-variable t)
diff --git a/lisp/frame.el b/lisp/frame.el
index 6996bb2e9c6..9476cb0ec46 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2841,7 +2841,7 @@ Values smaller than 0.2 sec are treated as 0.2 sec."
"How many times to blink before using a solid cursor on NS, X, and MS-Windows.
Use 0 or negative value to blink forever."
:version "24.4"
- :type 'integer
+ :type 'natnum
:group 'cursor)
(defvar blink-cursor-blinks-done 1
diff --git a/lisp/gnus/ChangeLog.3 b/lisp/gnus/ChangeLog.3
index c75f5354ca8..f3324b29190 100644
--- a/lisp/gnus/ChangeLog.3
+++ b/lisp/gnus/ChangeLog.3
@@ -7385,7 +7385,7 @@
2011-01-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-sum.el (gnus-select-newsgroup): Don't propagate marks to
- backends after sanitising on entry, because this never makes sense:
+ backends after sanitizing on entry, because this never makes sense:
If the articles have gone missing, then the data no longer exists on
the backend, and if they haven't, then Gnus is wrong, and shouldn't
overwrite anything anyway.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 59c3bbc76ed..4b68a54ce81 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -743,7 +743,7 @@ Each element is a regular expression."
"Face used for highlighting buttons in the article buffer.
An article button is a piece of text that you can activate by pressing
-`RET' or `mouse-2' above it."
+\\`RET' or `mouse-2' above it."
:type 'face
:group 'gnus-article-buttons)
@@ -1091,9 +1091,9 @@ positive (negative), move point forward (backwards) this many
parts. When nil, redisplay article."
:version "23.1" ;; No Gnus
:group 'gnus-article-mime
- :type '(choice (const nil :tag "Redisplay article.")
- (const 1 :tag "Next part.")
- (const 0 :tag "Current part.")
+ :type '(choice (const :value nil :tag "Redisplay article")
+ (const :value 1 :tag "Next part")
+ (const :value 0 :tag "Current part")
integer))
;;;
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index f8714a95d40..ddd939794dd 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -273,7 +273,7 @@ DOC is a documentation string for the parameter.")
gnus-agent-cat-predicate)
(agent-score
(choice :tag "Score File" :value nil
- (const file :tag "Use group's score files")
+ (const :value file :tag "Use group's score files")
(repeat (list (string :format "%v" :tag "File name"))))
"Which score files to use when using score to select articles to fetch.
diff --git a/lisp/gnus/gnus-eform.el b/lisp/gnus/gnus-eform.el
index 300532de286..96f515119dc 100644
--- a/lisp/gnus/gnus-eform.el
+++ b/lisp/gnus/gnus-eform.el
@@ -92,7 +92,7 @@ The optional LAYOUT overrides the `edit-form' window layout."
(insert ";;; ")
(forward-line 1))
(insert (substitute-command-keys
- ";; Type `C-c C-c' after you've finished editing.\n"))
+ ";; Type \\`C-c C-c' after you've finished editing.\n"))
(insert "\n")
(let ((p (point)))
(gnus-pp form)
diff --git a/lisp/gnus/gnus-logic.el b/lisp/gnus/gnus-logic.el
index 3fb2ed3c626..c1b559ba6f4 100644
--- a/lisp/gnus/gnus-logic.el
+++ b/lisp/gnus/gnus-logic.el
@@ -224,8 +224,8 @@
(goto-char (point-min))
(prog1
(funcall search-func match nil t)
- (widen)))
- (when handles (mm-destroy-parts handles))))))
+ (widen)
+ (when handles (mm-destroy-parts handles))))))))
(provide 'gnus-logic)
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 17a87134be0..3fc5ce2408a 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -52,24 +52,6 @@ method to use when posting."
(const current)
(sexp :tag "Methods" ,gnus-select-method)))
-(defcustom gnus-outgoing-message-group nil
- "All outgoing messages will be put in this group.
-If you want to store all your outgoing mail and articles in the group
-\"nnml:archive\", you set this variable to that value. This variable
-can also be a list of group names.
-
-If you want to have greater control over what group to put each
-message in, you can set this variable to a function that checks the
-current newsgroup name and then returns a suitable group name (or list
-of names)."
- :group 'gnus-message
- :type '(choice (const nil)
- (function)
- (string :tag "Group")
- (repeat :tag "List of groups" (string :tag "Group"))))
-
-(make-obsolete-variable 'gnus-outgoing-message-group 'gnus-message-archive-group "24.1")
-
(defcustom gnus-mailing-list-groups nil
"If non-nil a regexp matching groups that are really mailing lists.
This is useful when you're reading a mailing list that has been
@@ -215,30 +197,6 @@ use this option with care."
:parameter-document "\
List of charsets that are permitted to be unencoded.")
-(defcustom gnus-debug-files
- '("gnus.el" "gnus-sum.el" "gnus-group.el"
- "gnus-art.el" "gnus-start.el" "gnus-async.el"
- "gnus-msg.el" "gnus-score.el" "gnus-win.el" "gnus-topic.el"
- "gnus-agent.el" "gnus-cache.el" "gnus-srvr.el"
- "mm-util.el" "mm-decode.el" "nnmail.el" "message.el")
- "Files whose variables will be reported in `gnus-bug'."
- :version "22.1"
- :group 'gnus-message
- :type '(repeat file))
-
-(make-obsolete-variable 'gnus-debug-files "it is no longer used." "24.1")
-
-(defcustom gnus-debug-exclude-variables
- '(mm-mime-mule-charset-alist
- nnmail-split-fancy message-minibuffer-local-map)
- "Variables that should not be reported in `gnus-bug'."
- :version "22.1"
- :group 'gnus-message
- :type '(repeat variable))
-
-(make-obsolete-variable
- 'gnus-debug-exclude-variables "it is no longer used." "24.1")
-
(defcustom gnus-discouraged-post-methods
'(nndraft nnml nnimap nnmaildir nnmh nnfolder nndir)
"A list of back ends that are not used in \"real\" newsgroups.
@@ -1665,7 +1623,7 @@ this is a reply."
(defun gnus-inews-insert-gcc (&optional group)
"Insert the Gcc to say where the article is to be archived."
(let* ((group (or group gnus-newsgroup-name))
- (var (or gnus-outgoing-message-group gnus-message-archive-group))
+ (var gnus-message-archive-group)
(gcc-self-val
(and group (not (gnus-virtual-group-p group))
(gnus-group-find-parameter group 'gcc-self t)))
diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el
index 23a71bda209..2b9d7fac1db 100644
--- a/lisp/gnus/gnus-range.el
+++ b/lisp/gnus/gnus-range.el
@@ -36,10 +36,10 @@
(car list))
(make-obsolete 'gnus-last-element "use `car' of `last' instead." "27.1")
-(define-obsolete-function-alias 'gnus-copy-sequence 'copy-tree "27.1")
+(define-obsolete-function-alias 'gnus-copy-sequence #'copy-tree "27.1")
-;;; We could be using `seq-difference' here, but it's much slower
-;;; on these data sets. See bug#50877.
+;; We could be using `seq-difference' here, but it's much slower
+;; on these data sets. See bug#50877.
(defun gnus-set-difference (list1 list2)
"Return a list of elements of LIST1 that do not appear in LIST2."
(let ((hash2 (make-hash-table :test 'eq))
@@ -163,7 +163,7 @@ LIST1 and LIST2 have to be sorted over <."
#'range-intersection "29.1")
;;;###autoload
-(defalias 'gnus-set-sorted-intersection 'gnus-sorted-nintersection)
+(defalias 'gnus-set-sorted-intersection #'gnus-sorted-nintersection)
;;;###autoload
(defun gnus-sorted-nintersection (list1 list2)
@@ -241,7 +241,7 @@ ranges."
(range-compress-list numbers)
(range-denormalize (range-compress-list numbers))))
-(defalias 'gnus-uncompress-sequence 'gnus-uncompress-range)
+(defalias 'gnus-uncompress-sequence #'gnus-uncompress-range)
(define-obsolete-function-alias 'gnus-uncompress-range
#'range-uncompress "29.1")
@@ -256,7 +256,7 @@ ranges."
(define-obsolete-function-alias 'gnus-list-range-intersection
#'range-list-intersection "29.1")
-(defalias 'gnus-inverse-list-range-intersection 'gnus-list-range-difference)
+(defalias 'gnus-inverse-list-range-intersection #'range-list-difference)
(define-obsolete-function-alias 'gnus-list-range-difference
#'range-list-difference "29.1")
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index 8cefb09b66a..ceeb1848542 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -1004,9 +1004,6 @@ Uses `gnus-registry-marks' to find what shortcuts to install."
nil
(cons "Registry Marks" gnus-registry-misc-menus)))))
-(define-obsolete-function-alias 'gnus-registry-user-format-function-M
- #'gnus-registry-article-marks-to-chars "24.1")
-
;; use like this:
;; (defalias 'gnus-user-format-function-M #'gnus-registry-article-marks-to-chars)
(defun gnus-registry-article-marks-to-chars (headers)
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 369df81d9bd..53b6d1b4c6f 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -1672,43 +1672,6 @@ Namazu provides a little more information, for instance a score."
(format "date:%s.." (notmuch-date (cdr expr))))
(t (ignore-errors (cl-call-next-method))))))
-(cl-defmethod gnus-search-run-search :around ((engine gnus-search-notmuch)
- server query groups)
- "Handle notmuch's thread-search routine."
- ;; Notmuch allows for searching threads, but only using its own
- ;; thread ids. That means a thread search is a \"double-bounce\":
- ;; once to find the relevant thread ids, and again to find the
- ;; actual messages. This method performs the first \"bounce\".
- (if (alist-get 'thread query)
- (with-slots (program proc-buffer) engine
- (let* ((qstring
- (gnus-search-make-query-string engine query))
- (cp-list (gnus-search-indexed-search-command
- engine qstring query groups))
- thread-ids proc)
- (with-current-buffer proc-buffer
- (erase-buffer)
- (setq proc (apply #'start-process (format "search-%s" server)
- proc-buffer program cp-list))
- (while (process-live-p proc)
- (accept-process-output proc))
- (goto-char (point-min))
- (while (re-search-forward
- "^thread:\\([^[:space:]\n]+\\)"
- (point-max) t)
- (cl-pushnew (match-string 1) thread-ids :test #'equal)))
- (cl-call-next-method
- engine server
- ;; If we found threads, completely replace the query with
- ;; our new thread-based one.
- (if thread-ids
- `((query . ,(mapconcat (lambda (thrd)
- (concat "thread:" thrd))
- thread-ids " or ")))
- query)
- nil)))
- (cl-call-next-method engine server query groups)))
-
(cl-defmethod gnus-search-indexed-search-command ((engine gnus-search-notmuch)
(qstring string)
query &optional _groups)
@@ -1721,13 +1684,14 @@ Namazu provides a little more information, for instance a score."
(append
(list (format "--config=%s" config-file)
"search"
- (if thread
- "--output=threads"
- "--output=files"))
+ "--output=files")
(unless thread '("--duplicate=1"))
(when limit (list (format "--limit=%d" limit)))
switches
- (list qstring)))))
+ (list (if thread
+ (format "thread:\"{%s}\""
+ (string-replace "\"" "\"\"" qstring))
+ qstring))))))
;;; Mairix interface
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index a4f98c91573..7f96e16c8ae 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -97,7 +97,7 @@ See `gnus-group-goto-unread'."
:type 'boolean)
(defcustom gnus-summary-stop-at-end-of-message nil
- "If non-nil, don't select the next message when using `SPC'."
+ "If non-nil, don't select the next message when using \\`SPC'."
:link '(custom-manual "(gnus)Group Maneuvering")
:group 'gnus-summary-maneuvering
:version "24.1"
@@ -264,8 +264,8 @@ This variable will only be used if the value of
(defcustom gnus-summary-goto-unread nil
"If t, many commands will go to the next unread article.
This applies to marking commands as well as other commands that
-\"naturally\" select the next article, like, for instance, `SPC' at
-the end of an article.
+\"naturally\" select the next article, like, for instance, \\`SPC'
+at the end of an article.
If nil, the marking commands do NOT go to the next unread article
\(they go to the next article instead). If `never', commands that
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index f60c11f985d..7eea08f1744 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1130,16 +1130,6 @@ you could set this variable:
:group 'gnus-server
:type '(repeat gnus-select-method))
-(defcustom gnus-local-domain nil
- "Local domain name without a host name.
-The DOMAINNAME environment variable is used instead if it is defined.
-If the function `system-name' returns the full Internet name, there is
-no need to set this variable."
- :group 'gnus-message
- :type '(choice (const :tag "default" nil)
- string))
-(make-obsolete-variable 'gnus-local-domain nil "24.1")
-
;; Customization variables
(defcustom gnus-refer-article-method 'current
@@ -2263,12 +2253,12 @@ a string, be sure to use a valid format, see RFC 2616."
:version "22.1"
:group 'gnus-message
:type '(choice (list (set :inline t
- (const gnus :tag "Gnus version")
- (const emacs :tag "Emacs version")
+ (const :value gnus :tag "Gnus version")
+ (const :value emacs :tag "Emacs version")
(choice :tag "system"
- (const type :tag "system type")
- (const config :tag "system configuration"))
- (const codename :tag "Emacs codename")))
+ (const :value type :tag "system type")
+ (const :value config :tag "system configuration"))
+ (const :value codename :tag "Emacs codename")))
(string)))
;; Convert old (< 2005-01-10) symbol type values:
@@ -2316,11 +2306,6 @@ automatically cache the article in the agent cache."
(defvar gnus-server-method-cache nil)
(defvar gnus-extended-servers nil)
-;; The carpal mode has been removed, but define the variable for
-;; backwards compatibility.
-(defvar gnus-carpal nil)
-(make-obsolete-variable 'gnus-carpal nil "24.1")
-
(defvar gnus-agent-fetching nil
"Whether Gnus agent is in fetching mode.")
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 48115a41655..7c2b24c6eee 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1411,7 +1411,7 @@ text and it replaces `self-insert-command' with the other command, e.g.
(file-name-as-directory (expand-file-name "drafts" message-directory))
"~/")
"Directory where Message auto-saves buffers if Gnus isn't running.
-If nil, Message won't auto-save."
+If nil, Message won't auto-save, whether or not Gnus is running."
:group 'message-buffers
:link '(custom-manual "(message)Various Message Variables")
:type '(choice directory (const :tag "Don't auto-save" nil)))
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 7256e5a2f7c..79217d34001 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -193,7 +193,11 @@ before the external MIME handler is invoked."
`(("image/p?jpeg"
mm-inline-image
,(lambda (handle)
- (mm-valid-and-fit-image-p 'jpeg handle)))
+ (mm-valid-and-fit-image-p 'jpeg handle)))
+ ("image/webp"
+ mm-inline-image
+ ,(lambda (handle)
+ (mm-valid-and-fit-image-p 'webp handle)))
("image/png"
mm-inline-image
,(lambda (handle)
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 57ce36a9442..5cfde5a8647 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -86,7 +86,7 @@ This is only used if `mm-inline-large-images' is set to
(defun mm-inline-image (handle)
(let ((b (point-marker))
(inhibit-read-only t))
- (put-image
+ (insert-image
(let ((image (mm-get-image handle)))
(if (eq mm-inline-large-images 'resize)
(gnus-rescale-image
@@ -98,7 +98,7 @@ This is only used if `mm-inline-large-images' is set to
(truncate (* mm-inline-large-images-proportion
(- (nth 3 edges) (nth 1 edges)))))))
image))
- b)
+ " ")
(insert "\n")
(mm-handle-set-undisplayer
handle
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index a69b5c77270..746109f26fa 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -95,9 +95,6 @@ Uses the same syntax as `nnmail-split-methods'.")
(defvoo nnimap-unsplittable-articles '(%Deleted %Seen)
"Articles with the flags in the list will not be considered when splitting.")
-(make-obsolete-variable 'nnimap-split-rule "see `nnimap-split-methods'."
- "24.1")
-
(defvoo nnimap-authenticator nil
"How nnimap authenticate itself to the server.
Possible choices are nil (use default methods), `anonymous',
@@ -233,27 +230,28 @@ during splitting, which may be slow."
params)
(format "%s" (nreverse params))))
+(defvar nnimap--max-retrieve-headers 200)
+
(deffoo nnimap-retrieve-headers (articles &optional group server _fetch-old)
(with-current-buffer nntp-server-buffer
(erase-buffer)
(when (nnimap-change-group group server)
(with-current-buffer (nnimap-buffer)
(erase-buffer)
- (let ((ranges (gnus-compress-sequence articles t))
- sequence)
- ;; If we have a lot of ranges, split them up to avoid
- ;; generating too-long lines. (The limit is 8192 octects,
- ;; and this should guarantee that it's (much) shorter than
- ;; that.)
- (while ranges
- (setq sequence
- (nnimap-send-command
- "UID FETCH %s %s"
- (nnimap-article-ranges (seq-take ranges 200))
- (nnimap-header-parameters)))
- (setq ranges (nthcdr 200 ranges)))
- ;; Wait for the final one.
- (nnimap-wait-for-response sequence t))
+ ;; If we have a lot of ranges, split them up to avoid
+ ;; generating too-long lines. (The limit is 8192 octects,
+ ;; and this should guarantee that it's (much) shorter than
+ ;; that.) We don't stream the requests, since the server
+ ;; may respond to the requests out-of-order:
+ ;; https://datatracker.ietf.org/doc/html/rfc3501#section-5.5
+ (dolist (ranges (seq-split (gnus-compress-sequence articles t)
+ nnimap--max-retrieve-headers))
+ (nnimap-wait-for-response
+ (nnimap-send-command
+ "UID FETCH %s %s"
+ (nnimap-article-ranges ranges)
+ (nnimap-header-parameters))
+ t))
(unless (process-live-p (get-buffer-process (current-buffer)))
(error "IMAP server %S closed connection" nnimap-address))
(nnimap-transform-headers)
diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el
index b0d258d67a5..084eb3d7745 100644
--- a/lisp/gnus/spam-stat.el
+++ b/lisp/gnus/spam-stat.el
@@ -189,7 +189,7 @@ When using `spam-stat-process-spam-directory' or
been touched in this many days will be considered. Without
this filter, re-training spam-stat with several thousand messages
will start to take a very long time."
- :type 'number)
+ :type 'integer)
(defvar spam-stat-last-saved-at nil
"Time stamp of last change of spam-stat-file on this run")
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 705f92b37be..fbd40158701 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -868,7 +868,7 @@ the C sources, too."
(shortdoc-display-group group object
help-window-keep-selected))
'follow-link t
- 'help-echo (purecopy "mouse-1, RET: show documentation group")))
+ 'help-echo "mouse-1, RET: show documentation group"))
groups)
(insert (if (= (length groups) 1)
" group.\n"
@@ -1390,17 +1390,19 @@ it is displayed along with the global value."
(help-fns--edit-value-mode)
(insert (format ";; Edit the `%s' variable.\n" (nth 0 var))
(substitute-command-keys
- ";; \\[help-fns-edit-mode-done] to update the value and exit.\n\n"))
+ ";; `\\[help-fns-edit-mode-done]' to update the value and exit; \
+`\\[help-fns-edit-mode-cancel]' to cancel.\n\n"))
(setq-local help-fns--edit-variable var)))
(defvar-keymap help-fns--edit-value-mode-map
- "C-c C-c" #'help-fns-edit-mode-done)
+ "C-c C-c" #'help-fns-edit-mode-done
+ "C-c C-k" #'help-fns-edit-mode-cancel)
(define-derived-mode help-fns--edit-value-mode emacs-lisp-mode "Elisp"
:interactive nil)
(defun help-fns-edit-mode-done (&optional kill)
- "Update the value of the variable and kill the buffer.
+ "Update the value of the variable being edited and kill the edit buffer.
If KILL (the prefix), don't update the value, but just kill the
current buffer."
(interactive "P" help-fns--edit-value-mode)
@@ -1420,6 +1422,12 @@ current buffer."
(with-current-buffer help-buffer
(revert-buffer)))))
+(defun help-fns-edit-mode-cancel ()
+ "Kill the edit buffer and cancel editing of the value.
+This cancels value editing without updating the value."
+ (interactive nil help-fns--edit-value-mode)
+ (help-fns-edit-mode-done t))
+
(defun help-fns--run-describe-functions (functions &rest args)
(with-current-buffer standard-output
(unless (bolp)
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 219e3c7b862..8b5e48edad1 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -31,25 +31,23 @@
(require 'cl-lib)
-(defvar help-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map (make-composed-keymap button-buffer-map
- special-mode-map))
- (define-key map "n" 'help-goto-next-page)
- (define-key map "p" 'help-goto-previous-page)
- (define-key map "l" 'help-go-back)
- (define-key map "r" 'help-go-forward)
- (define-key map "\C-c\C-b" 'help-go-back)
- (define-key map "\C-c\C-f" 'help-go-forward)
- (define-key map [XF86Back] 'help-go-back)
- (define-key map [XF86Forward] 'help-go-forward)
- (define-key map "\C-c\C-c" 'help-follow-symbol)
- (define-key map "s" 'help-view-source)
- (define-key map "I" 'help-goto-lispref-info)
- (define-key map "i" 'help-goto-info)
- (define-key map "c" 'help-customize)
- map)
- "Keymap for Help mode.")
+(defvar-keymap help-mode-map
+ :doc "Keymap for Help mode."
+ :parent (make-composed-keymap button-buffer-map
+ special-mode-map)
+ "n" #'help-goto-next-page
+ "p" #'help-goto-previous-page
+ "l" #'help-go-back
+ "r" #'help-go-forward
+ "C-c C-b" #'help-go-back
+ "C-c C-f" #'help-go-forward
+ "<XF86Back>" #'help-go-back
+ "<XF86Forward>" #'help-go-forward
+ "C-c C-c" #'help-follow-symbol
+ "s" #'help-view-source
+ "I" #'help-goto-lispref-info
+ "i" #'help-goto-info
+ "c" #'help-customize)
(easy-menu-define help-mode-menu help-mode-map
"Menu for Help mode."
diff --git a/lisp/help.el b/lisp/help.el
index d7ee1a84a43..abe17fa4ce2 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1192,14 +1192,6 @@ Otherwise, return a new string."
(let* ((fun (intern (buffer-substring (point) (1- end-point))))
(key (with-current-buffer orig-buf
(where-is-internal fun keymap t))))
- ;; If this a command remap, we need to follow it.
- (when (and (vectorp key)
- (> (length key) 1)
- (eq (aref key 0) 'remap)
- (symbolp (aref key 1)))
- (setq fun (aref key 1))
- (setq key (with-current-buffer orig-buf
- (where-is-internal fun keymap t))))
(if (not key)
;; Function is not on any key.
(let ((op (point)))
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 8cddd644824..a45e74eca26 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -97,7 +97,7 @@
When a file is visited and hi-lock mode is on, patterns starting
up to this limit are added to font-lock's patterns. See documentation
of functions `hi-lock-mode' and `hi-lock-find-patterns'."
- :type 'integer
+ :type 'natnum
:group 'hi-lock)
(defcustom hi-lock-highlight-range 2000000
@@ -107,7 +107,7 @@ such as the buffer created by `list-colors-display'. In those buffers
hi-lock patterns will only be applied over a range of
`hi-lock-highlight-range' characters. If font-lock is active then
highlighting will be applied throughout the buffer."
- :type 'integer
+ :type 'natnum
:group 'hi-lock)
(defcustom hi-lock-exclude-modes
@@ -128,11 +128,10 @@ patterns."
(const :tag "Ask about file patterns" ask)
(function :tag "Function to check file patterns"))
:group 'hi-lock
+ ;; It can have a function value.
+ :risky t
:version "22.1")
-;; It can have a function value.
-(put 'hi-lock-file-patterns-policy 'risky-local-variable t)
-
(defcustom hi-lock-auto-select-face nil
"When nil, highlighting commands prompt for the face to use.
When non-nil, highlighting command determine the faces to use
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 0bc6330cc5a..b1fcf9ae712 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -81,7 +81,7 @@ selection process starts again from the user's $HOME.")
This means to show completions even when the current minibuffer contents
is the same as was the initial input after minibuffer activation.
This also means that if you traverse the list of completions with
-commands like `C-.' and just hit RET without typing any
+commands like \\`C-.' and just hit \\`RET' without typing any
characters, the match under point will be chosen instead of the
default."
:type 'boolean
@@ -370,7 +370,7 @@ require user confirmation."
(defun icomplete-fido-exit (force)
"Attempt to exit minibuffer immediately with current input.
Unless FORCE is non-nil (interactively with a prefix argument),
-honour a non-nil REQUIRE-MATCH argument to `completing-read' by
+honor a non-nil REQUIRE-MATCH argument to `completing-read' by
trying to complete as much as possible and disallowing the exit
if that doesn't produce a completion match."
(interactive "P")
@@ -840,13 +840,13 @@ by `group-function''s second \"transformation\" protocol."
while (listp r)
count 1))
repeat total-space
- for neighbour = nil
+ for neighbor = nil
if (and preds (> space-above 0)) do
- (push (setq neighbour (pop preds)) scroll-above)
+ (push (setq neighbor (pop preds)) scroll-above)
(cl-decf space-above)
else if (consp succs) collect
- (setq neighbour (pop succs)) into scroll-below-aux
- while neighbour
+ (setq neighbor (pop succs)) into scroll-below-aux
+ while neighbor
finally (setq scroll-below scroll-below-aux))
;; Halfway there...
(let* ((selected (propertize (car comps) 'icomplete-selected t))
diff --git a/lisp/ido.el b/lisp/ido.el
index b3365059d25..134081d6759 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -554,7 +554,7 @@ See `ido-last-directory-list' and `ido-save-directory-list-file'."
"Maximum number of working directories to record.
This is the list of directories where files have most recently been opened.
See `ido-work-directory-list' and `ido-save-directory-list-file'."
- :type 'integer)
+ :type 'natnum)
(defcustom ido-work-directory-list-ignore-regexps nil
"List of regexps matching directories which should not be recorded.
diff --git a/lisp/iimage.el b/lisp/iimage.el
index 8a765d5e5d5..baeb4bb6a7b 100644
--- a/lisp/iimage.el
+++ b/lisp/iimage.el
@@ -87,9 +87,6 @@ Examples of image filename patterns to match:
(iimage-mode-buffer t)
(recenter-top-bottom arg))
-;;;###autoload
-(define-obsolete-function-alias 'turn-on-iimage-mode 'iimage-mode "24.1")
-
(defun turn-off-iimage-mode ()
"Unconditionally turn off iimage mode."
(interactive)
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 684f2ff3fc1..46c555df278 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -286,7 +286,7 @@ Stop if the bottom edge of the image is reached.
Interactively, giving this command a numerical prefix will scroll
up by that many lines (and down by that many lines if the number
is negative). Without a prefix, scroll up by a full screen.
-If given a `C-u -' prefix, scroll a full page down instead.
+If given a \\`C-u -' prefix, scroll a full page down instead.
If N is omitted or nil, scroll upward by a near full screen.
A near full screen is `next-screen-context-lines' less than a full screen.
@@ -314,7 +314,7 @@ Stop if the top edge of the image is reached.
Interactively, giving this command a numerical prefix will scroll
down by that many lines (and up by that many lines if the number
is negative). Without a prefix, scroll down by a full screen.
-If given a `C-u -' prefix, scroll a full page up instead.
+If given a \\`C-u -' prefix, scroll a full page up instead.
If N is omitted or nil, scroll downward by a near full screen.
A near full screen is `next-screen-context-lines' less than a full screen.
diff --git a/lisp/image.el b/lisp/image.el
index e90cccaa096..02e5c85fafd 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -446,15 +446,6 @@ type if we can't otherwise guess it."
(error "Invalid image type `%s'" type))
type)
-
-(if (fboundp 'image-metadata) ; eg not --without-x
- (define-obsolete-function-alias 'image-extension-data
- 'image-metadata "24.1"))
-
-(define-obsolete-variable-alias
- 'image-library-alist
- 'dynamic-library-alist "24.1")
-
;;;###autoload
(defun image-type-available-p (type)
"Return t if image type TYPE is available.
@@ -622,7 +613,7 @@ means display it in the right marginal area."
(put-text-property 0 (length string) 'display prop string)
(overlay-put overlay 'put-image t)
(overlay-put overlay 'before-string string)
- (overlay-put overlay 'map image-map)
+ (overlay-put overlay 'keymap image-map)
overlay)))
@@ -975,9 +966,10 @@ for the animation speed. A negative value means to animate in reverse."
(plist-put (cdr image) :animate-tardiness
(+ (* (plist-get (cdr image) :animate-tardiness) 0.9)
(float-time (time-since target-time))))
- (let ((buffer (plist-get (cdr image) :animate-buffer))
- (position (plist-get (cdr image) :animate-position)))
- (when (and (buffer-live-p buffer)
+ (let* ((buffer (plist-get (cdr image) :animate-buffer))
+ (position (plist-get (cdr image) :animate-position))
+ (continue-animation
+ (and (buffer-live-p buffer)
;; If we have a :animate-position setting, the caller
;; has requested that the animation be stopped if the
;; image is no longer displayed in the buffer.
@@ -994,7 +986,13 @@ for the animation speed. A negative value means to animate in reverse."
(or (< (plist-get (cdr image) :animate-tardiness) 2)
(progn
(message "Stopping animation; animation possibly too big")
- nil)))
+ nil)))))
+ (if (not continue-animation)
+ ;; Eject from the animation cache since we've decided not to
+ ;; keep updating it. This helps stop unbounded RAM usage when
+ ;; doing, for instance, `g' in an eww buffer with animated
+ ;; images.
+ (clear-image-cache nil image)
(let* ((time (prog1 (current-time)
(image-show-frame image n t)))
(speed (image-animate-get-speed image))
diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el
index 78a2df72c4c..8c49c1edf28 100644
--- a/lisp/image/gravatar.el
+++ b/lisp/image/gravatar.el
@@ -45,7 +45,7 @@
"Time to live in seconds for gravatar cache entries.
If a requested gravatar has been cached for longer than this, it
is retrieved anew. The default value is 30 days."
- :type 'integer
+ :type 'natnum
;; Restricted :type to number of seconds.
:version "27.1"
:group 'gravatar)
diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el
index 9440c623f90..9c2f24819a3 100644
--- a/lisp/image/image-converter.el
+++ b/lisp/image/image-converter.el
@@ -68,6 +68,8 @@ not, conversion will fail."
(imagemagick :command "convert" :probe ("-list" "format")))
"List of supported image converters to try.")
+(defvar image-converter--extra-converters (make-hash-table :test #'equal))
+
(defun image-converter-initialize ()
"Determine the external image converter to be used.
This also determines which external formats we can parse."
@@ -123,15 +125,21 @@ converted image data is returned as a string."
(error "IMAGE-FORMAT should be a symbol like `image/png'"))
(with-temp-buffer
(set-buffer-multibyte nil)
- (when-let ((err (image-converter--convert
- image-converter
- (if (listp image)
- (plist-get (cdr image) :file)
- image)
- (if (listp image)
- (plist-get (cdr image) :data-p)
- image-format))))
- (error "%s" err))
+ (let* ((source (if (listp image)
+ (plist-get (cdr image) :file)
+ image))
+ (format (if (listp image)
+ (plist-get (cdr image) :data-p)
+ image-format))
+ (type (if format
+ (image-converter--mime-type format)
+ (file-name-extension source)))
+ (extra-converter (gethash type image-converter--extra-converters)))
+ (if extra-converter
+ (funcall extra-converter source format)
+ (when-let ((err (image-converter--convert
+ image-converter source format)))
+ (error "%s" err))))
(if (listp image)
;; Return an image object that's the same as we were passed,
;; but ignore the :type value.
@@ -244,20 +252,22 @@ Only suffixes that map to `image-mode' are returned."
(cadr (split-string (symbol-name image-format) "/"))))
(defun image-converter--convert-magick (type source image-format)
- (let ((command (image-converter--value type :command)))
+ (let ((command (image-converter--value type :command))
+ (coding-system-for-read 'no-conversion))
(unless (zerop (if image-format
;; We have the image data in SOURCE.
(progn
(insert source)
- (apply #'call-process-region (point-min) (point-max)
- (car command) t t nil
- (append
- (cdr command)
- (list (format "%s:-"
- (image-converter--mime-type
- image-format))
+ (let ((coding-system-for-write 'no-conversion))
+ (apply #'call-process-region (point-min) (point-max)
+ (car command) t t nil
+ (append
+ (cdr command)
+ (list (format "%s:-"
+ (image-converter--mime-type
+ image-format))
(concat image-convert-to-format
- ":-")))))
+ ":-"))))))
;; SOURCE is a file name.
(apply #'call-process (car command)
nil t nil
@@ -272,18 +282,20 @@ Only suffixes that map to `image-mode' are returned."
(cl-defmethod image-converter--convert ((type (eql 'ffmpeg)) source
image-format)
"Convert using ffmpeg."
- (let ((command (image-converter--value type :command)))
+ (let ((command (image-converter--value type :command))
+ (coding-system-for-read 'no-conversion))
(unless (zerop (if image-format
(progn
(insert source)
- (apply #'call-process-region
- (point-min) (point-max) (car command)
- t '(t nil) nil
- (append
- (cdr command)
- (list "-i" "-"
- "-c:v" image-convert-to-format
- "-f" "image2pipe" "-"))))
+ (let ((coding-system-for-write 'no-conversion))
+ (apply #'call-process-region
+ (point-min) (point-max) (car command)
+ t '(t nil) nil
+ (append
+ (cdr command)
+ (list "-i" "-"
+ "-c:v" image-convert-to-format
+ "-f" "image2pipe" "-")))))
(apply #'call-process
(car command)
nil '(t nil) nil
@@ -294,6 +306,21 @@ Only suffixes that map to `image-mode' are returned."
"-")))))
"ffmpeg error when converting")))
+;;;###autoload
+(defun image-converter-add-handler (suffix converter)
+ "Make Emacs use CONVERTER to parse image files that end with SUFFIX.
+CONVERTER is a function with two parameters, where the first is
+the file name or a string with the image data, and the second is
+non-nil if the first parameter is image data. The converter
+should output the image in the current buffer, converted to
+`image-convert-to-format'."
+ (cl-pushnew suffix image-converter-file-name-extensions :test #'equal)
+ (setq image-converter-file-name-extensions
+ (sort image-converter-file-name-extensions #'string<))
+ (setq image-converter-regexp
+ (concat "\\." (regexp-opt image-converter-file-name-extensions) "\\'"))
+ (setf (gethash suffix image-converter--extra-converters) converter))
+
(provide 'image-converter)
;;; image-converter.el ends here
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 4393c6ed6cb..dcd816cb7a8 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -87,7 +87,7 @@ This might not yet be honored by all index-building functions."
(defcustom imenu-auto-rescan-maxout 600000
"Imenu auto-rescan is disabled in buffers larger than this size (in bytes).
Also see `imenu-max-index-time'."
- :type 'integer
+ :type 'natnum
:version "26.2")
(defcustom imenu-use-popup-menu 'on-mouse
@@ -132,7 +132,7 @@ element should come before the second. The arguments are cons cells;
(defcustom imenu-max-items 25
"Maximum number of elements in a mouse menu for Imenu."
- :type 'integer)
+ :type 'natnum)
(defcustom imenu-space-replacement "."
"The replacement string for spaces in index names.
@@ -471,7 +471,7 @@ Non-nil arguments are in recursive calls."
(t
(lambda () (interactive)
(if cmd (funcall cmd item) item))))))
- alist)))
+ (seq-filter #'identity alist))))
(defun imenu--in-alist (str alist)
"Check whether the string STR is contained in multi-level ALIST."
diff --git a/lisp/indent.el b/lisp/indent.el
index d6dee94016d..f52b729051d 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -270,11 +270,8 @@ Negative values of ARG indent backward, so you can remove all
indentation by specifying a large negative ARG."
(interactive "r\nP\np")
(if (and (not arg) interactive)
- (progn
- (message
- (substitute-command-keys
- "Indent region with \\<indent-rigidly-map>\\[indent-rigidly-left], \\[indent-rigidly-right], \\[indent-rigidly-left-to-tab-stop], or \\[indent-rigidly-right-to-tab-stop]."))
- (set-transient-map indent-rigidly-map t #'deactivate-mark))
+ (set-transient-map indent-rigidly-map t #'deactivate-mark
+ "Indent region with %k")
(save-excursion
(goto-char end)
(setq end (point-marker))
diff --git a/lisp/info.el b/lisp/info.el
index f9d63b0f32d..7fdb893edc5 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -133,8 +133,6 @@ orientation. See `Info-nth-menu-item'.")
:version "22.1"
:type 'boolean)
-;; It's unfortunate that nil means no fontification, as opposed to no limit,
-;; since that differs from font-lock-maximum-size.
(defcustom Info-fontify-maximum-menu-size 400000
"Maximum size of menu to fontify if `font-lock-mode' is non-nil.
Set to nil to disable node fontification; set to t for no limit."
@@ -260,7 +258,7 @@ This only has an effect if `Info-hide-note-references' is non-nil."
"Depth of breadcrumbs to display.
0 means do not display breadcrumbs."
:version "23.1"
- :type 'integer)
+ :type 'natnum)
(defcustom Info-search-whitespace-regexp "\\s-+"
"If non-nil, regular expression to match a sequence of whitespace chars.
@@ -2208,7 +2206,7 @@ and is not in the header line or a tag table."
(let ((backward (< found beg-found)))
(not
(or
- (and (not search-invisible)
+ (and (not (eq search-invisible t))
(if backward
(or (text-property-not-all found beg-found 'invisible nil)
(text-property-not-all found beg-found 'display nil))
diff --git a/lisp/informat.el b/lisp/informat.el
index e7595fa541a..c126ab5b1a1 100644
--- a/lisp/informat.el
+++ b/lisp/informat.el
@@ -158,7 +158,7 @@
;;;###autoload
(defcustom Info-split-threshold 262144
"The number of characters by which `Info-split' splits an info file."
- :type 'integer
+ :type 'natnum
:version "23.1"
:group 'texinfo)
diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el
index 6a65bc43dc7..4f4d4f48320 100644
--- a/lisp/international/emoji.el
+++ b/lisp/international/emoji.el
@@ -73,18 +73,13 @@ representing names. For instance:
(defvar emoji--insert-buffer)
;;;###autoload
-(defun emoji-insert (&optional text)
- "Choose and insert an emoji glyph.
-If TEXT (interactively, the prefix argument), choose the emoji
-by typing its Unicode Standard name (with completion), instead
-of selecting from emoji display."
- (interactive "*P")
+(defun emoji-insert ()
+ "Choose and insert an emoji glyph."
+ (interactive "*")
(emoji--init)
- (if text
- (emoji--choose-emoji)
- (unless (fboundp 'emoji--command-Emoji)
- (emoji--define-transient))
- (funcall (intern "emoji--command-Emoji"))))
+ (unless (fboundp 'emoji--command-Emoji)
+ (emoji--define-transient))
+ (funcall (intern "emoji--command-Emoji")))
;;;###autoload
(defun emoji-recent ()
@@ -707,10 +702,9 @@ We prefer the earliest unique letter."
;;;###autoload
(defun emoji-zoom-increase (&optional factor)
"Increase the size of the character under point.
-FACTOR is the multiplication factor for the size.
-
-This command will be repeatable if `repeat-mode' is switched on."
+FACTOR is the multiplication factor for the size."
(interactive)
+ (set-transient-map emoji-zoom-map t nil "Zoom with %k")
(let* ((factor (or factor 1.1))
(old (get-text-property (point) 'face))
(height (or (and (consp old)
@@ -728,18 +722,12 @@ This command will be repeatable if `repeat-mode' is switched on."
(put-text-property (point) (1+ (point))
'rear-nonsticky t)))))
-(put 'emoji-zoom-increase 'repeat-map 'emoji-zoom-map)
-
;;;###autoload
(defun emoji-zoom-decrease ()
- "Decrease the size of the character under point.
-
-This command will be repeatable if `repeat-mode' is switched on."
+ "Decrease the size of the character under point."
(interactive)
(emoji-zoom-increase 0.9))
-(put 'emoji-zoom-decrease 'repeat-map 'emoji-zoom-map)
-
(provide 'emoji)
;;; emoji.el ends here
diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el
index 912c4b72a01..90fdc06b1e4 100644
--- a/lisp/international/iso-transl.el
+++ b/lisp/international/iso-transl.el
@@ -375,12 +375,12 @@ sequence VECTOR. (VECTOR is normally one character long.)")
(defun iso-transl-set-language (lang)
"Set shorter key bindings for some characters relevant for LANG.
-This affects the `C-x 8' prefix.
+This affects the \\`C-x 8' prefix.
Note that only a few languages are supported, and for more
rigorous support it is recommended to use an input method
instead. Also note that many of these characters can be input
-with the regular `C-x 8' map without having to specify a language
+with the regular \\`C-x 8' map without having to specify a language
here."
(interactive (list (let ((completion-ignore-case t))
(completing-read "Set which language? "
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 48c8d2b0818..df1c06ec272 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1411,6 +1411,7 @@ This function is called with no argument.")
Each element has the form:
(INPUT-METHOD LANGUAGE-ENV ACTIVATE-FUNC TITLE DESCRIPTION ARGS...)
See the function `register-input-method' for the meanings of the elements.")
+;; Autoload if this file no longer dumped.
;;;###autoload
(put 'input-method-alist 'risky-local-variable t)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 34c3665bd8c..8f480a87d94 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -466,6 +466,12 @@ and doesn't remove full-buffer highlighting after a search."
:group 'lazy-count
:version "27.1")
+(defvar lazy-count-invisible-format " (invisible %s)"
+ "Format of the number of invisible matches for the prompt.
+When invisible matches exist, their number is appended
+after the total number of matches. Display nothing when
+this variable is nil.")
+
;; Define isearch help map.
@@ -1103,7 +1109,7 @@ In incremental searches, a space or spaces normally matches any
whitespace defined by the variable `search-whitespace-regexp'.
To search for a literal space and nothing else, enter C-q SPC.
To toggle whitespace matching, use `isearch-toggle-lax-whitespace',
-usually bound to `M-s SPC' during isearch.
+usually bound to \\`M-s SPC' during isearch.
This command does not support character folding."
(interactive "P\np")
(isearch-mode t (null not-regexp) nil (not no-recursive-edit)))
@@ -1277,6 +1283,7 @@ used to set the value of `isearch-regexp-function'."
isearch-lazy-count-current nil
isearch-lazy-count-total nil
+ isearch-lazy-count-invisible nil
;; Save the original value of `minibuffer-message-timeout', and
;; set it to nil so that isearch's messages don't get timed out.
@@ -3529,7 +3536,12 @@ isearch-message-suffix prompt. Otherwise, for isearch-message-prefix."
(- isearch-lazy-count-total
isearch-lazy-count-current
-1)))
- (or isearch-lazy-count-total "?"))
+ (if (and isearch-lazy-count-invisible
+ lazy-count-invisible-format)
+ (concat (format "%s" (or isearch-lazy-count-total "?"))
+ (format lazy-count-invisible-format
+ isearch-lazy-count-invisible))
+ (or isearch-lazy-count-total "?")))
"")))
@@ -3780,10 +3792,11 @@ Optional third argument, if t, means if fail just return nil (no error).
(save-excursion
(goto-char beg)
(let (;; can-be-opened keeps track if we can open some overlays.
- (can-be-opened (eq search-invisible 'open))
+ (can-be-opened (memq search-invisible '(open can-be-opened)))
;; the list of overlays that could be opened
(crt-overlays nil))
- (when (and can-be-opened isearch-hide-immediately)
+ (when (and can-be-opened isearch-hide-immediately
+ (not (eq search-invisible 'can-be-opened)))
(isearch-close-unnecessary-overlays beg end))
;; If the following character is currently invisible,
;; skip all characters with that same `invisible' property value.
@@ -3822,9 +3835,10 @@ Optional third argument, if t, means if fail just return nil (no error).
(if (>= (point) end)
(if (and can-be-opened (consp crt-overlays))
(progn
- (setq isearch-opened-overlays
- (append isearch-opened-overlays crt-overlays))
- (mapc 'isearch-open-overlay-temporary crt-overlays)
+ (unless (eq search-invisible 'can-be-opened)
+ (setq isearch-opened-overlays
+ (append isearch-opened-overlays crt-overlays))
+ (mapc 'isearch-open-overlay-temporary crt-overlays))
nil)
(setq isearch-hidden t)))))))
@@ -4008,6 +4022,7 @@ since they have special meaning in a regexp."
(defvar isearch-lazy-highlight-error nil)
(defvar isearch-lazy-count-current nil)
(defvar isearch-lazy-count-total nil)
+(defvar isearch-lazy-count-invisible nil)
(defvar isearch-lazy-count-hash (make-hash-table))
(defvar lazy-count-update-hook nil
"Hook run after new lazy count results are computed.")
@@ -4086,7 +4101,8 @@ by other Emacs features."
;; Reset old counter before going to count new numbers
(clrhash isearch-lazy-count-hash)
(setq isearch-lazy-count-current nil
- isearch-lazy-count-total nil)
+ isearch-lazy-count-total nil
+ isearch-lazy-count-invisible nil)
;; Delay updating the message if possible, to avoid flicker
(when (string-equal isearch-string "")
(when (and isearch-mode (null isearch-message-function))
@@ -4166,10 +4182,10 @@ Attempt to do the search exactly the way the pending Isearch would."
(isearch-regexp-lax-whitespace
isearch-lazy-highlight-regexp-lax-whitespace)
(isearch-forward isearch-lazy-highlight-forward)
- ;; Don't match invisible text unless it can be opened
- ;; or when counting matches and user can visit hidden matches
- (search-invisible (or (eq search-invisible 'open)
- (and isearch-lazy-count search-invisible)))
+ ;; Count all invisible matches, but highlight only
+ ;; matches that can be opened by visiting them later
+ (search-invisible (or (not (null isearch-lazy-count))
+ 'can-be-opened))
(retry t)
(success nil))
;; Use a loop like in `isearch-search'.
@@ -4186,15 +4202,20 @@ Attempt to do the search exactly the way the pending Isearch would."
(error nil)))
(defun isearch-lazy-highlight-match (mb me)
- (let ((ov (make-overlay mb me)))
- (push ov isearch-lazy-highlight-overlays)
- ;; 1000 is higher than ediff's 100+,
- ;; but lower than isearch main overlay's 1001
- (overlay-put ov 'priority 1000)
- (overlay-put ov 'face 'lazy-highlight)
- (unless (or (eq isearch-lazy-highlight 'all-windows)
- isearch-lazy-highlight-buffer)
- (overlay-put ov 'window (selected-window)))))
+ (when (or (not isearch-lazy-count)
+ ;; Recheck the match that possibly was intended
+ ;; for counting only, but not for highlighting
+ (let ((search-invisible 'can-be-opened))
+ (funcall isearch-filter-predicate mb me)))
+ (let ((ov (make-overlay mb me)))
+ (push ov isearch-lazy-highlight-overlays)
+ ;; 1000 is higher than ediff's 100+,
+ ;; but lower than isearch main overlay's 1001
+ (overlay-put ov 'priority 1000)
+ (overlay-put ov 'face 'lazy-highlight)
+ (unless (or (eq isearch-lazy-highlight 'all-windows)
+ isearch-lazy-highlight-buffer)
+ (overlay-put ov 'window (selected-window))))))
(defun isearch-lazy-highlight-start ()
"Start a new lazy-highlight updating loop."
@@ -4328,11 +4349,22 @@ Attempt to do the search exactly the way the pending Isearch would."
(setq found nil)
(forward-char -1)))
(when isearch-lazy-count
- (setq isearch-lazy-count-total
- (1+ (or isearch-lazy-count-total 0)))
- (puthash (if isearch-lazy-highlight-forward me mb)
- isearch-lazy-count-total
- isearch-lazy-count-hash))
+ ;; Count as invisible when can't open overlay,
+ ;; but don't leave search-invisible with the
+ ;; value `open' since then lazy-highlight
+ ;; will open all overlays with matches.
+ (if (not (let ((search-invisible
+ (if (eq search-invisible 'open)
+ 'can-be-opened
+ search-invisible)))
+ (funcall isearch-filter-predicate mb me)))
+ (setq isearch-lazy-count-invisible
+ (1+ (or isearch-lazy-count-invisible 0)))
+ (setq isearch-lazy-count-total
+ (1+ (or isearch-lazy-count-total 0)))
+ (puthash (if isearch-lazy-highlight-forward me mb)
+ isearch-lazy-count-total
+ isearch-lazy-count-hash)))
;; Don't highlight the match when this loop is used
;; only to count matches or when matches were already
;; highlighted within the current window boundaries
@@ -4457,89 +4489,117 @@ LAX-WHITESPACE: The value of `isearch-lax-whitespace' and
(funcall after-change nil nil nil)))))
+(defun isearch-search-fun-in-noncontiguous-region (search-fun bounds)
+ "Return the function that searches inside noncontiguous regions.
+A noncontiguous region is defined by the argument BOUNDS that
+is a list of cons cells of the form (START . END)."
+ (apply-partially
+ #'search-within-boundaries
+ search-fun
+ (lambda (pos)
+ (seq-some (lambda (b) (if isearch-forward
+ (and (>= pos (car b)) (< pos (cdr b)))
+ (and (> pos (car b)) (<= pos (cdr b)))))
+ bounds))
+ (lambda (pos)
+ (let ((bounds (flatten-list bounds))
+ found)
+ (unless isearch-forward
+ (setq bounds (nreverse bounds)))
+ (while (and bounds (not found))
+ (if (if isearch-forward (< pos (car bounds)) (> pos (car bounds)))
+ (setq found (car bounds))
+ (setq bounds (cdr bounds))))
+ found))))
+
(defun isearch-search-fun-in-text-property (search-fun property)
"Return the function to search inside text that has the specified PROPERTY.
The function will limit the search for matches only inside text which has
this property in the current buffer.
The argument SEARCH-FUN provides the function to search text, and
defaults to the value of `isearch-search-fun-default' when nil."
- (lambda (string &optional bound noerror count)
- (let* ((old (point))
- ;; Check if point is already on the property.
- (beg (when (get-text-property
- (if isearch-forward old (max (1- old) (point-min)))
- property)
- old))
- end found (i 0)
- (subregexp
- (and isearch-regexp
- (save-match-data
- (catch 'subregexp
- (while (string-match "\\^\\|\\$" string i)
- (setq i (match-end 0))
- (when (subregexp-context-p string (match-beginning 0))
- ;; The ^/$ is not inside a char-range or escaped.
- (throw 'subregexp t))))))))
- ;; Otherwise, try to search for the next property.
- (unless beg
- (setq beg (if isearch-forward
- (next-single-property-change old property)
- (previous-single-property-change old property)))
- (when beg (goto-char beg)))
- ;; Non-nil `beg' means there are more properties.
- (while (and beg (not found))
- ;; Search for the end of the current property.
- (setq end (if isearch-forward
- (next-single-property-change beg property)
- (previous-single-property-change beg property)))
- ;; Handle ^/$ specially by matching in a temporary buffer.
- (if subregexp
- (let* ((prop-beg
- (if (or (if isearch-forward (bobp) (eobp))
- (null (get-text-property
- (+ (point) (if isearch-forward -1 0))
- property)))
- ;; Already at the beginning of the field.
- beg
- ;; Get the real beginning of the field when
- ;; the search was started in the middle.
- (if isearch-forward
- (previous-single-property-change beg property)
- (next-single-property-change beg property))))
- (substring (buffer-substring prop-beg end))
- (offset (if isearch-forward prop-beg end))
- match-data)
- (with-temp-buffer
- (insert substring)
- (goto-char (- beg offset -1))
- ;; Apply ^/$ regexp on the whole extracted substring.
- (setq found (funcall
- (or search-fun (isearch-search-fun-default))
- string (and bound (max (point-min)
- (min (point-max)
- (- bound offset -1))))
- noerror count))
- ;; Adjust match data as if it's matched in original buffer.
- (when found
- (setq found (+ found offset -1)
- match-data (mapcar (lambda (m) (+ m offset -1))
- (match-data)))))
- (when match-data (set-match-data match-data)))
- (setq found (funcall
- (or search-fun (isearch-search-fun-default))
- string (if bound (if isearch-forward
- (min bound end)
- (max bound end))
- end)
- noerror count)))
- ;; Get the next text property.
- (unless found
- (setq beg (if isearch-forward
- (next-single-property-change end property)
- (previous-single-property-change end property)))
- (when beg (goto-char beg))))
- (unless found (goto-char old))
- found)))
+ (apply-partially
+ #'search-within-boundaries
+ search-fun
+ (lambda (pos) (get-text-property (if isearch-forward pos
+ (max (1- pos) (point-min)))
+ property))
+ (lambda (pos) (if isearch-forward
+ (next-single-property-change pos property)
+ (previous-single-property-change pos property)))))
+
+(defun search-within-boundaries ( search-fun get-fun next-fun
+ string &optional bound noerror count)
+ (let* ((old (point))
+ ;; Check if point is already on the property.
+ (beg (when (funcall get-fun old) old))
+ end found (i 0)
+ (subregexp
+ (and isearch-regexp
+ (save-match-data
+ (catch 'subregexp
+ (while (string-match "\\^\\|\\$" string i)
+ (setq i (match-end 0))
+ (when (subregexp-context-p string (match-beginning 0))
+ ;; The ^/$ is not inside a char-range or escaped.
+ (throw 'subregexp t))))))))
+ ;; Otherwise, try to search for the next property.
+ (unless beg
+ (setq beg (funcall next-fun old))
+ (when beg (goto-char beg)))
+ ;; Non-nil `beg' means there are more properties.
+ (while (and beg (not found))
+ ;; Search for the end of the current property.
+ (setq end (funcall next-fun beg))
+ ;; Handle ^/$ specially by matching in a temporary buffer.
+ (if subregexp
+ (let* ((prop-beg
+ (if (or (if isearch-forward (bobp) (eobp))
+ (null (funcall get-fun
+ (+ (point)
+ (if isearch-forward -1 1)))))
+ ;; Already at the beginning of the field.
+ beg
+ ;; Get the real beginning of the field when
+ ;; the search was started in the middle.
+ (let ((isearch-forward (not isearch-forward)))
+ ;; Search in the reverse direction.
+ (funcall next-fun beg))))
+ (substring (buffer-substring prop-beg end))
+ (offset (if isearch-forward prop-beg end))
+ match-data)
+ (with-temp-buffer
+ (insert substring)
+ (goto-char (- beg offset -1))
+ ;; Apply ^/$ regexp on the whole extracted substring.
+ (setq found (funcall
+ (or search-fun (isearch-search-fun-default))
+ string (and bound (max (point-min)
+ (min (point-max)
+ (- bound offset -1))))
+ noerror count))
+ ;; Adjust match data as if it's matched in original buffer.
+ (when found
+ (setq found (+ found offset -1)
+ match-data (mapcar (lambda (m) (+ m offset -1))
+ (match-data)))))
+ (when found (goto-char found))
+ (when match-data (set-match-data
+ (mapcar (lambda (m) (copy-marker m))
+ match-data))))
+ (setq found (funcall
+ (or search-fun (isearch-search-fun-default))
+ string (if bound (if isearch-forward
+ (min bound end)
+ (max bound end))
+ end)
+ noerror count)))
+ ;; Get the next text property.
+ (unless found
+ (setq beg (funcall next-fun end))
+ (when beg (goto-char beg))))
+ (unless found (goto-char old))
+ found))
(defun isearch-resume (string regexp word forward message case-fold)
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index a3ada443702..be26ca55f0d 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -51,7 +51,7 @@ This variable controls both `display-time' and stealth fontification.
The optimum value is a little over the typical number of buffer
characters which fit in a typical window."
- :type 'integer)
+ :type 'natnum)
(defcustom jit-lock-stealth-time nil
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index b84e9b74b1f..90833e1c1d7 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -277,7 +277,7 @@ the function is waiting, then it exits immediately, returning
CANCEL-ON-INPUT-RETVAL. Any future replies (normal or error) are
ignored."
(let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer
- cancelled
+ canceled
(retval
(unwind-protect
(catch tag
@@ -287,26 +287,26 @@ ignored."
#'jsonrpc--async-request-1
connection method params
:success-fn (lambda (result)
- (unless cancelled
+ (unless canceled
(throw tag `(done ,result))))
:error-fn
(jsonrpc-lambda
(&key code message data)
- (unless cancelled
+ (unless canceled
(throw tag `(error (jsonrpc-error-code . ,code)
(jsonrpc-error-message . ,message)
(jsonrpc-error-data . ,data)))))
:timeout-fn
(lambda ()
- (unless cancelled
+ (unless canceled
(throw tag '(error (jsonrpc-error-message . "Timed out")))))
`(,@(when deferred `(:deferred ,deferred))
,@(when timeout `(:timeout ,timeout)))))
(cond (cancel-on-input
(unwind-protect
(let ((inhibit-quit t)) (while (sit-for 30)))
- (setq cancelled t))
- `(cancelled ,cancel-on-input-retval))
+ (setq canceled t))
+ `(canceled ,cancel-on-input-retval))
(t (while t (accept-process-output nil 30)))))
;; In normal operation, cancellation is handled by the
;; timeout function and response filter, but we still have
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index ea60bc35f2b..92118ad1433 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -129,7 +129,7 @@ Set to nil if no mouse binding is desired."
(defcustom kmacro-ring-max 8
"Maximum number of keyboard macros to save in macro ring."
- :type 'integer)
+ :type 'natnum)
(defcustom kmacro-execute-before-append t
@@ -875,8 +875,8 @@ KEYS should be a vector or a string that obeys `key-valid-p'."
(defun kmacro-bind-to-key (_arg)
"When not defining or executing a macro, offer to bind last macro to a key.
-The key sequences `C-x C-k 0' through `C-x C-k 9' and `C-x C-k A'
-through `C-x C-k Z' are reserved for user bindings, and to bind to
+The key sequences \\`C-x C-k 0' through \\`C-x C-k 9' and \\`C-x C-k A'
+through \\`C-x C-k Z' are reserved for user bindings, and to bind to
one of these sequences, just enter the digit or letter, rather than
the whole sequence.
@@ -1002,7 +1002,7 @@ The ARG parameter is unused."
"Display the last keyboard macro.
If repeated, it shows previous elements in the macro ring.
To execute the displayed macro ring item without changing the macro ring,
-just enter C-k.
+just enter \\`C-k'.
This is like `kmacro-view-macro', but allows repeating macro commands
without repeating the prefix."
(interactive)
diff --git a/lisp/language/ind-util.el b/lisp/language/ind-util.el
index 60ada03fa25..27facaa858f 100644
--- a/lisp/language/ind-util.el
+++ b/lisp/language/ind-util.el
@@ -267,11 +267,11 @@
?த nil nil nil ?ந ?ன ;; DENTALS
?ப nil nil nil ?ம ;; LABIALS
?ய ?ர ?ற ?ல ?ள ?ழ ?வ ;; SEMIVOWELS
- nil ?ஷ ?ஸ ?ஹ ;; SIBILANTS
+ ?ஶ ?ஷ ?ஸ ?ஹ ;; SIBILANTS
nil nil nil nil nil nil nil nil ;; NUKTAS
- "ஜ்ஞ" "க்ஷ")
+ "ஜ்ஞ" "க்ஷ" "க்‌ஷ")
(;; Misc Symbols
- nil ?ஂ ?ஃ nil ?் nil nil)
+ nil ?ஂ ?ஃ nil ?் ?ௐ nil)
(;; Digits
nil nil nil nil nil nil nil nil nil nil)
(;; Inscript-extra (4) (#, $, ^, *, ])
@@ -290,11 +290,11 @@
?த nil nil nil ?ந ?ன ;; DENTALS
?ப nil nil nil ?ம ;; LABIALS
?ய ?ர ?ற ?ல ?ள ?ழ ?வ ;; SEMIVOWELS
- nil ?ஷ ?ஸ ?ஹ ;; SIBILANTS
+ ?ஶ ?ஷ ?ஸ ?ஹ ;; SIBILANTS
nil nil nil nil nil nil nil nil ;; NUKTAS
- "ஜ்ஞ" "க்ஷ")
+ "ஜ்ஞ" "க்ஷ" "க்‌ஷ")
(;; Misc Symbols
- nil ?ஂ ?ஃ nil ?் nil nil)
+ nil ?ஂ ?ஃ nil ?் ?ௐ nil)
(;; Digits
?௦ ?௧ ?௨ ?௩ ?௪ ?௫ ?௬ ?௭ ?௮ ?௯)
(;; Inscript-extra (4) (#, $, ^, *, ])
@@ -315,8 +315,8 @@
'(;; for encode/decode
(;; vowels -- 18
"a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U")
- ("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") "E" "e" "ai"
- "o.c" "O" "o" "au" ("RRI" "R^I") ("LLI" "L^I"))
+ ("RRi" "R^i" "RRu" "R^u") ("LLi" "L^i") (".c" "e.c") "E" "e" "ai"
+ "o.c" "O" "o" "au" ("RRI" "R^I" "RRU" "R^U") ("LLI" "L^I"))
(;; consonants -- 40
"k" "kh" "g" "gh" ("~N" "N^")
"ch" ("Ch" "chh") "j" "jh" ("~n" "JN")
diff --git a/lisp/language/indian.el b/lisp/language/indian.el
index 2887d410adf..407173827fe 100644
--- a/lisp/language/indian.el
+++ b/lisp/language/indian.el
@@ -109,7 +109,7 @@ are supported in this language environment."))
"Tamil" '((charset unicode)
(coding-system utf-8)
(coding-priority utf-8)
- (input-method . "tamil-itrans")
+ (input-method . "tamil-phonetic")
(sample-text . "Tamil (தமிழ்) வணக்கம்")
(documentation . "\
South Indian Language Tamil is supported in this language environment."))
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index c38ede4d678..dfbdf401dcc 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -313,8 +313,8 @@ Interactively, BEG and END are the mark/point of the current region.
Many modes define specific alignment rules, and some of these
rules in some modes react to the current prefix argument. For
-instance, in `text-mode', `M-x align' will align into columns
-based on space delimiters, while `C-u - M-x align' will align
+instance, in `text-mode', \\`M-x align' will align into columns
+based on space delimiters, while \\`C-u -' \\`M-x align' will align
into columns based on the \"$\" character. See the
`align-rules-list' variable definition for the specific rules.
@@ -639,7 +639,6 @@ hooks, by which independent code can cooperate with allout
without changes to the allout core. Here are key ones:
`allout-mode-hook'
-`allout-mode-deactivate-hook' (deprecated)
`allout-mode-off-hook'
`allout-exposure-change-functions'
`allout-structure-added-functions'
@@ -1483,6 +1482,7 @@ Major mode for editing Autoconf configure.ac files.
;;; Generated autoloads from autoinsert.el
+(put 'auto-insert 'safe-local-variable #'null)
(autoload 'auto-insert "autoinsert" "\
Insert default contents into new files if variable `auto-insert' is non-nil.
Matches the visited file name against the elements of `auto-insert-alist'." t nil)
@@ -2119,10 +2119,10 @@ a reflection.
;;; Generated autoloads from bookmark.el
- (define-key ctl-x-r-map "b" 'bookmark-jump)
- (define-key ctl-x-r-map "m" 'bookmark-set)
- (define-key ctl-x-r-map "M" 'bookmark-set-no-overwrite)
- (define-key ctl-x-r-map "l" 'bookmark-bmenu-list)
+ (keymap-set ctl-x-r-map "b" #'bookmark-jump)
+ (keymap-set ctl-x-r-map "m" #'bookmark-set)
+ (keymap-set ctl-x-r-map "M" #'bookmark-set-no-overwrite)
+ (keymap-set ctl-x-r-map "l" #'bookmark-bmenu-list)
(defvar-keymap bookmark-map :doc "\
Keymap containing bindings to bookmark functions.
It is not bound to any key by default: to bind it
@@ -2453,6 +2453,7 @@ When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-flag'.
(fn URL &optional NEW-WINDOW)" t nil)
+(make-obsolete 'browse-url-mozilla 'nil "29.1")
(autoload 'browse-url-firefox "browse-url" "\
Ask the Firefox WWW browser to load URL.
Defaults to the URL around or before point. Passes the strings
@@ -2542,6 +2543,7 @@ When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-flag'.
(fn URL &optional NEW-WINDOW)" t nil)
+(make-obsolete 'browse-url-w3 'nil "29.1")
(autoload 'browse-url-w3-gnudoit "browse-url" "\
Ask another Emacs running gnuserv to load the URL using the W3 browser.
The `browse-url-gnudoit-program' program is used with options given by
@@ -2729,7 +2731,6 @@ it is disabled.
;;; Generated autoloads from emacs-lisp/bytecomp.el
(put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
-(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
(put 'byte-compile-dynamic-docstrings 'safe-local-variable 'booleanp)
(put 'byte-compile-error-on-warn 'safe-local-variable 'booleanp)
(put 'byte-compile-warnings 'safe-local-variable (lambda (v) (or (symbolp v) (null (delq nil (mapcar (lambda (x) (not (symbolp x))) v))))))
@@ -4289,11 +4290,11 @@ The buffer is left in Command History mode." t nil)
Examine commands from variable `command-history' in a buffer.
The number of commands listed is controlled by `list-command-history-max'.
The command history is filtered by `list-command-history-filter' if non-nil.
-Use \\<command-history-map>\\[command-history-repeat] to repeat the command on the current line.
+Use \\<command-history-mode-map>\\[command-history-repeat] to repeat the command on the current line.
Otherwise much like Emacs-Lisp Mode except that there is no self-insertion
and digits provide prefix arguments. Tab does not indent.
-\\{command-history-map}
+\\{command-history-mode-map}
This command always recompiles the Command History listing
and runs the normal hook `command-history-hook'." t nil)
@@ -5050,6 +5051,8 @@ evaluate `compilation-shell-minor-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
+\\{compilation-shell-minor-mode-map}
+
(fn &optional ARG)" t nil)
(autoload 'compilation-minor-mode "compile" "\
Toggle Compilation minor mode.
@@ -5073,6 +5076,8 @@ evaluate `compilation-minor-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
+\\{compilation-minor-mode-map}
+
(fn &optional ARG)" t nil)
(autoload 'compilation-next-error-function "compile" "\
Advance to the next error message and visit the file where the error was.
@@ -6139,7 +6144,6 @@ The mode's hook is called both when the mode is enabled and when
it is disabled.
(fn &optional ARG)" t nil)
-(define-obsolete-function-alias 'turn-on-cwarn-mode 'cwarn-mode "24.1")
(put 'global-cwarn-mode 'globalized-minor-mode t)
(defvar global-cwarn-mode nil "\
Non-nil if Global Cwarn mode is enabled.
@@ -7269,8 +7273,11 @@ it is disabled.
(autoload 'dig "dig" "\
Query addresses of a DOMAIN using dig.
See `dig-invoke' for an explanation for the parameters.
-When called interactively, DOMAIN is prompted for. If given a prefix,
-also prompt for the QUERY-TYPE parameter.
+When called interactively, DOMAIN is prompted for.
+
+If given a \\[universal-argument] prefix, also prompt for the QUERY-TYPE parameter.
+
+If given a \\[universal-argument] \\[universal-argument] prefix, also prompt for the SERVER parameter.
(fn DOMAIN &optional QUERY-TYPE QUERY-CLASS QUERY-OPTION DIG-OPTION SERVER)" t nil)
(register-definition-prefixes "dig" '("dig-" "query-dig"))
@@ -7382,7 +7389,7 @@ Type \\[dired-do-copy] to Copy files.
Type \\[dired-sort-toggle-or-edit] to toggle Sorting by name/date or change the `ls' switches.
Type \\[revert-buffer] to read all currently expanded directories aGain.
This retains all marks and hides subdirs again that were hidden before.
-Use `SPC' and `DEL' to move down and up by lines.
+Use \\`SPC' and \\`DEL' to move down and up by lines.
If Dired ever gets confused, you can either type \\[revert-buffer] to read the
directories again, type \\[dired-do-redisplay] to relist the file at point or the marked files or a
@@ -8368,7 +8375,7 @@ Major mode for Ebrowse class tree buffers.
Each line corresponds to a class in a class tree.
Letters do not insert themselves, they are commands.
File operations in the tree buffer work on class tree data structures.
-E.g.\\[save-buffer] writes the tree to the file it was loaded from.
+E.g. \\[save-buffer] writes the tree to the file it was loaded from.
Tree mode key bindings:
\\{ebrowse-tree-mode-map}
@@ -8406,7 +8413,7 @@ A second call of this function without changing point inserts the next match.
A call with prefix PREFIX reads the symbol to insert from the minibuffer with
completion.
-(fn PREFIX)" '("P") nil)
+(fn PREFIX)" t nil)
(autoload 'ebrowse-tags-loop-continue "ebrowse" "\
Repeat last operation on files in tree.
FIRST-TIME non-nil means this is not a repetition, but the first time.
@@ -9078,6 +9085,11 @@ It creates an autoload function for CNAME's constructor.
;;; Generated autoloads from emacs-lisp/eieio-custom.el
+(autoload 'customize-object "eieio-custom" "\
+Customize OBJ in a custom buffer.
+Optional argument GROUP is the sub-group of slots to display.
+
+(fn OBJ &optional GROUP)" nil nil)
(register-definition-prefixes "eieio-custom" '("eieio-"))
@@ -9088,6 +9100,18 @@ It creates an autoload function for CNAME's constructor.
;;; Generated autoloads from emacs-lisp/eieio-opt.el
+(autoload 'eieio-browse "eieio-opt" "\
+Create an object browser window to show all objects.
+If optional ROOT-CLASS, then start with that, otherwise start with
+variable `eieio-default-superclass'.
+
+(fn &optional ROOT-CLASS)" t nil)
+(define-obsolete-function-alias 'eieio-help-class 'cl--describe-class "25.1")
+(autoload 'eieio-help-constructor "eieio-opt" "\
+Describe CTR if it is a class constructor.
+
+(fn CTR)" nil nil)
+(make-obsolete 'eieio-help-constructor '"use `describe-function' or `cl--describe-class'." "29.1")
(register-definition-prefixes "eieio-opt" '("eieio-"))
@@ -9393,7 +9417,7 @@ See also `emacs-lock-unlockable-modes', which exempts buffers under
some major modes from being locked under some circumstances.
(fn &optional ARG)" t nil)
-(register-definition-prefixes "emacs-lock" '("emacs-lock-" "toggle-emacs-lock"))
+(register-definition-prefixes "emacs-lock" '("emacs-lock-"))
;;; Generated autoloads from textmodes/emacs-news-mode.el
@@ -9477,12 +9501,7 @@ Emerge two RCS revisions of a file, with another revision as ancestor.
;;; Generated autoloads from international/emoji.el
(autoload 'emoji-insert "emoji" "\
-Choose and insert an emoji glyph.
-If TEXT (interactively, the prefix argument), choose the emoji
-by typing its Unicode Standard name (with completion), instead
-of selecting from emoji display.
-
-(fn &optional TEXT)" t nil)
+Choose and insert an emoji glyph." t nil)
(autoload 'emoji-recent "emoji" "\
Choose and insert one of the recently-used emoji glyphs." t nil)
(autoload 'emoji-search "emoji" "\
@@ -9509,13 +9528,9 @@ the name is not known.
Increase the size of the character under point.
FACTOR is the multiplication factor for the size.
-This command will be repeatable if `repeat-mode' is switched on.
-
(fn &optional FACTOR)" t nil)
(autoload 'emoji-zoom-decrease "emoji" "\
-Decrease the size of the character under point.
-
-This command will be repeatable if `repeat-mode' is switched on." t nil)
+Decrease the size of the character under point." t nil)
(register-definition-prefixes "emoji" '("emoji-"))
@@ -9906,8 +9921,10 @@ Non-interactively, it takes the keyword arguments
(server (erc-compute-server))
(port (erc-compute-port))
(nick (erc-compute-nick))
+ (user (erc-compute-user))
password
(full-name (erc-compute-full-name))
+ id
That is, if called with
@@ -9917,7 +9934,11 @@ then the server and full-name will be set to those values,
whereas `erc-compute-port' and `erc-compute-nick' will be invoked
for the values of the other parameters.
-(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) PASSWORD (FULL-NAME (erc-compute-full-name)))" '((erc-select-read-args)) nil)
+When present, ID should be an opaque object used to identify the
+connection unequivocally. This is rarely needed and not available
+interactively.
+
+(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) ID)" t nil)
(defalias 'erc-select #'erc)
(autoload 'erc-tls "erc" "\
ERC is a powerful, modular, and extensible IRC client.
@@ -9933,6 +9954,7 @@ Non-interactively, it takes the keyword arguments
password
(full-name (erc-compute-full-name))
client-certificate
+ id
That is, if called with
@@ -9957,7 +9979,13 @@ Example usage:
\\='(\"/home/bandali/my-cert.key\"
\"/home/bandali/my-cert.crt\"))
-(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) PASSWORD (FULL-NAME (erc-compute-full-name)) CLIENT-CERTIFICATE)" '((let ((erc-default-port erc-default-port-tls)) (erc-select-read-args))) nil)
+When present, ID should be an opaque object for identifying the
+connection unequivocally. (In most cases, this would be a string or a
+symbol composed of letters from the Latin alphabet.) This option is
+generally unneeded, however. See info node `(erc) Connecting' for use
+cases. Not available interactively.
+
+(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) CLIENT-CERTIFICATE ID)" t nil)
(autoload 'erc-handle-irc-url "erc" "\
Use ERC to IRC on HOST:PORT in CHANNEL as USER with PASSWORD.
If ERC is already connected to HOST:PORT, simply /join CHANNEL.
@@ -10073,6 +10101,7 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL.
Return the name of the network or \"Unknown\" as a symbol.
Use the server parameter NETWORK if provided, otherwise parse the
server name and search for a match in `erc-networks-alist'." nil nil)
+(make-obsolete 'erc-determine-network '"maybe see `erc-networks--determine'" "29.1")
(autoload 'erc-server-select "erc-networks" "\
Interactively select a server to connect to using `erc-server-alist'." t nil)
(register-definition-prefixes "erc-networks" '("erc-"))
@@ -10172,7 +10201,9 @@ it has to be wrapped in `(eval (quote ...))'.
If NAME is already defined as a test and Emacs is running
in batch mode, an error is signalled.
-(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil 'macro)
+(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil t)
+(function-put 'ert-deftest 'doc-string-elt 3)
+(function-put 'ert-deftest 'lisp-indent-function 2)
(autoload 'ert-run-tests-batch "ert" "\
Run the tests specified by SELECTOR, printing results to the terminal.
@@ -10965,6 +10996,8 @@ If BUFFER, the data to be rendered is in that buffer. In that
case, this function doesn't actually fetch URL. BUFFER will be
killed after rendering.
+For more information, see Info node `(eww) Top'.
+
(fn URL &optional NEW-BUFFER BUFFER)" t nil)
(defalias 'browse-web 'eww)
(autoload 'eww-open-file "eww" "\
@@ -11244,9 +11277,9 @@ INC may be passed as a numeric prefix argument.
The actual adjustment made depends on the final component of the
keybinding used to invoke the command, with all modifiers removed:
- +, = Increase font size in current buffer by one step
- - Decrease font size in current buffer by one step
- 0 Reset the font size to the global default
+ \\`+', \\`=' Increase font size in current buffer by one step
+ \\`-' Decrease font size in current buffer by one step
+ \\`0' Reset the font size to the global default
After adjusting, continue to read input events and further adjust
the font size as long as the input event read
@@ -11268,12 +11301,43 @@ that have an explicit `:height' setting. The two exceptions to
this are the `default' and `header-line' faces: they will both be
scaled even if they have an explicit `:height' setting.
+See also the related command `global-text-scale-adjust'.
+
(fn INC)" t nil)
(define-key global-map [pinch] 'text-scale-pinch)
(autoload 'text-scale-pinch "face-remap" "\
Adjust the height of the default face by the scale in the pinch event EVENT.
(fn EVENT)" t nil)
+ (define-key ctl-x-map [(control meta ?+)] 'global-text-scale-adjust)
+ (define-key ctl-x-map [(control meta ?=)] 'global-text-scale-adjust)
+ (define-key ctl-x-map [(control meta ?-)] 'global-text-scale-adjust)
+ (define-key ctl-x-map [(control meta ?0)] 'global-text-scale-adjust)
+(autoload 'global-text-scale-adjust "face-remap" "\
+Globally adjust the font size by INCREMENT.
+
+Interactively, INCREMENT may be passed as a numeric prefix argument.
+
+The adjustment made depends on the final component of the key binding
+used to invoke the command, with all modifiers removed:
+
+ \\`+', \\`=' Globally increase the height of the default face
+ \\`-' Globally decrease the height of the default face
+ \\`0' Globally reset the height of the default face
+
+After adjusting, further adjust the font size as long as the key,
+with all modifiers removed, is one of the above characters.
+
+Buffer-local face adjustements have higher priority than global
+face adjustments.
+
+The variable `global-text-scale-adjust-resizes-frames' controls
+whether the frames are resized to keep the same number of lines
+and characters per line when the font size is adjusted.
+
+See also the related command `text-scale-adjust'.
+
+(fn INCREMENT)" t nil)
(autoload 'buffer-face-mode "face-remap" "\
Minor mode for a buffer-specific default face.
@@ -11329,7 +11393,7 @@ An interface to `buffer-face-mode' which uses the `variable-pitch' face.
Besides the choice of face, it is the same as `buffer-face-mode'.
(fn &optional ARG)" t nil)
-(register-definition-prefixes "face-remap" '("buffer-face-mode-" "face-" "internal-lisp-face-attributes" "text-scale-"))
+(register-definition-prefixes "face-remap" '("buffer-face-mode-" "face-" "global-text-scale-adjust-" "internal-lisp-face-attributes" "text-scale-"))
;;; Generated autoloads from facemenu.el
@@ -11453,6 +11517,12 @@ double prefix to wrap forward, triple to wrap backwards.
Actual search is done by the function `ffap-next-guess'.
(fn &optional BACK WRAP)" t nil)
+(autoload 'ffap-machine-at-point "ffap" "\
+Return machine name at point if it exists, or nil." nil nil)
+(autoload 'ffap-url-at-point "ffap" "\
+Return URL from around point if it exists, or nil.
+
+Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." nil nil)
(autoload 'find-file-at-point "ffap" "\
Find FILENAME, guessing a default from text around point.
If `ffap-url-regexp' is not nil, the FILENAME may also be an URL.
@@ -11762,6 +11832,11 @@ use in place of \"-ls\" as the final argument.
Collect output in the \"*Find*\" buffer. To kill the job before
it finishes, type \\[kill-find].
+For more information on how to write valid find expressions for
+ARGS, see Info node `(find) Finding Files'. If you are not
+using GNU findutils (on macOS and *BSD systems), see instead the
+man page for \"find\".
+
(fn DIR ARGS)" t nil)
(autoload 'find-dired-with-command "find-dired" "\
Run `find' and go into Dired mode on a buffer of the output.
@@ -12209,6 +12284,8 @@ evaluate `flymake-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
+\\{flymake-mode-map}
+
(fn &optional ARG)" t nil)
(autoload 'flymake-mode-on "flymake" "\
Turn Flymake mode on." nil nil)
@@ -13791,7 +13868,7 @@ Return intersection of LIST1 and LIST2.
LIST1 and LIST2 have to be sorted over <.
(fn LIST1 LIST2)" nil nil)
-(defalias 'gnus-set-sorted-intersection 'gnus-sorted-nintersection)
+(defalias 'gnus-set-sorted-intersection #'gnus-sorted-nintersection)
(autoload 'gnus-sorted-nintersection "gnus-range" "\
Return intersection of LIST1 and LIST2 by modifying cdr pointers of LIST1.
LIST1 and LIST2 have to be sorted over <.
@@ -14235,7 +14312,7 @@ to specify a command to run.
If CONFIRM is non-nil, the user will be given an opportunity to edit the
command before it's run.
-Interactively, the user can use the `M-c' command while entering
+Interactively, the user can use the \\`M-c' command while entering
the regexp to indicate whether the grep should be case sensitive
or not.
@@ -15783,7 +15860,8 @@ inlined into the compiled format versions. This means that if you
change its definition, you should explicitly call
`ibuffer-recompile-formats'.
-(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil 'macro)
+(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil t)
+(function-put 'define-ibuffer-column 'lisp-indent-function 'defun)
(autoload 'define-ibuffer-sorter "ibuf-macs" "\
Define a method of sorting named NAME.
DOCUMENTATION is the documentation of the function, which will be called
@@ -15794,7 +15872,9 @@ For sorting, the forms in BODY will be evaluated with `a' bound to one
buffer object, and `b' bound to another. BODY should return a non-nil
value if and only if `a' is \"less than\" `b'.
-(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil 'macro)
+(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil t)
+(function-put 'define-ibuffer-sorter 'lisp-indent-function 1)
+(function-put 'define-ibuffer-sorter 'doc-string-elt 2)
(autoload 'define-ibuffer-op "ibuf-macs" "\
Generate a function which operates on a buffer.
OP becomes the name of the function; if it doesn't begin with
@@ -15833,7 +15913,9 @@ BODY define the operation; they are forms to evaluate per each
marked buffer. BODY is evaluated with `buf' bound to the
buffer object.
-(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING BEFORE AFTER COMPLEX) &rest BODY)" nil 'macro)
+(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING BEFORE AFTER COMPLEX) &rest BODY)" nil t)
+(function-put 'define-ibuffer-op 'lisp-indent-function 2)
+(function-put 'define-ibuffer-op 'doc-string-elt 3)
(autoload 'define-ibuffer-filter "ibuf-macs" "\
Define a filter named NAME.
DOCUMENTATION is the documentation of the function.
@@ -15848,7 +15930,9 @@ not a particular buffer should be displayed or not. The forms in BODY
will be evaluated with BUF bound to the buffer object, and QUALIFIER
bound to the current value of the filter.
-(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil 'macro)
+(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil t)
+(function-put 'define-ibuffer-filter 'lisp-indent-function 2)
+(function-put 'define-ibuffer-filter 'doc-string-elt 2)
(register-definition-prefixes "ibuf-macs" '("ibuffer-"))
@@ -16548,7 +16632,6 @@ See `inferior-emacs-lisp-mode' for details.
;;; Generated autoloads from iimage.el
-(define-obsolete-function-alias 'turn-on-iimage-mode 'iimage-mode "24.1")
(autoload 'iimage-mode "iimage" "\
Toggle Iimage mode on or off.
@@ -16770,6 +16853,15 @@ Return non-nil if there is an image at point." nil nil)
;;; Generated autoloads from image/image-converter.el
+(autoload 'image-converter-add-handler "image-converter" "\
+Make Emacs use CONVERTER to parse image files that end with SUFFIX.
+CONVERTER is a function with two parameters, where the first is
+the file name or a string with the image data, and the second is
+non-nil if the first parameter is image data. The converter
+should output the image in the current buffer, converted to
+`image-convert-to-format'.
+
+(fn SUFFIX CONVERTER)" nil nil)
(register-definition-prefixes "image-converter" '("image-convert"))
@@ -18676,6 +18768,41 @@ Major mode for browsing CVS log output.
(register-definition-prefixes "log-view" '("log-view-"))
+;;; Generated autoloads from longlines.el
+
+(autoload 'longlines-mode "longlines" "\
+Toggle Long Lines mode in this buffer.
+
+When Long Lines mode is enabled, long lines are wrapped if they
+extend beyond `fill-column'. The soft newlines used for line
+wrapping will not show up when the text is yanked or saved to
+disk.
+
+If the variable `longlines-auto-wrap' is non-nil, lines are
+automatically wrapped whenever the buffer is changed. You can
+always call `fill-paragraph' to fill individual paragraphs.
+
+If the variable `longlines-show-hard-newlines' is non-nil, hard
+newlines are indicated with a symbol.
+
+This is a minor mode. If called interactively, toggle the
+`Longlines mode' mode. If the prefix argument is positive,
+enable the mode, and if it is zero or negative, disable the mode.
+
+If called from Lisp, toggle the mode if ARG is `toggle'. Enable
+the mode if ARG is nil, omitted, or is a positive number.
+Disable the mode if ARG is a negative number.
+
+To check whether the minor mode is enabled in the current buffer,
+evaluate `longlines-mode'.
+
+The mode's hook is called both when the mode is enabled and when
+it is disabled.
+
+(fn &optional ARG)" t nil)
+(register-definition-prefixes "longlines" '("longlines-"))
+
+
;;; Generated autoloads from lpr.el
(defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)) "\
@@ -19096,13 +19223,6 @@ if it is quoted with double-quotes.
(autoload 'mail-completion-at-point-function "mailalias" "\
Compute completion data for mail aliases.
For use on `completion-at-point-functions'." nil nil)
-(autoload 'mail-complete "mailalias" "\
-Perform completion on header field or word preceding point.
-Completable headers are according to `mail-complete-alist'. If none matches
-current header, calls `mail-complete-function' and passes prefix ARG if any.
-
-(fn ARG)" t nil)
-(make-obsolete 'mail-complete 'mail-completion-at-point-function "24.1")
(register-definition-prefixes "mailalias" '("build-mail-aliases" "mail-"))
@@ -20011,7 +20131,7 @@ ripples outward, changing the flow of the eddy currents in the
upper atmosphere. These cause momentary pockets of higher-pressure
air to form, which act as lenses that deflect incoming cosmic rays,
focusing them to strike the drive platter and flip the desired bit.
-You can type `M-x butterfly C-M-c' to run it. This is a permuted
+You can type \\`M-x butterfly C-M-c' to run it. This is a permuted
variation of `C-x M-c M-butterfly' from url `https://xkcd.com/378/'." t nil)
(autoload 'list-dynamic-libraries "misc" "\
Display a list of all dynamic libraries known to Emacs.
@@ -20839,6 +20959,7 @@ Interactively, prompt for NAME-SERVER if invoked with prefix argument.
This command uses `dig-program' for looking up the DNS information.
(fn HOST &optional NAME-SERVER)" t nil)
+(make-obsolete 'run-dig 'dig "29.1")
(autoload 'ftp "net-utils" "\
Run `ftp-program' to connect to HOST.
@@ -20866,7 +20987,7 @@ This command uses `network-connection-service-alist', which see.
Open a network connection to HOST on PORT.
(fn HOST PORT)" t nil)
-(register-definition-prefixes "net-utils" '("arp-program" "dig-program" "dns-lookup-program" "finger-X.500-host-regexps" "ftp-" "ifconfig-program" "ipconfig" "iwconfig-program" "net" "nslookup-" "ping-program" "route-program" "run-network-program" "smbclient" "traceroute-program" "whois-"))
+(register-definition-prefixes "net-utils" '("arp-program" "dns-lookup-program" "finger-X.500-host-regexps" "ftp-" "ifconfig-program" "ipconfig" "iwconfig-program" "net" "nslookup-" "ping-program" "route-program" "run-network-program" "smbclient" "traceroute-program" "whois-"))
;;; Generated autoloads from net/netrc.el
@@ -23119,12 +23240,11 @@ Completion for the `chown' command." nil nil)
Completion for the `chgrp' command." nil nil)
(autoload 'pcomplete/ssh "pcmpl-unix" "\
Completion rules for the `ssh' command." nil nil)
+(defalias 'pcomplete/rsh #'pcomplete/ssh)
(autoload 'pcomplete/scp "pcmpl-unix" "\
Completion rules for the `scp' command.
Includes files as well as host names followed by a colon." nil nil)
(autoload 'pcomplete/telnet "pcmpl-unix" nil nil nil)
-(autoload 'pcomplete/rsh "pcmpl-unix" "\
-Complete `rsh', which, after the user and hostname, is like xargs." nil nil)
(register-definition-prefixes "pcmpl-unix" '("pcmpl-" "pcomplete/"))
@@ -23494,6 +23614,7 @@ it is disabled.
;;; Generated autoloads from plstore.el
+(put 'plstore-encrypt-to 'safe-local-variable (lambda (val) (or (stringp val) (and (listp val) (catch 'safe (mapc (lambda (elt) (unless (stringp elt) (throw 'safe nil))) val) t)))))
(autoload 'plstore-open "plstore" "\
Create a plstore instance associated with FILE.
@@ -25281,6 +25402,8 @@ evaluate `rectangle-mark-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
+\\{rectangle-mark-mode-map}
+
(fn &optional ARG)" t nil)
(register-definition-prefixes "rect" '("apply-on-rectangle" "clear-rectangle-line" "delete-" "extract-rectangle-" "killed-rectangle" "ope" "rectangle-" "spaces-string" "string-rectangle-"))
@@ -25773,49 +25896,6 @@ Make a ring that can contain SIZE elements.
(register-definition-prefixes "ring" '("ring-"))
-;;; Generated autoloads from net/rlogin.el
-
-(autoload 'rlogin "rlogin" "\
-Open a network login connection via `rlogin' with args INPUT-ARGS.
-INPUT-ARGS should start with a host name; it may also contain
-other arguments for `rlogin'.
-
-Input is sent line-at-a-time to the remote connection.
-
-Communication with the remote host is recorded in a buffer `*rlogin-HOST*'
-(or `*rlogin-USER@HOST*' if the remote username differs).
-If a prefix argument is given and the buffer `*rlogin-HOST*' already exists,
-a new buffer with a different connection will be made.
-
-When called from a program, if the optional second argument BUFFER is
-a string or buffer, it specifies the buffer to use.
-
-The variable `rlogin-program' contains the name of the actual program to
-run. It can be a relative or absolute path.
-
-The variable `rlogin-explicit-args' is a list of arguments to give to
-the rlogin when starting. They are added after any arguments given in
-INPUT-ARGS.
-
-If the default value of `rlogin-directory-tracking-mode' is t, then the
-default directory in that buffer is set to a remote (FTP) file name to
-access your home directory on the remote machine. Occasionally this causes
-an error, if you cannot access the home directory on that machine. This
-error is harmless as long as you don't try to use that default directory.
-
-If `rlogin-directory-tracking-mode' is neither t nor nil, then the default
-directory is initially set up to your (local) home directory.
-This is useful if the remote machine and your local machine
-share the same files via NFS. This is the default.
-
-If you wish to change directory tracking styles during a session, use the
-function `rlogin-directory-tracking-mode' rather than simply setting the
-variable.
-
-(fn INPUT-ARGS &optional BUFFER)" t nil)
-(register-definition-prefixes "rlogin" '("rlogin-"))
-
-
;;; Generated autoloads from mail/rmail.el
(defvar rmail-file-name (purecopy "~/RMAIL") "\
@@ -25844,14 +25924,6 @@ Then it should be a regexp matching your mail addresses.
Setting this variable has an effect only before reading a mail.")
(custom-autoload 'rmail-user-mail-address-regexp "rmail" t)
-(define-obsolete-variable-alias 'rmail-dont-reply-to-names 'mail-dont-reply-to-names "\
-24.1")
-(defvar rmail-default-dont-reply-to-names nil "\
-Regexp specifying part of the default value of `mail-dont-reply-to-names'.
-This is used when the user does not set `mail-dont-reply-to-names'
-explicitly.")
-(make-obsolete-variable 'rmail-default-dont-reply-to-names 'mail-dont-reply-to-names "\
-24.1")
(defvar rmail-ignored-headers (purecopy (concat "^via:\\|^mail-from:\\|^origin:\\|^references:\\|^sender:" "\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:" "\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:" "\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:" "\\|^nntp-posting-host:\\|^path:\\|^x-char.*:\\|^x-face:\\|^face:" "\\|^x-mailer:\\|^delivered-to:\\|^lines:" "\\|^content-transfer-encoding:\\|^x-coding-system:" "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:" "\\|^precedence:\\|^mime-version:" "\\|^list-owner:\\|^list-help:\\|^list-post:\\|^list-subscribe:" "\\|^list-id:\\|^list-unsubscribe:\\|^list-archive:" "\\|^content-length:\\|^nntp-posting-date:\\|^user-agent" "\\|^importance:\\|^envelope-to:\\|^delivery-date\\|^openpgp:" "\\|^mbox-line:\\|^cancel-lock:" "\\|^DomainKey-Signature:\\|^dkim-signature:" "\\|^ARC-.*:" "\\|^Received-SPF:" "\\|^Authentication-Results:" "\\|^resent-face:\\|^resent-x.*:\\|^resent-organization:\\|^resent-openpgp:" "\\|^x-.*:")) "\
Regexp to match header fields that Rmail should normally hide.
(See also `rmail-nonignored-headers', which overrides this regexp.)
@@ -29306,6 +29378,15 @@ single space character, and leading/trailing whitespace is
removed.
(fn STRING)" nil nil)
+(autoload 'named-let "subr-x" "\
+Looping construct taken from Scheme.
+Like `let', bind variables in BINDINGS and then evaluate BODY,
+but with the twist that BODY can evaluate itself recursively by
+calling NAME, where the arguments passed to NAME are used
+as the new values of the bound variables in the recursive invocation.
+
+(fn NAME BINDINGS &rest BODY)" nil t)
+(function-put 'named-let 'lisp-indent-function 2)
(autoload 'string-pixel-width "subr-x" "\
Return the width of STRING in pixels.
@@ -29328,7 +29409,7 @@ this defaults to the current buffer.
Query the user for a process and return the process object.
(fn PROMPT)" nil nil)
-(register-definition-prefixes "subr-x" '("hash-table-" "internal--thread-argument" "named-let" "replace-region-contents" "string-" "thread-" "with-buffer-unmodified-if-unchanged"))
+(register-definition-prefixes "subr-x" '("hash-table-" "internal--thread-argument" "replace-region-contents" "string-" "thread-" "with-buffer-unmodified-if-unchanged"))
;;; Generated autoloads from progmodes/subword.el
@@ -30275,6 +30356,7 @@ Communication with HOST is recorded in a buffer `*rsh-HOST*'.
Normally input is edited in Emacs and sent a line at a time.
(fn HOST)" t nil)
+(make-obsolete 'rsh 'nil "29.1")
(register-definition-prefixes "telnet" '("send-process-next-char" "telnet-"))
@@ -30309,7 +30391,7 @@ commands to use in that buffer.
(autoload 'ansi-term "term" "\
Start a terminal-emulator in a new buffer.
This is almost the same as `term' apart from always creating a new buffer,
-and `C-x' being marked as a `term-escape-char'.
+and \\`C-x' being marked as a `term-escape-char'.
(fn PROGRAM &optional NEW-BUFFER-NAME)" t nil)
(autoload 'serial-term "term" "\
@@ -32082,6 +32164,14 @@ which specify the range to operate on.
;;; Generated autoloads from mail/undigest.el
+(autoload 'undigestify-rmail-message "undigest" "\
+Break up a digest message into its constituent messages.
+Leaves original message, deleted, before the undigestified messages." t nil)
+(autoload 'unforward-rmail-message "undigest" "\
+Extract a forwarded message from the containing message.
+This puts the forwarded message into a separate rmail message following
+the containing message. This command is only useful when messages are
+forwarded with `rmail-enable-mime-composing' set to nil." t nil)
(register-definition-prefixes "undigest" '("rmail-"))
@@ -34405,18 +34495,6 @@ The mode's hook is called both when the mode is enabled and when
it is disabled.
(fn &optional ARG)" t nil)
-(autoload 'view-return-to-alist-update "view" "\
-Update `view-return-to-alist' of buffer BUFFER.
-Remove from `view-return-to-alist' all entries referencing dead
-windows. Optional argument ITEM non-nil means add ITEM to
-`view-return-to-alist' after purging. For a description of items
-that can be added see the RETURN-TO-ALIST argument of the
-function `view-mode-exit'. If `view-return-to-alist' contains an
-entry for the selected window, purge that entry from
-`view-return-to-alist' before adding ITEM.
-
-(fn BUFFER &optional ITEM)" nil nil)
-(make-obsolete 'view-return-to-alist-update '"this function has no effect." "24.1")
(autoload 'view-mode-enter "view" "\
Enter View mode and set up exit from view mode depending on optional arguments.
Optional argument QUIT-RESTORE if non-nil must specify a valid
@@ -34624,7 +34702,6 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
(put 'which-func-format 'risky-local-variable t)
(put 'which-func-current 'risky-local-variable t)
-(define-obsolete-function-alias 'which-func-mode 'which-function-mode "24.1")
(defvar which-function-mode nil "\
Non-nil if Which-Function mode is enabled.
See the `which-function-mode' command
@@ -35114,6 +35191,11 @@ The optional ARGS are additional keyword arguments.
Delete WIDGET.
(fn WIDGET)" nil nil)
+(autoload 'widget-convert "wid-edit" "\
+Convert TYPE to a widget without inserting it in the buffer.
+The optional ARGS are additional keyword arguments.
+
+(fn TYPE &rest ARGS)" nil nil)
(autoload 'widget-insert "wid-edit" "\
Call `insert' with ARGS even if surrounding text is read only.
@@ -35321,8 +35403,8 @@ Winner mode is a global minor mode that records the changes in
the window configuration (i.e. how the frames are partitioned
into windows) so that the changes can be \"undone\" using the
command `winner-undo'. By default this one is bound to the key
-sequence `C-c <left>'. If you change your mind (while undoing),
-you can press `C-c <right>' (calling `winner-redo').
+sequence \\`C-c <left>'. If you change your mind (while undoing),
+you can press \\`C-c <right>' (calling `winner-redo').
This is a global minor mode. If called interactively, toggle the
`Winner mode' mode. If the prefix argument is positive, enable
diff --git a/lisp/leim/quail/indian.el b/lisp/leim/quail/indian.el
index 8fffcc35119..e652f108dde 100644
--- a/lisp/leim/quail/indian.el
+++ b/lisp/leim/quail/indian.el
@@ -127,47 +127,34 @@
indian-mlm-itrans-v5-hash "malayalam-itrans" "Malayalam" "MlmIT"
"Malayalam transliteration by ITRANS method.")
-(defvar quail-tamil-itrans-syllable-table
- (let ((vowels
- '(("அ" nil "a")
- ("ஆ" "ா" "A")
- ("இ" "ி" "i")
- ("ஈ" "ீ" "I")
- ("உ" "ு" "u")
- ("ஊ" "ூ" "U")
- ("எ" "ெ" "e")
- ("ஏ" "ே" "E")
- ("ஐ" "ை" "ai")
- ("ஒ" "ொ" "o")
- ("ஓ" "ோ" "O")
- ("ஔ" "ௌ" "au")))
- (consonants
- '(("க" "k") ; U+0B95
- ("ங" "N^") ; U+0B99
- ("ச" "ch") ; U+0B9A
- ("ஞ" "JN") ; U+0B9E
- ("ட" "T") ; U+0B9F
- ("ண" "N") ; U+0BA3
- ("த" "t") ; U+0BA4
- ("ந" "n") ; U+0BA8
- ("ப" "p") ; U+0BAA
- ("ம" "m") ; U+0BAE
- ("ய" "y") ; U+0BAF
- ("ர" "r") ; U+0BB0
- ("ல" "l") ; U+0BB2
- ("வ" "v") ; U+0BB5
- ("ழ" "z") ; U+0BB4
- ("ள" "L") ; U+0BB3
- ("ற" "rh") ; U+0BB1
- ("ன" "nh") ; U+0BA9
- ("ஜ" "j") ; U+0B9C
- ("ஶ" nil) ; U+0BB6
- ("ஷ" "Sh") ; U+0BB7
- ("ஸ" "s") ; U+0BB8
- ("ஹ" "h") ; U+0BB9
- ("க்ஷ" "x" ) ; U+0B95
- ))
- (virama #x0BCD)
+;; This is needed since the Unicode codepoint order does not reflect
+;; the actual order in the Tamil language.
+(defvar quail-tamil-itrans--consonant-order
+ '("க" "ங" "ச" "ஞ" "ட" "ண"
+ "த" "ந" "ப" "ம" "ய" "ர"
+ "ல" "வ" "ழ" "ள" "ற" "ன"
+ "ஜ" "ஸ" "ஷ" "ஹ" "க்ஷ"
+ "க்‌ஷ" "ஶ"))
+
+(defun quail-tamil-itrans-compute-syllable-table (vowels consonants)
+ "Return the syllable table for the input method as a string.
+VOWELS is a list of (VOWEL SIGN INPUT-SEQ) where VOWEL is the
+Tamil vowel character, SIGN is the vowel sign corresponding to
+that vowel character or nil for none, and INPUT-SEQ is the input
+sequence to insert VOWEL.
+
+CONSONANTS is a list of (CONSONANT INPUT-SEQ...) where CONSONANT
+is the Tamil consonant character, and INPUT-SEQ is one or more
+strings that describe how to insert CONSONANT."
+ (setq vowels (sort vowels
+ (lambda (x y)
+ (string-lessp (car x) (car y)))))
+ (setq consonants
+ (sort consonants
+ (lambda (x y)
+ (or (seq-position (car x) quail-tamil-itrans--consonant-order) 1000)
+ (or (seq-position (car y) quail-tamil-itrans--consonant-order) 1000))))
+ (let ((virama #x0BCD)
clm)
(with-temp-buffer
(insert "\n")
@@ -197,21 +184,45 @@
(insert (propertize "\t" 'display (list 'space :align-to clm))
(car c) (or (nth 1 v) ""))
(setq clm (+ clm 6)))
- (insert "\n" (or (nth 1 c) "")
- (propertize "\t" 'display '(space :align-to 4))
- "|")
- (setq clm 6)
-
- (dolist (v vowels)
- (apply #'insert (propertize "\t" 'display (list 'space :align-to clm))
- (if (nth 1 c) (list (nth 1 c) (nth 2 v)) (list "")))
- (setq clm (+ clm 6))))
+ (dolist (ct (cdr c))
+ (insert "\n" (or ct "")
+ (propertize "\t" 'display '(space :align-to 4))
+ "|")
+ (setq clm 6)
+ (dolist (v vowels)
+ (apply #'insert (propertize "\t" 'display (list 'space :align-to clm))
+ (if ct (list ct (nth 2 v)) (list "")))
+ (setq clm (+ clm 6)))))
(insert "\n")
(insert "----+")
(insert-char ?- 74)
(insert "\n")
(buffer-string))))
+(defvar quail-tamil-itrans-syllable-table
+ (quail-tamil-itrans-compute-syllable-table
+ (let ((vowels (car indian-tml-base-table))
+ trans v ret)
+ (dotimes (i (length vowels))
+ (when (setq v (nth i vowels))
+ (when (characterp (car v))
+ (setcar v (string (car v))))
+ (setq trans (nth i (car indian-itrans-v5-table-for-tamil)))
+ (push (append v (list (if (listp trans) (car trans) trans)))
+ ret)))
+ ret)
+ (let ((consonants (cadr indian-tml-base-table))
+ trans c ret)
+ (dotimes (i (length consonants))
+ (when (setq c (nth i consonants))
+ (when (characterp c)
+ (setq c (string c)))
+ (setq trans (nth i (cadr indian-itrans-v5-table-for-tamil)))
+ (push (cons c (if (listp trans) trans (list trans)))
+ ret)))
+ (setq ret (nreverse ret))
+ ret)))
+
(defvar quail-tamil-itrans-numerics-and-symbols-table
(let ((numerics '((?௰ "பத்து") (?௱ "நூறு") (?௲ "ஆயிரம்")))
(symbols '((?௳ "நாள்") (?௴ "மாதம்") (?௵ "வருடம்")
@@ -244,25 +255,28 @@
(insert "\n")
(buffer-string))))
-(defun quail-tamil-itrans-compute-signs-table (digitp)
+(defun quail-tamil-itrans-compute-signs-table (digitp various)
"Compute the signs table for the tamil-itrans input method.
-If DIGITP is non-nil, include the digits translation as well."
- (let ((various '((?ஃ . "H") ("ஸ்ரீ" . "srii") (?ௐ)))
- (digits "௦௧௨௩௪௫௬௭௮௯")
+If DIGITP is non-nil, include the digits translation as well.
+If VARIOUS is non-nil, then it should a list of (CHAR TRANS)
+where CHAR is the character/string to translate and TRANS is
+CHAR's translation."
+ (let ((digits "௦௧௨௩௪௫௬௭௮௯")
(width 6) clm)
(with-temp-buffer
- (insert "\n" (make-string 18 ?-) "+")
- (when digitp (insert (make-string 60 ?-)))
+ (insert "\n" (make-string 18 ?-))
+ (when digitp
+ (insert "+" (make-string 60 ?-)))
(insert "\n")
(insert
(propertize "\t" 'display '(space :align-to 5)) "various"
- (propertize "\t" 'display '(space :align-to 18)) "|")
+ (propertize "\t" 'display '(space :align-to 18)))
(when digitp
(insert
- (propertize "\t" 'display '(space :align-to 45)) "digits"))
- (insert "\n" (make-string 18 ?-) "+")
+ "|" (propertize "\t" 'display '(space :align-to 45)) "digits"))
+ (insert "\n" (make-string 18 ?-))
(when digitp
- (insert (make-string 60 ?-)))
+ (insert "+" (make-string 60 ?-)))
(insert "\n")
(setq clm 0)
@@ -270,7 +284,8 @@ If DIGITP is non-nil, include the digits translation as well."
(insert (propertize "\t" 'display (list 'space :align-to clm))
(car (nth i various)))
(setq clm (+ clm width)))
- (insert (propertize "\t" 'display '(space :align-to 18)) "|")
+ (when digitp
+ (insert (propertize "\t" 'display '(space :align-to 18)) "|"))
(setq clm 20)
(when digitp
(dotimes (i 10)
@@ -281,25 +296,28 @@ If DIGITP is non-nil, include the digits translation as well."
(setq clm 0)
(dotimes (i (length various))
(insert (propertize "\t" 'display (list 'space :align-to clm))
- (or (cdr (nth i various)) ""))
+ (or (cadr (nth i various)) ""))
(setq clm (+ clm width)))
- (insert (propertize "\t" 'display '(space :align-to 18)) "|")
+ (when digitp
+ (insert (propertize "\t" 'display '(space :align-to 18)) "|"))
(setq clm 20)
(when digitp
(dotimes (i 10)
(insert (propertize "\t" 'display (list 'space :align-to clm))
(format "%d" i))
(setq clm (+ clm width))))
- (insert "\n" (make-string 18 ?-) "+")
+ (insert "\n" (make-string 18 ?-))
(when digitp
- (insert (make-string 60 ?-) "\n"))
+ (insert "+" (make-string 60 ?-) "\n"))
(buffer-string))))
(defvar quail-tamil-itrans-various-signs-and-digits-table
- (quail-tamil-itrans-compute-signs-table t))
+ (quail-tamil-itrans-compute-signs-table
+ t '((?ஃ "H") ("ஸ்ரீ" "srii") (?ௐ "OM"))))
(defvar quail-tamil-itrans-various-signs-table
- (quail-tamil-itrans-compute-signs-table nil))
+ (quail-tamil-itrans-compute-signs-table
+ nil '((?ஃ "H") ("ஸ்ரீ" "srii") (?ௐ "OM"))))
(if nil
(quail-define-package "tamil-itrans" "Tamil" "TmlIT" t "Tamil ITRANS"))
@@ -348,6 +366,160 @@ Their descriptions are included for easy reference.
Full key sequences are listed below:")
;;;
+;;; Tamil phonetic input method
+;;;
+
+;; Define the input method straightaway.
+(quail-define-package "tamil-phonetic" "Tamil" "ழ" t
+ "Customisable Tamil phonetic input method.
+To change the translation rules of the input method, customize
+`tamil-translation-rules'.
+
+To use native Tamil digits, customize `tamil-translation-rules'
+accordingly.
+
+To end the current translation process, say \\<quail-translation-keymap>\\[quail-select-current] (defined in
+`quail-translation-keymap'). This is useful when there's a
+conflict between two possible translation.
+
+The current input scheme is:
+
+### Basic syllables (உயிர்மெய் எழுத்துக்கள்) ###
+\\=\\<tamil--syllable-table>
+
+### Miscellaneous ####
+\\=\\<tamil--signs-table>
+
+The following characters have NO input sequence associated with
+them by default. Their descriptions are included for easy
+reference.
+\\=\\<quail-tamil-itrans-numerics-and-symbols-table>
+
+Full key sequences are listed below:"
+ nil nil nil nil nil nil t)
+
+(defvar tamil--syllable-table nil)
+(defvar tamil--signs-table nil)
+(defvar tamil--hashtables
+ (cons (make-hash-table :test #'equal)
+ (make-hash-table :test #'equal)))
+(defvar tamil--vowel-signs
+ '(("அ" . t) ("ஆ" . ?ா) ("இ" . ?ி) ("ஈ" . ?ீ)
+ ("உ" . ?ு) ("ஊ" . ?ூ) ("எ" . ?ெ) ("ஏ" . ?ே)
+ ("ஐ" . ?ை) ("ஒ" . ?ொ) ("ஓ" . ?ோ) ("ஔ" . ?ௌ)))
+
+(defun tamil--setter (sym val)
+ (set-default sym val)
+ (tamil--update-quail-rules val))
+
+(defun tamil--make-tables (rules)
+ (let (v v-table v-trans
+ c-table c-trans
+ m-table m-trans)
+ (dolist (ch rules)
+ (cond
+ ;; Vowel.
+ ((setq v (assoc-default (car ch) tamil--vowel-signs))
+ (push (list (car ch) (and (characterp v) v)) v-table)
+ (push (cdr ch) v-trans))
+ ;; Consonant. It needs to end with pulli.
+ ((string-suffix-p "்" (car ch))
+ ;; Strip the pulli now.
+ (push (substring (car ch) 0 -1) c-table)
+ (push (cdr ch) c-trans))
+ ;; If nothing else, then consider it a misc character.
+ (t (push (car ch) m-table)
+ (push (cdr ch) m-trans))))
+ (list v-table v-trans c-table c-trans m-table m-trans)))
+
+(defun tamil--update-quail-rules (rules &optional name)
+ ;; This function does pretty much what `indian-make-hash' does
+ ;; except that we don't try to copy the structure of
+ ;; `indian-tml-base-table' which leads to less code hassle.
+ (let* ((quail-current-package (assoc (or name "tamil-phonetic") quail-package-alist))
+ (tables (tamil--make-tables rules))
+ (v (nth 0 tables))
+ (v-trans (nth 1 tables))
+ (c (nth 2 tables))
+ (c-trans (nth 3 tables))
+ (m (nth 4 tables))
+ (m-trans (nth 5 tables))
+ (pulli (string #x0BCD)))
+ (clrhash (car tamil--hashtables))
+ (clrhash (cdr tamil--hashtables))
+ (indian--puthash-v v v-trans tamil--hashtables)
+ (indian--puthash-c c c-trans pulli tamil--hashtables)
+ (indian--puthash-cv c c-trans v v-trans tamil--hashtables)
+ (indian--puthash-m m m-trans tamil--hashtables)
+ ;; Now override the current translation rules.
+ ;; Empty quail map is '(list nil)'.
+ (setf (nth 2 quail-current-package) '(nil))
+ (maphash (lambda (k v)
+ (quail-defrule k (if (length= v 1)
+ (string-to-char v)
+ (vector v))))
+ (cdr tamil--hashtables))
+ (setq tamil--syllable-table
+ (quail-tamil-itrans-compute-syllable-table
+ (mapcar (lambda (ch) (append ch (pop v-trans))) v)
+ (mapcar (lambda (ch) (cons ch (pop c-trans))) c))
+ tamil--signs-table
+ (quail-tamil-itrans-compute-signs-table
+ nil
+ (append (mapcar (lambda (ch) (cons ch (pop m-trans))) m)
+ (and (gethash "ஸ்" (car tamil--hashtables))
+ `(("ஸ்ரீ" ,(concat (gethash "ஸ்" (car tamil--hashtables))
+ (gethash "ரீ" (car tamil--hashtables)))))))))))
+
+(defgroup tamil-input nil
+ "Translation rules for the Tamil input method."
+ :prefix "tamil-"
+ :group 'leim)
+
+(defcustom tamil-translation-rules
+ ;; Vowels.
+ '(("அ" "a") ("ஆ" "aa") ("இ" "i") ("ஈ" "ii")
+ ("உ" "u") ("ஊ" "uu") ("எ" "e") ("ஏ" "ee")
+ ("ஐ" "ai") ("ஒ" "o") ("ஓ" "oo") ("ஔ" "au" "ow")
+
+ ;; Consonants.
+ ("க்" "k" "g") ("ங்" "ng") ("ச்" "ch" "s") ("ஞ்" "nj") ("ட்" "t" "d")
+ ("ண்" "N") ("த்" "th" "dh") ("ந்" "nh") ("ப்" "p" "b") ("ம்" "m")
+ ("ய்" "y") ("ர்" "r") ("ல்" "l") ("வ்" "v") ("ழ்" "z" "zh")
+ ("ள்" "L") ("ற்" "rh") ("ன்" "n")
+ ;; Sanskrit.
+ ("ஜ்" "j") ("ஸ்" "S") ("ஷ்" "sh") ("ஹ்" "h")
+ ("க்‌ஷ்" "ksh") ("க்ஷ்" "ksH") ("ஶ்" "Z")
+
+ ;; Misc. ஃ is neither a consonant nor a vowel.
+ ("ஃ" "F" "q")
+ ("ௐ" "OM"))
+ "List of input sequences to translate to Tamil characters.
+Each element should be (CHARACTER INPUT-SEQUENCES...) where
+CHARACTER is the Tamil character, and INPUT-SEQUENCES are one
+or more input sequences which produce that character.
+
+CHARACTER is considered as a consonant (மெய் எழுத்து) if it ends
+with a pulli (virama).
+
+CHARACTER that is neither a vowel nor a consonant is inserted as
+is."
+ :group 'tamil-input
+ :type '(alist :key-type string :value-type (repeat string))
+ :set #'tamil--setter
+ :version "29.1"
+ :options
+ (delq nil
+ (append (mapcar #'car tamil--vowel-signs)
+ (mapcar (lambda (x) (if (characterp x)
+ (string x #x0BCD)
+ (and x (concat x "்"))))
+ (nth 1 indian-tml-base-table))
+ '("ஃ" "ௐ")
+ ;; Digits.
+ (mapcar #'string (nth 3 indian-tml-base-digits-table)))))
+
+;;;
;;; Input by Inscript
;;;
@@ -681,7 +853,7 @@ Full key sequences are listed below:")
(quail-define-package "malayalam-mozhi" "Malayalam" "MlmMI" t
"Malayalam transliteration by Mozhi method."
nil nil t nil nil nil t nil
- #'indian-mlm-mozhi-update-translation)
+ #'indian-mlm-mozhi-update-translation nil t)
(maphash
(lambda (key val)
diff --git a/lisp/leim/quail/persian.el b/lisp/leim/quail/persian.el
index 61428c94f0d..07d006c2a48 100644
--- a/lisp/leim/quail/persian.el
+++ b/lisp/leim/quail/persian.el
@@ -23,7 +23,7 @@
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
-;;
+
;; This file contains a collection of input methods for
;; Persian languages (Farsi, Urdu, Pashto/Afghanic, ...)
;;
@@ -402,7 +402,7 @@
;;;;;;;;;;; isiri-6219 Table 6 -- جدول ۶ - حروِفِ عربی
("F" ?إ)
- ("D" ?\u0671) ;; (ucs-insert #x0671)ٱ named: حرفِ الفِ وصل
+ ("D" ?\u0671) ;; (insert-char #x0671)ٱ named: حرفِ الفِ وصل
("K" ?ك) ;; Arabic kaf
("Th" ?ة) ;; ta marbuteh
("Y" ?ي)
@@ -421,40 +421,40 @@
("8" ?۸)
("9" ?۹)
- ("\\/" ?\u066B) ;; (ucs-insert #x066B)٫ named: ممیزِ فارسی
- ("\\," ?\u066C) ;; (ucs-insert #x066C)٬ named: جداکننده‌ی هزارهای فارسی
- ("%" ?\u066A) ;; (ucs-insert #x066A)٪ named: درصدِ فارسی
- ("+" ?\u002B) ;; (ucs-insert #x002B)+ named: علامتِ به‌اضافه
- ("-" ?\u2212) ;; (ucs-insert #x2212)− named: علامتِ منها
- ("\\*" ?\u00D7) ;; (ucs-insert #x00D7)× named: علامتِ ضرب
- ("\\-" ?\u00F7) ;; (ucs-insert #x00F7)÷ named: علامتِ تقسیم
- ("<" ?\u003C) ;; (ucs-insert #x003C)< named: علامتِ کوچکتر
- ("=" ?\u003D) ;; (ucs-insert #x003D)= named: علامتِ مساوی
- (">" ?\u003E) ;; (ucs-insert #x003E)> named: علامتِ بزرگتر
+ ("\\/" ?\u066B) ;; (insert-char #x066B)٫ named: ممیزِ فارسی
+ ("\\," ?\u066C) ;; (insert-char #x066C)٬ named: جداکننده‌ی هزارهای فارسی
+ ("%" ?\u066A) ;; (insert-char #x066A)٪ named: درصدِ فارسی
+ ("+" ?\u002B) ;; (insert-char #x002B)+ named: علامتِ به‌اضافه
+ ("-" ?\u2212) ;; (insert-char #x2212)− named: علامتِ منها
+ ("\\*" ?\u00D7) ;; (insert-char #x00D7)× named: علامتِ ضرب
+ ("\\-" ?\u00F7) ;; (insert-char #x00F7)÷ named: علامتِ تقسیم
+ ("<" ?\u003C) ;; (insert-char #x003C)< named: علامتِ کوچکتر
+ ("=" ?\u003D) ;; (insert-char #x003D)= named: علامتِ مساوی
+ (">" ?\u003E) ;; (insert-char #x003E)> named: علامتِ بزرگتر
;;;;;;;;;;; isiri-6219 Table 2 -- جدول ۲ - علائم نقطه گذاریِ مشترک
;;; Space
("." ?.) ;;
- (":" ?\u003A) ;; (ucs-insert #x003A): named:
- ("!" ?\u0021) ;; (ucs-insert #x0021)! named:
- ("\\." ?\u2026) ;; (ucs-insert #x2026)… named:
- ("\\-" ?\u2010) ;; (ucs-insert #x2010)‐ named:
- ("-" ?\u002D) ;; (ucs-insert #x002D)- named:
+ (":" ?\u003A) ;; (insert-char #x003A): named:
+ ("!" ?\u0021) ;; (insert-char #x0021)! named:
+ ("\\." ?\u2026) ;; (insert-char #x2026)… named:
+ ("\\-" ?\u2010) ;; (insert-char #x2010)‐ named:
+ ("-" ?\u002D) ;; (insert-char #x002D)- named:
("|" ?|)
;;("\\\\" ?\)
("//" ?/)
- ("*" ?\u002A) ;; (ucs-insert #x002A)* named:
- ("(" ?\u0028) ;; (ucs-insert #x0028)( named:
- (")" ?\u0029) ;; (ucs-insert #x0029)) named:
- ("[" ?\u005B) ;; (ucs-insert #x005B)[ named:
- ("[" ?\u005D) ;; (ucs-insert #x005D)] named:
- ("{" ?\u007B) ;; (ucs-insert #x007B){ named:
- ("}" ?\u007D) ;; (ucs-insert #x007D)} named:
- ("\\<" ?\u00AB) ;; (ucs-insert #x00AB)« named:
- ("\\>" ?\u00BB) ;; (ucs-insert #x00BB)» named:
- ("N" ?\u00AB) ;; (ucs-insert #x00AB)« named:
- ("M" ?\u00BB) ;; (ucs-insert #x00BB)» named:
+ ("*" ?\u002A) ;; (insert-char #x002A)* named:
+ ("(" ?\u0028) ;; (insert-char #x0028)( named:
+ (")" ?\u0029) ;; (insert-char #x0029)) named:
+ ("[" ?\u005B) ;; (insert-char #x005B)[ named:
+ ("[" ?\u005D) ;; (insert-char #x005D)] named:
+ ("{" ?\u007B) ;; (insert-char #x007B){ named:
+ ("}" ?\u007D) ;; (insert-char #x007D)} named:
+ ("\\<" ?\u00AB) ;; (insert-char #x00AB)« named:
+ ("\\>" ?\u00BB) ;; (insert-char #x00BB)» named:
+ ("N" ?\u00AB) ;; (insert-char #x00AB)« named:
+ ("M" ?\u00BB) ;; (insert-char #x00BB)» named:
;;;;;;;;;;; isiri-6219 Table 3 -- جدول ۳ - علائم نقطه گذاریِ فارسی
("," ?،) ;; farsi
@@ -466,20 +466,20 @@
;;;;;;;;;;; isiri-6219 Table 1 -- جدول ۱ - نویسه‌های کنترلی
;; LF
;; CR
- ("&zwnj;" ?\u200C) ;; (ucs-insert #x200C)‌ named: فاصله‌ی مجازی
+ ("&zwnj;" ?\u200C) ;; (insert-char #x200C)‌ named: فاصله‌ی مجازی
("/" ?\u200C) ;;
- ("&zwj;" ?\u200D) ;; (ucs-insert #x200D)‍ named: اتصالِ مجازی
+ ("&zwj;" ?\u200D) ;; (insert-char #x200D)‍ named: اتصالِ مجازی
("J" ?\u200D) ;;
- ("&lrm;" ?\u200E) ;; (ucs-insert #x200E)‎ named: نشانه‌ی چپ‌به‌راست
- ("&rlm;" ?\u200F) ;; (ucs-insert #x200F)‏ named: نشانه‌ی راست‌به‌چپ
- ("&ls;" ?\u2028) ;; (ucs-insert #x2028)
 named: جداکننده‌ی سطرها
- ("&ps;" ?\u2028) ;; (ucs-insert #x2029)
 named: جداکننده‌ی بندها
- ("&lre;" ?\u202A) ;; (ucs-insert #x202A)‪ named: زیرمتنِ چپ‌به‌راست
- ("&rle;" ?\u202B) ;; (ucs-insert #x202B) named: زیرمتنِ راست‌به‌چپ
- ("&pdf;" ?\u202C) ;; (ucs-insert #x202C) named: پایانِ زیرمتن
- ("&lro;" ?\u202D) ;; (ucs-insert #x202D) named: زیرمتنِ اکیداً چپ‌به‌راست
- ("&rlo;" ?\u202D) ;; (ucs-insert #x202E) named: زیرمتنِ اکیداً راست‌به‌چپ
- ("&bom;" ?\uFEFF) ;; (ucs-insert #xFEFF) named: نشانه‌ی ترتیبِ بایت‌ها
+ ("&lrm;" ?\u200E) ;; (insert-char #x200E)‎ named: نشانه‌ی چپ‌به‌راست
+ ("&rlm;" ?\u200F) ;; (insert-char #x200F)‏ named: نشانه‌ی راست‌به‌چپ
+ ("&ls;" ?\u2028) ;; (insert-char #x2028)
 named: جداکننده‌ی سطرها
+ ("&ps;" ?\u2028) ;; (insert-char #x2029)
 named: جداکننده‌ی بندها
+ ("&lre;" ?\u202A) ;; (insert-char #x202A)‪ named: زیرمتنِ چپ‌به‌راست
+ ("&rle;" ?\u202B) ;; (insert-char #x202B) named: زیرمتنِ راست‌به‌چپ
+ ("&pdf;" ?\u202C) ;; (insert-char #x202C) named: پایانِ زیرمتن
+ ("&lro;" ?\u202D) ;; (insert-char #x202D) named: زیرمتنِ اکیداً چپ‌به‌راست
+ ("&rlo;" ?\u202D) ;; (insert-char #x202E) named: زیرمتنِ اکیداً راست‌به‌چپ
+ ("&bom;" ?\uFEFF) ;; (insert-char #xFEFF) named: نشانه‌ی ترتیبِ بایت‌ها
;;;;;;;;;;; isiri-6219 Table 7 -- جدول ۷ - نشانه‌هایِ فارسی
@@ -491,14 +491,14 @@
("O" ?ٌ) ;; دو پيش فارسى -- تنوين رفع
("~" ?ّ) ;; tashdid ;; تشديد فارسى
("@" ?ْ) ;; ساکن فارسى
- ("U" ?\u0653) ;; (ucs-insert #x0653)ٓ named: مدِ فارسی
+ ("U" ?\u0653) ;; (insert-char #x0653)ٓ named: مدِ فارسی
("`" ?ٔ) ;; همزه فارسى بالا
- ("C" ?\u0655) ;; (ucs-insert #x0655)ٕ named: همزه فارسى پایین
- ("$" ?\u0670) ;; (ucs-insert #x0670)ٰ named: الفِ مقصوره‌ی فارسی
+ ("C" ?\u0655) ;; (insert-char #x0655)ٕ named: همزه فارسى پایین
+ ("$" ?\u0670) ;; (insert-char #x0670)ٰ named: الفِ مقصوره‌ی فارسی
;;;;;;;;;;; isiri-6219 Table 8 - Forbidden Characters -- جدول ۸ - نویسه‌هایِ ممنوع
-;; ;; he ye (ucs-insert 1728) (ucs-insert #x06c0) kills emacs-24.0.90
+;; ;; he ye (insert-char 1728) (insert-char #x06c0) kills emacs-24.0.90
;; arabic digits 0-9
@@ -508,7 +508,7 @@
("\\~" ?~)
("\\@" ?@)
("\\#" ?#)
- ("\\$" ?\uFDFC) ;; (ucs-insert #xFDFC)﷼ named:
+ ("\\$" ?\uFDFC) ;; (insert-char #xFDFC)﷼ named:
("\\^" ?^)
("\\1" ?1)
("\\2" ?2)
diff --git a/lisp/obsolete/longlines.el b/lisp/longlines.el
index 731f47794c9..4ad2cab2b23 100644
--- a/lisp/obsolete/longlines.el
+++ b/lisp/longlines.el
@@ -6,7 +6,6 @@
;; Alex Schroeder <alex@gnu.org>
;; Chong Yidong <cyd@stupidchicken.com>
;; Maintainer: emacs-devel@gnu.org
-;; Obsolete-since: 24.4
;; Keywords: convenience, wp
;; This file is part of GNU Emacs.
@@ -73,6 +72,11 @@ You can also enable the display temporarily, using the command
This is used when `longlines-show-hard-newlines' is on."
:type 'string)
+(defcustom longlines-break-chars " ;,|"
+ "A bag of separator chars for longlines."
+ :version "29.1"
+ :type 'string)
+
;;; Internal variables
(defvar longlines-wrap-beg nil)
@@ -115,7 +119,6 @@ newlines are indicated with a symbol."
(add-to-list 'buffer-file-format 'longlines)
(add-hook 'change-major-mode-hook #'longlines-mode-off nil t)
(add-hook 'before-revert-hook #'longlines-before-revert-hook nil t)
- (make-local-variable 'buffer-substring-filters)
(make-local-variable 'longlines-auto-wrap)
(set (make-local-variable 'isearch-search-fun-function)
#'longlines-search-function)
@@ -123,7 +126,8 @@ newlines are indicated with a symbol."
#'longlines-search-forward)
(set (make-local-variable 'replace-re-search-function)
#'longlines-re-search-forward)
- (add-to-list 'buffer-substring-filters 'longlines-encode-string)
+ (add-function :filter-return (local 'filter-buffer-substring-function)
+ #'longlines-encode-string)
(when longlines-wrap-follows-window-size
(let ((dw (if (and (integerp longlines-wrap-follows-window-size)
(>= longlines-wrap-follows-window-size 0)
@@ -140,7 +144,7 @@ newlines are indicated with a symbol."
(inhibit-modification-hooks t)
(mod (buffer-modified-p))
buffer-file-name buffer-file-truename)
- ;; Turning off undo is OK since (spaces + newlines) is
+ ;; Turning off undo is OK since (separators + newlines) is
;; conserved, except for a corner case in
;; longlines-wrap-lines that we'll never encounter from here
(save-restriction
@@ -199,7 +203,8 @@ newlines are indicated with a symbol."
(kill-local-variable 'replace-search-function)
(kill-local-variable 'replace-re-search-function)
(kill-local-variable 'require-final-newline)
- (kill-local-variable 'buffer-substring-filters)
+ (remove-function (local 'filter-buffer-substring-function)
+ #'longlines-encode-string)
(kill-local-variable 'use-hard-newlines)))
(defun longlines-mode-off ()
@@ -273,11 +278,8 @@ end of the buffer."
"If the current line needs to be wrapped, wrap it and return nil.
If wrapping is performed, point remains on the line. If the line does
not need to be wrapped, move point to the next line and return t."
- (if (longlines-set-breakpoint)
+ (if (longlines-set-breakpoint fill-column)
(progn (insert-before-markers-and-inherit ?\n)
- (backward-char 1)
- (delete-char -1)
- (forward-char 1)
nil)
(if (longlines-merge-lines-p)
(progn (end-of-line)
@@ -286,58 +288,60 @@ not need to be wrapped, move point to the next line and return t."
;; replace these two newlines by a single space. Unfortunately,
;; this breaks the conservation of (spaces + newlines), so we
;; have to fiddle with longlines-wrap-point.
- (if (or (prog1 (bolp) (forward-char 1)) (eolp))
- (progn
- (delete-char -1)
- (if (> longlines-wrap-point (point))
- (setq longlines-wrap-point
- (1- longlines-wrap-point))))
- (insert-before-markers-and-inherit ?\s)
- (backward-char 1)
- (delete-char -1)
- (forward-char 1))
+ (if (or (prog1 (bolp) (forward-char 1)) (eolp))
+ (progn
+ (delete-char -1)
+ (if (> longlines-wrap-point (point))
+ (setq longlines-wrap-point
+ (1- longlines-wrap-point))))
+ (delete-char -1))
nil)
(forward-line 1)
t)))
-(defun longlines-set-breakpoint ()
+(defun longlines-set-breakpoint (target-column)
"Place point where we should break the current line, and return t.
If the line should not be broken, return nil; point remains on the
line."
- (move-to-column fill-column)
- (if (and (re-search-forward "[^ ]" (line-end-position) 1)
- (> (current-column) fill-column))
- ;; This line is too long. Can we break it?
- (or (longlines-find-break-backward)
- (progn (move-to-column fill-column)
- (longlines-find-break-forward)))))
+ (move-to-column target-column)
+ (let ((non-break-re (format "[^%s]" longlines-break-chars)))
+ (if (and (re-search-forward non-break-re (line-end-position) t 1)
+ (> (current-column) target-column))
+ ;; This line is too long. Can we break it?
+ (or (longlines-find-break-backward)
+ (progn (move-to-column target-column)
+ (longlines-find-break-forward))))))
(defun longlines-find-break-backward ()
"Move point backward to the first available breakpoint and return t.
If no breakpoint is found, return nil."
- (and (search-backward " " (line-beginning-position) 1)
- (save-excursion
- (skip-chars-backward " " (line-beginning-position))
- (null (bolp)))
- (progn (forward-char 1)
- (if (and fill-nobreak-predicate
- (run-hook-with-args-until-success
- 'fill-nobreak-predicate))
- (progn (skip-chars-backward " " (line-beginning-position))
- (longlines-find-break-backward))
- t))))
+ (let ((break-re (format "[%s]" longlines-break-chars)))
+ (when (and (re-search-backward break-re (line-beginning-position) t 1)
+ (save-excursion
+ (skip-chars-backward longlines-break-chars
+ (line-beginning-position))
+ (null (bolp))))
+ (forward-char 1)
+ (if (and fill-nobreak-predicate
+ (run-hook-with-args-until-success 'fill-nobreak-predicate))
+ (progn
+ (skip-chars-backward longlines-break-chars
+ (line-beginning-position))
+ (longlines-find-break-backward))
+ t))))
(defun longlines-find-break-forward ()
"Move point forward to the first available breakpoint and return t.
If no break point is found, return nil."
- (and (search-forward " " (line-end-position) 1)
- (progn (skip-chars-forward " " (line-end-position))
- (null (eolp)))
- (if (and fill-nobreak-predicate
- (run-hook-with-args-until-success
- 'fill-nobreak-predicate))
- (longlines-find-break-forward)
- t)))
+ (let ((break-re (format "[%s]" longlines-break-chars)))
+ (and (re-search-forward break-re (line-end-position) t 1)
+ (progn
+ (skip-chars-forward longlines-break-chars (line-end-position))
+ (null (eolp)))
+ (if (and fill-nobreak-predicate
+ (run-hook-with-args-until-success 'fill-nobreak-predicate))
+ (longlines-find-break-forward)
+ t))))
(defun longlines-merge-lines-p ()
"Return t if part of the next line can fit onto the current line.
@@ -348,12 +352,7 @@ Otherwise, return nil. Text cannot be moved across hard newlines."
(null (get-text-property (point) 'hard))
(let ((space (- fill-column (current-column))))
(forward-line 1)
- (if (eq (char-after) ? )
- t ; We can always merge some spaces
- (<= (if (search-forward " " (line-end-position) 1)
- (current-column)
- (1+ (current-column)))
- space))))))
+ (longlines-set-breakpoint (max 0 (1- space)))))))
(defun longlines-decode-region (&optional beg end)
"Turn all newlines between BEG and END into hard newlines.
@@ -372,7 +371,7 @@ If BEG and END are nil, the point and mark are used."
(longlines-decode-region (point-min) (point-max)))
(defun longlines-encode-region (beg end &optional _buffer)
- "Replace each soft newline between BEG and END with exactly one space.
+ "Remove each soft newline between BEG and END.
Hard newlines are left intact. The optional argument BUFFER exists for
compatibility with `format-alist', and is ignored."
(save-excursion
@@ -382,23 +381,28 @@ compatibility with `format-alist', and is ignored."
(while (search-forward "\n" reg-max t)
(let ((pos (match-beginning 0)))
(unless (get-text-property pos 'hard)
- (goto-char (1+ pos))
- (insert-and-inherit " ")
- (delete-region pos (1+ pos))
- (remove-text-properties pos (1+ pos) '(hard nil)))))
+ (remove-text-properties pos (1+ pos) '(hard nil))
+ (delete-region pos (1+ pos)))))
(set-buffer-modified-p mod)
end)))
(defun longlines-encode-string (string)
- "Return a copy of STRING with each soft newline replaced by a space.
+ "Return a copy of STRING with each soft newline removed.
Hard newlines are left intact."
- (let* ((str (copy-sequence string))
- (pos (string-search "\n" str)))
- (while pos
- (if (null (get-text-property pos 'hard str))
- (aset str pos ? ))
- (setq pos (string-search "\n" str (1+ pos))))
- str))
+ (let ((start 0)
+ (result nil)
+ pos)
+ (while (setq pos (string-search "\n" string start))
+ (unless (= start pos)
+ (push (substring string start pos) result))
+ (when (get-text-property pos 'hard string)
+ (push (substring string pos (1+ pos)) result))
+ (setq start (1+ pos)))
+ (if (null result)
+ (copy-sequence string)
+ (unless (= start (length string))
+ (push (substring string start) result))
+ (apply #'concat (nreverse result)))))
;;; Auto wrap
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 9d2e20ae04b..6cc99c21348 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -42,9 +42,6 @@
:group 'maint
:group 'mail)
-(define-obsolete-variable-alias 'report-emacs-bug-pretest-address
- 'report-emacs-bug-address "24.1")
-
(defcustom report-emacs-bug-no-confirmation nil
"If non-nil, suppress the confirmations asked for the sake of novice users."
:type 'boolean)
@@ -521,7 +518,7 @@ Message buffer where you can explain more about the patch."
(goto-char (point-min))
(view-mode 1)
(button-mode 1))
- (message-mail-other-window report-emacs-bug-address subject)
+ (compose-mail-other-window report-emacs-bug-address subject)
(message-goto-body)
(insert "\n\n\n")
(emacs-bug--system-description)
diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el
index b343a017e34..eebb140088e 100644
--- a/lisp/mail/hashcash.el
+++ b/lisp/mail/hashcash.el
@@ -1,6 +1,6 @@
;;; hashcash.el --- Add hashcash payments to email -*- lexical-binding:t -*-
-;; Copyright (C) 2003-2005, 2007-2022 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2022 Free Software Foundation, Inc.
;; Written by: Paul Foley <mycroft@actrix.gen.nz> (1997-2002)
;; Maintainer: emacs-devel@gnu.org
@@ -57,7 +57,7 @@
"The default number of bits to pay to unknown users.
If this is zero, no payment header will be generated.
See `hashcash-payment-alist'."
- :type 'integer
+ :type 'natnum
:group 'hashcash)
(defcustom hashcash-payment-alist '()
@@ -77,7 +77,7 @@ present, is the string to be hashed; if not present ADDR will be used."
(defcustom hashcash-default-accept-payment 20
"The default minimum number of bits to accept on incoming payments."
- :type 'integer
+ :type 'natnum
:group 'hashcash)
(defcustom hashcash-accept-resources `((,user-mail-address nil))
@@ -95,10 +95,12 @@ If this is not in your PATH, specify an absolute file name."
:type '(choice (const nil) file)
:group 'hashcash)
-(defcustom hashcash-extra-generate-parameters nil
+(defcustom hashcash-extra-generate-parameters '("-Z2")
"A list of parameter strings passed to `hashcash-program' when minting.
-For example, you may want to set this to (\"-Z2\") to reduce header length."
+For example, on very old hardware, you may want to set this
+to (\"-Z0\") to disable compression."
:type '(repeat string)
+ :version "29.1"
:group 'hashcash)
(defcustom hashcash-double-spend-database "hashcash.db"
diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index c87ea2b46e6..25ce4ea9025 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -1,7 +1,6 @@
;;; mail-extr.el --- extract full name and address from email header -*- lexical-binding: t; -*-
-;; Copyright (C) 1991-1994, 1997, 2001-2022 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1991-2022 Free Software Foundation, Inc.
;; Author: Joe Wells <jbw@cs.bu.edu>
;; Maintainer: emacs-devel@gnu.org
@@ -240,8 +239,7 @@ we will act as though we couldn't find a full name in the address."
;; Matches a leading title that is not part of the name (does not
;; contribute to uniquely identifying the person).
(defcustom mail-extr-full-name-prefixes
- (purecopy
- "\\(Prof\\|D[Rr]\\|Mrs?\\|Rev\\|Rabbi\\|SysOp\\|LCDR\\)\\.?[ \t\n]")
+ "\\(Prof\\|D[Rr]\\|Mrs?\\|Rev\\|Rabbi\\|SysOp\\|LCDR\\)\\.?[ \t\n]"
"Matches prefixes to the full name that identify a person's position.
These are stripped from the full name because they do not contribute to
uniquely identifying the person."
@@ -279,45 +277,42 @@ by translating things like \"foo!bar!baz@host\" into \"baz@bar.UUCP\"."
;; Yes, there are weird people with digits in their names.
;; You will also notice the consideration for the
;; Swedish/Finnish/Norwegian character set.
-(defconst mail-extr-all-letters-but-separators
- (purecopy "][[:alnum:]{|}'~`"))
+(defconst mail-extr-all-letters-but-separators "][[:alnum:]{|}'~`")
;; Any character that can occur in a name in an RFC 822 (or later)
;; address including the separator (hyphen and possibly period) for
;; multipart names.
;; #### should . be in here?
(defconst mail-extr-all-letters
- (purecopy (concat mail-extr-all-letters-but-separators "-")))
+ (concat mail-extr-all-letters-but-separators "-"))
;; Any character that can start a name.
;; Keep this set as minimal as possible.
-(defconst mail-extr-first-letters (purecopy "[:alpha:]"))
+(defconst mail-extr-first-letters "[:alpha:]")
;; Any character that can end a name.
;; Keep this set as minimal as possible.
-(defconst mail-extr-last-letters (purecopy "[:alpha:]`'."))
+(defconst mail-extr-last-letters "[:alpha:]`'.")
(defconst mail-extr-leading-garbage "\\W+")
;; (defconst mail-extr-non-begin-name-chars
-;; (purecopy (concat "^" mail-extr-first-letters)))
+;; (concat "^" mail-extr-first-letters))
;; (defconst mail-extr-non-end-name-chars
-;; (purecopy (concat "^" mail-extr-last-letters)))
+;; (concat "^" mail-extr-last-letters))
;; Matches periods used instead of spaces. Must not match the period
;; following an initial.
(defconst mail-extr-bad-dot-pattern
- (purecopy
- (format "\\([%s][%s]\\)\\.+\\([%s]\\)"
- mail-extr-all-letters
- mail-extr-last-letters
- mail-extr-first-letters)))
+ (format "\\([%s][%s]\\)\\.+\\([%s]\\)"
+ mail-extr-all-letters
+ mail-extr-last-letters
+ mail-extr-first-letters))
;; Matches an embedded or leading nickname that should be removed.
;; (defconst mail-extr-nickname-pattern
-;; (purecopy
-;; (format "\\([ .]\\|\\`\\)[\"'`[(]\\([ .%s]+\\)[]\"')] "
-;; mail-extr-all-letters)))
+;; (format "\\([ .]\\|\\`\\)[\"'`[(]\\([ .%s]+\\)[]\"')] "
+;; mail-extr-all-letters))
;; Matches the occurrence of a generational name suffix, and the last
;; character of the preceding name. This is important because we want to
@@ -325,59 +320,56 @@ by translating things like \"foo!bar!baz@host\" into \"baz@bar.UUCP\"."
;; *** Perhaps this should be a user-customizable variable. However, the
;; *** regular expression is fairly tricky to alter, so maybe not.
(defconst mail-extr-full-name-suffix-pattern
- (purecopy
- (format
- "\\(,? ?\\([JjSs][Rr]\\.?\\|V?I+V?\\)\\)\\([^%s]\\([^%s]\\|\\'\\)\\|\\'\\)"
- mail-extr-all-letters mail-extr-all-letters)))
+ (format
+ "\\(,? ?\\([JjSs][Rr]\\.?\\|V?I+V?\\)\\)\\([^%s]\\([^%s]\\|\\'\\)\\|\\'\\)"
+ mail-extr-all-letters mail-extr-all-letters))
-(defconst mail-extr-roman-numeral-pattern (purecopy "V?I+V?\\b"))
+(defconst mail-extr-roman-numeral-pattern "V?I+V?\\b")
;; Matches a trailing uppercase (with other characters possible) acronym.
;; Must not match a trailing uppercase last name or trailing initial
(defconst mail-extr-weird-acronym-pattern
- (purecopy "\\([A-Z]+[-_/]\\|[A-Z][A-Z][A-Z]?\\b\\)"))
+ "\\([A-Z]+[-_/]\\|[A-Z][A-Z][A-Z]?\\b\\)")
;; Matches a mixed-case or lowercase name (not an initial).
;; #### Match Latin1 lower case letters here too?
;; (defconst mail-extr-mixed-case-name-pattern
-;; (purecopy
-;; (format
-;; "\\b\\([a-z][%s]*[%s]\\|[%s][%s]*[a-z][%s]*[%s]\\|[%s][%s]*[a-z]\\)"
-;; mail-extr-all-letters mail-extr-last-letters
-;; mail-extr-first-letters mail-extr-all-letters mail-extr-all-letters
-;; mail-extr-last-letters mail-extr-first-letters mail-extr-all-letters)))
+;; (format
+;; "\\b\\([a-z][%s]*[%s]\\|[%s][%s]*[a-z][%s]*[%s]\\|[%s][%s]*[a-z]\\)"
+;; mail-extr-all-letters mail-extr-last-letters
+;; mail-extr-first-letters mail-extr-all-letters mail-extr-all-letters
+;; mail-extr-last-letters mail-extr-first-letters mail-extr-all-letters))
;; Matches a trailing alternative address.
;; #### Match Latin1 letters here too?
;; #### Match _ before @ here too?
(defconst mail-extr-alternative-address-pattern
- (purecopy "\\(aka *\\)?[a-zA-Z.]+[!@][a-zA-Z.]"))
+ "\\(aka *\\)?[a-zA-Z.]+[!@][a-zA-Z.]")
;; Matches a variety of trailing comments not including comma-delimited
;; comments.
(defconst mail-extr-trailing-comment-start-pattern
- (purecopy " [-{]\\|--\\|[+@#></;]"))
+ " [-{]\\|--\\|[+@#></;]")
;; Matches a name (not an initial).
;; This doesn't force a word boundary at the end because sometimes a
;; comment is separated by a `-' with no preceding space.
(defconst mail-extr-name-pattern
- (purecopy (format "\\b[%s][%s]*[%s]"
- mail-extr-first-letters
- mail-extr-all-letters
- mail-extr-last-letters)))
+ (format "\\b[%s][%s]*[%s]"
+ mail-extr-first-letters
+ mail-extr-all-letters
+ mail-extr-last-letters))
(defconst mail-extr-initial-pattern
- (purecopy (format "\\b[%s]\\([. ]\\|\\b\\)" mail-extr-first-letters)))
+ (format "\\b[%s]\\([. ]\\|\\b\\)" mail-extr-first-letters))
;; Matches a single name before a comma.
;; (defconst mail-extr-last-name-first-pattern
-;; (purecopy (concat "\\`" mail-extr-name-pattern ",")))
+;; (concat "\\`" mail-extr-name-pattern ","))
;; Matches telephone extensions.
(defconst mail-extr-telephone-extension-pattern
- (purecopy
- "\\(\\([Ee]xt\\|[Tt]ph\\|[Tt]el\\|[Xx]\\)\\.?\\)? *\\+?[0-9][- 0-9]+"))
+ "\\(\\([Ee]xt\\|[Tt]ph\\|[Tt]el\\|[Xx]\\)\\.?\\)? *\\+?[0-9][- 0-9]+")
;; Matches ham radio call signs.
;; Help from: Mat Maessen N2NJZ <maessm@rpi.edu>, Mark Feit
@@ -386,7 +378,7 @@ by translating things like \"foo!bar!baz@host\" into \"baz@bar.UUCP\"."
;; KE9TV KF0NV N1API N3FU N3GZE N3IGS N4KCC N7IKQ N9HHU W4YHF W6ANK WA2SUH
;; WB7VZI N2NJZ NR3G KJ4KK AB4UM AL7NI KH6OH WN3KBT N4TMI W1A N0NZO
(defconst mail-extr-ham-call-sign-pattern
- (purecopy "\\b\\(DX[0-9]+\\|[AKNW][A-Z]?[0-9][A-Z][A-Z]?[A-Z]?\\)"))
+ "\\b\\(DX[0-9]+\\|[AKNW][A-Z]?[0-9][A-Z][A-Z]?[A-Z]?\\)")
;; Possible trailing suffixes: "\\(/\\(KT\\|A[AEG]\\|[R0-9]\\)\\)?"
;; /KT == Temporary Technician (has CSC but not "real" license)
@@ -400,31 +392,29 @@ by translating things like \"foo!bar!baz@host\" into \"baz@bar.UUCP\"."
;; Matches normal single-part name
(defconst mail-extr-normal-name-pattern
- (purecopy (format "\\b[%s][%s]+[%s]"
- mail-extr-first-letters
- mail-extr-all-letters-but-separators
- mail-extr-last-letters)))
+ (format "\\b[%s][%s]+[%s]"
+ mail-extr-first-letters
+ mail-extr-all-letters-but-separators
+ mail-extr-last-letters))
;; Matches a single word name.
;; (defconst mail-extr-one-name-pattern
-;; (purecopy (concat "\\`" mail-extr-normal-name-pattern "\\'")))
+;; (concat "\\`" mail-extr-normal-name-pattern "\\'"))
;; Matches normal two names with missing middle initial
;; The first name is not allowed to have a hyphen because this can cause
;; false matches where the "middle initial" is actually the first letter
;; of the second part of the first name.
(defconst mail-extr-two-name-pattern
- (purecopy
- (concat "\\`\\(" mail-extr-normal-name-pattern
- "\\|" mail-extr-initial-pattern
- "\\) +\\(" mail-extr-name-pattern "\\)\\(,\\|\\'\\)")))
+ (concat "\\`\\(" mail-extr-normal-name-pattern
+ "\\|" mail-extr-initial-pattern
+ "\\) +\\(" mail-extr-name-pattern "\\)\\(,\\|\\'\\)"))
(defconst mail-extr-listserv-list-name-pattern
- (purecopy "Multiple recipients of list \\([-A-Z]+\\)"))
+ "Multiple recipients of list \\([-A-Z]+\\)")
(defconst mail-extr-stupid-vms-date-stamp-pattern
- (purecopy
- "[0-9][0-9]-[JFMASOND][aepuco][nbrylgptvc]-[0-9][0-9][0-9][0-9] [0-9]+ *"))
+ "[0-9][0-9]-[JFMASOND][aepuco][nbrylgptvc]-[0-9][0-9][0-9][0-9] [0-9]+ *")
;;; HZ -- GB (PRC Chinese character encoding) in ASCII embedding protocol
;;
@@ -443,25 +433,23 @@ by translating things like \"foo!bar!baz@host\" into \"baz@bar.UUCP\"."
;; mode from GB back to ASCII. (Note that the escape-from-GB code '~}'
;; ($7E7D) is outside the defined GB range.)
(defconst mail-extr-hz-embedded-gb-encoded-chinese-pattern
- (purecopy "~{\\([^~].\\|~[^}]\\)+~}"))
+ "~{\\([^~].\\|~[^}]\\)+~}")
;; The leading optional lowercase letters are for a bastardized version of
;; the encoding, as is the optional nature of the final slash.
(defconst mail-extr-x400-encoded-address-pattern
- (purecopy "[a-z]?[a-z]?\\(/[A-Za-z]+\\(\\.[A-Za-z]+\\)?=[^/]+\\)+/?\\'"))
+ "[a-z]?[a-z]?\\(/[A-Za-z]+\\(\\.[A-Za-z]+\\)?=[^/]+\\)+/?\\'")
(defconst mail-extr-x400-encoded-address-field-pattern-format
- (purecopy "/%s=\\([^/]+\\)\\(/\\|\\'\\)"))
+ "/%s=\\([^/]+\\)\\(/\\|\\'\\)")
(defconst mail-extr-x400-encoded-address-surname-pattern
;; S stands for Surname (family name).
- (purecopy
- (format mail-extr-x400-encoded-address-field-pattern-format "[Ss]")))
+ (format mail-extr-x400-encoded-address-field-pattern-format "[Ss]"))
(defconst mail-extr-x400-encoded-address-given-name-pattern
;; G stands for Given name.
- (purecopy
- (format mail-extr-x400-encoded-address-field-pattern-format "[Gg]")))
+ (format mail-extr-x400-encoded-address-field-pattern-format "[Gg]"))
(defconst mail-extr-x400-encoded-address-full-name-pattern
;; PN stands for Personal Name. When used it represents the combination
@@ -469,8 +457,7 @@ by translating things like \"foo!bar!baz@host\" into \"baz@bar.UUCP\"."
;; "The one system I used having this field asked it with the prompt
;; `Personal Name'. But they mapped it into G and S on outgoing real
;; X.400 addresses. As they mapped G and S into PN on incoming..."
- (purecopy
- (format mail-extr-x400-encoded-address-field-pattern-format "[Pp][Nn]")))
+ (format mail-extr-x400-encoded-address-field-pattern-format "[Pp][Nn]"))
diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el
index e02d4218dd2..a13f9de1740 100644
--- a/lisp/mail/mail-hist.el
+++ b/lisp/mail/mail-hist.el
@@ -80,7 +80,7 @@ previous/next input.")
(defcustom mail-hist-history-size (or kill-ring-max 1729)
"The maximum number of elements in a mail field's history.
Oldest elements are dumped first."
- :type 'integer)
+ :type 'natnum)
;;;###autoload
(defcustom mail-hist-keep-history t
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 952970d07c0..63752f953a7 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -59,7 +59,7 @@ also the To field, unless this would leave an empty To field."
(defun mail-string-delete (string start end)
"Return a string containing all of STRING except the part
from START (inclusive) to END (exclusive)."
- ;; FIXME: This is not used anywhere. Make obsolete?
+ (declare (obsolete substring "29.1"))
(if (null end) (substring string 0 start)
(concat (substring string 0 start)
(substring string end nil))))
@@ -239,12 +239,8 @@ comma-separated list, and return the pruned list."
;; Or just set the default directly in the defcustom.
(if (null mail-dont-reply-to-names)
(setq mail-dont-reply-to-names
- ;; `rmail-default-dont-reply-to-names' is obsolete.
- (let ((a (bound-and-true-p rmail-default-dont-reply-to-names))
- (b (if (> (length user-mail-address) 0)
- (concat "\\`" (regexp-quote user-mail-address) "\\'"))))
- (cond ((and a b) (concat a "\\|" b))
- ((or a b))))))
+ (if (> (length user-mail-address) 0)
+ (concat "\\`" (regexp-quote user-mail-address) "\\'"))))
;; Split up DESTINATIONS and match each element separately.
(let ((start-pos 0) (cur-pos 0)
(case-fold-search t))
@@ -281,9 +277,6 @@ comma-separated list, and return the pruned list."
(substring destinations (match-end 0))
destinations))
-;; Legacy name
-(define-obsolete-function-alias 'rmail-dont-reply-to #'mail-dont-reply-to "24.1")
-
;;;###autoload
(defun mail-fetch-field (field-name &optional last all list delete)
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el
index ba7cf58d383..57fb1117b60 100644
--- a/lisp/mail/mailalias.el
+++ b/lisp/mail/mailalias.el
@@ -72,11 +72,10 @@ When t this still needs to be initialized.")
)
"Alist of header field and expression to return alist for completion.
The expression may reference the variable `pattern'
-which will hold the string being completed.
-If not on matching header, `mail-complete-function' gets called instead."
+which will hold the string being completed."
:type 'alist
+ :risky t
:group 'mailalias)
-(put 'mail-complete-alist 'risky-local-variable t)
;;;###autoload
(defcustom mail-complete-style 'angles
@@ -90,13 +89,6 @@ If `angles', they look like:
:type '(choice (const angles) (const parens) (const nil))
:group 'mailalias)
-(defcustom mail-complete-function 'ispell-complete-word
- "Function to call when completing outside `mail-complete-alist'-header."
- :type '(choice function (const nil))
- :group 'mailalias)
-(make-obsolete-variable 'mail-complete-function
- 'completion-at-point-functions "24.1")
-
(defcustom mail-directory-function nil
"Function to get completions from directory service or nil for none.
See `mail-directory-requery'."
@@ -129,8 +121,8 @@ or like this:
(remote-shell-program \"HOST\" \"-n\" \"COMMAND \\='^\" pattern \"\\='\")"
:type 'sexp
+ :risky t
:group 'mailalias)
-(put 'mail-directory-process 'risky-local-variable t)
(defcustom mail-directory-stream nil
"List of (HOST SERVICE) for stream connection to mail directory."
@@ -140,8 +132,8 @@ or like this:
(string :tag "Service name"))
(plist :inline t
:tag "Additional open-network-stream parameters")))
+ :risky t
:group 'mailalias)
-(put 'mail-directory-stream 'risky-local-variable t)
(defcustom mail-directory-parser nil
"How to interpret the output of `mail-directory-function'.
@@ -151,8 +143,8 @@ Three types of values are possible:
- regexp means first \\(grouping\\) in successive matches is name
- function called at beginning of buffer that returns an alist of names"
:type '(choice (const nil) regexp function)
+ :risky t
:group 'mailalias)
-(put 'mail-directory-parser 'risky-local-variable t)
;; Internal variables.
@@ -433,25 +425,6 @@ For use on `completion-at-point-functions'."
(let ((pattern prefix)) (eval list-exp))))))
(list beg end table)))))
-;;;###autoload
-(defun mail-complete (arg)
- "Perform completion on header field or word preceding point.
-Completable headers are according to `mail-complete-alist'. If none matches
-current header, calls `mail-complete-function' and passes prefix ARG if any."
- (declare (obsolete mail-completion-at-point-function "24.1"))
- (interactive "P")
- ;; Read the defaults first, if we have not done so.
- (sendmail-sync-aliases)
- (if (eq mail-aliases t)
- (progn
- (setq mail-aliases nil)
- (if (file-exists-p mail-personal-alias-file)
- (build-mail-aliases))))
- (let ((data (mail-completion-at-point-function)))
- (if data
- (apply #'completion-in-region data)
- (funcall mail-complete-function arg))))
-
(defun mail-completion-expand (table)
"Build new completion table that expands aliases.
Completes like TABLE except that if the completion is a valid alias,
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index adb61aa09db..71eda7cd2b0 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -315,20 +315,6 @@ Setting this variable has an effect only before reading a mail."
:version "21.1")
;;;###autoload
-(define-obsolete-variable-alias 'rmail-dont-reply-to-names
- 'mail-dont-reply-to-names "24.1")
-
-;; Prior to 24.1, this used to contain "\\`info-".
-;;;###autoload
-(defvar rmail-default-dont-reply-to-names nil
- "Regexp specifying part of the default value of `mail-dont-reply-to-names'.
-This is used when the user does not set `mail-dont-reply-to-names'
-explicitly.")
-;;;###autoload
-(make-obsolete-variable 'rmail-default-dont-reply-to-names
- 'mail-dont-reply-to-names "24.1")
-
-;;;###autoload
(defcustom rmail-ignored-headers
(purecopy
(concat "^via:\\|^mail-from:\\|^origin:\\|^references:\\|^sender:"
@@ -388,7 +374,7 @@ If nil, display all header fields except those matched by
;;;###autoload
(defcustom rmail-retry-ignored-headers (purecopy "^x-authentication-warning:\\|^x-detected-operating-system:\\|^x-spam[-a-z]*:\\|content-type:\\|content-transfer-encoding:\\|mime-version:\\|message-id:")
"Headers that should be stripped when retrying a failed message."
- :type '(choice regexp (const nil :tag "None"))
+ :type '(choice regexp (const :value nil :tag "None"))
:group 'rmail-headers
:version "23.2") ; added x-detected-operating-system, x-spam
@@ -462,8 +448,8 @@ as argument, to ask the user that question."
(const :tag "Confirm with y-or-n-p" y-or-n-p)
(const :tag "Confirm with yes-or-no-p" yes-or-no-p))
:version "21.1"
+ :risky t
:group 'rmail-files)
-(put 'rmail-confirm-expunge 'risky-local-variable t)
;;;###autoload
(defvar rmail-mode-hook nil
@@ -1465,7 +1451,6 @@ If so restore the actual mbox message collection."
(setq-local font-lock-defaults
'(rmail-font-lock-keywords
t t nil nil
- (font-lock-maximum-size . nil)
(font-lock-dont-widen . t)
(font-lock-inhibit-thing-lock . (lazy-lock-mode fast-lock-mode))))
(setq-local require-final-newline nil)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index c55cdc8412a..8cb079f7fbe 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -372,8 +372,8 @@ and should insert whatever you want to insert."
:type '(choice (const :tag "None" nil)
(const :tag "Use `.signature' file" t)
(string :tag "String to insert")
- (sexp :tag "Expression to evaluate")))
-(put 'mail-signature 'risky-local-variable t)
+ (sexp :tag "Expression to evaluate"))
+ :risky t)
;;;###autoload
(defcustom mail-signature-file (purecopy "~/.signature")
@@ -430,20 +430,6 @@ support Delivery Status Notification."
(const :tag "Success" success)))
:version "22.1")
-;; Note: could use /usr/ucb/mail instead of sendmail;
-;; options -t, and -v if not interactive.
-(defvar mail-mailer-swallows-blank-line nil
- "Set this non-nil if the system's mailer runs the header and body together.
-The actual value should be an expression to evaluate that returns
-non-nil if the problem will actually occur.
-\(As far as we know, this is not an issue on any system still supported
-by Emacs.)")
-
-(put 'mail-mailer-swallows-blank-line 'risky-local-variable t) ; gets evalled
-(make-obsolete-variable 'mail-mailer-swallows-blank-line
- "no need to set this on any modern system."
- "24.1" 'set)
-
(defvar mail-mode-syntax-table
;; define-derived-mode will make it inherit from text-mode-syntax-table.
(let ((st (make-syntax-table)))
@@ -1309,8 +1295,6 @@ external program defined by `sendmail-program'."
;; Insert an extra newline if we need it to work around
;; Sun's bug that swallows newlines.
(goto-char (1+ delimline))
- (if (eval mail-mailer-swallows-blank-line)
- (newline))
;; Find and handle any Fcc fields.
(goto-char (point-min))
(if (re-search-forward "^Fcc:" delimline t)
@@ -1495,28 +1479,6 @@ just append to the file, in Babyl format if necessary."
(with-current-buffer buffer
(set-visited-file-modtime)))))))))
-(defun mail-sent-via ()
- "Make a Sent-via header line from each To or Cc header line."
- (declare (obsolete "nobody can remember what it is for." "24.1"))
- (interactive)
- (save-excursion
- ;; put a marker at the end of the header
- (let ((end (copy-marker (mail-header-end)))
- (case-fold-search t))
- (goto-char (point-min))
- ;; search for the To: lines and make Sent-via: lines from them
- ;; search for the next To: line
- (while (re-search-forward "^\\(to\\|cc\\):" end t)
- ;; Grab this line plus all its continuations, sans the `to:'.
- (let ((to-line
- (buffer-substring (point)
- (progn
- (if (re-search-forward "^[^ \t\n]" end t)
- (backward-char 1)
- (goto-char end))
- (point)))))
- ;; Insert a copy, with altered header field name.
- (insert-before-markers "Sent-via:" to-line))))))
(defun mail-to ()
"Move point to end of To field, creating it if necessary."
@@ -1839,8 +1801,6 @@ If the current line has `mail-yank-prefix', insert it on the new line."
(or (bolp) (newline))
(goto-char start))))
-(define-obsolete-function-alias 'mail-attach-file #'mail-insert-file "24.1")
-
(declare-function mml-attach-file "mml"
(file &optional type description disposition))
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 88e55e968c4..fcb072d5d09 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -171,7 +171,7 @@ attempt."
"The number of times smtpmail will retry sending when getting transient errors.
These are errors with a code of 4xx from the SMTP server, which
mean \"try again\"."
- :type 'integer
+ :type 'natnum
:version "27.1")
(defcustom smtpmail-store-queue-variables nil
@@ -342,8 +342,6 @@ for `smtpmail-try-auth-method'.")
;; Insert an extra newline if we need it to work around
;; Sun's bug that swallows newlines.
(goto-char (1+ delimline))
- (if (eval mail-mailer-swallows-blank-line t)
- (newline))
;; Find and handle any Fcc fields.
(goto-char (point-min))
(if (re-search-forward "^Fcc:" delimline t)
@@ -552,7 +550,6 @@ for `smtpmail-try-auth-method'.")
:require (and ask-for-password
'(:user :secret))
:create ask-for-password)))
- (mech (or (plist-get auth-info :smtp-auth) (car mechs)))
(user (plist-get auth-info :user))
(password (auth-info-password auth-info))
(save-function (and ask-for-password
@@ -572,18 +569,26 @@ for `smtpmail-try-auth-method'.")
:require '(:user :secret)
:create t))
password (auth-info-password auth-info)))
- (let ((result (catch 'done
- (if (and mech user password)
- (smtpmail-try-auth-method process mech user password)
- ;; No mechanism, or no credentials.
- mech))))
- (if (stringp result)
- (progn
- (auth-source-forget+ :host host :port port)
- (throw 'done result))
- (when save-function
- (funcall save-function))
- result))))
+ (let ((mechs (or (ensure-list (plist-get auth-info :smtp-auth))
+ mechs))
+ (result ""))
+ (when (and mechs user password)
+ (while (and mechs
+ (stringp result))
+ (setq result (catch 'done
+ (smtpmail-try-auth-method
+ process (pop mechs) user password))))
+ ;; A string result is an error.
+ (if (stringp result)
+ (progn
+ ;; All methods failed.
+ ;; Forget the credentials.
+ (auth-source-forget+ :host host :port port)
+ (throw 'done result))
+ ;; Success.
+ (when save-function
+ (funcall save-function))
+ result)))))
(cl-defgeneric smtpmail-try-auth-method (_process mech _user _password)
"Perform authentication of type MECH for USER with PASSWORD.
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index 5dc5ee38ffd..f320246f2de 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -146,8 +146,8 @@ a variable whose value is a citation frame."
:type '(repeat (list symbol (repeat (cons regexp
(choice (repeat (repeat sexp))
symbol)))))
+ :risky t
:group 'supercite-frames)
-(put 'sc-cite-frame-alist 'risky-local-variable t)
(defcustom sc-uncite-frame-alist '()
"Alist for frame selection during unciting.
@@ -155,8 +155,8 @@ See the variable `sc-cite-frame-alist' for details."
:type '(repeat (list symbol (repeat (cons regexp
(choice (repeat (repeat sexp))
symbol)))))
+ :risky t
:group 'supercite-frames)
-(put 'sc-uncite-frame-alist 'risky-local-variable t)
(defcustom sc-recite-frame-alist '()
"Alist for frame selection during reciting.
@@ -164,8 +164,8 @@ See the variable `sc-cite-frame-alist' for details."
:type '(repeat (list symbol (repeat (cons regexp
(choice (repeat (repeat sexp))
symbol)))))
+ :risky t
:group 'supercite-frames)
-(put 'sc-recite-frame-alist 'risky-local-variable t)
(defcustom sc-default-cite-frame
'(;; initialize fill state and temporary variables when entering
@@ -211,8 +211,8 @@ See the variable `sc-cite-frame-alist' for details."
(end (sc-fill-if-different "")))
"Default REGI frame for citing a region."
:type '(repeat (repeat sexp))
+ :risky t
:group 'supercite-frames)
-(put 'sc-default-cite-frame 'risky-local-variable t)
(defcustom sc-default-uncite-frame
'(;; do nothing on a blank line
@@ -221,8 +221,8 @@ See the variable `sc-cite-frame-alist' for details."
((sc-cite-regexp) (sc-uncite-line)))
"Default REGI frame for unciting a region."
:type '(repeat (repeat sexp))
+ :risky t
:group 'supercite-frames)
-(put 'sc-default-uncite-frame 'risky-local-variable t)
(defcustom sc-default-recite-frame
'(;; initialize fill state when entering frame
@@ -237,8 +237,8 @@ See the variable `sc-cite-frame-alist' for details."
(end (sc-fill-if-different "")))
"Default REGI frame for reciting a region."
:type '(repeat (repeat sexp))
+ :risky t
:group 'supercite-frames)
-(put 'sc-default-recite-frame 'risky-local-variable t)
(defcustom sc-cite-region-limit t
"This variable controls automatic citation of yanked text.
@@ -428,8 +428,8 @@ to be consulted during attribution selection."
(repeat (cons regexp
(choice (sexp :tag "List to eval")
string)))))
+ :risky t
:group 'supercite-attr)
-(put 'sc-attrib-selection-list 'risky-local-variable t)
(defcustom sc-attribs-preselect-hook nil
"Hook to run before selecting an attribution."
@@ -483,8 +483,8 @@ The variable `sc-preferred-header-style' controls which function in
this list is chosen for automatic reference header insertions.
Electric reference mode will cycle through this list of functions."
:type '(repeat sexp)
+ :risky t
:group 'supercite)
-(put 'sc-rewrite-header-list 'risky-local-variable t)
(defcustom sc-titlecue-regexp "\\s +-+\\s +"
"Regular expression describing the separator between names and titles.
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el
index c6d29bc4e77..cdb1bec4788 100644
--- a/lisp/mail/undigest.el
+++ b/lisp/mail/undigest.el
@@ -378,8 +378,4 @@ forwarded with `rmail-enable-mime-composing' set to nil."
(provide 'undigest)
-;; Local Variables:
-;; generated-autoload-file: "rmail-loaddefs.el"
-;; End:
-
;;; undigest.el ends here
diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el
index 8ce5afa9622..9e7194e4a02 100644
--- a/lisp/mail/unrmail.el
+++ b/lisp/mail/unrmail.el
@@ -208,7 +208,7 @@ The variable `unrmail-mbox-format' controls which mbox format to use."
(setq mail-from (or (let ((from (mail-fetch-field "Mail-From")))
;; mail-mbox-from (below) returns a
;; string that ends in a newline, but
- ;; but mail-fetch-field does not, so
+ ;; mail-fetch-field does not, so
;; we append a newline here.
(if from
(format "%s\n" from)))
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 92989fcfb2e..12a0b4d328f 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -584,9 +584,6 @@
menu))
-(define-obsolete-function-alias
- 'menu-bar-kill-ring-save 'kill-ring-save "24.1")
-
;; These are alternative definitions for the cut, paste and copy
;; menu items. Use them if your system expects these to use the clipboard.
@@ -2194,12 +2191,12 @@ otherwise it could decide to silently do nothing."
(defcustom yank-menu-length 20
"Text of items in `yank-menu' longer than this will be truncated."
- :type 'integer
+ :type 'natnum
:group 'menu)
(defcustom yank-menu-max-items 60
"Maximum number of entries to display in the `yank-menu'."
- :type 'integer
+ :type 'natnum
:group 'menu
:version "29.1")
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index ef0a76b9a49..f011ea47f80 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -95,9 +95,9 @@ RANGE is read in interactive use."
Remove all of the messages (files) within the current folder, and
then remove the folder (directory) itself.
-Run the abnormal hook `mh-kill-folder-suppress-prompt-hooks'. The
-hook functions are called with no arguments and should return a
-non-nil value to suppress the normal prompt when you remove a
+Run the abnormal hook `mh-kill-folder-suppress-prompt-functions'.
+The hook functions are called with no arguments and should return
+a non-nil value to suppress the normal prompt when you remove a
folder. This is useful for folders that are easily regenerated."
(interactive)
(if (or (run-hook-with-args-until-success
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index d2e07977e5d..b93f7d8c412 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -1141,15 +1141,7 @@ this ;-)"
"Check if show buffer is small.
This is used to decide if smileys and graphical emphasis should be
displayed."
- (let ((max nil))
- ;; FIXME: font-lock-maximum-size is obsolete.
- (when (and (boundp 'font-lock-maximum-size) font-lock-maximum-size)
- (cond ((numberp font-lock-maximum-size)
- (setq max font-lock-maximum-size))
- ((listp font-lock-maximum-size)
- (setq max (cdr (or (assoc 'mh-show-mode font-lock-maximum-size)
- (assoc t font-lock-maximum-size)))))))
- (or (not (numberp max)) (>= (/ max 8) (buffer-size)))))
+ (>= 64000 (buffer-size)))
diff --git a/lisp/midnight.el b/lisp/midnight.el
index 3e309a5c881..60d9b565ef0 100644
--- a/lisp/midnight.el
+++ b/lisp/midnight.el
@@ -67,14 +67,14 @@ The autokilling is done by `clean-buffer-list' when it is in `midnight-hook'.
Currently displayed and/or modified (unsaved) buffers, as well as buffers
matching `clean-buffer-list-kill-never-buffer-names' and
`clean-buffer-list-kill-never-regexps' are excluded."
- :type 'integer)
+ :type 'natnum)
(defcustom clean-buffer-list-delay-special 3600
"The number of seconds before some buffers become eligible for autokilling.
Buffers matched by `clean-buffer-list-kill-regexps' and
`clean-buffer-list-kill-buffer-names' are killed if they were last
displayed more than this many seconds ago."
- :type 'integer)
+ :type 'natnum)
(defcustom clean-buffer-list-kill-regexps '("\\`\\*Man ")
"List of regexps saying which buffers will be killed at midnight.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 9ffaff7c8e2..9d2abbd1180 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2135,7 +2135,7 @@ and with BASE-SIZE appended as the last element."
(lambda (elem)
(let ((str
;; Don't modify the string itself, but a copy, since the
- ;; the string may be read-only or used for other purposes.
+ ;; string may be read-only or used for other purposes.
;; Furthermore, since `completions' may come from
;; display-completion-list, `elem' may be a list.
(if (consp elem)
@@ -2225,25 +2225,6 @@ These include:
`exact' - text is a valid completion but may be further
completed.")
-(defvar completion-annotate-function
- nil
- ;; Note: there's a lot of scope as for when to add annotations and
- ;; what annotations to add. E.g. completing-help.el allowed adding
- ;; the first line of docstrings to M-x completion. But there's
- ;; a tension, since such annotations, while useful at times, can
- ;; actually drown the useful information.
- ;; So completion-annotate-function should be used parsimoniously, or
- ;; else only used upon a user's request (e.g. we could add a command
- ;; to completion-list-mode to add annotations to the current
- ;; completions).
- "Function to add annotations in the *Completions* buffer.
-The function takes a completion and should either return nil, or a string that
-will be displayed next to the completion. The function can access the
-completion table and predicates via `minibuffer-completion-table' and related
-variables.")
-(make-obsolete-variable 'completion-annotate-function
- 'completion-extra-properties "24.1")
-
(defun completion--done (string &optional finished message)
(let* ((exit-fun (plist-get completion-extra-properties :exit-function))
(pre-msg (and exit-fun (current-message))))
@@ -2314,8 +2295,7 @@ variables.")
minibuffer-completion-predicate))
(ann-fun (or (completion-metadata-get all-md 'annotation-function)
(plist-get completion-extra-properties
- :annotation-function)
- completion-annotate-function))
+ :annotation-function)))
(aff-fun (or (completion-metadata-get all-md 'affixation-function)
(plist-get completion-extra-properties
:affixation-function)))
@@ -2790,9 +2770,6 @@ Gets combined either with `minibuffer-local-completion-map' or
with `minibuffer-local-must-match-map'."
"SPC" nil)
-(defvar minibuffer-local-filename-must-match-map (make-sparse-keymap))
-(make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1")
-
(defvar-keymap minibuffer-local-ns-map
:doc "Local keymap for the minibuffer when spaces are not allowed."
:parent minibuffer-local-map
@@ -3091,7 +3068,8 @@ such as making the current buffer visit no file in the case of
:type 'boolean)
(defcustom minibuffer-beginning-of-buffer-movement nil
- "Control how the `M-<' command in the minibuffer behaves.
+ "Control how the \\<minibuffer-local-map>\\[minibuffer-beginning-of-buffer] \
+command in the minibuffer behaves.
If non-nil, the command will go to the end of the prompt (if
point is after the end of the prompt). If nil, it will behave
like the `beginning-of-buffer' command."
@@ -3160,8 +3138,9 @@ Fourth arg MUSTMATCH can take the following values:
input, but she needs to confirm her choice if she called
`minibuffer-complete' right before `minibuffer-complete-and-exit'
and the input is not an existing file.
-- a function, which will be called with the input as the argument.
- If it returns a non-nil value, the minibuffer is exited with that value.
+- a function, which will be called with the input as the
+ argument. If the function returns a non-nil value, the
+ minibuffer is exited with that argument as the value.
- anything else behaves like t except that typing RET does not exit if it
does non-null completion.
diff --git a/lisp/misc.el b/lisp/misc.el
index 8a01b51c6d3..28c5d6e07f5 100644
--- a/lisp/misc.el
+++ b/lisp/misc.el
@@ -151,7 +151,7 @@ ripples outward, changing the flow of the eddy currents in the
upper atmosphere. These cause momentary pockets of higher-pressure
air to form, which act as lenses that deflect incoming cosmic rays,
focusing them to strike the drive platter and flip the desired bit.
-You can type `M-x butterfly C-M-c' to run it. This is a permuted
+You can type \\`M-x butterfly C-M-c' to run it. This is a permuted
variation of `C-x M-c M-butterfly' from url `https://xkcd.com/378/'."
(interactive)
(if (yes-or-no-p "Do you really want to unleash the powers of the butterfly? ")
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 98e49c3598f..ddcb51aecf2 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1200,7 +1200,7 @@ frame with the mouse."
(<= (- right parent-right) snap-width)
snap-x (<= (- last-x snap-x) snap-width))
;; Stay snapped when the mouse moved rightward but
- ;; not more more than `snap-width' pixels from the
+ ;; not more than `snap-width' pixels from the
;; time FRAME snapped.
(setq left (- parent-right native-width)))
(t
@@ -1222,7 +1222,7 @@ frame with the mouse."
(<= (- parent-top top) snap-width)
snap-y (<= (- snap-y last-y) snap-width))
;; Stay snapped when the mouse moved upward but
- ;; not more more than `snap-width' pixels from the
+ ;; not more than `snap-width' pixels from the
;; time FRAME snapped.
(setq top parent-top))
(t
@@ -1244,7 +1244,7 @@ frame with the mouse."
(<= (- bottom parent-bottom) snap-width)
snap-y (<= (- last-y snap-y) snap-width))
;; Stay snapped when the mouse moved downward but
- ;; not more more than `snap-width' pixels from the
+ ;; not more than `snap-width' pixels from the
;; time FRAME snapped.
(setq top (- parent-bottom native-height)))
(t
diff --git a/lisp/msb.el b/lisp/msb.el
index 6e1d03ac277..6843df2edcf 100644
--- a/lisp/msb.el
+++ b/lisp/msb.el
@@ -103,7 +103,7 @@
((eq major-mode 'Man-mode)
4090
"Manuals (%d)")
- ((eq major-mode 'w3-mode)
+ ((eq major-mode 'eww-mode)
4020
"WWW (%d)")
((or (memq major-mode
@@ -154,7 +154,7 @@
((eq major-mode 'Man-mode)
5030
"Manuals (%d)")
- ((eq major-mode 'w3-mode)
+ ((eq major-mode 'eww-mode)
5020
"WWW (%d)")
((or (memq major-mode
@@ -299,7 +299,7 @@ If the value is not a number, then the value 10 is used."
(defcustom msb-display-most-recently-used 15
"How many buffers should be in the most-recently-used menu.
No buffers at all if less than 1 or nil (or any non-number)."
- :type 'integer
+ :type 'natnum
:set #'msb-custom-set)
(defcustom msb-most-recently-used-title "Most recently used (%d)"
@@ -353,9 +353,6 @@ This is instead of the groups in `msb-menu-cond'."
:type 'boolean
:set #'msb-custom-set)
-(define-obsolete-variable-alias 'msb-after-load-hooks
- 'msb-after-load-hook "24.1")
-
(defcustom msb-after-load-hook nil
"Hook run after the msb package has been loaded."
:type 'hook
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 9a92d42cc00..ba5255fc076 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -41,6 +41,7 @@
(require 'timer)
(defvar mouse-wheel-mode)
+
(defvar mouse-wheel--installed-bindings-alist nil
"Alist of all installed mouse wheel key bindings.")
@@ -113,7 +114,10 @@ set to the event sent when clicking on the mouse wheel button."
:type 'number)
(defcustom mouse-wheel-scroll-amount
- '(1 ((shift) . hscroll) ((meta) . nil) ((control) . text-scale))
+ '(1 ((shift) . hscroll)
+ ((meta) . nil)
+ ((control meta) . global-text-scale)
+ ((control) . text-scale))
"Amount to scroll windows by when spinning the mouse wheel.
This is an alist mapping the modifier key to the amount to scroll when
the wheel is moved with the modifier key depressed.
@@ -128,10 +132,11 @@ less than a full screen.
If AMOUNT is the symbol `hscroll', this means that with MODIFIER,
the mouse wheel will scroll horizontally instead of vertically.
-If AMOUNT is the symbol `text-scale', this means that with
-MODIFIER, the mouse wheel will change the font size instead of
-scrolling (by adjusting the font height of the default face).
-For more information, see `text-scale-adjust'."
+If AMOUNT is the symbol `text-scale' or `global-text-scale', this
+means that with MODIFIER, the mouse wheel will change the font size
+instead of scrolling (by adjusting the font height of the default
+face, either locally in the buffer or globally). For more
+information, see `text-scale-adjust' and `global-text-scale-adjust'."
:group 'mouse
:type '(cons
(choice :tag "Normal"
@@ -156,7 +161,8 @@ For more information, see `text-scale-adjust'."
(integer :tag "Scroll specific # of lines")
(float :tag "Scroll fraction of window")
(const :tag "Scroll horizontally" :value hscroll)
- (const :tag "Change face size" :value text-scale)))))
+ (const :tag "Change buffer face size" :value text-scale)
+ (const :tag "Change global face size" :value global-text-scale)))))
:set 'mouse-wheel-change-button
:version "28.1")
@@ -435,6 +441,20 @@ See also `text-scale-adjust'."
(text-scale-decrease 1)))
(select-window selected-window))))
+(declare-function global-text-scale-adjust "face-remap.el" (increment))
+(defun mouse-wheel-global-text-scale (event)
+ "Increase or decrease the global font size according to the EVENT.
+This invokes `global-text-scale-adjust', which see."
+ (interactive (list last-input-event))
+ (let ((button (mwheel-event-button event)))
+ (unwind-protect
+ (cond ((memq button (list mouse-wheel-down-event
+ mouse-wheel-down-alternate-event))
+ (global-text-scale-adjust 1))
+ ((memq button (list mouse-wheel-up-event
+ mouse-wheel-up-alternate-event))
+ (global-text-scale-adjust -1))))))
+
(defun mouse-wheel--add-binding (key fun)
"Bind mouse wheel button KEY to function FUN.
Save it for later removal by `mouse-wheel--remove-bindings'."
@@ -487,8 +507,15 @@ an event used for scrolling, such as `mouse-wheel-down-event'."
mouse-wheel-down-alternate-event
mouse-wheel-up-alternate-event))
(when event
- (mouse-wheel--add-binding `[,(list (caar binding) event)]
+ (mouse-wheel--add-binding `[,(append (car binding) (list event))]
'mouse-wheel-text-scale))))
+ ((and (consp binding) (eq (cdr binding) 'global-text-scale))
+ (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event
+ mouse-wheel-down-alternate-event
+ mouse-wheel-up-alternate-event))
+ (when event
+ (mouse-wheel--add-binding `[,(append (car binding) (list event))]
+ 'mouse-wheel-global-text-scale))))
;; Bindings for scrolling.
(t
(dolist (event (list mouse-wheel-down-event mouse-wheel-up-event
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 9937c022d9f..8355ca4838e 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -1,7 +1,6 @@
;;; ange-ftp.el --- transparent FTP support for GNU Emacs -*- lexical-binding:t -*-
-;; Copyright (C) 1989-1996, 1998, 2000-2022 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1989-2022 Free Software Foundation, Inc.
;; Author: Andy Norman (ange@hplb.hpl.hp.com)
;; Maintainer: emacs-devel@gnu.org
@@ -870,13 +869,10 @@ Both telnet and rlogin do something like this."
(defcustom ange-ftp-gateway-program remote-shell-program
"Name of program to spawn a shell on the gateway machine.
-Valid candidates are rsh (remsh on some systems), telnet and rlogin.
See also the gateway variable above."
:group 'ange-ftp
- :type '(choice (const "rsh")
- (const "telnet")
- (const "rlogin")
- string))
+ :type 'string
+ :version "29.1")
(defcustom ange-ftp-gateway-prompt-pattern "^[^#$%>;\n]*[#$%>;] *"
"Regexp matching prompt after complete login sequence on gateway machine.
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 1cfe90895fe..a55aec76bfc 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -1,4 +1,4 @@
-;;; browse-url.el --- pass a URL to a WWW browser -*- lexical-binding: t; -*-
+;;; browse-url.el --- pass a URL to a web browser -*- lexical-binding: t; -*-
;; Copyright (C) 1995-2022 Free Software Foundation, Inc.
@@ -24,24 +24,28 @@
;;; Commentary:
-;; This package provides functions which read a URL (Uniform Resource
-;; Locator) from the minibuffer, defaulting to the URL around point,
-;; and ask a World-Wide Web browser to load it. It can also load the
-;; URL associated with the current buffer. Different browsers use
-;; different methods of remote control so there is one function for
-;; each supported browser. If the chosen browser is not running, it
-;; is started. Currently there is support for the following browsers,
-;; as well as some other obsolete ones:
+;; This package provides functions which read a URL from the
+;; minibuffer, defaulting to the URL around point, and ask a web
+;; browser to load it. It can also load the URL at point, or one
+;; associated with the current buffer. The main functions are:
+
+;; `browse-url' Open URL
+;; `browse-url-at-point' Open URL at point
+;; `browse-url-of-buffer' Use web browser to display buffer
+;; `browse-url-of-file' Use web browser to display file
+
+;; Different browsers use different methods of remote control so there
+;; is one function for each supported browser. If the chosen browser
+;; is not running, it is started. Currently there is support for the
+;; following browsers, as well as some other obsolete ones:
;; Function Browser Earliest version
-;; browse-url-mozilla Mozilla Don't know
;; browse-url-firefox Firefox Don't know (tried with 1.0.1)
;; browse-url-chrome Chrome 47.0.2526.111
;; browse-url-chromium Chromium 3.0
;; browse-url-epiphany GNOME Web (Epiphany) Don't know
;; browse-url-webpositive WebPositive 1.2-alpha (Haiku R1/beta3)
-;; browse-url-w3 w3 0
-;; browse-url-text-* Any text browser 0
+;; browse-url-text-* Any text browser 0
;; browse-url-generic arbitrary
;; browse-url-default-windows-browser MS-Windows browser
;; browse-url-default-macosx-browser macOS browser
@@ -50,14 +54,12 @@
;; browse-url-elinks Elinks Don't know (tried with 0.12.GIT)
;; eww-browse-url Emacs Web Wowser
-;; Browsers can cache Web pages so it may be necessary to tell them to
+;; Browsers can cache web pages so it may be necessary to tell them to
;; reload the current page if it has changed (e.g., if you have edited
;; it). There is currently no perfect automatic solution to this.
-;; This package generalizes function html-previewer-process in Marc
-;; Andreessen's html-mode (LCD modes/html-mode.el.Z). See also the
-;; ffap.el package. The huge hyperbole package also contains similar
-;; functions.
+;; See also the ffap.el package. The huge hyperbole package also
+;; contains similar functions.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Usage
@@ -83,14 +85,14 @@
;; M-x browse-url-of-dired-file RET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Customization (~/.emacs)
+;; Customization (Init File)
;; To see what variables are available for customization, type
;; `M-x set-variable browse-url TAB'. Better, use
;; `M-x customize-group browse-url'.
-;; Bind the browse-url commands to keys with the `C-c C-z' prefix
-;; (as used by html-helper-mode):
+;; Bind the browse-url commands to keys with the `C-c C-z' prefix:
+
;; (keymap-global-set "C-c C-z ." 'browse-url-at-point)
;; (keymap-global-set "C-c C-z b" 'browse-url-of-buffer)
;; (keymap-global-set "C-c C-z r" 'browse-url-of-region)
@@ -108,9 +110,9 @@
;; Gnus provides a standard feature to activate URLs in article
;; buffers for invocation of browse-url.
-;; Use the Emacs w3 browser when not running under X11:
+;; Use the Emacs Web Wowser (EWW) when not running under X11:
;; (or (eq window-system 'x)
-;; (setq browse-url-browser-function 'browse-url-w3))
+;; (setq browse-url-browser-function #'eww-browse-url))
;; To always save modified buffers before displaying the file in a browser:
;; (setq browse-url-save-file t)
@@ -149,15 +151,14 @@
:group 'comm)
(defvar browse-url--browser-defcustom-type
- '(choice
- (function-item :tag "Emacs W3" :value browse-url-w3)
- (function-item :tag "eww" :value eww-browse-url)
- (function-item :tag "Mozilla" :value browse-url-mozilla)
+ `(choice
+ (function-item :tag "Emacs Web Wowser (EWW)" :value eww-browse-url)
(function-item :tag "Firefox" :value browse-url-firefox)
(function-item :tag "Google Chrome" :value browse-url-chrome)
(function-item :tag "Chromium" :value browse-url-chromium)
(function-item :tag "GNOME Web (Epiphany)" :value browse-url-epiphany)
- (function-item :tag "WebPositive" :value browse-url-webpositive)
+ ,@(when (eq system-type 'haiku)
+ (list '(function-item :tag "WebPositive" :value browse-url-webpositive)))
(function-item :tag "Text browser in an xterm window"
:value browse-url-text-xterm)
(function-item :tag "Text browser in an Emacs window"
@@ -165,11 +166,13 @@
(function-item :tag "KDE" :value browse-url-kde)
(function-item :tag "Elinks" :value browse-url-elinks)
(function-item :tag "Specified by `Browse Url Generic Program'"
- :value browse-url-generic)
- (function-item :tag "Default Windows browser"
- :value browse-url-default-windows-browser)
- (function-item :tag "Default macOS browser"
- :value browse-url-default-macosx-browser)
+ :value browse-url-generic)
+ ,@(when (eq system-type 'windows-nt)
+ (list '(function-item :tag "Default Windows browser"
+ :value browse-url-default-windows-browser)))
+ ,@(when (eq system-type 'darwin)
+ (list '(function-item :tag "Default macOS browser"
+ :value browse-url-default-macosx-browser)))
(function-item :tag "Default browser"
:value browse-url-default-browser)
(function :tag "Your own function")
@@ -247,16 +250,19 @@ be used instead."
(defcustom browse-url-mozilla-program "mozilla"
"The name by which to invoke Mozilla."
:type 'string)
+(make-obsolete-variable 'browse-url-mozilla-program nil "29.1")
(defcustom browse-url-mozilla-arguments nil
"A list of strings to pass to Mozilla as arguments."
:type '(repeat (string :tag "Argument")))
+(make-obsolete-variable 'browse-url-mozilla-arguments nil "29.1")
(defcustom browse-url-mozilla-startup-arguments browse-url-mozilla-arguments
"A list of strings to pass to Mozilla when it starts up.
Defaults to the value of `browse-url-mozilla-arguments' at the time
`browse-url' is loaded."
:type '(repeat (string :tag "Argument")))
+(make-obsolete-variable 'browse-url-mozilla-startup-arguments nil "29.1")
(defun browse-url--find-executable (candidates default)
(while (and candidates (not (executable-find (car candidates))))
@@ -340,6 +346,7 @@ Defaults to the value of `browse-url-epiphany-arguments' at the time
If non-nil, then open the URL in a new tab rather than a new window if
`browse-url-mozilla' is asked to open it in a new window."
:type 'boolean)
+(make-obsolete-variable 'browse-url-mozilla-new-window-is-tab nil "29.1")
(defcustom browse-url-firefox-new-window-is-tab nil
"Whether to open up new windows in a tab or a new window.
@@ -404,7 +411,7 @@ address to an HTTP URL:
(setq browse-url-filename-alist
\\='((\"/webmaster@webserver:/home/www/html/\" .
- \"http://www.acme.co.uk/\")
+ \"https://www.example.org/\")
(\"^/\\(ftp@\\|anonymous@\\)?\\([^:/]+\\):/*\" . \"ftp://\\2/\")
(\"^/\\([^:@/]+@\\)?\\([^:/]+\\):/*\" . \"ftp://\\1\\2/\")
(\"^/+\" . \"file:/\")))"
@@ -437,11 +444,13 @@ These might set its size, for instance."
(defcustom browse-url-gnudoit-program "gnudoit"
"The name of the `gnudoit' program used by `browse-url-w3-gnudoit'."
:type 'string)
+(make-obsolete-variable 'browse-url-gnudoit-program nil "29.1")
(defcustom browse-url-gnudoit-args '("-q")
"A list of strings defining options for `browse-url-gnudoit-program'.
These might set the port, for instance."
:type '(repeat (string :tag "Argument")))
+(make-obsolete-variable 'browse-url-gnudoit-args nil "29.1")
(defcustom browse-url-generic-program nil
"The name of the browser program used by `browse-url-generic'."
@@ -643,11 +652,24 @@ regarding its parameter treatment."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; URL input
+(defcustom browse-url-default-scheme "http"
+ "URL scheme that `browse-url' (and related commands) will use by default.
+
+For example, when point is on an URL fragment like
+\"www.example.org\", `browse-url' will assume that this is an
+\"http\" URL by default (i.e. \"http://www.example.org\").
+
+Note that if you set this to \"https\", websites that do not yet
+support HTTPS may not load correctly in your web browser. Such
+websites are increasingly rare, but they do still exist."
+ :type 'string
+ :version "29.1")
+
(defun browse-url-url-at-point ()
(or (thing-at-point 'url t)
;; assume that the user is pointing at something like gnu.org/gnu
(let ((f (thing-at-point 'filename t)))
- (and f (concat "http://" f)))))
+ (and f (concat browse-url-default-scheme "://" f)))))
;; Having this as a separate function called by the browser-specific
;; functions allows them to be stand-alone commands, making it easier
@@ -1024,20 +1046,17 @@ instead of `browse-url-new-window-flag'."
'browse-url-default-haiku-browser)
((browse-url-can-use-xdg-open) 'browse-url-xdg-open)
;;; ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
- ((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
((executable-find browse-url-firefox-program) 'browse-url-firefox)
((executable-find browse-url-chromium-program) 'browse-url-chromium)
((executable-find browse-url-kde-program) 'browse-url-kde)
((executable-find browse-url-chrome-program) 'browse-url-chrome)
((executable-find browse-url-webpositive-program) 'browse-url-webpositive)
((executable-find browse-url-xterm-program) 'browse-url-text-xterm)
- ((locate-library "w3") 'browse-url-w3)
- (t
- (lambda (&rest _ignore) (error "No usable browser found"))))
+ (t #'eww-browse-url))
url args))
(function-put 'browse-url-default-browser 'browse-url-browser-kind
- ;; Well, most probably external if we ignore w3.
+ ;; Well, most probably external if we ignore EWW.
'external)
(defun browse-url-can-use-xdg-open ()
@@ -1078,6 +1097,7 @@ new tab in an existing window instead.
When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-flag'."
+ (declare (obsolete nil "29.1"))
(interactive (browse-url-interactive-arg "URL: "))
(setq url (browse-url-encode-url url))
(let* ((process-environment (browse-url-process-environment))
@@ -1104,6 +1124,7 @@ used instead of `browse-url-new-window-flag'."
(defun browse-url-mozilla-sentinel (process url)
"Handle a change to the process communicating with Mozilla."
+ (declare (obsolete nil "29.1"))
(or (eq (process-exit-status process) 0)
(let* ((process-environment (browse-url-process-environment)))
;; Mozilla is not running - start it
@@ -1365,6 +1386,7 @@ prefix argument reverses the effect of `browse-url-new-window-flag'.
When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-flag'."
+ (declare (obsolete nil "29.1"))
(interactive (browse-url-interactive-arg "W3 URL: "))
(require 'w3) ; w3-fetch-other-window not autoloaded
(if (browse-url-maybe-new-window new-window)
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index e0824f39716..31cc5035a3e 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -89,7 +89,7 @@ You can specify here:
This port is probably always 2628 so there should be no need to modify it."
:group 'dictionary
:set #'dictionary-set-server-var
- :type 'number
+ :type 'natnum
:version "28.1")
(defcustom dictionary-identification
@@ -206,7 +206,7 @@ where the current word was found."
"The port of the proxy server, used only when `dictionary-use-http-proxy' is set."
:group 'dictionary-proxy
:set #'dictionary-set-server-var
- :type 'number
+ :type 'natnum
:version "28.1")
(defcustom dictionary-use-single-buffer
@@ -326,26 +326,22 @@ is utf-8"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Global variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar dictionary-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (set-keymap-parent map button-buffer-map)
-
- (define-key map "q" #'dictionary-close)
- (define-key map "h" #'dictionary-help)
- (define-key map "s" #'dictionary-search)
- (define-key map "d" #'dictionary-lookup-definition)
- (define-key map "D" #'dictionary-select-dictionary)
- (define-key map "M" #'dictionary-select-strategy)
- (define-key map "m" #'dictionary-match-words)
- (define-key map "l" #'dictionary-previous)
- (define-key map "n" #'forward-button)
- (define-key map "p" #'backward-button)
- (define-key map " " #'scroll-up-command)
- (define-key map [?\S-\ ] #'scroll-down-command)
- (define-key map (read-kbd-macro "M-SPC") #'scroll-down-command)
- map)
- "Keymap for the dictionary mode.")
+(defvar-keymap dictionary-mode-map
+ :doc "Keymap for the dictionary mode."
+ :suppress t :parent button-buffer-map
+ "q" #'dictionary-close
+ "h" #'dictionary-help
+ "s" #'dictionary-search
+ "d" #'dictionary-lookup-definition
+ "D" #'dictionary-select-dictionary
+ "M" #'dictionary-select-strategy
+ "m" #'dictionary-match-words
+ "l" #'dictionary-previous
+ "n" #'forward-button
+ "p" #'backward-button
+ "SPC" #'scroll-up-command
+ "S-SPC" #'scroll-down-command
+ "M-SPC" #'scroll-down-command)
(defvar dictionary-connection
nil
@@ -759,31 +755,31 @@ of matching words."
(progn
(insert-button "[Back]" :type 'dictionary-button
'callback 'dictionary-restore-state
- 'help-echo (purecopy "Mouse-2 to go backwards in history"))
+ 'help-echo "Mouse-2 to go backwards in history")
(insert " ")
(insert-button "[Search definition]" :type 'dictionary-button
'callback 'dictionary-search
- 'help-echo (purecopy "Mouse-2 to look up a new word"))
+ 'help-echo "Mouse-2 to look up a new word")
(insert " ")
(insert-button "[Matching words]" :type 'dictionary-button
'callback 'dictionary-match-words
- 'help-echo (purecopy "Mouse-2 to find matches for a pattern"))
+ 'help-echo "Mouse-2 to find matches for a pattern")
(insert " ")
(insert-button "[Quit]" :type 'dictionary-button
'callback 'dictionary-close
- 'help-echo (purecopy "Mouse-2 to close this window"))
+ 'help-echo "Mouse-2 to close this window")
(insert "\n ")
(insert-button "[Select dictionary]" :type 'dictionary-button
'callback 'dictionary-select-dictionary
- 'help-echo (purecopy "Mouse-2 to select dictionary for future searches"))
+ 'help-echo "Mouse-2 to select dictionary for future searches")
(insert " ")
(insert-button "[Select match strategy]" :type 'dictionary-button
'callback 'dictionary-select-strategy
- 'help-echo (purecopy "Mouse-2 to select matching algorithm"))
+ 'help-echo "Mouse-2 to select matching algorithm")
(insert "\n\n")))
(setq dictionary-marker (point-marker)))
@@ -932,13 +928,13 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
(insert-button (concat dictionary ": " translated) :type 'dictionary-link
'callback 'dictionary-set-dictionary
'data (cons dictionary description)
- 'help-echo (purecopy "Mouse-2 to select this dictionary"))
+ 'help-echo "Mouse-2 to select this dictionary")
(unless (dictionary-special-dictionary dictionary)
(insert " ")
(insert-button "(Details)" :type 'dictionary-link
'callback 'dictionary-set-dictionary
'list-data (list (cons dictionary description) t)
- 'help-echo (purecopy "Mouse-2 to get more information")))
+ 'help-echo "Mouse-2 to get more information"))
(insert "\n")))))
(defun dictionary-set-dictionary (param &optional more)
@@ -976,7 +972,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
(insert-button description :type 'dictionary-link
'callback 'dictionary-set-dictionary
'data (cons dictionary description)
- 'help-echo (purecopy "Mouse-2 to select this dictionary"))
+ 'help-echo "Mouse-2 to select this dictionary")
(insert "\n\n")
(setq reply (dictionary-read-answer))
(insert reply)
@@ -1027,7 +1023,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
(insert-button description :type 'dictionary-link
'callback 'dictionary-set-strategy
'data strategy
- 'help-echo (purecopy "Mouse-2 to select this matching algorithm"))
+ 'help-echo "Mouse-2 to select this matching algorithm")
(insert "\n")))))
(defun dictionary-set-strategy (strategy &rest _ignored)
@@ -1128,7 +1124,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
(insert-button word :type 'dictionary-link
'callback 'dictionary-new-search
'data (cons word dictionary)
- 'help-echo (purecopy "Mouse-2 to lookup word"))
+ 'help-echo "Mouse-2 to lookup word")
(insert "\n")) (reverse word-list))
(insert "\n")))
list))
diff --git a/lisp/net/dig.el b/lisp/net/dig.el
index f7f1500454a..d4fad0c61fd 100644
--- a/lisp/net/dig.el
+++ b/lisp/net/dig.el
@@ -44,6 +44,11 @@
"Name of dig (domain information groper) binary."
:type 'file)
+(defcustom dig-program-options nil
+ "Options for the dig program."
+ :type '(repeat string)
+ :version "26.1")
+
(defcustom dig-dns-server nil
"DNS server to query.
If nil, use system defaults."
@@ -59,8 +64,8 @@ If nil, use system defaults."
:type 'sexp)
(defun dig-invoke (domain &optional
- query-type query-class query-option
- dig-option server)
+ query-type query-class query-option
+ dig-option server)
"Call dig with given arguments and return buffer containing output.
DOMAIN is a string with a DNS domain. QUERY-TYPE is an optional
string with a DNS type. QUERY-CLASS is an optional string with a DNS
@@ -79,7 +84,8 @@ and is a commonly available debugging tool."
(push domain cmdline)
(if server (push (concat "@" server) cmdline)
(if dig-dns-server (push (concat "@" dig-dns-server) cmdline)))
- (apply #'call-process dig-program nil buf nil cmdline)
+ (apply #'call-process dig-program nil buf nil
+ (append dig-program-options cmdline))
buf))
(defun dig-extract-rr (domain &optional type class)
@@ -117,11 +123,9 @@ Buffer should contain output generated by `dig-invoke'."
(setq str (replace-match "" nil nil str)))
str))
-(defvar dig-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "g" nil)
- (define-key map "q" #'dig-exit)
- map))
+(defvar-keymap dig-mode-map
+ "g" nil
+ "q" #'dig-exit)
(define-derived-mode dig-mode special-mode "Dig"
"Major mode for displaying dig output."
@@ -132,7 +136,7 @@ Buffer should contain output generated by `dig-invoke'."
(defun dig-exit ()
"Quit dig output buffer."
- (interactive)
+ (interactive nil dig-mode)
(quit-window t))
;;;###autoload
@@ -140,12 +144,23 @@ Buffer should contain output generated by `dig-invoke'."
query-type query-class query-option dig-option server)
"Query addresses of a DOMAIN using dig.
See `dig-invoke' for an explanation for the parameters.
-When called interactively, DOMAIN is prompted for. If given a prefix,
-also prompt for the QUERY-TYPE parameter."
+When called interactively, DOMAIN is prompted for.
+
+If given a \\[universal-argument] prefix, also prompt \
+for the QUERY-TYPE parameter.
+
+If given a \\[universal-argument] \\[universal-argument] \
+prefix, also prompt for the SERVER parameter."
(interactive
- (list (read-string "Host: ")
+ (list (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Host" default) nil nil default))
(and current-prefix-arg
(read-string "Query type: "))))
+ (when (and (numberp (car current-prefix-arg))
+ (>= (car current-prefix-arg) 16))
+ (let ((serv (read-from-minibuffer "Name server: ")))
+ (when (not (equal serv ""))
+ (setq server serv))))
(pop-to-buffer-same-window
(dig-invoke domain query-type query-class query-option dig-option server))
(goto-char (point-min))
diff --git a/lisp/net/eudc-capf.el b/lisp/net/eudc-capf.el
index 68cbfd93ffe..92f0c80493d 100644
--- a/lisp/net/eudc-capf.el
+++ b/lisp/net/eudc-capf.el
@@ -71,7 +71,7 @@
;; setting.
;;
;; The value of the variable `eudc-capf-modes' indicates which
-;; major modes do such a setup as part of their initialisation
+;; major modes do such a setup as part of their initialization
;; code.
;;; Code:
diff --git a/lisp/net/eudc-hotlist.el b/lisp/net/eudc-hotlist.el
index 26afd768051..d70e0cf4f63 100644
--- a/lisp/net/eudc-hotlist.el
+++ b/lisp/net/eudc-hotlist.el
@@ -35,15 +35,13 @@
(defvar eudc-hotlist-menu nil)
(defvar eudc-hotlist-list-beginning nil)
-(defvar eudc-hotlist-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "a" #'eudc-hotlist-add-server)
- (define-key map "d" #'eudc-hotlist-delete-server)
- (define-key map "s" #'eudc-hotlist-select-server)
- (define-key map "t" #'eudc-hotlist-transpose-servers)
- (define-key map "q" #'eudc-hotlist-quit-edit)
- (define-key map "x" #'kill-current-buffer)
- map))
+(defvar-keymap eudc-hotlist-mode-map
+ "a" #'eudc-hotlist-add-server
+ "d" #'eudc-hotlist-delete-server
+ "s" #'eudc-hotlist-select-server
+ "t" #'eudc-hotlist-transpose-servers
+ "q" #'eudc-hotlist-quit-edit
+ "x" #'kill-current-buffer)
(define-derived-mode eudc-hotlist-mode fundamental-mode "EUDC-Servers"
"Major mode used to edit the hotlist of servers.
diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el
index ca4e4c9f377..5cfd4e25ec0 100644
--- a/lisp/net/eudc.el
+++ b/lisp/net/eudc.el
@@ -56,16 +56,14 @@
(defvar eudc-form-widget-list nil)
-(defvar eudc-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-keymap)
- (define-key map "q" #'kill-current-buffer)
- (define-key map "x" #'kill-current-buffer)
- (define-key map "f" #'eudc-query-form)
- (define-key map "b" #'eudc-try-bbdb-insert)
- (define-key map "n" #'eudc-move-to-next-record)
- (define-key map "p" #'eudc-move-to-previous-record)
- map))
+(defvar-keymap eudc-mode-map
+ :parent widget-keymap
+ "q" #'kill-current-buffer
+ "x" #'kill-current-buffer
+ "f" #'eudc-query-form
+ "b" #'eudc-try-bbdb-insert
+ "n" #'eudc-move-to-next-record
+ "p" #'eudc-move-to-previous-record)
(defvar mode-popup-menu)
@@ -383,32 +381,51 @@ accordingly. Otherwise it is set to its EUDC default binding."
(cons protocol eudc-known-protocols))))
-(defun eudc-translate-query (query)
+(defun eudc-translate-query (query &optional reverse)
"Translate attribute names of QUERY.
The translation is done according to
-`eudc-protocol-attributes-translation-alist'."
+`eudc-protocol-attributes-translation-alist'.
+
+When REVERSE is nil or omitted, the attribute names are
+translated from EUDC generic names to protocol-specific
+names. When REVERSE is non-nil, the translation is from
+protocol-specific names back to EUDC generic names."
(if eudc-protocol-attributes-translation-alist
(mapcar (lambda (attribute)
- (let ((trans (assq (car attribute)
- (symbol-value eudc-protocol-attributes-translation-alist))))
+ (let ((trans
+ (if reverse
+ (rassq (car attribute)
+ (symbol-value eudc-protocol-attributes-translation-alist))
+ (assq (car attribute)
+ (symbol-value eudc-protocol-attributes-translation-alist)))))
(if trans
- (cons (cdr trans) (cdr attribute))
+ (cons (if reverse (car trans) (cdr trans))
+ (cdr attribute))
attribute)))
query)
query))
-(defun eudc-translate-attribute-list (list)
+(defun eudc-translate-attribute-list (list &optional reverse)
"Translate a list of attribute names LIST.
The translation is done according to
-`eudc-protocol-attributes-translation-alist'."
+`eudc-protocol-attributes-translation-alist'.
+
+When REVERSE is nil or omitted, the attribute names are
+translated from EUDC generic names to protocol-specific
+names. When REVERSE is non-nil, the translation is from
+protocol-specific names back to EUDC generic names."
(if eudc-protocol-attributes-translation-alist
(let (trans)
(mapcar (lambda (attribute)
- (setq trans (assq attribute
- (symbol-value eudc-protocol-attributes-translation-alist)))
- (if trans
- (cdr trans)
- attribute))
+ (setq trans
+ (if reverse
+ (rassq attribute
+ (symbol-value eudc-protocol-attributes-translation-alist))
+ (assq attribute
+ (symbol-value eudc-protocol-attributes-translation-alist))))
+ (if trans
+ (if reverse (car trans) (cdr trans))
+ attribute))
list))
list))
@@ -909,7 +926,7 @@ non-nil, collect results from all servers."
`eudc-inline-expansion-format' is expected to return a list.")
nil))))
- ;; fallback behaviour (nil function, or non-matching type)
+ ;; fallback behavior (nil function, or non-matching type)
(t
(let ((fname (cdr (assq (nth 0 query-attrs) res)))
(lname (cdr (assq (nth 1 query-attrs) res)))
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 3c16942e7c0..4dbd5de2ef7 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -363,7 +363,9 @@ new buffer instead of reusing the default EWW buffer.
If BUFFER, the data to be rendered is in that buffer. In that
case, this function doesn't actually fetch URL. BUFFER will be
-killed after rendering."
+killed after rendering.
+
+For more information, see Info node `(eww) Top'."
(interactive
(let ((uris (eww-suggested-uris)))
(list (read-string (format-prompt "Enter URL or keywords"
@@ -932,9 +934,9 @@ The renaming scheme is performed in accordance with
(defun eww-links-at-point ()
"Return list of URIs, if any, linked at point."
- (remq nil
- (list (get-text-property (point) 'shr-url)
- (get-text-property (point) 'image-url))))
+ (seq-filter #'stringp
+ (list (get-text-property (point) 'shr-url)
+ (get-text-property (point) 'image-url))))
(defun eww-view-source ()
"View the HTML source code of the current page."
@@ -1207,6 +1209,8 @@ instead of `browse-url-new-window-flag'."
(let ((url-allow-non-local-files t))
(eww url)))
+(function-put 'eww-browse-url 'browse-url-browser-kind 'internal)
+
(defun eww-back-url ()
"Go to the previously displayed page."
(interactive nil eww-mode)
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index ac24efdccbf..0b6488292de 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -175,16 +175,15 @@ the list is tried until a successful connection is made."
:type '(repeat string))
(defcustom imap-shell-program '("ssh %s imapd"
- "rsh %s imapd"
- "ssh %g ssh %s imapd"
- "rsh %g rsh %s imapd")
+ "ssh %g ssh %s imapd")
"A list of strings, containing commands for IMAP connection.
Within a string, %s is replaced with the server address, %p with port
number on server, %g with `imap-shell-host', and %l with
`imap-default-user'. The program should read IMAP commands from stdin
and write IMAP response to stdout. Each entry in the list is tried
until a successful connection is made."
- :type '(repeat string))
+ :type '(repeat string)
+ :version "29.1")
(defcustom imap-process-connection-type nil
"Value for `process-connection-type' to use for Kerberos4, GSSAPI, shell and SSL.
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index da45457891b..0f2943cbb03 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -54,7 +54,7 @@ a separator."
Initialized from the LDAP library at build time.
Default value is 389."
:type '(choice (const :tag "Use library default" nil)
- (integer :tag "Port number")))
+ (natnum :tag "Port number")))
(defcustom ldap-default-base nil
"Default base for LDAP searches.
diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el
index 8ba7f1bec3d..ee72eba35db 100644
--- a/lisp/net/mailcap.el
+++ b/lisp/net/mailcap.el
@@ -974,6 +974,7 @@ If NO-DECODE is non-nil, don't decode STRING."
(".ai" . "application/postscript")
(".jpe" . "image/jpeg")
(".jpeg" . "image/jpeg")
+ (".webp" . "image/webp")
(".org" . "text/x-org"))
"An alist of file extensions and corresponding MIME content-types.
This exists for you to customize the information in Lisp. It is
diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el
index d84763b1626..0b99d2a0b7c 100644
--- a/lisp/net/mairix.el
+++ b/lisp/net/mairix.el
@@ -743,21 +743,20 @@ VALUES may contain values for editable fields from current article."
;;;; Major mode for editing/deleting/saving searches
-(defvar mairix-searches-mode-map
- (let ((map (make-keymap)))
- (define-key map [(return)] 'mairix-select-search)
- (define-key map [(down)] 'mairix-next-search)
- (define-key map [(up)] 'mairix-previous-search)
- (define-key map [(right)] 'mairix-next-search)
- (define-key map [(left)] 'mairix-previous-search)
- (define-key map "\C-p" 'mairix-previous-search)
- (define-key map "\C-n" 'mairix-next-search)
- (define-key map [(q)] 'mairix-select-quit)
- (define-key map [(e)] 'mairix-select-edit)
- (define-key map [(d)] 'mairix-select-delete)
- (define-key map [(s)] 'mairix-select-save)
- map)
- "`mairix-searches-mode' keymap.")
+(defvar-keymap mairix-searches-mode-map
+ :doc "`mairix-searches-mode' keymap."
+ :full t
+ "<return>" #'mairix-select-search
+ "<down>" #'mairix-next-search
+ "<up>" #'mairix-previous-search
+ "<right>" #'mairix-next-search
+ "<left>" #'mairix-previous-search
+ "C-p" #'mairix-previous-search
+ "C-n" #'mairix-next-search
+ "q" #'mairix-select-quit
+ "e" #'mairix-select-edit
+ "d" #'mairix-select-delete
+ "s" #'mairix-select-save)
(defvar mairix-searches-mode-font-lock-keywords
'(("^\\([0-9]+\\)"
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 411b6ed4132..c7ff175e08e 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -23,11 +23,10 @@
;;; Commentary:
-;;
;; There are three main areas of functionality:
;;
;; * Wrap common network utility programs (ping, traceroute, netstat,
-;; nslookup, arp, route). Note that these wrappers are of the diagnostic
+;; nslookup, arp, route). Note that these wrappers are of the diagnostic
;; functions of these programs only.
;;
;; * Implement some very basic protocols in Emacs Lisp (finger and whois)
@@ -39,7 +38,7 @@
;;; Code:
;; On some systems, programs like ifconfig are not in normal user
-;; path, but rather in /sbin, /usr/sbin, etc (but non-root users can
+;; path, but rather in /sbin, /usr/sbin, etc. (but non-root users can
;; still use them for queries). Actually the trend these
;; days is for /sbin to be a symlink to /usr/sbin, but we still need to
;; search both for older systems.
@@ -176,15 +175,6 @@ This variable is only used if the variable
`comint-use-prompt-regexp' is non-nil."
:type 'regexp)
-(defcustom dig-program "dig"
- "Program to query DNS information."
- :type 'string)
-
-(defcustom dig-program-options nil
- "Options for the dig program."
- :type '(repeat string)
- :version "26.1")
-
(defcustom ftp-program "ftp"
"Program to run to do FTP transfers."
:type 'string)
@@ -280,6 +270,7 @@ This variable is only used if the variable
(define-derived-mode net-utils-mode special-mode "NetworkUtil"
"Major mode for interacting with an external network utility."
+ :interactive nil
(setq-local font-lock-defaults
'((net-utils-font-lock-keywords)))
(setq-local revert-buffer-function #'net-utils--revert-function))
@@ -288,31 +279,6 @@ This variable is only used if the variable
;; Utility functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Simplified versions of some at-point functions from ffap.el.
-;; It's not worth loading all of ffap just for these.
-(defun net-utils-machine-at-point ()
- (let ((pt (point)))
- (buffer-substring-no-properties
- (save-excursion
- (skip-chars-backward "-a-zA-Z0-9.")
- (point))
- (save-excursion
- (skip-chars-forward "-a-zA-Z0-9.")
- (skip-chars-backward "." pt)
- (point)))))
-
-(defun net-utils-url-at-point ()
- (let ((pt (point)))
- (buffer-substring-no-properties
- (save-excursion
- (skip-chars-backward "--:=&?$+@-Z_a-z~#,%")
- (skip-chars-forward "^A-Za-z0-9" pt)
- (point))
- (save-excursion
- (skip-chars-forward "--:=&?$+@-Z_a-z~#,%")
- (skip-chars-backward ":;.,!?" pt)
- (point)))))
-
(defun net-utils-remove-ctrl-m-filter (process output-string)
"Remove trailing control Ms."
(with-current-buffer (process-buffer process)
@@ -464,7 +430,8 @@ This variable is only used if the variable
If your system's ping continues until interrupted, you can try setting
`ping-program-options'."
(interactive
- (list (read-from-minibuffer "Ping host: " (net-utils-machine-at-point))))
+ (list (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Ping host" default) nil nil default))))
(let ((options
(if ping-program-options
(append ping-program-options (list host))
@@ -497,7 +464,8 @@ See also: `nslookup-host-ipv4', `nslookup-host-ipv6' for
non-interactive versions of this function more suitable for use
in Lisp code."
(interactive
- (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point))
+ (list (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Lookup host" default) nil nil default))
(if current-prefix-arg (read-from-minibuffer "Name server: "))))
(let ((options
(append nslookup-program-options (list host)
@@ -589,14 +557,12 @@ This command uses `nslookup-program' to look up DNS records."
(autoload 'comint-mode "comint" nil t)
-(defvar nslookup-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\t" #'completion-at-point)
- map))
+(defvar-keymap nslookup-mode-map
+ "TAB" #'completion-at-point)
-;; Using a derived mode gives us keymaps, hooks, etc.
(define-derived-mode nslookup-mode comint-mode "Nslookup"
"Major mode for interacting with the nslookup program."
+ :interactive nil
(setq-local font-lock-defaults
'((nslookup-font-lock-keywords)))
(setq comint-prompt-regexp nslookup-prompt-regexp)
@@ -611,7 +577,8 @@ Interactively, prompt for NAME-SERVER if invoked with prefix argument.
This command uses `dns-lookup-program' for looking up the DNS information."
(interactive
- (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point))
+ (list (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Lookup host" default) nil nil default))
(if current-prefix-arg (read-from-minibuffer "Name server: "))))
(let ((options
(append dns-lookup-program-options (list host)
@@ -633,20 +600,12 @@ DNS resolution.
Interactively, prompt for NAME-SERVER if invoked with prefix argument.
This command uses `dig-program' for looking up the DNS information."
+ (declare (obsolete dig "29.1"))
(interactive
- (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point))
+ (list (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Lookup host" default) nil nil default))
(if current-prefix-arg (read-from-minibuffer "Name server: "))))
- (let ((options
- (append dig-program-options (list host)
- (if name-server (list (concat "@" name-server))))))
- (net-utils-run-program
- "Dig"
- (concat "** "
- (mapconcat #'identity
- (list "Dig" host dig-program)
- " ** "))
- dig-program
- options)))
+ (dig host nil nil nil nil name-server))
(autoload 'comint-exec "comint")
(declare-function comint-watch-for-password-prompt "comint" (string))
@@ -656,9 +615,8 @@ This command uses `dig-program' for looking up the DNS information."
(defun ftp (host)
"Run `ftp-program' to connect to HOST."
(interactive
- (list
- (read-from-minibuffer
- "Ftp to Host: " (net-utils-machine-at-point))))
+ (list (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Ftp to Host" default) nil nil default))))
(let ((buf (get-buffer-create (concat "*ftp [" host "]*"))))
(set-buffer buf)
(ftp-mode)
@@ -668,14 +626,12 @@ This command uses `dig-program' for looking up the DNS information."
(list host)))
(pop-to-buffer buf)))
-(defvar ftp-mode-map
- (let ((map (make-sparse-keymap)))
- ;; Occasionally useful
- (define-key map "\t" #'completion-at-point)
- map))
+(defvar-keymap ftp-mode-map
+ "TAB" #'completion-at-point)
(define-derived-mode ftp-mode comint-mode "FTP"
"Major mode for interacting with the ftp program."
+ :interactive nil
(setq comint-prompt-regexp ftp-prompt-regexp)
(setq comint-input-autoexpand t)
;; Only add the password-prompting hook if it's not already in the
@@ -695,8 +651,8 @@ This command uses `dig-program' for looking up the DNS information."
This command uses `smbclient-program' to connect to HOST."
(interactive
(list
- (read-from-minibuffer
- "Connect to Host: " (net-utils-machine-at-point))
+ (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Connect to Host" default) nil nil default))
(read-from-minibuffer "SMB Service: ")))
(let* ((name (format "smbclient [%s\\%s]" host service))
(buf (get-buffer-create (concat "*" name "*")))
@@ -714,8 +670,8 @@ This command uses `smbclient-program' to connect to HOST."
This command uses `smbclient-program' to connect to HOST."
(interactive
(list
- (read-from-minibuffer
- "Connect to Host: " (net-utils-machine-at-point))))
+ (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Connect to Host" default) nil nil default))))
(let ((buf (get-buffer-create (format "*SMB Shares on %s*" host))))
(set-buffer buf)
(smbclient-mode)
@@ -725,6 +681,7 @@ This command uses `smbclient-program' to connect to HOST."
(define-derived-mode smbclient-mode comint-mode "smbclient"
"Major mode for interacting with the smbclient program."
+ :interactive nil
(setq comint-prompt-regexp smbclient-prompt-regexp)
(setq comint-input-autoexpand t)
;; Only add the password-prompting hook if it's not already in the
@@ -813,15 +770,15 @@ and `network-connection-service-alist', which see."
;; uses a string like "pbreton@cs.umb.edu", we won't ask for the
;; host name. If we don't see an "@", we'll prompt for the host.
(interactive
- (let* ((answer (read-from-minibuffer "Finger User: "
- (net-utils-url-at-point)))
+ (let* ((answer (let ((default (ffap-url-at-point)))
+ (read-string (format-prompt "Finger User" default) nil nil default)))
(index (string-match (regexp-quote "@") answer)))
(if index
(list (substring answer 0 index)
(substring answer (1+ index)))
(list answer
- (read-from-minibuffer "At Host: "
- (net-utils-machine-at-point))))))
+ (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "At Host" default) nil nil default))))))
(let* ((user-and-host (concat user "@" host))
(process-name (concat "Finger [" user-and-host "]"))
(regexps finger-X.500-host-regexps)
@@ -940,10 +897,9 @@ The port is deduced from `network-connection-service-alist'."
;;; General Network connection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Using a derived mode gives us keymaps, hooks, etc.
-(define-derived-mode
- network-connection-mode comint-mode "Network-Connection"
- "Major mode for interacting with the `network-connection' program.")
+(define-derived-mode network-connection-mode comint-mode "Network-Connection"
+ "Major mode for interacting with the `network-connection' program."
+ :interactive nil)
(defun network-connection-mode-setup (host service)
(setq-local network-connection-host host)
@@ -955,7 +911,8 @@ The port is deduced from `network-connection-service-alist'."
This command uses `network-connection-service-alist', which see."
(interactive
(list
- (read-from-minibuffer "Host: " (net-utils-machine-at-point))
+ (let ((default (ffap-machine-at-point)))
+ (read-string (format-prompt "Host" default) nil nil default))
(completing-read "Service: "
(mapcar
(lambda (elt)
@@ -1008,6 +965,9 @@ This command uses `network-connection-service-alist', which see."
(and old-comint-input-ring
(setq comint-input-ring old-comint-input-ring)))))
+(define-obsolete-function-alias 'net-utils-machine-at-point #'ffap-machine-at-point "29.1")
+(define-obsolete-function-alias 'net-utils-url-at-point #'ffap-url-at-point "29.1")
+
(provide 'net-utils)
;;; net-utils.el ends here
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index 7ae58884f97..5ae2df769a2 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -40,7 +40,6 @@
;; Silence warnings
(defvar newsticker-groups)
-(defvar w3-mode-map)
(defvar w3m-minor-mode-map)
(defvar newsticker--retrieval-timer-list nil
diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el
index df574dfa2f4..4eb6f6c695e 100644
--- a/lisp/net/newst-plainview.el
+++ b/lisp/net/newst-plainview.el
@@ -37,7 +37,6 @@
(require 'xml)
;; Silence warnings
-(defvar w3-mode-map)
(defvar w3m-minor-mode-map)
;; ======================================================================
@@ -1232,7 +1231,6 @@ item-retrieval time is added as well."
(newsticker--buffer-do-insert-text item 'desc feed-name-symbol))
(defvar w3m-fill-column)
-(defvar w3-maximum-line-length)
(defun newsticker--buffer-do-insert-text (item type feed-name-symbol)
"Actually insert contents of news item, format it, render it and all that.
@@ -1366,19 +1364,14 @@ FEED-NAME-SYMBOL tells to which feed this item belongs."
"</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" pos-text-end t)
;; (message "%s" (newsticker--title item))
(let ((w3m-fill-column (if newsticker-use-full-width
- -1 fill-column))
- (w3-maximum-line-length
- (if newsticker-use-full-width nil fill-column)))
+ -1 fill-column)))
(save-excursion
(funcall newsticker-html-renderer pos-text-start
pos-text-end)))
- (cond ((eq newsticker-html-renderer 'w3m-region)
- (add-text-properties pos (point-max)
- (list 'keymap
- w3m-minor-mode-map)))
- ((eq newsticker-html-renderer 'w3-region)
- (add-text-properties pos (point-max)
- (list 'keymap w3-mode-map))))
+ (when (eq newsticker-html-renderer 'w3m-region)
+ (add-text-properties pos (point-max)
+ (list 'keymap
+ w3m-minor-mode-map)))
(setq is-rendered-HTML t)))
(error
(message "Error: HTML rendering failed: %s, %s"
diff --git a/lisp/net/newst-reader.el b/lisp/net/newst-reader.el
index 7e00ac93e75..4a7f0b8e3ee 100644
--- a/lisp/net/newst-reader.el
+++ b/lisp/net/newst-reader.el
@@ -112,18 +112,18 @@ window is used when filling. See also `newsticker-justification'."
"Function for rendering HTML contents.
If non-nil, newsticker.el will call this function whenever it
finds HTML-like tags in item descriptions.
-Possible functions include `shr-render-region', `w3m-region', `w3-region', and
+Possible functions include `shr-render-region', `w3m-region', and
`newsticker-htmlr-render'.
-Newsticker automatically loads the respective package w3m, w3, or
+Newsticker automatically loads the respective package w3m, or
htmlr if this option is set."
:type '(choice :tag "Function"
(const :tag "None" nil)
(const :tag "SHR" shr-render-region)
- (const :tag "w3" w3-region)
(const :tag "w3m" w3m-region)
(const :tag "htmlr" newsticker-htmlr-render))
:set #'newsticker--set-customvar-formatting
- :group 'newsticker-reader)
+ :group 'newsticker-reader
+ :version "29.1")
(defcustom newsticker-date-format
"(%A, %H:%M)"
@@ -315,8 +315,6 @@ Return the image."
(if newsticker-html-renderer
(cond ((eq newsticker-html-renderer 'w3m-region)
(require 'w3m))
- ((eq newsticker-html-renderer 'w3-region)
- (require 'w3-auto))
((eq newsticker-html-renderer 'newsticker-htmlr-render)
(require 'htmlr))))
(funcall newsticker-frontend))
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index b429a33dec8..637f53e6550 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -252,7 +252,6 @@ their id stays constant."
(declare-function w3m-toggle-inline-images "ext:w3m" (&optional force no-cache))
(defvar w3m-fill-column)
-(defvar w3-maximum-line-length)
(defun newsticker--treeview-render-text (start end)
"Render text between markers START and END."
@@ -272,17 +271,13 @@ their id stays constant."
"</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" end t)
;; (message "%s" (newsticker--title item))
(let ((w3m-fill-column (if newsticker-use-full-width
- -1 fill-column))
- (w3-maximum-line-length
- (if newsticker-use-full-width nil fill-column)))
+ -1 fill-column)))
(select-window (newsticker--treeview-item-window))
(save-excursion
(funcall newsticker-html-renderer start end)))
;;(cond ((eq newsticker-html-renderer 'w3m-region)
;; (add-text-properties start end (list 'keymap
;; w3m-minor-mode-map)))
- ;;((eq newsticker-html-renderer 'w3-region)
- ;;(add-text-properties start end (list 'keymap w3-mode-map))))
(if (eq newsticker-html-renderer 'w3m-region)
(w3m-toggle-inline-images t))
t)))
@@ -608,14 +603,10 @@ If CLEAR-BUFFER is non-nil the list buffer is completely erased."
(newsticker--treeview-list-update-faces)
(goto-char (point-min))))
-(defvar newsticker-treeview-list-sort-button-map
- (let ((map (make-sparse-keymap)))
- (define-key map [header-line mouse-1]
- #'newsticker--treeview-list-sort-by-column)
- (define-key map [header-line mouse-2]
- #'newsticker--treeview-list-sort-by-column)
- map)
- "Local keymap for newsticker treeview list window sort buttons.")
+(defvar-keymap newsticker-treeview-list-sort-button-map
+ :doc "Local keymap for newsticker treeview list window sort buttons."
+ "<header-line> <mouse-1>" #'newsticker--treeview-list-sort-by-column
+ "<header-line> <mouse-2>" #'newsticker--treeview-list-sort-by-column)
(defun newsticker--treeview-list-sort-by-column (&optional event)
"Sort the newsticker list window buffer by the column clicked on.
@@ -2012,41 +2003,39 @@ Return t if groups have changed, nil otherwise."
menu)
"Map for newsticker item menu.")
-(defvar newsticker-treeview-mode-map
- (let ((map (make-sparse-keymap 'newsticker-treeview-mode-map)))
- (define-key map " " #'newsticker-treeview-next-page)
- (define-key map "a" #'newsticker-add-url)
- (define-key map "b" #'newsticker-treeview-browse-url-item)
- (define-key map "c" #'newsticker-treeview-customize-current-feed)
- (define-key map "F" #'newsticker-treeview-prev-feed)
- (define-key map "f" #'newsticker-treeview-next-feed)
- (define-key map "g" #'newsticker-treeview-get-news)
- (define-key map "G" #'newsticker-get-all-news)
- (define-key map "i" #'newsticker-treeview-toggle-item-immortal)
- (define-key map "j" #'newsticker-treeview-jump)
- (define-key map "n" #'newsticker-treeview-next-item)
- (define-key map "N" #'newsticker-treeview-next-new-or-immortal-item)
- (define-key map "O" #'newsticker-treeview-mark-list-items-old)
- (define-key map "o" #'newsticker-treeview-mark-item-old)
- (define-key map "p" #'newsticker-treeview-prev-item)
- (define-key map "P" #'newsticker-treeview-prev-new-or-immortal-item)
- (define-key map "q" #'newsticker-treeview-quit)
- (define-key map "S" #'newsticker-treeview-save-item)
- (define-key map "s" #'newsticker-treeview-save)
- (define-key map "u" #'newsticker-treeview-update)
- (define-key map "v" #'newsticker-treeview-browse-url)
- ;;(define-key map "\n" #'newsticker-treeview-scroll-item)
- ;;(define-key map "\C-m" #'newsticker-treeview-scroll-item)
- (define-key map "\M-m" #'newsticker-group-move-feed)
- (define-key map "\M-a" #'newsticker-group-add-group)
- (define-key map "\M-d" #'newsticker-group-delete-group)
- (define-key map "\M-r" #'newsticker-group-rename-group)
- (define-key map [M-down] #'newsticker-group-shift-feed-down)
- (define-key map [M-up] #'newsticker-group-shift-feed-up)
- (define-key map [M-S-down] #'newsticker-group-shift-group-down)
- (define-key map [M-S-up] #'newsticker-group-shift-group-up)
- map)
- "Mode map for newsticker treeview.")
+(defvar-keymap newsticker-treeview-mode-map
+ :doc "Mode map for newsticker treeview."
+ "SPC" #'newsticker-treeview-next-page
+ "a" #'newsticker-add-url
+ "b" #'newsticker-treeview-browse-url-item
+ "c" #'newsticker-treeview-customize-current-feed
+ "F" #'newsticker-treeview-prev-feed
+ "f" #'newsticker-treeview-next-feed
+ "g" #'newsticker-treeview-get-news
+ "G" #'newsticker-get-all-news
+ "i" #'newsticker-treeview-toggle-item-immortal
+ "j" #'newsticker-treeview-jump
+ "n" #'newsticker-treeview-next-item
+ "N" #'newsticker-treeview-next-new-or-immortal-item
+ "O" #'newsticker-treeview-mark-list-items-old
+ "o" #'newsticker-treeview-mark-item-old
+ "p" #'newsticker-treeview-prev-item
+ "P" #'newsticker-treeview-prev-new-or-immortal-item
+ "q" #'newsticker-treeview-quit
+ "S" #'newsticker-treeview-save-item
+ "s" #'newsticker-treeview-save
+ "u" #'newsticker-treeview-update
+ "v" #'newsticker-treeview-browse-url
+ ;;"C-j" #'newsticker-treeview-scroll-item
+ ;;"RET" #'newsticker-treeview-scroll-item
+ "M-m" #'newsticker-group-move-feed
+ "M-a" #'newsticker-group-add-group
+ "M-d" #'newsticker-group-delete-group
+ "M-r" #'newsticker-group-rename-group
+ "M-<down>" #'newsticker-group-shift-feed-down
+ "M-<up>" #'newsticker-group-shift-feed-up
+ "M-S-<down>" #'newsticker-group-shift-group-down
+ "M-S-<up>" #'newsticker-group-shift-group-up)
(define-derived-mode newsticker-treeview-mode fundamental-mode "Newsticker TV"
"Major mode for Newsticker Treeview.
diff --git a/lisp/net/pop3.el b/lisp/net/pop3.el
index 0f6dfb6ad46..de225d76dcc 100644
--- a/lisp/net/pop3.el
+++ b/lisp/net/pop3.el
@@ -59,7 +59,7 @@
(defcustom pop3-port 110
"POP3 port."
:version "22.1" ;; Oort Gnus
- :type 'number
+ :type 'natnum
:group 'pop3)
(defcustom pop3-password-required t
@@ -88,7 +88,7 @@ valid value is `apop'."
The lower the number, the more latency-sensitive the fetching
will be. If your pop3 server doesn't support streaming at all,
set this to 1."
- :type 'number
+ :type 'natnum
:version "24.1"
:group 'pop3)
diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el
index 598a7da0712..61cae43a88a 100644
--- a/lisp/net/quickurl.el
+++ b/lisp/net/quickurl.el
@@ -163,19 +163,17 @@ in your init file (after loading/requiring quickurl).")
(defvar quickurl-urls nil
"URL alist for use with `quickurl' and `quickurl-ask'.")
-(defvar quickurl-list-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "a" #'quickurl-list-add-url)
- (define-key map [(control m)] #'quickurl-list-insert-url)
- (define-key map "u" #'quickurl-list-insert-naked-url)
- (define-key map " " #'quickurl-list-insert-with-lookup)
- (define-key map "l" #'quickurl-list-insert-lookup)
- (define-key map "d" #'quickurl-list-insert-with-desc)
- (define-key map [(control g)] #'quickurl-list-quit)
- (define-key map "q" #'quickurl-list-quit)
- (define-key map [mouse-2] #'quickurl-list-mouse-select)
- map)
- "Local keymap for a `quickurl-list-mode' buffer.")
+(defvar-keymap quickurl-list-mode-map
+ :doc "Local keymap for a `quickurl-list-mode' buffer."
+ "a" #'quickurl-list-add-url
+ "RET" #'quickurl-list-insert-url
+ "u" #'quickurl-list-insert-naked-url
+ "SPC" #'quickurl-list-insert-with-lookup
+ "l" #'quickurl-list-insert-lookup
+ "d" #'quickurl-list-insert-with-desc
+ "C-g" #'quickurl-list-quit
+ "q" #'quickurl-list-quit
+ "<mouse-2>" #'quickurl-list-mouse-select)
(defvar quickurl-list-buffer-name "*quickurl-list*"
"Name for the URL listing buffer.")
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index eca7b2046c5..54d7861f445 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -130,7 +130,7 @@ be displayed instead."
(defcustom rcirc-default-port 6667
"The default port to connect to."
- :type 'integer)
+ :type 'natnum)
(defcustom rcirc-default-nick (user-login-name)
"Your nick."
@@ -267,6 +267,7 @@ The ARGUMENTS for each METHOD symbol are:
Examples:
((\"Libera.Chat\" nickserv \"bob\" \"p455w0rd\")
(\"Libera.Chat\" chanserv \"bob\" \"#bobland\" \"passwd99\")
+ (\"Libera.Chat\" certfp \"/path/to/key\" \"/path/to/cert\")
(\"bitlbee\" bitlbee \"robert\" \"sekrit\")
(\"dal.net\" nickserv \"bob\" \"sekrit\" \"NickServ@services.dal.net\")
(\"quakenet.org\" quakenet \"bobby\" \"sekrit\")
@@ -1345,33 +1346,30 @@ The list is updated automatically by `defun-rcirc-command'.")
'set-rcirc-encode-coding-system
"28.1")
-(defvar rcirc-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "RET") 'rcirc-send-input)
- (define-key map (kbd "M-p") 'rcirc-insert-prev-input)
- (define-key map (kbd "M-n") 'rcirc-insert-next-input)
- (define-key map (kbd "TAB") 'completion-at-point)
- (define-key map (kbd "C-c C-b") 'rcirc-browse-url)
- (define-key map (kbd "C-c C-c") 'rcirc-edit-multiline)
- (define-key map (kbd "C-c C-j") 'rcirc-cmd-join)
- (define-key map (kbd "C-c C-k") 'rcirc-cmd-kick)
- (define-key map (kbd "C-c C-l") 'rcirc-toggle-low-priority)
- (define-key map (kbd "C-c C-d") 'rcirc-cmd-mode)
- (define-key map (kbd "C-c C-m") 'rcirc-cmd-msg)
- (define-key map (kbd "C-c C-r") 'rcirc-cmd-nick) ; rename
- (define-key map (kbd "C-c C-o") 'rcirc-omit-mode)
- (define-key map (kbd "C-c C-p") 'rcirc-cmd-part)
- (define-key map (kbd "C-c C-q") 'rcirc-cmd-query)
- (define-key map (kbd "C-c C-t") 'rcirc-cmd-topic)
- (define-key map (kbd "C-c C-n") 'rcirc-cmd-names)
- (define-key map (kbd "C-c C-w") 'rcirc-cmd-whois)
- (define-key map (kbd "C-c C-x") 'rcirc-cmd-quit)
- (define-key map (kbd "C-c TAB") ; C-i
- 'rcirc-toggle-ignore-buffer-activity)
- (define-key map (kbd "C-c C-s") 'rcirc-switch-to-server-buffer)
- (define-key map (kbd "C-c C-a") 'rcirc-jump-to-first-unread-line)
- map)
- "Keymap for rcirc mode.")
+(defvar-keymap rcirc-mode-map
+ :doc "Keymap for rcirc mode."
+ "RET" #'rcirc-send-input
+ "M-p" #'rcirc-insert-prev-input
+ "M-n" #'rcirc-insert-next-input
+ "TAB" #'completion-at-point
+ "C-c C-b" #'rcirc-browse-url
+ "C-c C-c" #'rcirc-edit-multiline
+ "C-c C-j" #'rcirc-cmd-join
+ "C-c C-k" #'rcirc-cmd-kick
+ "C-c C-l" #'rcirc-toggle-low-priority
+ "C-c C-d" #'rcirc-cmd-mode
+ "C-c C-m" #'rcirc-cmd-msg
+ "C-c C-r" #'rcirc-cmd-nick ; rename
+ "C-c C-o" #'rcirc-omit-mode
+ "C-c C-p" #'rcirc-cmd-part
+ "C-c C-q" #'rcirc-cmd-query
+ "C-c C-t" #'rcirc-cmd-topic
+ "C-c C-n" #'rcirc-cmd-names
+ "C-c C-w" #'rcirc-cmd-whois
+ "C-c C-x" #'rcirc-cmd-quit
+ "C-c C-i" #'rcirc-toggle-ignore-buffer-activity
+ "C-c C-s" #'rcirc-switch-to-server-buffer
+ "C-c C-a" #'rcirc-jump-to-first-unread-line)
(defvar-local rcirc-short-buffer-name nil
"Generated abbreviation to use to indicate buffer activity.")
@@ -1713,14 +1711,12 @@ extracted."
parent
(substitute-command-keys "\\[rcirc-multiline-minor-cancel]")))))
-(defvar rcirc-multiline-minor-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-c C-c") 'rcirc-multiline-minor-submit)
- (define-key map (kbd "C-x C-s") 'rcirc-multiline-minor-submit)
- (define-key map (kbd "C-c C-k") 'rcirc-multiline-minor-cancel)
- (define-key map (kbd "ESC ESC ESC") 'rcirc-multiline-minor-cancel)
- map)
- "Keymap for multiline mode in rcirc.")
+(defvar-keymap rcirc-multiline-minor-mode-map
+ :doc "Keymap for multiline mode in rcirc."
+ "C-c C-c" #'rcirc-multiline-minor-submit
+ "C-x C-s" #'rcirc-multiline-minor-submit
+ "C-c C-k" #'rcirc-multiline-minor-cancel
+ "ESC ESC ESC" #'rcirc-multiline-minor-cancel)
(define-minor-mode rcirc-multiline-minor-mode
"Minor mode for editing multiple lines in rcirc."
@@ -2268,12 +2264,10 @@ This function does not alter the INPUT string."
(mapconcat rcirc-nick-filter sorted sep)))
;;; activity tracking
-(defvar rcirc-track-minor-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-c C-@") 'rcirc-next-active-buffer)
- (define-key map (kbd "C-c C-SPC") 'rcirc-next-active-buffer)
- map)
- "Keymap for rcirc track minor mode.")
+(defvar-keymap rcirc-track-minor-mode-map
+ :doc "Keymap for rcirc track minor mode."
+ "C-c C-@" #'rcirc-next-active-buffer
+ "C-c C-SPC" #'rcirc-next-active-buffer)
(defcustom rcirc-track-abbrevate-flag t
"Non-nil means `rcirc-track-minor-mode' should abbreviate names."
@@ -3301,7 +3295,7 @@ PROCESS is the process object for the current connection."
(with-current-buffer chat-buffer
(rcirc-print process sender "NICK" old-nick new-nick)
(setq rcirc-target new-nick)
- (rename-buffer (rcirc-generate-new-buffer-name process new-nick)))
+ (rename-buffer (rcirc-generate-new-buffer-name process new-nick) t))
(setf rcirc-buffer-alist
(cons (cons new-nick chat-buffer)
(delq (assoc-string old-nick rcirc-buffer-alist t)
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el
index d8341774e47..c4f97a92fb5 100644
--- a/lisp/net/secrets.el
+++ b/lisp/net/secrets.el
@@ -741,14 +741,13 @@ ITEM can also be an object path, which is used if contained in COLLECTION."
;;; Visualization.
-(defvar secrets-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map (make-composed-keymap special-mode-map widget-keymap))
- (define-key map "n" #'next-line)
- (define-key map "p" #'previous-line)
- (define-key map "z" #'kill-current-buffer)
- map)
- "Keymap used in `secrets-mode' buffers.")
+(defvar-keymap secrets-mode-map
+ :doc "Keymap used in `secrets-mode' buffers."
+ :parent (make-composed-keymap special-mode-map
+ widget-keymap)
+ "n" #'next-line
+ "p" #'previous-line
+ "z" #'kill-current-buffer)
(define-derived-mode secrets-mode special-mode "Secrets"
"Major mode for presenting password entries retrieved by Security Service.
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 0645f4721a3..476c7017e6c 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -232,6 +232,11 @@ temporarily blinks with this face."
"Face used for rendering <code> blocks."
:version "29.1")
+(defface shr-mark
+ '((t :background "yellow" :foreground "black"))
+ "Face used for <mark> elements."
+ :version "29.1")
+
(defcustom shr-inhibit-images nil
"If non-nil, inhibit loading images."
:version "28.1"
@@ -285,11 +290,10 @@ and other things:
"O" #'shr-save-contents
"RET" #'shr-browse-url)
-(defvar shr-image-map
- (let ((map (copy-keymap shr-map)))
- (when (boundp 'image-map)
- (set-keymap-parent map image-map))
- map))
+(defvar-keymap shr-image-map
+ :parent (if (boundp 'image-map)
+ (make-composed-keymap shr-map image-map)
+ shr-map))
;; Public functions and commands.
(declare-function libxml-parse-html-region "xml.c"
@@ -815,7 +819,7 @@ size, and full-buffer size."
(let* ((props (copy-sequence (text-properties-at (point))))
(face (plist-get props 'face)))
;; We don't want to use the faces on the indentation, because
- ;; that's ugly, but we do want to use the background colour.
+ ;; that's ugly, but we do want to use the background color.
(when face
(setq props (plist-put props 'face (shr-face-background face))))
(add-text-properties gap-start (point) props))))
@@ -1422,6 +1426,14 @@ ones, in case fg and bg are nil."
;; The `tt' tag is deprecated in favor of `code'.
(shr-tag-code dom))
+(defun shr-tag-mark (dom)
+ (when (and (not (bobp))
+ (not (= (char-after (1- (point))) ?\s)))
+ (insert " "))
+ (let ((start (point)))
+ (shr-generic dom)
+ (shr-add-font start (point) 'shr-mark)))
+
(defun shr-tag-ins (cont)
(let* ((start (point))
(color "green")
diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el
index 50342b9105a..a39e35a53a1 100644
--- a/lisp/net/sieve-manage.el
+++ b/lisp/net/sieve-manage.el
@@ -131,7 +131,7 @@ for doing the actual authentication."
(defcustom sieve-manage-default-port "sieve"
"Default port number or service name for managesieve protocol."
- :type '(choice integer string)
+ :type '(choice natnum string)
:version "24.4")
(defcustom sieve-manage-default-stream 'network
diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el
index 58fd41d8995..f62af03534a 100644
--- a/lisp/net/sieve-mode.el
+++ b/lisp/net/sieve-mode.el
@@ -137,13 +137,11 @@
;; Key map definition
-(defvar sieve-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-l" #'sieve-upload)
- (define-key map "\C-c\C-c" #'sieve-upload-and-kill)
- (define-key map "\C-c\C-m" #'sieve-manage)
- map)
- "Key map used in sieve mode.")
+(defvar-keymap sieve-mode-map
+ :doc "Keymap used in sieve mode."
+ "C-c C-l" #'sieve-upload
+ "C-c C-c" #'sieve-upload-and-kill
+ "C-c RET" #'sieve-manage)
;; Menu
diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el
index 630ea04070b..3a6067ee10b 100644
--- a/lisp/net/sieve.el
+++ b/lisp/net/sieve.el
@@ -106,33 +106,31 @@ require \"fileinto\";
;; FIXME: This is arguably a bug/problem in `easy-menu-define'.
(declare-function sieve-manage-mode-menu "sieve")
-(defvar sieve-manage-mode-map
- (let ((map (make-sparse-keymap)))
- ;; various
- (define-key map "?" #'sieve-help)
- (define-key map "h" #'sieve-help)
- ;; activating
- (define-key map "m" #'sieve-activate)
- (define-key map "u" #'sieve-deactivate)
- (define-key map "\M-\C-?" #'sieve-deactivate-all)
- ;; navigation keys
- (define-key map "\C-p" #'sieve-prev-line)
- (define-key map [up] #'sieve-prev-line)
- (define-key map "\C-n" #'sieve-next-line)
- (define-key map [down] #'sieve-next-line)
- (define-key map " " #'sieve-next-line)
- (define-key map "n" #'sieve-next-line)
- (define-key map "p" #'sieve-prev-line)
- (define-key map "\C-m" #'sieve-edit-script)
- (define-key map "f" #'sieve-edit-script)
- ;; (define-key map "o" #'sieve-edit-script-other-window)
- (define-key map "r" #'sieve-remove)
- (define-key map "q" #'sieve-bury-buffer)
- (define-key map "Q" #'sieve-manage-quit)
- (define-key map [(down-mouse-2)] #'sieve-edit-script)
- (define-key map [(down-mouse-3)] #'sieve-manage-mode-menu)
- map)
- "Keymap for `sieve-manage-mode'.")
+(defvar-keymap sieve-manage-mode-map
+ :doc "Keymap for `sieve-manage-mode'."
+ ;; various
+ "?" #'sieve-help
+ "h" #'sieve-help
+ ;; activating
+ "m" #'sieve-activate
+ "u" #'sieve-deactivate
+ "M-DEL" #'sieve-deactivate-all
+ ;; navigation keys
+ "C-p" #'sieve-prev-line
+ "<up>" #'sieve-prev-line
+ "C-n" #'sieve-next-line
+ "<down>" #'sieve-next-line
+ "SPC" #'sieve-next-line
+ "n" #'sieve-next-line
+ "p" #'sieve-prev-line
+ "RET" #'sieve-edit-script
+ "f" #'sieve-edit-script
+ ;; "o" #'sieve-edit-script-other-window
+ "r" #'sieve-remove
+ "q" #'sieve-bury-buffer
+ "Q" #'sieve-manage-quit
+ "<down-mouse-2>" #'sieve-edit-script
+ "<down-mouse-3>" #'sieve-manage-mode-menu)
(easy-menu-define sieve-manage-mode-menu sieve-manage-mode-map
"Sieve Menu."
diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el
index de84b4f8dd1..394c4a9666d 100644
--- a/lisp/net/snmp-mode.el
+++ b/lisp/net/snmp-mode.el
@@ -248,14 +248,12 @@ This is used during Tempo template completion."
;; Set up our keymap
;;
-(defvar snmp-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\177" 'backward-delete-char-untabify)
- (define-key map "\C-c\C-i" 'tempo-complete-tag)
- (define-key map "\C-c\C-f" 'tempo-forward-mark)
- (define-key map "\C-c\C-b" 'tempo-backward-mark)
- map)
- "Keymap used in SNMP mode.")
+(defvar-keymap snmp-mode-map
+ :doc "Keymap used in SNMP mode."
+ "DEL" #'backward-delete-char-untabify
+ "C-c TAB" #'tempo-complete-tag
+ "C-c C-f" #'tempo-forward-mark
+ "C-c C-b" #'tempo-backward-mark)
;; Set up our syntax table
diff --git a/lisp/net/socks.el b/lisp/net/socks.el
index 8df0773e1d2..2ba1c20566f 100644
--- a/lisp/net/socks.el
+++ b/lisp/net/socks.el
@@ -407,11 +407,10 @@ When ATYPE indicates an IP, param ADDRESS must be given as raw bytes."
(setq version (process-get proc 'socks-server-protocol))
(cond
((equal version 'http)
- (setq request (format (eval-when-compile
- (concat
- "CONNECT %s:%d HTTP/1.0\r\n"
- "User-Agent: Emacs/SOCKS v1.0\r\n"
- "\r\n"))
+ (setq request (format (concat
+ "CONNECT %s:%d HTTP/1.0\r\n"
+ "User-Agent: Emacs/SOCKS v1.0\r\n"
+ "\r\n")
(cond
((equal atype socks-address-type-name) address)
(t
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index 0d54d2220b6..bea79e89331 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -1,7 +1,6 @@
;;; telnet.el --- run a telnet session from within an Emacs buffer -*- lexical-binding: t; -*-
-;; Copyright (C) 1985, 1988, 1992, 1994, 2001-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
;; Author: William F. Schelter
;; Maintainer: emacs-devel@gnu.org
@@ -24,11 +23,11 @@
;;; Commentary:
-;; This mode is intended to be used for telnet or rsh to a remote host;
-;; `telnet' and `rsh' are the two entry points. Multiple telnet or rsh
-;; sessions are supported.
+;; This mode is intended to be used for telnet to a remote host;
+;; `telnet' is the entry point. Multiple telnet sessions are
+;; supported.
;;
-;; Normally, input is sent to the remote telnet/rsh line-by-line, as you
+;; Normally, input is sent to the remote telnet line-by-line, as you
;; type RET or LFD. C-c C-c sends a C-c to the remote immediately;
;; C-c C-z sends C-z immediately. C-c C-q followed by any character
;; sends that character immediately.
@@ -61,14 +60,13 @@ PROGRAM says which program to run, to talk to that machine.
LOGIN-NAME, which is optional, says what to log in as on that machine.")
(defvar telnet-new-line "\r")
-(defvar telnet-mode-map
- (let ((map (nconc (make-sparse-keymap) comint-mode-map)))
- (define-key map "\C-m" #'telnet-send-input)
- ;; (define-key map "\C-j" #'telnet-send-input)
- (define-key map "\C-c\C-q" #'send-process-next-char)
- (define-key map "\C-c\C-c" #'telnet-interrupt-subjob)
- (define-key map "\C-c\C-z" #'telnet-c-z)
- map))
+(defvar-keymap telnet-mode-map
+ :parent comint-mode-map
+ "RET" #'telnet-send-input
+ ;; "C-j" #'telnet-send-input
+ "C-c C-q" #'send-process-next-char
+ "C-c C-c" #'telnet-interrupt-subjob
+ "C-c C-z" #'telnet-c-z)
(defvar telnet-prompt-pattern "^[^#$%>\n]*[#$%>] *")
(defvar telnet-replace-c-g nil)
@@ -95,7 +93,7 @@ Should be set to the number of terminal writes telnet will make
rejecting one login and prompting again for a username and password.")
(defvar telnet-connect-command nil
- "Command used to start the `telnet' (or `rsh') connection.")
+ "Command used to start the `telnet' connection.")
(defun telnet-interrupt-subjob ()
"Interrupt the program running through telnet on the remote host."
@@ -246,7 +244,7 @@ Normally input is edited in Emacs and sent a line at a time."
(put 'telnet-mode 'mode-class 'special)
(define-derived-mode telnet-mode comint-mode "Telnet"
- "This mode is for using telnet (or rsh) from a buffer to another host.
+ "This mode is for using telnet from a buffer to another host.
It has most of the same commands as `comint-mode'.
There is a variable `telnet-interrupt-string' which is the character
sent to try to stop execution of a job on the remote host.
@@ -261,6 +259,7 @@ Data is sent to the remote host when RET is typed."
"Open a network login connection to host named HOST (a string).
Communication with HOST is recorded in a buffer `*rsh-HOST*'.
Normally input is edited in Emacs and sent a line at a time."
+ (declare (obsolete nil "29.1"))
(interactive "sOpen rsh connection to host: ")
(require 'shell)
(let ((name (concat "rsh-" host )))
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 9981cc3c138..b504ce600d1 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -270,7 +270,7 @@ arguments to pass to the OPERATION."
"Parse `file-attributes' for Tramp files using the ls(1) command."
(with-current-buffer (tramp-get-buffer vec)
(goto-char (point-min))
- (let ((file-properties nil))
+ (let (file-properties)
(while (re-search-forward tramp-adb-ls-toolbox-regexp nil t)
(let* ((mod-string (match-string 1))
(is-dir (eq ?d (aref mod-string 0)))
@@ -1289,8 +1289,7 @@ connection if a previous connection has died for some reason."
"echo \\\"`getprop ro.product.model` "
"`getprop ro.product.version` "
"`getprop ro.build.version.release`\\\""))
- (let ((old-getprop
- (tramp-get-connection-property vec "getprop" nil))
+ (let ((old-getprop (tramp-get-connection-property vec "getprop"))
(new-getprop
(tramp-set-connection-property
vec "getprop"
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index a0cbfed64ea..dbebcad1a84 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -129,7 +129,7 @@ If KEY is `tramp-cache-undefined', don't create anything, and return nil."
hash))))
;;;###tramp-autoload
-(defun tramp-get-file-property (key file property default)
+(defun tramp-get-file-property (key file property &optional default)
"Get the PROPERTY of FILE from the cache context of KEY.
Return DEFAULT if not set."
;; Unify localname. Remove hop from `tramp-file-name' structure.
@@ -240,7 +240,7 @@ Return VALUE."
(defun tramp-flush-file-properties (key file)
"Remove all properties of FILE in the cache context of KEY."
(let* ((file (tramp-run-real-handler #'directory-file-name (list file)))
- (truename (tramp-get-file-property key file "file-truename" nil)))
+ (truename (tramp-get-file-property key file "file-truename")))
;; Unify localname. Remove hop from `tramp-file-name' structure.
(setq file (tramp-compat-file-name-unquote file)
key (copy-tramp-file-name key))
@@ -262,7 +262,7 @@ Remove also properties of all files in subdirectories."
(setq directory (tramp-compat-file-name-unquote directory))
(let* ((directory (tramp-run-real-handler
#'directory-file-name (list directory)))
- (truename (tramp-get-file-property key directory "file-truename" nil)))
+ (truename (tramp-get-file-property key directory "file-truename")))
(tramp-message key 8 "%s" directory)
(dolist (key (hash-table-keys tramp-cache-data))
(when (and (tramp-file-name-p key)
@@ -311,7 +311,7 @@ This is suppressed for temporary buffers."
;;; -- Properties --
;;;###tramp-autoload
-(defun tramp-get-connection-property (key property default)
+(defun tramp-get-connection-property (key property &optional default)
"Get the named PROPERTY for the connection.
KEY identifies the connection, it is either a process or a
`tramp-file-name' structure. A special case is nil, which is
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 006683bdcc8..bd2dbf4a1e0 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -135,7 +135,7 @@ When called interactively, a Tramp connection has to be selected."
(get-buffer (tramp-debug-buffer-name vec)))
(unless keep-debug
(get-buffer (tramp-trace-buffer-name vec)))
- (tramp-get-connection-property vec "process-buffer" nil)))
+ (tramp-get-connection-property vec "process-buffer")))
(when (bufferp buf) (kill-buffer buf)))
;; Flush file cache.
@@ -722,7 +722,7 @@ the debug buffer(s).")
(when (y-or-n-p "Do you want to append the buffer(s)?")
;; OK, let's send. First we delete the buffer list.
- (kill-buffer nil)
+ (kill-buffer)
(switch-to-buffer curbuf)
(goto-char (point-max))
(insert (propertize "\n" 'display "\n\
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index bd6d53afcb8..a12e4859ac4 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -31,7 +31,7 @@
(require 'auth-source)
(require 'format-spec)
-(require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'.
+(require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'.
(require 'parse-time)
(require 'shell)
(require 'subr-x)
@@ -234,7 +234,7 @@ CONDITION can also be a list of error conditions."
(if (fboundp 'string-replace)
#'string-replace
(lambda (from-string to-string in-string)
- (let ((case-fold-search nil))
+ (let (case-fold-search)
(replace-regexp-in-string
(regexp-quote from-string) to-string in-string t t)))))
@@ -243,7 +243,7 @@ CONDITION can also be a list of error conditions."
(if (fboundp 'string-search)
#'string-search
(lambda (needle haystack &optional start-pos)
- (let ((case-fold-search nil))
+ (let (case-fold-search)
(string-match-p (regexp-quote needle) haystack start-pos)))))
;; Function `make-lock-file-name' is new in Emacs 28.1.
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index ca7bcf35ce4..6cb1237a0f4 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -151,7 +151,7 @@ If NAME doesn't belong to a crypted remote directory, retun nil."
(dolist (dir tramp-crypt-directories)
(and (string-prefix-p
dir (file-name-as-directory (expand-file-name name)))
- (throw 'crypt-file-name-p dir))))))
+ (throw 'crypt-file-name-p dir))))))
;; New handlers should be added here.
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 7a13760ffc9..dd7e0f9f342 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -125,7 +125,7 @@ pass to the OPERATION."
;; "ftp" method is used in the Tramp file name. So we unset
;; those values.
(ange-ftp-ftp-name-arg "")
- (ange-ftp-ftp-name-res nil))
+ ange-ftp-ftp-name-res)
(cond
;; If argument is a symlink, `file-directory-p' and
;; `file-exists-p' call the traversed file recursively. So we
diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el
index 20be74a79b7..2ff106d6023 100644
--- a/lisp/net/tramp-fuse.el
+++ b/lisp/net/tramp-fuse.el
@@ -153,7 +153,7 @@
(defun tramp-fuse-mount-point (vec)
"Return local mount point of VEC."
- (or (tramp-get-connection-property vec "mount-point" nil)
+ (or (tramp-get-connection-property vec "mount-point")
(expand-file-name
(concat
tramp-temp-name-prefix
@@ -177,7 +177,7 @@ It has the same meaning as `remote-file-name-inhibit-cache'.")
;; cannot use `with-tramp-file-property', because we don't want to
;; cache a nil result.
(let ((remote-file-name-inhibit-cache tramp-fuse-mount-timeout))
- (or (tramp-get-file-property vec "/" "mounted" nil)
+ (or (tramp-get-file-property vec "/" "mounted")
(let* ((default-directory tramp-compat-temporary-file-directory)
(command (format "mount -t fuse.%s" (tramp-file-name-method vec)))
(mount (shell-command-to-string command)))
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 07e084768ab..056237fd55c 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1020,7 +1020,7 @@ file names."
;; We cannot copy or rename directly.
((or (and equal-remote
- (tramp-get-connection-property v "direct-copy-failed" nil))
+ (tramp-get-connection-property v "direct-copy-failed"))
(and t1 (not (tramp-gvfs-file-name-p filename)))
(and t2 (not (tramp-gvfs-file-name-p newname))))
(let ((tmpfile (tramp-compat-make-temp-file filename)))
@@ -1057,7 +1057,7 @@ file names."
(if (or (not equal-remote)
(and equal-remote
(tramp-get-connection-property
- v "direct-copy-failed" nil)))
+ v "direct-copy-failed")))
;; Propagate the error.
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
@@ -1145,7 +1145,7 @@ file names."
(setq name (tramp-compat-file-name-concat dir name)))
;; If NAME is not a Tramp file, run the real handler.
(if (not (tramp-tramp-file-p name))
- (tramp-run-real-handler #'expand-file-name (list name nil))
+ (tramp-run-real-handler #'expand-file-name (list name))
;; Dissect NAME.
(with-parsed-tramp-file-name name nil
;; If there is a default location, expand tilde.
@@ -1336,32 +1336,29 @@ If FILE-SYSTEM is non-nil, return file system attributes."
(or (cdr (assoc "standard::size" attributes)) "0")))
;; ... file mode flags
(setq res-filemodes
- (let ((n (cdr (assoc "unix::mode" attributes))))
- (if n
- (tramp-file-mode-from-int (string-to-number n))
- (format
- "%s%s%s%s------"
- (if dirp "d" (if res-symlink-target "l" "-"))
- (if (equal (cdr (assoc "access::can-read" attributes))
- "FALSE")
- "-" "r")
- (if (equal (cdr (assoc "access::can-write" attributes))
- "FALSE")
- "-" "w")
- (if (equal (cdr (assoc "access::can-execute" attributes))
- "FALSE")
- "-" "x")))))
+ (if-let ((n (cdr (assoc "unix::mode" attributes))))
+ (tramp-file-mode-from-int (string-to-number n))
+ (format
+ "%s%s%s%s------"
+ (if dirp "d" (if res-symlink-target "l" "-"))
+ (if (equal (cdr (assoc "access::can-read" attributes))
+ "FALSE")
+ "-" "r")
+ (if (equal (cdr (assoc "access::can-write" attributes))
+ "FALSE")
+ "-" "w")
+ (if (equal (cdr (assoc "access::can-execute" attributes))
+ "FALSE")
+ "-" "x"))))
;; ... inode and device
(setq res-inode
- (let ((n (cdr (assoc "unix::inode" attributes))))
- (if n
- (string-to-number n)
- (tramp-get-inode (tramp-dissect-file-name filename)))))
+ (if-let ((n (cdr (assoc "unix::inode" attributes))))
+ (string-to-number n)
+ (tramp-get-inode (tramp-dissect-file-name filename))))
(setq res-device
- (let ((n (cdr (assoc "unix::device" attributes))))
- (if n
- (string-to-number n)
- (tramp-get-device (tramp-dissect-file-name filename)))))
+ (if-let ((n (cdr (assoc "unix::device" attributes))))
+ (string-to-number n)
+ (tramp-get-device (tramp-dissect-file-name filename))))
;; Return data gathered.
(list
@@ -1582,8 +1579,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
(with-current-buffer (tramp-get-connection-buffer vec)
(goto-char (point-min))
(when (looking-at-p "gio: Operation not supported")
- (tramp-set-connection-property vec key nil)))
- nil))))
+ (tramp-set-connection-property vec key nil)))))))
(defun tramp-gvfs-handle-set-file-modes (filename mode &optional flag)
"Like `set-file-modes' for Tramp files."
@@ -1612,12 +1608,11 @@ If FILE-SYSTEM is non-nil, return file system attributes."
If USER is a string, return its home directory instead of the
user identified by VEC. If there is no user specified in either
VEC or USER, or if there is no home directory, return nil."
- (let ((localname
- (tramp-get-connection-property vec "default-location" nil))
+ (let ((localname (tramp-get-connection-property vec "default-location"))
result)
(cond
((zerop (length localname))
- (tramp-get-connection-property (tramp-get-process vec) "share" nil))
+ (tramp-get-connection-property (tramp-get-process vec) "share"))
;; Google-drive.
((not (string-prefix-p "/" localname))
(dolist (item
@@ -1634,8 +1629,7 @@ ID-FORMAT valid values are `string' and `integer'."
(if (equal id-format 'string)
(tramp-file-name-user vec)
(when-let ((localname
- (tramp-get-connection-property
- (tramp-get-process vec) "share" nil)))
+ (tramp-get-connection-property (tramp-get-process vec) "share")))
(file-attribute-user-id
(file-attributes (tramp-make-tramp-file-name vec localname) id-format)))))
@@ -1643,8 +1637,7 @@ ID-FORMAT valid values are `string' and `integer'."
"The gid of the remote connection VEC, in ID-FORMAT.
ID-FORMAT valid values are `string' and `integer'."
(when-let ((localname
- (tramp-get-connection-property
- (tramp-get-process vec) "share" nil)))
+ (tramp-get-connection-property (tramp-get-process vec) "share")))
(file-attribute-group-id
(file-attributes (tramp-make-tramp-file-name vec localname) id-format))))
@@ -1682,7 +1675,7 @@ ID-FORMAT valid values are `string' and `integer'."
(concat (tramp-gvfs-get-remote-prefix v) localname)))
(when (string-equal "mtp" method)
(when-let
- ((media (tramp-get-connection-property v "media-device" nil)))
+ ((media (tramp-get-connection-property v "media-device")))
(setq method (tramp-media-device-method media)
host (tramp-media-device-host media)
port (tramp-media-device-port media))))
@@ -1757,7 +1750,7 @@ a downcased host name only."
(setq domain (read-string "Domain name: ")))
(tramp-message l 6 "%S %S %S %d" message user domain flags)
- (unless (tramp-get-connection-property l "first-password-request" nil)
+ (unless (tramp-get-connection-property l "first-password-request")
(tramp-clear-passwd l))
(setq password (tramp-read-passwd
@@ -1879,14 +1872,13 @@ Their full names are \"org.gtk.vfs.MountTracker.mounted\" and
(when (member method tramp-media-methods)
;; Ensure that media devices are cached.
(tramp-get-media-devices nil)
- (let ((v (tramp-get-connection-property
- (make-tramp-media-device
- :method method :host host :port port)
- "vector" nil)))
- (when v
- (setq method (tramp-file-name-method v)
- host (tramp-file-name-host v)
- port (tramp-file-name-port v)))))
+ (when-let ((v (tramp-get-connection-property
+ (make-tramp-media-device
+ :method method :host host :port port)
+ "vector" nil)))
+ (setq method (tramp-file-name-method v)
+ host (tramp-file-name-host v)
+ port (tramp-file-name-port v))))
(when (member method tramp-gvfs-methods)
(let ((v (make-tramp-file-name
:method method :user user :domain domain
@@ -1924,15 +1916,14 @@ Their full names are \"org.gtk.vfs.MountTracker.mounted\" and
(defun tramp-gvfs-connection-mounted-p (vec)
"Check, whether the location is already mounted."
(or
- (tramp-get-file-property vec "/" "fuse-mountpoint" nil)
+ (tramp-get-file-property vec "/" "fuse-mountpoint")
(catch 'mounted
(dolist
(elt
(with-tramp-file-property vec "/" "list-mounts"
(with-tramp-dbus-call-method vec t
:session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
- tramp-gvfs-interface-mounttracker tramp-gvfs-listmounts))
- nil)
+ tramp-gvfs-interface-mounttracker tramp-gvfs-listmounts)))
;; Jump over the first elements of the mount info. Since there
;; were changes in the entries, we cannot access dedicated
;; elements.
@@ -1981,14 +1972,13 @@ Their full names are \"org.gtk.vfs.MountTracker.mounted\" and
(when (member method tramp-media-methods)
;; Ensure that media devices are cached.
(tramp-get-media-devices vec)
- (let ((v (tramp-get-connection-property
- (make-tramp-media-device
- :method method :host host :port port)
- "vector" nil)))
- (when v
- (setq method (tramp-file-name-method v)
- host (tramp-file-name-host v)
- port (tramp-file-name-port v)))))
+ (when-let ((v (tramp-get-connection-property
+ (make-tramp-media-device
+ :method method :host host :port port)
+ "vector")))
+ (setq method (tramp-file-name-method v)
+ host (tramp-file-name-host v)
+ port (tramp-file-name-port v))))
(when (and
(string-equal method (tramp-file-name-method vec))
(string-equal user (tramp-file-name-user vec))
@@ -2244,7 +2234,7 @@ connection if a previous connection has died for some reason."
(tramp-error
vec 'file-error
"Timeout reached mounting %s@%s using %s" user host method)))
- (while (not (tramp-get-file-property vec "/" "fuse-mountpoint" nil))
+ (while (not (tramp-get-file-property vec "/" "fuse-mountpoint"))
(read-event nil nil 0.1)))
;; If `tramp-gvfs-handler-askquestion' has returned "No", it
@@ -2382,11 +2372,11 @@ It checks for registered GNOME Online Accounts."
(defun tramp-get-media-device (vec)
"Transform VEC into a `tramp-media-device' structure.
Check, that respective cache values do exist."
- (if-let ((media (tramp-get-connection-property vec "media-device" nil))
- (prop (tramp-get-connection-property media "vector" nil)))
+ (if-let ((media (tramp-get-connection-property vec "media-device"))
+ (prop (tramp-get-connection-property media "vector")))
media
(tramp-get-media-devices vec)
- (tramp-get-connection-property vec "media-device" nil)))
+ (tramp-get-connection-property vec "media-device")))
(defun tramp-get-media-devices (vec)
"Retrieve media devices, and cache them.
@@ -2431,9 +2421,9 @@ It checks for mounted media devices."
(lambda (key)
(and (tramp-media-device-p key)
(string-equal service (tramp-media-device-method key))
- (tramp-get-connection-property key "vector" nil)
+ (tramp-get-connection-property key "vector")
(list nil (tramp-file-name-host
- (tramp-get-connection-property key "vector" nil)))))
+ (tramp-get-connection-property key "vector")))))
(hash-table-keys tramp-cache-data)))
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el
index 5e51074c494..226113d8800 100644
--- a/lisp/net/tramp-integration.el
+++ b/lisp/net/tramp-integration.el
@@ -108,7 +108,7 @@ been set up by `rfn-eshadow-setup-minibuffer'."
end))
(point-max))
(let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
- (rfn-eshadow-update-overlay-hook nil)
+ rfn-eshadow-update-overlay-hook
file-name-handler-alist)
(move-overlay rfn-eshadow-overlay (point-max) (point-max))
(rfn-eshadow-update-overlay))))))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index f2e91a1977e..174fde720e4 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1146,8 +1146,8 @@ component is used as the target of the symlink."
;; Use Perl implementation.
((and (tramp-get-remote-perl v)
- (tramp-get-connection-property v "perl-file-spec" nil)
- (tramp-get-connection-property v "perl-cwd-realpath" nil))
+ (tramp-get-connection-property v "perl-file-spec")
+ (tramp-get-connection-property v "perl-cwd-realpath"))
(tramp-maybe-send-script
v tramp-perl-file-truename "tramp_perl_file_truename")
(setq result
@@ -1185,9 +1185,9 @@ component is used as the target of the symlink."
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property v localname "file-exists-p"
(or (not (null (tramp-get-file-property
- v localname "file-attributes-integer" nil)))
+ v localname "file-attributes-integer")))
(not (null (tramp-get-file-property
- v localname "file-attributes-string" nil)))
+ v localname "file-attributes-string")))
(tramp-send-command-and-check
v
(format
@@ -1463,7 +1463,7 @@ of."
v (format
"env TZ=UTC %s %s %s %s"
(tramp-get-remote-touch v)
- (if (tramp-get-connection-property v "touch-t" nil)
+ (if (tramp-get-connection-property v "touch-t")
(format "-t %s" (format-time-string "%Y%m%d%H%M.%S" time t))
"")
(if (eq flag 'nofollow) "-h" "")
@@ -2350,7 +2350,7 @@ The method used must be an out-of-band method."
?h (or (tramp-file-name-host v) "")
?u (or (tramp-file-name-user v)
;; There might be an interactive setting.
- (tramp-get-connection-property v "login-as" nil)
+ (tramp-get-connection-property v "login-as")
"")
;; For direct remote copying, the port must be the
;; same for source and target.
@@ -2771,7 +2771,7 @@ the result will be a local, non-Tramp, file name."
(with-parsed-tramp-file-name name nil
;; If connection is not established yet, run the real handler.
(if (not (tramp-connectable-p v))
- (tramp-run-real-handler #'expand-file-name (list name nil))
+ (tramp-run-real-handler #'expand-file-name (list name))
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
(setq localname (concat "~/" localname)))
;; Tilde expansion if necessary. This needs a shell which
@@ -3976,7 +3976,7 @@ Only send the definition if it has not already been done."
;; We cannot let-bind (tramp-get-connection-process vec) because it
;; might be nil.
(let ((scripts (tramp-get-connection-property
- (tramp-get-connection-process vec) "scripts" nil)))
+ (tramp-get-connection-process vec) "scripts")))
(unless (member name scripts)
(with-tramp-progress-reporter
vec 5 (format-message "Sending script `%s'" name)
@@ -4226,7 +4226,7 @@ file exists and nonzero exit status otherwise."
(defun tramp-find-shell (vec)
"Open a shell on the remote host which groks tilde expansion."
;; If we are in `make-process', we don't need another shell.
- (unless (tramp-get-connection-property vec "process-name" nil)
+ (unless (tramp-get-connection-property vec "process-name")
(with-current-buffer (tramp-get-buffer vec)
(let ((default-shell (tramp-get-method-parameter vec 'tramp-remote-shell))
shell)
@@ -4323,11 +4323,10 @@ process to set up. VEC specifies the connection."
;; connection properties. We start again with
;; `tramp-maybe-open-connection', it will be caught there.
(tramp-message vec 5 "Checking system information")
- (let* ((old-uname (tramp-get-connection-property vec "uname" nil))
+ (let* ((old-uname (tramp-get-connection-property vec "uname"))
(uname
;; If we are in `make-process', we don't need to recompute.
- (if (and old-uname
- (tramp-get-connection-property vec "process-name" nil))
+ (if (and old-uname (tramp-get-connection-property vec "process-name"))
old-uname
(tramp-set-connection-property
vec "uname"
@@ -4935,7 +4934,7 @@ Goes through the list `tramp-inline-compress-commands'."
"Close the connection VEC after a session timeout.
If there is just some editing, retry it after 5 seconds."
(if (and (tramp-get-connection-property
- (tramp-get-connection-process vec) "locked" nil)
+ (tramp-get-connection-process vec) "locked")
(tramp-file-name-equal-p vec (car tramp-current-connection)))
(progn
(tramp-message
@@ -4954,7 +4953,7 @@ connection if a previous connection has died for some reason."
(throw 'non-essential 'non-essential))
(let ((p (tramp-get-connection-process vec))
- (process-name (tramp-get-connection-property vec "process-name" nil))
+ (process-name (tramp-get-connection-property vec "process-name"))
(process-environment (copy-sequence process-environment))
(pos (with-current-buffer (tramp-get-connection-buffer vec) (point))))
@@ -5168,9 +5167,9 @@ connection if a previous connection has died for some reason."
previous-hop hop)))
;; Activate session timeout.
- (when (tramp-get-connection-property p "session-timeout" nil)
+ (when (tramp-get-connection-property p "session-timeout")
(run-at-time
- (tramp-get-connection-property p "session-timeout" nil) nil
+ (tramp-get-connection-property p "session-timeout") nil
#'tramp-timeout-session vec))
;; Make initial shell settings.
@@ -5192,7 +5191,7 @@ is meant to be used from `tramp-maybe-open-connection' only. The
function waits for output unless NOOUTPUT is set."
(unless neveropen (tramp-maybe-open-connection vec))
(let ((p (tramp-get-connection-process vec)))
- (when (tramp-get-connection-property p "remote-echo" nil)
+ (when (tramp-get-connection-property p "remote-echo")
;; We mark the command string that it can be erased in the output buffer.
(tramp-set-connection-property p "check-remote-echo" t)
;; If we put `tramp-echo-mark' after a trailing newline (which
@@ -5959,7 +5958,7 @@ If no corresponding command is found, nil is returned."
(> size tramp-inline-compress-start-size))
(with-tramp-connection-property (tramp-get-process vec) prop
(tramp-find-inline-compress vec)
- (tramp-get-connection-property (tramp-get-process vec) prop nil))))
+ (tramp-get-connection-property (tramp-get-process vec) prop))))
(defun tramp-get-inline-coding (vec prop size)
"Return the coding command related to PROP.
@@ -5979,7 +5978,7 @@ function cell is returned to be applied on a buffer."
(let ((coding
(with-tramp-connection-property (tramp-get-process vec) prop
(tramp-find-inline-encoding vec)
- (tramp-get-connection-property (tramp-get-process vec) prop nil)))
+ (tramp-get-connection-property (tramp-get-process vec) prop)))
(prop1 (if (tramp-compat-string-search "encoding" prop)
"inline-compress" "inline-decompress"))
compress)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 528463c5a7b..b717c4dcc38 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -748,7 +748,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq name (tramp-compat-file-name-concat dir name)))
;; If NAME is not a Tramp file, run the real handler.
(if (not (tramp-tramp-file-p name))
- (tramp-run-real-handler #'expand-file-name (list name nil))
+ (tramp-run-real-handler #'expand-file-name (list name))
;; Dissect NAME.
(with-parsed-tramp-file-name name nil
;; Tilde expansion if necessary.
@@ -1385,7 +1385,7 @@ component is used as the target of the symlink."
(when tmpinput (delete-file tmpinput))
;; FIXME: Does connection-property "process-buffer" still exist?
(unless outbuf
- (kill-buffer (tramp-get-connection-property v "process-buffer" nil)))
+ (kill-buffer (tramp-get-connection-property v "process-buffer")))
(when process-file-side-effects
(tramp-flush-directory-properties v ""))
@@ -1700,7 +1700,7 @@ Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
(setq localname (or localname "/"))
(with-tramp-file-property v localname "file-entries"
(let* ((share (tramp-smb-get-share v))
- (cache (tramp-get-connection-property v "share-cache" nil))
+ (cache (tramp-get-connection-property v "share-cache"))
res entry)
(if (and (not share) cache)
@@ -2029,7 +2029,7 @@ If ARGUMENT is non-nil, use it as argument for
(if (not (zerop (length user))) (concat user "@") "")
host (or share ""))
- (let* ((coding-system-for-read nil)
+ (let* (coding-system-for-read
(process-connection-type tramp-process-connection-type)
(p (let ((default-directory
tramp-compat-temporary-file-directory)
diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el
index 61bf165f308..d7c918fbc83 100644
--- a/lisp/net/tramp-sshfs.el
+++ b/lisp/net/tramp-sshfs.el
@@ -449,7 +449,7 @@ connection if a previous connection has died for some reason."
(funcall orig-fun)))
(add-function
- :around (symbol-function #'shell-mode) #'tramp-sshfs-tolerate-tilde)
+ :around (symbol-function #'shell-mode) #'tramp-sshfs-tolerate-tilde)
(add-hook 'tramp-sshfs-unload-hook
(lambda ()
(remove-function
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 9d5a02456ec..0198aacf15a 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -106,8 +106,8 @@ Any level x includes messages for all levels 1 .. x-1. The levels are
4 activities
5 internal
6 sent and received strings
- 7 file caching
- 8 connection properties
+ 7 connection properties
+ 8 file caching
9 test commands
10 traces (huge)
11 call traces (maintainer only)."
@@ -621,7 +621,7 @@ This regexp must match both `tramp-initial-end-of-output' and
"Regexp matching password-like prompts.
The regexp should match at end of buffer.
-This variable is, by default, initialised from
+This variable is, by default, initialized from
`password-word-equivalents' when Tramp is loaded, and it is
usually more convenient to add new passphrases to that variable
instead of altering this variable.
@@ -1384,7 +1384,8 @@ would require an immediate reread during filename completion, nil
means to use always cached values for the directory contents."
:type '(choice (const nil) (const t) integer))
(make-obsolete-variable
- 'tramp-completion-reread-directory-timeout 'remote-file-name-inhibit-cache "27.2")
+ 'tramp-completion-reread-directory-timeout
+ 'remote-file-name-inhibit-cache "27.2")
;;; Internal Variables:
@@ -1501,7 +1502,7 @@ entry does not exist, return nil."
(replace-regexp-in-string "^tramp-" "" (symbol-name param))))
(if (tramp-connection-property-p vec hash-entry)
;; We use the cached property.
- (tramp-get-connection-property vec hash-entry nil)
+ (tramp-get-connection-property vec hash-entry)
;; Use the static value from `tramp-methods'.
(when-let ((methods-entry
(assoc
@@ -1837,7 +1838,7 @@ Unless DONT-CREATE, the buffer is created when it doesn't exist yet."
;; as indication, whether a connection is active.
(tramp-set-connection-property
vec "process-buffer"
- (tramp-get-connection-property vec "process-buffer" nil))
+ (tramp-get-connection-property vec "process-buffer"))
(setq buffer-undo-list t
default-directory
(tramp-make-tramp-file-name vec 'noloc))
@@ -1848,14 +1849,14 @@ Unless DONT-CREATE, the buffer is created when it doesn't exist yet."
Unless DONT-CREATE, the buffer is created when it doesn't exist yet.
In case a second asynchronous communication has been started, it is different
from `tramp-get-buffer'."
- (or (tramp-get-connection-property vec "process-buffer" nil)
+ (or (tramp-get-connection-property vec "process-buffer")
(tramp-get-buffer vec dont-create)))
(defun tramp-get-connection-name (vec)
"Get the connection name to be used for VEC.
In case a second asynchronous communication has been started, it is different
from the default one."
- (or (tramp-get-connection-property vec "process-name" nil)
+ (or (tramp-get-connection-property vec "process-name")
(tramp-buffer-name vec)))
(defun tramp-get-process (vec-or-proc)
@@ -1956,7 +1957,7 @@ The outline level is equal to the verbosity of the Tramp message."
They are completed by \"M-x TAB\" only in Tramp debug buffers."
(with-current-buffer buffer
(string-equal
- (buffer-substring (point-min) (min 10 (point-max))) ";; Emacs:")))
+ (buffer-substring (point-min) (min (+ (point-min) 10) (point-max))) ";; Emacs:")))
(put #'tramp-debug-buffer-command-completion-p 'tramp-suppress-trace t)
@@ -2352,7 +2353,7 @@ without a visible progress reporter."
;; running, and when there is a minimum level.
(when-let ((pr (and (null tramp-inhibit-progress-reporter)
(<= ,level (min tramp-verbose 3))
- (make-progress-reporter ,message nil nil))))
+ (make-progress-reporter ,message))))
(run-at-time 3 0.1 #'tramp-progress-reporter-update pr))))
(unwind-protect
;; Execute the body.
@@ -3521,7 +3522,7 @@ Let-bind it when necessary.")
;; home directory.
(tramp-get-home-directory vec)
;; Otherwise, just use the cached value.
- (tramp-get-connection-property vec "~" nil))))
+ (tramp-get-connection-property vec "~"))))
(when home-dir
(setq home-dir
(tramp-compat-funcall
@@ -3651,7 +3652,7 @@ Let-bind it when necessary.")
(setq name (tramp-compat-file-name-concat dir name)))
;; If NAME is not a Tramp file, run the real handler.
(if (not (tramp-tramp-file-p name))
- (tramp-run-real-handler #'expand-file-name (list name nil))
+ (tramp-run-real-handler #'expand-file-name (list name))
;; Dissect NAME.
(with-parsed-tramp-file-name name nil
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
@@ -3881,7 +3882,7 @@ Let-bind it when necessary.")
(let* ((o (tramp-dissect-file-name filename))
(p (tramp-get-connection-process o))
(c (and (process-live-p p)
- (tramp-get-connection-property p "connected" nil))))
+ (tramp-get-connection-property p "connected"))))
;; We expand the file name only, if there is already a connection.
(with-parsed-tramp-file-name
(if c (expand-file-name filename) filename) nil
@@ -4567,7 +4568,7 @@ substitution. SPEC-LIST is a list of char/value pairs used for
(and ;; The method supports it.
(tramp-get-method-parameter v 'tramp-direct-async)
;; It has been indicated.
- (tramp-get-connection-property v "direct-async-process" nil)
+ (tramp-get-connection-property v "direct-async-process")
;; There's no multi-hop.
(or (not (tramp-multi-hop-p v))
(= (length (tramp-compute-multi-hops v)) 1))
@@ -4848,7 +4849,7 @@ support symbolic links."
(prog1
;; Run the process.
- (process-file-shell-command command nil buffer nil)
+ (process-file-shell-command command nil buffer)
;; Insert error messages if they were separated.
(when error-file
(with-current-buffer error-buffer
@@ -5073,8 +5074,7 @@ of."
;; Sometimes, the process returns a new password request
;; immediately after rejecting the previous (wrong) one.
(unless (or tramp-password-prompt-not-unique
- (tramp-get-connection-property
- vec "first-password-request" nil))
+ (tramp-get-connection-property vec "first-password-request"))
(tramp-clear-passwd vec))
(goto-char (point-min))
(tramp-check-for-regexp proc tramp-process-action-regexp)
@@ -5318,7 +5318,7 @@ performed successfully. Any other value means an error."
"Lock PROC for other communication, and run BODY.
Mostly useful to protect BODY from being interrupted by timers."
(declare (indent 1) (debug t))
- `(if (tramp-get-connection-property ,proc "locked" nil)
+ `(if (tramp-get-connection-property ,proc "locked")
;; Be kind for older Emacsen.
(if (member 'remote-file-error debug-ignored-errors)
(throw 'non-essential 'non-essential)
@@ -5371,7 +5371,7 @@ Erase echoed commands if exists."
;; Check whether we need to remove echo output. The max length of
;; the echo mark regexp is taken for search. We restrict the
;; search for the second echo mark to PIPE_BUF characters.
- (when (and (tramp-get-connection-property proc "check-remote-echo" nil)
+ (when (and (tramp-get-connection-property proc "check-remote-echo")
(re-search-forward
tramp-echoed-echo-mark-regexp
(+ (point) (* 5 tramp-echo-mark-marker-length)) t))
@@ -5387,7 +5387,7 @@ Erase echoed commands if exists."
(delete-region begin (point))
(goto-char (point-min)))))
- (when (or (not (tramp-get-connection-property proc "check-remote-echo" nil))
+ (when (or (not (tramp-get-connection-property proc "check-remote-echo"))
;; Sometimes, the echo string is suppressed on the remote side.
(not (string-equal
(substring-no-properties
@@ -5449,7 +5449,7 @@ The STRING is expected to use Unix line-endings, but the lines sent to
the remote host use line-endings as defined in the variable
`tramp-rsh-end-of-line'. The communication buffer is erased before sending."
(let* ((p (tramp-get-connection-process vec))
- (chunksize (tramp-get-connection-property p "chunksize" nil)))
+ (chunksize (tramp-get-connection-property p "chunksize")))
(unless p
(tramp-error
vec 'file-error "Can't send string to remote host -- not logged in"))
@@ -5487,7 +5487,7 @@ the remote host use line-endings as defined in the variable
(unless (process-live-p proc)
(let ((vec (process-get proc 'vector))
(buf (process-buffer proc))
- (prompt (tramp-get-connection-property proc "prompt" nil)))
+ (prompt (tramp-get-connection-property proc "prompt")))
(when vec
(tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event)
(tramp-flush-connection-properties proc)
@@ -5711,7 +5711,7 @@ VEC is used for tracing."
"Check `file-attributes' caches for VEC.
Return t if according to the cache access type ACCESS is known to
be granted."
- (let ((result nil)
+ (let (result
(offset (cond
((eq ?r access) 1)
((eq ?w access) 2)
@@ -6055,7 +6055,7 @@ Consults the auth-source package."
(key (tramp-make-tramp-file-name vec 'noloc))
(method (tramp-file-name-method vec))
(user (or (tramp-file-name-user-domain vec)
- (tramp-get-connection-property key "login-as" nil)))
+ (tramp-get-connection-property key "login-as")))
(host (tramp-file-name-host-port vec))
(pw-prompt
(or prompt
@@ -6078,8 +6078,7 @@ Consults the auth-source package."
(setq tramp-password-save-function nil)
;; See if auth-sources contains something useful.
(ignore-errors
- (and (tramp-get-connection-property
- vec "first-password-request" nil)
+ (and (tramp-get-connection-property vec "first-password-request")
;; Try with Tramp's current method. If there is no
;; user name, `:create' triggers to ask for. We
;; suppress it.
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 9a2f495eb8c..2b39add20d9 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -52,9 +52,9 @@
;; Suppress message from `emacs-repository-get-branch'. We must
;; also handle out-of-tree builds.
(let ((inhibit-message t)
- (debug-on-error nil)
(dir (or (locate-dominating-file (locate-library "tramp") ".git")
- source-directory)))
+ source-directory))
+ debug-on-error)
;; `emacs-repository-get-branch' has been introduced with Emacs 27.1.
(with-no-warnings
(and (stringp dir) (file-directory-p dir)
@@ -67,9 +67,9 @@
;; Suppress message from `emacs-repository-get-version'. We must
;; also handle out-of-tree builds.
(let ((inhibit-message t)
- (debug-on-error nil)
(dir (or (locate-dominating-file (locate-library "tramp") ".git")
- source-directory)))
+ source-directory))
+ debug-on-error)
(and (stringp dir) (file-directory-p dir)
(executable-find "git")
(emacs-repository-get-version dir))))
@@ -104,7 +104,7 @@
("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2")
("2.3.5.26.3" . "26.3")
("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2")
- ("2.5.2.28.1" . "28.1")))
+ ("2.5.2.28.1" . "28.1") ("2.5.3.28.2" . "28.2")))
(add-hook 'tramp-unload-hook
(lambda ()
diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el
index b2ef47898cd..9886a4c79d8 100644
--- a/lisp/net/webjump.el
+++ b/lisp/net/webjump.el
@@ -79,6 +79,14 @@
:prefix "webjump-"
:group 'browse-url)
+(defcustom webjump-use-internal-browser nil
+ "Whether or not to force the use of an internal browser.
+If non-nil, WebJump will always use an internal browser (such as
+EWW or xwidget-webkit) to open web pages, as opposed to an
+external browser like IceCat."
+ :version "29.1"
+ :type 'boolean)
+
(defconst webjump-sample-sites
'(
;; FSF, not including Emacs-specific.
@@ -255,18 +263,32 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
webjump-sites t))
(name (car item))
(expr (cdr item)))
- (browse-url (webjump-url-fix
- (cond ((not expr) "")
- ((stringp expr) expr)
- ((vectorp expr) (webjump-builtin expr name))
- ((listp expr) (eval expr t))
- ((symbolp expr)
- (if (fboundp expr)
- (funcall expr name)
- (error "WebJump URL function \"%s\" undefined"
- expr)))
- (t (error "WebJump URL expression for \"%s\" invalid"
- name)))))))
+ (if webjump-use-internal-browser
+ (browse-url-with-browser-kind
+ 'internal (webjump-url-fix
+ (cond ((not expr) "")
+ ((stringp expr) expr)
+ ((vectorp expr) (webjump-builtin expr name))
+ ((listp expr) (eval expr t))
+ ((symbolp expr)
+ (if (fboundp expr)
+ (funcall expr name)
+ (error "WebJump URL function \"%s\" undefined"
+ expr)))
+ (t (error "WebJump URL expression for \"%s\" invalid"
+ name)))))
+ (browse-url (webjump-url-fix
+ (cond ((not expr) "")
+ ((stringp expr) expr)
+ ((vectorp expr) (webjump-builtin expr name))
+ ((listp expr) (eval expr t))
+ ((symbolp expr)
+ (if (fboundp expr)
+ (funcall expr name)
+ (error "WebJump URL function \"%s\" undefined"
+ expr)))
+ (t (error "WebJump URL expression for \"%s\" invalid"
+ name))))))))
(defun webjump-builtin (expr name)
(if (< (length expr) 1)
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 171b7088c10..dfe5c369e2c 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -369,31 +369,29 @@ and, if `nxml-char-ref-display-glyph-flag' is non-nil, a glyph
corresponding to the referenced character following the character
reference.")
-(defvar nxml-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\M-\C-u" 'nxml-backward-up-element)
- (define-key map "\M-\C-d" 'nxml-down-element)
- (define-key map "\M-\C-n" 'nxml-forward-element)
- (define-key map "\M-\C-p" 'nxml-backward-element)
- (define-key map "\M-{" 'nxml-backward-paragraph)
- (define-key map "\M-}" 'nxml-forward-paragraph)
- (define-key map "\M-h" 'nxml-mark-paragraph)
- (define-key map "\C-c\C-f" 'nxml-finish-element)
- (define-key map "\C-c]" 'nxml-finish-element)
- (define-key map "\C-c/" 'nxml-finish-element)
- (define-key map "\C-c\C-m" 'nxml-split-element)
- (define-key map "\C-c\C-b" 'nxml-balanced-close-start-tag-block)
- (define-key map "\C-c\C-i" 'nxml-balanced-close-start-tag-inline)
- (define-key map "\C-c\C-x" 'nxml-insert-xml-declaration)
- (define-key map "\C-c\C-d" 'nxml-dynamic-markup-word)
- ;; u is for Unicode
- (define-key map "\C-c\C-u" 'nxml-insert-named-char)
- (define-key map "\C-c\C-o" nxml-outline-prefix-map)
- (define-key map [S-mouse-2] 'nxml-mouse-hide-direct-text-content)
- (define-key map "/" 'nxml-electric-slash)
- (define-key map "\M-\t" 'completion-at-point)
- map)
- "Keymap for `nxml-mode'.")
+(defvar-keymap nxml-mode-map
+ :doc "Keymap for `nxml-mode'."
+ "C-M-u" #'nxml-backward-up-element
+ "C-M-d" #'nxml-down-element
+ "C-M-n" #'nxml-forward-element
+ "C-M-p" #'nxml-backward-element
+ "M-{" #'nxml-backward-paragraph
+ "M-}" #'nxml-forward-paragraph
+ "M-h" #'nxml-mark-paragraph
+ "C-c C-f" #'nxml-finish-element
+ "C-c ]" #'nxml-finish-element
+ "C-c /" #'nxml-finish-element
+ "C-c C-m" #'nxml-split-element
+ "C-c C-b" #'nxml-balanced-close-start-tag-block
+ "C-c C-i" #'nxml-balanced-close-start-tag-inline
+ "C-c C-x" #'nxml-insert-xml-declaration
+ "C-c C-d" #'nxml-dynamic-markup-word
+ ;; u is for Unicode
+ "C-c C-u" #'nxml-insert-named-char
+ "C-c C-o" nxml-outline-prefix-map
+ "/" #'nxml-electric-slash
+ "M-TAB" #'completion-at-point
+ "S-<mouse-2>" #'nxml-mouse-hide-direct-text-content)
(defvar nxml-font-lock-keywords
'(nxml-fontify-matcher)
diff --git a/lisp/nxml/nxml-outln.el b/lisp/nxml/nxml-outln.el
index 928338a6af9..1518122a79d 100644
--- a/lisp/nxml/nxml-outln.el
+++ b/lisp/nxml/nxml-outln.el
@@ -129,20 +129,18 @@ See the variable `nxml-section-element-name-regexp' for more details."
(defvar nxml-heading-scan-distance 1000
"Maximum distance from section to scan for heading.")
-(defvar nxml-outline-prefix-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-a" 'nxml-show-all)
- (define-key map "\C-t" 'nxml-hide-all-text-content)
- (define-key map "\C-r" 'nxml-refresh-outline)
- (define-key map "\C-c" 'nxml-hide-direct-text-content)
- (define-key map "\C-e" 'nxml-show-direct-text-content)
- (define-key map "\C-d" 'nxml-hide-subheadings)
- (define-key map "\C-s" 'nxml-show)
- (define-key map "\C-k" 'nxml-show-subheadings)
- (define-key map "\C-l" 'nxml-hide-text-content)
- (define-key map "\C-i" 'nxml-show-direct-subheadings)
- (define-key map "\C-o" 'nxml-hide-other)
- map))
+(defvar-keymap nxml-outline-prefix-map
+ "C-a" #'nxml-show-all
+ "C-t" #'nxml-hide-all-text-content
+ "C-r" #'nxml-refresh-outline
+ "C-c" #'nxml-hide-direct-text-content
+ "C-e" #'nxml-show-direct-text-content
+ "C-d" #'nxml-hide-subheadings
+ "C-s" #'nxml-show
+ "C-k" #'nxml-show-subheadings
+ "C-l" #'nxml-hide-text-content
+ "C-i" #'nxml-show-direct-subheadings
+ "C-o" #'nxml-hide-other)
;;; Commands for changing visibility
@@ -693,11 +691,9 @@ non-transparent child section."
(nxml-highlighted-qname (xmltok-end-tag-qname))
nxml-highlighted-greater-than))))
-(defvar nxml-outline-show-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-m" 'nxml-show-direct-text-content)
- (define-key map [mouse-2] 'nxml-mouse-show-direct-text-content)
- map))
+(defvar-keymap nxml-outline-show-map
+ "RET" #'nxml-show-direct-text-content
+ "<mouse-2>" #'nxml-mouse-show-direct-text-content)
(defvar nxml-outline-show-help "mouse-2: show")
@@ -724,12 +720,10 @@ non-transparent child section."
(put 'nxml-outline-display-heading 'evaporate t)
(put 'nxml-outline-display-heading 'face 'nxml-heading)
-(defvar nxml-outline-hiding-tag-map
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-1] 'nxml-mouse-show-direct-subheadings)
- (define-key map [mouse-2] 'nxml-mouse-show-direct-text-content)
- (define-key map "\C-m" 'nxml-show-direct-text-content)
- map))
+(defvar-keymap nxml-outline-hiding-tag-map
+ "<mouse-1>" #'nxml-mouse-show-direct-subheadings
+ "<mouse-2>" #'nxml-mouse-show-direct-text-content
+ "RET" #'nxml-show-direct-text-content)
(defvar nxml-outline-hiding-tag-help
"mouse-1: show subheadings, mouse-2: show text content")
@@ -739,12 +733,10 @@ non-transparent child section."
(put 'nxml-outline-display-hiding-tag 'keymap nxml-outline-hiding-tag-map)
(put 'nxml-outline-display-hiding-tag 'help-echo nxml-outline-hiding-tag-help)
-(defvar nxml-outline-showing-tag-map
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-1] 'nxml-mouse-hide-subheadings)
- (define-key map [mouse-2] 'nxml-mouse-show-direct-text-content)
- (define-key map "\C-m" 'nxml-show-direct-text-content)
- map))
+(defvar-keymap nxml-outline-showing-tag-map
+ "<mouse-1>" #'nxml-mouse-hide-subheadings
+ "<mouse-2>" #'nxml-mouse-show-direct-text-content
+ "RET" #'nxml-show-direct-text-content)
(defvar nxml-outline-showing-tag-help
"mouse-1: hide subheadings, mouse-2: show text content")
diff --git a/lisp/nxml/nxml-parse.el b/lisp/nxml/nxml-parse.el
index ff9eda3fd2a..56ba4480bfa 100644
--- a/lisp/nxml/nxml-parse.el
+++ b/lisp/nxml/nxml-parse.el
@@ -246,7 +246,7 @@ same way as well-formedness error."
parsed-attributes)))
(setq atts (cdr atts)))
;; We want to end up with the attributes followed by the
- ;; the namespace attributes in the same order as
+ ;; namespace attributes in the same order as
;; xmltok-attributes and xmltok-namespace-attributes respectively.
(when parsed-namespace-attributes
(setq parsed-attributes
diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el
index 56ff3b66c0f..b9c980222e2 100644
--- a/lisp/nxml/rng-valid.el
+++ b/lisp/nxml/rng-valid.el
@@ -110,14 +110,14 @@
(defcustom rng-state-cache-distance 2000
"Distance in characters between each parsing and validation state cache."
- :type 'integer)
+ :type 'natnum)
(defcustom rng-validate-chunk-size 8000
"Number of characters in a RELAX NG validation chunk.
A validation chunk will be the smallest chunk that is at least this
size and ends with a tag. After validating a chunk, validation will
continue only if Emacs is still idle."
- :type 'integer)
+ :type 'natnum)
(defcustom rng-validate-delay 1.5
"Time in seconds that Emacs must be idle before starting a full validation.
diff --git a/lisp/obsolete/eieio-compat.el b/lisp/obsolete/eieio-compat.el
index b31bde4efba..ead9352695c 100644
--- a/lisp/obsolete/eieio-compat.el
+++ b/lisp/obsolete/eieio-compat.el
@@ -249,30 +249,10 @@ Summary:
nil)
;;;###autoload
-(defun eieio-defmethod (method args)
- "Obsolete work part of an old version of the `defmethod' macro."
- (declare (obsolete cl-defmethod "24.1"))
- (eval `(defmethod ,method ,@args))
- method)
-
-;;;###autoload
-(defun eieio-defgeneric (method doc-string)
- "Obsolete work part of an old version of the `defgeneric' macro."
- (declare (obsolete cl-defgeneric "24.1"))
- (eval `(defgeneric ,method (x) ,@(if doc-string `(,doc-string))))
- ;; Return the method
- 'method)
-
-;;;###autoload
(defun eieio-defclass (cname superclasses slots options)
(declare (obsolete eieio-defclass-internal "25.1"))
(eval `(defclass ,cname ,superclasses ,slots ,@options)))
-
-;; Local Variables:
-;; generated-autoload-file: "eieio-loaddefs.el"
-;; End:
-
(provide 'eieio-compat)
;;; eieio-compat.el ends here
diff --git a/lisp/obsolete/info-edit.el b/lisp/obsolete/info-edit.el
index 6c1be1078ff..6c4c10ca6c2 100644
--- a/lisp/obsolete/info-edit.el
+++ b/lisp/obsolete/info-edit.el
@@ -33,7 +33,6 @@
(make-obsolete-variable 'Info-edit-mode-hook
"editing Info nodes by hand is not recommended." "24.4")
-(define-obsolete-variable-alias 'Info-edit-map 'Info-edit-mode-map "24.1")
(defvar Info-edit-mode-map (let ((map (make-sparse-keymap)))
(set-keymap-parent map text-mode-map)
(define-key map "\C-c\C-c" #'Info-cease-edit)
diff --git a/lisp/net/rlogin.el b/lisp/obsolete/rlogin.el
index 98b660dcc43..6a06300ae35 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/obsolete/rlogin.el
@@ -1,10 +1,10 @@
;;; rlogin.el --- remote login interface -*- lexical-binding:t -*-
-;; Copyright (C) 1992-1995, 1997-1998, 2001-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1992-2022 Free Software Foundation, Inc.
;; Author: Noah Friedman <friedman@splode.com>
;; Keywords: unix, comm
+;; Obsolete-since: 29.1
;; This file is part of GNU Emacs.
@@ -23,6 +23,9 @@
;;; Commentary:
+;; This library is obsolete.
+;; See: https://debbugs.gnu.org/56461
+
;; Support for remote logins using `rlogin'.
;; This program is layered on top of shell.el; the code here only accounts
;; for the variations needed to handle a remote process, e.g. directory
@@ -35,11 +38,6 @@
;;; Code:
-;; FIXME?
-;; Maybe this file should be obsolete.
-;; https://lists.gnu.org/r/emacs-devel/2013-02/msg00517.html
-;; It only adds rlogin-directory-tracking-mode. Is that useful?
-
(require 'comint)
(require 'shell)
@@ -118,19 +116,15 @@ this variable is set from that."
:type '(choice (const nil) string)
:group 'rlogin)
-(defvar rlogin-mode-map
- (let ((map (if (consp shell-mode-map)
- (cons 'keymap shell-mode-map)
- (copy-keymap shell-mode-map))))
- (define-key map "\C-c\C-c" 'rlogin-send-Ctrl-C)
- (define-key map "\C-c\C-d" 'rlogin-send-Ctrl-D)
- (define-key map "\C-c\C-z" 'rlogin-send-Ctrl-Z)
- (define-key map "\C-c\C-\\" 'rlogin-send-Ctrl-backslash)
- (define-key map "\C-d" 'rlogin-delchar-or-send-Ctrl-D)
- (define-key map "\C-i" 'rlogin-tab-or-complete)
- map)
- "Keymap for `rlogin-mode'.")
-
+(defvar-keymap rlogin-mode-map
+ :doc "Keymap for `rlogin-mode'."
+ :parent shell-mode-map
+ "C-c C-c" #'rlogin-send-Ctrl-C
+ "C-c C-d" #'rlogin-send-Ctrl-D
+ "C-c C-z" #'rlogin-send-Ctrl-Z
+ "C-c C-\\" #'rlogin-send-Ctrl-backslash
+ "C-d" #'rlogin-delchar-or-send-Ctrl-D
+ "TAB" #'rlogin-tab-or-complete)
(defvar rlogin-history nil)
diff --git a/lisp/obsolete/starttls.el b/lisp/obsolete/starttls.el
index 6f0685d3dda..2f1f0e9773c 100644
--- a/lisp/obsolete/starttls.el
+++ b/lisp/obsolete/starttls.el
@@ -287,9 +287,6 @@ GnuTLS requires a port number."
starttls-gnutls-program
starttls-program))))
-(define-obsolete-function-alias 'starttls-any-program-available
- #'starttls-available-p "24.1")
-
(provide 'starttls)
;;; starttls.el ends here
diff --git a/lisp/org/ChangeLog.1 b/lisp/org/ChangeLog.1
index 7e08d1a3c9a..836e1430dfe 100644
--- a/lisp/org/ChangeLog.1
+++ b/lisp/org/ChangeLog.1
@@ -4001,7 +4001,7 @@
buffer.
(org-agenda-ignore-drawer-properties): New option.
(org-agenda-prepare-buffers):
- Honour `org-agenda-ignore-drawer-properties'.
+ Honor `org-agenda-ignore-drawer-properties'.
* org-clock.el (org-clock-goto): Recenter to thrd line
@@ -4134,7 +4134,7 @@
(orgstruct-heading-prefix-regexp, orgstruct-setup-hook):
New options.
(orgstruct-initialized): New variable.
- (org-get-local-variables): Honour state property.
+ (org-get-local-variables): Honor state property.
(org-run-like-in-org-mode): Use `let' instead of `progv'. Do not
override variables with non-default values.
(org-forward-heading-same-level): Do not skip to headlines on
diff --git a/lisp/org/ob-comint.el b/lisp/org/ob-comint.el
index 427aba34150..c99d6a8ba71 100644
--- a/lisp/org/ob-comint.el
+++ b/lisp/org/ob-comint.el
@@ -166,7 +166,7 @@ source block, and the name of the temp file.")
(defvar-local org-babel-comint-async-chunk-callback nil
"Callback function to clean Babel async output results before insertion.
Its single argument is a string consisting of output from the
-comint process. It should return a string that will be be passed
+comint process. It should return a string that will be passed
to `org-babel-insert-result'.")
(defvar-local org-babel-comint-async-dangling nil
diff --git a/lisp/org/ol-doi.el b/lisp/org/ol-doi.el
index 94585e4c3e5..56239f65d43 100644
--- a/lisp/org/ol-doi.el
+++ b/lisp/org/ol-doi.el
@@ -44,7 +44,7 @@ PATH is a the path to search for, as a string."
"Export a \"doi\" type link.
PATH is the DOI name. DESC is the description of the link, or
nil. BACKEND is a symbol representing the backend used for
-export. INFO is a a plist containing the export parameters."
+export. INFO is a plist containing the export parameters."
(let ((uri (concat org-link-doi-server-url path)))
(pcase backend
(`html
diff --git a/lisp/org/ol.el b/lisp/org/ol.el
index a03d85f618a..a0dad926bc2 100644
--- a/lisp/org/ol.el
+++ b/lisp/org/ol.el
@@ -1580,14 +1580,6 @@ non-nil."
nil nil nil))))
(org-link-store-props :type "calendar" :date cd)))
- ((eq major-mode 'w3-mode)
- (setq cpltxt (if (and (buffer-name)
- (not (string-match "Untitled" (buffer-name))))
- (buffer-name)
- (url-view-url t))
- link (url-view-url t))
- (org-link-store-props :type "w3" :url (url-view-url t)))
-
((eq major-mode 'image-mode)
(setq cpltxt (concat "file:"
(abbreviate-file-name buffer-file-name))
diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el
index a5fea08882f..c7b4bde0d28 100644
--- a/lisp/org/org-feed.el
+++ b/lisp/org/org-feed.el
@@ -406,7 +406,7 @@ it can be a list structured like an entry in `org-feed-alist'."
;; Write the new status
;; We do this only now, in case something goes wrong above, so
- ;; that would would end up with a status that does not reflect
+ ;; that would end up with a status that does not reflect
;; which items truly have been handled
(org-feed-write-status inbox-pos drawer status)
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index 4507fbe7ddc..7cce678a81b 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -272,10 +272,10 @@ argument for the FUNCTION."
for k in keys collect
(cons k (funcall function (lookup k alist1) (lookup k alist2))))))
-(defun org--plot/item-frequencies (values &optional normalise)
+(defun org--plot/item-frequencies (values &optional normalize)
"Return an alist indicating the frequency of values in VALUES list.
-When NORMALISE is non-nil, the count is divided by the number of values."
- (let ((normaliser (if normalise (float (length values)) 1)))
+When NORMALIZE is non-nil, the count is divided by the number of values."
+ (let ((normaliser (if normalize (float (length values)) 1)))
(cl-loop for (n . m) in (seq-group-by #'identity values)
collect (cons n (/ (length m) normaliser)))))
diff --git a/lisp/outline.el b/lisp/outline.el
index 7fd43195cc0..38a37fb74d3 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1,7 +1,6 @@
;;; outline.el --- outline mode commands for Emacs -*- lexical-binding: t; -*-
-;; Copyright (C) 1986, 1993-1995, 1997, 2000-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1986-2022 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: outlines
@@ -182,7 +181,7 @@ in the file it applies to.")
This option controls, in Outline minor mode, where on a heading typing
the key sequences bound to visibility-cycling commands like `outline-cycle'
and `outline-cycle-buffer' will invoke those commands. By default, you can
-invoke these commands by typing `TAB' and `S-TAB' anywhere on a heading line,
+invoke these commands by typing \\`TAB' and \\`S-TAB' anywhere on a heading line,
but customizing this option can make those bindings be in effect only at
specific positions on the heading, like only at the line's beginning or
line's end. This allows these keys to be bound to their usual commands,
@@ -381,9 +380,9 @@ After that, changing the prefix key requires manipulating keymaps."
(defcustom outline-minor-mode-cycle nil
"Enable visibility-cycling commands on headings in `outline-minor-mode'.
-If enabled, typing `TAB' on a heading line cycles the visibility
+If enabled, typing \\`TAB' on a heading line cycles the visibility
state of that heading's body between `hide all', `headings only'
-and `show all' (`outline-cycle'), and typing `S-TAB' on a heading
+and `show all' (`outline-cycle'), and typing \\`S-TAB' on a heading
line likewise cycles the visibility state of the whole buffer
\(`outline-cycle-buffer').
Typing these keys anywhere outside heading lines invokes their default
diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el
index 0074722be78..8774f091c83 100644
--- a/lisp/pcmpl-unix.el
+++ b/lisp/pcmpl-unix.el
@@ -198,6 +198,10 @@ Uses both `pcmpl-ssh-config-file' and `pcmpl-ssh-known-hosts-file'."
(pcomplete-here (pcmpl-ssh-hosts)))
;;;###autoload
+(defalias 'pcomplete/rsh #'pcomplete/ssh)
+(defalias 'pcomplete/rlogin #'pcomplete/ssh)
+
+;;;###autoload
(defun pcomplete/scp ()
"Completion rules for the `scp' command.
Includes files as well as host names followed by a colon."
@@ -229,22 +233,12 @@ Includes files as well as host names followed by a colon."
(defalias 'pcomplete/ftp 'pcmpl-unix-complete-hostname)
(defalias 'pcomplete/ncftp 'pcmpl-unix-complete-hostname)
(defalias 'pcomplete/ping 'pcmpl-unix-complete-hostname)
-(defalias 'pcomplete/rlogin 'pcmpl-unix-complete-hostname)
;;;###autoload
(defun pcomplete/telnet ()
(pcomplete-opt "xl(pcmpl-unix-user-names)")
(pcmpl-unix-complete-hostname))
-;;;###autoload
-(defun pcomplete/rsh ()
- "Complete `rsh', which, after the user and hostname, is like xargs."
- (pcomplete-opt "l(pcmpl-unix-user-names)")
- (pcmpl-unix-complete-hostname)
- (pcomplete-here (funcall pcomplete-command-completion-function))
- (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
- pcomplete-default-completion-function)))
-
(provide 'pcmpl-unix)
;;; pcmpl-unix.el ends here
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index f8822c30db1..fee242be981 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -161,11 +161,12 @@ SHOULD be at least 2 (MUST BE at least 1).")
"For making font-lock use the winner's face for the line.")
(defface gomoku-O
- '((((class color)) (:foreground "red" :weight bold)))
+ '((((class color)) :foreground "red" :weight bold))
"Face to use for Emacs's O.")
(defface gomoku-X
- '((((class color)) (:foreground "green" :weight bold)))
+ '((((background light)) :foreground "blue" :weight bold)
+ (((class color)) :foreground "green" :weight bold))
"Face to use for your X.")
(defvar gomoku-font-lock-keywords
diff --git a/lisp/play/spook.el b/lisp/play/spook.el
index f2bdba1c2aa..ccff2e75b0a 100644
--- a/lisp/play/spook.el
+++ b/lisp/play/spook.el
@@ -49,7 +49,7 @@
(defcustom spook-phrase-default-count 15
"Default number of phrases to insert."
- :type 'integer)
+ :type 'natnum)
;;;###autoload
(defun spook ()
diff --git a/lisp/play/tetris.el b/lisp/play/tetris.el
index d9bc0dd020c..a6bfea81ee1 100644
--- a/lisp/play/tetris.el
+++ b/lisp/play/tetris.el
@@ -95,27 +95,27 @@ If the return value is a number, it is used as the timer period."
(defcustom tetris-buffer-width 30
"Width of used portion of buffer."
- :type 'number)
+ :type 'natnum)
(defcustom tetris-buffer-height 22
"Height of used portion of buffer."
- :type 'number)
+ :type 'natnum)
(defcustom tetris-width 10
"Width of playing area."
- :type 'number)
+ :type 'natnum)
(defcustom tetris-height 20
"Height of playing area."
- :type 'number)
+ :type 'natnum)
(defcustom tetris-top-left-x 3
"X position of top left of playing area."
- :type 'number)
+ :type 'natnum)
(defcustom tetris-top-left-y 1
"Y position of top left of playing area."
- :type 'number)
+ :type 'natnum)
(defcustom tetris-allow-repetitions t
"If non-nil, use a random selection for each shape.
diff --git a/lisp/plstore.el b/lisp/plstore.el
index b37d39ce1b1..de3f828016a 100644
--- a/lisp/plstore.el
+++ b/lisp/plstore.el
@@ -107,6 +107,7 @@ symmetric encryption will be used."
:type '(choice (const nil) (repeat :tag "Recipient(s)" string))
:group 'plstore)
+;;;###autoload
(put 'plstore-encrypt-to 'safe-local-variable
(lambda (val)
(or (stringp val)
diff --git a/lisp/profiler.el b/lisp/profiler.el
index 94c24c62aa6..8670e5786a4 100644
--- a/lisp/profiler.el
+++ b/lisp/profiler.el
@@ -38,7 +38,7 @@
(defcustom profiler-sampling-interval 1000000
"Default sampling interval in nanoseconds."
- :type 'integer
+ :type 'natnum
:group 'profiler)
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index d3626dbaf01..5143af7dded 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -140,7 +140,7 @@ to the highlighted and clickable region."
t)))
;; All groups 2..10 are within bounds.
(cons m-b1 m-e1)
- ;; The regexp doesn't fulfil the contract of
+ ;; The regexp doesn't fulfill the contract of
;; bug-reference-bug-regexp, so fall back to the old behavior.
(unless (member bug-reference-bug-regexp
bug-reference--nonconforming-regexps)
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 15e3beb8377..625010b04b2 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1820,7 +1820,7 @@ casts and declarations are fontified. Used on level 2 and higher."
;; font-lock-keyword-face. It always returns NIL to inhibit this and
;; prevent a repeat invocation. See elisp/lispref page "Search-based
;; Fontification".
- (let (mode capture-default id-start id-end declaration sub-begin sub-end)
+ (let (mode capture-default id-start id-end declaration sub-begin sub-end tem)
(while (and (< (point) limit)
(search-forward "[" limit t))
(when (progn (backward-char)
@@ -1832,15 +1832,18 @@ casts and declarations are fontified. Used on level 2 and higher."
(char-after)))
;; Is the first element of the list a bare "=" or "&"?
(when mode
- (forward-char)
- (c-forward-syntactic-ws)
- (if (memq (char-after) '(?, ?\]))
- (progn
- (setq capture-default mode)
- (when (eq (char-after) ?,)
- (forward-char)
- (c-forward-syntactic-ws)))
- (c-backward-token-2)))
+ (setq tem nil)
+ (save-excursion
+ (forward-char)
+ (c-forward-syntactic-ws)
+ (if (memq (char-after) '(?, ?\]))
+ (progn
+ (setq capture-default mode)
+ (when (eq (char-after) ?,)
+ (forward-char)
+ (c-forward-syntactic-ws))
+ (setq tem (point)))))
+ (if tem (goto-char tem)))
;; Go round the following loop once per captured item. We use "\\s)"
;; rather than "\\]" here to avoid infinite looping in this situation:
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 00348ac0bb9..32031d19462 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -793,14 +793,6 @@ bundle agent rcfiles
(cdr (assq 'functions cfengine3-fallback-syntax)))
'symbols))
-(defcustom cfengine-mode-abbrevs nil
- "Abbrevs for CFEngine2 mode."
- :type '(repeat (list (string :tag "Name")
- (string :tag "Expansion")
- (choice :tag "Hook" (const nil) function))))
-
-(make-obsolete-variable 'cfengine-mode-abbrevs 'edit-abbrevs "24.1")
-
;; Taken from the doc for pre-release 2.1.
(eval-and-compile
(defconst cfengine2-actions
@@ -1409,7 +1401,6 @@ to the action header."
(setq-local outline-regexp "[ \t]*\\(\\sw\\|\\s_\\)+:+")
(setq-local outline-level #'cfengine2-outline-level)
(setq-local fill-paragraph-function #'cfengine-fill-paragraph)
- (define-abbrev-table 'cfengine2-mode-abbrev-table cfengine-mode-abbrevs)
(setq font-lock-defaults
'(cfengine2-font-lock-keywords nil nil nil beginning-of-line))
;; Fixme: set the args of functions in evaluated classes to string
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index e571cee83c6..f51d2fcb115 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1322,7 +1322,7 @@ name, and one for the discovery of a following BLOCK.")
,cperl--ws+-rx
(group-n 2 ,cperl--normal-identifier-rx))
"A regular expression to detect a subroutine start.
-Contains three groups: One one to distinguish lexical from
+Contains three groups: One to distinguish lexical from
\"normal\" subroutines, for the keyword \"sub\", and one for the
subroutine name.")
diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el
index 971e3f6174d..03469b9f55b 100644
--- a/lisp/progmodes/cwarn.el
+++ b/lisp/progmodes/cwarn.el
@@ -180,9 +180,6 @@ C++ modes are included."
(cwarn-font-lock-keywords cwarn-mode)
(font-lock-flush))
-;;;###autoload
-(define-obsolete-function-alias 'turn-on-cwarn-mode 'cwarn-mode "24.1")
-
;;}}}
;;{{{ Help functions
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 16069f75aeb..16b2f3ff503 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -996,7 +996,7 @@ if for some reason a circle is in the inheritance graph."
Each line corresponds to a class in a class tree.
Letters do not insert themselves, they are commands.
File operations in the tree buffer work on class tree data structures.
-E.g.\\[save-buffer] writes the tree to the file it was loaded from.
+E.g. \\[save-buffer] writes the tree to the file it was loaded from.
Tree mode key bindings:
\\{ebrowse-tree-mode-map}"
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index fb114ec990e..0c4a9bfdbea 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -2223,6 +2223,7 @@ interactively, this is the prefix argument."
(interactive "P")
(let ((bfn buffer-file-name)
file elc)
+ (require 'bytecomp)
(unwind-protect
(progn
(setq file (make-temp-file "compile" nil ".el")
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 0b7958e52fb..15ee5cb7d51 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1678,9 +1678,9 @@ the file they refer to is visited and `flymake-mode' is turned on
in the resulting buffer.
Flymake backends that somehow gain sporadic information about
-diagnostics in neighbouring files may freely modify this variable
+diagnostics in neighboring files may freely modify this variable
by adding or removing entries to for those files. If the
-information about those neighbouring files is acquired repeatedly
+information about those neighboring files is acquired repeatedly
and reliably, it may be more sensible to report them as
\"foreign\" diagnostics instead.
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 79ef6101e9b..940710f7c59 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -684,7 +684,7 @@ Note that this variable only takes effect when variable
Until there are such number of source windows on screen, GDB
tries to open a new window when visiting a new source file; after
that GDB starts to reuse existing source windows."
- :type 'number
+ :type 'natnum
:group 'gdb
:version "28.1")
@@ -2112,7 +2112,7 @@ is running."
(not (null gdb-running-threads-count))
(> gdb-running-threads-count 0))))
-;; GUD displays the selected GDB frame. This might might not be the current
+;; GUD displays the selected GDB frame. This might not be the current
;; GDB frame (after up, down etc). If no GDB frame is visible but the last
;; visited breakpoint is, use that window.
(defun gdb-display-source-buffer (buffer)
@@ -2817,7 +2817,7 @@ END-CHAR is the ending delimiter; will stop at end-of-buffer otherwise."
pieces)
(forward-char))
(t
- (warn "Unrecognised escape char: %c" (following-char))))
+ (warn "Unrecognized escape char: %c" (following-char))))
(setq start (point)))
(push (buffer-substring start (1- (point))) pieces)
(let ((s (apply #'concat (nreverse pieces))))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index a3ef90f397e..423de7d5818 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -885,6 +885,14 @@ The value depends on `grep-command', `grep-template',
(setq-local compilation-disable-input t)
(setq-local compilation-error-screen-columns
grep-error-screen-columns)
+ ;; We normally use a nul byte to separate the file name from the
+ ;; contents, but display it as ":". That's fine, but when yanking
+ ;; to other buffers, it's annoying to have the nul byte there.
+ (unless kill-transform-function
+ (setq-local kill-transform-function #'identity))
+ (add-function :filter-return (local 'kill-transform-function)
+ (lambda (string)
+ (string-replace "\0" ":" string)))
(add-hook 'compilation-filter-hook #'grep-filter nil t))
(defun grep--save-buffers ()
@@ -1210,7 +1218,7 @@ to specify a command to run.
If CONFIRM is non-nil, the user will be given an opportunity to edit the
command before it's run.
-Interactively, the user can use the `M-c' command while entering
+Interactively, the user can use the \\`M-c' command while entering
the regexp to indicate whether the grep should be case sensitive
or not."
(interactive
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 26fecf9c9f1..be43effed7d 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -334,7 +334,7 @@ Used to gray out relevant toolbar icons.")
(">" . gud-down)))
(define-key map key cmd))
map)
- "Keymap to repeat `gud-gdb' stepping instructions `C-x C-a C-n n n'.
+ "Keymap to repeat `gud-gdb' stepping instructions \\`C-x C-a C-n n n'.
Used in `repeat-mode'.")
(defun gud-set-repeat-map-property (keymap-symbol)
@@ -1054,7 +1054,7 @@ SKIP is the number of chars to skip on each line, it defaults to 0."
("l" . gud-refresh)))
(define-key map key cmd))
map)
- "Keymap to repeat `sdb' stepping instructions `C-x C-a C-n n n'.
+ "Keymap to repeat `sdb' stepping instructions \\`C-x C-a C-n n n'.
Used in `repeat-mode'.")
(defun gud-sdb-marker-filter (string)
@@ -1301,7 +1301,7 @@ whereby $stopformat=1 produces an output format compatible with
gud-irix-p)
(define-key map "f" 'gud-finish))
map)
- "Keymap to repeat `dbx' stepping instructions `C-x C-a C-n n n'.
+ "Keymap to repeat `dbx' stepping instructions \\`C-x C-a C-n n n'.
Used in `repeat-mode'.")
;; The process filter is also somewhat
@@ -1476,7 +1476,7 @@ and source-file directory for your debugger."
(">" . gud-down)))
(define-key map key cmd))
map)
- "Keymap to repeat `xdb' stepping instructions `C-x C-a C-n n n'.
+ "Keymap to repeat `xdb' stepping instructions \\`C-x C-a C-n n n'.
Used in `repeat-mode'.")
(defcustom gud-xdb-directories nil
@@ -1564,7 +1564,7 @@ directories if your program contains sources from more than one directory."
("l" . gud-refresh)))
(define-key map key cmd))
map)
- "Keymap to repeat `perldb' stepping instructions `C-x C-a C-n n n'.
+ "Keymap to repeat `perldb' stepping instructions \\`C-x C-a C-n n n'.
Used in `repeat-mode'.")
(defun gud-perldb-massage-args (_file args)
@@ -1754,7 +1754,7 @@ working directory and source-file directory for your debugger."
(">" . gud-down)))
(define-key map key cmd))
map)
- "Keymap to repeat `pdb' stepping instructions `C-x C-a C-n n n'.
+ "Keymap to repeat `pdb' stepping instructions \\`C-x C-a C-n n n'.
Used in `repeat-mode'.")
;; There's no guarantee that Emacs will hand the filter the entire
@@ -1871,7 +1871,7 @@ directory and source-file directory for your debugger."
(">" . gud-down)))
(define-key map key cmd))
map)
- "Keymap to repeat `guiler' stepping instructions `C-x C-a C-n n n'.
+ "Keymap to repeat `guiler' stepping instructions \\`C-x C-a C-n n n'.
Used in `repeat-mode'.")
(defun gud-guiler-marker-filter (string)
@@ -2398,7 +2398,7 @@ extension EXTN. Normally EXTN is given as the regular expression
("l" . gud-refresh)))
(define-key map key cmd))
map)
- "Keymap to repeat `jdb' stepping instructions `C-x C-a C-n n n'.
+ "Keymap to repeat `jdb' stepping instructions \\`C-x C-a C-n n n'.
Used in `repeat-mode'.")
(defun gud-jdb-find-source-using-classpath (p)
@@ -3694,7 +3694,6 @@ With arg, dereference expr if ARG is positive, otherwise do not dereference."
(message "Dereferencing is now %s."
(if gud-tooltip-dereference "on" "off")))
-(defvar tooltip-use-echo-area)
(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
(declare-function tooltip-strip-prompt "tooltip" (process output))
@@ -3708,8 +3707,7 @@ With arg, dereference expr if ARG is positive, otherwise do not dereference."
"Process debugger output and show it in a tooltip window."
(remove-function (process-filter process) #'gud-tooltip-process-output)
(tooltip-show (tooltip-strip-prompt process output)
- (or gud-tooltip-echo-area tooltip-use-echo-area
- (not tooltip-mode))))
+ (or gud-tooltip-echo-area (not tooltip-mode))))
(defun gud-tooltip-print-command (expr)
"Return a suitable command to print the expression EXPR."
@@ -3753,8 +3751,7 @@ This function must return nil if it doesn't handle EVENT."
(unless (null define-elt)
(tooltip-show
(cdr define-elt)
- (or gud-tooltip-echo-area tooltip-use-echo-area
- (not tooltip-mode)))
+ (or gud-tooltip-echo-area (not tooltip-mode)))
expr))))
(when gud-tooltip-dereference
(setq expr (concat "*" expr)))
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index b6063521365..d21a9faec9d 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -231,7 +231,7 @@ because these are used as separators by IDL."
(defcustom idlwave-shell-graphics-window-size '(500 400)
"Size of IDL graphics windows popped up by special IDLWAVE command.
-The command is `C-c C-d C-f' and accepts as a prefix the window nr.
+The command is \\`C-c C-d C-f' and accepts as a prefix the window nr.
A command like `WINDOW,N,xsize=XX,ysize=YY' is sent to IDL."
:group 'idlwave-shell-general-setup
:type '(list
@@ -844,7 +844,7 @@ IDL has currently stepped.")
---------
A complete set of commands for compiling and debugging IDL programs
is available from the menu. Also keybindings starting with a
- `C-c C-d' prefix are available for most commands in the *idl* buffer
+ \\`C-c C-d' prefix are available for most commands in the *idl* buffer
and also in source buffers. The best place to learn about the
keybindings is again the menu.
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index edb53793e64..a2061fde762 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -1001,9 +1001,9 @@ Obsolete, if the IDL Assistant is being used for help."
"List of modifiers to be used for the debugging commands.
Will be used to bind debugging commands in the shell buffer and in all
source buffers. These are additional convenience bindings, the debugging
-commands are always available with the `C-c C-d' prefix.
+commands are always available with the \\`C-c C-d' prefix.
If you set this to (control shift), this means setting a breakpoint will
-be on `C-S-b', compiling a source file on `C-S-c' etc. Possible modifiers
+be on \\`C-S-b', compiling a source file on \\`C-S-c' etc. Possible modifiers
are `control', `meta', `super', `hyper', `alt', and `shift'."
:group 'idlwave-shell-general-setup
:type '(set :tag "Specify modifiers"
@@ -3247,7 +3247,7 @@ ignored."
;; In the following while statements, after one iteration
;; point will be at the beginning of a line in which case
;; the while will not be executed for the
- ;; the first paragraph line and thus will not affect the
+ ;; first paragraph line and thus will not affect the
;; indentation.
;;
;; First check to see if indentation is based on hanging indent.
@@ -8421,7 +8421,7 @@ was pressed."
(defun idlwave-list-shell-load-path-shadows (&optional _arg)
"List the load path shadows of all routines compiled under the shell.
This is very useful for checking an IDL application. Just compile the
-application, do RESOLVE_ALL, and `C-c C-i' to compile all referenced
+application, do RESOLVE_ALL, and \\`C-c C-i' to compile all referenced
routines and update IDLWAVE internal info. Then check for shadowing
with this command."
(interactive)
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 91307f6c09f..cbbcf1c2b7c 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -220,8 +220,8 @@ to MODIFY A FILE WITHOUT YOUR CONFIRMATION when \"it seems necessary\"."
"List of special targets.
You will be offered to complete on one of those in the minibuffer whenever
you enter a \".\" at the beginning of a line in `makefile-mode'."
- :type '(repeat string))
-(put 'makefile-special-targets-list 'risky-local-variable t)
+ :type '(repeat string)
+ :risky t)
(defcustom makefile-runtime-macros-list
'(("@") ("&") (">") ("<") ("*") ("^") ("+") ("?") ("%") ("$"))
@@ -1170,7 +1170,6 @@ and adds all qualifying names to the list of known targets."
(goto-char (match-end 0))
(insert suffix))))))))
-(define-obsolete-function-alias 'makefile-complete 'completion-at-point "24.1")
;; Backslashification. Stolen from cc-mode.el.
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index 5aaa277431a..f0fd23f3bc3 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -108,30 +108,27 @@
(macro-keywords-2
"\\(primarydef\\|secondarydef\\|tertiarydef\\)")
(args-keywords
- (eval-when-compile
- (regexp-opt
- '("expr" "suffix" "text" "primary" "secondary" "tertiary")
- t)))
+ (regexp-opt
+ '("expr" "suffix" "text" "primary" "secondary" "tertiary")
+ t))
(type-keywords
- (eval-when-compile
- (regexp-opt
- '("boolean" "color" "numeric" "pair" "path" "pen" "picture"
- "string" "transform" "newinternal")
- t)))
+ (regexp-opt
+ '("boolean" "color" "numeric" "pair" "path" "pen" "picture"
+ "string" "transform" "newinternal")
+ t))
(syntactic-keywords
- (eval-when-compile
- (regexp-opt
- '("for" "forever" "forsuffixes" "endfor"
- "step" "until" "upto" "downto" "thru" "within"
- "iff" "if" "elseif" "else" "fi" "exitif" "exitunless"
- "let" "def" "vardef" "enddef" "mode_def"
- "true" "false" "known" "unknown" "and" "or" "not"
- "save" "interim" "inner" "outer" "relax"
- "begingroup" "endgroup" "expandafter" "scantokens"
- "generate" "input" "endinput" "end" "bye"
- "message" "errmessage" "errhelp" "special" "numspecial"
- "readstring" "readfrom" "write")
- t)))
+ (regexp-opt
+ '("for" "forever" "forsuffixes" "endfor"
+ "step" "until" "upto" "downto" "thru" "within"
+ "iff" "if" "elseif" "else" "fi" "exitif" "exitunless"
+ "let" "def" "vardef" "enddef" "mode_def"
+ "true" "false" "known" "unknown" "and" "or" "not"
+ "save" "interim" "inner" "outer" "relax"
+ "begingroup" "endgroup" "expandafter" "scantokens"
+ "generate" "input" "endinput" "end" "bye"
+ "message" "errmessage" "errhelp" "special" "numspecial"
+ "readstring" "readfrom" "write")
+ t))
)
(list
;; embedded TeX code in btex ... etex
@@ -441,8 +438,6 @@ If the list was changed, sort the list and remove duplicates first."
(insert close)))))))
(nth 1 entry))))
-(define-obsolete-function-alias 'meta-complete-symbol
- 'completion-at-point "24.1")
;;; Indentation.
@@ -806,7 +801,6 @@ The environment marked is the one that contains point or follows point."
st)
"Syntax table used in Metafont or MetaPost mode.")
-(define-obsolete-variable-alias 'meta-mode-map 'meta-common-mode-map "24.1")
(defvar meta-common-mode-map
(let ((map (make-sparse-keymap)))
;; Comment Paragraphs:
diff --git a/lisp/progmodes/modula2.el b/lisp/progmodes/modula2.el
index a8d644dba0e..e668570ba17 100644
--- a/lisp/progmodes/modula2.el
+++ b/lisp/progmodes/modula2.el
@@ -101,9 +101,8 @@
(defcustom m2-indent 5
"This variable gives the indentation in Modula-2 mode."
- :type 'integer)
-(put 'm2-indent 'safe-local-variable
- (lambda (v) (or (null v) (integerp v))))
+ :type 'integer
+ :safe (lambda (v) (or (null v) (integerp v))))
(defconst m2-smie-grammar
;; An official definition can be found as "M2R10.pdf". This grammar does
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 7b7c675873b..721dfa51ad3 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -197,8 +197,8 @@ newline or semicolon after an else or end keyword."
(defcustom octave-block-offset 2
"Extra indentation applied to statements in Octave block structures."
- :type 'integer)
-(put 'octave-block-offset 'safe-local-variable 'integerp)
+ :type 'integer
+ :safe #'integerp)
(defvar octave-block-comment-start
(concat (make-string 2 octave-comment-char) " ")
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 351ea6e3a99..8d3194e6a47 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -239,14 +239,6 @@ will do all lineups."
(const :tag "Declarations" declaration)
(const :tag "Case statements" case)))
-(defvar pascal-toggle-completions nil
- "If non-nil, `pascal-complete-word' tries all possible completions.
-Repeated use of \\[pascal-complete-word] then shows all
-completions in turn, instead of displaying a list of all possible
-completions.")
-(make-obsolete-variable 'pascal-toggle-completions
- 'completion-cycle-threshold "24.1")
-
(defcustom pascal-type-keywords
'("array" "file" "packed" "char" "integer" "real" "string" "record")
"Keywords for types used when completing a word in a declaration or parmlist.
@@ -1297,13 +1289,6 @@ indent of the current line in parameterlist."
(when (> e b)
(list b e #'pascal-completion))))
-(define-obsolete-function-alias 'pascal-complete-word
- 'completion-at-point "24.1")
-
-(define-obsolete-function-alias 'pascal-show-completions
- 'completion-help-at-point "24.1")
-
-
(defun pascal-get-default-symbol ()
"Return symbol around current point as a string."
(save-excursion
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 9598209f5e5..5aba95d4c79 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -742,14 +742,6 @@ Relevant only when `prolog-imenu-flag' is non-nil."
:group 'prolog-other
:type 'boolean)
-(defcustom prolog-char-quote-workaround nil
- "If non-nil, declare 0 as a quote character to handle 0'<char>.
-This is really kludgy, and unneeded (i.e. obsolete) in Emacs>=24."
- :version "24.1"
- :group 'prolog-other
- :type 'boolean)
-(make-obsolete-variable 'prolog-char-quote-workaround nil "24.1")
-
;;-------------------------------------------------------------------
;; Internal variables
@@ -1303,7 +1295,7 @@ To find out what version of Prolog mode you are running, enter
(t t)))
;; This statement was missing in Emacs 24.1, 24.2, 24.3.
-(define-obsolete-function-alias 'switch-to-prolog 'run-prolog "24.1")
+(define-obsolete-function-alias 'switch-to-prolog 'run-prolog "24.1") ; "24.4" ; for grep
;;;###autoload
(defun run-prolog (arg)
"Run an inferior Prolog process, input and output via buffer *prolog*.
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 16cdf58611a..1c99937c4b9 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -248,7 +248,6 @@
(eval-when-compile (require 'subr-x)) ;For `string-empty-p'.
;; Avoid compiler warnings
-(defvar view-return-to-alist)
(defvar compilation-error-regexp-alist)
(defvar outline-heading-end-regexp)
@@ -1472,15 +1471,17 @@ With positive ARG search backwards, else search forwards."
0))))
(found
(progn
- (when (and (python-info-looking-at-beginning-of-defun)
+ (when (and (python-info-looking-at-beginning-of-defun nil t)
(or (< arg 0)
;; If looking at beginning of defun, and if
;; pos is > line-content-start, ensure a
;; backward re search match this defun by
;; going to end of line before calling
;; re-search-fn bug#40563
- (and (> arg 0) (> pos line-content-start))))
- (end-of-line 1))
+ (and (> arg 0)
+ (or (python-info-continuation-line-p)
+ (> pos line-content-start)))))
+ (python-nav-end-of-statement))
(while (and (funcall re-search-fn
python-nav-beginning-of-defun-regexp nil t)
@@ -1490,14 +1491,18 @@ With positive ARG search backwards, else search forwards."
(and (> arg 0)
(not (= (current-indentation) 0))
(>= (current-indentation) body-indentation)))))
- (and (python-info-looking-at-beginning-of-defun)
+ (and (python-info-looking-at-beginning-of-defun nil t)
(or (not (= (line-number-at-pos pos)
(line-number-at-pos)))
(and (>= (point) line-beg-pos)
(<= (point) line-content-start)
(> pos line-content-start)))))))
(if found
- (or (beginning-of-line 1) t)
+ (progn
+ (when (< arg 0)
+ (python-nav-beginning-of-statement))
+ (beginning-of-line 1)
+ t)
(and (goto-char pos) nil))))
(defun python-nav-beginning-of-defun (&optional arg)
@@ -3104,7 +3109,8 @@ of `error' with a user-friendly message."
(or (python-shell-get-process)
(if interactivep
(user-error
- "Start a Python process first with `M-x run-python' or `%s'"
+ (substitute-command-keys
+ "Start a Python process first with \\`M-x run-python' or `%s'")
;; Get the binding.
(key-description
(where-is-internal
@@ -5299,10 +5305,15 @@ operator."
(forward-line -1)
(python-info-assignment-statement-p t))))
-(defun python-info-looking-at-beginning-of-defun (&optional syntax-ppss)
- "Check if point is at `beginning-of-defun' using SYNTAX-PPSS."
+(defun python-info-looking-at-beginning-of-defun (&optional syntax-ppss
+ check-statement)
+ "Check if point is at `beginning-of-defun' using SYNTAX-PPSS.
+When CHECK-STATEMENT is non-nil, the current statement is checked
+instead of the current physical line."
(and (not (python-syntax-context-type (or syntax-ppss (syntax-ppss))))
(save-excursion
+ (when check-statement
+ (python-nav-beginning-of-statement))
(beginning-of-line 1)
(looking-at python-nav-beginning-of-defun-regexp))))
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index a1977246341..87bb92908d1 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -2457,6 +2457,13 @@ If there is no Rubocop config file, Rubocop will be passed a flag
(setq-local beginning-of-defun-function #'ruby-beginning-of-defun)
(setq-local end-of-defun-function #'ruby-end-of-defun)
+ ;; `outline-regexp' contains the first part of `ruby-indent-beg-re'
+ (setq-local outline-regexp (concat "^\\s *"
+ (regexp-opt '("class" "module" "def"))
+ "\\_>"))
+ (setq-local outline-level (lambda () (1+ (/ (current-indentation)
+ ruby-indent-level))))
+
(add-hook 'after-save-hook #'ruby-mode-set-encoding nil 'local)
(add-hook 'electric-indent-functions #'ruby--electric-indent-p nil 'local)
(add-hook 'flymake-diagnostic-functions #'ruby-flymake-auto nil 'local)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 75758fd39a2..be9f325d93d 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1156,8 +1156,8 @@ Can be set to a number, or to nil which means leave it as is."
"The default indentation increment.
This value is used for the `+' and `-' symbols in an indentation variable."
:type 'integer
+ :safe #'integerp
:group 'sh-indentation)
-(put 'sh-basic-offset 'safe-local-variable 'integerp)
(defcustom sh-indent-comment t
"How a comment line is to be indented.
@@ -1926,9 +1926,9 @@ With t, you get the latter as long as that would indent the continuation line
deeper than the initial line."
:version "25.1"
:type '(choice
- (const nil :tag "Never")
- (const t :tag "Only if needed to make it deeper")
- (const always :tag "Always"))
+ (const :value nil :tag "Never")
+ (const :value t :tag "Only if needed to make it deeper")
+ (const :value always :tag "Always"))
:group 'sh-indentation)
(defun sh-smie--continuation-start-indent ()
@@ -2410,6 +2410,8 @@ Lines containing only comments are considered empty."
The working directory is that of the buffer, and only environment variables
are already set which is why you can mark a header within the script.
+The executed subshell is `sh-shell-file'.
+
With a positive prefix ARG, instead of sending region, define header from
beginning of buffer to point. With a negative prefix ARG, instead of sending
region, clear header."
@@ -2417,17 +2419,18 @@ region, clear header."
(if flag
(setq sh-header-marker (if (> (prefix-numeric-value flag) 0)
(point-marker)))
- (if sh-header-marker
- (save-excursion
- (let (buffer-undo-list)
- (goto-char sh-header-marker)
- (append-to-buffer (current-buffer) start end)
- (shell-command-on-region (point-min)
- (setq end (+ sh-header-marker
- (- end start)))
- sh-shell-file)
- (delete-region sh-header-marker end)))
- (shell-command-on-region start end (concat sh-shell-file " -")))))
+ (let ((shell-file-name sh-shell-file))
+ (if sh-header-marker
+ (save-excursion
+ (let (buffer-undo-list)
+ (goto-char sh-header-marker)
+ (append-to-buffer (current-buffer) start end)
+ (shell-command-on-region (point-min)
+ (setq end (+ sh-header-marker
+ (- end start)))
+ sh-shell-file)
+ (delete-region sh-header-marker end)))
+ (shell-command-on-region start end (concat sh-shell-file " -"))))))
(defun sh-remember-variable (var)
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index ef8375e859c..b950f93f2a0 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -274,8 +274,8 @@ file. Since that is a plaintext file, this could be dangerous."
(defcustom sql-port 0
"Default port for connecting to a MySQL or Postgres server."
:version "24.1"
- :type 'number
- :safe 'numberp)
+ :type 'natnum
+ :safe 'natnump)
(defcustom sql-default-directory nil
"Default directory for SQL processes."
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index 8c179879ce2..7dae14f9e02 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -120,13 +120,13 @@
(defcustom tcl-indent-level 4
"Indentation of Tcl statements with respect to containing block."
- :type 'integer)
-(put 'tcl-indent-level 'safe-local-variable #'integerp)
+ :type 'integer
+ :safe #'integerp)
(defcustom tcl-continued-indent-level 4
"Indentation of continuation line relative to first line of command."
- :type 'integer)
-(put 'tcl-continued-indent-level 'safe-local-variable #'integerp)
+ :type 'integer
+ :safe #'integerp)
(defcustom tcl-auto-newline nil
"Non-nil means automatically newline before and after braces you insert."
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 3c8d4f43dbc..2e8e8d23192 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -234,9 +234,6 @@ It creates the Imenu index for the buffer, if necessary."
(setq which-func-mode nil)
(error "Error in which-func-update: %S" info))))))
-;;;###autoload
-(define-obsolete-function-alias 'which-func-mode 'which-function-mode "24.1")
-
(defvar which-func-update-timer nil)
(unless (or (assq 'which-func-mode mode-line-misc-info)
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 8df5204fa12..885aa3cc7c7 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -6325,17 +6325,6 @@ If FACE is not a valid face name, use default face."
(ps-face-background-name face))))
-(declare-function jit-lock-fontify-now "jit-lock" (&optional start end))
-(declare-function lazy-lock-fontify-region "lazy-lock" (beg end))
-
-;; to avoid compilation gripes
-(defun ps-print-ensure-fontified (start end)
- (cond ((and (boundp 'jit-lock-mode) (symbol-value 'jit-lock-mode))
- (jit-lock-fontify-now start end))
- ((and (boundp 'lazy-lock-mode) (symbol-value 'lazy-lock-mode))
- (lazy-lock-fontify-region start end))))
-
-
(defun ps-generate-postscript-with-faces (from to)
;; Some initialization...
(setq ps-current-effect 0)
@@ -6355,7 +6344,7 @@ If FACE is not a valid face name, use default face."
;; Generate some PostScript.
(save-restriction
(narrow-to-region from to)
- (ps-print-ensure-fontified from to)
+ (font-lock-ensure from to)
(deactivate-mark) ;bug#16866.
(ps-generate-postscript-with-faces1 from to)))
@@ -6415,7 +6404,7 @@ If FACE is not a valid face name, use default face."
(ps-end-job needs-begin-file)
;; Setting this variable tells the unwind form that the
- ;; the PostScript was generated without error.
+ ;; PostScript was generated without error.
(setq completed-safely t))
;; Unwind form: If some bad mojo occurred while generating
@@ -6512,6 +6501,8 @@ If FACE is not a valid face name, use default face."
(unless noninteractive
(add-hook 'kill-emacs-query-functions #'ps-kill-emacs-check))
+(define-obsolete-function-alias 'ps-print-ensure-fontified #'font-lock-ensure "29.1")
+
(provide 'ps-print)
;;; ps-print.el ends here
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 601b2642f76..b80ee3dd7d8 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -178,7 +178,7 @@ The default is to call `find-file' to edit the selected file."
(defcustom recentf-max-menu-items 10
"Maximum number of items in the recentf menu."
:group 'recentf
- :type 'integer)
+ :type 'natnum)
(defcustom recentf-menu-filter nil
"Function used to filter files displayed in the recentf menu.
@@ -837,7 +837,7 @@ corresponding sub-menu items are displayed in the main recent files
menu or in the `recentf-arrange-by-rule-others' sub-menu if
defined."
:group 'recentf-filters
- :type 'number)
+ :type 'natnum)
(defcustom recentf-arrange-by-rule-subfilter nil
"Function called by a rule based filter to filter sub-menu elements.
diff --git a/lisp/repeat.el b/lisp/repeat.el
index fa65057a73f..a32f3a4c507 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -368,8 +368,8 @@ When non-nil and the last typed key (with or without modifiers)
doesn't exist in the keymap attached by the `repeat-map' property,
then don't activate that keymap for the next command. So only the
same keys among repeatable keys are allowed in the repeating sequence.
-For example, with a non-nil value, only `C-x u u' repeats undo,
-whereas `C-/ u' doesn't.
+For example, with a non-nil value, only \\`C-x u u' repeats undo,
+whereas \\`C-/ u' doesn't.
You can also set the property `repeat-check-key' on the command symbol.
This property can override the value of this variable.
@@ -503,11 +503,14 @@ See `describe-repeat-maps' for a list of all repeatable commands."
(map-keymap (lambda (key cmd) (and cmd (push key keys))) keymap)
(format-message "Repeat with %s%s"
(mapconcat (lambda (key)
- (key-description (vector key)))
+ (substitute-command-keys
+ (format "\\`%s'"
+ (key-description (vector key)))))
keys ", ")
(if repeat-exit-key
- (format ", or exit with %s"
- (key-description repeat-exit-key))
+ (substitute-command-keys
+ (format ", or exit with \\`%s'"
+ (key-description repeat-exit-key)))
""))))
(defun repeat-echo-message (keymap)
@@ -560,13 +563,17 @@ Used in `repeat-mode'."
(insert "A list of keymaps used by commands with the symbol property `repeat-map'.\n\n")
(dolist (keymap (sort keymaps (lambda (a b)
- (string-lessp (car a) (car b)))))
+ (when (and (symbolp (car a))
+ (symbolp (car b)))
+ (string-lessp (car a) (car b))))))
(insert (format-message
"`%s' keymap is repeatable by these commands:\n"
(car keymap)))
(dolist (command (sort (cdr keymap) #'string-lessp))
(let* ((info (help-fns--analyze-function command))
- (map (list (symbol-value (car keymap))))
+ (map (list (if (symbolp (car keymap))
+ (symbol-value (car keymap))
+ (car keymap))))
(desc (mapconcat (lambda (key)
(propertize (key-description key)
'face 'help-key-binding))
diff --git a/lisp/replace.el b/lisp/replace.el
index 34c3d5299e4..54ee64f64a5 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -415,7 +415,7 @@ word boundaries. A negative prefix arg means replace backward.
Use \\<minibuffer-local-map>\\[next-history-element] \
to pull the last incremental search string to the minibuffer
that reads FROM-STRING, or invoke replacements from
-incremental search with a key sequence like `C-s C-s M-%'
+incremental search with a key sequence like \\`C-s C-s M-%'
to use its current search string as the string to replace.
Matching is independent of case if both `case-fold-search'
@@ -472,8 +472,8 @@ To customize possible responses, change the bindings in `query-replace-map'."
(defun query-replace-regexp (regexp to-string &optional delimited start end backward region-noncontiguous-p)
"Replace some things after point matching REGEXP with TO-STRING.
As each match is found, the user must type a character saying
-what to do with it. Type SPC or `y' to replace the match,
-DEL or `n' to skip and go to the next match. For more directions,
+what to do with it. Type \\`SPC' or \\`y' to replace the match,
+\\`DEL' or \\`n' to skip and go to the next match. For more directions,
type \\[help-command] at that time.
In Transient Mark mode, if the mark is active, operate on the contents
@@ -481,12 +481,12 @@ of the region. Otherwise, operate from point to the end of the buffer's
accessible portion.
When invoked interactively, matching a newline with `\\n' will not work;
-use `C-q C-j' instead. To match a tab character (`\\t'), just press `TAB'.
+use \\`C-q C-j' instead. To match a tab character (`\\t'), just press \\`TAB'.
Use \\<minibuffer-local-map>\\[next-history-element] \
to pull the last incremental search regexp to the minibuffer
that reads REGEXP, or invoke replacements from
-incremental search with a key sequence like `C-M-s C-M-s C-M-%'
+incremental search with a key sequence like \\`C-M-s C-M-s C-M-%'
to use its current search regexp as the regexp to replace.
Matching is independent of case if both `case-fold-search'
@@ -895,6 +895,23 @@ by this function to the end of values available via
(regexp-quote (or (car search-ring) ""))
(car (symbol-value query-replace-from-history-variable))))
+(defvar-keymap read-regexp-map
+ :parent minibuffer-local-map
+ "M-c" #'read-regexp-toggle-case-folding)
+
+(defvar read-regexp--case-fold nil)
+
+(defun read-regexp-toggle-case-folding ()
+ (interactive)
+ (setq read-regexp--case-fold
+ (if (or (eq read-regexp--case-fold 'fold)
+ (and read-regexp--case-fold
+ (not (eq read-regexp--case-fold 'inhibit-fold))))
+ 'inhibit-fold
+ 'fold))
+ (minibuffer-message "Case folding is now %s"
+ (if (eq read-regexp--case-fold 'fold) "on" "off")))
+
(defun read-regexp (prompt &optional defaults history)
"Read and return a regular expression as a string.
Prompt with the string PROMPT. If PROMPT ends in \":\" (followed by
@@ -931,11 +948,14 @@ in \":\", followed by optional whitespace), DEFAULT is added to the prompt.
The optional argument HISTORY is a symbol to use for the history list.
If nil, use `regexp-history'.
-If the user has used the `M-c' command to specify case
+If the user has used the \\<read-regexp-map>\\[read-regexp-toggle-case-folding] command to specify case
sensitivity, the returned string will have a text property named
`case-fold' that has a value of either `fold' or
`inhibit-fold'. (It's up to the caller of `read-regexp' to
-respect this or not; see `read-regexp-case-fold-search'.)"
+respect this or not; see `read-regexp-case-fold-search'.)
+
+This command uses the `read-regexp-map' keymap while reading the
+regexp from the user."
(let* ((defaults
(if (and defaults (symbolp defaults))
(cond
@@ -951,29 +971,15 @@ respect this or not; see `read-regexp-case-fold-search'.)"
(suggestions (delete-dups (delq nil (delete "" suggestions))))
;; Do not automatically add default to the history for empty input.
(history-add-new-input nil)
- (case-fold case-fold-search)
+ ;; `read-regexp--case-fold' dynamically bound and may be
+ ;; altered by `M-c'.
+ (read-regexp--case-fold case-fold-search)
(input (read-from-minibuffer
(if (string-match-p ":[ \t]*\\'" prompt)
prompt
(format-prompt prompt (and (length> default 0)
(query-replace-descr default))))
- nil
- (define-keymap
- :parent minibuffer-local-map
- "M-c" (lambda ()
- (interactive)
- (setq case-fold
- (if (or (eq case-fold 'fold)
- (and case-fold
- (not (eq case-fold
- 'inhibit-fold))))
- 'inhibit-fold
- 'fold))
- (minibuffer-message
- "Case folding is now %s"
- (if (eq case-fold 'fold)
- "on"
- "off"))))
+ nil read-regexp-map
nil (or history 'regexp-history) suggestions t))
(result (if (equal input "")
;; Return the default value when the user enters
@@ -983,9 +989,9 @@ respect this or not; see `read-regexp-case-fold-search'.)"
(when result
(add-to-history (or history 'regexp-history) result))
(if (and result
- (or (eq case-fold 'fold)
- (eq case-fold 'inhibit-fold)))
- (propertize result 'case-fold case-fold)
+ (or (eq read-regexp--case-fold 'fold)
+ (eq read-regexp--case-fold 'inhibit-fold)))
+ (propertize result 'case-fold read-regexp--case-fold)
(or result input))))
(defun read-regexp-case-fold-search (regexp)
diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el
index f0efc20f037..0b18697cea7 100644
--- a/lisp/ruler-mode.el
+++ b/lisp/ruler-mode.el
@@ -509,36 +509,21 @@ START-EVENT is the mouse click event."
(setq ruler-mode-show-tab-stops (not ruler-mode-show-tab-stops))
(force-mode-line-update))
-(defvar ruler-mode-map
- (let ((km (make-sparse-keymap)))
- (define-key km [header-line down-mouse-1]
- #'ignore)
- (define-key km [header-line down-mouse-3]
- #'ignore)
- (define-key km [header-line down-mouse-2]
- #'ruler-mode-mouse-grab-any-column)
- (define-key km [header-line (shift down-mouse-1)]
- #'ruler-mode-mouse-set-left-margin)
- (define-key km [header-line (shift down-mouse-3)]
- #'ruler-mode-mouse-set-right-margin)
- (define-key km [header-line (control down-mouse-1)]
- #'ruler-mode-mouse-add-tab-stop)
- (define-key km [header-line (control down-mouse-3)]
- #'ruler-mode-mouse-del-tab-stop)
- (define-key km [header-line (control down-mouse-2)]
- #'ruler-mode-toggle-show-tab-stops)
- (define-key km [header-line (shift mouse-1)]
- #'ignore)
- (define-key km [header-line (shift mouse-3)]
- #'ignore)
- (define-key km [header-line (control mouse-1)]
- #'ignore)
- (define-key km [header-line (control mouse-3)]
- #'ignore)
- (define-key km [header-line (control mouse-2)]
- #'ignore)
- km)
- "Keymap for ruler minor mode.")
+(defvar-keymap ruler-mode-map
+ :doc "Keymap for `ruler-mode'."
+ "<header-line> <down-mouse-1>" #'ignore
+ "<header-line> <down-mouse-3>" #'ignore
+ "<header-line> <down-mouse-2>" #'ruler-mode-mouse-grab-any-column
+ "<header-line> S-<down-mouse-1>" #'ruler-mode-mouse-set-left-margin
+ "<header-line> S-<down-mouse-3>" #'ruler-mode-mouse-set-right-margin
+ "<header-line> C-<down-mouse-1>" #'ruler-mode-mouse-add-tab-stop
+ "<header-line> C-<down-mouse-3>" #'ruler-mode-mouse-del-tab-stop
+ "<header-line> C-<down-mouse-2>" #'ruler-mode-toggle-show-tab-stops
+ "<header-line> S-<mouse-1>" #'ignore
+ "<header-line> S-<mouse-3>" #'ignore
+ "<header-line> C-<mouse-1>" #'ignore
+ "<header-line> C-<mouse-3>" #'ignore
+ "<header-line> C-<mouse-2>" #'ignore)
(defvar ruler-mode-header-line-format-old nil
"Hold previous value of `header-line-format'.")
diff --git a/lisp/savehist.el b/lisp/savehist.el
index 172acaa4e87..8924c8dde23 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -97,7 +97,8 @@ This is decimal, not octal. The default is 384 (0600 in octal).
Set to nil to use the default permissions that Emacs uses, typically
mandated by umask. The default is a bit more restrictive to protect
the user's privacy."
- :type 'integer)
+ :type '(choice (natnum :tag "Specify")
+ (const :tag "Use default" :value nil)))
(defcustom savehist-autosave-interval (* 5 60)
"The interval between autosaves of minibuffer history.
diff --git a/lisp/select.el b/lisp/select.el
index 8ffe16e7b33..2d501f207f1 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -112,20 +112,28 @@ E.g. it doesn't exist under MS-Windows."
;; We keep track of the last selection here, so we can check the
;; current selection against it, and avoid passing back with
;; gui-selection-value the same text we previously killed or
-;; yanked. We track both
-;; separately in case another X application only sets one of them
-;; we aren't fooled by the PRIMARY or CLIPBOARD selection staying the same.
+;; yanked. We track both separately in case another X application only
+;; sets one of them we aren't fooled by the PRIMARY or CLIPBOARD
+;; selection staying the same.
(defvar gui--last-selected-text-clipboard nil
"The value of the CLIPBOARD selection last seen.")
+
(defvar gui--last-selected-text-primary nil
"The value of the PRIMARY selection last seen.")
(defvar gui--last-selection-timestamp-clipboard nil
"The timestamp of the CLIPBOARD selection last seen.")
+
(defvar gui--last-selection-timestamp-primary nil
"The timestamp of the PRIMARY selection last seen.")
+(defvar gui-last-cut-in-clipboard nil
+ "Whether or not the last call to `interprogram-cut-function' owned CLIPBOARD.")
+
+(defvar gui-last-cut-in-primary nil
+ "Whether or not the last call to `interprogram-cut-function' owned PRIMARY.")
+
(defun gui--set-last-clipboard-selection (text)
"Save last clipboard selection.
Save the selected text, passed as argument, and for window
@@ -182,7 +190,10 @@ MS-Windows does not have a \"primary\" selection."
;; should not be reset by cut (Bug#16382).
(setq saved-region-selection text)
(gui-set-selection 'CLIPBOARD text)
- (gui--set-last-clipboard-selection text)))
+ (gui--set-last-clipboard-selection text))
+ ;; Record which selections we now have ownership over.
+ (setq gui-last-cut-in-clipboard select-enable-clipboard
+ gui-last-cut-in-primary select-enable-primary))
(define-obsolete-function-alias 'x-select-text 'gui-select-text "25.1")
(defcustom x-select-request-type nil
@@ -218,13 +229,13 @@ decided by `x-select-request-type'. The return value is already
decoded. If `gui-get-selection' signals an error, return nil."
;; The doc string of `interprogram-paste-function' says to return
;; nil if no other program has provided text to paste.
- (unless (and
- ;; `gui-backend-selection-owner-p' might be unreliable on
- ;; some other window systems.
- (memq window-system '(x haiku))
- (eq type 'CLIPBOARD)
- ;; Should we unify this with gui--clipboard-selection-unchanged-p?
- (gui-backend-selection-owner-p type))
+ (unless (and gui-last-cut-in-clipboard
+ ;; `gui-backend-selection-owner-p' might be unreliable on
+ ;; some other window systems.
+ (memq window-system '(x haiku))
+ (eq type 'CLIPBOARD)
+ ;; Should we unify this with gui--clipboard-selection-unchanged-p?
+ (gui-backend-selection-owner-p type))
(let ((request-type (if (memq window-system '(x pgtk haiku))
(or x-select-request-type
'(UTF8_STRING COMPOUND_TEXT STRING text/plain\;charset=utf-8))
@@ -254,7 +265,15 @@ decoded. If `gui-get-selection' signals an error, return nil."
;; (bug#53894) for further discussion about this DWIM
;; action, and possible ways to make this check less
;; fragile, if so desired.
- (unless (gui--clipboard-selection-unchanged-p text)
+
+ ;; Don't check the "newness" of CLIPBOARD if the last
+ ;; call to `gui-select-text' didn't cause us to become
+ ;; its owner. This lets the user yank text killed by
+ ;; `clipboard-kill-region' with `clipboard-yank' without
+ ;; interference from text killed by other means when
+ ;; `select-enable-clipboard' is nil.
+ (unless (and gui-last-cut-in-clipboard
+ (gui--clipboard-selection-unchanged-p text))
(gui--set-last-clipboard-selection text)
text))))
(primary-text
@@ -264,7 +283,8 @@ decoded. If `gui-get-selection' signals an error, return nil."
;; Check the PRIMARY selection for 'newness', is it different
;; from what we remembered them to be last time we did a
;; cut/paste operation.
- (unless (gui--primary-selection-unchanged-p text)
+ (unless (and gui-last-cut-in-primary
+ (gui--primary-selection-unchanged-p text))
(gui--set-last-primary-selection text)
text)))))
@@ -455,6 +475,73 @@ are not available to other programs."
(symbolp data)
(integerp data)))
+
+;; Minor mode to make losing ownership of PRIMARY behave more like
+;; other X programs.
+
+(defvar lost-selection-last-region-buffer nil
+ "The last buffer from which the region was selected.")
+
+(defun lost-selection-post-select-region-function (_text)
+ "Handle the region being selected into PRIMARY.
+If the current buffer is different from the last buffer,
+deactivate the mark in every other buffer.
+TEXT is ignored."
+ (when (not (eq lost-selection-last-region-buffer
+ (current-buffer)))
+ (dolist (buffer (buffer-list))
+ (unless (or (string-match-p "^ "
+ (buffer-name buffer))
+ (eq buffer (current-buffer)))
+ (with-current-buffer buffer
+ (deactivate-mark t))))
+ (setq lost-selection-last-region-buffer (current-buffer))))
+
+(defun lost-selection-function (selection)
+ "Handle losing of ownership of SELECTION.
+If SELECTION is `PRIMARY', deactivate the mark in every
+non-temporary buffer."
+ (let ((select-active-regions nil))
+ (when (eq selection 'PRIMARY)
+ (dolist (buffer (buffer-list))
+ (unless (string-match-p "^ "
+ (buffer-name buffer))
+ (with-current-buffer buffer
+ (deactivate-mark t)))))))
+
+(define-minor-mode lost-selection-mode
+ "Toggle `lost-selection-mode'.
+
+When this is enabled, selecting some text in another program will
+cause the mark to be deactivated in all buffers, mimicking the
+behavior of most X Windows programs.
+
+Selecting text in a buffer that ends up changing the primary
+selection will also cause the mark to be deactivated in all other
+buffers."
+ :global t
+ :group 'x
+ (if lost-selection-mode
+ (progn
+ (cond ((featurep 'x) (add-hook 'x-lost-selection-functions
+ #'lost-selection-function))
+ ((featurep 'pgtk) (add-hook 'pgtk-lost-selection-functions
+ #'lost-selection-function))
+ ((featurep 'haiku) (add-hook 'haiku-lost-selection-functions
+ #'lost-selection-function)))
+ (add-hook 'post-select-region-hook
+ #'lost-selection-post-select-region-function))
+ (cond ((featurep 'x) (remove-hook 'x-lost-selection-functions
+ #'lost-selection-function))
+ ((featurep 'pgtk) (remove-hook 'pgtk-lost-selection-functions
+ #'lost-selection-function))
+ ((featurep 'haiku) (remove-hook 'haiku-lost-selection-functions
+ #'lost-selection-function)))
+ (remove-hook 'post-select-region-hook
+ #'lost-selection-post-select-region-function)
+ (setq lost-selection-last-region-buffer nil)))
+
+
;; Functions to convert the selection into various other selection types.
;; Every selection type that Emacs handles is implemented this way, except
;; for TIMESTAMP, which is a special case.
diff --git a/lisp/ses.el b/lisp/ses.el
index ba965ff8a5b..a5fd1774dd7 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -3807,7 +3807,7 @@ function is redefined."
(default (and cur-printer (ses--locprn-def cur-printer)))
create-printer)
(cond
- ;; cancelled operation => do nothing
+ ;; canceled operation => do nothing
((eq definition t))
;; no change => do nothing
((and cur-printer (equal definition default)))
diff --git a/lisp/shell.el b/lisp/shell.el
index 8bcc578406a..85225b128ab 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -440,12 +440,11 @@ Useful for shells like zsh that has this feature."
(push (point) begins)
(let ((arg ()))
(while (looking-at
- (eval-when-compile
- (concat
- "\\(?:[^\s\t\n\\\"';]+"
- "\\|'\\([^']*\\)'?"
- "\\|\"\\(\\(?:[^\"\\]\\|\\\\.\\)*\\)\"?"
- "\\|\\\\\\(\\(?:.\\|\n\\)?\\)\\)")))
+ (concat
+ "\\(?:[^\s\t\n\\\"';]+"
+ "\\|'\\([^']*\\)'?"
+ "\\|\"\\(\\(?:[^\"\\]\\|\\\\.\\)*\\)\"?"
+ "\\|\\\\\\(\\(?:.\\|\n\\)?\\)\\)"))
(goto-char (match-end 0))
(cond
((match-beginning 3) ;Backslash escape.
diff --git a/lisp/simple.el b/lisp/simple.el
index ea94727b3a7..5443d961e13 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1732,8 +1732,6 @@ from Lisp."
words (if (= words 1) "" "s")
chars (if (= chars 1) "" "s"))))
-(define-obsolete-function-alias 'count-lines-region 'count-words-region "24.1")
-
(defun what-line ()
"Print the current buffer line number and narrowed line number of point."
(interactive)
@@ -1920,17 +1918,19 @@ in *Help* buffer. See also the command `describe-char'."
bidi-fixer encoding-msg pos total percent col hscroll))))))
;; Initialize read-expression-map. It is defined at C level.
-(defvar read-expression-map
- (let ((m (make-sparse-keymap)))
- (define-key m "\M-\t" 'completion-at-point)
- ;; Might as well bind TAB to completion, since inserting a TAB char is
- ;; much too rarely useful.
- (define-key m "\t" 'completion-at-point)
- (define-key m "\r" 'read--expression-try-read)
- (define-key m "\n" 'read--expression-try-read)
- (define-key m "\M-g\M-c" 'read-expression-switch-to-completions)
- (set-keymap-parent m minibuffer-local-map)
- m))
+(defvar-keymap read-expression-map
+ :parent minibuffer-local-map
+ "C-M-i" #'completion-at-point
+ ;; Might as well bind TAB to completion, since inserting a TAB char is
+ ;; much too rarely useful.
+ "TAB" #'completion-at-point
+ "M-g M-c" #'read-expression-switch-to-completions)
+
+(defvar-keymap read--expression-map
+ :doc "Keymap used by `read--expression'."
+ :parent read-expression-map
+ "RET" #'read--expression-try-read
+ "C-j" #'read--expression-try-read)
(defun read-minibuffer (prompt &optional initial-contents)
"Return a Lisp object read using the minibuffer, unevaluated.
@@ -1951,10 +1951,6 @@ Such arguments are used as in `read-from-minibuffer'.)"
;; Used for interactive spec `X'.
(eval (read--expression prompt initial-contents)))
-(defvar minibuffer-completing-symbol nil
- "Non-nil means completing a Lisp symbol in the minibuffer.")
-(make-obsolete-variable 'minibuffer-completing-symbol nil "24.1" 'get)
-
(defvar minibuffer-default nil
"The current default value or list of default values in the minibuffer.
The functions `read-from-minibuffer' and `completing-read' bind
@@ -2015,20 +2011,19 @@ display the result of expression evaluation."
PROMPT and optional argument INITIAL-CONTENTS do the same as in
function `read-from-minibuffer'."
- (let ((minibuffer-completing-symbol t))
- (minibuffer-with-setup-hook
- (lambda ()
- ;; FIXME: instead of just applying the syntax table, maybe
- ;; use a special major mode tailored to reading Lisp
- ;; expressions from the minibuffer? (`emacs-lisp-mode'
- ;; doesn't preserve the necessary keybindings.)
- (set-syntax-table emacs-lisp-mode-syntax-table)
- (add-hook 'completion-at-point-functions
- #'elisp-completion-at-point nil t)
- (run-hooks 'eval-expression-minibuffer-setup-hook))
- (read-from-minibuffer prompt initial-contents
- read-expression-map t
- 'read-expression-history))))
+ (minibuffer-with-setup-hook
+ (lambda ()
+ ;; FIXME: instead of just applying the syntax table, maybe
+ ;; use a special major mode tailored to reading Lisp
+ ;; expressions from the minibuffer? (`emacs-lisp-mode'
+ ;; doesn't preserve the necessary keybindings.)
+ (set-syntax-table emacs-lisp-mode-syntax-table)
+ (add-hook 'completion-at-point-functions
+ #'elisp-completion-at-point nil t)
+ (run-hooks 'eval-expression-minibuffer-setup-hook))
+ (read-from-minibuffer prompt initial-contents
+ read--expression-map t
+ 'read-expression-history)))
(defun read--expression-try-read ()
"Try to read an Emacs Lisp expression in the minibuffer.
@@ -2211,7 +2206,7 @@ to get different commands to edit and resubmit."
If it's nil, include all the commands.
If it's a function, it will be called with two parameters: the
symbol of the command and a buffer. The predicate should return
-non-nil if the command should be present when doing `M-x TAB'
+non-nil if the command should be present when doing \\`M-x TAB'
in that buffer."
:version "28.1"
:group 'completion
@@ -3525,12 +3520,22 @@ Return what remains of the list."
;; If this records an obsolete save
;; (not matching the actual disk file)
;; then don't mark unmodified.
- (when (or (equal time (visited-file-modtime))
- (and (consp time)
- (equal (list (car time) (cdr time))
- (visited-file-modtime))))
- (unlock-buffer)
- (set-buffer-modified-p nil)))
+ (let ((visited-file-time (visited-file-modtime)))
+ ;; Indirect buffers don't have a visited file, so their
+ ;; file-modtime can be bogus. In that case, use the
+ ;; modtime of the base buffer instead.
+ (if (and (numberp visited-file-time)
+ (= visited-file-time 0)
+ (buffer-base-buffer))
+ (setq visited-file-time
+ (with-current-buffer (buffer-base-buffer)
+ (visited-file-modtime))))
+ (when (or (equal time visited-file-time)
+ (and (consp time)
+ (equal (list (car time) (cdr time))
+ visited-file-time)))
+ (unlock-buffer)
+ (set-buffer-modified-p nil))))
;; Element (nil PROP VAL BEG . END) is property change.
(`(nil . ,(or `(,prop ,val ,beg . ,end) pcase--dontcare))
(when (or (> (point-min) beg) (< (point-max) end))
@@ -5349,17 +5354,6 @@ that `filter-buffer-substring' received. It should return the
buffer substring between BEG and END, after filtering. If DELETE is
non-nil, it should delete the text between BEG and END from the buffer.")
-(defvar buffer-substring-filters nil
- "List of filter functions for `buffer-substring--filter'.
-Each function must accept a single argument, a string, and return a string.
-The buffer substring is passed to the first function in the list,
-and the return value of each function is passed to the next.
-As a special convention, point is set to the start of the buffer text
-being operated on (i.e., the first argument of `buffer-substring--filter')
-before these functions are called.")
-(make-obsolete-variable 'buffer-substring-filters
- 'filter-buffer-substring-function "24.1")
-
(defun filter-buffer-substring (beg end &optional delete)
"Return the buffer substring between BEG and END, after filtering.
If DELETE is non-nil, delete the text between BEG and END from the buffer.
@@ -5380,20 +5374,15 @@ that are special to a buffer, and should not be copied into other buffers."
"Default function to use for `filter-buffer-substring-function'.
Its arguments and return value are as specified for `filter-buffer-substring'.
Also respects the obsolete wrapper hook `filter-buffer-substring-functions'
-\(see `with-wrapper-hook' for details about wrapper hooks),
-and the abnormal hook `buffer-substring-filters'.
+(see `with-wrapper-hook' for details about wrapper hooks).
No filtering is done unless a hook says to."
(subr--with-wrapper-hook-no-warnings
filter-buffer-substring-functions (beg end delete)
(cond
- ((or delete buffer-substring-filters)
+ (delete
(save-excursion
(goto-char beg)
- (let ((string (if delete (delete-and-extract-region beg end)
- (buffer-substring beg end))))
- (dolist (filter buffer-substring-filters)
- (setq string (funcall filter string)))
- string)))
+ (delete-and-extract-region beg end)))
(t
(buffer-substring beg end)))))
@@ -5456,7 +5445,7 @@ ring directly.")
(defcustom kill-ring-max 120
"Maximum length of kill ring before oldest elements are thrown away."
- :type 'integer
+ :type 'natnum
:group 'killing
:version "29.1")
@@ -7026,7 +7015,7 @@ is set to the buffer displayed in that window.")
(defcustom mark-ring-max 16
"Maximum size of mark ring. Start discarding off end if gets this big."
- :type 'integer
+ :type 'natnum
:group 'editing-basics)
(defvar global-mark-ring nil
@@ -7035,7 +7024,7 @@ is set to the buffer displayed in that window.")
(defcustom global-mark-ring-max 16
"Maximum size of global mark ring. \
Start discarding off end if gets this big."
- :type 'integer
+ :type 'natnum
:group 'editing-basics)
(defun pop-to-mark-command ()
@@ -8609,10 +8598,10 @@ constitute a word."
(defcustom fill-prefix nil
"String for filling to insert at front of new line, or nil for none."
:type '(choice (const :tag "None" nil)
- string)
+ string)
+ :safe #'string-or-null-p
:group 'fill)
(make-variable-buffer-local 'fill-prefix)
-(put 'fill-prefix 'safe-local-variable 'string-or-null-p)
(defcustom auto-fill-inhibit-regexp nil
"Regexp to match lines that should not be auto-filled."
@@ -8937,7 +8926,19 @@ presented."
:global t :group 'mode-line)
(define-minor-mode auto-save-mode
- "Toggle auto-saving in the current buffer (Auto Save mode)."
+ "Toggle auto-saving in the current buffer (Auto Save mode).
+
+When this mode is enabled, Emacs periodically saves each file-visiting
+buffer in a separate \"auto-save file\". This is a safety measure to
+prevent you from losing more than a limited amount of work if the
+system crashes.
+
+Auto-saving does not alter the file visited by the buffer: the visited
+file is changed only when you request saving it explicitly (such as
+with \\[save-buffer]). If you want to save the buffer into its
+visited files automatically, use \\[auto-save-visited-mode]).
+
+For more details, see Info node `(emacs) Auto Save'."
:variable ((and buffer-auto-save-file-name
;; If auto-save is off because buffer has shrunk,
;; then toggling should turn it on.
diff --git a/lisp/so-long.el b/lisp/so-long.el
index 4950f0adb50..75201fefcad 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -38,7 +38,7 @@
;; compacted into the smallest file size possible, which often entails removing
;; newlines should they not be strictly necessary). This can result in lines
;; which are many thousands of characters long, and most programming modes
-;; simply aren't optimised (remotely) for this scenario, so performance can
+;; simply aren't optimized (remotely) for this scenario, so performance can
;; suffer significantly.
;;
;; When so-long detects such a file, it calls the command `so-long', which
@@ -412,7 +412,7 @@
;;
;; 1.1.2 - Use `so-long-mode-line-active' face on `mode-name' in `so-long-mode'.
;; 1.1.1 - Identical to 1.1, but fixing an incorrect GNU ELPA release.
-;; 1.1 - Utilise `buffer-line-statistics' in Emacs 28+, with the new
+;; 1.1 - Utilize `buffer-line-statistics' in Emacs 28+, with the new
;; `so-long-predicate' function `so-long-statistics-excessive-p'.
;; - Increase `so-long-threshold' from 250 to 10,000.
;; - Increase `so-long-max-lines' from 5 to 500.
@@ -449,7 +449,7 @@
;; - Added sgml-mode and nxml-mode to `so-long-target-modes'.
;; 0.7.4 - Refactored the handling of `whitespace-mode'.
;; 0.7.3 - Added customization group `so-long' with user options.
-;; - Added `so-long-original-values' to generalise the storage and
+;; - Added `so-long-original-values' to generalize the storage and
;; restoration of values from the original mode upon `so-long-revert'.
;; - Added `so-long-revert-hook'.
;; 0.7.2 - Remember the original major mode even with M-x `so-long-mode'.
@@ -642,7 +642,7 @@ Note that `so-long-statistics-excessive-p' requires Emacs 28.1 or later."
(defun so-long--action-type ()
"Generate a :type for `so-long-action' based on `so-long-action-alist'."
;; :type seemingly cannot be a form to be evaluated on demand, so we
- ;; endeavour to keep it up-to-date with `so-long-action-alist' by
+ ;; endeavor to keep it up-to-date with `so-long-action-alist' by
;; calling this from `so-long--action-alist-setter'.
`(radio ,@(mapcar (lambda (x) (list 'const :tag (cadr x) (car x)))
(assq-delete-all nil so-long-action-alist))
@@ -684,8 +684,8 @@ subsequently called."
(function :tag "Action")
(function :tag "Revert")))
:set #'so-long--action-alist-setter
+ :risky t
:package-version '(so-long . "1.0"))
-(put 'so-long-action-alist 'risky-local-variable t)
(defcustom so-long-action 'so-long-mode
"The action taken by `so-long' when long lines are detected.
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index b12cf3d9c2d..9184d6c5254 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -703,8 +703,6 @@ If you want to change this while speedbar is active, either use
(defvar speedbar-update-flag-disable nil
"Permanently disable changing of the update flag.")
-(define-obsolete-variable-alias
- 'speedbar-syntax-table 'speedbar-mode-syntax-table "24.1")
(defvar speedbar-mode-syntax-table
(let ((st (make-syntax-table)))
;; Turn off paren matching around here.
@@ -719,8 +717,6 @@ If you want to change this while speedbar is active, either use
st)
"Syntax-table used on the speedbar.")
-
-(define-obsolete-variable-alias 'speedbar-key-map 'speedbar-mode-map "24.1")
(defvar speedbar-mode-map
(let ((map (make-keymap)))
(suppress-keymap map t)
@@ -934,7 +930,8 @@ supported at a time.
;; reset the selection variable
(setq speedbar-last-selected-file nil)
(unless (display-graphic-p)
- (message "Use `M-x speedbar-get-focus' to see the speedbar window")))
+ (message (substitute-command-keys
+ "Use \\[speedbar-get-focus] to see the speedbar window"))))
(defun speedbar-frame-reposition-smartly ()
"Reposition the speedbar frame to be next to the attached frame."
diff --git a/lisp/startup.el b/lisp/startup.el
index 78288619d3c..ec4eddf80ef 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -800,10 +800,12 @@ It is the default value of the variable `top-level'."
;; face-font-rescale-alist into account. For such
;; situations, we ought to have a way to find all font
;; objects and regenerate them; currently we do not. As a
- ;; workaround, we specifically reset te default face's :font
- ;; attribute here. See bug#1785.
- (unless (eq face-font-rescale-alist
- old-face-font-rescale-alist)
+ ;; workaround, we specifically reset the default face's :font
+ ;; attribute here, if it was rescaled. See bug#1785.
+ (when (and (not (eq face-font-rescale-alist
+ old-face-font-rescale-alist))
+ (assoc (font-xlfd-name (face-attribute 'default :font))
+ face-font-rescale-alist #'string-match-p))
(set-face-attribute 'default nil :font (font-spec)))
;; Modify the initial frame based on what .emacs puts into
@@ -2801,7 +2803,8 @@ nil default-directory" name)
;; `nondisplayed-buffers-p' is true if there exist buffers
;; in `displayable-buffers' that were not displayed to the
;; user.
- (nondisplayed-buffers-p nil))
+ (nondisplayed-buffers-p nil)
+ (old-face-font-rescale-alist face-font-rescale-alist))
(when (> displayable-buffers-len 0)
(switch-to-buffer (car displayable-buffers)))
(cond
@@ -2845,6 +2848,14 @@ nil default-directory" name)
;; before doing any output.
(run-hooks 'emacs-startup-hook 'term-setup-hook)
+ ;; See the commentary in `normal-top-level' for why we do
+ ;; this.
+ (when (and (not (eq face-font-rescale-alist
+ old-face-font-rescale-alist))
+ (assoc (font-xlfd-name (face-attribute 'default :font))
+ face-font-rescale-alist #'string-match-p))
+ (set-face-attribute 'default nil :font (font-spec)))
+
;; It's important to notice the user settings before we
;; display the startup message; otherwise, the settings
;; won't take effect until the user gives the first
diff --git a/lisp/strokes.el b/lisp/strokes.el
index 5402ebf1e1c..d7a95393166 100644
--- a/lisp/strokes.el
+++ b/lisp/strokes.el
@@ -252,7 +252,7 @@ WARNING: Changing the value of this variable will gravely affect the
figure out what it should be based on your needs and on how
quick the particular platform(s) you're operating on, and
only then start programming in your custom strokes."
- :type 'integer)
+ :type 'natnum)
(defcustom strokes-file (locate-user-emacs-file "strokes" ".strokes")
"File containing saved strokes for Strokes mode."
@@ -1031,8 +1031,6 @@ o Strokes are a bit computer-dependent in that they depend somewhat on
(help-mode)
(help-print-return-message)))
-(define-obsolete-function-alias 'strokes-report-bug #'report-emacs-bug "24.1")
-
(defun strokes-window-configuration-changed-p ()
"Non-nil if the `strokes-window-configuration' frame properties changed.
This is based on the last time `strokes-window-configuration' was updated."
diff --git a/lisp/subr.el b/lisp/subr.el
index 4e4eac32d9d..ef2edcff102 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -964,7 +964,7 @@ side-effects, and the argument LIST is not modified."
(defun kbd (keys)
"Convert KEYS to the internal Emacs key representation.
KEYS should be a string in the format returned by commands such
-as `C-h k' (`describe-key').
+as \\[describe-key] (`describe-key').
This is the same format used for saving keyboard macros (see
`edmacro-mode').
@@ -1856,8 +1856,6 @@ be a list of the form returned by `event-start' and `event-end'."
;;;; Obsolescence declarations for variables, and aliases.
(make-obsolete-variable 'redisplay-end-trigger-functions 'jit-lock-register "23.1")
-(make-obsolete-variable 'deferred-action-list 'post-command-hook "24.1")
-(make-obsolete-variable 'deferred-action-function 'post-command-hook "24.1")
(make-obsolete-variable 'redisplay-dont-pause nil "24.5")
(make-obsolete 'window-redisplay-end-trigger nil "23.1")
(make-obsolete 'set-window-redisplay-end-trigger nil "23.1")
@@ -3484,8 +3482,11 @@ like) while `y-or-n-p' is running)."
(format "(y, n or %s) "
(key-description
(vector help-char)))
- "(y or n) "
- )))))))
+ "(y or n) "))))))
+ ;; Preserve the actual command that eventually called
+ ;; `y-or-n-p' (otherwise `repeat' will be repeating
+ ;; `exit-minibuffer').
+ (real-this-command real-this-command))
(cond
(noninteractive
(setq prompt (funcall padded prompt))
@@ -4707,9 +4708,6 @@ even if this catches the signal."
,@(cdr handler)))
handlers)))
-(define-obsolete-function-alias 'condition-case-no-debug
- 'condition-case-unless-debug "24.1")
-
(defmacro with-demoted-errors (format &rest body)
"Run BODY and demote any errors to simple messages.
FORMAT is a string passed to `message' to format any error message.
@@ -6013,7 +6011,16 @@ To test whether a function can be called interactively, use
(define-obsolete-function-alias
'set-temporary-overlay-map #'set-transient-map "24.4")
-(defun set-transient-map (map &optional keep-pred on-exit)
+(defvar set-transient-map-timeout nil
+ "Timeout in seconds for deactivation of a transient keymap.
+If this is a number, it specifies the amount of idle time
+after which to deactivate the keymap set by `set-transient-map',
+thus overriding the value of the TIMEOUT argument to that function.")
+
+(defvar set-transient-map-timer nil
+ "Timer for `set-transient-map-timeout'.")
+
+(defun set-transient-map (map &optional keep-pred on-exit message timeout)
"Set MAP as a temporary keymap taking precedence over other keymaps.
Normally, MAP is used only once, to look up the very next key.
However, if the optional argument KEEP-PRED is t, MAP stays
@@ -6024,24 +6031,52 @@ if it returns non-nil, then MAP stays active.
Optional arg ON-EXIT, if non-nil, specifies a function that is
called, with no arguments, after MAP is deactivated.
-This uses `overriding-terminal-local-map', which takes precedence over all
-other keymaps. As usual, if no match for a key is found in MAP, the normal
-key lookup sequence then continues.
+Optional arg MESSAGE, if non-nil, requests display of an informative
+message after activating the transient map. If MESSAGE is a string,
+it specifies the format string for the message to display, and the %k
+specifier in the string is replaced with the list of keys from the
+transient map. Any other non-nil value of MESSAGE means to use the
+message format string \"Repeat with %k\". Upon deactivating the map,
+the displayed message will be cleared out.
+
+Optional arg TIMEOUT, if non-nil, should be a number specifying the
+number of seconds of idle time after which the map is deactivated.
+The variable `set-transient-map-timeout', if non-nil, overrides the
+value of TIMEOUT.
+
+This function uses `overriding-terminal-local-map', which takes precedence
+over all other keymaps. As usual, if no match for a key is found in MAP,
+the normal key lookup sequence then continues.
This returns an \"exit function\", which can be called with no argument
to deactivate this transient map, regardless of KEEP-PRED."
- (let* ((clearfun (make-symbol "clear-transient-map"))
+ (let* ((timeout (or set-transient-map-timeout timeout))
+ (message
+ (when message
+ (let (keys)
+ (map-keymap (lambda (key cmd) (and cmd (push key keys))) map)
+ (format-spec (if (stringp message) message "Repeat with %k")
+ `((?k . ,(mapconcat
+ (lambda (key)
+ (substitute-command-keys
+ (format "\\`%s'"
+ (key-description (vector key)))))
+ keys ", ")))))))
+ (clearfun (make-symbol "clear-transient-map"))
(exitfun
(lambda ()
(internal-pop-keymap map 'overriding-terminal-local-map)
(remove-hook 'pre-command-hook clearfun)
+ ;; Clear the prompt after exiting.
+ (when message (message ""))
+ (when set-transient-map-timer (cancel-timer set-transient-map-timer))
(when on-exit (funcall on-exit)))))
;; Don't use letrec, because equal (in add/remove-hook) could get trapped
;; in a cycle. (bug#46326)
(fset clearfun
(lambda ()
(with-demoted-errors "set-transient-map PCH: %S"
- (unless (cond
+ (if (cond
((null keep-pred) nil)
((and (not (eq map (cadr overriding-terminal-local-map)))
(memq map (cddr overriding-terminal-local-map)))
@@ -6066,9 +6101,15 @@ to deactivate this transient map, regardless of KEEP-PRED."
;; nil and so is `mc`.
(and mc (eq this-command mc))))
(t (funcall keep-pred)))
+ ;; Repeat the message for the next command.
+ (when message (message "%s" message))
(funcall exitfun)))))
(add-hook 'pre-command-hook clearfun)
(internal-push-keymap map 'overriding-terminal-local-map)
+ (when timeout
+ (when set-transient-map-timer (cancel-timer set-transient-map-timer))
+ (setq set-transient-map-timer (run-with-idle-timer timeout nil exitfun)))
+ (when message (message "%s" message))
exitfun))
;;;; Progress reporters.
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 705b0725012..c769dbabce4 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -371,31 +371,28 @@ at the mouse-down event to the position at mouse-up event."
(tab-bar-move-tab-to
(if (null to) (1+ (tab-bar--current-tab-index)) to) from))))
-(defvar tab-bar-map
- (let ((map (make-sparse-keymap)))
- (define-key map [down-mouse-1] 'tab-bar-mouse-down-1)
- (define-key map [drag-mouse-1] 'tab-bar-mouse-move-tab)
- (define-key map [mouse-1] 'tab-bar-mouse-1)
- (define-key map [down-mouse-2] 'tab-bar-mouse-close-tab)
- (define-key map [mouse-2] 'ignore)
- (define-key map [down-mouse-3] 'tab-bar-mouse-context-menu)
-
- (define-key map [mouse-4] 'tab-previous)
- (define-key map [mouse-5] 'tab-next)
- (define-key map [wheel-up] 'tab-previous)
- (define-key map [wheel-down] 'tab-next)
- (define-key map [wheel-left] 'tab-previous)
- (define-key map [wheel-right] 'tab-next)
-
- (define-key map [S-mouse-4] 'tab-bar-move-tab-backward)
- (define-key map [S-mouse-5] 'tab-bar-move-tab)
- (define-key map [S-wheel-up] 'tab-bar-move-tab-backward)
- (define-key map [S-wheel-down] 'tab-bar-move-tab)
- (define-key map [S-wheel-left] 'tab-bar-move-tab-backward)
- (define-key map [S-wheel-right] 'tab-bar-move-tab)
-
- map)
- "Keymap for the commands used on the tab bar.")
+(defvar-keymap tab-bar-map
+ :doc "Keymap for the commands used on the tab bar."
+ "<down-mouse-1>" #'tab-bar-mouse-down-1
+ "<drag-mouse-1>" #'tab-bar-mouse-move-tab
+ "<mouse-1>" #'tab-bar-mouse-1
+ "<down-mouse-2>" #'tab-bar-mouse-close-tab
+ "<mouse-2>" #'ignore
+ "<down-mouse-3>" #'tab-bar-mouse-context-menu
+
+ "<mouse-4>" #'tab-previous
+ "<mouse-5>" #'tab-next
+ "<wheel-up>" #'tab-previous
+ "<wheel-down>" #'tab-next
+ "<wheel-left>" #'tab-previous
+ "<wheel-right>" #'tab-next
+
+ "S-<mouse-4>" #'tab-bar-move-tab-backward
+ "S-<mouse-5>" #'tab-bar-move-tab
+ "S-<wheel-up>" #'tab-bar-move-tab-backward
+ "S-<wheel-down>" #'tab-bar-move-tab
+ "S-<wheel-left>" #'tab-bar-move-tab-backward
+ "S-<wheel-right>" #'tab-bar-move-tab)
(global-set-key [tab-bar]
`(menu-item ,(purecopy "tab bar") ignore
@@ -618,7 +615,7 @@ Also add the number of windows in the window configuration."
"Maximum length of the tab name from the current buffer.
Effective when `tab-bar-tab-name-function' is customized
to `tab-bar-tab-name-truncated'."
- :type 'integer
+ :type 'natnum
:group 'tab-bar
:version "27.1")
@@ -2006,26 +2003,25 @@ For more information, see the function `tab-switcher'."
(defvar-local tab-switcher-column 3)
-(defvar tab-switcher-mode-map
- (let ((map (make-keymap)))
- (suppress-keymap map t)
- (define-key map "q" 'quit-window)
- (define-key map "\C-m" 'tab-switcher-select)
- (define-key map "d" 'tab-switcher-delete)
- (define-key map "k" 'tab-switcher-delete)
- (define-key map "\C-d" 'tab-switcher-delete-backwards)
- (define-key map "\C-k" 'tab-switcher-delete)
- (define-key map "x" 'tab-switcher-execute)
- (define-key map " " 'tab-switcher-next-line)
- (define-key map "n" 'tab-switcher-next-line)
- (define-key map "p" 'tab-switcher-prev-line)
- (define-key map "\177" 'tab-switcher-backup-unmark)
- (define-key map "?" 'describe-mode)
- (define-key map "u" 'tab-switcher-unmark)
- (define-key map [mouse-2] 'tab-switcher-mouse-select)
- (define-key map [follow-link] 'mouse-face)
- map)
- "Local keymap for `tab-switcher-mode' buffers.")
+(defvar-keymap tab-switcher-mode-map
+ :doc "Local keymap for `tab-switcher-mode' buffers."
+ :full t
+ :suppress t
+ "q" #'quit-window
+ "RET" #'tab-switcher-select
+ "d" #'tab-switcher-delete
+ "k" #'tab-switcher-delete
+ "C-d" #'tab-switcher-delete-backwards
+ "C-k" #'tab-switcher-delete
+ "x" #'tab-switcher-execute
+ "SPC" #'tab-switcher-next-line
+ "n" #'tab-switcher-next-line
+ "p" #'tab-switcher-prev-line
+ "DEL" #'tab-switcher-backup-unmark
+ "?" #'describe-mode
+ "u" #'tab-switcher-unmark
+ "<mouse-2>" #'tab-switcher-mouse-select
+ "<follow-link>" 'mouse-face)
(define-derived-mode tab-switcher-mode nil "Window Configurations"
"Major mode for selecting a window configuration.
@@ -2401,42 +2397,38 @@ When `switch-to-buffer-obey-display-actions' is non-nil,
(defalias 'tab-group 'tab-bar-change-tab-group)
(defalias 'tab-list 'tab-switcher)
-(define-key tab-prefix-map "n" 'tab-duplicate)
-(define-key tab-prefix-map "N" 'tab-new-to)
-(define-key tab-prefix-map "2" 'tab-new)
-(define-key tab-prefix-map "1" 'tab-close-other)
-(define-key tab-prefix-map "0" 'tab-close)
-(define-key tab-prefix-map "u" 'tab-undo)
-(define-key tab-prefix-map "o" 'tab-next)
-(define-key tab-prefix-map "O" 'tab-previous)
-(define-key tab-prefix-map "m" 'tab-move)
-(define-key tab-prefix-map "M" 'tab-move-to)
-(define-key tab-prefix-map "G" 'tab-group)
-(define-key tab-prefix-map "r" 'tab-rename)
-(define-key tab-prefix-map "\r" 'tab-switch)
-(define-key tab-prefix-map "b" 'switch-to-buffer-other-tab)
-(define-key tab-prefix-map "f" 'find-file-other-tab)
-(define-key tab-prefix-map "\C-f" 'find-file-other-tab)
-(define-key tab-prefix-map "\C-r" 'find-file-read-only-other-tab)
-(define-key tab-prefix-map "t" 'other-tab-prefix)
-
-(defvar tab-bar-switch-repeat-map
- (let ((map (make-sparse-keymap)))
- (define-key map "o" 'tab-next)
- (define-key map "O" 'tab-previous)
- map)
- "Keymap to repeat tab switch key sequences `C-x t o o O'.
-Used in `repeat-mode'.")
+(keymap-set tab-prefix-map "n" #'tab-duplicate)
+(keymap-set tab-prefix-map "N" #'tab-new-to)
+(keymap-set tab-prefix-map "2" #'tab-new)
+(keymap-set tab-prefix-map "1" #'tab-close-other)
+(keymap-set tab-prefix-map "0" #'tab-close)
+(keymap-set tab-prefix-map "u" #'tab-undo)
+(keymap-set tab-prefix-map "o" #'tab-next)
+(keymap-set tab-prefix-map "O" #'tab-previous)
+(keymap-set tab-prefix-map "m" #'tab-move)
+(keymap-set tab-prefix-map "M" #'tab-move-to)
+(keymap-set tab-prefix-map "G" #'tab-group)
+(keymap-set tab-prefix-map "r" #'tab-rename)
+(keymap-set tab-prefix-map "r" #'tab-switch)
+(keymap-set tab-prefix-map "b" #'switch-to-buffer-other-tab)
+(keymap-set tab-prefix-map "f" #'find-file-other-tab)
+(keymap-set tab-prefix-map "C-f" #'find-file-other-tab)
+(keymap-set tab-prefix-map "C-r" #'find-file-read-only-other-tab)
+(keymap-set tab-prefix-map "t" #'other-tab-prefix)
+
+(defvar-keymap tab-bar-switch-repeat-map
+ :doc "Keymap to repeat tab switch key sequences \\`C-x t o o O'.
+Used in `repeat-mode'."
+ "o" #'tab-next
+ "O" #'tab-previous)
(put 'tab-next 'repeat-map 'tab-bar-switch-repeat-map)
(put 'tab-previous 'repeat-map 'tab-bar-switch-repeat-map)
-(defvar tab-bar-move-repeat-map
- (let ((map (make-sparse-keymap)))
- (define-key map "m" 'tab-move)
- (define-key map "M" 'tab-bar-move-tab-backward)
- map)
- "Keymap to repeat tab move key sequences `C-x t m m M'.
-Used in `repeat-mode'.")
+(defvar-keymap tab-bar-move-repeat-map
+ :doc "Keymap to repeat tab move key sequences \\`C-x t m m M'.
+Used in `repeat-mode'."
+ "m" #'tab-move
+ "M" #'tab-bar-move-tab-backward)
(put 'tab-move 'repeat-map 'tab-bar-move-repeat-map)
(put 'tab-bar-move-tab-backward 'repeat-map 'tab-bar-move-repeat-map)
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 80b0aabd776..3e3b4c95595 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -288,7 +288,7 @@ variable `tab-line-tab-name-function'."
"Maximum length of the tab name from the current buffer.
Effective when `tab-line-tab-name-function' is customized
to `tab-line-tab-name-truncated-buffer'."
- :type 'integer
+ :type 'natnum
:group 'tab-line
:version "27.1")
diff --git a/lisp/term.el b/lisp/term.el
index 3bf1531fcd9..a28d8c5d761 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -915,7 +915,7 @@ Term buffers are truncated from the top to be no greater than this number.
Notice that a setting of 0 means \"don't truncate anything\". This variable
is buffer-local."
:group 'term
- :type 'integer
+ :type 'natnum
:version "27.1")
(defcustom term-bind-function-keys nil
@@ -2473,7 +2473,7 @@ Checks if STRING contains a password prompt as defined by
"Long inputs send to term processes are broken up into chunks of this size.
If your process is choking on big inputs, try lowering the value."
:group 'term
- :type 'integer)
+ :type 'natnum)
(defun term-send-string (proc str)
"Send to PROC the contents of STR as input.
@@ -4373,7 +4373,7 @@ the process. Any more args are arguments to PROGRAM."
(defun ansi-term (program &optional new-buffer-name)
"Start a terminal-emulator in a new buffer.
This is almost the same as `term' apart from always creating a new buffer,
-and `C-x' being marked as a `term-escape-char'."
+and \\`C-x' being marked as a `term-escape-char'."
(interactive (list (read-from-minibuffer "Run program: "
(or explicit-shell-file-name
(getenv "ESHELL")
diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el
index f6e4829cad4..b36e3037ee8 100644
--- a/lisp/term/haiku-win.el
+++ b/lisp/term/haiku-win.el
@@ -206,6 +206,7 @@ VALUE as a unibyte string, or nil if VALUE was not a string."
(declare-function haiku-selection-owner-p "haikuselect.c")
(declare-function haiku-put-resource "haikufns.c")
(declare-function haiku-drag-message "haikuselect.c")
+(declare-function haiku-selection-timestamp "haikuselect.c")
(defun haiku--handle-x-command-line-resources (command-line-resources)
"Handle command line X resources specified with the option `-xrm'.
@@ -249,7 +250,7 @@ If TYPE is nil, return \"text/plain\"."
"Find the types of data available from CLIPBOARD.
CLIPBOARD should be the symbol `PRIMARY', `SECONDARY' or
`CLIPBOARD'. Return the available types as a list of strings."
- (mapcar #'car (haiku-selection-data clipboard nil)))
+ (delq 'type (mapcar #'car (haiku-selection-data clipboard nil))))
(defun haiku-select-encode-xstring (_selection value)
"Convert VALUE to a system message association.
@@ -288,12 +289,19 @@ or a pair of markers) and turns it into a file system reference."
(cl-defmethod gui-backend-get-selection (type data-type
&context (window-system haiku))
- (if (eq data-type 'TARGETS)
- (apply #'vector (mapcar #'intern
- (haiku-selection-targets type)))
- (if (eq type 'XdndSelection)
- haiku-dnd-selection-value
- (haiku-selection-data type (haiku--selection-type-to-mime data-type)))))
+ (cond
+ ((eq data-type 'TARGETS)
+ (apply #'vector (mapcar #'intern
+ (haiku-selection-targets type))))
+ ;; The timestamp here is really the number of times a program has
+ ;; put data into the selection. But it always increases, so it
+ ;; makes sense if one imagines that time is frozen until
+ ;; immediately before that happens.
+ ((eq data-type 'TIMESTAMP)
+ (haiku-selection-timestamp type))
+ ((eq type 'XdndSelection) haiku-dnd-selection-value)
+ (t (haiku-selection-data type
+ (haiku--selection-type-to-mime data-type)))))
(cl-defmethod gui-backend-set-selection (type value
&context (window-system haiku))
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 84c5b087b9a..e26191b33b4 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -97,8 +97,6 @@ The properties returned may include `top', `left', `height', and `width'."
;;;; Keyboard mapping.
-(define-obsolete-variable-alias 'ns-alternatives-map 'x-alternatives-map "24.1")
-
;; Here are some Nextstep-like bindings for command key sequences.
(define-key global-map [?\s-,] 'customize)
(define-key global-map [?\s-'] 'next-window-any-frame)
@@ -682,10 +680,6 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
;;;; Pasteboard support.
-(define-obsolete-function-alias 'ns-store-cut-buffer-internal
- 'gui-set-selection "24.1")
-
-
(defun ns-copy-including-secondary ()
(interactive)
(call-interactively 'kill-ring-save)
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 7eaa6047763..993f1d43208 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -81,7 +81,6 @@
(&optional frame exclude-proportional))
(defvar w32-color-map) ;; defined in w32fns.c
-(make-obsolete 'w32-default-color-map nil "24.1")
(declare-function w32-send-sys-command "w32fns.c")
(declare-function set-message-beep "w32fns.c")
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 7c88c85ceff..3a0bd65f29c 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1171,9 +1171,6 @@ as returned by `x-server-vendor'."
;;;; Selections
-(define-obsolete-function-alias 'x-cut-buffer-or-selection-value
- 'x-selection-value "24.1")
-
;; Arrange for the kill and yank functions to set and check the clipboard.
(defun x-clipboard-yank ()
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index a7e257f41c5..08e38c9a050 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -66,7 +66,7 @@ If you select a region larger than this size, it won't be copied to your system
clipboard. Since clipboard data is base 64 encoded, the actual number of
string bytes that can be copied is 3/4 of this value."
:version "25.1"
- :type 'integer)
+ :type 'natnum)
(defcustom xterm-set-window-title nil
"Whether Emacs should set window titles to an Emacs frame in an XTerm."
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 544e0da8276..333cfa51695 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -316,8 +316,6 @@ If parsing fails, try to set this variable to nil."
(option (choice :tag "Alternative" :value nil
(const nil) integer)))))))
-(define-obsolete-variable-alias 'bibtex-entry-field-alist
- 'bibtex-BibTeX-entry-alist "24.1")
(defcustom bibtex-BibTeX-entry-alist
'(("Article" "Article in Journal"
(("author")
@@ -3661,7 +3659,11 @@ if that value is non-nil.
?\s)))))
(if (and buffer-file-name enable-local-variables)
(add-hook 'hack-local-variables-hook fun nil t)
- (funcall fun))))
+ (funcall fun)))
+ ;; We may be using the mode programmatically to extract data, and we
+ ;; then need this to be set up first so that sexp-based movement
+ ;; commands don't bug out.
+ (font-lock-set-defaults))
(defun bibtex-entry-alist (dialect)
"Return entry-alist for DIALECT."
@@ -3673,14 +3675,6 @@ if that value is non-nil.
(if (not (consp (nth 1 (car entry-alist))))
;; new format
entry-alist
- ;; Convert old format of `bibtex-entry-field-alist'
- (unless (get var 'entry-list-format)
- (put var 'entry-list-format "pre-24")
- (message "Old format of `%s' (pre GNU Emacs 24).
-Please convert to the new format."
- (if (eq (indirect-variable 'bibtex-entry-field-alist) var)
- 'bibtex-entry-field-alist var))
- (sit-for 3))
(let (lst)
(dolist (entry entry-alist)
(let ((fl (nth 1 entry)) req xref opt)
@@ -5318,7 +5312,6 @@ entries from minibuffer."
(goto-char (point-max))
(message "Buffer is now parsable. Please save it.")))
-(define-obsolete-function-alias 'bibtex-complete #'completion-at-point "24.1")
(defun bibtex-completion-at-point-function ()
(let ((pnt (point))
(case-fold-search t)
diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el
index fdb3cb86284..af0aa2ddeab 100644
--- a/lisp/textmodes/emacs-news-mode.el
+++ b/lisp/textmodes/emacs-news-mode.el
@@ -24,6 +24,7 @@
;;; Code:
(eval-when-compile (require 'cl-lib))
+(require 'outline)
(defgroup emacs-news-mode nil
"Major mode for editing and viewing the Emacs NEWS file."
@@ -39,12 +40,26 @@
"Face used for displaying the \"does not need documentation\" tag."
:version "29.1")
+(defvar-keymap emacs-news-common-map
+ ;; Navigation like `org-mode'/`outline-minor-mode'.
+ "C-c C-f" #'outline-forward-same-level
+ "C-c C-b" #'outline-backward-same-level
+ "C-c C-n" #'outline-next-visible-heading
+ "C-c C-p" #'outline-previous-visible-heading
+ "C-c C-u" #'outline-up-heading)
+
(defvar-keymap emacs-news-mode-map
+ :parent emacs-news-common-map
"C-c C-s" #'emacs-news-next-untagged-entry
"C-c C-r" #'emacs-news-previous-untagged-entry
+ "C-c C-t" #'emacs-news-toggle-tag
"C-c C-g" #'emacs-news-goto-section
- "C-c C-f" #'emacs-news-find-heading
- "C-c C-n" #'emacs-news-count-untagged-entries)
+ "C-c C-j" #'emacs-news-find-heading
+ "C-c C-e" #'emacs-news-count-untagged-entries
+ "<remap> <open-line>" #'emacs-news-open-line)
+
+(defvar-keymap emacs-news-view-mode-map
+ :parent emacs-news-common-map)
(defvar emacs-news-mode-font-lock-keywords
`(("^---$" 0 'emacs-news-does-not-need-documentation)
@@ -148,6 +163,26 @@ untagged NEWS entry."
(interactive nil emacs-news-mode)
(emacs-news-next-untagged-entry t))
+(defun emacs-news-toggle-tag ()
+ "Toggle documentation tag of current headline in the Emacs NEWS file."
+ (interactive nil emacs-news-mode)
+ (save-excursion
+ (goto-char (line-beginning-position))
+ (cond ((or (looking-at (rx bol (or "---" "+++") eol)))
+ (forward-line 2))
+ ((or (looking-at (rx bol "*** ")))
+ (forward-line 1)))
+ (outline-previous-visible-heading 1)
+ (forward-line -1)
+ (cond ((not (looking-at (rx bol (or "---" "+++") eol)))
+ (insert "\n---"))
+ ((looking-at (rx bol "---" eol))
+ (delete-char 3)
+ (insert "+++"))
+ ((looking-at (rx bol "+++" eol))
+ (delete-char 4))
+ (t (user-error "Invalid headline tag; can't toggle")))))
+
(defun emacs-news-count-untagged-entries ()
"Say how many untagged entries there are in the current NEWS buffer."
(interactive nil emacs-news-mode)
@@ -219,6 +254,16 @@ untagged NEWS entry."
(when (re-search-forward (concat "^*+ " (regexp-quote heading)) nil t)
(beginning-of-line)))
+(defun emacs-news-open-line (n)
+ "Open a new line in a NEWS file.
+This is like `open-line', but skips any temporary NEWS-style
+documentation marks on the previous line."
+ (interactive "*p" emacs-news-mode)
+ (when (save-excursion (forward-line -1)
+ (looking-at (rx bol (or "---" "+++") eol)))
+ (forward-line -1))
+ (open-line n))
+
(provide 'emacs-news-mode)
;;; emacs-news-mode.el ends here
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 88a8395c88a..23ba1a24f1f 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -46,8 +46,8 @@ A value of nil means that any change in indentation starts a new paragraph."
(defcustom colon-double-space nil
"Non-nil means put two spaces after a colon when filling."
- :type 'boolean)
-(put 'colon-double-space 'safe-local-variable #'booleanp)
+ :type 'boolean
+ :safe #'booleanp)
(defcustom fill-separate-heterogeneous-words-with-space nil
"Non-nil means to use a space to separate words of a different kind.
diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el
index 24149f9afb8..6b71f26e4f2 100644
--- a/lisp/textmodes/page-ext.el
+++ b/lisp/textmodes/page-ext.el
@@ -515,13 +515,12 @@ resets the page-delimiter to the original value."
(defvar pages-buffer-original-position)
(defvar pages-buffer-original-page)
-(defun pages-directory
- (pages-list-all-headers-p count-lines-p &optional regexp)
+(defun pages-directory (pages-list-all-headers-p count-lines-p &optional regexp)
"Display a directory of the page headers in a temporary buffer.
A header is the first non-blank line after the `page-delimiter'.
-\\[pages-directory-mode]
+\\<pages-directory-mode-map>
You may move point to one of the lines in the temporary buffer,
-then use \\<pages-directory-goto> to go to the same line in the pages buffer.
+then use \\[pages-directory-goto] to go to the same line in the pages buffer.
In interactive use:
@@ -587,7 +586,9 @@ directory for only the accessible portion of the buffer."
(pages-directory-mode)
(setq buffer-read-only nil)
(insert
- "==== Pages Directory: use `C-c C-c' to go to page under cursor. ====" ?\n)
+ (substitute-command-keys
+ "==== Pages Directory: use \\<pages-directory-mode-map>\
+\\[pages-directory-goto] to go to page under cursor. ====") "\n")
(setq pages-buffer pages-target-buffer)
(setq pages-pos-list nil))
@@ -772,7 +773,9 @@ directory."
(goto-char (point-min))
(delete-region (point) (line-end-position))
(insert
- "=== Address List Directory: use `C-c C-c' to go to page under cursor. ===")
+ (substitute-command-keys
+ "=== Address List Directory: use \\<pages-directory-mode-map>\
+\\[pages-directory-goto] to go to page under cursor. ==="))
(set-buffer-modified-p nil)
))
(error "No addresses file found!")))
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 98eb494823d..cd726ad4776 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -96,8 +96,8 @@ lines that start paragraphs from lines that separate them.
If the variable `use-hard-newlines' is non-nil, then only lines following a
hard newline are considered to match."
- :type 'regexp)
-(put 'paragraph-start 'safe-local-variable #'stringp)
+ :type 'regexp
+ :safe #'stringp)
;; paragraph-start requires a hard newline, but paragraph-separate does not:
;; It is assumed that paragraph-separate is distinctive enough to be believed
@@ -113,8 +113,8 @@ This is matched against the text at the left margin, which is not necessarily
the beginning of the line, so it should not use \"^\" as an anchor. This
ensures that the paragraph functions will work equally within a region of
text indented by a margin setting."
- :type 'regexp)
-(put 'paragraph-separate 'safe-local-variable #'stringp)
+ :type 'regexp
+ :safe #'stringp)
(defcustom sentence-end-double-space t
"Non-nil means a single space does not end a sentence.
@@ -125,8 +125,8 @@ This value is used by the function `sentence-end' to construct the
regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:type 'boolean
+ :safe #'booleanp
:group 'fill)
-(put 'sentence-end-double-space 'safe-local-variable #'booleanp)
(defcustom sentence-end-without-period nil
"Non-nil means a sentence will end without a period.
@@ -137,8 +137,8 @@ This value is used by the function `sentence-end' to construct the
regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
:type 'boolean
+ :safe #'booleanp
:group 'fill)
-(put 'sentence-end-without-period 'safe-local-variable #'booleanp)
(defcustom sentence-end-without-space
"。.?!"
@@ -147,8 +147,8 @@ regexp describing the end of a sentence, when the value of the variable
This value is used by the function `sentence-end' to construct the
regexp describing the end of a sentence, when the value of the variable
`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
- :type 'string)
-(put 'sentence-end-without-space 'safe-local-variable #'stringp)
+ :type 'string
+ :safe #'stringp)
(defcustom sentence-end nil
"Regexp describing the end of a sentence.
@@ -158,14 +158,14 @@ All paragraph boundaries also end sentences, regardless.
The value nil means to use the default value defined by the
function `sentence-end'. You should always use this function
to obtain the value of this variable."
- :type '(choice regexp (const :tag "Use default value" nil)))
-(put 'sentence-end 'safe-local-variable #'string-or-null-p)
+ :type '(choice regexp (const :tag "Use default value" nil))
+ :safe #'string-or-null-p)
(defcustom sentence-end-base "[.?!…‽][]\"'”’)}»›]*"
"Regexp matching the basic end of a sentence, not including following space."
:type 'regexp
+ :safe #'stringp
:version "25.1")
-(put 'sentence-end-base 'safe-local-variable #'stringp)
(defun sentence-end ()
"Return the regexp describing the end of a sentence.
@@ -192,14 +192,14 @@ in between. See Info node `(elisp)Standard Regexps'."
(defcustom page-delimiter "^\014"
"Regexp describing line-beginnings that separate pages."
- :type 'regexp)
-(put 'page-delimiter 'safe-local-variable #'stringp)
+ :type 'regexp
+ :safe #'stringp)
(defcustom paragraph-ignore-fill-prefix nil
"Non-nil means the paragraph commands are not affected by `fill-prefix'.
This is desirable in modes where blank lines are the paragraph delimiters."
- :type 'boolean)
-(put 'paragraph-ignore-fill-prefix 'safe-local-variable #'booleanp)
+ :type 'boolean
+ :safe #'booleanp)
;; Silence the compiler.
(defun forward-paragraph (&optional arg)
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 9adf0c819bf..b517cc16634 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -269,8 +269,6 @@ will prompt for other arguments."
(and newtag (cdr cell) (not (member newtag (cdr cell)))
(push newtag (cdr cell)))))
-(define-obsolete-variable-alias
- 'reftex-index-map 'reftex-index-mode-map "24.1")
(defvar reftex-index-mode-map
(let ((map (make-sparse-keymap)))
;; Index map
@@ -1198,8 +1196,6 @@ This gets refreshed in every phrases command.")
'((reftex-index-phrases-font-lock-keywords)
nil t nil beginning-of-line)
"Font lock defaults for `reftex-index-phrases-mode'.")
-(define-obsolete-variable-alias
- 'reftex-index-phrases-map 'reftex-index-phrases-mode-map "24.1")
(defvar reftex-index-phrases-mode-map
(let ((map (make-sparse-keymap)))
;; Keybindings and Menu for phrases buffer
@@ -1685,8 +1681,8 @@ this function repeatedly."
(defun reftex-index-phrases-set-macro-key ()
"Change the macro key for the current line.
Prompts for a macro key and insert is at the beginning of the line.
-If you reply with SPACE, the macro keyn will be removed, so that the
-default macro will be used. If you reply with `RET', just prints
+If you reply with \\`SPC', the macro key will be removed, so that the
+default macro will be used. If you reply with \\`RET', just prints
information about the currently selected macro."
(interactive)
(reftex-index-phrases-parse-header)
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index d77411483f7..5942801a8a9 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -59,8 +59,6 @@
(define-key map [follow-link] 'mouse-face)
map))
-(define-obsolete-variable-alias
- 'reftex-select-label-map 'reftex-select-label-mode-map "24.1")
(defvar reftex-select-label-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map reftex-select-shared-map)
@@ -109,8 +107,6 @@ During a selection process, these are the local bindings.
;; We do not set a local map - reftex-select-item does this.
)
-(define-obsolete-variable-alias
- 'reftex-select-bib-map 'reftex-select-bib-mode-map "24.1")
(defvar reftex-select-bib-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map reftex-select-shared-map)
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index f6f72cec4f8..5599eaee024 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -28,7 +28,6 @@
(require 'reftex)
;;;
-(define-obsolete-variable-alias 'reftex-toc-map 'reftex-toc-mode-map "24.1")
(defvar reftex-toc-mode-map
(let ((map (make-sparse-keymap)))
@@ -157,22 +156,22 @@ Here are all local bindings.
(defconst reftex-toc-help
" AVAILABLE KEYS IN TOC BUFFER
============================
-n / p next-line / previous-line
-SPC Show the corresponding location of the LaTeX document.
-TAB Goto the location and keep the TOC window.
-RET Goto the location and hide the TOC window (also on mouse-2).
-< / > Promote / Demote section, or all sections in region.
-C-c > Display Index. With prefix arg, restrict index to current section.
-q / k Hide/Kill *toc* buffer, return to position of reftex-toc command.
-l i c F Toggle display of [l]abels, [i]ndex, [c]ontext, [F]ile borders.
-t Change maximum toc depth (e.g. `3 t' hides levels greater than 3).
-f / g Toggle follow mode / Refresh *toc* buffer.
-a / d Toggle auto recenter / Toggle dedicated frame
-r / C-u r Reparse the LaTeX document / Reparse entire LaTeX document.
-. In other window, show position from where `reftex-toc' was called.
-M-% Global search and replace to rename label at point.
-x Switch to TOC of external document (with LaTeX package `xr').
-z Jump to a specific section (e.g. '3 z' goes to section 3).")
+\\`n' / \\`p' `next-line' / `previous-line'
+\\`SPC' Show the corresponding location of the LaTeX document.
+\\`TAB' Goto the location and keep the TOC window.
+\\`RET' Goto the location and hide the TOC window (also on `mouse-2').
+\\`<' / \\`>' Promote / Demote section, or all sections in region.
+\\`C-c >' Display Index. With prefix arg, restrict index to current section.
+\\`q' / \\`k' Hide/Kill *toc* buffer, return to position of reftex-toc command.
+\\`l' \\`i' \\`c' \\`F' Toggle display of [l]abels, [i]ndex, [c]ontext, [F]ile borders.
+\\`t' Change maximum toc depth (e.g. `3 t' hides levels greater than 3).
+\\`f' / \\`g' Toggle follow mode / Refresh *toc* buffer.
+\\`a' / \\`d' Toggle auto recenter / Toggle dedicated frame
+\\`r' / \\`C-u r' Reparse the LaTeX document / Reparse entire LaTeX document.
+\\`.' In other window, show position from where `reftex-toc' was called.
+\\`M-%' Global search and replace to rename label at point.
+\\`x' Switch to TOC of external document (with LaTeX package `xr').
+\\`z' Jump to a specific section (e.g. \\`3 z' goes to section 3).")
(defvar reftex--rebuilding-toc nil)
@@ -394,7 +393,9 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
(frame-parameter frame 'name))
"RefTeX TOC Frame")))
(if (and res error)
- (error "This frame is view-only. Use `C-c =' to create TOC window for commands"))
+ (error (substitute-command-keys
+ "This frame is view-only. Use \\[reftex-toc] \
+to create TOC window for commands")))
res))
(defun reftex-toc-show-help ()
@@ -402,7 +403,9 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
(interactive)
(reftex-toc-dframe-p nil 'error)
(with-output-to-temp-buffer "*RefTeX Help*"
- (princ reftex-toc-help))
+ (let ((help (substitute-command-keys reftex-toc-help)))
+ (with-current-buffer standard-output
+ (insert help))))
(reftex-enlarge-to-fit "*RefTeX Help*" t)
;; If follow mode is active, arrange to delay it one command
(if reftex-toc-follow-mode
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index 964baed03c7..c0d4dc68afa 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -48,10 +48,10 @@
;; the contents of this package and how to use it.
;;
;; For more information about reStructuredText, see
-;; http://docutils.sourceforge.net/rst.html
+;; https://docutils.sourceforge.io/rst.html
;;
;; For full details on how to use the contents of this file, see
-;; http://docutils.sourceforge.net/docs/user/emacs.html
+;; https://docutils.sourceforge.io/docs/user/emacs.html
;;
;; There are a number of convenient key bindings provided by rst-mode. For the
;; bindings, try C-c C-h when in rst-mode. There are also many variables that
@@ -72,7 +72,7 @@
;;; DOWNLOAD
;; The latest release of this file lies in the docutils source code repository:
-;; http://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils/tools/editors/emacs/rst.el
+;; https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/tools/editors/emacs/rst.el
;;; INSTALLATION
@@ -81,7 +81,7 @@
;; (require 'rst)
;;
;; If you are using `.txt' as a standard extension for reST files as
-;; http://docutils.sourceforge.net/FAQ.html#what-s-the-standard-filename-extension-for-a-restructuredtext-file
+;; https://docutils.sourceforge.io/FAQ.html#what-s-the-standard-filename-extension-for-a-restructuredtext-file
;; suggests you may use one of the `Local Variables in Files' mechanism Emacs
;; provides to set the major mode automatically. For instance you may use::
;;
@@ -274,7 +274,7 @@ in parentheses follows the development revision and the time stamp.")
(defgroup rst nil "Support for reStructuredText documents."
:group 'text
:version "23.1"
- :link '(url-link "http://docutils.sourceforge.net/rst.html"))
+ :link '(url-link "https://docutils.sourceforge.io/rst.html"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2153,8 +2153,8 @@ around the cursor. Then the following cases are distinguished.
(end-of-line))
nil)))))
-;; Maintain an alias for compatibility.
-(defalias 'rst-adjust-section-title 'rst-adjust)
+(define-obsolete-function-alias 'rst-adjust-section-title
+ #'rst-adjust "29.1")
(defun rst-adjust-region (demote)
;; testcover: ok.
@@ -2205,8 +2205,8 @@ Hierarchy is displayed in a temporary buffer."
(insert "\n")
(cl-incf level))))))
-;; Maintain an alias for backward compatibility.
-(defalias 'rst-display-adornments-hierarchy 'rst-display-hdr-hierarchy)
+(define-obsolete-function-alias 'rst-display-adornments-hierarchy
+ #'rst-display-hdr-hierarchy "29.1")
;; FIXME: Should accept an argument giving the hierarchy level to start with
;; instead of the top of the hierarchy.
@@ -2231,8 +2231,8 @@ in order to adapt it to our preferred style."
(goto-char marker) nil)
(rst-update-section (nth level (rst-Hdr-preferred-adornments))))))
-;; Maintain an alias for compatibility.
-(defalias 'rst-straighten-adornments 'rst-straighten-sections)
+(define-obsolete-function-alias 'rst-straighten-adornments
+ #'rst-straighten-sections "29.1")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2858,8 +2858,8 @@ file-write hook to always make it up-to-date automatically."
;; ;; Disable undo for the write file hook.
;; (let ((buffer-undo-list t)) (rst-toc-update) ))
-;; Maintain an alias for compatibility.
-(defalias 'rst-toc-insert-update 'rst-toc-update)
+(define-obsolete-function-alias 'rst-toc-insert-update
+ #'rst-toc-update "29.1")
(defconst rst-toc-buffer-name "*Table of Contents*"
"Name of the Table of Contents buffer.")
@@ -2893,8 +2893,8 @@ selecting a section title moves the cursor to that section."
(setq rst-toc-mode-return-wincfg wincfg)
(goto-char (or target-pos (point-min)))))
-;; Maintain an alias for compatibility.
-(defalias 'rst-goto-section 'rst-toc-follow-link)
+(define-obsolete-function-alias 'rst-goto-section
+ #'rst-toc-follow-link "29.1")
(defun rst-toc-follow-link (link-buf link-pnt kill)
;; testcover: ok.
@@ -2919,8 +2919,8 @@ error if there is no working link at the given position."
;; the adornment is always completely visible.
(recenter 5)))
-;; Maintain an alias for compatibility.
-(defalias 'rst-toc-mode-goto-section 'rst-toc-mode-follow-link-kill)
+(define-obsolete-function-alias 'rst-toc-mode-goto-section
+ #'rst-toc-mode-follow-link-kill "29.1")
;; FIXME: Cursor before or behind the list must be handled properly; before the
;; list should jump to the top and behind the list to the last normal
@@ -2931,8 +2931,8 @@ error if there is no working link at the given position."
(interactive)
(rst-toc-follow-link (current-buffer) (point) t))
-;; Maintain an alias for compatibility.
-(defalias 'rst-toc-mode-mouse-goto 'rst-toc-mouse-follow-link)
+(define-obsolete-function-alias 'rst-toc-mode-mouse-goto
+ #'rst-toc-mouse-follow-link "29.1")
(defun rst-toc-mouse-follow-link (event kill)
;; testcover: uncovered.
@@ -2942,8 +2942,8 @@ EVENT is the input event. Kill TOC buffer if KILL."
(rst-toc-follow-link (window-buffer (posn-window (event-end event)))
(posn-point (event-end event)) kill))
-;; Maintain an alias for compatibility.
-(defalias 'rst-toc-mode-mouse-goto-kill 'rst-toc-mode-mouse-follow-link-kill)
+(define-obsolete-function-alias 'rst-toc-mode-mouse-goto-kill
+ #'rst-toc-mode-mouse-follow-link-kill "29.1")
(defun rst-toc-mode-mouse-follow-link-kill (event)
;; testcover: uncovered.
@@ -2952,8 +2952,8 @@ EVENT is the input event."
(interactive "e")
(rst-toc-mouse-follow-link event t))
-;; Maintain an alias for compatibility.
-(defalias 'rst-toc-quit-window 'rst-toc-mode-return)
+(define-obsolete-function-alias 'rst-toc-quit-window
+ #'rst-toc-mode-return "29.1")
(defun rst-toc-mode-return (kill)
;; testcover: ok.
@@ -3569,8 +3569,6 @@ Region is from BEG to END. With WITH-EMPTY prefix empty lines too."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Font lock
-;; FIXME: The obsolete variables need to disappear.
-
;; The following versions have been done inside Emacs and should not be
;; replaced by `:package-version' attributes until a change.
@@ -3584,125 +3582,46 @@ Region is from BEG to END. With WITH-EMPTY prefix empty lines too."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-block-face 'rst-block
- "All syntax marking up a special block."
- :version "24.1"
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-block-face
- "customize the face `rst-block' instead."
- "24.1")
-
(defface rst-external '((t :inherit font-lock-type-face))
"Face used for field names and interpreted text."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-external-face 'rst-external
- "Field names and interpreted text."
- :version "24.1"
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-external-face
- "customize the face `rst-external' instead."
- "24.1")
-
(defface rst-definition '((t :inherit font-lock-function-name-face))
"Face used for all other defining constructs."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-definition-face 'rst-definition
- "All other defining constructs."
- :version "24.1"
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-definition-face
- "customize the face `rst-definition' instead."
- "24.1")
-
(defface rst-directive '((t :inherit font-lock-builtin-face))
"Face used for directives and roles."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-directive-face 'rst-directive
- "Directives and roles."
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-directive-face
- "customize the face `rst-directive' instead."
- "24.1")
-
(defface rst-comment '((t :inherit font-lock-comment-face))
"Face used for comments."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-comment-face 'rst-comment
- "Comments."
- :version "24.1"
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-comment-face
- "customize the face `rst-comment' instead."
- "24.1")
-
(defface rst-emphasis1 '((t :inherit italic))
"Face used for simple emphasis."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-emphasis1-face 'rst-emphasis1
- "Simple emphasis."
- :version "24.1"
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-emphasis1-face
- "customize the face `rst-emphasis1' instead."
- "24.1")
-
(defface rst-emphasis2 '((t :inherit bold))
"Face used for double emphasis."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-emphasis2-face 'rst-emphasis2
- "Double emphasis."
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-emphasis2-face
- "customize the face `rst-emphasis2' instead."
- "24.1")
-
(defface rst-literal '((t :inherit font-lock-string-face))
"Face used for literal text."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-literal-face 'rst-literal
- "Literal text."
- :version "24.1"
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-literal-face
- "customize the face `rst-literal' instead."
- "24.1")
-
(defface rst-reference '((t :inherit font-lock-variable-name-face))
"Face used for references to a definition."
:version "24.1"
:group 'rst-faces)
-(defcustom rst-reference-face 'rst-reference
- "References to a definition."
- :version "24.1"
- :group 'rst-faces
- :type '(face))
-(make-obsolete-variable 'rst-reference-face
- "customize the face `rst-reference' instead."
- "24.1")
-
(defface rst-transition '((t :inherit font-lock-keyword-face))
"Face used for a transition."
:package-version '(rst . "1.3.0")
@@ -3786,7 +3705,7 @@ of your own."
(defvar rst-font-lock-keywords
;; The reST-links in the comments below all relate to sections in
- ;; http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html.
+ ;; https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html.
`(;; FIXME: Block markup is not recognized in blocks after explicit markup
;; start.
@@ -3794,23 +3713,23 @@ of your own."
;; `Bullet Lists`_
;; FIXME: A bullet directly after a field name is not recognized.
(,(rst-re 'lin-beg '(:grp bul-sta))
- 1 rst-block-face)
+ 1 'rst-block)
;; `Enumerated Lists`_
(,(rst-re 'lin-beg '(:grp enmany-sta))
- 1 rst-block-face)
+ 1 'rst-block)
;; `Definition Lists`_
;; FIXME: missing.
;; `Field Lists`_
(,(rst-re 'lin-beg '(:grp fld-tag) 'bli-sfx)
- 1 rst-external-face)
+ 1 'rst-external)
;; `Option Lists`_
(,(rst-re 'lin-beg '(:grp opt-tag (:shy optsep-tag opt-tag) "*")
'(:alt "$" (:seq hws-prt "\\{2\\}")))
- 1 rst-block-face)
+ 1 'rst-block)
;; `Line Blocks`_
;; Only for lines containing no more bar - to distinguish from tables.
(,(rst-re 'lin-beg '(:grp "|" bli-sfx) "[^|\n]*$")
- 1 rst-block-face)
+ 1 'rst-block)
;; `Tables`_
;; FIXME: missing
@@ -3818,22 +3737,22 @@ of your own."
;; All the `Explicit Markup Blocks`_
;; `Footnotes`_ / `Citations`_
(,(rst-re 'lin-beg 'fnc-sta-2)
- (1 rst-definition-face)
- (2 rst-definition-face))
+ (1 'rst-definition)
+ (2 'rst-definition))
;; `Directives`_ / `Substitution Definitions`_
(,(rst-re 'lin-beg 'dir-sta-3)
- (1 rst-directive-face)
- (2 rst-definition-face)
- (3 rst-directive-face))
+ (1 'rst-directive)
+ (2 'rst-definition)
+ (3 'rst-directive))
;; `Hyperlink Targets`_
(,(rst-re 'lin-beg
'(:grp exm-sta "_" (:alt
(:seq "`" ilcbkqdef-tag "`")
(:seq (:alt "[^:\\\n]" "\\\\.") "+")) ":")
'bli-sfx)
- 1 rst-definition-face)
+ 1 'rst-definition)
(,(rst-re 'lin-beg '(:grp "__") 'bli-sfx)
- 1 rst-definition-face)
+ 1 'rst-definition)
;; All `Inline Markup`_
;; Most of them may be multiline though this is uninteresting.
@@ -3841,16 +3760,16 @@ of your own."
;; FIXME: Condition 5 preventing fontification of e.g. "*" not implemented
;; `Strong Emphasis`_.
(,(rst-re 'ilm-pfx '(:grp "\\*\\*" ilcast-tag "\\*\\*") 'ilm-sfx)
- 1 rst-emphasis2-face)
+ 1 'rst-emphasis2)
;; `Emphasis`_
(,(rst-re 'ilm-pfx '(:grp "\\*" ilcast-tag "\\*") 'ilm-sfx)
- 1 rst-emphasis1-face)
+ 1 'rst-emphasis1)
;; `Inline Literals`_
(,(rst-re 'ilm-pfx '(:grp "``" ilcbkq-tag "``") 'ilm-sfx)
- 1 rst-literal-face)
+ 1 'rst-literal)
;; `Inline Internal Targets`_
(,(rst-re 'ilm-pfx '(:grp "_`" ilcbkq-tag "`") 'ilm-sfx)
- 1 rst-definition-face)
+ 1 'rst-definition)
;; `Hyperlink References`_
;; FIXME: `Embedded URIs and Aliases`_ not considered.
;; FIXME: Directly adjacent marked up words are not fontified correctly
@@ -3858,28 +3777,28 @@ of your own."
(,(rst-re 'ilm-pfx '(:grp (:alt (:seq "`" ilcbkq-tag "`")
(:seq "\\sw" (:alt "\\sw" "-") "+\\sw"))
"__?") 'ilm-sfx)
- 1 rst-reference-face)
+ 1 'rst-reference)
;; `Interpreted Text`_
(,(rst-re 'ilm-pfx '(:grp (:shy ":" sym-tag ":") "?")
'(:grp "`" ilcbkq-tag "`")
'(:grp (:shy ":" sym-tag ":") "?") 'ilm-sfx)
- (1 rst-directive-face)
- (2 rst-external-face)
- (3 rst-directive-face))
+ (1 'rst-directive)
+ (2 'rst-external)
+ (3 'rst-directive))
;; `Footnote References`_ / `Citation References`_
(,(rst-re 'ilm-pfx '(:grp fnc-tag "_") 'ilm-sfx)
- 1 rst-reference-face)
+ 1 'rst-reference)
;; `Substitution References`_
;; FIXME: References substitutions like |this|_ or |this|__ are not
;; fontified correctly.
(,(rst-re 'ilm-pfx '(:grp sub-tag) 'ilm-sfx)
- 1 rst-reference-face)
+ 1 'rst-reference)
;; `Standalone Hyperlinks`_
;; FIXME: This takes it easy by using a whitespace as delimiter.
(,(rst-re 'ilm-pfx '(:grp uri-tag ":\\S +") 'ilm-sfx)
- 1 rst-definition-face)
+ 1 'rst-definition)
(,(rst-re 'ilm-pfx '(:grp sym-tag "@" sym-tag ) 'ilm-sfx)
- 1 rst-definition-face)
+ 1 'rst-definition)
;; Do all block fontification as late as possible so 'append works.
@@ -3906,18 +3825,18 @@ of your own."
;; `Comments`_
;; This is multiline.
(,(rst-re 'lin-beg 'cmt-sta-1)
- (1 rst-comment-face)
+ (1 'rst-comment)
(rst-font-lock-find-unindented-line-match
(rst-font-lock-find-unindented-line-limit (match-end 1))
nil
- (0 rst-comment-face append)))
+ (0 'rst-comment append)))
(,(rst-re 'lin-beg '(:grp exm-tag) '(:grp hws-tag) "$")
- (1 rst-comment-face)
- (2 rst-comment-face)
+ (1'rst-comment)
+ (2'rst-comment)
(rst-font-lock-find-unindented-line-match
(rst-font-lock-find-unindented-line-limit 'next)
nil
- (0 rst-comment-face append)))
+ (0 'rst-comment append)))
;; FIXME: This is not rendered as comment::
;; .. .. list-table::
@@ -3941,11 +3860,11 @@ of your own."
;; `Indented Literal Blocks`_
;; This is multiline.
(,(rst-re 'lin-beg 'lit-sta-2)
- (2 rst-block-face)
+ (2 'rst-block)
(rst-font-lock-find-unindented-line-match
(rst-font-lock-find-unindented-line-limit t)
nil
- (0 rst-literal-face append)))
+ (0 'rst-literal append)))
;; FIXME: `Quoted Literal Blocks`_ missing.
;; This is multiline.
@@ -3972,8 +3891,8 @@ of your own."
;;
;; Indentation is not required for doctest blocks.
(,(rst-re 'lin-beg '(:grp (:alt ">>>" ell-tag)) '(:grp ".+"))
- (1 rst-block-face)
- (2 rst-literal-face)))
+ (1 'rst-block)
+ (2 'rst-literal)))
"Keywords to highlight in rst mode.")
(defvar font-lock-beg)
@@ -4402,7 +4321,7 @@ buffer, if the region is not selected."
;; FIXME: Add `rst-compile-html-preview'.
-;; FIXME: Add support for `restview` (http://mg.pov.lt/restview/). May be a
+;; FIXME: Add support for `restview` (https://mg.pov.lt/restview/). May be a
;; more general facility for calling commands on a reST file would make
;; sense.
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index ff881377a7e..8f9b603ef5f 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -480,8 +480,8 @@ The attribute alist is made up as
ATTRIBUTERULE is a list of optionally t (no value when no input) followed by
an optional alist of possible values."
:type '(repeat (cons (string :tag "Tag Name")
- (repeat :tag "Tag Rule" sexp))))
-(put 'sgml-tag-alist 'risky-local-variable t)
+ (repeat :tag "Tag Rule" sexp)))
+ :risky t)
(defcustom sgml-tag-help
'(("!" . "Empty declaration for comment")
@@ -600,12 +600,11 @@ Do \\[describe-key] on the following bindings to discover what they do.
(setq-local tildify-foreach-region-function
(apply-partially
'tildify-foreach-ignore-environments
- `((,(eval-when-compile
- (concat
- "<\\("
- (regexp-opt '("pre" "dfn" "code" "samp" "kbd" "var"
- "PRE" "DFN" "CODE" "SAMP" "KBD" "VAR"))
- "\\)\\>[^>]*>"))
+ `((,(concat
+ "<\\("
+ (regexp-opt '("pre" "dfn" "code" "samp" "kbd" "var"
+ "PRE" "DFN" "CODE" "SAMP" "KBD" "VAR"))
+ "\\)\\>[^>]*>")
. ("</" 1 ">"))
("<! *--" . "-- *>")
("<" . ">"))))
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 473643bb483..d34133f8564 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -248,9 +248,9 @@ Normally set to either `plain-tex-mode' or `latex-mode'."
(defcustom tex-fontify-script t
"If non-nil, fontify subscript and superscript strings."
:type 'boolean
+ :safe #'booleanp
:group 'tex
:version "23.1")
-(put 'tex-fontify-script 'safe-local-variable #'booleanp)
(defcustom tex-font-script-display '(-0.2 0.2)
"How much to lower and raise subscript and superscript content.
@@ -983,14 +983,13 @@ Inherits `shell-mode-map' with a few additions.")
(when (and slash (not comment))
(setq mode
(if (looking-at
- (eval-when-compile
- (concat
- (regexp-opt '("documentstyle" "documentclass"
- "begin" "subsection" "section"
- "part" "chapter" "newcommand"
- "renewcommand" "RequirePackage")
- 'words)
- "\\|NeedsTeXFormat{LaTeX")))
+ (concat
+ (regexp-opt '("documentstyle" "documentclass"
+ "begin" "subsection" "section"
+ "part" "chapter" "newcommand"
+ "renewcommand" "RequirePackage")
+ 'words)
+ "\\|NeedsTeXFormat{LaTeX"))
(if (and (looking-at
"document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}")
;; SliTeX is almost never used any more nowadays.
@@ -1242,11 +1241,10 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook
(apply-partially
#'tildify-foreach-ignore-environments
`(("\\\\\\\\" . "") ; do not remove this
- (,(eval-when-compile
- (concat "\\\\begin{\\("
- (regexp-opt '("verbatim" "math" "displaymath"
- "equation" "eqnarray" "eqnarray*"))
- "\\)}"))
+ (,(concat "\\\\begin{\\("
+ (regexp-opt '("verbatim" "math" "displaymath"
+ "equation" "eqnarray" "eqnarray*"))
+ "\\)}")
. ("\\\\end{" 1 "}"))
("\\\\verb\\*?\\(.\\)" . (1))
("\\$\\$?" . (0))
@@ -2126,11 +2124,10 @@ If NOT-ALL is non-nil, save the `.dvi' file."
(defvar tex-compile-history nil)
(defvar tex-input-files-re
- (eval-when-compile
- (concat "\\." (regexp-opt '("tex" "texi" "texinfo"
- "bbl" "ind" "sty" "cls") t)
- ;; Include files with no dots (for directories).
- "\\'\\|\\`[^.]+\\'")))
+ (concat "\\." (regexp-opt '("tex" "texi" "texinfo"
+ "bbl" "ind" "sty" "cls") t)
+ ;; Include files with no dots (for directories).
+ "\\'\\|\\`[^.]+\\'"))
(defcustom tex-use-reftex t
"If non-nil, use RefTeX's list of files to determine what command to use."
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 5d6f5deae1b..1ac59ddc5fb 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -401,7 +401,7 @@ REPORT-FN is the callback function."
source beg end type msg)
into diags
finally (funcall report-fn diags)))
- (flymake-log :warning "Cancelling obsolete check %s"
+ (flymake-log :warning "Canceling obsolete check %s"
proc))
(kill-buffer (process-buffer proc)))))))
(process-send-region texinfo--flymake-proc (point-min) (point-max))
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index 5b468dc808b..e44aa06e3dd 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -1367,7 +1367,7 @@ left at the end of the node line."
;; There may be an @chapter or other such command between
;; the top node line and the next node line, as a title
;; for an `ifinfo' section. This @chapter command must
- ;; must be skipped. So the procedure is to search for
+ ;; be skipped. So the procedure is to search for
;; the next `@node' line, and then copy its name.
(if (re-search-forward "^@node" nil t)
(progn
diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el
index 9dcfb10d6df..2a7ad295ab7 100644
--- a/lisp/textmodes/tildify.el
+++ b/lisp/textmodes/tildify.el
@@ -494,9 +494,8 @@ variable will be set to the representation."
(if (not (string-equal " " (or space tildify-space-string)))
(when space
(setq tildify-space-string space))
- (message (eval-when-compile
- (concat "Hard space is a single space character, tildify-"
- "mode won't have any effect, disabling.")))
+ (message (concat "Hard space is a single space character, tildify-"
+ "mode won't have any effect, disabling."))
(setq tildify-mode nil))))
(if tildify-mode
(add-hook 'post-self-insert-hook #'tildify-space nil t)
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index b3dca5890f1..a7c86fb24f0 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -391,6 +391,8 @@ If nil, construct the regexp from `thing-at-point-uri-schemes'.")
"telnet://" "tftp://" "tip://" "tn3270://" "udp://" "urn:"
"uuid:" "vemmi://" "webcal://" "xri://" "xmlrpc.beep://"
"xmlrpc.beeps://" "z39.50r://" "z39.50s://" "xmpp:"
+ ;; Unofficial
+ "gemini://"
;; Compatibility
"fax:" "man:" "mms://" "mmsh://" "modem:" "prospero:" "snews:"
"wais://")
diff --git a/lisp/thumbs.el b/lisp/thumbs.el
index 3bf08dd6a58..3b31f1d8090 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -73,16 +73,16 @@
(defcustom thumbs-per-line 4
"Number of thumbnails per line to show in directory."
- :type 'integer)
+ :type 'natnum)
(defcustom thumbs-max-image-number 16
- "Maximum number of images initially displayed in thumbs buffer."
- :type 'integer)
+ "Maximum number of images initially displayed in thumbs buffer."
+ :type 'natnum)
(defcustom thumbs-thumbsdir-max-size 50000000
"Maximum size for thumbnails directory.
-When it reaches that size (in bytes), a warning is sent."
- :type 'integer)
+When it reaches that size (in bytes), a warning is displayed."
+ :type 'natnum)
;; Unfortunately Windows XP has a program called CONVERT.EXE in
;; C:/WINDOWS/SYSTEM32/ for partitioning NTFS systems. So Emacs
@@ -106,12 +106,12 @@ This must be the ImageMagick \"convert\" utility."
(defcustom thumbs-relief 5
"Size of button-like border around thumbnails."
- :type 'integer)
+ :type 'natnum)
(defcustom thumbs-margin 2
"Size of the margin around thumbnails.
This is where you see the cursor."
- :type 'integer)
+ :type 'natnum)
(defcustom thumbs-thumbsdir-auto-clean t
"If set, delete older file in the thumbnails directory.
@@ -121,7 +121,7 @@ than `thumbs-thumbsdir-max-size'."
(defcustom thumbs-image-resizing-step 10
"Step by which to resize image as a percentage."
- :type 'integer)
+ :type 'natnum)
(defcustom thumbs-temp-dir temporary-file-directory
"Temporary directory to use.
@@ -215,16 +215,17 @@ FILEIN is the input file,
FILEOUT is the output file,
ACTION is the command to send to convert.
Optional arguments are:
-ARG any arguments to the ACTION command,
+ARG if non-nil, the argument of the ACTION command,
OUTPUT-FORMAT is the file format to output (default is jpeg),
ACTION-PREFIX is the symbol to place before the ACTION command
(defaults to `-' but can sometimes be `+')."
- (call-process thumbs-conversion-program nil nil nil
- (or action-prefix "-")
- action
- (or arg "")
- filein
- (format "%s:%s" (or output-format "jpeg") fileout)))
+ (let ((action-param (concat (or action-prefix "-") action))
+ (fileout-param (format "%s:%s" (or output-format "jpeg") fileout)))
+ (if arg
+ (call-process thumbs-conversion-program nil nil nil
+ action-param arg filein fileout-param)
+ (call-process thumbs-conversion-program nil nil nil
+ action-param filein fileout-param))))
(defun thumbs-new-image-size (s increment)
"New image (a cons of width x height)."
@@ -610,7 +611,7 @@ ACTION and ARG should be a valid convert command."
(thumbs-call-convert (or old thumbs-current-image-filename)
tmp
action
- (or arg ""))
+ arg)
(save-excursion
(thumbs-insert-image tmp 'jpeg 0))
(setq thumbs-current-tmp-filename tmp)))
@@ -703,27 +704,25 @@ ACTION and ARG should be a valid convert command."
;; thumbs-mode
-(defvar thumbs-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [return] 'thumbs-find-image-at-point)
- (define-key map [mouse-2] 'thumbs-mouse-find-image)
- (define-key map [(meta return)] 'thumbs-find-image-at-point-other-window)
- (define-key map [(control return)] 'thumbs-set-image-at-point-to-root-window)
- (define-key map [delete] 'thumbs-delete-images)
- (define-key map [right] 'thumbs-forward-char)
- (define-key map [left] 'thumbs-backward-char)
- (define-key map [up] 'thumbs-backward-line)
- (define-key map [down] 'thumbs-forward-line)
- (define-key map "+" 'thumbs-show-more-images)
- (define-key map "d" 'thumbs-dired)
- (define-key map "m" 'thumbs-mark)
- (define-key map "u" 'thumbs-unmark)
- (define-key map "R" 'thumbs-rename-images)
- (define-key map "x" 'thumbs-delete-images)
- (define-key map "s" 'thumbs-show-name)
- (define-key map "q" 'thumbs-kill-buffer)
- map)
- "Keymap for `thumbs-mode'.")
+(defvar-keymap thumbs-mode-map
+ :doc "Keymap for `thumbs-mode'."
+ "<return>" #'thumbs-find-image-at-point
+ "<mouse-2>" #'thumbs-mouse-find-image
+ "M-<return>" #'thumbs-find-image-at-point-other-window
+ "C-<return>" #'thumbs-set-image-at-point-to-root-window
+ "<delete>" #'thumbs-delete-images
+ "<right>" #'thumbs-forward-char
+ "<left>" #'thumbs-backward-char
+ "<up>" #'thumbs-backward-line
+ "<down>" #'thumbs-forward-line
+ "+" #'thumbs-show-more-images
+ "d" #'thumbs-dired
+ "m" #'thumbs-mark
+ "u" #'thumbs-unmark
+ "R" #'thumbs-rename-images
+ "x" #'thumbs-delete-images
+ "s" #'thumbs-show-name
+ "q" #'thumbs-kill-buffer)
(put 'thumbs-mode 'mode-class 'special)
(define-derived-mode thumbs-mode
@@ -731,22 +730,20 @@ ACTION and ARG should be a valid convert command."
"Preview images in a thumbnails buffer."
(setq buffer-read-only t))
-(defvar thumbs-view-image-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [prior] 'thumbs-previous-image)
- (define-key map [next] 'thumbs-next-image)
- (define-key map "^" 'thumbs-display-thumbs-buffer)
- (define-key map "-" 'thumbs-shrink-image)
- (define-key map "+" 'thumbs-enlarge-image)
- (define-key map "<" 'thumbs-rotate-left)
- (define-key map ">" 'thumbs-rotate-right)
- (define-key map "e" 'thumbs-emboss-image)
- (define-key map "r" 'thumbs-resize-image)
- (define-key map "s" 'thumbs-save-current-image)
- (define-key map "q" 'thumbs-kill-buffer)
- (define-key map "w" 'thumbs-set-root)
- map)
- "Keymap for `thumbs-view-image-mode'.")
+(defvar-keymap thumbs-view-image-mode-map
+ :doc "Keymap for `thumbs-view-image-mode'."
+ "<prior>" #'thumbs-previous-image
+ "<next>" #'thumbs-next-image
+ "^" #'thumbs-display-thumbs-buffer
+ "-" #'thumbs-shrink-image
+ "+" #'thumbs-enlarge-image
+ "<" #'thumbs-rotate-left
+ ">" #'thumbs-rotate-right
+ "e" #'thumbs-emboss-image
+ "r" #'thumbs-resize-image
+ "s" #'thumbs-save-current-image
+ "q" #'thumbs-kill-buffer
+ "w" #'thumbs-set-root)
;; thumbs-view-image-mode
(put 'thumbs-view-image-mode 'mode-class 'special)
diff --git a/lisp/time.el b/lisp/time.el
index cd985bfb288..e7066cae7a5 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -93,7 +93,7 @@ Non-nil means \\[display-time] should display day and date as well as time."
(defcustom display-time-interval 60
"Seconds between updates of time in the mode line."
- :type 'integer)
+ :type 'natnum)
(defcustom display-time-24hr-format nil
"Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23.
@@ -519,7 +519,7 @@ If the value is t instead of an alist, use the value of
(defcustom world-clock-timer-second 60
"Interval in seconds for updating the `world-clock' buffer."
- :type 'integer
+ :type 'natnum
:version "28.1")
(defface world-clock-label
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 3e9c16a445a..95cb1cc62c0 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -140,15 +140,6 @@ When using the GTK toolkit, this face will only be used if
:group 'tooltip
:group 'basic-faces)
-(defcustom tooltip-use-echo-area nil
- "Use the echo area instead of tooltip frames for help and GUD tooltips.
-This variable is obsolete; instead of setting it to t, disable
-`tooltip-mode' (which has a similar effect)."
- :type 'boolean)
-
-(make-obsolete-variable 'tooltip-use-echo-area
- "disable Tooltip mode instead" "24.1" 'set)
-
(defcustom tooltip-resize-echo-area nil
"If non-nil, using the echo area for tooltips will resize the echo area.
By default, when the echo area is used for displaying tooltips,
@@ -427,7 +418,7 @@ This is installed on the hook `tooltip-functions', which
is run when the timer with id `tooltip-timeout-id' fires.
Value is non-nil if this function handled the tip."
(when (stringp tooltip-help-message)
- (tooltip-show tooltip-help-message tooltip-use-echo-area)
+ (tooltip-show tooltip-help-message (not tooltip-mode))
t))
(provide 'tooltip)
diff --git a/lisp/transient.el b/lisp/transient.el
index 06e41061925..41b69b1abac 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -246,7 +246,7 @@ for infix argument are highlighted when only a long argument
In the rare case that a short-hand is specified but does not
match the key binding, then it is highlighed differently.
-The highlighting is done using using `transient-mismatched-key'
+The highlighting is done using `transient-mismatched-key'
and `transient-nonstandard-key'."
:package-version '(transient . "0.1.0")
:group 'transient
diff --git a/lisp/type-break.el b/lisp/type-break.el
index 267facccc47..dca5a43b893 100644
--- a/lisp/type-break.el
+++ b/lisp/type-break.el
@@ -69,7 +69,7 @@
(defcustom type-break-interval (* 60 60)
"Number of seconds between scheduled typing breaks."
- :type 'integer
+ :type 'natnum
:group 'type-break)
(defcustom type-break-good-rest-interval (/ type-break-interval 6)
@@ -82,7 +82,7 @@ rest from typing, then the next typing break is simply rescheduled for later.
If a break is interrupted before this much time elapses, the user will be
asked whether or not really to interrupt the break."
:set-after '(type-break-interval)
- :type 'integer
+ :type 'natnum
:group 'type-break)
(defcustom type-break-good-break-interval nil
@@ -148,7 +148,7 @@ To avoid being queried at all, set `type-break-query-mode' to nil."
"Number of seconds between queries to take a break, if put off.
The user will continue to be prompted at this interval until he or she
finally submits to taking a typing break."
- :type 'integer
+ :type 'natnum
:group 'type-break)
(defcustom type-break-time-warning-intervals '(300 120 60 30)
@@ -171,7 +171,7 @@ will occur."
"Number of keystrokes for which warnings should be repeated.
That is, for each of this many keystrokes the warning is redisplayed
in the echo area to make sure it's really seen."
- :type 'integer
+ :type 'natnum
:group 'type-break)
(defcustom type-break-time-stamp-format "[%H:%M] "
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index 3e69227124f..db8c121cf00 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -37,7 +37,7 @@
"Default maximum time in seconds before cache files expire.
Used by the function `url-cache-expired'."
:version "24.1"
- :type 'integer
+ :type 'natnum
:group 'url-cache)
;; Cache manager
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index 15c78512c64..0709cdd3fa1 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -360,7 +360,7 @@ to run the `url-cookie-setup-save-timer' function manually."
(set-default var val)
(if (bound-and-true-p url-setup-done)
(url-cookie-setup-save-timer)))
- :type 'integer
+ :type 'natnum
:group 'url-cookie)
(defun url-cookie-setup-save-timer ()
diff --git a/lisp/url/url-history.el b/lisp/url/url-history.el
index cb4814afcad..058e601301b 100644
--- a/lisp/url/url-history.el
+++ b/lisp/url/url-history.el
@@ -63,7 +63,7 @@ to run the `url-history-setup-save-timer' function manually."
(set-default var val)
(if (bound-and-true-p url-setup-done)
(url-history-setup-save-timer)))
- :type 'integer
+ :type 'natnum
:group 'url-history)
(defvar url-history-timer nil)
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 4e5d017036c..3d7d8779795 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -709,7 +709,7 @@ should be shown to the user."
;; gives the URI of the proxy. The recipient is expected
;; to repeat this single request via the proxy. 305
;; responses MUST only be generated by origin servers.
- (error "Redirection thru a proxy server not supported: %s"
+ (error "Redirection through a proxy server not supported: %s"
redirect-uri))
(_
;; Treat everything like '300'
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index b2e24607e11..cf45a7f681a 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -36,13 +36,13 @@
(defcustom url-queue-parallel-processes 6
"The number of concurrent processes."
:version "24.1"
- :type 'integer
+ :type 'natnum
:group 'url)
(defcustom url-queue-timeout 5
"How long to let a job live once it's started (in seconds)."
:version "24.1"
- :type 'integer
+ :type 'natnum
:group 'url)
;;; Internal variables.
diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el
index 1012525568b..de42599e0d4 100644
--- a/lisp/url/url-vars.el
+++ b/lisp/url/url-vars.el
@@ -297,7 +297,7 @@ get the first available language (as opposed to the default)."
(defcustom url-max-password-attempts 5
"Maximum number of times a password will be prompted for.
Applies when a protected document is denied by the server."
- :type 'integer
+ :type 'natnum
:group 'url)
(defcustom url-show-status t
@@ -330,7 +330,7 @@ undefined."
(defcustom url-max-redirections 30
"The maximum number of redirection requests to honor in a HTTP connection.
A negative number means to honor an unlimited number of redirection requests."
- :type 'integer
+ :type 'natnum
:group 'url)
(defcustom url-confirmation-func 'y-or-n-p
diff --git a/lisp/url/url.el b/lisp/url/url.el
index 4592f0f2e72..d08ff04eda9 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -158,7 +158,7 @@ If URL is a multibyte string, it will be encoded as utf-8 and
URL-encoded before it's used."
;; XXX: There is code in Emacs that does dynamic binding
;; of the following variables around url-retrieve:
- ;; url-standalone-mode, url-gateway-unplugged, w3-honor-stylesheets,
+ ;; url-standalone-mode, url-gateway-unplugged,
;; url-confirmation-func, url-cookie-multiple-line,
;; url-cookie-{{,secure-}storage,confirmation}
;; url-standalone-mode and url-gateway-unplugged should work as
diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el
index beaad2e835f..e02d84f1f56 100644
--- a/lisp/vc/add-log.el
+++ b/lisp/vc/add-log.el
@@ -789,10 +789,9 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'."
If a ChangeLog file does not already exist, a non-nil value
means to put log entries in a suitably named buffer."
:type 'boolean
+ :safe #'booleanp
:version "27.1")
-(put 'add-log-dont-create-changelog-file 'safe-local-variable #'booleanp)
-
(defun add-log--pseudo-changelog-buffer-name (changelog-file-name)
"Compute a suitable name for a non-file visiting ChangeLog buffer.
CHANGELOG-FILE-NAME is the file name of the actual ChangeLog file
diff --git a/lisp/vc/compare-w.el b/lisp/vc/compare-w.el
index b56b4c0d83a..64d5d1081a3 100644
--- a/lisp/vc/compare-w.el
+++ b/lisp/vc/compare-w.el
@@ -1,7 +1,6 @@
;;; compare-w.el --- compare text between windows for Emacs -*- lexical-binding: t; -*-
-;; Copyright (C) 1986, 1989, 1993, 1997, 2001-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1986-2022 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: convenience files vc
@@ -99,7 +98,7 @@ may fail by finding the wrong match. The bigger number makes
difference regions more coarse-grained.
The default value 32 is good for the most cases."
- :type 'integer
+ :type 'natnum
:version "22.1")
(defcustom compare-windows-recenter nil
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 3f3e503a3f3..30ba4153a9e 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2074,7 +2074,7 @@ For use in `add-log-current-defun-function'."
(re-search-forward "^[^ ]" nil t))
(pcase-let ((`(,buf ,_line-offset ,pos ,src ,dst ,switched)
(ignore-errors ;Signals errors in place of prompting.
- ;; Use `noprompt' since this is used in which-func-mode
+ ;; Use `noprompt' since this is used in which-function-mode
;; and such.
(diff-find-source-location nil nil 'noprompt))))
(when buf
diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el
index b2fdb07d5fb..422ed5c0a4d 100644
--- a/lisp/vc/emerge.el
+++ b/lisp/vc/emerge.el
@@ -221,7 +221,7 @@ depend on the flags."
(defcustom emerge-min-visible-lines 3
"Number of lines to show above and below the flags when displaying a difference."
- :type 'integer)
+ :type 'natnum)
(defcustom emerge-temp-file-prefix
(expand-file-name "emerge" temporary-file-directory)
@@ -1647,7 +1647,7 @@ the height of the merge window.
(defun emerge-scroll-left (&optional arg)
"Scroll left all three merge buffers, if they are in windows.
If an argument is given, that is how many columns are scrolled, else nearly
-the width of the A and B windows. `C-u -' alone as argument scrolls half the
+the width of the A and B windows. \\`C-u -' alone as argument scrolls half the
width of the A and B windows."
(interactive "P")
(emerge-operate-on-windows
@@ -1675,7 +1675,7 @@ width of the A and B windows."
(defun emerge-scroll-right (&optional arg)
"Scroll right all three merge buffers, if they are in windows.
If an argument is given, that is how many columns are scrolled, else nearly
-the width of the A and B windows. `C-u -' alone as argument scrolls half the
+the width of the A and B windows. \\`C-u -' alone as argument scrolls half the
width of the A and B windows."
(interactive "P")
(emerge-operate-on-windows
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index 4a511f1f688..1f19c4cfe26 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -451,7 +451,8 @@ should be applied to the background or to the foreground."
(setq-local vc-annotate-backend backend)
(setq-local vc-annotate-parent-file file)
(setq-local vc-annotate-parent-rev rev)
- (setq-local vc-annotate-parent-display-mode display-mode))))
+ (setq-local vc-annotate-parent-display-mode display-mode)
+ (kill-local-variable 'revert-buffer-function))))
(with-current-buffer temp-buffer-name
(vc-run-delayed
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index ee394a93af4..072bd72b441 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -64,9 +64,13 @@
:version "22.2"
:group 'vc)
-(defcustom vc-bzr-program "bzr"
+(defcustom vc-bzr-program
+ (or (executable-find "bzr")
+ (executable-find "brz")
+ "bzr")
"Name of the bzr command (excluding any arguments)."
- :type 'string)
+ :type 'string
+ :version "29.1")
(defcustom vc-bzr-diff-switches nil
"String or list of strings specifying switches for bzr diff under VC.
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index cc08767ade3..80508570f32 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -141,9 +141,9 @@ confirmation whether it should follow the link. If nil, the link is
visited and a warning displayed."
:type '(choice (const :tag "Ask for confirmation" ask)
(const :tag "Visit link and warn" nil)
- (const :tag "Follow link" t))
+ (const :tag "Follow link" t))
+ :safe #'null
:group 'vc)
-(put 'vc-follow-symlinks 'safe-local-variable #'null)
(defcustom vc-display-status t
"If non-nil, display revision number and lock status in mode line.
@@ -556,15 +556,6 @@ this function."
templates))))
-;; toggle-read-only is obsolete since 24.3, but since vc-t-r-o was made
-;; obsolete earlier, it is ok for the latter to be an alias to the former,
-;; since the latter will be removed first. We can't just make it
-;; an alias for read-only-mode, since that is not 100% the same.
-(defalias 'vc-toggle-read-only 'toggle-read-only)
-(make-obsolete 'vc-toggle-read-only
- "use `read-only-mode' instead (or `toggle-read-only' in older versions of Emacs)."
- "24.1")
-
(defun vc-default-make-version-backups-p (_backend _file)
"Return non-nil if unmodified versions should be backed up locally.
The default is to switch off this feature."
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index d6f0f4a4977..d3e53858c16 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -824,7 +824,7 @@ for the backend you use."
"Limit the number of items shown by the VC log commands.
Zero means unlimited.
Not all VC backends are able to support this feature."
- :type 'integer)
+ :type 'natnum)
(defcustom vc-allow-async-revert nil
"Specifies whether the diff during \\[vc-revert] may be asynchronous.
diff --git a/lisp/view.el b/lisp/view.el
index 3343136c1cc..287112f2d44 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -1,7 +1,6 @@
;;; view.el --- peruse file or buffer without editing -*- lexical-binding: t -*-
-;; Copyright (C) 1985, 1989, 1994-1995, 1997, 2000-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-2022 Free Software Foundation, Inc.
;; Author: K. Shane Hartman
;; Maintainer: emacs-devel@gnu.org
@@ -26,9 +25,11 @@
;; This package provides the `view' minor mode documented in the Emacs
;; user's manual.
+;;
;; View mode entry and exit is done through the functions `view-mode-enter'
;; and `view-mode-exit'. Use these functions to enter or exit `view-mode' from
;; Emacs Lisp programs.
+;;
;; We use both view- and View- as prefix for symbols. View- is used as
;; prefix for commands that have a key binding. view- is used for commands
;; without key binding. The purpose of this is to make it easier for a
@@ -101,8 +102,6 @@ functions that enable or disable view mode.")
(defvar-local view-old-buffer-read-only nil)
-(defvar-local view-old-Helper-return-blurb nil)
-
(defvar-local view-page-size nil
"Default number of lines to scroll by View page commands.
If nil that means use the window size.")
@@ -113,18 +112,6 @@ If nil that means use half the window size.")
(defvar-local view-last-regexp nil) ; Global is better???
-(defvar-local view-return-to-alist nil
- "What to do with used windows and where to go when finished viewing buffer.
-This is local in each buffer being viewed.
-It is added to by `view-mode-enter' when starting to view a buffer and
-subtracted from by `view-mode-exit' when finished viewing the buffer.
-
-See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of
-`view-return-to-alist'.")
-(make-obsolete-variable
- 'view-return-to-alist "this variable is no longer used." "24.1")
-(put 'view-return-to-alist 'permanent-local t)
-
(defvar-local view-exit-action nil
"If non-nil, a function called when finished viewing.
The function should take one argument (a buffer).
@@ -454,15 +441,7 @@ Entry to view-mode runs the normal hook `view-mode-hook'."
(setq view-page-size nil
view-half-page-size nil
view-old-buffer-read-only buffer-read-only
- buffer-read-only t)
- (if (boundp 'Helper-return-blurb)
- (setq view-old-Helper-return-blurb (and (boundp 'Helper-return-blurb)
- Helper-return-blurb)
- Helper-return-blurb
- (format "continue viewing %s"
- (if (buffer-file-name)
- (file-name-nondirectory (buffer-file-name))
- (buffer-name))))))
+ buffer-read-only t))
(define-obsolete-function-alias 'view-mode-enable 'view-mode "24.4")
@@ -482,46 +461,10 @@ Entry to view-mode runs the normal hook `view-mode-hook'."
;; so that View mode stays off if read-only-mode is called.
(if (local-variable-p 'view-read-only)
(kill-local-variable 'view-read-only))
- (if (boundp 'Helper-return-blurb)
- (setq Helper-return-blurb view-old-Helper-return-blurb))
(if buffer-read-only
(setq buffer-read-only view-old-buffer-read-only)))
;;;###autoload
-(defun view-return-to-alist-update (buffer &optional item)
- "Update `view-return-to-alist' of buffer BUFFER.
-Remove from `view-return-to-alist' all entries referencing dead
-windows. Optional argument ITEM non-nil means add ITEM to
-`view-return-to-alist' after purging. For a description of items
-that can be added see the RETURN-TO-ALIST argument of the
-function `view-mode-exit'. If `view-return-to-alist' contains an
-entry for the selected window, purge that entry from
-`view-return-to-alist' before adding ITEM."
- (declare (obsolete "this function has no effect." "24.1"))
- (with-current-buffer buffer
- (when view-return-to-alist
- (let* ((list view-return-to-alist)
- entry entry-window last)
- (while list
- (setq entry (car list))
- (setq entry-window (car entry))
- (if (and (windowp entry-window)
- (or (and item (eq entry-window (selected-window)))
- (not (window-live-p entry-window))))
- ;; Remove that entry.
- (if last
- (setcdr last (cdr list))
- (setq view-return-to-alist
- (cdr view-return-to-alist)))
- ;; Leave entry alone.
- (setq last entry))
- (setq list (cdr list)))))
- ;; Add ITEM.
- (when item
- (setq view-return-to-alist
- (cons item view-return-to-alist)))))
-
-;;;###autoload
(defun view-mode-enter (&optional quit-restore exit-action)
"Enter View mode and set up exit from view mode depending on optional arguments.
Optional argument QUIT-RESTORE if non-nil must specify a valid
@@ -988,6 +931,9 @@ If TIMES is negative, search backwards."
(and (zerop times)
(looking-at ".*")))
+(defvar-local view-old-Helper-return-blurb nil)
+(make-obsolete 'view-old-Helper-return-blurb nil "29.1")
+
(provide 'view)
;;; view.el ends here
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 98f21ce9a5f..240f99effc2 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -1697,7 +1697,7 @@ cleaning up these problems."
(rstart (min start end))
(rend (max start end))
;; Fall back to whitespace-style so we can run before
- ;; before the mode is active.
+ ;; the mode is active.
(style (copy-sequence
(or whitespace-active-style whitespace-style)))
(bogus-list
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 29b6e13bc60..53626182470 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -880,6 +880,7 @@ The child is converted, using the keyword arguments ARGS."
"Make a deep copy of WIDGET."
(widget-apply (copy-sequence widget) :copy))
+;;;###autoload
(defun widget-convert (type &rest args)
"Convert TYPE to a widget without inserting it in the buffer.
The optional ARGS are additional keyword arguments."
diff --git a/lisp/widget.el b/lisp/widget.el
index 300a95bd229..e6a856b2927 100644
--- a/lisp/widget.el
+++ b/lisp/widget.el
@@ -91,7 +91,6 @@ The third argument DOC is a documentation string for the widget."
(put name 'widget-documentation (purecopy doc))
name)
-;; This is used by external widget code (in W3, at least).
(define-obsolete-function-alias 'widget-plist-member #'plist-member "26.1")
(provide 'widget)
diff --git a/lisp/windmove.el b/lisp/windmove.el
index c8ea4fd1e54..369c32c8919 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -644,7 +644,7 @@ Default value of MODIFIERS is `shift-meta'."
(defun windmove-delete-in-direction (dir &optional arg)
"Delete the window at direction DIR.
If prefix ARG is `\\[universal-argument]', also kill the buffer in that window.
-With `M-0' prefix, delete the selected window and
+With \\`M-0' prefix, delete the selected window and
select the window at direction DIR.
When `windmove-wrap-around' is non-nil, takes the window
from the opposite side of the frame."
@@ -788,7 +788,7 @@ Default value of MODIFIERS is `shift-super'."
(const :tag "Hyper" hyper)
(const :tag "Super" super)
(const :tag "Alt" alt))))
- "Customisation type for windmove modifiers.")
+ "Customization type for windmove modifiers.")
(defcustom windmove-default-keybindings nil
"Default keybindings for regular windmove commands.
diff --git a/lisp/window.el b/lisp/window.el
index eba888a89dd..4d88ffa9039 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -451,7 +451,7 @@ window to a height less than the one specified here, an
application should instead call `window-resize' with a non-nil
IGNORE argument. In order to have `split-window' make a window
shorter, explicitly specify the SIZE argument of that function."
- :type 'integer
+ :type 'natnum
:version "24.1"
:group 'windows)
@@ -483,7 +483,7 @@ window to a width less than the one specified here, an
application should instead call `window-resize' with a non-nil
IGNORE argument. In order to have `split-window' make a window
narrower, explicitly specify the SIZE argument of that function."
- :type 'integer
+ :type 'natnum
:version "24.1"
:group 'windows)
@@ -9179,10 +9179,11 @@ present. See also `fit-frame-to-buffer-sizes'."
(defcustom fit-frame-to-buffer-sizes '(nil nil nil nil)
"Size boundaries of frame for `fit-frame-to-buffer'.
-This list specifies the total maximum and minimum lines and
-maximum and minimum columns of the root window of any frame that
-shall be fit to its buffer. If any of these values is non-nil,
-it overrides the corresponding argument of `fit-frame-to-buffer'.
+This list specifies the total maximum and minimum numbers of
+lines and the maximum and minimum numbers of columns of the body
+of the root window of any frame that shall be fit to its buffer.
+Any value specified by ths variable will be overridden by the
+corresponding argument of `fit-frame-to-buffer', if non-nil.
On window systems where the menubar can wrap, fitting a frame to
its buffer may swallow the last line(s). Specifying an
@@ -9378,30 +9379,30 @@ for `fit-frame-to-buffer'."
(t parent-or-display-height))
;; The following is the maximum height that fits into the
;; top and bottom margins.
- (max (- bottom-margin top-margin outer-minus-body-height))))
+ (max (- bottom-margin top-margin outer-minus-body-height) 0)))
(min-height
(cond
((numberp min-height) (* min-height line-height))
((numberp (nth 1 sizes)) (* (nth 1 sizes) line-height))
- (t (window-min-size window nil nil t))))
+ (t (window-safe-min-size window nil t))))
(max-width
- (min
- (cond
- ((numberp max-width) (* max-width char-width))
- ((numberp (nth 2 sizes)) (* (nth 2 sizes) char-width))
- (t parent-or-display-width))
- ;; The following is the maximum width that fits into the
- ;; left and right margins.
- (max (- right-margin left-margin outer-minus-body-width))))
+ (unless (eq only 'vertically)
+ (min
+ (cond
+ ((numberp max-width) (* max-width char-width))
+ ((numberp (nth 2 sizes)) (* (nth 2 sizes) char-width))
+ (t parent-or-display-width))
+ ;; The following is the maximum width that fits into the
+ ;; left and right margins.
+ (max (- right-margin left-margin outer-minus-body-width) 0))))
(min-width
(cond
((numberp min-width) (* min-width char-width))
- ((numberp (nth 3 sizes)) (nth 3 sizes))
- (t (window-min-size window t nil t))))
+ ((numberp (nth 3 sizes)) (* (nth 3 sizes) char-width))
+ (t (window-safe-min-size window t t))))
;; Note: Currently, for a new frame the sizes of the header
;; and mode line may be estimated incorrectly
- (size
- (window-text-pixel-size window from to max-width max-height))
+ (size (window-text-pixel-size window from to max-width max-height))
(width (max (car size) min-width))
(height (max (cdr size) min-height)))
;; Don't change height or width when the window's size is fixed
diff --git a/lisp/winner.el b/lisp/winner.el
index e671b83880a..38ab5f51016 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -50,7 +50,7 @@
(defcustom winner-ring-size 200
"Maximum number of stored window configurations per frame."
- :type 'integer)
+ :type 'natnum)
(defcustom winner-boring-buffers '("*Completions*")
"List of buffer names whose windows `winner-undo' will not restore.
@@ -343,8 +343,8 @@ Winner mode is a global minor mode that records the changes in
the window configuration (i.e. how the frames are partitioned
into windows) so that the changes can be \"undone\" using the
command `winner-undo'. By default this one is bound to the key
-sequence `C-c <left>'. If you change your mind (while undoing),
-you can press `C-c <right>' (calling `winner-redo')."
+sequence \\`C-c <left>'. If you change your mind (while undoing),
+you can press \\`C-c <right>' (calling `winner-redo')."
:global t
(if winner-mode
(progn
diff --git a/lisp/woman.el b/lisp/woman.el
index fd5fee2005a..c74faa8af48 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -841,10 +841,12 @@ Only useful when run on a graphic display such as X or MS-Windows."
:tag "WoMan Formatting"
:group 'woman)
-(defcustom woman-fill-column 65
- "Right margin for formatted text -- default is 65."
- :type 'integer
- :group 'woman-formatting)
+;; This could probably be 80 to match 'Man-width'.
+(defcustom woman-fill-column 70
+ "Right margin for formatted text -- default is 70."
+ :type 'natnum
+ :group 'woman-formatting
+ :version "29.1")
(defcustom woman-fill-frame nil
;; Based loosely on a suggestion by Theodore Jump:
@@ -1151,7 +1153,7 @@ updated (e.g. to re-interpret the current directory).
Used non-interactively, arguments are optional: if given then TOPIC
should be a topic string and non-nil RE-CACHE forces re-caching."
(interactive (list nil current-prefix-arg))
- ;; The following test is for non-interactive calls via gnudoit etc.
+ ;; The following test is for non-interactive calls via emacsclient, etc.
(if (or (not (stringp topic)) (string-match-p "\\S " topic))
(let ((file-name (woman-file-name topic re-cache)))
(if file-name
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index c3d56f327dd..92899e7a0c6 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -84,7 +84,8 @@ if drop is successful, nil if not."
(defcustom x-dnd-known-types
(mapcar 'purecopy
- '("text/uri-list"
+ '("XdndDirectSave0"
+ "text/uri-list"
"text/x-moz-url"
"_NETSCAPE_URL"
"FILE_NAME"
@@ -120,8 +121,45 @@ like xterm) for text."
(const :tag "Use the OffiX protocol for both files and text" t))
:group 'x)
+(defcustom x-dnd-direct-save-function #'x-dnd-save-direct
+ "Function called when a file is dropped that Emacs must save.
+It is called with two arguments: the first is either nil or t,
+and the second is a string.
+
+If the first argument is t, the second argument is the name the
+dropped file should be saved under. The function should return a
+complete file name describing where the file should be saved.
+
+It can also return nil, which means to cancel the drop.
+
+If the first argument is nil, the second is the name of the file
+that was dropped."
+ :version "29.1"
+ :type '(choice (const :tag "Prompt for name before saving"
+ x-dnd-save-direct)
+ (const :tag "Save and open immediately without prompting"
+ x-dnd-save-direct-immediately)
+ (function :tag "Other function"))
+ :group 'x)
+
+(defcustom x-dnd-copy-types '("chromium/x-renderer-taint")
+ "List of data types offered by programs that don't support `private'.
+Some programs (such as Chromium) do not support
+`XdndActionPrivate'. The default `x-dnd-test-function' will
+always return `copy' instead, for programs offering one of the
+data types in this list."
+ :version "29.1"
+ :type '(repeat string)
+ :group 'x)
+
;; Internal variables
+(defvar x-dnd-debug-errors nil
+ "Whether or not to signal protocol errors during drag-and-drop.
+This is useful for debugging errors in the DND code, but makes
+drag-and-drop much slower over network connections with high
+latency.")
+
(defvar x-dnd-current-state nil
"The current state for a drop.
This is an alist with one entry for each display. The value for each display
@@ -144,25 +182,29 @@ any protocol specific data.")
("XdndActionCopy" . copy)
("XdndActionMove" . move)
("XdndActionLink" . link)
- ("XdndActionAsk" . ask))
+ ("XdndActionAsk" . ask)
+ ("XdndActionDirectSave" . direct-save))
"Mapping from XDND action types to Lisp symbols.")
(defvar x-dnd-empty-state [nil nil nil nil nil nil nil])
(declare-function x-register-dnd-atom "xselect.c")
+(defvar x-fast-protocol-requests)
+
(defun x-dnd-init-frame (&optional frame)
"Setup drag and drop for FRAME (i.e. create appropriate properties)."
(when (eq 'x (window-system frame))
- (x-register-dnd-atom "DndProtocol" frame)
- (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame)
- (x-register-dnd-atom "XdndEnter" frame)
- (x-register-dnd-atom "XdndPosition" frame)
- (x-register-dnd-atom "XdndLeave" frame)
- (x-register-dnd-atom "XdndDrop" frame)
- (x-register-dnd-atom "_DND_PROTOCOL" frame)
- (x-dnd-init-xdnd-for-frame frame)
- (x-dnd-init-motif-for-frame frame)))
+ (let ((x-fast-protocol-requests (not x-dnd-debug-errors)))
+ (x-register-dnd-atom "DndProtocol" frame)
+ (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame)
+ (x-register-dnd-atom "XdndEnter" frame)
+ (x-register-dnd-atom "XdndPosition" frame)
+ (x-register-dnd-atom "XdndLeave" frame)
+ (x-register-dnd-atom "XdndDrop" frame)
+ (x-register-dnd-atom "_DND_PROTOCOL" frame)
+ (x-dnd-init-xdnd-for-frame frame)
+ (x-dnd-init-motif-for-frame frame))))
(defun x-dnd-get-state-cons-for-frame (frame-or-window)
"Return the entry in `x-dnd-current-state' for a frame or window."
@@ -180,13 +222,22 @@ any protocol specific data.")
(defun x-dnd-default-test-function (_window _action types)
"The default test function for drag and drop.
-WINDOW is where the mouse is when this function is called. It may be
-a frame if the mouse is over the menu bar, scroll bar or tool bar.
-ACTION is the suggested action from the source, and TYPES are the
-types the drop data can have. This function only accepts drops with
-types in `x-dnd-known-types'. It always returns the action private."
+WINDOW is where the mouse is when this function is called. It
+may be a frame if the mouse is over the menu bar, scroll bar or
+tool bar. ACTION is the suggested action from the source, and
+TYPES are the types the drop data can have. This function only
+accepts drops with types in `x-dnd-known-types'. It always
+returns the action `private', unless `types' contains a value
+inside `x-dnd-copy-types'."
(let ((type (x-dnd-choose-type types)))
- (when type (cons 'private type))))
+ (when type (let ((list x-dnd-copy-types))
+ (catch 'out
+ (while t
+ (if (not list)
+ (throw 'out (cons 'private type))
+ (if (x-dnd-find-type (car list) types)
+ (throw 'out (cons 'copy type))
+ (setq list (cdr list))))))))))
(defun x-dnd-current-type (frame-or-window)
"Return the type we want the DND data to be in for the current drop.
@@ -199,29 +250,49 @@ FRAME-OR-WINDOW is the frame or window that the mouse is over."
(setcdr (x-dnd-get-state-cons-for-frame frame-or-window)
(copy-sequence x-dnd-empty-state)))
-(defun x-dnd-maybe-call-test-function (window action)
+(defun x-dnd-find-type (target types)
+ "Find the type TARGET in an array of types TYPES.
+TARGET must be a string, but TYPES can contain either symbols or
+strings."
+ (catch 'done
+ (dotimes (i (length types))
+ (let* ((type (aref types i))
+ (typename (if (symbolp type)
+ (symbol-name type) type)))
+ (when (equal target typename)
+ (throw 'done t))))
+ nil))
+
+(defun x-dnd-maybe-call-test-function (window action &optional xdnd)
"Call `x-dnd-test-function' if something has changed.
WINDOW is the window the mouse is over. ACTION is the suggested
action from the source. If nothing has changed, return the last
-action and type we got from `x-dnd-test-function'."
+action and type we got from `x-dnd-test-function'.
+
+XDND means the XDND protocol is being used."
(let ((buffer (when (window-live-p window)
(window-buffer window)))
(current-state (x-dnd-get-state-for-frame window)))
- (unless (and (equal buffer (aref current-state 0))
- (equal window (aref current-state 1))
- (equal action (aref current-state 3)))
- (save-current-buffer
- (when buffer (set-buffer buffer))
- (let* ((action-type (funcall x-dnd-test-function
- window
- action
- (aref current-state 2)))
- (handler (cdr (assoc (cdr action-type) x-dnd-types-alist))))
- ;; Ignore action-type if we have no handler.
- (setq current-state
- (x-dnd-save-state window
- action
- (when handler action-type)))))))
+ (if (and xdnd (x-dnd-find-type "XdndDirectSave0"
+ (aref current-state 2)))
+ (setq current-state
+ (x-dnd-save-state window 'direct-save
+ '(direct-save . "XdndDirectSave0")))
+ (unless (and (equal buffer (aref current-state 0))
+ (equal window (aref current-state 1))
+ (equal action (aref current-state 3)))
+ (save-current-buffer
+ (when buffer (set-buffer buffer))
+ (let* ((action-type (funcall x-dnd-test-function
+ window
+ action
+ (aref current-state 2)))
+ (handler (cdr (assoc (cdr action-type) x-dnd-types-alist))))
+ ;; Ignore action-type if we have no handler.
+ (setq current-state
+ (x-dnd-save-state window
+ action
+ (when handler action-type))))))))
(let ((current-state (x-dnd-get-state-for-frame window)))
(cons (aref current-state 5)
(aref current-state 4))))
@@ -371,6 +442,7 @@ nil if not."
Currently XDND, Motif and old KDE 1.x protocols are recognized."
(interactive "e")
(let* ((client-message (car (cdr (cdr event))))
+ (x-fast-protocol-requests (not x-dnd-debug-errors))
(window (posn-window (event-start event))))
(if (eq (and (consp client-message)
(car client-message))
@@ -382,6 +454,8 @@ Currently XDND, Motif and old KDE 1.x protocols are recognized."
x-dnd-xdnd-to-action)))
(targets (cddr client-message))
(local-value (nth 2 client-message)))
+ (when (windowp window)
+ (select-window window))
(x-dnd-save-state window nil nil
(apply #'vector targets))
(x-dnd-maybe-call-test-function window action)
@@ -597,9 +671,21 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
(dnd-source (aref data 0))
(action-type (x-dnd-maybe-call-test-function
window
- (cdr (assoc action x-dnd-xdnd-to-action))))
- (reply-action (car (rassoc (car action-type)
- x-dnd-xdnd-to-action)))
+ (cdr (assoc action x-dnd-xdnd-to-action)) t))
+ (reply-action (car (rassoc
+ ;; Mozilla and some other programs
+ ;; support XDS, but only if we
+ ;; reply with `copy'. We can
+ ;; recognize these broken programs
+ ;; by checking to see if
+ ;; `XdndActionDirectSave' was
+ ;; originally specified.
+ (if (and (eq (car action-type)
+ 'direct-save)
+ (not (eq action 'direct-save)))
+ 'copy
+ (car action-type))
+ x-dnd-xdnd-to-action)))
(accept ;; 1 = accept, 0 = reject
(if (and reply-action action-type
;; Only allow drops on the text area of a
@@ -609,13 +695,13 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
(list-to-send
(list (string-to-number
(frame-parameter frame 'outer-window-id))
- (+ 2 accept) ;; 1 = accept, 0 = reject. 2 =
- ;; "want position updates".
- (if dnd-indicate-insertion-point 0
- (x-dnd-get-drop-x-y frame window))
- (if dnd-indicate-insertion-point 0
- (x-dnd-get-drop-width-height
- frame window (eq accept 1)))
+ ;; 1 = accept, 0 = reject. 2 = "want position
+ ;; updates even for movement inside the given
+ ;; widget bounds".
+ (+ (if dnd-indicate-insertion-point 2 0) accept)
+ (x-dnd-get-drop-x-y frame window)
+ (x-dnd-get-drop-width-height
+ frame window (eq accept 1))
;; The no-toolkit Emacs build can actually
;; receive drops from programs that speak
;; versions of XDND earlier than 3 (such as
@@ -637,34 +723,39 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
(version (aref state 6))
(dnd-source (aref data 0))
(timestamp (aref data 2))
- (value (and (x-dnd-current-type window)
- (x-get-selection-internal
- 'XdndSelection
- (intern (x-dnd-current-type window))
- timestamp)))
- success action)
+ (current-action (aref state 5))
+ (current-type (aref state 4))
+ success action value)
(x-display-set-last-user-time timestamp)
- (unwind-protect
- (setq action (if value
- (condition-case info
- (x-dnd-drop-data
- event frame window value
- (x-dnd-current-type window))
- (error
- (message "Error: %s" info)
- nil))))
- (setq success (if action 1 0))
- (when (>= version 2)
- (x-send-client-message
- frame dnd-source frame "XdndFinished" 32
- (list (string-to-number
- (frame-parameter frame 'outer-window-id))
- (if (>= version 5) success 0) ;; 1 = Success, 0 = Error
- (if (or (not success) (< version 5)) 0
- (or (car (rassoc action
- x-dnd-xdnd-to-action))
- 0))))))
- (x-dnd-forget-drop window)))
+ (if (and (eq current-action 'direct-save)
+ (equal current-type "XdndDirectSave0"))
+ (x-dnd-handle-xds-drop event window dnd-source version)
+ (setq value (and (x-dnd-current-type window)
+ (x-get-selection-internal
+ 'XdndSelection
+ (intern (x-dnd-current-type window))
+ timestamp)))
+ (unwind-protect
+ (setq action (if value
+ (condition-case info
+ (x-dnd-drop-data
+ event frame window value
+ (x-dnd-current-type window))
+ (error
+ (message "Error: %s" info)
+ nil))))
+ (setq success (if action 1 0))
+ (when (>= version 2)
+ (x-send-client-message
+ frame dnd-source frame "XdndFinished" 32
+ (list (string-to-number
+ (frame-parameter frame 'outer-window-id))
+ (if (>= version 5) success 0) ;; 1 = Success, 0 = Error
+ (if (or (not action) (< version 5)) 0
+ (or (car (rassoc action
+ x-dnd-xdnd-to-action))
+ 0)))))
+ (x-dnd-forget-drop window)))))
(t (error "Unknown XDND message %s %s" message data))))
@@ -1097,19 +1188,25 @@ X and Y are the root window coordinates of the drop.
FRAME is the frame the drop originated on.
WINDOW-ID is the X window the drop should happen to.
LOCAL-SELECTION-DATA is the local selection data of the drop."
- (not (and (or (eq action 'XdndActionCopy)
- (eq action 'XdndActionMove))
- (not (and x-dnd-use-offix-drop local-selection-data
- (or (not (eq x-dnd-use-offix-drop 'files))
- (member "FILE_NAME" targets))
- (x-dnd-do-offix-drop targets x
- y frame window-id
- local-selection-data)))
- (or
- (member "STRING" targets)
- (member "UTF8_STRING" targets)
- (member "COMPOUND_TEXT" targets)
- (member "TEXT" targets)))))
+ (let ((chosen-action nil))
+ (not (and (or (eq action 'XdndActionCopy)
+ (eq action 'XdndActionMove))
+ (not (and x-dnd-use-offix-drop local-selection-data
+ (or (not (eq x-dnd-use-offix-drop 'files))
+ (member "FILE_NAME" targets))
+ (when (x-dnd-do-offix-drop targets x
+ y frame window-id
+ local-selection-data)
+ (setq chosen-action 'XdndActionCopy))))
+ (let ((delegate-p (or (member "STRING" targets)
+ (member "UTF8_STRING" targets)
+ (member "COMPOUND_TEXT" targets)
+ (member "TEXT" targets))))
+ (prog1 delegate-p
+ ;; A string will avoid the drop emulation done in C
+ ;; code, but won't be returned from `x-begin-drag'.
+ (setq chosen-action (unless delegate-p ""))))))
+ chosen-action))
(defvar x-dnd-targets-list)
(defvar x-dnd-native-test-function)
@@ -1144,6 +1241,7 @@ ACTION is the action given to `x-begin-drag'."
"Whether or not the drop target made a request for `XdndDirectSave0'.")
(defvar x-dnd-disable-motif-protocol)
+(defvar x-dnd-use-unsupported-drop)
(defun x-dnd-handle-direct-save (_selection _type _value)
"Handle a selection request for `XdndDirectSave'."
@@ -1155,7 +1253,8 @@ ACTION is the action given to `x-begin-drag'."
(not (equal (match-string 1 uri) "")))
(dnd-get-local-file-uri uri)
uri))
- (local-name (dnd-get-local-file-name local-file-uri)))
+ (local-name (and local-file-uri
+ (dnd-get-local-file-name local-file-uri))))
(if (not local-name)
'(STRING . "F")
(condition-case nil
@@ -1204,6 +1303,7 @@ was taken, or the direct save failed."
;; possibly work with Motif or OffiX programs.
(x-dnd-disable-motif-protocol t)
(x-dnd-use-offix-drop nil)
+ (x-dnd-use-unsupported-drop nil)
(prop-deleted nil)
encoded-name)
(unwind-protect
@@ -1224,7 +1324,8 @@ was taken, or the direct save failed."
;; FIXME: this does not work with GTK file managers, since
;; they always reach for `text/uri-list' first, contrary to
;; the spec.
- (let ((action (x-begin-drag '("XdndDirectSave0" "text/uri-list")
+ (let ((action (x-begin-drag '("XdndDirectSave0" "text/uri-list"
+ "application/octet-stream")
'XdndActionDirectSave
frame nil allow-same-frame)))
(if (not x-dnd-xds-performed)
@@ -1237,14 +1338,142 @@ was taken, or the direct save failed."
(and (stringp property)
(not (equal property ""))))
action)))))
- ;; TODO: check for failure and implement selection-based file
- ;; transfer.
(unless prop-deleted
(x-delete-window-property "XdndDirectSave0" frame))
;; Delete any remote copy that was made.
(when (not (equal file-name original-file-name))
(delete-file file-name)))))
+(defun x-dnd-save-direct (need-name name)
+ "Handle dropping a file that should be saved immediately.
+NEED-NAME tells whether or not the file was not yet saved. NAME
+is either the name of the file, or the name the drop source wants
+us to save under.
+
+Prompt the user for a file name, then open it."
+ (if need-name
+ (let ((file-name (read-file-name "Write file: "
+ default-directory
+ nil nil name)))
+ (when (file-exists-p file-name)
+ (unless (y-or-n-p (format-message
+ "File `%s' exists; overwrite? " file-name))
+ (setq file-name nil)))
+ file-name)
+ ;; TODO: move this to dired.el once a platform-agonistic
+ ;; interface can be found.
+ (if (derived-mode-p 'dired-mode)
+ (revert-buffer)
+ (find-file name))))
+
+(defun x-dnd-save-direct-immediately (need-name name)
+ "Save and open a dropped file, like `x-dnd-save-direct'.
+NEED-NAME tells whether or not the file was not yet saved. NAME
+is either the name of the file, or the name the drop source wants
+us to save under.
+
+Unlike `x-dnd-save-direct', do not prompt for the name by which
+to save the file. Simply save it in the current directory."
+ (if need-name
+ (let ((file-name (expand-file-name name)))
+ (when (file-exists-p file-name)
+ (unless (y-or-n-p (format-message
+ "File `%s' exists; overwrite? " file-name))
+ (setq file-name nil)))
+ file-name)
+ ;; TODO: move this to dired.el once a platform-agonistic
+ ;; interface can be found.
+ (if (derived-mode-p 'dired-mode)
+ (revert-buffer)
+ (find-file name))))
+
+(defun x-dnd-handle-octet-stream-for-drop (save-to)
+ "Save the contents of the XDS selection to SAVE-TO.
+Return non-nil if successful, nil otherwise."
+ (ignore-errors
+ (let ((coding-system-for-write 'raw-text)
+ (data (x-get-selection-internal 'XdndSelection
+ 'application/octet-stream)))
+ (when data
+ (write-region data nil save-to)
+ t))))
+
+(defun x-dnd-handle-xds-drop (event window source version)
+ "Handle an XDS (X Direct Save) protocol drop.
+EVENT is the drag-n-drop event containing the drop.
+WINDOW is the window on top of which the drop is supposed to happen.
+SOURCE is the X window that sent the drop.
+VERSION is the version of the XDND protocol understood by SOURCE."
+ (if (not (windowp window))
+ ;; We can't perform an XDS drop if there's no window from which
+ ;; to determine the current directory.
+ (let* ((start (event-start event))
+ (frame (posn-window start)))
+ (x-send-client-message frame source frame
+ "XdndFinished" 32
+ (list (string-to-number
+ (frame-parameter frame
+ 'outer-window-id)))))
+ (let ((desired-name (x-window-property "XdndDirectSave0"
+ (window-frame window)
+ ;; We currently don't handle
+ ;; any alternative character
+ ;; encodings.
+ "text/plain" source))
+ (frame (window-frame window))
+ (success nil) save-to save-to-remote hostname)
+ (unwind-protect
+ (when (stringp desired-name)
+ (setq desired-name (decode-coding-string
+ desired-name
+ (or file-name-coding-system
+ default-file-name-coding-system)))
+ (let ((name (funcall x-dnd-direct-save-function
+ t desired-name)))
+ (setq save-to name save-to-remote name))
+ (when save-to
+ (if (file-remote-p save-to)
+ (setq hostname (file-remote-p save-to 'host)
+ save-to (file-local-name save-to))
+ (setq hostname (system-name)))
+ (with-selected-window window
+ (let ((uri (format "file://%s%s" hostname save-to)))
+ (x-change-window-property "XdndDirectSave0"
+ (encode-coding-string
+ (url-encode-url uri) 'ascii)
+ frame "text/plain" 8 nil source)
+ (let ((result (x-get-selection-internal 'XdndSelection
+ 'XdndDirectSave0)))
+ (cond ((equal result "F")
+ (setq success
+ (x-dnd-handle-octet-stream-for-drop save-to-remote))
+ (unless success
+ (x-change-window-property "XdndDirectSave0" ""
+ frame "text/plain" 8
+ nil source)))
+ ((equal result "S")
+ (setq success t))
+ ((equal result "E")
+ (setq success nil))
+ (t (error "Broken implementation of XDS: got %s in reply"
+ result)))
+ (when success
+ (funcall x-dnd-direct-save-function nil save-to-remote)))))))
+ ;; We assume XDS always comes from a client supporting version 2
+ ;; or later, since custom actions aren't present before.
+ (x-send-client-message frame source frame
+ "XdndFinished" 32
+ (list (string-to-number
+ (frame-parameter frame
+ 'outer-window-id))
+ (if (>= version 5)
+ (if success 1 0)
+ 0)
+ (if (or (not success)
+ (< version 5))
+ 0
+ "XdndDirectSave0")))))))
+
(provide 'x-dnd)
;;; x-dnd.el ends here
diff --git a/lisp/xdg.el b/lisp/xdg.el
index 6a0b1dedd1d..c7d9c0e785e 100644
--- a/lisp/xdg.el
+++ b/lisp/xdg.el
@@ -171,13 +171,12 @@ file:///foo/bar.jpg"
;; https://www.freedesktop.org/wiki/Software/xdg-user-dirs/
(defconst xdg-line-regexp
- (eval-when-compile
- (rx "XDG_"
- (group-n 1 (or "DESKTOP" "DOWNLOAD" "TEMPLATES" "PUBLICSHARE"
- "DOCUMENTS" "MUSIC" "PICTURES" "VIDEOS"))
- "_DIR=\""
- (group-n 2 (or "/" "$HOME/") (*? (or (not (any "\"")) "\\\"")))
- "\""))
+ (rx "XDG_"
+ (group-n 1 (or "DESKTOP" "DOWNLOAD" "TEMPLATES" "PUBLICSHARE"
+ "DOCUMENTS" "MUSIC" "PICTURES" "VIDEOS"))
+ "_DIR=\""
+ (group-n 2 (or "/" "$HOME/") (*? (or (not (any "\"")) "\\\"")))
+ "\"")
"Regexp matching non-comment lines in `xdg-user-dirs' config files.")
(defvar xdg-user-dirs nil
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index 88bc8ff6c5e..0821760d995 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -134,6 +134,8 @@ Interactively, URL defaults to the string looking like a url around point."
(xwidget-webkit-new-session url)
(xwidget-webkit-goto-url url))))
+(function-put 'xwidget-webkit-browse-url 'browse-url-browser-kind 'internal)
+
(defun xwidget-webkit-clone-and-split-below ()
"Clone current URL into a new widget place in new window below.
Get the URL of current session, then browse to the URL
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index eba85631bd8..68f49e646da 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -1753,13 +1753,9 @@ make_shadow_gcs (XlwMenuWidget mw)
if (mw->menu.top_shadow_color == -1)
mw->menu.top_shadow_color = mw->core.background_pixel;
- else
- mw->menu.top_shadow_color = mw->menu.top_shadow_color;
if (mw->menu.bottom_shadow_color == -1)
mw->menu.bottom_shadow_color = mw->menu.foreground;
- else
- mw->menu.bottom_shadow_color = mw->menu.bottom_shadow_color;
if (mw->menu.top_shadow_color == mw->core.background_pixel ||
mw->menu.top_shadow_color == mw->menu.foreground)
diff --git a/m4/fchmodat.m4 b/m4/fchmodat.m4
index a5cf95a88be..f743ce1b025 100644
--- a/m4/fchmodat.m4
+++ b/m4/fchmodat.m4
@@ -1,4 +1,4 @@
-# fchmodat.m4 serial 6
+# fchmodat.m4 serial 7
dnl Copyright (C) 2004-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -97,6 +97,6 @@ AC_DEFUN([gl_FUNC_FCHMODAT],
# Prerequisites of lib/fchmodat.c.
AC_DEFUN([gl_PREREQ_FCHMODAT],
[
- AC_CHECK_FUNCS_ONCE([lchmod])
+ AC_CHECK_FUNCS_ONCE([readlinkat])
:
])
diff --git a/m4/lchmod.m4 b/m4/lchmod.m4
index 5baee738efd..cd43beed851 100644
--- a/m4/lchmod.m4
+++ b/m4/lchmod.m4
@@ -1,4 +1,4 @@
-#serial 8
+#serial 10
dnl Copyright (C) 2005-2006, 2008-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@@ -15,9 +15,7 @@ AC_DEFUN([gl_FUNC_LCHMOD],
dnl Persuade glibc <sys/stat.h> to declare lchmod().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-
- AC_CHECK_FUNCS_ONCE([lchmod lstat])
+ AC_CHECK_FUNCS_ONCE([lchmod])
if test "$ac_cv_func_lchmod" = no; then
HAVE_LCHMOD=0
fi
diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
index b5a9789b818..2adbfdeef4e 100644
--- a/m4/sys_stat_h.m4
+++ b/m4/sys_stat_h.m4
@@ -1,4 +1,4 @@
-# sys_stat_h.m4 serial 41 -*- Autoconf -*-
+# sys_stat_h.m4 serial 42 -*- Autoconf -*-
dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -46,7 +46,7 @@ AC_DEFUN_ONCE([gl_SYS_STAT_H],
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
- ]], [fchmodat fstat fstatat futimens getumask lchmod lstat
+ ]], [chmod fchmodat fstat fstatat futimens getumask lchmod lstat
mkdirat mkfifo mkfifoat mknod mknodat stat utimensat])
AC_REQUIRE([AC_C_RESTRICT])
@@ -72,6 +72,7 @@ AC_DEFUN([gl_SYS_STAT_H_REQUIRE_DEFAULTS],
[
m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS], [
gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHMOD])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHMODAT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTAT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTATAT])
@@ -112,6 +113,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD])
HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT])
+ REPLACE_CHMOD=0; AC_SUBST([REPLACE_CHMOD])
REPLACE_FCHMODAT=0; AC_SUBST([REPLACE_FCHMODAT])
REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
diff --git a/make-dist b/make-dist
index 67e49382d07..4646a2809bf 100755
--- a/make-dist
+++ b/make-dist
@@ -174,7 +174,7 @@ fi
### Find out which version of Emacs this is.
version=`
- sed -n 's/^AC_INIT(GNU Emacs,[ ]*\([^ ,)]*\).*/\1/p' <configure.ac
+ sed -n 's/^AC_INIT(\[GNU Emacs],[ ]*\[\([^]]*\).*/\1/p' <configure.ac
` || version=
if [ ! "${version}" ]; then
printf '%s\n' \
diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp
index 302fefe19f0..9847e710c0f 100644
--- a/msdos/sedlibmk.inp
+++ b/msdos/sedlibmk.inp
@@ -192,6 +192,9 @@ s/@PACKAGE@/emacs/
/^GL_GNULIB_TIMEGM *=/s/@GL_GNULIB_TIMEGM@/1/
/^GL_GNULIB_TIME_RZ *=/s/@GL_GNULIB_TIME_RZ@/1/
/^GL_GNULIB_UNSETENV *=/s/@GL_GNULIB_UNSETENV@/1/
+# Apparently without this `rawmemchr' isn't declared, so
+# we get warnings building canonicalize-lgpl.o
+/^GL_GNULIB_RAWMEMCHR *=/s/@GL_GNULIB_RAWMEMCHR@/1/
/^GL_GNULIB_[^ =]* *= *@/s/@[^@\n]*@/0/
/^GL_GSETTINGS_CFLAGS *=/s/@[^@\n]*@//
/^GL_GSETTINGS_LIBS *=/s/@[^@\n]*@//
diff --git a/src/.lldbinit b/src/.lldbinit
new file mode 100644
index 00000000000..358cea5f8b6
--- /dev/null
+++ b/src/.lldbinit
@@ -0,0 +1,33 @@
+# -*- mode: shell-script -*-
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of GNU Emacs.
+#
+# GNU Emacs is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+#
+# Use 'lldb --local-init' or add to your ~/.lldbinit the line
+#
+# settings set target.load-cwd-lldbinit true
+#
+# Emacs-specific commands start with 'x'. Type 'help' to see all
+# commands. Type 'help <command>' to see help for a command
+# <command>.
+
+# Make Python find our files
+script -- sys.path.append('../etc')
+
+# Load our Python files
+command script import emacs_lldb
+
+# end.
diff --git a/src/alloc.c b/src/alloc.c
index f115a3cebaa..6e166d00d5b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6266,6 +6266,11 @@ garbage_collect (void)
/* GC is complete: now we can run our finalizer callbacks. */
run_finalizers (&doomed_finalizers);
+#ifdef HAVE_WINDOW_SYSTEM
+ /* Eject unused image cache entries. */
+ image_prune_animation_caches (false);
+#endif
+
if (!NILP (Vpost_gc_hook))
{
specpdl_ref gc_count = inhibit_garbage_collection ();
diff --git a/src/buffer.c b/src/buffer.c
index 509ce51b55e..e5fa09a9789 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -911,7 +911,8 @@ does not run the hooks `kill-buffer-hook',
set_buffer_internal_1 (b);
Fset (intern ("buffer-save-without-query"), Qnil);
Fset (intern ("buffer-file-number"), Qnil);
- Fset (intern ("buffer-stale-function"), Qnil);
+ if (!NILP (Flocal_variable_p (Qbuffer_stale_function, base_buffer)))
+ Fkill_local_variable (Qbuffer_stale_function);
/* Cloned buffers need extra setup, to do things such as deep
variable copies for list variables that might be mangled due
to destructive operations in the indirect buffer. */
@@ -6478,5 +6479,7 @@ will run for `clone-indirect-buffer' calls as well. */);
DEFSYM (Qkill_buffer__possibly_save, "kill-buffer--possibly-save");
+ DEFSYM (Qbuffer_stale_function, "buffer-stale-function");
+
Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt);
}
diff --git a/src/character.c b/src/character.c
index c1a1b553891..968daccafa7 100644
--- a/src/character.c
+++ b/src/character.c
@@ -666,35 +666,26 @@ count_size_as_multibyte (const unsigned char *str, ptrdiff_t len)
}
-/* Convert unibyte text at STR of BYTES bytes to a multibyte text
- that contains the same single-byte characters. It actually
- converts all 8-bit characters to multibyte forms. It is assured
- that we can use LEN bytes at STR as a work area and that is
- enough. */
-
+/* Convert unibyte text at SRC of NCHARS chars to a multibyte text
+ at DST, that contains the same single-byte characters.
+ Return the number of bytes written at DST. */
ptrdiff_t
-str_to_multibyte (unsigned char *str, ptrdiff_t len, ptrdiff_t bytes)
+str_to_multibyte (unsigned char *dst, const unsigned char *src,
+ ptrdiff_t nchars)
{
- unsigned char *p = str, *endp = str + bytes;
- unsigned char *to;
-
- while (p < endp && *p < 0x80) p++;
- if (p == endp)
- return bytes;
- to = p;
- bytes = endp - p;
- endp = str + len;
- memmove (endp - bytes, p, bytes);
- p = endp - bytes;
- while (p < endp)
+ unsigned char *d = dst;
+ for (ptrdiff_t i = 0; i < nchars; i++)
{
- int c = *p++;
-
- if (c >= 0x80)
- c = BYTE8_TO_CHAR (c);
- to += CHAR_STRING (c, to);
+ unsigned char c = src[i];
+ if (c <= 0x7f)
+ *d++ = c;
+ else
+ {
+ *d++ = 0xc0 + ((c >> 6) & 1);
+ *d++ = 0x80 + (c & 0x3f);
+ }
}
- return (to - str);
+ return d - dst;
}
/* Arrange multibyte text at STR of LEN bytes as a unibyte text. It
@@ -734,31 +725,6 @@ str_as_unibyte (unsigned char *str, ptrdiff_t bytes)
return (to - str);
}
-/* Convert eight-bit chars in SRC (in multibyte form) to the
- corresponding byte and store in DST. CHARS is the number of
- characters in SRC. The value is the number of bytes stored in DST.
- Usually, the value is the same as CHARS, but is less than it if SRC
- contains a non-ASCII, non-eight-bit character. */
-
-ptrdiff_t
-str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars)
-{
- ptrdiff_t i;
-
- for (i = 0; i < chars; i++)
- {
- int c = string_char_advance (&src);
-
- if (CHAR_BYTE8_P (c))
- c = CHAR_TO_BYTE8 (c);
- else if (! ASCII_CHAR_P (c))
- return i;
- *dst++ = c;
- }
- return i;
-}
-
-
static ptrdiff_t
string_count_byte8 (Lisp_Object string)
{
diff --git a/src/character.h b/src/character.h
index 6ee6bcab205..6d0f035c2bb 100644
--- a/src/character.h
+++ b/src/character.h
@@ -567,10 +567,9 @@ extern int translate_char (Lisp_Object, int c);
extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t);
extern ptrdiff_t str_as_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t,
ptrdiff_t *);
-extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t);
+extern ptrdiff_t str_to_multibyte (unsigned char *dst, const unsigned char *src,
+ ptrdiff_t nchars);
extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t);
-extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *,
- ptrdiff_t);
extern ptrdiff_t strwidth (const char *, ptrdiff_t);
extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int,
ptrdiff_t *, ptrdiff_t *);
diff --git a/src/comp.c b/src/comp.c
index 0c78e60fc43..81d27299fa4 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5781,7 +5781,7 @@ For internal use. */);
DEFVAR_LISP ("native-comp-eln-load-path", Vnative_comp_eln_load_path,
doc: /* List of eln cache directories.
-If a directory is non absolute is assumed to be relative to
+If a directory is non absolute it is assumed to be relative to
`invocation-directory'.
`comp-native-version-dir' value is used as a sub-folder name inside
each eln cache directory.
diff --git a/src/composite.c b/src/composite.c
index 4d69702171f..1596e996d6c 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1513,10 +1513,11 @@ struct position_record
/* Similar to find_composition, but find an automatic composition instead.
This function looks for automatic composition at or near position
- POS of OBJECT (a buffer or a string). OBJECT defaults to the
- current buffer. It must be assured that POS is not within a static
- composition. Also, the current buffer must be displayed in some
- window, otherwise the function will return FALSE.
+ POS of STRING object, either a buffer or a Lisp string. If STRING
+ is nil, it defaults to the current buffer. It must be assured that
+ POS is not within a static composition. Also, the current buffer
+ must be displayed in some window, otherwise the function will
+ return FALSE.
If LIMIT is negative, and there's no composition that includes POS
(i.e. starts at or before POS and ends at or after POS), return
@@ -1525,8 +1526,8 @@ struct position_record
MAX_AUTO_COMPOSITION_LOOKBACK, the maximum number of look-back for
automatic compositions (3) -- this is a limitation imposed by
composition rules in composition-function-table, which see. If
- BACKLIM is negative, it stands for the beginning of OBJECT: BEGV
- for a buffer or position zero for a string.
+ BACKLIM is negative, it stands for the beginning of STRING object:
+ BEGV for a buffer or position zero for a string.
If LIMIT is positive, search for a composition forward (LIMIT >
POS) or backward (LIMIT < POS). In this case, LIMIT bounds the
@@ -1535,18 +1536,21 @@ struct position_record
function can find a composition that starts after POS.
BACKLIM limits how far back is the function allowed to look in
- OBJECT while trying to find a position where it is safe to start
- searching forward for compositions. Such a safe place is generally
- the position after a character that can never be composed.
+ STRING object while trying to find a position where it is safe to
+ start searching forward for compositions. Such a safe place is
+ generally the position after a character that can never be
+ composed.
If BACKLIM is negative, that means the first character position of
- OBJECT; this is useful when calling the function for the first time
- for a given buffer or string, since it is possible that a
- composition begins before POS. However, if POS is very far from
- the beginning of OBJECT, a negative value of BACKLIM could make the
- function slow. Also, in this case the function may return START
- and END that do not include POS, something that is not necessarily
- wanted, and needs to be explicitly checked by the caller.
+ STRING object; this is useful when calling the function for the
+ first time for a given buffer or string, since it is possible that
+ a composition begins before POS. However, if POS is very far from
+ the beginning of STRING object, a negative value of BACKLIM could
+ make the function slow. For that reason, when STRING is a buffer
+ or nil, we restrict the search back to the first newline before
+ POS. Also, in this case the function may return START and END that
+ do not include POS, something that is not necessarily wanted, and
+ needs to be explicitly checked by the caller.
When calling the function in a loop for the same buffer/string, the
caller should generally set BACKLIM equal to POS, to avoid costly
@@ -1585,7 +1589,15 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit, ptrdiff_t backlim,
cur.pos = pos;
if (NILP (string))
{
- head = backlim < 0 ? BEGV : backlim, tail = ZV, stop = GPT;
+ if (backlim < 0)
+ {
+ /* This assumes a newline can never be composed. */
+ head = find_newline (pos, -1, 0, -1, -1, NULL, NULL, false) + 1;
+ }
+ else
+ head = backlim;
+ tail = ZV;
+ stop = GPT;
cur.pos_byte = CHAR_TO_BYTE (cur.pos);
cur.p = BYTE_POS_ADDR (cur.pos_byte);
}
@@ -1871,7 +1883,8 @@ should be ignored. */)
else
{
CHECK_STRING (string);
- validate_subarray (string, from, to, SCHARS (string), &frompos, &topos);
+ ptrdiff_t chars = SCHARS (string);
+ validate_subarray (string, from, to, chars, &frompos, &topos);
if (! STRING_MULTIBYTE (string))
{
ptrdiff_t i;
@@ -1881,9 +1894,10 @@ should be ignored. */)
error ("Attempt to shape unibyte text");
/* STRING is a pure-ASCII string, so we can convert it (or,
rather, its copy) to multibyte and use that thereafter. */
- Lisp_Object string_copy = Fconcat (1, &string);
- STRING_SET_MULTIBYTE (string_copy);
- string = string_copy;
+ /* FIXME: Not clear why we need to do that: AFAICT the rest of
+ the code should work on an ASCII-only unibyte string just
+ as well (bug#56347). */
+ string = make_multibyte_string (SSDATA (string), chars, chars);
}
frombyte = string_char_to_byte (string, frompos);
}
diff --git a/src/data.c b/src/data.c
index 1dbec4687b8..568349ba839 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1546,8 +1546,13 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
/* Find the value of a symbol, returning Qunbound if it's not bound.
This is helpful for code which just wants to get a variable's value
if it has one, without signaling an error.
- Note that it must not be possible to quit
- within this function. Great care is required for this. */
+
+ This function is very similar to buffer_local_value, but we have
+ two separate code paths here since find_symbol_value has to be very
+ efficient, while buffer_local_value doesn't have to be.
+
+ Note that it must not be possible to quit within this function.
+ Great care is required for this. */
Lisp_Object
find_symbol_value (Lisp_Object symbol)
diff --git a/src/dired.c b/src/dired.c
index 6bb8c2fcb9f..c2c099f0a5f 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -219,6 +219,13 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
}
#endif
+ if (!NILP (full) && !STRING_MULTIBYTE (directory))
+ { /* We will be concatenating 'directory' with local file name.
+ We always decode local file names, so in order to safely concatenate
+ them we need 'directory' to be decoded as well (bug#56469). */
+ directory = DECODE_FILE (directory);
+ }
+
ptrdiff_t directory_nbytes = SBYTES (directory);
re_match_object = Qt;
@@ -263,9 +270,20 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
ptrdiff_t name_nbytes = SBYTES (name);
ptrdiff_t nbytes = directory_nbytes + needsep + name_nbytes;
ptrdiff_t nchars = SCHARS (directory) + needsep + SCHARS (name);
- finalname = make_uninit_multibyte_string (nchars, nbytes);
- if (nchars == nbytes)
- STRING_SET_UNIBYTE (finalname);
+ /* DECODE_FILE may return non-ASCII unibyte strings (e.g. when
+ file-name-coding-system is 'binary'), so we don't know for sure
+ that the bytes we have follow our internal utf-8 representation
+ for multibyte strings. If nchars == nbytes we don't need to
+ care and just return a unibyte string; and if not, that means
+ one of 'name' or 'directory' is multibyte, in which case we
+ presume that the other one would also be multibyte if it
+ contained non-ASCII.
+ FIXME: This last presumption is broken when 'directory' is
+ multibyte (with non-ASCII), and 'name' is unibyte with non-ASCII
+ (because file-name-coding-system is 'binary'). */
+ finalname = (nchars == nbytes)
+ ? make_uninit_string (nbytes)
+ : make_uninit_multibyte_string (nchars, nbytes);
memcpy (SDATA (finalname), SDATA (directory), directory_nbytes);
if (needsep)
SSET (finalname, directory_nbytes, DIRECTORY_SEP);
diff --git a/src/dispextern.h b/src/dispextern.h
index ca7834dec55..916dba53198 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3540,6 +3540,7 @@ struct image_cache *make_image_cache (void);
void free_image_cache (struct frame *);
void clear_image_caches (Lisp_Object);
void mark_image_cache (struct image_cache *);
+void image_prune_animation_caches (bool);
bool valid_image_p (Lisp_Object);
void prepare_image_for_display (struct frame *, struct image *);
ptrdiff_t lookup_image (struct frame *, Lisp_Object, int);
diff --git a/src/editfns.c b/src/editfns.c
index 84947af5086..4587b1132b1 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -161,7 +161,7 @@ DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
if (XFIXNUM (byte) < 0 || XFIXNUM (byte) > 255)
error ("Invalid byte");
b = XFIXNUM (byte);
- return make_string_from_bytes ((char *) &b, 1, 1);
+ return make_unibyte_string ((char *) &b, 1);
}
DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0,
diff --git a/src/fileio.c b/src/fileio.c
index 10d4b8bc15e..9697f6c8cf1 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2601,9 +2601,9 @@ is case-insensitive. */)
if (err <= 0)
return err < 0 ? Qt : Qnil;
Lisp_Object parent = file_name_directory (filename);
- /* Avoid infinite loop if the root has trouble
- (impossible?). */
- if (!NILP (Fstring_equal (parent, filename)))
+ /* Avoid infinite loop if the root has trouble (if that's even possible).
+ Without a parent, we just don't know and return nil as well. */
+ if (!STRINGP (parent) || !NILP (Fstring_equal (parent, filename)))
return Qnil;
filename = parent;
}
@@ -5832,6 +5832,15 @@ See Info node `(elisp)Modification Time' for more details. */)
return Qnil;
}
+Lisp_Object
+buffer_visited_file_modtime (struct buffer *buf)
+{
+ int ns = buf->modtime.tv_nsec;
+ if (ns < 0)
+ return make_fixnum (UNKNOWN_MODTIME_NSECS - ns);
+ return make_lisp_time (buf->modtime);
+}
+
DEFUN ("visited-file-modtime", Fvisited_file_modtime,
Svisited_file_modtime, 0, 0, 0,
doc: /* Return the current buffer's recorded visited file modification time.
@@ -5841,10 +5850,7 @@ visited file doesn't exist.
See Info node `(elisp)Modification Time' for more details. */)
(void)
{
- int ns = current_buffer->modtime.tv_nsec;
- if (ns < 0)
- return make_fixnum (UNKNOWN_MODTIME_NSECS - ns);
- return make_lisp_time (current_buffer->modtime);
+ return buffer_visited_file_modtime (current_buffer);
}
DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime,
@@ -5871,6 +5877,8 @@ in `current-time' or an integer flag as returned by `visited-file-modtime'. */)
current_buffer->modtime = mtime;
current_buffer->modtime_size = -1;
}
+ else if (current_buffer->base_buffer)
+ error ("An indirect buffer does not have a visited file");
else
{
register Lisp_Object filename;
diff --git a/src/fns.c b/src/fns.c
index 7553a094468..1f57e675b12 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -589,20 +589,21 @@ Do NOT use this function to compare file names for equality. */)
#endif /* !__STDC_ISO_10646__, !WINDOWSNT */
}
-static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args,
- Lisp_Object last_tail, bool vector_target);
-static Lisp_Object concat_strings (ptrdiff_t nargs, Lisp_Object *args);
+static Lisp_Object concat_to_list (ptrdiff_t nargs, Lisp_Object *args,
+ Lisp_Object last_tail);
+static Lisp_Object concat_to_vector (ptrdiff_t nargs, Lisp_Object *args);
+static Lisp_Object concat_to_string (ptrdiff_t nargs, Lisp_Object *args);
Lisp_Object
concat2 (Lisp_Object s1, Lisp_Object s2)
{
- return concat_strings (2, ((Lisp_Object []) {s1, s2}));
+ return concat_to_string (2, ((Lisp_Object []) {s1, s2}));
}
Lisp_Object
concat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3)
{
- return concat_strings (3, ((Lisp_Object []) {s1, s2, s3}));
+ return concat_to_string (3, ((Lisp_Object []) {s1, s2, s3}));
}
DEFUN ("append", Fappend, Sappend, 0, MANY, 0,
@@ -615,7 +616,7 @@ usage: (append &rest SEQUENCES) */)
{
if (nargs == 0)
return Qnil;
- return concat (nargs - 1, args, args[nargs - 1], false);
+ return concat_to_list (nargs - 1, args, args[nargs - 1]);
}
DEFUN ("concat", Fconcat, Sconcat, 0, MANY, 0,
@@ -628,7 +629,7 @@ to be `eq'.
usage: (concat &rest SEQUENCES) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
- return concat_strings (nargs, args);
+ return concat_to_string (nargs, args);
}
DEFUN ("vconcat", Fvconcat, Svconcat, 0, MANY, 0,
@@ -638,7 +639,7 @@ Each argument may be a list, vector or string.
usage: (vconcat &rest SEQUENCES) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
- return concat (nargs, args, Qnil, true);
+ return concat_to_vector (nargs, args);
}
@@ -706,17 +707,16 @@ the same empty object instead of its copy. */)
wrong_type_argument (Qsequencep, arg);
}
-/* This structure holds information of an argument of `concat_strings' that is
- a string and has text properties to be copied. */
+/* This structure holds information of an argument of `concat_to_string'
+ that is a string and has text properties to be copied. */
struct textprop_rec
{
ptrdiff_t argnum; /* refer to ARGS (arguments of `concat') */
- ptrdiff_t from; /* refer to ARGS[argnum] (argument string) */
ptrdiff_t to; /* refer to VAL (the target string) */
};
static Lisp_Object
-concat_strings (ptrdiff_t nargs, Lisp_Object *args)
+concat_to_string (ptrdiff_t nargs, Lisp_Object *args)
{
USE_SAFE_ALLOCA;
@@ -842,7 +842,6 @@ concat_strings (ptrdiff_t nargs, Lisp_Object *args)
if (string_intervals (arg))
{
textprops[num_textprops].argnum = i;
- textprops[num_textprops].from = 0;
textprops[num_textprops].to = toindex;
num_textprops++;
}
@@ -857,9 +856,8 @@ concat_strings (ptrdiff_t nargs, Lisp_Object *args)
else
{
/* Copy a single-byte string to a multibyte string. */
- toindex_byte += copy_text (SDATA (arg),
- SDATA (result) + toindex_byte,
- nchars, 0, 1);
+ toindex_byte += str_to_multibyte (SDATA (result) + toindex_byte,
+ SDATA (arg), nchars);
}
toindex += nchars;
}
@@ -912,19 +910,100 @@ concat_strings (ptrdiff_t nargs, Lisp_Object *args)
return result;
}
-/* Concatenate sequences into a list or vector. */
+/* Concatenate sequences into a list. */
+Lisp_Object
+concat_to_list (ptrdiff_t nargs, Lisp_Object *args, Lisp_Object last_tail)
+{
+ /* Copy the contents of the args into the result. */
+ Lisp_Object result = Qnil;
+ Lisp_Object last = Qnil; /* Last cons in result if nonempty. */
+
+ for (ptrdiff_t i = 0; i < nargs; i++)
+ {
+ Lisp_Object arg = args[i];
+ /* List arguments are treated specially since this is the common case. */
+ if (CONSP (arg))
+ {
+ Lisp_Object head = Fcons (XCAR (arg), Qnil);
+ Lisp_Object prev = head;
+ arg = XCDR (arg);
+ FOR_EACH_TAIL (arg)
+ {
+ Lisp_Object next = Fcons (XCAR (arg), Qnil);
+ XSETCDR (prev, next);
+ prev = next;
+ }
+ CHECK_LIST_END (arg, arg);
+ if (NILP (result))
+ result = head;
+ else
+ XSETCDR (last, head);
+ last = prev;
+ }
+ else if (NILP (arg))
+ ;
+ else if (VECTORP (arg) || STRINGP (arg)
+ || BOOL_VECTOR_P (arg) || COMPILEDP (arg))
+ {
+ ptrdiff_t arglen = XFIXNUM (Flength (arg));
+ ptrdiff_t argindex_byte = 0;
+ /* Copy element by element. */
+ for (ptrdiff_t argindex = 0; argindex < arglen; argindex++)
+ {
+ /* Fetch next element of `arg' arg into `elt', or break if
+ `arg' is exhausted. */
+ Lisp_Object elt;
+ if (STRINGP (arg))
+ {
+ int c;
+ if (STRING_MULTIBYTE (arg))
+ {
+ ptrdiff_t char_idx = argindex;
+ c = fetch_string_char_advance_no_check (arg, &char_idx,
+ &argindex_byte);
+ }
+ else
+ c = SREF (arg, argindex);
+ elt = make_fixed_natnum (c);
+ }
+ else if (BOOL_VECTOR_P (arg))
+ elt = bool_vector_ref (arg, argindex);
+ else
+ elt = AREF (arg, argindex);
+
+ /* Store this element into the result. */
+ Lisp_Object node = Fcons (elt, Qnil);
+ if (NILP (result))
+ result = node;
+ else
+ XSETCDR (last, node);
+ last = node;
+ }
+ }
+ else
+ wrong_type_argument (Qsequencep, arg);
+ }
+
+ if (NILP (result))
+ result = last_tail;
+ else
+ XSETCDR (last, last_tail);
+
+ return result;
+}
+
+/* Concatenate sequences into a vector. */
Lisp_Object
-concat (ptrdiff_t nargs, Lisp_Object *args, Lisp_Object last_tail,
- bool vector_target)
+concat_to_vector (ptrdiff_t nargs, Lisp_Object *args)
{
/* Check argument types and compute total length of arguments. */
EMACS_INT result_len = 0;
for (ptrdiff_t i = 0; i < nargs; i++)
{
Lisp_Object arg = args[i];
- if (!(CONSP (arg) || NILP (arg) || VECTORP (arg) || STRINGP (arg)
- || COMPILEDP (arg) || BOOL_VECTOR_P (arg)))
+ if (!(VECTORP (arg) || CONSP (arg) || NILP (arg) || STRINGP (arg)
+ || BOOL_VECTOR_P (arg) || COMPILEDP (arg)))
wrong_type_argument (Qsequencep, arg);
EMACS_INT len = XFIXNAT (Flength (arg));
result_len += len;
@@ -932,90 +1011,61 @@ concat (ptrdiff_t nargs, Lisp_Object *args, Lisp_Object last_tail,
memory_full (SIZE_MAX);
}
- /* When the target is a list, return the tail directly if all other
- arguments are empty. */
- if (!vector_target && result_len == 0)
- return last_tail;
-
- /* Create the output object. */
- Lisp_Object result = vector_target
- ? make_nil_vector (result_len)
- : Fmake_list (make_fixnum (result_len), Qnil);
+ /* Create the output vector. */
+ Lisp_Object result = make_uninit_vector (result_len);
+ Lisp_Object *dst = XVECTOR (result)->contents;
/* Copy the contents of the args into the result. */
- Lisp_Object tail = Qnil;
- ptrdiff_t toindex = 0;
- if (CONSP (result))
- {
- tail = result;
- toindex = -1; /* -1 in toindex is flag we are making a list */
- }
-
- Lisp_Object prev = Qnil;
for (ptrdiff_t i = 0; i < nargs; i++)
{
- ptrdiff_t arglen = 0;
- ptrdiff_t argindex = 0;
- ptrdiff_t argindex_byte = 0;
-
Lisp_Object arg = args[i];
- if (!CONSP (arg))
- arglen = XFIXNUM (Flength (arg));
-
- /* Copy element by element. */
- while (1)
+ if (VECTORP (arg))
{
- /* Fetch next element of `arg' arg into `elt', or break if
- `arg' is exhausted. */
- Lisp_Object elt;
- if (CONSP (arg))
- {
- elt = XCAR (arg);
- arg = XCDR (arg);
- }
- else if (NILP (arg) || argindex >= arglen)
- break;
- else if (STRINGP (arg))
+ ptrdiff_t size = ASIZE (arg);
+ memcpy (dst, XVECTOR (arg)->contents, size * sizeof *dst);
+ dst += size;
+ }
+ else if (CONSP (arg))
+ do
+ {
+ *dst++ = XCAR (arg);
+ arg = XCDR (arg);
+ }
+ while (!NILP (arg));
+ else if (NILP (arg))
+ ;
+ else if (STRINGP (arg))
+ {
+ ptrdiff_t size = SCHARS (arg);
+ if (STRING_MULTIBYTE (arg))
{
- int c;
- if (STRING_MULTIBYTE (arg))
- c = fetch_string_char_advance_no_check (arg, &argindex,
- &argindex_byte);
- else
+ ptrdiff_t byte = 0;
+ for (ptrdiff_t i = 0; i < size;)
{
- c = SREF (arg, argindex);
- argindex++;
+ int c = fetch_string_char_advance_no_check (arg, &i, &byte);
+ *dst++ = make_fixnum (c);
}
- XSETFASTINT (elt, c);
- }
- else if (BOOL_VECTOR_P (arg))
- {
- elt = bool_vector_ref (arg, argindex);
- argindex++;
}
else
- {
- elt = AREF (arg, argindex);
- argindex++;
- }
-
- /* Store this element into the result. */
- if (toindex < 0)
- {
- XSETCAR (tail, elt);
- prev = tail;
- tail = XCDR (tail);
- }
- else
- {
- ASET (result, toindex, elt);
- toindex++;
- }
+ for (ptrdiff_t i = 0; i < size; i++)
+ *dst++ = make_fixnum (SREF (arg, i));
+ }
+ else if (BOOL_VECTOR_P (arg))
+ {
+ ptrdiff_t size = bool_vector_size (arg);
+ for (ptrdiff_t i = 0; i < size; i++)
+ *dst++ = bool_vector_ref (arg, i);
+ }
+ else
+ {
+ eassert (COMPILEDP (arg));
+ ptrdiff_t size = PVSIZE (arg);
+ memcpy (dst, XVECTOR (arg)->contents, size * sizeof *dst);
+ dst += size;
}
}
- if (!NILP (prev))
- XSETCDR (prev, last_tail);
+ eassert (dst == XVECTOR (result)->contents + result_len);
return result;
}
@@ -1154,65 +1204,25 @@ string_byte_to_char (Lisp_Object string, ptrdiff_t byte_index)
return i;
}
-/* Convert STRING to a multibyte string. */
-
-static Lisp_Object
-string_make_multibyte (Lisp_Object string)
-{
- unsigned char *buf;
- ptrdiff_t nbytes;
- Lisp_Object ret;
- USE_SAFE_ALLOCA;
-
- if (STRING_MULTIBYTE (string))
- return string;
-
- nbytes = count_size_as_multibyte (SDATA (string),
- SCHARS (string));
- /* If all the chars are ASCII, they won't need any more bytes
- once converted. In that case, we can return STRING itself. */
- if (nbytes == SBYTES (string))
- return string;
-
- buf = SAFE_ALLOCA (nbytes);
- copy_text (SDATA (string), buf, SBYTES (string),
- 0, 1);
-
- ret = make_multibyte_string ((char *) buf, SCHARS (string), nbytes);
- SAFE_FREE ();
-
- return ret;
-}
-
-
/* Convert STRING (if unibyte) to a multibyte string without changing
- the number of characters. Characters 0200 through 0237 are
- converted to eight-bit characters. */
+ the number of characters. Characters 0x80..0xff are interpreted as
+ raw bytes. */
Lisp_Object
string_to_multibyte (Lisp_Object string)
{
- unsigned char *buf;
- ptrdiff_t nbytes;
- Lisp_Object ret;
- USE_SAFE_ALLOCA;
-
if (STRING_MULTIBYTE (string))
return string;
- nbytes = count_size_as_multibyte (SDATA (string), SBYTES (string));
+ ptrdiff_t nchars = SCHARS (string);
+ ptrdiff_t nbytes = count_size_as_multibyte (SDATA (string), nchars);
/* If all the chars are ASCII, they won't need any more bytes once
converted. */
- if (nbytes == SBYTES (string))
+ if (nbytes == nchars)
return make_multibyte_string (SSDATA (string), nbytes, nbytes);
- buf = SAFE_ALLOCA (nbytes);
- memcpy (buf, SDATA (string), SBYTES (string));
- str_to_multibyte (buf, nbytes, SBYTES (string));
-
- ret = make_multibyte_string ((char *) buf, SCHARS (string), nbytes);
- SAFE_FREE ();
-
+ Lisp_Object ret = make_uninit_multibyte_string (nchars, nbytes);
+ str_to_multibyte (SDATA (ret), SDATA (string), nchars);
return ret;
}
@@ -1257,7 +1267,17 @@ string the same way whether it is unibyte or multibyte.) */)
{
CHECK_STRING (string);
- return string_make_multibyte (string);
+ if (STRING_MULTIBYTE (string))
+ return string;
+
+ ptrdiff_t nchars = SCHARS (string);
+ ptrdiff_t nbytes = count_size_as_multibyte (SDATA (string), nchars);
+ if (nbytes == nchars)
+ return string;
+
+ Lisp_Object ret = make_uninit_multibyte_string (nchars, nbytes);
+ str_to_multibyte (SDATA (ret), SDATA (string), nchars);
+ return ret;
}
DEFUN ("string-make-unibyte", Fstring_make_unibyte, Sstring_make_unibyte,
@@ -1362,19 +1382,24 @@ an error is signaled. */)
(Lisp_Object string)
{
CHECK_STRING (string);
+ if (!STRING_MULTIBYTE (string))
+ return string;
- if (STRING_MULTIBYTE (string))
+ ptrdiff_t chars = SCHARS (string);
+ Lisp_Object ret = make_uninit_string (chars);
+ unsigned char *src = SDATA (string);
+ unsigned char *dst = SDATA (ret);
+ for (ptrdiff_t i = 0; i < chars; i++)
{
- ptrdiff_t chars = SCHARS (string);
- unsigned char *str = xmalloc (chars);
- ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars);
-
- if (converted < chars)
- error ("Can't convert the %"pD"dth character to unibyte", converted);
- string = make_unibyte_string ((char *) str, chars);
- xfree (str);
+ unsigned char b = *src++;
+ if (b <= 0x7f)
+ *dst++ = b; /* ASCII */
+ else if (CHAR_BYTE8_HEAD_P (b))
+ *dst++ = 0x80 | (b & 1) << 6 | (*src++ & 0x3f); /* raw byte */
+ else
+ error ("Cannot convert character at index %"pD"d to unibyte", i);
}
- return string;
+ return ret;
}
@@ -2950,6 +2975,9 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */)
specpdl_ref count = SPECPDL_INDEX ();
specbind (Qenable_recursive_minibuffers, Qt);
+ /* Preserve the actual command that eventually called `yes-or-no-p'
+ (otherwise `repeat' will be repeating `exit-minibuffer'). */
+ specbind (Qreal_this_command, Vreal_this_command);
while (1)
{
@@ -3073,7 +3101,7 @@ dynamic module files, in that order; but the function will not try to
load the file without any suffix. See `get-load-suffixes' for the
complete list of suffixes.
-To find the file, this function searches that directories in `load-path'.
+To find the file, this function searches the directories in `load-path'.
If the optional third argument NOERROR is non-nil, then, if
the file is not found, the function returns nil instead of signaling
@@ -6104,4 +6132,6 @@ The same variable also affects the function `read-answer'. */);
defsubr (&Sbuffer_hash);
defsubr (&Slocale_info);
defsubr (&Sbuffer_line_statistics);
+
+ DEFSYM (Qreal_this_command, "real-this-command");
}
diff --git a/src/frame.c b/src/frame.c
index 02c90ea6519..a39e1c4944f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1444,10 +1444,6 @@ affects all frames on the same terminal device. */)
If FRAME is a switch-frame event `(switch-frame FRAME1)', use
FRAME1 as frame.
- If TRACK is non-zero and the frame that currently has the focus
- redirects its focus to the selected frame, redirect that focused
- frame's focus to FRAME instead.
-
FOR_DELETION non-zero means that the selected frame is being
deleted, which includes the possibility that the frame's terminal
is dead.
@@ -1455,7 +1451,7 @@ affects all frames on the same terminal device. */)
The value of NORECORD is passed as argument to Fselect_window. */
Lisp_Object
-do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object norecord)
+do_switch_frame (Lisp_Object frame, int for_deletion, Lisp_Object norecord)
{
struct frame *sf = SELECTED_FRAME (), *f;
@@ -1477,59 +1473,6 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
else if (f == sf)
return frame;
- /* If a frame's focus has been redirected toward the currently
- selected frame, we should change the redirection to point to the
- newly selected frame. This means that if the focus is redirected
- from a minibufferless frame to a surrogate minibuffer frame, we
- can use `other-window' to switch between all the frames using
- that minibuffer frame, and the focus redirection will follow us
- around. */
-#if 0
- /* This is too greedy; it causes inappropriate focus redirection
- that's hard to get rid of. */
- if (track)
- {
- Lisp_Object tail;
-
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
- {
- Lisp_Object focus;
-
- if (!FRAMEP (XCAR (tail)))
- emacs_abort ();
-
- focus = FRAME_FOCUS_FRAME (XFRAME (XCAR (tail)));
-
- if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
- Fredirect_frame_focus (XCAR (tail), frame);
- }
- }
-#else /* ! 0 */
- /* Instead, apply it only to the frame we're pointing to. */
-#ifdef HAVE_WINDOW_SYSTEM
- if (track && FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->get_focus_frame)
- {
- Lisp_Object focus, gfocus;
-
- gfocus = FRAME_TERMINAL (f)->get_focus_frame (f);
- if (FRAMEP (gfocus))
- {
- focus = FRAME_FOCUS_FRAME (XFRAME (gfocus));
- if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
- /* Redirect frame focus also when FRAME has its minibuffer
- window on the selected frame (see Bug#24500).
-
- Don't do that: It causes redirection problem with a
- separate minibuffer frame (Bug#24803) and problems
- when updating the cursor on such frames.
- || (NILP (focus)
- && EQ (FRAME_MINIBUF_WINDOW (f), sf->selected_window))) */
- Fredirect_frame_focus (gfocus, frame);
- }
- }
-#endif /* HAVE_X_WINDOWS */
-#endif /* ! 0 */
-
if (!for_deletion && FRAME_HAS_MINIBUF_P (sf))
resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);
@@ -1627,7 +1570,7 @@ This function returns FRAME, or nil if FRAME has been deleted. */)
/* Do not select a tooltip frame (Bug#47207). */
error ("Cannot select a tooltip frame");
else
- return do_switch_frame (frame, 1, 0, norecord);
+ return do_switch_frame (frame, 0, norecord);
}
DEFUN ("handle-switch-frame", Fhandle_switch_frame,
@@ -1643,7 +1586,7 @@ necessarily represent user-visible input focus. */)
kset_prefix_arg (current_kboard, Vcurrent_prefix_arg);
run_hook (Qmouse_leave_buffer_hook);
- return do_switch_frame (event, 0, 0, Qnil);
+ return do_switch_frame (event, 0, Qnil);
}
DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
@@ -1990,6 +1933,9 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
int is_tooltip_frame;
bool nochild = !FRAME_PARENT_FRAME (f);
Lisp_Object minibuffer_child_frame = Qnil;
+#ifdef HAVE_X_WINDOWS
+ specpdl_ref ref;
+#endif
if (!FRAME_LIVE_P (f))
return Qnil;
@@ -2158,7 +2104,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
Fraise_frame (frame1);
#endif
- do_switch_frame (frame1, 0, 1, Qnil);
+ do_switch_frame (frame1, 1, Qnil);
sf = SELECTED_FRAME ();
}
else
@@ -2173,7 +2119,18 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
/* Clear any X selections for this frame. */
#ifdef HAVE_X_WINDOWS
if (FRAME_X_P (f))
- x_clear_frame_selections (f);
+ {
+ /* Don't preserve selections when a display is going away, since
+ that sends stuff down the wire. */
+
+ ref = SPECPDL_INDEX ();
+
+ if (EQ (force, Qnoelisp))
+ specbind (Qx_auto_preserve_selections, Qnil);
+
+ x_clear_frame_selections (f);
+ unbind_to (ref, Qnil);
+ }
#endif
#ifdef HAVE_PGTK
diff --git a/src/gtkutil.c b/src/gtkutil.c
index f2018bc01f5..a6bba096a43 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1887,7 +1887,9 @@ xg_free_frame_widgets (struct frame *f)
/* x_free_frame_resources should have taken care of it */
#ifndef HAVE_PGTK
+#ifdef HAVE_XDBE
eassert (!FRAME_X_DOUBLE_BUFFERED_P (f));
+#endif
g_object_unref (FRAME_X_OUTPUT (f)->im_context);
#endif
gtk_widget_destroy (FRAME_GTK_OUTER_WIDGET (f));
diff --git a/src/haiku_io.c b/src/haiku_io.c
index d3455276855..5cc70f6f71f 100644
--- a/src/haiku_io.c
+++ b/src/haiku_io.c
@@ -107,6 +107,8 @@ haiku_len (enum haiku_event_type type)
return sizeof (struct haiku_scroll_bar_part_event);
case SCREEN_CHANGED_EVENT:
return sizeof (struct haiku_screen_changed_event);
+ case CLIPBOARD_CHANGED_EVENT:
+ return sizeof (struct haiku_clipboard_changed_event);
}
emacs_abort ();
diff --git a/src/haiku_select.cc b/src/haiku_select.cc
index 80c5d294820..872da1d6c44 100644
--- a/src/haiku_select.cc
+++ b/src/haiku_select.cc
@@ -18,6 +18,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
+#include <Application.h>
#include <Clipboard.h>
#include <Message.h>
#include <Path.h>
@@ -47,6 +48,16 @@ static int64 count_primary = -1;
/* The number of times the secondary selection has changed. */
static int64 count_secondary = -1;
+/* Whether or not we currently think Emacs owns the primary
+ selection. */
+static bool owned_primary;
+
+/* Likewise for the secondary selection. */
+static bool owned_secondary;
+
+/* And the clipboard. */
+static bool owned_clipboard;
+
static BClipboard *
get_clipboard_object (enum haiku_clipboard clipboard)
{
@@ -150,14 +161,17 @@ be_update_clipboard_count (enum haiku_clipboard id)
{
case CLIPBOARD_CLIPBOARD:
count_clipboard = system_clipboard->SystemCount ();
+ owned_clipboard = true;
break;
case CLIPBOARD_PRIMARY:
count_primary = primary->SystemCount ();
+ owned_primary = true;
break;
case CLIPBOARD_SECONDARY:
count_secondary = secondary->SystemCount ();
+ owned_secondary = true;
break;
}
}
@@ -433,3 +447,73 @@ be_unlock_clipboard (enum haiku_clipboard clipboard, bool discard)
board->Unlock ();
}
+
+void
+be_handle_clipboard_changed_message (void)
+{
+ int64 n_clipboard, n_primary, n_secondary;
+
+ n_clipboard = system_clipboard->SystemCount ();
+ n_primary = primary->SystemCount ();
+ n_secondary = secondary->SystemCount ();
+
+ if (count_clipboard != -1
+ && (n_clipboard > count_clipboard + 1)
+ && owned_clipboard)
+ {
+ owned_clipboard = false;
+ haiku_selection_disowned (CLIPBOARD_CLIPBOARD,
+ n_clipboard);
+ }
+
+ if (count_primary != -1
+ && (n_primary > count_primary + 1)
+ && owned_primary)
+ {
+ owned_primary = false;
+ haiku_selection_disowned (CLIPBOARD_PRIMARY,
+ n_primary);
+ }
+
+ if (count_secondary != -1
+ && (n_secondary > count_secondary + 1)
+ && owned_secondary)
+ {
+ owned_secondary = false;
+ haiku_selection_disowned (CLIPBOARD_SECONDARY,
+ n_secondary);
+ }
+}
+
+void
+be_start_watching_selection (enum haiku_clipboard id)
+{
+ BClipboard *clipboard;
+
+ clipboard = get_clipboard_object (id);
+ clipboard->StartWatching (be_app);
+}
+
+bool
+be_selection_outdated_p (enum haiku_clipboard id, int64 count)
+{
+ if (id == CLIPBOARD_CLIPBOARD && count_clipboard > count)
+ return true;
+
+ if (id == CLIPBOARD_PRIMARY && count_primary > count)
+ return true;
+
+ if (id == CLIPBOARD_SECONDARY && count_secondary > count)
+ return true;
+
+ return false;
+}
+
+int64
+be_get_clipboard_count (enum haiku_clipboard id)
+{
+ BClipboard *clipboard;
+
+ clipboard = get_clipboard_object (id);
+ return clipboard->SystemCount ();
+}
diff --git a/src/haiku_support.cc b/src/haiku_support.cc
index 7819cef5683..1f7f372a9b4 100644
--- a/src/haiku_support.cc
+++ b/src/haiku_support.cc
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <app/Application.h>
#include <app/Cursor.h>
+#include <app/Clipboard.h>
#include <app/Messenger.h>
#include <app/Roster.h>
@@ -141,7 +142,7 @@ enum
struct font_selection_dialog_message
{
- /* Whether or not font selection was cancelled. */
+ /* Whether or not font selection was canceled. */
bool_bf cancel : 1;
/* Whether or not a size was explicitly specified. */
@@ -648,8 +649,12 @@ public:
void
MessageReceived (BMessage *msg)
{
+ struct haiku_clipboard_changed_event rq;
+
if (msg->what == QUIT_APPLICATION)
Quit ();
+ else if (msg->what == B_CLIPBOARD_CHANGED)
+ haiku_write (CLIPBOARD_CHANGED_EVENT, &rq);
else
BApplication::MessageReceived (msg);
}
@@ -1512,7 +1517,6 @@ public:
BLocker cr_surface_lock;
#endif
- BPoint tt_absl_pos;
BMessage *wait_for_release_message;
EmacsView () : BView (BRect (0, 0, 0, 0), "Emacs",
@@ -1792,12 +1796,14 @@ public:
struct haiku_mouse_motion_event rq;
int32 windowid;
EmacsWindow *window;
- BToolTip *tooltip;
window = (EmacsWindow *) Window ();
- tooltip = ToolTip ();
- rq.just_exited_p = transit == B_EXITED_VIEW;
+ if (transit == B_EXITED_VIEW)
+ rq.just_exited_p = true;
+ else
+ rq.just_exited_p = false;
+
rq.x = point.x;
rq.y = point.y;
rq.window = window;
@@ -1811,10 +1817,6 @@ public:
else
rq.dnd_message = false;
- if (tooltip)
- tooltip->SetMouseRelativeLocation (BPoint (-(point.x - tt_absl_pos.x),
- -(point.y - tt_absl_pos.y)));
-
if (!grab_view_locker.Lock ())
gui_abort ("Couldn't lock grab view locker");
@@ -3266,6 +3268,41 @@ public:
}
};
+/* A view that is added as a child of a tooltip's text view, and
+ prevents motion events from reaching it (thereby moving the
+ tooltip). */
+class EmacsMotionSuppressionView : public BView
+{
+ void
+ AttachedToWindow (void)
+ {
+ BView *text_view, *tooltip_view;
+
+ /* We know that this view is a child of the text view, whose
+ parent is the tooltip view, and that the tooltip view has
+ already set its mouse event mask. */
+
+ text_view = Parent ();
+
+ if (!text_view)
+ return;
+
+ tooltip_view = text_view->Parent ();
+
+ if (!tooltip_view)
+ return;
+
+ tooltip_view->SetEventMask (B_KEYBOARD_EVENTS, 0);
+ }
+
+public:
+ EmacsMotionSuppressionView (void) : BView (BRect (-1, -1, 1, 1),
+ NULL, 0, 0)
+ {
+ return;
+ }
+};
+
static int32
start_running_application (void *data)
{
@@ -4304,30 +4341,48 @@ BView_set_tooltip (void *view, const char *tooltip)
/* Set VIEW's tooltip to a sticky tooltip at X by Y. */
void
-BView_set_and_show_sticky_tooltip (void *view, const char *tooltip,
- int x, int y)
+be_show_sticky_tooltip (void *view, const char *tooltip_text,
+ int x, int y)
{
- BToolTip *tip;
- BView *vw = (BView *) view;
+ BToolTip *tooltip;
+ BView *vw, *tooltip_view;
+ BPoint point;
+
+ vw = (BView *) view;
+
if (!vw->LockLooper ())
gui_abort ("Failed to lock view while showing sticky tooltip");
- vw->SetToolTip (tooltip);
- tip = vw->ToolTip ();
- BPoint pt;
- EmacsView *ev = dynamic_cast<EmacsView *> (vw);
- if (ev)
- ev->tt_absl_pos = BPoint (x, y);
- vw->GetMouse (&pt, NULL, 1);
- pt.x -= x;
- pt.y -= y;
+ vw->SetToolTip ((const char *) NULL);
+
+ /* If the tooltip text is empty, then a tooltip object won't be
+ created by SetToolTip. */
+ if (tooltip_text[0] == '\0')
+ tooltip_text = " ";
+
+ vw->SetToolTip (tooltip_text);
+
+ tooltip = vw->ToolTip ();
+
+ vw->GetMouse (&point, NULL, 1);
+ point.x -= x;
+ point.y -= y;
+
+ point.x = -point.x;
+ point.y = -point.y;
+
+ /* We don't have to make the tooltip sticky since not receiving
+ mouse movement is enough to prevent it from being hidden. */
+ tooltip->SetMouseRelativeLocation (point);
+
+ /* Prevent the tooltip from moving in response to mouse
+ movement. */
+ tooltip_view = tooltip->View ();
- pt.x = -pt.x;
- pt.y = -pt.y;
+ if (tooltip_view)
+ tooltip_view->AddChild (new EmacsMotionSuppressionView);
- tip->SetMouseRelativeLocation (pt);
- tip->SetSticky (1);
- vw->ShowToolTip (tip);
+ vw->ShowToolTip (tooltip);
vw->UnlockLooper ();
}
diff --git a/src/haiku_support.h b/src/haiku_support.h
index 6260b35cbc1..5577d2f151f 100644
--- a/src/haiku_support.h
+++ b/src/haiku_support.h
@@ -114,8 +114,14 @@ enum haiku_event_type
DUMMY_EVENT,
SCREEN_CHANGED_EVENT,
MENU_BAR_LEFT,
+ CLIPBOARD_CHANGED_EVENT,
};
+struct haiku_clipboard_changed_event
+{
+ char dummy;
+};
+
struct haiku_screen_changed_event
{
bigtime_t when;
@@ -392,7 +398,7 @@ struct haiku_font_pattern
/* Temporary field used during font enumeration. */
int oblique_seen_p;
- /* Whether or not to enable antialising in the font. This field is
+ /* Whether or not to enable antialiasing in the font. This field is
special in that it's not handled by `BFont_open_pattern'. */
int use_antialiasing;
};
@@ -642,8 +648,7 @@ extern int32 BAlert_go (void *, void (*) (void), void (*) (void),
extern void BButton_set_enabled (void *, int);
extern void BView_set_tooltip (void *, const char *);
extern void BView_show_tooltip (void *);
-extern void BView_set_and_show_sticky_tooltip (void *, const char *,
- int, int);
+extern void be_show_sticky_tooltip (void *, const char *, int, int);
extern void BAlert_delete (void *);
diff --git a/src/haikufns.c b/src/haikufns.c
index b79443203ff..e0a65b499f4 100644
--- a/src/haikufns.c
+++ b/src/haikufns.c
@@ -1290,16 +1290,17 @@ compute_tip_xy (struct frame *f,
static Lisp_Object
haiku_hide_tip (bool delete)
{
+ Lisp_Object it, frame;
+
if (!NILP (tip_timer))
{
call1 (Qcancel_timer, tip_timer);
tip_timer = Qnil;
}
- Lisp_Object it, frame;
FOR_EACH_FRAME (it, frame)
- if (FRAME_WINDOW_P (XFRAME (frame)) &&
- FRAME_HAIKU_VIEW (XFRAME (frame)))
+ if (FRAME_WINDOW_P (XFRAME (frame))
+ && FRAME_HAIKU_VIEW (XFRAME (frame)))
BView_set_tooltip (FRAME_HAIKU_VIEW (XFRAME (frame)), NULL);
if (NILP (tip_frame)
@@ -2391,8 +2392,8 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
reliable way to get it. */
compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
BView_convert_from_screen (FRAME_HAIKU_VIEW (f), &root_x, &root_y);
- BView_set_and_show_sticky_tooltip (FRAME_HAIKU_VIEW (f), SSDATA (string),
- root_x, root_y);
+ be_show_sticky_tooltip (FRAME_HAIKU_VIEW (f), SSDATA (string),
+ root_x, root_y);
unblock_input ();
goto start_timer;
}
diff --git a/src/haikumenu.c b/src/haikumenu.c
index 5729bed4a9b..929ed952105 100644
--- a/src/haikumenu.c
+++ b/src/haikumenu.c
@@ -422,11 +422,13 @@ haiku_menu_show (struct frame *f, int x, int y, int menuflags,
BView_convert_to_screen (view, &x, &y);
unblock_input ();
+ unrequest_sigio ();
popup_activated_p++;
menu_item_selection = BMenu_run (menu, x, y, haiku_menu_show_help,
block_input, unblock_input,
haiku_process_pending_signals_for_menu, NULL);
popup_activated_p--;
+ request_sigio ();
FRAME_DISPLAY_INFO (f)->grabbed = 0;
@@ -627,8 +629,6 @@ set_frame_menubar (struct frame *f, bool deep_p)
/* If it has changed current-menubar from previous value,
really recompute the menubar from the value. */
- if (! NILP (Vlucid_menu_bar_dirty_flag))
- call0 (Qrecompute_lucid_menubar);
safe_run_hooks (Qmenu_bar_update_hook);
fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
diff --git a/src/haikuselect.c b/src/haikuselect.c
index fe76e09810c..dc0a7edf430 100644
--- a/src/haikuselect.c
+++ b/src/haikuselect.c
@@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "haikuselect.h"
#include "haikuterm.h"
#include "haiku_support.h"
+#include "keyboard.h"
#include <stdlib.h>
@@ -53,6 +54,23 @@ haiku_get_clipboard_name (Lisp_Object clipboard)
signal_error ("Invalid clipboard", clipboard);
}
+DEFUN ("haiku-selection-timestamp", Fhaiku_selection_timestamp,
+ Shaiku_selection_timestamp, 1, 1, 0,
+ doc: /* Retrieve the "timestamp" of the clipboard CLIPBOARD.
+CLIPBOARD can either be the symbol `PRIMARY', `SECONDARY' or
+`CLIPBOARD'. The timestamp is returned as a number describing the
+number of times programs have put data into CLIPBOARD. */)
+ (Lisp_Object clipboard)
+{
+ enum haiku_clipboard clipboard_name;
+ int64 timestamp;
+
+ clipboard_name = haiku_get_clipboard_name (clipboard);
+ timestamp = be_get_clipboard_count (clipboard_name);
+
+ return INT_TO_INTEGER (timestamp);
+}
+
DEFUN ("haiku-selection-data", Fhaiku_selection_data, Shaiku_selection_data,
2, 2, 0,
doc: /* Retrieve content typed as NAME from the clipboard
@@ -1021,6 +1039,59 @@ init_haiku_select (void)
}
void
+haiku_handle_selection_clear (struct input_event *ie)
+{
+ enum haiku_clipboard id;
+
+ id = haiku_get_clipboard_name (ie->arg);
+
+ if (be_selection_outdated_p (id, ie->timestamp))
+ return;
+
+ CALLN (Frun_hook_with_args,
+ Qhaiku_lost_selection_functions, ie->arg);
+
+ /* This is required for redisplay to happen if something changed the
+ display inside the selection loss functions. */
+ redisplay_preserve_echo_area (20);
+}
+
+void
+haiku_selection_disowned (enum haiku_clipboard id, int64 count)
+{
+ struct input_event ie;
+
+ EVENT_INIT (ie);
+ ie.kind = SELECTION_CLEAR_EVENT;
+
+ switch (id)
+ {
+ case CLIPBOARD_CLIPBOARD:
+ ie.arg = QCLIPBOARD;
+ break;
+
+ case CLIPBOARD_PRIMARY:
+ ie.arg = QPRIMARY;
+ break;
+
+ case CLIPBOARD_SECONDARY:
+ ie.arg = QSECONDARY;
+ break;
+ }
+
+ ie.timestamp = count;
+ kbd_buffer_store_event (&ie);
+}
+
+void
+haiku_start_watching_selections (void)
+{
+ be_start_watching_selection (CLIPBOARD_CLIPBOARD);
+ be_start_watching_selection (CLIPBOARD_PRIMARY);
+ be_start_watching_selection (CLIPBOARD_SECONDARY);
+}
+
+void
syms_of_haikuselect (void)
{
DEFVAR_BOOL ("haiku-signal-invalid-refs", haiku_signal_invalid_refs,
@@ -1035,12 +1106,21 @@ The function is called without any arguments. `mouse-position' can be
used to retrieve the current position of the mouse. */);
Vhaiku_drag_track_function = Qnil;
+ DEFVAR_LISP ("haiku-lost-selection-functions", Vhaiku_lost_selection_functions,
+ doc: /* A list of functions to be called when Emacs loses an X selection.
+These are only called if a connection to the Haiku display was opened. */);
+ Vhaiku_lost_selection_functions = Qnil;
+
DEFSYM (QSECONDARY, "SECONDARY");
DEFSYM (QCLIPBOARD, "CLIPBOARD");
DEFSYM (QSTRING, "STRING");
DEFSYM (QUTF8_STRING, "UTF8_STRING");
DEFSYM (Qforeign_selection, "foreign-selection");
DEFSYM (QTARGETS, "TARGETS");
+
+ DEFSYM (Qhaiku_lost_selection_functions,
+ "haiku-lost-selection-functions");
+
DEFSYM (Qmessage, "message");
DEFSYM (Qstring, "string");
DEFSYM (Qref, "ref");
@@ -1059,6 +1139,7 @@ used to retrieve the current position of the mouse. */);
DEFSYM (Qalready_running, "already-running");
defsubr (&Shaiku_selection_data);
+ defsubr (&Shaiku_selection_timestamp);
defsubr (&Shaiku_selection_put);
defsubr (&Shaiku_selection_owner_p);
defsubr (&Shaiku_drag_message);
diff --git a/src/haikuselect.h b/src/haikuselect.h
index ac8e0698952..42e9c93f7e9 100644
--- a/src/haikuselect.h
+++ b/src/haikuselect.h
@@ -38,7 +38,10 @@ enum haiku_clipboard
extern "C"
{
#endif
+/* Defined in haikuselect.c. */
+extern void haiku_selection_disowned (enum haiku_clipboard, int64);
+/* Defined in haiku_select.cc. */
extern void be_clipboard_init (void);
extern char *be_find_clipboard_data (enum haiku_clipboard, const char *, ssize_t *);
extern void be_set_clipboard_data (enum haiku_clipboard, const char *, const char *,
@@ -61,6 +64,10 @@ extern int be_add_point_data (void *, const char *, float, float);
extern int be_add_message_message (void *, const char *, void *);
extern int be_lock_clipboard_message (enum haiku_clipboard, void **, bool);
extern void be_unlock_clipboard (enum haiku_clipboard, bool);
+extern void be_handle_clipboard_changed_message (void);
+extern void be_start_watching_selection (enum haiku_clipboard);
+extern bool be_selection_outdated_p (enum haiku_clipboard, int64);
+extern int64 be_get_clipboard_count (enum haiku_clipboard);
#ifdef __cplusplus
};
diff --git a/src/haikuterm.c b/src/haikuterm.c
index 9f8aceae642..bcb3af0e2c3 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -32,6 +32,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "haiku_support.h"
#include "thread.h"
#include "window.h"
+#include "haikuselect.h"
#include <math.h>
#include <stdlib.h>
@@ -3202,6 +3203,11 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
FRAME_PIXEL_HEIGHT (f) = height;
haiku_clear_under_internal_border (f);
+
+ /* Flush the frame and flip buffers here. It is
+ necessary for tooltips displayed inside menus, as
+ redisplay cannot happen. */
+ haiku_flush (f);
continue;
}
@@ -4005,6 +4011,9 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
inev.timestamp = b->when / 1000;
break;
}
+ case CLIPBOARD_CHANGED_EVENT:
+ be_handle_clipboard_changed_message ();
+ break;
case APP_QUIT_REQUESTED_EVENT:
inev.kind = SAVE_SESSION_EVENT;
inev.arg = Qt;
@@ -4398,6 +4407,7 @@ haiku_term_init (void)
else
dpyinfo->default_name = build_string ("GNU Emacs");
+ haiku_start_watching_selections ();
unblock_input ();
return dpyinfo;
@@ -4438,6 +4448,7 @@ haiku_clear_under_internal_border (struct frame *f)
: INTERNAL_BORDER_FACE_ID));
struct face *face = FACE_FROM_ID_OR_NULL (f, face_id);
void *view = FRAME_HAIKU_VIEW (f);
+
block_input ();
BView_draw_lock (view, true, 0, 0, FRAME_PIXEL_WIDTH (f),
FRAME_PIXEL_HEIGHT (f));
diff --git a/src/haikuterm.h b/src/haikuterm.h
index ea20289b5d1..46a2218e492 100644
--- a/src/haikuterm.h
+++ b/src/haikuterm.h
@@ -357,4 +357,6 @@ extern void haiku_end_cr_clip (cairo_t *);
extern void haiku_merge_cursor_foreground (struct glyph_string *, unsigned long *,
unsigned long *);
+extern void haiku_handle_selection_clear (struct input_event *);
+extern void haiku_start_watching_selections (void);
#endif /* _HAIKU_TERM_H_ */
diff --git a/src/image.c b/src/image.c
index c0a7b85cb3b..f5004c2c4c7 100644
--- a/src/image.c
+++ b/src/image.c
@@ -186,6 +186,10 @@ static void free_color_table (void);
static unsigned long *colors_in_color_table (int *n);
#endif
+#if defined (HAVE_WEBP) || defined (HAVE_GIF)
+static void anim_prune_animation_cache (Lisp_Object);
+#endif
+
#ifdef USE_CAIRO
static Emacs_Pix_Container
@@ -1071,9 +1075,16 @@ struct image_type
libraries on Windows), or NULL if none. */
bool (*init) (void);
/* An initializer for the init field. */
-# define IMAGE_TYPE_INIT(f) f
-#else
-# define IMAGE_TYPE_INIT(f)
+#endif
+#if defined HAVE_RSVG || defined HAVE_PNG || defined HAVE_GIF || \
+ defined HAVE_TIFF || defined HAVE_JPEG || defined HAVE_XPM || \
+ defined HAVE_NS || defined HAVE_HAIKU || defined HAVE_PGTK || \
+ defined HAVE_WEBP
+# ifdef WINDOWSNT
+# define IMAGE_TYPE_INIT(f) f
+# else
+# define IMAGE_TYPE_INIT(f)
+# endif
#endif
};
@@ -2120,19 +2131,35 @@ clear_image_caches (Lisp_Object filter)
}
DEFUN ("clear-image-cache", Fclear_image_cache, Sclear_image_cache,
- 0, 1, 0,
+ 0, 2, 0,
doc: /* Clear the image cache.
FILTER nil or a frame means clear all images in the selected frame.
FILTER t means clear the image caches of all frames.
Anything else means clear only those images that refer to FILTER,
-which is then usually a filename. */)
- (Lisp_Object filter)
+which is then usually a filename.
+
+This function also clears the image animation cache. If
+ANIMATION-CACHE is non-nil, only the image spec `eq' with
+ANIMATION-CACHE is removed, and other image cache entries are not
+evicted. */)
+ (Lisp_Object filter, Lisp_Object animation_cache)
{
+ if (!NILP (animation_cache))
+ {
+#if defined (HAVE_WEBP) || defined (HAVE_GIF)
+ anim_prune_animation_cache (XCDR (animation_cache));
+#endif
+ return Qnil;
+ }
+
if (! (NILP (filter) || FRAMEP (filter)))
clear_image_caches (filter);
else
clear_image_cache (decode_window_system_frame (filter), Qt);
+ /* Also clear the animation caches. */
+ image_prune_animation_caches (true);
+
return Qnil;
}
@@ -2200,21 +2227,6 @@ image_frame_cache_size (struct frame *f)
return total;
}
-DEFUN ("image-cache-size", Fimage_cache_size, Simage_cache_size, 0, 0, 0,
- doc: /* Return the size of the image cache. */)
- (void)
-{
- Lisp_Object tail, frame;
- size_t total = 0;
-
- FOR_EACH_FRAME (tail, frame)
- if (FRAME_WINDOW_P (XFRAME (frame)))
- total += image_frame_cache_size (XFRAME (frame));
-
- return make_int (total);
-}
-
-
DEFUN ("image-flush", Fimage_flush, Simage_flush,
1, 2, 0,
doc: /* Flush the image with specification SPEC on frame FRAME.
@@ -3027,6 +3039,11 @@ struct anim_cache
/* A function to call to free the handle. */
void (*destructor) (void *);
int index, width, height, frames;
+ /* This is used to be able to say something about the cache size.
+ We don't actually know how much memory the different libraries
+ actually use here (since these cache structures are opaque), so
+ this is mostly just the size of the original image file. */
+ int byte_size;
struct timespec update_time;
struct anim_cache *next;
};
@@ -3043,12 +3060,16 @@ anim_create_cache (Lisp_Object spec)
cache->index = -1;
cache->next = NULL;
cache->spec = spec;
+ cache->byte_size = 0;
return cache;
}
-/* Discard cached images that haven't been used for a minute. */
+/* Discard cached images that haven't been used for a minute. If
+ CLEAR is t, remove all animation cache entries. If CLEAR is
+ anything other than nil or t, only remove the entries that have a
+ spec `eq' to CLEAR. */
static void
-anim_prune_animation_cache (void)
+anim_prune_animation_cache (Lisp_Object clear)
{
struct anim_cache **pcache = &anim_cache;
struct timespec old = timespec_sub (current_timespec (),
@@ -3057,9 +3078,9 @@ anim_prune_animation_cache (void)
while (*pcache)
{
struct anim_cache *cache = *pcache;
- if (timespec_cmp (old, cache->update_time) <= 0)
- pcache = &cache->next;
- else
+ if (EQ (clear, Qt)
+ || (EQ (clear, Qnil) && timespec_cmp (old, cache->update_time) > 0)
+ || EQ (clear, cache->spec))
{
if (cache->handle)
cache->destructor (cache);
@@ -3068,6 +3089,8 @@ anim_prune_animation_cache (void)
*pcache = cache->next;
xfree (cache);
}
+ else
+ pcache = &cache->next;
}
}
@@ -3077,7 +3100,7 @@ anim_get_animation_cache (Lisp_Object spec)
struct anim_cache *cache;
struct anim_cache **pcache = &anim_cache;
- anim_prune_animation_cache ();
+ anim_prune_animation_cache (Qnil);
while (1)
{
@@ -9011,13 +9034,14 @@ gif_load (struct frame *f, struct image *img)
struct anim_cache* cache = NULL;
/* Which sub-image are we to display? */
Lisp_Object image_number = image_spec_value (img->spec, QCindex, NULL);
+ int byte_size = 0;
idx = FIXNUMP (image_number) ? XFIXNAT (image_number) : 0;
if (!NILP (image_number))
{
/* If this is an animated image, create a cache for it. */
- cache = anim_get_animation_cache (img->spec);
+ cache = anim_get_animation_cache (XCDR (img->spec));
/* We have an old cache entry, so use it. */
if (cache->handle)
{
@@ -9064,6 +9088,14 @@ gif_load (struct frame *f, struct image *img)
image_error ("Cannot open `%s'", file);
return false;
}
+
+ /* Get the file size so that we can report it in
+ `image-cache-size'. */
+ struct stat st;
+ FILE *fp = fopen (SSDATA (encoded_file), "rb");
+ if (fstat (fileno (fp), &st) == 0)
+ byte_size = st.st_size;
+ fclose (fp);
}
else
{
@@ -9078,6 +9110,7 @@ gif_load (struct frame *f, struct image *img)
memsrc.bytes = SDATA (specified_data);
memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
+ byte_size = memsrc.len;
#if GIFLIB_MAJOR < 5
gif = DGifOpen (&memsrc, gif_read_from_memory);
@@ -9172,6 +9205,7 @@ gif_load (struct frame *f, struct image *img)
cache->destructor = (void (*)(void *)) &gif_destroy;
cache->width = width;
cache->height = height;
+ cache->byte_size = byte_size;
}
img->corners[TOP_CORNER] = gif->SavedImages[0].ImageDesc.Top;
@@ -9709,7 +9743,7 @@ webp_load (struct frame *f, struct image *img)
/* Animated image. */
int timestamp;
- struct anim_cache* cache = anim_get_animation_cache (img->spec);
+ struct anim_cache* cache = anim_get_animation_cache (XCDR (img->spec));
/* Get the next frame from the animation cache. */
if (cache->handle && cache->index == idx - 1)
{
@@ -9743,6 +9777,9 @@ webp_load (struct frame *f, struct image *img)
purge the anim cache. */
webp_data.size = size;
+ /* This is used just for reporting by `image-cache-size'. */
+ cache->byte_size = size;
+
/* Get the width/height of the total image. */
WebPDemuxer* demux = WebPDemux (&webp_data);
cache->width = width = WebPDemuxGetI (demux, WEBP_FF_CANVAS_WIDTH);
@@ -10082,9 +10119,10 @@ imagemagick_create_cache (char *signature)
return cache;
}
-/* Discard cached images that haven't been used for a minute. */
+/* Discard cached images that haven't been used for a minute. If
+ CLEAR, discard all cached animated images. */
static void
-imagemagick_prune_animation_cache (void)
+imagemagick_prune_animation_cache (bool clear)
{
struct animation_cache **pcache = &animation_cache;
struct timespec old = timespec_sub (current_timespec (),
@@ -10093,15 +10131,15 @@ imagemagick_prune_animation_cache (void)
while (*pcache)
{
struct animation_cache *cache = *pcache;
- if (timespec_cmp (old, cache->update_time) <= 0)
- pcache = &cache->next;
- else
+ if (clear || timespec_cmp (old, cache->update_time) > 0)
{
if (cache->wand)
DestroyMagickWand (cache->wand);
*pcache = cache->next;
xfree (cache);
}
+ else
+ pcache = &cache->next;
}
}
@@ -10112,7 +10150,7 @@ imagemagick_get_animation_cache (MagickWand *wand)
struct animation_cache *cache;
struct animation_cache **pcache = &animation_cache;
- imagemagick_prune_animation_cache ();
+ imagemagick_prune_animation_cache (false);
while (1)
{
@@ -11842,6 +11880,30 @@ The list of capabilities can include one or more of the following:
return Qnil;
}
+DEFUN ("image-cache-size", Fimage_cache_size, Simage_cache_size, 0, 0, 0,
+ doc: /* Return the size of the image cache. */)
+ (void)
+{
+ Lisp_Object tail, frame;
+ size_t total = 0;
+
+ FOR_EACH_FRAME (tail, frame)
+ if (FRAME_WINDOW_P (XFRAME (frame)))
+ total += image_frame_cache_size (XFRAME (frame));
+
+#if defined (HAVE_WEBP) || defined (HAVE_GIF)
+ struct anim_cache *pcache = anim_cache;
+ while (pcache)
+ {
+ total += pcache->byte_size;
+ pcache = pcache->next;
+ }
+#endif
+
+ return make_int (total);
+}
+
+
DEFUN ("init-image-library", Finit_image_library, Sinit_image_library, 1, 1, 0,
doc: /* Initialize image library implementing image type TYPE.
Return t if TYPE is a supported image type.
@@ -11951,6 +12013,18 @@ lookup_image_type (Lisp_Object type)
return NULL;
}
+/* Prune the animation caches. If CLEAR, remove all animation cache
+ entries. */
+void
+image_prune_animation_caches (bool clear)
+{
+#if defined (HAVE_WEBP) || defined (HAVE_GIF)
+ anim_prune_animation_cache (clear? Qt: Qnil);
+#endif
+#ifdef HAVE_IMAGEMAGICK
+ imagemagick_prune_animation_cache (clear);
+#endif
+}
void
syms_of_image (void)
diff --git a/src/json.c b/src/json.c
index 763f463aa4e..9a455f507b4 100644
--- a/src/json.c
+++ b/src/json.c
@@ -975,7 +975,7 @@ usage: (json-parse-string STRING &rest ARGS) */)
json_error_t error;
json_t *object
- = json_loads (SSDATA (encoded), JSON_DECODE_ANY, &error);
+ = json_loads (SSDATA (encoded), JSON_DECODE_ANY | JSON_ALLOW_NUL, &error);
if (object == NULL)
json_parse_error (&error);
@@ -1071,7 +1071,9 @@ usage: (json-parse-buffer &rest args) */)
json_error_t error;
json_t *object
= json_load_callback (json_read_buffer_callback, &data,
- JSON_DECODE_ANY | JSON_DISABLE_EOF_CHECK,
+ JSON_DECODE_ANY
+ | JSON_DISABLE_EOF_CHECK
+ | JSON_ALLOW_NUL,
&error);
if (object == NULL)
diff --git a/src/keyboard.c b/src/keyboard.c
index 8b8d348c41a..2863058d633 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1305,9 +1305,6 @@ command_loop_1 (void)
/* If there are warnings waiting, process them. */
if (!NILP (Vdelayed_warnings_list))
safe_run_hooks (Qdelayed_warnings_hook);
-
- if (!NILP (Vdeferred_action_list))
- safe_run_hooks (Qdeferred_action_function);
}
/* Do this after running Vpost_command_hook, for consistency. */
@@ -1374,12 +1371,6 @@ command_loop_1 (void)
}
}
- /* If it has changed current-menubar from previous value,
- really recompute the menubar from the value. */
- if (! NILP (Vlucid_menu_bar_dirty_flag)
- && !NILP (Ffboundp (Qrecompute_lucid_menubar)))
- call0 (Qrecompute_lucid_menubar);
-
Vthis_command = Qnil;
Vreal_this_command = Qnil;
Vthis_original_command = Qnil;
@@ -1537,8 +1528,6 @@ command_loop_1 (void)
if (!NILP (Vdelayed_warnings_list))
safe_run_hooks (Qdelayed_warnings_hook);
- safe_run_hooks (Qdeferred_action_function);
-
kset_last_command (current_kboard, Vthis_command);
kset_real_last_command (current_kboard, Vreal_this_command);
if (!CONSP (last_command_event))
@@ -1595,9 +1584,12 @@ command_loop_1 (void)
{
Lisp_Object txt
= call1 (Vregion_extract_function, Qnil);
+
if (XFIXNUM (Flength (txt)) > 0)
/* Don't set empty selections. */
call2 (Qgui_set_selection, QPRIMARY, txt);
+
+ CALLN (Frun_hook_with_args, Qpost_select_region_hook, txt);
}
if (current_buffer != prev_buffer || MODIFF != prev_modiff)
@@ -4012,6 +4004,7 @@ kbd_buffer_get_event (KBOARD **kbp,
We return nil for them. */
switch (event->kind)
{
+#ifndef HAVE_HAIKU
case SELECTION_REQUEST_EVENT:
case SELECTION_CLEAR_EVENT:
{
@@ -4035,52 +4028,19 @@ kbd_buffer_get_event (KBOARD **kbp,
#endif
}
break;
+#else
+ case SELECTION_REQUEST_EVENT:
+ emacs_abort ();
-#ifdef HAVE_X_WINDOWS
- case UNSUPPORTED_DROP_EVENT:
+ case SELECTION_CLEAR_EVENT:
{
- struct frame *f;
+ struct input_event copy = event->ie;
kbd_fetch_ptr = next_kbd_event (event);
input_pending = readable_events (0);
-
- /* This means this event was already handled in
- `x_dnd_begin_drag_and_drop'. */
- if (event->ie.modifiers < x_dnd_unsupported_event_level)
- break;
-
- f = XFRAME (event->ie.frame_or_window);
-
- if (!FRAME_LIVE_P (f))
- break;
-
- if (!NILP (Vx_dnd_unsupported_drop_function))
- {
- if (!NILP (call8 (Vx_dnd_unsupported_drop_function,
- XCAR (XCDR (event->ie.arg)), event->ie.x,
- event->ie.y, XCAR (XCDR (XCDR (event->ie.arg))),
- make_uint (event->ie.code),
- event->ie.frame_or_window,
- make_int (event->ie.timestamp),
- Fcopy_sequence (XCAR (event->ie.arg)))))
- break;
- }
-
- /* `x-dnd-unsupported-drop-function' could have deleted the
- event frame. */
- if (!FRAME_LIVE_P (f))
- break;
-
- x_dnd_do_unsupported_drop (FRAME_DISPLAY_INFO (f),
- event->ie.frame_or_window,
- XCAR (event->ie.arg),
- XCAR (XCDR (event->ie.arg)),
- (Window) event->ie.code,
- XFIXNUM (event->ie.x),
- XFIXNUM (event->ie.y),
- event->ie.timestamp);
- break;
+ haiku_handle_selection_clear (&copy);
}
+ break;
#endif
case MONITORS_CHANGED_EVENT:
@@ -4392,8 +4352,18 @@ kbd_buffer_get_event (KBOARD **kbp,
static void
process_special_events (void)
{
- for (union buffered_input_event *event = kbd_fetch_ptr;
- event != kbd_store_ptr; event = next_kbd_event (event))
+ union buffered_input_event *event;
+#if defined HAVE_X11 || defined HAVE_PGTK || defined HAVE_HAIKU
+#ifndef HAVE_HAIKU
+ struct selection_input_event copy;
+#else
+ struct input_event copy;
+#endif
+ int moved_events;
+#endif
+
+ for (event = kbd_fetch_ptr; event != kbd_store_ptr;
+ event = next_kbd_event (event))
{
/* If we find a stored X selection request, handle it now. */
if (event->kind == SELECTION_REQUEST_EVENT
@@ -4407,8 +4377,7 @@ process_special_events (void)
between kbd_fetch_ptr and EVENT one slot to the right,
cyclically. */
- struct selection_input_event copy = event->sie;
- int moved_events;
+ copy = event->sie;
if (event < kbd_fetch_ptr)
{
@@ -4430,6 +4399,27 @@ process_special_events (void)
#else
pgtk_handle_selection_event (&copy);
#endif
+#elif defined HAVE_HAIKU
+ if (event->ie.kind != SELECTION_CLEAR_EVENT)
+ emacs_abort ();
+
+ copy = event->ie;
+
+ if (event < kbd_fetch_ptr)
+ {
+ memmove (kbd_buffer + 1, kbd_buffer,
+ (event - kbd_buffer) * sizeof *kbd_buffer);
+ kbd_buffer[0] = kbd_buffer[KBD_BUFFER_SIZE - 1];
+ moved_events = kbd_buffer + KBD_BUFFER_SIZE - 1 - kbd_fetch_ptr;
+ }
+ else
+ moved_events = event - kbd_fetch_ptr;
+
+ memmove (kbd_fetch_ptr + 1, kbd_fetch_ptr,
+ moved_events * sizeof *kbd_fetch_ptr);
+ kbd_fetch_ptr = next_kbd_event (kbd_fetch_ptr);
+ input_pending = readable_events (0);
+ haiku_handle_selection_clear (&copy);
#else
/* We're getting selection request events, but we don't have
a window system. */
@@ -11466,7 +11456,7 @@ quit_throw_to_read_char (bool from_signal)
if (FRAMEP (internal_last_event_frame)
&& !EQ (internal_last_event_frame, selected_frame))
do_switch_frame (make_lispy_switch_frame (internal_last_event_frame),
- 0, 0, Qnil);
+ 0, Qnil);
sys_longjmp (getcjmp, 1);
}
@@ -12087,11 +12077,13 @@ syms_of_keyboard (void)
DEFSYM (Qpre_command_hook, "pre-command-hook");
DEFSYM (Qpost_command_hook, "post-command-hook");
+ /* Hook run after the region is selected. */
+ DEFSYM (Qpost_select_region_hook, "post-select-region-hook");
+
DEFSYM (Qundo_auto__add_boundary, "undo-auto--add-boundary");
DEFSYM (Qundo_auto__undoably_changed_buffers,
"undo-auto--undoably-changed-buffers");
- DEFSYM (Qdeferred_action_function, "deferred-action-function");
DEFSYM (Qdelayed_warnings_hook, "delayed-warnings-hook");
DEFSYM (Qfunction_key, "function-key");
@@ -12186,7 +12178,6 @@ syms_of_keyboard (void)
apply_modifiers. */
DEFSYM (Qmodifier_cache, "modifier-cache");
- DEFSYM (Qrecompute_lucid_menubar, "recompute-lucid-menubar");
DEFSYM (Qactivate_menubar_hook, "activate-menubar-hook");
DEFSYM (Qpolling_period, "polling-period");
@@ -12667,10 +12658,6 @@ See also `pre-command-hook'. */);
Fset (Qecho_area_clear_hook, Qnil);
- DEFVAR_LISP ("lucid-menu-bar-dirty-flag", Vlucid_menu_bar_dirty_flag,
- doc: /* Non-nil means menu bar, specified Lucid style, needs to be recomputed. */);
- Vlucid_menu_bar_dirty_flag = Qnil;
-
#ifdef USE_LUCID
DEFVAR_BOOL ("lucid--menu-grab-keyboard",
lucid__menu_grab_keyboard,
@@ -12809,17 +12796,6 @@ This keymap works like `input-decode-map', but comes after `function-key-map'.
Another difference is that it is global rather than terminal-local. */);
Vkey_translation_map = Fmake_sparse_keymap (Qnil);
- DEFVAR_LISP ("deferred-action-list", Vdeferred_action_list,
- doc: /* List of deferred actions to be performed at a later time.
-The precise format isn't relevant here; we just check whether it is nil. */);
- Vdeferred_action_list = Qnil;
-
- DEFVAR_LISP ("deferred-action-function", Vdeferred_action_function,
- doc: /* Function to call to handle deferred actions, after each command.
-This function is called with no arguments after each command
-whenever `deferred-action-list' is non-nil. */);
- Vdeferred_action_function = Qnil;
-
DEFVAR_LISP ("delayed-warnings-list", Vdelayed_warnings_list,
doc: /* List of warnings to be displayed after this command.
Each element must be a list (TYPE MESSAGE [LEVEL [BUFFER-NAME]]),
@@ -13006,7 +12982,7 @@ Emacs allows binding both upper and lower case key sequences to
commands. However, if there is a lower case key sequence bound to a
command, and the user enters an upper case key sequence that is not
bound to a command, Emacs will use the lower case binding. Setting
-this variable to nil inhibits this behaviour. */);
+this variable to nil inhibits this behavior. */);
translate_upper_case_key_bindings = true;
DEFVAR_BOOL ("input-pending-p-filter-events",
@@ -13047,6 +13023,12 @@ not recorded. The non-nil value countermands `inhibit--record-char',
which see. */);
record_all_keys = false;
+ DEFVAR_LISP ("post-select-region-hook", Vpost_select_region_hook,
+ doc: /* Abnormal hook run after the region is selected.
+This usually happens as a result of `select-active-regions'. The hook
+is called with one argument, the string that was selected. */);;
+ Vpost_select_region_hook = Qnil;
+
pdumper_do_now_and_after_load (syms_of_keyboard_for_pdumper);
}
@@ -13074,7 +13056,6 @@ syms_of_keyboard_for_pdumper (void)
PDUMPER_RESET (num_input_keys, 0);
PDUMPER_RESET (num_nonmacro_input_events, 0);
PDUMPER_RESET_LV (Vlast_event_frame, Qnil);
- PDUMPER_RESET_LV (Vdeferred_action_list, Qnil);
PDUMPER_RESET_LV (Vdelayed_warnings_list, Qnil);
/* Create the initial keyboard. Qt means 'unset'. */
@@ -13196,7 +13177,10 @@ mark_kboards (void)
{
/* These two special event types have no Lisp_Objects to mark. */
if (event->kind != SELECTION_REQUEST_EVENT
- && event->kind != SELECTION_CLEAR_EVENT)
+#ifndef HAVE_HAIKU
+ && event->kind != SELECTION_CLEAR_EVENT
+#endif
+ )
{
mark_object (event->ie.x);
mark_object (event->ie.y);
diff --git a/src/keymap.c b/src/keymap.c
index 2b77a7fc444..506b755e5da 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1026,8 +1026,14 @@ DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0,
doc: /* Return a copy of the keymap KEYMAP.
Note that this is almost never needed. If you want a keymap that's like
-another yet with a few changes, you should use map inheritance rather
-than copying. I.e. something like:
+another yet with a few changes, you should use keymap inheritance rather
+than copying. That is, something like:
+
+ (defvar-keymap foo-map
+ :parent <theirmap>
+ ...)
+
+Or, if you need to support Emacs versions older than 29:
(let ((map (make-sparse-keymap)))
(set-keymap-parent map <theirmap>)
diff --git a/src/lisp.h b/src/lisp.h
index 7a7d2e79979..dc496cc1658 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1640,13 +1640,13 @@ STRING_MULTIBYTE (Lisp_Object str)
/* Mark STR as a multibyte string. Assure that STR contains only
ASCII characters in advance. */
-#define STRING_SET_MULTIBYTE(STR) \
- do { \
- if (XSTRING (STR)->u.s.size == 0) \
- (STR) = empty_multibyte_string; \
- else \
- XSTRING (STR)->u.s.size_byte = XSTRING (STR)->u.s.size; \
- } while (false)
+INLINE void
+STRING_SET_MULTIBYTE (Lisp_Object str)
+{
+ /* The 0-length strings are unique&shared so we can't modify them. */
+ eassert (XSTRING (str)->u.s.size > 0);
+ XSTRING (str)->u.s.size_byte = XSTRING (str)->u.s.size;
+}
/* Convenience functions for dealing with Lisp strings. */
@@ -3451,7 +3451,7 @@ union specbinding
#define WRAP_SPECPDL_REF 1
#endif
-/* Abstract reference to to a specpdl entry.
+/* Abstract reference to a specpdl entry.
The number is always a multiple of sizeof (union specbinding). */
#ifdef WRAP_SPECPDL_REF
/* Use a proper type for specpdl_ref if it does not make the code slower,
@@ -4733,6 +4733,7 @@ extern bool internal_delete_file (Lisp_Object);
extern Lisp_Object check_emacs_readlinkat (int, Lisp_Object, char const *);
extern bool file_directory_p (Lisp_Object);
extern bool file_accessible_directory_p (Lisp_Object);
+extern Lisp_Object buffer_visited_file_modtime (struct buffer *);
extern void init_fileio (void);
extern void syms_of_fileio (void);
@@ -4841,7 +4842,7 @@ extern void syms_of_indent (void);
/* Defined in frame.c. */
extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object);
-extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object);
+extern Lisp_Object do_switch_frame (Lisp_Object, int, Lisp_Object);
extern Lisp_Object get_frame_param (struct frame *, Lisp_Object);
extern void frames_discard_buffer (Lisp_Object);
extern void init_frame_once (void);
diff --git a/src/lread.c b/src/lread.c
index 66b13916465..0b46a2e4ee5 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1735,13 +1735,24 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd,
{
if (!NILP (find_symbol_value (
Qnative_comp_warning_on_missing_source)))
- call2 (intern_c_string ("display-warning"),
- Qcomp,
- CALLN (Fformat,
- build_string ("Cannot look-up eln file as no source "
- "file was found for %s"),
- *filename));
- return;
+ {
+ /* If we have an installation without any .el files,
+ there's really no point in giving a warning here,
+ because that will trigger a cascade of warnings. So
+ just do a sanity check and refuse to do anything if we
+ can't find even central .el files. */
+ if (NILP (Flocate_file_internal (build_string ("simple.el"),
+ Vload_path,
+ Qnil, Qnil)))
+ return;
+ call2 (intern_c_string ("display-warning"),
+ Qcomp,
+ CALLN (Fformat,
+ build_string ("Cannot look up eln file as "
+ "no source file was found for %s"),
+ *filename));
+ return;
+ }
}
}
Lisp_Object eln_rel_name = Fcomp_el_to_eln_rel_filename (src_name);
@@ -4265,7 +4276,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
/* Catch silly games like #1=#1# */
invalid_syntax ("nonsensical self-reference", readcharfun);
- /* Optimisation: since the placeholder is already
+ /* Optimization: since the placeholder is already
a cons, repurpose it as the actual value.
This allows us to skip the substitution below,
since the placeholder is already referenced
@@ -4877,7 +4888,7 @@ oblookup (Lisp_Object obarray, register const char *ptr, ptrdiff_t size, ptrdiff
/* Like 'oblookup', but considers 'Vread_symbol_shorthands',
potentially recognizing that IN is shorthand for some other
- longhand name, which is then then placed in OUT. In that case,
+ longhand name, which is then placed in OUT. In that case,
memory is malloc'ed for OUT (which the caller must free) while
SIZE_OUT and SIZE_BYTE_OUT respectively hold the character and byte
sizes of the transformed symbol name. If IN is not recognized
diff --git a/src/minibuf.c b/src/minibuf.c
index 85d6ec44349..bedc5644807 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1123,8 +1123,8 @@ read_minibuf_unwind (void)
found:
if (!EQ (exp_MB_frame, saved_selected_frame)
&& !NILP (exp_MB_frame))
- do_switch_frame (exp_MB_frame, 0, 0, Qt); /* This also sets
- minibuf_window */
+ do_switch_frame (exp_MB_frame, 0, Qt); /* This also sets
+ minibuf_window */
/* To keep things predictable, in case it matters, let's be in the
minibuffer when we reset the relevant variables. Don't depend on
@@ -1236,7 +1236,7 @@ read_minibuf_unwind (void)
/* Restore the selected frame. */
if (!EQ (exp_MB_frame, saved_selected_frame)
&& !NILP (exp_MB_frame))
- do_switch_frame (saved_selected_frame, 0, 0, Qt);
+ do_switch_frame (saved_selected_frame, 0, Qt);
}
/* Replace the expired minibuffer in frame exp_MB_frame with the next less
@@ -1545,18 +1545,6 @@ function, instead of the usual behavior. */)
return unbind_to (count, result);
}
-static Lisp_Object
-minibuf_conform_representation (Lisp_Object string, Lisp_Object basis)
-{
- if (STRING_MULTIBYTE (string) == STRING_MULTIBYTE (basis))
- return string;
-
- if (STRING_MULTIBYTE (string))
- return Fstring_make_unibyte (string);
- else
- return Fstring_make_multibyte (string);
-}
-
static bool
match_regexps (Lisp_Object string, Lisp_Object regexps,
bool ignore_case)
@@ -1817,7 +1805,7 @@ or from one of the possible completions. */)
don't change the case of what the user typed. */
if (completion_ignore_case && bestmatchsize == SCHARS (string)
&& SCHARS (bestmatch) > bestmatchsize)
- return minibuf_conform_representation (string, bestmatch);
+ return string;
/* Return t if the supplied string is an exact match (counting case);
it does not require any change to be made. */
@@ -2011,8 +1999,9 @@ REQUIRE-MATCH can take the following values:
input, but she needs to confirm her choice if she called
`minibuffer-complete' right before `minibuffer-complete-and-exit'
and the input is not an element of COLLECTION.
-- a function, which will be called with the input as the parameter.
- If it returns a non-nil value, the minibuffer is exited with that value.
+- a function, which will be called with the input as the
+ argument. If the function returns a non-nil value, the
+ minibuffer is exited with that argument as the value.
- anything else behaves like t except that typing RET does not exit if it
does non-null completion.
@@ -2089,19 +2078,6 @@ the values STRING, PREDICATE and `lambda'. */)
SSDATA (string),
SCHARS (string),
SBYTES (string));
- if (!SYMBOLP (tem))
- {
- if (STRING_MULTIBYTE (string))
- string = Fstring_make_unibyte (string);
- else
- string = Fstring_make_multibyte (string);
-
- tem = oblookup (collection,
- SSDATA (string),
- SCHARS (string),
- SBYTES (string));
- }
-
if (completion_ignore_case && !SYMBOLP (tem))
{
for (i = ASIZE (collection) - 1; i >= 0; i--)
diff --git a/src/nsmenu.m b/src/nsmenu.m
index d02d7bae4b5..ae795a0d22b 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -207,8 +207,6 @@ ns_update_menubar (struct frame *f, bool deep_p)
/* If it has changed current-menubar from previous value,
really recompute the menubar from the value. */
- if (! NILP (Vlucid_menu_bar_dirty_flag))
- call0 (Qrecompute_lucid_menubar);
safe_run_hooks (Qmenu_bar_update_hook);
fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
diff --git a/src/nsselect.m b/src/nsselect.m
index c46bfeaf42a..5b47d746122 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -724,7 +724,7 @@ Return the action that the drop target actually chose to perform, or
nil if no action was performed (either because there was no drop
target, or the drop was rejected). If RETURN-FRAME is the symbol
`now', also return any frame that mouse moves into during the
-drag-and-drop operation, whilst simultaneously cancelling it. Any
+drag-and-drop operation, whilst simultaneously canceling it. Any
other non-nil value means to do the same, but to wait for the mouse to
leave FRAME first.
diff --git a/src/nsterm.h b/src/nsterm.h
index 7a097b32489..2a4c7571a34 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -927,6 +927,9 @@ struct ns_output
NSColor *cursor_color;
NSColor *foreground_color;
NSColor *background_color;
+ NSColor *relief_background_color;
+ NSColor *light_relief_color;
+ NSColor *dark_relief_color;
EmacsToolbar *toolbar;
#else
void *view;
@@ -934,6 +937,9 @@ struct ns_output
void *cursor_color;
void *foreground_color;
void *background_color;
+ void *relief_background_color;
+ void *light_relief_color;
+ void *dark_relief_color;
void *toolbar;
#endif
diff --git a/src/nsterm.m b/src/nsterm.m
index 7f232e72922..2ba167f189b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3475,6 +3475,35 @@ ns_draw_box (NSRect r, CGFloat hthickness, CGFloat vthickness,
}
}
+/* Set up colors for the relief lines around glyph string S. */
+
+static void
+ns_setup_relief_colors (struct glyph_string *s)
+{
+ struct ns_output *di = FRAME_OUTPUT_DATA (s->f);
+ NSColor *color;
+
+ if (s->face->use_box_color_for_shadows_p)
+ color = [NSColor colorWithUnsignedLong: s->face->box_color];
+ else
+ color = [NSColor colorWithUnsignedLong: s->face->background];
+
+ if (s->hl == DRAW_CURSOR)
+ color = FRAME_CURSOR_COLOR (s->f);
+
+ if (color == nil)
+ color = [NSColor grayColor];
+
+ if (color != di->relief_background_color)
+ {
+ [di->relief_background_color release];
+ di->relief_background_color = [color retain];
+ [di->light_relief_color release];
+ di->light_relief_color = [[color highlightWithLevel: 0.4] retain];
+ [di->dark_relief_color release];
+ di->dark_relief_color = [[color shadowWithLevel: 0.4] retain];
+ }
+}
static void
ns_draw_relief (NSRect outer, int hthickness, int vthickness, char raised_p,
@@ -3486,40 +3515,13 @@ ns_draw_relief (NSRect outer, int hthickness, int vthickness, char raised_p,
of some sides not being drawn, and because the rect will be filled.
-------------------------------------------------------------------------- */
{
- static NSColor *baseCol, *lightCol, *darkCol;
- NSColor *newBaseCol;
NSRect inner;
- NSBezierPath *p;
-
- baseCol = nil;
- lightCol = nil;
- newBaseCol = nil;
- p = nil;
+ NSBezierPath *p = nil;
NSTRACE ("ns_draw_relief");
/* set up colors */
-
- if (s->face->use_box_color_for_shadows_p)
- newBaseCol = [NSColor colorWithUnsignedLong: s->face->box_color];
- else
- newBaseCol = [NSColor colorWithUnsignedLong: s->face->background];
-
- if (s->hl == DRAW_CURSOR)
- newBaseCol = FRAME_CURSOR_COLOR (s->f);
-
- if (newBaseCol == nil)
- newBaseCol = [NSColor grayColor];
-
- if (newBaseCol != baseCol) /* TODO: better check */
- {
- [baseCol release];
- baseCol = [newBaseCol retain];
- [lightCol release];
- lightCol = [[baseCol highlightWithLevel: 0.4] retain];
- [darkCol release];
- darkCol = [[baseCol shadowWithLevel: 0.4] retain];
- }
+ ns_setup_relief_colors (s);
/* Calculate the inner rectangle. */
inner = outer;
@@ -3542,7 +3544,9 @@ ns_draw_relief (NSRect outer, int hthickness, int vthickness, char raised_p,
if (bottom_p)
inner.size.height -= hthickness;
- [(raised_p ? lightCol : darkCol) set];
+ struct ns_output *di = FRAME_OUTPUT_DATA (s->f);
+
+ [(raised_p ? di->light_relief_color : di->dark_relief_color) set];
if (top_p || left_p)
{
@@ -3564,7 +3568,7 @@ ns_draw_relief (NSRect outer, int hthickness, int vthickness, char raised_p,
[p fill];
}
- [(raised_p ? darkCol : lightCol) set];
+ [(raised_p ? di->dark_relief_color : di->light_relief_color) set];
if (bottom_p || right_p)
{
@@ -3626,7 +3630,7 @@ ns_draw_relief (NSRect outer, int hthickness, int vthickness, char raised_p,
NSMaxY (outer) - 0.5)];
}
- [darkCol set];
+ [di->dark_relief_color set];
[p stroke];
if (vthickness > 1 && hthickness > 1)
@@ -10913,7 +10917,7 @@ This variable is ignored on macOS < 10.7 and GNUstep. Default is t. */);
It is called with three arguments FRAME, X, and Y, whenever the user
moves the mouse over an Emacs frame as part of a drag-and-drop
operation. FRAME is the frame the mouse is on top of, and X and Y are
-the frame-relative positions of the mouse in the X and Y axises
+the frame-relative positions of the mouse in the X and Y axes
respectively. */);
Vns_drag_motion_function = Qns_handle_drag_motion;
diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 4f15ec6ff66..5c43e5f3607 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -2043,7 +2043,7 @@ use `(length \(display-monitor-attributes-list TERMINAL))' instead. */)
DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
- doc: /* Return the height in millimeters of the the display TERMINAL.
+ doc: /* Return the height in millimeters of the display TERMINAL.
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display.
@@ -2084,7 +2084,7 @@ for each physical monitor, use `display-monitor-attributes-list'. */)
DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
- doc: /* Return the width in millimeters of the the display TERMINAL.
+ doc: /* Return the width in millimeters of the display TERMINAL.
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display.
@@ -2125,7 +2125,7 @@ for each physical monitor, use `display-monitor-attributes-list'. */)
DEFUN ("x-display-backing-store", Fx_display_backing_store, Sx_display_backing_store, 0, 1, 0,
- doc: /* Return an indication of whether the the display TERMINAL does backing store.
+ doc: /* Return an indication of whether the display TERMINAL does backing store.
The value may be `buffered', `retained', or `non-retained'.
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
@@ -2138,7 +2138,7 @@ If omitted or nil, that stands for the selected frame's display. */)
DEFUN ("x-display-visual-class", Fx_display_visual_class, Sx_display_visual_class, 0, 1, 0,
- doc: /* Return the visual class of the the display TERMINAL.
+ doc: /* Return the visual class of the display TERMINAL.
The value is one of the symbols `static-gray', `gray-scale',
`static-color', `pseudo-color', `true-color', or `direct-color'.
diff --git a/src/pgtkmenu.c b/src/pgtkmenu.c
index 2eabf6ac1bc..d147f4b4168 100644
--- a/src/pgtkmenu.c
+++ b/src/pgtkmenu.c
@@ -289,8 +289,6 @@ set_frame_menubar (struct frame *f, bool deep_p)
/* If it has changed current-menubar from previous value,
really recompute the menubar from the value. */
- if (!NILP (Vlucid_menu_bar_dirty_flag))
- call0 (Qrecompute_lucid_menubar);
safe_run_hooks (Qmenu_bar_update_hook);
fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
diff --git a/src/pgtkselect.c b/src/pgtkselect.c
index fff163c92a7..e0230003b3a 100644
--- a/src/pgtkselect.c
+++ b/src/pgtkselect.c
@@ -790,8 +790,8 @@ pgtk_handle_selection_event (struct selection_input_event *event)
void
pgtk_clear_frame_selections (struct frame *f)
{
- Lisp_Object frame;
- Lisp_Object rest;
+ Lisp_Object frame, rest, timestamp, symbol;
+ guint32 time;
struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
struct terminal *t = dpyinfo->terminal;
@@ -801,9 +801,22 @@ pgtk_clear_frame_selections (struct frame *f)
while (CONSP (t->Vselection_alist)
&& EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (t->Vselection_alist)))))))
{
+ symbol = Fcar (Fcar (t->Vselection_alist));
+
/* Run the `pgtk-lost-selection-functions' abnormal hook. */
CALLN (Frun_hook_with_args, Qpgtk_lost_selection_functions,
- Fcar (Fcar (t->Vselection_alist)));
+ symbol);
+
+ timestamp = Fcar (Fcdr (Fcdr (Fcar (t->Vselection_alist))));
+ CONS_TO_INTEGER (timestamp, guint32, time);
+
+ /* On Wayland, GDK will still ask the (now non-existent) frame for
+ selection data, even though we no longer think the selection is
+ owned by us. Manually relinquish ownership of the selection. */
+ gdk_selection_owner_set_for_display (dpyinfo->display,
+ NULL,
+ symbol_to_gdk_atom (symbol),
+ time, TRUE);
tset_selection_alist (t, XCDR (t->Vselection_alist));
}
@@ -813,8 +826,18 @@ pgtk_clear_frame_selections (struct frame *f)
if (CONSP (XCDR (rest))
&& EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (XCDR (rest))))))))
{
+ symbol = XCAR (XCAR (XCDR (rest)));
CALLN (Frun_hook_with_args, Qpgtk_lost_selection_functions,
- XCAR (XCAR (XCDR (rest))));
+ symbol);
+
+ timestamp = XCAR (XCDR (XCDR (XCAR (XCDR (rest)))));
+ CONS_TO_INTEGER (timestamp, guint32, time);
+
+ gdk_selection_owner_set_for_display (dpyinfo->display,
+ NULL,
+ symbol_to_gdk_atom (symbol),
+ time, TRUE);
+
XSETCDR (rest, XCDR (XCDR (rest)));
break;
}
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 1eb4d378adf..b283cef7cde 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -5454,15 +5454,18 @@ window_state_event (GtkWidget *widget,
gpointer *user_data)
{
struct frame *f = pgtk_any_window_to_frame (event->window_state.window);
+ GdkWindowState new_state;
union buffered_input_event inev;
+ new_state = event->window_state.new_window_state;
+
EVENT_INIT (inev.ie);
inev.ie.kind = NO_EVENT;
inev.ie.arg = Qnil;
if (f)
{
- if (event->window_state.new_window_state & GDK_WINDOW_STATE_FOCUSED)
+ if (new_state & GDK_WINDOW_STATE_FOCUSED)
{
if (FRAME_ICONIFIED_P (f))
{
@@ -5478,17 +5481,24 @@ window_state_event (GtkWidget *widget,
}
}
- if (event->window_state.new_window_state
- & GDK_WINDOW_STATE_FULLSCREEN)
+ if (new_state & GDK_WINDOW_STATE_FULLSCREEN)
store_frame_param (f, Qfullscreen, Qfullboth);
- else if (event->window_state.new_window_state
- & GDK_WINDOW_STATE_MAXIMIZED)
+ else if (new_state & GDK_WINDOW_STATE_MAXIMIZED)
store_frame_param (f, Qfullscreen, Qmaximized);
+ else if ((new_state & GDK_WINDOW_STATE_TOP_TILED)
+ && (new_state & GDK_WINDOW_STATE_BOTTOM_TILED)
+ && !(new_state & GDK_WINDOW_STATE_TOP_RESIZABLE)
+ && !(new_state & GDK_WINDOW_STATE_BOTTOM_RESIZABLE))
+ store_frame_param (f, Qfullscreen, Qfullheight);
+ else if ((new_state & GDK_WINDOW_STATE_LEFT_TILED)
+ && (new_state & GDK_WINDOW_STATE_RIGHT_TILED)
+ && !(new_state & GDK_WINDOW_STATE_LEFT_RESIZABLE)
+ && !(new_state & GDK_WINDOW_STATE_RIGHT_RESIZABLE))
+ store_frame_param (f, Qfullscreen, Qfullwidth);
else
store_frame_param (f, Qfullscreen, Qnil);
- if (event->window_state.new_window_state
- & GDK_WINDOW_STATE_ICONIFIED)
+ if (new_state & GDK_WINDOW_STATE_ICONIFIED)
SET_FRAME_ICONIFIED (f, true);
else
{
@@ -5498,8 +5508,7 @@ window_state_event (GtkWidget *widget,
SET_FRAME_ICONIFIED (f, false);
}
- if (event->window_state.new_window_state
- & GDK_WINDOW_STATE_STICKY)
+ if (new_state & GDK_WINDOW_STATE_STICKY)
store_frame_param (f, Qsticky, Qt);
else
store_frame_param (f, Qsticky, Qnil);
diff --git a/src/print.c b/src/print.c
index d562500b619..b5a621f80aa 100644
--- a/src/print.c
+++ b/src/print.c
@@ -467,8 +467,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
if (chars < bytes)
{
newstr = make_uninit_multibyte_string (chars, bytes);
- memcpy (SDATA (newstr), SDATA (string), chars);
- str_to_multibyte (SDATA (newstr), bytes, chars);
+ str_to_multibyte (SDATA (newstr), SDATA (string), chars);
string = newstr;
}
}
@@ -727,7 +726,7 @@ Optional argument OVERRIDES should be a list of settings for print-related
variables. An element in this list can be the symbol t, which means "reset
all the values to their defaults". Otherwise, an element should be a pair,
where the `car' or the pair is the setting symbol, and the `cdr' is the
-value of of the setting to use for this `prin1' call.
+value of the setting to use for this `prin1' call.
For instance:
diff --git a/src/process.c b/src/process.c
index af402c8edb3..d6d51b26e11 100644
--- a/src/process.c
+++ b/src/process.c
@@ -8321,14 +8321,21 @@ DEFUN ("signal-names", Fsignal_names, Ssignal_names, 0, 0, 0,
doc: /* Return a list of known signal names on this system. */)
(void)
{
+#ifndef MSDOS
+ int i;
char name[SIG2STR_MAX];
Lisp_Object names = Qnil;
- for (int i = 0; i < 256; ++i)
+
+ for (i = 0; i <= SIGNUM_BOUND; ++i)
{
if (!sig2str (i, name))
names = Fcons (build_string (name), names);
}
+
return names;
+#else
+ return Qnil;
+#endif
}
#ifdef subprocesses
diff --git a/src/sheap.h b/src/sheap.h
index 297b7cf317d..9133f0b292f 100644
--- a/src/sheap.h
+++ b/src/sheap.h
@@ -23,7 +23,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
/* Size of the static heap. Guess a value that is probably too large,
by up to a factor of four or so. Typically the unused part is not
paged in and so does not cost much. */
-enum { STATIC_HEAP_SIZE = sizeof (Lisp_Object) << 22 };
+enum { STATIC_HEAP_SIZE = sizeof (Lisp_Object) << 23 };
extern char bss_sbrk_buffer[STATIC_HEAP_SIZE];
extern char *max_bss_sbrk_ptr;
diff --git a/src/sqlite.c b/src/sqlite.c
index 75a3b2ea32c..54bfb7b6c61 100644
--- a/src/sqlite.c
+++ b/src/sqlite.c
@@ -246,8 +246,10 @@ If FILE is nil, an in-memory database will be opened instead. */)
(Lisp_Object file)
{
Lisp_Object name;
- int flags = (SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX
- | SQLITE_OPEN_READWRITE);
+ int flags = (SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE);
+#ifdef SQLITE_OPEN_FULLMUTEX
+ flags |= SQLITE_OPEN_FULLMUTEX;
+#endif
#ifdef SQLITE_OPEN_URI
flags |= SQLITE_OPEN_URI;
#endif
diff --git a/src/systime.h b/src/systime.h
index 75088bd4a62..085a7ddeaba 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -26,6 +26,9 @@ INLINE_HEADER_BEGIN
#ifdef HAVE_X_WINDOWS
# include <X11/X.h>
+#elif defined HAVE_HAIKU
+# include <support/SupportDefs.h>
+typedef int64 Time;
#else
typedef unsigned long Time;
#endif
diff --git a/src/termhooks.h b/src/termhooks.h
index a1e3e2cde9a..c5f1e286e92 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -209,30 +209,6 @@ enum event_kind
representation of the dropped items.
.timestamp gives a timestamp (in
milliseconds) for the click. */
-#ifdef HAVE_X_WINDOWS
- UNSUPPORTED_DROP_EVENT, /* Event sent when the regular C
- drag-and-drop machinery could not
- handle a drop to a window.
-
- .code is the XID of the window that
- could not be dropped to.
-
- .arg is a list of the local value of
- XdndSelection, a list of selection
- targets, and the intended action to
- be taken upon drop, and .timestamp
- gives the timestamp where the drop
- happened.
-
- .modifiers gives a number that
- determines if an event was already
- handled by
- `x_dnd_begin_drag_and_drop'.
-
- .x and .y give the coordinates of
- the drop originating from the root
- window. */
-#endif
USER_SIGNAL_EVENT, /* A user signal.
code is a number identifying it,
index into lispy_user_signals. */
diff --git a/src/undo.c b/src/undo.c
index 36664d16424..f76977dbe50 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -218,7 +218,7 @@ record_first_change (void)
base_buffer = base_buffer->base_buffer;
bset_undo_list (current_buffer,
- Fcons (Fcons (Qt, Fvisited_file_modtime ()),
+ Fcons (Fcons (Qt, buffer_visited_file_modtime (base_buffer)),
BVAR (current_buffer, undo_list)));
}
diff --git a/src/w32fns.c b/src/w32fns.c
index 468073c9170..51540e1880c 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -797,13 +797,6 @@ w32_default_color_map (void)
return (cmap);
}
-DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
- 0, 0, 0, doc: /* Return the default color map. */)
- (void)
-{
- return w32_default_color_map ();
-}
-
static Lisp_Object
w32_color_map_lookup (const char *colorname)
{
@@ -10879,7 +10872,6 @@ keys when IME input is received. */);
/* W32 specific functions */
defsubr (&Sw32_define_rgb_color);
- defsubr (&Sw32_default_color_map);
defsubr (&Sw32_display_monitor_attributes_list);
defsubr (&Sw32_send_sys_command);
defsubr (&Sw32_shell_execute);
diff --git a/src/window.c b/src/window.c
index ad03a02758e..10373f8a2bf 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1289,7 +1289,7 @@ WINDOW must be a live window and defaults to the selected one.
Clip the number to a reasonable value if out of range.
Return the new number. NCOL should be zero or positive.
-Note that if `automatic-hscrolling' is non-nil, you cannot scroll the
+Note that if `auto-hscroll-mode' is non-nil, you cannot scroll the
window so that the location of point moves off-window. */)
(Lisp_Object window, Lisp_Object ncol)
{
@@ -6667,6 +6667,7 @@ and redisplay normally--don't erase and redraw the frame. */)
if (h <= 0)
{
bidi_unshelve_cache (itdata, false);
+ unbind_to (count, Qnil);
return Qnil;
}
@@ -7298,7 +7299,7 @@ the return value is nil. Otherwise the value is t. */)
do_switch_frame (NILP (dont_set_frame)
? data->selected_frame
: old_frame
- , 0, 0, Qnil);
+ , 0, Qnil);
}
FRAME_WINDOW_CHANGE (f) = true;
diff --git a/src/xdisp.c b/src/xdisp.c
index 4089525e10f..f205327cc34 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13468,9 +13468,6 @@ update_menu_bar (struct frame *f, bool save_match_data, bool hooks_run)
/* If it has changed current-menubar from previous value,
really recompute the menu-bar from the value. */
- if (! NILP (Vlucid_menu_bar_dirty_flag))
- call0 (Qrecompute_lucid_menubar);
-
safe_run_hooks (Qmenu_bar_update_hook);
hooks_run = true;
diff --git a/src/xfaces.c b/src/xfaces.c
index f70fe87c95e..bbc1d352c6e 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -295,6 +295,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#define IGNORE_DEFFACE_P(ATTR) EQ ((ATTR), QCignore_defface)
+/* True if face attribute ATTR is `reset'. */
+
+#define RESET_P(ATTR) EQ ((ATTR), Qreset)
+
/* Size of hash table of realized faces in face caches (should be a
prime number). */
@@ -961,7 +965,7 @@ DEFUN ("color-values-from-color-spec",
Scolor_values_from_color_spec,
1, 1, 0,
doc: /* Parse color SPEC as a numeric color and return (RED GREEN BLUE).
-This function recognises the following formats for SPEC:
+This function recognizes the following formats for SPEC:
#RGB, where R, G and B are hex numbers of equal length, 1-4 digits each.
rgb:R/G/B, where R, G, and B are hex numbers, 1-4 digits each.
@@ -1757,57 +1761,72 @@ check_lface_attrs (Lisp_Object attrs[LFACE_VECTOR_SIZE])
{
eassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FAMILY_INDEX])
+ || RESET_P (attrs[LFACE_FAMILY_INDEX])
|| STRINGP (attrs[LFACE_FAMILY_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FOUNDRY_INDEX])
+ || RESET_P (attrs[LFACE_FOUNDRY_INDEX])
|| STRINGP (attrs[LFACE_FOUNDRY_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_SWIDTH_INDEX])
+ || RESET_P (attrs[LFACE_SWIDTH_INDEX])
|| SYMBOLP (attrs[LFACE_SWIDTH_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_HEIGHT_INDEX])
+ || RESET_P (attrs[LFACE_HEIGHT_INDEX])
|| NUMBERP (attrs[LFACE_HEIGHT_INDEX])
|| FUNCTIONP (attrs[LFACE_HEIGHT_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_WEIGHT_INDEX])
+ || RESET_P (attrs[LFACE_WEIGHT_INDEX])
|| SYMBOLP (attrs[LFACE_WEIGHT_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_SLANT_INDEX])
+ || RESET_P (attrs[LFACE_SLANT_INDEX])
|| SYMBOLP (attrs[LFACE_SLANT_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_UNDERLINE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_UNDERLINE_INDEX])
+ || RESET_P (attrs[LFACE_UNDERLINE_INDEX])
|| SYMBOLP (attrs[LFACE_UNDERLINE_INDEX])
|| STRINGP (attrs[LFACE_UNDERLINE_INDEX])
|| CONSP (attrs[LFACE_UNDERLINE_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_EXTEND_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_EXTEND_INDEX])
+ || RESET_P (attrs[LFACE_EXTEND_INDEX])
|| SYMBOLP (attrs[LFACE_EXTEND_INDEX])
|| STRINGP (attrs[LFACE_EXTEND_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_OVERLINE_INDEX])
+ || RESET_P (attrs[LFACE_OVERLINE_INDEX])
|| SYMBOLP (attrs[LFACE_OVERLINE_INDEX])
|| STRINGP (attrs[LFACE_OVERLINE_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_STRIKE_THROUGH_INDEX])
+ || RESET_P (attrs[LFACE_STRIKE_THROUGH_INDEX])
|| SYMBOLP (attrs[LFACE_STRIKE_THROUGH_INDEX])
|| STRINGP (attrs[LFACE_STRIKE_THROUGH_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_BOX_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_BOX_INDEX])
+ || RESET_P (attrs[LFACE_BOX_INDEX])
|| SYMBOLP (attrs[LFACE_BOX_INDEX])
|| STRINGP (attrs[LFACE_BOX_INDEX])
|| FIXNUMP (attrs[LFACE_BOX_INDEX])
|| CONSP (attrs[LFACE_BOX_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_INVERSE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_INVERSE_INDEX])
+ || RESET_P (attrs[LFACE_INVERSE_INDEX])
|| SYMBOLP (attrs[LFACE_INVERSE_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_FOREGROUND_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FOREGROUND_INDEX])
+ || RESET_P (attrs[LFACE_FOREGROUND_INDEX])
|| STRINGP (attrs[LFACE_FOREGROUND_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_DISTANT_FOREGROUND_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_DISTANT_FOREGROUND_INDEX])
+ || RESET_P (attrs[LFACE_DISTANT_FOREGROUND_INDEX])
|| STRINGP (attrs[LFACE_DISTANT_FOREGROUND_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_BACKGROUND_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_BACKGROUND_INDEX])
+ || RESET_P (attrs[LFACE_BACKGROUND_INDEX])
|| STRINGP (attrs[LFACE_BACKGROUND_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_INHERIT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_INHERIT_INDEX])
@@ -1817,13 +1836,16 @@ check_lface_attrs (Lisp_Object attrs[LFACE_VECTOR_SIZE])
#ifdef HAVE_WINDOW_SYSTEM
eassert (UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_STIPPLE_INDEX])
+ || RESET_P (attrs[LFACE_STIPPLE_INDEX])
|| SYMBOLP (attrs[LFACE_STIPPLE_INDEX])
|| !NILP (Fbitmap_spec_p (attrs[LFACE_STIPPLE_INDEX])));
eassert (UNSPECIFIEDP (attrs[LFACE_FONT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_FONT_INDEX])
+ || RESET_P (attrs[LFACE_FONT_INDEX])
|| FONTP (attrs[LFACE_FONT_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_FONTSET_INDEX])
|| STRINGP (attrs[LFACE_FONTSET_INDEX])
+ || RESET_P (attrs[LFACE_FONTSET_INDEX])
|| NILP (attrs[LFACE_FONTSET_INDEX]));
#endif
}
@@ -2083,7 +2105,7 @@ lface_fully_specified_p (Lisp_Object attrs[LFACE_VECTOR_SIZE])
#ifdef HAVE_WINDOW_SYSTEM
/* Set font-related attributes of Lisp face LFACE from FONT-OBJECT.
- If FORCE_P, set only unspecified attributes of LFACE. The
+ If FORCE_P is zero, set only unspecified attributes of LFACE. The
exception is `font' attribute. It is set to FONT_OBJECT regardless
of FORCE_P. */
@@ -2339,6 +2361,14 @@ merge_named_face (struct window *w,
Lisp_Object from[LFACE_VECTOR_SIZE], val;
bool ok = get_lface_attributes (w, f, face_name, from, false,
named_merge_points);
+ if (ok && !EQ (face_name, Qdefault))
+ {
+ struct face *deflt = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+ int i;
+ for (i = 1; i < LFACE_VECTOR_SIZE; i++)
+ if (EQ (from[i], Qreset))
+ from[i] = deflt->lface[i];
+ }
if (ok && (attr_filter == 0 /* No filter. */
|| (!NILP (from[attr_filter]) /* Filter, but specified. */
@@ -3087,7 +3117,9 @@ FRAME 0 means change the face on all frames, and change the default
if (EQ (attr, QCfamily))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
CHECK_STRING (value);
if (SCHARS (value) == 0)
@@ -3099,7 +3131,9 @@ FRAME 0 means change the face on all frames, and change the default
}
else if (EQ (attr, QCfoundry))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
CHECK_STRING (value);
if (SCHARS (value) == 0)
@@ -3111,7 +3145,9 @@ FRAME 0 means change the face on all frames, and change the default
}
else if (EQ (attr, QCheight))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
if (EQ (face, Qdefault))
{
@@ -3139,7 +3175,9 @@ FRAME 0 means change the face on all frames, and change the default
}
else if (EQ (attr, QCweight))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
CHECK_SYMBOL (value);
if (FONT_WEIGHT_NAME_NUMERIC (value) < 0)
@@ -3151,7 +3189,9 @@ FRAME 0 means change the face on all frames, and change the default
}
else if (EQ (attr, QCslant))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
CHECK_SYMBOL (value);
if (FONT_SLANT_NAME_NUMERIC (value) < 0)
@@ -3165,7 +3205,7 @@ FRAME 0 means change the face on all frames, and change the default
{
bool valid_p = false;
- if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value))
+ if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value) || RESET_P (value))
valid_p = true;
else if (NILP (value) || EQ (value, Qt))
valid_p = true;
@@ -3223,7 +3263,9 @@ FRAME 0 means change the face on all frames, and change the default
}
else if (EQ (attr, QCoverline))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
if ((SYMBOLP (value)
&& !EQ (value, Qt)
&& !NILP (value))
@@ -3237,7 +3279,9 @@ FRAME 0 means change the face on all frames, and change the default
}
else if (EQ (attr, QCstrike_through))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
if ((SYMBOLP (value)
&& !EQ (value, Qt)
&& !NILP (value))
@@ -3258,7 +3302,7 @@ FRAME 0 means change the face on all frames, and change the default
if (EQ (value, Qt))
value = make_fixnum (1);
- if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value))
+ if (UNSPECIFIEDP (value) || IGNORE_DEFFACE_P (value) || RESET_P (value))
valid_p = true;
else if (NILP (value))
valid_p = true;
@@ -3320,7 +3364,9 @@ FRAME 0 means change the face on all frames, and change the default
else if (EQ (attr, QCinverse_video)
|| EQ (attr, QCreverse_video))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
CHECK_SYMBOL (value);
if (!EQ (value, Qt) && !NILP (value))
@@ -3331,7 +3377,9 @@ FRAME 0 means change the face on all frames, and change the default
}
else if (EQ (attr, QCextend))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
CHECK_SYMBOL (value);
if (!EQ (value, Qt) && !NILP (value))
@@ -3345,7 +3393,9 @@ FRAME 0 means change the face on all frames, and change the default
/* Compatibility with 20.x. */
if (NILP (value))
value = Qunspecified;
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
/* Don't check for valid color names here because it depends
on the frame (display) whether the color will be valid
@@ -3362,7 +3412,9 @@ FRAME 0 means change the face on all frames, and change the default
/* Compatibility with 20.x. */
if (NILP (value))
value = Qunspecified;
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
/* Don't check for valid color names here because it depends
on the frame (display) whether the color will be valid
@@ -3379,7 +3431,9 @@ FRAME 0 means change the face on all frames, and change the default
/* Compatibility with 20.x. */
if (NILP (value))
value = Qunspecified;
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
/* Don't check for valid color names here because it depends
on the frame (display) whether the color will be valid
@@ -3394,7 +3448,9 @@ FRAME 0 means change the face on all frames, and change the default
else if (EQ (attr, QCstipple))
{
#if defined (HAVE_WINDOW_SYSTEM)
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value)
&& !NILP (value)
&& NILP (Fbitmap_spec_p (value)))
signal_error ("Invalid stipple attribute", value);
@@ -3404,7 +3460,9 @@ FRAME 0 means change the face on all frames, and change the default
}
else if (EQ (attr, QCwidth))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
CHECK_SYMBOL (value);
if (FONT_WIDTH_NAME_NUMERIC (value) < 0)
@@ -3419,7 +3477,9 @@ FRAME 0 means change the face on all frames, and change the default
#ifdef HAVE_WINDOW_SYSTEM
if (EQ (frame, Qt) || FRAME_WINDOW_P (f))
{
- if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
+ if (!UNSPECIFIEDP (value)
+ && !IGNORE_DEFFACE_P (value)
+ && !RESET_P (value))
{
struct frame *f1;
@@ -3476,12 +3536,15 @@ FRAME 0 means change the face on all frames, and change the default
#ifdef HAVE_WINDOW_SYSTEM
if (EQ (frame, Qt) || FRAME_WINDOW_P (f))
{
- Lisp_Object tmp;
+ Lisp_Object tmp = value;
old_value = LFACE_FONTSET (lface);
- tmp = Fquery_fontset (value, Qnil);
- if (NILP (tmp))
- signal_error ("Invalid fontset name", value);
+ if (!RESET_P (value))
+ {
+ tmp = Fquery_fontset (value, Qnil);
+ if (NILP (tmp))
+ signal_error ("Invalid fontset name", value);
+ }
ASET (lface, LFACE_FONTSET_INDEX, value = tmp);
}
#endif /* HAVE_WINDOW_SYSTEM */
@@ -3503,14 +3566,20 @@ FRAME 0 means change the face on all frames, and change the default
else if (EQ (attr, QCbold))
{
old_value = LFACE_WEIGHT (lface);
- ASET (lface, LFACE_WEIGHT_INDEX, NILP (value) ? Qnormal : Qbold);
+ if (RESET_P (value))
+ ASET (lface, LFACE_WEIGHT_INDEX, value);
+ else
+ ASET (lface, LFACE_WEIGHT_INDEX, NILP (value) ? Qnormal : Qbold);
prop_index = FONT_WEIGHT_INDEX;
}
else if (EQ (attr, QCitalic))
{
attr = QCslant;
old_value = LFACE_SLANT (lface);
- ASET (lface, LFACE_SLANT_INDEX, NILP (value) ? Qnormal : Qitalic);
+ if (RESET_P (value))
+ ASET (lface, LFACE_SLANT_INDEX, value);
+ else
+ ASET (lface, LFACE_SLANT_INDEX, NILP (value) ? Qnormal : Qitalic);
prop_index = FONT_SLANT_INDEX;
}
else
@@ -4120,6 +4189,7 @@ Default face attributes override any local face attributes. */)
/* Ensure that the face vector is fully specified by merging
the previously-cached vector. */
memcpy (attrs, oldface->lface, sizeof attrs);
+
merge_face_vectors (NULL, f, lvec, attrs, 0);
vcopy (local_lface, 0, attrs, LFACE_VECTOR_SIZE);
newface = realize_face (c, lvec, DEFAULT_FACE_ID);
@@ -4886,6 +4956,13 @@ lookup_named_face (struct window *w, struct frame *f,
return -1;
memcpy (attrs, default_face->lface, sizeof attrs);
+
+ /* Make explicit any attributes whose value is 'reset'. */
+ int i;
+ for (i = 1; i < LFACE_VECTOR_SIZE; i++)
+ if (EQ (symbol_attrs[i], Qreset))
+ symbol_attrs[i] = attrs[i];
+
merge_face_vectors (w, f, symbol_attrs, attrs, 0);
return lookup_face (f, attrs);
@@ -5056,6 +5133,13 @@ lookup_derived_face (struct window *w,
default_face = FACE_FROM_ID (f, face_id);
memcpy (attrs, default_face->lface, sizeof attrs);
+
+ /* Make explicit any attributes whose value is 'reset'. */
+ int i;
+ for (i = 1; i < LFACE_VECTOR_SIZE; i++)
+ if (EQ (symbol_attrs[i], Qreset))
+ symbol_attrs[i] = attrs[i];
+
merge_face_vectors (w, f, symbol_attrs, attrs, 0);
return lookup_face (f, attrs);
}
@@ -5103,49 +5187,60 @@ gui_supports_face_attributes_p (struct frame *f,
struct face *def_face)
{
Lisp_Object *def_attrs = def_face->lface;
+ Lisp_Object lattrs[LFACE_VECTOR_SIZE];
+
+ /* Make explicit any attributes whose value is 'reset'. */
+ int i;
+ for (i = 1; i < LFACE_VECTOR_SIZE; i++)
+ {
+ if (EQ (attrs[i], Qreset))
+ lattrs[i] = def_attrs[i];
+ else
+ lattrs[i] = attrs[i];
+ }
/* Check that other specified attributes are different from the
default face. */
- if ((!UNSPECIFIEDP (attrs[LFACE_UNDERLINE_INDEX])
- && face_attr_equal_p (attrs[LFACE_UNDERLINE_INDEX],
+ if ((!UNSPECIFIEDP (lattrs[LFACE_UNDERLINE_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_UNDERLINE_INDEX],
def_attrs[LFACE_UNDERLINE_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_INVERSE_INDEX])
- && face_attr_equal_p (attrs[LFACE_INVERSE_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_INVERSE_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_INVERSE_INDEX],
def_attrs[LFACE_INVERSE_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_EXTEND_INDEX])
- && face_attr_equal_p (attrs[LFACE_EXTEND_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_EXTEND_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_EXTEND_INDEX],
def_attrs[LFACE_EXTEND_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_FOREGROUND_INDEX])
- && face_attr_equal_p (attrs[LFACE_FOREGROUND_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_FOREGROUND_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_FOREGROUND_INDEX],
def_attrs[LFACE_FOREGROUND_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_DISTANT_FOREGROUND_INDEX])
- && face_attr_equal_p (attrs[LFACE_DISTANT_FOREGROUND_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_DISTANT_FOREGROUND_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_DISTANT_FOREGROUND_INDEX],
def_attrs[LFACE_DISTANT_FOREGROUND_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_BACKGROUND_INDEX])
- && face_attr_equal_p (attrs[LFACE_BACKGROUND_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_BACKGROUND_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_BACKGROUND_INDEX],
def_attrs[LFACE_BACKGROUND_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX])
- && face_attr_equal_p (attrs[LFACE_STIPPLE_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_STIPPLE_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_STIPPLE_INDEX],
def_attrs[LFACE_STIPPLE_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX])
- && face_attr_equal_p (attrs[LFACE_OVERLINE_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_OVERLINE_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_OVERLINE_INDEX],
def_attrs[LFACE_OVERLINE_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX])
- && face_attr_equal_p (attrs[LFACE_STRIKE_THROUGH_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_STRIKE_THROUGH_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_STRIKE_THROUGH_INDEX],
def_attrs[LFACE_STRIKE_THROUGH_INDEX]))
- || (!UNSPECIFIEDP (attrs[LFACE_BOX_INDEX])
- && face_attr_equal_p (attrs[LFACE_BOX_INDEX],
+ || (!UNSPECIFIEDP (lattrs[LFACE_BOX_INDEX])
+ && face_attr_equal_p (lattrs[LFACE_BOX_INDEX],
def_attrs[LFACE_BOX_INDEX])))
return false;
/* Check font-related attributes, as those are the most commonly
"unsupported" on a window-system (because of missing fonts). */
- if (!UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX])
- || !UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX])
- || !UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX])
- || !UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX])
- || !UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX])
- || !UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]))
+ if (!UNSPECIFIEDP (lattrs[LFACE_FAMILY_INDEX])
+ || !UNSPECIFIEDP (lattrs[LFACE_FOUNDRY_INDEX])
+ || !UNSPECIFIEDP (lattrs[LFACE_HEIGHT_INDEX])
+ || !UNSPECIFIEDP (lattrs[LFACE_WEIGHT_INDEX])
+ || !UNSPECIFIEDP (lattrs[LFACE_SLANT_INDEX])
+ || !UNSPECIFIEDP (lattrs[LFACE_SWIDTH_INDEX]))
{
int face_id;
struct face *face;
@@ -5811,8 +5906,16 @@ realize_named_face (struct frame *f, Lisp_Object symbol, int id)
lface = Finternal_make_lisp_face (symbol, frame);
}
- /* Merge SYMBOL's face with the default face. */
+
get_lface_attributes_no_remap (f, symbol, symbol_attrs, true);
+
+ /* Handle the 'reset' pseudo-value of any attribute by replacing it
+ with the corresponding value of the default face. */
+ int i;
+ for (i = 1; i < LFACE_VECTOR_SIZE; i++)
+ if (EQ (symbol_attrs[i], Qreset))
+ symbol_attrs[i] = attrs[i];
+ /* Merge SYMBOL's face with the default face. */
merge_face_vectors (NULL, f, symbol_attrs, attrs, 0);
/* Realize the face. */
@@ -6750,7 +6853,21 @@ merge_faces (struct window *w, Lisp_Object face_name, int face_id,
if (!face)
return base_face_id;
- merge_face_vectors (w, f, face->lface, attrs, 0);
+ if (face_id != DEFAULT_FACE_ID)
+ {
+ struct face *deflt = FACE_FROM_ID (f, DEFAULT_FACE_ID);
+ Lisp_Object lface_attrs[LFACE_VECTOR_SIZE];
+ int i;
+
+ memcpy (lface_attrs, face->lface, LFACE_VECTOR_SIZE);
+ /* Make explicit any attributes whose value is 'reset'. */
+ for (i = 1; i < LFACE_VECTOR_SIZE; i++)
+ if (EQ (lface_attrs[i], Qreset))
+ lface_attrs[i] = deflt->lface[i];
+ merge_face_vectors (w, f, lface_attrs, attrs, 0);
+ }
+ else
+ merge_face_vectors (w, f, face->lface, attrs, 0);
}
/* Look up a realized face with the given face attributes,
@@ -7019,6 +7136,7 @@ syms_of_xfaces (void)
DEFSYM (Qblack, "black");
DEFSYM (Qoblique, "oblique");
DEFSYM (Qitalic, "italic");
+ DEFSYM (Qreset, "reset");
/* The symbols `foreground-color' and `background-color' which can be
used as part of a `face' property. This is for compatibility with
diff --git a/src/xfns.c b/src/xfns.c
index 9dcf73da1ca..748ea10c952 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3712,6 +3712,16 @@ setup_xi_event_mask (struct frame *f)
XIEventMask mask;
ptrdiff_t l = XIMaskLen (XI_LASTEVENT);
unsigned char *m;
+#ifndef HAVE_XINPUT2_1
+ /* Set up fallback values, since XIGetSelectedEvents doesn't work
+ with this version of libXi. */
+ XIEventMask *selected;
+
+ selected = xzalloc (sizeof *selected + l);
+ selected->mask = ((unsigned char *) selected) + sizeof *selected;
+ selected->mask_len = l;
+ selected->deviceid = XIAllMasterDevices;
+#endif
mask.mask = m = alloca (l);
memset (m, 0, l);
@@ -3736,6 +3746,12 @@ setup_xi_event_mask (struct frame *f)
FRAME_X_WINDOW (f),
&mask, 1);
+ /* Fortunately `xi_masks' isn't used on GTK 3, where we really have
+ to get the event mask from the X server. */
+#ifndef HAVE_XINPUT2_1
+ memcpy (selected->mask, m, l);
+#endif
+
memset (m, 0, l);
#endif /* !HAVE_GTK3 */
@@ -3775,6 +3791,12 @@ setup_xi_event_mask (struct frame *f)
XISelectEvents (FRAME_X_DISPLAY (f),
FRAME_X_WINDOW (f),
&mask, 1);
+
+#ifndef HAVE_XINPUT2_1
+ FRAME_X_OUTPUT (f)->xi_masks = selected;
+ FRAME_X_OUTPUT (f)->num_xi_masks = 1;
+#endif
+
unblock_input ();
}
#endif
@@ -4935,7 +4957,10 @@ This function is an internal primitive--use `make-frame' instead. */)
x_icon (f, parms);
x_make_gc (f);
-#ifdef HAVE_XINPUT2
+ /* While this function is present in versions of libXi that only
+ support 2.0, it does not release the display lock after
+ finishing, leading to a deadlock. */
+#if defined HAVE_XINPUT2 && defined HAVE_XINPUT2_1
if (dpyinfo->supports_xi2)
FRAME_X_OUTPUT (f)->xi_masks
= XIGetSelectedEvents (dpyinfo->display, FRAME_X_WINDOW (f),
@@ -5387,9 +5412,9 @@ DEFUN ("x-server-input-extension-version", Fx_server_input_extension_version,
doc: /* Return the version of the X Input Extension supported by TERMINAL.
The value is nil if TERMINAL's X server doesn't support the X Input
Extension extension, or if Emacs doesn't support the version present
-on that server. Otherwise, the return value is a list of the the
-major and minor versions of the X Input Extension extension running on
-that server. */)
+on that server. Otherwise, the return value is a list of the major
+and minor versions of the X Input Extension extension running on that
+server. */)
(Lisp_Object terminal)
{
#ifdef HAVE_XINPUT2
@@ -6938,7 +6963,7 @@ that mouse buttons are being held down, such as immediately after a
xaction = FRAME_DISPLAY_INFO (f)->Xatom_XdndActionAsk;
else if (SYMBOLP (action))
/* This is to accommodate non-standard DND protocols such as XDS
- that are explictly implemented by Emacs, and is not documented
+ that are explicitly implemented by Emacs, and is not documented
for that reason. */
xaction = symbol_to_x_atom (FRAME_DISPLAY_INFO (f), action);
else if (CONSP (action))
@@ -7339,18 +7364,23 @@ If VALUE is a string and FORMAT is 32, then the format of VALUE is
system-specific. VALUE must contain unsigned integer data in native
endian-ness in multiples of the size of the C type 'long': the low 32
bits of each such number are used as the value of each element of the
-property. */)
+property.
+
+Wait for the request to complete and signal any error, unless
+`x-fast-protocol-requests' is non-nil, in which case errors will be
+silently ignored. */)
(Lisp_Object prop, Lisp_Object value, Lisp_Object frame,
Lisp_Object type, Lisp_Object format, Lisp_Object outer_p,
Lisp_Object window_id)
{
- struct frame *f = decode_window_system_frame (frame);
+ struct frame *f;
Atom prop_atom;
Atom target_type = XA_STRING;
int element_format = 8;
unsigned char *data;
int nelements;
Window target_window;
+ struct x_display_info *dpyinfo;
#ifdef USE_XCB
bool intern_prop;
bool intern_target;
@@ -7361,6 +7391,9 @@ property. */)
bool rc;
#endif
+ f = decode_window_system_frame (frame);
+ dpyinfo = FRAME_DISPLAY_INFO (f);
+
CHECK_STRING (prop);
if (! NILP (format))
@@ -7412,7 +7445,7 @@ property. */)
{
CONS_TO_INTEGER (window_id, Window, target_window);
if (! target_window)
- target_window = FRAME_DISPLAY_INFO (f)->root_window;
+ target_window = dpyinfo->root_window;
}
else
{
@@ -7424,47 +7457,47 @@ property. */)
block_input ();
#ifndef USE_XCB
- prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f),
- SSDATA (prop), false);
+ prop_atom = x_intern_cached_atom (dpyinfo, SSDATA (prop),
+ false);
if (! NILP (type))
{
CHECK_STRING (type);
- target_type = x_intern_cached_atom (FRAME_DISPLAY_INFO (f),
- SSDATA (type), false);
+ target_type = x_intern_cached_atom (dpyinfo, SSDATA (type),
+ false);
}
#else
rc = true;
intern_target = true;
intern_prop = true;
- prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f),
- SSDATA (prop), true);
+ prop_atom = x_intern_cached_atom (dpyinfo, SSDATA (prop),
+ true);
if (prop_atom != None)
intern_prop = false;
else
prop_atom_cookie
- = xcb_intern_atom (FRAME_DISPLAY_INFO (f)->xcb_connection,
+ = xcb_intern_atom (dpyinfo->xcb_connection,
0, SBYTES (prop), SSDATA (prop));
if (!NILP (type))
{
CHECK_STRING (type);
- target_type = x_intern_cached_atom (FRAME_DISPLAY_INFO (f),
- SSDATA (type), true);
+ target_type = x_intern_cached_atom (dpyinfo, SSDATA (type),
+ true);
if (target_type)
intern_target = false;
else
target_type_cookie
- = xcb_intern_atom (FRAME_DISPLAY_INFO (f)->xcb_connection,
+ = xcb_intern_atom (dpyinfo->xcb_connection,
0, SBYTES (type), SSDATA (type));
}
if (intern_prop)
{
- reply = xcb_intern_atom_reply (FRAME_DISPLAY_INFO (f)->xcb_connection,
+ reply = xcb_intern_atom_reply (dpyinfo->xcb_connection,
prop_atom_cookie, &generic_error);
if (reply)
@@ -7481,7 +7514,7 @@ property. */)
if (!NILP (type) && intern_target)
{
- reply = xcb_intern_atom_reply (FRAME_DISPLAY_INFO (f)->xcb_connection,
+ reply = xcb_intern_atom_reply (dpyinfo->xcb_connection,
target_type_cookie, &generic_error);
if (reply)
@@ -7500,15 +7533,18 @@ property. */)
error ("Failed to intern type or property atom");
#endif
- x_catch_errors (FRAME_X_DISPLAY (f));
- XChangeProperty (FRAME_X_DISPLAY (f), target_window,
- prop_atom, target_type, element_format, PropModeReplace,
- data, nelements);
+ x_catch_errors_for_lisp (dpyinfo);
- if (CONSP (value)) xfree (data);
- x_check_errors (FRAME_X_DISPLAY (f),
- "Couldn't change window property: %s");
- x_uncatch_errors_after_check ();
+ XChangeProperty (dpyinfo->display, target_window,
+ prop_atom, target_type, element_format,
+ PropModeReplace, data, nelements);
+
+ if (CONSP (value))
+ xfree (data);
+
+ x_check_errors_for_lisp (dpyinfo,
+ "Couldn't change window property: %s");
+ x_uncatch_errors_for_lisp (dpyinfo);
unblock_input ();
return value;
@@ -7525,7 +7561,11 @@ If WINDOW-ID is non-nil, remove property from that window instead
across X displays or screens on the same display, so FRAME provides
context for the window ID.
-Value is PROP. */)
+Value is PROP.
+
+Wait for the request to complete and signal any error, unless
+`x-fast-protocol-requests' is non-nil, in which case errors will be
+silently ignored. */)
(Lisp_Object prop, Lisp_Object frame, Lisp_Object window_id)
{
struct frame *f = decode_window_system_frame (frame);
@@ -7545,11 +7585,11 @@ Value is PROP. */)
prop_atom = x_intern_cached_atom (FRAME_DISPLAY_INFO (f),
SSDATA (prop), false);
- x_catch_errors (FRAME_X_DISPLAY (f));
+ x_catch_errors_for_lisp (FRAME_DISPLAY_INFO (f));
XDeleteProperty (FRAME_X_DISPLAY (f), target_window, prop_atom);
- x_check_errors (FRAME_X_DISPLAY (f),
- "Couldn't delete window property: %s");
- x_uncatch_errors_after_check ();
+ x_check_errors_for_lisp (FRAME_DISPLAY_INFO (f),
+ "Couldn't delete window property: %s");
+ x_uncatch_errors_for_lisp (FRAME_DISPLAY_INFO (f));
unblock_input ();
return prop;
@@ -8810,9 +8850,8 @@ DEFUN ("x-double-buffered-p", Fx_double_buffered_p, Sx_double_buffered_p,
doc: /* Return t if FRAME is being double buffered. */)
(Lisp_Object frame)
{
- struct frame *f = decode_live_frame (frame);
-
#ifdef HAVE_XDBE
+ struct frame *f = decode_live_frame (frame);
return FRAME_X_DOUBLE_BUFFERED_P (f) ? Qt : Qnil;
#else
return Qnil;
diff --git a/src/xmenu.c b/src/xmenu.c
index 7134bf22c83..e5e24b87d16 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -261,20 +261,10 @@ x_menu_translate_generic_event (XEvent *event)
copy.xbutton.y = lrint (xev->event_y);
copy.xbutton.x_root = lrint (xev->root_x);
copy.xbutton.y_root = lrint (xev->root_y);
- copy.xbutton.state = xev->mods.effective;
+ copy.xbutton.state = xi_convert_event_state (xev);
copy.xbutton.button = xev->detail;
copy.xbutton.same_screen = True;
- if (xev->buttons.mask_len)
- {
- if (XIMaskIsSet (xev->buttons.mask, 1))
- copy.xbutton.state |= Button1Mask;
- if (XIMaskIsSet (xev->buttons.mask, 2))
- copy.xbutton.state |= Button2Mask;
- if (XIMaskIsSet (xev->buttons.mask, 3))
- copy.xbutton.state |= Button3Mask;
- }
-
XPutBackEvent (dpyinfo->display, &copy);
break;
@@ -397,7 +387,7 @@ popup_get_selection (XEvent *initial_event, struct x_display_info *dpyinfo,
copy.xbutton.y = lrint (xev->event_y);
copy.xbutton.x_root = lrint (xev->root_x);
copy.xbutton.y_root = lrint (xev->root_y);
- copy.xbutton.state = xev->mods.effective;
+ copy.xbutton.state = xi_convert_event_state (xev);
copy.xbutton.button = xev->detail;
copy.xbutton.same_screen = True;
@@ -412,16 +402,6 @@ popup_get_selection (XEvent *initial_event, struct x_display_info *dpyinfo,
copy.xbutton.state = 0;
#endif
- if (xev->buttons.mask_len)
- {
- if (XIMaskIsSet (xev->buttons.mask, 1))
- copy.xbutton.state |= Button1Mask;
- if (XIMaskIsSet (xev->buttons.mask, 2))
- copy.xbutton.state |= Button2Mask;
- if (XIMaskIsSet (xev->buttons.mask, 3))
- copy.xbutton.state |= Button3Mask;
- }
-
break;
}
case XI_KeyPress:
@@ -442,7 +422,7 @@ popup_get_selection (XEvent *initial_event, struct x_display_info *dpyinfo,
copy.xkey.y = lrint (xev->event_y);
copy.xkey.x_root = lrint (xev->root_x);
copy.xkey.y_root = lrint (xev->root_y);
- copy.xkey.state = xev->mods.effective;
+ copy.xkey.state = xi_convert_event_state (xev);
copy.xkey.keycode = xev->detail;
copy.xkey.same_screen = True;
@@ -996,8 +976,6 @@ set_frame_menubar (struct frame *f, bool deep_p)
/* If it has changed current-menubar from previous value,
really recompute the menubar from the value. */
- if (! NILP (Vlucid_menu_bar_dirty_flag))
- call0 (Qrecompute_lucid_menubar);
safe_run_hooks (Qmenu_bar_update_hook);
fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
diff --git a/src/xselect.c b/src/xselect.c
index 41fa837c5a4..1750cfb8bd8 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -40,8 +40,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <X11/Xproto.h>
-static Time pending_dnd_time;
-
struct prop_location;
struct selection_data;
@@ -165,6 +163,12 @@ symbol_to_x_atom (struct x_display_info *dpyinfo, Lisp_Object sym)
return dpyinfo->Xatom_XmTRANSFER_SUCCESS;
if (EQ (sym, QXmTRANSFER_FAILURE))
return dpyinfo->Xatom_XmTRANSFER_FAILURE;
+ if (EQ (sym, QXdndDirectSave0))
+ return dpyinfo->Xatom_XdndDirectSave0;
+ if (EQ (sym, Qtext_plain))
+ return dpyinfo->Xatom_text_plain;
+ if (EQ (sym, QXdndActionDirectSave))
+ return dpyinfo->Xatom_XdndActionDirectSave;
if (!SYMBOLP (sym))
emacs_abort ();
@@ -233,6 +237,12 @@ x_atom_to_symbol (struct x_display_info *dpyinfo, Atom atom)
return QXmTRANSFER_SUCCESS;
if (atom == dpyinfo->Xatom_XmTRANSFER_FAILURE)
return QXmTRANSFER_FAILURE;
+ if (atom == dpyinfo->Xatom_XdndDirectSave0)
+ return QXdndDirectSave0;
+ if (atom == dpyinfo->Xatom_text_plain)
+ return Qtext_plain;
+ if (atom == dpyinfo->Xatom_XdndActionDirectSave)
+ return QXdndActionDirectSave;
x_catch_errors (dpyinfo->display);
str = x_get_atom_name (dpyinfo, atom, NULL);
@@ -253,7 +263,7 @@ x_atom_to_symbol (struct x_display_info *dpyinfo, Atom atom)
TIMESTAMP should be the timestamp where selection ownership will be
assumed.
DND_DATA is the local value that will be used for selection requests
- with `pending_dnd_time'.
+ with `dpyinfo->pending_dnd_time'.
Update the Vselection_alist so that we can reply to later requests for
our selection. */
@@ -427,10 +437,19 @@ static void
x_decline_selection_request (struct selection_input_event *event)
{
XEvent reply_base;
- XSelectionEvent *reply = &(reply_base.xselection);
+ XSelectionEvent *reply;
+ Display *dpy;
+ struct x_display_info *dpyinfo;
+
+ reply = &(reply_base.xselection);
+ dpy = SELECTION_EVENT_DISPLAY (event);
+ dpyinfo = x_display_info_for_display (dpy);
+
+ if (!dpyinfo)
+ return;
reply->type = SelectionNotify;
- reply->display = SELECTION_EVENT_DISPLAY (event);
+ reply->display = dpy;
reply->requestor = SELECTION_EVENT_REQUESTOR (event);
reply->selection = SELECTION_EVENT_SELECTION (event);
reply->time = SELECTION_EVENT_TIME (event);
@@ -440,10 +459,12 @@ x_decline_selection_request (struct selection_input_event *event)
/* The reason for the error may be that the receiver has
died in the meantime. Handle that case. */
block_input ();
- x_catch_errors (reply->display);
- XSendEvent (reply->display, reply->requestor, False, 0, &reply_base);
- XFlush (reply->display);
- x_uncatch_errors ();
+ x_ignore_errors_for_next_request (dpyinfo);
+ XSendEvent (dpyinfo->display, reply->requestor,
+ False, 0, &reply_base);
+ x_stop_ignoring_errors (dpyinfo);
+
+ XFlush (dpyinfo->display);
unblock_input ();
}
@@ -843,8 +864,11 @@ x_handle_selection_request (struct selection_input_event *event)
/* This is how the XDND protocol recommends dropping text onto a
target that doesn't support XDND. */
- if (SELECTION_EVENT_TIME (event) == pending_dnd_time + 1
- || SELECTION_EVENT_TIME (event) == pending_dnd_time + 2)
+ if (dpyinfo->pending_dnd_time
+ && ((SELECTION_EVENT_TIME (event)
+ == dpyinfo->pending_dnd_time + 1)
+ || (SELECTION_EVENT_TIME (event)
+ == dpyinfo->pending_dnd_time + 2)))
use_alternate = true;
block_input ();
@@ -1067,20 +1091,23 @@ x_handle_selection_event (struct selection_input_event *event)
void
x_clear_frame_selections (struct frame *f)
{
- Lisp_Object frame;
- Lisp_Object rest;
+ Lisp_Object frame, rest, lost;
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
struct terminal *t = dpyinfo->terminal;
XSETFRAME (frame, f);
+ lost = Qnil;
/* Delete elements from the beginning of Vselection_alist. */
while (CONSP (t->Vselection_alist)
&& EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (t->Vselection_alist)))))))
{
- /* Run the `x-lost-selection-functions' abnormal hook. */
- CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
- Fcar (Fcar (t->Vselection_alist)));
+ if (!x_auto_preserve_selections)
+ /* Run the `x-lost-selection-functions' abnormal hook. */
+ CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
+ Fcar (Fcar (t->Vselection_alist)));
+ else
+ lost = Fcons (Fcar (t->Vselection_alist), lost);
tset_selection_alist (t, XCDR (t->Vselection_alist));
}
@@ -1090,11 +1117,18 @@ x_clear_frame_selections (struct frame *f)
if (CONSP (XCDR (rest))
&& EQ (frame, XCAR (XCDR (XCDR (XCDR (XCAR (XCDR (rest))))))))
{
- CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
- XCAR (XCAR (XCDR (rest))));
+ if (!x_auto_preserve_selections)
+ CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
+ XCAR (XCAR (XCDR (rest))));
+ else
+ lost = Fcons (XCAR (XCDR (rest)), lost);
+
XSETCDR (rest, XCDR (XCDR (rest)));
break;
}
+
+ if (x_auto_preserve_selections)
+ x_preserve_selections (dpyinfo, lost, frame);
}
/* True if any properties for DISPLAY and WINDOW
@@ -2325,9 +2359,13 @@ run. */)
Lisp_Object name, timestamp, frame, result;
CHECK_SYMBOL (target);
- name = Fnth (make_fixnum (0), value);
- timestamp = Fnth (make_fixnum (2), value);
- frame = Fnth (make_fixnum (3), value);
+
+ /* Check that VALUE has 4 elements, for x_get_local_selection. */
+ Lisp_Object v = value; CHECK_CONS (v);
+ name = XCAR (v); v = XCDR (v); CHECK_CONS (v);
+ v = XCDR (v); CHECK_CONS (v);
+ timestamp = XCAR (v); v = XCDR (v); CHECK_CONS (v);
+ frame = XCAR (v);
CHECK_SYMBOL (name);
CONS_TO_INTEGER (timestamp, Time, time);
@@ -2749,7 +2787,11 @@ to send. If a value is a string, it is converted to an Atom and the value of
the Atom is sent. If a value is a cons, it is converted to a 32 bit number
with the high 16 bits from the car and the lower 16 bit from the cdr.
If more values than fits into the event is given, the excessive values
-are ignored. */)
+are ignored.
+
+Wait for the event to be sent and signal any error, unless
+`x-fast-protocol-requests' is non-nil, in which case errors will be
+silently ignored. */)
(Lisp_Object display, Lisp_Object dest, Lisp_Object from,
Lisp_Object message_type, Lisp_Object format, Lisp_Object values)
{
@@ -2830,7 +2872,7 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from,
the destination window. But if we are sending to the root window,
there is no such client. Then we set the event mask to 0xffffff. The
event then goes to clients selecting for events on the root window. */
- x_catch_errors (dpyinfo->display);
+ x_catch_errors_for_lisp (dpyinfo);
{
bool propagate = !to_root;
long mask = to_root ? 0xffffff : 0;
@@ -2838,7 +2880,8 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from,
XSendEvent (dpyinfo->display, wdest, propagate, mask, &event);
XFlush (dpyinfo->display);
}
- x_uncatch_errors ();
+ x_check_errors_for_lisp (dpyinfo, "Failed to send client event: %s");
+ x_uncatch_errors_for_lisp (dpyinfo);
unblock_input ();
}
@@ -2863,12 +2906,6 @@ x_timestamp_for_selection (struct x_display_info *dpyinfo,
return value;
}
-void
-x_set_pending_dnd_time (Time time)
-{
- pending_dnd_time = time;
-}
-
static void syms_of_xselect_for_pdumper (void);
void
@@ -2989,6 +3026,9 @@ Note that this does not affect setting or owning selections. */);
DEFSYM (QCLIPBOARD_MANAGER, "CLIPBOARD_MANAGER");
DEFSYM (QSAVE_TARGETS, "SAVE_TARGETS");
DEFSYM (QNULL, "NULL");
+ DEFSYM (QXdndDirectSave0, "XdndDirectSave0");
+ DEFSYM (QXdndActionDirectSave, "XdndActionDirectSave");
+ DEFSYM (Qtext_plain, "text/plain");
DEFSYM (Qforeign_selection, "foreign-selection");
DEFSYM (Qx_lost_selection_functions, "x-lost-selection-functions");
DEFSYM (Qx_sent_selection_functions, "x-sent-selection-functions");
diff --git a/src/xterm.c b/src/xterm.c
index 500443ebaa1..94fb0bfa1a0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -233,18 +233,19 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
EMACS_CHECK_MODULES([XFIXES], [$XFIXES_MODULES])
if test $HAVE_XFIXES = no; then
# Test old way in case pkg-config doesn't have it (older machines).
- AC_CHECK_HEADER(X11/extensions/Xfixes.h,
- [AC_CHECK_LIB(Xfixes, XFixesHideCursor, HAVE_XFIXES=yes)])
+ AC_CHECK_HEADER([X11/extensions/Xfixes.h],
+ [AC_CHECK_LIB([Xfixes], [XFixesHideCursor], [HAVE_XFIXES=yes])])
if test $HAVE_XFIXES = yes; then
XFIXES_LIBS=-lXfixes
fi
fi
if test $HAVE_XFIXES = yes; then
- AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have the Xfixes extension.])
+ AC_DEFINE([HAVE_XFIXES], [1],
+ [Define to 1 if you have the Xfixes extension.])
fi
fi
- AC_SUBST(XFIXES_CFLAGS)
- AC_SUBST(XFIXES_LIBS)
+ AC_SUBST([XFIXES_CFLAGS])
+ AC_SUBST([XFIXES_LIBS])
Then, make sure to adjust CFLAGS and LIBES in src/Makefile.in and
add the new XFIXES_CFLAGS and XFIXES_LIBS variables to
@@ -497,7 +498,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
data.l[1] = timestamp
data.l[2] = low 32 bits of a provided frame counter value
data.l[3] = high 32 bits of a provided frame counter value
- data.l[4] = 1 if the the extended frame counter should be updated,
+ data.l[4] = 1 if the extended frame counter should be updated,
otherwise 0
Upon receiving such an event, Emacs constructs and saves a counter
@@ -804,6 +805,20 @@ static int current_finish;
static struct input_event *current_hold_quit;
#endif
+#ifdef HAVE_XINPUT2
+#ifndef X_XIGrabDevice
+#define X_XIGrabDevice 51
+#endif
+
+#ifndef X_XIUngrabDevice
+#define X_XIUngrabDevice 52
+#endif
+
+#ifndef X_XIAllowEvents
+#define X_XIAllowEvents 53
+#endif
+#endif
+
/* Queue selection requests in `pending_selection_requests' if more
than 0. */
static int x_use_pending_selection_requests;
@@ -1021,6 +1036,10 @@ static const struct x_atom_ref x_atom_refs[] =
ATOM_REFS_INIT ("XdndLeave", Xatom_XdndLeave)
ATOM_REFS_INIT ("XdndDrop", Xatom_XdndDrop)
ATOM_REFS_INIT ("XdndFinished", Xatom_XdndFinished)
+ /* XDS source and target. */
+ ATOM_REFS_INIT ("XdndDirectSave0", Xatom_XdndDirectSave0)
+ ATOM_REFS_INIT ("XdndActionDirectSave", Xatom_XdndActionDirectSave)
+ ATOM_REFS_INIT ("text/plain", Xatom_text_plain)
/* Motif drop protocol support. */
ATOM_REFS_INIT ("_MOTIF_DRAG_WINDOW", Xatom_MOTIF_DRAG_WINDOW)
ATOM_REFS_INIT ("_MOTIF_DRAG_TARGETS", Xatom_MOTIF_DRAG_TARGETS)
@@ -1116,7 +1135,6 @@ static void x_scroll_bar_end_update (struct x_display_info *, struct scroll_bar
#ifdef HAVE_X_I18N
static int x_filter_event (struct x_display_info *, XEvent *);
#endif
-static void x_ignore_errors_for_next_request (struct x_display_info *);
static void x_clean_failable_requests (struct x_display_info *);
static struct frame *x_tooltip_window_to_frame (struct x_display_info *,
@@ -1128,10 +1146,6 @@ static Window x_get_window_below (Display *, Window, int, int, int *, int *);
/* Flag that indicates if a drag-and-drop operation is in progress. */
bool x_dnd_in_progress;
-/* Number that indicates the last "generation" of
- UNSUPPORTED_DROP_EVENTs handled. */
-unsigned x_dnd_unsupported_event_level;
-
/* The frame where the drag-and-drop operation originated. */
struct frame *x_dnd_frame;
@@ -1146,6 +1160,20 @@ struct frame *x_dnd_finish_frame;
important information. */
bool x_dnd_waiting_for_finish;
+/* Flag that means (when set in addition to
+ `x_dnd_waiting_for_finish') to run the unsupported drop function
+ with the given arguments. */
+static bool x_dnd_run_unsupported_drop_function;
+
+/* The "before"-time of the unsupported drop. */
+static Time x_dnd_unsupported_drop_time;
+
+/* The target window of the unsupported drop. */
+static Window x_dnd_unsupported_drop_window;
+
+/* The Lisp data associated with the unsupported drop function. */
+static Lisp_Object x_dnd_unsupported_drop_data;
+
/* Whether or not to move the tooltip along with the mouse pointer
during drag-and-drop. */
static bool x_dnd_update_tooltip;
@@ -1257,6 +1285,13 @@ static Window x_dnd_waiting_for_status_window;
upon receiving an XdndStatus event from said window. */
static XEvent x_dnd_pending_send_position;
+/* If true, send a drop from `x_dnd_finish_frame' to the pending
+ status window after receiving all pending XdndStatus events. */
+static bool x_dnd_need_send_drop;
+
+/* The protocol version of any such drop. */
+static int x_dnd_send_drop_proto;
+
/* The action the drop target actually chose to perform.
Under XDND, this is set upon receiving the XdndFinished or
@@ -1398,7 +1433,7 @@ static bool x_dnd_use_toplevels;
/* Motif drag-and-drop protocol support. */
/* Pointer to a variable which stores whether or not an X error
- occured while trying to create the Motif drag window. */
+ occurred while trying to create the Motif drag window. */
static volatile bool *xm_drag_window_error;
typedef enum xm_byte_order
@@ -1828,10 +1863,47 @@ xm_drag_window_io_error_handler (Display *dpy)
siglongjmp (x_dnd_disconnect_handler, 1);
}
+/* Determine whether or not WINDOW exists on DPYINFO by selecting for
+ input from it. */
+static bool
+x_special_window_exists_p (struct x_display_info *dpyinfo,
+ Window window)
+{
+ bool rc;
+
+ x_catch_errors (dpyinfo->display);
+ XSelectInput (dpyinfo->display, window,
+ StructureNotifyMask);
+ rc = !x_had_errors_p (dpyinfo->display);
+ x_uncatch_errors_after_check ();
+
+ return rc;
+}
+
+/* Drag window creation strategy (very tricky, but race-free):
+
+ First look for _MOTIF_DRAG_WINDOW. If it is already present,
+ return it immediately to avoid the overhead of new display
+ connections.
+
+ Otherwise, create a new connection to the display. In that
+ connection, create a window, which will be the new drag window. Set
+ the client disconnect mode of the new connection to
+ RetainPermanent, and close it.
+
+ Grab the current display. Look up _MOTIF_DRAG_WINDOW, the current
+ drag window. If it exists (which means _MOTIF_DRAG_WINDOW was
+ created between the first step and now), kill the client that
+ created the new drag window to free the client slot on the X
+ server. Otherwise, set _MOTIF_DRAG_WINDOW to the new drag window.
+
+ Ungrab the display and return whichever window is currently in
+ _MOTIF_DRAG_WINDOW. */
+
static Window
xm_get_drag_window_1 (struct x_display_info *dpyinfo)
{
- Atom actual_type, _MOTIF_DRAG_WINDOW;
+ Atom actual_type;
int rc, actual_format;
unsigned long nitems, bytes_remaining;
unsigned char *tmp_data = NULL;
@@ -1841,9 +1913,9 @@ xm_get_drag_window_1 (struct x_display_info *dpyinfo)
Emacs_XErrorHandler old_handler;
Emacs_XIOErrorHandler old_io_handler;
- /* These are volatile because GCC mistakenly warns about them being
+ /* This is volatile because GCC mistakenly warns about them being
clobbered by longjmp. */
- volatile bool error, created;
+ volatile bool error;
drag_window = None;
rc = XGetWindowProperty (dpyinfo->display, dpyinfo->root_window,
@@ -1852,26 +1924,20 @@ xm_get_drag_window_1 (struct x_display_info *dpyinfo)
&actual_format, &nitems, &bytes_remaining,
&tmp_data) == Success;
- if (rc)
+ if (rc && actual_type == XA_WINDOW
+ && actual_format == 32 && nitems == 1
+ && tmp_data)
{
- if (actual_type == XA_WINDOW
- && actual_format == 32 && nitems == 1)
- {
- drag_window = *(Window *) tmp_data;
- x_catch_errors (dpyinfo->display);
- XSelectInput (dpyinfo->display, drag_window,
- StructureNotifyMask);
- rc = !x_had_errors_p (dpyinfo->display);
- x_uncatch_errors_after_check ();
-
- if (!rc)
- drag_window = None;
- }
+ drag_window = *(Window *) tmp_data;
+ rc = x_special_window_exists_p (dpyinfo, drag_window);
- if (tmp_data)
- XFree (tmp_data);
+ if (!rc)
+ drag_window = None;
}
+ if (tmp_data)
+ XFree (tmp_data);
+
if (drag_window == None)
{
block_input ();
@@ -1900,74 +1966,22 @@ xm_get_drag_window_1 (struct x_display_info *dpyinfo)
error = false;
xm_drag_window_error = &error;
- XGrabServer (temp_display);
XSetCloseDownMode (temp_display, RetainPermanent);
-
old_handler = XSetErrorHandler (xm_drag_window_error_handler);
- _MOTIF_DRAG_WINDOW = XInternAtom (temp_display,
- "_MOTIF_DRAG_WINDOW", False);
-
- if (error)
- goto give_up;
-
- /* Some other program might've created a drag window between now
- and when we first looked. Use that if it exists. */
-
- tmp_data = NULL;
- rc = XGetWindowProperty (temp_display, DefaultRootWindow (temp_display),
- _MOTIF_DRAG_WINDOW, 0, 1, False, XA_WINDOW,
- &actual_type, &actual_format, &nitems,
- &bytes_remaining, &tmp_data) == Success;
-
- if (rc && actual_type == XA_WINDOW
- && actual_format == 32 && nitems == 1
- && tmp_data)
- drag_window = *(Window *) tmp_data;
-
- if (tmp_data)
- XFree (tmp_data);
-
- error = false;
-
- if (drag_window == None)
- {
- created = true;
-
- attrs.override_redirect = True;
- drag_window = XCreateWindow (temp_display, DefaultRootWindow (temp_display),
- -1, -1, 1, 1, 0, CopyFromParent, InputOnly,
- CopyFromParent, CWOverrideRedirect, &attrs);
- XChangeProperty (temp_display, DefaultRootWindow (temp_display),
- _MOTIF_DRAG_WINDOW, XA_WINDOW, 32, PropModeReplace,
- (unsigned char *) &drag_window, 1);
- }
- else
- created = false;
+ attrs.override_redirect = True;
+ drag_window = XCreateWindow (temp_display, DefaultRootWindow (temp_display),
+ -1, -1, 1, 1, 0, CopyFromParent, InputOnly,
+ CopyFromParent, CWOverrideRedirect, &attrs);
/* Handle all errors now. */
XSync (temp_display, False);
- give_up:
-
/* Some part of the drag window creation process failed, so
- punt. */
+ punt. Release all resources too. */
if (error)
{
XSetCloseDownMode (temp_display, DestroyAll);
-
- /* If the drag window was actually created, delete it now.
- Probably, a BadAlloc happened during the XChangeProperty
- request. */
- if (created)
- {
- if (drag_window != None)
- XDestroyWindow (temp_display, drag_window);
-
- XDeleteProperty (temp_display, DefaultRootWindow (temp_display),
- _MOTIF_DRAG_WINDOW);
- }
-
drag_window = None;
}
@@ -1985,15 +1999,49 @@ xm_get_drag_window_1 (struct x_display_info *dpyinfo)
/* Make sure the drag window created is actually valid for the
current display, and the XOpenDisplay above didn't
accidentally connect to some other display. */
- x_catch_errors (dpyinfo->display);
- XSelectInput (dpyinfo->display, drag_window, StructureNotifyMask);
- rc = !x_had_errors_p (dpyinfo->display);
- x_uncatch_errors_after_check ();
+ if (!x_special_window_exists_p (dpyinfo, drag_window))
+ drag_window = None;
unblock_input ();
- /* We connected to the wrong display, so just give up. */
- if (!rc)
- drag_window = None;
+ if (drag_window != None)
+ {
+ XGrabServer (dpyinfo->display);
+
+ x_catch_errors (dpyinfo->display);
+ tmp_data = NULL;
+
+ rc = XGetWindowProperty (dpyinfo->display, dpyinfo->root_window,
+ dpyinfo->Xatom_MOTIF_DRAG_WINDOW,
+ 0, 1, False, XA_WINDOW, &actual_type,
+ &actual_format, &nitems, &bytes_remaining,
+ &tmp_data) == Success;
+
+ if (rc && actual_type == XA_WINDOW
+ && actual_format == 32 && nitems == 1
+ && tmp_data
+ && x_special_window_exists_p (dpyinfo,
+ *(Window *) tmp_data))
+ {
+ /* Kill the client now to avoid leaking a client slot,
+ which is a limited resource. */
+ XKillClient (dpyinfo->display, drag_window);
+ drag_window = *(Window *) tmp_data;
+ }
+ else
+ XChangeProperty (dpyinfo->display, dpyinfo->root_window,
+ dpyinfo->Xatom_MOTIF_DRAG_WINDOW,
+ XA_WINDOW, 32, PropModeReplace,
+ (unsigned char *) &drag_window, 1);
+
+ if (tmp_data)
+ XFree (tmp_data);
+
+ if (x_had_errors_p (dpyinfo->display))
+ drag_window = None;
+ x_uncatch_errors ();
+
+ XUngrabServer (dpyinfo->display);
+ }
}
return drag_window;
@@ -2049,7 +2097,7 @@ xm_setup_dnd_targets (struct x_display_info *dpyinfo,
&actual_type, &actual_format, &nitems,
&bytes_remaining, &tmp_data) == Success;
had_errors = x_had_errors_p (dpyinfo->display);
- x_uncatch_errors ();
+ x_uncatch_errors_after_check ();
/* The drag window is probably invalid, so remove our record of
it. */
@@ -2260,7 +2308,7 @@ xm_get_drag_atom_1 (struct x_display_info *dpyinfo,
&actual_format, &nitems, &bytes_remaining,
&tmp_data);
atom = None;
- /* GCC thinks i is used unitialized, but it's always initialized if
+ /* GCC thinks i is used uninitialized, but it's always initialized if
`atoms' exists at that particular spot. */
i = 0;
@@ -2421,6 +2469,7 @@ xm_send_drop_message (struct x_display_info *dpyinfo, Window source,
x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (dpyinfo->display, target, False, NoEventMask, &msg);
+ x_stop_ignoring_errors (dpyinfo);
}
static void
@@ -2447,6 +2496,7 @@ xm_send_top_level_enter_message (struct x_display_info *dpyinfo, Window source,
x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (dpyinfo->display, target, False, NoEventMask, &msg);
+ x_stop_ignoring_errors (dpyinfo);
}
static void
@@ -2477,6 +2527,7 @@ xm_send_drag_motion_message (struct x_display_info *dpyinfo, Window source,
x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (dpyinfo->display, target, False, NoEventMask, &msg);
+ x_stop_ignoring_errors (dpyinfo);
}
static void
@@ -2535,6 +2586,7 @@ xm_send_top_level_leave_message (struct x_display_info *dpyinfo, Window source,
x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (dpyinfo->display, target, False, NoEventMask, &msg);
+ x_stop_ignoring_errors (dpyinfo);
}
static int
@@ -2758,6 +2810,7 @@ x_dnd_free_toplevels (bool display_alive)
unsigned long *prev_masks;
specpdl_ref count;
Display *dpy;
+ struct x_display_info *dpyinfo;
if (!x_dnd_toplevels)
/* Probably called inside an IO error handler. */
@@ -2825,17 +2878,22 @@ x_dnd_free_toplevels (bool display_alive)
if (display_alive)
{
- x_catch_errors (dpy);
+ dpyinfo = x_display_info_for_display (dpy);
- for (i = 0; i < n_windows; ++i)
+ if (n_windows)
{
- XSelectInput (dpy, destroy_windows[i], prev_masks[i]);
+ x_ignore_errors_for_next_request (dpyinfo);
+
+ for (i = 0; i < n_windows; ++i)
+ {
+ XSelectInput (dpy, destroy_windows[i], prev_masks[i]);
#ifdef HAVE_XSHAPE
- XShapeSelectInput (dpy, destroy_windows[i], None);
+ XShapeSelectInput (dpy, destroy_windows[i], None);
#endif
- }
+ }
- x_uncatch_errors ();
+ x_stop_ignoring_errors (dpyinfo);
+ }
}
unbind_to (count, Qnil);
@@ -3188,6 +3246,7 @@ x_dnd_compute_toplevels (struct x_display_info *dpyinfo)
XShapeSelectInput (dpyinfo->display,
toplevels[i],
ShapeNotifyMask);
+ x_stop_ignoring_errors (dpyinfo);
#ifndef HAVE_XCB_SHAPE
x_catch_errors (dpyinfo->display);
@@ -3348,12 +3407,12 @@ x_dnd_compute_toplevels (struct x_display_info *dpyinfo)
}
#endif
- x_catch_errors (dpyinfo->display);
+ x_ignore_errors_for_next_request (dpyinfo);
XSelectInput (dpyinfo->display, toplevels[i],
(attrs.your_event_mask
| StructureNotifyMask
| PropertyChangeMask));
- x_uncatch_errors ();
+ x_stop_ignoring_errors (dpyinfo);
x_dnd_toplevels = tem;
}
@@ -3810,12 +3869,16 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
if (NILP (value))
return;
+ if (!x_dnd_use_unsupported_drop)
+ return;
+
event.xbutton.serial = 0;
event.xbutton.send_event = True;
event.xbutton.display = dpyinfo->display;
event.xbutton.root = dpyinfo->root_window;
event.xbutton.x_root = root_x;
event.xbutton.y_root = root_y;
+
x_catch_errors (dpyinfo->display);
child = dpyinfo->root_window;
@@ -3828,8 +3891,10 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
&& child_return != None)
child = child_return;
+ x_uncatch_errors ();
+
if (!CONSP (value))
- goto cancel;
+ return;
current_value = assq_no_quit (QPRIMARY,
dpyinfo->terminal->Vselection_alist);
@@ -3846,7 +3911,7 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
from generating events that will insert something else. */
if (owner != FRAME_X_WINDOW (f))
- goto cancel;
+ return;
event.xbutton.window = child;
event.xbutton.subwindow = None;
@@ -3856,34 +3921,37 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
event.xbutton.button = 2;
event.xbutton.same_screen = True;
- x_set_pending_dnd_time (before);
+ dpyinfo->pending_dnd_time = before;
event.xbutton.type = ButtonPress;
event.xbutton.time = before + 1;
+ x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (dpyinfo->display, child,
True, ButtonPressMask, &event);
+ x_stop_ignoring_errors (dpyinfo);
event.xbutton.type = ButtonRelease;
event.xbutton.time = before + 2;
+ x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (dpyinfo->display, child,
True, ButtonReleaseMask, &event);
+ x_stop_ignoring_errors (dpyinfo);
- cancel:
- x_uncatch_errors ();
+ x_dnd_action_symbol = QXdndActionPrivate;
+
+ return;
}
static void
x_dnd_send_unsupported_drop (struct x_display_info *dpyinfo, Window target_window,
int root_x, int root_y, Time before)
{
- struct input_event ie;
Lisp_Object targets, arg;
int i;
char **atom_names, *name;
- EVENT_INIT (ie);
targets = Qnil;
atom_names = alloca (sizeof *atom_names * x_dnd_n_targets);
@@ -3891,8 +3959,6 @@ x_dnd_send_unsupported_drop (struct x_display_info *dpyinfo, Window target_windo
x_dnd_n_targets, atom_names))
return;
- x_dnd_action = dpyinfo->Xatom_XdndActionPrivate;
-
for (i = x_dnd_n_targets; i > 0; --i)
{
targets = Fcons (build_string (atom_names[i - 1]),
@@ -3911,19 +3977,17 @@ x_dnd_send_unsupported_drop (struct x_display_info *dpyinfo, Window target_windo
else
arg = Qnil;
- ie.kind = UNSUPPORTED_DROP_EVENT;
- ie.code = (unsigned) target_window;
- ie.modifiers = x_dnd_unsupported_event_level;
- ie.arg = list3 (assq_no_quit (QXdndSelection,
- dpyinfo->terminal->Vselection_alist),
- targets, arg);
- ie.timestamp = before;
-
- XSETINT (ie.x, root_x);
- XSETINT (ie.y, root_y);
- XSETFRAME (ie.frame_or_window, x_dnd_frame);
+ x_dnd_run_unsupported_drop_function = true;
+ x_dnd_unsupported_drop_time = before;
+ x_dnd_unsupported_drop_window = target_window;
+ x_dnd_unsupported_drop_data
+ = listn (5, assq_no_quit (QXdndSelection,
+ dpyinfo->terminal->Vselection_alist),
+ targets, arg, make_fixnum (root_x),
+ make_fixnum (root_y));
- kbd_buffer_store_event (&ie);
+ x_dnd_waiting_for_finish = true;
+ x_dnd_finish_display = dpyinfo->display;
}
static Window
@@ -4377,6 +4441,7 @@ x_dnd_send_enter (struct frame *f, Window target, int supported)
x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
+ x_stop_ignoring_errors (dpyinfo);
}
static void
@@ -4439,6 +4504,7 @@ x_dnd_send_position (struct frame *f, Window target, int supported,
{
x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
+ x_stop_ignoring_errors (dpyinfo);
x_dnd_waiting_for_status_window = target;
}
@@ -4464,6 +4530,7 @@ x_dnd_send_leave (struct frame *f, Window target)
x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
+ x_stop_ignoring_errors (dpyinfo);
}
static bool
@@ -4496,6 +4563,20 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
x_ignore_errors_for_next_request (dpyinfo);
XSendEvent (FRAME_X_DISPLAY (f), target, False, NoEventMask, &msg);
+ x_stop_ignoring_errors (dpyinfo);
+ return true;
+}
+
+static bool
+x_dnd_do_drop (Window target, int supported)
+{
+ if (x_dnd_waiting_for_status_window != target)
+ return x_dnd_send_drop (x_dnd_frame, target,
+ x_dnd_selection_timestamp, supported);
+
+ x_dnd_need_send_drop = true;
+ x_dnd_send_drop_proto = supported;
+
return true;
}
@@ -4525,10 +4606,14 @@ x_free_dnd_targets (void)
x_dnd_n_targets = 0;
}
+/* Clear some Lisp variables after the drop finishes, so they are
+ freed by the GC. */
+
static void
-x_clear_dnd_monitors (void)
+x_clear_dnd_variables (void)
{
x_dnd_monitors = Qnil;
+ x_dnd_unsupported_drop_data = Qnil;
}
static void
@@ -4543,6 +4628,34 @@ x_free_dnd_toplevels (void)
x_dnd_free_toplevels (true);
}
+/* Restore event masks and window properties changed during a
+ drag-and-drop operation, after it finishes. */
+static void
+x_restore_events_after_dnd (struct frame *f, XWindowAttributes *wa)
+{
+ struct x_display_info *dpyinfo;
+
+ dpyinfo = FRAME_DISPLAY_INFO (f);
+
+ /* Restore the old event mask. */
+ XSelectInput (dpyinfo->display, dpyinfo->root_window,
+ wa->your_event_mask);
+#ifdef HAVE_XKB
+ if (dpyinfo->supports_xkb)
+ XkbSelectEvents (dpyinfo->display, XkbUseCoreKbd,
+ XkbStateNotifyMask, 0);
+#endif
+ /* Delete the Motif drag initiator info if it was set up. */
+ if (x_dnd_motif_setup_p)
+ XDeleteProperty (dpyinfo->display, FRAME_X_WINDOW (f),
+ x_dnd_motif_atom);
+
+ /* Remove any type list set as well. */
+ if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
+ XDeleteProperty (dpyinfo->display, FRAME_X_WINDOW (f),
+ dpyinfo->Xatom_XdndTypeList);
+}
+
static void
x_dnd_cleanup_drag_and_drop (void *frame)
{
@@ -4602,32 +4715,9 @@ x_dnd_cleanup_drag_and_drop (void *frame)
#endif
x_dnd_return_frame_object = NULL;
x_dnd_movement_frame = NULL;
-
- block_input ();
- /* Restore the old event mask. */
- XSelectInput (FRAME_X_DISPLAY (f),
- FRAME_DISPLAY_INFO (f)->root_window,
- x_dnd_old_window_attrs.your_event_mask);
-
-#ifdef HAVE_XKB
- if (FRAME_DISPLAY_INFO (f)->supports_xkb)
- XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
- XkbStateNotifyMask, 0);
-#endif
-
- /* Delete the Motif drag initiator info if it was set up. */
- if (x_dnd_motif_setup_p)
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection);
-
- /* Remove any type list set as well. */
- if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- FRAME_DISPLAY_INFO (f)->Xatom_XdndTypeList);
-
- unblock_input ();
-
x_dnd_frame = NULL;
+
+ x_restore_events_after_dnd (f, &x_dnd_old_window_attrs);
}
static void
@@ -5023,7 +5113,11 @@ xi_convert_button_state (XIButtonState *in, unsigned int *out)
}
/* Return the modifier state in XEV as a standard X modifier mask. */
-static unsigned int
+
+#ifdef USE_GTK
+static
+#endif
+unsigned int
xi_convert_event_state (XIDeviceEvent *xev)
{
unsigned int mods, buttons;
@@ -6371,20 +6465,6 @@ x_set_frame_alpha (struct frame *f)
unsigned long opac;
Window parent;
-#ifndef USE_XCB
- unsigned char *data = NULL;
- Atom actual;
- int rc, format;
- unsigned long n, left;
- unsigned long value;
-#else
- xcb_get_property_cookie_t opacity_cookie;
- xcb_get_property_reply_t *opacity_reply;
- xcb_generic_error_t *error;
- bool rc;
- uint32_t value;
-#endif
-
if (dpyinfo->highlight_frame == f)
alpha = f->alpha[0];
else
@@ -6405,8 +6485,6 @@ x_set_frame_alpha (struct frame *f)
opac = alpha * OPAQUE;
- x_catch_errors (dpy);
-
/* If there is a parent from the window manager, put the property there
also, to work around broken window managers that fail to do that.
Do this unconditionally as this function is called on reparent when
@@ -6415,77 +6493,23 @@ x_set_frame_alpha (struct frame *f)
if (!FRAME_PARENT_FRAME (f))
{
parent = x_find_topmost_parent (f);
+
if (parent != None)
- XChangeProperty (dpy, parent, dpyinfo->Xatom_net_wm_window_opacity,
- XA_CARDINAL, 32, PropModeReplace,
- (unsigned char *) &opac, 1);
+ {
+ x_ignore_errors_for_next_request (dpyinfo);
+ XChangeProperty (dpy, parent,
+ dpyinfo->Xatom_net_wm_window_opacity,
+ XA_CARDINAL, 32, PropModeReplace,
+ (unsigned char *) &opac, 1);
+ x_stop_ignoring_errors (dpyinfo);
+ }
}
- /* return unless necessary */
- {
-#ifndef USE_XCB
- rc = XGetWindowProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity,
- 0, 1, False, XA_CARDINAL,
- &actual, &format, &n, &left,
- &data);
-
- if (rc == Success && actual != None
- && n && format == XA_CARDINAL && data)
- {
- value = *(unsigned long *) data;
-
- /* Xlib sign-extends values greater than 0x7fffffff on 64-bit
- machines. Get the low bits by ourself. */
-
- value &= 0xffffffff;
-
- if (value == opac)
- {
- x_uncatch_errors ();
- XFree (data);
- return;
- }
- }
-
- if (data)
- XFree (data);
-#else
- /* Avoid the confusing Xlib sign-extension mess by using XCB
- instead. */
- opacity_cookie
- = xcb_get_property (dpyinfo->xcb_connection, 0, (xcb_window_t) win,
- (xcb_atom_t) dpyinfo->Xatom_net_wm_window_opacity,
- XCB_ATOM_CARDINAL, 0, 1);
- opacity_reply
- = xcb_get_property_reply (dpyinfo->xcb_connection,
- opacity_cookie, &error);
-
- rc = opacity_reply;
-
- if (!opacity_reply)
- free (error);
- else
- {
- rc = (opacity_reply->format == 32
- && opacity_reply->type == XCB_ATOM_CARDINAL
- && (xcb_get_property_value_length (opacity_reply) >= 4));
-
- if (rc)
- value = *(uint32_t *) xcb_get_property_value (opacity_reply);
- }
-
- if (opacity_reply)
- free (opacity_reply);
-
- if (rc && value == opac)
- return;
-#endif
- }
-
+ x_ignore_errors_for_next_request (dpyinfo);
XChangeProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity,
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &opac, 1);
- x_uncatch_errors ();
+ x_stop_ignoring_errors (dpyinfo);
}
/***********************************************************************
@@ -7107,6 +7131,24 @@ x_update_frame_user_time_window (struct frame *f)
output = FRAME_X_OUTPUT (f);
dpyinfo = FRAME_DISPLAY_INFO (f);
+ if (!NILP (Vx_no_window_manager)
+ || !x_wm_supports (f, dpyinfo->Xatom_net_wm_user_time))
+ {
+ if (output->user_time_window != None
+ && output->user_time_window != FRAME_OUTER_WINDOW (f))
+ {
+ XDestroyWindow (dpyinfo->display, output->user_time_window);
+ XDeleteProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f),
+ dpyinfo->Xatom_net_wm_user_time_window);
+ }
+ else
+ XDeleteProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f),
+ dpyinfo->Xatom_net_wm_user_time);
+
+ output->user_time_window = None;
+ return;
+ }
+
if (!x_wm_supports (f, dpyinfo->Xatom_net_wm_user_time_window))
{
if (output->user_time_window == None)
@@ -10599,6 +10641,10 @@ x_scroll_run (struct window *w, struct run *run)
static void
x_frame_highlight (struct frame *f)
{
+ struct x_display_info *dpyinfo;
+
+ dpyinfo = FRAME_DISPLAY_INFO (f);
+
/* We used to only do this if Vx_no_window_manager was non-nil, but
the ICCCM (section 4.1.6) says that the window's border pixmap
and border pixel are window attributes which are "private to the
@@ -10608,10 +10654,10 @@ x_frame_highlight (struct frame *f)
the window-manager in use, tho something more is at play since I've been
using that same window-manager binary for ever. Let's not crash just
because of this (bug#9310). */
- x_catch_errors (FRAME_X_DISPLAY (f));
+ x_ignore_errors_for_next_request (dpyinfo);
XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
f->output_data.x->border_pixel);
- x_uncatch_errors ();
+ x_stop_ignoring_errors (dpyinfo);
unblock_input ();
gui_update_cursor (f, true);
x_set_frame_alpha (f);
@@ -10620,17 +10666,23 @@ x_frame_highlight (struct frame *f)
static void
x_frame_unhighlight (struct frame *f)
{
+ struct x_display_info *dpyinfo;
+
+ dpyinfo = FRAME_DISPLAY_INFO (f);
+
/* We used to only do this if Vx_no_window_manager was non-nil, but
the ICCCM (section 4.1.6) says that the window's border pixmap
and border pixel are window attributes which are "private to the
client", so we can always change it to whatever we want. */
+
block_input ();
/* Same as above for XSetWindowBorder (bug#9310). */
- x_catch_errors (FRAME_X_DISPLAY (f));
+ x_ignore_errors_for_next_request (dpyinfo);
XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
f->output_data.x->border_tile);
- x_uncatch_errors ();
+ x_stop_ignoring_errors (dpyinfo);
unblock_input ();
+
gui_update_cursor (f, true);
x_set_frame_alpha (f);
}
@@ -11275,6 +11327,57 @@ x_dnd_lose_ownership (Lisp_Object timestamp_and_frame)
XCDR (timestamp_and_frame));
}
+/* Clean up an existing drag-and-drop operation in preparation for its
+ sudden termination. */
+
+static void
+x_dnd_process_quit (struct frame *f, Time timestamp)
+{
+ xm_drop_start_message dmsg;
+
+ if (x_dnd_in_progress)
+ {
+ if (x_dnd_last_seen_window != None
+ && x_dnd_last_protocol_version != -1)
+ x_dnd_send_leave (f, x_dnd_last_seen_window);
+ else if (x_dnd_last_seen_window != None
+ && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
+ && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
+ && x_dnd_motif_setup_p)
+ {
+ dmsg.reason = XM_DRAG_REASON (XM_DRAG_ORIGINATOR_INITIATOR,
+ XM_DRAG_REASON_DROP_START);
+ dmsg.byte_order = XM_BYTE_ORDER_CUR_FIRST;
+ dmsg.timestamp = timestamp;
+ dmsg.side_effects
+ = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (FRAME_DISPLAY_INFO (f),
+ x_dnd_wanted_action),
+ XM_DROP_SITE_VALID, x_dnd_motif_operations,
+ XM_DROP_ACTION_DROP_CANCEL);
+ dmsg.x = 0;
+ dmsg.y = 0;
+ dmsg.index_atom = x_dnd_motif_atom;
+ dmsg.source_window = FRAME_X_WINDOW (f);
+
+ x_dnd_send_xm_leave_for_drop (FRAME_DISPLAY_INFO (f), f,
+ x_dnd_last_seen_window,
+ timestamp);
+ xm_send_drop_message (FRAME_DISPLAY_INFO (f), FRAME_X_WINDOW (f),
+ x_dnd_last_seen_window, &dmsg);
+ }
+
+ x_dnd_end_window = x_dnd_last_seen_window;
+ x_dnd_last_seen_window = None;
+ x_dnd_last_seen_toplevel = None;
+ x_dnd_in_progress = false;
+ x_dnd_frame = NULL;
+ }
+
+ x_dnd_waiting_for_finish = false;
+ x_dnd_return_frame_object = NULL;
+ x_dnd_movement_frame = NULL;
+}
+
/* This function is defined far away from the rest of the XDND code so
it can utilize `x_any_window_to_frame'. */
@@ -11307,11 +11410,10 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
XWindowAttributes root_window_attrs;
struct input_event hold_quit;
char *atom_name, *ask_actions;
- Lisp_Object action, ltimestamp;
+ Lisp_Object action, ltimestamp, val;
specpdl_ref ref, count, base;
ptrdiff_t i, end, fill;
XTextProperty prop;
- xm_drop_start_message dmsg;
Lisp_Object frame_object, x, y, frame, local_value;
bool signals_were_pending, need_sync;
#ifdef HAVE_XKB
@@ -11320,9 +11422,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
#ifndef USE_GTK
struct x_display_info *event_display;
#endif
- union buffered_input_event *events, *event;
- int n_events;
- struct frame *event_frame;
+ unsigned int additional_mask;
base = SPECPDL_INDEX ();
@@ -11330,67 +11430,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
Fx_begin_drag. */
specbind (Qx_dnd_targets_list, selection_target_list);
- /* Before starting drag-and-drop, walk through the keyboard buffer
- to see if there are any UNSUPPORTED_DROP_EVENTs, and run them now
- if they exist, to prevent race conditions from happening due to
- multiple unsupported drops running at once. */
-
- block_input ();
- events = alloca (sizeof *events * KBD_BUFFER_SIZE);
- n_events = 0;
- event = kbd_fetch_ptr;
-
- while (event != kbd_store_ptr)
- {
- if (event->ie.kind == UNSUPPORTED_DROP_EVENT
- && event->ie.modifiers < x_dnd_unsupported_event_level)
- events[n_events++] = *event;
-
- event = (event == kbd_buffer + KBD_BUFFER_SIZE - 1
- ? kbd_buffer : event + 1);
- }
-
- x_dnd_unsupported_event_level += 1;
- unblock_input ();
-
- for (i = 0; i < n_events; ++i)
- {
- maybe_quit ();
-
- event = &events[i];
- event_frame = XFRAME (event->ie.frame_or_window);
-
- if (!FRAME_LIVE_P (event_frame))
- continue;
-
- if (!NILP (Vx_dnd_unsupported_drop_function))
- {
- if (!NILP (call8 (Vx_dnd_unsupported_drop_function,
- XCAR (XCDR (event->ie.arg)), event->ie.x,
- event->ie.y, XCAR (XCDR (XCDR (event->ie.arg))),
- make_uint (event->ie.code),
- event->ie.frame_or_window,
- make_int (event->ie.timestamp),
- Fcopy_sequence (XCAR (event->ie.arg)))))
- continue;
- }
-
- /* `x-dnd-unsupported-drop-function' could have deleted the
- event frame. */
- if (!FRAME_LIVE_P (event_frame))
- continue;
-
- x_dnd_do_unsupported_drop (FRAME_DISPLAY_INFO (event_frame),
- event->ie.frame_or_window,
- XCAR (event->ie.arg),
- XCAR (XCDR (event->ie.arg)),
- (Window) event->ie.code,
- XFIXNUM (event->ie.x),
- XFIXNUM (event->ie.y),
- event->ie.timestamp);
- break;
- }
-
if (!FRAME_VISIBLE_P (f))
error ("Frame must be visible");
@@ -11418,6 +11457,9 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
ltimestamp = x_timestamp_for_selection (FRAME_DISPLAY_INFO (f),
QXdndSelection);
+ if (NILP (ltimestamp))
+ error ("No local value for XdndSelection");
+
if (BIGNUMP (ltimestamp))
x_dnd_selection_timestamp = bignum_to_intmax (ltimestamp);
else
@@ -11493,6 +11535,8 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
unbind_to (count, Qnil);
}
+ record_unwind_protect_void (x_clear_dnd_variables);
+
if (follow_tooltip)
{
#if defined HAVE_XRANDR || defined USE_GTK
@@ -11503,8 +11547,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
#endif
x_dnd_monitors
= Fx_display_monitor_attributes_list (frame);
-
- record_unwind_protect_void (x_clear_dnd_monitors);
}
x_dnd_update_tooltip = follow_tooltip;
@@ -11551,12 +11593,14 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
x_dnd_xm_use_help = false;
x_dnd_motif_setup_p = false;
x_dnd_end_window = None;
+ x_dnd_run_unsupported_drop_function = false;
x_dnd_use_toplevels
= x_wm_supports (f, FRAME_DISPLAY_INFO (f)->Xatom_net_client_list_stacking);
x_dnd_toplevels = NULL;
x_dnd_allow_current_frame = allow_current_frame;
x_dnd_movement_frame = NULL;
x_dnd_init_type_lists = false;
+ x_dnd_need_send_drop = false;
#ifdef HAVE_XKB
x_dnd_keyboard_state = 0;
@@ -11589,7 +11633,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
if (EQ (return_frame, Qnow))
x_dnd_return_frame = 2;
- /* Now select for SubstructureNotifyMask and PropertyNotifyMask on
+ /* Now select for SubstructureNotifyMask and PropertyChangeMask on
the root window, so we can get notified when window stacking
changes, a common operation during drag-and-drop. */
@@ -11597,11 +11641,15 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
FRAME_DISPLAY_INFO (f)->root_window,
&root_window_attrs);
+ additional_mask = SubstructureNotifyMask;
+
+ if (x_dnd_use_toplevels)
+ additional_mask |= PropertyChangeMask;
+
XSelectInput (FRAME_X_DISPLAY (f),
FRAME_DISPLAY_INFO (f)->root_window,
root_window_attrs.your_event_mask
- | SubstructureNotifyMask
- | PropertyChangeMask);
+ | additional_mask);
if (EQ (return_frame, Qnow))
x_dnd_update_state (FRAME_DISPLAY_INFO (f), CurrentTime);
@@ -11717,72 +11765,12 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
if (hold_quit.kind != NO_EVENT)
{
- if (x_dnd_in_progress)
- {
- if (x_dnd_last_seen_window != None
- && x_dnd_last_protocol_version != -1)
- x_dnd_send_leave (f, x_dnd_last_seen_window);
- else if (x_dnd_last_seen_window != None
- && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
- && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
- && x_dnd_motif_setup_p)
- {
- dmsg.reason = XM_DRAG_REASON (XM_DRAG_ORIGINATOR_INITIATOR,
- XM_DRAG_REASON_DROP_START);
- dmsg.byte_order = XM_BYTE_ORDER_CUR_FIRST;
- dmsg.timestamp = hold_quit.timestamp;
- dmsg.side_effects
- = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (FRAME_DISPLAY_INFO (f),
- x_dnd_wanted_action),
- XM_DROP_SITE_VALID, x_dnd_motif_operations,
- XM_DROP_ACTION_DROP_CANCEL);
- dmsg.x = 0;
- dmsg.y = 0;
- dmsg.index_atom = x_dnd_motif_atom;
- dmsg.source_window = FRAME_X_WINDOW (f);
-
- x_dnd_send_xm_leave_for_drop (FRAME_DISPLAY_INFO (f), f,
- x_dnd_last_seen_window,
- hold_quit.timestamp);
- xm_send_drop_message (FRAME_DISPLAY_INFO (f), FRAME_X_WINDOW (f),
- x_dnd_last_seen_window, &dmsg);
- }
-
- x_dnd_end_window = x_dnd_last_seen_window;
- x_dnd_last_seen_window = None;
- x_dnd_last_seen_toplevel = None;
- x_dnd_in_progress = false;
- x_dnd_frame = NULL;
- }
-
- x_dnd_waiting_for_finish = false;
- x_dnd_return_frame_object = NULL;
- x_dnd_movement_frame = NULL;
-
- /* Don't clear dpyinfo->grabbed if we're quitting. */
-
+ x_dnd_process_quit (f, hold_quit.timestamp);
#ifdef USE_GTK
current_hold_quit = NULL;
#endif
/* Restore the old event mask. */
- XSelectInput (FRAME_X_DISPLAY (f),
- FRAME_DISPLAY_INFO (f)->root_window,
- root_window_attrs.your_event_mask);
-#ifdef HAVE_XKB
- if (FRAME_DISPLAY_INFO (f)->supports_xkb)
- XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
- XkbStateNotifyMask, 0);
-#endif
- /* Delete the Motif drag initiator info if it was set up. */
- if (x_dnd_motif_setup_p)
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- x_dnd_motif_atom);
-
-
- /* Remove any type list set as well. */
- if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- FRAME_DISPLAY_INFO (f)->Xatom_XdndTypeList);
+ x_restore_events_after_dnd (f, &root_window_attrs);
/* Call kbd_buffer_store event, which calls
handle_interrupt and sets `last-event-frame' along
@@ -11805,78 +11793,70 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
unbind_to (ref, Qnil);
}
-#ifdef USE_GTK
- if (xg_pending_quit_event.kind != NO_EVENT)
+ /* Sometimes C-g can be pressed inside a selection
+ converter, where quitting is inhibited. We want
+ to quit after the converter exits. */
+ if (!NILP (Vquit_flag) && !NILP (Vinhibit_quit))
{
- xg_pending_quit_event.kind = NO_EVENT;
-
- if (x_dnd_in_progress)
- {
- if (x_dnd_last_seen_window != None
- && x_dnd_last_protocol_version != -1)
- x_dnd_send_leave (f, x_dnd_last_seen_window);
- else if (x_dnd_last_seen_window != None
- && !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
- && x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
- && x_dnd_motif_setup_p)
- {
- dmsg.reason = XM_DRAG_REASON (XM_DRAG_ORIGINATOR_INITIATOR,
- XM_DRAG_REASON_DROP_START);
- dmsg.byte_order = XM_BYTE_ORDER_CUR_FIRST;
- dmsg.timestamp = xg_pending_quit_event.timestamp;
- dmsg.side_effects
- = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (FRAME_DISPLAY_INFO (f),
- x_dnd_wanted_action),
- XM_DROP_SITE_VALID, x_dnd_motif_operations,
- XM_DROP_ACTION_DROP_CANCEL);
- dmsg.x = 0;
- dmsg.y = 0;
- dmsg.index_atom = x_dnd_motif_atom;
- dmsg.source_window = FRAME_X_WINDOW (f);
-
- x_dnd_send_xm_leave_for_drop (FRAME_DISPLAY_INFO (f), f,
- x_dnd_last_seen_window,
- xg_pending_quit_event.timestamp);
- xm_send_drop_message (FRAME_DISPLAY_INFO (f), FRAME_X_WINDOW (f),
- x_dnd_last_seen_window, &dmsg);
- }
-
- x_dnd_end_window = x_dnd_last_seen_window;
- x_dnd_last_seen_window = None;
- x_dnd_last_seen_toplevel = None;
- x_dnd_in_progress = false;
- x_dnd_frame = NULL;
- }
+ x_dnd_process_quit (f, FRAME_DISPLAY_INFO (f)->last_user_time);
+#ifdef USE_GTK
+ current_hold_quit = NULL;
+#endif
+ x_restore_events_after_dnd (f, &root_window_attrs);
+ quit ();
+ }
+ if (x_dnd_run_unsupported_drop_function
+ && x_dnd_waiting_for_finish)
+ {
+ x_dnd_run_unsupported_drop_function = false;
x_dnd_waiting_for_finish = false;
- x_dnd_return_frame_object = NULL;
- x_dnd_movement_frame = NULL;
+ x_dnd_unwind_flag = true;
- FRAME_DISPLAY_INFO (f)->grabbed = 0;
- current_hold_quit = NULL;
+ ref = SPECPDL_INDEX ();
+ record_unwind_protect_ptr (x_dnd_cleanup_drag_and_drop, f);
- block_input ();
- /* Restore the old event mask. */
- XSelectInput (FRAME_X_DISPLAY (f),
- FRAME_DISPLAY_INFO (f)->root_window,
- root_window_attrs.your_event_mask);
-#ifdef HAVE_XKB
- if (FRAME_DISPLAY_INFO (f)->supports_xkb)
- XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
- XkbStateNotifyMask, 0);
-#endif
- /* Delete the Motif drag initiator info if it was set up. */
- if (x_dnd_motif_setup_p)
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- x_dnd_motif_atom);
+ if (!NILP (Vx_dnd_unsupported_drop_function))
+ val = call8 (Vx_dnd_unsupported_drop_function,
+ XCAR (XCDR (x_dnd_unsupported_drop_data)),
+ Fnth (make_fixnum (3), x_dnd_unsupported_drop_data),
+ Fnth (make_fixnum (4), x_dnd_unsupported_drop_data),
+ Fnth (make_fixnum (2), x_dnd_unsupported_drop_data),
+ make_uint (x_dnd_unsupported_drop_window),
+ frame, make_uint (x_dnd_unsupported_drop_time),
+ Fcopy_sequence (XCAR (x_dnd_unsupported_drop_data)));
+ else
+ val = Qnil;
+
+ if (NILP (val))
+ x_dnd_do_unsupported_drop (FRAME_DISPLAY_INFO (f),
+ frame, XCAR (x_dnd_unsupported_drop_data),
+ XCAR (XCDR (x_dnd_unsupported_drop_data)),
+ x_dnd_unsupported_drop_window,
+ XFIXNUM (Fnth (make_fixnum (3),
+ x_dnd_unsupported_drop_data)),
+ XFIXNUM (Fnth (make_fixnum (4),
+ x_dnd_unsupported_drop_data)),
+ x_dnd_unsupported_drop_time);
+ else if (SYMBOLP (val))
+ x_dnd_action_symbol = val;
+ x_dnd_unwind_flag = false;
+ unbind_to (ref, Qnil);
- /* Remove any type list set as well. */
- if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- FRAME_DISPLAY_INFO (f)->Xatom_XdndTypeList);
- unblock_input ();
+ /* Break out of the loop now, since DND has
+ completed. */
+ break;
+ }
+#ifdef USE_GTK
+ if (xg_pending_quit_event.kind != NO_EVENT)
+ {
+ xg_pending_quit_event.kind = NO_EVENT;
+ current_hold_quit = NULL;
+
+ x_dnd_process_quit (f, FRAME_DISPLAY_INFO (f)->last_user_time);
+ x_restore_events_after_dnd (f, &root_window_attrs);
quit ();
}
#else
@@ -11898,27 +11878,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
current_hold_quit = NULL;
#endif
x_dnd_movement_frame = NULL;
-
- block_input ();
- /* Restore the old event mask. */
- XSelectInput (FRAME_X_DISPLAY (f),
- FRAME_DISPLAY_INFO (f)->root_window,
- root_window_attrs.your_event_mask);
-#ifdef HAVE_XKB
- if (FRAME_DISPLAY_INFO (f)->supports_xkb)
- XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
- XkbStateNotifyMask, 0);
-#endif
- /* Delete the Motif drag initiator info if it was set up. */
- if (x_dnd_motif_setup_p)
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- x_dnd_motif_atom);
-
- /* Remove any type list set as well. */
- if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
- XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- FRAME_DISPLAY_INFO (f)->Xatom_XdndTypeList);
- unblock_input ();
+ x_restore_events_after_dnd (f, &root_window_attrs);
if (x_dnd_return_frame == 3
&& FRAME_LIVE_P (x_dnd_return_frame_object))
@@ -15009,7 +14969,6 @@ x_scroll_bar_expose (struct scroll_bar *bar, const XEvent *event)
Window w = bar->x_window;
#else
Drawable w = bar->x_drawable;
-#endif
int x, y, width, height;
if (event->type == Expose)
@@ -15026,6 +14985,7 @@ x_scroll_bar_expose (struct scroll_bar *bar, const XEvent *event)
width = event->xgraphicsexpose.width;
height = event->xgraphicsexpose.height;
}
+#endif
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
GC gc = f->output_data.x->normal_gc;
@@ -16401,8 +16361,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
{
int rc;
- if (x_dnd_in_progress
- && FRAME_DISPLAY_INFO (x_dnd_frame) == dpyinfo
+ if (((x_dnd_in_progress
+ && FRAME_DISPLAY_INFO (x_dnd_frame) == dpyinfo)
+ || (x_dnd_waiting_for_finish
+ && FRAME_DISPLAY_INFO (x_dnd_finish_frame) == dpyinfo))
&& event->xclient.message_type == dpyinfo->Xatom_XdndStatus)
{
Window target;
@@ -16411,11 +16373,17 @@ handle_one_xevent (struct x_display_info *dpyinfo,
target = event->xclient.data.l[0];
if (x_dnd_last_protocol_version != -1
+ && x_dnd_in_progress
&& target == x_dnd_last_seen_window
- && event->xclient.data.l[1] & 2)
+ /* The XDND documentation is not very clearly worded.
+ But this should be the correct behavior, since
+ "kDNDStatusSendHereFlag" in the reference
+ implementation is 2, and means the mouse rect
+ should be ignored. */
+ && !(event->xclient.data.l[1] & 2))
{
r1 = event->xclient.data.l[2];
- r2 = event->xclient.data.l[2];
+ r2 = event->xclient.data.l[3];
x_dnd_mouse_rect_target = target;
x_dnd_mouse_rect.x = (r1 & 0xffff0000) >> 16;
@@ -16427,7 +16395,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
x_dnd_mouse_rect_target = None;
if (x_dnd_last_protocol_version != -1
- && target == x_dnd_last_seen_window)
+ && (x_dnd_in_progress
+ && target == x_dnd_last_seen_window))
{
if (event->xclient.data.l[1] & 1)
{
@@ -16449,10 +16418,36 @@ handle_one_xevent (struct x_display_info *dpyinfo,
XSendEvent (dpyinfo->display, target,
False, NoEventMask,
&x_dnd_pending_send_position);
+ x_stop_ignoring_errors (dpyinfo);
+ x_dnd_pending_send_position.type = 0;
+
+ /* Since we sent another XdndPosition message, we
+ have to wait for another one in reply, so don't
+ reset `x_dnd_waiting_for_status_window'
+ here. */
}
+ else
+ x_dnd_waiting_for_status_window = None;
+
+ /* Send any pending drop if warranted. */
+ if (x_dnd_waiting_for_finish && x_dnd_need_send_drop
+ && x_dnd_waiting_for_status_window == None)
+ {
+ if (event->xclient.data.l[1] & 1)
+ {
+ if (x_dnd_send_drop_proto >= 2)
+ x_dnd_action = event->xclient.data.l[4];
+ else
+ x_dnd_action = dpyinfo->Xatom_XdndActionCopy;
+ }
+ else
+ x_dnd_action = None;
- x_dnd_pending_send_position.type = 0;
- x_dnd_waiting_for_status_window = None;
+ x_dnd_waiting_for_finish
+ = x_dnd_send_drop (x_dnd_finish_frame,
+ target, x_dnd_selection_timestamp,
+ x_dnd_send_drop_proto);
+ }
}
goto done;
@@ -16512,16 +16507,16 @@ handle_one_xevent (struct x_display_info *dpyinfo,
switch (operation)
{
case XM_DRAG_MOVE:
- x_dnd_action = dpyinfo->Xatom_XdndActionMove;
+ x_dnd_action_symbol = QXdndActionMove;
break;
case XM_DRAG_COPY:
- x_dnd_action = dpyinfo->Xatom_XdndActionCopy;
+ x_dnd_action_symbol = QXdndActionCopy;
break;
/* This means XM_DRAG_OPERATION_IS_LINK (operation). */
default:
- x_dnd_action = dpyinfo->Xatom_XdndActionLink;
+ x_dnd_action_symbol = QXdndActionLink;
break;
}
@@ -16611,11 +16606,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (event->xclient.data.l[0] == dpyinfo->Xatom_wm_delete_window)
{
- f = any;
+ f = x_top_window_to_frame (dpyinfo,
+ event->xclient.window);
+
if (!f)
goto OTHER; /* May be a dialog that is to be removed */
inev.ie.kind = DELETE_WINDOW_EVENT;
+ inev.ie.timestamp = event->xclient.data.l[1];
XSETFRAME (inev.ie.frame_or_window, f);
goto done;
}
@@ -16825,7 +16823,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
const XSelectionClearEvent *eventp = &event->xselectionclear;
if (eventp->selection == dpyinfo->motif_drag_atom
- && dpyinfo->motif_drag_atom_time <= eventp->time)
+ && (eventp->time == CurrentTime
+ || dpyinfo->motif_drag_atom_time <= eventp->time))
dpyinfo->motif_drag_atom = None;
inev.sie.kind = SELECTION_CLEAR_EVENT;
@@ -18671,10 +18670,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
configureEvent.xconfigure.height,
f->new_width, f->new_height);
+#ifdef HAVE_XDBE
block_input ();
if (FRAME_X_DOUBLE_BUFFERED_P (f))
x_drop_xrender_surfaces (f);
unblock_input ();
+#endif
xg_frame_resized (f, configureEvent.xconfigure.width,
configureEvent.xconfigure.height);
#ifdef USE_CAIRO
@@ -18917,9 +18918,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version;
x_dnd_waiting_for_finish
- = x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window,
- x_dnd_selection_timestamp,
- x_dnd_last_protocol_version);
+ = x_dnd_do_drop (x_dnd_last_seen_window,
+ x_dnd_last_protocol_version);
x_dnd_finish_display = dpyinfo->display;
}
else if (x_dnd_last_seen_window != None)
@@ -18972,23 +18972,17 @@ handle_one_xevent (struct x_display_info *dpyinfo,
}
}
else
- {
- x_set_pending_dnd_time (event->xbutton.time);
- x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None
- ? x_dnd_last_seen_toplevel
- : x_dnd_last_seen_window),
- event->xbutton.x_root, event->xbutton.y_root,
- event->xbutton.time);
- }
+ x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None
+ ? x_dnd_last_seen_toplevel
+ : x_dnd_last_seen_window),
+ event->xbutton.x_root, event->xbutton.y_root,
+ event->xbutton.time);
}
else if (x_dnd_last_seen_toplevel != None)
- {
- x_set_pending_dnd_time (event->xbutton.time);
- x_dnd_send_unsupported_drop (dpyinfo, x_dnd_last_seen_toplevel,
- event->xbutton.x_root,
- event->xbutton.y_root,
- event->xbutton.time);
- }
+ x_dnd_send_unsupported_drop (dpyinfo, x_dnd_last_seen_toplevel,
+ event->xbutton.x_root,
+ event->xbutton.y_root,
+ event->xbutton.time);
x_dnd_last_protocol_version = -1;
@@ -19253,6 +19247,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
goto OTHER;
case DestroyNotify:
+ if (event->xdestroywindow.window
+ == dpyinfo->net_supported_window)
+ dpyinfo->net_supported_window = None;
+
xft_settings_event (dpyinfo, event);
break;
@@ -20323,9 +20321,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version;
x_dnd_waiting_for_finish
- = x_dnd_send_drop (x_dnd_frame, x_dnd_last_seen_window,
- x_dnd_selection_timestamp,
- x_dnd_last_protocol_version);
+ = x_dnd_do_drop (x_dnd_last_seen_window,
+ x_dnd_last_protocol_version);
x_dnd_finish_display = dpyinfo->display;
}
else if (x_dnd_last_seen_window != None)
@@ -20387,22 +20384,16 @@ handle_one_xevent (struct x_display_info *dpyinfo,
}
}
else
- {
- x_set_pending_dnd_time (xev->time);
- x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None
- ? x_dnd_last_seen_toplevel
- : x_dnd_last_seen_window),
- xev->root_x, xev->root_y, xev->time);
- }
+ x_dnd_send_unsupported_drop (dpyinfo, (x_dnd_last_seen_toplevel != None
+ ? x_dnd_last_seen_toplevel
+ : x_dnd_last_seen_window),
+ xev->root_x, xev->root_y, xev->time);
}
else if (x_dnd_last_seen_toplevel != None)
- {
- x_set_pending_dnd_time (xev->time);
- x_dnd_send_unsupported_drop (dpyinfo,
- x_dnd_last_seen_toplevel,
- xev->root_x, xev->root_y,
- xev->time);
- }
+ x_dnd_send_unsupported_drop (dpyinfo,
+ x_dnd_last_seen_toplevel,
+ xev->root_x, xev->root_y,
+ xev->time);
x_dnd_last_protocol_version = -1;
x_dnd_last_motif_style = XM_DRAG_STYLE_NONE;
@@ -21645,11 +21636,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (!menu_bar_p && !tool_bar_p)
{
- x_catch_errors (dpyinfo->display);
-
if (f && device->direct_p)
{
*finish = X_EVENT_DROP;
+
+ x_catch_errors (dpyinfo->display);
+
if (x_input_grab_touch_events)
XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
xev->detail, xev->event, XIAcceptTouch);
@@ -21669,13 +21661,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (source)
inev.ie.device = source->name;
}
+
+ x_uncatch_errors ();
}
#ifndef HAVE_GTK3
else if (x_input_grab_touch_events)
- XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
- xev->detail, xev->event, XIRejectTouch);
+ {
+ x_ignore_errors_for_next_request (dpyinfo);
+ XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
+ xev->detail, xev->event, XIRejectTouch);
+ x_stop_ignoring_errors (dpyinfo);
+ }
#endif
- x_uncatch_errors ();
}
else
{
@@ -22981,7 +22978,8 @@ x_error_catcher (Display *display, XErrorEvent *event,
There is no need to use this mechanism for ignoring errors from
single asynchronous requests, such as sending a ClientMessage to a
window that might no longer exist. Use
- x_ignore_errors_for_next_request instead. */
+ x_ignore_errors_for_next_request (paired with
+ x_stop_ignoring_errors) instead. */
void
x_catch_errors_with_handler (Display *dpy, x_special_error_handler handler,
@@ -22994,7 +22992,7 @@ x_catch_errors_with_handler (Display *dpy, x_special_error_handler handler,
data->handler = handler;
data->handler_data = handler_data;
data->prev = x_error_message;
- data->first_request = NextRequest (dpy);
+ data->first_request = XNextRequest (dpy);
x_error_message = data;
++x_error_message_count;
@@ -23008,17 +23006,21 @@ x_catch_errors (Display *dpy)
/* Return if errors for REQUEST should be ignored even if there is no
error handler applied. */
-static unsigned long *
+static struct x_failable_request *
x_request_can_fail (struct x_display_info *dpyinfo,
unsigned long request)
{
- unsigned long *failable_requests;
+ struct x_failable_request *failable_requests;
for (failable_requests = dpyinfo->failable_requests;
failable_requests < dpyinfo->next_failable_request;
failable_requests++)
{
- if (*failable_requests == request)
+ if (X_COMPARE_SERIALS (request, >=,
+ failable_requests->start)
+ && (!failable_requests->end
+ || X_COMPARE_SERIALS (request, <=,
+ failable_requests->end)))
return failable_requests;
}
@@ -23030,13 +23032,17 @@ x_request_can_fail (struct x_display_info *dpyinfo,
static void
x_clean_failable_requests (struct x_display_info *dpyinfo)
{
- unsigned long *first, *last;
+ struct x_failable_request *first, *last;
last = dpyinfo->next_failable_request;
for (first = dpyinfo->failable_requests; first < last; first++)
{
- if (*first > LastKnownRequestProcessed (dpyinfo->display))
+ if (X_COMPARE_SERIALS (first->start, >,
+ LastKnownRequestProcessed (dpyinfo->display))
+ || !first->end
+ || X_COMPARE_SERIALS (first->end, >,
+ LastKnownRequestProcessed (dpyinfo->display)))
break;
}
@@ -23048,20 +23054,42 @@ x_clean_failable_requests (struct x_display_info *dpyinfo)
+ (last - first));
}
-static void
+void
x_ignore_errors_for_next_request (struct x_display_info *dpyinfo)
{
- unsigned long *request, *max;
+ struct x_failable_request *request, *max;
+ unsigned long next_request;
+#ifdef HAVE_GTK3
+ GdkDisplay *gdpy;
+
+ /* GTK 3 tends to override our own error handler inside certain
+ callbacks, which this can be called from. Instead of trying to
+ restore our own, add a trap for the following requests with
+ GDK as well. */
+
+ gdpy = gdk_x11_lookup_xdisplay (dpyinfo->display);
+
+ if (gdpy)
+ gdk_x11_display_error_trap_push (gdpy);
+#endif
+
+ if ((dpyinfo->next_failable_request
+ != dpyinfo->failable_requests)
+ && (dpyinfo->next_failable_request - 1)->end == 0)
+ /* A new sequence should never be started before an old one
+ finishes. Use `x_catch_errors' to nest error handlers. */
+ emacs_abort ();
request = dpyinfo->next_failable_request;
max = dpyinfo->failable_requests + N_FAILABLE_REQUESTS;
+ next_request = XNextRequest (dpyinfo->display);
if (request >= max)
{
/* There is no point in making this extra sync if all requests
are known to have been fully processed. */
if ((LastKnownRequestProcessed (dpyinfo->display)
- != NextRequest (dpyinfo->display) - 1))
+ != next_request - 1))
XSync (dpyinfo->display, False);
x_clean_failable_requests (dpyinfo);
@@ -23073,10 +23101,38 @@ x_ignore_errors_for_next_request (struct x_display_info *dpyinfo)
function. */
emacs_abort ();
- *request = NextRequest (dpyinfo->display);
+ request->start = next_request;
+ request->end = 0;
+
dpyinfo->next_failable_request++;
}
+void
+x_stop_ignoring_errors (struct x_display_info *dpyinfo)
+{
+ struct x_failable_request *range;
+#ifdef HAVE_GTK3
+ GdkDisplay *gdpy;
+#endif
+
+ range = dpyinfo->next_failable_request - 1;
+ range->end = XNextRequest (dpyinfo->display) - 1;
+
+ /* Abort if no request was made since
+ `x_ignore_errors_for_next_request'. */
+
+ if (X_COMPARE_SERIALS (range->end, <,
+ range->start))
+ emacs_abort ();
+
+#ifdef HAVE_GTK3
+ gdpy = gdk_x11_lookup_xdisplay (dpyinfo->display);
+
+ if (gdpy)
+ gdk_x11_display_error_trap_pop_ignored (gdpy);
+#endif
+}
+
/* Undo the last x_catch_errors call.
DPY should be the display that was passed to x_catch_errors.
@@ -23124,7 +23180,7 @@ x_uncatch_errors (void)
/* There is no point in making this extra sync if all requests
are known to have been fully processed. */
&& (LastKnownRequestProcessed (x_error_message->dpy)
- != NextRequest (x_error_message->dpy) - 1)
+ != XNextRequest (x_error_message->dpy) - 1)
/* Likewise if no request was made since the trap was
installed. */
&& (NextRequest (x_error_message->dpy)
@@ -23161,7 +23217,7 @@ x_check_errors (Display *dpy, const char *format)
/* There is no point in making this extra sync if all requests
are known to have been fully processed. */
if ((LastKnownRequestProcessed (dpy)
- != NextRequest (dpy) - 1)
+ != XNextRequest (dpy) - 1)
&& (NextRequest (dpy)
> x_error_message->first_request))
XSync (dpy, False);
@@ -23196,7 +23252,7 @@ x_had_errors_p (Display *dpy)
/* Make sure to catch any errors incurred so far. */
if ((LastKnownRequestProcessed (dpy)
- != NextRequest (dpy) - 1)
+ != XNextRequest (dpy) - 1)
&& (NextRequest (dpy)
> x_error_message->first_request))
XSync (dpy, False);
@@ -23258,10 +23314,26 @@ x_trace_wire (Display *dpy)
static char *error_msg;
+/* Try to find a frame in Vframe_list, and make it the selected frame.
+ `delete_frame' sometimes misses the initial frame for an unknown
+ reason when Emacs is running as a background daemon. */
+
+static void
+x_try_restore_frame (void)
+{
+ Lisp_Object tail, frame;
+
+ FOR_EACH_FRAME (tail, frame)
+ {
+ if (!NILP (do_switch_frame (frame, 1, Qnil)))
+ return;
+ }
+}
+
/* Handle the loss of connection to display DPY. ERROR_MESSAGE is
the text of an error message that lead to the connection loss. */
-static AVOID
+static void
x_connection_closed (Display *dpy, const char *error_message, bool ioerror)
{
struct x_display_info *dpyinfo;
@@ -23270,6 +23342,18 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror)
Emacs_XIOErrorHandler io_error_handler;
xm_drop_start_message dmsg;
struct frame *f;
+ Lisp_Object minibuf_frame, tmp;
+ struct x_failable_request *failable;
+ struct x_error_message_stack *stack;
+ static Display *current_display;
+
+ /* Prevent recursive calls of this function for the same display.
+ This is because destroying a frame might still cause an IO error
+ in some cases. (bug#56528) */
+ if (current_display == dpy)
+ return;
+
+ current_display = dpy;
dpyinfo = x_display_info_for_display (dpy);
error_msg = alloca (strlen (error_message) + 1);
@@ -23369,9 +23453,14 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror)
that are on the dead display. */
FOR_EACH_FRAME (tail, frame)
{
- Lisp_Object minibuf_frame;
+ /* Tooltip frames don't have these, so avoid crashing. */
+
+ if (FRAME_TOOLTIP_P (XFRAME (frame)))
+ continue;
+
minibuf_frame
= WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame))));
+
if (FRAME_X_P (XFRAME (frame))
&& FRAME_X_P (XFRAME (minibuf_frame))
&& ! EQ (frame, minibuf_frame)
@@ -23422,20 +23511,55 @@ For details, see etc/PROBLEMS.\n",
/* We have just closed all frames on this display. */
emacs_abort ();
- {
- Lisp_Object tmp;
- XSETTERMINAL (tmp, dpyinfo->terminal);
- Fdelete_terminal (tmp, Qnoelisp);
- }
+ /* This was the last terminal remaining, so print the error
+ message and associated error handlers and kill Emacs. */
+ if (dpyinfo->terminal == terminal_list
+ && !terminal_list->next_terminal)
+ {
+ fprintf (stderr, "%s\n", error_msg);
+
+ if (!ioerror && dpyinfo)
+ {
+ /* Dump the list of error handlers for debugging
+ purposes. */
+
+ fprintf (stderr, "X error handlers currently installed:\n");
+
+ for (failable = dpyinfo->failable_requests;
+ failable < dpyinfo->next_failable_request;
+ ++failable)
+ {
+ if (failable->end)
+ fprintf (stderr, "Ignoring errors between %lu to %lu\n",
+ failable->start, failable->end);
+ else
+ fprintf (stderr, "Ignoring errors from %lu onwards\n",
+ failable->start);
+ }
+
+ for (stack = x_error_message; stack; stack = stack->prev)
+ fprintf (stderr, "Trapping errors from %lu\n",
+ stack->first_request);
+ }
+ }
+
+ XSETTERMINAL (tmp, dpyinfo->terminal);
+ Fdelete_terminal (tmp, Qnoelisp);
}
+ /* The initial "daemon" frame is sometimes not selected by
+ `delete_frame' when Emacs is a background daemon. */
+ if (NILP (selected_frame))
+ x_try_restore_frame ();
+
unblock_input ();
- if (terminal_list == 0)
- {
- fprintf (stderr, "%s\n", error_msg);
- Fkill_emacs (make_fixnum (70), Qnil);
- }
+ /* Sometimes another terminal is still alive, but deleting this
+ terminal caused all frames to vanish. In that case, simply kill
+ Emacs, since the next redisplay will abort as there is no more
+ selected frame. (bug#56528) */
+ if (terminal_list == 0 || NILP (selected_frame))
+ Fkill_emacs (make_fixnum (70), Qnil);
totally_unblock_input ();
@@ -23445,6 +23569,7 @@ For details, see etc/PROBLEMS.\n",
/* Here, we absolutely have to use a non-local exit (e.g. signal, throw,
longjmp), because returning from this function would get us back into
Xlib's code which will directly call `exit'. */
+ current_display = NULL;
error ("%s", error_msg);
}
@@ -23458,7 +23583,7 @@ x_error_handler (Display *display, XErrorEvent *event)
{
struct x_error_message_stack *stack;
struct x_display_info *dpyinfo;
- unsigned long *fail, *last;
+ struct x_failable_request *fail, *last;
#if defined USE_GTK && defined HAVE_GTK3
if ((event->error_code == BadMatch
@@ -23475,13 +23600,17 @@ x_error_handler (Display *display, XErrorEvent *event)
if (fail)
{
- /* Now that this request has been handled, remove it from
- the list of requests that can fail. */
- last = dpyinfo->next_failable_request;
- memmove (&dpyinfo->failable_requests, fail,
- sizeof *fail * (last - fail));
- dpyinfo->next_failable_request = (dpyinfo->failable_requests
- + (last - fail));
+ /* Now that this request sequence has been fully handled,
+ remove it from the list of requests that can fail. */
+
+ if (event->serial == fail->end)
+ {
+ last = dpyinfo->next_failable_request;
+ memmove (&dpyinfo->failable_requests, fail,
+ sizeof *fail * (last - fail));
+ dpyinfo->next_failable_request = (dpyinfo->failable_requests
+ + (last - fail));
+ }
return 0;
}
@@ -23491,15 +23620,13 @@ x_error_handler (Display *display, XErrorEvent *event)
(that happens a lot in xmenu.c), just ignore the error. */
#ifdef HAVE_XINPUT2
- /* 51 is X_XIGrabDevice and 52 is X_XIUngrabDevice.
-
- 53 is X_XIAllowEvents. We handle errors from that here to avoid
- a sync in handle_one_xevent. */
+ /* Handle errors from some specific XI2 requests here to avoid a
+ sync in handle_one_xevent. */
if (dpyinfo && dpyinfo->supports_xi2
&& event->request_code == dpyinfo->xi2_opcode
- && (event->minor_code == 51
- || event->minor_code == 52
- || event->minor_code == 53))
+ && (event->minor_code == X_XIGrabDevice
+ || event->minor_code == X_XIUngrabDevice
+ || event->minor_code == X_XIAllowEvents))
return 0;
#endif
@@ -23521,7 +23648,8 @@ x_error_handler (Display *display, XErrorEvent *event)
static void NO_INLINE
x_error_quitter (Display *display, XErrorEvent *event)
{
- char buf[256], buf1[356];
+ char buf[256], buf1[400 + INT_STRLEN_BOUND (int)
+ + INT_STRLEN_BOUND (unsigned long)];
/* Ignore BadName errors. They can happen because of fonts
or colors that are not defined. */
@@ -23533,8 +23661,9 @@ x_error_quitter (Display *display, XErrorEvent *event)
original error handler. */
XGetErrorText (display, event->error_code, buf, sizeof (buf));
- sprintf (buf1, "X protocol error: %s on protocol request %d",
- buf, event->request_code);
+ sprintf (buf1, "X protocol error: %s on protocol request %d\n"
+ "Serial no: %lu\n", buf, event->request_code,
+ event->serial);
x_connection_closed (display, buf1, false);
}
@@ -23543,7 +23672,7 @@ x_error_quitter (Display *display, XErrorEvent *event)
It kills all frames on the display that we lost touch with.
If that was the only one, it prints an error message and kills Emacs. */
-static _Noreturn ATTRIBUTE_COLD int
+static int NO_INLINE
x_io_error_quitter (Display *display)
{
char buf[256];
@@ -23551,6 +23680,8 @@ x_io_error_quitter (Display *display)
snprintf (buf, sizeof buf, "Connection lost to X server '%s'",
DisplayString (display));
x_connection_closed (display, buf, true);
+
+ return 0;
}
@@ -24001,10 +24132,45 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_gravity)
&& FRAME_X_OUTPUT (f)->move_offset_top == 0))))
x_check_expected_move (f, modified_left, modified_top);
}
+ /* Instead, just wait for the last ConfigureWindow request to
+ complete. No window manager is involved when moving child
+ frames. */
+ else
+ XSync (FRAME_X_DISPLAY (f), False);
unblock_input ();
}
+static Window
+x_get_wm_check_window (struct x_display_info *dpyinfo)
+{
+ Window result;
+ unsigned char *tmp_data = NULL;
+ int rc, actual_format;
+ unsigned long actual_size, bytes_remaining;
+ Atom actual_type;
+
+ rc = XGetWindowProperty (dpyinfo->display, dpyinfo->root_window,
+ dpyinfo->Xatom_net_supporting_wm_check,
+ 0, 1, False, XA_WINDOW, &actual_type,
+ &actual_format, &actual_size,
+ &bytes_remaining, &tmp_data);
+
+ if (rc != Success || actual_type != XA_WINDOW
+ || actual_format != 32 || actual_size != 1)
+ {
+ if (tmp_data)
+ XFree (tmp_data);
+
+ return None;
+ }
+
+ result = *(Window *) tmp_data;
+ XFree (tmp_data);
+
+ return result;
+}
+
/* Return true if _NET_SUPPORTING_WM_CHECK window exists and _NET_SUPPORTED
on the root window for frame F contains ATOMNAME.
This is how a WM check shall be done according to the Window Manager
@@ -24025,33 +24191,40 @@ x_wm_supports_1 (struct x_display_info *dpyinfo, Atom want_atom)
unsigned char *tmp_data = NULL;
Atom target_type = XA_WINDOW;
+ /* The user says there's no window manager, so take him up on
+ it. */
+ if (!NILP (Vx_no_window_manager))
+ return false;
+
block_input ();
x_catch_errors (dpy);
- rc = XGetWindowProperty (dpy, target_window,
- dpyinfo->Xatom_net_supporting_wm_check,
- 0, max_len, False, target_type,
- &actual_type, &actual_format, &actual_size,
- &bytes_remaining, &tmp_data);
- if (rc != Success || actual_type != XA_WINDOW || x_had_errors_p (dpy))
- {
- if (tmp_data) XFree (tmp_data);
- x_uncatch_errors ();
- unblock_input ();
- return false;
- }
+ wmcheck_window = dpyinfo->net_supported_window;
- wmcheck_window = *(Window *) tmp_data;
- XFree (tmp_data);
+ if (wmcheck_window == None)
+ wmcheck_window = x_get_wm_check_window (dpyinfo);
- /* Check if window exists. */
- XSelectInput (dpy, wmcheck_window, StructureNotifyMask);
- if (x_had_errors_p (dpy))
+ if (!x_special_window_exists_p (dpyinfo, wmcheck_window))
{
- x_uncatch_errors_after_check ();
- unblock_input ();
- return false;
+ if (dpyinfo->net_supported_window != None)
+ {
+ dpyinfo->net_supported_window = None;
+ wmcheck_window = x_get_wm_check_window (dpyinfo);
+
+ if (!x_special_window_exists_p (dpyinfo, wmcheck_window))
+ {
+ x_uncatch_errors ();
+ unblock_input ();
+ return false;
+ }
+ }
+ else
+ {
+ x_uncatch_errors ();
+ unblock_input ();
+ return false;
+ }
}
if (dpyinfo->net_supported_window != wmcheck_window)
@@ -24703,7 +24876,6 @@ x_sync_with_move (struct frame *f, int left, int top, bool fuzzy)
wait_reading_process_output (0, 500000000, 0, false, Qnil, NULL, 0);
}
-
/* Wait for an event on frame F matching EVENTTYPE. */
void
x_wait_for_event (struct frame *f, int eventtype)
@@ -24869,11 +25041,9 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
&deviceid))
{
x_ignore_errors_for_next_request (FRAME_DISPLAY_INFO (f));
-
- XIWarpPointer (FRAME_X_DISPLAY (f),
- deviceid, None,
- FRAME_X_WINDOW (f),
- 0, 0, 0, 0, pix_x, pix_y);
+ XIWarpPointer (FRAME_X_DISPLAY (f), deviceid, None,
+ FRAME_X_WINDOW (f), 0, 0, 0, 0, pix_x, pix_y);
+ x_stop_ignoring_errors (FRAME_DISPLAY_INFO (f));
}
}
else
@@ -25012,6 +25182,7 @@ x_focus_frame (struct frame *f, bool noactivate)
x_ignore_errors_for_next_request (dpyinfo);
XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
RevertToParent, CurrentTime);
+ x_stop_ignoring_errors (dpyinfo);
if (!noactivate)
x_ewmh_activate_frame (f);
@@ -25058,9 +25229,14 @@ xembed_send_message (struct frame *f, Time t, enum xembed_message msg,
event.xclient.data.l[3] = data1;
event.xclient.data.l[4] = data2;
+ /* XXX: the XEmbed spec tells us to trap errors around this request,
+ but I don't understand why: there is no way for clients to
+ survive the death of the parent anyway. */
+
+ x_ignore_errors_for_next_request (FRAME_DISPLAY_INFO (f));
XSendEvent (FRAME_X_DISPLAY (f), FRAME_X_OUTPUT (f)->parent_desc,
False, NoEventMask, &event);
- XSync (FRAME_X_DISPLAY (f), False);
+ x_stop_ignoring_errors (FRAME_DISPLAY_INFO (f));
}
/* Change of visibility. */
@@ -25674,8 +25850,15 @@ x_destroy_window (struct frame *f)
#endif
#ifdef HAVE_XINPUT2
+#ifdef HAVE_XINPUT2_1
if (f->output_data.x->xi_masks)
XFree (f->output_data.x->xi_masks);
+#else
+ /* This is allocated by us under very old versions of libXi; see
+ `setup_xi_event_mask'. */
+ if (f->output_data.x->xi_masks)
+ xfree (f->output_data.x->xi_masks);
+#endif
#endif
xfree (f->output_data.x);
@@ -26909,6 +27092,13 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
}
else
x_uncatch_errors_after_check ();
+
+ /* But don't delude ourselves into thinking that we can use
+ features provided by a version of the input extension that
+ libXi itself doesn't support. */
+
+ if (minor > original_minor)
+ minor = original_minor;
#else
if (x_had_errors_p (dpyinfo->display))
rc = BadRequest;
@@ -27746,10 +27936,13 @@ void
mark_xterm (void)
{
Lisp_Object val;
-#if defined HAVE_XINPUT2 || defined USE_TOOLKIT_SCROLL_BARS
+#if defined HAVE_XINPUT2 || defined USE_TOOLKIT_SCROLL_BARS \
+ || defined HAVE_XRANDR || defined USE_GTK
struct x_display_info *dpyinfo;
+#if defined HAVE_XINPUT2 || defined USE_TOOLKIT_SCROLL_BARS
int i;
#endif
+#endif
if (x_dnd_return_frame_object)
{
@@ -27782,6 +27975,170 @@ mark_xterm (void)
#endif
}
+/* Error handling functions for Lisp functions that expose X protocol
+ requests. They are mostly like `x_catch_errors' and friends, but
+ respect `x-fast-protocol-requests'. */
+
+void
+x_catch_errors_for_lisp (struct x_display_info *dpyinfo)
+{
+ if (!x_fast_protocol_requests)
+ x_catch_errors (dpyinfo->display);
+ else
+ x_ignore_errors_for_next_request (dpyinfo);
+}
+
+void
+x_check_errors_for_lisp (struct x_display_info *dpyinfo,
+ const char *format)
+{
+ if (!x_fast_protocol_requests)
+ x_check_errors (dpyinfo->display, format);
+}
+
+void
+x_uncatch_errors_for_lisp (struct x_display_info *dpyinfo)
+{
+ if (!x_fast_protocol_requests)
+ x_uncatch_errors ();
+ else
+ x_stop_ignoring_errors (dpyinfo);
+}
+
+/* Preserve the selections in LOST in another frame on DPYINFO. LOST
+ is a list of local selections that were lost, due to their frame
+ being deleted. */
+
+void
+x_preserve_selections (struct x_display_info *dpyinfo, Lisp_Object lost,
+ Lisp_Object current_owner)
+{
+ Lisp_Object tail, frame, new_owner, tem;
+ Time timestamp;
+ Window *owners;
+ Atom *names;
+ ptrdiff_t nowners, counter;
+ struct selection_input_event clear;
+#ifdef USE_XCB
+ xcb_get_selection_owner_cookie_t *cookies;
+ xcb_generic_error_t *error;
+ xcb_get_selection_owner_reply_t *reply;
+#endif
+
+ new_owner = Qnil;
+
+ FOR_EACH_FRAME (tail, frame)
+ {
+ if (FRAME_X_P (XFRAME (frame))
+ && !EQ (frame, current_owner)
+ && FRAME_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
+ {
+ new_owner = frame;
+ break;
+ }
+ }
+
+ tail = lost;
+ nowners = 0;
+
+ FOR_EACH_TAIL_SAFE (tail)
+ {
+ tem = XCAR (tail);
+ ++nowners;
+
+ /* The selection is really lost (since we cannot find a new
+ owner), so run the appropriate hooks. */
+ if (NILP (new_owner))
+ CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
+ XCAR (tem));
+ else
+ {
+ CONS_TO_INTEGER (XCAR (XCDR (XCDR (tem))), Time, timestamp);
+
+ /* This shouldn't be able to signal any errors, despite the
+ call to `x_check_errors' inside. */
+ x_own_selection (XCAR (tem), XCAR (XCDR (tem)),
+ new_owner, XCAR (XCDR (XCDR (XCDR (XCDR (tem))))),
+ timestamp);
+ }
+ }
+
+ if (!NILP (new_owner))
+ {
+ owners = alloca (sizeof *owners * nowners);
+ names = alloca (sizeof *names * nowners);
+#ifdef USE_XCB
+ cookies = alloca (sizeof *cookies * nowners);
+#endif
+
+ tail = lost;
+ nowners = 0;
+ counter = 0;
+
+ FOR_EACH_TAIL_SAFE (tail)
+ {
+ tem = XCAR (tail);
+
+ /* Now check if we still don't own that selection, which can
+ happen if another program set itself as the owner. */
+ names[counter++] = symbol_to_x_atom (dpyinfo, XCAR (tem));
+
+#ifndef USE_XCB
+ owners[nowners++] = XGetSelectionOwner (dpyinfo->display,
+ names[counter - 1]);
+#else
+ cookies[nowners++]
+ = xcb_get_selection_owner (dpyinfo->xcb_connection,
+ names[counter - 1]);
+ }
+
+ nowners = 0;
+
+ FOR_EACH_TAIL_SAFE (tail)
+ {
+ reply = xcb_get_selection_owner_reply (dpyinfo->xcb_connection,
+ cookies[nowners++], &error);
+
+ if (reply)
+ owners[nowners - 1] = reply->owner;
+ else
+ owners[nowners - 1] = None;
+
+ free (reply ? (void *) reply : (void *) error);
+#endif
+
+ if (owners[nowners - 1] != FRAME_X_WINDOW (XFRAME (new_owner)))
+ {
+ /* Clear the local selection, since we know we don't own
+ it any longer. */
+ CONS_TO_INTEGER (XCAR (XCDR (XCDR (tem))), Time, timestamp);
+
+ clear.kind = SELECTION_CLEAR_EVENT;
+
+ SELECTION_EVENT_DPYINFO (&clear) = dpyinfo;
+ SELECTION_EVENT_SELECTION (&clear) = names[nowners - 1];
+ SELECTION_EVENT_TIME (&clear) = timestamp;
+
+ x_handle_selection_event (&clear);
+ }
+ }
+
+ tail = lost;
+ nowners = 0;
+
+ FOR_EACH_TAIL_SAFE (tail)
+ {
+ tem = XCAR (tail);
+
+ /* If the selection isn't owned by us anymore, note that the
+ selection was lost. */
+ if (owners[nowners++] != FRAME_X_WINDOW (XFRAME (new_owner)))
+ CALLN (Frun_hook_with_args, Qx_lost_selection_functions,
+ XCAR (tem));
+ }
+ }
+}
+
void
syms_of_xterm (void)
{
@@ -27797,10 +28154,14 @@ syms_of_xterm (void)
x_dnd_selection_alias_cell = Fcons (Qnil, Qnil);
staticpro (&x_dnd_selection_alias_cell);
+ x_dnd_unsupported_drop_data = Qnil;
+ staticpro (&x_dnd_unsupported_drop_data);
+
DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms");
DEFSYM (Qlatin_1, "latin-1");
DEFSYM (Qnow, "now");
DEFSYM (Qx_dnd_targets_list, "x-dnd-targets-list");
+ DEFSYM (Qx_auto_preserve_selections, "x-auto-preserve-selections");
#ifdef USE_GTK
xg_default_icon_file = build_pure_c_string ("icons/hicolor/scalable/apps/emacs.svg");
@@ -27847,7 +28208,7 @@ you, try increasing the value of
x_mouse_click_focus_ignore_position = false;
DEFVAR_INT ("x-mouse-click-focus-ignore-time", x_mouse_click_focus_ignore_time,
- doc: /* Number of miliseconds for which to ignore buttons after focus change.
+ doc: /* Number of milliseconds for which to ignore buttons after focus change.
This variable only takes effect if
`x-mouse-click-focus-ignore-position' is non-nil, and should be
adjusted if the default value does not work for whatever reason. */);
@@ -28021,7 +28382,6 @@ mouse position list. */);
DEFVAR_LISP ("x-dnd-unsupported-drop-function", Vx_dnd_unsupported_drop_function,
doc: /* Function called when trying to drop on an unsupported window.
-
This function is called whenever the user tries to drop something on a
window that does not support either the XDND or Motif protocols for
drag-and-drop. It should return a non-nil value if the drop was
@@ -28034,8 +28394,11 @@ where the drop happened, ACTION is the action that was passed to
`x-begin-drag', FRAME is the frame which initiated the drag-and-drop
operation, TIME is the X server time when the drop happened, and
LOCAL-SELECTION is the contents of the `XdndSelection' when
-`x-begin-drag' was run, which can be passed to
-`x-get-local-selection'. */);
+`x-begin-drag' was run; its contents can be retrieved by calling the
+function `x-get-local-selection'.
+
+If a symbol is returned, then it will be used as the return value of
+`x-begin-drag'. */);
Vx_dnd_unsupported_drop_function = Qnil;
DEFVAR_INT ("x-color-cache-bucket-size", x_color_cache_bucket_size,
@@ -28075,4 +28438,27 @@ drag-and-drop code. */);
When non-nil, `x-begin-drag' will not drop onto any window that only
supports the Motif drag-and-drop protocols. */);
x_dnd_disable_motif_protocol = false;
+
+ DEFVAR_BOOL ("x-dnd-use-unsupported-drop", x_dnd_use_unsupported_drop,
+ doc: /* Enable the emulation of drag-and-drop based on the primary selection.
+When nil, do not use the primary selection and synthetic mouse clicks
+to emulate the drag-and-drop of `STRING', `UTF8_STRING',
+`COMPOUND_TEXT' or `TEXT'. */);
+ x_dnd_use_unsupported_drop = true;
+
+ DEFVAR_BOOL ("x-fast-protocol-requests", x_fast_protocol_requests,
+ doc: /* Whether or not X protocol-related functions should wait for errors.
+When this is nil, functions such as `x-delete-window-property',
+`x-change-window-property' and `x-send-client-message' will wait for a
+reply from the X server, and signal any errors that occurred while
+executing the protocol request. Otherwise, errors will be silently
+ignored without waiting, which is generally faster. */);
+ x_fast_protocol_requests = false;
+
+ DEFVAR_BOOL ("x-auto-preserve-selections", x_auto_preserve_selections,
+ doc: /* Whether or not to transfer selection ownership when deleting a frame.
+When non-nil, deleting a frame that is currently the owner of a
+selection will cause its ownership to be transferred to another frame
+on the same display. */);
+ x_auto_preserve_selections = true;
}
diff --git a/src/xterm.h b/src/xterm.h
index 76d35aaf34f..6afd08eab2b 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -261,6 +261,16 @@ struct xi_device_t
Status x_parse_color (struct frame *f, const char *color_name,
XColor *color);
+struct x_failable_request
+{
+ /* The first request making up this sequence. */
+ unsigned long start;
+
+ /* If this is zero, then the request has not yet been made.
+ Otherwise, this is the request that ends this sequence. */
+ unsigned long end;
+};
+
/* For each X display, we have a structure that records
information about it. */
@@ -628,6 +638,9 @@ struct x_display_info
Xatom_XdndPosition, Xatom_XdndStatus, Xatom_XdndLeave, Xatom_XdndDrop,
Xatom_XdndFinished;
+ /* XDS source and target. */
+ Atom Xatom_XdndDirectSave0, Xatom_XdndActionDirectSave, Xatom_text_plain;
+
#ifdef HAVE_XKB
/* Virtual modifiers */
Atom Xatom_Meta, Xatom_Super, Xatom_Hyper, Xatom_ShiftLock, Xatom_Alt;
@@ -746,12 +759,16 @@ struct x_display_info
int screen_mm_width;
int screen_mm_height;
- /* Circular buffer of request serials to ignore inside an error
- handler in increasing order. */
- unsigned long failable_requests[N_FAILABLE_REQUESTS];
+ /* Circular buffer of request serial ranges to ignore inside an
+ error handler in increasing order. */
+ struct x_failable_request failable_requests[N_FAILABLE_REQUESTS];
/* Pointer to the next request in `failable_requests'. */
- unsigned long *next_failable_request;
+ struct x_failable_request *next_failable_request;
+
+ /* The pending drag-and-drop time for middle-click based
+ drag-and-drop emulation. */
+ Time pending_dnd_time;
};
#ifdef HAVE_X_I18N
@@ -1435,12 +1452,19 @@ extern bool x_text_icon (struct frame *, const char *);
extern void x_catch_errors (Display *);
extern void x_catch_errors_with_handler (Display *, x_special_error_handler,
void *);
+extern void x_catch_errors_for_lisp (struct x_display_info *);
+extern void x_uncatch_errors_for_lisp (struct x_display_info *);
+extern void x_check_errors_for_lisp (struct x_display_info *,
+ const char *)
+ ATTRIBUTE_FORMAT_PRINTF (2, 0);
extern void x_check_errors (Display *, const char *)
ATTRIBUTE_FORMAT_PRINTF (2, 0);
extern bool x_had_errors_p (Display *);
extern void x_unwind_errors_to (int);
extern void x_uncatch_errors (void);
extern void x_uncatch_errors_after_check (void);
+extern void x_ignore_errors_for_next_request (struct x_display_info *);
+extern void x_stop_ignoring_errors (struct x_display_info *);
extern void x_clear_errors (Display *);
extern void x_set_window_size (struct frame *, bool, int, int);
extern void x_set_last_user_time_from_lisp (struct x_display_info *, Time);
@@ -1599,7 +1623,6 @@ extern void x_clipboard_manager_save_all (void);
extern Lisp_Object x_timestamp_for_selection (struct x_display_info *,
Lisp_Object);
-extern void x_set_pending_dnd_time (Time);
extern void x_own_selection (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object, Time);
extern Atom x_intern_cached_atom (struct x_display_info *, const char *,
@@ -1620,6 +1643,8 @@ extern void xic_set_statusarea (struct frame *);
extern void xic_set_xfontset (struct frame *, const char *);
extern bool x_defined_color (struct frame *, const char *, Emacs_Color *,
bool, bool);
+extern void x_preserve_selections (struct x_display_info *, Lisp_Object,
+ Lisp_Object);
#ifdef HAVE_X_I18N
extern void free_frame_xic (struct frame *);
# if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
@@ -1669,12 +1694,14 @@ extern bool x_dnd_in_progress;
extern bool x_dnd_waiting_for_finish;
extern struct frame *x_dnd_frame;
extern struct frame *x_dnd_finish_frame;
-extern unsigned x_dnd_unsupported_event_level;
extern int x_error_message_count;
#ifdef HAVE_XINPUT2
extern struct xi_device_t *xi_device_from_id (struct x_display_info *, int);
extern bool xi_frame_selected_for (struct frame *, unsigned long);
+#ifndef USE_GTK
+extern unsigned int xi_convert_event_state (XIDeviceEvent *);
+#endif
#endif
extern void mark_xterm (void);
diff --git a/test/ChangeLog.1 b/test/ChangeLog.1
index fe7e6626cbf..328609038a7 100644
--- a/test/ChangeLog.1
+++ b/test/ChangeLog.1
@@ -65,7 +65,7 @@
2015-03-10 Paul Eggert <eggert@cs.ucla.edu>
- Prefer "initialize" to "initialise"
+ Prefer "initialize"
* indent/js-indent-init-t.js: Rename from
indent/js-indent-first-initialiser-t.js.
* indent/js-indent-init-dynamic.js: Rename from
diff --git a/test/Makefile.in b/test/Makefile.in
index 0be5842512f..1fa9d5f7d9d 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -151,13 +151,13 @@ endif
%.elc: %.el
$(AM_V_ELC)$(emacs) --batch -f batch-byte-compile $<
+ifdef EMACS_HYDRA_CI
+WRITE_LOG = 2>&1 | tee $@
+else
## Save logs, and show logs for failed tests.
WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
-## On Hydra or Emba, always show logs for certain problematic tests.
-ifdef EMACS_HYDRA_CI
-lisp/net/tramp-tests.log \
-: WRITE_LOG = 2>&1 | tee $@
endif
+## On Emba, always show logs for certain problematic tests.
ifdef EMACS_EMBA_CI
lisp/filenotify-tests.log lisp/net/tramp-tests.log src/emacs-module-tests.log \
: WRITE_LOG = 2>&1 | tee $@
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el
index 56cb9057ed9..64e59f5b9b4 100644
--- a/test/lisp/calc/calc-tests.el
+++ b/test/lisp/calc/calc-tests.el
@@ -445,7 +445,7 @@ An existing calc stack is reused, otherwise a new one is created."
(t ; n<k<0
0))))
((natnump k)
- ;; Generalisation for any n, integral k≥0: use falling product
+ ;; Generalization for any n, integral k≥0: use falling product
(/ (apply '* (number-sequence n (- n (1- k)) -1))
(calc-tests--fac k)))
(t (error "Case not covered"))))
diff --git a/test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp b/test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp
index e7d85101a1a..f5b6d641842 100644
--- a/test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp
@@ -20,7 +20,7 @@
// along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
-// Note: initially provided by by Alex Ott.
+// Note: initially provided by Alex Ott.
template <typename DerivedT>
struct grammar {
diff --git a/test/lisp/dnd-tests.el b/test/lisp/dnd-tests.el
index b6edbc3a2e7..88f6e694577 100644
--- a/test/lisp/dnd-tests.el
+++ b/test/lisp/dnd-tests.el
@@ -411,5 +411,31 @@ This function only tries to handle strings."
(inhibit-message t))
(should (prog1 t (dnd-open-remote-url url 'private)))))
+(ert-deftest dnd-tests-direct-save ()
+ ;; This test just verifies that a direct save works; the window
+ ;; system specific test is in x-dnd-tests.el. When running this
+ ;; interactively, keep in mind that there are only two file managers
+ ;; which are known to implement XDS correctly: System G (see
+ ;; http://nps-systemg.sourceforge.net), and Emacs itself. GTK file
+ ;; managers such as Nautilus will not work, since they prefer the
+ ;; `text/uri-list' selection target to `XdndDirectSave0', contrary
+ ;; to the XDS specification.
+ (let ((window-system window-system)
+ (normal-temp-file (expand-file-name (make-temp-name "dnd-test")
+ temporary-file-directory)))
+ (unwind-protect
+ (progn
+ (unless (file-exists-p normal-temp-file)
+ (write-region "" 0 normal-temp-file))
+ (unless (eq window-system 'x)
+ ;; Use a window system that isn't X, since we only want to test
+ ;; the fallback code when run non-interactively.
+ (setq window-system 'haiku))
+ (should (eq (dnd-direct-save normal-temp-file
+ (make-temp-name "target-file-name"))
+ 'copy)))
+ (ignore-errors
+ (delete-file normal-temp-file)))))
+
(provide 'dnd-tests)
;;; dnd-tests.el ends here
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 9c5bef09a34..a246c25e24f 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -38,7 +38,7 @@
bytecomp-test-var)
(defun bytecomp-test-identity (x)
- "Identity, but hidden from some optimisations."
+ "Identity, but hidden from some optimizations."
x)
(defmacro bytecomp-test-loop (outer1 outer2 inner1 inner2)
@@ -556,7 +556,7 @@ inner loops respectively."
((not x) 3)))
'("a" "b" "c" "d" nil))
- ;; `let' and `let*' optimisations with body being constant or variable
+ ;; `let' and `let*' optimizations with body being constant or variable
(let* (a
(b (progn (setq a (cons 1 a)) 2))
(c (1+ b))
@@ -582,7 +582,7 @@ inner loops respectively."
(let* (x y)
'a)
- ;; Check empty-list optimisations.
+ ;; Check empty-list optimizations.
(mapcar (lambda (x) (member x nil)) '("a" 2 nil))
(mapcar (lambda (x) (memql x nil)) '(a 2 nil))
(mapcar (lambda (x) (memq x nil)) '(a nil))
@@ -597,7 +597,7 @@ inner loops respectively."
(list (mapcar (lambda (x) (assoc (setq n (1+ n)) nil)) '(a "nil"))
n))
- ;; Exercise variable-aliasing optimisations.
+ ;; Exercise variable-aliasing optimizations.
(let ((a (list 1)))
(let ((b a))
(let ((a (list 2)))
diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el
index 9e5d59163f9..d979604910e 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -511,5 +511,26 @@ Evaluate BODY for each created sequence.
(should (equal (seq-difference '(1 nil) '(2 nil))
'(1)))))
+(ert-deftest test-seq-split ()
+ (let ((seq [0 1 2 3 4 5 6 7 8 9 10]))
+ (should (equal seq (car (seq-split seq 20))))
+ (should (equal seq (car (seq-split seq 11))))
+ (should (equal (seq-split seq 10)
+ '([0 1 2 3 4 5 6 7 8 9] [10])))
+ (should (equal (seq-split seq 5)
+ '([0 1 2 3 4] [5 6 7 8 9] [10])))
+ (should (equal (seq-split seq 1)
+ '([0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10])))
+ (should-error (seq-split seq 0))
+ (should-error (seq-split seq -10)))
+ (let ((seq '(0 1 2 3 4 5 6 7 8 9)))
+ (should (equal (seq-split seq 5)
+ '((0 1 2 3 4) (5 6 7 8 9)))))
+ (let ((seq "0123456789"))
+ (should (equal (seq-split seq 2)
+ '("01" "23" "45" "67" "89")))
+ (should (equal (seq-split seq 3)
+ '("012" "345" "678" "9")))))
+
(provide 'seq-tests)
;;; seq-tests.el ends here
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el
index 0bec9db36e9..99c0e822155 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -607,21 +607,36 @@
(should (equal (string-limit "foó" 4 nil 'utf-8) "fo\303\263"))
(should (equal (string-limit "foóa" 4 nil 'utf-8) "fo\303\263"))
(should (equal (string-limit "foóá" 4 nil 'utf-8) "fo\303\263"))
+ (should (equal (string-limit "foóá" 2 nil 'utf-8-with-signature)
+ ""))
(should (equal (string-limit "foóá" 4 nil 'utf-8-with-signature)
- "fo\303\263"))
+ "\357\273\277f"))
(should (equal (string-limit "foóa" 4 nil 'iso-8859-1) "fo\363a"))
(should (equal (string-limit "foóá" 4 nil 'iso-8859-1) "fo\363\341"))
- (should (equal (string-limit "foóá" 4 nil 'utf-16) "\000f\000o"))
+ (should (equal (string-limit "foóá" 3 nil 'utf-16) ""))
+ (should (equal (string-limit "foóá" 6 nil 'utf-16) "\376\377\000f\000o"))
(should (equal (string-limit "foó" 10 t 'utf-8) "fo\303\263"))
(should (equal (string-limit "foó" 3 t 'utf-8) "o\303\263"))
(should (equal (string-limit "foó" 4 t 'utf-8) "fo\303\263"))
(should (equal (string-limit "foóa" 4 t 'utf-8) "o\303\263a"))
(should (equal (string-limit "foóá" 4 t 'utf-8) "\303\263\303\241"))
- (should (equal (string-limit "foóá" 2 t 'utf-8-with-signature) "\303\241"))
+ (should (equal (string-limit "foóá" 2 t 'utf-8-with-signature)
+ ""))
(should (equal (string-limit "foóa" 4 t 'iso-8859-1) "fo\363a"))
(should (equal (string-limit "foóá" 4 t 'iso-8859-1) "fo\363\341"))
- (should (equal (string-limit "foóá" 4 t 'utf-16) "\000\363\000\341")))
+ (should (equal (string-limit "foóá" 6 t 'utf-16) "\376\377\000\363\000\341")))
+
+(ert-deftest subr-string-limit-glyphs ()
+ (should (equal (encode-coding-string "Hello, 👼🏻🧑🏼‍🤝‍🧑🏻" 'utf-8)
+ "Hello, \360\237\221\274\360\237\217\273\360\237\247\221\360\237\217\274\342\200\215\360\237\244\235\342\200\215\360\237\247\221\360\237\217\273"))
+ (should (= (length (encode-coding-string "Hello, 👼🏻🧑🏼‍🤝‍🧑🏻" 'utf-8)) 41))
+ (should (equal (string-limit "Hello, 👼🏻🧑🏼‍🤝‍🧑🏻" 100 nil 'utf-8)
+ "Hello, \360\237\221\274\360\237\217\273\360\237\247\221\360\237\217\274\342\200\215\360\237\244\235\342\200\215\360\237\247\221\360\237\217\273"))
+ (should (equal (string-limit "Hello, 👼🏻🧑🏼‍🤝‍🧑🏻" 15 nil 'utf-8)
+ "Hello, \360\237\221\274\360\237\217\273"))
+ (should (equal (string-limit "Hello, 👼🏻🧑🏼‍🤝‍🧑🏻" 10 nil 'utf-8)
+ "Hello, ")))
(ert-deftest subr-string-lines ()
(should (equal (string-lines "foo") '("foo")))
diff --git a/test/lisp/erc/erc-networks-tests.el b/test/lisp/erc/erc-networks-tests.el
index dcda04692ec..66a334b7091 100644
--- a/test/lisp/erc/erc-networks-tests.el
+++ b/test/lisp/erc/erc-networks-tests.el
@@ -48,7 +48,7 @@
(ert-deftest erc-networks--id ()
(cl-letf (((symbol-function 'float-time)
- (lambda () 0.0)))
+ (lambda (&optional _) 0.0)))
;; Fixed
(should (equal (erc-networks--id-fixed-create 'foo)
@@ -81,7 +81,7 @@
(ert-deftest erc-networks--id-create ()
(cl-letf (((symbol-function 'float-time)
- (lambda () 0.0)))
+ (lambda (&optional _) 0.0)))
(should (equal (erc-networks--id-create 'foo)
(make-erc-networks--id-fixed :ts (float-time)
@@ -1187,7 +1187,7 @@
nil (make-erc-response)))))
(should (string-match-p "failed" (cadr err)))
(should (eq (car err) 'error)))
- (should (string-match-p "*** Failed" (car (pop calls)))))))
+ (should (string-match-p (rx "*** Failed") (car (pop calls)))))))
(erc-networks-tests--clean-bufs)))
diff --git a/test/lisp/erc/erc-scenarios-base-reuse-buffers.el b/test/lisp/erc/erc-scenarios-base-reuse-buffers.el
index 5af9589b745..f134f3ffb69 100644
--- a/test/lisp/erc/erc-scenarios-base-reuse-buffers.el
+++ b/test/lisp/erc/erc-scenarios-base-reuse-buffers.el
@@ -226,7 +226,7 @@ Adapted from scenario clash-of-chans/uniquify described in Bug#48598:
(should chan-buffer-foo))))
(ert-deftest erc-scenarios-base-reuse-buffers-channel-buffers--disabled ()
- :tags '(:expensive-test)
+ :tags '(:expensive-test :unstable)
(with-suppressed-warnings ((obsolete erc-reuse-buffers))
(should erc-reuse-buffers)
(let ((erc-scenarios-common-dialog "base/reuse-buffers/channel")
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 62bea8fb3f0..4971d0e194f 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -664,6 +664,7 @@
(erc-server-current-nick "tester")
(erc-last-input-time 0)
erc-accidental-paste-threshold-seconds
+ erc-send-modify-hook
;;
calls)
(cl-letf (((symbol-function 'erc-process-input-line)
diff --git a/test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld b/test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld
index 4b6ccfff38a..35a9a570b6d 100644
--- a/test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld
+++ b/test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld
@@ -37,7 +37,7 @@
((mode 6 "MODE #chan")
(0 ":irc.barnet.org 324 tester #chan +nt")
(0 ":irc.barnet.org 329 tester #chan 1619593200")
- (0.25 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defence, by mercy, 'tis most just.")
+ (0.25 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defense, by mercy, 'tis most just.")
(0.25 ":mike!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :joe: The Marshal of France, Monsieur la Far.")
(0.25 ":joe!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :mike: And bide the penance of each three years' day.")
(0.25 ":mike!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :joe: Madam, within; but never man so chang'd.")
diff --git a/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld b/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld
index 6f50ecca4ef..f916fea2374 100644
--- a/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld
+++ b/test/lisp/erc/resources/base/assoc/reconplay/foonet.eld
@@ -28,7 +28,7 @@
(0.0 ":bob!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:35:55] alice: This is but a custom in your tongue; you bear a graver purpose, I hope.")
(0.0 ":alice!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:16] bob: To imitate them; faults that are rich are fair.")
(0.0 ":bob!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:18] alice: Our Romeo hath not been in bed to-night.")
- (0.0 ":alice!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:21] bob: But, in defence, by mercy, 'tis most just.")
+ (0.0 ":alice!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:21] bob: But, in defense, by mercy, 'tis most just.")
(0.0 ":bob!~u@mw6kegwt77kwe.irc PRIVMSG #chan :[10:37:25] alice: Younger than she are happy mothers made.")
(0.0 ":***!znc@znc.in PRIVMSG #chan :Playback Complete.")
(0.0 ":irc.foonet.org 305 tester :You are no longer marked as being away"))
diff --git a/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld b/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld
index 766035a524c..e2fe1430283 100644
--- a/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld
+++ b/test/lisp/erc/resources/base/netid/bouncer/barnet-again.eld
@@ -41,7 +41,7 @@
((mode 5 "MODE #chan")
(0 ":irc.barnet.org 324 tester #chan +nt")
(0 ":irc.barnet.org 329 tester #chan 1620805269")
- (0.1 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defence, by mercy, 'tis most just.")
+ (0.1 ":joe!~u@svpn88yjcdj42.irc PRIVMSG #chan :mike: But, in defense, by mercy, 'tis most just.")
(0.1 ":mike!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :joe: The Marshal of France, Monsieur la Far.")
(0.1 ":joe!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :mike: And bide the penance of each three years' day.")
(0.1 ":mike!~u@xrir8fpe4d7ak.irc PRIVMSG #chan :joe: Madam, within; but never man so chang'd.")
diff --git a/test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld b/test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld
index e3c41e2133a..b99621cc311 100644
--- a/test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld
+++ b/test/lisp/erc/resources/base/netid/bouncer/foonet-drop.eld
@@ -36,7 +36,7 @@
(0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: More evident than this; for this was stol'n.")
(0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Sell when you can; you are not for all markets.")
(0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: There's the fool hangs on your back already.")
- (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Why, if you have a stomach to't, monsieur, if you think your mystery in stratagem can bring this instrument of honour again into its native quarter, be magnanimous in the enterprise and go on; I will grace the attempt for a worthy exploit: if you speed well in it, the duke shall both speak of it, and extend to you what further becomes his greatness, even to the utmost syllable of your worthiness.")
+ (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Why, if you have a stomach to't, monsieur, if you think your mystery in stratagem can bring this instrument of honor again into its native quarter, be magnanimous in the enterprise and go on; I will grace the attempt for a worthy exploit: if you speed well in it, the duke shall both speak of it, and extend to you what further becomes his greatness, even to the utmost syllable of your worthiness.")
(0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: For he hath still been tried a holy man.")
(0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: To have the touches dearest priz'd.")
(0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: And must advise the emperor for his good.")
diff --git a/test/lisp/erc/resources/base/netid/bouncer/foonet.eld b/test/lisp/erc/resources/base/netid/bouncer/foonet.eld
index c241c59bb88..b0964fb9537 100644
--- a/test/lisp/erc/resources/base/netid/bouncer/foonet.eld
+++ b/test/lisp/erc/resources/base/netid/bouncer/foonet.eld
@@ -36,7 +36,7 @@
(0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: More evident than this; for this was stol'n.")
(0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Sell when you can; you are not for all markets.")
(0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: There's the fool hangs on your back already.")
- (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Why, if you have a stomach to't, monsieur, if you think your mystery in stratagem can bring this instrument of honour again into its native quarter, be magnanimous in the enterprise and go on; I will grace the attempt for a worthy exploit: if you speed well in it, the duke shall both speak of it, and extend to you what further becomes his greatness, even to the utmost syllable of your worthiness.")
+ (0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: Why, if you have a stomach to't, monsieur, if you think your mystery in stratagem can bring this instrument of honor again into its native quarter, be magnanimous in the enterprise and go on; I will grace the attempt for a worthy exploit: if you speed well in it, the duke shall both speak of it, and extend to you what further becomes his greatness, even to the utmost syllable of your worthiness.")
(0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: For he hath still been tried a holy man.")
(0.1 ":alice!~u@ertp7idh9jtgi.irc PRIVMSG #chan :bob: To have the touches dearest priz'd.")
(0.1 ":bob!~u@ertp7idh9jtgi.irc PRIVMSG #chan :alice: And must advise the emperor for his good.")
diff --git a/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld b/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld
index fc6cdaafe91..0c8cdac0379 100644
--- a/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld
+++ b/test/lisp/erc/resources/base/renick/queries/bouncer-barnet.eld
@@ -35,7 +35,7 @@
((mode 5 "MODE #chan")
(0 ":irc.barnet.org 324 tester #chan +nt")
(0 ":irc.barnet.org 329 tester #chan 1622538742")
- (0.1 ":joe!~u@286u8jcpis84e.irc PRIVMSG #chan :mike: By favours several which they did bestow.")
+ (0.1 ":joe!~u@286u8jcpis84e.irc PRIVMSG #chan :mike: By favors several which they did bestow.")
(0.1 ":mike!~u@286u8jcpis84e.irc PRIVMSG #chan :joe: You, Roderigo! come, sir, I am for you."))
((privmsg-a 5 "PRIVMSG rando :Linda said you were gonna kill me.")
diff --git a/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld b/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld
index 82700c5912c..efc2506fd6f 100644
--- a/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld
+++ b/test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld
@@ -27,7 +27,7 @@
(0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:16] joe: Tush! none but minstrels like of sonneting.")
(0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:19] mike: Prithee, nuncle, be contented; 'tis a naughty night to swim in. Now a little fire in a wide field were like an old lecher's heart; a small spark, all the rest on's body cold. Look! here comes a walking fire.")
(0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:22] joe: My name is Edgar, and thy father's son.")
- (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:26] mike: Good my lord, be good to me; your honour is accounted a merciful man; good my lord.")
+ (0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:26] mike: Good my lord, be good to me; your honor is accounted a merciful man; good my lord.")
(0 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:31] joe: Thy child shall live, and I will see it nourish'd.")
(0 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :[09:09:33] mike: Quick, quick; fear nothing; I'll be at thy elbow.")
(0 ":***!znc@znc.in PRIVMSG #chan :Playback Complete.")
@@ -38,7 +38,7 @@
(0 ":irc.barnet.org 324 tester #chan +nt")
(0 ":irc.barnet.org 329 tester #chan 1620205534")
(0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: That will be given to the loudest noise we make.")
- (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: If it please your honour, I am the poor duke's constable, and my name is Elbow: I do lean upon justice, sir; and do bring in here before your good honour two notorious benefactors.")
+ (0.1 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: If it please your honor, I am the poor duke's constable, and my name is Elbow: I do lean upon justice, sir; and do bring in here before your good honor two notorious benefactors.")
(0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Following the signs, woo'd but the sign of she.")
(0.5 ":joe!~u@wvys46tx8tpmk.irc PRIVMSG #chan :mike: That, sir, which I will not report after her.")
(0.1 ":mike!~u@wvys46tx8tpmk.irc PRIVMSG #chan :joe: Boyet, prepare: I will away to-night.")
diff --git a/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld b/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld
index b8fc45e57b5..3711eb8f8e6 100644
--- a/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld
+++ b/test/lisp/erc/resources/base/upstream-reconnect/soju-barnet.eld
@@ -36,7 +36,7 @@
(0.06 ":joe!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :mike: Once more I'll read the ode that I have writ.")
(0.06 ":mike!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :joe: This is the foul fiend Flibbertigibbet: he begins at curfew, and walks till the first cock; he gives the web and the pin, squints the eye, and makes the harelip; mildews the white wheat, and hurts the poor creature of earth.")
(0.06 ":joe!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :mike: Sir, I praise the Lord for you, and so may my parishioners; for their sons are well tutored by you, and their daughters profit very greatly under you: you are a good member of the commonwealth.")
- (0.08 ":mike!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :joe: If it please your honour, I know not well what they are; but precise villains they are, that I am sure of, and void of all profanation in the world that good Christians ought to have.")
+ (0.08 ":mike!~u@6d9pasqcqwb2s.irc PRIVMSG #chan :joe: If it please your honor, I know not well what they are; but precise villains they are, that I am sure of, and void of all profanation in the world that good Christians ought to have.")
;; Unexpected disconnect
(0.03 ":BouncerServ!BouncerServ@BouncerServ NOTICE tester :disconnected from barnet: failed to handle messages: failed to read IRC command: read tcp [::1]:54990->[::1]:6668: read: software caused connection abort")
;; Eventual reconnect
diff --git a/test/lisp/erc/resources/erc-d/erc-d-i.el b/test/lisp/erc/resources/erc-d/erc-d-i.el
index 27b1bf60839..db113335a82 100644
--- a/test/lisp/erc/resources/erc-d/erc-d-i.el
+++ b/test/lisp/erc/resources/erc-d/erc-d-i.el
@@ -39,14 +39,14 @@ UTF-8 text before parsing, which is nonstandard."
(defconst erc-d-i--tag-escapes
'((";" . "\\:") (" " . "\\s") ("\\" . "\\\\") ("\r" . "\\r") ("\n" . "\\n")))
-;; XXX these are not mirror inverses; unescaping may degenerate
-;; original by dropping stranded/misplaced backslashes.
+;; These are not mirror inverses; unescaping may drop stranded or
+;; misplaced backslashes.
(defconst erc-d-i--tag-escaped-regexp (rx (or ?\; ?\ ?\\ ?\r ?\n)))
(defconst erc-d-i--tag-unescaped-regexp
(rx (or "\\:" "\\s" "\\\\" "\\r" "\\n"
- (seq "\\" (or string-end (not (or ":" "n" "r" "\\")))))))
+ (seq "\\" (or string-end (not (or ":" "s" "n" "r" "\\")))))))
(defun erc-d-i--unescape-tag-value (str)
"Undo substitution of char placeholders in raw tag value STR."
@@ -65,8 +65,6 @@ UTF-8 text before parsing, which is nonstandard."
(defconst erc-d-i--invalid-tag-regexp (rx (any "\0\7\r\n; ")))
-;; This is `erc-v3-message-tags' with fatal errors.
-
(defun erc-d-i--validate-tags (raw)
"Validate tags portion of some RAW incoming message.
RAW must not have a leading \"@\" or a trailing space. The spec says
diff --git a/test/lisp/erc/resources/erc-d/erc-d-tests.el b/test/lisp/erc/resources/erc-d/erc-d-tests.el
index f64b5e8a74c..21005cd7600 100644
--- a/test/lisp/erc/resources/erc-d/erc-d-tests.el
+++ b/test/lisp/erc/resources/erc-d/erc-d-tests.el
@@ -1046,7 +1046,7 @@ nonzero for this to work."
(kill-buffer client-buffer)
(kill-buffer dumb-server-buffer))))
-;; Without adjusting penalty, takes ~15 secs. With is comprable to direct ^.
+;; Without adjusting penalty, takes ~15 secs. With is comparable to direct ^.
(ert-deftest erc-d-run-fuzzy ()
:tags '(:expensive-test)
(let ((erc-server-flood-penalty 1.2) ; penalty < margin/sends is basically 0
diff --git a/test/lisp/erc/resources/erc-d/resources/incremental.eld b/test/lisp/erc/resources/erc-d/resources/incremental.eld
index ab940fe6129..a1b48495ec3 100644
--- a/test/lisp/erc/resources/erc-d/resources/incremental.eld
+++ b/test/lisp/erc/resources/erc-d/resources/incremental.eld
@@ -30,7 +30,7 @@
((mode 3 "MODE #foo")
(0.0 ":irc.foo.net 324 tester #foo +Cint")
(0.0 ":irc.foo.net 329 tester #foo 1519850102")
- (0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: But, in defence, by mercy, 'tis most just.")
+ (0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: But, in defense, by mercy, 'tis most just.")
(0.1 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #foo :bob: Grows, lives, and dies, in single blessedness.")
(0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :Look for me.")
(0.1 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #foo :bob: By this hand, it will not kill a fly. But come, now I will be your Rosalind in a more coming-on disposition; and ask me what you will, I will grant it.")
diff --git a/test/lisp/erc/resources/erc-d/resources/no-block.eld b/test/lisp/erc/resources/erc-d/resources/no-block.eld
index 1b1f3965637..2811923d8ac 100644
--- a/test/lisp/erc/resources/erc-d/resources/no-block.eld
+++ b/test/lisp/erc/resources/erc-d/resources/no-block.eld
@@ -36,7 +36,7 @@
((mode-foo 1.2 "MODE #foo")
(0.0 ":irc.example.org 324 tester #foo +Cint")
(0.0 ":irc.example.org 329 tester #foo 1519850102")
- (-0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: But, in defence, by mercy, 'tis most just.")
+ (-0.1 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: But, in defense, by mercy, 'tis most just.")
(-0.2 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #foo :bob: Grows, lives, and dies, in single blessedness.")
(-0.3 ":bob!~u@svpn88yjcdj42.irc PRIVMSG #foo :alice: For these two hours, Rosalind, I will leave thee.")
(-0.4 ":alice!~u@svpn88yjcdj42.irc PRIVMSG #foo :bob: By this hand, it will not kill a fly. But come, now I will be your Rosalind in a more coming-on disposition; and ask me what you will, I will grant it.")
diff --git a/test/lisp/eshell/em-alias-tests.el b/test/lisp/eshell/em-alias-tests.el
new file mode 100644
index 00000000000..497159e3460
--- /dev/null
+++ b/test/lisp/eshell/em-alias-tests.el
@@ -0,0 +1,87 @@
+;;; em-alias-tests.el --- em-alias test suite -*- lexical-binding:t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Tests for Eshell's alias module.
+
+;;; Code:
+
+(require 'ert)
+(require 'esh-mode)
+(require 'eshell)
+(require 'em-alias)
+
+(require 'eshell-tests-helpers
+ (expand-file-name "eshell-tests-helpers"
+ (file-name-directory (or load-file-name
+ default-directory))))
+;;; Tests:
+
+(ert-deftest em-alias-test/simple-alias ()
+ "Test a simple alias with no arguments"
+ (with-temp-eshell
+ (eshell-insert-command "alias say-hi 'echo hi'")
+ (eshell-command-result-p "say-hi" "hi\n")
+ (eshell-command-result-p "say-hi bye" "hi\n")))
+
+(ert-deftest em-alias-test/alias-arg-vars ()
+ "Test alias with $0, $1, ... variables"
+ (with-temp-eshell
+ (eshell-insert-command "alias show-args 'printnl $0 \"$1 $2\"'")
+ (eshell-command-result-p "show-args one two" "show-args\none two\n")))
+
+(ert-deftest em-alias-test/alias-arg-vars-indices ()
+ "Test alias with $1, $2, ... variables using indices"
+ (with-temp-eshell
+ (eshell-insert-command "alias funny-sum '+ $1[0] $2[1]'")
+ (eshell-command-result-p "funny-sum (list 1 2) (list 3 4)"
+ "5\n")))
+
+(ert-deftest em-alias-test/alias-arg-vars-split-indices ()
+ "Test alias with $0, $1, ... variables using split indices"
+ (with-temp-eshell
+ (eshell-insert-command "alias my-prefix 'echo $0[- 0]'")
+ (eshell-command-result-p "my-prefix"
+ "my\n")
+ (eshell-insert-command "alias funny-sum '+ $1[: 0] $2[: 1]'")
+ (eshell-command-result-p "funny-sum 1:2 3:4"
+ "5\n")))
+
+(ert-deftest em-alias-test/alias-all-args-var ()
+ "Test alias with the $* variable"
+ (with-temp-eshell
+ (eshell-insert-command "alias show-all-args 'printnl $*'")
+ (eshell-command-result-p "show-all-args" "\\`\\'")
+ (eshell-command-result-p "show-all-args a" "a\n")
+ (eshell-command-result-p "show-all-args a b c" "a\nb\nc\n")))
+
+(ert-deftest em-alias-test/alias-all-args-var-indices ()
+ "Test alias with the $* variable using indices"
+ (with-temp-eshell
+ (eshell-insert-command "alias add-pair '+ $*[0] $*[1]'")
+ (eshell-command-result-p "add-pair 1 2" "3\n")))
+
+(ert-deftest em-alias-test/alias-all-args-var-split-indices ()
+ "Test alias with the $* variable using split indices"
+ (with-temp-eshell
+ (eshell-insert-command "alias add-funny-pair '+ $*[0][: 0] $*[1][: 1]'")
+ (eshell-command-result-p "add-funny-pair 1:2 3:4" "5\n")))
+
+;; em-alias-tests.el ends here
diff --git a/test/lisp/eshell/em-dirs-tests.el b/test/lisp/eshell/em-dirs-tests.el
new file mode 100644
index 00000000000..8e96cc07471
--- /dev/null
+++ b/test/lisp/eshell/em-dirs-tests.el
@@ -0,0 +1,102 @@
+;;; em-dirs-tests.el --- em-dirs test suite -*- lexical-binding:t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Tests for Eshell's dirs module.
+
+;;; Code:
+
+(require 'ert)
+(require 'esh-mode)
+(require 'eshell)
+(require 'em-dirs)
+
+(require 'eshell-tests-helpers
+ (expand-file-name "eshell-tests-helpers"
+ (file-name-directory (or load-file-name
+ default-directory))))
+;;; Tests:
+
+(ert-deftest em-dirs-test/pwd-var ()
+ "Test using the $PWD variable."
+ (let ((default-directory "/some/path"))
+ (should (equal (eshell-test-command-result "echo $PWD")
+ (expand-file-name default-directory)))))
+
+(ert-deftest em-dirs-test/pwd-var-indices ()
+ "Test using the $PWD variable with indices."
+ (let ((default-directory "/some/path/here"))
+ (should (equal (eshell-test-command-result "echo $PWD[/ 1]")
+ "some"))
+ (should (equal (eshell-test-command-result "echo $PWD[/ 1 3]")
+ '("some" "here")))))
+
+(ert-deftest em-dirs-test/short-pwd-var ()
+ "Test using the $+ (current directory) variable."
+ (let ((default-directory "/some/path"))
+ (should (equal (eshell-test-command-result "echo $+")
+ (expand-file-name default-directory)))))
+
+(ert-deftest em-dirs-test/oldpwd-var ()
+ "Test using the $OLDPWD variable."
+ (let (eshell-last-dir-ring-file-name)
+ (with-temp-eshell
+ (eshell-command-result-p "echo $OLDPWD"
+ "\\`\\'")
+ (ring-insert eshell-last-dir-ring "/some/path")
+ (eshell-command-result-p "echo $OLDPWD"
+ "/some/path\n"))))
+
+(ert-deftest em-dirs-test/oldpwd-var-indices ()
+ "Test using the $OLDPWD variable with indices."
+ (let (eshell-last-dir-ring-file-name)
+ (with-temp-eshell
+ (ring-insert eshell-last-dir-ring "/some/path/here")
+ (eshell-command-result-p "echo $OLDPWD[/ 1]"
+ "some\n")
+ (eshell-command-result-p "echo $OLDPWD[/ 1 3]"
+ "(\"some\" \"here\")\n"))))
+
+(ert-deftest em-dirs-test/directory-ring-var ()
+ "Test using the $- (directory ring) variable."
+ (let (eshell-last-dir-ring-file-name)
+ (with-temp-eshell
+ (eshell-command-result-p "echo $-"
+ "\\`\\'")
+ (ring-insert eshell-last-dir-ring "/some/path")
+ (ring-insert eshell-last-dir-ring "/other/path")
+ (eshell-command-result-p "echo $-"
+ "/other/path\n")
+ (eshell-command-result-p "echo $-[0]"
+ "/other/path\n")
+ (eshell-command-result-p "echo $-[1]"
+ "/some/path\n"))))
+
+(ert-deftest em-dirs-test/directory-ring-var-indices ()
+ "Test using the $- (directory ring) variable with multiple indices."
+ (let (eshell-last-dir-ring-file-name)
+ (with-temp-eshell
+ (ring-insert eshell-last-dir-ring "/some/path/here")
+ (eshell-command-result-p "echo $-[0][/ 1]"
+ "some\n")
+ (eshell-command-result-p "echo $-[1][/ 1 3]"
+ "(\"some\" \"here\")\n"))))
+
+;; em-dirs-tests.el ends here
diff --git a/test/lisp/eshell/em-script-tests.el b/test/lisp/eshell/em-script-tests.el
new file mode 100644
index 00000000000..a34f9434021
--- /dev/null
+++ b/test/lisp/eshell/em-script-tests.el
@@ -0,0 +1,62 @@
+;;; em-script-tests.el --- em-script test suite -*- lexical-binding:t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Tests for Eshell's script module.
+
+;;; Code:
+
+(require 'ert)
+(require 'esh-mode)
+(require 'eshell)
+(require 'em-script)
+
+(require 'eshell-tests-helpers
+ (expand-file-name "eshell-tests-helpers"
+ (file-name-directory (or load-file-name
+ default-directory))))
+;;; Tests:
+
+(ert-deftest em-script-test/source-script ()
+ "Test sourcing script with no argumentss"
+ (ert-with-temp-file temp-file :text "echo hi"
+ (with-temp-eshell
+ (eshell-command-result-p (format "source %s" temp-file)
+ "hi\n"))))
+
+(ert-deftest em-script-test/source-script-arg-vars ()
+ "Test sourcing script with $0, $1, ... variables"
+ (ert-with-temp-file temp-file :text "printnl $0 \"$1 $2\""
+ (with-temp-eshell
+ (eshell-command-result-p (format "source %s one two" temp-file)
+ (format "%s\none two\n" temp-file)))))
+
+(ert-deftest em-script-test/source-script-all-args-var ()
+ "Test sourcing script with the $* variable"
+ (ert-with-temp-file temp-file :text "printnl $*"
+ (with-temp-eshell
+ (eshell-command-result-p (format "source %s" temp-file)
+ "\\`\\'")
+ (eshell-command-result-p (format "source %s a" temp-file)
+ "a\n")
+ (eshell-command-result-p (format "source %s a b c" temp-file)
+ "a\nb\nc\n"))))
+
+;; em-script-tests.el ends here
diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el
index 3180fe7a5fc..54e701a6aab 100644
--- a/test/lisp/eshell/esh-var-tests.el
+++ b/test/lisp/eshell/esh-var-tests.el
@@ -487,6 +487,19 @@ inside double-quotes"
(should (equal (eshell-test-command-result "echo $COLUMNS")
(window-body-width nil 'remap))))
+(ert-deftest esh-var-test/inside-emacs-var ()
+ "Test presence of \"INSIDE_EMACS\" in subprocesses"
+ (with-temp-eshell
+ (eshell-command-result-p "env"
+ (format "INSIDE_EMACS=%s,eshell"
+ emacs-version))))
+
+(ert-deftest esh-var-test/inside-emacs-var-split-indices ()
+ "Test using \"INSIDE_EMACS\" with split indices"
+ (with-temp-eshell
+ (eshell-command-result-p "echo $INSIDE_EMACS[, 1]"
+ "eshell")))
+
(ert-deftest esh-var-test/last-result-var ()
"Test using the \"last result\" ($$) variable"
(with-temp-eshell
@@ -497,12 +510,38 @@ inside double-quotes"
"Test using the \"last result\" ($$) variable twice"
(with-temp-eshell
(eshell-command-result-p "+ 1 2; + $$ $$"
- "3\n6\n")))
+ "3\n6\n")))
+
+(ert-deftest esh-var-test/last-result-var-split-indices ()
+ "Test using the \"last result\" ($$) variable with split indices"
+ (with-temp-eshell
+ (eshell-command-result-p
+ "string-join (list \"01\" \"02\") :; + $$[: 1] 3"
+ "01:02\n5\n")
+ (eshell-command-result-p
+ "string-join (list \"01\" \"02\") :; echo \"$$[: 1]\""
+ "01:02\n02\n")))
(ert-deftest esh-var-test/last-arg-var ()
"Test using the \"last arg\" ($_) variable"
(with-temp-eshell
(eshell-command-result-p "+ 1 2; + $_ 4"
- "3\n6\n")))
+ "3\n6\n")))
+
+(ert-deftest esh-var-test/last-arg-var-indices ()
+ "Test using the \"last arg\" ($_) variable with indices"
+ (with-temp-eshell
+ (eshell-command-result-p "+ 1 2; + $_[0] 4"
+ "3\n5\n")
+ (eshell-command-result-p "+ 1 2; + $_[1] 4"
+ "3\n6\n")))
+
+(ert-deftest esh-var-test/last-arg-var-split-indices ()
+ "Test using the \"last arg\" ($_) variable with split indices"
+ (with-temp-eshell
+ (eshell-command-result-p "concat 01:02 03:04; + $_[0][: 1] 5"
+ "01:0203:04\n7\n")
+ (eshell-command-result-p "concat 01:02 03:04; echo \"$_[0][: 1]\""
+ "01:0203:04\n02\n")))
;; esh-var-tests.el ends here
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index ab5d73d4792..5dc18775485 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -178,13 +178,6 @@ e.g. \"{(+ 1 2)} 3\" => 3"
(string-replace "\\" "\\\\" bufname))))
(should (equal (buffer-string) "hi")))))
-(ert-deftest eshell-test/inside-emacs-var ()
- "Test presence of \"INSIDE_EMACS\" in subprocesses"
- (with-temp-eshell
- (eshell-command-result-p "env"
- (format "INSIDE_EMACS=%s,eshell"
- emacs-version))))
-
(ert-deftest eshell-test/escape-nonspecial ()
"Test that \"\\c\" and \"c\" are equivalent when \"c\" is not a
special character."
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index ad0138b2e7b..4ed1786a8ef 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -178,10 +178,6 @@ Return nil when any other file notification watch is still active."
tramp-allow-unsafe-temporary-files
(or tramp-allow-unsafe-temporary-files noninteractive))
-;; This should happen on hydra only.
-(when (getenv "EMACS_HYDRA_CI")
- (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
-
(defun file-notify--test-add-watch (file flags callback)
"Like `file-notify-add-watch', but also passing FILE to CALLBACK."
(file-notify-add-watch file flags
diff --git a/test/lisp/isearch-tests.el b/test/lisp/isearch-tests.el
index 4600757d940..8cb5e5e4542 100644
--- a/test/lisp/isearch-tests.el
+++ b/test/lisp/isearch-tests.el
@@ -38,5 +38,85 @@
;; Bug #21091: let `isearch-done' work without `isearch-update'.
(isearch-done))
+
+;; Search functions.
+
+(defun isearch--test-search-within-boundaries (pairs)
+ (goto-char (point-min))
+ (let ((isearch-forward t)
+ (isearch-regexp nil))
+ (dolist (pos (append pairs nil))
+ (should (eq (cdr pos) (isearch-search-string "foo" nil t)))
+ (should (equal (match-string 0) "foo"))
+ (when (car pos) (should (eq (car pos) (match-beginning 0))))))
+
+ (goto-char (point-max))
+ (let ((isearch-forward nil)
+ (isearch-regexp nil))
+ (dolist (pos (append (reverse pairs) nil))
+ (should (eq (car pos) (isearch-search-string "foo" nil t)))
+ (should (equal (match-string 0) "foo"))
+ (when (cdr pos) (should (eq (cdr pos) (match-end 0))))))
+
+ (goto-char (point-min))
+ (let ((isearch-forward t)
+ (isearch-regexp t))
+ (dolist (pos (append pairs nil))
+ (should (eq (cdr pos) (isearch-search-string ".*" nil t)))
+ (should (equal (match-string 0) "foo"))
+ (when (car pos) (should (eq (car pos) (match-beginning 0))))))
+
+ (goto-char (point-min))
+ (let ((isearch-forward t)
+ (isearch-regexp t))
+ (dolist (pos (append pairs nil))
+ (should (eq (cdr pos) (isearch-search-string "^.*" nil t)))
+ (should (equal (match-string 0) "foo"))
+ (when (car pos) (should (eq (car pos) (match-beginning 0))))))
+
+ (goto-char (point-min))
+ (let ((isearch-forward t)
+ (isearch-regexp t))
+ (dolist (pos (append pairs nil))
+ (should (eq (cdr pos) (isearch-search-string ".*$" nil t)))
+ (should (equal (match-string 0) "foo"))
+ (when (car pos) (should (eq (car pos) (match-beginning 0))))))
+
+ (goto-char (point-max))
+ (let ((isearch-forward nil)
+ (isearch-regexp t))
+ (dolist (pos (append (reverse pairs) nil))
+ (should (eq (car pos) (isearch-search-string "^.*" nil t)))
+ (should (equal (match-string 0) "foo"))
+ (when (cdr pos) (should (eq (cdr pos) (match-end 0))))))
+
+ (goto-char (point-max))
+ (let ((isearch-forward nil)
+ (isearch-regexp t))
+ (dolist (pos (append (reverse pairs) nil))
+ (should (eq (car pos) (isearch-search-string "foo$" nil t)))
+ (should (equal (match-string 0) "foo"))
+ (when (cdr pos) (should (eq (cdr pos) (match-end 0)))))))
+
+(ert-deftest isearch--test-search-fun-in-text-property ()
+ (let* ((pairs '((4 . 7) (11 . 14) (21 . 24)))
+ (isearch-search-fun-function
+ (lambda () (isearch-search-fun-in-text-property nil 'dired-filename))))
+ (with-temp-buffer
+ (insert "foo" (propertize "foo" 'dired-filename t) "foo\n")
+ (insert (propertize "foo" 'dired-filename t) "foo\n")
+ (insert "foo" (propertize "foo" 'dired-filename t) "\n")
+ (isearch--test-search-within-boundaries pairs))))
+
+(ert-deftest isearch--test-search-fun-in-noncontiguous-region ()
+ (let* ((pairs '((4 . 7) (11 . 14) (21 . 24)))
+ (isearch-search-fun-function
+ (lambda () (isearch-search-fun-in-noncontiguous-region nil pairs))))
+ (with-temp-buffer
+ (insert "foofoofoo\n")
+ (insert "foofoo\n")
+ (insert "foofoo\n")
+ (isearch--test-search-within-boundaries pairs))))
+
(provide 'isearch-tests)
;;; isearch-tests.el ends here
diff --git a/test/lisp/mail/mail-extr-tests.el b/test/lisp/mail/mail-extr-tests.el
new file mode 100644
index 00000000000..a8f0c605cb0
--- /dev/null
+++ b/test/lisp/mail/mail-extr-tests.el
@@ -0,0 +1,41 @@
+;;; mail-extr-tests.el --- Tests for mail-extr.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'mail-extr)
+
+(defconst mail-extract-test-cases
+ '(("foo@example.org" . (nil "foo@example.org"))
+ ("J. Random Hacker <foo@example.org>" . ("J. Random Hacker" "foo@example.org"))
+ ("\"J. Random Hacker\" <foo@example.org>" . ("J. Random Hacker" "foo@example.org"))
+ ("Ååå Äää <foo@example.org>" . ("Ååå Äää" "foo@example.org"))))
+
+(ert-deftest mail-extract-address-components ()
+ (dolist (test mail-extract-test-cases)
+ (should (equal (mail-extract-address-components (car test)) (cdr test)))))
+
+(ert-deftest what-domain ()
+ (should (equal (what-domain "cu") "CU: Cuba")))
+
+(provide 'mail-extr-tests)
+;;; mail-extr-tests.el ends here
diff --git a/test/lisp/net/browse-url-tests.el b/test/lisp/net/browse-url-tests.el
index 8fcc831d538..1c993958b81 100644
--- a/test/lisp/net/browse-url-tests.el
+++ b/test/lisp/net/browse-url-tests.el
@@ -31,7 +31,7 @@
(require 'ert-x)
(ert-deftest browse-url-tests-browser-kind ()
- (should (eq (browse-url--browser-kind #'browse-url-w3 "gnu.org")
+ (should (eq (browse-url--browser-kind #'browse-url-emacs "gnu.org")
'internal))
(should
(eq (browse-url--browser-kind #'browse-url-firefox "gnu.org")
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 63fd96cae80..8b6d10033f1 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -128,6 +128,7 @@ A resource file is in the resource directory as per
`(expand-file-name ,file (ert-resource-directory)))))
;; `ert-remote-temporary-file-directory' was introduced in Emacs 29.1.
+;; Adapting `tramp-remote-path' happens also there.
(unless (boundp 'ert-remote-temporary-file-directory)
(eval-and-compile
;; There is no default value on w32 systems, which could work out
@@ -152,7 +153,11 @@ A resource file is in the resource directory as per
(unless (and (null noninteractive) (file-directory-p "~/"))
(setenv "HOME" temporary-file-directory))
(format "/mock::%s" temporary-file-directory)))
- "Temporary directory for remote file tests.")))
+ "Temporary directory for remote file tests.")
+
+ ;; This should happen on hydra only.
+ (when (getenv "EMACS_HYDRA_CI")
+ (add-to-list 'tramp-remote-path 'tramp-own-remote-path))))
;; Beautify batch mode.
(when noninteractive
@@ -178,10 +183,6 @@ A resource file is in the resource directory as per
tramp-persistency-file-name nil
tramp-verbose 0)
-;; This should happen on hydra only.
-(when (getenv "EMACS_HYDRA_CI")
- (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
-
(defvar tramp--test-enabled-checked nil
"Cached result of `tramp--test-enabled'.
If the function did run, the value is a cons cell, the `cdr'
@@ -6570,7 +6571,7 @@ Additionally, ls does not support \"--dired\"."
;; This fails for tramp-crypt.el, so we ignore that.
(ignore-errors
(insert-directory ert-remote-temporary-file-directory "-al"))
- (not (tramp-get-connection-property tramp-test-vec "ls--dired" nil)))))
+ (not (tramp-get-connection-property tramp-test-vec "ls--dired")))))
(defun tramp--test-share-p ()
"Check, whether the method needs a share."
@@ -7141,13 +7142,13 @@ The values are derived from PROC. Run BODY.
This is needed in timer functions as well as process filters and sentinels."
;; FIXME: For tramp-sshfs.el, `processp' does not work.
(declare (indent 1) (debug (processp body)))
- `(let* ((v (tramp-get-connection-property ,proc "vector" nil))
- (pname (tramp-get-connection-property v "process-name" nil))
- (pbuffer (tramp-get-connection-property v "process-buffer" nil)))
+ `(let* ((v (tramp-get-connection-property ,proc "vector"))
+ (pname (tramp-get-connection-property v "process-name"))
+ (pbuffer (tramp-get-connection-property v "process-buffer")))
(tramp--test-message
"tramp--test-with-proper-process-name-and-buffer before %s %s"
- (tramp-get-connection-property v "process-name" nil)
- (tramp-get-connection-property v "process-buffer" nil))
+ (tramp-get-connection-property v "process-name")
+ (tramp-get-connection-property v "process-buffer"))
(if (process-name ,proc)
(tramp-set-connection-property v "process-name" (process-name ,proc))
(tramp-flush-connection-property v "process-name"))
@@ -7157,8 +7158,8 @@ This is needed in timer functions as well as process filters and sentinels."
(tramp-flush-connection-property v "process-buffer"))
(tramp--test-message
"tramp--test-with-proper-process-name-and-buffer changed %s %s"
- (tramp-get-connection-property v "process-name" nil)
- (tramp-get-connection-property v "process-buffer" nil))
+ (tramp-get-connection-property v "process-name")
+ (tramp-get-connection-property v "process-buffer"))
(unwind-protect
(progn ,@body)
(if pname
diff --git a/test/lisp/progmodes/autoconf-tests.el b/test/lisp/progmodes/autoconf-tests.el
index e383b4bb6c4..7c609f3c2a7 100644
--- a/test/lisp/progmodes/autoconf-tests.el
+++ b/test/lisp/progmodes/autoconf-tests.el
@@ -31,18 +31,18 @@
(ert-deftest autoconf-tests-current-defun-function-define ()
(with-temp-buffer
- (insert "AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.])")
+ (insert "AC_DEFINE([HAVE_RSVG], [1], [Define to 1 if using librsvg.])")
(goto-char (point-min))
(should-not (autoconf-current-defun-function))
- (forward-char 10)
+ (forward-char 11)
(should (equal (autoconf-current-defun-function) "HAVE_RSVG"))))
(ert-deftest autoconf-tests-current-defun-function-subst ()
(with-temp-buffer
- (insert "AC_SUBST(srcdir)")
+ (insert "AC_SUBST([srcdir])")
(goto-char (point-min))
(should-not (autoconf-current-defun-function))
- (forward-char 9)
+ (forward-char 10)
(should (equal (autoconf-current-defun-function) "srcdir"))))
(ert-deftest autoconf-tests-autoconf-mode-comment-syntax ()
diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el
index 774370be4cf..36bdbe4c91b 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -260,6 +260,9 @@
"e: e:\\src\\Test.kt: (34, 15): foo: bar" 4 15 34 "e:\\src\\Test.kt" 2)
(gradle-kotlin
"w: e:\\src\\Test.kt: (11, 98): foo: bar" 4 98 11 "e:\\src\\Test.kt" 1)
+ (gradle-android
+ " ERROR:/Users/salutis/src/AndroidSchemeExperiment/app/build/intermediates/incremental/debug/mergeDebugResources/stripped.dir/layout/item.xml:3: AAPT: error: '16dpw' is incompatible with attribute padding (attr) dimension."
+ 1 nil 3 "/Users/salutis/src/AndroidSchemeExperiment/app/build/intermediates/incremental/debug/mergeDebugResources/stripped.dir/layout/item.xml" 2)
;; Guile
(guile-file "In foo.scm:\n" 1 nil nil "foo.scm")
(guile-line " 63:4 [call-with-prompt prompt0 ...]" 1 4 63 nil)
@@ -492,7 +495,7 @@ The test data is in `compile-tests--test-regexps-data'."
(compilation-num-warnings-found 0)
(compilation-num-infos-found 0))
(mapc #'compile--test-error-line compile-tests--test-regexps-data)
- (should (eq compilation-num-errors-found 97))
+ (should (eq compilation-num-errors-found 98))
(should (eq compilation-num-warnings-found 35))
(should (eq compilation-num-infos-found 28)))))
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index c59a2e79533..92c20288c8e 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1757,6 +1757,36 @@ def foo(x):
(should (= (marker-position (mark-marker))
expected-mark-end-position)))))
+(ert-deftest python-mark-defun-5 ()
+ "Test `python-mark-defun' with point inside backslash escaped defun."
+ (python-tests-with-temp-buffer
+ "
+def \\
+ foo(x):
+ return x
+"
+ (let ((transient-mark-mode t)
+ (expected-mark-beginning-position
+ (progn
+ (python-tests-look-at "def ")
+ (1- (line-beginning-position))))
+ (expected-mark-end-position
+ (save-excursion
+ (python-tests-look-at "return x")
+ (forward-line)
+ (point))))
+ (python-tests-look-at "def ")
+ (python-mark-defun 1)
+ (should (= (point) expected-mark-beginning-position))
+ (should (= (marker-position (mark-marker))
+ expected-mark-end-position))
+ (deactivate-mark)
+ (python-tests-look-at "foo(x)")
+ (python-mark-defun 1)
+ (should (= (point) expected-mark-beginning-position))
+ (should (= (marker-position (mark-marker))
+ expected-mark-end-position)))))
+
;;; Navigation
@@ -1845,7 +1875,7 @@ class C(object):
(python-tests-look-at "def m(self):" -1)
(beginning-of-line)
(point))))
- ;; Nested defuns shuld be skipped.
+ ;; Nested defuns should be skipped.
(python-tests-look-at "return a" -1)
(should (= (save-excursion
(python-nav-beginning-of-defun)
@@ -1905,17 +1935,47 @@ class C(object):
(ert-deftest python-nav-beginning-of-defun-4 ()
(python-tests-with-temp-buffer
"
+def a():
+ pass
+
def \\
- a():
+ b():
return 0
+
+def c():
+ pass
"
- (python-tests-look-at "return 0")
+ (python-tests-look-at "def c():")
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def \\" -1)
+ (beginning-of-line)
+ (point))))
+ (python-tests-look-at "return 0" -1)
(should (= (save-excursion
(python-nav-beginning-of-defun)
(point))
(save-excursion
(python-tests-look-at "def \\" -1)
(beginning-of-line)
+ (point))))
+ (python-tests-look-at "b():" -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def \\" -1)
+ (beginning-of-line)
+ (point))))
+ (python-tests-look-at "def a():" -1)
+ (should (= (save-excursion
+ (python-nav-beginning-of-defun -1)
+ (point))
+ (save-excursion
+ (python-tests-look-at "def \\")
+ (beginning-of-line)
(point))))))
(ert-deftest python-nav-end-of-defun-1 ()
@@ -5242,6 +5302,23 @@ def decorat0r(deff):
(python-tests-look-at "deff()")
(should (not (python-info-looking-at-beginning-of-defun)))))
+(ert-deftest python-info-looking-at-beginning-of-defun-2 ()
+ (python-tests-with-temp-buffer
+ "
+def \\
+ foo(arg):
+ pass
+"
+ (python-tests-look-at "def \\")
+ (should (python-info-looking-at-beginning-of-defun))
+ (should (python-info-looking-at-beginning-of-defun nil t))
+ (python-tests-look-at "foo(arg):")
+ (should (not (python-info-looking-at-beginning-of-defun)))
+ (should (python-info-looking-at-beginning-of-defun nil t))
+ (python-tests-look-at "pass")
+ (should (not (python-info-looking-at-beginning-of-defun)))
+ (should (not (python-info-looking-at-beginning-of-defun nil t)))))
+
(ert-deftest python-info-current-line-comment-p-1 ()
(python-tests-with-temp-buffer
"
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index e822bc9eb66..0916f7ce688 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -55,10 +55,6 @@
ert-remote-temporary-file-directory
(ignore-errors (file-truename ert-remote-temporary-file-directory)))
-;; This should happen on hydra only.
-(when (getenv "EMACS_HYDRA_CI")
- (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
-
(defconst shadow-test-info-file
(expand-file-name "shadows_test" temporary-file-directory)
"File to keep shadow information in during tests.")
diff --git a/test/lisp/so-long-tests/spelling-tests.el b/test/lisp/so-long-tests/spelling-tests.el
index ce4b0844c99..7bd06395535 100644
--- a/test/lisp/so-long-tests/spelling-tests.el
+++ b/test/lisp/so-long-tests/spelling-tests.el
@@ -58,7 +58,7 @@
(find-spelling-mistake
(cl-letf (((symbol-function 'ispell-command-loop)
(lambda (_miss _guess word _start _end)
- (message "Unrecognised word: %s." word)
+ (message "Unrecognized word: %s." word)
(throw 'mistake t))))
(catch 'mistake
(find-library "so-long")
diff --git a/test/lisp/textmodes/emacs-news-mode-resources/toggle-tag.erts b/test/lisp/textmodes/emacs-news-mode-resources/toggle-tag.erts
new file mode 100644
index 00000000000..63c3b1b7d8a
--- /dev/null
+++ b/test/lisp/textmodes/emacs-news-mode-resources/toggle-tag.erts
@@ -0,0 +1,131 @@
+Name: tag1
+Point-Char: |
+
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+|Before, that binding was only available with 'dired-x'.
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+---
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+|Before, that binding was only available with 'dired-x'.
+=-=-=
+
+Name: tag2
+Point-Char: |
+
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+---
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+|Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
++++
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+|Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=-=
+
+Name: tag3
+Point-Char: |
+
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
++++
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+|Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+|Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=-=
+
+Name: tag4-point-at-headline
+Point-Char: |
+
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+|*** 'M-G' is now bound to 'dired-goto-subdir'.
+Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+---
+|*** 'M-G' is now bound to 'dired-goto-subdir'.
+Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=-=
+
+Name: tag5-point-at-tag
+Point-Char: |
+
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+|---
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+|+++
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=-=
+
+Name: tag6-point-at-tag
+Point-Char: |
+
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+|+++
+*** 'M-G' is now bound to 'dired-goto-subdir'.
+Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=
++++
+*** 'dired-do-relsymlink-regexp' moved from dired-x to dired.
+The corresponding key "% Y" is now bound by default in Dired.
+
+|*** 'M-G' is now bound to 'dired-goto-subdir'.
+Before, that binding was only available if the 'dired-x' package was
+loaded.
+=-=-=
diff --git a/test/lisp/textmodes/emacs-news-mode-tests.el b/test/lisp/textmodes/emacs-news-mode-tests.el
new file mode 100644
index 00000000000..d2da5eda906
--- /dev/null
+++ b/test/lisp/textmodes/emacs-news-mode-tests.el
@@ -0,0 +1,32 @@
+;;; emacs-news-mode-tests.el --- Tests for emacs-news-mode.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'ert-x)
+(require 'emacs-news-mode)
+
+(ert-deftest emacs-news-toggle-tag ()
+ (ert-test-erts-file (ert-resource-file "toggle-tag.erts")
+ (lambda ()
+ (emacs-news-mode)
+ (emacs-news-toggle-tag))))
+
+;;; emacs-news-mode-tests.el ends here
diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el
index d52a19ef5d1..8361d58b558 100644
--- a/test/lisp/time-stamp-tests.el
+++ b/test/lisp/time-stamp-tests.el
@@ -271,7 +271,8 @@
(should (equal (time-stamp-string "%3a" ref-time1) Mon))
(should (equal (time-stamp-string "%#A" ref-time1) MONDAY))
;; documented 1997-2019
- (should (equal (time-stamp-string "%3A" ref-time1) MON))
+ (should (equal (time-stamp-string "%3A" ref-time1)
+ (substring MONDAY 0 3)))
(should (equal (time-stamp-string "%:a" ref-time1) Monday))
;; implemented since 2001, documented since 2019
(should (equal (time-stamp-string "%#a" ref-time1) MON))
@@ -291,10 +292,12 @@
(January (format-time-string "%B" ref-time1 t))
(JANUARY (format-time-string "%^B" ref-time1 t)))
;; implemented and documented since 1997
- (should (equal (time-stamp-string "%3b" ref-time1) Jan))
+ (should (equal (time-stamp-string "%3b" ref-time1)
+ (substring January 0 3)))
(should (equal (time-stamp-string "%#B" ref-time1) JANUARY))
;; documented 1997-2019
- (should (equal (time-stamp-string "%3B" ref-time1) JAN))
+ (should (equal (time-stamp-string "%3B" ref-time1)
+ (substring JANUARY 0 3)))
(should (equal (time-stamp-string "%:b" ref-time1) January))
;; implemented since 2001, documented since 2019
(should (equal (time-stamp-string "%#b" ref-time1) JAN))
@@ -652,15 +655,17 @@
(should (equal (time-stamp-string "%0b" ref-time3) ""))
(should (equal (time-stamp-string "%1b" ref-time3) (substring May 0 1)))
(should (equal (time-stamp-string "%2b" ref-time3) (substring May 0 2)))
- (should (equal (time-stamp-string "%3b" ref-time3) May))
+ (should (equal (time-stamp-string "%3b" ref-time3) (substring May 0 3)))
(should (equal (time-stamp-string "%4b" ref-time3) (concat " " May)))
(should (equal (time-stamp-string "%0%" ref-time3) ""))
(should (equal (time-stamp-string "%1%" ref-time3) "%"))
(should (equal (time-stamp-string "%2%" ref-time3) " %"))
(should (equal (time-stamp-string "%9%" ref-time3) " %"))
(should (equal (time-stamp-string "%10%" ref-time3) " %"))
- (should (equal (time-stamp-string "%#3a" ref-time3) SUN))
- (should (equal (time-stamp-string "%#3b" ref-time2) NOV)))))
+ (should (equal (time-stamp-string "%#3a" ref-time3)
+ (substring SUN 0 3)))
+ (should (equal (time-stamp-string "%#3b" ref-time2)
+ (substring NOV 0 3))))))
;;; Tests of helper functions
diff --git a/test/lisp/x-dnd-tests.el b/test/lisp/x-dnd-tests.el
index 35cda3b10a0..8856be79ebc 100644
--- a/test/lisp/x-dnd-tests.el
+++ b/test/lisp/x-dnd-tests.el
@@ -24,6 +24,7 @@
;;; Code:
(require 'x-dnd)
+(require 'cl-lib)
(when (display-graphic-p)
(error "This test cannot be run under X"))
@@ -33,6 +34,9 @@
(defconst x-dnd-tests-drag-window-xid 3948573
"XID of the drag window returned during the test.")
+(defvar x-dnd-tests-xds-property-value nil
+ "The value of the `XdndDirectSave0' window property.")
+
(defconst x-dnd-tests-targets-table
(base64-decode-string
"bAArAKIBAAAGAB8AAABqAQAANgIAAJMCAAAFAwAABgMAAAEAkMJbAAEAINNbAAUAHwAAAGoBAAA2
@@ -62,7 +66,7 @@ AgAABQMAAAYDAAATGwAAGhsAAA==")
"The expected result of parsing that targets table.")
(defalias 'x-window-property
- (lambda (prop &optional _frame type window-id _delete-p _vector-ret-p)
+ (lambda (prop &optional _frame type window-id delete-p _vector-ret-p)
(cond
((and (equal prop "_MOTIF_DRAG_WINDOW")
(zerop window-id) (equal type "WINDOW"))
@@ -70,7 +74,13 @@ AgAABQMAAAYDAAATGwAAGhsAAA==")
((and (equal prop "_MOTIF_DRAG_TARGETS")
(equal type "_MOTIF_DRAG_TARGETS")
(equal window-id x-dnd-tests-drag-window-xid))
- x-dnd-tests-targets-table))))
+ x-dnd-tests-targets-table)
+ ((and (equal prop "XdndDirectSave0")
+ (or (equal type "text/plain")
+ (equal type "AnyPropertyType")))
+ (prog1 x-dnd-tests-xds-property-value
+ (when delete-p
+ (setq x-dnd-tests-xds-property-value nil)))))))
;; This test also serves to exercise most of the Motif value
;; extraction code.
@@ -78,5 +88,116 @@ AgAABQMAAAYDAAATGwAAGhsAAA==")
(should (equal (x-dnd-xm-read-targets-table nil)
x-dnd-tests-lispy-targets-table)))
+;;; XDS tests.
+
+(defvar x-dnd-tests-xds-target-dir nil
+ "The name of the target directory where the file will be saved.")
+
+(defvar x-dnd-tests-xds-name nil
+ "The name that the dragged file should be saved under.")
+
+(defvar x-dnd-tests-xds-include-hostname nil
+ "Whether or not to include the hostname inside the XDS URI.")
+
+(defun x-dnd-tests-call-xds-converter ()
+ "Look up the XDS selection converter and call it.
+Return the result of the selection."
+ (let ((conv (cdr (assq 'XdndDirectSave0
+ selection-converter-alist))))
+ (should (functionp conv))
+ (funcall conv 'XdndDirectSave0 'XdndDirectSave0 nil)))
+
+(defalias 'x-begin-drag
+ (lambda (_targets &optional action frame &rest _)
+ ;; Verify that frame is either nil or a valid frame.
+ (when (and frame (not (frame-live-p frame)))
+ (signal 'wrong-type-argument frame))
+ (prog1 'XdndActionDirectSave
+ ;; Verify that the action is `XdndActionDirectSave'.
+ (should (eq action 'XdndActionDirectSave))
+ ;; Set the property value to the URI of the new file.
+ (should (and (stringp x-dnd-tests-xds-property-value)
+ (not (multibyte-string-p x-dnd-tests-xds-property-value))))
+ (let ((uri (if x-dnd-tests-xds-include-hostname
+ (format "file://%s%s" (system-name)
+ (expand-file-name x-dnd-tests-xds-property-value
+ x-dnd-tests-xds-target-dir))
+ (concat "file:///" (expand-file-name x-dnd-tests-xds-property-value
+ x-dnd-tests-xds-target-dir)))))
+ (setq x-dnd-tests-xds-property-value
+ (encode-coding-string (url-encode-url uri)
+ 'raw-text)))
+ ;; Convert the selection and verify its success.
+ (should (equal (x-dnd-tests-call-xds-converter)
+ '(STRING . "S"))))))
+
+(defalias 'x-change-window-property
+ (lambda (prop value &optional _frame type format outer-p _window-id)
+ ;; Check that the properties are the right type.
+ (should (equal prop "XdndDirectSave0"))
+ (should (equal value (encode-coding-string
+ x-dnd-tests-xds-name
+ (or file-name-coding-system
+ default-file-name-coding-system))))
+ (should (equal type "text/plain"))
+ (should (equal format 8))
+ (should (not outer-p))
+ (setq x-dnd-tests-xds-property-value value)))
+
+(defalias 'x-delete-window-property
+ (lambda (&rest _args)
+ ;; This function shouldn't ever be reached during XDS.
+ (setq x-dnd-tests-xds-property-value nil)))
+
+(defun x-dnd-tests-do-direct-save-internal (include-hostname)
+ "Test the behavior of `x-dnd-do-direct-save'.
+Make it perform a direct save to a randomly generated directory,
+and check that the file exists. If INCLUDE-HOSTNAME, include the
+hostname in the target URI."
+ (let ((x-dnd-tests-xds-include-hostname include-hostname)
+ (x-dnd-tests-xds-target-dir
+ (file-name-as-directory (expand-file-name
+ (make-temp-name "x-dnd-test")
+ temporary-file-directory)))
+ (original-file (expand-file-name
+ (make-temp-name "x-dnd-test")
+ temporary-file-directory))
+ (x-dnd-tests-xds-name (make-temp-name "x-dnd-test-target")))
+ ;; The call to `gui-set-selection' is only used for providing the
+ ;; conventional `text/uri-list' target and can be ignored.
+ (cl-flet ((gui-set-selection #'ignore))
+ (unwind-protect
+ (progn
+ ;; Touch `original-file' if it doesn't exist.
+ (unless (file-exists-p original-file)
+ (write-region "" 0 original-file))
+ ;; Create `x-dnd-tests-xds-target-dir'.
+ (make-directory x-dnd-tests-xds-target-dir)
+ ;; Start the direct save and verify it returns the correct action.
+ (should (eq (x-dnd-do-direct-save original-file
+ x-dnd-tests-xds-name
+ nil nil)
+ 'XdndActionDirectSave))
+ ;; Now verify that the new file exists.
+ (should (file-exists-p
+ (expand-file-name x-dnd-tests-xds-name
+ x-dnd-tests-xds-target-dir)))
+ ;; The XDS protocol makes very clear that the window
+ ;; property must be deleted after the drag-and-drop
+ ;; operation completes.
+ (should (not x-dnd-tests-xds-property-value)))
+ ;; Clean up after ourselves.
+ (ignore-errors
+ (delete-file original-file))
+ (ignore-errors
+ (delete-directory x-dnd-tests-xds-target-dir t))))))
+
+(ert-deftest x-dnd-tests-do-direct-save ()
+ ;; TODO: add tests for application/octet-stream transfer.
+ (x-dnd-tests-do-direct-save-internal nil)
+ ;; Test with both kinds of file: URIs, since different programs
+ ;; generate different kinds.
+ (x-dnd-tests-do-direct-save-internal t))
+
(provide 'x-dnd-tests)
;;; x-dnd-tests.el ends here
diff --git a/test/manual/etags/ETAGS.good_1 b/test/manual/etags/ETAGS.good_1
index c3d1477d44c..4baaff4c425 100644
--- a/test/manual/etags/ETAGS.good_1
+++ b/test/manual/etags/ETAGS.good_1
@@ -2941,92 +2941,92 @@ complete(328,10055
add_active(340,10527
parse(353,10949
derived_analyses(364,11341
-build(378,11965
-buildact(392,12521
-mapsyn(412,13542
-add_edge(434,14278
-findcats(447,14758
-normalize_tree(465,15478
-normalize_trees(475,15856
-expandmng_tree(486,16248
-expandmng_trees(496,16614
-cat(511,17013
-subtree(644,21266
-hypothetical_mem(653,21565
-make_coor(667,22130
-start_up:-start_up688,23013
-tokenizeatom(710,23921
-tokenize(720,24348
-isoperator(752,25377
-isoptab(756,25431
-specialsymbol(765,25756
-sstab(771,25861
-parse_cgi(787,26347
-keyvalseq(792,26510
-andkeyvalseq(796,26609
-keyval(799,26688
-valseq(807,26920
-plusvalseq(810,27007
-val(816,27109
-argvals(824,27426
-commaargvals(828,27503
-atomval(833,27578
-atom(836,27640
-action(846,28004
-keyvalcgi(864,28649
-keyvalscgi(865,28670
-outsyn(868,28726
-act(876,29060
-actout(901,29906
-texttreelist(912,30089
-htmltreelist(918,30190
-fitchtreelist(924,30304
-pp_html_table_tree(938,30759
-pp_html_tree(949,31113
-pp_html_trees(988,32381
-pp_html_table_fitch_tree(999,32769
-pp_html_fitch_tree(1017,33672
-removeexp(1129,39002
-splitexp(1142,39490
-pp_exp(1155,39990
-map_word(1168,40249
-pp_exps(1180,40474
-pp_tree(1188,40777
-pp_trees(1216,41807
-pp_word_list(1225,42128
-pp_word(1231,42262
-pp_word_list_rest(1238,42569
-pp_cat(1248,42929
-pp_syn(1255,43196
-pp_syn_paren(1276,43899
-pp_paren(1293,44377
-pp_syn_back(1300,44661
-pp_bas_cat(1311,45001
-writecat(1322,45409
-writesubs(1351,46455
-writesups(1361,46757
-writelistsubs(1371,47090
-pp_lam(1380,47408
-pp_lam_bracket(1398,48022
-pp_lam_paren(1407,48338
-pp_rule(1429,49238
-member(1447,49866
-append_list(1451,49919
-append(1456,50010
-at_least_one_member(1460,50076
-numbervars(1464,50171
-reverse(1467,50209
-select(1471,50290
-select_last(1475,50357
-cat_atoms(1479,50436
-writelist(1485,50524
-write_lex_cat(1492,50676
-writebreaklex(1500,50988
-write_lex(1513,51265
-writebreak(1521,51541
-tt:-tt1531,51713
-mt:-mt1534,51784
-cmt:-cmt1537,51878
+build(378,11967
+buildact(392,12523
+mapsyn(412,13544
+add_edge(434,14280
+findcats(447,14760
+normalize_tree(465,15480
+normalize_trees(475,15858
+expandmng_tree(486,16250
+expandmng_trees(496,16616
+cat(511,17015
+subtree(644,21268
+hypothetical_mem(653,21567
+make_coor(667,22132
+start_up:-start_up688,23015
+tokenizeatom(710,23923
+tokenize(720,24350
+isoperator(752,25379
+isoptab(756,25433
+specialsymbol(765,25758
+sstab(771,25863
+parse_cgi(787,26349
+keyvalseq(792,26512
+andkeyvalseq(796,26611
+keyval(799,26690
+valseq(807,26922
+plusvalseq(810,27009
+val(816,27111
+argvals(824,27428
+commaargvals(828,27505
+atomval(833,27580
+atom(836,27642
+action(846,28006
+keyvalcgi(864,28651
+keyvalscgi(865,28672
+outsyn(868,28728
+act(876,29062
+actout(901,29908
+texttreelist(912,30091
+htmltreelist(918,30192
+fitchtreelist(924,30306
+pp_html_table_tree(938,30761
+pp_html_tree(949,31115
+pp_html_trees(988,32383
+pp_html_table_fitch_tree(999,32771
+pp_html_fitch_tree(1017,33674
+removeexp(1129,39004
+splitexp(1142,39492
+pp_exp(1155,39992
+map_word(1168,40251
+pp_exps(1180,40476
+pp_tree(1188,40779
+pp_trees(1216,41809
+pp_word_list(1225,42130
+pp_word(1231,42264
+pp_word_list_rest(1238,42571
+pp_cat(1248,42931
+pp_syn(1255,43198
+pp_syn_paren(1276,43901
+pp_paren(1293,44379
+pp_syn_back(1300,44663
+pp_bas_cat(1311,45003
+writecat(1322,45411
+writesubs(1351,46457
+writesups(1361,46759
+writelistsubs(1371,47092
+pp_lam(1380,47410
+pp_lam_bracket(1398,48024
+pp_lam_paren(1407,48340
+pp_rule(1429,49240
+member(1447,49868
+append_list(1451,49921
+append(1456,50012
+at_least_one_member(1460,50078
+numbervars(1464,50173
+reverse(1467,50211
+select(1471,50292
+select_last(1475,50359
+cat_atoms(1479,50438
+writelist(1485,50526
+write_lex_cat(1492,50678
+writebreaklex(1500,50990
+write_lex(1513,51267
+writebreak(1521,51543
+tt:-tt1531,51715
+mt:-mt1534,51786
+cmt:-cmt1537,51880
pyt-src/server.py,1438
class Controls:Controls17,358
@@ -3921,60 +3921,60 @@ merc-src/accumulator.m,3228
:- func initialize_goal_store570,22060
:- pred accu_store580,22421
:- pred identify_recursive_calls601,23288
-:- pred identify_out_and_out_prime626,24396
-:- type accu_sets676,26425
-:- pred accu_stage1689,26977
-:- pred accu_stage1_2727,28347
-:- pred accu_sets_init781,30557
-:- func set_upto796,30984
-:- pred accu_before812,31498
-:- pred accu_assoc835,32477
-:- pred accu_construct862,33712
-:- pred accu_construct_assoc896,35307
-:- pred accu_update938,37069
-:- pred member_lessthan_goalid964,38219
-:- type accu_assoc975,38652
-:- pred accu_is_associative986,39138
-:- pred associativity_assertion1014,40263
-:- pred commutativity_assertion1037,41242
-:- pred accu_is_update1057,41952
-:- pred is_associative_construction1078,42802
-:- type accu_substs1095,43480
-:- type accu_base1103,43744
-:- pred accu_stage21124,44605
-:- pred accu_substs_init1179,46957
-:- pred acc_var_subst_init1194,47573
-:- pred create_new_var1207,48147
-:- pred accu_process_assoc_set1223,48862
-:- pred accu_has_heuristic1297,52081
-:- pred accu_heuristic1304,52336
-:- pred accu_process_update_set1318,52906
-:- pred accu_divide_base_case1380,55844
-:- pred accu_related1412,57146
-:- inst stored_goal_plain_call1444,58415
-:- pred lookup_call1449,58601
-:- pred accu_stage31470,59432
-:- pred acc_proc_info1508,61326
-:- pred acc_pred_info1556,63449
-:- pred accu_create_goal1600,65285
-:- func create_acc_call1621,66400
-:- pred create_orig_goal1634,66987
-:- pred create_acc_goal1662,68157
-:- func create_new_orig_recursive_goals1709,70225
-:- func create_new_recursive_goals1723,70918
-:- func create_new_base_goals1738,71717
-:- pred acc_unification1749,72156
-:- pred accu_top_level1766,72896
-:- pred update_accumulator_pred1856,76290
-:- func accu_rename1876,77253
-:- func base_case_ids1889,77784
-:- func base_case_ids_set1898,78048
-:- func accu_goal_list1905,78269
-:- pred calculate_goal_info1916,78680
-:- func chain_subst1932,79319
-:- pred chain_subst_21938,79482
-:- some [T] pred unravel_univ1956,80060
-:- pragma foreign_export1957,80116
+:- pred identify_out_and_out_prime626,24397
+:- type accu_sets676,26426
+:- pred accu_stage1689,26978
+:- pred accu_stage1_2727,28348
+:- pred accu_sets_init781,30558
+:- func set_upto796,30985
+:- pred accu_before812,31499
+:- pred accu_assoc835,32478
+:- pred accu_construct862,33713
+:- pred accu_construct_assoc896,35308
+:- pred accu_update938,37070
+:- pred member_lessthan_goalid964,38220
+:- type accu_assoc975,38653
+:- pred accu_is_associative986,39139
+:- pred associativity_assertion1014,40264
+:- pred commutativity_assertion1037,41243
+:- pred accu_is_update1057,41953
+:- pred is_associative_construction1078,42803
+:- type accu_substs1095,43481
+:- type accu_base1103,43745
+:- pred accu_stage21124,44606
+:- pred accu_substs_init1179,46958
+:- pred acc_var_subst_init1194,47574
+:- pred create_new_var1207,48148
+:- pred accu_process_assoc_set1223,48863
+:- pred accu_has_heuristic1297,52082
+:- pred accu_heuristic1304,52337
+:- pred accu_process_update_set1318,52907
+:- pred accu_divide_base_case1380,55845
+:- pred accu_related1412,57147
+:- inst stored_goal_plain_call1444,58416
+:- pred lookup_call1449,58602
+:- pred accu_stage31470,59433
+:- pred acc_proc_info1508,61327
+:- pred acc_pred_info1556,63450
+:- pred accu_create_goal1600,65286
+:- func create_acc_call1621,66401
+:- pred create_orig_goal1634,66988
+:- pred create_acc_goal1662,68158
+:- func create_new_orig_recursive_goals1709,70226
+:- func create_new_recursive_goals1723,70919
+:- func create_new_base_goals1738,71718
+:- pred acc_unification1749,72157
+:- pred accu_top_level1766,72897
+:- pred update_accumulator_pred1856,76291
+:- func accu_rename1876,77254
+:- func base_case_ids1889,77785
+:- func base_case_ids_set1898,78049
+:- func accu_goal_list1905,78270
+:- pred calculate_goal_info1916,78681
+:- func chain_subst1932,79320
+:- pred chain_subst_21938,79483
+:- some [T] pred unravel_univ1956,80061
+:- pragma foreign_export1957,80117
c-src/c.c,76
T f(1,0
diff --git a/test/manual/etags/ETAGS.good_2 b/test/manual/etags/ETAGS.good_2
index 3c611dc8ef5..6e90f1e8e05 100644
--- a/test/manual/etags/ETAGS.good_2
+++ b/test/manual/etags/ETAGS.good_2
@@ -3514,92 +3514,92 @@ complete(328,10055
add_active(340,10527
parse(353,10949
derived_analyses(364,11341
-build(378,11965
-buildact(392,12521
-mapsyn(412,13542
-add_edge(434,14278
-findcats(447,14758
-normalize_tree(465,15478
-normalize_trees(475,15856
-expandmng_tree(486,16248
-expandmng_trees(496,16614
-cat(511,17013
-subtree(644,21266
-hypothetical_mem(653,21565
-make_coor(667,22130
-start_up:-start_up688,23013
-tokenizeatom(710,23921
-tokenize(720,24348
-isoperator(752,25377
-isoptab(756,25431
-specialsymbol(765,25756
-sstab(771,25861
-parse_cgi(787,26347
-keyvalseq(792,26510
-andkeyvalseq(796,26609
-keyval(799,26688
-valseq(807,26920
-plusvalseq(810,27007
-val(816,27109
-argvals(824,27426
-commaargvals(828,27503
-atomval(833,27578
-atom(836,27640
-action(846,28004
-keyvalcgi(864,28649
-keyvalscgi(865,28670
-outsyn(868,28726
-act(876,29060
-actout(901,29906
-texttreelist(912,30089
-htmltreelist(918,30190
-fitchtreelist(924,30304
-pp_html_table_tree(938,30759
-pp_html_tree(949,31113
-pp_html_trees(988,32381
-pp_html_table_fitch_tree(999,32769
-pp_html_fitch_tree(1017,33672
-removeexp(1129,39002
-splitexp(1142,39490
-pp_exp(1155,39990
-map_word(1168,40249
-pp_exps(1180,40474
-pp_tree(1188,40777
-pp_trees(1216,41807
-pp_word_list(1225,42128
-pp_word(1231,42262
-pp_word_list_rest(1238,42569
-pp_cat(1248,42929
-pp_syn(1255,43196
-pp_syn_paren(1276,43899
-pp_paren(1293,44377
-pp_syn_back(1300,44661
-pp_bas_cat(1311,45001
-writecat(1322,45409
-writesubs(1351,46455
-writesups(1361,46757
-writelistsubs(1371,47090
-pp_lam(1380,47408
-pp_lam_bracket(1398,48022
-pp_lam_paren(1407,48338
-pp_rule(1429,49238
-member(1447,49866
-append_list(1451,49919
-append(1456,50010
-at_least_one_member(1460,50076
-numbervars(1464,50171
-reverse(1467,50209
-select(1471,50290
-select_last(1475,50357
-cat_atoms(1479,50436
-writelist(1485,50524
-write_lex_cat(1492,50676
-writebreaklex(1500,50988
-write_lex(1513,51265
-writebreak(1521,51541
-tt:-tt1531,51713
-mt:-mt1534,51784
-cmt:-cmt1537,51878
+build(378,11967
+buildact(392,12523
+mapsyn(412,13544
+add_edge(434,14280
+findcats(447,14760
+normalize_tree(465,15480
+normalize_trees(475,15858
+expandmng_tree(486,16250
+expandmng_trees(496,16616
+cat(511,17015
+subtree(644,21268
+hypothetical_mem(653,21567
+make_coor(667,22132
+start_up:-start_up688,23015
+tokenizeatom(710,23923
+tokenize(720,24350
+isoperator(752,25379
+isoptab(756,25433
+specialsymbol(765,25758
+sstab(771,25863
+parse_cgi(787,26349
+keyvalseq(792,26512
+andkeyvalseq(796,26611
+keyval(799,26690
+valseq(807,26922
+plusvalseq(810,27009
+val(816,27111
+argvals(824,27428
+commaargvals(828,27505
+atomval(833,27580
+atom(836,27642
+action(846,28006
+keyvalcgi(864,28651
+keyvalscgi(865,28672
+outsyn(868,28728
+act(876,29062
+actout(901,29908
+texttreelist(912,30091
+htmltreelist(918,30192
+fitchtreelist(924,30306
+pp_html_table_tree(938,30761
+pp_html_tree(949,31115
+pp_html_trees(988,32383
+pp_html_table_fitch_tree(999,32771
+pp_html_fitch_tree(1017,33674
+removeexp(1129,39004
+splitexp(1142,39492
+pp_exp(1155,39992
+map_word(1168,40251
+pp_exps(1180,40476
+pp_tree(1188,40779
+pp_trees(1216,41809
+pp_word_list(1225,42130
+pp_word(1231,42264
+pp_word_list_rest(1238,42571
+pp_cat(1248,42931
+pp_syn(1255,43198
+pp_syn_paren(1276,43901
+pp_paren(1293,44379
+pp_syn_back(1300,44663
+pp_bas_cat(1311,45003
+writecat(1322,45411
+writesubs(1351,46457
+writesups(1361,46759
+writelistsubs(1371,47092
+pp_lam(1380,47410
+pp_lam_bracket(1398,48024
+pp_lam_paren(1407,48340
+pp_rule(1429,49240
+member(1447,49868
+append_list(1451,49921
+append(1456,50012
+at_least_one_member(1460,50078
+numbervars(1464,50173
+reverse(1467,50211
+select(1471,50292
+select_last(1475,50359
+cat_atoms(1479,50438
+writelist(1485,50526
+write_lex_cat(1492,50678
+writebreaklex(1500,50990
+write_lex(1513,51267
+writebreak(1521,51543
+tt:-tt1531,51715
+mt:-mt1534,51786
+cmt:-cmt1537,51880
pyt-src/server.py,1438
class Controls:Controls17,358
@@ -4505,108 +4505,108 @@ initialize_goal_store573,22166
accu_store584,22576
:- pred identify_recursive_calls601,23288
identify_recursive_calls604,23406
-:- pred identify_out_and_out_prime626,24396
-identify_out_and_out_prime631,24631
-:- type accu_sets676,26425
-:- pred accu_stage1689,26977
-accu_stage1693,27155
-:- pred accu_stage1_2727,28347
-accu_stage1_2731,28515
-:- pred accu_sets_init781,30557
-accu_sets_init783,30605
-:- func set_upto796,30984
-set_upto798,31039
-:- pred accu_before812,31498
-accu_before815,31639
-:- pred accu_assoc835,32477
-accu_assoc838,32617
-:- pred accu_construct862,33712
-accu_construct865,33856
-:- pred accu_construct_assoc896,35307
-accu_construct_assoc899,35457
-:- pred accu_update938,37069
-accu_update941,37210
-:- pred member_lessthan_goalid964,38219
-member_lessthan_goalid967,38342
-:- type accu_assoc975,38652
-:- pred accu_is_associative986,39138
-accu_is_associative989,39250
-:- pred associativity_assertion1014,40263
-associativity_assertion1017,40404
-:- pred commutativity_assertion1037,41242
-commutativity_assertion1040,41369
-:- pred accu_is_update1057,41952
-accu_is_update1060,42066
-:- pred is_associative_construction1078,42802
-is_associative_construction1081,42898
-:- type accu_substs1095,43480
-:- type accu_base1103,43744
-:- pred accu_stage21124,44605
-accu_stage21131,44946
-:- pred accu_substs_init1179,46957
-accu_substs_init1182,47097
-:- pred acc_var_subst_init1194,47573
-acc_var_subst_init1198,47718
-:- pred create_new_var1207,48147
-create_new_var1210,48288
-:- pred accu_process_assoc_set1223,48862
-accu_process_assoc_set1229,49150
-:- pred accu_has_heuristic1297,52081
-accu_has_heuristic1299,52161
-:- pred accu_heuristic1304,52336
-accu_heuristic1307,52457
-:- pred accu_process_update_set1318,52906
-accu_process_update_set1325,53221
-:- pred accu_divide_base_case1380,55844
-accu_divide_base_case1385,56059
-:- pred accu_related1412,57146
-accu_related1415,57270
-:- inst stored_goal_plain_call1444,58415
-:- pred lookup_call1449,58601
-lookup_call1452,58715
-:- pred accu_stage31470,59432
-accu_stage31477,59826
-:- pred acc_proc_info1508,61326
-acc_proc_info1512,61485
-:- pred acc_pred_info1556,63449
-acc_pred_info1559,63597
-:- pred accu_create_goal1600,65285
-accu_create_goal1607,65628
-:- func create_acc_call1621,66400
-create_acc_call1625,66569
-:- pred create_orig_goal1634,66987
-create_orig_goal1638,67176
-:- pred create_acc_goal1662,68157
-create_acc_goal1667,68380
-:- func create_new_orig_recursive_goals1709,70225
-create_new_orig_recursive_goals1712,70368
-:- func create_new_recursive_goals1723,70918
-create_new_recursive_goals1727,71108
-:- func create_new_base_goals1738,71717
-create_new_base_goals1741,71831
-:- pred acc_unification1749,72156
-acc_unification1751,72225
-:- pred accu_top_level1766,72896
-accu_top_level1770,73058
-:- pred update_accumulator_pred1856,76290
-update_accumulator_pred1859,76411
-:- func accu_rename1876,77253
-accu_rename1879,77363
-:- func base_case_ids1889,77784
-base_case_ids1891,77846
-:- func base_case_ids_set1898,78048
-base_case_ids_set1900,78113
-:- func accu_goal_list1905,78269
-accu_goal_list1907,78349
-:- pred calculate_goal_info1916,78680
-calculate_goal_info1918,78753
-:- func chain_subst1932,79319
-chain_subst1934,79378
-:- pred chain_subst_21938,79482
-chain_subst_21941,79576
-:- some [T] pred unravel_univ1956,80060
-:- pragma foreign_export1957,80116
-unravel_univ1961,80340
+:- pred identify_out_and_out_prime626,24397
+identify_out_and_out_prime631,24632
+:- type accu_sets676,26426
+:- pred accu_stage1689,26978
+accu_stage1693,27156
+:- pred accu_stage1_2727,28348
+accu_stage1_2731,28516
+:- pred accu_sets_init781,30558
+accu_sets_init783,30606
+:- func set_upto796,30985
+set_upto798,31040
+:- pred accu_before812,31499
+accu_before815,31640
+:- pred accu_assoc835,32478
+accu_assoc838,32618
+:- pred accu_construct862,33713
+accu_construct865,33857
+:- pred accu_construct_assoc896,35308
+accu_construct_assoc899,35458
+:- pred accu_update938,37070
+accu_update941,37211
+:- pred member_lessthan_goalid964,38220
+member_lessthan_goalid967,38343
+:- type accu_assoc975,38653
+:- pred accu_is_associative986,39139
+accu_is_associative989,39251
+:- pred associativity_assertion1014,40264
+associativity_assertion1017,40405
+:- pred commutativity_assertion1037,41243
+commutativity_assertion1040,41370
+:- pred accu_is_update1057,41953
+accu_is_update1060,42067
+:- pred is_associative_construction1078,42803
+is_associative_construction1081,42899
+:- type accu_substs1095,43481
+:- type accu_base1103,43745
+:- pred accu_stage21124,44606
+accu_stage21131,44947
+:- pred accu_substs_init1179,46958
+accu_substs_init1182,47098
+:- pred acc_var_subst_init1194,47574
+acc_var_subst_init1198,47719
+:- pred create_new_var1207,48148
+create_new_var1210,48289
+:- pred accu_process_assoc_set1223,48863
+accu_process_assoc_set1229,49151
+:- pred accu_has_heuristic1297,52082
+accu_has_heuristic1299,52162
+:- pred accu_heuristic1304,52337
+accu_heuristic1307,52458
+:- pred accu_process_update_set1318,52907
+accu_process_update_set1325,53222
+:- pred accu_divide_base_case1380,55845
+accu_divide_base_case1385,56060
+:- pred accu_related1412,57147
+accu_related1415,57271
+:- inst stored_goal_plain_call1444,58416
+:- pred lookup_call1449,58602
+lookup_call1452,58716
+:- pred accu_stage31470,59433
+accu_stage31477,59827
+:- pred acc_proc_info1508,61327
+acc_proc_info1512,61486
+:- pred acc_pred_info1556,63450
+acc_pred_info1559,63598
+:- pred accu_create_goal1600,65286
+accu_create_goal1607,65629
+:- func create_acc_call1621,66401
+create_acc_call1625,66570
+:- pred create_orig_goal1634,66988
+create_orig_goal1638,67177
+:- pred create_acc_goal1662,68158
+create_acc_goal1667,68381
+:- func create_new_orig_recursive_goals1709,70226
+create_new_orig_recursive_goals1712,70369
+:- func create_new_recursive_goals1723,70919
+create_new_recursive_goals1727,71109
+:- func create_new_base_goals1738,71718
+create_new_base_goals1741,71832
+:- pred acc_unification1749,72157
+acc_unification1751,72226
+:- pred accu_top_level1766,72897
+accu_top_level1770,73059
+:- pred update_accumulator_pred1856,76291
+update_accumulator_pred1859,76412
+:- func accu_rename1876,77254
+accu_rename1879,77364
+:- func base_case_ids1889,77785
+base_case_ids1891,77847
+:- func base_case_ids_set1898,78049
+base_case_ids_set1900,78114
+:- func accu_goal_list1905,78270
+accu_goal_list1907,78350
+:- pred calculate_goal_info1916,78681
+calculate_goal_info1918,78754
+:- func chain_subst1932,79320
+chain_subst1934,79379
+:- pred chain_subst_21938,79483
+chain_subst_21941,79577
+:- some [T] pred unravel_univ1956,80061
+:- pragma foreign_export1957,80117
+unravel_univ1961,80341
c-src/c.c,76
T f(1,0
diff --git a/test/manual/etags/ETAGS.good_3 b/test/manual/etags/ETAGS.good_3
index 45507706b32..15ed7855b30 100644
--- a/test/manual/etags/ETAGS.good_3
+++ b/test/manual/etags/ETAGS.good_3
@@ -3348,92 +3348,92 @@ complete(328,10055
add_active(340,10527
parse(353,10949
derived_analyses(364,11341
-build(378,11965
-buildact(392,12521
-mapsyn(412,13542
-add_edge(434,14278
-findcats(447,14758
-normalize_tree(465,15478
-normalize_trees(475,15856
-expandmng_tree(486,16248
-expandmng_trees(496,16614
-cat(511,17013
-subtree(644,21266
-hypothetical_mem(653,21565
-make_coor(667,22130
-start_up:-start_up688,23013
-tokenizeatom(710,23921
-tokenize(720,24348
-isoperator(752,25377
-isoptab(756,25431
-specialsymbol(765,25756
-sstab(771,25861
-parse_cgi(787,26347
-keyvalseq(792,26510
-andkeyvalseq(796,26609
-keyval(799,26688
-valseq(807,26920
-plusvalseq(810,27007
-val(816,27109
-argvals(824,27426
-commaargvals(828,27503
-atomval(833,27578
-atom(836,27640
-action(846,28004
-keyvalcgi(864,28649
-keyvalscgi(865,28670
-outsyn(868,28726
-act(876,29060
-actout(901,29906
-texttreelist(912,30089
-htmltreelist(918,30190
-fitchtreelist(924,30304
-pp_html_table_tree(938,30759
-pp_html_tree(949,31113
-pp_html_trees(988,32381
-pp_html_table_fitch_tree(999,32769
-pp_html_fitch_tree(1017,33672
-removeexp(1129,39002
-splitexp(1142,39490
-pp_exp(1155,39990
-map_word(1168,40249
-pp_exps(1180,40474
-pp_tree(1188,40777
-pp_trees(1216,41807
-pp_word_list(1225,42128
-pp_word(1231,42262
-pp_word_list_rest(1238,42569
-pp_cat(1248,42929
-pp_syn(1255,43196
-pp_syn_paren(1276,43899
-pp_paren(1293,44377
-pp_syn_back(1300,44661
-pp_bas_cat(1311,45001
-writecat(1322,45409
-writesubs(1351,46455
-writesups(1361,46757
-writelistsubs(1371,47090
-pp_lam(1380,47408
-pp_lam_bracket(1398,48022
-pp_lam_paren(1407,48338
-pp_rule(1429,49238
-member(1447,49866
-append_list(1451,49919
-append(1456,50010
-at_least_one_member(1460,50076
-numbervars(1464,50171
-reverse(1467,50209
-select(1471,50290
-select_last(1475,50357
-cat_atoms(1479,50436
-writelist(1485,50524
-write_lex_cat(1492,50676
-writebreaklex(1500,50988
-write_lex(1513,51265
-writebreak(1521,51541
-tt:-tt1531,51713
-mt:-mt1534,51784
-cmt:-cmt1537,51878
+build(378,11967
+buildact(392,12523
+mapsyn(412,13544
+add_edge(434,14280
+findcats(447,14760
+normalize_tree(465,15480
+normalize_trees(475,15858
+expandmng_tree(486,16250
+expandmng_trees(496,16616
+cat(511,17015
+subtree(644,21268
+hypothetical_mem(653,21567
+make_coor(667,22132
+start_up:-start_up688,23015
+tokenizeatom(710,23923
+tokenize(720,24350
+isoperator(752,25379
+isoptab(756,25433
+specialsymbol(765,25758
+sstab(771,25863
+parse_cgi(787,26349
+keyvalseq(792,26512
+andkeyvalseq(796,26611
+keyval(799,26690
+valseq(807,26922
+plusvalseq(810,27009
+val(816,27111
+argvals(824,27428
+commaargvals(828,27505
+atomval(833,27580
+atom(836,27642
+action(846,28006
+keyvalcgi(864,28651
+keyvalscgi(865,28672
+outsyn(868,28728
+act(876,29062
+actout(901,29908
+texttreelist(912,30091
+htmltreelist(918,30192
+fitchtreelist(924,30306
+pp_html_table_tree(938,30761
+pp_html_tree(949,31115
+pp_html_trees(988,32383
+pp_html_table_fitch_tree(999,32771
+pp_html_fitch_tree(1017,33674
+removeexp(1129,39004
+splitexp(1142,39492
+pp_exp(1155,39992
+map_word(1168,40251
+pp_exps(1180,40476
+pp_tree(1188,40779
+pp_trees(1216,41809
+pp_word_list(1225,42130
+pp_word(1231,42264
+pp_word_list_rest(1238,42571
+pp_cat(1248,42931
+pp_syn(1255,43198
+pp_syn_paren(1276,43901
+pp_paren(1293,44379
+pp_syn_back(1300,44663
+pp_bas_cat(1311,45003
+writecat(1322,45411
+writesubs(1351,46457
+writesups(1361,46759
+writelistsubs(1371,47092
+pp_lam(1380,47410
+pp_lam_bracket(1398,48024
+pp_lam_paren(1407,48340
+pp_rule(1429,49240
+member(1447,49868
+append_list(1451,49921
+append(1456,50012
+at_least_one_member(1460,50078
+numbervars(1464,50173
+reverse(1467,50211
+select(1471,50292
+select_last(1475,50359
+cat_atoms(1479,50438
+writelist(1485,50526
+write_lex_cat(1492,50678
+writebreaklex(1500,50990
+write_lex(1513,51267
+writebreak(1521,51543
+tt:-tt1531,51715
+mt:-mt1534,51786
+cmt:-cmt1537,51880
pyt-src/server.py,1438
class Controls:Controls17,358
@@ -4328,60 +4328,60 @@ merc-src/accumulator.m,3228
:- func initialize_goal_store570,22060
:- pred accu_store580,22421
:- pred identify_recursive_calls601,23288
-:- pred identify_out_and_out_prime626,24396
-:- type accu_sets676,26425
-:- pred accu_stage1689,26977
-:- pred accu_stage1_2727,28347
-:- pred accu_sets_init781,30557
-:- func set_upto796,30984
-:- pred accu_before812,31498
-:- pred accu_assoc835,32477
-:- pred accu_construct862,33712
-:- pred accu_construct_assoc896,35307
-:- pred accu_update938,37069
-:- pred member_lessthan_goalid964,38219
-:- type accu_assoc975,38652
-:- pred accu_is_associative986,39138
-:- pred associativity_assertion1014,40263
-:- pred commutativity_assertion1037,41242
-:- pred accu_is_update1057,41952
-:- pred is_associative_construction1078,42802
-:- type accu_substs1095,43480
-:- type accu_base1103,43744
-:- pred accu_stage21124,44605
-:- pred accu_substs_init1179,46957
-:- pred acc_var_subst_init1194,47573
-:- pred create_new_var1207,48147
-:- pred accu_process_assoc_set1223,48862
-:- pred accu_has_heuristic1297,52081
-:- pred accu_heuristic1304,52336
-:- pred accu_process_update_set1318,52906
-:- pred accu_divide_base_case1380,55844
-:- pred accu_related1412,57146
-:- inst stored_goal_plain_call1444,58415
-:- pred lookup_call1449,58601
-:- pred accu_stage31470,59432
-:- pred acc_proc_info1508,61326
-:- pred acc_pred_info1556,63449
-:- pred accu_create_goal1600,65285
-:- func create_acc_call1621,66400
-:- pred create_orig_goal1634,66987
-:- pred create_acc_goal1662,68157
-:- func create_new_orig_recursive_goals1709,70225
-:- func create_new_recursive_goals1723,70918
-:- func create_new_base_goals1738,71717
-:- pred acc_unification1749,72156
-:- pred accu_top_level1766,72896
-:- pred update_accumulator_pred1856,76290
-:- func accu_rename1876,77253
-:- func base_case_ids1889,77784
-:- func base_case_ids_set1898,78048
-:- func accu_goal_list1905,78269
-:- pred calculate_goal_info1916,78680
-:- func chain_subst1932,79319
-:- pred chain_subst_21938,79482
-:- some [T] pred unravel_univ1956,80060
-:- pragma foreign_export1957,80116
+:- pred identify_out_and_out_prime626,24397
+:- type accu_sets676,26426
+:- pred accu_stage1689,26978
+:- pred accu_stage1_2727,28348
+:- pred accu_sets_init781,30558
+:- func set_upto796,30985
+:- pred accu_before812,31499
+:- pred accu_assoc835,32478
+:- pred accu_construct862,33713
+:- pred accu_construct_assoc896,35308
+:- pred accu_update938,37070
+:- pred member_lessthan_goalid964,38220
+:- type accu_assoc975,38653
+:- pred accu_is_associative986,39139
+:- pred associativity_assertion1014,40264
+:- pred commutativity_assertion1037,41243
+:- pred accu_is_update1057,41953
+:- pred is_associative_construction1078,42803
+:- type accu_substs1095,43481
+:- type accu_base1103,43745
+:- pred accu_stage21124,44606
+:- pred accu_substs_init1179,46958
+:- pred acc_var_subst_init1194,47574
+:- pred create_new_var1207,48148
+:- pred accu_process_assoc_set1223,48863
+:- pred accu_has_heuristic1297,52082
+:- pred accu_heuristic1304,52337
+:- pred accu_process_update_set1318,52907
+:- pred accu_divide_base_case1380,55845
+:- pred accu_related1412,57147
+:- inst stored_goal_plain_call1444,58416
+:- pred lookup_call1449,58602
+:- pred accu_stage31470,59433
+:- pred acc_proc_info1508,61327
+:- pred acc_pred_info1556,63450
+:- pred accu_create_goal1600,65286
+:- func create_acc_call1621,66401
+:- pred create_orig_goal1634,66988
+:- pred create_acc_goal1662,68158
+:- func create_new_orig_recursive_goals1709,70226
+:- func create_new_recursive_goals1723,70919
+:- func create_new_base_goals1738,71718
+:- pred acc_unification1749,72157
+:- pred accu_top_level1766,72897
+:- pred update_accumulator_pred1856,76291
+:- func accu_rename1876,77254
+:- func base_case_ids1889,77785
+:- func base_case_ids_set1898,78049
+:- func accu_goal_list1905,78270
+:- pred calculate_goal_info1916,78681
+:- func chain_subst1932,79320
+:- pred chain_subst_21938,79483
+:- some [T] pred unravel_univ1956,80061
+:- pragma foreign_export1957,80117
c-src/c.c,76
T f(1,0
diff --git a/test/manual/etags/ETAGS.good_4 b/test/manual/etags/ETAGS.good_4
index dee534ae753..dc65a09fdc2 100644
--- a/test/manual/etags/ETAGS.good_4
+++ b/test/manual/etags/ETAGS.good_4
@@ -3103,92 +3103,92 @@ complete(328,10055
add_active(340,10527
parse(353,10949
derived_analyses(364,11341
-build(378,11965
-buildact(392,12521
-mapsyn(412,13542
-add_edge(434,14278
-findcats(447,14758
-normalize_tree(465,15478
-normalize_trees(475,15856
-expandmng_tree(486,16248
-expandmng_trees(496,16614
-cat(511,17013
-subtree(644,21266
-hypothetical_mem(653,21565
-make_coor(667,22130
-start_up:-start_up688,23013
-tokenizeatom(710,23921
-tokenize(720,24348
-isoperator(752,25377
-isoptab(756,25431
-specialsymbol(765,25756
-sstab(771,25861
-parse_cgi(787,26347
-keyvalseq(792,26510
-andkeyvalseq(796,26609
-keyval(799,26688
-valseq(807,26920
-plusvalseq(810,27007
-val(816,27109
-argvals(824,27426
-commaargvals(828,27503
-atomval(833,27578
-atom(836,27640
-action(846,28004
-keyvalcgi(864,28649
-keyvalscgi(865,28670
-outsyn(868,28726
-act(876,29060
-actout(901,29906
-texttreelist(912,30089
-htmltreelist(918,30190
-fitchtreelist(924,30304
-pp_html_table_tree(938,30759
-pp_html_tree(949,31113
-pp_html_trees(988,32381
-pp_html_table_fitch_tree(999,32769
-pp_html_fitch_tree(1017,33672
-removeexp(1129,39002
-splitexp(1142,39490
-pp_exp(1155,39990
-map_word(1168,40249
-pp_exps(1180,40474
-pp_tree(1188,40777
-pp_trees(1216,41807
-pp_word_list(1225,42128
-pp_word(1231,42262
-pp_word_list_rest(1238,42569
-pp_cat(1248,42929
-pp_syn(1255,43196
-pp_syn_paren(1276,43899
-pp_paren(1293,44377
-pp_syn_back(1300,44661
-pp_bas_cat(1311,45001
-writecat(1322,45409
-writesubs(1351,46455
-writesups(1361,46757
-writelistsubs(1371,47090
-pp_lam(1380,47408
-pp_lam_bracket(1398,48022
-pp_lam_paren(1407,48338
-pp_rule(1429,49238
-member(1447,49866
-append_list(1451,49919
-append(1456,50010
-at_least_one_member(1460,50076
-numbervars(1464,50171
-reverse(1467,50209
-select(1471,50290
-select_last(1475,50357
-cat_atoms(1479,50436
-writelist(1485,50524
-write_lex_cat(1492,50676
-writebreaklex(1500,50988
-write_lex(1513,51265
-writebreak(1521,51541
-tt:-tt1531,51713
-mt:-mt1534,51784
-cmt:-cmt1537,51878
+build(378,11967
+buildact(392,12523
+mapsyn(412,13544
+add_edge(434,14280
+findcats(447,14760
+normalize_tree(465,15480
+normalize_trees(475,15858
+expandmng_tree(486,16250
+expandmng_trees(496,16616
+cat(511,17015
+subtree(644,21268
+hypothetical_mem(653,21567
+make_coor(667,22132
+start_up:-start_up688,23015
+tokenizeatom(710,23923
+tokenize(720,24350
+isoperator(752,25379
+isoptab(756,25433
+specialsymbol(765,25758
+sstab(771,25863
+parse_cgi(787,26349
+keyvalseq(792,26512
+andkeyvalseq(796,26611
+keyval(799,26690
+valseq(807,26922
+plusvalseq(810,27009
+val(816,27111
+argvals(824,27428
+commaargvals(828,27505
+atomval(833,27580
+atom(836,27642
+action(846,28006
+keyvalcgi(864,28651
+keyvalscgi(865,28672
+outsyn(868,28728
+act(876,29062
+actout(901,29908
+texttreelist(912,30091
+htmltreelist(918,30192
+fitchtreelist(924,30306
+pp_html_table_tree(938,30761
+pp_html_tree(949,31115
+pp_html_trees(988,32383
+pp_html_table_fitch_tree(999,32771
+pp_html_fitch_tree(1017,33674
+removeexp(1129,39004
+splitexp(1142,39492
+pp_exp(1155,39992
+map_word(1168,40251
+pp_exps(1180,40476
+pp_tree(1188,40779
+pp_trees(1216,41809
+pp_word_list(1225,42130
+pp_word(1231,42264
+pp_word_list_rest(1238,42571
+pp_cat(1248,42931
+pp_syn(1255,43198
+pp_syn_paren(1276,43901
+pp_paren(1293,44379
+pp_syn_back(1300,44663
+pp_bas_cat(1311,45003
+writecat(1322,45411
+writesubs(1351,46457
+writesups(1361,46759
+writelistsubs(1371,47092
+pp_lam(1380,47410
+pp_lam_bracket(1398,48024
+pp_lam_paren(1407,48340
+pp_rule(1429,49240
+member(1447,49868
+append_list(1451,49921
+append(1456,50012
+at_least_one_member(1460,50078
+numbervars(1464,50173
+reverse(1467,50211
+select(1471,50292
+select_last(1475,50359
+cat_atoms(1479,50438
+writelist(1485,50526
+write_lex_cat(1492,50678
+writebreaklex(1500,50990
+write_lex(1513,51267
+writebreak(1521,51543
+tt:-tt1531,51715
+mt:-mt1534,51786
+cmt:-cmt1537,51880
pyt-src/server.py,1438
class Controls:Controls17,358
@@ -4083,60 +4083,60 @@ merc-src/accumulator.m,3228
:- func initialize_goal_store570,22060
:- pred accu_store580,22421
:- pred identify_recursive_calls601,23288
-:- pred identify_out_and_out_prime626,24396
-:- type accu_sets676,26425
-:- pred accu_stage1689,26977
-:- pred accu_stage1_2727,28347
-:- pred accu_sets_init781,30557
-:- func set_upto796,30984
-:- pred accu_before812,31498
-:- pred accu_assoc835,32477
-:- pred accu_construct862,33712
-:- pred accu_construct_assoc896,35307
-:- pred accu_update938,37069
-:- pred member_lessthan_goalid964,38219
-:- type accu_assoc975,38652
-:- pred accu_is_associative986,39138
-:- pred associativity_assertion1014,40263
-:- pred commutativity_assertion1037,41242
-:- pred accu_is_update1057,41952
-:- pred is_associative_construction1078,42802
-:- type accu_substs1095,43480
-:- type accu_base1103,43744
-:- pred accu_stage21124,44605
-:- pred accu_substs_init1179,46957
-:- pred acc_var_subst_init1194,47573
-:- pred create_new_var1207,48147
-:- pred accu_process_assoc_set1223,48862
-:- pred accu_has_heuristic1297,52081
-:- pred accu_heuristic1304,52336
-:- pred accu_process_update_set1318,52906
-:- pred accu_divide_base_case1380,55844
-:- pred accu_related1412,57146
-:- inst stored_goal_plain_call1444,58415
-:- pred lookup_call1449,58601
-:- pred accu_stage31470,59432
-:- pred acc_proc_info1508,61326
-:- pred acc_pred_info1556,63449
-:- pred accu_create_goal1600,65285
-:- func create_acc_call1621,66400
-:- pred create_orig_goal1634,66987
-:- pred create_acc_goal1662,68157
-:- func create_new_orig_recursive_goals1709,70225
-:- func create_new_recursive_goals1723,70918
-:- func create_new_base_goals1738,71717
-:- pred acc_unification1749,72156
-:- pred accu_top_level1766,72896
-:- pred update_accumulator_pred1856,76290
-:- func accu_rename1876,77253
-:- func base_case_ids1889,77784
-:- func base_case_ids_set1898,78048
-:- func accu_goal_list1905,78269
-:- pred calculate_goal_info1916,78680
-:- func chain_subst1932,79319
-:- pred chain_subst_21938,79482
-:- some [T] pred unravel_univ1956,80060
-:- pragma foreign_export1957,80116
+:- pred identify_out_and_out_prime626,24397
+:- type accu_sets676,26426
+:- pred accu_stage1689,26978
+:- pred accu_stage1_2727,28348
+:- pred accu_sets_init781,30558
+:- func set_upto796,30985
+:- pred accu_before812,31499
+:- pred accu_assoc835,32478
+:- pred accu_construct862,33713
+:- pred accu_construct_assoc896,35308
+:- pred accu_update938,37070
+:- pred member_lessthan_goalid964,38220
+:- type accu_assoc975,38653
+:- pred accu_is_associative986,39139
+:- pred associativity_assertion1014,40264
+:- pred commutativity_assertion1037,41243
+:- pred accu_is_update1057,41953
+:- pred is_associative_construction1078,42803
+:- type accu_substs1095,43481
+:- type accu_base1103,43745
+:- pred accu_stage21124,44606
+:- pred accu_substs_init1179,46958
+:- pred acc_var_subst_init1194,47574
+:- pred create_new_var1207,48148
+:- pred accu_process_assoc_set1223,48863
+:- pred accu_has_heuristic1297,52082
+:- pred accu_heuristic1304,52337
+:- pred accu_process_update_set1318,52907
+:- pred accu_divide_base_case1380,55845
+:- pred accu_related1412,57147
+:- inst stored_goal_plain_call1444,58416
+:- pred lookup_call1449,58602
+:- pred accu_stage31470,59433
+:- pred acc_proc_info1508,61327
+:- pred acc_pred_info1556,63450
+:- pred accu_create_goal1600,65286
+:- func create_acc_call1621,66401
+:- pred create_orig_goal1634,66988
+:- pred create_acc_goal1662,68158
+:- func create_new_orig_recursive_goals1709,70226
+:- func create_new_recursive_goals1723,70919
+:- func create_new_base_goals1738,71718
+:- pred acc_unification1749,72157
+:- pred accu_top_level1766,72897
+:- pred update_accumulator_pred1856,76291
+:- func accu_rename1876,77254
+:- func base_case_ids1889,77785
+:- func base_case_ids_set1898,78049
+:- func accu_goal_list1905,78270
+:- pred calculate_goal_info1916,78681
+:- func chain_subst1932,79320
+:- pred chain_subst_21938,79483
+:- some [T] pred unravel_univ1956,80061
+:- pragma foreign_export1957,80117
c-src/c.c,76
T f(1,0
diff --git a/test/manual/etags/ETAGS.good_5 b/test/manual/etags/ETAGS.good_5
index 6410685cb30..3e238a50f38 100644
--- a/test/manual/etags/ETAGS.good_5
+++ b/test/manual/etags/ETAGS.good_5
@@ -4083,92 +4083,92 @@ complete(328,10055
add_active(340,10527
parse(353,10949
derived_analyses(364,11341
-build(378,11965
-buildact(392,12521
-mapsyn(412,13542
-add_edge(434,14278
-findcats(447,14758
-normalize_tree(465,15478
-normalize_trees(475,15856
-expandmng_tree(486,16248
-expandmng_trees(496,16614
-cat(511,17013
-subtree(644,21266
-hypothetical_mem(653,21565
-make_coor(667,22130
-start_up:-start_up688,23013
-tokenizeatom(710,23921
-tokenize(720,24348
-isoperator(752,25377
-isoptab(756,25431
-specialsymbol(765,25756
-sstab(771,25861
-parse_cgi(787,26347
-keyvalseq(792,26510
-andkeyvalseq(796,26609
-keyval(799,26688
-valseq(807,26920
-plusvalseq(810,27007
-val(816,27109
-argvals(824,27426
-commaargvals(828,27503
-atomval(833,27578
-atom(836,27640
-action(846,28004
-keyvalcgi(864,28649
-keyvalscgi(865,28670
-outsyn(868,28726
-act(876,29060
-actout(901,29906
-texttreelist(912,30089
-htmltreelist(918,30190
-fitchtreelist(924,30304
-pp_html_table_tree(938,30759
-pp_html_tree(949,31113
-pp_html_trees(988,32381
-pp_html_table_fitch_tree(999,32769
-pp_html_fitch_tree(1017,33672
-removeexp(1129,39002
-splitexp(1142,39490
-pp_exp(1155,39990
-map_word(1168,40249
-pp_exps(1180,40474
-pp_tree(1188,40777
-pp_trees(1216,41807
-pp_word_list(1225,42128
-pp_word(1231,42262
-pp_word_list_rest(1238,42569
-pp_cat(1248,42929
-pp_syn(1255,43196
-pp_syn_paren(1276,43899
-pp_paren(1293,44377
-pp_syn_back(1300,44661
-pp_bas_cat(1311,45001
-writecat(1322,45409
-writesubs(1351,46455
-writesups(1361,46757
-writelistsubs(1371,47090
-pp_lam(1380,47408
-pp_lam_bracket(1398,48022
-pp_lam_paren(1407,48338
-pp_rule(1429,49238
-member(1447,49866
-append_list(1451,49919
-append(1456,50010
-at_least_one_member(1460,50076
-numbervars(1464,50171
-reverse(1467,50209
-select(1471,50290
-select_last(1475,50357
-cat_atoms(1479,50436
-writelist(1485,50524
-write_lex_cat(1492,50676
-writebreaklex(1500,50988
-write_lex(1513,51265
-writebreak(1521,51541
-tt:-tt1531,51713
-mt:-mt1534,51784
-cmt:-cmt1537,51878
+build(378,11967
+buildact(392,12523
+mapsyn(412,13544
+add_edge(434,14280
+findcats(447,14760
+normalize_tree(465,15480
+normalize_trees(475,15858
+expandmng_tree(486,16250
+expandmng_trees(496,16616
+cat(511,17015
+subtree(644,21268
+hypothetical_mem(653,21567
+make_coor(667,22132
+start_up:-start_up688,23015
+tokenizeatom(710,23923
+tokenize(720,24350
+isoperator(752,25379
+isoptab(756,25433
+specialsymbol(765,25758
+sstab(771,25863
+parse_cgi(787,26349
+keyvalseq(792,26512
+andkeyvalseq(796,26611
+keyval(799,26690
+valseq(807,26922
+plusvalseq(810,27009
+val(816,27111
+argvals(824,27428
+commaargvals(828,27505
+atomval(833,27580
+atom(836,27642
+action(846,28006
+keyvalcgi(864,28651
+keyvalscgi(865,28672
+outsyn(868,28728
+act(876,29062
+actout(901,29908
+texttreelist(912,30091
+htmltreelist(918,30192
+fitchtreelist(924,30306
+pp_html_table_tree(938,30761
+pp_html_tree(949,31115
+pp_html_trees(988,32383
+pp_html_table_fitch_tree(999,32771
+pp_html_fitch_tree(1017,33674
+removeexp(1129,39004
+splitexp(1142,39492
+pp_exp(1155,39992
+map_word(1168,40251
+pp_exps(1180,40476
+pp_tree(1188,40779
+pp_trees(1216,41809
+pp_word_list(1225,42130
+pp_word(1231,42264
+pp_word_list_rest(1238,42571
+pp_cat(1248,42931
+pp_syn(1255,43198
+pp_syn_paren(1276,43901
+pp_paren(1293,44379
+pp_syn_back(1300,44663
+pp_bas_cat(1311,45003
+writecat(1322,45411
+writesubs(1351,46457
+writesups(1361,46759
+writelistsubs(1371,47092
+pp_lam(1380,47410
+pp_lam_bracket(1398,48024
+pp_lam_paren(1407,48340
+pp_rule(1429,49240
+member(1447,49868
+append_list(1451,49921
+append(1456,50012
+at_least_one_member(1460,50078
+numbervars(1464,50173
+reverse(1467,50211
+select(1471,50292
+select_last(1475,50359
+cat_atoms(1479,50438
+writelist(1485,50526
+write_lex_cat(1492,50678
+writebreaklex(1500,50990
+write_lex(1513,51267
+writebreak(1521,51543
+tt:-tt1531,51715
+mt:-mt1534,51786
+cmt:-cmt1537,51880
pyt-src/server.py,1438
class Controls:Controls17,358
@@ -5074,108 +5074,108 @@ initialize_goal_store573,22166
accu_store584,22576
:- pred identify_recursive_calls601,23288
identify_recursive_calls604,23406
-:- pred identify_out_and_out_prime626,24396
-identify_out_and_out_prime631,24631
-:- type accu_sets676,26425
-:- pred accu_stage1689,26977
-accu_stage1693,27155
-:- pred accu_stage1_2727,28347
-accu_stage1_2731,28515
-:- pred accu_sets_init781,30557
-accu_sets_init783,30605
-:- func set_upto796,30984
-set_upto798,31039
-:- pred accu_before812,31498
-accu_before815,31639
-:- pred accu_assoc835,32477
-accu_assoc838,32617
-:- pred accu_construct862,33712
-accu_construct865,33856
-:- pred accu_construct_assoc896,35307
-accu_construct_assoc899,35457
-:- pred accu_update938,37069
-accu_update941,37210
-:- pred member_lessthan_goalid964,38219
-member_lessthan_goalid967,38342
-:- type accu_assoc975,38652
-:- pred accu_is_associative986,39138
-accu_is_associative989,39250
-:- pred associativity_assertion1014,40263
-associativity_assertion1017,40404
-:- pred commutativity_assertion1037,41242
-commutativity_assertion1040,41369
-:- pred accu_is_update1057,41952
-accu_is_update1060,42066
-:- pred is_associative_construction1078,42802
-is_associative_construction1081,42898
-:- type accu_substs1095,43480
-:- type accu_base1103,43744
-:- pred accu_stage21124,44605
-accu_stage21131,44946
-:- pred accu_substs_init1179,46957
-accu_substs_init1182,47097
-:- pred acc_var_subst_init1194,47573
-acc_var_subst_init1198,47718
-:- pred create_new_var1207,48147
-create_new_var1210,48288
-:- pred accu_process_assoc_set1223,48862
-accu_process_assoc_set1229,49150
-:- pred accu_has_heuristic1297,52081
-accu_has_heuristic1299,52161
-:- pred accu_heuristic1304,52336
-accu_heuristic1307,52457
-:- pred accu_process_update_set1318,52906
-accu_process_update_set1325,53221
-:- pred accu_divide_base_case1380,55844
-accu_divide_base_case1385,56059
-:- pred accu_related1412,57146
-accu_related1415,57270
-:- inst stored_goal_plain_call1444,58415
-:- pred lookup_call1449,58601
-lookup_call1452,58715
-:- pred accu_stage31470,59432
-accu_stage31477,59826
-:- pred acc_proc_info1508,61326
-acc_proc_info1512,61485
-:- pred acc_pred_info1556,63449
-acc_pred_info1559,63597
-:- pred accu_create_goal1600,65285
-accu_create_goal1607,65628
-:- func create_acc_call1621,66400
-create_acc_call1625,66569
-:- pred create_orig_goal1634,66987
-create_orig_goal1638,67176
-:- pred create_acc_goal1662,68157
-create_acc_goal1667,68380
-:- func create_new_orig_recursive_goals1709,70225
-create_new_orig_recursive_goals1712,70368
-:- func create_new_recursive_goals1723,70918
-create_new_recursive_goals1727,71108
-:- func create_new_base_goals1738,71717
-create_new_base_goals1741,71831
-:- pred acc_unification1749,72156
-acc_unification1751,72225
-:- pred accu_top_level1766,72896
-accu_top_level1770,73058
-:- pred update_accumulator_pred1856,76290
-update_accumulator_pred1859,76411
-:- func accu_rename1876,77253
-accu_rename1879,77363
-:- func base_case_ids1889,77784
-base_case_ids1891,77846
-:- func base_case_ids_set1898,78048
-base_case_ids_set1900,78113
-:- func accu_goal_list1905,78269
-accu_goal_list1907,78349
-:- pred calculate_goal_info1916,78680
-calculate_goal_info1918,78753
-:- func chain_subst1932,79319
-chain_subst1934,79378
-:- pred chain_subst_21938,79482
-chain_subst_21941,79576
-:- some [T] pred unravel_univ1956,80060
-:- pragma foreign_export1957,80116
-unravel_univ1961,80340
+:- pred identify_out_and_out_prime626,24397
+identify_out_and_out_prime631,24632
+:- type accu_sets676,26426
+:- pred accu_stage1689,26978
+accu_stage1693,27156
+:- pred accu_stage1_2727,28348
+accu_stage1_2731,28516
+:- pred accu_sets_init781,30558
+accu_sets_init783,30606
+:- func set_upto796,30985
+set_upto798,31040
+:- pred accu_before812,31499
+accu_before815,31640
+:- pred accu_assoc835,32478
+accu_assoc838,32618
+:- pred accu_construct862,33713
+accu_construct865,33857
+:- pred accu_construct_assoc896,35308
+accu_construct_assoc899,35458
+:- pred accu_update938,37070
+accu_update941,37211
+:- pred member_lessthan_goalid964,38220
+member_lessthan_goalid967,38343
+:- type accu_assoc975,38653
+:- pred accu_is_associative986,39139
+accu_is_associative989,39251
+:- pred associativity_assertion1014,40264
+associativity_assertion1017,40405
+:- pred commutativity_assertion1037,41243
+commutativity_assertion1040,41370
+:- pred accu_is_update1057,41953
+accu_is_update1060,42067
+:- pred is_associative_construction1078,42803
+is_associative_construction1081,42899
+:- type accu_substs1095,43481
+:- type accu_base1103,43745
+:- pred accu_stage21124,44606
+accu_stage21131,44947
+:- pred accu_substs_init1179,46958
+accu_substs_init1182,47098
+:- pred acc_var_subst_init1194,47574
+acc_var_subst_init1198,47719
+:- pred create_new_var1207,48148
+create_new_var1210,48289
+:- pred accu_process_assoc_set1223,48863
+accu_process_assoc_set1229,49151
+:- pred accu_has_heuristic1297,52082
+accu_has_heuristic1299,52162
+:- pred accu_heuristic1304,52337
+accu_heuristic1307,52458
+:- pred accu_process_update_set1318,52907
+accu_process_update_set1325,53222
+:- pred accu_divide_base_case1380,55845
+accu_divide_base_case1385,56060
+:- pred accu_related1412,57147
+accu_related1415,57271
+:- inst stored_goal_plain_call1444,58416
+:- pred lookup_call1449,58602
+lookup_call1452,58716
+:- pred accu_stage31470,59433
+accu_stage31477,59827
+:- pred acc_proc_info1508,61327
+acc_proc_info1512,61486
+:- pred acc_pred_info1556,63450
+acc_pred_info1559,63598
+:- pred accu_create_goal1600,65286
+accu_create_goal1607,65629
+:- func create_acc_call1621,66401
+create_acc_call1625,66570
+:- pred create_orig_goal1634,66988
+create_orig_goal1638,67177
+:- pred create_acc_goal1662,68158
+create_acc_goal1667,68381
+:- func create_new_orig_recursive_goals1709,70226
+create_new_orig_recursive_goals1712,70369
+:- func create_new_recursive_goals1723,70919
+create_new_recursive_goals1727,71109
+:- func create_new_base_goals1738,71718
+create_new_base_goals1741,71832
+:- pred acc_unification1749,72157
+acc_unification1751,72226
+:- pred accu_top_level1766,72897
+accu_top_level1770,73059
+:- pred update_accumulator_pred1856,76291
+update_accumulator_pred1859,76412
+:- func accu_rename1876,77254
+accu_rename1879,77364
+:- func base_case_ids1889,77785
+base_case_ids1891,77847
+:- func base_case_ids_set1898,78049
+base_case_ids_set1900,78114
+:- func accu_goal_list1905,78270
+accu_goal_list1907,78350
+:- pred calculate_goal_info1916,78681
+calculate_goal_info1918,78754
+:- func chain_subst1932,79320
+chain_subst1934,79379
+:- pred chain_subst_21938,79483
+chain_subst_21941,79577
+:- some [T] pred unravel_univ1956,80061
+:- pragma foreign_export1957,80117
+unravel_univ1961,80341
c-src/c.c,76
T f(1,0
diff --git a/test/manual/etags/ETAGS.good_6 b/test/manual/etags/ETAGS.good_6
index 6f440a7fc95..09abde35c51 100644
--- a/test/manual/etags/ETAGS.good_6
+++ b/test/manual/etags/ETAGS.good_6
@@ -4083,92 +4083,92 @@ complete(328,10055
add_active(340,10527
parse(353,10949
derived_analyses(364,11341
-build(378,11965
-buildact(392,12521
-mapsyn(412,13542
-add_edge(434,14278
-findcats(447,14758
-normalize_tree(465,15478
-normalize_trees(475,15856
-expandmng_tree(486,16248
-expandmng_trees(496,16614
-cat(511,17013
-subtree(644,21266
-hypothetical_mem(653,21565
-make_coor(667,22130
-start_up:-start_up688,23013
-tokenizeatom(710,23921
-tokenize(720,24348
-isoperator(752,25377
-isoptab(756,25431
-specialsymbol(765,25756
-sstab(771,25861
-parse_cgi(787,26347
-keyvalseq(792,26510
-andkeyvalseq(796,26609
-keyval(799,26688
-valseq(807,26920
-plusvalseq(810,27007
-val(816,27109
-argvals(824,27426
-commaargvals(828,27503
-atomval(833,27578
-atom(836,27640
-action(846,28004
-keyvalcgi(864,28649
-keyvalscgi(865,28670
-outsyn(868,28726
-act(876,29060
-actout(901,29906
-texttreelist(912,30089
-htmltreelist(918,30190
-fitchtreelist(924,30304
-pp_html_table_tree(938,30759
-pp_html_tree(949,31113
-pp_html_trees(988,32381
-pp_html_table_fitch_tree(999,32769
-pp_html_fitch_tree(1017,33672
-removeexp(1129,39002
-splitexp(1142,39490
-pp_exp(1155,39990
-map_word(1168,40249
-pp_exps(1180,40474
-pp_tree(1188,40777
-pp_trees(1216,41807
-pp_word_list(1225,42128
-pp_word(1231,42262
-pp_word_list_rest(1238,42569
-pp_cat(1248,42929
-pp_syn(1255,43196
-pp_syn_paren(1276,43899
-pp_paren(1293,44377
-pp_syn_back(1300,44661
-pp_bas_cat(1311,45001
-writecat(1322,45409
-writesubs(1351,46455
-writesups(1361,46757
-writelistsubs(1371,47090
-pp_lam(1380,47408
-pp_lam_bracket(1398,48022
-pp_lam_paren(1407,48338
-pp_rule(1429,49238
-member(1447,49866
-append_list(1451,49919
-append(1456,50010
-at_least_one_member(1460,50076
-numbervars(1464,50171
-reverse(1467,50209
-select(1471,50290
-select_last(1475,50357
-cat_atoms(1479,50436
-writelist(1485,50524
-write_lex_cat(1492,50676
-writebreaklex(1500,50988
-write_lex(1513,51265
-writebreak(1521,51541
-tt:-tt1531,51713
-mt:-mt1534,51784
-cmt:-cmt1537,51878
+build(378,11967
+buildact(392,12523
+mapsyn(412,13544
+add_edge(434,14280
+findcats(447,14760
+normalize_tree(465,15480
+normalize_trees(475,15858
+expandmng_tree(486,16250
+expandmng_trees(496,16616
+cat(511,17015
+subtree(644,21268
+hypothetical_mem(653,21567
+make_coor(667,22132
+start_up:-start_up688,23015
+tokenizeatom(710,23923
+tokenize(720,24350
+isoperator(752,25379
+isoptab(756,25433
+specialsymbol(765,25758
+sstab(771,25863
+parse_cgi(787,26349
+keyvalseq(792,26512
+andkeyvalseq(796,26611
+keyval(799,26690
+valseq(807,26922
+plusvalseq(810,27009
+val(816,27111
+argvals(824,27428
+commaargvals(828,27505
+atomval(833,27580
+atom(836,27642
+action(846,28006
+keyvalcgi(864,28651
+keyvalscgi(865,28672
+outsyn(868,28728
+act(876,29062
+actout(901,29908
+texttreelist(912,30091
+htmltreelist(918,30192
+fitchtreelist(924,30306
+pp_html_table_tree(938,30761
+pp_html_tree(949,31115
+pp_html_trees(988,32383
+pp_html_table_fitch_tree(999,32771
+pp_html_fitch_tree(1017,33674
+removeexp(1129,39004
+splitexp(1142,39492
+pp_exp(1155,39992
+map_word(1168,40251
+pp_exps(1180,40476
+pp_tree(1188,40779
+pp_trees(1216,41809
+pp_word_list(1225,42130
+pp_word(1231,42264
+pp_word_list_rest(1238,42571
+pp_cat(1248,42931
+pp_syn(1255,43198
+pp_syn_paren(1276,43901
+pp_paren(1293,44379
+pp_syn_back(1300,44663
+pp_bas_cat(1311,45003
+writecat(1322,45411
+writesubs(1351,46457
+writesups(1361,46759
+writelistsubs(1371,47092
+pp_lam(1380,47410
+pp_lam_bracket(1398,48024
+pp_lam_paren(1407,48340
+pp_rule(1429,49240
+member(1447,49868
+append_list(1451,49921
+append(1456,50012
+at_least_one_member(1460,50078
+numbervars(1464,50173
+reverse(1467,50211
+select(1471,50292
+select_last(1475,50359
+cat_atoms(1479,50438
+writelist(1485,50526
+write_lex_cat(1492,50678
+writebreaklex(1500,50990
+write_lex(1513,51267
+writebreak(1521,51543
+tt:-tt1531,51715
+mt:-mt1534,51786
+cmt:-cmt1537,51880
pyt-src/server.py,1438
class Controls:Controls17,358
@@ -5074,108 +5074,108 @@ initialize_goal_store573,22166
accu_store584,22576
:- pred identify_recursive_calls601,23288
identify_recursive_calls604,23406
-:- pred identify_out_and_out_prime626,24396
-identify_out_and_out_prime631,24631
-:- type accu_sets676,26425
-:- pred accu_stage1689,26977
-accu_stage1693,27155
-:- pred accu_stage1_2727,28347
-accu_stage1_2731,28515
-:- pred accu_sets_init781,30557
-accu_sets_init783,30605
-:- func set_upto796,30984
-set_upto798,31039
-:- pred accu_before812,31498
-accu_before815,31639
-:- pred accu_assoc835,32477
-accu_assoc838,32617
-:- pred accu_construct862,33712
-accu_construct865,33856
-:- pred accu_construct_assoc896,35307
-accu_construct_assoc899,35457
-:- pred accu_update938,37069
-accu_update941,37210
-:- pred member_lessthan_goalid964,38219
-member_lessthan_goalid967,38342
-:- type accu_assoc975,38652
-:- pred accu_is_associative986,39138
-accu_is_associative989,39250
-:- pred associativity_assertion1014,40263
-associativity_assertion1017,40404
-:- pred commutativity_assertion1037,41242
-commutativity_assertion1040,41369
-:- pred accu_is_update1057,41952
-accu_is_update1060,42066
-:- pred is_associative_construction1078,42802
-is_associative_construction1081,42898
-:- type accu_substs1095,43480
-:- type accu_base1103,43744
-:- pred accu_stage21124,44605
-accu_stage21131,44946
-:- pred accu_substs_init1179,46957
-accu_substs_init1182,47097
-:- pred acc_var_subst_init1194,47573
-acc_var_subst_init1198,47718
-:- pred create_new_var1207,48147
-create_new_var1210,48288
-:- pred accu_process_assoc_set1223,48862
-accu_process_assoc_set1229,49150
-:- pred accu_has_heuristic1297,52081
-accu_has_heuristic1299,52161
-:- pred accu_heuristic1304,52336
-accu_heuristic1307,52457
-:- pred accu_process_update_set1318,52906
-accu_process_update_set1325,53221
-:- pred accu_divide_base_case1380,55844
-accu_divide_base_case1385,56059
-:- pred accu_related1412,57146
-accu_related1415,57270
-:- inst stored_goal_plain_call1444,58415
-:- pred lookup_call1449,58601
-lookup_call1452,58715
-:- pred accu_stage31470,59432
-accu_stage31477,59826
-:- pred acc_proc_info1508,61326
-acc_proc_info1512,61485
-:- pred acc_pred_info1556,63449
-acc_pred_info1559,63597
-:- pred accu_create_goal1600,65285
-accu_create_goal1607,65628
-:- func create_acc_call1621,66400
-create_acc_call1625,66569
-:- pred create_orig_goal1634,66987
-create_orig_goal1638,67176
-:- pred create_acc_goal1662,68157
-create_acc_goal1667,68380
-:- func create_new_orig_recursive_goals1709,70225
-create_new_orig_recursive_goals1712,70368
-:- func create_new_recursive_goals1723,70918
-create_new_recursive_goals1727,71108
-:- func create_new_base_goals1738,71717
-create_new_base_goals1741,71831
-:- pred acc_unification1749,72156
-acc_unification1751,72225
-:- pred accu_top_level1766,72896
-accu_top_level1770,73058
-:- pred update_accumulator_pred1856,76290
-update_accumulator_pred1859,76411
-:- func accu_rename1876,77253
-accu_rename1879,77363
-:- func base_case_ids1889,77784
-base_case_ids1891,77846
-:- func base_case_ids_set1898,78048
-base_case_ids_set1900,78113
-:- func accu_goal_list1905,78269
-accu_goal_list1907,78349
-:- pred calculate_goal_info1916,78680
-calculate_goal_info1918,78753
-:- func chain_subst1932,79319
-chain_subst1934,79378
-:- pred chain_subst_21938,79482
-chain_subst_21941,79576
-:- some [T] pred unravel_univ1956,80060
-:- pragma foreign_export1957,80116
-unravel_univ1961,80340
+:- pred identify_out_and_out_prime626,24397
+identify_out_and_out_prime631,24632
+:- type accu_sets676,26426
+:- pred accu_stage1689,26978
+accu_stage1693,27156
+:- pred accu_stage1_2727,28348
+accu_stage1_2731,28516
+:- pred accu_sets_init781,30558
+accu_sets_init783,30606
+:- func set_upto796,30985
+set_upto798,31040
+:- pred accu_before812,31499
+accu_before815,31640
+:- pred accu_assoc835,32478
+accu_assoc838,32618
+:- pred accu_construct862,33713
+accu_construct865,33857
+:- pred accu_construct_assoc896,35308
+accu_construct_assoc899,35458
+:- pred accu_update938,37070
+accu_update941,37211
+:- pred member_lessthan_goalid964,38220
+member_lessthan_goalid967,38343
+:- type accu_assoc975,38653
+:- pred accu_is_associative986,39139
+accu_is_associative989,39251
+:- pred associativity_assertion1014,40264
+associativity_assertion1017,40405
+:- pred commutativity_assertion1037,41243
+commutativity_assertion1040,41370
+:- pred accu_is_update1057,41953
+accu_is_update1060,42067
+:- pred is_associative_construction1078,42803
+is_associative_construction1081,42899
+:- type accu_substs1095,43481
+:- type accu_base1103,43745
+:- pred accu_stage21124,44606
+accu_stage21131,44947
+:- pred accu_substs_init1179,46958
+accu_substs_init1182,47098
+:- pred acc_var_subst_init1194,47574
+acc_var_subst_init1198,47719
+:- pred create_new_var1207,48148
+create_new_var1210,48289
+:- pred accu_process_assoc_set1223,48863
+accu_process_assoc_set1229,49151
+:- pred accu_has_heuristic1297,52082
+accu_has_heuristic1299,52162
+:- pred accu_heuristic1304,52337
+accu_heuristic1307,52458
+:- pred accu_process_update_set1318,52907
+accu_process_update_set1325,53222
+:- pred accu_divide_base_case1380,55845
+accu_divide_base_case1385,56060
+:- pred accu_related1412,57147
+accu_related1415,57271
+:- inst stored_goal_plain_call1444,58416
+:- pred lookup_call1449,58602
+lookup_call1452,58716
+:- pred accu_stage31470,59433
+accu_stage31477,59827
+:- pred acc_proc_info1508,61327
+acc_proc_info1512,61486
+:- pred acc_pred_info1556,63450
+acc_pred_info1559,63598
+:- pred accu_create_goal1600,65286
+accu_create_goal1607,65629
+:- func create_acc_call1621,66401
+create_acc_call1625,66570
+:- pred create_orig_goal1634,66988
+create_orig_goal1638,67177
+:- pred create_acc_goal1662,68158
+create_acc_goal1667,68381
+:- func create_new_orig_recursive_goals1709,70226
+create_new_orig_recursive_goals1712,70369
+:- func create_new_recursive_goals1723,70919
+create_new_recursive_goals1727,71109
+:- func create_new_base_goals1738,71718
+create_new_base_goals1741,71832
+:- pred acc_unification1749,72157
+acc_unification1751,72226
+:- pred accu_top_level1766,72897
+accu_top_level1770,73059
+:- pred update_accumulator_pred1856,76291
+update_accumulator_pred1859,76412
+:- func accu_rename1876,77254
+accu_rename1879,77364
+:- func base_case_ids1889,77785
+base_case_ids1891,77847
+:- func base_case_ids_set1898,78049
+base_case_ids_set1900,78114
+:- func accu_goal_list1905,78270
+accu_goal_list1907,78350
+:- pred calculate_goal_info1916,78681
+calculate_goal_info1918,78754
+:- func chain_subst1932,79320
+chain_subst1934,79379
+:- pred chain_subst_21938,79483
+chain_subst_21941,79577
+:- some [T] pred unravel_univ1956,80061
+:- pragma foreign_export1957,80117
+unravel_univ1961,80341
c-src/c.c,76
T f(1,0
diff --git a/test/manual/etags/cp-src/clheir.hpp b/test/manual/etags/cp-src/clheir.hpp
index 55d91228fb3..831da5ca095 100644
--- a/test/manual/etags/cp-src/clheir.hpp
+++ b/test/manual/etags/cp-src/clheir.hpp
@@ -2,7 +2,7 @@
/* CLHEIR.H */
/* ======================================================================= */
-// CLASS HEIRARCHY
+// CLASS HIERARCHY
// Locations or Agents are both of type generic_object. Generic_objects may
// have states, and are responsible for updating their states appropriately
// when their step() functions are executed.
diff --git a/test/manual/etags/merc-src/accumulator.m b/test/manual/etags/merc-src/accumulator.m
index c82dbf58ff8..0ee41216c11 100644
--- a/test/manual/etags/merc-src/accumulator.m
+++ b/test/manual/etags/merc-src/accumulator.m
@@ -616,7 +616,7 @@ identify_recursive_calls(PredId, ProcId, GoalStore, Ids) :-
% Determine the variables which are members of the sets Out and Out',
% and initialize the substitutions between the two sets.
%
- % This is done by identifing those variables whose instantiatedness change
+ % This is done by identifying those variables whose instantiatedness change
% in the goals after the recursive call and are headvars.
%
% Note that we are only identifying the output variables which will need
diff --git a/test/manual/etags/prol-src/natded.prolog b/test/manual/etags/prol-src/natded.prolog
index f0ee6b41b12..08c81d48f61 100644
--- a/test/manual/etags/prol-src/natded.prolog
+++ b/test/manual/etags/prol-src/natded.prolog
@@ -371,7 +371,7 @@ derived_analyses([W|Ws],[W|DerWs]):-
% build(Ws:+<list(<word>)>, Right:+<int>, Left:-<int>)
% ----------------------------------------------------------------------
-% finishes building chart with Ws as remaing word, starting from
+% finishes building chart with Ws as remaining word, starting from
% right position Right and finishing on left position Left
% -- counts backwards, so Left > Right
% ----------------------------------------------------------------------
diff --git a/test/manual/indent/perl.perl b/test/manual/indent/perl.perl
index db94552a928..b44593da028 100755
--- a/test/manual/indent/perl.perl
+++ b/test/manual/indent/perl.perl
@@ -90,7 +90,7 @@ s:abc:def:g; # FIXME: the initial s is fontified like a label, and indented
s'def'ghi'g; # The middle ' should not end the quoting.
s"ghi"ijk"g; # The middle ' should not end the quoting.
-s#ijk#lmn#g; # This is a regular expression sustitution.
+s#ijk#lmn#g; # This is a regular expression substitution.
s #lmn#opq#g; # FIXME: this should be a comment starting with "#lmn"
/lmn/rst/g; # and this is the actual regular expression
diff --git a/test/manual/process-callout-tests.el b/test/manual/process-callout-tests.el
new file mode 100644
index 00000000000..0bb960cf909
--- /dev/null
+++ b/test/manual/process-callout-tests.el
@@ -0,0 +1,64 @@
+;;; process-callout-tests.el --- Testing the process facilities -*- lexical-binding: t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ert)
+
+;;; This test is here in test/manual instead of
+;;; test/src/process-tests.el for two reasons: The test suite
+;;; shouldn't "call home" automatically, because that's against our
+;;; privacy principles, and as a practical matter, the server may have
+;;; problems, and that shouldn't trigger a test error.
+
+(ert-deftest process-async-https-with-delay ()
+ "Bug#49449: asynchronous TLS connection with delayed completion."
+ (skip-unless (and internet-is-working (gnutls-available-p)))
+ (let* ((status nil)
+ (buf (url-http
+ #s(url "https" nil nil "elpa.gnu.org" nil
+ "/packages/archive-contents" nil nil t silent t t)
+ (lambda (s) (setq status s))
+ '(nil) nil 'tls)))
+ (unwind-protect
+ (progn
+ ;; Busy-wait for 1 s to allow for the TCP connection to complete.
+ (let ((delay 1.0)
+ (t0 (float-time)))
+ (while (< (float-time) (+ t0 delay))))
+ ;; Wait for the entire operation to finish.
+ (let ((limit 4.0)
+ (t0 (float-time)))
+ (while (and (null status)
+ (< (float-time) (+ t0 limit)))
+ (sit-for 0.1)))
+ (should status)
+ (should-not (plist-get status ':error))
+ (should buf)
+ (should (> (buffer-size buf) 0))
+ )
+ (when buf
+ (kill-buffer buf)))))
+
+;;; process-callout-tests.el ends here
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index 13d48b31a4f..cba10a05025 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -1503,9 +1503,12 @@ with parameters from the *Messages* buffer modification."
(ert-deftest test-restore-buffer-modified-p ()
(ert-with-temp-file file
+ ;; This avoids the annoying "foo and bar are the same file" on
+ ;; MS-Windows.
+ (setq file (file-truename file))
(with-current-buffer (find-file file)
(auto-save-mode 1)
- (should-not (buffer-modified-p))
+ (should-not (eq (buffer-modified-p) t))
(insert "foo")
(should (buffer-modified-p))
(restore-buffer-modified-p nil)
@@ -1522,9 +1525,10 @@ with parameters from the *Messages* buffer modification."
(delete-file buffer-auto-save-file-name))))
(ert-with-temp-file file
+ (setq file (file-truename file))
(with-current-buffer (find-file file)
(auto-save-mode 1)
- (should-not (buffer-modified-p))
+ (should-not (eq (buffer-modified-p) t))
(insert "foo")
(should (buffer-modified-p))
(should-not (eq (buffer-modified-p) 'autosaved))
diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el
index 0a60f4d6cc4..9092f040c80 100644
--- a/test/src/comp-resources/comp-test-funcs.el
+++ b/test/src/comp-resources/comp-test-funcs.el
@@ -515,6 +515,8 @@
(defun comp-test-47868-4-f ()
#(" " 0 1 (face font-lock-keyword-face)))
+(defun comp-test-48029-nonascii-žžž-f (arg)
+ (when arg t))
;;;;;;;;;;;;;;;;;;;;
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index e7b534d00ec..1b239cec795 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -508,11 +508,6 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
(should (string= (comp-test-45635-f :height 180 :family "PragmataPro Liga")
"PragmataPro Liga")))
-(comp-deftest 45603-1 ()
- "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01994.html>"
- (load (native-compile (ert-resource-file "comp-test-45603.el")))
- (should (fboundp 'comp-test-45603--file-local-name)))
-
(comp-deftest 46670-1 ()
"<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-02/msg01413.html>"
(should (string= (comp-test-46670-2-f "foo") "foo"))
@@ -532,6 +527,11 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
(should (eq (comp-test-47868-1-f) (comp-test-47868-3-f)))
(should (eq (comp-test-47868-2-f) (comp-test-47868-4-f))))
+(comp-deftest 48029-1 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-07/msg00666.html>"
+ (should (subr-native-elisp-p
+ (symbol-function 'comp-test-48029-nonascii-žžž-f))))
+
;;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests. ;;
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index c137ce06f1a..08582c8a862 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -201,4 +201,20 @@ Also check that an encoding error can appear in a symlink."
(insert-file-contents "/dev/urandom" nil nil 10)
(should (= (buffer-size) 10))))
+(defun fileio-tests--identity-expand-handler (_ file &rest _)
+ file)
+(put 'fileio-tests--identity-expand-handler 'operations '(expand-file-name))
+
+(ert-deftest fileio--file-name-case-insensitive-p ()
+ ;; Check that we at least don't crash if given nonexisting files
+ ;; without a directory (bug#56443).
+
+ ;; Use an identity file-name handler, as if called by `ffap'.
+ (let* ((file-name-handler-alist
+ '(("^mailto:" . fileio-tests--identity-expand-handler)))
+ (file "mailto:snowball@hell.com"))
+ ;; Check that `expand-file-name' is identity for this name.
+ (should (equal (expand-file-name file nil) file))
+ (file-name-case-insensitive-p file)))
+
;;; fileio-tests.el ends here
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index ba56019d4cd..20074ca0d21 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -1344,4 +1344,25 @@
(should (equal (plist-member plist (copy-sequence "a") #'equal)
'("a" "c")))))
+(ert-deftest fns--string-to-unibyte-multibyte ()
+ (dolist (str (list "" "a" "abc" "a\x00\x7fz" "a\xaa\xbbz" "\x80\xdd\xff"
+ (apply #'unibyte-string (number-sequence 0 255))))
+ (ert-info ((prin1-to-string str) :prefix "str: ")
+ (should-not (multibyte-string-p str))
+ (let* ((u (string-to-unibyte str)) ; should be identity
+ (m (string-to-multibyte u)) ; lossless conversion
+ (mm (string-to-multibyte m)) ; should be identity
+ (uu (string-to-unibyte m)) ; also lossless
+ (ml (mapcar (lambda (c) (if (<= c #x7f) c (+ c #x3fff00))) u)))
+ (should-not (multibyte-string-p u))
+ (should (multibyte-string-p m))
+ (should (multibyte-string-p mm))
+ (should-not (multibyte-string-p uu))
+ (should (equal str u))
+ (should (equal m mm))
+ (should (equal str uu))
+ (should (equal (append m nil) ml)))))
+ (should-error (string-to-unibyte "å"))
+ (should-error (string-to-unibyte "ABC∀BC")))
+
;;; fns-tests.el ends here
diff --git a/test/src/json-tests.el b/test/src/json-tests.el
index f3dfeea30b4..3560e1abc96 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -187,8 +187,11 @@
(ert-deftest json-parse-string/null ()
(skip-unless (fboundp 'json-parse-string))
(should-error (json-parse-string "\x00") :type 'wrong-type-argument)
- ;; FIXME: Reconsider whether this is the right behavior.
- (should-error (json-parse-string "[\"a\\u0000b\"]") :type 'json-parse-error))
+ (should (json-parse-string "[\"a\\u0000b\"]"))
+ (let* ((string "{\"foo\":\"this is a string including a literal \\u0000\"}")
+ (data (json-parse-string string)))
+ (should (hash-table-p data))
+ (should (equal string (json-serialize data)))))
(ert-deftest json-parse-string/invalid-unicode ()
"Some examples from
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el
index de3012b5764..b0876664ed1 100644
--- a/test/src/keymap-tests.el
+++ b/test/src/keymap-tests.el
@@ -135,7 +135,7 @@
(should (eq (lookup-key map [menu-bar I-bar]) 'foo))))
(ert-deftest keymap-lookup-key/mixed-case-multibyte ()
- "Backwards compatibility behaviour (Bug#50752)."
+ "Backwards compatibility behavior (Bug#50752)."
(let ((map (make-keymap)))
;; (downcase "Åäö") => "åäö"
(define-key map [menu-bar åäö bar] 'foo)
@@ -153,19 +153,19 @@
(should (eq (lookup-key map [menu-bar buffer 1]) 'foo))))
(ert-deftest keymap-lookup-keymap/with-spaces ()
- "Backwards compatibility behaviour (Bug#50752)."
+ "Backwards compatibility behavior (Bug#50752)."
(let ((map (make-keymap)))
(define-key map [menu-bar foo-bar] 'foo)
(should (eq (lookup-key map [menu-bar Foo\ Bar]) 'foo))))
(ert-deftest keymap-lookup-keymap/with-spaces-multibyte ()
- "Backwards compatibility behaviour (Bug#50752)."
+ "Backwards compatibility behavior (Bug#50752)."
(let ((map (make-keymap)))
(define-key map [menu-bar åäö-bar] 'foo)
(should (eq (lookup-key map [menu-bar Åäö\ Bar]) 'foo))))
(ert-deftest keymap-lookup-keymap/with-spaces-multibyte-lang-env ()
- "Backwards compatibility behaviour (Bug#50752)."
+ "Backwards compatibility behavior (Bug#50752)."
(let ((lang-env current-language-environment))
(set-language-environment "Turkish")
(let ((map (make-keymap)))
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index 824c6da1191..f1ed7e18d5b 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -909,35 +909,6 @@ Return nil if FILENAME doesn't exist."
;; ...and the change description should be "interrupt".
(should (equal '("interrupt\n") events)))))
-(ert-deftest process-async-https-with-delay ()
- "Bug#49449: asynchronous TLS connection with delayed completion."
- (skip-unless (and internet-is-working (gnutls-available-p)))
- (let* ((status nil)
- (buf (url-http
- #s(url "https" nil nil "elpa.gnu.org" nil
- "/packages/archive-contents" nil nil t silent t t)
- (lambda (s) (setq status s))
- '(nil) nil 'tls)))
- (unwind-protect
- (progn
- ;; Busy-wait for 1 s to allow for the TCP connection to complete.
- (let ((delay 1.0)
- (t0 (float-time)))
- (while (< (float-time) (+ t0 delay))))
- ;; Wait for the entire operation to finish.
- (let ((limit 4.0)
- (t0 (float-time)))
- (while (and (null status)
- (< (float-time) (+ t0 limit)))
- (sit-for 0.1)))
- (should status)
- (should-not (plist-get status ':error))
- (should buf)
- (should (> (buffer-size buf) 0))
- )
- (when buf
- (kill-buffer buf)))))
-
(ert-deftest process-num-processors ()
"Sanity checks for num-processors."
(should (equal (num-processors) (num-processors)))