summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog30
-rw-r--r--INSTALL.BZR27
-rw-r--r--Makefile.in2
-rw-r--r--admin/admin.el230
-rw-r--r--admin/make-tarball.txt9
-rw-r--r--admin/notes/BRANCH7
-rw-r--r--admin/notes/elpa62
-rwxr-xr-xautogen.sh208
-rw-r--r--autogen/Makefile.in (renamed from lib/Makefile.in)2
-rw-r--r--autogen/README14
-rw-r--r--autogen/aclocal.m4 (renamed from aclocal.m4)4
-rw-r--r--autogen/config.in (renamed from src/config.in)3
-rwxr-xr-xautogen/configure (renamed from configure)486
-rwxr-xr-xautogen/copy_autogen20
-rwxr-xr-xautogen/update_autogen183
-rw-r--r--configure.in9
-rw-r--r--doc/emacs/ChangeLog37
-rw-r--r--doc/emacs/Makefile.in2
-rw-r--r--doc/emacs/ack.texi26
-rw-r--r--doc/emacs/building.texi2
-rw-r--r--doc/emacs/custom.texi2
-rw-r--r--doc/emacs/display.texi3
-rw-r--r--doc/emacs/emacs.texi26
-rw-r--r--doc/emacs/makefile.w32-in2
-rw-r--r--doc/emacs/msdog.texi53
-rw-r--r--doc/emacs/mule.texi2
-rw-r--r--doc/emacs/search.texi8
-rw-r--r--doc/emacs/xresources.texi7
-rw-r--r--doc/lispref/ChangeLog.trunk34
-rw-r--r--doc/lispref/Makefile.in2
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/intro.texi4
-rw-r--r--doc/lispref/keymaps.texi14
-rw-r--r--doc/lispref/makefile.w32-in3
-rw-r--r--doc/lispref/modes.texi2
-rw-r--r--doc/lispref/nonascii.texi2
-rw-r--r--doc/lispref/package.texi101
-rw-r--r--doc/lispref/strings.texi4
-rw-r--r--doc/misc/ChangeLog51
-rw-r--r--doc/misc/Makefile.in13
-rw-r--r--doc/misc/auth.texi74
-rw-r--r--doc/misc/calc.texi235
-rw-r--r--doc/misc/message.texi28
-rw-r--r--doc/misc/tramp.texi29
-rw-r--r--doc/misc/trampver.texi2
-rw-r--r--etc/ChangeLog20
-rw-r--r--etc/NEWS36
-rw-r--r--etc/themes/tsdh-dark-theme.el6
-rw-r--r--etc/themes/tsdh-light-theme.el7
-rw-r--r--etc/themes/wombat-theme.el108
-rw-r--r--lib-src/ChangeLog2
-rw-r--r--lib/gnulib.mk2
-rw-r--r--lib/sys_stat.in.h16
-rw-r--r--lisp/ChangeLog.trunk420
-rw-r--r--lisp/allout-widgets.el4
-rw-r--r--lisp/allout.el99
-rw-r--r--lisp/avoid.el16
-rw-r--r--lisp/calc/README2
-rw-r--r--lisp/calc/calc-ext.el31
-rw-r--r--lisp/calc/calc-help.el4
-rw-r--r--lisp/calc/calc-menu.el105
-rw-r--r--lisp/calc/calc-units.el114
-rw-r--r--lisp/calc/calc.el6
-rw-r--r--lisp/calendar/cal-hebrew.el12
-rw-r--r--lisp/calendar/time-date.el8
-rw-r--r--lisp/cus-edit.el6
-rw-r--r--lisp/cus-start.el6
-rw-r--r--lisp/cus-theme.el10
-rw-r--r--lisp/custom.el18
-rw-r--r--lisp/dired-aux.el5
-rw-r--r--lisp/dired.el3
-rw-r--r--lisp/ebuff-menu.el101
-rw-r--r--lisp/emacs-lisp/bytecomp.el14
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el8
-rw-r--r--lisp/emacs-lisp/ert.el9
-rw-r--r--lisp/emacs-lisp/package-x.el255
-rw-r--r--lisp/emacs-lisp/package.el177
-rw-r--r--lisp/eshell/esh-opt.el55
-rw-r--r--lisp/eshell/esh-util.el3
-rw-r--r--lisp/facemenu.el37
-rw-r--r--lisp/files.el10
-rw-r--r--lisp/font-lock.el2
-rw-r--r--lisp/gnus/ChangeLog228
-rw-r--r--lisp/gnus/auth-source.el314
-rw-r--r--lisp/gnus/gnus-art.el14
-rw-r--r--lisp/gnus/gnus-group.el33
-rw-r--r--lisp/gnus/gnus-int.el4
-rw-r--r--lisp/gnus/gnus-start.el26
-rw-r--r--lisp/gnus/gnus-sum.el56
-rw-r--r--lisp/gnus/gnus-sync.el12
-rw-r--r--lisp/gnus/gnus-util.el6
-rw-r--r--lisp/gnus/gnus-win.el6
-rw-r--r--lisp/gnus/gravatar.el6
-rw-r--r--lisp/gnus/gssapi.el105
-rw-r--r--lisp/gnus/message.el18
-rw-r--r--lisp/gnus/mm-uu.el8
-rw-r--r--lisp/gnus/nnimap.el68
-rw-r--r--lisp/gnus/shr.el15
-rw-r--r--lisp/gnus/sieve-manage.el7
-rw-r--r--lisp/help-fns.el1
-rw-r--r--lisp/help.el12
-rw-r--r--lisp/ido.el8
-rw-r--r--lisp/info.el10
-rw-r--r--lisp/mail/rmail.el4
-rw-r--r--lisp/minibuffer.el10
-rw-r--r--lisp/net/ldap.el43
-rw-r--r--lisp/net/quickurl.el10
-rw-r--r--lisp/net/rcirc.el7
-rw-r--r--lisp/net/tramp-sh.el42
-rw-r--r--lisp/net/trampver.el4
-rw-r--r--lisp/net/xesam.el8
-rw-r--r--lisp/notifications.el4
-rw-r--r--lisp/org/ChangeLog10
-rw-r--r--lisp/org/ob-exp.el14
-rw-r--r--lisp/org/ob-ref.el12
-rw-r--r--lisp/org/ob-sql.el22
-rw-r--r--lisp/org/org-freemind.el6
-rw-r--r--lisp/org/org-mouse.el10
-rw-r--r--lisp/org/org-plot.el24
-rw-r--r--lisp/org/org-src.el14
-rw-r--r--lisp/play/bubbles.el50
-rw-r--r--lisp/play/gamegrid.el10
-rw-r--r--lisp/play/morse.el108
-rw-r--r--lisp/progmodes/cc-cmds.el19
-rw-r--r--lisp/progmodes/compile.el49
-rw-r--r--lisp/progmodes/delphi.el75
-rw-r--r--lisp/progmodes/ebrowse.el12
-rw-r--r--lisp/progmodes/gdb-mi.el45
-rw-r--r--lisp/progmodes/gud.el4
-rw-r--r--lisp/progmodes/ruby-mode.el2
-rw-r--r--lisp/server.el8
-rw-r--r--lisp/shell.el22
-rw-r--r--lisp/simple.el6
-rw-r--r--lisp/startup.el45
-rw-r--r--lisp/subr.el36
-rw-r--r--lisp/textmodes/texinfo.el7
-rw-r--r--lisp/vc/diff-mode.el21
-rw-r--r--lisp/vc/emerge.el23
-rw-r--r--lisp/vc/vc-bzr.el9
-rw-r--r--lisp/vc/vc-dir.el6
-rw-r--r--lisp/vc/vc-git.el22
-rw-r--r--lisp/vc/vc-hg.el13
-rw-r--r--lisp/vc/vc.el7
-rw-r--r--src/.gdbinit4
-rw-r--r--src/ChangeLog.trunk797
-rw-r--r--src/alloc.c90
-rw-r--r--src/bidi.c3
-rw-r--r--src/buffer.c283
-rw-r--r--src/buffer.h72
-rw-r--r--src/bytecode.c16
-rw-r--r--src/callint.c28
-rw-r--r--src/casefiddle.c31
-rw-r--r--src/casetab.c6
-rw-r--r--src/category.c4
-rw-r--r--src/ccl.c57
-rw-r--r--src/character.c2
-rw-r--r--src/character.h57
-rw-r--r--src/charset.c29
-rw-r--r--src/charset.h7
-rw-r--r--src/chartab.c45
-rw-r--r--src/cm.c9
-rw-r--r--src/cm.h33
-rw-r--r--src/cmds.c6
-rw-r--r--src/coding.c348
-rw-r--r--src/data.c40
-rw-r--r--src/dbusbind.c49
-rw-r--r--src/deps.mk28
-rw-r--r--src/dired.c52
-rw-r--r--src/dispextern.h8
-rw-r--r--src/doc.c36
-rw-r--r--src/editfns.c209
-rw-r--r--src/emacs.c51
-rw-r--r--src/eval.c63
-rw-r--r--src/fileio.c109
-rw-r--r--src/filelock.c10
-rw-r--r--src/floatfns.c17
-rw-r--r--src/fns.c25
-rw-r--r--src/font.c84
-rw-r--r--src/fontset.c17
-rw-r--r--src/fringe.c20
-rw-r--r--src/gtkutil.c338
-rw-r--r--src/image.c64
-rw-r--r--src/indent.c34
-rw-r--r--src/insdel.c24
-rw-r--r--src/intervals.c16
-rw-r--r--src/keyboard.c244
-rw-r--r--src/keyboard.h11
-rw-r--r--src/keymap.c76
-rw-r--r--src/lisp.h309
-rw-r--r--src/lread.c67
-rw-r--r--src/makefile.w32-in44
-rw-r--r--src/marker.c12
-rw-r--r--src/minibuf.c77
-rw-r--r--src/msdos.c7
-rw-r--r--src/msdos.h2
-rw-r--r--src/nsterm.m18
-rw-r--r--src/print.c26
-rw-r--r--src/process.c19
-rw-r--r--src/regex.c255
-rw-r--r--src/s/aix4-2.h2
-rw-r--r--src/s/cygwin.h3
-rw-r--r--src/s/darwin.h3
-rw-r--r--src/s/gnu-linux.h2
-rw-r--r--src/s/irix6-5.h3
-rw-r--r--src/scroll.c13
-rw-r--r--src/search.c29
-rw-r--r--src/syntax.c19
-rw-r--r--src/sysdep.c37
-rw-r--r--src/systime.h5
-rw-r--r--src/systty.h3
-rw-r--r--src/term.c78
-rw-r--r--src/termcap.c18
-rw-r--r--src/termchar.h93
-rw-r--r--src/termhooks.h3
-rw-r--r--src/terminal.c5
-rw-r--r--src/tparam.c16
-rw-r--r--src/tparam.h31
-rw-r--r--src/unexaix.c9
-rw-r--r--src/unexcoff.c8
-rw-r--r--src/unexcw.c9
-rw-r--r--src/unexec.h1
-rw-r--r--src/unexelf.c28
-rw-r--r--src/unexhp9k800.c6
-rw-r--r--src/unexmacosx.c8
-rw-r--r--src/unexsol.c7
-rw-r--r--src/unexw32.c6
-rw-r--r--src/w32.c5
-rw-r--r--src/w32console.c9
-rw-r--r--src/w32fns.c48
-rw-r--r--src/w32font.c3
-rw-r--r--src/w32inevt.c9
-rw-r--r--src/w32menu.c8
-rw-r--r--src/w32proc.c8
-rw-r--r--src/w32select.c2
-rw-r--r--src/w32term.c14
-rw-r--r--src/w32term.h6
-rw-r--r--src/w32uniscribe.c4
-rw-r--r--src/w32xfns.c2
-rw-r--r--src/window.c53
-rw-r--r--src/window.h1
-rw-r--r--src/xdisp.c65
-rw-r--r--src/xfaces.c90
-rw-r--r--src/xfns.c52
-rw-r--r--src/xgselect.c17
-rw-r--r--src/xmenu.c24
-rw-r--r--src/xrdb.c10
-rw-r--r--src/xselect.c34
-rw-r--r--src/xsmfns.c6
-rw-r--r--src/xterm.c222
-rw-r--r--src/xterm.h14
250 files changed, 7240 insertions, 3902 deletions
diff --git a/ChangeLog b/ChangeLog
index 949862248b..a58a60465d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2011-03-20 Glenn Morris <rgm@gnu.org>
+
+ * autogen/: New directory, to be excluded from releases.
+ * autogen/copy_autogen, autogen/update_autogen: New scripts.
+ * autogen/README: New file.
+ * autogen/aclocal.m4, autogen/config.in, autogen/configure:
+ * autogen/Makefile.in: Add auto-updated generated files.
+ * autogen.sh: No longer a no-op, now it tests for autotools
+ and runs them as necessary.
+ * configure.in: Defaule maintainer-mode to on.
+ * aclocal.m4, configure, lib/Makefile.in: Remove files.
+
+2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ Update for gnulib.
+ * Makefile.in (GNULIB_MODULES): Add intprops, as Emacs now
+ includes <intprops.h> directly.
+ * lib/sys_stat.in.h: New version from Gnulib, which fixes a bug
+ when building Emacs on Solaris 9 and running it on Solaris 10.
+
+2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * configure.in: Require 3.0 for --with-gtk3. Add HAVE_GTK3.
+
2011-03-06 Glenn Morris <rgm@gnu.org>
* configure.in (FREETYPE_LIBS): Actually set it to something.
@@ -47,7 +71,7 @@
2011-02-21 Christoph Scholtes <cschol2112@gmail.com>
- * lib/makefile.w32-in: ($(BLD)/md5.$(O)): Added dependency on
+ * lib/makefile.w32-in ($(BLD)/md5.$(O)): Added dependency on
$(EMACS_ROOT)/nt/inc/stdint.h.
2011-02-21 Eli Zaretskii <eliz@gnu.org>
@@ -86,7 +110,7 @@
way to test this so I left it alone.
* configure: Regenerate.
-2011-02-20 Christoph Scholtes <cschol2112@gmail.com>
+2011-02-20 Christoph Scholtes <cschol2112@gmail.com>
* lib/makefile.w32-in ($(BLD)/md5.$(O)): New recipe, moved from
src/makefile.w32-in.
@@ -949,7 +973,7 @@
2010-06-28 Jan Djärv <jan.h.d@swipnet.se>
- * configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY,
+ * configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY,
check for gtk_file_chooser_dialog_new, and HAVE_GTK_FILE_BOTH (implied
by minimum required Gtk+ 2.6). Add checks for functions introduced
in Gtk+ 2.14 or newer (bug#6505).
diff --git a/INSTALL.BZR b/INSTALL.BZR
index 710a73c704..3859e3cd4f 100644
--- a/INSTALL.BZR
+++ b/INSTALL.BZR
@@ -4,14 +4,29 @@ See the end of the file for license conditions.
Building and Installing Emacs from Bazaar
-If this is the first time you go through it, you'll need to configure
-before bootstrapping:
+Building Emacs from Bazaar requires some tools that are not needed
+when building from a release. You will need:
- $ ./configure
+autoconf - at least the version specified near the start of
+ configure.in (in the AC_PREREQ command).
+automake - we recommend at least version 1.11.
+makeinfo - not strictly necessary, but highly recommended, so that
+ you can build the manuals.
+
+The `autogen.sh' script can help you figure out if you have the
+necessary tools.
+
+The first time you build, there are a couple of extra steps.
+First, generate the `configure' script:
+
+ $ ./autogen.sh
-(Normally there is no need to run `autoconf' etc. If you do need it,
-the relevant command is `autoreconf -I m4'. Be aware that this will
-likely lead to conflicts next time you update from Bazaar.)
+(or you can just run `autoreconf -I m4').
+
+You can then configure your build (use `./configure --help' to see
+options you can set):
+
+ $ ./configure
Some of the files that are included in the Emacs tarball, such as
byte-compiled Lisp files, are not stored in Bazaar. Therefore, to
diff --git a/Makefile.in b/Makefile.in
index 7bd4318bfb..19267f8212 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -332,7 +332,7 @@ DOS_gnulib_comp.m4 = gl-comp.m4
# as per $(gnulib_srcdir)/DEPENDENCIES.
GNULIB_MODULES = \
crypto/md5 dtoastr filemode getloadavg getopt-gnu \
- ignore-value lstat mktime readlink strftime symlink sys_stat
+ ignore-value intprops lstat mktime readlink strftime symlink sys_stat
GNULIB_TOOL_FLAGS = \
--import --no-changelog --no-vc-files --makefile-name=gnulib.mk
sync-from-gnulib: $(gnulib_srcdir)
diff --git a/admin/admin.el b/admin/admin.el
index 717bfee702..70958ce1a7 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -212,6 +212,236 @@ Root must be the root of an Emacs source tree."
"\\\\def\\\\year{")
"\\([0-9]\\{4\\}\\)}.+%.+copyright year"))))))
+;;; Various bits of magic for generating the web manuals
+
+(defun make-manuals (root)
+ "Generate the web manuals for the Emacs webpage."
+ (interactive "DEmacs root directory: ")
+ (let* ((dest (expand-file-name "manual" root))
+ (html-node-dir (expand-file-name "html_node" dest))
+ (html-mono-dir (expand-file-name "html_mono" dest))
+ (txt-dir (expand-file-name "text" dest))
+ (dvi-dir (expand-file-name "dvi" dest))
+ (ps-dir (expand-file-name "ps" dest)))
+ (when (file-directory-p dest)
+ (if (y-or-n-p (format "Directory %s exists, delete it first?" dest))
+ (delete-directory dest t)
+ (error "Aborted")))
+ (make-directory dest)
+ (make-directory html-node-dir)
+ (make-directory html-mono-dir)
+ (make-directory txt-dir)
+ (make-directory dvi-dir)
+ (make-directory ps-dir)
+ ;; Emacs manual
+ (let ((texi (expand-file-name "doc/emacs/emacs.texi" root)))
+ (manual-html-node texi (expand-file-name "emacs" html-node-dir))
+ (manual-html-mono texi (expand-file-name "emacs.html" html-mono-dir))
+ (manual-txt texi (expand-file-name "emacs.txt" txt-dir))
+ (manual-pdf texi (expand-file-name "emacs.pdf" dest))
+ (manual-dvi texi (expand-file-name "emacs.dvi" dvi-dir)
+ (expand-file-name "emacs.ps" ps-dir)))
+ ;; Lisp manual
+ (let ((texi (expand-file-name "doc/lispref/elisp.texi" root)))
+ (manual-html-node texi (expand-file-name "elisp" html-node-dir))
+ (manual-html-mono texi (expand-file-name "elisp.html" html-mono-dir))
+ (manual-txt texi (expand-file-name "elisp.txt" txt-dir))
+ (manual-pdf texi (expand-file-name "elisp.pdf" dest))
+ (manual-dvi texi (expand-file-name "elisp.dvi" dvi-dir)
+ (expand-file-name "elisp.ps" ps-dir)))
+ (message "Manuals created in %s" dest)))
+
+(defconst manual-doctype-string
+ "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
+\"http://www.w3.org/TR/html4/loose.dtd\">\n\n")
+
+(defconst manual-meta-string
+ "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
+<link rev=\"made\" href=\"mailto:webmasters@gnu.org\">
+<link rel=\"icon\" type=\"image/png\" href=\"/graphics/gnu-head-mini.png\">
+<meta name=\"ICBM\" content=\"42.256233,-71.006581\">
+<meta name=\"DC.title\" content=\"gnu.org\">\n\n")
+
+(defconst manual-style-string "<style type=\"text/css\">
+@import url('/style.css');\n</style>\n")
+
+(defun manual-html-mono (texi-file dest)
+ "Run Makeinfo on TEXI-FILE, emitting mono HTML output to DEST.
+This function also edits the HTML files so that they validate as
+HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
+the @import directive."
+ (call-process "makeinfo" nil nil nil
+ "--html" "--no-split" texi-file "-o" dest)
+ (with-temp-buffer
+ (insert-file-contents dest)
+ (setq buffer-file-name dest)
+ (manual-html-fix-headers)
+ (manual-html-fix-index-1)
+ (manual-html-fix-index-2 t)
+ (manual-html-fix-node-div)
+ (goto-char (point-max))
+ (re-search-backward "</body>[\n \t]*</html>")
+ (insert "</div>\n\n")
+ (save-buffer)))
+
+(defun manual-html-node (texi-file dir)
+ "Run Makeinfo on TEXI-FILE, emitting per-node HTML output to DIR.
+This function also edits the HTML files so that they validate as
+HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
+the @import directive."
+ (unless (file-exists-p texi-file)
+ (error "Manual file %s not found" texi-file))
+ (call-process "makeinfo" nil nil nil
+ "--html" texi-file "-o" dir)
+ ;; Loop through the node files, fixing them up.
+ (dolist (f (directory-files dir nil "\\.html\\'"))
+ (let (opoint)
+ (with-temp-buffer
+ (insert-file-contents (expand-file-name f dir))
+ (setq buffer-file-name (expand-file-name f dir))
+ (if (looking-at "<meta http-equiv")
+ ;; Ignore those HTML files that are just redirects.
+ (set-buffer-modified-p nil)
+ (manual-html-fix-headers)
+ (if (equal f "index.html")
+ (let (copyright-text)
+ (manual-html-fix-index-1)
+ ;; Move copyright notice to the end.
+ (re-search-forward "[ \t]*<p>Copyright &copy;")
+ (setq opoint (match-beginning 0))
+ (re-search-forward "</blockquote>")
+ (setq copyright-text (buffer-substring opoint (point)))
+ (delete-region opoint (point))
+ (manual-html-fix-index-2)
+ (insert copyright-text "\n</div>\n"))
+ ;; For normal nodes, give the header div a blue bg.
+ (manual-html-fix-node-div))
+ (save-buffer))))))
+
+(defun manual-txt (texi-file dest)
+ "Run Makeinfo on TEXI-FILE, emitting plaintext output to DEST."
+ (call-process "makeinfo" nil nil nil
+ "--plaintext" "--no-split" texi-file "-o" dest)
+ (shell-command (concat "gzip -c " dest " > " (concat dest ".gz"))))
+
+(defun manual-pdf (texi-file dest)
+ "Run texi2pdf on TEXI-FILE, emitting plaintext output to DEST."
+ (call-process "texi2pdf" nil nil nil texi-file "-o" dest))
+
+(defun manual-dvi (texi-file dest ps-dest)
+ "Run texi2dvi on TEXI-FILE, emitting dvi output to DEST.
+Also generate postscript output in PS-DEST."
+ (call-process "texi2dvi" nil nil nil texi-file "-o" dest)
+ (call-process "dvips" nil nil nil dest "-o" ps-dest)
+ (call-process "gzip" nil nil nil dest)
+ (call-process "gzip" nil nil nil ps-dest))
+
+(defun manual-html-fix-headers ()
+ "Fix up HTML headers for the Emacs manual in the current buffer."
+ (let (opoint)
+ (insert manual-doctype-string)
+ (search-forward "<head>\n")
+ (insert manual-meta-string)
+ (search-forward "<meta")
+ (setq opoint (match-beginning 0))
+ (re-search-forward "<!--")
+ (goto-char (match-beginning 0))
+ (delete-region opoint (point))
+ (insert manual-style-string)
+ (search-forward "<meta http-equiv=\"Content-Style")
+ (setq opoint (match-beginning 0))
+ (search-forward "</head>")
+ (delete-region opoint (match-beginning 0))))
+
+(defun manual-html-fix-node-div ()
+ "Fix up HTML \"node\" divs in the current buffer."
+ (let (opoint div-end)
+ (while (search-forward "<div class=\"node\">" nil t)
+ (replace-match
+ "<div class=\"node\" style=\"background-color:#DDDDFF\">"
+ t t)
+ (setq opoint (point))
+ (re-search-forward "</div>")
+ (setq div-end (match-beginning 0))
+ (goto-char opoint)
+ (if (search-forward "<hr>" div-end 'move)
+ (replace-match "" t t)))))
+
+(defun manual-html-fix-index-1 ()
+ (let (opoint)
+ (re-search-forward "<body>\n\\(<h1 class=\"settitle\\)")
+ (setq opoint (match-beginning 1))
+ (search-forward "<h2 class=\"unnumbered")
+ (goto-char (match-beginning 0))
+ (delete-region opoint (point))
+ (insert "<div id=\"content\" class=\"inner\">\n\n")))
+
+(defun manual-html-fix-index-2 (&optional table-workaround)
+ "Replace the index list in the current buffer with a HTML table."
+ (let (done open-td tag desc)
+ ;; Convert the list that Makeinfo made into a table.
+ (search-forward "<ul class=\"menu\">")
+ (replace-match "<table style=\"float:left\" width=\"100%\">")
+ (forward-line 1)
+ (while (not done)
+ (cond
+ ((or (looking-at "<li>\\(<a.+</a>\\):[ \t]+\\(.*\\)$")
+ (looking-at "<li>\\(<a.+</a>\\)$"))
+ (setq tag (match-string 1))
+ (setq desc (match-string 2))
+ (replace-match "" t t)
+ (when open-td
+ (save-excursion
+ (forward-char -1)
+ (skip-chars-backward " ")
+ (delete-region (point) (line-end-position))
+ (insert "</td>\n </tr>")))
+ (insert " <tr>\n ")
+ (if table-workaround
+ ;; This works around a Firefox bug in the mono file.
+ (insert "<td bgcolor=\"white\">")
+ (insert "<td>"))
+ (insert tag "</td>\n <td>" (or desc ""))
+ (setq open-td t))
+ ((eq (char-after) ?\n)
+ (delete-char 1)
+ ;; Negate the following `forward-line'.
+ (forward-line -1))
+ ((looking-at "<!-- ")
+ (search-forward "-->"))
+ ((looking-at "<p>[- ]*The Detailed Node Listing[- \n]*")
+ (replace-match " </td></tr></table>\n
+<h3>Detailed Node Listing</h3>\n\n" t t)
+ (search-forward "<p>")
+ (search-forward "<p>")
+ (goto-char (match-beginning 0))
+ (skip-chars-backward "\n ")
+ (setq open-td nil)
+ (insert "</p>\n\n<table style=\"float:left\" width=\"100%\">"))
+ ((looking-at "</li></ul>")
+ (replace-match "" t t))
+ ((looking-at "<p>")
+ (replace-match "" t t)
+ (when open-td
+ (insert " </td></tr>")
+ (setq open-td nil))
+ (insert " <tr>
+ <th colspan=\"2\" align=\"left\" style=\"text-align:left\">")
+ (re-search-forward "</p>[ \t\n]*<ul class=\"menu\">")
+ (replace-match " </th></tr>"))
+ ((looking-at "[ \t]*</ul>[ \t]*$")
+ (replace-match
+ (if open-td
+ " </td></tr>\n</table>"
+ "</table>") t t)
+ (setq done t))
+ (t
+ (if (eobp)
+ (error "Parse error in %s" f))
+ (unless open-td
+ (setq done t))))
+ (forward-line 1))))
+
(provide 'admin)
;;; admin.el ends here
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 6a8072de06..9c47d6e1fa 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -28,11 +28,14 @@ For each step, check for possible errors.
refer to a newer release of Emacs. (This is probably needed only
when preparing a major Emacs release, or branching for it.)
-5. autoreconf -I m4 --force
+5. Edit configure.in so that maintainer-mode is off by default.
+ (FIXME - need to find a better way of dealing with this).
+
+ autoreconf -I m4 --force
make bootstrap
-6. Commit configure, src/config.in, etc/AUTHORS, all the files changed
- by M-x set-version, and lisp/cus-edit.el (if modified).
+6. Commit etc/AUTHORS, all the files changed by M-x set-version, and
+ lisp/cus-edit.el (if modified).
Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit lisp/ldefs-boot.el.
For a release, also commit the ChangeLog files in all directories.
diff --git a/admin/notes/BRANCH b/admin/notes/BRANCH
index 53f3d9603c..9f09135f20 100644
--- a/admin/notes/BRANCH
+++ b/admin/notes/BRANCH
@@ -23,3 +23,10 @@ on what branch at any time.
If you are looking at this file in a branch other than the trunk,
there may be some branch-specific documentation below this line.
________________________________________________________________________
+
+* elpa
+
+ This branch does not contain a copy of Emacs, but of the Emacs Lisp
+ package archive (elpa.gnu.org). See admin/notes/elpa for further
+ explanation, and the README file in the branch for usage
+ instructions.
diff --git a/admin/notes/elpa b/admin/notes/elpa
index e28d81e6d6..db14456fe3 100644
--- a/admin/notes/elpa
+++ b/admin/notes/elpa
@@ -1,42 +1,24 @@
NOTES ON THE EMACS PACKAGE ARCHIVE
-Here are instructions on uploading files to the package archive at
-elpa.gnu.org, for Emacs maintainers. (If you are not a maintainer,
-contact us if you want to submit a package.)
-
-1. You will need login access to elpa.gnu.org. You will also need to
- get the FSF sysadmins to allow ssh access through the FSF firewall
- for your local machine. Ensure that your uid, USER, is in the
- `elpa' group on elpa.gnu.org; this gives you write access to the
- bzr repository from which the packages are managed.
-
-2. Go to your bzr repository on your local machine. Of, if you don't
- have one (you should, if you're tracking Emacs bzr), make one:
-
- cd $DEVHOME
- bzr init-repo elpa/
- cd elpa
-
- Create a branch for elpa:
-
- bzr branch bzr+ssh://USER@elpa.gnu.org/home/elpa/package-repo package-repo
-
- Bind the branch:
-
- cd package-repo/
- echo "public_branch = bzr+ssh://USER@elpa.gnu.org/home/elpa/package-repo" >> .bzr/branch/branch.conf
- bzr bind bzr+ssh://USER@elpa.gnu.org/home/elpa/package-repo
-
- Now you should be able to do `bzr up' and `bzr commit'.
-
-3. Changes in bzr do not immediately propagate to the user-facing tree
- (i.e., what users see when they do `M-x list-packages'). That tree
- is created by a (daily) cron job that does "bzr export". If for
- some reason you need to refresh the user-facing tree immediately,
- run /home/elpa/bin/package-update.sh as the "elpa" user.
-
- The Org mode dailies are not part of the repository. After the
- package-update.sh script creates the user-facing tree, it copies
- the daily tarfile hosted on orgmode.org directly into that tree.
-
-4. FIXME: How to actually upload a package file.
+The GNU Emacs package archive, at elpa.gnu.org, is managed using a Bzr
+branch named "elpa", hosted on Savannah. To check it out:
+
+ bzr branch bzr+ssh://USER@bzr.savannah.gnu.org/emacs/elpa elpa
+ cd elpa
+ echo "public_branch = bzr+ssh://USER@bzr.savannah.gnu.org/emacs/elpa" >> .bzr/branch/branch.conf
+ bzr bind bzr+ssh://USERNAME@bzr.savannah.gnu.org/emacs/elpa
+ [create task branch for edits, etc.]
+
+Changes to this branch propagate to elpa.gnu.org in a semi-manual way.
+There exists a copy of the elpa branch on that machine. Someone with
+access logs in, pulls the latest changes from Savannah, and runs a
+"deployment" script. This script (which is itself kept in the Bzr
+branch) generates the content visible at http://elpa.gnu.org/packages.
+
+The reason we set things up this way, instead of using the package
+upload commands in package-x.el, is to let Emacs hackers conveniently
+edit the contents of the "elpa" branch. (In particular, multi-file
+packages are stored on the branch in source form, not as tarfiles.)
+
+It is easy to use the elpa branch to deploy a "local" copy of the
+package archive. For details, see the README file in the elpa branch.
diff --git a/autogen.sh b/autogen.sh
index 52184c46f5..a56b8d7782 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,7 +1,207 @@
#!/bin/sh
+### autogen.sh - tool to help build Emacs from a bzr checkout
-echo "Please read INSTALL.BZR for instructions on how to build Emacs from Bazaar."
+## Copyright (C) 2011 Free Software Foundation, Inc.
-# Exit with failure, since people may have generic build scripts that
-# try things like "autogen.sh && ./configure && make".
-exit 1
+## Author: Glenn Morris <rgm@gnu.org>
+
+## This file is part of GNU Emacs.
+
+## GNU Emacs is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+
+## GNU Emacs is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+### Commentary:
+
+## The Emacs bzr repository does not include the configure script
+## (and associated helpers). The first time you fetch Emacs from bzr,
+## run this script to generate the necessary files.
+## For more details, see the file INSTALL.BZR.
+
+### Code:
+
+## Tools we need:
+progs="autoconf automake"
+
+## Minimum versions we need:
+autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.in`
+
+## FIXME how to determine this from the sources?
+automake_min=1.11
+
+
+## $1 = program, eg "autoconf".
+## Echo the version string, eg "2.59".
+## FIXME does not handle things like "1.4a", but AFAIK those are
+## all old versions, so it is OK to fail there.
+## Also note that we do not handle micro versions.
+get_version ()
+{
+ $1 --version 2>&1 | sed -n '1 s/.* \([1-9][0-9\.]*\).*/\1/p'
+}
+
+## $1 = version string, eg "2.59"
+## Echo the major version, eg "2".
+major_version ()
+{
+ echo $1 | sed -e 's/\([0-9][0-9]*\)\..*/\1/'
+}
+
+## $1 = version string, eg "2.59"
+## Echo the minor version, eg "59".
+minor_version ()
+{
+ echo $1 | sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/'
+}
+
+## $1 = program
+## $2 = minimum version.
+## Return 0 if program is present with version >= minumum version.
+## Return 1 if program is missing.
+## Return 2 if program is present but too old.
+## Return 3 for unexpected error (eg failed to parse version).
+check_version ()
+{
+ have_version=`get_version $1`
+
+ [ x"$have_version" = x ] && return 1
+
+ have_maj=`major_version $have_version`
+ need_maj=`major_version $2`
+
+ [ x"$have_maj" != x ] && [ x"$need_maj" != x ] || return 3
+
+ [ $have_maj -gt $need_maj ] && return 0
+ [ $have_maj -lt $need_maj ] && return 2
+
+ have_min=`minor_version $have_version`
+ need_min=`minor_version $2`
+
+ [ x"$have_min" != x ] && [ x"$need_min" != x ] || return 3
+
+ [ $have_min -ge $need_min ] && return 0
+ return 2
+}
+
+
+cat <<EOF
+Checking whether you have the necessary tools...
+(Read INSTALL.BZR for more details on building Emacs)
+
+EOF
+
+missing=
+
+for prog in $progs; do
+
+ eval min=\$${prog}_min
+
+ echo "Checking for $prog (need at least version $min)..."
+
+ check_version $prog $min
+
+ retval=$?
+
+ case $retval in
+ 0) stat="ok" ;;
+ 1) stat="missing" ;;
+ 2) stat="too old" ;;
+ *) stat="unable to check" ;;
+ esac
+
+ echo $stat
+
+ if [ $retval -ne 0 ]; then
+ missing="$missing $prog"
+ eval ${prog}_why=\""$stat"\"
+ fi
+
+done
+
+
+if [ x"$missing" != x ]; then
+
+ cat <<EOF
+
+Building Emacs from Bzr requires the following specialized programs:
+EOF
+
+ for prog in $progs; do
+ eval min=\$${prog}_min
+
+ echo "$prog (minimum version $min)"
+ done
+
+
+ cat <<EOF
+
+Your system seems to be missing the following tool(s):
+EOF
+
+ for prog in $missing; do
+ eval why=\$${prog}_why
+
+ echo "$prog ($why)"
+ done
+
+ cat <<EOF
+
+If you think you have the required tools, please add them to your PATH
+and re-run this script.
+
+Otherwise, please try installing them.
+On systems using rpm and yum, try: "yum install PACKAGE"
+On systems using dpkg and apt, try: "apt-get install PACKAGE"
+Then re-run this script.
+
+If you do not have permission to do this, or if the version provided
+by your system is too old, it is normally straightforward to build
+these packages from source. You can find the sources at:
+
+ftp://ftp.gnu.org/gnu/PACKAGE/
+
+Download the package (make sure you get at least the minimum version
+listed above), extract it using tar, then run configure, make,
+make install. Add the installation directory to your PATH and re-run
+this script.
+
+If you know that the required versions are in your PATH, but this
+script has made an error, then you can simply run
+
+autoreconf -I m4
+
+instead of this script.
+
+If all else fails, you can try using the pre-built versions of the
+generated files by doing:
+
+cd autogen && ./copy_autogen
+
+This is not recommended - see the comments in \`copy_autogen'.
+
+Please report any problems with this script to bug-gnu-emacs@gnu.org .
+EOF
+
+ exit 1
+fi
+
+echo "Your system has the required tools, running autoreconf..."
+
+
+## Let autoreconf figure out what, if anything, needs doing.
+autoreconf -I m4 || exit $?
+
+echo "You can now run \`./configure'."
+
+exit 0
+
+### autogen.sh ends here
diff --git a/lib/Makefile.in b/autogen/Makefile.in
index 04ee541a09..502b3dbb92 100644
--- a/lib/Makefile.in
+++ b/autogen/Makefile.in
@@ -24,7 +24,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value lstat mktime readlink strftime symlink sys_stat
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink strftime symlink sys_stat
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
diff --git a/autogen/README b/autogen/README
new file mode 100644
index 0000000000..a16dc93c48
--- /dev/null
+++ b/autogen/README
@@ -0,0 +1,14 @@
+This directory contains some pre-built generated files.
+Most people do not need to use these files - instead you should
+generate them yourself using eg `autogen.sh'.
+
+File: Destination: Created by:
+configure ../ autoconf
+config.in ../src autoheader * also used by MSDOS bzr build
+aclocal.m4 ../ aclocal
+Makefile.in ../lib automake
+
+There are also some scripts:
+
+copy_autogen - copy pre-built generated files into place
+update_autogen - regenerate generated files (for maintainers)
diff --git a/aclocal.m4 b/autogen/aclocal.m4
index 9fdc8e76c4..963faafb45 100644
--- a/aclocal.m4
+++ b/autogen/aclocal.m4
@@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
-[m4_warning([this file was generated for autoconf 2.67.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
diff --git a/src/config.in b/autogen/config.in
index 7f33727c0b..8889213b78 100644
--- a/src/config.in
+++ b/autogen/config.in
@@ -285,6 +285,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `grantpt' function. */
#undef HAVE_GRANTPT
+/* Define to 1 if using GTK 3 or later. */
+#undef HAVE_GTK3
+
/* Define to 1 if you have the `gtk_adjustment_get_page_size' function. */
#undef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
diff --git a/configure b/autogen/configure
index b8a83e6677..4c45db1bad 100755
--- a/configure
+++ b/autogen/configure
@@ -1,11 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for emacs 24.0.50.
+# Generated by GNU Autoconf 2.65 for emacs 24.0.50.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -316,7 +316,7 @@ $as_echo X"$as_dir" |
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -356,19 +356,19 @@ else
fi # as_fn_arith
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
+# script with status $?, using 1 if that was 0.
as_fn_error ()
{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
fi
- $as_echo "$as_me: error: $2" >&2
+ $as_echo "$as_me: error: $1" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -530,7 +530,7 @@ test -n "$DJDIR" || exec 7<&0 </dev/null
exec 6>&1
# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
@@ -1220,9 +1220,8 @@ do
fi
case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
@@ -1267,7 +1266,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1293,7 +1292,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
+ as_fn_error "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1497,7 +1496,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1513,7 +1512,7 @@ do
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
+ as_fn_error "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
@@ -1543,8 +1542,8 @@ do
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
+ -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
;;
*=*)
@@ -1552,7 +1551,7 @@ Try \`$0 --help' for more information"
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ as_fn_error "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
@@ -1570,13 +1569,13 @@ done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
+ as_fn_error "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
@@ -1599,7 +1598,7 @@ do
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1613,8 +1612,8 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1629,9 +1628,9 @@ test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
+ as_fn_error "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
+ as_fn_error "pwd does not report name of working directory"
# Find the source files, if location was not specified.
@@ -1670,11 +1669,11 @@ else
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1714,7 +1713,7 @@ Configuration:
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
+ -q, --quiet, --silent do not print \`checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
@@ -1936,9 +1935,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
emacs configure 24.0.50
-generated by GNU Autoconf 2.67
+generated by GNU Autoconf 2.65
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -2008,7 +2007,7 @@ $as_echo "$ac_try_echo"; } >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
+ test $ac_status = 0; } >/dev/null && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then :
@@ -2032,10 +2031,10 @@ fi
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval "test \"\${$3+set}\"" = set; then :
+ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
@@ -2071,7 +2070,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
else
ac_header_preproc=no
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
@@ -2098,7 +2097,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
@@ -2162,7 +2161,7 @@ ac_fn_c_check_header_compile ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2230,18 +2229,15 @@ fi
} # ac_fn_c_try_link
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
-# ---------------------------------------------
-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly.
+# ac_fn_c_check_decl LINENO SYMBOL VAR
+# ------------------------------------
+# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
ac_fn_c_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- as_decl_name=`echo $2|sed 's/ *(.*//'`
- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
-$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
+$as_echo_n "checking whether $2 is declared... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2250,12 +2246,8 @@ $4
int
main ()
{
-#ifndef $as_decl_name
-#ifdef __cplusplus
- (void) $as_decl_use;
-#else
- (void) $as_decl_name;
-#endif
+#ifndef $2
+ (void) $2;
#endif
;
@@ -2284,7 +2276,7 @@ ac_fn_c_check_header_preproc ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2296,7 +2288,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
else
eval "$3=no"
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
@@ -2314,7 +2306,7 @@ ac_fn_c_check_member ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
$as_echo_n "checking for $2.$3... " >&6; }
-if eval "test \"\${$4+set}\"" = set; then :
+if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2370,7 +2362,7 @@ ac_fn_c_check_func ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2438,7 +2430,7 @@ ac_fn_c_check_type ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
@@ -2665,7 +2657,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by emacs $as_me 24.0.50, which was
-generated by GNU Autoconf 2.67. Invocation command line was
+generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@@ -2775,9 +2767,11 @@ trap 'exit_status=$?
{
echo
- $as_echo "## ---------------- ##
+ cat <<\_ASBOX
+## ---------------- ##
## Cache variables. ##
-## ---------------- ##"
+## ---------------- ##
+_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
(
@@ -2811,9 +2805,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
)
echo
- $as_echo "## ----------------- ##
+ cat <<\_ASBOX
+## ----------------- ##
## Output variables. ##
-## ----------------- ##"
+## ----------------- ##
+_ASBOX
echo
for ac_var in $ac_subst_vars
do
@@ -2826,9 +2822,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
echo
if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
+ cat <<\_ASBOX
+## ------------------- ##
## File substitutions. ##
-## ------------------- ##"
+## ------------------- ##
+_ASBOX
echo
for ac_var in $ac_subst_files
do
@@ -2842,9 +2840,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
fi
if test -s confdefs.h; then
- $as_echo "## ----------- ##
+ cat <<\_ASBOX
+## ----------- ##
## confdefs.h. ##
-## ----------- ##"
+## ----------- ##
+_ASBOX
echo
cat confdefs.h
echo
@@ -2899,12 +2899,7 @@ _ACEOF
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
+ ac_site_file1=$CONFIG_SITE
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
@@ -2919,11 +2914,7 @@ do
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+ . "$ac_site_file"
fi
done
@@ -3014,7 +3005,7 @@ if $ac_cache_corrupted; then
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
@@ -3034,22 +3025,16 @@ am__api_version='1.11'
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
+ for ac_t in install-sh install.sh shtool; do
+ if test -f "$ac_dir/$ac_t"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/$ac_t -c"
+ break 2
+ fi
+ done
done
if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
@@ -3165,11 +3150,11 @@ am_lf='
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
+ as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
+ as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
esac
# Do `set' in a subshell so we don't clobber the current shell's
@@ -3191,7 +3176,7 @@ if (
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ as_fn_error "ls -t appears to fail. Make sure there is not a broken
alias in your environment" "$LINENO" 5
fi
@@ -3201,7 +3186,7 @@ then
# Ok.
:
else
- as_fn_error $? "newly created file is older than distributed files!
+ as_fn_error "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -3440,7 +3425,7 @@ done
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
@@ -3448,7 +3433,7 @@ SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -3482,7 +3467,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then
am__isrc=' -I$(srcdir)'
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
fi
fi
@@ -3685,7 +3670,7 @@ if test "${with_x_toolkit+set}" = set; then :
g | gt | gtk ) val=gtk ;;
gtk3 ) val=gtk3 ;;
* )
-as_fn_error $? "\`--with-x-toolkit=$withval' is invalid;
+as_fn_error "\`--with-x-toolkit=$withval' is invalid;
this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or
\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
;;
@@ -3949,7 +3934,7 @@ fi
if test "${enable_maintainer_mode+set}" = set; then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
- USE_MAINTAINER_MODE=no
+ USE_MAINTAINER_MODE=yes
fi
if test $USE_MAINTAINER_MODE = yes; then
@@ -3998,7 +3983,7 @@ do
stringfreelist) ac_gc_check_string_free_list=1 ;;
xmallocoverrun) ac_xmalloc_overrun=1 ;;
conslist) ac_gc_check_cons_list=1 ;;
- *) as_fn_error $? "unknown check category $check" "$LINENO" 5 ;;
+ *) as_fn_error "unknown check category $check" "$LINENO" 5 ;;
esac
done
IFS="$ac_save_IFS"
@@ -4113,7 +4098,7 @@ fi
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+ as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
@@ -4124,16 +4109,16 @@ else
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
@@ -4158,7 +4143,7 @@ else
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+ as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
@@ -4166,7 +4151,7 @@ fi
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
@@ -4420,7 +4405,7 @@ fi
if test $unported = yes; then
- as_fn_error $? "Emacs hasn't been ported to \`${canonical}' systems.
+ as_fn_error "Emacs hasn't been ported to \`${canonical}' systems.
Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5
fi
@@ -4738,8 +4723,8 @@ fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4853,8 +4838,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -4896,8 +4882,8 @@ done
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -4954,9 +4940,9 @@ $as_echo "$ac_try_echo"; } >&5
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
+as_fn_error "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details." "$LINENO" 5; }
fi
fi
fi
@@ -5007,8 +4993,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
@@ -5426,7 +5412,7 @@ $as_echo_n "checking whether cc understands -c and -o together... " >&6; }
fi
set dummy $CC; ac_cc=`$as_echo "$2" |
sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then :
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5680,7 +5666,7 @@ else
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
@@ -5696,11 +5682,11 @@ else
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
break
fi
@@ -5739,7 +5725,7 @@ else
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
@@ -5755,18 +5741,18 @@ else
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
fi
ac_ext=c
@@ -5827,7 +5813,7 @@ esac
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
@@ -5893,7 +5879,7 @@ esac
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
@@ -6025,7 +6011,8 @@ do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -6356,7 +6343,7 @@ else
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
@@ -6372,11 +6359,11 @@ else
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
break
fi
@@ -6415,7 +6402,7 @@ else
# Broken: fails on valid input.
continue
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
@@ -6431,18 +6418,18 @@ else
ac_preproc_ok=:
break
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
fi
ac_ext=c
@@ -6790,7 +6777,7 @@ if test "$MAKEINFO" = "no"; then
if test "x${with_makeinfo}" = "xno"; then
HAVE_MAKEINFO=no
elif test ! -e $srcdir/info/emacs; then
- as_fn_error $? "You do not seem to have makeinfo >= 4.6, and your
+ as_fn_error "You do not seem to have makeinfo >= 4.6, and your
source tree does not seem to have pre-built manuals in the \`info' directory.
Either install a suitable version of makeinfo, or re-run configure
with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5
@@ -6951,7 +6938,7 @@ fi
if test "x$GCC" = "xyes"; then
C_SWITCH_MACHINE="-fno-common"
else
- as_fn_error $? "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5
+ as_fn_error "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5
fi
else
UNEXEC_OBJ=unexalpha.o
@@ -7227,7 +7214,7 @@ else
## Some platforms don't use any of these files, so it is not
## appropriate to put this test outside the if block.
test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \
- as_fn_error $? "crt*.o not found in specified location." "$LINENO" 5
+ as_fn_error "crt*.o not found in specified location." "$LINENO" 5
fi
@@ -7282,7 +7269,8 @@ if test "${with_sound}" != "no"; then
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -7473,7 +7461,7 @@ else
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$emacs_alsa_subdir" != yes; then
- as_fn_error $? "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5
+ as_fn_error "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5
fi
ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
fi
@@ -7508,7 +7496,8 @@ for ac_header in sys/select.h sys/time.h unistd.h utime.h \
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -8563,8 +8552,8 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
;; #(
*)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ as_fn_error "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
esac
@@ -8603,7 +8592,7 @@ fi
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
@@ -8611,7 +8600,7 @@ SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -8747,7 +8736,7 @@ if test "x$with_x" = xno; then
have_x=disabled
else
case $x_includes,$x_libraries in #(
- *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #(
+ *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #(
*,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
$as_echo_n "(cached) " >&6
else
@@ -8765,7 +8754,7 @@ libdir:
@echo libdir='${LIBDIR}'
_ACEOF
if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
- # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
for ac_var in incroot usrlibdir libdir; do
eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
done
@@ -8851,7 +8840,7 @@ else
fi
done
fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
fi # $ac_x_includes = no
if test "$ac_x_libraries" = no; then
@@ -9034,7 +9023,7 @@ if test "${with_ns}" != no; then
if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then :
HAVE_NS=yes
else
- as_fn_error $? "\`--with-ns' was specified, but the include
+ as_fn_error "\`--with-ns' was specified, but the include
files are missing or cannot be compiled." "$LINENO" 5
fi
@@ -9153,7 +9142,7 @@ fi
if test "$HAVE_XSERVER" = true ||
test -n "$DISPLAY" ||
test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
- as_fn_error $? "You seem to be running X, but no X development libraries
+ as_fn_error "You seem to be running X, but no X development libraries
were found. You should install the relevant development files for X
and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make
sure you have development files for image handling, i.e.
@@ -9276,7 +9265,8 @@ do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -9783,7 +9773,8 @@ XScreenNumberOfScreen XSetWMProtocols
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -10086,8 +10077,8 @@ fi
HAVE_GTK=no
if test "${with_gtk3}" = "yes"; then
- GLIB_REQUIRED=2.6
- GTK_REQUIRED=2.90
+ GLIB_REQUIRED=2.28
+ GTK_REQUIRED=3.0
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
@@ -10185,8 +10176,11 @@ $as_echo "no" >&6; }
fi
if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
- as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5
+ as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
fi
+
+$as_echo "#define HAVE_GTK3 1" >>confdefs.h
+
fi
if test "$pkg_check_gtk" != "yes"; then
@@ -10291,7 +10285,7 @@ $as_echo "no" >&6; }
fi
if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
- as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5
+ as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5
fi
fi
fi
@@ -10318,7 +10312,7 @@ done
if test "${GTK_COMPILES}" != "yes"; then
if test "$USE_X_TOOLKIT" != "maybe"; then
- as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5 ;
+ as_fn_error "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5;
fi
else
HAVE_GTK=yes
@@ -10448,7 +10442,8 @@ $as_echo "#define HAVE_GTK_AND_PTHREAD 1" >>confdefs.h
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -10970,7 +10965,7 @@ $as_echo "yes; using Lucid toolkit" >&6; }
USE_X_TOOLKIT=LUCID
LUCID_LIBW=-lXaw
elif test x"${USE_X_TOOLKIT}" = xLUCID; then
- as_fn_error $? "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
+ as_fn_error "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5
$as_echo "no; do not use toolkit by default" >&6; }
@@ -11778,7 +11773,7 @@ $as_echo "no" >&6; }
fi
- test "$HAVE_FREETYPE" = "no" && as_fn_error $? "libxft requires libfreetype" "$LINENO" 5
+ test "$HAVE_FREETYPE" = "no" && as_fn_error "libxft requires libfreetype" "$LINENO" 5
fi
HAVE_LIBOTF=no
@@ -12237,7 +12232,8 @@ if test "${HAVE_X11}" = "yes"; then
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -12489,7 +12485,7 @@ if test "${HAVE_X11}" = "yes"; then
MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
if test "X${MISSING}" != X; then
- as_fn_error $? "The following required libraries were not found:
+ as_fn_error "The following required libraries were not found:
$MISSING
Maybe some development libraries/packages are missing?
If you don't want to link with them give
@@ -12978,7 +12974,8 @@ if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
@@ -13042,7 +13039,7 @@ fi
if test x"$ac_cv_func_alloca_works" != xyes; then
- as_fn_error $? "a system implementation of alloca is required " "$LINENO" 5
+ as_fn_error "a system implementation of alloca is required " "$LINENO" 5
fi
# fmod, logb, and frexp are found in -lm on most systems.
@@ -13238,7 +13235,7 @@ fi
if test $ac_cv_prog_liblockfile = yes; then
- as_fn_error $? "Shared liblockfile found but can't link against it.
+ as_fn_error "Shared liblockfile found but can't link against it.
This probably means that movemail could lose mail.
There may be a \`development' package to install containing liblockfile." "$LINENO" 5
fi
@@ -13327,7 +13324,8 @@ cfmakeraw cfsetspeed isnan copysign __executable_start
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -13719,8 +13717,8 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
;; #(
*)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ as_fn_error "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
esac
@@ -14621,7 +14619,8 @@ fi
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -15353,7 +15352,7 @@ fi
# Make sure getloadavg.c is where it belongs, at configure-time.
test -f "$srcdir/$gl_source_base/getloadavg.c" ||
- as_fn_error $? "$srcdir/$gl_source_base/getloadavg.c is missing" "$LINENO" 5
+ as_fn_error "$srcdir/$gl_source_base/getloadavg.c is missing" "$LINENO" 5
gl_save_LIBS=$LIBS
@@ -16951,7 +16950,8 @@ $as_echo "$gl_cv_header_working_stdint_h" >&6; }
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
@@ -16981,7 +16981,7 @@ done
for gltype in ptrdiff_t size_t ; do
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
$as_echo_n "checking for bit size of $gltype... " >&6; }
-if eval "test \"\${gl_cv_bitsizeof_${gltype}+set}\"" = set; then :
+if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
@@ -17026,7 +17026,7 @@ _ACEOF
for gltype in sig_atomic_t wchar_t wint_t ; do
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
$as_echo_n "checking for bit size of $gltype... " >&6; }
-if eval "test \"\${gl_cv_bitsizeof_${gltype}+set}\"" = set; then :
+if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
@@ -17070,7 +17070,7 @@ _ACEOF
for gltype in sig_atomic_t wchar_t wint_t ; do
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
$as_echo_n "checking whether $gltype is signed... " >&6; }
-if eval "test \"\${gl_cv_type_${gltype}_signed+set}\"" = set; then :
+if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -17129,7 +17129,7 @@ _ACEOF
for gltype in ptrdiff_t size_t ; do
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if eval "test \"\${gl_cv_type_${gltype}_suffix+set}\"" = set; then :
+if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
eval gl_cv_type_${gltype}_suffix=no
@@ -17201,7 +17201,7 @@ _ACEOF
for gltype in sig_atomic_t wchar_t wint_t ; do
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if eval "test \"\${gl_cv_type_${gltype}_suffix+set}\"" = set; then :
+if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
$as_echo_n "(cached) " >&6
else
eval gl_cv_type_${gltype}_suffix=no
@@ -17811,7 +17811,7 @@ else
fi
if test "$have_tputs_et_al" != true; then
- as_fn_error $? "I couldn't find termcap functions (tputs and friends).
+ as_fn_error "I couldn't find termcap functions (tputs and friends).
Maybe some development libraries/packages are missing? Try installing
libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5
fi
@@ -18937,7 +18937,8 @@ for ac_func in fork vfork
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
@@ -19257,7 +19258,7 @@ if test "x$GCC" = xyes \
&& test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
&& test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
&& test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
- as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
+ as_fn_error "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
fi
version=$PACKAGE_VERSION
@@ -19833,7 +19834,6 @@ DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
-U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -19857,16 +19857,16 @@ else
fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
+ as_fn_error "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+ as_fn_error "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
- as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
+ as_fn_error "conditional \"GL_COND_LIBTOOL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
@@ -20049,19 +20049,19 @@ export LANGUAGE
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
+# script with status $?, using 1 if that was 0.
as_fn_error ()
{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ as_status=$?; test $as_status -eq 0 && as_status=1
+ if test "$3"; then
+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
fi
- $as_echo "$as_me: error: $2" >&2
+ $as_echo "$as_me: error: $1" >&2
as_fn_exit $as_status
} # as_fn_error
@@ -20257,7 +20257,7 @@ $as_echo X"$as_dir" |
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
} # as_fn_mkdir_p
@@ -20311,7 +20311,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by emacs $as_me 24.0.50, which was
-generated by GNU Autoconf 2.67. Invocation command line was
+generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -20377,10 +20377,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
emacs config.status 24.0.50
-configured by $0, generated by GNU Autoconf 2.67,
+configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -20398,16 +20398,11 @@ ac_need_defaults=:
while test $# != 0
do
case $1 in
- --*=?*)
+ --*=*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
*)
ac_option=$1
ac_optarg=$2
@@ -20429,7 +20424,6 @@ do
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
@@ -20442,7 +20436,7 @@ do
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
+ as_fn_error "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
@@ -20451,7 +20445,7 @@ Try \`$0 --help' for more information.";;
ac_cs_silent=: ;;
# This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
+ -*) as_fn_error "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
@@ -20525,7 +20519,7 @@ do
"epaths") CONFIG_COMMANDS="$CONFIG_COMMANDS epaths" ;;
"gdbinit") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbinit" ;;
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -20563,7 +20557,7 @@ $debug ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
@@ -20597,7 +20591,7 @@ if test "x$ac_cr" = x; then
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
+ ac_cs_awk_cr='\r'
else
ac_cs_awk_cr=$ac_cr
fi
@@ -20614,7 +20608,7 @@ _ACEOF
echo "_ACEOF"
} >conf$$files.sh &&
. ./conf$$files.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
rm -f conf$$files.sh
{
@@ -20622,18 +20616,18 @@ rm -f conf$$files.sh
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
@@ -20728,28 +20722,20 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
else
cat
fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+ || as_fn_error "could not setup config files machinery" "$LINENO" 5
_ACEOF
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
s/^[^=]*=[ ]*$//
}'
fi
@@ -20777,7 +20763,7 @@ for ac_last_try in false false :; do
if test -z "$ac_t"; then
break
elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
@@ -20862,7 +20848,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+ as_fn_error "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"
@@ -20875,7 +20861,7 @@ do
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+ :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -20903,7 +20889,7 @@ do
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+ as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
@@ -20930,7 +20916,7 @@ $as_echo "$as_me: creating $ac_file" >&6;}
case $ac_tag in
*:-:* | *:-) cat >"$tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -21072,22 +21058,22 @@ if $ac_cs_awk_getline; then
else
$AWK -f "$tmp/subs.awk" | $SHELL
fi >$tmp/out \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
+which seems to be undefined. Please make sure it is defined." >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
+which seems to be undefined. Please make sure it is defined." >&2;}
rm -f "$tmp/stdin"
case $ac_file in
-) cat "$tmp/out" && rm -f "$tmp/out";;
*) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
;;
:H)
#
@@ -21098,19 +21084,19 @@ which seems to be undefined. Please make sure it is defined" >&2;}
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
} >"$tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ || as_fn_error "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
+ || as_fn_error "could not create -" "$LINENO" 5
fi
# Compute "$ac_file"'s index in $config_headers.
_am_arg="$ac_file"
@@ -21275,7 +21261,7 @@ _ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
@@ -21296,7 +21282,7 @@ if test "$no_create" != yes; then
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
+ $ac_cs_success || as_fn_exit $?
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
diff --git a/autogen/copy_autogen b/autogen/copy_autogen
new file mode 100755
index 0000000000..4abdbd87c0
--- /dev/null
+++ b/autogen/copy_autogen
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+## Helper script for those building Emacs from bzr without autoconf etc.
+## This installs some pre-generated versions of the automatically
+## generated files. It is highly recommended to install the necessary
+## tools instead of using this. Note that if eg configure.in
+## is updated, the next time you run make it will attempt to
+## regenerate configure and will fail if you do not have the required
+## tools. You will have to run this script again.
+
+if test ! -e config.in; then
+ echo "You must run this script from the autogen/ directory."
+ exit 1
+fi
+
+cp configure aclocal.m4 ../
+cp config.in ../src/
+cp Makefile.in ../lib/
+
+echo "You can now run configure"
diff --git a/autogen/update_autogen b/autogen/update_autogen
new file mode 100755
index 0000000000..0b26dd27d2
--- /dev/null
+++ b/autogen/update_autogen
@@ -0,0 +1,183 @@
+#!/bin/bash
+### update_autogen - update the generated files in Emacs autogen/ directory
+
+## Copyright (C) 2011 Free Software Foundation, Inc.
+
+## Author: Glenn Morris <rgm@gnu.org>
+
+## This file is part of GNU Emacs.
+
+## GNU Emacs is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+
+## GNU Emacs is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+### Commentary:
+
+## This is a helper script to update the pre-built generated files in
+## the autogen/ directory. This is suitable for running from cron.
+## Only Emacs maintainers need use this, so it uses bash features.
+
+### Code:
+
+function die () # write error to stderr and exit
+{
+ [ $# -gt 0 ] && echo "$PN: $@" >&2
+ exit 1
+}
+
+PN=${0##*/} # basename of script
+PD=${0%/*}
+
+[ "$PD" = "$0" ] && PD=. # if PATH includes PWD
+
+## This should be the autogen directory.
+cd $PD
+cd ../
+[ -d autogen ] || die "Could not locate autogen directory"
+
+
+function usage ()
+{
+ cat 1>&2 <<EOF
+Usage: ${PN} [-f] [-c] [-q]
+Update the generated files in the Emacs autogen/ directory.
+Options:
+-f: force an update even if the source files are locally modified.
+-c: if the update succeeds and the generated files are modified,
+ commit them (caution).
+-q: be quiet; only give error messages, not status messages.
+EOF
+ exit 1
+}
+
+
+## Defaults.
+
+force=
+commit=
+quiet=
+
+## Parameters.
+sources="configure.in lib/Makefile.am"
+genfiles="configure aclocal.m4 src/config.in lib/Makefile.in"
+
+for g in $genfiles; do
+ basegen="$basegen ${g##*/}"
+done
+
+[ "$basegen" ] || die "internal error"
+
+tempfile=/tmp/$PN.$$
+
+trap "rm -f $tempfile 2> /dev/null" EXIT
+
+
+while getopts ":hcfq" option ; do
+ case $option in
+ (h) usage ;;
+
+ (c) commit=1 ;;
+
+ (f) force=1 ;;
+
+ (q) quiet=1 ;;
+
+ (\?) die "Bad option -$OPTARG" ;;
+
+ (:) die "Option -$OPTARG requires an argument" ;;
+
+ (*) die "getopts error" ;;
+ esac
+done
+shift $(( --OPTIND ))
+OPTIND=1
+
+[ $# -eq 0 ] || die "Wrong number of arguments"
+
+
+function msg ()
+{
+ [ "$quiet" ] && return 0
+ echo "$@"
+} # function msg
+
+
+msg "Running bzr status..."
+
+bzr status -S $sources >| $tempfile || die "bzr status error for sources"
+
+while read stat file; do
+
+ case $stat in
+ M)
+ msg "Locally modified: $file"
+ [ "$force" ] || die "There are local modifications"
+ ;;
+
+ *) die "Unexpected status ($stat) for $file" ;;
+ esac
+done < $tempfile
+
+
+msg "Running autoreconf..."
+
+autoreconf -I m4 || die "autoreconf error"
+
+
+cp $genfiles autogen/
+
+
+cd autogen
+
+
+bzr status -S $basegen >| $tempfile || \
+ die "bzr status error for generated files"
+
+
+modified=
+
+while read stat file; do
+
+ [ "$stat" != "M" ] && die "Unexpected status ($stat) for generated $file"
+
+ modified="$modified $file"
+
+done < $tempfile
+
+
+[ "$modified" ] || {
+ msg "No files were modified"
+ exit 0
+}
+
+msg "Modified file(s): $modified"
+
+[ "$commit" ] || exit 0
+
+
+msg "Committing..."
+
+## bzr status output is annoyingly always relative to top-level, not PWD.
+cd ../
+
+opt=
+[ "$quiet" ] || opt=-q
+
+bzr commit $opt -m "Auto-commit of generated files." $modified || \
+ die "bzr commit error"
+
+
+msg "Committed files: $modified"
+
+exit
+
+### update_autogen ends here
diff --git a/configure.in b/configure.in
index 69d1a1e5bd..b38aa97625 100644
--- a/configure.in
+++ b/configure.in
@@ -229,7 +229,7 @@ AC_ARG_ENABLE(maintainer-mode,
[enable make rules and dependencies not useful (and sometimes
confusing) to the casual installer])],
USE_MAINTAINER_MODE=$enableval,
- USE_MAINTAINER_MODE=no)
+ USE_MAINTAINER_MODE=yes)
if test $USE_MAINTAINER_MODE = yes; then
MAINT=
else
@@ -1826,8 +1826,8 @@ fi
HAVE_GTK=no
if test "${with_gtk3}" = "yes"; then
- GLIB_REQUIRED=2.6
- GTK_REQUIRED=2.90
+ GLIB_REQUIRED=2.28
+ GTK_REQUIRED=3.0
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
dnl Checks for libraries.
@@ -1835,6 +1835,7 @@ if test "${with_gtk3}" = "yes"; then
if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
AC_MSG_ERROR($GTK_PKG_ERRORS)
fi
+ AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
fi
if test "$pkg_check_gtk" != "yes"; then
@@ -2256,7 +2257,7 @@ if test "${HAVE_X11}" = "yes"; then
dnl if -lfreetype is not specified.
dnl The following is needed to set FREETYPE_LIBS.
PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes,
- HAVE_FREETYPE=no)
+ HAVE_FREETYPE=no)
test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype)
fi
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index dfdef6a0b0..a30ffc0797 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,40 @@
+2011-03-12 Eli Zaretskii <eliz@gnu.org>
+
+ * msdog.texi (Windows HOME): Fix the wording to clarify how Emacs sets
+ HOME on Windows and where it looks for init files. (Bug#8221)
+
+2011-03-10 Eli Zaretskii <eliz@gnu.org>
+
+ * search.texi (Regexp Example):
+ * mule.texi (International Chars):
+ * building.texi (External Lisp): Don't use characters outside
+ ISO-8859-1.
+
+2011-03-09 Eli Zaretskii <eliz@gnu.org>
+
+ * ack.texi (Acknowledgments): Convert to ISO-8859-1 encoding. Use
+ Texinfo @-commands for non Latin-1 characters.
+
+ * makefile.w32-in (MAKEINFO_OPTS): Add --enable-encoding.
+
+ * custom.texi (Init File): Add index entries for ".emacs".
+ (Bug#8210)
+
+2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xresources.texi (GTK resources): ~/.emacs.d/gtkrc does not work
+ for Gtk+ 3.
+
+2011-03-08 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (MAKEINFO_OPTS): Add --enable-encoding.
+ * emacs.texi (Acknowledgments):
+ * ack.texi (Acknowledgments): Names to UTF-8.
+ * emacs.texi: Set documentencoding.
+
+ * display.texi (Optional Mode Line): Don't mention exactly where
+ display-time appears. (Bug#8193)
+
2011-03-06 Chong Yidong <cyd@stupidchicken.com>
* search.texi (Isearch Yank): C-y now bound to isearch-yank-kill.
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in
index 0ba396e642..ae142dba6e 100644
--- a/doc/emacs/Makefile.in
+++ b/doc/emacs/Makefile.in
@@ -38,7 +38,7 @@ texinfodir = $(srcdir)/../misc
# The makeinfo program is part of the Texinfo distribution.
# Use --force so that it generates output even if there are errors.
MAKEINFO = @MAKEINFO@
-MAKEINFO_OPTS = --force -I $(srcdir)
+MAKEINFO_OPTS = --force --enable-encoding -I $(srcdir)
TEXI2DVI = texi2dvi
TEXI2PDF = texi2pdf
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index d49fd7b7c6..debe7149cb 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -1,3 +1,4 @@
+@c -*- coding: iso-latin-1 -*-
@c This is part of the Emacs manual.
@c Copyright (C) 1994-1997, 1999-2011 Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@@ -51,7 +52,7 @@ files.
Michael Albinus wrote @file{dbus.el}, a package that implements the
D-Bus message bus protocol; @file{zeroconf.el}, a mode for browsing
Avahi services; and @file{xesam.el}, a Xesam-based search engine
-interface. He and Kai Gro@ss{}johann wrote the Tramp package, which
+interface. He and Kai Großjohann wrote the Tramp package, which
provides transparent remote file editing using rcp, ssh, ftp, and
other network protocols. He and Daniel Pittman wrote
@file{tramp-cache.el}.
@@ -190,7 +191,7 @@ prior to Emacs 23 for Mac OS.
@item
Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many
improvements to the Emacs display engine; and, together with Kai
-Gro@ss{}johann and Alex Schroeder, wrote @file{longlines.el}, a minor
+Großjohann and Alex Schroeder, wrote @file{longlines.el}, a minor
mode for wrapping long lines.
@item
@@ -248,7 +249,7 @@ text replace the current selection.
Eric Ding wrote @file{goto-addr.el},
@item
-Jan Dj@"{a}rv added support for the GTK+ toolkit and X drag-and-drop.
+Jan Djärv added support for the GTK+ toolkit and X drag-and-drop.
@item
Carsten Dominik wrote Ref@TeX{}, a package for setting up labels and
@@ -283,7 +284,7 @@ folders have mail waiting in them; and @file{iswitchb.el}, a feature
for incremental reading and completion of buffer names.
@item
-Torbj@"orn Einarsson wrote @file{f90.el}, a mode for Fortran 90 files.
+Torbjörn Einarsson wrote @file{f90.el}, a mode for Fortran 90 files.
@item
Tsugutomo Enami co-wrote the support for international character sets.
@@ -349,7 +350,7 @@ Kevin Gallo added multiple-frame support for Windows NT and wrote
@file{w32-win.el}, support functions for the MS-Windows window system.
@item
-Juan Le@'{o}n Lahoz Garc@'{i}a wrote @file{wdired.el}, a package for
+Juan León Lahoz García wrote @file{wdired.el}, a package for
performing file operations by directly editing Dired buffers.
@item
@@ -483,8 +484,8 @@ Emacs: @file{dns.el} for Domain Name Service lookups;
@file{netrc.el} for parsing of @file{.netrc} files; and
@file{time-date.el} for general date and time handling. Components of
Gnus have also been written by: Nagy Andras, David Blacka, Scott Byer,
-Kevin Greiner, Kai Gro@ss{}johann, Joe Hildebrand, Paul Jarc, Sascha
-L@"{u}decke, David Moore, Jim Radford, Benjamin Rutt, Raymond Scholz,
+Kevin Greiner, Kai Großjohann, Joe Hildebrand, Paul Jarc, Sascha
+Lüdecke, David Moore, Jim Radford, Benjamin Rutt, Raymond Scholz,
Thomas Steffen, Reiner Steib, Didier Verna, Ilja Weis, Katsumi Yamaoka,
Teodor Zlatanov, and others (@pxref{Contributors,,,gnus, the Gnus Manual}).
@@ -524,7 +525,7 @@ S/MIME and Sieve components; and @file{tls.el} and @file{starttls.el}
for the Transport Layer Security protocol.
@item
-Arne J@o{}rgensen wrote @file{latexenc.el}, a package to
+Arne Jørgensen wrote @file{latexenc.el}, a package to
automatically guess the correct coding system in LaTeX files.
@item
@@ -576,7 +577,7 @@ files and running a PostScript interpreter interactively from within
Emacs.
@item
-Karel Kl@'{@dotless{i}}@v{c} contributed SELinux support, for preserving the
+Karel Klí@v{c} contributed SELinux support, for preserving the
Security-Enchanced Linux context of files on backup and copy.
@item
@@ -667,9 +668,8 @@ directory-local variables; and the @code{info-finder} feature that
creates a virtual Info manual of package keywords.
@item
-K@'{a}roly L@H{o}rentey wrote the ``multi-terminal'' code, which
-allows Emacs to run on graphical and text-only terminals
-simultaneously.
+Károly L@H{o}rentey wrote the ``multi-terminal'' code, which allows Emacs to
+run on graphical and text-only terminals simultaneously.
@item
Martin Lorentzon wrote @file{vc-annotate.el}, support for version
@@ -933,7 +933,7 @@ Fred Pierresteguy and Paul Reilly made Emacs work with X Toolkit
widgets.
@item
-Fran@,{c}ois Pinard, Greg McGary, and Bruno Haible wrote @file{po.el},
+François Pinard, Greg McGary, and Bruno Haible wrote @file{po.el},
support for PO translation files.
@item
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 1a02e92b67..a07e758201 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1056,7 +1056,7 @@ Show file information or library names in threads buffer.
Show addresses for thread frames in threads buffer.
@end table
- It’s possible to observe information for several threads
+ It's possible to observe information for several threads
simultaneously (in addition to buffers which show information for
currently selected thread) using the following keys from the threads
buffer.
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 9304e8bef0..7a696df319 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -2114,6 +2114,8 @@ Reference Manual}.
@node Init File
@section The Init File, @file{~/.emacs}
@cindex init file
+@cindex .emacs file
+@cindex ~/.emacs file
@cindex Emacs initialization file
@cindex key rebinding, permanent
@cindex rebinding keys, permanently
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index a21b660ee2..5eaf2e7e3c 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -999,8 +999,7 @@ value is 200 characters.
Emacs can optionally display the time and system load in all mode
lines. To enable this feature, type @kbd{M-x display-time} or customize
the option @code{display-time-mode}. The information added to the mode
-line usually appears after the buffer name, before the mode names and
-their parentheses. It looks like this:
+line looks like this:
@example
@var{hh}:@var{mm}pm @var{l.ll}
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index cd9a4602bf..7ca6204a99 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -1,4 +1,4 @@
-\input texinfo
+\input texinfo @c -*- coding: iso-latin-1 -*-
@setfilename ../../info/emacs
@settitle GNU Emacs Manual
@@ -29,6 +29,8 @@ developing GNU and promoting software freedom.''
@end quotation
@end copying
+@documentencoding ISO-8859-1
+
@dircategory Emacs
@direntry
* Emacs: (emacs). The extensible self-documenting text editor.
@@ -1350,7 +1352,7 @@ Abrahamsson, Jay K.@: Adams, Michael Albinus, Nagy Andras, Ralf Angeli,
Joe Arceneaux, Miles Bader, David Bakhash, Juanma Barranquero, Eli
Barzilay, Thomas Baumann, Steven L.@: Baur, Jay Belanger, Alexander L.@:
Belikoff, Boaz Ben-Zvi, Karl Berry, Anna M.@: Bigatti, Ray Blaak, Jim
-Blandy, Johan Bockg@aa{}rd, Jan Böcker, Lennart Borgman, Per Bothner,
+Blandy, Johan Bockgård, Jan Böcker, Lennart Borgman, Per Bothner,
Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel Briot, Kevin
Broadey, Vincent Broman, David M.@: Brown, Georges Brun-Cottan, Joe
Buehler, W@l{}odek Bzyl, Bill Carpenter, Per Cederqvist, Hans Chalupsky,
@@ -1358,16 +1360,16 @@ Chong Yidong, Chris Chase, Bob Chassell, Andrew Choi, Sacha Chua, James
Clark, Mike Clarkson, Glynn Clements, Daniel Colascione, Andrew Csillag,
Baoqiu Cui, Doug Cutting, Mathias Dahl, Julien Danjou, Satyaki Das,
Vivek Dasmohapatra, Michael DeCorte, Gary Delp, Matthieu Devin, Eri
-Ding, Jan Dj@"{a}rv, Carsten Dominik, Scott Draves, Benjamin Drieu,
+Ding, Jan Djärv, Carsten Dominik, Scott Draves, Benjamin Drieu,
Viktor Dukhovni, Dmitry Dzhus, John Eaton, Rolf Ebert, Paul Eggert,
-Stephen Eglen, Torbj@"orn Einarsson, Tsugutomo Enami, Hans Henrik
+Stephen Eglen, Torbjörn Einarsson, Tsugutomo Enami, Hans Henrik
Eriksen, Michael Ernst, Ata Etemadi, Frederick Farnbach, Oscar
Figueiredo, Fred Fish, Karl Fogel, Gary Foster, Romain Francoise, Noah
Friedman, Andreas Fuchs, Hallvard Furuseth, Keith Gabryelski, Peter S.@:
-Galbraith, Kevin Gallagher, Kevin Gallo, Juan Le@'{o}n Lahoz
-Garc@'{@dotless{i}}a, Howard Gayle, Daniel German, Stephen Gildea,
+Galbraith, Kevin Gallagher, Kevin Gallo, Juan León Lahoz
+García, Howard Gayle, Daniel German, Stephen Gildea,
Julien Gilles, David Gillespie, Bob Glickstein, Deepak Goel, Boris
-Goldowsky, Michelangelo Grigni, Odd Gripenstam, Kai Gro@ss{}johann,
+Goldowsky, Michelangelo Grigni, Odd Gripenstam, Kai Großjohann,
Michael Gschwind, Bastien Guerry, Henry Guillaume, Doug Gwyn, Ken'ichi
Handa, Lars Hansen, Chris Hanson, K. Shane Hartman, John Heidemann, Jon
K.@: Hellan, Jesper Harder, Magnus Henoch, Markus Heritsch, Karl Heuer,
@@ -1375,17 +1377,17 @@ Manabu Higashida, Anders Holst, Jeffrey C.@: Honig, Tassilo Horn, Kurt
Hornik, Tom Houlder, Joakim Hove, Denis Howe, Lars Ingebrigtsen, Andrew
Innes, Seiichiro Inoue, Philip Jackson, Pavel Janik, Paul Jarc, Ulf
Jasper, Michael K. Johnson, Kyle Jones, Terry Jones, Simon Josefsson,
-Arne J@o{}rgensen, Tomoji Kagatani, Brewster Kahle, Tokuya Kameshima,
+Arne Jørgensen, Tomoji Kagatani, Brewster Kahle, Tokuya Kameshima,
Lute Kamstra, David Kastrup, David Kaufman, Henry Kautz, Taichi
Kawabata, Howard Kaye, Michael Kifer, Richard King, Peter Kleiweg, Karel
-Kl@'{@dotless{i}}@v{c}, Shuhei Kobayashi, Pavel Kobiakov, Larry K.@:
+Klí@v{c}, Shuhei Kobayashi, Pavel Kobiakov, Larry K.@:
Kolodney, David M.@: Koppelman, Koseki Yoshinori, Robert Krawitz,
-Sebastian Kremer, Ryszard Kubiak, David K@aa{}gedal, Daniel LaLiberte,
+Sebastian Kremer, Ryszard Kubiak, David Kågedal, Daniel LaLiberte,
Karl Landstrom, Mario Lang, Aaron Larson, James R.@: Larus, Vinicius
Jose Latorre, Werner Lemberg, Frederic Lepied, Peter Liljenberg, Lars
Lindberg, Chris Lindblad, Anders Lindgren, Thomas Link, Juri Linkov,
-Francis Litterio, Emilio C. Lopes, K@'{a}roly L@H{o}rentey, Dave Love,
-Sascha L@"{u}decke, Eric Ludlam, Alan Mackenzie, Christopher J.@:
+Francis Litterio, Emilio C. Lopes, Károly L@H{o}rentey, Dave Love,
+Sascha Lüdecke, Eric Ludlam, Alan Mackenzie, Christopher J.@:
Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann, Brian Marick, Simon
Marshall, Bengt Martensson, Charlie Martin, Thomas May, Roland McGrath,
Will Mengarini, David Megginson, Ben A. Mesander, Wayne Mesard, Brad
diff --git a/doc/emacs/makefile.w32-in b/doc/emacs/makefile.w32-in
index bbbcaf0528..ad976468be 100644
--- a/doc/emacs/makefile.w32-in
+++ b/doc/emacs/makefile.w32-in
@@ -28,7 +28,7 @@ infodir = $(srcdir)/../../info
# The makeinfo program is part of the Texinfo distribution.
MAKEINFO = makeinfo
-MAKEINFO_OPTS = --force -I$(srcdir)
+MAKEINFO_OPTS = --force --enable-encoding -I$(srcdir)
MULTI_INSTALL_INFO = $(srcdir)\..\..\nt\multi-install-info.bat
INFO_TARGETS = $(infodir)/emacs
DVI_TARGETS = emacs.dvi
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi
index 7358773485..0a454db86b 100644
--- a/doc/emacs/msdog.texi
+++ b/doc/emacs/msdog.texi
@@ -404,36 +404,45 @@ names, which might cause misalignment of columns in Dired display.
@dfn{user-specific application data directory}. The actual location
depends on your Windows version and system configuration; typical values
are @file{C:\Documents and Settings\@var{username}\Application Data} on
-Windows 2K/XP and later, and either @file{C:\WINDOWS\Application Data}
+Windows 2K/XP/2K3, @file{C:\Users\@var{username}\AppData\Roaming} on
+Windows Vista/7/2K8, and either @file{C:\WINDOWS\Application Data}
or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the
-older Windows 9X/ME systems.
-
- @code{HOME} can also be set in the system registry, for details see
+older Windows 9X/ME systems. If this directory does not exist or
+cannot be accessed, Emacs falls back to @file{C:\} as the default
+value of @code{HOME}.
+
+ You can override this default value of @code{HOME} by explicitly
+setting the environment variable @env{HOME} to point to any directory
+on your system. @env{HOME} can be set either from the command shell
+prompt or from the @samp{My Computer}s @samp{Properties} dialog.
+@code{HOME} can also be set in the system registry, for details see
@ref{MS-Windows Registry}.
-@cindex init file @file{.emacs} on MS-Windows
- The home directory is where your init file @file{.emacs} is stored.
-When Emacs starts, it first checks whether the environment variable
-@env{HOME} is set. If it is, it looks for the init file in the
-directory pointed by @env{HOME}. If @env{HOME} is not defined, Emacs
-checks for an existing @file{.emacs} file in @file{C:\}, the root
-directory of drive @file{C:}@footnote{
-The check in @file{C:\} is for compatibility with older versions of Emacs,
-which didn't check the application data directory.
-}. If there's no such file in @file{C:\}, Emacs next uses the Windows
-system calls to find out the exact location of your application data
-directory. If that system call fails, Emacs falls back to @file{C:\}.
-
- Whatever the final place is, Emacs sets the value of the @env{HOME}
-environment variable to point to it, and it will use that location for
-other files and directories it normally creates in the user's home
-directory.
+ For compatibility with older versions of Emacs@footnote{
+Older versions of Emacs didn't check the application data directory.
+}, if there is a file named @file{.emacs} in @file{C:\}, the root
+directory of drive @file{C:}, and @env{HOME} is set neither in the
+environment nor in the Registry, Emacs will treat @file{C:\} as the
+default @code{HOME} location, and will not look in the application
+data directory, even if it exists. Note that only @file{.emacs} is
+looked for in @file{C:\}; the older name @file{_emacs} (see below) is
+not. This use of @file{C:\.emacs} to define @code{HOME} is
+deprecated.
+
+ Whatever the final place is, Emacs sets the internal value of the
+@env{HOME} environment variable to point to it, and it will use that
+location for other files and directories it normally looks for or
+creates in the user's home directory.
You can always find out where Emacs thinks is your home directory's
location by typing @kbd{C-x d ~/ @key{RET}}. This should present the
list of files in the home directory, and show its full name on the
first line. Likewise, to visit your init file, type @kbd{C-x C-f
-~/.emacs @key{RET}}.
+~/.emacs @key{RET}} (assuming the file's name is @file{.emacs}).
+
+@cindex init file @file{.emacs} on MS-Windows
+ The home directory is where your init file is stored. It can have
+any name mentioned in @ref{Init File}.
@cindex @file{_emacs} init file, MS-Windows
Because MS-DOS does not allow file names with leading dots, and
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 22c155d26d..e12ec70706 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -237,7 +237,7 @@ preferred charset: unicode (Unicode (ISO10646))
Character code properties: customize what to show
name: LATIN CAPITAL LETTER A WITH GRAVE
general-category: Lu (Letter, Uppercase)
- decomposition: (65 768) ('A' 'Ì€')
+ decomposition: (65 768) ('A' '`')
old-name: LATIN CAPITAL LETTER A GRAVE
There are text properties here:
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 9fdccc3218..b5d426210a 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -917,13 +917,13 @@ setting of the syntax table (@pxref{Syntax}).
@node Regexp Example
@section Regular Expression Example
- Here is an example of a regexp---the regexp that Emacs uses, by
-default, to recognize the end of a sentence, not including the
-following space (i.e., the variable @code{sentence-end-base}):
+ Here is an example of a regexp---similar to the regexp that Emacs
+uses, by default, to recognize the end of a sentence, not including
+the following space (i.e., the variable @code{sentence-end-base}):
@example
@verbatim
-[.?!][]\"'â€â€)}]*
+[.?!][]\"')}]*
@end verbatim
@end example
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi
index 41a09a5f71..33ea83d7d6 100644
--- a/doc/emacs/xresources.texi
+++ b/doc/emacs/xresources.texi
@@ -660,8 +660,11 @@ The color for the border shadow, on the top and the left.
@iftex
The most common way to customize the GTK widgets Emacs uses (menus, dialogs
tool bars and scroll bars) is by choosing an appropriate theme, for example
-with the GNOME theme selector. You can also do Emacs specific customization
-by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc}. Some GTK
+with the GNOME theme selector.
+
+You can also do Emacs specific customization
+by inserting GTK style directives in the file @file{~/.emacs.d/gtkrc},
+but only if you have a Gtk+ version earlier than 3 (i.e. 2). Some GTK
themes ignore customizations in @file{~/.emacs.d/gtkrc} so not everything
works with all themes. To customize Emacs font, background, faces, etc., use
the normal X resources (@pxref{Resources}). We will present some examples of
diff --git a/doc/lispref/ChangeLog.trunk b/doc/lispref/ChangeLog.trunk
index 5d28a90136..c705aae493 100644
--- a/doc/lispref/ChangeLog.trunk
+++ b/doc/lispref/ChangeLog.trunk
@@ -1,3 +1,37 @@
+2011-03-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * strings.texi (String Conversion): Don't mention
+ string-make-(uni|multi)byte (bug#8262).
+ * nonascii.texi (Converting Representations): Fix up range.
+ * keymaps.texi (Key Binding Commands): Update code point, avoid
+ "unibyte character" and remove mention of unibyte bindings.
+
+2011-03-10 Eli Zaretskii <eliz@gnu.org>
+
+ * modes.texi (Operator Precedence Grammars): Don't use characters
+ outside ISO-8859-1.
+
+2011-03-09 Eli Zaretskii <eliz@gnu.org>
+
+ * intro.texi (Acknowledgements): Convert to ISO-8859-1 encoding.
+
+ * makefile.w32-in (MAKEINFO_OPTS): Add --enable-encoding.
+
+2011-03-08 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (MAKEINFO_OPTS): Add --enable-encoding.
+ * intro.texi (Acknowledgements): Names to UTF-8.
+ * elisp.texi: Set documentencoding.
+
+2011-03-06 Chong Yidong <cyd@stupidchicken.com>
+
+ * package.texi: Update index keywords.
+ (Package Archives): New node contents. Document package-x.el.
+
+2011-03-06 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in (srcs): Add package.texi.
+
2011-03-06 Chong Yidong <cyd@stupidchicken.com>
* package.texi (Packaging, Packaging Basics, Simple Packages)
diff --git a/doc/lispref/Makefile.in b/doc/lispref/Makefile.in
index d5427f6e47..75fa884224 100644
--- a/doc/lispref/Makefile.in
+++ b/doc/lispref/Makefile.in
@@ -31,7 +31,7 @@ texinfodir = $(srcdir)/../misc
emacsdir = $(srcdir)/../emacs
MAKEINFO = @MAKEINFO@
-MAKEINFO_OPTS = --force -I $(emacsdir) -I $(srcdir)
+MAKEINFO_OPTS = --force --enable-encoding -I $(emacsdir) -I $(srcdir)
TEXI2DVI = texi2dvi
TEXI2PDF = texi2pdf
DVIPS = dvips
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index fc06652661..69c50ba42b 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -62,6 +62,8 @@ developing GNU and promoting software freedom.''
@end quotation
@end copying
+@documentencoding ISO-8859-1
+
@dircategory GNU Emacs Lisp
@direntry
* Elisp: (elisp). The Emacs Lisp Reference Manual.
diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi
index baa184004e..7c07072602 100644
--- a/doc/lispref/intro.texi
+++ b/doc/lispref/intro.texi
@@ -1,4 +1,4 @@
-@c -*-texinfo-*-
+@c -*-coding: iso-latin-1-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
@c Copyright (C) 1990-1994, 2001-2011 Free Software Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@@ -542,6 +542,6 @@ Kirman, Bob Knighten, Frederick M. Korz, Joe Lammens, Glenn M. Lewis,
K. Richard Magill, Brian Marick, Roland McGrath, Stefan Monnier, Skip
Montanaro, John Gardiner Myers, Thomas A. Peterson, Francesco Potorti,
Friedrich Pukelsheim, Arnold D. Robbins, Raul Rockwell, Jason Rumney,
-Per Starb@"ack, Shinichirou Sugou, Kimmo Suominen, Edward Tharp, Bill
+Per Starbäck, Shinichirou Sugou, Kimmo Suominen, Edward Tharp, Bill
Trost, Rickard Westman, Jean White, Eduard Wiebe, Matthew Wilding,
Carl Witty, Dale Worley, Rusty Wright, and David D. Zuhn.
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index af24ff5aa4..2648c22ca0 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -1705,15 +1705,11 @@ or
@noindent
and your language environment is multibyte Latin-1, these commands
-actually bind the multibyte character with code 2294, not the unibyte
-Latin-1 character with code 246 (@kbd{M-v}). In order to use this
-binding, you need to enter the multibyte Latin-1 character as keyboard
-input. One way to do this is by using an appropriate input method
-(@pxref{Input Methods, , Input Methods, emacs, The GNU Emacs Manual}).
-
- If you want to use a unibyte character in the key binding, you can
-construct the key sequence string using @code{multibyte-char-to-unibyte}
-or @code{string-make-unibyte} (@pxref{Converting Representations}).
+actually bind the multibyte character with code 246, not the byte
+code 246 (@kbd{M-v}) sent by a Latin-1 terminal. In order to use this
+binding, you need to teach Emacs how to decode the keyboard by using an
+appropriate input method (@pxref{Input Methods, , Input Methods, emacs, The GNU
+Emacs Manual}).
@deffn Command global-set-key key binding
This function sets the binding of @var{key} in the current global map
diff --git a/doc/lispref/makefile.w32-in b/doc/lispref/makefile.w32-in
index e0bcd21f2c..7b88e861d6 100644
--- a/doc/lispref/makefile.w32-in
+++ b/doc/lispref/makefile.w32-in
@@ -33,7 +33,7 @@ texinfodir = $(srcdir)/../misc
TEX=tex
INSTALL_INFO = install-info
MAKEINFO = makeinfo
-MAKEINFO_OPTS = --force -I$(srcdir) -I$(emacsdir)
+MAKEINFO_OPTS = --force --enable-encoding -I$(srcdir) -I$(emacsdir)
# The environment variable and its value to add $(srcdir) to the path
# searched for TeX input files.
@@ -87,6 +87,7 @@ srcs = \
$(srcdir)/numbers.texi \
$(srcdir)/objects.texi \
$(srcdir)/os.texi \
+ $(srcdir)/package.texi \
$(srcdir)/positions.texi \
$(srcdir)/processes.texi \
$(srcdir)/searching.texi \
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index f238f38462..f0a8985fa7 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -3403,7 +3403,7 @@ Such pairs of precedences are sufficient to express left-associativity
or right-associativity of infix operators, nesting of tokens like
parentheses and many other cases.
-@c ¡Let's leave this undocumented to leave it more open for change!
+@c Let's leave this undocumented to leave it more open for change!
@c @defvar smie-grammar
@c The value of this variable is an alist specifying the left and right
@c precedence of each token. It is meant to be initialized by using one of
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 409ecc7e20..6fcde61199 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -167,7 +167,7 @@ acceptable because the buffer's representation is a choice made by the
user that cannot be overridden automatically.
Converting unibyte text to multibyte text leaves @acronym{ASCII}
-characters unchanged, and converts bytes with codes 128 through 159 to
+characters unchanged, and converts bytes with codes 128 through 255 to
the multibyte representation of raw eight-bit bytes.
Converting multibyte text to unibyte converts all @acronym{ASCII}
diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
index 4de44fe165..62fbc2a9a0 100644
--- a/doc/lispref/package.texi
+++ b/doc/lispref/package.texi
@@ -5,7 +5,8 @@
@setfilename ../../info/package
@node Packaging, Antinews, System Interface, Top
@chapter Preparing Lisp code for distribution
-@cindex packaging
+@cindex package
+@cindex Lisp package
Emacs provides a standard way to distribute Emacs Lisp code to
users. A @dfn{package} is a collection of one or more files,
@@ -24,8 +25,11 @@ put it in a @dfn{package archive} for others to download.
@node Packaging Basics
@section Packaging Basics
-@cindex packaging basics
@cindex package attributes
+@cindex package name
+@cindex package version
+@cindex dependencies
+@cindex package dependencies
A package is either a @dfn{simple package} or a @dfn{multi-file
package}. A simple package is stored in a package archive as a single
@@ -69,6 +73,7 @@ installing this package also automatically installs its dependencies;
if any dependency cannot be found, the package cannot be installed.
@end table
+@cindex content directory, package
Installing a package, either via the Package Menu, or via the
command @code{package-install-file}, creates a subdirectory of
@code{package-user-dir} named @file{@var{name}-@var{version}}, where
@@ -78,6 +83,7 @@ package's @dfn{content directory}. It is where Emacs puts the
package's contents (the single Lisp file for a simple package, or the
files extracted from a multi-file package).
+@cindex package autoloads
Emacs then searches every Lisp file in the content directory for
autoload magic comments (@pxref{Autoload}). These autoload
definitions are saved to a file named @file{@var{name}-autoloads.el}
@@ -98,7 +104,8 @@ typically called to begin using the package.
@node Simple Packages
@section Simple Packages
-@cindex single file packages
+@cindex single file package
+@cindex simple package
A simple package consists of a single Emacs Lisp source file. The
file must conform to the Emacs Lisp library header conventions
@@ -160,7 +167,7 @@ single-file package to a package archive.
@node Multi-file Packages
@section Multi-file Packages
-@cindex multi-file packages
+@cindex multi-file package
A multi-file package is less convenient to create than a single-file
package, but it offers more features: it can include multiple Emacs
@@ -206,10 +213,10 @@ file is used as the long description.
If the content directory contains a file named @file{dir}, this is
assumed to be an Info directory file made with @command{install-info}.
@xref{Invoking install-info, Invoking install-info, Invoking
-install-info, texinfo, Texinfo}. The Info files listed in this
-directory file should also be present in the content directory. In
-this case, Emacs will automatically add the content directory to
-@code{Info-directory-list} when the package is activated.
+install-info, texinfo, Texinfo}. The relevant Info files should also
+be present in the content directory. In this case, Emacs will
+automatically add the content directory to @code{Info-directory-list}
+when the package is activated.
Do not include any @file{.elc} files in the package. Those are
created when the package is installed. Note that there is no way to
@@ -234,5 +241,79 @@ variable @code{load-file-name} (@pxref{Loading}). Here is an example:
@node Package Archives
@section Creating and Maintaining Package Archives
-
-To be done.
+@cindex package archive
+
+ Via the Package Menu, users may download packages from @dfn{package
+archives}. Such archives are specified by the variable
+@code{package-archives}, whose default value contains a single entry:
+the archive hosted by the GNU project at @url{elpa.gnu.org}. This
+section describes how to set up and maintain a package archive.
+
+@cindex base location, package archive
+@defopt package-archives
+The value of this variable is an alist of package archives recognized
+by the Emacs package manager.
+
+Each alist element corresponds to one archive, and should have the
+form @code{(@var{id} . @var{location})}, where @var{id} is the name of
+the archive (a string) and @var{location} is its @dfn{base location}
+(a string).
+
+If the base location starts with @samp{http:}, it is treated as a HTTP
+URL, and packages are downloaded from this archive via HTTP (as is the
+case for the default GNU archive).
+
+Otherwise, the base location should be a directory name. In this
+case, Emacs retrieves packages from this archive via ordinary file
+access. Such ``local'' archives are mainly useful for testing.
+@end defopt
+
+ A package archive is simply a directory in which the package files,
+and associated files, are stored. If you want the archive to be
+reachable via HTTP, this directory must be accessible to a web server.
+How to accomplish this is beyond the scope of this manual.
+
+ A convenient way to set up and update a package archive is via the
+@code{package-x} library. This is included with Emacs, but not loaded
+by default; type @kbd{M-x load-library @kbd{RET} package-x @kbd{RET}}
+to load it, or add @code{(require 'package-x)} to your init file.
+@xref{Lisp Libraries,, Lisp Libraries, emacs, The GNU Emacs Manual}.
+Once loaded, you can make use of the following:
+
+@defopt package-archive-upload-base
+The value of this variable is the base location of a package archive,
+as a directory name. The commands in the @code{package-x} library
+will use this base location.
+
+The directory name should be absolute. You may specify a remote name,
+such as @file{/ssh:foo@@example.com:/var/www/packages/}, if the
+package archive is on a different machine. @xref{Remote Files,,
+Remote Files, emacs, The GNU Emacs Manual}.
+@end defopt
+
+@deffn Command package-upload-file filename
+This command prompts for @var{filename}, a file name, and uploads that
+file to @code{package-archive-upload-base}. The file must be either a
+simple package (a @file{.el} file) or a multi-file package (a
+@file{.tar} file); otherwise, an error is raised. The package
+attributes are automatically extracted, and the archive's contents
+list is updated with this information.
+
+If @code{package-archive-upload-base} does not specify a valid
+directory, the function prompts interactively for one. If the
+directory does not exist, it is created. The directory need not have
+any initial contents (i.e., you can use this command to populate an
+initially empty archive).
+@end deffn
+
+@deffn Command package-upload-buffer
+This command is similar to @code{package-upload-file}, but instead of
+prompting for a package file, it uploads the contents of the current
+buffer. The current buffer must be visiting a simple package (a
+@file{.el} file) or a multi-file package (a @file{.tar} file);
+otherwise, an error is raised.
+@end deffn
+
+@noindent
+After you create an archive, remember that it is not accessible in the
+Package Menu interface unless it is in @code{package-archives}.
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index ce080bc221..d062c21595 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -554,8 +554,8 @@ strings and integers. @code{format} (@pxref{Formatting Strings}) and
@code{prin1-to-string} (@pxref{Output Functions}) can also convert
Lisp objects into strings. @code{read-from-string} (@pxref{Input
Functions}) can ``convert'' a string representation of a Lisp object
-into an object. The functions @code{string-make-multibyte} and
-@code{string-make-unibyte} convert the text representation of a string
+into an object. The functions @code{string-to-multibyte} and
+@code{string-to-unibyte} convert the text representation of a string
(@pxref{Converting Representations}).
@xref{Documentation}, for functions that produce textual descriptions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 2c5f998737..50f0e4e45b 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,54 @@
+2011-03-17 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc.texi (Logarithmic Units): Update the function names.
+
+2011-03-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * message.texi (Various Commands): Document format specs in the
+ ellipsis.
+
+2011-03-15 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * message.texi (Insertion Variables): Document message-cite-style.
+
+2011-03-14 Michael Albinus <michael.albinus@gmx.de>
+
+ * tramp.texi (Remote processes): New subsection "Running shell on
+ a remote host".
+
+2011-03-12 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth.texi (Help for developers): Update docs to explain that the
+ :save-function will only run the first time.
+
+2011-03-12 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (emacs-faq.html): Fix some more cross-refs.
+ (emacs-faq.text): New target.
+ (clean): Add emacs-faq.
+
+2011-03-12 Michael Albinus <michael.albinus@gmx.de>
+
+ Sync with Tramp 2.2.1.
+
+ * trampver.texi: Update release number.
+
+2011-03-11 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (HTML_TARGETS): New.
+ (clean): Delete $HTML_TARGETS.
+ (emacs-faq.html): New, for use with the gnu.org Emacs webpage.
+
+2011-03-08 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth.texi (Help for developers): Show example of using
+ `auth-source-search' with prompts and :save-function.
+
+2011-03-07 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * message.texi (Message Buffers): Update default value of
+ message-generate-new-buffers.
+
2011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
* calc.texi (Logarithmic Units): Rename calc-logunits-dblevel
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 0a28d417c7..450199a33c 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -197,6 +197,8 @@ PDF_TARGETS = \
widget.pdf \
woman.pdf
+HTML_TARGETS = emacs-faq.html
+
TEXI2DVI = texi2dvi
TEXI2PDF = texi2pdf
@@ -401,6 +403,15 @@ faq.dvi: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
$(ENVADD) $(TEXI2DVI) $<
faq.pdf: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
$(ENVADD) $(TEXI2PDF) $<
+## This is the name used on the Emacs web-page.
+## sed fixes up links to point to split version of the manual.
+emacs-faq.html: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
+ $(MAKEINFO) $(MAKEINFO_OPTS) --no-split \
+ --css-ref='/layout.css' --html -o $@ $<
+ sed -i -e 's|a href="\([a-z]*\)\.html#\([^"]*\)"|a href="manual/html_node/\1/\2.html"|g' \
+ -e 's|/Top\.html|/|g' $@
+emacs-faq.text: ${srcdir}/faq.texi $(emacsdir)/emacsver.texi
+ $(MAKEINFO) $(MAKEINFO_OPTS) --plaintext -o $@ $<
flymake : $(infodir)/flymake
$(infodir)/flymake: flymake.texi
@@ -684,7 +695,7 @@ mostlyclean:
rm -f gnustmp.*
clean: mostlyclean
- rm -f $(DVI_TARGETS) $(PDF_TARGETS)
+ rm -f $(DVI_TARGETS) $(PDF_TARGETS) $(HTML_TARGETS) emacs-faq.text
distclean: clean
# rm -f Makefile
diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi
index 23ac23dce5..a16da92343 100644
--- a/doc/misc/auth.texi
+++ b/doc/misc/auth.texi
@@ -131,11 +131,11 @@ library encourages this confusion by accepting both, as you'll see
later.
If you have problems with the search, set @code{auth-source-debug} to
-@code{t} and see what host, port, and user the library is checking in
-the @code{*Messages*} buffer. Ditto for any other problems, your
-first step is always to see what's being checked. The second step, of
-course, is to write a blog entry about it and wait for the answer in
-the comments.
+@code{'trivia} and see what host, port, and user the library is
+checking in the @code{*Messages*} buffer. Ditto for any other
+problems, your first step is always to see what's being checked. The
+second step, of course, is to write a blog entry about it and wait for
+the answer in the comments.
You can customize the variable @code{auth-sources}. The following may
be needed if you are using an older version of Emacs or if the
@@ -232,6 +232,14 @@ TODO: how does it work generally, how does secrets.el work, some examples.
@node Help for developers
@chapter Help for developers
+The auth-source library lets you control logging output easily.
+
+@defvar auth-source-debug
+Set this variable to 'trivia to see lots of output in *Messages*, or
+set it to a function that behaves like @code{message} to do your own
+logging.
+@end defvar
+
The auth-source library only has a few functions for external use.
@defun auth-source-search SPEC
@@ -240,6 +248,62 @@ TODO: how to include docstring?
@end defun
+Let's take a look at an example of using @code{auth-source-search}
+from Gnus' @code{nnimap.el}.
+
+@example
+(defun nnimap-credentials (address ports)
+ (let* ((auth-source-creation-prompts
+ '((user . "IMAP user at %h: ")
+ (secret . "IMAP password for %u@@%h: ")))
+ (found (nth 0 (auth-source-search :max 1
+ :host address
+ :port ports
+ :require '(:user :secret)
+ :create t))))
+ (if found
+ (list (plist-get found :user)
+ (let ((secret (plist-get found :secret)))
+ (if (functionp secret)
+ (funcall secret)
+ secret))
+ (plist-get found :save-function))
+ nil)))
+@end example
+
+This call requires the user and password (secret) to be in the
+results. It also requests that an entry be created if it doesn't
+exist already. While the created entry is being assembled, the shown
+prompts will be used to interact with the user. The caller can also
+pass data in @code{auth-source-creation-defaults} to supply defaults
+for any of the prompts.
+
+Note that the password needs to be evaluated if it's a function. It's
+wrapped in a function to provide some security.
+
+Later, after a successful login, @code{nnimal.el} calls the
+@code{:save-function} like so:
+
+@example
+(when (functionp (nth 2 credentials))
+ (funcall (nth 2 credentials)))
+@end example
+
+This will work whether the @code{:save-function} was provided or not.
+@code{:save-function} will be provided only when a new entry was
+created, so this effectively says ``after a successful login, save the
+authentication information we just used, if it was newly created.''
+
+After the first time it's called, the @code{:save-function} will not
+run again (but it will log something if you have set
+@code{auth-source-debug} to @code{'trivia}). This is so it won't ask
+the same question again, which is annoying. This is so it won't ask
+the same question again, which is annoying. This is so it won't ask
+the same question again, which is annoying.
+
+So the responsibility of the API user that specified @code{:create t}
+is to call the @code{:save-function} if it's provided.
+
@defun auth-source-delete SPEC
TODO: how to include docstring?
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 88103fc003..f732eff569 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -28126,47 +28126,15 @@ tell Calc to use a different file for the Calc init file.)
@section Logarithmic Units
The units @code{dB} (decibels) and @code{Np} (nepers) are logarithmic
-units which are typically manipulated differently than standard units.
-Calc provides commands to work with these logarithmic units.
+units which are manipulated differently than standard units. Calc
+provides commands to work with these logarithmic units.
Decibels and nepers are used to measure power quantities as well as
-field quantities (quantities whose squares are proportional to power).
-The decibel and neper values of a quantity are relative to
-a reference quantity; for example, the decibel value of a sound
-pressure level of
-@infoline @math{60 uPa}
-@texline @math{60 \mu{\rm Pa}}
-relative to
-@infoline @math{20 uPa}
-@texline @math{20 \mu{\rm Pa}}
-(the threshhold of human hearing) is
-@infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB},
-@texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = 20 \log_{10}(3) {\rm dB}},
-which is about
-@infoline @math{9.54 dB}.
-@texline @math{9.54 {\rm dB}}.
-Note that in taking the ratio, the original units cancel and so these
-logarithmic units are dimensionless.
-
-@vindex calc-logunits-power-reference
-@vindex calc-logunits-field-reference
-The Calc commands for the logarithmic units assume that power quantities
-are being used unless the @kbd{H} prefix is used, in which case they assume that
-field quantities are being used. For power quantities, Calc uses
-@infoline @math{1 mW}
-@texline @math{1 {\rm mW}}
-as the default reference quantity; this default can be changed by changing
-the value of the customizable variable
-@code{calc-logunits-power-reference} (@pxref{Customizing Calc}).
-For field quantities, Calc uses
-@infoline @math{20 uPa}
-@texline @math{20 \mu{\rm Pa}}
-as the default reference quantity; this is the value used in acoustics
-which is where decibels are commonly encountered. This default can be
-changed by changing the value of the customizable variable
-@code{calc-logunits-field-reference} (@pxref{Customizing Calc}). A
-non-default reference quantity will be read from the stack if the
-capital @kbd{O} prefix is used.
+field quantities (quantities whose squares are proportional to power);
+these two types of quantities are handled slightly different from each
+other. By default the Calc commands work as if power quantities are
+being used; with the @kbd{H} prefix the Calc commands work as if field
+quantities are being used.
The decibel level of a power
@infoline @math{P1},
@@ -28214,6 +28182,20 @@ relative to a reference
is defined as
@infoline @math{20 log10(F1/F0) dB}.
@texline @math{20 \log_{10}(F_{1}/F_{0}) {\rm dB}}.
+For example, the decibel value of a sound pressure level of
+@infoline @math{60 uPa}
+@texline @math{60 \mu{\rm Pa}}
+relative to
+@infoline @math{20 uPa}
+@texline @math{20 \mu{\rm Pa}}
+(the threshhold of human hearing) is
+@infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB},
+@texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = 20 \log_{10}(3) {\rm dB}},
+which is about
+@infoline @math{9.54 dB}.
+@texline @math{9.54 {\rm dB}}.
+Note that in taking the ratio, the original units cancel and so these
+logarithmic units are dimensionless.
Nepers (named after John Napier, who is credited with inventing the
logarithm) are similar to bels except they use natural logarithms instead
@@ -28236,55 +28218,72 @@ is
@infoline @math{ln(F1/F0) Np}.
@texline @math{\ln(F_1/F_0) {\rm Np}}.
+@vindex calc-lu-power-reference
+@vindex calc-lu-field-reference
+For power quantities, Calc uses
+@infoline @math{1 mW}
+@texline @math{1 {\rm mW}}
+as the default reference quantity; this default can be changed by changing
+the value of the customizable variable
+@code{calc-lu-power-reference} (@pxref{Customizing Calc}).
+For field quantities, Calc uses
+@infoline @math{20 uPa}
+@texline @math{20 \mu{\rm Pa}}
+as the default reference quantity; this is the value used in acoustics
+which is where decibels are commonly encountered. This default can be
+changed by changing the value of the customizable variable
+@code{calc-lu-field-reference} (@pxref{Customizing Calc}). A
+non-default reference quantity will be read from the stack if the
+capital @kbd{O} prefix is used.
+
@kindex l q
-@pindex calc-logunits-quantity
-@tindex powerquant
-@tindex fieldquant
-The @kbd{l q} (@code{calc-logunits-quantity}) [@code{powerquant}]
+@pindex calc-lu-quant
+@tindex lupquant
+@tindex lufquant
+The @kbd{l q} (@code{calc-lu-quant}) [@code{lupquant}]
command computes the power quantity corresponding to a given number of
logarithmic units. With the capital @kbd{O} prefix, @kbd{O l q}, the
reference level will be read from the top of the stack. (In an
-algebraic formula, @code{powerquant} can be given an optional second
+algebraic formula, @code{lupquant} can be given an optional second
argument which will be used for the reference level.) For example,
@code{20 dB @key{RET} l q} will return @code{100 mW};
@code{20 dB @key{RET} 4 W @key{RET} O l q} will return @code{400 W}.
-The @kbd{H l q} [@code{fieldquant}] command behaves like @kbd{l q} but
+The @kbd{H l q} [@code{lufquant}] command behaves like @kbd{l q} but
computes field quantities instead of power quantities.
@kindex l d
-@pindex calc-dblevel
-@tindex dbpowerlevel
-@tindex dbfieldlevel
+@pindex calc-db
+@tindex dbpower
+@tindex dbfield
@kindex l n
-@pindex calc-nplevel
-@tindex nppowerlevel
-@tindex npfieldlevel
-The @kbd{l d} (@code{calc-dblevel}) [@code{dbpowerlevel}]
-command will compute the decibel level of a power quantity using the
-default reference level; @kbd{H l d} [@code{dbfieldlevel}] will
-compute the decibel level of a field quantity. The commands @kbd{l n}
-(@code{calc-nplevel}) [@code{nppowerlevel}] and @kbd{H l n}
-[@code{npfieldlevel}] will similarly compute neper levels. With the
-capital @kbd{O} prefix these commands will read a reference level
-from the stack; in an algebraic formula the reference level can be
-given as an optional second argument.
+@pindex calc-np
+@tindex nppower
+@tindex npfield
+The @kbd{l d} (@code{calc-db}) [@code{dbpower}] command will compute
+the decibel level of a power quantity using the default reference
+level; @kbd{H l d} [@code{dbfield}] will compute the decibel level of
+a field quantity. The commands @kbd{l n} (@code{calc-np})
+[@code{nppower}] and @kbd{H l n} [@code{npfield}] will similarly
+compute neper levels. With the capital @kbd{O} prefix these commands
+will read a reference level from the stack; in an algebraic formula
+the reference level can be given as an optional second argument.
@kindex l +
-@pindex calc-logunits-add
-@tindex lupoweradd
-@tindex lufieldadd
+@pindex calc-lu-plus
+@tindex lupadd
+@tindex lufadd
@kindex l -
-@pindex calc-logunits-sub
-@tindex lupowersub
-@tindex lufieldsub
+@pindex calc-lu-minus
+@tindex lupsub
+@tindex lufsub
@kindex l *
-@pindex calc-logunits-mul
-@tindex lupowermul
-@tindex lufieldmul
+@pindex calc-lu-times
+@tindex lupmul
+@tindex lufmul
@kindex l /
-@pindex calc-logunits-div
-@tindex lupowerdiv
-@tindex lufielddiv
+@pindex calc-lu-divide
+@tindex lupdiv
+@tindex lufdiv
The sum of two power or field quantities doesn't correspond to the sum
of the corresponding decibel or neper levels. If the powers
corresponding to decibel levels
@@ -28305,13 +28304,13 @@ $$ 10 \log_{10}(10^{D_1/10} + 10^{D_2/10}) {\rm dB}.$$
@end tex
@noindent
-When field quantities are combined, it often means the
-corresponding powers are added and so the above formula might be used.
-In acoustics, for example, the decibel sound pressure level is defined
-using the field formula but the sound pressure levels are combined
-as the sound power levels, and so the above formula should be used. If
-two field quantities themselves are added, the new decibel level will be
-
+When field quantities are combined, it often means the corresponding
+powers are added and so the above formula might be used. In
+acoustics, for example, the sound pressure level is a field quantity
+and so the decibels are often defined using the field formula, but the
+sound pressure levels are combined as the sound power levels, and so
+the above formula should be used. If two field quantities themselves
+are added, the new decibel level will be
@ifnottex
@example
@@ -28349,20 +28348,18 @@ $$ D + 20 \log_{10}(N) {\rm dB}.$$
@end tex
@noindent
-There are similar formulas for combining nepers.
-The @kbd{l +} (@code{calc-logunits-add}) [@code{lupoweradd}] command
-will ``add'' two logarithmic unit power levels this way; with the
-@kbd{H} prefix, @kbd{H l +} [@code{lufieldadd}] will add logarithmic
-unit field levels. Similarly, logarithmic units can be
-``subtracted'' with @kbd{l -} (@code{calc-logunits-sub})
-[@code{lupowersub}] or @kbd{H l -} [@code{lufieldsub}].
-The @kbd{l *} (@code{calc-logunits-mul}) [@code{lupowermul}]
-and @kbd{H l *} [@code{lufieldmul}] commands will ``multiply''
-a logarithmic unit by a number; the @kbd{l /}
-(@code{calc-logunits-divide}) [@code{lupowerdiv}] and
-@kbd{H l /} [@code{lufielddiv}] commands will ``divide'' a
-logarithmic unit by a number. Note that the reference quantities don't
-play a role in this arithmetic.
+There are similar formulas for combining nepers. The @kbd{l +}
+(@code{calc-lu-plus}) [@code{lupadd}] command will ``add'' two
+logarithmic unit power levels this way; with the @kbd{H} prefix,
+@kbd{H l +} [@code{lufadd}] will add logarithmic unit field levels.
+Similarly, logarithmic units can be ``subtracted'' with @kbd{l -}
+(@code{calc-lu-minus}) [@code{lupsub}] or @kbd{H l -} [@code{lufsub}].
+The @kbd{l *} (@code{calc-lu-times}) [@code{lupmul}] and @kbd{H l *}
+[@code{lufmul}] commands will ``multiply'' a logarithmic unit by a
+number; the @kbd{l /} (@code{calc-lu-divide}) [@code{lupdiv}] and
+@kbd{H l /} [@code{lufdiv}] commands will ``divide'' a logarithmic
+unit by a number. Note that the reference quantities don't play a role
+in this arithmetic.
@node Musical Notes, , Logarithmic Units, Units
@section Musical Notes
@@ -35539,16 +35536,16 @@ should also be added to @code{calc-embedded-announce-formula-alist}
and @code{calc-embedded-open-close-plain-alist}.
@end defvar
-@defvar calc-logunits-power-reference
-@defvarx calc-logunits-field-reference
+@defvar calc-lu-power-reference
+@defvarx calc-lu-field-reference
See @ref{Logarithmic Units}.@*
-The variables @code{calc-logunits-power-reference} and
-@code{calc-logunits-field-reference} are unit expressions (written as
+The variables @code{calc-lu-power-reference} and
+@code{calc-lu-field-reference} are unit expressions (written as
strings) which Calc will use as reference quantities for logarithmic
units.
-The default value of @code{calc-logunits-power-reference} is @code{"mW"}
-and the default value of @code{calc-logunits-field-reference} is
+The default value of @code{calc-lu-power-reference} is @code{"mW"}
+and the default value of @code{calc-lu-field-reference} is
@code{"20 uPa"}.
@end defvar
@@ -36209,26 +36206,26 @@ keystrokes are not listed in this summary.
@r{ v x@: I k T @: @: @:ltpt@:(x,v)}
@c
-@r{ a b@: l + @: @: @:lupoweradd@:(a,b)}
-@r{ a b@: H l + @: @: @:lufieldadd@:(a,b)}
-@r{ a b@: l - @: @: @:lupowersub@:(a,b)}
-@r{ a b@: H l - @: @: @:lufieldsub@:(a,b)}
-@r{ a b@: l * @: @: @:lupowermul@:(a,b)}
-@r{ a b@: H l * @: @: @:lufieldmul@:(a,b)}
-@r{ a b@: l / @: @: @:lupowerdiv@:(a,b)}
-@r{ a b@: H l / @: @: @:lufielddiv@:(a,b)}
-@r{ a@: l d @: @: @:dbpowerlevel@:(a)}
-@r{ a b@: O l d @: @: @:dbpowerlevel@:(a,b)}
-@r{ a@: H l d @: @: @:dbfieldlevel@:(a)}
-@r{ a b@: O H l d @: @: @:dbfieldlevel@:(a,b)}
-@r{ a@: l n @: @: @:nppowerlevel@:(a)}
-@r{ a b@: O l n @: @: @:nppowerlevel@:(a,b)}
-@r{ a@: H l n @: @: @:npfieldlevel@:(a)}
-@r{ a b@: O H l n @: @: @:npfieldlevel@:(a,b)}
-@r{ a@: l q @: @: @:powerquant@:(a)}
-@r{ a b@: O l q @: @: @:powerquant@:(a,b)}
-@r{ a@: H l q @: @: @:fieldquant@:(a)}
-@r{ a b@: O H l q @: @: @:fieldquant@:(a,b)}
+@r{ a b@: l + @: @: @:lupadd@:(a,b)}
+@r{ a b@: H l + @: @: @:lufadd@:(a,b)}
+@r{ a b@: l - @: @: @:lupsub@:(a,b)}
+@r{ a b@: H l - @: @: @:lufsub@:(a,b)}
+@r{ a b@: l * @: @: @:lupmul@:(a,b)}
+@r{ a b@: H l * @: @: @:lufmul@:(a,b)}
+@r{ a b@: l / @: @: @:lupdiv@:(a,b)}
+@r{ a b@: H l / @: @: @:lufdiv@:(a,b)}
+@r{ a@: l d @: @: @:dbpower@:(a)}
+@r{ a b@: O l d @: @: @:dbpower@:(a,b)}
+@r{ a@: H l d @: @: @:dbfield@:(a)}
+@r{ a b@: O H l d @: @: @:dbfield@:(a,b)}
+@r{ a@: l n @: @: @:nppower@:(a)}
+@r{ a b@: O l n @: @: @:nppower@:(a,b)}
+@r{ a@: H l n @: @: @:npfield@:(a)}
+@r{ a b@: O H l n @: @: @:npfield@:(a,b)}
+@r{ a@: l q @: @: @:lupquant@:(a)}
+@r{ a b@: O l q @: @: @:lupquant@:(a,b)}
+@r{ a@: H l q @: @: @:lufquant@:(a)}
+@r{ a b@: O H l q @: @: @:lufquant@:(a,b)}
@r{ a@: l s @: @: @:spn@:(a)}
@r{ a@: l m @: @: @:midi@:(a)}
@r{ a@: l f @: @: @:freq@:(a)}
diff --git a/doc/misc/message.texi b/doc/misc/message.texi
index b28639907e..48d0028e45 100644
--- a/doc/misc/message.texi
+++ b/doc/misc/message.texi
@@ -1202,6 +1202,10 @@ The text is killed and replaced with the contents of the variable
@code{message-elide-ellipsis}. The default value is to use an ellipsis
(@samp{[...]}).
+This is a format-spec string, and you can use @samp{%l} to say how
+many lines were removed, and @samp{%c} to say how many characters were
+removed.
+
@item C-c M-k
@kindex C-c M-k
@findex message-kill-address
@@ -1930,6 +1934,25 @@ posting a prepared news message.
@section Insertion Variables
@table @code
+@item message-cite-style
+@vindex message-cite-style
+The overall style to be used when replying to messages. This controls
+things like where the reply should be put relative to the original,
+how the citation is formatted, where the signature goes, etc.
+
+Value is either @code{nil} (no variable overrides) or a let-style list
+of pairs @code{(VARIABLE VALUE)} to override default values.
+
+See @code{gnus-posting-styles} to set this variable for specific
+groups. Presets to impersonate popular mail agents are available in the
+@code{message-cite-style-*} variables.
+
+@item message-cite-reply-position
+@vindex message-cite-reply-position
+Where the reply should be positioned. Available styles are
+@code{traditional} to reply inline, @code{above} for top-posting, and
+@code{below} for bottom-posting
+
@item message-ignored-cited-headers
@vindex message-ignored-cited-headers
All headers that match this regexp will be removed from yanked
@@ -2298,8 +2321,7 @@ created.
@item unique
@item t
-Create the new buffer with the name generated in the Message way. This
-is the default.
+Create the new buffer with the name generated in the Message way.
@item unsent
Similar to @code{unique} but the buffer name begins with "*unsent ".
@@ -2315,7 +2337,7 @@ type, the To address and the group name (any of these may be
@code{nil}). The function should return the new buffer name.
@end table
-The default value is @code{unique}.
+The default value is @code{unsent}.
@item message-max-buffers
@vindex message-max-buffers
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index bdbba437af..e1c4a806de 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -2540,7 +2540,28 @@ Another trick might be that you put @code{ForwardX11 yes} or
that host.
-@subsection Running shell-command on a remote host
+@subsection Running @code{shell} on a remote host
+@cindex shell
+
+Calling @code{M-x shell} in a buffer related to a remote host runs the
+local shell as defined in @option{shell-file-name}. This might be
+also a valid path name for a shell to be applied on the remote host,
+but it will fail at least when your local and remote hosts belong to
+different system types, like @samp{windows-nt} and @samp{gnu/linux}.
+
+You must set the variable @option{explicit-shell-file-name} to the
+shell path name on the remote host, in order to start that shell on
+the remote host.
+
+@ifset emacs
+Starting with Emacs 24 this won't be necessary, if you call
+@code{shell} interactively. You will be asked for the remote shell
+path, if you are on a remote buffer, and if
+@option{explicit-shell-file-name} is equal to @code{nil}.
+@end ifset
+
+
+@subsection Running @code{shell-command} on a remote host
@cindex shell-command
@code{shell-command} allows to execute commands in a shell, either
@@ -2556,13 +2577,13 @@ You will see the buffer @file{*Async Shell Command*}, containing the
continuous output of the @command{tail} command.
-@subsection Running eshell on a remote host
+@subsection Running @code{eshell} on a remote host
@cindex eshell
@value{tramp} is integrated into @file{eshell.el}. That is, you can
open an interactive shell on your remote host, and run commands there.
-After you have started @code{eshell}, you could perform commands like
-this:
+After you have started @code{M-x eshell}, you could perform commands
+like this:
@example
@b{~ $} cd @trampfn{sudo, , , /etc} @key{RET}
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index 437b1372c1..e4c444980c 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -8,7 +8,7 @@
@c In the Tramp CVS, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
-@set trampver 2.2.1-pre
+@set trampver 2.2.1
@c Other flags from configuration
@set instprefix /usr/local
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 13f99b466a..53cd307e3c 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,17 @@
+2011-03-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * NEWS: Document warning about _emacs.
+
+2011-03-14 Michael Albinus <michael.albinus@gmx.de>
+
+ * NEWS: `shell' prompts for the shell path name, when the default
+ directory is a remote file name and neither environment variable
+ $ESHELL nor variable `explicit-shell-file-name' is set.
+
+2011-03-08 Kristoffer Grönlund <krig@koru.se>
+
+ * themes/wombat-theme.el: New file.
+
2011-03-06 Juanma Barranquero <lekktu@gmail.com>
* srecode/el.srt: Fix typo.
@@ -10,15 +24,15 @@
2011-02-17 Ken Manheimer <ken.manheimer@gmail.com>
* etc/images/icons/allout-widgets/dark-bg,
- etc/images/icons/allout-widgets/light-bg,
- encrypted-locked.{xpm,png}, unlocked-encrypted.{xpm,png}:
+ * etc/images/icons/allout-widgets/light-bg,
+ * encrypted-locked.{xpm,png}, unlocked-encrypted.{xpm,png}:
Reorganize icon directories and files to reconcile against windows
short-filename clashes.
2011-02-16 Ken Manheimer <ken.manheimer@gmail.com>
* etc/images/icons/allout-widgets-dark-bg,
- etc/images/icons/allout-widgets-light-bg: Icons for new
+ * etc/images/icons/allout-widgets-light-bg: Icons for new
allout-widgets.el.
* etc/images/icons/README: Include coypright and GPL 3 license for
diff --git a/etc/NEWS b/etc/NEWS
index ac7fdcbab0..a7ec965e3d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -62,6 +62,8 @@ longer have any effect. (They were declared obsolete in Emacs 23.)
** New command line option `--no-site-lisp' removes site-lisp directories
from load-path. -Q now implies this.
+** On Windows, Emacs now warns when the obsolete _emacs init file is used.
+
* Changes in Emacs 24.1
@@ -79,6 +81,9 @@ error, its exit status is 1.
** Completion can cycle, depending on completion-cycle-threshold.
+** `completing-read' can be customized using the new variable
+`completing-read-function'
+
** auto-mode-case-fold is now enabled by default.
+++
@@ -183,8 +188,8 @@ If you have code that adds something to kill-emacs-hook, you should
consider if it is still appropriate to add it in the noninteractive case.
** New scrolling commands `scroll-up-command' and `scroll-down-command'
-(bound to C-v/[next] and M-v/[prior]) does not signal errors at top/bottom
-of buffer at first key-press (instead moves to top/bottom of buffer)
+(bound to C-v/[next] and M-v/[prior]) do not signal errors at top/bottom
+of buffer at first key-press (instead move to top/bottom of buffer)
when a new variable `scroll-error-top-bottom' is non-nil.
** New scrolling commands `scroll-up-line' and `scroll-down-line'
@@ -335,6 +340,10 @@ between applications.
the lines in the current rectangle. With an prefix argument, this
prompts for a number to count from and for a format string.
+** The command shell prompts for the shell path name, when the default
+directory is a remote file name and neither environment variable
+$ESHELL nor variable `explicit-shell-file-name' is set.
+
* Changes in Specialized Modes and Packages in Emacs 24.1
@@ -359,7 +368,7 @@ Just set shell-dir-cookie-re to an appropriate regexp.
** Archive Mode has basic support to browse 7z archives.
** browse-url has gotten a new variable that is used for mailto: URLs,
- `browse-url-mailto-function', which defaults to `browse-url-mail'.
+`browse-url-mailto-function', which defaults to `browse-url-mail'.
** Directory local variables can apply to file-less buffers, in certain modes
(eg dired, vc-dir, log-edit). For example, adding
@@ -645,6 +654,8 @@ binding `log-view-expanded-log-entry-function' to a suitable function.
---
*** `copyright-fix-years' can optionally convert consecutive years to ranges.
+*** New command `nato-region' converts text to NATO phonetic alphabet.
+
* New Modes and Packages in Emacs 24.1
@@ -694,15 +705,14 @@ FIXME: This only says what was changed, but not what are the
programmer-visible consequences.
** Passing a nil argument to a minor mode function now turns the mode
- ON unconditionally.
+ON unconditionally.
** During startup, Emacs no longer adds entries for `menu-bar-lines'
-and `tool-bar-lines' to `default-frame-alist' and
-`initial-frame-alist'. With these alist entries omitted, `make-frame'
-checks the value of the variable `menu-bar-mode'/`tool-bar-mode' to
-determine whether to create a menu-bar or tool-bar, respectively.
-If the alist entries are added, they override the value of
-`menu-bar-mode'/`tool-bar-mode'.
+and `tool-bar-lines' to `default-frame-alist' and `initial-frame-alist'.
+With these alist entries omitted, `make-frame' checks the value of the
+variable `menu-bar-mode'/`tool-bar-mode' to determine whether to create
+a menu-bar or tool-bar, respectively. If the alist entries are added,
+they override the value of `menu-bar-mode'/`tool-bar-mode'.
** Regions created by mouse dragging are now normal active regions,
similar to the ones created by shift-selection. In previous Emacs
@@ -822,13 +832,13 @@ displayed with a "spinning bar".
* Changes in Emacs 24.1 on non-free operating systems
-** New configure.bat option --enable-checking builds emacs with extra
+** New configure.bat option --enable-checking builds Emacs with extra
runtime checks.
** New configure.bat option --distfiles to specify files to be
-included in binary distribution
+included in binary distribution.
-** New make target `dist' to create binary distribution for MS Windows
+** New make target `dist' to create binary distribution for MS Windows.
----------------------------------------------------------------------
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index d15677114a..b4fe0b5923 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -58,3 +58,9 @@
'(window-number-face ((t (:foreground "red" :weight bold)))))
(provide-theme 'tsdh-dark)
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
+;;; tsdh-dark-theme.el ends here
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index 9fac27fda1..4eda7a4b7c 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -57,3 +57,10 @@
'(window-number-face ((t (:foreground "red" :weight bold)))))
(provide-theme 'tsdh-light)
+
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
+;;; tsdh-light-theme.el ends here
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el
new file mode 100644
index 0000000000..6a16b52ee2
--- /dev/null
+++ b/etc/themes/wombat-theme.el
@@ -0,0 +1,108 @@
+;;; wombat-theme.el --- Custom face theme for Emacs
+
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+
+;; Author: Kristoffer Grönlund <krig@koru.se>
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(deftheme wombat
+ "Theme for faces, using easy-on-the eyes colors on a dark gray background.
+Adapted, with permission, from a Vim color scheme by Lars H. Nielsen.
+Basic, Font Lock, Isearch, Gnus, Message, and Ansi-Color faces
+are included.")
+
+(let ((class '((class color) (min-colors 89))))
+ (custom-theme-set-faces
+ 'wombat
+ `(default ((,class (:background "#242424" :foreground "#f6f3e8"))))
+ `(cursor ((,class (:background "#656565" :foreground "#f6f3e8"))))
+ ;; Highlighting faces
+ `(fringe ((,class (:background "#303030"))))
+ `(highlight ((,class (:background "#454545" :foreground "#ffffff"
+ :underline t))))
+ `(region ((,class (:background "#444444" :foreground "#f6f3e8"))))
+ `(secondary-selection ((,class (:background "#333366" :foreground "#f6f3e8"))))
+ `(isearch ((,class (:background "#343434" :foreground "#857b6f"))))
+ `(lazy-highlight ((,class (:background "#384048" :foreground "#a0a8b0"))))
+ ;; Mode line faces
+ `(mode-line ((,class (:background "#444444" :foreground "#f6f3e8"))))
+ `(mode-line-inactive ((,class (:background "#444444" :foreground "#857b6f"))))
+ ;; Escape and prompt faces
+ `(minibuffer-prompt ((,class (:foreground "#e5786d"))))
+ `(escape-glyph ((,class (:foreground "#ddaa6f" :weight bold))))
+ ;; Font lock faces
+ `(font-lock-builtin-face ((,class (:foreground "#e5786d"))))
+ `(font-lock-comment-face ((,class (:foreground "#99968b"))))
+ `(font-lock-constant-face ((,class (:foreground "#e5786d"))))
+ `(font-lock-function-name-face ((,class (:foreground "#cae682"))))
+ `(font-lock-keyword-face ((,class (:foreground "#8ac6f2" :weight bold))))
+ `(font-lock-string-face ((,class (:foreground "#95e454"))))
+ `(font-lock-type-face ((,class (:foreground "#92a65e" :weight bold))))
+ `(font-lock-variable-name-face ((,class (:foreground "#cae682"))))
+ `(font-lock-warning-face ((,class (:foreground "#ccaa8f"))))
+ ;; Button and link faces
+ `(link ((,class (:foreground "#8ac6f2" :underline t))))
+ `(link-visited ((,class (:foreground "#e5786d" :underline t))))
+ `(button ((,class (:background "#333333" :foreground "#f6f3e8"))))
+ `(header-line ((,class (:background "#303030" :foreground "#e7f6da"))))
+ ;; Gnus faces
+ `(gnus-group-news-1 ((,class (:weight bold :foreground "#95e454"))))
+ `(gnus-group-news-1-low ((,class (:foreground "#95e454"))))
+ `(gnus-group-news-2 ((,class (:weight bold :foreground "#cae682"))))
+ `(gnus-group-news-2-low ((,class (:foreground "#cae682"))))
+ `(gnus-group-news-3 ((,class (:weight bold :foreground "#ccaa8f"))))
+ `(gnus-group-news-3-low ((,class (:foreground "#ccaa8f"))))
+ `(gnus-group-news-4 ((,class (:weight bold :foreground "#99968b"))))
+ `(gnus-group-news-4-low ((,class (:foreground "#99968b"))))
+ `(gnus-group-news-5 ((,class (:weight bold :foreground "#cae682"))))
+ `(gnus-group-news-5-low ((,class (:foreground "#cae682"))))
+ `(gnus-group-news-low ((,class (:foreground "#99968b"))))
+ `(gnus-group-mail-1 ((,class (:weight bold :foreground "#95e454"))))
+ `(gnus-group-mail-1-low ((,class (:foreground "#95e454"))))
+ `(gnus-group-mail-2 ((,class (:weight bold :foreground "#cae682"))))
+ `(gnus-group-mail-2-low ((,class (:foreground "#cae682"))))
+ `(gnus-group-mail-3 ((,class (:weight bold :foreground "#ccaa8f"))))
+ `(gnus-group-mail-3-low ((,class (:foreground "#ccaa8f"))))
+ `(gnus-group-mail-low ((,class (:foreground "#99968b"))))
+ `(gnus-header-content ((,class (:foreground "#8ac6f2"))))
+ `(gnus-header-from ((,class (:weight bold :foreground "#95e454"))))
+ `(gnus-header-subject ((,class (:foreground "#cae682"))))
+ `(gnus-header-name ((,class (:foreground "#8ac6f2"))))
+ `(gnus-header-newsgroups ((,class (:foreground "#cae682"))))
+ ;; Message faces
+ `(message-header-name ((,class (:foreground "#8ac6f2" :weight bold))))
+ `(message-header-cc ((,class (:foreground "#95e454"))))
+ `(message-header-other ((,class (:foreground "#95e454"))))
+ `(message-header-subject ((,class (:foreground "#cae682"))))
+ `(message-header-to ((,class (:foreground "#cae682"))))
+ `(message-cited-text ((,class (:foreground "#99968b"))))
+ `(message-separator ((,class (:foreground "#e5786d" :weight bold))))))
+
+(custom-theme-set-variables
+ 'wombat
+ '(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682"
+ "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"]))
+
+(provide-theme 'wombat)
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
+;;; wombat-theme.el ends here
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 4b50b2ddde..bd1a84cf0b 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -119,7 +119,7 @@
($(BLD)/etags.$(O), $(BLD)/movemail.$(O), $(BLD)/ntlib.$(O)):
Depend on $(EMACS_ROOT)/nt/inc/sys/stat.h.
-2011-02-21 Ben Key <bkey76@gmail.com> (tiny change)
+2011-02-21 Ben Key <bkey76@gmail.com>
* make-docfile.c (scan_c_file): Adapt DEFVAR_PER_BUFFER case to
the new BVAR macro.
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index b5fd4a358d..cd6a1d00c1 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value lstat mktime readlink strftime symlink sys_stat
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink strftime symlink sys_stat
MOSTLYCLEANFILES += core *.stackdump
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 61cdcc5392..13fae7b670 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -355,7 +355,11 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
#if @GNULIB_FUTIMENS@
-# if @REPLACE_FUTIMENS@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
+ implementation relies on futimesat, which on Solaris 10 makes an invocation
+ to futimens that is meant to invoke the libc's futimens(), not gnulib's
+ futimens(). */
+# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef futimens
# define futimens rpl_futimens
@@ -368,7 +372,9 @@ _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif
_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif
+# if @HAVE_FUTIMENS@
_GL_CXXALIASWARN (futimens);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef futimens
# if HAVE_RAW_DECL_FUTIMENS
@@ -612,7 +618,11 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
#if @GNULIB_UTIMENSAT@
-# if @REPLACE_UTIMENSAT@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
+ implementation relies on futimesat, which on Solaris 10 makes an invocation
+ to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
+ utimensat(). */
+# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef utimensat
# define utimensat rpl_utimensat
@@ -631,7 +641,9 @@ _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag));
# endif
+# if @HAVE_UTIMENSAT@
_GL_CXXALIASWARN (utimensat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef utimensat
# if HAVE_RAW_DECL_UTIMENSAT
diff --git a/lisp/ChangeLog.trunk b/lisp/ChangeLog.trunk
index e4d402afa7..d087982ede 100644
--- a/lisp/ChangeLog.trunk
+++ b/lisp/ChangeLog.trunk
@@ -1,3 +1,410 @@
+2011-03-21 Glenn Morris <rgm@gnu.org>
+
+ * eshell/esh-opt.el (eshell-eval-using-options, eshell-process-args):
+ Doc fixes.
+
+2011-03-21 Chong Yidong <cyd@stupidchicken.com>
+
+ * cus-theme.el: Add missing provide statement.
+ (customize-create-theme): Extract theme value correctly.
+ (custom-theme-visit-theme): Autoload.
+ (customize-create-theme): Prompt before inserting default faces.
+
+2011-03-20 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc-menu.el (calc-units-menu): Add entries for logarithmic
+ units and musical notes.
+
+2011-03-20 Leo <sdl.web@gmail.com>
+
+ * ido.el (ido-read-internal): Use completing-read-default.
+ (ido-completing-read): Fix compatibility with completing-read.
+
+2011-03-20 Christian Ohler <ohler@gnu.org>
+
+ * emacs-lisp/ert.el (ert-run-tests-batch): Remove unused variable.
+ (ert-delete-all-tests): Use `called-interactively-p' rather than
+ `interactive-p'.
+ (ert--make-xrefs-region): Respect END.
+
+2011-03-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * dired-aux.el (dired-create-directory): Signal an error if the
+ directory already exists (Bug#8246).
+
+ * facemenu.el (list-colors-display): Call list-faces-display
+ inside with-help-window.
+ (list-colors-print): Use display property to align the final
+ column, instead of checking window-width.
+
+2011-03-19 Eli Zaretskii <eliz@gnu.org>
+
+ * emerge.el (emerge-metachars): Separate value for ms-dos and
+ windows-nt systems.
+ (emerge-protect-metachars): Quote correctly for ms-dos and
+ windows-nt systems.
+
+2011-03-19 Ralph Schleicher <rs@ralph-schleicher.de>
+
+ * info.el (info-initialize): Replace all uses of `:' with
+ path-separator for compatibility with non-Unix systems.
+ Cache quoting of path-separator. (Bug#8258)
+
+2011-03-19 Juanma Barranquero <lekktu@gmail.com>
+
+ * avoid.el (mouse-avoidance-mode, mouse-avoidance-nudge-dist)
+ (mouse-avoidance-threshold, mouse-avoidance-banish-destination)
+ (mouse-avoidance-mode): Fix typos in docstrings.
+
+2011-03-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * startup.el (package-subdirectory-regexp): Move from package.el.
+ Omit \\` and \\', and let callers add them.
+
+ * emacs-lisp/package.el (package-strip-version)
+ (package-load-all-descriptors): Add \\` and \\' to
+ package-subdirectory-regexp before using it.
+ (package-untar-buffer): New arg DIR; ensure that file untars only
+ into this expected directory. Remove superfluous delete-region.
+ (package-unpack): Caller changed.
+ (package-tar-file-info): Use package-subdirectory-regexp.
+
+2011-03-18 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc/diff-mode.el (diff-mode-map): Shadow problematic bindings from
+ diff-mode-shared-map (bug#8284).
+ (diff-mode-shared-map): Re-introduce some bindings that were problematic.
+
+2011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * calendar/time-date.el (format-seconds): Use assoc instead of
+ assoc-string, since assoc-string doesn't exist in XEmacs.
+
+2011-03-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * custom.el (custom-known-themes): Reflow docstring.
+ (custom-theme-load-path): Fix typo in docstring.
+ (load-theme): Fix typo in error message.
+ (custom-available-themes, custom-variable-theme-value):
+ Use `let', not `let*'.
+
+2011-03-17 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/README: Mention inclusion of musical notes.
+
+ * calc/calc-units.el (calc-lu-quant): Rename from
+ `calc-logunits-quantity'.
+ (calcFunc-lupquant): Rename from `calcFunc-powerquant'.
+ (calcFunc-lufquant): Rename from `calcFunc-fieldquant'.
+ (calc-db): Rename from `calc-dblevel'.
+ (calcFunc-dbpower): Rename from `calcFunc-dbpowerlevel'.
+ (calcFunc-dbfield): Rename from `calcFunc-dbfieldlevel'.
+ (calc-np): Rename from `calc-nplevel'.
+ (calcFunc-nppower): Rename from `calcFunc-nppowerlevel'.
+ (calcFunc-npfield): Rename from `calcFunc-npfieldlevel'.
+ (calc-lu-plus): Rename from `calc-logunits-add'.
+ (calcFunc-lupadd): Rename from `calcFunc-lupoweradd'.
+ (calcFunc-lufadd): Rename from `calcFunc-lufieldadd'.
+ (calc-lu-minus): Rename from `calc-logunits-sub'.
+ (calcFunc-lupsub): Rename from `calcFunc-lupowersub'.
+ (calcFunc-lufsub): Rename from `calcFunc-lufieldsub'.
+ (calc-lu-times): Rename from `calc-logunits-mul'.
+ (calcFunc-lupmul): Rename from `calcFunc-lupowermul'.
+ (calcFunc-lufmul): Rename from `calcFunc-lufieldmul'.
+ (calc-lu-divide): Rename from `calc-logunits-div'.
+ (calcFunc-lupdiv): Rename from `calcFunc-lupowerdiv'.
+ (calcFunc-lufdiv): Rename from `calcFunc-lufielddiv'.
+
+ * calc/calc-ext.el (calc-init-extensions): Update the names of the
+ functions being autoloaded.
+
+ * calc/calc.el (calc-lu-power-reference): Rename from
+ `calc-logunits-power-reference'.
+ (calc-lu-field-reference): Rename from
+ `calc-logunits-field-reference'.
+
+ * calc/calc-help (calc-l-prefix-help): Mention musical note functions.
+
+2011-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * minibuffer.el (completion-all-sorted-completions):
+ Use :completion-cycle-penalty text property if present.
+
+2011-03-16 Ken Manheimer <ken.manheimer@gmail.com>
+
+ * allout.el (allout-yank-processing): Adjust for new rebulleting
+ regime so bullet being yanked is used without prompting the user
+ for a choice.
+
+2011-03-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * startup.el (command-line): Warn the user that _emacs is deprecated.
+
+2011-03-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * progmodes/delphi.el (delphi-search-path, delphi-indent-level)
+ (delphi-verbose, delphi-comment-face, delphi-string-face)
+ (delphi-keyword-face, delphi-ignore-changes, delphi-indent-line)
+ (delphi-mode-abbrev-table, delphi-debug-buffer, delphi-tab)
+ (delphi-find-unit, delphi-find-current-xdef, delphi-fill-comment)
+ (delphi-new-comment-line, delphi-font-lock-defaults)
+ (delphi-debug-mode-map, delphi-mode-syntax-table, delphi-mode):
+ Fix typos in docstrings.
+
+2011-03-15 Ken Manheimer <ken.manheimer@gmail.com>
+
+ * allout.el (allout-make-topic-prefix, allout-rebullet-heading):
+ Invert the roles of character and string values for INSTEAD, so a
+ string is used for the more common case of a defaulting prompt.
+
+2011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/ruby-mode.el (ruby-backward-sexp):
+ * progmodes/ebrowse.el (ebrowse-draw-file-member-info):
+ * play/gamegrid.el (gamegrid-make-face):
+ * play/bubbles.el (bubbles--grid-width, bubbles--grid-height)
+ (bubbles--colors, bubbles--shift-mode, bubbles--initialize-images):
+ * notifications.el (notifications-notify):
+ * net/xesam.el (xesam-search-engines):
+ * net/quickurl.el (quickurl-list-insert):
+ * vc/vc-hg.el (vc-hg-dir-printer): Fix use of case.
+
+2011-03-15 Chong Yidong <cyd@stupidchicken.com>
+
+ * startup.el (command-line): Update package subdirectory regexp.
+
+2011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * allout.el (allout-abbreviate-flattened-numbering)
+ (allout-mode-deactivate-hook): Fix up obsolescence "date".
+
+ * subr.el (read-char-choice): Only show the cursor after the prompt,
+ not after the answer.
+
+2011-03-15 Kevin Ryde <user42@zip.com.au>
+
+ * help-fns.el (variable-at-point): Skip leading quotes, if any
+ (bug#8253).
+
+2011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/bytecomp.el (byte-compile-save-excursion): Change the
+ warning message.
+
+2011-03-14 Michael Albinus <michael.albinus@gmx.de>
+
+ * shell.el (shell): When called interactively, offer to change the
+ shell file name on remote hosts.
+
+2011-03-13 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * net/ldap.el (ldap-search-internal): Add `auth-source-search'
+ integration for LDAP parameters. The host, base, user or binddn,
+ and secret tokens can be specified in a netrc file, for instance.
+ This is optional because an `auth-source' parameter must be
+ specified in the search attributes.
+
+2011-03-13 Juanma Barranquero <lekktu@gmail.com>
+
+ * help.el (describe-mode): Link to the mode's definition (bug#8185).
+
+2011-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization
+ into declaration. Remove redundant and harmful binding.
+
+2011-03-12 Eli Zaretskii <eliz@gnu.org>
+
+ * files.el (file-ownership-preserved-p): Pass `integer' as an
+ explicit 2nd argument to `file-attributes'. If the file's owner
+ is the Administrators group on Windows, and the current user is
+ Administrator, consider that a match.
+
+ * server.el (server-ensure-safe-dir): Consider server directory
+ safe on MS-Windows if its owner is the Administrators group while
+ the current Emacs user is Administrator. Use `=' to compare
+ numerical UIDs, since they could be integers or floats.
+
+2011-03-12 Juanma Barranquero <lekktu@gmail.com>
+
+ * vc/vc-bzr.el (vc-bzr-state): Handle bzr 2.3.0 (follow-up to bug#8170).
+
+2011-03-12 Michael Albinus <michael.albinus@gmx.de>
+
+ Sync with Tramp 2.2.1.
+
+ * net/tramp-sh.el (tramp-methods): Exchange "%k" marker with options.
+
+ * net/trampver.el: Update release number.
+
+2011-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/compile.el (compilation--previous-directory): Fix up
+ various nil/dead-marker mismatches (bug#8014).
+ (compilation-directory-properties, compilation-error-properties):
+ Don't call it at a position past the one we're about to change.
+
+ * emacs-lisp/bytecomp.el (byte-compile-make-obsolete-variable):
+ Disable obsolescence warnings in the file that declares it.
+
+2011-03-11 Ken Manheimer <ken.manheimer@gmail.com>
+
+ * allout-widgets.el (allout-widgets-tally): Initialize
+ allout-widgets-tally as a hash table rather than nil to prevent
+ mode-line redisplay warnings.
+ Also, clarify the module description and fix a comment typo.
+
+2011-03-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * help-fns.el (describe-variable): Don't complete keywords.
+ Suggested by Teodor Zlatanov <tzz@lifelogs.com>.
+
+2011-03-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * emacs-lisp/package.el (package-version-join): Impose a standard
+ string representation for pre/alpha/beta version lists.
+ (package-unpack-single): Standardize the directory name by passing
+ it through package-version-join.
+ (package-strip-rcs-id): Accept any version string that does not
+ signal an error in version-to-list.
+
+2011-03-10 Michael Albinus <michael.albinus@gmx.de>
+
+ * simple.el (delete-trailing-whitespace): Return nil for the
+ benefit of `write-file-functions'.
+
+2011-03-10 Glenn Morris <rgm@gnu.org>
+
+ * vc/vc-hg.el (vc-hg-pull, vc-hg-merge-branch): Use vc-hg-program.
+
+ * vc/vc-git.el (vc-git-program): New option.
+ (vc-git-branches, vc-git-pull, vc-git-merge-branch, vc-git-command)
+ (vc-git--call): Use it.
+
+ * eshell/esh-util.el (eshell-condition-case): Doc fix.
+
+ * cus-edit.el (Custom-newline): If no button at point, look
+ for a subgroup button at start-of-line. (Bug#2298)
+
+ * mail/rmail.el (rmail-msgend, rmail-msgbeg): Doc fixes.
+
+2011-03-10 Julien Danjou <julien@danjou.info>
+
+ * avoid.el (mouse-avoidance-ignore-p): Do not move the cursor if
+ `cursor-type' is nil.
+
+2011-03-09 Jay Belanger <jay.p.belanger@gmail.com>
+
+ * calc/calc.el (calc-mode-map): Don't bind "C-_" to `calc-missing-key'.
+
+2011-03-09 Ken Manheimer <ken.manheimer@gmail.com>
+
+ * allout.el Summary: Change so yank of distinctive-bullet items
+ preserves the existing header prefix, rebulleting it if necessary,
+ rather than replacing it. This is necessary for proper operation
+ of cooperative addons like allout-widgets.
+ (allout-make-topic-prefix, allout-rebullet-heading): Change
+ SOLICIT arg to INSTEAD, and interpret additionally a string value
+ as alternate bullet to be used, instead of prompting the user for
+ a bullet character.
+
+2011-03-09 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Do
+ not use `tramp-file-name-port', because this returns also
+ `tramp-default-port'.
+
+2011-03-09 Deniz Dogan <deniz.a.m.dogan@gmail.com>
+
+ * net/rcirc.el (rcirc-handler-001): Remove useless
+ with-rcirc-process-buffer.
+ (rcirc-check-auth-status): Swap arguments to string-match.
+
+2011-03-09 Glenn Morris <rgm@gnu.org>
+
+ * shell.el (shell-mode):
+ Set comint-input-ring-size from HISTSIZE. (Bug#7889)
+
+ * progmodes/gdb-mi.el (gdb): Improve 2010-12-08 change.
+ Check for GDBHISTFILE, HISTSIZE, etc. (Bug#7889)
+
+2011-03-08 Chong Yidong <cyd@stupidchicken.com>
+
+ * emacs-lisp/package.el (package-refresh-contents)
+ (package-menu-execute): Use condition-case-no-debug.
+
+2011-03-08 Michael Albinus <michael.albinus@gmx.de>
+
+ * simple.el (shell-command-to-string): Use `process-file'.
+
+ * emacs-lisp/package.el (package-tar-file-info): Handle also
+ remote files.
+
+ * emacs-lisp/package-x.el (package-upload-buffer-internal): Use
+ `equal' for upload base check.
+
+2011-03-08 Arni Magnusson <arnima@hafro.is> (tiny change)
+
+ * textmodes/texinfo.el (texinfo-environments):
+ Add deftypecv, deftypeivar, deftypemethod, deftypeop, html. (Bug#2783)
+
+2011-03-08 Glenn Morris <rgm@gnu.org>
+
+ * cus-start.el (cursor-in-non-selected-windows):
+ Fix :set quoting oddness. (Bug#8192)
+
+ * font-lock.el (lisp-font-lock-keywords-1): Don't highlight `)'
+ in some setf expressions. (Bug#2159)
+
+2011-03-08 Chong Yidong <cyd@stupidchicken.com>
+
+ * custom.el (custom-available-themes): Return themes in
+ alphabetical order.
+
+2011-03-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * progmodes/cc-cmds.el (c-beginning-of-statement): Fix incorrect
+ application of patch from Alan Mackenzie (Bug#7595).
+
+2011-03-07 Deniz Dogan <deniz.a.m.dogan@gmail.com>
+
+ * net/rcirc.el (rcirc-connect): Fix PASS bug.
+
+2011-03-07 Glenn Morris <rgm@gnu.org>
+
+ * vc/vc.el (vc-next-action): Add missing space to y-or-n-p prompt.
+ Give an explicit error if failed to make writable. (Bug#6146)
+
+2011-03-07 Ed Reingold <reingold@emr.cs.iit.edu>
+
+ * calendar/cal-hebrew.el (diary-hebrew-yahrzeit):
+ Add optional `after-sunset' argument. (Bug#8190)
+
+2011-03-07 Aaron S. Hawley <aaron.s.hawley@gmail.com>
+
+ * play/morse.el (nato-alphabet, nato-region, denato-region):
+ New variable and functions. (Bug#2288)
+ (morse-region, unmorse-region): Barf if read-only.
+
+2011-03-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/gud.el (gdb-script-syntax-propertize-function):
+ Don't change the syntax of a \n that closes a comment (bug#8169).
+
+2011-03-06 Chong Yidong <cyd@stupidchicken.com>
+
+ * emacs-lisp/package-x.el (package-archive-upload-base): Make it a
+ defcustom.
+ (package--update-file): Doc fix. Accept relative file names.
+ (package--archive-contents-from-file): Remove the argument, since
+ it's necessarily always "archive-contents".
+ (package-maint-add-news-item): Pass relative file name args to
+ package--update-file.
+ (package-upload-buffer-internal): Prompt for a destination if
+ package-archive-upload-base is invalid. Create the directory if
+ it does not exist.
+ (package-upload-buffer, package-upload-file): Doc fix.
+
2011-03-06 Chong Yidong <cyd@stupidchicken.com>
* isearch.el (isearch-mode-map): Bind C-y to isearch-yank-kill,
@@ -11,8 +418,8 @@
2011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
- * calc/calc-ext.el (calc-init-extensions): Rename
- calc-logunits-dblevel and calc-logunits-nplevel to calc-dblevel
+ * calc/calc-ext.el (calc-init-extensions):
+ Rename calc-logunits-dblevel and calc-logunits-nplevel to calc-dblevel
and calc-nplevel, respectively. Add keybindings for calc-spn,
calc-midi and calc-freq. Add autoloads for calcFunc-spn,
calcFunc-midi, calcFunc-freq, calc-spn, calc-midi and calc-freq.
@@ -732,7 +1139,7 @@
2011-02-17 Ken Manheimer <ken.manheimer@gmail.com>
* lisp/allout-widgets.el (allout-widgets-icons-light-subdir)
- (allout-widgets-icons-dark-subdir): Track relocations of icons
+ (allout-widgets-icons-dark-subdir): Track relocations of icons.
* lisp/allout.el: Remove commentary about remove encryption
passphrase mnemonic support and verification.
(allout-encrypt-string): Recognize epg failure to decrypt gpg2
@@ -1109,10 +1516,9 @@
(allout-auto-activation-helper, allout-setup): New autoloads
implement new custom set procedure for allout-auto-activation.
- Also, explicitly invoke
- (allout-setup) after allout-auto-activation is custom-defined, to
- effect the settings in emacs sessions besides the few where
- allout-auto-activation customization is donea.
+ Also, explicitly invoke (allout-setup) after allout-auto-activation
+ is custom-defined, to affect the settings in emacs sessions besides
+ the few where allout-auto-activation customization is done.
(allout-auto-activation): Use allout-auto-activation-helper to
:set. Revise the docstring.
(allout-init): Reduce functionality to just customizing
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index cc5fd6d96f..47f181ab76 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -1,4 +1,4 @@
-;; allout-widgets.el --- Show allout outline structure with graphical widgets.
+;; allout-widgets.el --- Visually highlight allout outline structure.
;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ken Manheimer
@@ -238,7 +238,7 @@ buffer, and tracking increases as new widgets are added and
decreases as obsolete widgets are garbage collected."
:type 'boolean
:group 'allout-widgets-developer)
-(defvar allout-widgets-tally nil
+(defvar allout-widgets-tally (make-hash-table :test 'eq :weakness 'key)
"Hash-table of existing allout widgets, for debugging.
Table is maintained iff `allout-widgets-maintain-tally' is non-nil.
diff --git a/lisp/allout.el b/lisp/allout.el
index c75b7a22f9..3fb8ed7ccd 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -310,6 +310,7 @@ Auto-layout is not.
With value nil, inhibit any automatic allout-mode activation."
:set 'allout-auto-activation-helper
+ ;; FIXME: Using strings here is unusual and less efficient than symbols.
:type '(choice (const :tag "On" t)
(const :tag "Ask about layout" "ask")
(const :tag "Mode only" "activate")
@@ -752,7 +753,7 @@ Set this var to the bullet you want to use for file cross-references."
;;;_ = allout-flattened-numbering-abbreviation
(define-obsolete-variable-alias 'allout-abbreviate-flattened-numbering
- 'allout-flattened-numbering-abbreviation "24.0")
+ '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
@@ -1402,7 +1403,7 @@ their settings before allout-mode was started."
(defvar allout-mode-deactivate-hook nil
"*Hook that's run when allout mode ends.")
(define-obsolete-variable-alias 'allout-mode-deactivate-hook
- 'allout-mode-off-hook "future")
+ 'allout-mode-off-hook "24.1")
;;;_ = allout-exposure-category
(defvar allout-exposure-category nil
"Symbol for use as allout invisible-text overlay category.")
@@ -3465,13 +3466,13 @@ Offer one suitable for current depth DEPTH as default."
(defun allout-make-topic-prefix (&optional prior-bullet
new
depth
- solicit
+ instead
number-control
index)
;; Depth null means use current depth, non-null means we're either
;; opening a new topic after current topic, lower or higher, or we're
;; changing level of current topic.
- ;; Solicit dominates specified bullet-char.
+ ;; Instead dominates specified bullet-char.
;;;_ . Doc string:
"Generate a topic prefix suitable for optional arg DEPTH, or current depth.
@@ -3492,15 +3493,18 @@ bullet or previous sibling.
Third arg DEPTH forces the topic prefix to that depth, regardless of
the current topics' depth.
-If SOLICIT is non-nil, then the choice of bullet is solicited from
-user. If it's a character, then that character is offered as the
-default, otherwise the one suited to the context (according to
-distinction or depth) is offered. (This overrides other options,
-including, eg, a distinctive PRIOR-BULLET.) If non-nil, then the
-context-specific bullet is used.
+If INSTEAD is:
+
+- nil, then the bullet char for the context is used, per distinction or depth
+- a \(numeric) character, then character's string representation is used
+- a string, then the user is asked for bullet with the first char as default
+- anything else, the user is solicited with bullet char per context as default
+
+\(INSTEAD overrides other options, including, eg, a distinctive
+PRIOR-BULLET.)
Fifth arg, NUMBER-CONTROL, matters only if `allout-numbered-bullet'
-is non-nil *and* soliciting was not explicitly invoked. Then
+is non-nil *and* no specific INSTEAD was specified. Then
NUMBER-CONTROL non-nil forces prefix to either numbered or
denumbered format, depending on the value of the sixth arg, INDEX.
@@ -3549,8 +3553,13 @@ index for each successive sibling)."
;; Solicitation overrides numbering and other cases:
((progn (setq body (make-string (- depth 2) ?\ ))
;; The actual condition:
- solicit)
- (let* ((got (allout-solicit-alternate-bullet depth solicit)))
+ instead)
+ (let ((got (cond ((stringp instead)
+ (if (> (length instead) 0)
+ (allout-solicit-alternate-bullet
+ depth (substring instead 0 1))))
+ ((characterp instead) (char-to-string instead))
+ (t (allout-solicit-alternate-bullet depth)))))
;; Gotta check whether we're numbering and got a numbered bullet:
(setq numbering (and allout-numbered-bullet
(not (and number-control (not index)))
@@ -3913,7 +3922,7 @@ Note that refill of indented paragraphs is not done."
(allout-end-of-prefix)
(setq from allout-recent-prefix-beginning
to allout-recent-prefix-end)
- (allout-rebullet-heading t ;;; solicit
+ (allout-rebullet-heading t ;;; instead
nil ;;; depth
nil ;;; number-control
nil ;;; index
@@ -3931,8 +3940,8 @@ Note that refill of indented paragraphs is not done."
(message "Done.")
(cond (on-bullet (goto-char (allout-current-bullet-pos)))
(initial-col (move-to-column initial-col)))))
-;;;_ > allout-rebullet-heading (&optional solicit ...)
-(defun allout-rebullet-heading (&optional solicit
+;;;_ > allout-rebullet-heading (&optional instead ...)
+(defun allout-rebullet-heading (&optional instead
new-depth
number-control
index
@@ -3942,11 +3951,11 @@ Note that refill of indented paragraphs is not done."
All args are optional.
-If SOLICIT is non-nil, then the choice of bullet is solicited from
-user. If it's a character, then that character is offered as the
-default, otherwise the one suited to the context (according to
-distinction or depth) is offered. If non-nil, then the
-context-specific bullet is just used.
+If INSTEAD is:
+- nil, then the bullet char for the context is used, per distinction or depth
+- a \(numeric) character, then character's string representation is used
+- a string, then the user is asked for bullet with the first char as default
+- anything else, the user is solicited with bullet char per context as default
Second arg DEPTH forces the topic prefix to that depth, regardless
of the topic's current depth.
@@ -3981,7 +3990,7 @@ this function."
(new-prefix (allout-make-topic-prefix current-bullet
nil
new-depth
- solicit
+ instead
number-control
index)))
@@ -4028,7 +4037,7 @@ this function."
(cond ((numberp index) (1+ index))
((not number-control) (allout-sibling-index))))
(if (allout-numbered-type-prefix)
- (allout-rebullet-heading nil ;;; solicit
+ (allout-rebullet-heading nil ;;; instead
new-depth ;;; new-depth
number-control;;; number-control
index ;;; index
@@ -4145,7 +4154,7 @@ a topic and its immediate offspring is greater than one.)"
(when (< relative-depth 0)
(save-excursion
(goto-char local-point)
- (allout-rebullet-heading nil ;;; solicit
+ (allout-rebullet-heading nil ;;; instead
(+ starting-depth relative-depth)
nil ;;; number
starting-index
@@ -4203,7 +4212,7 @@ Returns final depth."
; Prime ascender for ascension:
(setq ascender (1- allout-recent-depth))
(if (>= allout-recent-depth depth)
- (allout-rebullet-heading nil ;;; solicit
+ (allout-rebullet-heading nil ;;; instead
nil ;;; depth
nil ;;; number-control
nil ;;; index
@@ -4230,7 +4239,7 @@ rebulleting each topic at this level."
(use-bullet (equal '(16) denumber))
(more t))
(while more
- (allout-rebullet-heading use-bullet ;;; solicit
+ (allout-rebullet-heading use-bullet ;;; instead
depth ;;; depth
t ;;; number-control
index ;;; index
@@ -4577,32 +4586,20 @@ however, are left exactly like normal, non-allout-specific yanks."
(progn (widen)
(forward-char -1)
(narrow-to-region subj-beg (point))))))
- ;; Preserve new bullet if it's a distinctive one, otherwise
- ;; use old one:
- (if (string-match (regexp-quote prefix-bullet)
- allout-distinctive-bullets-string)
- ; Delete from bullet of old to
- ; before bullet of new:
- (progn
- (beginning-of-line)
- (allout-unprotected
- (delete-region (point) subj-beg))
- (set-marker (allout-mark-marker t) subj-end)
- (goto-char subj-beg)
- (allout-end-of-prefix))
- ; Delete base subj prefix,
- ; leaving old one:
- (allout-unprotected
- (progn
- (delete-region (point) (+ (point)
- prefix-len
- (- adjust-to-depth
- subj-depth)))
+ ;; Remove new heading prefix:
+ (allout-unprotected
+ (progn
+ (delete-region (point) (+ (point)
+ prefix-len
+ (- adjust-to-depth
+ subj-depth)))
; and delete residual subj
; prefix digits and space:
- (while (looking-at "[0-9]") (delete-char 1))
- (if (looking-at " ")
- (delete-char 1))))))
+ (while (looking-at "[0-9]") (delete-char 1))
+ (if (looking-at " ")
+ (delete-char 1))))
+ ;; Assert new topic's bullet - minimal effort if unchanged:
+ (allout-rebullet-heading (string-to-char prefix-bullet)))
(exchange-point-and-mark))))
(if rectify-numbering
(progn
@@ -4613,7 +4610,7 @@ however, are left exactly like normal, non-allout-specific yanks."
(goto-char subj-beg)
(if (allout-goto-prefix-doublechecked)
(allout-unprotected
- (allout-rebullet-heading nil ;;; solicit
+ (allout-rebullet-heading nil ;;; instead
(allout-depth) ;;; depth
nil ;;; number-control
nil ;;; index
diff --git a/lisp/avoid.el b/lisp/avoid.el
index fe47a0c4a3..038927105e 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -76,7 +76,7 @@
;;;###autoload
(defcustom mouse-avoidance-mode nil
- "Activate mouse avoidance mode.
+ "Activate Mouse Avoidance mode.
See function `mouse-avoidance-mode' for possible values.
Setting this variable directly does not take effect;
use either \\[customize] or the function `mouse-avoidance-mode'."
@@ -85,8 +85,7 @@ use either \\[customize] or the function `mouse-avoidance-mode'."
(mouse-avoidance-mode (or value 'none)))
:initialize 'custom-initialize-default
:type '(choice (const :tag "none" nil) (const banish) (const jump)
- (const animate) (const exile) (const proteus)
- )
+ (const animate) (const exile) (const proteus))
:group 'avoid
:require 'avoid
:version "20.3")
@@ -94,7 +93,7 @@ use either \\[customize] or the function `mouse-avoidance-mode'."
(defcustom mouse-avoidance-nudge-dist 15
"Average distance that mouse will be moved when approached by cursor.
-Only applies in Mouse-Avoidance mode `jump' and its derivatives.
+Only applies in Mouse Avoidance mode `jump' and its derivatives.
For best results make this larger than `mouse-avoidance-threshold'."
:type 'integer
:group 'avoid)
@@ -112,7 +111,7 @@ For best results make this larger than `mouse-avoidance-threshold'."
(defcustom mouse-avoidance-threshold 5
"Mouse-pointer's flight distance.
If the cursor gets closer than this, the mouse pointer will move away.
-Only applies in mouse-avoidance-modes `animate' and `jump'."
+Only applies in Mouse Avoidance modes `animate' and `jump'."
:type 'integer
:group 'avoid)
@@ -183,7 +182,7 @@ Acceptable distance is defined by `mouse-avoidance-threshold'."
mouse-avoidance-threshold))))))
(defun mouse-avoidance-banish-destination ()
- "The position to which Mouse-Avoidance mode `banish' moves the mouse.
+ "The position to which Mouse Avoidance mode `banish' moves the mouse.
You can redefine this if you want the mouse banished to a different corner."
(let* ((pos (window-edges)))
(cons (- (nth 2 pos) 2)
@@ -278,6 +277,7 @@ redefine this function to suit your own tastes."
(defun mouse-avoidance-ignore-p ()
(let ((mp (mouse-position)))
(or (not (frame-pointer-visible-p)) ; The pointer is hidden
+ (not cursor-type) ; There's no cursor
executing-kbd-macro ; don't check inside macro
(null (cadr mp)) ; don't move unless in an Emacs frame
(not (eq (car mp) (selected-frame)))
@@ -332,7 +332,7 @@ redefine this function to suit your own tastes."
;;;###autoload
(defun mouse-avoidance-mode (&optional mode)
- "Set cursor avoidance mode to MODE.
+ "Set Mouse Avoidance mode to MODE.
MODE should be one of the symbols `banish', `exile', `jump', `animate',
`cat-and-mouse', `proteus', or `none'.
@@ -352,7 +352,7 @@ Effects of the different modes:
Whenever the mouse is moved, the frame is also raised.
-\(see `mouse-avoidance-threshold' for definition of \"too close\",
+\(See `mouse-avoidance-threshold' for definition of \"too close\",
and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
definition of \"random distance\".)"
(interactive
diff --git a/lisp/calc/README b/lisp/calc/README
index 533b80baeb..308b5115aa 100644
--- a/lisp/calc/README
+++ b/lisp/calc/README
@@ -72,6 +72,8 @@ Summary of changes to "Calc"
Emacs 24.1
+* Support for musical notes added.
+
* Support for logarithmic units added.
* Calc no longer uses the tex prefix for TeX specific unit
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 11a26d6d12..9ea773fbb9 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -422,13 +422,13 @@
(define-key calc-mode-map "kT" 'calc-utpt)
(define-key calc-mode-map "l" nil)
- (define-key calc-mode-map "lq" 'calc-logunits-quantity)
- (define-key calc-mode-map "ld" 'calc-dblevel)
- (define-key calc-mode-map "ln" 'calc-nplevel)
- (define-key calc-mode-map "l+" 'calc-logunits-add)
- (define-key calc-mode-map "l-" 'calc-logunits-sub)
- (define-key calc-mode-map "l*" 'calc-logunits-mul)
- (define-key calc-mode-map "l/" 'calc-logunits-divide)
+ (define-key calc-mode-map "lq" 'calc-lu-quant)
+ (define-key calc-mode-map "ld" 'calc-db)
+ (define-key calc-mode-map "ln" 'calc-np)
+ (define-key calc-mode-map "l+" 'calc-lu-plus)
+ (define-key calc-mode-map "l-" 'calc-lu-minus)
+ (define-key calc-mode-map "l*" 'calc-lu-times)
+ (define-key calc-mode-map "l/" 'calc-lu-divide)
(define-key calc-mode-map "ls" 'calc-spn)
(define-key calc-mode-map "lm" 'calc-midi)
(define-key calc-mode-map "lf" 'calc-freq)
@@ -943,12 +943,11 @@ calc-store-value calc-var-name)
("calc-stuff" calc-explain-why calcFunc-clean
calcFunc-pclean calcFunc-pfloat calcFunc-pfrac)
- ("calc-units" calcFunc-usimplify calcFunc-lufieldadd
-calcFunc-lupoweradd calcFunc-lufieldsub calcFunc-lupowersub
-calcFunc-lufieldmul calcFunc-lupowermul calcFunc-lufielddiv
-calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant
-calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel
-calcFunc-nppowerlevel calcFunc-spn calcFunc-midi calcFunc-freq
+ ("calc-units" calcFunc-usimplify calcFunc-lufadd calcFunc-lupadd
+calcFunc-lufsub calcFunc-lupsub calcFunc-lufmul calcFunc-lupmul
+calcFunc-lufdiv calcFunc-lupdiv calcFunc-lufquant calcFunc-lupquant
+calcFunc-dbfield calcFunc-dbpower calcFunc-npfield
+calcFunc-nppower calcFunc-spn calcFunc-midi calcFunc-freq
math-build-units-table math-build-units-table-buffer
math-check-unit-name math-convert-temperature math-convert-units
math-extract-units math-remove-units math-simplify-units
@@ -1180,9 +1179,9 @@ calc-convert-temperature calc-convert-units calc-define-unit
calc-enter-units-table calc-explain-units calc-extract-units
calc-get-unit-definition calc-permanent-units calc-quick-units
calc-remove-units calc-simplify-units calc-undefine-unit
-calc-view-units-table calc-logunits-quantity calc-dblevel
-calc-nplevel calc-logunits-add calc-logunits-sub
-calc-logunits-mul calc-logunits-divide calc-spn calc-midi
+calc-view-units-table calc-lu-quant calc-db
+calc-np calc-lu-plus calc-lu-minus
+calc-lu-times calc-lu-divide calc-spn calc-midi
calc-freq)
("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index d688b31b3c..427cf6ba23 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -673,7 +673,9 @@ C-w Describe how there is no warranty for Calc."
(interactive)
(calc-do-prefix-help
'("Quantity, DB level, Np level"
- "+, -, *, /")
+ "+, -, *, /"
+ "Scientific pitch notation, Midi number, Frequency"
+ )
"log units" ?l))
(defun calc-v-prefix-help ()
diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el
index aaddf3e486..d8099b0aad 100644
--- a/lisp/calc/calc-menu.el
+++ b/lisp/calc/calc-menu.el
@@ -960,6 +960,111 @@
(require 'calc-units)
(call-interactively 'calc-view-units-table))
:keys "u V"]
+ (list "Logarithmic Units"
+ ["Convert (1:) to dB (power)"
+ (progn
+ (require 'calc-units)
+ (call-interactively 'calc-db))
+ :keys "l d"
+ :active (>= (calc-stack-size) 1)]
+ ["Convert (2:) to dB (power) with reference level (1:)"
+ (progn
+ (require 'calc-units)
+ (let ((calc-option-flag t))
+ (call-interactively 'calc-db)))
+ :keys "O l d"
+ :active (>= (calc-stack-size) 2)]
+ ["Convert (1:) to Np (power)"
+ (progn
+ (require 'calc-units)
+ (call-interactively 'calc-np))
+ :keys "l n"
+ :active (>= (calc-stack-size) 1)]
+ ["Convert (2:) to Np (power) with reference level (1:)"
+ (progn
+ (require 'calc-units)
+ (let ((calc-option-flag t))
+ (call-interactively 'calc-np)))
+ :keys "O l n"
+ :active (>= (calc-stack-size) 2)]
+ ["Convert (1:) to power quantity"
+ (progn
+ (require 'calc-units)
+ (call-interactively 'calc-lu-quant))
+ :keys "l q"
+ :active (>= (calc-stack-size) 1)]
+ ["Convert (2:) to power quantity with reference level (1:)"
+ (progn
+ (require 'calc-units)
+ (let ((calc-option-flag t))
+ (call-interactively 'calc-lu-quant)))
+ :keys "O l q"
+ :active (>= (calc-stack-size) 2)]
+ "----"
+ ["Convert (1:) to dB (field)"
+ (progn
+ (require 'calc-units)
+ (let ((calc-hyperbolic-flag t))
+ (call-interactively 'calc-db)))
+ :keys "H l d"
+ :active (>= (calc-stack-size) 1)]
+ ["Convert (2:) to dB (field) with reference level (1:)"
+ (progn
+ (require 'calc-units)
+ (let ((calc-option-flag t)
+ (calc-hyperbolic-flag t))
+ (call-interactively 'calc-db)))
+ :keys "O H l d"
+ :active (>= (calc-stack-size) 2)]
+ ["Convert (1:) to Np (field)"
+ (progn
+ (require 'calc-units)
+ (let ((calc-hyperbolic-flag t))
+ (call-interactively 'calc-np)))
+ :keys "H l n"
+ :active (>= (calc-stack-size) 1)]
+ ["Convert (2:) to Np (field) with reference level (1:)"
+ (progn
+ (require 'calc-units)
+ (let ((calc-option-flag t)
+ (calc-hyperbolic-flag t))
+ (call-interactively 'calc-np)))
+ :keys "O H l d"
+ :active (>= (calc-stack-size) 2)]
+ ["Convert (1:) to field quantity"
+ (progn
+ (require 'calc-units)
+ (let ((calc-hyperbolic-flag t))
+ (call-interactively 'calc-lu-quant)))
+ :keys "H l q"
+ :active (>= (calc-stack-size) 1)]
+ ["Convert (2:) to field quantity with reference level (1:)"
+ (progn
+ (require 'calc-units)
+ (let ((calc-option-flag t)
+ (calc-hyperbolic-flag))
+ (call-interactively 'calc-lu-quant)))
+ :keys "O H l q"
+ :active (>= (calc-stack-size) 2)])
+ (list "Musical Notes"
+ ["Convert (1:) to scientific pitch notation"
+ (progn
+ (require 'calc-units)
+ (call-interactively 'calc-spn))
+ :keys "l s"
+ :active (>= (calc-stack-size) 1)]
+ ["Convert (1:) to midi number"
+ (progn
+ (require 'calc-units)
+ (call-interactively 'calc-midi))
+ :keys "l m"
+ :active (>= (calc-stack-size) 1)]
+ ["Convert (1:) to frequency"
+ (progn
+ (require 'calc-units)
+ (call-interactively 'calc-freq))
+ :keys "l f"
+ :active (>= (calc-stack-size) 1)])
"----"
["Help on Units"
(calc-info-goto-node "Units")])
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 7f0adc9fe7..43cb5828e8 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -1623,39 +1623,39 @@ In symbolic mode, return the list (^ a b)."
coef)))
units)))))))
-(defun calcFunc-lufieldplus (a b)
+(defun calcFunc-lufadd (a b)
(math-logunits-add a b nil nil))
-(defun calcFunc-lupowerplus (a b)
+(defun calcFunc-lupadd (a b)
(math-logunits-add a b nil t))
-(defun calcFunc-lufieldminus (a b)
+(defun calcFunc-lufsub (a b)
(math-logunits-add a b t nil))
-(defun calcFunc-lupowerminus (a b)
+(defun calcFunc-lupsub (a b)
(math-logunits-add a b t t))
-(defun calc-logunits-add (arg)
+(defun calc-lu-plus (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-inverse)
(if (calc-is-hyperbolic)
- (calc-binary-op "lu-" 'calcFunc-lufieldminus arg)
- (calc-binary-op "lu-" 'calcFunc-lupowerminus arg))
+ (calc-binary-op "lu-" 'calcFunc-lufsub arg)
+ (calc-binary-op "lu-" 'calcFunc-lupsub arg))
(if (calc-is-hyperbolic)
- (calc-binary-op "lu+" 'calcFunc-lufieldplus arg)
- (calc-binary-op "lu+" 'calcFunc-lupowerplus arg)))))
+ (calc-binary-op "lu+" 'calcFunc-lufadd arg)
+ (calc-binary-op "lu+" 'calcFunc-lupadd arg)))))
-(defun calc-logunits-sub (arg)
+(defun calc-lu-minus (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-inverse)
(if (calc-is-hyperbolic)
- (calc-binary-op "lu+" 'calcFunc-lufieldplus arg)
- (calc-binary-op "lu+" 'calcFunc-lupowerplus arg))
+ (calc-binary-op "lu+" 'calcFunc-lufadd arg)
+ (calc-binary-op "lu+" 'calcFunc-lupadd arg))
(if (calc-is-hyperbolic)
- (calc-binary-op "lu-" 'calcFunc-lufieldminus arg)
- (calc-binary-op "lu-" 'calcFunc-lupowerminus arg)))))
+ (calc-binary-op "lu-" 'calcFunc-lufsub arg)
+ (calc-binary-op "lu-" 'calcFunc-lupsub arg)))))
(defun math-logunits-mul (a b power)
(let (logunit coef units number)
@@ -1719,39 +1719,39 @@ In symbolic mode, return the list (^ a b)."
(math-div (math-conditional-apply 'calcFunc-ln b) (if power 2 1)))
units)))))))))
-(defun calcFunc-lufieldtimes (a b)
+(defun calcFunc-lufmul (a b)
(math-logunits-mul a b nil))
-(defun calcFunc-lupowertimes (a b)
+(defun calcFunc-lupmul (a b)
(math-logunits-mul a b t))
-(defun calc-logunits-mul (arg)
+(defun calc-lu-times (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-inverse)
(if (calc-is-hyperbolic)
- (calc-binary-op "lu/" 'calcFunc-lufielddiv arg)
- (calc-binary-op "lu/" 'calcFunc-lupowerdiv arg))
+ (calc-binary-op "lu/" 'calcFunc-lufdiv arg)
+ (calc-binary-op "lu/" 'calcFunc-lupdiv arg))
(if (calc-is-hyperbolic)
- (calc-binary-op "lu*" 'calcFunc-lufieldtimes arg)
- (calc-binary-op "lu*" 'calcFunc-lupowertimes arg)))))
+ (calc-binary-op "lu*" 'calcFunc-lufmul arg)
+ (calc-binary-op "lu*" 'calcFunc-lupmul arg)))))
-(defun calcFunc-lufielddiv (a b)
+(defun calcFunc-lufdiv (a b)
(math-logunits-divide a b nil))
-(defun calcFunc-lupowerdiv (a b)
+(defun calcFunc-lupdiv (a b)
(math-logunits-divide a b t))
-(defun calc-logunits-divide (arg)
+(defun calc-lu-divide (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-inverse)
(if (calc-is-hyperbolic)
- (calc-binary-op "lu*" 'calcFunc-lufieldtimes arg)
- (calc-binary-op "lu*" 'calcFunc-lupowertimes arg))
+ (calc-binary-op "lu*" 'calcFunc-lufmul arg)
+ (calc-binary-op "lu*" 'calcFunc-lupmul arg))
(if (calc-is-hyperbolic)
- (calc-binary-op "lu/" 'calcFunc-lufielddiv arg)
- (calc-binary-op "lu/" 'calcFunc-lupowerdiv arg)))))
+ (calc-binary-op "lu/" 'calcFunc-lufdiv arg)
+ (calc-binary-op "lu/" 'calcFunc-lupdiv arg)))))
(defun math-logunits-quant (val ref power)
(let* ((units (math-simplify (math-extract-units val)))
@@ -1777,29 +1777,29 @@ In symbolic mode, return the list (^ a b)."
coeff))))
runits)))))
-(defvar calc-logunits-field-reference)
-(defvar calc-logunits-power-reference)
+(defvar calc-lu-field-reference)
+(defvar calc-lu-power-reference)
-(defun calcFunc-fieldquant (val &optional ref)
+(defun calcFunc-lufquant (val &optional ref)
(unless ref
- (setq ref (math-read-expr calc-logunits-field-reference)))
+ (setq ref (math-read-expr calc-lu-field-reference)))
(math-logunits-quant val ref nil))
-(defun calcFunc-powerquant (val &optional ref)
+(defun calcFunc-lupquant (val &optional ref)
(unless ref
- (setq ref (math-read-expr calc-logunits-power-reference)))
+ (setq ref (math-read-expr calc-lu-power-reference)))
(math-logunits-quant val ref t))
-(defun calc-logunits-quantity (arg)
+(defun calc-lu-quant (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-hyperbolic)
(if (calc-is-option)
- (calc-binary-op "lupq" 'calcFunc-fieldquant arg)
- (calc-unary-op "lupq" 'calcFunc-fieldquant arg))
+ (calc-binary-op "lupq" 'calcFunc-lufquant arg)
+ (calc-unary-op "lupq" 'calcFunc-lufquant arg))
(if (calc-is-option)
- (calc-binary-op "lufq" 'calcFunc-powerquant arg)
- (calc-unary-op "lufq" 'calcFunc-powerquant arg)))))
+ (calc-binary-op "lufq" 'calcFunc-lupquant arg)
+ (calc-unary-op "lufq" 'calcFunc-lupquant arg)))))
(defun math-logunits-level (val ref db power)
"Compute the value of VAL in decibels or nepers."
@@ -1817,47 +1817,47 @@ In symbolic mode, return the list (^ a b)."
'(var Np var-Np)))
units)))
-(defun calcFunc-dbfieldlevel (val &optional ref)
+(defun calcFunc-dbfield (val &optional ref)
(unless ref
- (setq ref (math-read-expr calc-logunits-field-reference)))
+ (setq ref (math-read-expr calc-lu-field-reference)))
(math-logunits-level val ref t nil))
-(defun calcFunc-dbpowerlevel (val &optional ref)
+(defun calcFunc-dbpower (val &optional ref)
(unless ref
- (setq ref (math-read-expr calc-logunits-power-reference)))
+ (setq ref (math-read-expr calc-lu-power-reference)))
(math-logunits-level val ref t t))
-(defun calcFunc-npfieldlevel (val &optional ref)
+(defun calcFunc-npfield (val &optional ref)
(unless ref
- (setq ref (math-read-expr calc-logunits-field-reference)))
+ (setq ref (math-read-expr calc-lu-field-reference)))
(math-logunits-level val ref nil nil))
-(defun calcFunc-nppowerlevel (val &optional ref)
+(defun calcFunc-nppower (val &optional ref)
(unless ref
- (setq ref (math-read-expr calc-logunits-power-reference)))
+ (setq ref (math-read-expr calc-lu-power-reference)))
(math-logunits-level val ref nil t))
-(defun calc-dblevel (arg)
+(defun calc-db (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-hyperbolic)
(if (calc-is-option)
- (calc-binary-op "ludb" 'calcFunc-dbfieldlevel arg)
- (calc-unary-op "ludb" 'calcFunc-dbfieldlevel arg))
+ (calc-binary-op "ludb" 'calcFunc-dbfield arg)
+ (calc-unary-op "ludb" 'calcFunc-dbfield arg))
(if (calc-is-option)
- (calc-binary-op "ludb" 'calcFunc-dbpowerlevel arg)
- (calc-unary-op "ludb" 'calcFunc-dbpowerlevel arg)))))
+ (calc-binary-op "ludb" 'calcFunc-dbpower arg)
+ (calc-unary-op "ludb" 'calcFunc-dbpower arg)))))
-(defun calc-nplevel (arg)
+(defun calc-np (arg)
(interactive "P")
(calc-slow-wrapper
(if (calc-is-hyperbolic)
(if (calc-is-option)
- (calc-binary-op "lunp" 'calcFunc-npfieldlevel arg)
- (calc-unary-op "lunp" 'calcFunc-npfieldlevel arg))
+ (calc-binary-op "lunp" 'calcFunc-npfield arg)
+ (calc-unary-op "lunp" 'calcFunc-npfield arg))
(if (calc-is-option)
- (calc-binary-op "lunp" 'calcFunc-nppowerlevel arg)
- (calc-unary-op "lunp" 'calcFunc-nppowerlevel arg)))))
+ (calc-binary-op "lunp" 'calcFunc-nppower arg)
+ (calc-unary-op "lunp" 'calcFunc-nppower arg)))))
;;; Musical notes
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index f4d8983eb8..41f549cbe2 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -434,13 +434,13 @@ by displaying the sub-formula in `calc-selected-face'."
:group 'calc
:type 'boolean)
-(defcustom calc-logunits-field-reference
+(defcustom calc-lu-field-reference
"20 uPa"
"The default reference level for logarithmic units (field)."
:group 'calc
:type '(string))
-(defcustom calc-logunits-power-reference
+(defcustom calc-lu-power-reference
"mW"
"The default reference level for logarithmic units (power)."
:group 'calc
@@ -1084,7 +1084,7 @@ Used by `calc-user-invocation'.")
"lOW")
(mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key))
(concat "ABCDEFGHIJKLMNOPQRSTUVXZabcdfghjkmoprstuvwxyz"
- ":\\|!()[]<>{},;=~`\C-k\C-w\C-_"))
+ ":\\|!()[]<>{},;=~`\C-k\C-w"))
(define-key map "\M-w" 'calc-missing-key)
(define-key map "\M-k" 'calc-missing-key)
(define-key map "\M-\C-w" 'calc-missing-key)
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 63e7484e12..e5373a2875 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -879,21 +879,27 @@ use when highlighting the day in the calendar."
(declare-function diary-ordinal-suffix "diary-lib" (n))
;;;###diary-autoload
-(defun diary-hebrew-yahrzeit (death-month death-day death-year &optional mark)
+(defun diary-hebrew-yahrzeit (death-month death-day death-year
+ &optional mark after-sunset)
"Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before.
Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary
entry is assumed to be the name of the person. Although the date
of death is specified by the civil calendar, the proper Hebrew
calendar Yahrzeit is determined.
+If the death occurred after local sunset on the given civil date,
+the following civil date corresponds to the Hebrew date of
+death--set the optional parameter AFTER-SUNSET non-nil in this case.
+
The order of the input parameters changes according to `calendar-date-style'
\(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style).
An optional parameter MARK specifies a face or single-character string to
use when highlighting the day in the calendar."
(let* ((h-date (calendar-hebrew-from-absolute
- (calendar-absolute-from-gregorian
- (diary-make-date death-month death-day death-year))))
+ (+ (calendar-absolute-from-gregorian
+ (diary-make-date death-month death-day death-year))
+ (if after-sunset 1 0))))
(h-month (calendar-extract-month h-date))
(h-day (calendar-extract-day h-date))
(h-year (calendar-extract-year h-date))
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index a1bfad3a5f..6220360061 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -308,13 +308,9 @@ This function does not work for SECONDS greater than `most-positive-fixnum'."
(setq start (match-end 0)
spec (match-string 1 string))
(unless (string-equal spec "%")
- ;; `assoc-string' is not available in XEmacs. So when compiling
- ;; Gnus (`time-date.el' is part of Gnus) with XEmacs, we get
- ;; a warning here. But `format-seconds' is not used anywhere in
- ;; Gnus so it's not a real problem. --rsteib
- (or (setq match (assoc-string spec units t))
+ (or (setq match (assoc (downcase spec) units))
(error "Bad format specifier: `%s'" spec))
- (if (assoc-string spec usedunits t)
+ (if (assoc (downcase spec) usedunits)
(error "Multiple instances of specifier: `%s'" spec))
(if (string-equal (car match) "z")
(setq zeroflag t)
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 8882165278..203043ebd9 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4756,6 +4756,12 @@ The format is suitable for use with `easy-menu-define'."
"Invoke button at POS, or refuse to allow editing of Custom buffer."
(interactive "@d")
(let ((button (get-char-property pos 'button)))
+ ;; If there is no button at point, then use the one at the start
+ ;; of the line, if it is a custom-group-link (bug#2298).
+ (or button
+ (if (setq button (get-char-property (line-beginning-position) 'button))
+ (or (eq (widget-type button) 'custom-group-link)
+ (setq button nil))))
(if button
(widget-apply-action button event)
(error "You can't edit this part of the Custom buffer"))))
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index d2d99ee64f..788731e4db 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -111,9 +111,9 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
(cursor-in-non-selected-windows
cursor boolean nil
:tag "Cursor In Non-selected Windows"
- :set #'(lambda (symbol value)
- (set-default symbol value)
- (force-mode-line-update t)))
+ :set (lambda (symbol value)
+ (set-default symbol value)
+ (force-mode-line-update t)))
(transient-mark-mode editing-basics boolean nil
:standard (not noninteractive)
:initialize custom-initialize-delay
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index cdc066aa91..4f9428d497 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -100,6 +100,9 @@ named *Custom Theme*."
(make-local-variable 'custom-theme-insert-face-marker)
(make-local-variable 'custom-theme-insert-variable-marker)
(make-local-variable 'custom-theme--listed-faces)
+ (when (called-interactively-p 'interactive)
+ (unless (y-or-n-p "Include basic face customizations in this theme? ")
+ (setq custom-theme--listed-faces nil)))
(if (eq theme 'user)
(widget-insert "This buffer contains all the Custom settings you have made.
@@ -188,7 +191,7 @@ remove them from your saved Custom file.\n\n"))
(while vars
(if (eq (car vars) 'custom-enabled-themes)
(progn (pop vars) (pop values))
- (custom-theme-add-var-1 (pop vars) (pop values)))))
+ (custom-theme-add-var-1 (pop vars) (eval (pop values))))))
(setq custom-theme-insert-variable-marker (point-marker))
(widget-insert " ")
(widget-create 'push-button
@@ -297,8 +300,9 @@ SPEC, if non-nil, should be a face spec to which to set the widget."
;;; Reading and writing
+;;;###autoload
(defun custom-theme-visit-theme (theme)
- "Load the custom theme THEME's settings into the current buffer."
+ "Set up a Custom buffer to edit custom theme THEME."
(interactive
(list
(intern (completing-read "Find custom theme: "
@@ -663,4 +667,6 @@ Theme files are named *-theme.el in `"))
(widget-toggle-action widget event)
(setq custom-theme-allow-multiple-selections (widget-value widget)))
+(provide 'cus-theme)
+
;;; cus-theme.el ends here
diff --git a/lisp/custom.el b/lisp/custom.el
index d0d11610b9..d9bb4f954b 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -792,10 +792,10 @@ E.g. dumped variables whose default depends on run-time information."
(defvar custom-known-themes '(user changed)
"Themes that have been defined with `deftheme'.
The default value is the list (user changed). The theme `changed'
-contains the settings before custom themes are applied. The
-theme `user' contains all the settings the user customized and saved.
-Additional themes declared with the `deftheme' macro will be added to
-the front of this list.")
+contains the settings before custom themes are applied. The theme
+`user' contains all the settings the user customized and saved.
+Additional themes declared with the `deftheme' macro will be added
+to the front of this list.")
(defsubst custom-theme-p (theme)
"Non-nil when THEME has been defined."
@@ -1074,7 +1074,7 @@ order. Each element in the list should be one of the following:
named \"themes\" in `data-directory').
- a directory name (a string).
-Each theme file is named NAME-theme.el, where THEME is the theme
+Each theme file is named THEME-theme.el, where THEME is the theme
name."
:type '(repeat (choice (const :tag "custom-theme-directory"
custom-theme-directory)
@@ -1146,7 +1146,7 @@ Return t if THEME was successfully loaded, nil otherwise."
'("" "c")))
hash)
(unless fn
- (error "Unable to find theme file for `%s'." theme))
+ (error "Unable to find theme file for `%s'" theme))
(with-temp-buffer
(insert-file-contents fn)
(setq hash (sha1 (current-buffer)))
@@ -1212,7 +1212,7 @@ NAME should be a symbol."
(defun custom-available-themes ()
"Return a list of available Custom themes (symbols)."
- (let* (sym themes)
+ (let (sym themes)
(dolist (dir (custom-theme--load-path))
(when (file-directory-p dir)
(dolist (file (file-expand-wildcards
@@ -1222,7 +1222,7 @@ NAME should be a symbol."
(setq sym (intern (match-string 1 file)))
(custom-theme-name-valid-p sym)
(push sym themes)))))
- (delete-dups themes)))
+ (nreverse (delete-dups themes))))
(defun custom-theme--load-path ()
(let (lpath)
@@ -1338,7 +1338,7 @@ That is to say, it specifies what the value should be according to
currently enabled custom themes.
This function returns nil if no custom theme specifies a value for VARIABLE."
- (let* ((theme-value (get variable 'theme-value)))
+ (let ((theme-value (get variable 'theme-value)))
(if theme-value
(cdr (car theme-value)))))
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index c533c81be0..9ab1fcb0e2 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1638,11 +1638,14 @@ Optional arg HOW-TO determiness how to treat the target.
;;;###autoload
(defun dired-create-directory (directory)
- "Create a directory called DIRECTORY."
+ "Create a directory called DIRECTORY.
+If DIRECTORY already exists, signal an error."
(interactive
(list (read-file-name "Create directory: " (dired-current-directory))))
(let* ((expanded (directory-file-name (expand-file-name directory)))
(try expanded) new)
+ (if (file-exists-p expanded)
+ (error "Cannot create directory %s: file exists" expanded))
;; Find the topmost nonexistent parent dir (variable `new')
(while (and try (not (file-exists-p try)) (not (equal new try)))
(setq new try
diff --git a/lisp/dired.el b/lisp/dired.el
index c8343ba756..d72e0aad55 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3629,7 +3629,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;; dired-diff) "dired-aux" "dired-aux.el" "154cdfbf451aedec60c5012b625ff329")
+;;;;;; dired-diff) "dired-aux" "dired-aux.el" "2d805d6766bd7970cd446413b4ed4ce0")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\
@@ -3860,6 +3860,7 @@ Not documented
(autoload 'dired-create-directory "dired-aux" "\
Create a directory called DIRECTORY.
+If DIRECTORY already exists, signal an error.
\(fn DIRECTORY)" t nil)
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index dd589cb58f..a906cf8516 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -34,7 +34,56 @@
;; this depends on the format of list-buffers (from src/buffer.c) and
;; on stuff in lisp/buff-menu.el
-(defvar electric-buffer-menu-mode-map nil)
+(defvar electric-buffer-menu-mode-map
+ (let ((map (make-keymap)))
+ (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined)
+ (define-key map "\e" nil)
+ (define-key map "\C-z" 'suspend-frame)
+ (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
+ (define-key map (char-to-string help-char) 'Helper-help)
+ (define-key map "?" 'Helper-describe-bindings)
+ (define-key map "\C-c" nil)
+ (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit)
+ (define-key map "\C-]" 'Electric-buffer-menu-quit)
+ (define-key map "q" 'Electric-buffer-menu-quit)
+ (define-key map " " 'Electric-buffer-menu-select)
+ (define-key map "\C-m" 'Electric-buffer-menu-select)
+ (define-key map "\C-l" 'recenter)
+ (define-key map "s" 'Buffer-menu-save)
+ (define-key map "d" 'Buffer-menu-delete)
+ (define-key map "k" 'Buffer-menu-delete)
+ (define-key map "\C-d" 'Buffer-menu-delete-backwards)
+ ;; (define-key map "\C-k" 'Buffer-menu-delete)
+ (define-key map "\177" 'Buffer-menu-backup-unmark)
+ (define-key map "~" 'Buffer-menu-not-modified)
+ (define-key map "u" 'Buffer-menu-unmark)
+ (let ((i ?0))
+ (while (<= i ?9)
+ (define-key map (char-to-string i) 'digit-argument)
+ (define-key map (concat "\e" (char-to-string i)) 'digit-argument)
+ (setq i (1+ i))))
+ (define-key map "-" 'negative-argument)
+ (define-key map "\e-" 'negative-argument)
+ (define-key map "m" 'Buffer-menu-mark)
+ (define-key map "\C-u" 'universal-argument)
+ (define-key map "\C-p" 'previous-line)
+ (define-key map "\C-n" 'next-line)
+ (define-key map "p" 'previous-line)
+ (define-key map "n" 'next-line)
+ (define-key map "\C-v" 'scroll-up)
+ (define-key map "\ev" 'scroll-down)
+ (define-key map ">" 'scroll-right)
+ (define-key map "<" 'scroll-left)
+ (define-key map "\e\C-v" 'scroll-other-window)
+ (define-key map "\e>" 'end-of-buffer)
+ (define-key map "\e<" 'beginning-of-buffer)
+ (define-key map "\e\e" nil)
+ (define-key map "\e\e\e" 'Electric-buffer-menu-quit)
+ ;; This binding prevents the "escape => ESC" function-key-map mapping from
+ ;; kicking in!
+ ;; (define-key map [escape escape escape] 'Electric-buffer-menu-quit)
+ (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
+ map))
(defvar electric-buffer-menu-mode-hook nil
"Normal hook run by `electric-buffer-list'.")
@@ -167,55 +216,7 @@ Entry to this mode via command `electric-buffer-list' calls the value of
;; generally the same as Buffer-menu-mode-map
;; (except we don't indirect to global-map)
(put 'Electric-buffer-menu-undefined 'suppress-keymap t)
-(if electric-buffer-menu-mode-map
- nil
- (let ((map (make-keymap)))
- (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined)
- (define-key map "\e" nil)
- (define-key map "\C-z" 'suspend-frame)
- (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
- (define-key map (char-to-string help-char) 'Helper-help)
- (define-key map "?" 'Helper-describe-bindings)
- (define-key map "\C-c" nil)
- (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit)
- (define-key map "\C-]" 'Electric-buffer-menu-quit)
- (define-key map "q" 'Electric-buffer-menu-quit)
- (define-key map " " 'Electric-buffer-menu-select)
- (define-key map "\C-m" 'Electric-buffer-menu-select)
- (define-key map "\C-l" 'recenter)
- (define-key map "s" 'Buffer-menu-save)
- (define-key map "d" 'Buffer-menu-delete)
- (define-key map "k" 'Buffer-menu-delete)
- (define-key map "\C-d" 'Buffer-menu-delete-backwards)
- ;(define-key map "\C-k" 'Buffer-menu-delete)
- (define-key map "\177" 'Buffer-menu-backup-unmark)
- (define-key map "~" 'Buffer-menu-not-modified)
- (define-key map "u" 'Buffer-menu-unmark)
- (let ((i ?0))
- (while (<= i ?9)
- (define-key map (char-to-string i) 'digit-argument)
- (define-key map (concat "\e" (char-to-string i)) 'digit-argument)
- (setq i (1+ i))))
- (define-key map "-" 'negative-argument)
- (define-key map "\e-" 'negative-argument)
- (define-key map "m" 'Buffer-menu-mark)
- (define-key map "\C-u" 'universal-argument)
- (define-key map "\C-p" 'previous-line)
- (define-key map "\C-n" 'next-line)
- (define-key map "p" 'previous-line)
- (define-key map "n" 'next-line)
- (define-key map "\C-v" 'scroll-up)
- (define-key map "\ev" 'scroll-down)
- (define-key map ">" 'scroll-right)
- (define-key map "<" 'scroll-left)
- (define-key map "\e\C-v" 'scroll-other-window)
- (define-key map "\e>" 'end-of-buffer)
- (define-key map "\e<" 'beginning-of-buffer)
- (define-key map "\e\e" nil)
- (define-key map "\e\e\e" 'Electric-buffer-menu-quit)
- (define-key map [escape escape escape] 'Electric-buffer-menu-quit)
- (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select)
- (setq electric-buffer-menu-mode-map map)))
+
(defun Electric-buffer-menu-exit ()
(interactive)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c9a85edfca..5a87f59002 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4071,7 +4071,8 @@ binding slots have been popped."
(defun byte-compile-save-excursion (form)
(if (and (eq 'set-buffer (car-safe (car-safe (cdr form))))
(byte-compile-warning-enabled-p 'suspicious))
- (byte-compile-warn "`save-excursion' defeated by `set-buffer'"))
+ (byte-compile-warn
+ "Use `with-current-buffer' rather than save-excursion+set-buffer"))
(byte-compile-out 'byte-save-excursion 0)
(byte-compile-body-do-effect (cdr form))
(byte-compile-out 'byte-unbind 1))
@@ -4120,6 +4121,17 @@ binding slots have been popped."
,@decls
',(nth 1 form)))))
+;; If foo.el declares `toto' as obsolete, it is likely that foo.el will
+;; actually use `toto' in order for this obsolete variable to still work
+;; correctly, so paradoxically, while byte-compiling foo.el, the presence
+;; of a make-obsolete-variable call for `toto' is an indication that `toto'
+;; should not trigger obsolete-warnings in foo.el.
+(byte-defop-compiler-1 make-obsolete-variable)
+(defun byte-compile-make-obsolete-variable (form)
+ (when (eq 'quote (car-safe (nth 1 form)))
+ (push (nth 1 (nth 1 form)) byte-compile-not-obsolete-vars))
+ (byte-compile-normal-call form))
+
(defun byte-compile-defvar (form)
;; This is not used for file-level defvar/consts with doc strings.
(when (and (symbolp (nth 1 form))
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index 3a6878ed16..8bcbd67f46 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -282,7 +282,7 @@ Not documented
;;;;;; flet progv psetq do-all-symbols do-symbols dotimes dolist
;;;;;; do* do loop return-from return block etypecase typecase ecase
;;;;;; case load-time-value eval-when destructuring-bind function*
-;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "80cb83265399ce021c8c0c7d1a8562f2")
+;;;;;; defmacro* defun* gentemp gensym) "cl-macs" "cl-macs.el" "c4734fbda33043d967624d39d80c3304")
;;; Generated autoloads from cl-macs.el
(autoload 'gensym "cl-macs" "\
@@ -500,16 +500,16 @@ Like `let', but lexically scoped.
The main visible difference is that lambdas inside BODY will create
lexical closures as in Common Lisp.
-\(fn VARLIST BODY)" nil (quote macro))
+\(fn BINDINGS BODY)" nil (quote macro))
(autoload 'lexical-let* "cl-macs" "\
Like `let*', but lexically scoped.
The main visible difference is that lambdas inside BODY, and in
-successive bindings within VARLIST, will create lexical closures
+successive bindings within BINDINGS, will create lexical closures
as in Common Lisp. This is similar to the behavior of `let*' in
Common Lisp.
-\(fn VARLIST BODY)" nil (quote macro))
+\(fn BINDINGS BODY)" nil (quote macro))
(autoload 'multiple-value-bind "cl-macs" "\
Collect multiple return values.
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 5bd8fd01b1..b2e2084385 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1482,9 +1482,8 @@ Returns the stats object."
(let ((print-escape-newlines t)
(print-level 5)
(print-length 10))
- (let ((begin (point)))
- (ert--pp-with-indentation-and-newline
- (ert-test-result-with-condition-condition result))))
+ (ert--pp-with-indentation-and-newline
+ (ert-test-result-with-condition-condition result)))
(goto-char (1- (point-max)))
(assert (looking-at "\n"))
(delete-char 1)
@@ -1603,7 +1602,7 @@ Nothing more than an interactive interface to `ert-make-test-unbound'."
(defun ert-delete-all-tests ()
"Make all symbols in `obarray' name no test."
(interactive)
- (when (interactive-p)
+ (when (called-interactively-p 'any)
(unless (y-or-n-p "Delete all tests? ")
(error "Aborted")))
;; We can't use `ert-select-tests' here since that gives us only
@@ -1793,7 +1792,7 @@ EWOC and STATS are arguments for `ert--results-update-stats-display'."
BEGIN and END specify a region in the current buffer."
(save-excursion
(save-restriction
- (narrow-to-region begin (point))
+ (narrow-to-region begin end)
;; Inhibit optimization in `debugger-make-xrefs' that would
;; sometimes insert unrelated backtrace info into our buffer.
(let ((debugger-previous-backtrace nil))
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index 61f23abf0a..cd4b5ee231 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -27,21 +27,41 @@
;;; Commentary:
-;; This file currently contains parts of the package system most
-;; people won't need, such as package uploading.
+;; This file currently contains parts of the package system that many
+;; won't need, such as package uploading.
+
+;; To upload to an archive, first set `package-archive-upload-base' to
+;; some desired directory. For testing purposes, you can specify any
+;; directory you want, but if you want the archive to be accessible to
+;; others via http, this is typically a directory in the /var/www tree
+;; (possibly one on a remote machine, accessed via Tramp).
+
+;; Then call M-x package-upload-file, which prompts for a file to
+;; upload. Alternatively, M-x package-upload-buffer uploads the
+;; current buffer, if it's visiting a package file.
+
+;; Once a package is uploaded, users can access it via the Package
+;; Menu, by adding the archive to `package-archives'.
;;; Code:
(require 'package)
(defvar gnus-article-buffer)
-;; Note that this only works if you have the password, which you
-;; probably don't :-).
-(defvar package-archive-upload-base nil
- "Base location for uploading to package archive.")
+(defcustom package-archive-upload-base "/path/to/archive"
+ "The base location of the archive to which packages are uploaded.
+This should be an absolute directory name. If the archive is on
+another machine, you may specify a remote name in the usual way,
+e.g. \"/ssh:foo@example.com:/var/www/packages/\".
+See Info node `(emacs)Remote Files'.
+
+Unlike `package-archives', you can't specify a HTTP URL."
+ :type 'directory
+ :group 'package
+ :version "24.1")
(defvar package-update-news-on-upload nil
- "Whether package upload should also update NEWS and RSS feeds.")
+ "Whether uploading a package should also update NEWS and RSS feeds.")
(defun package--encode (string)
"Encode a string by replacing some characters with XML entities."
@@ -75,13 +95,18 @@
title " - " (package--encode text)
" </li>\n"))
-(defun package--update-file (file location text)
+(defun package--update-file (file tag text)
+ "Update the package archive file named FILE.
+FILE should be relative to `package-archive-upload-base'.
+TAG is a string that can be found within the file; TEXT is
+inserted after its first occurrence in the file."
+ (setq file (expand-file-name file package-archive-upload-base))
(save-excursion
(let ((old-buffer (find-buffer-visiting file)))
(with-current-buffer (let ((find-file-visit-truename t))
(or old-buffer (find-file-noselect file)))
(goto-char (point-min))
- (search-forward location)
+ (search-forward tag)
(forward-line)
(insert text)
(let ((file-precious-flag t))
@@ -105,30 +130,31 @@ Return the file contents, as a string, or nil if unsuccessful."
(buffer-substring-no-properties (point-min) (point-max)))
(kill-buffer buffer))))))
-(defun package--archive-contents-from-file (file)
- "Parse the given archive-contents file."
- (if (not (file-exists-p file))
- ;; no existing archive-contents, possibly a new ELPA repo.
- (list package-archive-version)
- (let ((dont-kill (find-buffer-visiting file)))
- (with-current-buffer (let ((find-file-visit-truename t))
- (find-file-noselect file))
- (prog1
- (package-read-from-string
- (buffer-substring-no-properties (point-min) (point-max)))
- (unless dont-kill
- (kill-buffer (current-buffer))))))))
+(defun package--archive-contents-from-file ()
+ "Parse the archive-contents at `package-archive-upload-base'"
+ (let ((file (expand-file-name "archive-contents"
+ package-archive-upload-base)))
+ (if (not (file-exists-p file))
+ ;; No existing archive-contents means a new archive.
+ (list package-archive-version)
+ (let ((dont-kill (find-buffer-visiting file)))
+ (with-current-buffer (let ((find-file-visit-truename t))
+ (find-file-noselect file))
+ (prog1
+ (package-read-from-string
+ (buffer-substring-no-properties (point-min) (point-max)))
+ (unless dont-kill
+ (kill-buffer (current-buffer)))))))))
(defun package-maint-add-news-item (title description archive-url)
- "Add a news item to the ELPA web pages.
+ "Add a news item to the webpages associated with the package archive.
TITLE is the title of the news item.
-DESCRIPTION is the text of the news item.
-You need administrative access to ELPA to use this."
+DESCRIPTION is the text of the news item."
(interactive "sTitle: \nsText: ")
- (package--update-file (concat package-archive-upload-base "elpa.rss")
+ (package--update-file "elpa.rss"
"<description>"
(package--make-rss-entry title description archive-url))
- (package--update-file (concat package-archive-upload-base "news.html")
+ (package--update-file "news.html"
"New entries go here"
(package--make-html-entry title description)))
@@ -144,8 +170,8 @@ PKG-INFO is the package info, see `package-buffer-info'.
EXTENSION is the file extension, a string. It can be either
\"el\" or \"tar\".
-The variable `package-archive-upload-base' specifies the upload
-destination. If this is nil, signal an error.
+The upload destination is given by `package-archive-upload-base'.
+If its value is invalid, prompt for a directory.
Optional arg ARCHIVE-URL is the URL of the destination archive.
If it is non-nil, compute the new \"archive-contents\" file
@@ -156,85 +182,97 @@ addition, if `package-update-news-on-upload' is non-nil, call
If ARCHIVE-URL is nil, compute the new \"archive-contents\" file
from the \"archive-contents\" at `package-archive-upload-base',
if it exists."
- (unless package-archive-upload-base
- (error "No destination specified in `package-archive-upload-base'"))
- (save-excursion
- (save-restriction
- (let* ((file-type (cond
- ((equal extension "el") 'single)
- ((equal extension "tar") 'tar)
- (t (error "Unknown extension `%s'" extension))))
- (file-name (aref pkg-info 0))
- (pkg-name (intern file-name))
- (requires (aref pkg-info 1))
- (desc (if (string= (aref pkg-info 2) "")
- (read-string "Description of package: ")
- (aref pkg-info 2)))
- (pkg-version (aref pkg-info 3))
- (commentary (aref pkg-info 4))
- (split-version (version-to-list pkg-version))
- (pkg-buffer (current-buffer)))
-
- ;; Get archive-contents from ARCHIVE-URL if it's non-nil, or
- ;; from `package-archive-upload-base' otherwise.
- (let ((contents (or (package--archive-contents-from-url archive-url)
- (package--archive-contents-from-file
- (concat package-archive-upload-base
- "archive-contents"))))
- (new-desc (vector split-version requires desc file-type)))
- (if (> (car contents) package-archive-version)
- (error "Unrecognized archive version %d" (car contents)))
- (let ((elt (assq pkg-name (cdr contents))))
- (if elt
- (if (version-list-<= split-version
- (package-desc-vers (cdr elt)))
- (error "New package has smaller version: %s" pkg-version)
- (setcdr elt new-desc))
- (setq contents (cons (car contents)
- (cons (cons pkg-name new-desc)
- (cdr contents))))))
-
- ;; Now CONTENTS is the updated archive contents. Upload
- ;; this and the package itself. For now we assume ELPA is
- ;; writable via file primitives.
- (let ((print-level nil)
- (print-length nil))
- (write-region (concat (pp-to-string contents) "\n")
- nil
- (concat package-archive-upload-base
- "archive-contents")))
-
- ;; If there is a commentary section, write it.
- (when commentary
- (write-region commentary nil
- (concat package-archive-upload-base
- (symbol-name pkg-name) "-readme.txt")))
-
- (set-buffer pkg-buffer)
- (write-region (point-min) (point-max)
- (concat package-archive-upload-base
- file-name "-" pkg-version
- "." extension)
- nil nil nil 'excl)
-
- ;; Write a news entry.
- (and package-update-news-on-upload
- archive-url
- (package--update-news (concat file-name "." extension)
- pkg-version desc archive-url))
-
- ;; special-case "package": write a second copy so that the
- ;; installer can easily find the latest version.
- (if (string= file-name "package")
- (write-region (point-min) (point-max)
- (concat package-archive-upload-base
- file-name "." extension)
- nil nil nil 'ask)))))))
+ (let ((package-archive-upload-base package-archive-upload-base))
+ ;; Check if `package-archive-upload-base' is valid.
+ (when (or (not (stringp package-archive-upload-base))
+ (equal package-archive-upload-base
+ (car-safe
+ (get 'package-archive-upload-base 'standard-value))))
+ (setq package-archive-upload-base
+ (read-directory-name
+ "Base directory for package archive: ")))
+ (unless (file-directory-p package-archive-upload-base)
+ (if (y-or-n-p (format "%s does not exist; create it? "
+ package-archive-upload-base))
+ (make-directory package-archive-upload-base t)
+ (error "Aborted")))
+ (save-excursion
+ (save-restriction
+ (let* ((file-type (cond
+ ((equal extension "el") 'single)
+ ((equal extension "tar") 'tar)
+ (t (error "Unknown extension `%s'" extension))))
+ (file-name (aref pkg-info 0))
+ (pkg-name (intern file-name))
+ (requires (aref pkg-info 1))
+ (desc (if (string= (aref pkg-info 2) "")
+ (read-string "Description of package: ")
+ (aref pkg-info 2)))
+ (pkg-version (aref pkg-info 3))
+ (commentary (aref pkg-info 4))
+ (split-version (version-to-list pkg-version))
+ (pkg-buffer (current-buffer)))
+
+ ;; Get archive-contents from ARCHIVE-URL if it's non-nil, or
+ ;; from `package-archive-upload-base' otherwise.
+ (let ((contents (or (package--archive-contents-from-url archive-url)
+ (package--archive-contents-from-file)))
+ (new-desc (vector split-version requires desc file-type)))
+ (if (> (car contents) package-archive-version)
+ (error "Unrecognized archive version %d" (car contents)))
+ (let ((elt (assq pkg-name (cdr contents))))
+ (if elt
+ (if (version-list-<= split-version
+ (package-desc-vers (cdr elt)))
+ (error "New package has smaller version: %s" pkg-version)
+ (setcdr elt new-desc))
+ (setq contents (cons (car contents)
+ (cons (cons pkg-name new-desc)
+ (cdr contents))))))
+
+ ;; Now CONTENTS is the updated archive contents. Upload
+ ;; this and the package itself. For now we assume ELPA is
+ ;; writable via file primitives.
+ (let ((print-level nil)
+ (print-length nil))
+ (write-region (concat (pp-to-string contents) "\n")
+ nil
+ (expand-file-name "archive-contents"
+ package-archive-upload-base)))
+
+ ;; If there is a commentary section, write it.
+ (when commentary
+ (write-region commentary nil
+ (expand-file-name
+ (concat (symbol-name pkg-name) "-readme.txt")
+ package-archive-upload-base)))
+
+ (set-buffer pkg-buffer)
+ (write-region (point-min) (point-max)
+ (expand-file-name
+ (concat file-name "-" pkg-version "." extension)
+ package-archive-upload-base)
+ nil nil nil 'excl)
+
+ ;; Write a news entry.
+ (and package-update-news-on-upload
+ archive-url
+ (package--update-news (concat file-name "." extension)
+ pkg-version desc archive-url))
+
+ ;; special-case "package": write a second copy so that the
+ ;; installer can easily find the latest version.
+ (if (string= file-name "package")
+ (write-region (point-min) (point-max)
+ (expand-file-name
+ (concat file-name "." extension)
+ package-archive-upload-base)
+ nil nil nil 'ask))))))))
(defun package-upload-buffer ()
"Upload the current buffer as a single-file Emacs Lisp package.
-The variable `package-archive-upload-base' specifies the upload
-destination."
+If `package-archive-upload-base' does not specify a valid upload
+destination, prompt for one."
(interactive)
(save-excursion
(save-restriction
@@ -247,9 +285,8 @@ destination."
Interactively, prompt for FILE. The package is considered a
single-file package if FILE ends in \".el\", and a multi-file
package if FILE ends in \".tar\".
-
-The variable `package-archive-upload-base' specifies the upload
-destination."
+If `package-archive-upload-base' does not specify a valid upload
+destination, prompt for one."
(interactive "fPackage file name: ")
(with-temp-buffer
(insert-file-contents-literally file)
@@ -269,4 +306,4 @@ This should be invoked from the gnus *Summary* buffer."
(provide 'package-x)
-;;; package.el ends here
+;;; package-x.el ends here
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 2552ad4eb6..5dc2938fe0 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -319,20 +319,39 @@ Like `package-alist', but maps package name to a second alist.
The inner alist is keyed by version.")
(put 'package-obsolete-alist 'risky-local-variable t)
-(defconst package-subdirectory-regexp
- "^\\([^.].*\\)-\\([0-9]+\\(?:[.][0-9]+\\)*\\)$"
- "Regular expression matching the name of a package subdirectory.
-The first subexpression is the package name.
-The second subexpression is the version string.")
-
-(defun package-version-join (l)
- "Turn a list of version numbers into a version string."
- (mapconcat 'int-to-string l "."))
+(defun package-version-join (vlist)
+ "Return the version string corresponding to the list VLIST.
+This is, approximately, the inverse of `version-to-list'.
+\(Actually, it returns only one of the possible inverses, since
+`version-to-list' is a many-to-one operation.)"
+ (if (null vlist)
+ ""
+ (let ((str-list (list "." (int-to-string (car vlist)))))
+ (dolist (num (cdr vlist))
+ (cond
+ ((>= num 0)
+ (push (int-to-string num) str-list)
+ (push "." str-list))
+ ((< num -3)
+ (error "Invalid version list `%s'" vlist))
+ (t
+ ;; pre, or beta, or alpha
+ (cond ((equal "." (car str-list))
+ (pop str-list))
+ ((not (string-match "[0-9]+" (car str-list)))
+ (error "Invalid version list `%s'" vlist)))
+ (push (cond ((= num -1) "pre")
+ ((= num -2) "beta")
+ ((= num -3) "alpha"))
+ str-list))))
+ (if (equal "." (car str-list))
+ (pop str-list))
+ (apply 'concat (nreverse str-list)))))
(defun package-strip-version (dirname)
"Strip the version from a combined package name and version.
E.g., if given \"quux-23.0\", will return \"quux\""
- (if (string-match package-subdirectory-regexp dirname)
+ (if (string-match (concat "\\`" package-subdirectory-regexp "\\'") dirname)
(match-string 1 dirname)))
(defun package-load-descriptor (dir package)
@@ -357,12 +376,13 @@ In each valid package subdirectory, this function loads the
description file containing a call to `define-package', which
updates `package-alist' and `package-obsolete-alist'."
(let ((all (memq 'all package-load-list))
+ (regexp (concat "\\`" package-subdirectory-regexp "\\'"))
name version force)
(dolist (dir (cons package-user-dir package-directory-list))
(when (file-directory-p dir)
(dolist (subdir (directory-files dir))
(when (and (file-directory-p (expand-file-name subdir dir))
- (string-match package-subdirectory-regexp subdir))
+ (string-match regexp subdir))
(setq name (intern (match-string 1 subdir))
version (match-string 2 subdir)
force (assq name package-load-list))
@@ -554,30 +574,29 @@ EXTRA-PROPERTIES is currently unused."
(package-autoload-ensure-default-file generated-autoload-file))
(update-directory-autoloads pkg-dir)))
-(defun package-untar-buffer ()
+(defvar tar-parse-info)
+(declare-function tar-untar-buffer "tar-mode" ())
+
+(defun package-untar-buffer (dir)
"Untar the current buffer.
-This uses `tar-untar-buffer' if it is available.
-Otherwise it uses an external `tar' program.
-`default-directory' should be set by the caller."
+This uses `tar-untar-buffer' from Tar mode. All files should
+untar into a directory named DIR; otherwise, signal an error."
(require 'tar-mode)
- (if (fboundp 'tar-untar-buffer)
- (progn
- ;; tar-mode messes with narrowing, so we just let it have the
- ;; whole buffer to play with.
- (delete-region (point-min) (point))
- (tar-mode)
- (tar-untar-buffer))
- ;; FIXME: check the result.
- (call-process-region (point) (point-max) "tar" nil '(nil nil) nil
- "xf" "-")))
+ (tar-mode)
+ ;; Make sure everything extracts into DIR.
+ (let ((regexp (concat "\\`" (regexp-quote dir) "/")))
+ (dolist (tar-data tar-parse-info)
+ (unless (string-match regexp (aref tar-data 2))
+ (error "Package does not untar cleanly into directory %s/" dir))))
+ (tar-untar-buffer))
(defun package-unpack (name version)
- (let ((pkg-dir (expand-file-name (concat (symbol-name name) "-" version)
- package-user-dir)))
+ (let* ((dirname (concat (symbol-name name) "-" version))
+ (pkg-dir (expand-file-name dirname package-user-dir)))
(make-directory package-user-dir t)
;; FIXME: should we delete PKG-DIR if it exists?
(let* ((default-directory (file-name-as-directory package-user-dir)))
- (package-untar-buffer)
+ (package-untar-buffer dirname)
(package-generate-autoloads (symbol-name name) pkg-dir)
(let ((load-path (cons pkg-dir load-path)))
(byte-recompile-directory pkg-dir 0 t)))))
@@ -592,7 +611,9 @@ Otherwise it uses an external `tar' program.
(if (string= file-name "package")
(package--write-file-no-coding
(expand-file-name (concat file-name ".el") package-user-dir))
- (let* ((pkg-dir (expand-file-name (concat file-name "-" version)
+ (let* ((pkg-dir (expand-file-name (concat file-name "-"
+ (package-version-join
+ (version-to-list version)))
package-user-dir))
(el-file (expand-file-name (concat file-name ".el") pkg-dir))
(pkg-file (expand-file-name (concat file-name "-pkg.el") pkg-dir)))
@@ -848,15 +869,17 @@ The package is found on one of the archives in `package-archives'."
;; Try to activate it.
(package-initialize))
-(defun package-strip-rcs-id (v-str)
- "Strip RCS version ID from the version string.
+(defun package-strip-rcs-id (str)
+ "Strip RCS version ID from the version string STR.
If the result looks like a dotted numeric version, return it.
Otherwise return nil."
- (if v-str
- (if (string-match "^[ \t]*[$]Revision:[ \t]\([0-9.]+\)[ \t]*[$]$" v-str)
- (match-string 1 v-str)
- (if (string-match "^[0-9.]*$" v-str)
- v-str))))
+ (when str
+ (when (string-match "\\`[ \t]*[$]Revision:[ \t]+" str)
+ (setq str (substring str (match-end 0))))
+ (condition-case nil
+ (if (version-to-list str)
+ str)
+ (error nil))))
(defun package-buffer-info ()
"Return a vector describing the package in the current buffer.
@@ -911,43 +934,47 @@ boundaries."
"Find package information for a tar file.
FILE is the name of the tar file to examine.
The return result is a vector like `package-buffer-info'."
- (unless (string-match "^\\(.+\\)-\\([0-9.]+\\)\\.tar$" file)
- (error "Invalid package name `%s'" file))
- (let* ((pkg-name (file-name-nondirectory (match-string-no-properties 1 file)))
- (pkg-version (match-string-no-properties 2 file))
- ;; Extract the package descriptor.
- (pkg-def-contents (shell-command-to-string
- ;; Requires GNU tar.
- (concat "tar -xOf " file " "
- pkg-name "-" pkg-version "/"
- pkg-name "-pkg.el")))
- (pkg-def-parsed (package-read-from-string pkg-def-contents)))
- (unless (eq (car pkg-def-parsed) 'define-package)
- (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name))
- (let ((name-str (nth 1 pkg-def-parsed))
- (version-string (nth 2 pkg-def-parsed))
- (docstring (nth 3 pkg-def-parsed))
- (requires (nth 4 pkg-def-parsed))
- (readme (shell-command-to-string
- ;; Requires GNU tar.
- (concat "tar -xOf " file " "
- pkg-name "-" pkg-version "/README"))))
- (unless (equal pkg-version version-string)
- (error "Package has inconsistent versions"))
- (unless (equal pkg-name name-str)
- (error "Package has inconsistent names"))
- ;; Kind of a hack.
- (if (string-match ": Not found in archive" readme)
- (setq readme nil))
- ;; Turn string version numbers into list form.
- (if (eq (car requires) 'quote)
- (setq requires (car (cdr requires))))
- (setq requires
- (mapcar (lambda (elt)
- (list (car elt)
- (version-to-list (cadr elt))))
- requires))
- (vector pkg-name requires docstring version-string readme))))
+ (let ((default-directory (file-name-directory file))
+ (file (file-name-nondirectory file)))
+ (unless (string-match (concat "\\`" package-subdirectory-regexp "\\.tar\\'")
+ file)
+ (error "Invalid package name `%s'" file))
+ (let* ((pkg-name (match-string-no-properties 1 file))
+ (pkg-version (match-string-no-properties 2 file))
+ ;; Extract the package descriptor.
+ (pkg-def-contents (shell-command-to-string
+ ;; Requires GNU tar.
+ (concat "tar -xOf " file " "
+
+ pkg-name "-" pkg-version "/"
+ pkg-name "-pkg.el")))
+ (pkg-def-parsed (package-read-from-string pkg-def-contents)))
+ (unless (eq (car pkg-def-parsed) 'define-package)
+ (error "No `define-package' sexp is present in `%s-pkg.el'" pkg-name))
+ (let ((name-str (nth 1 pkg-def-parsed))
+ (version-string (nth 2 pkg-def-parsed))
+ (docstring (nth 3 pkg-def-parsed))
+ (requires (nth 4 pkg-def-parsed))
+ (readme (shell-command-to-string
+ ;; Requires GNU tar.
+ (concat "tar -xOf " file " "
+ pkg-name "-" pkg-version "/README"))))
+ (unless (equal pkg-version version-string)
+ (error "Package has inconsistent versions"))
+ (unless (equal pkg-name name-str)
+ (error "Package has inconsistent names"))
+ ;; Kind of a hack.
+ (if (string-match ": Not found in archive" readme)
+ (setq readme nil))
+ ;; Turn string version numbers into list form.
+ (if (eq (car requires) 'quote)
+ (setq requires (car (cdr requires))))
+ (setq requires
+ (mapcar (lambda (elt)
+ (list (car elt)
+ (version-to-list (cadr elt))))
+ requires))
+ (vector pkg-name requires docstring version-string readme)))))
;;;###autoload
(defun package-install-from-buffer (pkg-info type)
@@ -1037,7 +1064,7 @@ makes them available for download."
(unless (file-exists-p package-user-dir)
(make-directory package-user-dir t))
(dolist (archive package-archives)
- (condition-case nil
+ (condition-case-no-debug nil
(package--download-one-archive archive "archive-contents")
(error (message "Failed to download `%s' archive."
(car archive)))))
@@ -1465,7 +1492,7 @@ packages marked for deletion are removed."
delete-list
", "))))
(dolist (elt delete-list)
- (condition-case err
+ (condition-case-no-debug err
(package-delete (car elt) (cdr elt))
(error (message (cadr err)))))
(error "Aborted")))
diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el
index d716240687..a9e8f11c39 100644
--- a/lisp/eshell/esh-opt.el
+++ b/lisp/eshell/esh-opt.el
@@ -35,13 +35,51 @@ Eshell commands implemented in Lisp."
;;; User Functions:
-(defmacro eshell-eval-using-options (name macro-args
- options &rest body-forms)
+(defmacro eshell-eval-using-options (name macro-args options &rest body-forms)
"Process NAME's MACRO-ARGS using a set of command line OPTIONS.
-After doing so, settings will be stored in local symbols as declared
-by OPTIONS; FORMS will then be evaluated -- assuming all was OK.
+After doing so, stores settings in local symbols as declared by OPTIONS;
+then evaluates BODY-FORMS -- assuming all was OK.
-The syntax of OPTIONS is:
+OPTIONS is a list, beginning with one or more elements of the form:
+\(SHORT LONG VALUE SYMBOL HELP-STRING)
+Each of these elements represents a particular command-line switch.
+
+SHORT is either nil, or a character that can be used as a switch -SHORT.
+LONG is either nil, or a string that can be used as a switch --LONG.
+At least one of SHORT and LONG must be non-nil.
+VALUE is the value associated with the option. It can be either:
+ t - the option needs a value to be specified after the switch;
+ nil - the option is given the value t;
+ anything else - specifies the actual value for the option.
+SYMBOL is either nil, or the name of the Lisp symbol that will be bound
+to VALUE. A nil SYMBOL calls `eshell-show-usage', and so is appropriate
+for a \"--help\" type option.
+HELP-STRING is a documentation string for the option.
+
+Any remaining elements of OPTIONS are :KEYWORD arguments. Some take
+arguments, some do not. The recognized :KEYWORDS are:
+
+:external STRING
+ STRING is an external command to run if there are unknown switches.
+
+:usage STRING
+ STRING is the initial part of the command's documentation string.
+ It appears before the options are listed.
+
+:post-usage STRING
+ STRING is an optional trailing part of the command's documentation string.
+ It appears after the options, but before the final part of the
+ documentation about the associated external command (if there is one).
+
+:show-usage
+ If present, then show the usage message if the command is called with no
+ arguments.
+
+:preserve-args
+ If present, do not pass MACRO-ARGS through `eshell-flatten-list'
+and `eshell-stringify-list'.
+
+For example, OPTIONS might look like:
'((?C nil nil multi-column \"multi-column display\")
(nil \"help\" nil nil \"show this usage display\")
@@ -52,8 +90,9 @@ The syntax of OPTIONS is:
Sort entries alphabetically across.\")
`eshell-eval-using-options' returns the value of the last form in
-BODY-FORMS. If instead an external command is run, the tag
-`eshell-external' will be thrown with the new process for its value.
+BODY-FORMS. If instead an external command is run (because of
+an unknown option), the tag `eshell-external' will be thrown with
+the new process for its value.
Lastly, any remaining arguments will be available in a locally
interned variable `args' (created using a `let' form)."
@@ -200,7 +239,7 @@ switch is unrecognized."
(defun eshell-process-args (name args options)
"Process the given ARGS using OPTIONS.
-This assumes that symbols have been intern'd by `eshell-with-options'."
+This assumes that symbols have been intern'd by `eshell-eval-using-options'."
(let ((ai 0) arg)
(while (< ai (length args))
(setq arg (nth ai args))
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index dbe4f824de..424d246a2b 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -138,7 +138,8 @@ function `string-to-number'."
(memq system-type '(ms-dos windows-nt)))
(defmacro eshell-condition-case (tag form &rest handlers)
- "Like `condition-case', but only if `eshell-pass-through-errors' is nil."
+ "If `eshell-handle-errors' is non-nil, this is `condition-case'.
+Otherwise, evaluates FORM with no error handling."
(if eshell-handle-errors
`(condition-case ,tag
,form
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 97862afb67..fffe09a84a 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -567,18 +567,12 @@ You can change the color sort order by customizing `list-colors-sort'."
(with-help-window buffer-name
(with-current-buffer standard-output
(erase-buffer)
+ (list-colors-print list callback)
+ (set-buffer-modified-p nil)
(setq truncate-lines t)))
- (let ((buf (get-buffer buffer-name))
- (inhibit-read-only t))
- ;; Display buffer before generating content, to allow
- ;; `list-colors-print' to get the right window-width.
- (with-selected-window (or (get-buffer-window buf t) (selected-window))
- (with-current-buffer buf
- (list-colors-print list callback)
- (set-buffer-modified-p nil)))
- (when callback
- (pop-to-buffer buf)
- (message "Click on a color to select it."))))
+ (when callback
+ (pop-to-buffer buffer-name)
+ (message "Click on a color to select it.")))
(defun list-colors-print (list &optional callback)
(let ((callback-fn
@@ -595,30 +589,19 @@ You can change the color sort order by customizing `list-colors-sort'."
(let* ((opoint (point))
(color-values (color-values (car color)))
(light-p (>= (apply 'max color-values)
- (* (car (color-values "white")) .5)))
- (max-len (max (- (window-width) 33) 20)))
+ (* (car (color-values "white")) .5))))
(insert (car color))
(indent-to 22)
(put-text-property opoint (point) 'face `(:background ,(car color)))
(put-text-property
(prog1 (point)
(insert " ")
- (if (cdr color)
- ;; Insert as many color names as possible, fitting max-len.
- (let ((names (list (car color)))
- (others (cdr color))
- (len (length (car color)))
- newlen)
- (while (and others
- (< (setq newlen (+ len 2 (length (car others))))
- max-len))
- (setq len newlen)
- (push (pop others) names))
- (insert (mapconcat 'identity (nreverse names) ", ")))
- (insert (car color))))
+ ;; Insert all color names.
+ (insert (mapconcat 'identity color ",")))
(point)
'face (list :foreground (car color)))
- (indent-to (max (- (window-width) 8) 44))
+ (insert (propertize " " 'display '(space :align-to (- right 9))))
+ (insert " ")
(insert (propertize
(apply 'format "#%02x%02x%02x"
(mapcar (lambda (c) (lsh c -8))
diff --git a/lisp/files.el b/lisp/files.el
index caf0a9752c..38047f2fa4 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3896,11 +3896,17 @@ See also `file-name-version-regexp'."
(let ((handler (find-file-name-handler file 'file-ownership-preserved-p)))
(if handler
(funcall handler 'file-ownership-preserved-p file)
- (let ((attributes (file-attributes file)))
+ (let ((attributes (file-attributes file 'integer)))
;; Return t if the file doesn't exist, since it's true that no
;; information would be lost by an (attempted) delete and create.
(or (null attributes)
- (= (nth 2 attributes) (user-uid)))))))
+ (= (nth 2 attributes) (user-uid))
+ ;; Files created on Windows by Administrator (RID=500)
+ ;; have the Administrators group (RID=544) recorded as
+ ;; their owner. Rewriting them will still preserve the
+ ;; owner.
+ (and (eq system-type 'windows-nt)
+ (= (user-uid) 500) (= (nth 2 attributes) 544)))))))
(defun file-name-sans-extension (filename)
"Return FILENAME sans final \"extension\".
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index b7b617fcff..988e821d7e 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2242,7 +2242,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
"\\)\\)\\>"
;; Any whitespace and defined object.
"[ \t'\(]*"
- "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?")
+ "\\(setf[ \t]+\\sw+\\|\\sw+\\)?")
(1 font-lock-keyword-face)
(9 (cond ((match-beginning 3) font-lock-function-name-face)
((match-beginning 6) font-lock-variable-name-face)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c14c79a92c..7eca03bd93 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,182 @@
+2011-03-18 Julien Danjou <julien@danjou.info>
+
+ * gnus-util.el (gnus-buffer-live-p): Simplify gnus-buffer-live-p.
+ (gnus-buffer-live-p): Check that buffer is not nil.
+
+2011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el: Require mouse, which the build bot seems to say is
+ needed.
+
+ * gravatar.el (gravatar-retrieve-synchronously): Use `url-retrieve' on
+ XEmacs, since it doesn't have url-retrieve-synchronously.
+
+2011-03-17 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * gnus-group.el (gnus-group-list-ticked): New function.
+ (gnus-group-make-menu-bar): Provide a menu entry for it.
+ (gnus-group-list-map): Provide a binding for it.
+
+2011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * shr.el (shr-visit-file): New command.
+
+ * nnimap.el (nnimap-fetch-inbox): Rewrite slightly last patch.
+
+2011-03-17 Bjørn Mork <bjorn@mork.no>
+
+ * nnimap.el (nnimap-fetch-inbox): Don't download bodies on ver4-capable
+ servers.
+
+2011-03-16 Julien Danjou <julien@danjou.info>
+
+ * mm-uu.el (mm-uu-dissect-text-parts): Only dissect handle that are
+ inline.
+
+ * gnus-art.el (article-hide-list-identifiers): Use
+ gnus-group-get-list-identifiers.
+
+ * gnus-sum.el (gnus-group-get-list-identifiers): New function.
+ (gnus-summary-remove-list-identifiers): Use
+ gnus-group-get-list-identifiers to get regexp.
+ (gnus-select-newsgroup, gnus-summary-insert-subject)
+ (gnus-summary-insert-articles): Call
+ gnus-summary-remove-list-identifiers unconditionally.
+
+2011-03-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-sum.el (gnus-articles-to-read): Revert back to old behaviour if
+ we're selecting a group with unread articles.
+
+ * nnimap.el (nnimap-open-connection-1): Allow `network-only', too.
+
+ * gssapi.el: New file separated out from imap.el to provide a general
+ Kerberos 5 connection facility for Emacs.
+
+ * message.el (message-elide-ellipsis): Document the format spec
+ ellipsis.
+
+2011-03-15 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * message.el (message-elide-region): Allow the ellipsis to say how many
+ lines were removed.
+
+2011-03-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-win.el (gnus-configure-frame): Protect against trying to restore
+ window configurations containing buffers that are now dead.
+
+ * nnimap.el (nnimap-parse-flags): Remove all MODSEQ entries before
+ parsing to avoid integer overflows.
+ (nnimap-parse-flags): Simplify the last change.
+ (nnimap-parse-flags): Store HIGHESTMODSEQ as a string, since it may be
+ too large for 32-bit Emacsen.
+
+2011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * auth-source.el (auth-source-netrc-create):
+ * message.el (message-yank-original): Fix use of `case'.
+
+2011-03-15 Nelson Ferreira <nelson.ferreira@ieee.org> (tiny change)
+
+ * gnus-art.el (gnus-article-treat-body-boundary): Fix boundary width on
+ XEmacs, which was one character too wide.
+
+2011-03-09 Antoine Levitt <antoine.levitt@gmail.com>
+
+ * gnus-sum.el (gnus-articles-to-read): Use gnus-large-newsgroup as
+ default number of articles to display.
+ (gnus-articles-to-read): Use pretty names for prompt.
+
+2011-03-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-int.el (gnus-open-server): Ditto.
+
+ * gnus-start.el (gnus-activate-group): Give a backtrace if
+ debug-on-quit is set and the user hits `C-g'.
+ (gnus-read-active-file): Ditto.
+
+ * gnus-group.el (gnus-group-read-ephemeral-group): Ditto.
+
+2011-03-15 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * message.el (message-yank-original): Use cond instead of CL case.
+
+2011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * auth-source.el (auth-source-netrc-create): Use usual format for the
+ default in prompts.
+
+2011-03-13 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-source-netrc-create): Show the default in the
+ prompt when prompting for token creation.
+
+2011-03-12 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-source-format-prompt): Always convert the value
+ to a string to avoid evaluating non-string arguments.
+ (auth-source-netrc-create): Offer default properly, not as initial
+ content in `read-string'.
+ (auth-source-netrc-saver): Use a cache keyed by file name and MD5 hash
+ of line to determine if we've been run before. If so, don't run again,
+ but print a trivial message to indicate the cache was hit instead.
+
+2011-03-11 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook):
+ Don't install `gnus-sync-read' to any hooks by default. It's buggy.
+ The user will have to run `gnus-sync-read' manually and wait for Cloudy
+ Gnus.
+
+2011-03-11 Julien Danjou <julien@danjou.info>
+
+ * mm-uu.el (mm-uu-type-alist): Add support for diff starting with "===
+ modified file".
+
+2011-03-09 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * auth-source.el (auth-source-read-char-choice): New function to read a
+ character choice using `dropdown-list', `read-char-choice', or
+ `read-char'. It appends "[a/b/c] " to the prompt if the choices were
+ '(?a ?b ?c). The `dropdown-list' support is disabled for now. Use
+ `eval-when-compile' to load `dropdown-list'. Remove `dropdown-list'.
+ (auth-source-netrc-saver): Use it.
+ (auth-source-pick-first-password): New convenience function.
+
+2011-03-08 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * nnimap.el (nnimap-credentials): Keep the :save-function as the third
+ parameter in the credentials.
+ (nnimap-open-connection-1): Use it after a successful login.
+ (nnimap-credentials): Add IMAP-specific user and password prompt.
+
+ * auth-source.el (auth-source-search): Add :require parameter, taking a
+ list. Document it and the :save-function return token. Pass :require
+ down. Change the CREATED message from a warning to a debug statement.
+ (auth-source-search-backends): Pass :require down.
+ (auth-source-netrc-search): Pass :require down.
+ (auth-source-netrc-parse): Use :require, if it's given, as a filter.
+ Change save prompt to indicate all modifications saved here are
+ deletions.
+ (auth-source-netrc-create): Take user login name as default in user
+ prompt. Move all the save functionality to a lexically bound function
+ under the :save-function token in the returned list. Set up clearer
+ default prompts for user, host, port, and secret.
+ (auth-source-netrc-saver): New function, intended to be wrapped for
+ :save-function.
+
+2011-03-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * shr.el (shr-table-horizontal-line): Change the defaults for the table
+ lines to be spaces instead.
+
+2011-03-07 Julien Danjou <julien@danjou.info>
+
+ * sieve-manage.el (sieve-sasl-auth): Create auth-info if not found.
+ (sieve-sasl-auth): Check that auth-source-search did return something,
+ or just return an empty string.
+
2011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
* gnus.el (gnus-interactive): Use read-directory-name.
@@ -12,6 +191,13 @@
2011-03-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * gnus-start.el (gnus-group-change-level): Allow putting foreign groups
+ onto the list of killed groups, too. This makes killed nnimap groups,
+ for instance, more reliably not reappear.
+
+ * nnimap.el (nnimap-request-thread): Don't bug out when we can't find
+ the parent.
+
* gnus-sum.el (gnus-update-read-articles): Fix typo.
* gnus.el (gnus-valid-select-methods): Mark nnimap as a backend that
@@ -24,8 +210,8 @@
2011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
- * message.el (message-cite-reply-position, message-cite-style): New
- variables.
+ * message.el (message-cite-reply-position, message-cite-style):
+ New variables.
(message-yank-original): Use the new citation styles.
2011-03-04 Daiki Ueno <ueno@unixuser.org>
@@ -139,14 +325,14 @@
2011-02-23 Lars Ingebrigtsen <larsi@gnus.org>
- * gnus-start.el (gnus-dribble-read-file): Set
- buffer-save-without-query, since we always want to save the dribble
+ * gnus-start.el (gnus-dribble-read-file):
+ Set buffer-save-without-query, since we always want to save the dribble
file, probably.
* nnmail.el (nnmail-article-group): Allow a final "" split to work on
nnimap.
- * gnus-sum.el (gnus-user-date-format-alist): Renamed back again from
+ * gnus-sum.el (gnus-user-date-format-alist): Rename back again from
-summary- since it's a user-visible variable.
* nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the
@@ -392,8 +578,8 @@
2011-02-14 Teodor Zlatanov <tzz@lifelogs.com>
* auth-source.el (auth-source-backend-parse-parameters): Don't rely on
- `plist-get' to accept non-list parameters (XEmacs issue). Fix
- docstring.
+ `plist-get' to accept non-list parameters (XEmacs issue).
+ Fix docstring.
(auth-source-secrets-search): Use `delete-dups', `append mapcar', and
`butlast' instead of `remove-duplicates', `mapcan', and `subseq'.
(auth-sources, auth-source-backend-parse, auth-source-secrets-search):
@@ -433,8 +619,8 @@
2011-02-13 Tassilo Horn <tassilo@member.fsf.org> (tiny change)
- * nnimap.el (nnimap-request-accept-article, nnimap-process-quirk): Fix
- Gcc processing on imap.
+ * nnimap.el (nnimap-request-accept-article, nnimap-process-quirk):
+ Fix Gcc processing on imap.
2011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -522,8 +708,8 @@
2011-02-06 Michael Albinus <michael.albinus@gmx.de>
- * auth-source.el (top): Require 'eieio unconditionally. Autoload
- `secrets-get-attributes' instead of `secrets-get-attribute'.
+ * auth-source.el (top): Require 'eieio unconditionally.
+ Autoload `secrets-get-attributes' instead of `secrets-get-attribute'.
(auth-source-secrets-search): Limit search when `max' is greater than
number of results.
@@ -559,7 +745,7 @@
(auth-source-protocol-defaults, auth-source-user-or-password-imap)
(auth-source-user-or-password-pop3, auth-source-user-or-password-ssh)
(auth-source-user-or-password-sftp)
- (auth-source-user-or-password-smtp): Removed.
+ (auth-source-user-or-password-smtp): Remove.
(auth-source-user-or-password): Deprecated and modified to be a wrapper
around `auth-source-search'. Not tested thoroughly.
@@ -725,16 +911,16 @@
* gnus-group.el (gnus-group-jump-to-group): Allow jumping to groups
that Gnus doesn't know exists again.
- * gnus-art.el (gnus-article-date-lapsed-new-header): Removed.
+ * gnus-art.el (gnus-article-date-lapsed-new-header): Remove.
(gnus-treat-date-ut): Ditto.
- (gnus-article-update-date-header): Renamed.
- (gnus-treat-date-local): Removed.
- (gnus-treat-date-english): Removed.
- (gnus-treat-date-lapsed): Removed.
- (gnus-treat-date-combined-lapsed): Removed.
- (gnus-treat-date-original): Removed.
- (gnus-treat-date-iso8601): Removed.
- (gnus-treat-date-user-defined): Removed.
+ (gnus-article-update-date-header): Rename.
+ (gnus-treat-date-local): Remove.
+ (gnus-treat-date-english): Remove.
+ (gnus-treat-date-lapsed): Remove.
+ (gnus-treat-date-combined-lapsed): Remove.
+ (gnus-treat-date-original): Remove.
+ (gnus-treat-date-iso8601): Remove.
+ (gnus-treat-date-user-defined): Remove.
(gnus-article-date-headers): New variable to control all the date
header options.
(article-date-ut): Rewrite to allow using the new way to format date
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index 500de10b71..e0bea324a2 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -54,6 +54,8 @@
(autoload 'secrets-list-collections "secrets")
(autoload 'secrets-search-items "secrets")
+(autoload 'rfc2104-hash "rfc2104")
+
(defvar secrets-enabled)
(defgroup auth-source nil
@@ -286,6 +288,28 @@ If the value is not a list, symmetric encryption will be used."
msg))
+;;; (auth-source-read-char-choice "enter choice? " '(?a ?b ?q))
+(defun auth-source-read-char-choice (prompt choices)
+ "Read one of CHOICES by `read-char-choice', or `read-char'.
+`dropdown-list' support is disabled because it doesn't work reliably.
+Only one of CHOICES will be returned. The PROMPT is augmented
+with \"[a/b/c] \" if CHOICES is '\(?a ?b ?c\)."
+ (when choices
+ (let* ((prompt-choices
+ (apply 'concat (loop for c in choices
+ collect (format "%c/" c))))
+ (prompt-choices (concat "[" (substring prompt-choices 0 -1) "] "))
+ (full-prompt (concat prompt prompt-choices))
+ k)
+
+ (while (not (memq k choices))
+ (setq k (cond
+ ((fboundp 'read-char-choice)
+ (read-char-choice full-prompt choices))
+ (t (message "%s" full-prompt)
+ (setq k (read-char))))))
+ k)))
+
;; (auth-source-pick nil :host "any" :port 'imap :user "joe")
;; (auth-source-pick t :host "any" :port 'imap :user "joe")
;; (setq auth-sources '((:source (:secrets default) :host t :port t :user "joe")
@@ -393,7 +417,7 @@ parameters."
(defun* auth-source-search (&rest spec
&key type max host user port secret
- create delete
+ require create delete
&allow-other-keys)
"Search or modify authentication backends according to SPEC.
@@ -487,6 +511,11 @@ should `catch' the backend-specific error as usual. Some
backends (netrc, at least) will prompt the user rather than throw
an error.
+:require (A B C) means that only results that contain those
+tokens will be returned. Thus for instance requiring :secret
+will ensure that any results will actually have a :secret
+property.
+
:delete t means to delete any found entries. nil by default.
Use `auth-source-delete' in ELisp code instead of calling
`auth-source-search' directly with this parameter.
@@ -516,11 +545,17 @@ is a plist with keys :backend :host :port :user, plus any other
keys provided by the backend (notably :secret). But note the
exception for :max 0, which see above.
+The token can hold a :save-function key. If you call that, the
+user will be prompted to save the data to the backend. You can't
+request that this should happen right after creation, because
+`auth-source-search' has no way of knowing if the token is
+actually useful. So the caller must arrange to call this function.
+
The token's :secret key can hold a function. In that case you
must call it to obtain the actual value."
(let* ((backends (mapcar 'auth-source-backend-parse auth-sources))
(max (or max 1))
- (ignored-keys '(:create :delete :max))
+ (ignored-keys '(:require :create :delete :max))
(keys (loop for i below (length spec) by 2
unless (memq (nth i spec) ignored-keys)
collect (nth i spec)))
@@ -539,6 +574,10 @@ must call it to obtain the actual value."
(or (eq t create) (listp create)) t
"Invalid auth-source :create parameter (must be t or a list): %s %s")
+ (assert
+ (listp require) t
+ "Invalid auth-source :require parameter (must be a list): %s")
+
(setq filtered-backends (copy-sequence backends))
(dolist (backend backends)
(dolist (key keys)
@@ -562,8 +601,9 @@ must call it to obtain the actual value."
spec
;; to exit early
max
- ;; create and delete
- nil delete))
+ ;; create is always nil here
+ nil delete
+ require))
(auth-source-do-debug
"auth-source-search: found %d results (max %d) matching %S"
@@ -577,9 +617,9 @@ must call it to obtain the actual value."
spec
;; to exit early
max
- ;; create and delete
- create delete))
- (auth-source-do-warn
+ create delete
+ require))
+ (auth-source-do-debug
"auth-source-search: CREATED %d results (max %d) matching %S"
(length found) max spec))
@@ -589,18 +629,19 @@ must call it to obtain the actual value."
found))
-(defun auth-source-search-backends (backends spec max create delete)
+(defun auth-source-search-backends (backends spec max create delete require)
(let (matches)
(dolist (backend backends)
(when (> max (length matches)) ; when we need more matches...
- (let ((bmatches (apply
- (slot-value backend 'search-function)
- :backend backend
- ;; note we're overriding whatever the spec
- ;; has for :create and :delete
- :create create
- :delete delete
- spec)))
+ (let* ((bmatches (apply
+ (slot-value backend 'search-function)
+ :backend backend
+ ;; note we're overriding whatever the spec
+ ;; has for :require, :create, and :delete
+ :require require
+ :create create
+ :delete delete
+ spec)))
(when bmatches
(auth-source-do-trivia
"auth-source-search-backend: got %d (max %d) in %s:%s matching %S"
@@ -713,7 +754,28 @@ while \(:host t) would find all host entries."
(return 'no)))
'no))))
-;;; Backend specific parsing: netrc/authinfo backend
+;;; (auth-source-pick-first-password :host "z.lifelogs.com")
+;;; (auth-source-pick-first-password :port "imap")
+(defun auth-source-pick-first-password (&rest spec)
+ "Pick the first secret found from applying SPEC to `auth-source-search'."
+ (let* ((result (nth 0 (apply 'auth-source-search (plist-put spec :max 1))))
+ (secret (plist-get result :secret)))
+
+ (if (functionp secret)
+ (funcall secret)
+ secret)))
+
+;; (auth-source-format-prompt "test %u %h %p" '((?u "user") (?h "host")))
+(defun auth-source-format-prompt (prompt alist)
+ "Format PROMPT using %x (for any character x) specifiers in ALIST."
+ (dolist (cell alist)
+ (let ((c (nth 0 cell))
+ (v (nth 1 cell)))
+ (when (and c v)
+ (setq prompt (replace-regexp-in-string (format "%%%c" c)
+ (format "%s" v)
+ prompt)))))
+ prompt)
(defun auth-source-ensure-strings (values)
(unless (listp values)
@@ -724,12 +786,14 @@ while \(:host t) would find all host entries."
value))
values))
+;;; Backend specific parsing: netrc/authinfo backend
+
(defvar auth-source-netrc-cache nil)
;;; (auth-source-netrc-parse "~/.authinfo.gpg")
(defun* auth-source-netrc-parse (&rest
spec
- &key file max host user port delete
+ &key file max host user port delete require
&allow-other-keys)
"Parse FILE and return a list of all entries in the file.
Note that the MAX parameter is used so we can exit the parse early."
@@ -828,7 +892,15 @@ Note that the MAX parameter is used so we can exit the parse early."
(or
(aget alist "port")
(aget alist "protocol")
- t)))
+ t))
+ (or
+ ;; the required list of keys is nil, or
+ (null require)
+ ;; every element of require is in the normalized list
+ (let ((normalized (nth 0 (auth-source-netrc-normalize
+ (list alist)))))
+ (loop for req in require
+ always (plist-get normalized req)))))
(decf max)
(push (nreverse alist) result)
;; to delete a line, we just comment it out
@@ -853,7 +925,7 @@ Note that the MAX parameter is used so we can exit the parse early."
(setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
;; ask AFTER we've successfully opened the file
- (when (y-or-n-p (format "Save file %s? (%d modifications)"
+ (when (y-or-n-p (format "Save file %s? (%d deletions)"
file modified))
(write-region (point-min) (point-max) file nil 'silent)
(auth-source-do-debug
@@ -893,7 +965,7 @@ Note that the MAX parameter is used so we can exit the parse early."
(defun* auth-source-netrc-search (&rest
spec
- &key backend create delete
+ &key backend require create delete
type max host user port
&allow-other-keys)
"Given a property list SPEC, return search matches from the :backend.
@@ -905,6 +977,7 @@ See `auth-source-search' for details on SPEC."
(let ((results (auth-source-netrc-normalize
(auth-source-netrc-parse
:max max
+ :require require
:delete delete
:file (oref backend source)
:host (or host t)
@@ -933,17 +1006,6 @@ See `auth-source-search' for details on SPEC."
(nth 0 v)
v))
-;; (auth-source-format-prompt "test %u %h %p" '((?u "user") (?h "host")))
-
-(defun auth-source-format-prompt (prompt alist)
- "Format PROMPT using %x (for any character x) specifiers in ALIST."
- (dolist (cell alist)
- (let ((c (nth 0 cell))
- (v (nth 1 cell)))
- (when (and c v)
- (setq prompt (replace-regexp-in-string (format "%%%c" c) v prompt)))))
- prompt)
-
;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t)
;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B)))
@@ -992,12 +1054,12 @@ See `auth-source-search' for details on SPEC."
(data (auth-source-netrc-element-or-first data))
;; this is the default to be offered
(given-default (aget auth-source-creation-defaults r))
- ;; the default supplementals are simple: for the user,
- ;; try (user-login-name), otherwise take given-default
+ ;; the default supplementals are simple:
+ ;; for the user, try `given-default' and then (user-login-name);
+ ;; otherwise take `given-default'
(default (cond
- ;; don't default the user name
- ;; ((and (not given-default) (eq r 'user))
- ;; (user-login-name))
+ ((and (not given-default) (eq r 'user))
+ (user-login-name))
(t given-default)))
(printable-defaults (list
(cons 'user
@@ -1020,10 +1082,10 @@ See `auth-source-search' for details on SPEC."
"[any port]"))))
(prompt (or (aget auth-source-creation-prompts r)
(case r
- ('secret "%p password for user %u, host %h: ")
- ('user "%p user name: ")
- ('host "%p host name for user %u: ")
- ('port "%p port for user %u and host %h: "))
+ (secret "%p password for %u@%h: ")
+ (user "%p user name for %h: ")
+ (host "%p host name for user %u: ")
+ (port "%p port for %u@%h: "))
(format "Enter %s (%%u@%%h:%%p): " r)))
(prompt (auth-source-format-prompt
prompt
@@ -1031,14 +1093,20 @@ See `auth-source-search' for details on SPEC."
(?h ,(aget printable-defaults 'host))
(?p ,(aget printable-defaults 'port))))))
- ;; store the data, prompting for the password if needed
+ ;; Store the data, prompting for the password if needed.
(setq data
(cond
((and (null data) (eq r 'secret))
- ;; special case prompt for passwords
+ ;; Special case prompt for passwords.
(read-passwd prompt))
((null data)
- (read-string prompt default))
+ (when default
+ (setq prompt
+ (if (string-match ": *\\'" prompt)
+ (concat (substring prompt 0 (match-beginning 0))
+ " (default " default "): ")
+ (concat prompt "(default " default ") "))))
+ (read-string prompt nil nil default))
(t (or data default))))
(when data
@@ -1049,7 +1117,7 @@ See `auth-source-search' for details on SPEC."
(lambda () data))
data))))
- ;; when r is not an empty string...
+ ;; When r is not an empty string...
(when (and (stringp data)
(< 0 (length data)))
;; this function is not strictly necessary but I think it
@@ -1062,79 +1130,99 @@ See `auth-source-search' for details on SPEC."
(if (zerop (length add)) "" " ")
;; remap auth-source tokens to netrc
(case r
- ('user "login")
- ('host "machine")
- ('secret "password")
- ('port "port") ; redundant but clearer
+ (user "login")
+ (host "machine")
+ (secret "password")
+ (port "port") ; redundant but clearer
(t (symbol-name r)))
;; the value will be printed in %S format
data))))
(setq add (concat add (funcall printer)))))))
- (with-temp-buffer
- (when (file-exists-p file)
- (insert-file-contents file))
- (when auth-source-gpg-encrypt-to
- ;; (see bug#7487) making `epa-file-encrypt-to' local to
- ;; this buffer lets epa-file skip the key selection query
- ;; (see the `local-variable-p' check in
- ;; `epa-file-write-region').
- (unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
- (make-local-variable 'epa-file-encrypt-to))
- (if (listp auth-source-gpg-encrypt-to)
- (setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
- (goto-char (point-max))
-
- ;; ask AFTER we've successfully opened the file
- (let ((prompt (format "Save auth info to file %s? %s: "
- file
- "y/n/N/e/?"))
- (done (not (eq auth-source-save-behavior 'ask)))
- (bufname "*auth-source Help*")
- k)
- (while (not done)
- (message "%s" prompt)
- (setq k (read-char))
- (case k
- (?y (setq done t))
- (?? (save-excursion
- (with-output-to-temp-buffer bufname
- (princ
- (concat "(y)es, save\n"
- "(n)o but use the info\n"
- "(N)o and don't ask to save again\n"
- "(e)dit the line\n"
- "(?) for help as you can see.\n"))
- (set-buffer standard-output)
- (help-mode))))
- (?n (setq add ""
- done t))
- (?N (setq add ""
- done t
- auth-source-save-behavior nil))
- (?e (setq add (read-string "Line to add: " add)))
- (t nil)))
-
- (when (get-buffer-window bufname)
- (delete-window (get-buffer-window bufname)))
-
- ;; make sure the info is not saved
- (when (null auth-source-save-behavior)
- (setq add ""))
-
- (when (< 0 (length add))
- (progn
- (unless (bolp)
- (insert "\n"))
- (insert add "\n")
- (write-region (point-min) (point-max) file nil 'silent)
- (auth-source-do-warn
- "auth-source-netrc-create: wrote 1 new line to %s"
- file)
- nil))
-
- (when (eq done t)
- (list artificial))))))
+ (plist-put
+ artificial
+ :save-function
+ (lexical-let ((file file)
+ (add add))
+ (lambda () (auth-source-netrc-saver file add))))
+
+ (list artificial)))
+
+;;(funcall (plist-get (nth 0 (auth-source-search :host '("nonesuch2") :user "tzz" :port "imap" :create t :max 1)) :save-function))
+(defun auth-source-netrc-saver (file add)
+ "Save a line ADD in FILE, prompting along the way.
+Respects `auth-source-save-behavior'. Uses
+`auth-source-netrc-cache' to avoid prompting more than once."
+ (let* ((key (format "%s %s" file (rfc2104-hash 'md5 64 16 file add)))
+ (cached (assoc key auth-source-netrc-cache)))
+
+ (if cached
+ (auth-source-do-trivia
+ "auth-source-netrc-saver: found previous run for key %s, returning"
+ key)
+ (with-temp-buffer
+ (when (file-exists-p file)
+ (insert-file-contents file))
+ (when auth-source-gpg-encrypt-to
+ ;; (see bug#7487) making `epa-file-encrypt-to' local to
+ ;; this buffer lets epa-file skip the key selection query
+ ;; (see the `local-variable-p' check in
+ ;; `epa-file-write-region').
+ (unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
+ (make-local-variable 'epa-file-encrypt-to))
+ (if (listp auth-source-gpg-encrypt-to)
+ (setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
+ ;; we want the new data to be found first, so insert at beginning
+ (goto-char (point-min))
+
+ ;; Ask AFTER we've successfully opened the file.
+ (let ((prompt (format "Save auth info to file %s? " file))
+ (done (not (eq auth-source-save-behavior 'ask)))
+ (bufname "*auth-source Help*")
+ k)
+ (while (not done)
+ (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??)))
+ (case k
+ (?y (setq done t))
+ (?? (save-excursion
+ (with-output-to-temp-buffer bufname
+ (princ
+ (concat "(y)es, save\n"
+ "(n)o but use the info\n"
+ "(N)o and don't ask to save again\n"
+ "(e)dit the line\n"
+ "(?) for help as you can see.\n"))
+ ;; Why? Doesn't with-output-to-temp-buffer already do
+ ;; the exact same thing anyway? --Stef
+ (set-buffer standard-output)
+ (help-mode))))
+ (?n (setq add ""
+ done t))
+ (?N (setq add ""
+ done t
+ auth-source-save-behavior nil))
+ (?e (setq add (read-string "Line to add: " add)))
+ (t nil)))
+
+ (when (get-buffer-window bufname)
+ (delete-window (get-buffer-window bufname)))
+
+ ;; Make sure the info is not saved.
+ (when (null auth-source-save-behavior)
+ (setq add ""))
+
+ (when (< 0 (length add))
+ (progn
+ (unless (bolp)
+ (insert "\n"))
+ (insert add "\n")
+ (write-region (point-min) (point-max) file nil 'silent)
+ (auth-source-do-debug
+ "auth-source-netrc-create: wrote 1 new line to %s"
+ file)
+ (message "Saved new authentication information to %s" file)
+ nil))))
+ (aput 'auth-source-netrc-cache key "ran"))))
;;; Backend specific parsing: Secrets API backend
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index c64138b43d..7c7e053192 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -44,6 +44,7 @@
(require 'wid-edit)
(require 'mm-uu)
(require 'message)
+(require 'mouse)
(autoload 'gnus-msg-mail "gnus-msg" nil t)
(autoload 'gnus-button-mailto "gnus-msg")
@@ -2337,10 +2338,12 @@ long lines if and only if arg is positive."
(let ((start (point)))
(insert "X-Boundary: ")
(gnus-add-text-properties start (point) '(invisible t intangible t))
- (insert (let (str)
- (while (>= (window-width) (length str))
+ (insert (let (str (max (window-width)))
+ (if (featurep 'xemacs)
+ (setq max (1- max)))
+ (while (>= max (length str))
(setq str (concat str gnus-body-boundary-delimiter)))
- (substring str 0 (window-width)))
+ (substring str 0 max))
"\n")
(gnus-put-text-property start (point) 'gnus-decoration 'header)))))
@@ -3074,10 +3077,7 @@ images if any to the browser, and deletes them when exiting the group
The `gnus-list-identifiers' variable specifies what to do."
(interactive)
(let ((inhibit-point-motion-hooks t)
- (regexp (or (gnus-parameter-list-identifier gnus-newsgroup-name)
- (if (consp gnus-list-identifiers)
- (mapconcat 'identity gnus-list-identifiers " *\\|")
- gnus-list-identifiers)))
+ (regexp (gnus-group-get-list-identifiers gnus-newsgroup-name))
(inhibit-read-only t))
(when regexp
(save-excursion
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 9ed3cf02a4..c265538e19 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -697,7 +697,8 @@ simple manner.")
"M" gnus-group-list-all-matching
"l" gnus-group-list-level
"c" gnus-group-list-cached
- "?" gnus-group-list-dormant)
+ "?" gnus-group-list-dormant
+ "!" gnus-group-list-ticked)
(gnus-define-keys (gnus-group-list-limit-map "/" gnus-group-list-map)
"k" gnus-group-list-limit
@@ -849,7 +850,8 @@ simple manner.")
["List all groups matching..." gnus-group-list-all-matching t]
["List active file" gnus-group-list-active t]
["List groups with cached" gnus-group-list-cached t]
- ["List groups with dormant" gnus-group-list-dormant t])
+ ["List groups with dormant" gnus-group-list-dormant t]
+ ["List groups with ticked" gnus-group-list-ticked t])
("Sort"
["Default sort" gnus-group-sort-groups t]
["Sort by method" gnus-group-sort-groups-by-method t]
@@ -2313,9 +2315,10 @@ Return the name of the group if selection was successful."
gnus-fetch-old-ephemeral-headers))
(gnus-group-read-group (or number t) t group select-articles))
group)
- ;;(error nil)
(quit
- (message "Quit reading the ephemeral group")
+ (if debug-on-quit
+ (debug "Quit")
+ (message "Quit reading the ephemeral group"))
nil)))))
(defcustom gnus-gmane-group-download-format
@@ -4535,6 +4538,28 @@ This command may read the active file."
(goto-char (point-min))
(gnus-group-position-point))
+(defun gnus-group-list-ticked (level &optional lowest)
+ "List all groups with ticked articles.
+If the prefix LEVEL is non-nil, it should be a number that says which
+level to cut off listing groups.
+If LOWEST, don't list groups with level lower than LOWEST.
+
+This command may read the active file."
+ (interactive "P")
+ (when level
+ (setq level (prefix-numeric-value level)))
+ (when (or (not level) (>= level gnus-level-zombie))
+ (gnus-cache-open))
+ (funcall gnus-group-prepare-function
+ (or level gnus-level-subscribed)
+ #'(lambda (info)
+ (let ((marks (gnus-info-marks info)))
+ (assq 'tick marks)))
+ lowest
+ 'ignore)
+ (goto-char (point-min))
+ (gnus-group-position-point))
+
(defun gnus-group-listed-groups ()
"Return a list of listed groups."
(let (point groups)
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index a67063bb97..ef15a47989 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -270,7 +270,9 @@ If it is down, start it up (again)."
server (error-message-string err))
nil)
(quit
- (gnus-message 1 "Quit trying to open server %s" server)
+ (if debug-on-quit
+ (debug "Quit")
+ (gnus-message 1 "Quit trying to open server %s" server))
nil)))
open-offline)
;; If this hasn't been opened before, we add it to the list.
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index ebfa53f841..afded87fe3 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1306,16 +1306,13 @@ for new groups, and subscribe the new groups as zombies."
((>= level gnus-level-zombie)
;; Remove from the hash table.
(gnus-sethash group nil gnus-newsrc-hashtb)
- ;; We do not enter foreign groups into the list of dead
- ;; groups.
- (unless (gnus-group-foreign-p group)
- (if (= level gnus-level-zombie)
- (push group gnus-zombie-list)
- (if (= oldlevel gnus-level-killed)
- ;; Remove from active hashtb.
- (unintern group gnus-active-hashtb)
- ;; Don't add it into killed-list if it was killed.
- (push group gnus-killed-list)))))
+ (if (= level gnus-level-zombie)
+ (push group gnus-zombie-list)
+ (if (= oldlevel gnus-level-killed)
+ ;; Remove from active hashtb.
+ (unintern group gnus-active-hashtb)
+ ;; Don't add it into killed-list if it was killed.
+ (push group gnus-killed-list))))
(t
;; If the list is to be entered into the newsrc assoc, and
;; it was killed, we have to create an entry in the newsrc
@@ -1465,9 +1462,10 @@ If SCAN, request a scan of that group as well."
(inline (gnus-request-group group (or dont-sub-check dont-check)
method
(gnus-get-info group)))
- ;;(error nil)
(quit
- (message "Quit activating %s" group)
+ (if debug-on-quit
+ (debug "Quit")
+ (message "Quit activating %s" group))
nil)))
(unless dont-check
(setq active (gnus-parse-active))
@@ -2007,7 +2005,9 @@ If SCAN, request a scan of that group as well."
;; We catch C-g so that we can continue past servers
;; that do not respond.
(quit
- (message "Quit reading the active file")
+ (if debug-on-quit
+ (debug "Quit")
+ (message "Quit reading the active file"))
nil))))))))
(defun gnus-read-active-file-1 (method force)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index a8786e39c7..29a98b7d11 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -5510,12 +5510,17 @@ or a straight list of headers."
(cdr (assq number gnus-newsgroup-scored))
(memq number gnus-newsgroup-processable))))))
+(defun gnus-group-get-list-identifiers (group)
+ "Get list identifier regexp for GROUP."
+ (or (gnus-parameter-list-identifier group)
+ (if (consp gnus-list-identifiers)
+ (mapconcat 'identity gnus-list-identifiers " *\\|")
+ gnus-list-identifiers)))
+
(defun gnus-summary-remove-list-identifiers ()
"Remove list identifiers in `gnus-list-identifiers' from articles in the current group."
- (let ((regexp (if (consp gnus-list-identifiers)
- (mapconcat 'identity gnus-list-identifiers " *\\|")
- gnus-list-identifiers))
- changed subject)
+ (let ((regexp (gnus-group-get-list-identifiers gnus-newsgroup-name))
+ changed subject)
(when regexp
(setq regexp (concat "^\\(?:R[Ee]: +\\)*\\(" regexp " *\\)"))
(dolist (header gnus-newsgroup-headers)
@@ -5707,8 +5712,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
(when gnus-agent
(gnus-agent-get-undownloaded-list))
;; Remove list identifiers from subject
- (when gnus-list-identifiers
- (gnus-summary-remove-list-identifiers))
+ (gnus-summary-remove-list-identifiers)
;; Check whether auto-expire is to be done in this group.
(setq gnus-newsgroup-auto-expire
(gnus-group-auto-expirable-p group))
@@ -5798,7 +5802,8 @@ If SELECT-ARTICLES, only select those articles from GROUP."
(defun gnus-articles-to-read (group &optional read-all)
"Find out what articles the user wants to read."
- (let* ((articles
+ (let* ((only-read-p t)
+ (articles
;; Select all articles if `read-all' is non-nil, or if there
;; are no unread articles.
(if (or read-all
@@ -5822,6 +5827,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
(gnus-uncompress-range (gnus-active group)))
(gnus-cache-articles-in-group group))
;; Select only the "normal" subset of articles.
+ (setq only-read-p nil)
(gnus-sorted-nunion
(gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked)
gnus-newsgroup-unreads)))
@@ -5845,16 +5851,25 @@ If SELECT-ARTICLES, only select those articles from GROUP."
(let* ((cursor-in-echo-area nil)
(initial (gnus-parameter-large-newsgroup-initial
gnus-newsgroup-name))
+ (default (if only-read-p
+ (or initial gnus-large-newsgroup)
+ number))
(input
(read-string
- (format
- "How many articles from %s (%s %d): "
- (gnus-group-decoded-name gnus-newsgroup-name)
- (if initial "max" "default")
- number)
- (if initial
- (cons (number-to-string initial)
- 0)))))
+ (if only-read-p
+ (format
+ "How many articles from %s (available %d, default %d): "
+ (gnus-group-decoded-name
+ (gnus-group-real-name gnus-newsgroup-name))
+ number default)
+ (format
+ "How many articles from %s (%d available): "
+ (gnus-group-decoded-name
+ (gnus-group-real-name gnus-newsgroup-name))
+ default))
+ nil
+ nil
+ (number-to-string default))))
(if (string-match "^[ \t]*$" input) number input)))
((and (> scored marked) (< scored number)
(> (- scored number) 20))
@@ -5862,7 +5877,8 @@ If SELECT-ARTICLES, only select those articles from GROUP."
(read-string
(format "%s %s (%d scored, %d total): "
"How many articles from"
- (gnus-group-decoded-name group)
+ (gnus-group-decoded-name
+ (gnus-group-real-name gnus-newsgroup-name))
scored number))))
(if (string-match "^[ \t]*$" input)
number input)))
@@ -6564,9 +6580,8 @@ the subject line on."
(1+ (point-at-eol))
(gnus-delete-line))))))
;; Remove list identifiers from subject.
- (when gnus-list-identifiers
- (let ((gnus-newsgroup-headers (list header)))
- (gnus-summary-remove-list-identifiers)))
+ (let ((gnus-newsgroup-headers (list header)))
+ (gnus-summary-remove-list-identifiers))
(when old-header
(mail-header-set-number header (mail-header-number old-header)))
(setq gnus-newsgroup-sparse
@@ -12670,8 +12685,7 @@ returned."
(when gnus-agent
(gnus-agent-get-undownloaded-list))
;; Remove list identifiers from subject
- (when gnus-list-identifiers
- (gnus-summary-remove-list-identifiers))
+ (gnus-summary-remove-list-identifiers)
;; First and last article in this newsgroup.
(when gnus-newsgroup-headers
(setq gnus-newsgroup-begin
diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el
index 892b10a0d0..fbdacdd2fb 100644
--- a/lisp/gnus/gnus-sync.el
+++ b/lisp/gnus/gnus-sync.el
@@ -25,7 +25,8 @@
;; This is the gnus-sync.el package.
;; It's due for a rewrite using gnus-after-set-mark-hook and
-;; gnus-before-update-mark-hook. Until then please consider it
+;; gnus-before-update-mark-hook, and my plan is to do this once No
+;; Gnus development is done. Until then please consider it
;; experimental.
;; Put this in your startup file (~/.gnus.el for instance)
@@ -42,7 +43,8 @@
;; TODO:
-;; - after gnus-sync-read, the message counts are wrong
+;; - after gnus-sync-read, the message counts are wrong. So it's not
+;; run automatically, you have to call it with M-x gnus-sync-read
;; - use gnus-after-set-mark-hook and gnus-before-update-mark-hook to
;; catch the mark updates
@@ -220,13 +222,13 @@ synchronized, I believe). Also see `gnus-variable-list'."
"Install the sync hooks."
(interactive)
;; (add-hook 'gnus-get-new-news-hook 'gnus-sync-read)
- (add-hook 'gnus-save-newsrc-hook 'gnus-sync-save)
- (add-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read))
+ ;; (add-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read)
+ (add-hook 'gnus-save-newsrc-hook 'gnus-sync-save))
(defun gnus-sync-unload-hook ()
"Uninstall the sync hooks."
(interactive)
- ;; (remove-hook 'gnus-get-new-news-hook 'gnus-sync-read)
+ (remove-hook 'gnus-get-new-news-hook 'gnus-sync-read)
(remove-hook 'gnus-save-newsrc-hook 'gnus-sync-save)
(remove-hook 'gnus-read-newsrc-el-hook 'gnus-sync-read))
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 42dbd5948c..3f66b45aaa 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -672,11 +672,9 @@ If N, return the Nth ancestor instead."
(when (string-match "\\(<[^<]+>\\)[ \t]*\\'" references)
(match-string 1 references))))))
-(defun gnus-buffer-live-p (buffer)
+(defsubst gnus-buffer-live-p (buffer)
"Say whether BUFFER is alive or not."
- (and buffer
- (get-buffer buffer)
- (buffer-name (get-buffer buffer))))
+ (and buffer (buffer-live-p (get-buffer buffer))))
(defun gnus-horizontal-recenter ()
"Recenter the current buffer horizontally."
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index 156f9a020f..c38f57d96c 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -268,8 +268,10 @@ See the Gnus manual for an explanation of the syntax used.")
(error "Invalid buffer type: %s" type))
(let ((buf (gnus-get-buffer-create
(gnus-window-to-buffer-helper buffer))))
- (if (eq buf (window-buffer (selected-window))) (set-buffer buf)
- (switch-to-buffer buf)))
+ (when (buffer-name buf)
+ (if (eq buf (window-buffer (selected-window)))
+ (set-buffer buf)
+ (switch-to-buffer buf))))
(when (memq 'frame-focus split)
(setq gnus-window-frame-focus window))
;; We return the window if it has the `point' spec.
diff --git a/lisp/gnus/gravatar.el b/lisp/gnus/gravatar.el
index 0c97080d84..4b0c9a1628 100644
--- a/lisp/gnus/gravatar.el
+++ b/lisp/gnus/gravatar.el
@@ -129,8 +129,10 @@ You can provide a list of argument to pass to CB in CBARGS."
"Retrieve MAIL-ADDRESS gravatar and returns it."
(let ((url (gravatar-build-url mail-address)))
(if (gravatar-cache-expired url)
- (with-current-buffer (url-retrieve-synchronously url)
- (when gravatar-automatic-caching
+ (with-current-buffer (if (featurep 'xemacs)
+ (url-retrieve url)
+ (url-retrieve-synchronously url))
+ (when gravatar-automatic-caching
(url-store-in-cache (current-buffer)))
(let ((data (gravatar-data->image)))
(kill-buffer (current-buffer))
diff --git a/lisp/gnus/gssapi.el b/lisp/gnus/gssapi.el
new file mode 100644
index 0000000000..3765fb84ee
--- /dev/null
+++ b/lisp/gnus/gssapi.el
@@ -0,0 +1,105 @@
+;;; gssapi.el --- GSSAPI/Kerberos 5 interface for Emacs
+
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+
+;; Author: Simon Josefsson <simon@josefsson.org>
+;; Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Keywords: network
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'format-spec)
+
+(defcustom gssapi-program (list
+ (concat "gsasl %s %p "
+ "--mechanism GSSAPI "
+ "--authentication-id %l")
+ "imtest -m gssapi -u %l -p %p %s")
+ "List of strings containing commands for GSSAPI (krb5) authentication.
+%s is replaced with server hostname, %p with port to connect to, and
+%l with the value of `imap-default-user'. The program should accept
+IMAP commands on stdin and return responses to stdout. Each entry in
+the list is tried until a successful connection is made."
+ :group 'network
+ :type '(repeat string))
+
+(defun open-gssapi-stream (name buffer server port)
+ (let ((cmds gssapi-program)
+ cmd done)
+ (with-current-buffer buffer
+ (while (and (not done)
+ (setq cmd (pop cmds)))
+ (message "Opening GSSAPI connection with `%s'..." cmd)
+ (erase-buffer)
+ (let* ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary)
+ (process (start-process
+ name buffer shell-file-name shell-command-switch
+ (format-spec
+ cmd
+ (format-spec-make
+ ?s server
+ ?p (number-to-string port)
+ ?l imap-default-user))))
+ response)
+ (when process
+ (while (and (memq (process-status process) '(open run))
+ (goto-char (point-min))
+ ;; Athena IMTEST can output SSL verify errors
+ (or (while (looking-at "^verify error:num=")
+ (forward-line))
+ t)
+ (or (while (looking-at "^TLS connection established")
+ (forward-line))
+ t)
+ ;; cyrus 1.6.x (13? < x <= 22) queries capabilities
+ (or (while (looking-at "^C:")
+ (forward-line))
+ t)
+ ;; cyrus 1.6 imtest print "S: " before server greeting
+ (or (not (looking-at "S: "))
+ (forward-char 3)
+ t)
+ ;; GNU SASL may print 'Trying ...' first.
+ (or (not (looking-at "Trying "))
+ (forward-line)
+ t)
+ (not (and (looking-at "\\* \\(OK\\|PREAUTH\\|BYE\\) ")
+ ;; success in imtest 1.6:
+ (re-search-forward
+ (concat "^\\(\\(Authenticat.*\\)\\|\\("
+ "Client authentication "
+ "finished.*\\)\\)")
+ nil t)
+ (setq response (match-string 1)))))
+ (accept-process-output process 1)
+ (sit-for 1))
+ (erase-buffer)
+ (message "GSSAPI IMAP connection: %s" (or response "failed"))
+ (if (and response (let ((case-fold-search nil))
+ (not (string-match "failed" response))))
+ (setq done process)
+ (delete-process process)
+ nil))))
+ done)))
+
+(provide 'gssapi)
+
+;;; gssapi.el ends here
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 08c59b00bf..bb9215aca7 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -49,6 +49,7 @@
(require 'mail-parse)
(require 'mml)
(require 'rfc822)
+(require 'format-spec)
(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
@@ -438,7 +439,10 @@ whitespace)."
:group 'message-various)
(defcustom message-elide-ellipsis "\n[...]\n\n"
- "*The string which is inserted for elided text."
+ "*The string which is inserted for elided text.
+This is a format-spec string, and you can use %l to say how many
+lines were removed, and %c to say how many characters were
+removed."
:type 'string
:link '(custom-manual "(message)Various Commands")
:group 'message-various)
@@ -3535,8 +3539,12 @@ Note that this should not be used in newsgroups."
An ellipsis (from `message-elide-ellipsis') will be inserted where the
text was killed."
(interactive "r")
- (kill-region b e)
- (insert message-elide-ellipsis))
+ (let ((lines (count-lines b e))
+ (chars (- e b)))
+ (kill-region b e)
+ (insert (format-spec message-elide-ellipsis
+ `((?l . ,lines)
+ (?c . ,chars))))))
(defvar message-caesar-translation-table nil)
@@ -3749,12 +3757,12 @@ prefix, and don't delete any headers."
(insert-before-markers ?\n)
(goto-char pt))))
(case message-cite-reply-position
- ('above
+ (above
(message-goto-body)
(insert body-text)
(insert (if (bolp) "\n" "\n\n"))
(message-goto-body))
- ('below
+ (below
(message-goto-signature)))
;; Add a `message-setup-very-last-hook' here?
;; Add `gnus-article-highlight-citation' here?
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 14b4419830..4f7b5ed26b 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -158,6 +158,12 @@ This can be either \"inline\" or \"attachment\".")
mm-uu-diff-extract
nil
mm-uu-diff-test)
+ (diff
+ "^=== modified file "
+ nil
+ mm-uu-diff-extract
+ nil
+ mm-uu-diff-test)
(git-format-patch
"^diff --git "
"^-- "
@@ -699,6 +705,8 @@ Assume text has been decoded if DECODED is non-nil."
;; Mutt still uses application/pgp even though
;; it has already been withdrawn.
(string-match "\\`text/\\|\\`application/pgp\\'" type)
+ (equal (car (mm-handle-disposition handle))
+ "inline")
(setq
children
(with-current-buffer buffer
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index aa4ecbc3b0..bcbe7b678d 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -279,16 +279,21 @@ textual parts.")
(current-buffer)))
(defun nnimap-credentials (address ports)
- (let ((found (nth 0 (auth-source-search :max 1
- :host address
- :port ports
- :create t))))
+ (let* ((auth-source-creation-prompts
+ '((user . "IMAP user at %h: ")
+ (secret . "IMAP password for %u@%h: ")))
+ (found (nth 0 (auth-source-search :max 1
+ :host address
+ :port ports
+ :require '(:user :secret)
+ :create t))))
(if found
(list (plist-get found :user)
(let ((secret (plist-get found :secret)))
(if (functionp secret)
(funcall secret)
- secret)))
+ secret))
+ (plist-get found :save-function))
nil)))
(defun nnimap-keepalive ()
@@ -335,6 +340,7 @@ textual parts.")
(ports
(cond
((or (eq nnimap-stream 'network)
+ (eq nnimap-stream 'network-only)
(eq nnimap-stream 'starttls))
(nnheader-message 7 "Opening connection to %s..."
nnimap-address)
@@ -396,7 +402,12 @@ textual parts.")
(let ((nnimap-inhibit-logging t))
(setq login-result
(nnimap-login (car credentials) (cadr credentials))))
- (unless (car login-result)
+ (if (car login-result)
+ ;; save the credentials if a save function exists
+ ;; (such a function will only be passed if a new
+ ;; token was created)
+ (when (functionp (nth 2 credentials))
+ (funcall (nth 2 credentials)))
;; If the login failed, then forget the credentials
;; that are now possibly cached.
(dolist (host (list (nnoo-current-server 'nnimap)
@@ -1442,6 +1453,11 @@ textual parts.")
;; Change \Delete etc to %Delete, so that the reader can read it.
(subst-char-in-region (point-min) (point-max)
?\\ ?% t)
+ ;; Remove any MODSEQ entries in the buffer, because they may contain
+ ;; numbers that are too large for 32-bit Emacsen.
+ (while (re-search-forward " MODSEQ ([0-9]+)" nil t)
+ (replace-match "" t t))
+ (goto-char (point-min))
(let (start end articles groups uidnext elems permanent-flags
uidvalidity vanished highestmodseq)
(dolist (elem sequences)
@@ -1481,9 +1497,9 @@ textual parts.")
(match-string 1)))
(goto-char start)
(setq highestmodseq
- (and (search-forward "HIGHESTMODSEQ "
+ (and (re-search-forward "HIGHESTMODSEQ \\([0-9]+\\)"
(or end (point-min)) t)
- (read (current-buffer))))
+ (match-string 1)))
(goto-char end)
(forward-line -1))
;; The UID FETCH FLAGS was successful.
@@ -1497,18 +1513,7 @@ textual parts.")
(goto-char end))
(while (re-search-forward "^\\* [0-9]+ FETCH " start t)
(let ((p (point)))
- ;; FIXME: For FETCH lines like "* 2971 FETCH (FLAGS (%Recent) UID
- ;; 12509 MODSEQ (13419098521433281274))" we get an
- ;; overflow-error. The handler simply deletes that large number
- ;; and reads again. But maybe there's a better fix...
- (setq elems (condition-case nil (read (current-buffer))
- (overflow-error
- ;; After an overflow-error, point is just after
- ;; the too large number. So delete it and try
- ;; again.
- (delete-region (point) (progn (backward-word) (point)))
- (goto-char p)
- (read (current-buffer)))))
+ (setq elems (read (current-buffer)))
(push (cons (cadr (memq 'UID elems))
(cadr (memq 'FLAGS elems)))
articles)))
@@ -1545,10 +1550,11 @@ textual parts.")
refid refid value)))))
(result (with-current-buffer (nnimap-buffer)
(nnimap-command "UID SEARCH %s" cmd))))
- (gnus-fetch-headers
- (and (car result) (delete 0 (mapcar #'string-to-number
- (cdr (assoc "SEARCH" (cdr result))))))
- nil t)))
+ (when result
+ (gnus-fetch-headers
+ (and (car result) (delete 0 (mapcar #'string-to-number
+ (cdr (assoc "SEARCH" (cdr result))))))
+ nil t))))
(defun nnimap-possibly-change-group (group server)
(let ((open-result t))
@@ -1663,6 +1669,8 @@ textual parts.")
(goto-char (point-max)))
openp)
(quit
+ (when debug-on-quit
+ (debug "Quit"))
;; The user hit C-g while we were waiting: kill the process, in case
;; it's a gnutls-cli process that's stuck (tends to happen a lot behind
;; NAT routers).
@@ -1754,11 +1762,15 @@ textual parts.")
(format "(UID %s%s)"
(format
(if (nnimap-ver4-p)
- "BODY.PEEK[HEADER] BODY.PEEK"
+ "BODY.PEEK"
"RFC822.PEEK"))
- (if nnimap-split-download-body-default
- "[]"
- "[1]")))
+ (cond
+ (nnimap-split-download-body-default
+ "[]")
+ ((nnimap-ver4-p)
+ "[HEADER]")
+ (t
+ "[1]"))))
t))
(defun nnimap-split-incoming-mail ()
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index bb9695ebb7..113137a004 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -53,17 +53,17 @@ fit these criteria."
:group 'shr
:type 'regexp)
-(defcustom shr-table-horizontal-line ?-
+(defcustom shr-table-horizontal-line ?
"Character used to draw horizontal table lines."
:group 'shr
:type 'character)
-(defcustom shr-table-vertical-line ?|
+(defcustom shr-table-vertical-line ?
"Character used to draw vertical table lines."
:group 'shr
:type 'character)
-(defcustom shr-table-corner ?+
+(defcustom shr-table-corner ?
"Character used to draw table corners."
:group 'shr
:type 'character)
@@ -113,6 +113,15 @@ cid: URL as the argument.")
;; Public functions and commands.
+(defun shr-visit-file (file)
+ (interactive "fHTML file name: ")
+ (pop-to-buffer "*html*")
+ (erase-buffer)
+ (shr-insert-document
+ (with-temp-buffer
+ (insert-file-contents file)
+ (libxml-parse-html-region (point-min) (point-max)))))
+
;;;###autoload
(defun shr-insert-document (dom)
(setq shr-content-cache nil)
diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el
index c9a0df2059..5c2e775a21 100644
--- a/lisp/gnus/sieve-manage.el
+++ b/lisp/gnus/sieve-manage.el
@@ -275,9 +275,10 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
(with-current-buffer buffer
(let* ((auth-info (auth-source-search :host sieve-manage-server
:port "sieve"
- :max 1))
- (user-name (plist-get (nth 0 auth-info) :user))
- (user-password (plist-get (nth 0 auth-info) :secret))
+ :max 1
+ :create t))
+ (user-name (or (plist-get (nth 0 auth-info) :user) ""))
+ (user-password (or (plist-get (nth 0 auth-info) :secret) ""))
(user-password (if (functionp user-password)
(funcall user-password)
user-password))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 8209cdebd3..392e894965 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -575,6 +575,7 @@ If ANY-SYMBOL is non-nil, don't insist the symbol be bound."
(with-syntax-table emacs-lisp-mode-syntax-table
(or (condition-case ()
(save-excursion
+ (skip-chars-forward "'")
(or (not (zerop (skip-syntax-backward "_w")))
(eq (char-syntax (following-char)) ?w)
(eq (char-syntax (following-char)) ?_)
diff --git a/lisp/help.el b/lisp/help.el
index 9fcb06c559..e148e5ef6a 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -871,7 +871,17 @@ whose documentation describes the minor mode."
(let ((start (point)))
(insert (format-mode-line mode nil nil buffer))
(add-text-properties start (point) '(face bold)))))
- (princ " mode:\n")
+ (princ " mode")
+ (let* ((mode major-mode)
+ (file-name (find-lisp-object-file-name mode nil)))
+ (when file-name
+ (princ (concat " defined in `" (file-name-nondirectory file-name) "'"))
+ ;; Make a hyperlink to the library.
+ (with-current-buffer standard-output
+ (save-excursion
+ (re-search-backward "`\\([^`']+\\)'" nil t)
+ (help-xref-button 1 'help-function-def mode file-name)))))
+ (princ ":\n")
(princ (documentation major-mode)))))
;; For the sake of IELM and maybe others
nil)
diff --git a/lisp/ido.el b/lisp/ido.el
index 2e67e367a8..2a5c7cf2f0 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1983,7 +1983,7 @@ If INITIAL is non-nil, it specifies the initial input string."
(setq ido-exit nil)
(setq ido-final-text
(catch 'ido
- (completing-read
+ (completing-read-default
(ido-make-prompt item prompt)
'(("dummy" . 1)) nil nil ; table predicate require-match
(prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents
@@ -4740,13 +4740,13 @@ See `read-directory-name' for additional parameters."
(concat ido-current-directory filename)))))
;;;###autoload
-(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def)
+(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def inherit-input-method)
"Ido replacement for the built-in `completing-read'.
Read a string in the minibuffer with ido-style completion.
PROMPT is a string to prompt with; normally it ends in a colon and a space.
CHOICES is a list of strings which are the possible completions.
-PREDICATE is currently ignored; it is included to be compatible
- with `completing-read'.
+PREDICATE and INHERIT-INPUT-METHOD is currently ignored; it is included
+ to be compatible with `completing-read'.
If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless
the input is (or completes to) an element of CHOICES or is null.
If the input is null, `ido-completing-read' returns DEF, or an empty
diff --git a/lisp/info.el b/lisp/info.el
index bc2062e72b..fb75365973 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -594,15 +594,15 @@ in `Info-file-supports-index-cookies-list'."
(defun info-initialize ()
"Initialize `Info-directory-list', if that hasn't been done yet."
(unless Info-directory-list
- (let ((path (getenv "INFOPATH")))
+ (let ((path (getenv "INFOPATH"))
+ (sep (regexp-quote path-separator)))
(setq Info-directory-list
(prune-directory-list
(if path
- (if (string-match ":\\'" path)
- (append (split-string (substring path 0 -1)
- (regexp-quote path-separator))
+ (if (string-match-p (concat sep "\\'") path)
+ (append (split-string (substring path 0 -1) sep)
(Info-default-dirs))
- (split-string path (regexp-quote path-separator)))
+ (split-string path sep))
(Info-default-dirs)))))))
;;;###autoload
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 9a892f493d..200aadda65 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -2306,11 +2306,11 @@ change; nil means current message."
;;;; *** Rmail Message Selection And Support ***
(defun rmail-msgend (n)
- "Return the start position for message number N."
+ "Return the end position for message number N."
(marker-position (aref rmail-message-vector (1+ n))))
(defun rmail-msgbeg (n)
- "Return the end position for message number N."
+ "Return the start position for message number N."
(marker-position (aref rmail-message-vector n)))
(defun rmail-apply-in-message (msgnum function &rest args)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 531a0e26ea..4a2deb6b3b 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -698,7 +698,15 @@ scroll the window of possible completions."
(when last
(setcdr last nil)
;; Prefer shorter completions.
- (setq all (sort all (lambda (c1 c2) (< (length c1) (length c2)))))
+ (setq all (sort all (lambda (c1 c2)
+ (let ((s1 (get-text-property
+ 0 :completion-cycle-penalty c1))
+ (s2 (get-text-property
+ 0 :completion-cycle-penalty c2)))
+ (if (eq s1 s2)
+ (< (length c1) (length c2))
+ (< (or s1 (length c1))
+ (or s2 (length c2))))))))
;; Prefer recently used completions.
(let ((hist (symbol-value minibuffer-history-variable)))
(setq all (sort all (lambda (c1 c2)
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index 3ccad277ff..2caf8dec30 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -36,6 +36,8 @@
(require 'custom)
(eval-when-compile (require 'cl))
+(autoload 'auth-source-search "auth-source")
+
(defgroup ldap nil
"Lightweight Directory Access Protocol."
:version "21.1"
@@ -480,6 +482,22 @@ Additional search parameters can be specified through
"Perform a search on a LDAP server.
SEARCH-PLIST is a property list describing the search request.
Valid keys in that list are:
+
+ `auth-source', if non-nil, will use `auth-source-search' and
+will grab the :host, :secret, :base, and (:user or :binddn)
+tokens into the `host', `passwd', `base', and `binddn' parameters
+respectively if they are not provided in SEARCH-PLIST. So for
+instance *each* of these netrc lines has the same effect if you
+ask for the host \"ldapserver:2400\":
+
+ machine ldapserver:2400 login myDN secret myPassword base myBase
+ machine ldapserver:2400 binddn myDN secret myPassword port ldap
+ login myDN secret myPassword base myBase
+
+but if you have more than one in your netrc file, only the first
+matching one will be used. Note the \"port ldap\" part is NOT
+required.
+
`host' is a string naming one or more (blank-separated) LDAP servers to
to try to connect to. Each host name may optionally be of the form HOST:PORT.
`filter' is a filter string for the search as described in RFC 1558.
@@ -500,19 +518,34 @@ not their associated values.
its distinguished name DN.
The function returns a list of matching entries. Each entry is itself
an alist of attribute/value pairs."
- (let ((buf (get-buffer-create " *ldap-search*"))
+ (let* ((buf (get-buffer-create " *ldap-search*"))
(bufval (get-buffer-create " *ldap-value*"))
(host (or (plist-get search-plist 'host)
ldap-default-host))
+ ;; find entries with port "ldap" that match the requested host if any
+ (asfound (when (plist-get search-plist 'auth-source)
+ (nth 0 (auth-source-search :host (or host t)
+ :create t))))
+ ;; if no host was requested, get it from the auth-source entry
+ (host (or host (plist-get asfound :host)))
+ ;; get the password from the auth-source
+ (passwd (or (plist-get search-plist 'passwd)
+ (plist-get asfound :secret)))
+ ;; convert the password from a function call if needed
+ (passwd (if (functionp passwd) (funcall passwd) passwd))
+ ;; get the binddn from the search-list or from the
+ ;; auth-source user or binddn tokens
+ (binddn (or (plist-get search-plist 'binddn)
+ (plist-get asfound :user)
+ (plist-get asfound :binddn)))
+ (base (or (plist-get search-plist 'base)
+ (plist-get asfound :base)
+ ldap-default-base))
(filter (plist-get search-plist 'filter))
(attributes (plist-get search-plist 'attributes))
(attrsonly (plist-get search-plist 'attrsonly))
- (base (or (plist-get search-plist 'base)
- ldap-default-base))
(scope (plist-get search-plist 'scope))
- (binddn (plist-get search-plist 'binddn))
(auth (plist-get search-plist 'auth))
- (passwd (plist-get search-plist 'passwd))
(deref (plist-get search-plist 'deref))
(timelimit (plist-get search-plist 'timelimit))
(sizelimit (plist-get search-plist 'sizelimit))
diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el
index 4045a44364..c3da170716 100644
--- a/lisp/net/quickurl.el
+++ b/lisp/net/quickurl.el
@@ -511,15 +511,15 @@ TYPE dictates what will be inserted, options are:
(with-current-buffer quickurl-list-last-buffer
(insert
(case type
- ('url (funcall quickurl-format-function url))
- ('naked-url (quickurl-url-url url))
- ('with-lookup (format "%s <URL:%s>"
+ (url (funcall quickurl-format-function url))
+ (naked-url (quickurl-url-url url))
+ (with-lookup (format "%s <URL:%s>"
(quickurl-url-keyword url)
(quickurl-url-url url)))
- ('with-desc (format "%S <URL:%s>"
+ (with-desc (format "%S <URL:%s>"
(quickurl-url-description url)
(quickurl-url-url url)))
- ('lookup (quickurl-url-keyword url)))))
+ (lookup (quickurl-url-keyword url)))))
(error "No URL details on that line"))
url))
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 1e3ee91092..71aa0dd22b 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -548,7 +548,7 @@ If ARG is non-nil, instead prompt for connection parameters."
(add-hook 'auto-save-hook 'rcirc-log-write)
;; identify
- (when password
+ (unless (zerop (length password))
(rcirc-send-string process (concat "PASS " password)))
(rcirc-send-string process (concat "NICK " nick))
(rcirc-send-string process (concat "USER " user-name
@@ -2449,8 +2449,7 @@ keywords when no KEYWORD is given."
(if rcirc-auto-authenticate-flag
(if rcirc-authenticate-before-join
(progn
- (with-rcirc-process-buffer process
- (add-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t t))
+ (add-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t t)
(rcirc-authenticate))
(rcirc-authenticate)
(rcirc-join-channels process rcirc-startup-channels))
@@ -2515,7 +2514,7 @@ the only argument."
(and ;; quakenet
(string= sender "Q")
(string= target rcirc-nick)
- (string-match message "\\`You are now logged in as .+\\.\\'")))
+ (string-match "\\`You are now logged in as .+\\.\\'" message)))
(setq rcirc-user-authenticated t)
(run-hook-with-args 'rcirc-authenticated-hook process)
(remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t))))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 63a4c19ecc..ec5c46b289 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -90,7 +90,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("%h") ("-l" "%u")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "rcp")
- (tramp-copy-args (("%k" "-p") ("-r")))
+ (tramp-copy-args (("-p" "%k") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)))
;;;###tramp-autoload
@@ -100,7 +100,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("%h") ("-l" "%u")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "rcp")
- (tramp-copy-args (("%k" "-p")))
+ (tramp-copy-args (("-p" "%k")))
(tramp-copy-keep-date t)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
@@ -110,7 +110,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r")))
+ (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -126,7 +126,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
- (tramp-copy-args (("-1") ("-P" "%p") ("%k" "-p") ("-q") ("-r")))
+ (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -142,7 +142,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
- (tramp-copy-args (("-2") ("-P" "%p") ("%k" "-p") ("-q") ("-r")))
+ (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -160,7 +160,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r")
+ (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
("-o" "ControlPath=%t.%%r@%%h:%%p")
("-o" "ControlMaster=auto")))
(tramp-copy-keep-date t)
@@ -179,7 +179,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r")))
+ (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -202,7 +202,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "rsync")
- (tramp-copy-args (("-e" "ssh") ("%k" "-t") ("-r")))
+ (tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-keep-tmpfile t)
(tramp-copy-recursive t)))
@@ -217,7 +217,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "rsync")
- (tramp-copy-args (("%k" "-t") ("-r")))
+ (tramp-copy-args (("-t" "%k") ("-r")))
(tramp-copy-env (("RSYNC_RSH")
(,(concat
"ssh"
@@ -353,7 +353,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "pscp")
- (tramp-copy-args (("-P" "%p") ("-scp") ("%k" "-p")
+ (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k")
("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
@@ -366,7 +366,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
(tramp-remote-sh "/bin/sh")
(tramp-copy-program "pscp")
- (tramp-copy-args (("-P" "%p") ("-sftp") ("%k" "-p")
+ (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k")
("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
@@ -378,7 +378,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("%h") ("-l" "%u") ("sh" "-i")))
(tramp-remote-sh "/bin/sh -i")
(tramp-copy-program "fcp")
- (tramp-copy-args (("%k" "-p")))
+ (tramp-copy-args (("-p" "%k")))
(tramp-copy-keep-date t)))
;;;###tramp-autoload
@@ -2251,11 +2251,15 @@ The method used must be an out-of-band method."
'identity)
(if t2 (tramp-make-copy-program-file-name v) newname)))
- ;; Check for port number. Until now, there's no need for handling
- ;; like method, user, host.
- (setq host (tramp-file-name-real-host v)
- port (tramp-file-name-port v)
- port (or (and port (number-to-string port)) ""))
+ ;; Check for host and port number. We cannot use
+ ;; `tramp-file-name-port', because this returns also
+ ;; `tramp-default-port', which might clash with settings in
+ ;; "~/.ssh/config".
+ (setq host (tramp-file-name-host v)
+ port "")
+ (when (string-match tramp-host-with-port-regexp host)
+ (setq host (string-to-number (match-string 1 host))
+ port (string-to-number (match-string 2 host))))
;; Compose copy command.
(setq spec (format-spec-make
@@ -2270,7 +2274,7 @@ The method used must be an out-of-band method."
copy-args
(delete
;; " " has either been a replacement of "%k" (when
- ;; keep-date argument is non-nil), or a replacemtent
+ ;; keep-date argument is non-nil), or a replacement
;; for the whole keep-date sublist.
" "
(dolist
@@ -2281,7 +2285,7 @@ The method used must be an out-of-band method."
(append
copy-args
(let ((y (mapcar (lambda (z) (format-spec z spec)) x)))
- (if (zerop (length (car y))) '(" ") y))))))
+ (if (member "" y) '(" ") y))))))
copy-env
(delq
nil
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 1f3064c706..462b8f1139 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
;; should be changed only there.
;;;###tramp-autoload
-(defconst tramp-version "2.2.1-pre"
+(defconst tramp-version "2.2.1"
"This version of Tramp.")
;;;###tramp-autoload
@@ -44,7 +44,7 @@
(= emacs-major-version 21)
(>= emacs-minor-version 4)))
"ok"
- (format "Tramp 2.2.1-pre is not fit for %s"
+ (format "Tramp 2.2.1 is not fit for %s"
(when (string-match "^.*$" (emacs-version))
(match-string 0 (emacs-version)))))))
(unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/lisp/net/xesam.el b/lisp/net/xesam.el
index 21a2274940..64c26cfb2c 100644
--- a/lisp/net/xesam.el
+++ b/lisp/net/xesam.el
@@ -414,18 +414,18 @@ If there is no registered search engine at all, the function returns `nil'."
;; Hopefully, this will change later.
(setq hit-fields
(case (intern vendor-id)
- ('Beagle
+ (Beagle
'("xesam:mimeType" "xesam:url"))
- ('Strigi
+ (Strigi
'("xesam:author" "xesam:cc" "xesam:charset"
"xesam:contentType" "xesam:fileExtension"
"xesam:id" "xesam:lineCount" "xesam:links"
"xesam:mimeType" "xesam:name" "xesam:size"
"xesam:sourceModified" "xesam:subject" "xesam:to"
"xesam:url"))
- ('TrackerXesamSession
+ (TrackerXesamSession
'("xesam:relevancyRating" "xesam:url"))
- ('Debbugs
+ (Debbugs
'("xesam:keyword" "xesam:owner" "xesam:title"
"xesam:url" "xesam:sourceModified" "xesam:mimeType"
"debbugs:key"))
diff --git a/lisp/notifications.el b/lisp/notifications.el
index 893b9ed095..adb9fdd641 100644
--- a/lisp/notifications.el
+++ b/lisp/notifications.el
@@ -210,8 +210,8 @@ used to manipulate the notification item with
(add-to-list 'hints `(:dict-entry
"urgency"
(:variant :byte ,(case urgency
- ('low 0)
- ('critical 2)
+ (low 0)
+ (critical 2)
(t 1)))) t))
(when category
(add-to-list 'hints `(:dict-entry
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index e75821b686..44a2cb15b7 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,13 @@
+2011-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * org-src.el (org-src-switch-to-buffer):
+ * org-plot.el (org-plot/gnuplot-script, org-plot/gnuplot):
+ * org-mouse.el (org-mouse-agenda-type):
+ * org-freemind.el (org-freemind-node-to-org):
+ * ob-sql.el (org-babel-execute:sql):
+ * ob-exp.el (org-babel-exp-do-export, org-babel-exp-code):
+ * ob-ref.el (org-babel-ref-resolve): Fix use of case.
+
2011-03-06 Juanma Barranquero <lekktu@gmail.com>
* org.el (org-blank-before-new-entry, org-context-in-file-links)
diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el
index 1be45198e0..3215bcf4d8 100644
--- a/lisp/org/ob-exp.el
+++ b/lisp/org/ob-exp.el
@@ -231,10 +231,10 @@ The function respects the value of the :exports header argument."
(org-babel-exp-results info type 'silent))))
(clean () (org-babel-remove-result info)))
(case (intern (or (cdr (assoc :exports (nth 2 info))) "code"))
- ('none (silently) (clean) "")
- ('code (silently) (clean) (org-babel-exp-code info type))
- ('results (org-babel-exp-results info type))
- ('both (concat (org-babel-exp-code info type)
+ (none (silently) (clean) "")
+ (code (silently) (clean) (org-babel-exp-code info type))
+ (results (org-babel-exp-results info type))
+ (both (concat (org-babel-exp-code info type)
"\n\n"
(org-babel-exp-results info type))))))
@@ -250,8 +250,8 @@ The code block is not evaluated."
(name (nth 4 info))
(args (mapcar #'cdr (org-babel-get-header (nth 2 info) :var))))
(case type
- ('inline (format "=%s=" body))
- ('block
+ (inline (format "=%s=" body))
+ (block
(let ((str
(format "#+BEGIN_SRC %s %s\n%s%s#+END_SRC\n" lang switches body
(if (and body (string-match "\n$" body))
@@ -265,7 +265,7 @@ The code block is not evaluated."
(mapconcat #'identity args ", ")))
str))
str))
- ('lob
+ (lob
(let ((call-line (and (string-match "results=" (car args))
(substring (car args) (match-end 0)))))
(cond
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index 7b06e90f92..96819df8ea 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -147,12 +147,12 @@ the variable."
(let ((params (append args '((:results . "silent")))))
(setq result
(case type
- ('results-line (org-babel-read-result))
- ('table (org-babel-read-table))
- ('list (org-babel-read-list))
- ('file (org-babel-read-link))
- ('source-block (org-babel-execute-src-block nil nil params))
- ('lob (org-babel-execute-src-block nil lob-info params)))))
+ (results-line (org-babel-read-result))
+ (table (org-babel-read-table))
+ (list (org-babel-read-list))
+ (file (org-babel-read-link))
+ (source-block (org-babel-execute-src-block nil nil params))
+ (lob (org-babel-execute-src-block nil lob-info params)))))
(if (symbolp result)
(format "%S" result)
(if (and index (listp result))
diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el
index 3bd10d6b2b..49859d24a1 100644
--- a/lisp/org/ob-sql.el
+++ b/lisp/org/ob-sql.el
@@ -66,18 +66,18 @@ This function is called by `org-babel-execute-src-block'."
(out-file (or (cdr (assoc :out-file params))
(org-babel-temp-file "sql-out-")))
(command (case (intern engine)
- ('msosql (format "osql %s -s \"\t\" -i %s -o %s"
- (or cmdline "")
- (org-babel-process-file-name in-file)
- (org-babel-process-file-name out-file)))
- ('mysql (format "mysql %s -e \"source %s\" > %s"
+ (msosql (format "osql %s -s \"\t\" -i %s -o %s"
(or cmdline "")
- (org-babel-process-file-name in-file)
- (org-babel-process-file-name out-file)))
- ('postgresql (format "psql -A -P footer=off -F \"\t\" -f %s -o %s %s"
- (org-babel-process-file-name in-file)
- (org-babel-process-file-name out-file)
- (or cmdline "")))
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)))
+ (mysql (format "mysql %s -e \"source %s\" > %s"
+ (or cmdline "")
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)))
+ (postgresql (format "psql -A -P footer=off -F \"\t\" -f %s -o %s %s"
+ (org-babel-process-file-name in-file)
+ (org-babel-process-file-name out-file)
+ (or cmdline "")))
(t (error "no support for the %s sql engine" engine)))))
(with-temp-file in-file
(insert (org-babel-expand-body:sql body params)))
diff --git a/lisp/org/org-freemind.el b/lisp/org/org-freemind.el
index c85b4bac36..dccdf44929 100644
--- a/lisp/org/org-freemind.el
+++ b/lisp/org/org-freemind.el
@@ -1172,8 +1172,8 @@ PATH should be a list of steps, where each step has the form
(when (< 0 (- level skip-levels))
(dolist (attrib attributes)
(case (car attrib)
- ('TEXT (setq text (cdr attrib)))
- ('text (setq text (cdr attrib)))))
+ (TEXT (setq text (cdr attrib)))
+ (text (setq text (cdr attrib)))))
(unless text
;; There should be a richcontent node holding the text:
(setq text (org-freemind-get-richcontent-node-text node)))
@@ -1193,7 +1193,7 @@ PATH should be a list of steps, where each step has the form
(setq text (replace-regexp-in-string "\n $" "" text))
(insert text))
(case qname
- ('node
+ (node
(insert (make-string (- level skip-levels) ?*) " " text "\n")
(when note
(insert ":COMMENT:\n" note "\n:END:\n"))
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index d30f172f42..cec19d89de 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -476,11 +476,11 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
(defun org-mouse-agenda-type (type)
(case type
- ('tags "Tags: ")
- ('todo "TODO: ")
- ('tags-tree "Tags tree: ")
- ('todo-tree "TODO tree: ")
- ('occur-tree "Occur tree: ")
+ (tags "Tags: ")
+ (todo "TODO: ")
+ (tags-tree "Tags tree: ")
+ (todo-tree "TODO tree: ")
+ (occur-tree "Occur tree: ")
(t "Agenda command ???")))
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index c5f4bff24f..10722403f7 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -206,18 +206,18 @@ manner suitable for prepending to a user-specified script."
(y-labels (plist-get params :ylabels))
(plot-str "'%s' using %s%d%s with %s title '%s'")
(plot-cmd (case type
- ('2d "plot")
- ('3d "splot")
- ('grid "splot")))
+ (2d "plot")
+ (3d "splot")
+ (grid "splot")))
(script "reset") plot-lines)
(flet ((add-to-script (line) (setf script (format "%s\n%s" script line))))
(when file ;; output file
(add-to-script (format "set term %s" (file-name-extension file)))
(add-to-script (format "set output '%s'" file)))
(case type ;; type
- ('2d ())
- ('3d (if map (add-to-script "set map")))
- ('grid (if map
+ (2d ())
+ (3d (if map (add-to-script "set map")))
+ (grid (if map
(add-to-script "set pm3d map")
(add-to-script "set pm3d"))))
(when title (add-to-script (format "set title '%s'" title))) ;; title
@@ -243,7 +243,7 @@ manner suitable for prepending to a user-specified script."
"%Y-%m-%d-%H:%M:%S") "\"")))
(unless preface
(case type ;; plot command
- ('2d (dotimes (col num-cols)
+ (2d (dotimes (col num-cols)
(unless (and (equal type '2d)
(or (and ind (equal (+ 1 col) ind))
(and deps (not (member (+ 1 col) deps)))))
@@ -258,10 +258,10 @@ manner suitable for prepending to a user-specified script."
with
(or (nth col col-labels) (format "%d" (+ 1 col))))
plot-lines)))))
- ('3d
+ (3d
(setq plot-lines (list (format "'%s' matrix with %s title ''"
data-file with))))
- ('grid
+ (grid
(setq plot-lines (list (format "'%s' with %s title ''"
data-file with)))))
(add-to-script
@@ -305,9 +305,9 @@ line directly before or after the table."
(setf params (org-plot/collect-options params))))
;; dump table to datafile (very different for grid)
(case (plist-get params :plot-type)
- ('2d (org-plot/gnuplot-to-data table data-file params))
- ('3d (org-plot/gnuplot-to-data table data-file params))
- ('grid (let ((y-labels (org-plot/gnuplot-to-grid-data
+ (2d (org-plot/gnuplot-to-data table data-file params))
+ (3d (org-plot/gnuplot-to-data table data-file params))
+ (grid (let ((y-labels (org-plot/gnuplot-to-grid-data
table data-file params)))
(when y-labels (plist-put params :ylabels y-labels)))))
;; check for timestamp ind column
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index 98fdb75423..bd1c380204 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -335,26 +335,26 @@ buffer."
(defun org-src-switch-to-buffer (buffer context)
(case org-src-window-setup
- ('current-window
+ (current-window
(switch-to-buffer buffer))
- ('other-window
+ (other-window
(switch-to-buffer-other-window buffer))
- ('other-frame
+ (other-frame
(case context
- ('exit
+ (exit
(let ((frame (selected-frame)))
(switch-to-buffer-other-frame buffer)
(delete-frame frame)))
- ('save
+ (save
(kill-buffer (current-buffer))
(switch-to-buffer buffer))
(t
(switch-to-buffer-other-frame buffer))))
- ('reorganize-frame
+ (reorganize-frame
(if (eq context 'edit) (delete-other-windows))
(org-switch-to-buffer-other-window buffer)
(if (eq context 'exit) (delete-other-windows)))
- ('switch-invisibly
+ (switch-invisibly
(set-buffer buffer))
(t
(message "Invalid value %s for org-src-window-setup"
diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el
index 8fea2cef6a..0dc556007b 100644
--- a/lisp/play/bubbles.el
+++ b/lisp/play/bubbles.el
@@ -719,57 +719,57 @@ static char * dot3d_xpm[] = {
(defsubst bubbles--grid-width ()
"Return the grid width for the current game theme."
(car (case bubbles-game-theme
- ('easy
+ (easy
bubbles--grid-small)
- ('medium
+ (medium
bubbles--grid-medium)
- ('difficult
+ (difficult
bubbles--grid-large)
- ('hard
+ (hard
bubbles--grid-huge)
- ('user-defined
+ (user-defined
bubbles-grid-size))))
(defsubst bubbles--grid-height ()
"Return the grid height for the current game theme."
(cdr (case bubbles-game-theme
- ('easy
+ (easy
bubbles--grid-small)
- ('medium
+ (medium
bubbles--grid-medium)
- ('difficult
+ (difficult
bubbles--grid-large)
- ('hard
+ (hard
bubbles--grid-huge)
- ('user-defined
+ (user-defined
bubbles-grid-size))))
(defsubst bubbles--colors ()
"Return the color list for the current game theme."
(case bubbles-game-theme
- ('easy
+ (easy
bubbles--colors-2)
- ('medium
+ (medium
bubbles--colors-3)
- ('difficult
+ (difficult
bubbles--colors-4)
- ('hard
+ (hard
bubbles--colors-5)
- ('user-defined
+ (user-defined
bubbles-colors)))
(defsubst bubbles--shift-mode ()
"Return the shift mode for the current game theme."
(case bubbles-game-theme
- ('easy
+ (easy
'default)
- ('medium
+ (medium
'default)
- ('difficult
+ (difficult
'always)
- ('hard
+ (hard
'always)
- ('user-defined
+ (user-defined
bubbles-shift-mode)))
(defun bubbles-save-settings ()
@@ -1346,11 +1346,11 @@ Return t if new char is non-empty."
(when (and (display-images-p)
(not (eq bubbles-graphics-theme 'ascii)))
(let ((template (case bubbles-graphics-theme
- ('circles bubbles--image-template-circle)
- ('balls bubbles--image-template-ball)
- ('squares bubbles--image-template-square)
- ('diamonds bubbles--image-template-diamond)
- ('emacs bubbles--image-template-emacs))))
+ (circles bubbles--image-template-circle)
+ (balls bubbles--image-template-ball)
+ (squares bubbles--image-template-square)
+ (diamonds bubbles--image-template-diamond)
+ (emacs bubbles--image-template-emacs))))
(setq bubbles--empty-image
(create-image (replace-regexp-in-string
"^\"\\(.*\\)\t.*c .*\",$"
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index d3d8350a43..99e3b48743 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -213,19 +213,19 @@ static unsigned char gamegrid_bits[] = {
(let ((data (gamegrid-match-spec-list data-spec-list))
(color (gamegrid-match-spec-list color-spec-list)))
(case data
- ('color-x
+ (color-x
(gamegrid-make-color-x-face color))
- ('grid-x
+ (grid-x
(unless gamegrid-grid-x-face
(setq gamegrid-grid-x-face (gamegrid-make-grid-x-face)))
gamegrid-grid-x-face)
- ('mono-x
+ (mono-x
(unless gamegrid-mono-x-face
(setq gamegrid-mono-x-face (gamegrid-make-mono-x-face)))
gamegrid-mono-x-face)
- ('color-tty
+ (color-tty
(gamegrid-make-color-tty-face color))
- ('mono-tty
+ (mono-tty
(unless gamegrid-mono-tty-face
(setq gamegrid-mono-tty-face (gamegrid-make-mono-tty-face)))
gamegrid-mono-tty-face))))
diff --git a/lisp/play/morse.el b/lisp/play/morse.el
index d4a0224ede..b88f1b264c 100644
--- a/lisp/play/morse.el
+++ b/lisp/play/morse.el
@@ -25,6 +25,9 @@
;; Converts text to Morse code and back with M-x morse-region and
;; M-x unmorse-region (though Morse code is no longer official :-().
+;; Converts text to NATO phonetic alphabet and back with M-x
+;; nato-region and M-x denato-region.
+
;;; Code:
(defvar morse-code '(("a" . ".-")
@@ -91,10 +94,64 @@
("@" . ".--.-."))
"Morse code character set.")
+(defvar nato-alphabet '(("a" . "Alfa")
+ ("b" . "Bravo")
+ ("c" . "Charlie")
+ ("d" . "Delta")
+ ("e" . "Echo")
+ ("f" . "Foxtrot")
+ ("g" . "Golf")
+ ("h" . "Hotel")
+ ("i" . "India")
+ ("j" . "Juliett")
+ ("k" . "Kilo")
+ ("l" . "Lima")
+ ("m" . "Mike")
+ ("n" . "November")
+ ("o" . "Oscar")
+ ("p" . "Papa")
+ ("q" . "Quebec")
+ ("r" . "Romeo")
+ ("s" . "Sierra")
+ ("t" . "Tango")
+ ("u" . "Uniform")
+ ("v" . "Victor")
+ ("w" . "Whiskey")
+ ("x" . "Xray")
+ ("y" . "Yankee")
+ ("z" . "Zulu")
+ ;; Numbers
+ ("0" . "Zero")
+ ("1" . "One")
+ ("2" . "Two")
+ ("3" . "Three")
+ ("4" . "Four")
+ ("5" . "Five")
+ ("6" . "Six")
+ ("7" . "Seven")
+ ("8" . "Eight")
+ ("9" . "Niner")
+ ;; Punctuation is not part of standard
+ ("=" . "Equals")
+ ("?" . "Query")
+ ("/" . "Slash")
+ ("," . "Comma")
+ ("." . "Stop")
+ (":" . "Colon")
+ ("'" . "Apostrophe")
+ ("-" . "Dash")
+ ("(" . "Open")
+ (")" . "Close")
+ ("@" . "At"))
+ "NATO phonetic alphabet.
+See ''International Code of Signals'' (INTERCO), United States
+Edition, 1969 Edition (Revised 2003) available from National
+Geospatial-Intelligence Agency at http://www.nga.mil/")
+
;;;###autoload
(defun morse-region (beg end)
"Convert all text in a given region to morse code."
- (interactive "r")
+ (interactive "*r")
(if (integerp end)
(setq end (copy-marker end)))
(save-excursion
@@ -117,7 +174,7 @@
;;;###autoload
(defun unmorse-region (beg end)
"Convert morse coded text in region to ordinary ASCII text."
- (interactive "r")
+ (interactive "*r")
(if (integerp end)
(setq end (copy-marker end)))
(save-excursion
@@ -136,6 +193,53 @@
(if (looking-at "/")
(delete-char 1))))))))
+;;;###autoload
+(defun nato-region (beg end)
+ "Convert all text in a given region to NATO phonetic alphabet."
+ ;; Copied from morse-region. -- ashawley 2009-02-10
+ (interactive "*r")
+ (if (integerp end)
+ (setq end (copy-marker end)))
+ (save-excursion
+ (let ((sep "")
+ str nato)
+ (goto-char beg)
+ (while (< (point) end)
+ (setq str (downcase (buffer-substring (point) (1+ (point)))))
+ (cond ((looking-at "\\s-+")
+ (goto-char (match-end 0))
+ (setq sep ""))
+ ((setq nato (assoc str nato-alphabet))
+ (delete-char 1)
+ (insert sep (cdr nato))
+ (setq sep "-"))
+ (t
+ (forward-char 1)
+ (setq sep "")))))))
+
+;;;###autoload
+(defun denato-region (beg end)
+ "Convert NATO phonetic alphabet in region to ordinary ASCII text."
+ ;; Copied from unmorse-region. -- ashawley 2009-02-10
+ (interactive "*r")
+ (if (integerp end)
+ (setq end (copy-marker end)))
+ (save-excursion
+ (let (str paren nato)
+ (goto-char beg)
+ (while (< (point) end)
+ (if (null (looking-at "[a-z]+"))
+ (forward-char 1)
+ (setq str (buffer-substring (match-beginning 0) (match-end 0)))
+ (if (null (setq nato (rassoc str nato-alphabet)))
+ (goto-char (match-end 0))
+ (replace-match
+ (if (string-equal "(" (car nato))
+ (if (setq paren (null paren)) "(" ")")
+ (car nato)) t)
+ (if (looking-at "-")
+ (delete-char 1))))))))
+
(provide 'morse)
;;; morse.el ends here
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 5ac30bc28c..0f873e678c 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -2564,19 +2564,12 @@ be more \"DWIM:ey\"."
;; Are we about to move backwards into or out of a
;; preprocessor command? If so, locate its beginning.
(when (eq (cdr res) 'macro-boundary)
- (setq macro-fence
- (save-excursion
- (if macro-fence
- (progn
- (end-of-line)
- (and (not (eobp))
- (progn (c-skip-ws-forward)
- (c-beginning-of-macro))
- (progn (c-end-of-macro)
- (point))))
- (and (not (eobp))
- (c-beginning-of-macro)
- (progn (c-end-of-macro) (point)))))))
+ (save-excursion
+ (beginning-of-line)
+ (setq macro-fence
+ (and (not (bobp))
+ (progn (c-skip-ws-backward) (c-beginning-of-macro))
+ (point)))))
;; Are we about to move backwards into a literal?
(when (memq (cdr res) '(macro-boundary literal))
(setq range (c-ascertain-preceding-literal)))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 88f418f934..40383c6bc3 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -860,27 +860,29 @@ POS and RES.")
(car compilation--previous-directory-cache)))
(prev
(previous-single-property-change
- pos 'compilation-directory nil cache)))
- (cond
- ((null cache)
- (setq compilation--previous-directory-cache
- (cons (copy-marker pos) (copy-marker prev)))
- prev)
- ((eq prev cache)
- (if cache
- (set-marker (car compilation--previous-directory-cache) pos)
- (setq compilation--previous-directory-cache
- (cons (copy-marker pos) nil)))
- (cdr compilation--previous-directory-cache))
- (t
- (if cache
- (progn
- (set-marker (car compilation--previous-directory-cache) pos)
- (setcdr compilation--previous-directory-cache
- (copy-marker prev)))
- (setq compilation--previous-directory-cache
- (cons (copy-marker pos) (copy-marker prev))))
- prev)))))
+ pos 'compilation-directory nil cache))
+ (res
+ (cond
+ ((null cache)
+ (setq compilation--previous-directory-cache
+ (cons (copy-marker pos) (if prev (copy-marker prev))))
+ prev)
+ ((and prev (= prev cache))
+ (if cache
+ (set-marker (car compilation--previous-directory-cache) pos)
+ (setq compilation--previous-directory-cache
+ (cons (copy-marker pos) nil)))
+ (cdr compilation--previous-directory-cache))
+ (t
+ (if cache
+ (progn
+ (set-marker cache pos)
+ (setcdr compilation--previous-directory-cache
+ (copy-marker prev)))
+ (setq compilation--previous-directory-cache
+ (cons (copy-marker pos) (if prev (copy-marker prev)))))
+ prev))))
+ (if (markerp res) (marker-position res) res))))
;; Internal function for calculating the text properties of a directory
;; change message. The compilation-directory property is important, because it
@@ -889,7 +891,7 @@ POS and RES.")
(defun compilation-directory-properties (idx leave)
(if leave (setq leave (match-end leave)))
;; find previous stack, and push onto it, or if `leave' pop it
- (let ((dir (compilation--previous-directory (point))))
+ (let ((dir (compilation--previous-directory (match-beginning 0))))
(setq dir (if dir (or (get-text-property (1- dir) 'compilation-directory)
(get-text-property dir 'compilation-directory))))
`(font-lock-face ,(if leave
@@ -948,7 +950,8 @@ POS and RES.")
(match-string-no-properties file))))
(let ((dir
(unless (file-name-absolute-p file)
- (let ((pos (compilation--previous-directory (point))))
+ (let ((pos (compilation--previous-directory
+ (match-beginning 0))))
(when pos
(or (get-text-property (1- pos) 'compilation-directory)
(get-text-property pos 'compilation-directory)))))))
diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el
index c376b25fae..0f823c806e 100644
--- a/lisp/progmodes/delphi.el
+++ b/lisp/progmodes/delphi.el
@@ -26,14 +26,14 @@
;; To enter Delphi mode when you find a Delphi source file, one must override
;; the auto-mode-alist to associate Delphi with .pas (and .dpr and .dpk)
-;; files. Emacs, by default, will otherwise enter Pascal mode. E.g.
+;; files. Emacs, by default, will otherwise enter Pascal mode. E.g.
;;
;; (autoload 'delphi-mode "delphi")
;; (setq auto-mode-alist
;; (cons '("\\.\\(pas\\|dpr\\|dpk\\)$" . delphi-mode) auto-mode-alist))
;; To get keyword, comment, and string literal coloring, be sure that font-lock
-;; is running. One can manually do M-x font-lock-mode in a Delphi buffer, or
+;; is running. One can manually do M-x font-lock-mode in a Delphi buffer, or
;; one can put in .emacs:
;;
;; (add-hook 'delphi-mode-hook 'turn-on-font-lock)
@@ -56,8 +56,8 @@
;; When you have entered Delphi mode, you may get more info by pressing
;; C-h m.
-;; This delphi mode implementation is fairly tolerant of syntax errors, relying
-;; as much as possible on the indentation of the previous statement. This also
+;; This Delphi mode implementation is fairly tolerant of syntax errors, relying
+;; as much as possible on the indentation of the previous statement. This also
;; makes it faster and simpler, since there is less searching for properly
;; constructed beginnings.
@@ -74,15 +74,16 @@
"True if in debug mode.")
(defcustom delphi-search-path "."
- "*Directories to search when finding external units. It is a list of
-directory strings. If only a single directory, it can be a single
-string instead of a list. If a directory ends in \"...\" then that
-directory is recursively searched."
+ "*Directories to search when finding external units.
+It is a list of directory strings. If only a single directory,
+it can be a single string instead of a list. If a directory
+ends in \"...\" then that directory is recursively searched."
:type 'string
:group 'delphi)
(defcustom delphi-indent-level 3
- "*Indentation of Delphi statements with respect to containing block. E.g.
+ "*Indentation of Delphi statements with respect to containing block.
+E.g.
begin
// This is an indent of 3.
@@ -117,7 +118,7 @@ end; end;"
:group 'delphi)
(defcustom delphi-verbose t ; nil
- "*If true then delphi token processing progress is reported to the user."
+ "*If true then Delphi token processing progress is reported to the user."
:type 'boolean
:group 'delphi)
@@ -137,17 +138,17 @@ differs from the default."
:group 'delphi)
(defcustom delphi-comment-face 'font-lock-comment-face
- "*Face used to color delphi comments."
+ "*Face used to color Delphi comments."
:type 'face
:group 'delphi)
(defcustom delphi-string-face 'font-lock-string-face
- "*Face used to color delphi strings."
+ "*Face used to color Delphi strings."
:type 'face
:group 'delphi)
(defcustom delphi-keyword-face 'font-lock-keyword-face
- "*Face used to color delphi keywords."
+ "*Face used to color Delphi keywords."
:type 'face
:group 'delphi)
@@ -720,9 +721,9 @@ routine.")
(delphi-progress-done)))))
(defvar delphi-ignore-changes t
- "Internal flag to control if the delphi-mode responds to buffer changes.
-Defaults to t in case the delphi-after-change function is called on a
-non-delphi buffer. Set to nil in a delphi buffer. To override, just do:
+ "Internal flag to control if the Delphi mode responds to buffer changes.
+Defaults to t in case the `delphi-after-change' function is called on a
+non-Delphi buffer. Set to nil in a Delphi buffer. To override, just do:
(let ((delphi-ignore-changes t)) ...)")
(defun delphi-after-change (change-start change-end old-length)
@@ -1521,8 +1522,8 @@ non-delphi buffer. Set to nil in a delphi buffer. To override, just do:
indent)))
(defun delphi-indent-line ()
- "Indent the current line according to the current language construct. If
-before the indent, the point is moved to the indent."
+ "Indent the current line according to the current language construct.
+If before the indent, the point is moved to the indent."
(interactive)
(delphi-save-match-data
(let ((marked-point (point-marker)) ; Maintain our position reliably.
@@ -1547,7 +1548,7 @@ before the indent, the point is moved to the indent."
(set-marker marked-point nil))))
(defvar delphi-mode-abbrev-table nil
- "Abbrev table in use in delphi-mode buffers.")
+ "Abbrev table in use in Delphi mode buffers.")
(define-abbrev-table 'delphi-mode-abbrev-table ())
(defmacro delphi-ensure-buffer (buffer-var buffer-name)
@@ -1568,7 +1569,7 @@ before the indent, the point is moved to the indent."
;; Debugging helpers:
(defvar delphi-debug-buffer nil
- "Buffer to write delphi-mode debug messages to. Created on demand.")
+ "Buffer to write Delphi mode debug messages to. Created on demand.")
(defun delphi-debug-log (format-string &rest args)
;; Writes a message to the log buffer.
@@ -1679,7 +1680,7 @@ before the indent, the point is moved to the indent."
(defun delphi-tab ()
"Indent the region, when Transient Mark mode is enabled and the region is
-active. Otherwise, indent the current line or insert a TAB, depending on the
+active. Otherwise, indent the current line or insert a TAB, depending on the
value of `delphi-tab-always-indents' and the current line position."
(interactive)
(cond ((use-region-p)
@@ -1768,8 +1769,8 @@ value of `delphi-tab-always-indents' and the current line position."
nil))
(defun delphi-find-unit (unit)
- "Finds the specified delphi source file according to `delphi-search-path'.
-If no extension is specified, .pas is assumed. Creates a buffer for the unit."
+ "Find the specified Delphi source file according to `delphi-search-path'.
+If no extension is specified, .pas is assumed. Creates a buffer for the unit."
(interactive "sDelphi unit name: ")
(let* ((unit-file (if (string-match "^\\(.*\\)\\.[a-z]+$" unit)
unit
@@ -1791,7 +1792,7 @@ If no extension is specified, .pas is assumed. Creates a buffer for the unit."
"Find the definition of the identifier under the current point, searching
in external units if necessary (as listed in the current unit's use clause).
The set of directories to search for a unit is specified by the global variable
-delphi-search-path."
+`delphi-search-path'."
(interactive)
(error "delphi-find-current-xdef: not implemented yet"))
@@ -1802,7 +1803,7 @@ it is a routine."
(error "delphi-find-current-body: not implemented yet"))
(defun delphi-fill-comment ()
- "Fills the text of the current comment, according to `fill-column'.
+ "Fill the text of the current comment, according to `fill-column'.
An error is raised if not in a comment."
(interactive)
(save-excursion
@@ -1888,8 +1889,8 @@ An error is raised if not in a comment."
(delphi-progress-done)))))))
(defun delphi-new-comment-line ()
- "If in a // comment, does a newline, indented such that one is still in the
-comment block. If not in a // comment, just does a normal newline."
+ "If in a // comment, do a newline, indented such that one is still in the
+comment block. If not in a // comment, just does a normal newline."
(interactive)
(let ((comment (delphi-current-token)))
(if (not (eq 'comment-single-line (delphi-token-kind comment)))
@@ -1923,7 +1924,7 @@ comment block. If not in a // comment, just does a normal newline."
nil ; Syntax begin movement doesn't apply
(font-lock-fontify-region-function . delphi-fontify-region)
(font-lock-verbose . delphi-fontifying-progress-step))
- "Delphi mode font-lock defaults. Syntactic fontification is ignored.")
+ "Delphi mode font-lock defaults. Syntactic fontification is ignored.")
(defvar delphi-debug-mode-map
(let ((kmap (make-sparse-keymap)))
@@ -1944,7 +1945,7 @@ comment block. If not in a // comment, just does a normal newline."
("x" delphi-debug-show-is-stable)
))
kmap)
- "Keystrokes for delphi-mode debug commands.")
+ "Keystrokes for Delphi mode debug commands.")
(defvar delphi-mode-map
(let ((kmap (make-sparse-keymap)))
@@ -1964,7 +1965,7 @@ comment block. If not in a // comment, just does a normal newline."
"Keymap used in Delphi mode.")
(defconst delphi-mode-syntax-table (make-syntax-table)
- "Delphi mode's syntax table. It is just a standard syntax table.
+ "Delphi mode's syntax table. It is just a standard syntax table.
This is ok since we do our own keyword/comment/string face coloring.")
;;;###autoload
@@ -1976,7 +1977,7 @@ This is ok since we do our own keyword/comment/string face coloring.")
\\[delphi-fill-comment]\t- Fill the current comment.
\\[delphi-new-comment-line]\t- If in a // comment, do a new comment line.
-M-x indent-region also works for indenting a whole region.
+\\[indent-region] also works for indenting a whole region.
Customization:
@@ -1996,21 +1997,21 @@ Customization:
`delphi-search-path' (default .)
Directories to search when finding external units.
`delphi-verbose' (default nil)
- If true then delphi token processing progress is reported to the user.
+ If true then Delphi token processing progress is reported to the user.
Coloring:
`delphi-comment-face' (default font-lock-comment-face)
- Face used to color delphi comments.
+ Face used to color Delphi comments.
`delphi-string-face' (default font-lock-string-face)
- Face used to color delphi strings.
+ Face used to color Delphi strings.
`delphi-keyword-face' (default font-lock-keyword-face)
- Face used to color delphi keywords.
+ Face used to color Delphi keywords.
`delphi-other-face' (default nil)
Face used to color everything else.
-Turning on Delphi mode calls the value of the variable delphi-mode-hook with
-no args, if that value is non-nil."
+Turning on Delphi mode calls the value of the variable `delphi-mode-hook'
+with no args, if that value is non-nil."
(interactive)
(kill-all-local-variables)
(use-local-map delphi-mode-map)
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index d674484345..87e5875c94 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -3566,12 +3566,12 @@ KIND is an additional string printed in the buffer."
(insert kind)
(indent-to 50)
(insert (case (second info)
- ('ebrowse-ts-member-functions "member function")
- ('ebrowse-ts-member-variables "member variable")
- ('ebrowse-ts-static-functions "static function")
- ('ebrowse-ts-static-variables "static variable")
- ('ebrowse-ts-friends (if globals-p "define" "friend"))
- ('ebrowse-ts-types "type")
+ (ebrowse-ts-member-functions "member function")
+ (ebrowse-ts-member-variables "member variable")
+ (ebrowse-ts-static-functions "static function")
+ (ebrowse-ts-static-variables "static variable")
+ (ebrowse-ts-friends (if globals-p "define" "friend"))
+ (ebrowse-ts-types "type")
(t "unknown"))
"\n")))
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 25d1410621..ab315f9eef 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -648,21 +648,36 @@ detailed description of this mode.
(set (make-local-variable 'gud-minor-mode) 'gdbmi)
(setq comint-input-sender 'gdb-send)
(when (ring-empty-p comint-input-ring) ; cf shell-mode
- (let (hfile)
- (when (catch 'done
- (dolist (file '(".gdbinit" "~/.gdbinit"))
- (if (file-readable-p (setq file (expand-file-name file)))
- (with-temp-buffer
- (insert-file-contents file)
- (and (re-search-forward
- "^ *set history filename *\\(.*\\)" nil t)
- (file-readable-p
- (setq hfile (expand-file-name
- (match-string 1)
- (file-name-directory file))))
- (throw 'done t))))))
- (set (make-local-variable 'comint-input-ring-file-name) hfile)
- (comint-read-input-ring t))))
+ (let ((hfile (expand-file-name (or (getenv "GBDHISTFILE")
+ (if (eq system-type 'ms-dos)
+ "_gdb_history"
+ ".gdb_history"))))
+ ;; gdb defaults to 256, but we'll default to comint-input-ring-size.
+ (hsize (getenv "HISTSIZE")))
+ (dolist (file (append '("~/.gdbinit")
+ (unless (string-equal (expand-file-name ".")
+ (expand-file-name "~"))
+ '(".gdbinit"))))
+ (if (file-readable-p (setq file (expand-file-name file)))
+ (with-temp-buffer
+ (insert-file-contents file)
+ ;; TODO? check for "set history save\\( *on\\)?" and do
+ ;; not use history otherwise?
+ (while (re-search-forward
+ "^ *set history \\(filename\\|size\\) *\\(.*\\)" nil t)
+ (cond ((string-equal (match-string 1) "filename")
+ (setq hfile (expand-file-name
+ (match-string 2)
+ (file-name-directory file))))
+ ((string-equal (match-string 1) "size")
+ (setq hsize (match-string 2))))))))
+ (and (stringp hsize)
+ (integerp (setq hsize (string-to-number hsize)))
+ (> hsize 0)
+ (set (make-local-variable 'comint-input-ring-size) hsize))
+ (if (stringp hfile)
+ (set (make-local-variable 'comint-input-ring-file-name) hfile))
+ (comint-read-input-ring t)))
(gud-def gud-tbreak "tbreak %f:%l" "\C-t"
"Set temporary breakpoint at current line.")
(gud-def gud-jump
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 53918b903e..47cbdf19ed 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -3127,7 +3127,9 @@ class of the file (using s to separate nested class ids)."
("^document\\s-.*\\(\n\\)" (1 "< b"))
("^end\\(\\>\\)"
(1 (ignore
- (unless (eq (match-beginning 0) (point-min))
+ (when (and (> (match-beginning 0) (point-min))
+ (eq 1 (nth 7 (save-excursion
+ (syntax-ppss (1- (match-beginning 0)))))))
;; We change the \n in front, which is more difficult, but results
;; in better highlighting. If the doc is empty, the single \n is
;; both the beginning and the end of the docstring, which can't be
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 9d40b4d8fd..c8b156c544 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -974,7 +974,7 @@ With ARG, do it many times. Negative ARG means move forward."
(goto-char (scan-sexps (1+ (point)) -1))
(case (char-before)
(?% (forward-char -1))
- ('(?q ?Q ?w ?W ?r ?x)
+ ((?q ?Q ?w ?W ?r ?x)
(if (eq (char-before (1- (point))) ?%) (forward-char -2))))
nil)
((looking-at "\\s\"\\|\\\\\\S_")
diff --git a/lisp/server.el b/lisp/server.el
index 019a16a43d..ce14f133f0 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -486,7 +486,13 @@ See variable `server-auth-dir' for details."
(file-name-as-directory dir))
:warning)
(throw :safe t))
- (unless (eql uid (user-uid)) ; is the dir ours?
+ (unless (or (= uid (user-uid)) ; is the dir ours?
+ (and w32
+ ;; Files created on Windows by
+ ;; Administrator (RID=500) have
+ ;; the Administrators (RID=544)
+ ;; group recorded as the owner.
+ (= uid 544) (= (user-uid) 500)))
(throw :safe nil))
(when w32 ; on NTFS?
(throw :safe t))
diff --git a/lisp/shell.el b/lisp/shell.el
index 2f11cc6314..dde81c6cb9 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -459,7 +459,12 @@ buffer."
;; shell-dependent assignments.
(when (ring-empty-p comint-input-ring)
(let ((shell (file-name-nondirectory (car
- (process-command (get-buffer-process (current-buffer)))))))
+ (process-command (get-buffer-process (current-buffer))))))
+ (hsize (getenv "HISTSIZE")))
+ (and (stringp hsize)
+ (integerp (setq hsize (string-to-number hsize)))
+ (> hsize 0)
+ (set (make-local-variable 'comint-input-ring-size) hsize))
(setq comint-input-ring-file-name
(or (getenv "HISTFILE")
(cond ((string-equal shell "bash") "~/.bash_history")
@@ -578,6 +583,21 @@ Otherwise, one argument `-i' is passed to the shell.
(get-buffer-create (or buffer "*shell*"))
;; If the current buffer is a dead shell buffer, use it.
(current-buffer)))
+
+ ;; On remote hosts, the local `shell-file-name' might be useless.
+ (if (and (interactive-p)
+ (file-remote-p default-directory)
+ (null explicit-shell-file-name)
+ (null (getenv "ESHELL")))
+ (with-current-buffer buffer
+ (set (make-local-variable 'explicit-shell-file-name)
+ (file-remote-p
+ (expand-file-name
+ (read-file-name
+ "Remote shell path: " default-directory shell-file-name
+ t shell-file-name))
+ 'localname))))
+
;; Pop to buffer, so that the buffer's window will be correctly set
;; when we call comint (so that comint sets the COLUMNS env var properly).
(pop-to-buffer buffer)
diff --git a/lisp/simple.el b/lisp/simple.el
index 7a191f0cc9..e4c742b56f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -636,7 +636,9 @@ If the region is active, only delete whitespace within the region."
(if (looking-at ".*\f")
(goto-char (match-end 0))))
(delete-region (point) (match-end 0)))
- (set-marker end-marker nil)))))
+ (set-marker end-marker nil))))
+ ;; Return nil for the benefit of `write-file-functions'.
+ nil)
(defun newline-and-indent ()
"Insert a newline, then indent according to major mode.
@@ -2627,7 +2629,7 @@ specifies the value of ERROR-BUFFER."
(with-output-to-string
(with-current-buffer
standard-output
- (call-process shell-file-name nil t nil shell-command-switch command))))
+ (process-file shell-file-name nil t nil shell-command-switch command))))
(defun process-file (program &optional infile buffer display &rest args)
"Process files synchronously in a separate process.
diff --git a/lisp/startup.el b/lisp/startup.el
index 4dbf41d3ac..765ca1540e 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -392,6 +392,15 @@ Warning Warning!!! Pure space overflow !!!Warning Warning
:type 'directory
:initialize 'custom-initialize-delay)
+(defconst package-subdirectory-regexp
+ "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)"
+ "Regular expression matching the name of a package subdirectory.
+The first subexpression is the package name.
+The second subexpression is the version string.
+
+The regexp should not contain a starting \"\\`\" or a trailing
+ \"\\'\"; those are added automatically by callers.")
+
(defun normal-top-level-add-subdirs-to-load-path ()
"Add all subdirectories of current directory to `load-path'.
More precisely, this uses only the subdirectories whose names
@@ -1006,19 +1015,23 @@ opening the first frame (e.g. open a connection to an X server).")
(if init-file-user
(let ((user-init-file-1
(cond
- ((eq system-type 'ms-dos)
- (concat "~" init-file-user "/_emacs"))
- ((eq system-type 'windows-nt)
- ;; Prefer .emacs on Windows.
- (if (directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$")
- "~/.emacs"
- ;; Also support _emacs for compatibility.
- (if (directory-files "~" nil "^_emacs\\(\\.elc?\\)?$")
- "~/_emacs"
- ;; But default to .emacs if _emacs does not exist.
- "~/.emacs")))
- (t
- (concat "~" init-file-user "/.emacs")))))
+ ((eq system-type 'ms-dos)
+ (concat "~" init-file-user "/_emacs"))
+ ((not (eq system-type 'windows-nt))
+ (concat "~" init-file-user "/.emacs"))
+ ;; Else deal with the Windows situation
+ ((directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$")
+ ;; Prefer .emacs on Windows.
+ "~/.emacs")
+ ((directory-files "~" nil "^_emacs\\(\\.elc?\\)?$")
+ ;; Also support _emacs for compatibility, but warn about it.
+ (display-warning
+ 'initialization
+ "`_emacs' init file is deprecated, please use `.emacs'"
+ :warning)
+ "~/_emacs")
+ (t ;; But default to .emacs if _emacs does not exist.
+ "~/.emacs"))))
;; This tells `load' to store the file name found
;; into user-init-file.
(setq user-init-file t)
@@ -1190,9 +1203,9 @@ the `--debug-init' option to view a complete error backtrace."
(when (file-directory-p dir)
(dolist (subdir (directory-files dir))
(when (and (file-directory-p (expand-file-name subdir dir))
- ;; package-subdirectory-regexp from package.el
- (string-match "^\\([^.].*\\)-\\([0-9]+\\(?:[.][0-9]+\\)*\\)$"
- subdir))
+ (string-match
+ (concat "\\`" package-subdirectory-regexp "\\'")
+ subdir))
(throw 'package-dir-found t)))))))
(package-initialize))
diff --git a/lisp/subr.el b/lisp/subr.el
index 45cfb56bdc..9f4e35fcbe 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2066,24 +2066,24 @@ If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
keyboard-quit events while waiting for a valid input."
(unless (consp chars)
(error "Called `read-char-choice' without valid char choices"))
- (let ((cursor-in-echo-area t)
- (executing-kbd-macro executing-kbd-macro)
- char done)
- (while (not done)
- (unless (get-text-property 0 'face prompt)
- (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
- (setq char (let ((inhibit-quit inhibit-keyboard-quit))
- (read-key prompt)))
- (cond
- ((not (numberp char)))
- ((memq char chars)
- (setq done t))
- ((and executing-kbd-macro (= char -1))
- ;; read-event returns -1 if we are in a kbd macro and
- ;; there are no more events in the macro. Attempt to
- ;; get an event interactively.
- (setq executing-kbd-macro nil))))
- ;; Display the question with the answer.
+ (let (char done)
+ (let ((cursor-in-echo-area t)
+ (executing-kbd-macro executing-kbd-macro))
+ (while (not done)
+ (unless (get-text-property 0 'face prompt)
+ (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
+ (setq char (let ((inhibit-quit inhibit-keyboard-quit))
+ (read-key prompt)))
+ (cond
+ ((not (numberp char)))
+ ((memq char chars)
+ (setq done t))
+ ((and executing-kbd-macro (= char -1))
+ ;; read-event returns -1 if we are in a kbd macro and
+ ;; there are no more events in the macro. Attempt to
+ ;; get an event interactively.
+ (setq executing-kbd-macro nil)))))
+ ;; Display the question with the answer. But without cursor-in-echo-area.
(message "%s%s" prompt (char-to-string char))
char))
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index dfd12a005a..7e9ce9aff6 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -318,11 +318,12 @@ chapter."
(defconst texinfo-environments
'("cartouche" "copying" "defcv" "deffn" "defivar" "defmac"
- "defmethod" "defop" "defopt" "defspec" "deftp" "deftypefn"
- "deftypefun" "deftypevar" "deftypevr" "defun" "defvar"
+ "defmethod" "defop" "defopt" "defspec" "deftp" "deftypecv"
+ "deftypefn" "deftypefun" "deftypeivar" "deftypemethod"
+ "deftypeop" "deftypevar" "deftypevr" "defun" "defvar"
"defvr" "description" "detailmenu" "direntry" "display"
"documentdescription" "enumerate" "example" "flushleft"
- "flushright" "format" "ftable" "group" "ifclear" "ifset"
+ "flushright" "format" "ftable" "group" "html" "ifclear" "ifset"
"ifhtml" "ifinfo" "ifnothtml" "ifnotinfo" "ifnotplaintext"
"ifnottex" "ifplaintext" "iftex" "ignore" "itemize" "lisp"
"macro" "menu" "multitable" "quotation" "smalldisplay"
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index f55629b3ea..50f20cea77 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -122,8 +122,7 @@ when editing big diffs)."
("\C-m" . diff-goto-source)
([mouse-2] . diff-goto-source)
;; From XEmacs' diff-mode.
- ;; Standard M-w is useful, so don't change M-W.
- ;;("W" . widen)
+ ("W" . widen)
;;("." . diff-goto-source) ;display-buffer
;;("f" . diff-goto-source) ;find-file
("o" . diff-goto-source) ;other-window
@@ -135,17 +134,21 @@ when editing big diffs)."
;; Not useful if you have to metafy them.
;;(" " . scroll-up)
;;("\177" . scroll-down)
- ;; Standard M-a is useful, so don't change M-A.
- ;;("A" . diff-ediff-patch)
- ;; Standard M-r is useful, so don't change M-r or M-R.
- ;;("r" . diff-restrict-view)
- ;;("R" . diff-reverse-direction)
- )
+ ("A" . diff-ediff-patch)
+ ("r" . diff-restrict-view)
+ ("R" . diff-reverse-direction))
"Basic keymap for `diff-mode', bound to various prefix keys."
:inherit special-mode-map)
(easy-mmode-defmap diff-mode-map
- `(("\e" . ,diff-mode-shared-map)
+ `(("\e" . ,(let ((map (make-sparse-keymap)))
+ ;; We want to inherit most bindings from diff-mode-shared-map,
+ ;; but not all since they may hide useful M-<foo> global
+ ;; bindings when editing.
+ (set-keymap-parent map diff-mode-shared-map)
+ (dolist (key '("A" "r" "R" "g" "q" "W"))
+ (define-key map key nil))
+ map))
;; From compilation-minor-mode.
("\C-c\C-c" . diff-goto-source)
;; By analogy with the global C-x 4 a binding.
diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el
index 601b6b1e59..5435a840ac 100644
--- a/lisp/vc/emerge.el
+++ b/lisp/vc/emerge.el
@@ -3176,21 +3176,26 @@ See also `auto-save-file-name-p'."
;; Metacharacters that have to be protected from the shell when executing
;; a diff/diff3 command.
-(defcustom emerge-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
- "Characters that must be quoted with \\ when used in a shell command line.
+(defcustom emerge-metachars
+ (if (memq system-type '(ms-dos windows-nt))
+ "[ \t\"<>|?*^&=]"
+ "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]")
+ "Characters that must be quoted when used in a shell command line.
More precisely, a [...] regexp to match any one such character."
:type 'regexp
:group 'emerge)
;; Quote metacharacters (using \) when executing a diff/diff3 command.
(defun emerge-protect-metachars (s)
- (let ((limit 0))
- (while (string-match emerge-metachars s limit)
- (setq s (concat (substring s 0 (match-beginning 0))
- "\\"
- (substring s (match-beginning 0))))
- (setq limit (1+ (match-end 0)))))
- s)
+ (if (memq system-type '(ms-dos windows-nt))
+ (shell-quote-argument s)
+ (let ((limit 0))
+ (while (string-match emerge-metachars s limit)
+ (setq s (concat (substring s 0 (match-beginning 0))
+ "\\"
+ (substring s (match-beginning 0))))
+ (setq limit (1+ (match-end 0)))))
+ s))
(provide 'emerge)
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index a0a16601ed..21cb86a984 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -435,8 +435,13 @@ If any error occurred in running `bzr status', then return nil."
(defun vc-bzr-state (file)
(lexical-let ((result (vc-bzr-status file)))
(when (consp result)
- (when (cdr result)
- (message "Warnings in `bzr' output: %s" (cdr result)))
+ (let ((warnings (cdr result)))
+ (when warnings
+ ;; bzr 2.3.0 returns info about shelves, which is not really a warning
+ (when (string-match "[1-9]+ shel\\(f\\|ves\\) exists?\\..*?\n" warnings)
+ (setq warnings (replace-match "" nil nil warnings)))
+ (unless (string= warnings "")
+ (message "Warnings in `bzr' output: %s" warnings))))
(cdr (assq (car result)
'((added . added)
(kindchanged . edited)
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index d4970207b9..01b6f2fc26 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -104,7 +104,7 @@ See `run-hooks'."
;; We pass a filename to create-file-buffer because it is what
;; the function expects, and also what uniquify needs (if active)
(with-current-buffer (create-file-buffer (expand-file-name bname dir))
- (cd dir)
+ (setq default-directory dir)
(vc-setup-buffer (current-buffer))
;; Reset the vc-parent-buffer-name so that it does not appear
;; in the mode-line.
@@ -1002,7 +1002,7 @@ specific headers."
(generate-new-buffer (format " *VC-%s* tmp status" backend))))
(lexical-let ((buffer (current-buffer)))
(with-current-buffer vc-dir-process-buffer
- (cd def-dir)
+ (setq default-directory def-dir)
(erase-buffer)
(vc-call-backend
backend 'dir-status-files def-dir files default-state
@@ -1067,7 +1067,7 @@ Throw an error if another update process is in progress."
(ewoc-set-hf vc-ewoc (vc-dir-headers backend def-dir) "")
(lexical-let ((buffer (current-buffer)))
(with-current-buffer vc-dir-process-buffer
- (cd def-dir)
+ (setq default-directory def-dir)
(erase-buffer)
(vc-call-backend
backend 'dir-status def-dir
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3b4d0e5f42..711a573ba9 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -119,6 +119,12 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
:version "23.1"
:group 'vc)
+(defcustom vc-git-program "git"
+ "Name of the Git executable (excluding any arguments)."
+ :version "24.1"
+ :type 'string
+ :group 'vc)
+
(defcustom vc-git-root-log-format
'("%d%h..: %an %ad %s"
;; The first shy group matches the characters drawn by --graph.
@@ -554,7 +560,7 @@ or an empty string if none."
"Return the existing branches, as a list of strings.
The car of the list is the current branch."
(with-temp-buffer
- (call-process "git" nil t nil "branch")
+ (call-process vc-git-program nil t nil "branch")
(goto-char (point-min))
(let (current-branch branches)
(while (not (eobp))
@@ -633,13 +639,13 @@ for the Git command to run."
(let* ((root (vc-git-root default-directory))
(buffer (format "*vc-git : %s*" (expand-file-name root)))
(command "pull")
- (git-program "git")
+ (git-program vc-git-program)
args)
;; If necessary, prompt for the exact command.
(when prompt
(setq args (split-string
(read-shell-command "Git pull command: "
- "git pull"
+ (format "%s pull" git-program)
'vc-git-history)
" " t))
(setq git-program (car args)
@@ -663,7 +669,7 @@ This prompts for a branch to merge from."
branches
(cons "FETCH_HEAD" branches))
nil t)))
- (apply 'vc-do-async-command buffer root "git" "merge"
+ (apply 'vc-do-async-command buffer root vc-git-program "merge"
(list merge-source))
(vc-set-async-update buffer)))
@@ -1083,8 +1089,10 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
(defun vc-git-command (buffer okstatus file-or-list &rest flags)
"A wrapper around `vc-do-command' for use in vc-git.el.
-The difference to vc-do-command is that this function always invokes `git'."
- (apply 'vc-do-command (or buffer "*vc*") okstatus "git" file-or-list flags))
+The difference to vc-do-command is that this function always invokes
+`vc-git-program'."
+ (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
+ file-or-list flags))
(defun vc-git--empty-db-p ()
"Check if the git db is empty (no commit done yet)."
@@ -1095,7 +1103,7 @@ The difference to vc-do-command is that this function always invokes `git'."
;; We don't need to care the arguments. If there is a file name, it
;; is always a relative one. This works also for remote
;; directories.
- (apply 'process-file "git" nil buffer nil command args))
+ (apply 'process-file vc-git-program nil buffer nil command args))
(defun vc-git--out-ok (command &rest args)
(zerop (apply 'vc-git--call '(t nil) command args)))
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index d283c39362..0516abbf02 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -529,9 +529,9 @@ REV is the revision to check out into WORKFILE."
(insert (propertize
(format " (%s %s)"
(case (vc-hg-extra-fileinfo->rename-state extra)
- ('copied "copied from")
- ('renamed-from "renamed from")
- ('renamed-to "renamed to"))
+ (copied "copied from")
+ (renamed-from "renamed from")
+ (renamed-to "renamed to"))
(vc-hg-extra-fileinfo->extra-name extra))
'face 'font-lock-comment-face)))))
@@ -663,14 +663,15 @@ then attempts to update the working directory."
(let* ((root (vc-hg-root default-directory))
(buffer (format "*vc-hg : %s*" (expand-file-name root)))
(command "pull")
- (hg-program "hg")
+ (hg-program vc-hg-program)
;; Fixme: before updating the working copy to the latest
;; state, should check if it's visiting an old revision.
(args '("-u")))
;; If necessary, prompt for the exact command.
(when prompt
(setq args (split-string
- (read-shell-command "Run Hg (like this): " "hg pull -u"
+ (read-shell-command "Run Hg (like this): "
+ (format "%s pull -u" hg-program)
'vc-hg-history)
" " t))
(setq hg-program (car args)
@@ -685,7 +686,7 @@ then attempts to update the working directory."
This runs the command \"hg merge\"."
(let* ((root (vc-hg-root default-directory))
(buffer (format "*vc-hg : %s*" (expand-file-name root))))
- (apply 'vc-do-async-command buffer root "hg" '("merge"))
+ (apply 'vc-do-async-command buffer root vc-hg-program '("merge"))
(vc-set-async-update buffer)))
;;; Internal functions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 200291bd92..7f55ffdbda 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1115,9 +1115,12 @@ merge in the changes into your working copy."
(dolist (file files)
(unless (file-writable-p file)
;; Make the file+buffer read-write.
- (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue?" file))
+ (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue? " file))
(error "Aborted"))
- (set-file-modes file (logior (file-modes file) 128))
+ ;; Maybe we somehow lost permissions on the directory.
+ (condition-case nil
+ (set-file-modes file (logior (file-modes file) 128))
+ (error (error "Unable to make file writable")))
(let ((visited (get-file-buffer file)))
(when visited
(with-current-buffer visited
diff --git a/src/.gdbinit b/src/.gdbinit
index 3072dc956b..2cf5663df9 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -392,7 +392,7 @@ define pwinx
printf "Window %d ", $int
xgetptr $w->buffer
set $tem = (struct buffer *) $ptr
- xgetptr $tem->name
+ xgetptr $tem->name_
printf "%s", ((struct Lisp_String *) $ptr)->data
printf "\n"
xgetptr $w->start
@@ -938,7 +938,7 @@ end
define xbuffer
xgetptr $
print (struct buffer *) $ptr
- xgetptr $->name
+ xgetptr $->name_
output ((struct Lisp_String *) $ptr)->data
echo \n
end
diff --git a/src/ChangeLog.trunk b/src/ChangeLog.trunk
index a96edcdfdc..6fa2d82156 100644
--- a/src/ChangeLog.trunk
+++ b/src/ChangeLog.trunk
@@ -1,3 +1,796 @@
+2011-03-20 Glenn Morris <rgm@gnu.org>
+
+ * config.in: Remove file.
+
+2011-03-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * minibuf.c (Vcompleting_read_function): Don't declare, global variables
+ are now in src/globals.h.
+ (syms_of_minibuf): Remove spurious & from previous change.
+
+2011-03-20 Leo <sdl.web@gmail.com>
+
+ * minibuf.c (completing-read-function): New variable.
+ (completing-read-default): Rename from completing-read.
+ (completing-read): Call completing-read-function.
+
+2011-03-19 Juanma Barranquero <lekktu@gmail.com>
+
+ * xfaces.c (Fx_load_color_file):
+ Read color file from absolute filename (bug#8250).
+
+2011-03-19 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in: Update dependencies.
+
+2011-03-17 Eli Zaretskii <eliz@gnu.org>
+
+ * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
+
+2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix more problems found by GCC 4.5.2's static checks.
+
+ * process.c (make_serial_process_unwind, send_process_trap):
+ (sigchld_handler): Now static.
+
+ * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
+ That way, the code declares only the vars that it needs.
+ * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
+ * s/cygwin.h (PTY_ITERATION): Likewise.
+ * s/darwin.h (PTY_ITERATION): Likewise.
+ * s/gnu-linux.h (PTY_ITERATION): Likewise.
+
+ * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
+ * process.c (allocate_pty): Don't declare stb unless it's needed.
+
+ * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
+ (CONSTANTLIM): Remove; unused.
+ (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
+ Define only if needed.
+
+ * unexelf.c (unexec): Name an expression,
+ to avoid gcc -Wbad-function-cast warning.
+ Use a different way to cause a compilation error if anyone uses
+ n rather than nn, a way that does not involve shadowing.
+ (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
+
+ * deps.mk (unexalpha.o): Remove; unused.
+
+ New file unexec.h, the (simple) interface for unexec (Bug#8267).
+ * unexec.h: New file.
+ * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
+ (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
+ Depend on unexec.h.
+ * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
+ * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
+ * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
+ Change as necessary to match prototype in unexec.h.
+
+ * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
+ shadowing.
+ (back_comment, skip_chars): Mark vars as initialized.
+
+ * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
+ Rename locals to avoid shadowing.
+
+ * lread.c (read1): Rewrite so as not to use empty "else".
+ (Fload, readevalloop, read1): Rename locals to avoid shadowing.
+
+ * print.c (Fredirect_debugging_output): Fix pointer signedess.
+
+ * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
+ warning when compiling print.c.
+
+ * font.c (font_unparse_fcname): Abort in an "impossible" situation
+ instead of using an uninitialized var.
+ (font_sort_entities): Mark var as initialized.
+
+ * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
+
+ * font.c (font_unparse_xlfd): Don't mix pointers to variables with
+ pointers to constants.
+ (font_parse_fcname): Remove unused vars.
+ (font_delete_unmatched): Now static.
+ (font_get_spec): Remove; unused.
+ (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
+ (font_update_drivers, Ffont_get_glyphs, font_add_log):
+ Rename or move locals to avoid shadowing.
+
+ * fns.c (require_nesting_list, require_unwind): Now static.
+ (Ffillarray): Rename locals to avoid shadowing.
+
+ * floatfns.c (domain_error2): Define only if needed.
+ (Ffrexp, Fldexp): Rename locals to avoid shadowing.
+
+ * alloc.c (mark_backtrace): Move decl from here ...
+ * lisp.h: ... to here, so that it can be checked.
+
+ * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
+ (Fdefvar): Rewrite so as not to use empty "else".
+ (lisp_indirect_variable): Name an expression,
+ to avoid gcc -Wbad-function-cast warning.
+ (Fdefvar): Rename locals to avoid shadowing.
+
+ * callint.c (quotify_arg, quotify_args): Now static.
+ (Fcall_interactively): Rename locals to avoid shadowing.
+ Use const pointer when appropriate.
+
+ * lisp.h (get_system_name, get_operating_system_release):
+ Move decls here, to check interfaces.
+ * process.c (get_operating_system_release): Move decl to lisp.h.
+ * xrdb.c (get_system_name): Likewise.
+ * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
+ (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
+ some of which prompt warnings from gcc -Wbad-function-cast.
+ (Fformat_time_string, Fencode_time, Finsert_char):
+ (Ftranslate_region_internal, Fformat):
+ Rename or remove local vars to avoid shadowing.
+ (Ftranslate_region_internal): Mark var as initialized.
+
+ * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
+ avoid shadowing.
+
+ * lisp.h (eassert): Check that the argument compiles, even if
+ ENABLE_CHECKING is not defined.
+
+ * data.c (Findirect_variable): Name an expression, to avoid
+ gcc -Wbad-function-cast warning.
+ (default_value, arithcompare, arith_driver, arith_error): Now static.
+ (store_symval_forwarding): Rename local to avoid shadowing.
+ (Fmake_variable_buffer_local, Fmake_local_variable): Mark
+ variables as initialized.
+ (do_blv_forwarding, do_symval_forwarding): Remove; unused.
+
+ * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
+ (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
+ Rename locals to avoid shadowing.
+ (mark_stack): Move local variables into the #ifdef region where
+ they're used.
+ (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
+ ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
+ needed otherwise.
+ (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
+ (GC_STRING_CHARS): Remove; not used.
+ (Fmemory_limit): Cast sbrk's returned value to char *.
+
+ * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
+ avoids undefined behavior in theory.
+
+ * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
+
+ Use functions, not macros, for up- and down-casing (Bug#8254).
+ * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
+ (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
+ to use the following functions instead of these macros.
+ (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
+ EMACS_INT, since callers assume the returned value fits in int.
+ (upcase1): Likewise, for UPCASE_TABLE.
+ (uppercasep, lowercasep, upcase): New static inline functions.
+ * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
+ the race-condition problem in the old DOWNCASE.
+
+ * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
+ Rename locals to avoid shadowing.
+ (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
+ (regex_compile, re_search_2, re_match_2_internal):
+ Remove unused local vars.
+ (FREE_VAR): Rewrite so as not to use empty "else",
+ which gcc can warn about.
+ (regex_compile, re_match_2_internal): Mark locals as initialized.
+ (RETALLOC_IF): Define only if needed.
+ (WORDCHAR_P): Likewise. This one is never needed, but is used
+ only in a comment talking about a compiler bug, so put inside
+ the #if 0 of that comment.
+ (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
+ (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
+ Remove; unused.
+
+ * search.c (boyer_moore): Rename locals to avoid shadowing.
+ * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
+ (PREV_CHAR_BOUNDARY): Likewise.
+
+ * search.c (simple_search): Remove unused var.
+
+ * dired.c (compile_pattern): Move decl from here ...
+ * lisp.h: ... to here, so that it can be checked.
+ (struct re_registers): New forward decl.
+
+ * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
+
+ * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
+ All uses changed.
+ (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
+ Rename locals to avoid shadowing.
+ (Fvertical_motion): Mark locals as initialized.
+
+ * casefiddle.c (casify_object, casify_region): Now static.
+ (casify_region): Mark local as initialized.
+
+ * cmds.c (internal_self_insert): Rename local to avoid shadowing.
+
+ * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
+ New macros, so that the caller can use some names other than
+ gcpro1, gcpro2, etc.
+ (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
+ of the new macros.
+ (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
+ argument, for consistency with GCPRO2_VAR, etc: it is now the
+ prefix of the variable, not the variable itself. All uses
+ changed.
+ * dired.c (directory_files_internal, file_name_completion):
+ Rename locals to avoid shadowing.
+
+ Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
+ An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
+ dired.c's scmp function, had undefined behavior.
+ * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
+ (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
+ * buffer.h: ... to here, because these macros use current_buffer,
+ and the new implementation with inline functions needs to have
+ current_buffer in scope now, rather than later when the macros
+ are used.
+ (downcase, upcase1): New static inline functions.
+ (DOWNCASE, UPCASE1): Reimplement using these functions.
+ This avoids undefined behavior in expressions like
+ DOWNCASE (x) == DOWNCASE (y), which previously suffered
+ from race conditions in accessing the global variables
+ case_temp1 and case_temp2.
+ * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
+ * lisp.h (case_temp1, case_temp2): Remove their decls.
+ * character.h (ASCII_CHAR_P): Move from here ...
+ * lisp.h: ... to here, so that the inline functions mentioned
+ above can use them.
+
+ * dired.c (directory_files_internal_unwind): Now static.
+
+ * fileio.c (file_name_as_directory, directory_file_name):
+ (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
+ Now static.
+ (file_name_as_directory): Use const pointers when appropriate.
+ (Fexpand_file_name): Likewise. In particular, newdir might
+ point at constant storage, so make it a const pointer.
+ (Fmake_directory_internal, Fread_file_name): Remove unused vars.
+ (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
+ signedness issues.
+ (Fset_file_times, Finsert_file_contents, auto_save_error):
+ Rename locals to avoid shadowing.
+
+ * minibuf.c (choose_minibuf_frame_1): Now static.
+ (Ftry_completion, Fall_completions): Rename or remove locals
+ to avoid shadowing.
+
+ * marker.c (bytepos_to_charpos): Remove; unused.
+
+ * lisp.h (verify_bytepos, count_markers): New decls,
+ so that gcc does not warn that these functions aren't declared.
+
+ * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
+ (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
+ (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
+ (copy_text): Remove unused local var.
+
+ * filelock.c (within_one_second): Now static.
+ (lock_file_1): Rename local to avoid shadowing.
+
+ * buffer.c (fix_overlays_before): Mark locals as initialized.
+ (fix_start_end_in_overlays): Likewise. This function should be
+ simplified by using pointers-to-pointers, but that's a different
+ matter.
+ (switch_to_buffer_1): Now static.
+ (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
+ (report_overlay_modification): Rename locals to avoid shadowing.
+
+ * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
+ Fix pointer signedness issue.
+ (sys_subshell): Mark local as volatile if checking for lint,
+ to suppress a gcc -Wclobbered warning that does not seem to be right.
+ (MAXPATHLEN): Define only if needed.
+
+ * process.c (serial_open, serial_configure): Move decls from here ...
+ * systty.h: ... to here, so that they can be checked.
+
+ * fns.c (get_random, seed_random): Move extern decls from here ...
+ * lisp.h: ... to here, so that they can be checked.
+
+ * sysdep.c (reset_io): Now static.
+ (wait_for_termination_signal): Remove; unused.
+
+ * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
+ (copy_keymap_item, append_key, push_text_char_description):
+ Now static.
+ (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
+ (DENSE_TABLE_SIZE): Remove; unused.
+ (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
+ (describe_map_tree):
+ Rename locals to avoid shadowing.
+
+ * keyboard.c: Declare functions static if they are not used elsewhere.
+ (echo_char, echo_dash, cmd_error, top_level_2):
+ (poll_for_input, handle_async_input): Now static.
+ (read_char, kbd_buffer_get_event, make_lispy_position):
+ (make_lispy_event, make_lispy_movement, apply_modifiers):
+ (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
+ (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
+ (Fread_key_sequence_vector): Rename locals to avoid shadowing.
+ (read_key_sequence, read_char): Mark locals as initialized.
+ (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
+
+ * keyboard.h (make_ctrl_char): New decl.
+ (mark_kboards): Move decl here ...
+ * alloc.c (mark_kboards): ... from here.
+
+ * lisp.h (force_auto_save_soon): New decl.
+
+ * emacs.c (init_cmdargs): Rename local to avoid shadowing.
+ (DEFINE_DUMMY_FUNCTION): New macro.
+ (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
+ Use it.
+ (main): Add casts to avoid warnings
+ if GCC considers string literals to be constants.
+
+ * lisp.h (fatal_error_signal): Add decl, since it's exported.
+
+ * dbusbind.c: Pointer signedness fixes.
+ (xd_signature, xd_append_arg, xd_initialize):
+ (Fdbus_call_method, Fdbus_call_method_asynchronously):
+ (Fdbus_method_return_internal, Fdbus_method_error_internal):
+ (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
+ (Fdbus_register_signal): Use SSDATA when the context wants char *.
+
+ * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
+ if GCC considers string literals to be constants.
+ (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
+
+2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
+ (print_preprocess, print_object): New macro to fix last change.
+
+ * print.c (print_preprocess): Don't forget font objects.
+
+2011-03-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * emacs.c (USAGE3): Doc fixes.
+
+2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * coding.c (detect_coding_iso_2022): Reorganize code to clarify
+ structure.
+
+2011-03-14 Juanma Barranquero <lekktu@gmail.com>
+
+ * lisp.h (VWindow_system, Qfile_name_history):
+ * keyboard.h (lispy_function_keys) [WINDOWSNT]:
+ * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
+ (w32_system_caret_x, w32_system_caret_y): Declare extern.
+
+ * w32select.c: Don't #include "keyboard.h".
+ (run_protected): Add extern declaration for waiting_for_input.
+
+ * w32.c (Qlocal, noninteractive1, inhibit_window_system):
+ * w32console.c (detect_input_pending, read_input_pending)
+ (encode_terminal_code):
+ * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
+ (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
+ (w32_system_caret_y, Qfile_name_history):
+ * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
+ * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
+ * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
+ (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
+ * w32proc.c (Qlocal, report_file_error):
+ * w32term.c (Vwindow_system, updating_frame):
+ * w32uniscribe.c (initialized, uniscribe_font_driver):
+ Remove unneeded extern declarations.
+
+2011-03-14 Chong Yidong <cyd@stupidchicken.com>
+
+ * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
+
+2011-03-13 Chong Yidong <cyd@stupidchicken.com>
+
+ * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
+ (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
+ These macros can no longer be used for assignment.
+
+ * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Assign
+ struct members directly, instead of using BUF_BEGV etc.
+ (record_buffer_markers, fetch_buffer_markers): New functions for
+ recording and fetching special buffer markers.
+ (set_buffer_internal_1, set_buffer_temp): Use them.
+
+ * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
+
+ * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
+
+ * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
+ (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
+
+ * xdisp.c (hscroll_window_tree):
+ (reconsider_clip_changes): Use PT instead of BUF_PT.
+
+2011-03-13 Eli Zaretskii <eliz@gnu.org>
+
+ * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
+ $(EMACS_ROOT)/lib/intprops.h.
+
+2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix more problems found by GCC 4.5.2's static checks.
+
+ * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
+ to unsigned char * to avoid compiler diagnostic.
+ (xg_free_frame_widgets): Make it clear that a local variable is
+ needed only if USE_GTK_TOOLTIP.
+ (gdk_window_get_screen): Make it clear that this macro is needed
+ only if USE_GTK_TOOLTIP.
+ (int_gtk_range_get_value): New function, which avoids a diagnostic
+ from gcc -Wbad-function-cast.
+ (xg_set_toolkit_scroll_bar_thumb): Use it.
+ (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
+ diagnostic from gcc -Wbad-function-cast.
+ (get_utf8_string, xg_get_file_with_chooser):
+ Rename locals to avoid shadowing.
+ (create_dialog): Move locals to avoid shadowing.
+
+ * xgselect.c (xg_select): Remove unused var.
+
+ * image.c (four_corners_best): Mark locals as initialized.
+ (gif_load): Initialize transparent_p to zero (Bug#8238).
+ Mark another local as initialized.
+ (my_png_error, my_error_exit): Mark with NO_RETURN.
+
+ * image.c (clear_image_cache): Now static.
+ (DIM, HAVE_STDLIB_H_1): Remove unused macros.
+ (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
+ (x_edge_detection): Remove unnecessary cast that
+ gcc -Wbad-function-cast diagnoses.
+ (gif_load): Fix pointer signedness.
+ (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
+ (jpeg_load, gif_load): Rename locals to avoid shadowing.
+
+2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ Improve quality of tests for time stamp overflow.
+ For example, without this patch (encode-time 0 0 0 1 1
+ 1152921504606846976) returns the obviously-bogus value (-948597
+ 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
+ reports time overflow. See
+ <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
+ * deps.mk (editfns.o): Depend on ../lib/intprops.h.
+ * editfns.c: Include limits.h and intprops.h.
+ (TIME_T_MIN, TIME_T_MAX): New macros.
+ (time_overflow): Move earlier, to before first use.
+ (hi_time, lo_time): New functions, for an accurate test for
+ out-of-range times.
+ (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
+ (Fget_internal_run_time): Don't assume time_t fits in int.
+ (make_time): Use list2 instead of Fcons twice.
+ (Fdecode_time): More accurate test for out-of-range times.
+ (check_tm_member): New function.
+ (Fencode_time): Use it, to test for out-of-range times.
+ (lisp_time_argument): Don't rely on undefined left-shift and
+ right-shift behavior when checking for time stamp overflow.
+
+ * editfns.c (time_overflow): New function, refactoring common code.
+ (Fformat_time_string, Fdecode_time, Fencode_time):
+ (Fcurrent_time_string): Use it.
+
+ Move 'make_time' to be next to its inverse 'lisp_time_argument'.
+ * dired.c (make_time): Move to ...
+ * editfns.c (make_time): ... here.
+ * systime.h: Note the move.
+
+2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * fringe.c (update_window_fringes): Remove unused variables.
+
+ * unexmacosx.c (copy_data_segment): Also copy __got section.
+ (Bug#8223)
+
+2011-03-12 Eli Zaretskii <eliz@gnu.org>
+
+ * termcap.c [MSDOS]: Include "msdos.h".
+ (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
+ Constify `char *' arguments and their references according to
+ prototypes in tparam.h.
+
+ * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
+
+ * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
+ Adapt all references accordingly.
+
+ * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
+
+2011-03-11 Tom Tromey <tromey@redhat.com>
+
+ * buffer.c (syms_of_buffer): Remove obsolete comment.
+
+2011-03-11 Eli Zaretskii <eliz@gnu.org>
+
+ * termhooks.h (encode_terminal_code): Declare prototype.
+
+ * msdos.c (encode_terminal_code): Don't declare prototype.
+
+ * term.c (encode_terminal_code): Now external again, used by
+ w32console.c and msdos.c.
+
+ * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)): Depend
+ on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
+
+2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix some minor problems found by GCC 4.5.2's static checks.
+
+ * fringe.c (update_window_fringes): Mark locals as initialized
+ (Bug#8227).
+ (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
+
+ * alloc.c (mark_fringe_data): Move decl from here ...
+ * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
+ to check its interface.
+ (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
+
+ * fontset.c (free_realized_fontset): Now static.
+ (Fset_fontset_font): Rename local to avoid shadowing.
+ (fontset_font): Mark local as initialized.
+ (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
+
+ * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
+
+ * xselect.c (x_disown_buffer_selections): Remove; not used.
+ (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
+ (x_own_selection, Fx_disown_selection_internal): Rename locals
+ to avoid shadowing.
+ (x_handle_dnd_message): Remove local to avoid shadowing.
+
+ * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
+ so that the caller can use some name other than gcpro1.
+ (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
+ * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
+ (Fx_backspace_delete_keys_p):
+ Use them to avoid shadowing, and rename vars to avoid shadowing.
+ (x_decode_color, x_set_name, x_window): Now static.
+ (Fx_create_frame): Add braces to silence GCC warning.
+ (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
+ (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
+ Remove unused locals.
+ (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
+ (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
+ Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
+ macros.
+
+ * xterm.h (x_mouse_leave): New decl.
+
+ * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
+ Remove unused functions.
+ (x_shift_glyphs_for_insert, XTflash, XTring_bell):
+ (x_calc_absolute_position): Now static.
+ (XTread_socket): Don't define label "out" unless it's used.
+ Don't declare local "event" unless it's used.
+ (x_iconify_frame, x_free_frame_resources): Don't declare locals
+ unless they are used.
+ (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
+ (x_fatal_error_signal): Remove; not used.
+ (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
+ (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
+ (x_error_catcher, x_connection_closed, x_error_handler):
+ (x_error_quitter, xembed_send_message, x_iconify_frame):
+ (my_log_handler): Rename locals to avoid shadowing.
+ (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
+ (x_connection_closed): Tell GCC not to suggest NO_RETURN.
+
+ * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font): Rename
+ or move locals to avoid shadowing.
+ (tty_defined_color, merge_face_heights): Now static.
+ (free_realized_faces_for_fontset): Remove; not used.
+ (Fx_list_fonts): Mark variable that gcc -Wuninitialized
+ does not deduce is never used uninitialized.
+ (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
+ (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
+
+ * terminal.c (store_terminal_param): Now static.
+
+ * xmenu.c (menu_highlight_callback): Now static.
+ (set_frame_menubar): Remove unused local.
+ (xmenu_show): Rename parameter to avoid shadowing.
+ (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
+ since they might point to immutable storage.
+ (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
+ since it's unused otherwise.
+
+ * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
+ Add a FIXME, since the code still doesn't look right. (Bug#8215)
+ (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
+ avoids a gcc -Wuninitialized diagnostic.
+ (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
+ (note_mouse_highlight): Mark variables that gcc -Wuninitialized
+ does not deduce are never used uninitialized.
+
+ * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
+
+ * xdisp.c (redisplay_window): Rename local to avoid shadowing.
+ * window.c (window_loop, size_window):
+ (run_window_configuration_change_hook, enlarge_window): Likewise.
+
+ * window.c (display_buffer): Now static.
+ (size_window): Mark variables that gcc -Wuninitialized
+ does not deduce are never used uninitialized.
+ * window.h (check_all_windows): New decl, to forestall
+ gcc -Wmissing-prototypes diagnostic.
+ * dispextern.h (bidi_dump_cached_states): Likewise.
+
+ * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
+ shadowing.
+ * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
+ Include <limits.h>.
+ (Fsort_charsets): Redo min/max calculation to shorten the code a bit
+ and to avoid gcc -Wuninitialized warning.
+ (load_charset_map): Mark variables that gcc -Wuninitialized
+ does not deduce are never used uninitialized.
+ (load_charset): Abort instead of using uninitialized var (Bug#8229).
+
+ * coding.c (coding_set_source, coding_set_destination):
+ Use "else { /* comment */ }" rather than "else /* comment */;"
+ for clarity, and to avoid gcc -Wempty-body warning.
+ (Fdefine_coding_system_internal): Don't redeclare 'i' inside
+ a block, when the outer 'i' will do.
+ (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
+ (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
+ (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
+ (decode_coding_raw_text, decode_coding_charset, get_translation_table):
+ (Fdecode_sjis_char, Fdefine_coding_system_internal):
+ Rename locals to avoid shadowing.
+ * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
+ * coding.c (emacs_mule_char, encode_invocation_designation):
+ Now static, since they're not used elsewhere.
+ (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
+ (decode_coding_object, encode_coding_object, detect_coding_system):
+ (decode_coding_emacs_mule): Mark variables that gcc
+ -Wuninitialized does not deduce are never used uninitialized.
+ (detect_coding_iso_2022): Initialize a local variable that might
+ be used uninitialized. Leave a FIXME because it's not clear that
+ this initialization is needed. (Bug#8211)
+ (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
+ (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
+ (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
+ (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
+ Remove unused macros.
+
+ * category.c (hash_get_category_set): Remove unused local var.
+ (copy_category_table): Now static, since it's not used elsewhere.
+ * character.c (string_count_byte8): Likewise.
+
+ * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
+ (Fregister_code_conversion_map): Rename locals to avoid shadowing.
+
+ * chartab.c (copy_sub_char_table): Now static, since it's not used
+ elsewhere.
+ (sub_char_table_ref_and_range, char_table_ref_and_range):
+ Rename locals to avoid shadowing.
+ (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
+
+ * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
+ (BIDI_BOB): Remove unused macro.
+
+ * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
+ deduce are never used uninitialized.
+ * term.c (encode_terminal_code): Likewise.
+
+ * term.c (encode_terminal_code): Now static. Remove unused local.
+
+ * tparam.h: New file.
+ * term.c, tparam.h: Include it.
+ * deps.mk (term.o, tparam.o): Depend on tparam.h.
+ * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
+ Move these decls to tparam.h, and make them agree with what
+ is actually in tparam.c. The previous trick of using incompatible
+ decls in different modules does not conform to the C standard.
+ All callers of tparam changed to use tparam's actual API.
+ * tparam.c (tparam1, tparam, tgoto):
+ Use const pointers where appropriate.
+
+ * cm.c (calccost, cmgoto): Use const pointers where appropriate.
+ * cm.h (struct cm): Likewise.
+ * dispextern.h (do_line_insertion_deletion_costs): Likewise.
+ * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
+ * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
+ (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
+ (turn_on_face, init_tty): Likewise.
+ * termchar.h (struct tty_display_info): Likewise.
+
+ * term.c (term_mouse_position): Rename local to avoid shadowing.
+
+ * alloc.c (mark_ttys): Move decl from here ...
+ * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
+
+2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
+
+2011-03-09 Juanma Barranquero <lekktu@gmail.com>
+
+ * search.c (compile_pattern_1): Remove argument regp, unused since
+ revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
+ (compile_pattern): Don't pass it.
+
+2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.h (DEFAULT_GDK_DISPLAY): New define.
+ (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
+ for ! HAVE_GTK3.
+ (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
+
+ * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
+
+ * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
+ gdk_window_get_screen, gdk_window_get_geometry,
+ gdk_x11_window_lookup_for_display and GDK_KEY_g.
+ (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
+ (xg_get_pixbuf_from_pixmap): New function.
+ (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
+ to Pixmap, take frame as parameter, remove GdkColormap parameter.
+ Call xg_get_pixbuf_from_pixmap instead of
+ gdk_pixbuf_get_from_drawable.
+ (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
+ xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
+ (xg_check_special_colors): Use GtkStyleContext and its functions
+ for HAVE_GTK3.
+ (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
+ (xg_prepare_tooltip, create_dialog, menubar_map_cb)
+ (xg_update_frame_menubar, xg_tool_bar_detach_callback)
+ (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes): Call
+ gtk_widget_get_preferred_size.
+ (xg_frame_resized): gdk_window_get_geometry only takes 5
+ parameters.
+ (xg_win_to_widget, xg_event_is_for_menubar): Call
+ gdk_x11_window_lookup_for_display.
+ (xg_set_widget_bg): New function.
+ (delete_cb): New function.
+ (xg_create_frame_widgets): connect delete-event to delete_cb.
+ Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
+ (xg_set_background_color): Call xg_set_widget_bg.
+ (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
+ (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
+ Only call gtk_range_set_update_policy if ! HAVE_GTK3.
+ (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
+ if ! HAVE_GTK3.
+ (update_frame_tool_bar): Call gtk_widget_hide.
+ (xg_initialize): Use GDK_KEY_g.
+
+ * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
+ if ! HAVE_GTK3
+ (x_session_initialize): Call gdk_x11_set_sm_client_id.
+
+ * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
+ (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
+ Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
+
+2011-03-08 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32xfns.c (select_palette): Check success of RealizePalette against
+ GDI_ERROR, not zero.
+
+2011-03-07 Ben Key <bkey76@gmail.com>
+
+ * w32fns.c (FILE_NAME_COMBO_BOX, FILE_NAME_LIST): Define.
+ (file_dialog_callback): Fix locating the window handle of the File Name
+ text field. After disabling it, set focus on the list control.
+ (Fx_file_dialog): If only_dir_p is non-nil, set the text of the File
+ Name text field to "Current Directory" if it does not already have
+ another value. (Bug#8181)
+
+2011-03-07 Adrian Robert <Adrian.B.Robert@gmail.com>
+
+ * nsterm.m (ns_draw_window_cursor): Fix handling of "cursor_width"
+ parameter for hbar cursors. Based on a patch by Ben Key
+ <bkey76@gmail.com>.
+
+2011-03-06 Chong Yidong <cyd@stupidchicken.com>
+
+ * xdisp.c (redisplay_window): Revert incorrect logic in 2011-03-06
+ change.
+
2011-03-06 Paul Eggert <eggert@cs.ucla.edu>
current_column: Now returns EMACS_INT, fixing some iftc
@@ -46,7 +839,7 @@
* xdisp.c (BUILD_GLYPHLESS_GLYPH_STRING): Omit unused local var.
(produce_glyphless_glyph): Make a pointer "const"
since it might point to immutable storage.
- (update_window_cursor): Now static, since it's not used elsewhere.
+ (update_window_cursor): Now static, since it's not used elsewhere.
(SKIP_GLYPHS): Removed unused macro.
2011-03-06 Michael Shields <shields@msrl.com> (tiny change)
@@ -132,7 +925,7 @@
as per recent filemodestring API change. Reported by Jonas Öster in
<http://lists.gnu.org/archive/html/emacs-devel/2011-02/msg01069.html>.
-2011-02-23 Ben Key <bkey76@gmail.com> (tiny change)
+2011-02-23 Ben Key <bkey76@gmail.com>
* nsterm.m (ns_draw_window_cursor): Obey the cursor_width argument
directly, for bar cursors.
diff --git a/src/alloc.c b/src/alloc.c
index c7fd8747f7..0ca702fe0c 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -92,7 +92,8 @@ extern __malloc_size_t __malloc_extra_blocks;
#endif /* not DOUG_LEA_MALLOC */
-#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
+#if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT
+#ifdef HAVE_GTK_AND_PTHREAD
/* When GTK uses the file chooser dialog, different backends can be loaded
dynamically. One such a backend is the Gnome VFS backend that gets loaded
@@ -130,12 +131,13 @@ static pthread_mutex_t alloc_mutex;
} \
while (0)
-#else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */
+#else /* ! defined HAVE_GTK_AND_PTHREAD */
#define BLOCK_INPUT_ALLOC BLOCK_INPUT
#define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT
-#endif /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */
+#endif /* ! defined HAVE_GTK_AND_PTHREAD */
+#endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */
/* Value of _bytes_used, when spare_memory was freed. */
@@ -152,13 +154,11 @@ static __malloc_size_t bytes_used_when_full;
#define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG)
#define VECTOR_MARKED_P(V) (((V)->size & ARRAY_MARK_FLAG) != 0)
-/* Value is the number of bytes/chars of S, a pointer to a struct
- Lisp_String. This must be used instead of STRING_BYTES (S) or
- S->size during GC, because S->size contains the mark bit for
+/* Value is the number of bytes of S, a pointer to a struct Lisp_String.
+ Be careful during GC, because S->size contains the mark bit for
strings. */
#define GC_STRING_BYTES(S) (STRING_BYTES (S))
-#define GC_STRING_CHARS(S) ((S)->size & ~ARRAY_MARK_FLAG)
/* Global variables. */
struct emacs_globals globals;
@@ -270,17 +270,10 @@ Lisp_Object Qpost_gc_hook;
static void mark_buffer (Lisp_Object);
static void mark_terminals (void);
-extern void mark_kboards (void);
-extern void mark_ttys (void);
-extern void mark_backtrace (void);
static void gc_sweep (void);
static void mark_glyph_matrix (struct glyph_matrix *);
static void mark_face_cache (struct face_cache *);
-#ifdef HAVE_WINDOW_SYSTEM
-extern void mark_fringe_data (void);
-#endif /* HAVE_WINDOW_SYSTEM */
-
static struct Lisp_String *allocate_string (void);
static void compact_small_strings (void);
static void free_large_strings (void);
@@ -2659,17 +2652,17 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
return val;
}
+#ifdef GC_CHECK_CONS_LIST
/* Get an error now if there's any junk in the cons free list. */
void
check_cons_list (void)
{
-#ifdef GC_CHECK_CONS_LIST
struct Lisp_Cons *tail = cons_free_list;
while (tail)
tail = tail->u.chain;
-#endif
}
+#endif
/* Make a list of 1, 2, 3, 4 or 5 specified objects. */
@@ -2909,15 +2902,15 @@ See also the function `vector'. */)
{
Lisp_Object vector;
register EMACS_INT sizei;
- register EMACS_INT index;
+ register EMACS_INT i;
register struct Lisp_Vector *p;
CHECK_NATNUM (length);
sizei = XFASTINT (length);
p = allocate_vector (sizei);
- for (index = 0; index < sizei; index++)
- p->contents[index] = init;
+ for (i = 0; i < sizei; i++)
+ p->contents[i] = init;
XSETVECTOR (vector, p);
return vector;
@@ -2931,14 +2924,14 @@ usage: (vector &rest OBJECTS) */)
(register int nargs, Lisp_Object *args)
{
register Lisp_Object len, val;
- register int index;
+ register int i;
register struct Lisp_Vector *p;
XSETFASTINT (len, nargs);
val = Fmake_vector (len, Qnil);
p = XVECTOR (val);
- for (index = 0; index < nargs; index++)
- p->contents[index] = args[index];
+ for (i = 0; i < nargs; i++)
+ p->contents[i] = args[i];
return val;
}
@@ -2962,7 +2955,7 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
(register int nargs, Lisp_Object *args)
{
register Lisp_Object len, val;
- register int index;
+ register int i;
register struct Lisp_Vector *p;
XSETFASTINT (len, nargs);
@@ -2980,11 +2973,11 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
args[1] = Fstring_as_unibyte (args[1]);
p = XVECTOR (val);
- for (index = 0; index < nargs; index++)
+ for (i = 0; i < nargs; i++)
{
if (!NILP (Vpurify_flag))
- args[index] = Fpurecopy (args[index]);
- p->contents[index] = args[index];
+ args[i] = Fpurecopy (args[i]);
+ p->contents[i] = args[i];
}
XSETPVECTYPE (p, PVEC_COMPILED);
XSETCOMPILED (val, p);
@@ -4328,12 +4321,6 @@ static void
mark_stack (void)
{
int i;
- /* jmp_buf may not be aligned enough on darwin-ppc64 */
- union aligned_jmpbuf {
- Lisp_Object o;
- jmp_buf j;
- } j;
- volatile int stack_grows_down_p = (char *) &j > (char *) stack_base;
void *end;
#ifdef HAVE___BUILTIN_UNWIND_INIT
@@ -4343,6 +4330,14 @@ mark_stack (void)
__builtin_unwind_init ();
end = &end;
#else /* not HAVE___BUILTIN_UNWIND_INIT */
+#ifndef GC_SAVE_REGISTERS_ON_STACK
+ /* jmp_buf may not be aligned enough on darwin-ppc64 */
+ union aligned_jmpbuf {
+ Lisp_Object o;
+ jmp_buf j;
+ } j;
+ volatile int stack_grows_down_p = (char *) &j > (char *) stack_base;
+#endif
/* This trick flushes the register windows so that all the state of
the process is contained in the stack. */
/* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is
@@ -5079,18 +5074,18 @@ returns nil, because real GC can't be done. */)
if (FLOATP (Vgc_cons_percentage))
{ /* Set gc_cons_combined_threshold. */
- EMACS_INT total = 0;
-
- total += total_conses * sizeof (struct Lisp_Cons);
- total += total_symbols * sizeof (struct Lisp_Symbol);
- total += total_markers * sizeof (union Lisp_Misc);
- total += total_string_size;
- total += total_vector_size * sizeof (Lisp_Object);
- total += total_floats * sizeof (struct Lisp_Float);
- total += total_intervals * sizeof (struct interval);
- total += total_strings * sizeof (struct Lisp_String);
-
- gc_relative_threshold = total * XFLOAT_DATA (Vgc_cons_percentage);
+ EMACS_INT tot = 0;
+
+ tot += total_conses * sizeof (struct Lisp_Cons);
+ tot += total_symbols * sizeof (struct Lisp_Symbol);
+ tot += total_markers * sizeof (union Lisp_Misc);
+ tot += total_string_size;
+ tot += total_vector_size * sizeof (Lisp_Object);
+ tot += total_floats * sizeof (struct Lisp_Float);
+ tot += total_intervals * sizeof (struct interval);
+ tot += total_strings * sizeof (struct Lisp_String);
+
+ gc_relative_threshold = tot * XFLOAT_DATA (Vgc_cons_percentage);
}
else
gc_relative_threshold = 0;
@@ -5139,9 +5134,9 @@ returns nil, because real GC can't be done. */)
if (!NILP (Vpost_gc_hook))
{
- int count = inhibit_garbage_collection ();
+ int gc_count = inhibit_garbage_collection ();
safe_run_hooks (Qpost_gc_hook);
- unbind_to (count, Qnil);
+ unbind_to (gc_count, Qnil);
}
/* Accumulate statistics. */
@@ -5320,7 +5315,6 @@ mark_object (Lisp_Object arg)
#else /* not GC_CHECK_MARKED_OBJECTS */
-#define CHECK_ALLOCATED() (void) 0
#define CHECK_LIVE(LIVEP) (void) 0
#define CHECK_ALLOCATED_AND_LIVE(LIVEP) (void) 0
@@ -6072,7 +6066,7 @@ We divide the value by 1024 to make sure it fits in a Lisp integer. */)
{
Lisp_Object end;
- XSETINT (end, (EMACS_INT) sbrk (0) / 1024);
+ XSETINT (end, (EMACS_INT) (char *) sbrk (0) / 1024);
return end;
}
diff --git a/src/bidi.c b/src/bidi.c
index eeacf65bd5..3457e17743 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -72,7 +72,6 @@ static Lisp_Object bidi_type_table, bidi_mirror_table;
#define RLO_CHAR 0x202E
#define BIDI_EOB -1
-#define BIDI_BOB -2 /* FIXME: Is this needed? */
/* Local data structures. (Look in dispextern.h for the rest.) */
@@ -180,7 +179,7 @@ bidi_get_type (int ch, bidi_dir_t override)
}
}
-void
+static void
bidi_check_type (bidi_type_t type)
{
if (type < UNKNOWN_BT || type > NEUTRAL_ON)
diff --git a/src/buffer.c b/src/buffer.c
index 1b413ccb8b..d301e7f14f 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -330,15 +330,17 @@ even if it is dead. The return value is never nil. */)
if (! BUF_BEG_ADDR (b))
buffer_memory_full ();
- BUF_PT (b) = BEG;
+ b->pt = BEG;
+ b->begv = BEG;
+ b->zv = BEG;
+ b->pt_byte = BEG_BYTE;
+ b->begv_byte = BEG_BYTE;
+ b->zv_byte = BEG_BYTE;
+
BUF_GPT (b) = BEG;
- BUF_BEGV (b) = BEG;
- BUF_ZV (b) = BEG;
- BUF_Z (b) = BEG;
- BUF_PT_BYTE (b) = BEG_BYTE;
BUF_GPT_BYTE (b) = BEG_BYTE;
- BUF_BEGV_BYTE (b) = BEG_BYTE;
- BUF_ZV_BYTE (b) = BEG_BYTE;
+
+ BUF_Z (b) = BEG;
BUF_Z_BYTE (b) = BEG_BYTE;
BUF_MODIFF (b) = 1;
BUF_CHARS_MODIFF (b) = 1;
@@ -489,6 +491,53 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
BVAR (to, local_var_alist) = buffer_lisp_local_variables (from);
}
+
+/* If buffer B has markers to record PT, BEGV and ZV when it is not
+ current, update these markers. */
+
+static void
+record_buffer_markers (struct buffer *b)
+{
+ if (! NILP (BVAR (b, pt_marker)))
+ {
+ Lisp_Object buffer;
+
+ eassert (!NILP (BVAR (b, begv_marker)));
+ eassert (!NILP (BVAR (b, zv_marker)));
+
+ XSETBUFFER (buffer, b);
+ set_marker_both (BVAR (b, pt_marker), buffer, b->pt, b->pt_byte);
+ set_marker_both (BVAR (b, begv_marker), buffer, b->begv, b->begv_byte);
+ set_marker_both (BVAR (b, zv_marker), buffer, b->zv, b->zv_byte);
+ }
+}
+
+
+/* If buffer B has markers to record PT, BEGV and ZV when it is not
+ current, fetch these values into B->begv etc. */
+
+static void
+fetch_buffer_markers (struct buffer *b)
+{
+ if (! NILP (BVAR (b, pt_marker)))
+ {
+ Lisp_Object m;
+
+ eassert (!NILP (BVAR (b, begv_marker)));
+ eassert (!NILP (BVAR (b, zv_marker)));
+
+ m = BVAR (b, pt_marker);
+ SET_BUF_PT_BOTH (b, marker_position (m), marker_byte_position (m));
+
+ m = BVAR (b, begv_marker);
+ SET_BUF_BEGV_BOTH (b, marker_position (m), marker_byte_position (m));
+
+ m = BVAR (b, zv_marker);
+ SET_BUF_ZV_BOTH (b, marker_position (m), marker_byte_position (m));
+ }
+}
+
+
DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
2, 3,
"bMake indirect buffer (to buffer): \nBName of indirect buffer: ",
@@ -527,12 +576,12 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
/* Use the base buffer's text object. */
b->text = b->base_buffer->text;
- BUF_BEGV (b) = BUF_BEGV (b->base_buffer);
- BUF_ZV (b) = BUF_ZV (b->base_buffer);
- BUF_PT (b) = BUF_PT (b->base_buffer);
- BUF_BEGV_BYTE (b) = BUF_BEGV_BYTE (b->base_buffer);
- BUF_ZV_BYTE (b) = BUF_ZV_BYTE (b->base_buffer);
- BUF_PT_BYTE (b) = BUF_PT_BYTE (b->base_buffer);
+ b->pt = b->base_buffer->pt;
+ b->begv = b->base_buffer->begv;
+ b->zv = b->base_buffer->zv;
+ b->pt_byte = b->base_buffer->pt_byte;
+ b->begv_byte = b->base_buffer->begv_byte;
+ b->zv_byte = b->base_buffer->zv_byte;
b->newline_cache = 0;
b->width_run_cache = 0;
@@ -562,24 +611,23 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
/* Make sure the base buffer has markers for its narrowing. */
if (NILP (BVAR (b->base_buffer, pt_marker)))
{
+ eassert (NILP (BVAR (b->base_buffer, begv_marker)));
+ eassert (NILP (BVAR (b->base_buffer, zv_marker)));
+
BVAR (b->base_buffer, pt_marker) = Fmake_marker ();
set_marker_both (BVAR (b->base_buffer, pt_marker), base_buffer,
- BUF_PT (b->base_buffer),
- BUF_PT_BYTE (b->base_buffer));
- }
- if (NILP (BVAR (b->base_buffer, begv_marker)))
- {
+ b->base_buffer->pt,
+ b->base_buffer->pt_byte);
+
BVAR (b->base_buffer, begv_marker) = Fmake_marker ();
set_marker_both (BVAR (b->base_buffer, begv_marker), base_buffer,
- BUF_BEGV (b->base_buffer),
- BUF_BEGV_BYTE (b->base_buffer));
- }
- if (NILP (BVAR (b->base_buffer, zv_marker)))
- {
+ b->base_buffer->begv,
+ b->base_buffer->begv_byte);
+
BVAR (b->base_buffer, zv_marker) = Fmake_marker ();
set_marker_both (BVAR (b->base_buffer, zv_marker), base_buffer,
- BUF_ZV (b->base_buffer),
- BUF_ZV_BYTE (b->base_buffer));
+ b->base_buffer->zv,
+ b->base_buffer->zv_byte);
XMARKER (BVAR (b->base_buffer, zv_marker))->insertion_type = 1;
}
@@ -587,11 +635,11 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
{
/* Give the indirect buffer markers for its narrowing. */
BVAR (b, pt_marker) = Fmake_marker ();
- set_marker_both (BVAR (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b));
+ set_marker_both (BVAR (b, pt_marker), buf, b->pt, b->pt_byte);
BVAR (b, begv_marker) = Fmake_marker ();
- set_marker_both (BVAR (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b));
+ set_marker_both (BVAR (b, begv_marker), buf, b->begv, b->begv_byte);
BVAR (b, zv_marker) = Fmake_marker ();
- set_marker_both (BVAR (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b));
+ set_marker_both (BVAR (b, zv_marker), buf, b->zv, b->zv_byte);
XMARKER (BVAR (b, zv_marker))->insertion_type = 1;
}
else
@@ -1416,9 +1464,9 @@ with SIGHUP. */)
don't re-kill them. */
if (other->base_buffer == b && !NILP (BVAR (other, name)))
{
- Lisp_Object buffer;
- XSETBUFFER (buffer, other);
- Fkill_buffer (buffer);
+ Lisp_Object buf;
+ XSETBUFFER (buf, other);
+ Fkill_buffer (buf);
}
UNGCPRO;
@@ -1479,9 +1527,9 @@ with SIGHUP. */)
&& BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)
&& NILP (Fsymbol_value (intern ("auto-save-visited-file-name"))))
{
- Lisp_Object tem;
- tem = Fsymbol_value (intern ("delete-auto-save-files"));
- if (! NILP (tem))
+ Lisp_Object delete;
+ delete = Fsymbol_value (intern ("delete-auto-save-files"));
+ if (! NILP (delete))
internal_delete_file (BVAR (b, auto_save_file_name));
}
@@ -1553,19 +1601,19 @@ with SIGHUP. */)
void
record_buffer (Lisp_Object buf)
{
- register Lisp_Object link, prev;
+ register Lisp_Object list, prev;
Lisp_Object frame;
frame = selected_frame;
prev = Qnil;
- for (link = Vbuffer_alist; CONSP (link); link = XCDR (link))
+ for (list = Vbuffer_alist; CONSP (list); list = XCDR (list))
{
- if (EQ (XCDR (XCAR (link)), buf))
+ if (EQ (XCDR (XCAR (list)), buf))
break;
- prev = link;
+ prev = list;
}
- /* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist);
+ /* Effectively do Vbuffer_alist = Fdelq (list, Vbuffer_alist);
we cannot use Fdelq itself here because it allows quitting. */
if (NILP (prev))
@@ -1573,40 +1621,40 @@ record_buffer (Lisp_Object buf)
else
XSETCDR (prev, XCDR (XCDR (prev)));
- XSETCDR (link, Vbuffer_alist);
- Vbuffer_alist = link;
+ XSETCDR (list, Vbuffer_alist);
+ Vbuffer_alist = list;
/* Effectively do a delq on buried_buffer_list. */
prev = Qnil;
- for (link = XFRAME (frame)->buried_buffer_list; CONSP (link);
- link = XCDR (link))
+ for (list = XFRAME (frame)->buried_buffer_list; CONSP (list);
+ list = XCDR (list))
{
- if (EQ (XCAR (link), buf))
+ if (EQ (XCAR (list), buf))
{
if (NILP (prev))
- XFRAME (frame)->buried_buffer_list = XCDR (link);
+ XFRAME (frame)->buried_buffer_list = XCDR (list);
else
XSETCDR (prev, XCDR (XCDR (prev)));
break;
}
- prev = link;
+ prev = list;
}
/* Now move this buffer to the front of frame_buffer_list also. */
prev = Qnil;
- for (link = frame_buffer_list (frame); CONSP (link);
- link = XCDR (link))
+ for (list = frame_buffer_list (frame); CONSP (list);
+ list = XCDR (list))
{
- if (EQ (XCAR (link), buf))
+ if (EQ (XCAR (list), buf))
break;
- prev = link;
+ prev = list;
}
/* Effectively do delq. */
- if (CONSP (link))
+ if (CONSP (list))
{
if (NILP (prev))
set_frame_buffer_list (frame,
@@ -1614,8 +1662,8 @@ record_buffer (Lisp_Object buf)
else
XSETCDR (prev, XCDR (XCDR (prev)));
- XSETCDR (link, frame_buffer_list (frame));
- set_frame_buffer_list (frame, link);
+ XSETCDR (list, frame_buffer_list (frame));
+ set_frame_buffer_list (frame, list);
}
else
set_frame_buffer_list (frame, Fcons (buf, frame_buffer_list (frame)));
@@ -1664,7 +1712,7 @@ the current buffer's major mode. */)
/* Switch to buffer BUFFER in the selected window.
If NORECORD is non-nil, don't call record_buffer. */
-Lisp_Object
+static Lisp_Object
switch_to_buffer_1 (Lisp_Object buffer_or_name, Lisp_Object norecord)
{
register Lisp_Object buffer;
@@ -1796,27 +1844,7 @@ set_buffer_internal_1 (register struct buffer *b)
/* If the old current buffer has markers to record PT, BEGV and ZV
when it is not current, update them now. */
- if (! NILP (BVAR (old_buf, pt_marker)))
- {
- Lisp_Object obuf;
- XSETBUFFER (obuf, old_buf);
- set_marker_both (BVAR (old_buf, pt_marker), obuf,
- BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
- }
- if (! NILP (BVAR (old_buf, begv_marker)))
- {
- Lisp_Object obuf;
- XSETBUFFER (obuf, old_buf);
- set_marker_both (BVAR (old_buf, begv_marker), obuf,
- BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
- }
- if (! NILP (BVAR (old_buf, zv_marker)))
- {
- Lisp_Object obuf;
- XSETBUFFER (obuf, old_buf);
- set_marker_both (BVAR (old_buf, zv_marker), obuf,
- BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
- }
+ record_buffer_markers (old_buf);
}
/* Get the undo list from the base buffer, so that it appears
@@ -1826,21 +1854,7 @@ set_buffer_internal_1 (register struct buffer *b)
/* If the new current buffer has markers to record PT, BEGV and ZV
when it is not current, fetch them now. */
- if (! NILP (BVAR (b, pt_marker)))
- {
- BUF_PT (b) = marker_position (BVAR (b, pt_marker));
- BUF_PT_BYTE (b) = marker_byte_position (BVAR (b, pt_marker));
- }
- if (! NILP (BVAR (b, begv_marker)))
- {
- BUF_BEGV (b) = marker_position (BVAR (b, begv_marker));
- BUF_BEGV_BYTE (b) = marker_byte_position (BVAR (b, begv_marker));
- }
- if (! NILP (BVAR (b, zv_marker)))
- {
- BUF_ZV (b) = marker_position (BVAR (b, zv_marker));
- BUF_ZV_BYTE (b) = marker_byte_position (BVAR (b, zv_marker));
- }
+ fetch_buffer_markers (b);
/* Look down buffer's list of local Lisp variables
to find and update any that forward into C variables. */
@@ -1876,50 +1890,13 @@ set_buffer_temp (struct buffer *b)
old_buf = current_buffer;
current_buffer = b;
- if (old_buf)
- {
- /* If the old current buffer has markers to record PT, BEGV and ZV
- when it is not current, update them now. */
- if (! NILP (BVAR (old_buf, pt_marker)))
- {
- Lisp_Object obuf;
- XSETBUFFER (obuf, old_buf);
- set_marker_both (BVAR (old_buf, pt_marker), obuf,
- BUF_PT (old_buf), BUF_PT_BYTE (old_buf));
- }
- if (! NILP (BVAR (old_buf, begv_marker)))
- {
- Lisp_Object obuf;
- XSETBUFFER (obuf, old_buf);
- set_marker_both (BVAR (old_buf, begv_marker), obuf,
- BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf));
- }
- if (! NILP (BVAR (old_buf, zv_marker)))
- {
- Lisp_Object obuf;
- XSETBUFFER (obuf, old_buf);
- set_marker_both (BVAR (old_buf, zv_marker), obuf,
- BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf));
- }
- }
+ /* If the old current buffer has markers to record PT, BEGV and ZV
+ when it is not current, update them now. */
+ record_buffer_markers (old_buf);
/* If the new current buffer has markers to record PT, BEGV and ZV
when it is not current, fetch them now. */
- if (! NILP (BVAR (b, pt_marker)))
- {
- BUF_PT (b) = marker_position (BVAR (b, pt_marker));
- BUF_PT_BYTE (b) = marker_byte_position (BVAR (b, pt_marker));
- }
- if (! NILP (BVAR (b, begv_marker)))
- {
- BUF_BEGV (b) = marker_position (BVAR (b, begv_marker));
- BUF_BEGV_BYTE (b) = marker_byte_position (BVAR (b, begv_marker));
- }
- if (! NILP (BVAR (b, zv_marker)))
- {
- BUF_ZV (b) = marker_position (BVAR (b, zv_marker));
- BUF_ZV_BYTE (b) = marker_byte_position (BVAR (b, zv_marker));
- }
+ fetch_buffer_markers (b);
}
DEFUN ("set-buffer", Fset_buffer, Sset_buffer, 1, 1, 0,
@@ -2007,13 +1984,13 @@ its frame, iconify that frame. */)
buffer is killed. */
if (!NILP (BVAR (XBUFFER (buffer), name)))
{
- Lisp_Object aelt, link;
+ Lisp_Object aelt, list;
aelt = Frassq (buffer, Vbuffer_alist);
- link = Fmemq (aelt, Vbuffer_alist);
+ list = Fmemq (aelt, Vbuffer_alist);
Vbuffer_alist = Fdelq (aelt, Vbuffer_alist);
- XSETCDR (link, Qnil);
- Vbuffer_alist = nconc2 (Vbuffer_alist, link);
+ XSETCDR (list, Qnil);
+ Vbuffer_alist = nconc2 (Vbuffer_alist, list);
XFRAME (selected_frame)->buffer_list
= Fdelq (buffer, XFRAME (selected_frame)->buffer_list);
@@ -2358,12 +2335,12 @@ current buffer is cleared. */)
&& GPT_BYTE > 1 && GPT_BYTE < Z_BYTE
&& ! CHAR_HEAD_P (*(GAP_END_ADDR)))
{
- unsigned char *p = GPT_ADDR - 1;
+ unsigned char *q = GPT_ADDR - 1;
- while (! CHAR_HEAD_P (*p) && p > BEG_ADDR) p--;
- if (LEADING_CODE_P (*p))
+ while (! CHAR_HEAD_P (*q) && q > BEG_ADDR) q--;
+ if (LEADING_CODE_P (*q))
{
- EMACS_INT new_gpt = GPT_BYTE - (GPT_ADDR - p);
+ EMACS_INT new_gpt = GPT_BYTE - (GPT_ADDR - q);
move_gap_both (new_gpt, new_gpt);
}
@@ -2447,14 +2424,14 @@ current buffer is cleared. */)
ZV = chars_in_text (BEG_ADDR, ZV_BYTE - BEG_BYTE) + BEG;
{
- EMACS_INT pt_byte = advance_to_char_boundary (PT_BYTE);
- EMACS_INT pt;
+ EMACS_INT byte = advance_to_char_boundary (PT_BYTE);
+ EMACS_INT position;
- if (pt_byte > GPT_BYTE)
- pt = chars_in_text (GAP_END_ADDR, pt_byte - GPT_BYTE) + GPT;
+ if (byte > GPT_BYTE)
+ position = chars_in_text (GAP_END_ADDR, byte - GPT_BYTE) + GPT;
else
- pt = chars_in_text (BEG_ADDR, pt_byte - BEG_BYTE) + BEG;
- TEMP_SET_PT_BOTH (pt, pt_byte);
+ position = chars_in_text (BEG_ADDR, byte - BEG_BYTE) + BEG;
+ TEMP_SET_PT_BOTH (position, byte);
}
tail = markers = BUF_MARKERS (current_buffer);
@@ -3421,7 +3398,8 @@ void
fix_start_end_in_overlays (register EMACS_INT start, register EMACS_INT end)
{
Lisp_Object overlay;
- struct Lisp_Overlay *before_list, *after_list;
+ struct Lisp_Overlay *before_list IF_LINT (= NULL);
+ struct Lisp_Overlay *after_list IF_LINT (= NULL);
/* These are either nil, indicating that before_list or after_list
should be assigned, or the cons cell the cdr of which should be
assigned. */
@@ -3569,7 +3547,7 @@ fix_overlays_before (struct buffer *bp, EMACS_INT prev, EMACS_INT pos)
/* If parent is nil, replace overlays_before; otherwise, parent->next. */
struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair;
Lisp_Object tem;
- EMACS_INT end;
+ EMACS_INT end IF_LINT (= 0);
/* After the insertion, the several overlays may be in incorrect
order. The possibility is that, in the list `overlays_before',
@@ -4345,10 +4323,10 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, int after,
for (i = 0; i < size;)
{
- Lisp_Object prop, overlay;
- prop = copy[i++];
- overlay = copy[i++];
- call_overlay_mod_hooks (prop, overlay, after, arg1, arg2, arg3);
+ Lisp_Object prop_i, overlay_i;
+ prop_i = copy[i++];
+ overlay_i = copy[i++];
+ call_overlay_mod_hooks (prop_i, overlay_i, after, arg1, arg2, arg3);
}
}
UNGCPRO;
@@ -5333,9 +5311,6 @@ syms_of_buffer (void)
Fput (Qprotected_field, Qerror_message,
make_pure_c_string ("Attempt to modify a protected field"));
- /* All these use DEFVAR_LISP_NOPRO because the slots in
- buffer_defaults will all be marked via Vbuffer_defaults. */
-
DEFVAR_BUFFER_DEFAULTS ("default-mode-line-format",
mode_line_format,
doc: /* Default value of `mode-line-format' for buffers that don't override it.
diff --git a/src/buffer.h b/src/buffer.h
index 65c7168d60..d80875a081 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -107,27 +107,46 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BUF_BEG(buf) (BEG)
#define BUF_BEG_BYTE(buf) (BEG_BYTE)
-/* !!!FIXME: all the BUF_BEGV/BUF_ZV/BUF_PT macros are flawed:
- on indirect (or base) buffers, that value is only correct if that buffer
- is the current_buffer, or if the buffer's text hasn't been modified (via
- an indirect buffer) since it was last current. */
+/* The BUF_BEGV[_BYTE], BUF_ZV[_BYTE], and BUF_PT[_BYTE] macros cannot
+ be used for assignment; use SET_BUF_* macros below for that. */
/* Position of beginning of accessible range of buffer. */
-#define BUF_BEGV(buf) ((buf)->begv)
-#define BUF_BEGV_BYTE(buf) ((buf)->begv_byte)
+#define BUF_BEGV(buf) \
+ (buf == current_buffer ? BEGV \
+ : NILP (BVAR (buf, begv_marker)) ? buf->begv \
+ : marker_position (BVAR (buf, begv_marker)))
+
+#define BUF_BEGV_BYTE(buf) \
+ (buf == current_buffer ? BEGV_BYTE \
+ : NILP (BVAR (buf, begv_marker)) ? buf->begv_byte \
+ : marker_byte_position (BVAR (buf, begv_marker)))
/* Position of point in buffer. */
-#define BUF_PT(buf) ((buf)->pt)
-#define BUF_PT_BYTE(buf) ((buf)->pt_byte)
+#define BUF_PT(buf) \
+ (buf == current_buffer ? PT \
+ : NILP (BVAR (buf, pt_marker)) ? buf->pt \
+ : marker_position (BVAR (buf, pt_marker)))
+
+#define BUF_PT_BYTE(buf) \
+ (buf == current_buffer ? PT_BYTE \
+ : NILP (BVAR (buf, pt_marker)) ? buf->pt_byte \
+ : marker_byte_position (BVAR (buf, pt_marker)))
+
+/* Position of end of accessible range of buffer. */
+#define BUF_ZV(buf) \
+ (buf == current_buffer ? ZV \
+ : NILP (BVAR (buf, zv_marker)) ? buf->zv \
+ : marker_position (BVAR (buf, zv_marker)))
+
+#define BUF_ZV_BYTE(buf) \
+ (buf == current_buffer ? ZV_BYTE \
+ : NILP (BVAR (buf, zv_marker)) ? buf->zv_byte \
+ : marker_byte_position (BVAR (buf, zv_marker)))
/* Position of gap in buffer. */
#define BUF_GPT(buf) ((buf)->text->gpt)
#define BUF_GPT_BYTE(buf) ((buf)->text->gpt_byte)
-/* Position of end of accessible range of buffer. */
-#define BUF_ZV(buf) ((buf)->zv)
-#define BUF_ZV_BYTE(buf) ((buf)->zv_byte)
-
/* Position of end of buffer. */
#define BUF_Z(buf) ((buf)->text->z)
#define BUF_Z_BYTE(buf) ((buf)->text->z_byte)
@@ -235,8 +254,6 @@ extern void enlarge_buffer_text (struct buffer *, EMACS_INT);
/* Macros for setting the BEGV, ZV or PT of a given buffer.
- SET_BUF_PT* seet to be redundant. Get rid of them?
-
The ..._BOTH macros take both a charpos and a bytepos,
which must correspond to each other.
@@ -1009,4 +1026,31 @@ extern int last_per_buffer_idx;
#define PER_BUFFER_VALUE(BUFFER, OFFSET) \
(*(Lisp_Object *)((OFFSET) + (char *) (BUFFER)))
+
+/* Downcase a character C, or make no change if that cannot be done. */
+static inline int
+downcase (int c)
+{
+ Lisp_Object downcase_table = BVAR (current_buffer, downcase_table);
+ Lisp_Object down = CHAR_TABLE_REF (downcase_table, c);
+ return NATNUMP (down) ? XFASTINT (down) : c;
+}
+
+/* 1 if C is upper case. */
+static inline int uppercasep (int c) { return downcase (c) != c; }
+
+/* Upcase a character C known to be not upper case. */
+static inline int
+upcase1 (int c)
+{
+ Lisp_Object upcase_table = BVAR (current_buffer, upcase_table);
+ Lisp_Object up = CHAR_TABLE_REF (upcase_table, c);
+ return NATNUMP (up) ? XFASTINT (up) : c;
+}
+
+/* 1 if C is lower case. */
+static inline int lowercasep (int c)
+{ return !uppercasep (c) && upcase1 (c) != c; }
+/* Upcase a character C, or make no change if that cannot be done. */
+static inline int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
diff --git a/src/bytecode.c b/src/bytecode.c
index ba3c012bd1..d887668dd3 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -76,11 +76,7 @@ Lisp_Object Qbyte_code_meter;
} \
}
-#else /* no BYTE_CODE_METER */
-
-#define METER_CODE(last_code, this_code)
-
-#endif /* no BYTE_CODE_METER */
+#endif /* BYTE_CODE_METER */
Lisp_Object Qbytecode;
@@ -148,7 +144,9 @@ extern Lisp_Object Qand_optional, Qand_rest;
#define Bpreceding_char 0150
#define Bcurrent_column 0151
#define Bindent_to 0152
+#ifdef BYTE_CODE_SAFE
#define Bscan_buffer 0153 /* No longer generated as of v18 */
+#endif
#define Beolp 0154
#define Beobp 0155
#define Bbolp 0156
@@ -156,8 +154,12 @@ extern Lisp_Object Qand_optional, Qand_rest;
#define Bcurrent_buffer 0160
#define Bset_buffer 0161
#define Bsave_current_buffer_1 0162 /* Replacing Bsave_current_buffer. */
+#if 0
#define Bread_char 0162 /* No longer generated as of v19 */
+#endif
+#ifdef BYTE_CODE_SAFE
#define Bset_mark 0163 /* this loser is no longer generated as of v18 */
+#endif
#define Binteractive_p 0164 /* Obsolete. */
#define Bforward_char 0165
@@ -234,7 +236,6 @@ extern Lisp_Object Qand_optional, Qand_rest;
#define BdiscardN 0266
#define Bconstant 0300
-#define CONSTANTLIM 0100
/* Whether to maintain a `top' and `bottom' field in the stack frame. */
#define BYTE_MAINTAIN_TOP (BYTE_CODE_SAFE || BYTE_MARK_STACK)
@@ -370,6 +371,7 @@ unmark_byte_stack (void)
We do this at every branch, to avoid loops that never GC. */
#define MAYBE_GC() \
+ do { \
if (consing_since_gc > gc_cons_threshold \
&& consing_since_gc > gc_relative_threshold) \
{ \
@@ -377,7 +379,7 @@ unmark_byte_stack (void)
Fgarbage_collect (); \
AFTER_POTENTIAL_GC (); \
} \
- else
+ } while (0)
/* Check for jumping out of range. */
diff --git a/src/callint.c b/src/callint.c
index a0efc4bbfe..3c520742e2 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -118,7 +118,7 @@ usage: (interactive &optional ARGS) */)
/* Quotify EXP: if EXP is constant, return it.
If EXP is not constant, return (quote EXP). */
-Lisp_Object
+static Lisp_Object
quotify_arg (register Lisp_Object exp)
{
if (CONSP (exp)
@@ -130,7 +130,7 @@ quotify_arg (register Lisp_Object exp)
}
/* Modify EXP by quotifying each element (except the first). */
-Lisp_Object
+static Lisp_Object
quotify_args (Lisp_Object exp)
{
register Lisp_Object tail;
@@ -262,7 +262,7 @@ invoke it. If KEYS is omitted or nil, the return value of
Lisp_Object prefix_arg;
char *string;
- char *tem;
+ const char *tem;
/* If varies[i] > 0, the i'th argument shouldn't just have its value
in this call quoted in the command history. It should be
@@ -415,25 +415,25 @@ invoke it. If KEYS is omitted or nil, the return value of
string++;
else if (*string == '@')
{
- Lisp_Object event, tem;
+ Lisp_Object event, w;
event = (next_event < key_count
? AREF (keys, next_event)
: Qnil);
if (EVENT_HAS_PARAMETERS (event)
- && (tem = XCDR (event), CONSP (tem))
- && (tem = XCAR (tem), CONSP (tem))
- && (tem = XCAR (tem), WINDOWP (tem)))
+ && (w = XCDR (event), CONSP (w))
+ && (w = XCAR (w), CONSP (w))
+ && (w = XCAR (w), WINDOWP (w)))
{
- if (MINI_WINDOW_P (XWINDOW (tem))
- && ! (minibuf_level > 0 && EQ (tem, minibuf_window)))
+ if (MINI_WINDOW_P (XWINDOW (w))
+ && ! (minibuf_level > 0 && EQ (w, minibuf_window)))
error ("Attempt to select inactive minibuffer window");
/* If the current buffer wants to clean up, let it. */
if (!NILP (Vmouse_leave_buffer_hook))
call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
- Fselect_window (tem, Qnil);
+ Fselect_window (w, Qnil);
}
string++;
}
@@ -686,7 +686,7 @@ invoke it. If KEYS is omitted or nil, the return value of
int first = 1;
do
{
- Lisp_Object tem;
+ Lisp_Object str;
if (! first)
{
message ("Please enter a number.");
@@ -694,13 +694,13 @@ invoke it. If KEYS is omitted or nil, the return value of
}
first = 0;
- tem = Fread_from_minibuffer (callint_message,
+ str = Fread_from_minibuffer (callint_message,
Qnil, Qnil, Qnil, Qnil, Qnil,
Qnil);
- if (! STRINGP (tem) || SCHARS (tem) == 0)
+ if (! STRINGP (str) || SCHARS (str) == 0)
args[i] = Qnil;
else
- args[i] = Fread (tem);
+ args[i] = Fread (str);
}
while (! NUMBERP (args[i]));
}
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 26fa0db2d7..43ecd38dc7 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -32,7 +32,7 @@ enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP};
Lisp_Object Qidentity;
-Lisp_Object
+static Lisp_Object
casify_object (enum case_action flag, Lisp_Object obj)
{
register int c, c1;
@@ -64,13 +64,13 @@ casify_object (enum case_action flag, Lisp_Object obj)
multibyte = 1;
if (! multibyte)
MAKE_CHAR_MULTIBYTE (c1);
- c = DOWNCASE (c1);
+ c = downcase (c1);
if (inword)
XSETFASTINT (obj, c | flags);
else if (c == (XFASTINT (obj) & ~flagbits))
{
if (! inword)
- c = UPCASE1 (c1);
+ c = upcase1 (c1);
if (! multibyte)
MAKE_CHAR_UNIBYTE (c);
XSETFASTINT (obj, c | flags);
@@ -92,10 +92,10 @@ casify_object (enum case_action flag, Lisp_Object obj)
MAKE_CHAR_MULTIBYTE (c);
c1 = c;
if (inword && flag != CASE_CAPITALIZE_UP)
- c = DOWNCASE (c);
- else if (!UPPERCASEP (c)
+ c = downcase (c);
+ else if (!uppercasep (c)
&& (!inword || flag != CASE_CAPITALIZE_UP))
- c = UPCASE1 (c1);
+ c = upcase1 (c1);
if ((int) flag >= (int) CASE_CAPITALIZE)
inword = (SYNTAX (c) == Sword);
if (c != c1)
@@ -133,10 +133,10 @@ casify_object (enum case_action flag, Lisp_Object obj)
}
c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i_byte, len);
if (inword && flag != CASE_CAPITALIZE_UP)
- c = DOWNCASE (c);
- else if (!UPPERCASEP (c)
+ c = downcase (c);
+ else if (!uppercasep (c)
&& (!inword || flag != CASE_CAPITALIZE_UP))
- c = UPCASE1 (c);
+ c = upcase1 (c);
if ((int) flag >= (int) CASE_CAPITALIZE)
inword = (SYNTAX (c) == Sword);
o += CHAR_STRING (c, o);
@@ -193,7 +193,7 @@ The argument object is not altered--the value is a copy. */)
/* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP.
b and e specify range of buffer to operate on. */
-void
+static void
casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
{
register int c;
@@ -201,7 +201,10 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
register int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
EMACS_INT start, end;
EMACS_INT start_byte, end_byte;
- EMACS_INT first = -1, last; /* Position of first and last changes. */
+
+ /* Position of first and last changes. */
+ EMACS_INT first = -1, last IF_LINT (= 0);
+
EMACS_INT opoint = PT;
EMACS_INT opoint_byte = PT_BYTE;
@@ -240,10 +243,10 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
}
c2 = c;
if (inword && flag != CASE_CAPITALIZE_UP)
- c = DOWNCASE (c);
- else if (!UPPERCASEP (c)
+ c = downcase (c);
+ else if (!uppercasep (c)
&& (!inword || flag != CASE_CAPITALIZE_UP))
- c = UPCASE1 (c);
+ c = upcase1 (c);
if ((int) flag >= (int) CASE_CAPITALIZE)
inword = ((SYNTAX (c) == Sword)
&& (inword || !syntax_prefix_flag_p (c)));
diff --git a/src/casetab.c b/src/casetab.c
index 5207e5315a..56f6b06535 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -28,11 +28,6 @@ Lisp_Object Qcase_table_p, Qcase_table;
Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
Lisp_Object Vascii_canon_table, Vascii_eqv_table;
-/* Used as a temporary in DOWNCASE and other macros in lisp.h. No
- need to mark it, since it is used only very temporarily. */
-int case_temp1;
-Lisp_Object case_temp2;
-
static void set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt);
static void set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
static void shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
@@ -302,4 +297,3 @@ syms_of_casetab (void)
defsubr (&Sset_case_table);
defsubr (&Sset_standard_case_table);
}
-
diff --git a/src/category.c b/src/category.c
index bcd73d3a48..cc7ff88474 100644
--- a/src/category.c
+++ b/src/category.c
@@ -61,7 +61,6 @@ static Lisp_Object hash_get_category_set (Lisp_Object, Lisp_Object);
static Lisp_Object
hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
{
- Lisp_Object val;
struct Lisp_Hash_Table *h;
int i;
unsigned hash;
@@ -228,7 +227,7 @@ copy_category_entry (Lisp_Object table, Lisp_Object c, Lisp_Object val)
the original and the copy. This function is called recursively by
binding TABLE to a sub char table. */
-Lisp_Object
+static Lisp_Object
copy_category_table (Lisp_Object table)
{
table = copy_char_table (table);
@@ -538,4 +537,3 @@ See the documentation of the variable `word-combining-categories'. */);
category_table_version = 0;
}
-
diff --git a/src/ccl.c b/src/ccl.c
index 411c041b22..5428e94c69 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -758,18 +758,18 @@ while(0)
buffer. */
#define CCL_WRITE_STRING(len) \
do { \
- int i; \
+ int ccli; \
if (!dst) \
CCL_INVALID_CMD; \
else if (dst + len <= dst_end) \
{ \
if (XFASTINT (ccl_prog[ic]) & 0x1000000) \
- for (i = 0; i < len; i++) \
- *dst++ = XFASTINT (ccl_prog[ic + i]) & 0xFFFFFF; \
+ for (ccli = 0; ccli < len; ccli++) \
+ *dst++ = XFASTINT (ccl_prog[ic + ccli]) & 0xFFFFFF; \
else \
- for (i = 0; i < len; i++) \
- *dst++ = ((XFASTINT (ccl_prog[ic + (i / 3)])) \
- >> ((2 - (i % 3)) * 8)) & 0xFF; \
+ for (ccli = 0; ccli < len; ccli++) \
+ *dst++ = ((XFASTINT (ccl_prog[ic + (ccli / 3)])) \
+ >> ((2 - (ccli % 3)) * 8)) & 0xFF; \
} \
else \
CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \
@@ -806,15 +806,15 @@ while(0)
#define CCL_ENCODE_CHAR(c, charset_list, id, encoded) \
do { \
- unsigned code; \
+ unsigned ncode; \
\
- charset = char_charset ((c), (charset_list), &code); \
+ charset = char_charset ((c), (charset_list), &ncode); \
if (! charset && ! NILP (charset_list)) \
- charset = char_charset ((c), Qnil, &code); \
+ charset = char_charset ((c), Qnil, &ncode); \
if (charset) \
{ \
(id) = CHARSET_ID (charset); \
- (encoded) = code; \
+ (encoded) = ncode; \
} \
} while (0)
@@ -2092,22 +2092,22 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
{
const unsigned char *p = SDATA (str) + consumed_bytes;
const unsigned char *endp = SDATA (str) + str_bytes;
- int i = 0;
+ int j = 0;
int *src, src_size;
if (endp - p == str_chars - consumed_chars)
- while (i < CCL_EXECUTE_BUF_SIZE && p < endp)
- source[i++] = *p++;
+ while (j < CCL_EXECUTE_BUF_SIZE && p < endp)
+ source[j++] = *p++;
else
- while (i < CCL_EXECUTE_BUF_SIZE && p < endp)
- source[i++] = STRING_CHAR_ADVANCE (p);
- consumed_chars += i;
+ while (j < CCL_EXECUTE_BUF_SIZE && p < endp)
+ source[j++] = STRING_CHAR_ADVANCE (p);
+ consumed_chars += j;
consumed_bytes = p - SDATA (str);
if (consumed_bytes == str_bytes)
ccl.last_block = NILP (contin);
src = source;
- src_size = i;
+ src_size = j;
while (1)
{
ccl_driver (&ccl, src, destination, src_size, CCL_EXECUTE_BUF_SIZE,
@@ -2123,8 +2123,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
outp = outbuf + offset;
}
- for (i = 0; i < ccl.produced; i++)
- CHAR_STRING_ADVANCE (destination[i], outp);
+ for (j = 0; j < ccl.produced; j++)
+ CHAR_STRING_ADVANCE (destination[j], outp);
}
else
{
@@ -2135,8 +2135,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
outp = outbuf + offset;
}
- for (i = 0; i < ccl.produced; i++)
- *outp++ = destination[i];
+ for (j = 0; j < ccl.produced; j++)
+ *outp++ = destination[j];
}
src += ccl.consumed;
src_size -= ccl.consumed;
@@ -2253,7 +2253,7 @@ Return index number of the registered map. */)
{
int len = ASIZE (Vcode_conversion_map_vector);
int i;
- Lisp_Object index;
+ Lisp_Object idx;
CHECK_SYMBOL (symbol);
CHECK_VECTOR (map);
@@ -2267,11 +2267,11 @@ Return index number of the registered map. */)
if (EQ (symbol, XCAR (slot)))
{
- index = make_number (i);
+ idx = make_number (i);
XSETCDR (slot, map);
Fput (symbol, Qcode_conversion_map, map);
- Fput (symbol, Qcode_conversion_map_id, index);
- return index;
+ Fput (symbol, Qcode_conversion_map_id, idx);
+ return idx;
}
}
@@ -2279,11 +2279,11 @@ Return index number of the registered map. */)
Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector,
len * 2, Qnil);
- index = make_number (i);
+ idx = make_number (i);
Fput (symbol, Qcode_conversion_map, map);
- Fput (symbol, Qcode_conversion_map_id, index);
+ Fput (symbol, Qcode_conversion_map_id, idx);
ASET (Vcode_conversion_map_vector, i, Fcons (symbol, map));
- return index;
+ return idx;
}
@@ -2341,4 +2341,3 @@ used by CCL. */);
defsubr (&Sregister_ccl_program);
defsubr (&Sregister_code_conversion_map);
}
-
diff --git a/src/character.c b/src/character.c
index 6f3312fec2..fdaf22f04f 100644
--- a/src/character.c
+++ b/src/character.c
@@ -786,7 +786,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, EMACS_INT chars, i
}
-EMACS_INT
+static EMACS_INT
string_count_byte8 (Lisp_Object string)
{
int multibyte = STRING_MULTIBYTE (string);
diff --git a/src/character.h b/src/character.h
index fb29ced66b..4c468e14d2 100644
--- a/src/character.h
+++ b/src/character.h
@@ -128,9 +128,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
XSETCDR ((x), tmp); \
} while (0)
-/* Nonzero iff C is an ASCII character. */
-#define ASCII_CHAR_P(c) ((unsigned) (c) < 0x80)
-
/* Nonzero iff C is a character of code less than 0x100. */
#define SINGLE_BYTE_CHAR_P(c) ((unsigned) (c) < 0x100)
@@ -281,11 +278,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
do { \
if ((p) > (limit)) \
{ \
- const unsigned char *p0 = (p); \
+ const unsigned char *pcb = (p); \
do { \
- p0--; \
- } while (p0 >= limit && ! CHAR_HEAD_P (*p0)); \
- (p) = (BYTES_BY_CHAR_HEAD (*p0) == (p) - p0) ? p0 : (p) - 1; \
+ pcb--; \
+ } while (pcb >= limit && ! CHAR_HEAD_P (*pcb)); \
+ (p) = (BYTES_BY_CHAR_HEAD (*pcb) == (p) - pcb) ? pcb : (p) - 1; \
} \
} while (0)
@@ -356,11 +353,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
CHARIDX++; \
if (STRING_MULTIBYTE (STRING)) \
{ \
- unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
- int len; \
+ unsigned char *string_ptr = &SDATA (STRING)[BYTEIDX]; \
+ int string_len; \
\
- OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
- BYTEIDX += len; \
+ OUTPUT = STRING_CHAR_AND_LENGTH (string_ptr, string_len); \
+ BYTEIDX += string_len; \
} \
else \
{ \
@@ -380,10 +377,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
if (STRING_MULTIBYTE (STRING)) \
{ \
unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
- int len; \
+ int ptrlen; \
\
- OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
- BYTEIDX += len; \
+ OUTPUT = STRING_CHAR_AND_LENGTH (ptr, ptrlen); \
+ BYTEIDX += ptrlen; \
} \
else \
{ \
@@ -400,11 +397,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \
do \
{ \
- unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
- int len; \
+ unsigned char *fetch_ptr = &SDATA (STRING)[BYTEIDX]; \
+ int fetch_len; \
\
- OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
- BYTEIDX += len; \
+ OUTPUT = STRING_CHAR_AND_LENGTH (fetch_ptr, fetch_len); \
+ BYTEIDX += fetch_len; \
CHARIDX++; \
} \
while (0)
@@ -420,10 +417,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
if (!NILP (BVAR (current_buffer, enable_multibyte_characters))) \
{ \
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
- int len; \
+ int string_len; \
\
- OUTPUT= STRING_CHAR_AND_LENGTH (ptr, len); \
- BYTEIDX += len; \
+ OUTPUT= STRING_CHAR_AND_LENGTH (ptr, string_len); \
+ BYTEIDX += string_len; \
} \
else \
{ \
@@ -454,8 +451,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define INC_POS(pos_byte) \
do { \
- unsigned char *p = BYTE_POS_ADDR (pos_byte); \
- pos_byte += BYTES_BY_CHAR_HEAD (*p); \
+ unsigned char *ptr = BYTE_POS_ADDR (pos_byte); \
+ pos_byte += BYTES_BY_CHAR_HEAD (*ptr); \
} while (0)
@@ -464,16 +461,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define DEC_POS(pos_byte) \
do { \
- unsigned char *p; \
+ unsigned char *ptr; \
\
pos_byte--; \
if (pos_byte < GPT_BYTE) \
- p = BEG_ADDR + pos_byte - BEG_BYTE; \
+ ptr = BEG_ADDR + pos_byte - BEG_BYTE; \
else \
- p = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE;\
- while (!CHAR_HEAD_P (*p)) \
+ ptr = BEG_ADDR + GAP_SIZE + pos_byte - BEG_BYTE; \
+ while (!CHAR_HEAD_P (*ptr)) \
{ \
- p--; \
+ ptr--; \
pos_byte--; \
} \
} while (0)
@@ -513,8 +510,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BUF_INC_POS(buf, pos_byte) \
do { \
- unsigned char *p = BUF_BYTE_ADDRESS (buf, pos_byte); \
- pos_byte += BYTES_BY_CHAR_HEAD (*p); \
+ unsigned char *bbp = BUF_BYTE_ADDRESS (buf, pos_byte); \
+ pos_byte += BYTES_BY_CHAR_HEAD (*bbp); \
} while (0)
diff --git a/src/charset.c b/src/charset.c
index 3624e740ac..d82b29ae44 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -29,6 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
+#include <limits.h>
#include <sys/types.h>
#include <setjmp.h>
#include "lisp.h"
@@ -250,7 +251,7 @@ struct charset_map_entries
static void
load_charset_map (struct charset *charset, struct charset_map_entries *entries, int n_entries, int control_flag)
{
- Lisp_Object vec, table;
+ Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil);
unsigned max_code = CHARSET_MAX_CODE (charset);
int ascii_compatible_p = charset->ascii_compatible_p;
int min_char, max_char, nonascii_min_char;
@@ -629,8 +630,12 @@ load_charset (struct charset *charset, int control_flag)
if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP)
map = CHARSET_MAP (charset);
- else if (CHARSET_UNIFIED_P (charset))
- map = CHARSET_UNIFY_MAP (charset);
+ else
+ {
+ if (! CHARSET_UNIFIED_P (charset))
+ abort ();
+ map = CHARSET_UNIFY_MAP (charset);
+ }
if (STRINGP (map))
load_charset_map_from_file (charset, map, control_flag);
else
@@ -668,9 +673,9 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object
while (1)
{
- int index = GET_TEMP_CHARSET_WORK_ENCODER (c);
+ int idx = GET_TEMP_CHARSET_WORK_ENCODER (c);
- if (index >= from_idx && index <= to_idx)
+ if (idx >= from_idx && idx <= to_idx)
{
if (NILP (XCAR (range)))
XSETCAR (range, make_number (c));
@@ -2066,10 +2071,10 @@ that case, find the charset from what supported by that coding system. */)
for (; CONSP (restriction); restriction = XCDR (restriction))
{
- struct charset *charset;
+ struct charset *rcharset;
- CHECK_CHARSET_GET_CHARSET (XCAR (restriction), charset);
- if (ENCODE_CHAR (charset, c) != CHARSET_INVALID_CODE (charset))
+ CHECK_CHARSET_GET_CHARSET (XCAR (restriction), rcharset);
+ if (ENCODE_CHAR (rcharset, c) != CHARSET_INVALID_CODE (rcharset))
return XCAR (restriction);
}
return Qnil;
@@ -2250,7 +2255,7 @@ See also `charset-priority-list' and `set-charset-priority'. */)
int n = XFASTINT (len), i, j, done;
Lisp_Object tail, elt, attrs;
struct charset_sort_data *sort_data;
- int id, min_id, max_id;
+ int id, min_id = INT_MAX, max_id = INT_MIN;
USE_SAFE_ALLOCA;
if (n == 0)
@@ -2262,11 +2267,9 @@ See also `charset-priority-list' and `set-charset-priority'. */)
CHECK_CHARSET_GET_ATTR (elt, attrs);
sort_data[i].charset = elt;
sort_data[i].id = id = XINT (CHARSET_ATTR_ID (attrs));
- if (i == 0)
- min_id = max_id = id;
- else if (id < min_id)
+ if (id < min_id)
min_id = id;
- else if (id > max_id)
+ if (id > max_id)
max_id = id;
}
for (done = 0, tail = Vcharset_ordered_list, i = 0;
diff --git a/src/charset.h b/src/charset.h
index 1fc552a5bd..8c87ffe6c3 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -358,9 +358,9 @@ extern int emacs_mule_charset[256];
#define CHECK_CHARSET_GET_CHARSET(x, charset) \
do { \
- int id; \
- CHECK_CHARSET_GET_ID (x, id); \
- charset = CHARSET_FROM_ID (id); \
+ int csid; \
+ CHECK_CHARSET_GET_ID (x, csid); \
+ charset = CHARSET_FROM_ID (csid); \
} while (0)
@@ -541,4 +541,3 @@ extern void map_charset_chars (void (*) (Lisp_Object, Lisp_Object),
struct charset *, unsigned, unsigned);
#endif /* EMACS_CHARSET_H */
-
diff --git a/src/chartab.c b/src/chartab.c
index cd8aa784eb..85aa5932ac 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -118,7 +118,7 @@ char_table_ascii (Lisp_Object table)
return XSUB_CHAR_TABLE (sub)->contents[0];
}
-Lisp_Object
+static Lisp_Object
copy_sub_char_table (Lisp_Object table)
{
Lisp_Object copy;
@@ -216,16 +216,16 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
int depth = XINT (tbl->depth);
int min_char = XINT (tbl->min_char);
int max_char = min_char + chartab_chars[depth - 1] - 1;
- int index = CHARTAB_IDX (c, depth, min_char), idx;
+ int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx;
Lisp_Object val;
- val = tbl->contents[index];
+ val = tbl->contents[chartab_idx];
if (SUB_CHAR_TABLE_P (val))
val = sub_char_table_ref_and_range (val, c, from, to, defalt);
else if (NILP (val))
val = defalt;
- idx = index;
+ idx = chartab_idx;
while (idx > 0 && *from < min_char + idx * chartab_chars[depth])
{
Lisp_Object this_val;
@@ -244,13 +244,13 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
break;
}
}
- while ((c = min_char + (index + 1) * chartab_chars[depth]) <= max_char
+ while ((c = min_char + (chartab_idx + 1) * chartab_chars[depth]) <= max_char
&& *to >= c)
{
Lisp_Object this_val;
- index++;
- this_val = tbl->contents[index];
+ chartab_idx++;
+ this_val = tbl->contents[chartab_idx];
if (SUB_CHAR_TABLE_P (this_val))
this_val = sub_char_table_ref_and_range (this_val, c, from, to, defalt);
else if (NILP (this_val))
@@ -275,10 +275,10 @@ Lisp_Object
char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
- int index = CHARTAB_IDX (c, 0, 0), idx;
+ int chartab_idx = CHARTAB_IDX (c, 0, 0), idx;
Lisp_Object val;
- val = tbl->contents[index];
+ val = tbl->contents[chartab_idx];
if (*from < 0)
*from = 0;
if (*to < 0)
@@ -288,7 +288,7 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
else if (NILP (val))
val = tbl->defalt;
- idx = index;
+ idx = chartab_idx;
while (*from < idx * chartab_chars[0])
{
Lisp_Object this_val;
@@ -308,13 +308,13 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
break;
}
}
- while (*to >= (index + 1) * chartab_chars[0])
+ while (*to >= (chartab_idx + 1) * chartab_chars[0])
{
Lisp_Object this_val;
- index++;
- c = index * chartab_chars[0];
- this_val = tbl->contents[index];
+ chartab_idx++;
+ c = chartab_idx * chartab_chars[0];
+ this_val = tbl->contents[chartab_idx];
if (SUB_CHAR_TABLE_P (this_val))
this_val = sub_char_table_ref_and_range (this_val, c, from, to,
tbl->defalt);
@@ -331,20 +331,6 @@ char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
}
-#define ASET_RANGE(ARRAY, FROM, TO, LIMIT, VAL) \
- do { \
- int limit = (TO) < (LIMIT) ? (TO) : (LIMIT); \
- for (; (FROM) < limit; (FROM)++) (ARRAY)->contents[(FROM)] = (VAL); \
- } while (0)
-
-#define GET_SUB_CHAR_TABLE(TABLE, SUBTABLE, IDX, DEPTH, MIN_CHAR) \
- do { \
- (SUBTABLE) = (TABLE)->contents[(IDX)]; \
- if (!SUB_CHAR_TABLE_P (SUBTABLE)) \
- (SUBTABLE) = make_sub_char_table ((DEPTH), (MIN_CHAR), (SUBTABLE)); \
- } while (0)
-
-
static void
sub_char_table_set (Lisp_Object table, int c, Lisp_Object val)
{
@@ -951,7 +937,7 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
map_charset_chars. */
void
-map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
+map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
Lisp_Object function, Lisp_Object table, Lisp_Object arg,
struct charset *charset,
unsigned from, unsigned to)
@@ -1012,4 +998,3 @@ syms_of_chartab (void)
defsubr (&Soptimize_char_table);
defsubr (&Smap_char_table);
}
-
diff --git a/src/cm.c b/src/cm.c
index d4aedad6db..108ee5720f 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -199,7 +199,7 @@ calccost (struct tty_display_info *tty,
tabx,
tab2x,
tabcost;
- register char *p;
+ register const char *p;
/* If have just wrapped on a terminal with xn,
don't believe the cursor position: give up here
@@ -330,9 +330,9 @@ cmgoto (struct tty_display_info *tty, int row, int col)
llcost,
relcost,
directcost;
- int use;
- char *p,
- *dcm;
+ int use IF_LINT (= 0);
+ char *p;
+ const char *dcm;
/* First the degenerate case */
if (row == curY (tty) && col == curX (tty)) /* already there */
@@ -460,4 +460,3 @@ Wcm_init (struct tty_display_info *tty)
return - 2;
return 0;
}
-
diff --git a/src/cm.h b/src/cm.h
index 7b4bedd4e8..5d430598f0 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -35,25 +35,25 @@ struct cm
int cm_curX; /* Current column */
/* Capabilities from termcap */
- char *cm_up; /* up (up) */
- char *cm_down; /* down (do) */
- char *cm_left; /* left (le) */
- char *cm_right; /* right (nd) */
- char *cm_home; /* home (ho) */
- char *cm_cr; /* carriage return (cr) */
- char *cm_ll; /* last line (ll) */
- char *cm_tab; /* tab (ta) */
- char *cm_backtab; /* backtab (bt) */
+ const char *cm_up; /* up (up) */
+ const char *cm_down; /* down (do) */
+ const char *cm_left; /* left (le) */
+ const char *cm_right; /* right (nd) */
+ const char *cm_home; /* home (ho) */
+ const char *cm_cr; /* carriage return (cr) */
+ const char *cm_ll; /* last line (ll) */
+ const char *cm_tab; /* tab (ta) */
+ const char *cm_backtab; /* backtab (bt) */
char *cm_abs; /* absolute (cm) */
- char *cm_habs; /* horizontal absolute (ch) */
- char *cm_vabs; /* vertical absolute (cv) */
+ const char *cm_habs; /* horizontal absolute (ch) */
+ const char *cm_vabs; /* vertical absolute (cv) */
#if 0
- char *cm_ds; /* "don't send" string (ds) */
+ const char *cm_ds; /* "don't send" string (ds) */
#endif
- char *cm_multiup; /* multiple up (UP) */
- char *cm_multidown; /* multiple down (DO) */
- char *cm_multileft; /* multiple left (LE) */
- char *cm_multiright; /* multiple right (RI) */
+ const char *cm_multiup; /* multiple up (UP) */
+ const char *cm_multidown; /* multiple down (DO) */
+ const char *cm_multileft; /* multiple left (LE) */
+ const char *cm_multiright; /* multiple right (RI) */
int cm_cols; /* number of cols on screen (co) */
int cm_rows; /* number of rows on screen (li) */
int cm_tabwidth; /* tab width (it) */
@@ -168,4 +168,3 @@ extern void cmcostinit (struct tty_display_info *);
extern void cmgoto (struct tty_display_info *, int, int);
extern void Wcm_clear (struct tty_display_info *);
extern int Wcm_init (struct tty_display_info *);
-
diff --git a/src/cmds.c b/src/cmds.c
index 5e6884c080..fa1ac5028a 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -485,18 +485,18 @@ internal_self_insert (int c, EMACS_INT n)
: (c == ' ' || c == '\n'))
&& !NILP (BVAR (current_buffer, auto_fill_function)))
{
- Lisp_Object tem;
+ Lisp_Object auto_fill_result;
if (c == '\n')
/* After inserting a newline, move to previous line and fill
that. Must have the newline in place already so filling and
justification, if any, know where the end is going to be. */
SET_PT_BOTH (PT - 1, PT_BYTE - 1);
- tem = call0 (BVAR (current_buffer, auto_fill_function));
+ auto_fill_result = call0 (BVAR (current_buffer, auto_fill_function));
/* Test PT < ZV in case the auto-fill-function is strange. */
if (c == '\n' && PT < ZV)
SET_PT_BOTH (PT + 1, PT_BYTE + 1);
- if (!NILP (tem))
+ if (!NILP (auto_fill_result))
hairy = 2;
}
diff --git a/src/coding.c b/src/coding.c
index f6310369ad..0c2836c19f 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -395,8 +395,6 @@ Lisp_Object Vbig5_coding_system;
/* Control characters of ISO2022. */
/* code */ /* function */
-#define ISO_CODE_LF 0x0A /* line-feed */
-#define ISO_CODE_CR 0x0D /* carriage-return */
#define ISO_CODE_SO 0x0E /* shift-out */
#define ISO_CODE_SI 0x0F /* shift-in */
#define ISO_CODE_SS2_7 0x19 /* single-shift-2 for 7-bit code */
@@ -479,7 +477,7 @@ enum iso_code_class_type
#define CODING_ISO_FLAG_COMPOSITION 0x2000
-#define CODING_ISO_FLAG_EUC_TW_SHIFT 0x4000
+/* #define CODING_ISO_FLAG_EUC_TW_SHIFT 0x4000 */
#define CODING_ISO_FLAG_USE_ROMAN 0x8000
@@ -721,25 +719,6 @@ static struct coding_system coding_categories[coding_category_max];
} while (0)
-#define ONE_MORE_BYTE_NO_CHECK(c) \
- do { \
- c = *src++; \
- if (multibytep && (c & 0x80)) \
- { \
- if ((c & 0xFE) == 0xC0) \
- c = ((c & 1) << 6) | *src++; \
- else \
- { \
- src--; \
- c = - string_char (src, &src, NULL); \
- record_conversion_result \
- (coding, CODING_RESULT_INVALID_SRC); \
- } \
- } \
- consumed_chars++; \
- } while (0)
-
-
/* Store a byte C in the place pointed by DST and increment DST to the
next free point, and increment PRODUCED_CHARS. The caller should
assure that C is 0..127, and declare and set the variable `dst'
@@ -1051,9 +1030,10 @@ coding_set_source (struct coding_system *coding)
coding->source = SDATA (coding->src_object) + coding->src_pos_byte;
}
else
- /* Otherwise, the source is C string and is never relocated
- automatically. Thus we don't have to update anything. */
- ;
+ {
+ /* Otherwise, the source is C string and is never relocated
+ automatically. Thus we don't have to update anything. */
+ }
}
static void
@@ -1079,9 +1059,10 @@ coding_set_destination (struct coding_system *coding)
}
}
else
- /* Otherwise, the destination is C string and is never relocated
- automatically. Thus we don't have to update anything. */
- ;
+ {
+ /* Otherwise, the destination is C string and is never relocated
+ automatically. Thus we don't have to update anything. */
+ }
}
@@ -1217,7 +1198,6 @@ alloc_destination (struct coding_system *coding, EMACS_INT nbytes,
#define UTF_8_4_OCTET_LEADING_P(c) (((c) & 0xF8) == 0xF0)
#define UTF_8_5_OCTET_LEADING_P(c) (((c) & 0xFC) == 0xF8)
-#define UTF_BOM 0xFEFF
#define UTF_8_BOM_1 0xEF
#define UTF_8_BOM_2 0xBB
#define UTF_8_BOM_3 0xBF
@@ -1318,7 +1298,7 @@ decode_coding_utf_8 (struct coding_system *coding)
int multibytep = coding->src_multibyte;
enum utf_bom_type bom = CODING_UTF_8_BOM (coding);
Lisp_Object attr, charset_list;
- int eol_crlf =
+ int eol_dos =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
int byte_after_cr = -1;
@@ -1379,7 +1359,7 @@ decode_coding_utf_8 (struct coding_system *coding)
}
else if (UTF_8_1_OCTET_P (c1))
{
- if (eol_crlf && c1 == '\r')
+ if (eol_dos && c1 == '\r')
ONE_MORE_BYTE (byte_after_cr);
c = c1;
}
@@ -1533,11 +1513,6 @@ encode_coding_utf_8 (struct coding_system *coding)
#define UTF_16_LOW_SURROGATE_P(val) \
(((val) & 0xFC00) == 0xDC00)
-#define UTF_16_INVALID_P(val) \
- (((val) == 0xFFFE) \
- || ((val) == 0xFFFF) \
- || UTF_16_LOW_SURROGATE_P (val))
-
static int
detect_coding_utf_16 (struct coding_system *coding,
@@ -1637,7 +1612,7 @@ decode_coding_utf_16 (struct coding_system *coding)
enum utf_16_endian_type endian = CODING_UTF_16_ENDIAN (coding);
int surrogate = CODING_UTF_16_SURROGATE (coding);
Lisp_Object attr, charset_list;
- int eol_crlf =
+ int eol_dos =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
int byte_after_cr1 = -1, byte_after_cr2 = -1;
@@ -1734,7 +1709,7 @@ decode_coding_utf_16 (struct coding_system *coding)
CODING_UTF_16_SURROGATE (coding) = surrogate = c;
else
{
- if (eol_crlf && c == '\r')
+ if (eol_dos && c == '\r')
{
ONE_MORE_BYTE (byte_after_cr1);
ONE_MORE_BYTE (byte_after_cr2);
@@ -1918,17 +1893,17 @@ detect_coding_emacs_mule (struct coding_system *coding,
it because analyzing it is too heavy for detecting. But,
at least, we check that the composite character
constitutes of more than 4 bytes. */
- const unsigned char *src_base;
+ const unsigned char *src_start;
repeat:
- src_base = src;
+ src_start = src;
do
{
ONE_MORE_BYTE (c);
}
while (c >= 0xA0);
- if (src - src_base <= 4)
+ if (src - src_start <= 4)
break;
found = CATEGORY_MASK_EMACS_MULE;
if (c == 0x80)
@@ -1980,7 +1955,7 @@ detect_coding_emacs_mule (struct coding_system *coding,
the decoded character or rule. If an invalid byte is found, return
-1. If SRC is too short, return -2. */
-int
+static int
emacs_mule_char (struct coding_system *coding, const unsigned char *src,
int *nbytes, int *nchars, int *id,
struct composition_status *cmp_status)
@@ -1988,7 +1963,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base = src;
int multibytep = coding->src_multibyte;
- int charset_id;
+ int charset_ID;
unsigned code;
int c;
int consumed_chars = 0;
@@ -1998,7 +1973,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
if (c < 0)
{
c = -c;
- charset_id = emacs_mule_charset[0];
+ charset_ID = emacs_mule_charset[0];
}
else
{
@@ -2034,7 +2009,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
switch (emacs_mule_bytes[c])
{
case 2:
- if ((charset_id = emacs_mule_charset[c]) < 0)
+ if ((charset_ID = emacs_mule_charset[c]) < 0)
goto invalid_code;
ONE_MORE_BYTE (c);
if (c < 0xA0)
@@ -2047,7 +2022,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
|| c == EMACS_MULE_LEADING_CODE_PRIVATE_12)
{
ONE_MORE_BYTE (c);
- if (c < 0xA0 || (charset_id = emacs_mule_charset[c]) < 0)
+ if (c < 0xA0 || (charset_ID = emacs_mule_charset[c]) < 0)
goto invalid_code;
ONE_MORE_BYTE (c);
if (c < 0xA0)
@@ -2056,7 +2031,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
}
else
{
- if ((charset_id = emacs_mule_charset[c]) < 0)
+ if ((charset_ID = emacs_mule_charset[c]) < 0)
goto invalid_code;
ONE_MORE_BYTE (c);
if (c < 0xA0)
@@ -2071,7 +2046,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
case 4:
ONE_MORE_BYTE (c);
- if (c < 0 || (charset_id = emacs_mule_charset[c]) < 0)
+ if (c < 0 || (charset_ID = emacs_mule_charset[c]) < 0)
goto invalid_code;
ONE_MORE_BYTE (c);
if (c < 0xA0)
@@ -2085,21 +2060,21 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
case 1:
code = c;
- charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
+ charset_ID = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
break;
default:
abort ();
}
CODING_DECODE_CHAR (coding, src, src_base, src_end,
- CHARSET_FROM_ID (charset_id), code, c);
+ CHARSET_FROM_ID (charset_ID), code, c);
if (c < 0)
goto invalid_code;
}
*nbytes = src - src_base;
*nchars = consumed_chars;
if (id)
- *id = charset_id;
+ *id = charset_ID;
return (mseq_found ? -c : c);
no_more_source:
@@ -2372,7 +2347,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
int char_offset = coding->produced_char;
int last_offset = char_offset;
int last_id = charset_ascii;
- int eol_crlf =
+ int eol_dos =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
int byte_after_cr = -1;
struct composition_status *cmp_status = &coding->spec.emacs_mule.cmp_status;
@@ -2390,7 +2365,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
while (1)
{
- int c, id;
+ int c, id IF_LINT (= 0);
src_base = src;
consumed_chars_base = consumed_chars;
@@ -2422,7 +2397,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
if (c < 0x80)
{
- if (eol_crlf && c == '\r')
+ if (eol_dos && c == '\r')
ONE_MORE_BYTE (byte_after_cr);
id = charset_ascii;
if (cmp_status->state != COMPOSING_NO)
@@ -2435,7 +2410,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
}
else
{
- int nchars, nbytes;
+ int nchars IF_LINT (= 0), nbytes IF_LINT (= 0);
/* emacs_mule_char can load a charset map from a file, which
allocates a large structure and might cause buffer text
to be relocated as result. Thus, we need to remember the
@@ -2903,10 +2878,6 @@ enum iso_code_class_type iso_code_class[256];
((id) <= (coding)->max_charset_id \
&& (coding)->safe_charsets[id] != 255)
-
-#define SHIFT_OUT_OK(category) \
- (CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0)
-
static void
setup_iso_safe_charsets (Lisp_Object attrs)
{
@@ -3023,40 +2994,11 @@ detect_coding_iso_2022 (struct coding_system *coding,
break;
single_shifting = 0;
ONE_MORE_BYTE (c);
- if (c >= '(' && c <= '/')
- {
- /* Designation sequence for a charset of dimension 1. */
- ONE_MORE_BYTE (c1);
- if (c1 < ' ' || c1 >= 0x80
- || (id = iso_charset_table[0][c >= ','][c1]) < 0)
- /* Invalid designation sequence. Just ignore. */
- break;
- }
- else if (c == '$')
- {
- /* Designation sequence for a charset of dimension 2. */
- ONE_MORE_BYTE (c);
- if (c >= '@' && c <= 'B')
- /* Designation for JISX0208.1978, GB2312, or JISX0208. */
- id = iso_charset_table[1][0][c];
- else if (c >= '(' && c <= '/')
- {
- ONE_MORE_BYTE (c1);
- if (c1 < ' ' || c1 >= 0x80
- || (id = iso_charset_table[1][c >= ','][c1]) < 0)
- /* Invalid designation sequence. Just ignore. */
- break;
- }
- else
- /* Invalid designation sequence. Just ignore it. */
- break;
- }
- else if (c == 'N' || c == 'O')
+ if (c == 'N' || c == 'O')
{
/* ESC <Fe> for SS2 or SS3. */
single_shifting = 1;
rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_8BIT;
- break;
}
else if (c == '1')
{
@@ -3072,36 +3014,66 @@ detect_coding_iso_2022 (struct coding_system *coding,
{
/* ESC <Fp> for start/end composition. */
composition_count = 0;
- break;
}
else
{
- /* Invalid escape sequence. Just ignore it. */
- break;
- }
+ if (c >= '(' && c <= '/')
+ {
+ /* Designation sequence for a charset of dimension 1. */
+ ONE_MORE_BYTE (c1);
+ if (c1 < ' ' || c1 >= 0x80
+ || (id = iso_charset_table[0][c >= ','][c1]) < 0)
+ /* Invalid designation sequence. Just ignore. */
+ break;
+ }
+ else if (c == '$')
+ {
+ /* Designation sequence for a charset of dimension 2. */
+ ONE_MORE_BYTE (c);
+ if (c >= '@' && c <= 'B')
+ /* Designation for JISX0208.1978, GB2312, or JISX0208. */
+ id = iso_charset_table[1][0][c];
+ else if (c >= '(' && c <= '/')
+ {
+ ONE_MORE_BYTE (c1);
+ if (c1 < ' ' || c1 >= 0x80
+ || (id = iso_charset_table[1][c >= ','][c1]) < 0)
+ /* Invalid designation sequence. Just ignore. */
+ break;
+ }
+ else
+ /* Invalid designation sequence. Just ignore it. */
+ break;
+ }
+ else
+ {
+ /* Invalid escape sequence. Just ignore it. */
+ break;
+ }
- /* We found a valid designation sequence for CHARSET. */
- rejected |= CATEGORY_MASK_ISO_8BIT;
- if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7],
- id))
- found |= CATEGORY_MASK_ISO_7;
- else
- rejected |= CATEGORY_MASK_ISO_7;
- if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_tight],
- id))
- found |= CATEGORY_MASK_ISO_7_TIGHT;
- else
- rejected |= CATEGORY_MASK_ISO_7_TIGHT;
- if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_else],
- id))
- found |= CATEGORY_MASK_ISO_7_ELSE;
- else
- rejected |= CATEGORY_MASK_ISO_7_ELSE;
- if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_8_else],
- id))
- found |= CATEGORY_MASK_ISO_8_ELSE;
- else
- rejected |= CATEGORY_MASK_ISO_8_ELSE;
+ /* We found a valid designation sequence for CHARSET. */
+ rejected |= CATEGORY_MASK_ISO_8BIT;
+ if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7],
+ id))
+ found |= CATEGORY_MASK_ISO_7;
+ else
+ rejected |= CATEGORY_MASK_ISO_7;
+ if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_tight],
+ id))
+ found |= CATEGORY_MASK_ISO_7_TIGHT;
+ else
+ rejected |= CATEGORY_MASK_ISO_7_TIGHT;
+ if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_7_else],
+ id))
+ found |= CATEGORY_MASK_ISO_7_ELSE;
+ else
+ rejected |= CATEGORY_MASK_ISO_7_ELSE;
+ if (SAFE_CHARSET_P (&coding_categories[coding_category_iso_8_else],
+ id))
+ found |= CATEGORY_MASK_ISO_8_ELSE;
+ else
+ rejected |= CATEGORY_MASK_ISO_8_ELSE;
+ }
break;
case ISO_CODE_SO:
@@ -3129,13 +3101,32 @@ detect_coding_iso_2022 (struct coding_system *coding,
rejected |= CATEGORY_MASK_ISO_7BIT;
if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
& CODING_ISO_FLAG_SINGLE_SHIFT)
- found |= CATEGORY_MASK_ISO_8_1, single_shifting = 1;
+ {
+ found |= CATEGORY_MASK_ISO_8_1;
+ single_shifting = 1;
+ }
if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_2])
& CODING_ISO_FLAG_SINGLE_SHIFT)
- found |= CATEGORY_MASK_ISO_8_2, single_shifting = 1;
+ {
+ found |= CATEGORY_MASK_ISO_8_2;
+ single_shifting = 1;
+ }
if (single_shifting)
break;
- goto check_extra_latin;
+ check_extra_latin:
+ if (! VECTORP (Vlatin_extra_code_table)
+ || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
+ {
+ rejected = CATEGORY_MASK_ISO;
+ break;
+ }
+ if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
+ & CODING_ISO_FLAG_LATIN_EXTRA)
+ found |= CATEGORY_MASK_ISO_8_1;
+ else
+ rejected |= CATEGORY_MASK_ISO_8_1;
+ rejected |= CATEGORY_MASK_ISO_8_2;
+ break;
default:
if (c < 0)
@@ -3158,7 +3149,7 @@ detect_coding_iso_2022 (struct coding_system *coding,
if (! single_shifting
&& ! (rejected & CATEGORY_MASK_ISO_8_2))
{
- int i = 1;
+ int len = 1;
while (src < src_end)
{
src_base = src;
@@ -3168,38 +3159,24 @@ detect_coding_iso_2022 (struct coding_system *coding,
src = src_base;
break;
}
- i++;
+ len++;
}
- if (i & 1 && src < src_end)
+ if (len & 1 && src < src_end)
{
rejected |= CATEGORY_MASK_ISO_8_2;
if (composition_count >= 0)
- composition_count += i;
+ composition_count += len;
}
else
{
found |= CATEGORY_MASK_ISO_8_2;
if (composition_count >= 0)
- composition_count += i / 2;
+ composition_count += len / 2;
}
}
break;
}
- check_extra_latin:
- single_shifting = 0;
- if (! VECTORP (Vlatin_extra_code_table)
- || NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
- {
- rejected = CATEGORY_MASK_ISO;
- break;
- }
- if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
- & CODING_ISO_FLAG_LATIN_EXTRA)
- found |= CATEGORY_MASK_ISO_8_1;
- else
- rejected |= CATEGORY_MASK_ISO_8_1;
- rejected |= CATEGORY_MASK_ISO_8_2;
}
}
detect_info->rejected |= CATEGORY_MASK_ISO;
@@ -3309,10 +3286,10 @@ detect_coding_iso_2022 (struct coding_system *coding,
} \
else /* new format (after ver.21) */ \
{ \
- int c; \
+ int b; \
\
- ONE_MORE_BYTE (c); \
- rule = COMPOSITION_ENCODE_RULE (rule - 81, c - 32); \
+ ONE_MORE_BYTE (b); \
+ rule = COMPOSITION_ENCODE_RULE (rule - 81, b - 32); \
if (rule >= 0) \
rule += 0x100; /* to destinguish it from the old format */ \
nbytes = 2; \
@@ -3504,7 +3481,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
int char_offset = coding->produced_char;
int last_offset = char_offset;
int last_id = charset_ascii;
- int eol_crlf =
+ int eol_dos =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
int byte_after_cr = -1;
int i;
@@ -3624,7 +3601,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
break;
case ISO_control_0:
- if (eol_crlf && c1 == '\r')
+ if (eol_dos && c1 == '\r')
ONE_MORE_BYTE (byte_after_cr);
MAYBE_FINISH_COMPOSITION ();
charset = CHARSET_FROM_ID (charset_ascii);
@@ -3897,6 +3874,10 @@ decode_coding_iso_2022 (struct coding_system *coding)
}
continue;
}
+ break;
+
+ default:
+ abort ();
}
if (cmp_status->state == COMPOSING_NO
@@ -4029,7 +4010,6 @@ decode_coding_iso_2022 (struct coding_system *coding)
const char *intermediate_char_94 = "()*+"; \
const char *intermediate_char_96 = ",-./"; \
int revision = -1; \
- int c; \
\
if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_REVISION) \
revision = CHARSET_ISO_REVISION (charset); \
@@ -4042,11 +4022,12 @@ decode_coding_iso_2022 (struct coding_system *coding)
EMIT_ONE_ASCII_BYTE (ISO_CODE_ESC); \
if (CHARSET_DIMENSION (charset) == 1) \
{ \
+ int b; \
if (! CHARSET_ISO_CHARS_96 (charset)) \
- c = intermediate_char_94[reg]; \
+ b = intermediate_char_94[reg]; \
else \
- c = intermediate_char_96[reg]; \
- EMIT_ONE_ASCII_BYTE (c); \
+ b = intermediate_char_96[reg]; \
+ EMIT_ONE_ASCII_BYTE (b); \
} \
else \
{ \
@@ -4226,7 +4207,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
to use CHARSET. The element `spec.iso_2022' of *CODING is updated.
Return new DST. */
-unsigned char *
+static unsigned char *
encode_invocation_designation (struct charset *charset,
struct coding_system *coding,
unsigned char *dst, int *p_nchars)
@@ -4289,30 +4270,6 @@ encode_invocation_designation (struct charset *charset,
return dst;
}
-/* The following three macros produce codes for indicating direction
- of text. */
-#define ENCODE_CONTROL_SEQUENCE_INTRODUCER \
- do { \
- if (CODING_ISO_FLAGS (coding) == CODING_ISO_FLAG_SEVEN_BITS) \
- EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, '['); \
- else \
- EMIT_ONE_BYTE (ISO_CODE_CSI); \
- } while (0)
-
-
-#define ENCODE_DIRECTION_R2L() \
- do { \
- ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst); \
- EMIT_TWO_ASCII_BYTES ('2', ']'); \
- } while (0)
-
-
-#define ENCODE_DIRECTION_L2R() \
- do { \
- ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst); \
- EMIT_TWO_ASCII_BYTES ('0', ']'); \
- } while (0)
-
/* Produce codes for designation and invocation to reset the graphic
planes and registers to initial state. */
@@ -4707,7 +4664,7 @@ decode_coding_sjis (struct coding_system *coding)
int char_offset = coding->produced_char;
int last_offset = char_offset;
int last_id = charset_ascii;
- int eol_crlf =
+ int eol_dos =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
int byte_after_cr = -1;
@@ -4742,7 +4699,7 @@ decode_coding_sjis (struct coding_system *coding)
goto invalid_code;
if (c < 0x80)
{
- if (eol_crlf && c == '\r')
+ if (eol_dos && c == '\r')
ONE_MORE_BYTE (byte_after_cr);
charset = charset_roman;
}
@@ -4824,7 +4781,7 @@ decode_coding_big5 (struct coding_system *coding)
int char_offset = coding->produced_char;
int last_offset = char_offset;
int last_id = charset_ascii;
- int eol_crlf =
+ int eol_dos =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
int byte_after_cr = -1;
@@ -4857,7 +4814,7 @@ decode_coding_big5 (struct coding_system *coding)
goto invalid_code;
if (c < 0x80)
{
- if (eol_crlf && c == '\r')
+ if (eol_dos && c == '\r')
ONE_MORE_BYTE (byte_after_cr);
charset = charset_roman;
}
@@ -5261,13 +5218,13 @@ encode_coding_ccl (struct coding_system *coding)
static void
decode_coding_raw_text (struct coding_system *coding)
{
- int eol_crlf =
+ int eol_dos =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
coding->chars_at_source = 1;
coding->consumed_char = coding->src_chars;
coding->consumed = coding->src_bytes;
- if (eol_crlf && coding->source[coding->src_bytes - 1] == '\r')
+ if (eol_dos && coding->source[coding->src_bytes - 1] == '\r')
{
coding->consumed_char--;
coding->consumed--;
@@ -5480,7 +5437,7 @@ decode_coding_charset (struct coding_system *coding)
int char_offset = coding->produced_char;
int last_offset = char_offset;
int last_id = charset_ascii;
- int eol_crlf =
+ int eol_dos =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
int byte_after_cr = -1;
@@ -5514,7 +5471,7 @@ decode_coding_charset (struct coding_system *coding)
else
{
ONE_MORE_BYTE (c);
- if (eol_crlf && c == '\r')
+ if (eol_dos && c == '\r')
ONE_MORE_BYTE (byte_after_cr);
}
if (c < 0)
@@ -6607,15 +6564,15 @@ get_translation_table (Lisp_Object attrs, int encodep, int *max_lookup)
}
else if (CONSP (translation_table))
{
- Lisp_Object tail, val;
+ Lisp_Object tail;
for (tail = translation_table; CONSP (tail); tail = XCDR (tail))
if (CHAR_TABLE_P (XCAR (tail))
&& CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (XCAR (tail))) > 1)
{
- val = XCHAR_TABLE (XCAR (tail))->extras[1];
- if (NATNUMP (val) && *max_lookup < XFASTINT (val))
- *max_lookup = XFASTINT (val);
+ Lisp_Object tailval = XCHAR_TABLE (XCAR (tail))->extras[1];
+ if (NATNUMP (tailval) && *max_lookup < XFASTINT (tailval))
+ *max_lookup = XFASTINT (tailval);
}
}
}
@@ -7652,12 +7609,12 @@ decode_coding_object (struct coding_system *coding,
Lisp_Object dst_object)
{
int count = SPECPDL_INDEX ();
- unsigned char *destination;
- EMACS_INT dst_bytes;
+ unsigned char *destination IF_LINT (= NULL);
+ EMACS_INT dst_bytes IF_LINT (= 0);
EMACS_INT chars = to - from;
EMACS_INT bytes = to_byte - from_byte;
Lisp_Object attrs;
- int saved_pt = -1, saved_pt_byte;
+ int saved_pt = -1, saved_pt_byte IF_LINT (= 0);
int need_marker_adjustment = 0;
Lisp_Object old_deactivate_mark;
@@ -7845,7 +7802,7 @@ encode_coding_object (struct coding_system *coding,
EMACS_INT chars = to - from;
EMACS_INT bytes = to_byte - from_byte;
Lisp_Object attrs;
- int saved_pt = -1, saved_pt_byte;
+ int saved_pt = -1, saved_pt_byte IF_LINT (= 0);
int need_marker_adjustment = 0;
int kill_src_buffer = 0;
Lisp_Object old_deactivate_mark;
@@ -8178,8 +8135,8 @@ detect_coding_system (const unsigned char *src,
base_category = XINT (CODING_ATTR_CATEGORY (attrs));
if (base_category == coding_category_undecided)
{
- enum coding_category category;
- struct coding_system *this;
+ enum coding_category category IF_LINT (= 0);
+ struct coding_system *this IF_LINT (= NULL);
int c, i;
/* Skip all ASCII bytes except for a few ISO2022 controls. */
@@ -9112,10 +9069,10 @@ Return the corresponding character. */)
}
else
{
- int s1 = c >> 8, s2 = c & 0xFF;
+ int c1 = c >> 8, c2 = c & 0xFF;
- if (s1 < 0x81 || (s1 > 0x9F && s1 < 0xE0) || s1 > 0xEF
- || s2 < 0x40 || s2 == 0x7F || s2 > 0xFC)
+ if (c1 < 0x81 || (c1 > 0x9F && c1 < 0xE0) || c1 > 0xEF
+ || c2 < 0x40 || c2 == 0x7F || c2 > 0xFC)
error ("Invalid code: %d", code);
SJIS_TO_JIS (c);
charset = charset_kanji;
@@ -9798,7 +9755,6 @@ usage: (define-coding-system-internal ...) */)
else if (EQ (coding_type, Qiso_2022))
{
Lisp_Object initial, reg_usage, request, flags;
- int i;
if (nargs < coding_arg_iso2022_max)
goto short_args;
@@ -9830,12 +9786,12 @@ usage: (define-coding-system-internal ...) */)
for (tail = request; ! NILP (tail); tail = Fcdr (tail))
{
int id;
- Lisp_Object tmp;
+ Lisp_Object tmp1;
val = Fcar (tail);
CHECK_CONS (val);
- tmp = XCAR (val);
- CHECK_CHARSET_GET_ID (tmp, id);
+ tmp1 = XCAR (val);
+ CHECK_CHARSET_GET_ID (tmp1, id);
CHECK_NATNUM_CDR (val);
if (XINT (XCDR (val)) >= 4)
error ("Invalid graphic register number: %d", XINT (XCDR (val)));
diff --git a/src/data.c b/src/data.c
index 6039743b1d..e5c485f532 100644
--- a/src/data.c
+++ b/src/data.c
@@ -807,7 +807,10 @@ variable chain of symbols. */)
(Lisp_Object object)
{
if (SYMBOLP (object))
- XSETSYMBOL (object, indirect_variable (XSYMBOL (object)));
+ {
+ struct Lisp_Symbol *sym = indirect_variable (XSYMBOL (object));
+ XSETSYMBOL (object, sym);
+ }
return object;
}
@@ -817,9 +820,6 @@ variable chain of symbols. */)
This does not handle buffer-local variables; use
swap_in_symval_forwarding for that. */
-#define do_blv_forwarding(blv) \
- ((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv))
-
Lisp_Object
do_symval_forwarding (register union Lisp_Fwd *valcontents)
{
@@ -866,14 +866,6 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents)
BUF non-zero means set the value in buffer BUF instead of the
current buffer. This only plays a role for per-buffer variables. */
-#define store_blv_forwarding(blv, newval, buf) \
- do { \
- if ((blv)->forwarded) \
- store_symval_forwarding (BLV_FWD (blv), (newval), (buf)); \
- else \
- SET_BLV_VALUE (blv, newval); \
- } while (0)
-
static void
store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf)
{
@@ -909,12 +901,12 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
{
- Lisp_Object buf;
+ Lisp_Object lbuf;
struct buffer *b;
- buf = Fcdr (XCAR (tail));
- if (!BUFFERP (buf)) continue;
- b = XBUFFER (buf);
+ lbuf = Fcdr (XCAR (tail));
+ if (!BUFFERP (lbuf)) continue;
+ b = XBUFFER (lbuf);
if (! PER_BUFFER_VALUE_P (b, idx))
PER_BUFFER_VALUE (b, offset) = newval;
@@ -1271,7 +1263,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
/* Return the default value of SYMBOL, but don't check for voidness.
Return Qunbound if it is void. */
-Lisp_Object
+static Lisp_Object
default_value (Lisp_Object symbol)
{
struct Lisp_Symbol *sym;
@@ -1505,8 +1497,8 @@ The function `default-value' gets the default value and `set-default' sets it.
{
struct Lisp_Symbol *sym;
struct Lisp_Buffer_Local_Value *blv = NULL;
- union Lisp_Val_Fwd valcontents;
- int forwarded;
+ union Lisp_Val_Fwd valcontents IF_LINT (= {0});
+ int forwarded IF_LINT (= 0);
CHECK_SYMBOL (variable);
sym = XSYMBOL (variable);
@@ -1581,8 +1573,8 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
(register Lisp_Object variable)
{
register Lisp_Object tem;
- int forwarded;
- union Lisp_Val_Fwd valcontents;
+ int forwarded IF_LINT (= 0);
+ union Lisp_Val_Fwd valcontents IF_LINT (= {0});
struct Lisp_Symbol *sym;
struct Lisp_Buffer_Local_Value *blv = NULL;
@@ -2218,7 +2210,7 @@ bool-vector. IDX starts at 0. */)
enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal };
-Lisp_Object
+static Lisp_Object
arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
{
double f1 = 0, f2 = 0;
@@ -2486,7 +2478,7 @@ enum arithop
static Lisp_Object float_arith_driver (double, int, enum arithop,
int, Lisp_Object *);
-Lisp_Object
+static Lisp_Object
arith_driver (enum arithop code, int nargs, register Lisp_Object *args)
{
register Lisp_Object val;
@@ -3310,7 +3302,7 @@ syms_of_data (void)
XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1;
}
-SIGTYPE
+static SIGTYPE
arith_error (int signo)
{
sigsetmask (SIGEMPTYMASK);
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 7e5104026c..2c8de20a4d 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -325,7 +325,7 @@ xd_signature (char *signature, unsigned int dtype, unsigned int parent_type, Lis
if ((subtype == DBUS_TYPE_SIGNATURE)
&& STRINGP (CAR_SAFE (XD_NEXT_VALUE (elt)))
&& NILP (CDR_SAFE (XD_NEXT_VALUE (elt))))
- strcpy (x, SDATA (CAR_SAFE (XD_NEXT_VALUE (elt))));
+ strcpy (x, SSDATA (CAR_SAFE (XD_NEXT_VALUE (elt))));
while (!NILP (elt))
{
@@ -531,7 +531,7 @@ xd_append_arg (unsigned int dtype, Lisp_Object object, DBusMessageIter *iter)
but by not encoding it, we guarantee it's valid utf-8, even if
it contains eight-bit-bytes. Of course, you can still send
manually-crafted junk by passing a unibyte string. */
- char *val = SDATA (object);
+ char *val = SSDATA (object);
XD_DEBUG_MESSAGE ("%c %s", dtype, val);
if (!dbus_message_iter_append_basic (iter, dtype, &val))
XD_SIGNAL2 (build_string ("Unable to append argument"), object);
@@ -569,7 +569,7 @@ xd_append_arg (unsigned int dtype, Lisp_Object object, DBusMessageIter *iter)
&& STRINGP (CAR_SAFE (XD_NEXT_VALUE (object)))
&& NILP (CDR_SAFE (XD_NEXT_VALUE (object))))
{
- strcpy (signature, SDATA (CAR_SAFE (XD_NEXT_VALUE (object))));
+ strcpy (signature, SSDATA (CAR_SAFE (XD_NEXT_VALUE (object))));
object = CDR_SAFE (XD_NEXT_VALUE (object));
}
@@ -789,7 +789,7 @@ xd_initialize (Lisp_Object bus, int raise_error)
dbus_error_init (&derror);
if (STRINGP (bus))
- connection = dbus_connection_open (SDATA (bus), &derror);
+ connection = dbus_connection_open (SSDATA (bus), &derror);
else
if (EQ (bus, QCdbus_system_bus))
connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror);
@@ -936,7 +936,7 @@ DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0,
Vdbus_registered_buses = Fcons (bus, Vdbus_registered_buses);
/* We do not want to abort. */
- putenv ("DBUS_FATAL_WARNINGS=0");
+ putenv ((char *) "DBUS_FATAL_WARNINGS=0");
/* Return. */
return Qnil;
@@ -1089,10 +1089,10 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TI
connection = xd_initialize (bus, TRUE);
/* Create the message. */
- dmessage = dbus_message_new_method_call (SDATA (service),
- SDATA (path),
- SDATA (interface),
- SDATA (method));
+ dmessage = dbus_message_new_method_call (SSDATA (service),
+ SSDATA (path),
+ SSDATA (interface),
+ SSDATA (method));
UNGCPRO;
if (dmessage == NULL)
XD_SIGNAL1 (build_string ("Unable to create a new message"));
@@ -1272,10 +1272,10 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
connection = xd_initialize (bus, TRUE);
/* Create the message. */
- dmessage = dbus_message_new_method_call (SDATA (service),
- SDATA (path),
- SDATA (interface),
- SDATA (method));
+ dmessage = dbus_message_new_method_call (SSDATA (service),
+ SSDATA (path),
+ SSDATA (interface),
+ SSDATA (method));
if (dmessage == NULL)
XD_SIGNAL1 (build_string ("Unable to create a new message"));
@@ -1386,7 +1386,7 @@ usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
dmessage = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_RETURN);
if ((dmessage == NULL)
|| (!dbus_message_set_reply_serial (dmessage, XUINT (serial)))
- || (!dbus_message_set_destination (dmessage, SDATA (service))))
+ || (!dbus_message_set_destination (dmessage, SSDATA (service))))
{
UNGCPRO;
XD_SIGNAL1 (build_string ("Unable to create a return message"));
@@ -1475,7 +1475,7 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
if ((dmessage == NULL)
|| (!dbus_message_set_error_name (dmessage, DBUS_ERROR_FAILED))
|| (!dbus_message_set_reply_serial (dmessage, XUINT (serial)))
- || (!dbus_message_set_destination (dmessage, SDATA (service))))
+ || (!dbus_message_set_destination (dmessage, SSDATA (service))))
{
UNGCPRO;
XD_SIGNAL1 (build_string ("Unable to create a error message"));
@@ -1591,9 +1591,9 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
connection = xd_initialize (bus, TRUE);
/* Create the message. */
- dmessage = dbus_message_new_signal (SDATA (path),
- SDATA (interface),
- SDATA (signal));
+ dmessage = dbus_message_new_signal (SSDATA (path),
+ SSDATA (interface),
+ SSDATA (signal));
UNGCPRO;
if (dmessage == NULL)
XD_SIGNAL1 (build_string ("Unable to create a new message"));
@@ -1745,11 +1745,11 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
/* key has the structure (UNAME SERVICE PATH HANDLER). */
if (((uname == NULL)
|| (NILP (CAR_SAFE (key)))
- || (strcmp (uname, SDATA (CAR_SAFE (key))) == 0))
+ || (strcmp (uname, SSDATA (CAR_SAFE (key))) == 0))
&& ((path == NULL)
|| (NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (key)))))
|| (strcmp (path,
- SDATA (CAR_SAFE (CDR_SAFE (CDR_SAFE (key)))))
+ SSDATA (CAR_SAFE (CDR_SAFE (CDR_SAFE (key)))))
== 0))
&& (!NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key)))))))
{
@@ -1888,7 +1888,6 @@ usage: (dbus-register-service BUS SERVICE &rest FLAGS) */)
(int nargs, register Lisp_Object *args)
{
Lisp_Object bus, service;
- struct gcpro gcpro1, gcpro2;
DBusConnection *connection;
unsigned int i;
unsigned int value;
@@ -1921,7 +1920,7 @@ usage: (dbus-register-service BUS SERVICE &rest FLAGS) */)
/* Request the known name from the bus. */
dbus_error_init (&derror);
- result = dbus_bus_request_name (connection, SDATA (service), flags,
+ result = dbus_bus_request_name (connection, SSDATA (service), flags,
&derror);
if (dbus_error_is_set (&derror))
XD_ERROR (derror);
@@ -2019,8 +2018,8 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
name of "org.freedesktop.DBus" is that string itself. */
if ((STRINGP (service))
&& (SBYTES (service) > 0)
- && (strcmp (SDATA (service), DBUS_SERVICE_DBUS) != 0)
- && (strncmp (SDATA (service), ":", 1) != 0))
+ && (strcmp (SSDATA (service), DBUS_SERVICE_DBUS) != 0)
+ && (strncmp (SSDATA (service), ":", 1) != 0))
{
uname = call2 (intern ("dbus-get-name-owner"), bus, service);
/* When there is no unique name, we mark it with an empty
@@ -2122,7 +2121,6 @@ discovering the still incomplete interface.*/)
Lisp_Object dont_register_service)
{
Lisp_Object key, key1, value;
- DBusError derror;
Lisp_Object args[2] = { bus, service };
/* Check parameters. */
@@ -2350,4 +2348,3 @@ be called when the D-Bus reply message arrives. */);
}
#endif /* HAVE_DBUS */
-
diff --git a/src/deps.mk b/src/deps.mk
index 77994bcaad..35754dfa7d 100644
--- a/src/deps.mk
+++ b/src/deps.mk
@@ -87,12 +87,13 @@ dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
lisp.h $(config_h)
editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
- coding.h frame.h blockinput.h atimer.h ../lib/unistd.h ../lib/strftime.h \
+ coding.h frame.h blockinput.h atimer.h \
+ ../lib/intprops.h ../lib/strftime.h ../lib/unistd.h \
lisp.h globals.h $(config_h)
emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \
globals.h ../lib/unistd.h window.h dispextern.h keyboard.h keymap.h \
- frame.h coding.h gnutls.h msdos.h
+ frame.h coding.h gnutls.h msdos.h unexec.h
fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h \
commands.h globals.h ../lib/unistd.h
@@ -190,24 +191,23 @@ sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
term.o: term.c termchar.h termhooks.h termopts.h lisp.h globals.h $(config_h) \
cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \
xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \
- systty.h syssignal.h $(INTERVALS_H) buffer.h ../lib/unistd.h
-termcap.o: termcap.c lisp.h $(config_h)
+ systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h
+termcap.o: termcap.c lisp.h tparam.h msdos.h $(config_h)
terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \
msdos.h
terminfo.o: terminfo.c lisp.h globals.h $(config_h)
-tparam.o: tparam.c lisp.h $(config_h)
+tparam.o: tparam.c tparam.h lisp.h $(config_h)
undo.o: undo.c buffer.h commands.h window.h dispextern.h msdos.h \
lisp.h globals.h $(config_h)
-unexaix.o: unexaix.c lisp.h $(config_h)
-unexalpha.o: unexalpha.c $(config_h)
-unexcw.o: unexcw.c lisp.h $(config_h)
-unexcoff.o: unexcoff.c lisp.h $(config_h)
-unexelf.o: unexelf.c ../lib/unistd.h $(config_h)
-unexhp9k800.o: unexhp9k800.c $(config_h)
-unexmacosx.o: unexmacosx.c $(config_h)
-unexsol.o: unexsol.c lisp.h $(config_h)
-unexw32.o: unexw32.c $(config_h)
+unexaix.o: unexaix.c lisp.h unexec.h $(config_h)
+unexcw.o: unexcw.c lisp.h unexec.h $(config_h)
+unexcoff.o: unexcoff.c lisp.h unexec.h $(config_h)
+unexelf.o: unexelf.c unexec.h ../lib/unistd.h $(config_h)
+unexhp9k800.o: unexhp9k800.c unexec.h $(config_h)
+unexmacosx.o: unexmacosx.c unexec.h $(config_h)
+unexsol.o: unexsol.c lisp.h unexec.h $(config_h)
+unexw32.o: unexw32.c unexec.h $(config_h)
w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h)
widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
diff --git a/src/dired.c b/src/dired.c
index 96063680d4..176f14925b 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -79,11 +79,6 @@ extern struct direct *readdir (DIR *);
#include "regex.h"
#include "blockinput.h"
-/* Returns a search buffer, with a fastmap allocated and ready to go. */
-extern struct re_pattern_buffer *compile_pattern (Lisp_Object,
- struct re_registers *,
- Lisp_Object, int, int);
-
Lisp_Object Qdirectory_files;
Lisp_Object Qdirectory_files_and_attributes;
Lisp_Object Qfile_name_completion;
@@ -102,7 +97,7 @@ directory_files_internal_w32_unwind (Lisp_Object arg)
}
#endif
-Lisp_Object
+static Lisp_Object
directory_files_internal_unwind (Lisp_Object dh)
{
DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer;
@@ -233,11 +228,11 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
int len;
int wanted = 0;
Lisp_Object name, finalname;
- struct gcpro gcpro1, gcpro2;
+ struct gcpro inner_gcpro1, inner_gcpro2;
len = NAMLEN (dp);
name = finalname = make_unibyte_string (dp->d_name, len);
- GCPRO2 (finalname, name);
+ GCPRO2_VAR (finalname, name, inner_gcpro);
/* Note: DECODE_FILE can GC; it should protect its argument,
though. */
@@ -293,23 +288,23 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
/* Construct an expanded filename for the directory entry.
Use the decoded names for input to Ffile_attributes. */
Lisp_Object decoded_fullname, fileattrs;
- struct gcpro gcpro1, gcpro2;
+ struct gcpro innermost_gcpro1, innermost_gcpro2;
decoded_fullname = fileattrs = Qnil;
- GCPRO2 (decoded_fullname, fileattrs);
+ GCPRO2_VAR (decoded_fullname, fileattrs, innermost_gcpro);
/* Both Fexpand_file_name and Ffile_attributes can GC. */
decoded_fullname = Fexpand_file_name (name, directory);
fileattrs = Ffile_attributes (decoded_fullname, id_format);
list = Fcons (Fcons (finalname, fileattrs), list);
- UNGCPRO;
+ UNGCPRO_VAR (innermost_gcpro);
}
else
list = Fcons (finalname, list);
}
- UNGCPRO;
+ UNGCPRO_VAR (inner_gcpro);
}
}
@@ -676,11 +671,11 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
if (!NILP (predicate))
{
Lisp_Object val;
- struct gcpro gcpro1;
+ struct gcpro inner_gcpro1;
- GCPRO1 (name);
+ GCPRO1_VAR (name, inner_gcpro);
val = call1 (predicate, name);
- UNGCPRO;
+ UNGCPRO_VAR (inner_gcpro);
if (NILP (val))
continue;
@@ -702,16 +697,16 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
Lisp_Object zero = make_number (0);
/* FIXME: This is a copy of the code in Ftry_completion. */
int compare = min (bestmatchsize, SCHARS (name));
- Lisp_Object tem
+ Lisp_Object cmp
= Fcompare_strings (bestmatch, zero,
make_number (compare),
name, zero,
make_number (compare),
completion_ignore_case ? Qt : Qnil);
int matchsize
- = (EQ (tem, Qt) ? compare
- : XINT (tem) < 0 ? - XINT (tem) - 1
- : XINT (tem) - 1);
+ = (EQ (cmp, Qt) ? compare
+ : XINT (cmp) < 0 ? - XINT (cmp) - 1
+ : XINT (cmp) - 1);
if (completion_ignore_case)
{
@@ -735,18 +730,18 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
(((matchsize == SCHARS (name))
==
(matchsize + !!directoryp == SCHARS (bestmatch)))
- && (tem = Fcompare_strings (name, zero,
+ && (cmp = Fcompare_strings (name, zero,
make_number (SCHARS (file)),
file, zero,
Qnil,
Qnil),
- EQ (Qt, tem))
- && (tem = Fcompare_strings (bestmatch, zero,
+ EQ (Qt, cmp))
+ && (cmp = Fcompare_strings (bestmatch, zero,
make_number (SCHARS (file)),
file, zero,
Qnil,
Qnil),
- ! EQ (Qt, tem))))
+ ! EQ (Qt, cmp))))
bestmatch = name;
}
bestmatchsize = matchsize;
@@ -795,8 +790,8 @@ scmp (const char *s1, const char *s2, int len)
if (completion_ignore_case)
{
while (l
- && (DOWNCASE ((unsigned char) *s1++)
- == DOWNCASE ((unsigned char) *s2++)))
+ && (downcase ((unsigned char) *s1++)
+ == downcase ((unsigned char) *s2++)))
l--;
}
else
@@ -848,13 +843,6 @@ file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_ad
return value;
}
-Lisp_Object
-make_time (time_t time)
-{
- return Fcons (make_number (time >> 16),
- Fcons (make_number (time & 0177777), Qnil));
-}
-
static char *
stat_uname (struct stat *st)
{
diff --git a/src/dispextern.h b/src/dispextern.h
index 37ae7ee5fd..9843dfd1fc 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2944,6 +2944,7 @@ enum tool_bar_item_image
extern void bidi_init_it (EMACS_INT, EMACS_INT, struct bidi_it *);
extern void bidi_move_to_visually_next (struct bidi_it *);
+extern void bidi_dump_cached_states (void);
extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int);
extern int bidi_mirror_char (int);
@@ -3325,9 +3326,10 @@ extern struct terminal *init_tty (const char *, const char *, int);
extern int scrolling_max_lines_saved (int, int, int *, int *, int *);
extern int scroll_cost (struct frame *, int, int, int);
-extern void do_line_insertion_deletion_costs (struct frame *, char *,
- char *, char *, char *,
- char *, char *, int);
+extern void do_line_insertion_deletion_costs (struct frame *, const char *,
+ const char *, const char *,
+ const char *, const char *,
+ const char *, int);
void scrolling_1 (struct frame *, int, int, int, int *, int *, int *,
int *, int);
diff --git a/src/doc.c b/src/doc.c
index b56464e721..158b09790f 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -323,17 +323,20 @@ string is passed through `substitute-command-keys'. */)
{
Lisp_Object fun;
Lisp_Object funcar;
- Lisp_Object tem, doc;
+ Lisp_Object doc;
int try_reload = 1;
documentation:
doc = Qnil;
- if (SYMBOLP (function)
- && (tem = Fget (function, Qfunction_documentation),
- !NILP (tem)))
- return Fdocumentation_property (function, Qfunction_documentation, raw);
+ if (SYMBOLP (function))
+ {
+ Lisp_Object tem = Fget (function, Qfunction_documentation);
+ if (!NILP (tem))
+ return Fdocumentation_property (function, Qfunction_documentation,
+ raw);
+ }
fun = Findirect_function (function, Qnil);
if (SUBRP (fun))
@@ -349,13 +352,16 @@ string is passed through `substitute-command-keys'. */)
{
if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) <= COMPILED_DOC_STRING)
return Qnil;
- tem = AREF (fun, COMPILED_DOC_STRING);
- if (STRINGP (tem))
- doc = tem;
- else if (NATNUMP (tem) || CONSP (tem))
- doc = tem;
else
- return Qnil;
+ {
+ Lisp_Object tem = AREF (fun, COMPILED_DOC_STRING);
+ if (STRINGP (tem))
+ doc = tem;
+ else if (NATNUMP (tem) || CONSP (tem))
+ doc = tem;
+ else
+ return Qnil;
+ }
}
else if (STRINGP (fun) || VECTORP (fun))
{
@@ -372,9 +378,8 @@ string is passed through `substitute-command-keys'. */)
|| (EQ (funcar, Qclosure) && (fun = XCDR (fun), 1))
|| EQ (funcar, Qautoload))
{
- Lisp_Object tem1;
- tem1 = Fcdr (Fcdr (fun));
- tem = Fcar (tem1);
+ Lisp_Object tem1 = Fcdr (Fcdr (fun));
+ Lisp_Object tem = Fcar (tem1);
if (STRINGP (tem))
doc = tem;
/* Handle a doc reference--but these never come last
@@ -542,7 +547,7 @@ the same file name is found in the `doc-directory'. */)
char buf[1024 + 1];
register EMACS_INT filled;
register EMACS_INT pos;
- register char *p, *end;
+ register char *p;
Lisp_Object sym;
char *name;
int skip_file = 0;
@@ -601,6 +606,7 @@ the same file name is found in the `doc-directory'. */)
pos = 0;
while (1)
{
+ register char *end;
if (filled < 512)
filled += emacs_read (fd, &buf[filled], sizeof buf - 1 - filled);
if (!filled)
diff --git a/src/editfns.c b/src/editfns.c
index 28690e7c76..1f98ff040b 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -45,6 +45,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#include <ctype.h>
+#include <limits.h>
+#include <intprops.h>
#include <strftime.h>
#include "intervals.h"
@@ -87,6 +89,7 @@ extern char **environ;
extern Lisp_Object w32_get_internal_run_time (void);
#endif
+static void time_overflow (void) NO_RETURN;
static int tm_diff (struct tm *, struct tm *);
static void find_field (Lisp_Object, Lisp_Object, Lisp_Object,
EMACS_INT *, Lisp_Object, EMACS_INT *);
@@ -119,7 +122,7 @@ Lisp_Object Qboundary;
void
init_editfns (void)
{
- char *user_name;
+ const char *user_name;
register char *p;
struct passwd *pw; /* password entry for the current user */
Lisp_Object tem;
@@ -133,7 +136,7 @@ init_editfns (void)
return;
#endif /* not CANNOT_DUMP */
- pw = (struct passwd *) getpwuid (getuid ());
+ pw = getpwuid (getuid ());
#ifdef MSDOS
/* We let the real user name default to "root" because that's quite
accurate on MSDOG and because it lets Emacs find the init file.
@@ -145,17 +148,17 @@ init_editfns (void)
/* Get the effective user name, by consulting environment variables,
or the effective uid if those are unset. */
- user_name = (char *) getenv ("LOGNAME");
+ user_name = getenv ("LOGNAME");
if (!user_name)
#ifdef WINDOWSNT
- user_name = (char *) getenv ("USERNAME"); /* it's USERNAME on NT */
+ user_name = getenv ("USERNAME"); /* it's USERNAME on NT */
#else /* WINDOWSNT */
- user_name = (char *) getenv ("USER");
+ user_name = getenv ("USER");
#endif /* WINDOWSNT */
if (!user_name)
{
- pw = (struct passwd *) getpwuid (geteuid ());
- user_name = (char *) (pw ? pw->pw_name : "unknown");
+ pw = getpwuid (geteuid ());
+ user_name = pw ? pw->pw_name : "unknown";
}
Vuser_login_name = build_string (user_name);
@@ -1263,9 +1266,9 @@ of the user with that uid, or nil if there is no such user. */)
if (NILP (uid))
return Vuser_login_name;
- id = (uid_t)XFLOATINT (uid);
+ id = XFLOATINT (uid);
BLOCK_INPUT;
- pw = (struct passwd *) getpwuid (id);
+ pw = getpwuid (id);
UNBLOCK_INPUT;
return (pw ? build_string (pw->pw_name) : Qnil);
}
@@ -1297,7 +1300,7 @@ Value is an integer or a float, depending on the value. */)
/* Make sure we don't produce a negative UID due to signed integer
overflow. */
if (euid < 0)
- return make_float ((double)geteuid ());
+ return make_float (geteuid ());
return make_fixnum_or_float (euid);
}
@@ -1313,7 +1316,7 @@ Value is an integer or a float, depending on the value. */)
/* Make sure we don't produce a negative UID due to signed integer
overflow. */
if (uid < 0)
- return make_float ((double)getuid ());
+ return make_float (getuid ());
return make_fixnum_or_float (uid);
}
@@ -1336,14 +1339,15 @@ name, or nil if there is no such user. */)
return Vuser_full_name;
else if (NUMBERP (uid))
{
+ uid_t u = XFLOATINT (uid);
BLOCK_INPUT;
- pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid));
+ pw = getpwuid (u);
UNBLOCK_INPUT;
}
else if (STRINGP (uid))
{
BLOCK_INPUT;
- pw = (struct passwd *) getpwnam (SSDATA (uid));
+ pw = getpwnam (SSDATA (uid));
UNBLOCK_INPUT;
}
else
@@ -1371,7 +1375,7 @@ name, or nil if there is no such user. */)
memcpy (r, p, q - p);
r[q - p] = 0;
strcat (r, SSDATA (login));
- r[q - p] = UPCASE ((unsigned char) r[q - p]);
+ r[q - p] = upcase ((unsigned char) r[q - p]);
strcat (r, q + 1);
full = build_string (r);
}
@@ -1387,8 +1391,6 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
return Vsystem_name;
}
-/* For the benefit of callers who don't want to include lisp.h */
-
const char *
get_system_name (void)
{
@@ -1414,6 +1416,49 @@ DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
return make_number (getpid ());
}
+
+
+#ifndef TIME_T_MIN
+# define TIME_T_MIN TYPE_MINIMUM (time_t)
+#endif
+#ifndef TIME_T_MAX
+# define TIME_T_MAX TYPE_MAXIMUM (time_t)
+#endif
+
+/* Report that a time value is out of range for Emacs. */
+static void
+time_overflow (void)
+{
+ error ("Specified time is not representable");
+}
+
+/* Return the upper part of the time T (everything but the bottom 16 bits),
+ making sure that it is representable. */
+static EMACS_INT
+hi_time (time_t t)
+{
+ time_t hi = t >> 16;
+
+ /* Check for overflow, helping the compiler for common cases where
+ no runtime check is needed, and taking care not to convert
+ negative numbers to unsigned before comparing them. */
+ if (! ((! TYPE_SIGNED (time_t)
+ || MOST_NEGATIVE_FIXNUM <= TIME_T_MIN >> 16
+ || MOST_NEGATIVE_FIXNUM <= hi)
+ && (TIME_T_MAX >> 16 <= MOST_POSITIVE_FIXNUM
+ || hi <= MOST_POSITIVE_FIXNUM)))
+ time_overflow ();
+
+ return hi;
+}
+
+/* Return the bottom 16 bits of the time T. */
+static EMACS_INT
+lo_time (time_t t)
+{
+ return t & ((1 << 16) - 1);
+}
+
DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0,
doc: /* Return the current time, as the number of seconds since 1970-01-01 00:00:00.
The time is returned as a list of three integers. The first has the
@@ -1428,8 +1473,8 @@ resolution finer than a second. */)
EMACS_TIME t;
EMACS_GET_TIME (t);
- return list3 (make_number ((EMACS_SECS (t) >> 16) & 0xffff),
- make_number ((EMACS_SECS (t) >> 0) & 0xffff),
+ return list3 (make_number (hi_time (EMACS_SECS (t))),
+ make_number (lo_time (EMACS_SECS (t))),
make_number (EMACS_USECS (t)));
}
@@ -1448,7 +1493,8 @@ on systems that do not provide resolution finer than a second. */)
{
#ifdef HAVE_GETRUSAGE
struct rusage usage;
- int secs, usecs;
+ time_t secs;
+ int usecs;
if (getrusage (RUSAGE_SELF, &usage) < 0)
/* This shouldn't happen. What action is appropriate? */
@@ -1463,8 +1509,8 @@ on systems that do not provide resolution finer than a second. */)
secs++;
}
- return list3 (make_number ((secs >> 16) & 0xffff),
- make_number ((secs >> 0) & 0xffff),
+ return list3 (make_number (hi_time (secs)),
+ make_number (lo_time (secs)),
make_number (usecs));
#else /* ! HAVE_GETRUSAGE */
#ifdef WINDOWSNT
@@ -1476,6 +1522,19 @@ on systems that do not provide resolution finer than a second. */)
}
+/* Make a Lisp list that represents the time T. */
+Lisp_Object
+make_time (time_t t)
+{
+ return list2 (make_number (hi_time (t)),
+ make_number (lo_time (t)));
+}
+
+/* Decode a Lisp list SPECIFIED_TIME that represents a time.
+ If SPECIFIED_TIME is nil, use the current time.
+ Set *RESULT to seconds since the Epoch.
+ If USEC is not null, set *USEC to the microseconds component.
+ Return nonzero if successful. */
int
lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
{
@@ -1496,6 +1555,7 @@ lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
else
{
Lisp_Object high, low;
+ EMACS_INT hi;
high = Fcar (specified_time);
CHECK_NUMBER (high);
low = Fcdr (specified_time);
@@ -1519,8 +1579,21 @@ lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
else if (usec)
*usec = 0;
CHECK_NUMBER (low);
- *result = (XINT (high) << 16) + (XINT (low) & 0xffff);
- return *result >> 16 == XINT (high);
+ hi = XINT (high);
+
+ /* Check for overflow, helping the compiler for common cases
+ where no runtime check is needed, and taking care not to
+ convert negative numbers to unsigned before comparing them. */
+ if (! ((TYPE_SIGNED (time_t)
+ ? (TIME_T_MIN >> 16 <= MOST_NEGATIVE_FIXNUM
+ || TIME_T_MIN >> 16 <= hi)
+ : 0 <= hi)
+ && (MOST_POSITIVE_FIXNUM <= TIME_T_MAX >> 16
+ || hi <= TIME_T_MAX >> 16)))
+ return 0;
+
+ *result = (hi << 16) + (XINT (low) & 0xffff);
+ return 1;
}
}
@@ -1648,7 +1721,7 @@ The modifiers are `E' and `O'. For certain characters X,
%OX is like %X, but uses the locale's number symbols.
For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
- (Lisp_Object format_string, Lisp_Object time, Lisp_Object universal)
+ (Lisp_Object format_string, Lisp_Object timeval, Lisp_Object universal)
{
time_t value;
int size;
@@ -1659,7 +1732,7 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
CHECK_STRING (format_string);
- if (! (lisp_time_argument (time, &value, &usec)
+ if (! (lisp_time_argument (timeval, &value, &usec)
&& 0 <= usec && usec < 1000000))
error ("Invalid time specification");
ns = usec * 1000;
@@ -1674,7 +1747,7 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
tm = ut ? gmtime (&value) : localtime (&value);
UNBLOCK_INPUT;
if (! tm)
- error ("Specified time is not representable");
+ time_overflow ();
synchronize_system_time_locale ();
@@ -1732,8 +1805,10 @@ DOW and ZONE.) */)
BLOCK_INPUT;
decoded_time = localtime (&time_spec);
UNBLOCK_INPUT;
- if (! decoded_time)
- error ("Specified time is not representable");
+ if (! (decoded_time
+ && MOST_NEGATIVE_FIXNUM - TM_YEAR_BASE <= decoded_time->tm_year
+ && decoded_time->tm_year <= MOST_POSITIVE_FIXNUM - TM_YEAR_BASE))
+ time_overflow ();
XSETFASTINT (list_args[0], decoded_time->tm_sec);
XSETFASTINT (list_args[1], decoded_time->tm_min);
XSETFASTINT (list_args[2], decoded_time->tm_hour);
@@ -1757,6 +1832,20 @@ DOW and ZONE.) */)
return Flist (9, list_args);
}
+/* Return OBJ - OFFSET, checking that OBJ is a valid fixnum and that
+ the result is representable as an int. Assume OFFSET is small and
+ nonnegative. */
+static int
+check_tm_member (Lisp_Object obj, int offset)
+{
+ EMACS_INT n;
+ CHECK_NUMBER (obj);
+ n = XINT (obj);
+ if (! (INT_MIN + offset <= n && n - offset <= INT_MAX))
+ time_overflow ();
+ return n - offset;
+}
+
DEFUN ("encode-time", Fencode_time, Sencode_time, 6, MANY, 0,
doc: /* Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
This is the reverse operation of `decode-time', which see.
@@ -1781,23 +1870,16 @@ year values as low as 1901 do work.
usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
(int nargs, register Lisp_Object *args)
{
- time_t time;
+ time_t value;
struct tm tm;
Lisp_Object zone = (nargs > 6 ? args[nargs - 1] : Qnil);
- CHECK_NUMBER (args[0]); /* second */
- CHECK_NUMBER (args[1]); /* minute */
- CHECK_NUMBER (args[2]); /* hour */
- CHECK_NUMBER (args[3]); /* day */
- CHECK_NUMBER (args[4]); /* month */
- CHECK_NUMBER (args[5]); /* year */
-
- tm.tm_sec = XINT (args[0]);
- tm.tm_min = XINT (args[1]);
- tm.tm_hour = XINT (args[2]);
- tm.tm_mday = XINT (args[3]);
- tm.tm_mon = XINT (args[4]) - 1;
- tm.tm_year = XINT (args[5]) - TM_YEAR_BASE;
+ tm.tm_sec = check_tm_member (args[0], 0);
+ tm.tm_min = check_tm_member (args[1], 0);
+ tm.tm_hour = check_tm_member (args[2], 0);
+ tm.tm_mday = check_tm_member (args[3], 0);
+ tm.tm_mon = check_tm_member (args[4], 1);
+ tm.tm_year = check_tm_member (args[5], TM_YEAR_BASE);
tm.tm_isdst = -1;
if (CONSP (zone))
@@ -1805,7 +1887,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
if (NILP (zone))
{
BLOCK_INPUT;
- time = mktime (&tm);
+ value = mktime (&tm);
UNBLOCK_INPUT;
}
else
@@ -1833,7 +1915,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
set_time_zone_rule (tzstring);
BLOCK_INPUT;
- time = mktime (&tm);
+ value = mktime (&tm);
UNBLOCK_INPUT;
/* Restore TZ to previous value. */
@@ -1845,10 +1927,10 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
#endif
}
- if (time == (time_t) -1)
- error ("Specified time is not representable");
+ if (value == (time_t) -1)
+ time_overflow ();
- return make_time (time);
+ return make_time (value);
}
DEFUN ("current-time-string", Fcurrent_time_string, Scurrent_time_string, 0, 1, 0,
@@ -1881,7 +1963,7 @@ but this is considered obsolete. */)
tm = localtime (&value);
UNBLOCK_INPUT;
if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) && (tem = asctime (tm))))
- error ("Specified time is not representable");
+ time_overflow ();
/* Remove the trailing newline. */
tem[strlen (tem) - 1] = '\0';
@@ -2258,7 +2340,7 @@ from adjoining text, if those properties are sticky. */)
(Lisp_Object character, Lisp_Object count, Lisp_Object inherit)
{
register char *string;
- register EMACS_INT strlen;
+ register EMACS_INT stringlen;
register int i;
register EMACS_INT n;
int len;
@@ -2276,18 +2358,18 @@ from adjoining text, if those properties are sticky. */)
n = XINT (count) * len;
if (n <= 0)
return Qnil;
- strlen = min (n, 256 * len);
- string = (char *) alloca (strlen);
- for (i = 0; i < strlen; i++)
+ stringlen = min (n, 256 * len);
+ string = (char *) alloca (stringlen);
+ for (i = 0; i < stringlen; i++)
string[i] = str[i % len];
- while (n >= strlen)
+ while (n >= stringlen)
{
QUIT;
if (!NILP (inherit))
- insert_and_inherit (string, strlen);
+ insert_and_inherit (string, stringlen);
else
- insert (string, strlen);
- n -= strlen;
+ insert (string, stringlen);
+ n -= stringlen;
}
if (n > 0)
{
@@ -2946,8 +3028,7 @@ It returns the number of characters changed. */)
EMACS_INT size; /* Size of translate table. */
EMACS_INT pos, pos_byte, end_pos;
int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
- int string_multibyte;
- Lisp_Object val;
+ int string_multibyte IF_LINT (= 0);
validate_region (&start, &end);
if (CHAR_TABLE_P (table))
@@ -3846,7 +3927,7 @@ usage: (format STRING &rest OBJECTS) */)
/* handle case (precision[n] >= 0) */
int width, padding;
- EMACS_INT nbytes, start, end;
+ EMACS_INT nbytes, start;
EMACS_INT nchars_string;
/* lisp_string_width ignores a precision of 0, but GNU
@@ -3878,7 +3959,6 @@ usage: (format STRING &rest OBJECTS) */)
info[n].start = start = nchars;
nchars += nchars_string;
- end = nchars;
if (p > buf
&& multibyte
@@ -4130,7 +4210,7 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
{
int i1, i2;
/* Check they're chars, not just integers, otherwise we could get array
- bounds violations in DOWNCASE. */
+ bounds violations in downcase. */
CHECK_CHARACTER (c1);
CHECK_CHARACTER (c2);
@@ -4139,9 +4219,6 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
if (NILP (BVAR (current_buffer, case_fold_search)))
return Qnil;
- /* Do these in separate statements,
- then compare the variables.
- because of the way DOWNCASE uses temp variables. */
i1 = XFASTINT (c1);
if (NILP (BVAR (current_buffer, enable_multibyte_characters))
&& ! ASCII_CHAR_P (i1))
@@ -4154,9 +4231,7 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
{
MAKE_CHAR_MULTIBYTE (i2);
}
- i1 = DOWNCASE (i1);
- i2 = DOWNCASE (i2);
- return (i1 == i2 ? Qt : Qnil);
+ return (downcase (i1) == downcase (i2) ? Qt : Qnil);
}
/* Transpose the markers in two regions of the current buffer, and
diff --git a/src/emacs.c b/src/emacs.c
index 4455e6b4d9..052f22ea62 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -141,7 +141,7 @@ Lisp_Object Qfile_name_handler_alist;
Lisp_Object Qrisky_local_variable;
-/* If non-zero, emacs should not attempt to use a window-specific code,
+/* If non-zero, Emacs should not attempt to use a window-specific code,
but instead should use the virtual terminal under which it was started. */
int inhibit_window_system;
@@ -169,7 +169,6 @@ static unsigned long heap_bss_diff;
#define MAX_HEAP_BSS_DIFF (1024*1024)
/* Nonzero means running Emacs without interactive terminal. */
-
int noninteractive;
/* Nonzero means remove site-lisp directories from load-path. */
@@ -249,14 +248,14 @@ Display options:\n\
--border-color, -bd COLOR main border color\n\
--border-width, -bw WIDTH width of main border\n\
--color, --color=MODE override color mode for character terminals;\n\
- MODE defaults to `auto', and can also\n\
- be `never', `auto', `always',\n\
+ MODE defaults to `auto', and\n\
+ can also be `never', `always',\n\
or a mode name like `ansi8'\n\
--cursor-color, -cr COLOR color of the Emacs cursor indicating point\n\
--font, -fn FONT default font; must be fixed-width\n\
--foreground-color, -fg COLOR window foreground color\n\
--fullheight, -fh make the first frame high as the screen\n\
---fullscreen, -fs make first frame fullscreen\n\
+--fullscreen, -fs make the first frame fullscreen\n\
--fullwidth, -fw make the first frame wide as the screen\n\
--maximized, -mm make the first frame maximized\n\
--geometry, -g GEOMETRY window geometry\n\
@@ -382,7 +381,7 @@ static void
init_cmdargs (int argc, char **argv, int skip_args)
{
register int i;
- Lisp_Object name, dir, tem;
+ Lisp_Object name, dir, handler;
int count = SPECPDL_INDEX ();
Lisp_Object raw_name;
@@ -393,8 +392,8 @@ init_cmdargs (int argc, char **argv, int skip_args)
/* Add /: to the front of the name
if it would otherwise be treated as magic. */
- tem = Ffind_file_name_handler (raw_name, Qt);
- if (! NILP (tem))
+ handler = Ffind_file_name_handler (raw_name, Qt);
+ if (! NILP (handler))
raw_name = concat2 (build_string ("/:"), raw_name);
Vinvocation_name = Ffile_name_nondirectory (raw_name);
@@ -411,8 +410,8 @@ init_cmdargs (int argc, char **argv, int skip_args)
{
/* Add /: to the front of the name
if it would otherwise be treated as magic. */
- tem = Ffind_file_name_handler (found, Qt);
- if (! NILP (tem))
+ handler = Ffind_file_name_handler (found, Qt);
+ if (! NILP (handler))
found = concat2 (build_string ("/:"), found);
Vinvocation_directory = Ffile_name_directory (found);
}
@@ -547,21 +546,22 @@ static char dump_tz[] = "UtC0";
Provide dummy definitions to avoid error.
(We don't have any real constructors or destructors.) */
#ifdef __GNUC__
+
+/* Define a dummy function F. Declare F too, to pacify gcc
+ -Wmissing-prototypes. */
+#define DEFINE_DUMMY_FUNCTION(f) void f (void); void f (void) {}
+
#ifndef GCC_CTORS_IN_LIBC
-void __do_global_ctors (void)
-{}
-void __do_global_ctors_aux (void)
-{}
-void __do_global_dtors (void)
-{}
+DEFINE_DUMMY_FUNCTION (__do_global_ctors)
+DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux)
+DEFINE_DUMMY_FUNCTION (__do_global_dtors)
/* GNU/Linux has a bug in its library; avoid an error. */
#ifndef GNU_LINUX
char * __CTOR_LIST__[2] = { (char *) (-1), 0 };
#endif
char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
#endif /* GCC_CTORS_IN_LIBC */
-void __main (void)
-{}
+DEFINE_DUMMY_FUNCTION (__main)
#endif /* __GNUC__ */
#endif /* ORDINARY_LINK */
@@ -576,7 +576,8 @@ void __main (void)
enough information to do it right. */
static int
-argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr)
+argmatch (char **argv, int argc, const char *sstr, const char *lstr,
+ int minlen, char **valptr, int *skipptr)
{
char *p = NULL;
int arglen;
@@ -948,7 +949,7 @@ main (int argc, char **argv)
/* Convert --script to -scriptload, un-skip it, and sort again
so that it will be handled in proper sequence. */
/* FIXME broken for --script=FILE - is that supposed to work? */
- argv[skip_args - 1] = "-scriptload";
+ argv[skip_args - 1] = (char *) "-scriptload";
skip_args -= 2;
sort_args (argc, argv);
}
@@ -1347,7 +1348,7 @@ main (int argc, char **argv)
for (j = 0; j < count_before + 1; j++)
new[j] = argv[j];
- new[count_before + 1] = "-d";
+ new[count_before + 1] = (char *) "-d";
new[count_before + 2] = displayname;
for (j = count_before + 2; j <argc; j++)
new[j + 1] = argv[j];
@@ -1357,7 +1358,7 @@ main (int argc, char **argv)
/* Change --display to -d, when its arg is separate. */
else if (displayname != 0 && skip_args > count_before
&& argv[count_before + 1][1] == '-')
- argv[count_before + 1] = "-d";
+ argv[count_before + 1] = (char *) "-d";
if (! no_site_lisp)
{
@@ -2084,9 +2085,7 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
#ifndef CANNOT_DUMP
-/* FIXME: maybe this should go into header file, config.h seems the
- only one appropriate. */
-extern int unexec (const char *, const char *);
+#include "unexec.h"
DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0,
doc: /* Dump current state of Emacs into executable file FILENAME.
@@ -2380,7 +2379,7 @@ Special values:
Anything else (in Emacs 24.1, the possibilities are: aix, berkeley-unix,
hpux, irix, usg-unix-v) indicates some sort of Unix system. */);
Vsystem_type = intern_c_string (SYSTEM_TYPE);
- /* Above values are from SYSTEM_TYPE in src/s/*.h. */
+ /* The above values are from SYSTEM_TYPE in include files under src/s. */
DEFVAR_LISP ("system-configuration", Vsystem_configuration,
doc: /* Value is string indicating configuration Emacs was built for.
diff --git a/src/eval.c b/src/eval.c
index 2fb89ce404..c22e7d3f57 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -160,7 +160,7 @@ restore_stack_limits (Lisp_Object data)
/* Call the Lisp debugger, giving it argument ARG. */
-Lisp_Object
+static Lisp_Object
call_debugger (Lisp_Object arg)
{
int debug_while_redisplaying;
@@ -216,7 +216,7 @@ call_debugger (Lisp_Object arg)
return unbind_to (count, val);
}
-void
+static void
do_debug_on_call (Lisp_Object code)
{
debug_on_next_call = 0;
@@ -796,11 +796,11 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
if (SYMBOL_CONSTANT_P (sym))
{
/* For upward compatibility, allow (defvar :foo (quote :foo)). */
- Lisp_Object tem = Fcar (tail);
- if (! (CONSP (tem)
- && EQ (XCAR (tem), Qquote)
- && CONSP (XCDR (tem))
- && EQ (XCAR (XCDR (tem)), sym)))
+ Lisp_Object tem1 = Fcar (tail);
+ if (! (CONSP (tem1)
+ && EQ (XCAR (tem1), Qquote)
+ && CONSP (XCDR (tem1))
+ && EQ (XCAR (XCDR (tem1)), sym)))
error ("Constant symbol `%s' specified in defvar",
SDATA (SYMBOL_NAME (sym)));
}
@@ -840,11 +840,12 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
Vinternal_interpreter_environment =
Fcons (sym, Vinternal_interpreter_environment);
else
- /* Simple (defvar <var>) should not count as a definition at all.
- It could get in the way of other definitions, and unloading this
- package could try to make the variable unbound. */
- ;
-
+ {
+ /* Simple (defvar <var>) should not count as a definition at all.
+ It could get in the way of other definitions, and unloading this
+ package could try to make the variable unbound. */
+ }
+
return sym;
}
@@ -895,7 +896,8 @@ user_variable_p_eh (Lisp_Object ignore)
static Lisp_Object
lisp_indirect_variable (Lisp_Object sym)
{
- XSETSYMBOL (sym, indirect_variable (XSYMBOL (sym)));
+ struct Lisp_Symbol *s = indirect_variable (XSYMBOL (sym));
+ XSETSYMBOL (sym, s);
return sym;
}
@@ -1720,7 +1722,7 @@ See also the function `condition-case'. */)
if (!NILP (clause))
break;
}
-
+
if (/* Don't run the debugger for a memory-full error.
(There is no room in memory to do that!) */
!NILP (error_symbol)
@@ -1737,13 +1739,13 @@ See also the function `condition-case'. */)
can continue code which has signaled a quit. */
if (debugger_called && EQ (real_error_symbol, Qquit))
return Qnil;
- }
+ }
if (!NILP (clause))
{
Lisp_Object unwind_data
= (NILP (error_symbol) ? data : Fcons (error_symbol, data));
-
+
h->chosen_clause = clause;
unwind_to_catch (h->tag, unwind_data);
}
@@ -1755,7 +1757,7 @@ See also the function `condition-case'. */)
if (! NILP (error_symbol))
data = Fcons (error_symbol, data);
-
+
string = Ferror_message_string (data);
fatal ("%s", SDATA (string), 0);
}
@@ -2648,8 +2650,8 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond)
}
else
{
- Lisp_Object globals = Qnil;
- GCPRO3 (sym, val, globals);
+ Lisp_Object global_vals = Qnil;
+ GCPRO3 (sym, val, global_vals);
for (;
CONSP (val) && ((cond == to_completion)
@@ -2661,23 +2663,25 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond)
{
/* t indicates this hook has a local binding;
it means to run the global binding too. */
- globals = Fdefault_value (sym);
- if (NILP (globals)) continue;
+ global_vals = Fdefault_value (sym);
+ if (NILP (global_vals)) continue;
- if (!CONSP (globals) || EQ (XCAR (globals), Qlambda))
+ if (!CONSP (global_vals) || EQ (XCAR (global_vals), Qlambda))
{
- args[0] = globals;
+ args[0] = global_vals;
ret = Ffuncall (nargs, args);
}
else
{
for (;
- CONSP (globals) && ((cond == to_completion)
- || (cond == until_success ? NILP (ret)
- : !NILP (ret)));
- globals = XCDR (globals))
+ (CONSP (global_vals)
+ && (cond == to_completion
+ || (cond == until_success
+ ? NILP (ret)
+ : !NILP (ret))));
+ global_vals = XCDR (global_vals))
{
- args[0] = XCAR (globals);
+ args[0] = XCAR (global_vals);
/* In a global value, t should not occur. If it does, we
must ignore it to avoid an endless loop. */
if (!EQ (args[0], Qt))
@@ -3248,7 +3252,7 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
return object;
}
-void
+static void
grow_specpdl (void)
{
register int count = SPECPDL_INDEX ();
@@ -3823,4 +3827,3 @@ alist of active lexical bindings. */);
defsubr (&Sspecial_variable_p);
defsubr (&Sfunctionp);
}
-
diff --git a/src/fileio.c b/src/fileio.c
index 18e9dbe968..5d33fb9387 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -178,7 +178,7 @@ report_file_error (const char *string, Lisp_Object data)
str = SSDATA (errstring);
c = STRING_CHAR ((unsigned char *) str);
- Faset (errstring, make_number (0), make_number (DOWNCASE (c)));
+ Faset (errstring, make_number (0), make_number (downcase (c)));
}
xsignal (Qfile_error,
@@ -433,8 +433,8 @@ get a current directory to run processes in. */)
}
-char *
-file_name_as_directory (char *out, char *in)
+static char *
+file_name_as_directory (char *out, const char *in)
{
int size = strlen (in) - 1;
@@ -496,7 +496,7 @@ For a Unix-syntax file name, just appends a slash. */)
* Value is nonzero if the string output is different from the input.
*/
-int
+static int
directory_file_name (char *src, char *dst)
{
long slen;
@@ -728,7 +728,8 @@ filesystem tree, not (expand-file-name ".." dirname). */)
{
/* These point to SDATA and need to be careful with string-relocation
during GC (via DECODE_FILE). */
- char *nm, *newdir;
+ char *nm;
+ const char *newdir;
/* This should only point to alloca'd data. */
char *target;
@@ -1013,21 +1014,23 @@ filesystem tree, not (expand-file-name ".." dirname). */)
if (!newdir && drive)
{
/* Get default directory if needed to make nm absolute. */
+ char *adir = NULL;
if (!IS_DIRECTORY_SEP (nm[0]))
{
- newdir = alloca (MAXPATHLEN + 1);
- if (!getdefdir (toupper (drive) - 'A' + 1, newdir))
- newdir = NULL;
+ adir = alloca (MAXPATHLEN + 1);
+ if (!getdefdir (toupper (drive) - 'A' + 1, adir))
+ adir = NULL;
}
- if (!newdir)
+ if (!adir)
{
/* Either nm starts with /, or drive isn't mounted. */
- newdir = alloca (4);
- newdir[0] = DRIVE_LETTER (drive);
- newdir[1] = ':';
- newdir[2] = '/';
- newdir[3] = 0;
+ adir = alloca (4);
+ adir[0] = DRIVE_LETTER (drive);
+ adir[1] = ':';
+ adir[2] = '/';
+ adir[3] = 0;
}
+ newdir = adir;
}
#endif /* DOS_NT */
@@ -1074,7 +1077,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
when we have pointers into lisp strings, we accomplish this
indirectly by prepending newdir to nm if necessary, and using
cwd (or the wd of newdir's drive) as the new newdir. */
-
+ char *adir;
if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]))
{
drive = (unsigned char) newdir[0];
@@ -1087,14 +1090,15 @@ filesystem tree, not (expand-file-name ".." dirname). */)
strcat (tmp, nm);
nm = tmp;
}
- newdir = alloca (MAXPATHLEN + 1);
+ adir = alloca (MAXPATHLEN + 1);
if (drive)
{
- if (!getdefdir (toupper (drive) - 'A' + 1, newdir))
+ if (!getdefdir (toupper (drive) - 'A' + 1, adir))
newdir = "/";
}
else
- getwd (newdir);
+ getwd (adir);
+ newdir = adir;
}
/* Strip off drive name from prefix, if present. */
@@ -1111,13 +1115,13 @@ filesystem tree, not (expand-file-name ".." dirname). */)
#ifdef WINDOWSNT
if (IS_DIRECTORY_SEP (newdir[0]) && IS_DIRECTORY_SEP (newdir[1]))
{
- char *p;
- newdir = strcpy (alloca (strlen (newdir) + 1), newdir);
- p = newdir + 2;
+ char *adir = strcpy (alloca (strlen (newdir) + 1), newdir);
+ char *p = adir + 2;
while (*p && !IS_DIRECTORY_SEP (*p)) p++;
p++;
while (*p && !IS_DIRECTORY_SEP (*p)) p++;
*p = 0;
+ newdir = adir;
}
else
#endif
@@ -1734,7 +1738,7 @@ expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir)
If QUICK is nonzero, we ask for y or n, not yes or no. */
-void
+static void
barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring,
int interactive, struct stat *statptr, int quick)
{
@@ -2041,7 +2045,6 @@ DEFUN ("delete-directory-internal", Fdelete_directory_internal,
(Lisp_Object directory)
{
const char *dir;
- Lisp_Object handler;
Lisp_Object encoded_dir;
CHECK_STRING (directory);
@@ -2753,7 +2756,7 @@ if file does not exist, is not accessible, or SELinux is disabled */)
#if HAVE_LIBSELINUX
if (is_selinux_enabled ())
{
- conlength = lgetfilecon (SDATA (absname), &con);
+ conlength = lgetfilecon (SSDATA (absname), &con);
if (conlength > 0)
{
context = context_new (con);
@@ -2808,34 +2811,35 @@ is disabled. */)
if (is_selinux_enabled ())
{
/* Get current file context. */
- conlength = lgetfilecon (SDATA (encoded_absname), &con);
+ conlength = lgetfilecon (SSDATA (encoded_absname), &con);
if (conlength > 0)
{
parsed_con = context_new (con);
/* Change the parts defined in the parameter.*/
if (STRINGP (user))
{
- if (context_user_set (parsed_con, SDATA (user)))
+ if (context_user_set (parsed_con, SSDATA (user)))
error ("Doing context_user_set");
}
if (STRINGP (role))
{
- if (context_role_set (parsed_con, SDATA (role)))
+ if (context_role_set (parsed_con, SSDATA (role)))
error ("Doing context_role_set");
}
if (STRINGP (type))
{
- if (context_type_set (parsed_con, SDATA (type)))
+ if (context_type_set (parsed_con, SSDATA (type)))
error ("Doing context_type_set");
}
if (STRINGP (range))
{
- if (context_range_set (parsed_con, SDATA (range)))
+ if (context_range_set (parsed_con, SSDATA (range)))
error ("Doing context_range_set");
}
/* Set the modified context back to the file. */
- fail = lsetfilecon (SDATA (encoded_absname), context_str (parsed_con));
+ fail = lsetfilecon (SSDATA (encoded_absname),
+ context_str (parsed_con));
if (fail)
report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil));
@@ -2937,19 +2941,19 @@ The value is an integer. */)
DEFUN ("set-file-times", Fset_file_times, Sset_file_times, 1, 2, 0,
- doc: /* Set times of file FILENAME to TIME.
+ doc: /* Set times of file FILENAME to TIMESTAMP.
Set both access and modification times.
Return t on success, else nil.
-Use the current time if TIME is nil. TIME is in the format of
+Use the current time if TIMESTAMP is nil. TIMESTAMP is in the format of
`current-time'. */)
- (Lisp_Object filename, Lisp_Object time)
+ (Lisp_Object filename, Lisp_Object timestamp)
{
Lisp_Object absname, encoded_absname;
Lisp_Object handler;
time_t sec;
int usec;
- if (! lisp_time_argument (time, &sec, &usec))
+ if (! lisp_time_argument (timestamp, &sec, &usec))
error ("Invalid time specification");
absname = Fexpand_file_name (filename, BVAR (current_buffer, directory));
@@ -2958,7 +2962,7 @@ Use the current time if TIME is nil. TIME is in the format of
call the corresponding file handler. */
handler = Ffind_file_name_handler (absname, Qset_file_times);
if (!NILP (handler))
- return call3 (handler, Qset_file_times, absname, time);
+ return call3 (handler, Qset_file_times, absname, timestamp);
encoded_absname = ENCODE_FILE (absname);
@@ -3354,13 +3358,13 @@ variable `last-coding-system-used' to the coding system actually used. */)
else if (nread > 0)
{
struct buffer *prev = current_buffer;
- Lisp_Object buffer;
+ Lisp_Object workbuf;
struct buffer *buf;
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
- buffer = Fget_buffer_create (build_string (" *code-converting-work*"));
- buf = XBUFFER (buffer);
+ workbuf = Fget_buffer_create (build_string (" *code-converting-work*"));
+ buf = XBUFFER (workbuf);
delete_all_overlays (buf);
BVAR (buf, directory) = BVAR (current_buffer, directory);
@@ -3872,7 +3876,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (not_regular)
{
- Lisp_Object val;
+ Lisp_Object nbytes;
/* Maybe make more room. */
if (gap_size < trytry)
@@ -3887,15 +3891,16 @@ variable `last-coding-system-used' to the coding system actually used. */)
non_regular_fd = fd;
non_regular_inserted = inserted;
non_regular_nbytes = trytry;
- val = internal_condition_case_1 (read_non_regular, Qnil, Qerror,
- read_non_regular_quit);
- if (NILP (val))
+ nbytes = internal_condition_case_1 (read_non_regular,
+ Qnil, Qerror,
+ read_non_regular_quit);
+ if (NILP (nbytes))
{
read_quit = 1;
break;
}
- this = XINT (val);
+ this = XINT (nbytes);
}
else
{
@@ -3986,7 +3991,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
care of marker adjustment. By this way, we can run Lisp
program safely before decoding the inserted text. */
Lisp_Object unwind_data;
- int count = SPECPDL_INDEX ();
+ int count1 = SPECPDL_INDEX ();
unwind_data = Fcons (BVAR (current_buffer, enable_multibyte_characters),
Fcons (BVAR (current_buffer, undo_list),
@@ -4013,7 +4018,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (CONSP (coding_system))
coding_system = XCAR (coding_system);
}
- unbind_to (count, Qnil);
+ unbind_to (count1, Qnil);
inserted = Z_BYTE - BEG_BYTE;
}
@@ -4116,7 +4121,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
if (inserted > 0)
{
/* Don't run point motion or modification hooks when decoding. */
- int count = SPECPDL_INDEX ();
+ int count1 = SPECPDL_INDEX ();
EMACS_INT old_inserted = inserted;
specbind (Qinhibit_point_motion_hooks, Qt);
specbind (Qinhibit_modification_hooks, Qt);
@@ -4228,7 +4233,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
Otherwise start with an empty undo_list. */
BVAR (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil;
- unbind_to (count, Qnil);
+ unbind_to (count1, Qnil);
}
/* Call after-change hooks for the inserted text, aside from the case
@@ -5059,8 +5064,8 @@ An argument specifies the modification time value to use
return Qnil;
}
-Lisp_Object
-auto_save_error (Lisp_Object error)
+static Lisp_Object
+auto_save_error (Lisp_Object error_val)
{
Lisp_Object args[3], msg;
int i, nbytes;
@@ -5074,7 +5079,7 @@ auto_save_error (Lisp_Object error)
args[0] = build_string ("Auto-saving %s: %s");
args[1] = BVAR (current_buffer, name);
- args[2] = Ferror_message_string (error);
+ args[2] = Ferror_message_string (error_val);
msg = Fformat (3, args);
GCPRO1 (msg);
nbytes = SBYTES (msg);
@@ -5095,7 +5100,7 @@ auto_save_error (Lisp_Object error)
return Qnil;
}
-Lisp_Object
+static Lisp_Object
auto_save_1 (void)
{
struct stat st;
@@ -5426,7 +5431,7 @@ before any other event (mouse or keypress) is handled. */)
Lisp_Object
Fread_file_name (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object initial, Lisp_Object predicate)
{
- struct gcpro gcpro1, gcpro2;
+ struct gcpro gcpro1;
Lisp_Object args[7];
GCPRO1 (default_filename);
diff --git a/src/filelock.c b/src/filelock.c
index 7f8f0e1c0f..2138eaa502 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -344,13 +344,13 @@ static int
lock_file_1 (char *lfname, int force)
{
register int err;
- time_t boot_time;
+ time_t boot;
const char *user_name;
const char *host_name;
char *lock_info_str;
/* Call this first because it can GC. */
- boot_time = get_boot_time ();
+ boot = get_boot_time ();
if (STRINGP (Fuser_login_name (Qnil)))
user_name = SSDATA (Fuser_login_name (Qnil));
@@ -363,9 +363,9 @@ lock_file_1 (char *lfname, int force)
lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)
+ LOCK_PID_MAX + 30);
- if (boot_time)
+ if (boot)
sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name,
- (unsigned long) getpid (), (unsigned long) boot_time);
+ (unsigned long) getpid (), (unsigned long) boot);
else
sprintf (lock_info_str, "%s@%s.%lu", user_name, host_name,
(unsigned long) getpid ());
@@ -382,7 +382,7 @@ lock_file_1 (char *lfname, int force)
/* Return 1 if times A and B are no more than one second apart. */
-int
+static int
within_one_second (time_t a, time_t b)
{
return (a - b >= -1 && a - b <= 1);
diff --git a/src/floatfns.c b/src/floatfns.c
index c00923643d..bc03509b75 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -187,8 +187,10 @@ static const char *float_error_fn_name;
xsignal3 (Qrange_error, build_string ((op)), (a1), (a2))
#define domain_error(op,arg) \
xsignal2 (Qdomain_error, build_string ((op)), (arg))
+#ifdef FLOAT_CHECK_DOMAIN
#define domain_error2(op,a1,a2) \
xsignal3 (Qdomain_error, build_string ((op)), (a1), (a2))
+#endif
/* Extract a Lisp number as a `double', or signal an error. */
@@ -326,9 +328,9 @@ If X is zero, both parts (SGNFCAND and EXP) are zero. */)
return Fcons (make_float (0.0), make_number (0));
else
{
- int exp;
- double sgnfcand = frexp (f, &exp);
- return Fcons (make_float (sgnfcand), make_number (exp));
+ int exponent;
+ double sgnfcand = frexp (f, &exponent);
+ return Fcons (make_float (sgnfcand), make_number (exponent));
}
}
@@ -336,10 +338,10 @@ DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0,
doc: /* Construct number X from significand SGNFCAND and exponent EXP.
Returns the floating point value resulting from multiplying SGNFCAND
(the significand) by 2 raised to the power of EXP (the exponent). */)
- (Lisp_Object sgnfcand, Lisp_Object exp)
+ (Lisp_Object sgnfcand, Lisp_Object exponent)
{
- CHECK_NUMBER (exp);
- return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp)));
+ CHECK_NUMBER (exponent);
+ return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exponent)));
}
#endif
@@ -1037,7 +1039,7 @@ syms_of_floatfns (void)
defsubr (&Scopysign);
defsubr (&Sfrexp);
defsubr (&Sldexp);
-#endif
+#endif
#if 0
defsubr (&Sacosh);
defsubr (&Sasinh);
@@ -1074,4 +1076,3 @@ syms_of_floatfns (void)
defsubr (&Sround);
defsubr (&Struncate);
}
-
diff --git a/src/fns.c b/src/fns.c
index b800846b78..9a009c8ab4 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -57,9 +57,6 @@ Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
static int internal_equal (Lisp_Object , Lisp_Object, int, int);
-extern long get_random (void);
-extern void seed_random (long);
-
#ifndef HAVE_UNISTD_H
extern long time ();
#endif
@@ -2136,15 +2133,15 @@ DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0,
ARRAY is a vector, string, char-table, or bool-vector. */)
(Lisp_Object array, Lisp_Object item)
{
- register EMACS_INT size, index;
+ register EMACS_INT size, idx;
int charval;
if (VECTORP (array))
{
register Lisp_Object *p = XVECTOR (array)->contents;
size = ASIZE (array);
- for (index = 0; index < size; index++)
- p[index] = item;
+ for (idx = 0; idx < size; idx++)
+ p[idx] = item;
}
else if (CHAR_TABLE_P (array))
{
@@ -2180,8 +2177,8 @@ ARRAY is a vector, string, char-table, or bool-vector. */)
*p++ = str[i % len];
}
else
- for (index = 0; index < size; index++)
- p[index] = charval;
+ for (idx = 0; idx < size; idx++)
+ p[idx] = charval;
}
else if (BOOL_VECTOR_P (array))
{
@@ -2191,14 +2188,14 @@ ARRAY is a vector, string, char-table, or bool-vector. */)
/ BOOL_VECTOR_BITS_PER_CHAR);
charval = (! NILP (item) ? -1 : 0);
- for (index = 0; index < size_in_chars - 1; index++)
- p[index] = charval;
- if (index < size_in_chars)
+ for (idx = 0; idx < size_in_chars - 1; idx++)
+ p[idx] = charval;
+ if (idx < size_in_chars)
{
/* Mask out bits beyond the vector size. */
if (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR)
charval &= (1 << (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR)) - 1;
- p[index] = charval;
+ p[idx] = charval;
}
}
else
@@ -2601,9 +2598,9 @@ particular subfeatures supported in this version of FEATURE. */)
/* List of features currently being require'd, innermost first. */
-Lisp_Object require_nesting_list;
+static Lisp_Object require_nesting_list;
-Lisp_Object
+static Lisp_Object
require_unwind (Lisp_Object old_value)
{
return require_nesting_list = old_value;
diff --git a/src/font.c b/src/font.c
index 35821ae34f..9e8b7029c2 100644
--- a/src/font.c
+++ b/src/font.c
@@ -311,10 +311,10 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror
{
Lisp_Object table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX);
int len = ASIZE (table);
- int i, j;
if (SYMBOLP (val))
{
+ int i, j;
char *s;
Lisp_Object args[2], elt;
@@ -500,10 +500,9 @@ font_prop_validate_style (Lisp_Object style, Lisp_Object val)
enum font_property_index prop = (EQ (style, QCweight) ? FONT_WEIGHT_INDEX
: EQ (style, QCslant) ? FONT_SLANT_INDEX
: FONT_WIDTH_INDEX);
- int n;
if (INTEGERP (val))
{
- n = XINT (val);
+ int n = XINT (val);
if (((n >> 4) & 0xF)
>= ASIZE (AREF (font_style_table, prop - FONT_WEIGHT_INDEX)))
val = Qerror;
@@ -1163,7 +1162,8 @@ font_parse_xlfd (char *name, Lisp_Object font)
int
font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
{
- char *f[XLFD_REGISTRY_INDEX + 1];
+ char *p;
+ const char *f[XLFD_REGISTRY_INDEX + 1];
Lisp_Object val;
int i, j, len = 0;
@@ -1194,14 +1194,14 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
/* Change "jisx0208*" and "jisx0208" to "jisx0208*-*". */
if (SDATA (val)[SBYTES (val) - 1] == '*')
{
- f[j] = alloca (SBYTES (val) + 3);
- sprintf (f[j], "%s-*", SDATA (val));
+ f[j] = p = alloca (SBYTES (val) + 3);
+ sprintf (p, "%s-*", SDATA (val));
len += SBYTES (val) + 3;
}
else
{
- f[j] = alloca (SBYTES (val) + 4);
- sprintf (f[j], "%s*-*", SDATA (val));
+ f[j] = p = alloca (SBYTES (val) + 4);
+ sprintf (p, "%s*-*", SDATA (val));
len += SBYTES (val) + 4;
}
}
@@ -1232,8 +1232,8 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
i = pixel_size;
if (i > 0)
{
- f[XLFD_PIXEL_INDEX] = alloca (22);
- len += sprintf (f[XLFD_PIXEL_INDEX], "%d-*", i) + 1;
+ f[XLFD_PIXEL_INDEX] = p = alloca (22);
+ len += sprintf (p, "%d-*", i) + 1;
}
else
f[XLFD_PIXEL_INDEX] = "*-*", len += 4;
@@ -1241,8 +1241,8 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
else if (FLOATP (val))
{
i = XFLOAT_DATA (val) * 10;
- f[XLFD_PIXEL_INDEX] = alloca (12);
- len += sprintf (f[XLFD_PIXEL_INDEX], "*-%d", i) + 1;
+ f[XLFD_PIXEL_INDEX] = p = alloca (12);
+ len += sprintf (p, "*-%d", i) + 1;
}
else
f[XLFD_PIXEL_INDEX] = "*-*", len += 4;
@@ -1250,9 +1250,8 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
if (INTEGERP (AREF (font, FONT_DPI_INDEX)))
{
i = XINT (AREF (font, FONT_DPI_INDEX));
- f[XLFD_RESX_INDEX] = alloca (22);
- len += sprintf (f[XLFD_RESX_INDEX],
- "%d-%d", i, i) + 1;
+ f[XLFD_RESX_INDEX] = p = alloca (22);
+ len += sprintf (p, "%d-%d", i, i) + 1;
}
else
f[XLFD_RESX_INDEX] = "*-*", len += 4;
@@ -1270,8 +1269,8 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
f[XLFD_SPACING_INDEX] = "*", len += 2;
if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX)))
{
- f[XLFD_AVGWIDTH_INDEX] = alloca (11);
- len += sprintf (f[XLFD_AVGWIDTH_INDEX], "%ld",
+ f[XLFD_AVGWIDTH_INDEX] = p = alloca (11);
+ len += sprintf (p, "%ld",
(long) XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1;
}
else
@@ -1448,12 +1447,10 @@ font_parse_fcname (char *name, Lisp_Object font)
{
/* Either a fontconfig-style name with no size and property
data, or a GTK-style name. */
- Lisp_Object prop;
Lisp_Object weight = Qnil, slant = Qnil;
Lisp_Object width = Qnil, size = Qnil;
char *word_start;
int word_len;
- int size_found = 0;
/* Scan backwards from the end, looking for a size. */
for (p = name + len - 1; p >= name; p--)
@@ -1569,8 +1566,10 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
point_size = -1;
len += 21; /* for ":pixelsize=NUM" */
}
- else if (FLOATP (val))
+ else
{
+ if (! FLOATP (val))
+ abort ();
pixel_size = -1;
point_size = (int) XFLOAT_DATA (val);
len += 11; /* for "-NUM" */
@@ -1604,15 +1603,15 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
len += strlen (":scalable=false"); /* or ":scalable=true" */
for (tail = AREF (font, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
{
- Lisp_Object key = XCAR (XCAR (tail)), val = XCDR (XCAR (tail));
+ Lisp_Object key = XCAR (XCAR (tail)), value = XCDR (XCAR (tail));
len += SBYTES (SYMBOL_NAME (key)) + 1; /* for :KEY= */
- if (STRINGP (val))
- len += SBYTES (val);
- else if (INTEGERP (val))
- len += sprintf (work, "%ld", (long) XINT (val));
- else if (SYMBOLP (val))
- len += (NILP (val) ? 5 : 4); /* for "false" or "true" */
+ if (STRINGP (value))
+ len += SBYTES (value);
+ else if (INTEGERP (value))
+ len += sprintf (work, "%ld", (long) XINT (value));
+ else if (SYMBOLP (value))
+ len += (NILP (value) ? 5 : 4); /* for "false" or "true" */
}
if (len > nbytes)
@@ -2178,7 +2177,7 @@ font_sort_entities (Lisp_Object list, Lisp_Object prefer, Lisp_Object frame, int
unsigned best_score;
Lisp_Object best_entity;
struct frame *f = XFRAME (frame);
- Lisp_Object tail, vec;
+ Lisp_Object tail, vec IF_LINT (= Qnil);
USE_SAFE_ALLOCA;
for (i = FONT_WEIGHT_INDEX; i <= FONT_AVGWIDTH_INDEX; i++)
@@ -2602,7 +2601,7 @@ static Lisp_Object scratch_font_spec, scratch_font_prefer;
(2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil).
*/
-Lisp_Object
+static Lisp_Object
font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size)
{
Lisp_Object entity, val;
@@ -2951,22 +2950,6 @@ font_get_name (Lisp_Object font_object)
}
-/* Return the specification of FONT_OBJECT. */
-
-Lisp_Object
-font_get_spec (Lisp_Object font_object)
-{
- Lisp_Object spec = font_make_spec ();
- int i;
-
- for (i = 0; i < FONT_SIZE_INDEX; i++)
- ASET (spec, i, AREF (font_object, i));
- ASET (spec, FONT_SIZE_INDEX,
- make_number (XFONT_OBJECT (font_object)->pixel_size));
- return spec;
-}
-
-
/* Create a new font spec from FONT_NAME, and return it. If FONT_NAME
could not be parsed by font_parse_name, return Qnil. */
@@ -3436,14 +3419,13 @@ Lisp_Object
font_update_drivers (FRAME_PTR f, Lisp_Object new_drivers)
{
Lisp_Object active_drivers = Qnil;
- struct font_driver *driver;
struct font_driver_list *list;
/* At first, turn off non-requested drivers, and turn on requested
drivers. */
for (list = f->font_driver_list; list; list = list->next)
{
- driver = list->driver;
+ struct font_driver *driver = list->driver;
if ((EQ (new_drivers, Qt) || ! NILP (Fmemq (driver->type, new_drivers)))
!= list->on)
{
@@ -4669,7 +4651,7 @@ the corresponding element is nil. */)
Lisp_Object object)
{
struct font *font;
- int i, len, c;
+ int i, len;
Lisp_Object *chars, vec;
USE_SAFE_ALLOCA;
@@ -4687,6 +4669,7 @@ the corresponding element is nil. */)
bytepos = CHAR_TO_BYTE (charpos);
for (i = 0; charpos < XFASTINT (to); i++)
{
+ int c;
FETCH_CHAR_ADVANCE (c, charpos, bytepos);
chars[i] = make_number (c);
}
@@ -4708,7 +4691,7 @@ the corresponding element is nil. */)
if (STRING_MULTIBYTE (object))
for (i = 0; i < len; i++)
{
- c = STRING_CHAR_ADVANCE (p);
+ int c = STRING_CHAR_ADVANCE (p);
chars[i] = make_number (c);
}
else
@@ -4959,7 +4942,7 @@ static Lisp_Object Vfont_log_deferred;
void
font_add_log (const char *action, Lisp_Object arg, Lisp_Object result)
{
- Lisp_Object tail, val;
+ Lisp_Object val;
int i;
if (EQ (Vfont_log, Qt))
@@ -5015,6 +4998,7 @@ font_add_log (const char *action, Lisp_Object arg, Lisp_Object result)
}
else if (CONSP (result))
{
+ Lisp_Object tail;
result = Fcopy_sequence (result);
for (tail = result; CONSP (tail); tail = XCDR (tail))
{
diff --git a/src/fontset.c b/src/fontset.c
index f297fd10a7..b5d8a0db43 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -233,14 +233,14 @@ fontset_id_valid_p (int id)
/* Macros to access special values of (base) FONTSET. */
#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1]
#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4]
-#define FONTSET_SPEC(fontset) XCHAR_TABLE (fontset)->extras[5]
+/* #define FONTSET_SPEC(fontset) XCHAR_TABLE (fontset)->extras[5] */
/* Macros to access special values of (realized) FONTSET. */
#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2]
#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3]
#define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4]
#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5]
-#define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6]
+/* #define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] */
#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7]
/* For both base and realized fontset. */
@@ -266,7 +266,6 @@ fontset_id_valid_p (int id)
ASET ((rfont_def), 0, make_number (face_id))
#define RFONT_DEF_FONT_DEF(rfont_def) AREF (rfont_def, 1)
#define RFONT_DEF_SPEC(rfont_def) FONT_DEF_SPEC (AREF (rfont_def, 1))
-#define RFONT_DEF_REPERTORY(rfont_def) FONT_DEF_REPERTORY (AREF (rfont_def, 1))
#define RFONT_DEF_OBJECT(rfont_def) AREF (rfont_def, 2)
#define RFONT_DEF_SET_OBJECT(rfont_def, object) \
ASET ((rfont_def), 2, (object))
@@ -713,7 +712,7 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face, int id, int fa
static Lisp_Object
fontset_font (Lisp_Object fontset, int c, struct face *face, int id)
{
- Lisp_Object rfont_def, default_rfont_def;
+ Lisp_Object rfont_def, default_rfont_def IF_LINT (= Qnil);
Lisp_Object base_fontset;
/* Try a font-group of FONTSET. */
@@ -836,7 +835,7 @@ fontset_ascii (int id)
return elt;
}
-void
+static void
free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
{
Lisp_Object tail;
@@ -1583,14 +1582,14 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
if (ascii_changed)
{
- Lisp_Object tail, frame, alist;
+ Lisp_Object tail, fr, alist;
int fontset_id = XINT (FONTSET_ID (fontset));
FONTSET_ASCII (fontset) = fontname;
name = FONTSET_NAME (fontset);
- FOR_EACH_FRAME (tail, frame)
+ FOR_EACH_FRAME (tail, fr)
{
- FRAME_PTR f = XFRAME (frame);
+ FRAME_PTR f = XFRAME (fr);
Lisp_Object font_object;
struct face *face;
@@ -1607,7 +1606,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
{
update_auto_fontset_alist (font_object, fontset);
alist = Fcons (Fcons (Qfont, Fcons (name, font_object)), Qnil);
- Fmodify_frame_parameters (frame, alist);
+ Fmodify_frame_parameters (fr, alist);
}
}
}
diff --git a/src/fringe.c b/src/fringe.c
index d42d6467f3..ce75df766e 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -913,7 +913,12 @@ update_window_fringes (struct window *w, int keep_current_p)
int bitmap_cache[MAX_BITMAP_CACHE];
int top_ind_rn, bot_ind_rn;
int top_ind_min_y, bot_ind_max_y;
- int top_row_ends_at_zv_p, bot_row_ends_at_zv_p;
+
+ /* top_ind_rn is set to a nonnegative value whenver
+ row->indicate_bob_p is set, so it's OK that top_row_ends_at_zv_p
+ is not initialized here. Similarly for bot_ind_rn,
+ row->indicate_eob_p and bot_row_ends_at_zv_p. */
+ int top_row_ends_at_zv_p IF_LINT (= 0), bot_row_ends_at_zv_p IF_LINT (= 0);
if (w->pseudo_window_p)
return 0;
@@ -949,18 +954,10 @@ update_window_fringes (struct window *w, int keep_current_p)
y < yb && rn < nrows;
y += row->height, ++rn)
{
- unsigned indicate_bob_p, indicate_top_line_p;
- unsigned indicate_eob_p, indicate_bottom_line_p;
-
row = w->desired_matrix->rows + rn;
if (!row->enabled_p)
row = w->current_matrix->rows + rn;
- indicate_bob_p = row->indicate_bob_p;
- indicate_top_line_p = row->indicate_top_line_p;
- indicate_eob_p = row->indicate_eob_p;
- indicate_bottom_line_p = row->indicate_bottom_line_p;
-
row->indicate_bob_p = row->indicate_top_line_p = 0;
row->indicate_eob_p = row->indicate_bottom_line_p = 0;
@@ -1380,7 +1377,7 @@ compute_fringe_widths (struct frame *f, int redraw)
/* Free resources used by a user-defined bitmap. */
-void
+static void
destroy_fringe_bitmap (int n)
{
struct fringe_bitmap **fbp;
@@ -1448,7 +1445,7 @@ static const unsigned char swap_nibble[16] = {
0x3, 0xb, 0x7, 0xf}; /* 0011 1011 0111 1111 */
#endif /* HAVE_X_WINDOWS */
-void
+static void
init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p)
{
if (once_p || fb->dynamic)
@@ -1831,4 +1828,3 @@ w32_reset_fringes (void)
#endif /* HAVE_NTGUI */
#endif /* HAVE_WINDOW_SYSTEM */
-
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6ecd5d624a..754f61e366 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -40,6 +40,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <X11/Xft/Xft.h>
#endif
+#ifdef HAVE_GTK3
+#include <gtk/gtkx.h>
+#endif
+
#define FRAME_TOTAL_PIXEL_HEIGHT(f) \
(FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
@@ -69,8 +73,26 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define remove_submenu(w) gtk_menu_item_remove_submenu ((w))
#endif
+#ifndef HAVE_GTK3
+#ifdef USE_GTK_TOOLTIP
+#define gdk_window_get_screen(w) gdk_drawable_get_screen (w)
+#endif
+#define gdk_window_get_geometry(w, a, b, c, d) \
+ gdk_window_get_geometry (w, a, b, c, d, 0)
+#define gdk_x11_window_lookup_for_display(d, w) \
+ gdk_xid_table_lookup_for_display (d, w)
+#define GDK_KEY_g GDK_g
+#endif
+
#define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
+/* Get the current value of the range, truncated to an integer. */
+static int
+int_gtk_range_get_value (GtkRange *range)
+{
+ return gtk_range_get_value (range);
+}
+
/***********************************************************************
Display handling functions
@@ -88,7 +110,7 @@ static GdkDisplay *gdpy_def;
static void
xg_set_screen (GtkWidget *w, FRAME_PTR f)
{
- if (FRAME_X_DISPLAY (f) != GDK_DISPLAY ())
+ if (FRAME_X_DISPLAY (f) != DEFAULT_GDK_DISPLAY ())
{
GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
GdkScreen *gscreen = gdk_display_get_default_screen (gdpy);
@@ -229,29 +251,55 @@ xg_create_default_cursor (Display *dpy)
return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR);
}
+static GdkPixbuf *
+xg_get_pixbuf_from_pixmap (FRAME_PTR f, Pixmap pix)
+{
+ int iunused;
+ GdkPixbuf *tmp_buf;
+ Window wunused;
+ unsigned int width, height, uunused;
+ XImage *xim;
+
+ XGetGeometry (FRAME_X_DISPLAY (f), pix, &wunused, &iunused, &iunused,
+ &width, &height, &uunused, &uunused);
+
+ xim = XGetImage (FRAME_X_DISPLAY (f), pix, 0, 0, width, height,
+ ~0, XYPixmap);
+ if (!xim) return 0;
+
+ tmp_buf = gdk_pixbuf_new_from_data ((guchar *) xim->data,
+ GDK_COLORSPACE_RGB,
+ FALSE,
+ xim->bitmap_unit,
+ (int) width,
+ (int) height,
+ xim->bytes_per_line,
+ NULL,
+ NULL);
+ XDestroyImage (xim);
+ return tmp_buf;
+}
+
/* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */
static GdkPixbuf *
-xg_get_pixbuf_from_pix_and_mask (GdkPixmap *gpix,
- GdkPixmap *gmask,
- GdkColormap *cmap)
+xg_get_pixbuf_from_pix_and_mask (FRAME_PTR f,
+ Pixmap pix,
+ Pixmap mask)
{
int width, height;
GdkPixbuf *icon_buf, *tmp_buf;
- gdk_drawable_get_size (gpix, &width, &height);
- tmp_buf = gdk_pixbuf_get_from_drawable (NULL, gpix, cmap,
- 0, 0, 0, 0, width, height);
+ tmp_buf = xg_get_pixbuf_from_pixmap (f, pix);
icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0);
g_object_unref (G_OBJECT (tmp_buf));
- if (gmask)
+ width = gdk_pixbuf_get_width (icon_buf);
+ height = gdk_pixbuf_get_height (icon_buf);
+
+ if (mask)
{
- GdkPixbuf *mask_buf = gdk_pixbuf_get_from_drawable (NULL,
- gmask,
- NULL,
- 0, 0, 0, 0,
- width, height);
+ GdkPixbuf *mask_buf = xg_get_pixbuf_from_pixmap (f, mask);
guchar *pixels = gdk_pixbuf_get_pixels (icon_buf);
guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf);
int rowstride = gdk_pixbuf_get_rowstride (icon_buf);
@@ -316,10 +364,6 @@ xg_get_image_for_pixmap (FRAME_PTR f,
GtkWidget *widget,
GtkImage *old_widget)
{
- GdkPixmap *gpix;
- GdkPixmap *gmask;
- GdkDisplay *gdpy;
- GdkColormap *cmap;
GdkPixbuf *icon_buf;
/* If we have a file, let GTK do all the image handling.
@@ -347,10 +391,6 @@ xg_get_image_for_pixmap (FRAME_PTR f,
on a monochrome display, and sometimes bad on all displays with
certain themes. */
- gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
- gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap);
- gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0;
-
/* This is a workaround to make icons look good on pseudo color
displays. Apparently GTK expects the images to have an alpha
channel. If they don't, insensitive and activated icons will
@@ -360,18 +400,17 @@ xg_get_image_for_pixmap (FRAME_PTR f,
not associated with the img->pixmap. The img->pixmap may be removed
by clearing the image cache and then the tool bar redraw fails, since
Gtk+ assumes the pixmap is always there. */
- cmap = gtk_widget_get_colormap (widget);
- icon_buf = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap);
+ icon_buf = xg_get_pixbuf_from_pix_and_mask (f, img->pixmap, img->mask);
- if (! old_widget)
- old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf));
- else
- gtk_image_set_from_pixbuf (old_widget, icon_buf);
-
- g_object_unref (G_OBJECT (icon_buf));
+ if (icon_buf)
+ {
+ if (! old_widget)
+ old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf));
+ else
+ gtk_image_set_from_pixbuf (old_widget, icon_buf);
- g_object_unref (G_OBJECT (gpix));
- if (gmask) g_object_unref (G_OBJECT (gmask));
+ g_object_unref (G_OBJECT (icon_buf));
+ }
return GTK_WIDGET (old_widget);
}
@@ -455,22 +494,22 @@ get_utf8_string (const char *str)
gsize bytes_written;
unsigned char *p = (unsigned char *)str;
char *cp, *up;
- GError *error = NULL;
+ GError *err = NULL;
while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
- &bytes_written, &error))
- && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
+ &bytes_written, &err))
+ && err->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
{
++nr_bad;
p += bytes_written+1;
- g_error_free (error);
- error = NULL;
+ g_error_free (err);
+ err = NULL;
}
- if (error)
+ if (err)
{
- g_error_free (error);
- error = NULL;
+ g_error_free (err);
+ err = NULL;
}
if (cp) g_free (cp);
@@ -478,16 +517,16 @@ get_utf8_string (const char *str)
p = (unsigned char *)str;
while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read,
- &bytes_written, &error))
- && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
+ &bytes_written, &err))
+ && err->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
{
strncpy (up, (char *)p, bytes_written);
sprintf (up + bytes_written, "\\%03o", p[bytes_written]);
up[bytes_written+4] = '\0';
up += bytes_written+4;
p += bytes_written+1;
- g_error_free (error);
- error = NULL;
+ g_error_free (err);
+ err = NULL;
}
if (cp)
@@ -495,10 +534,10 @@ get_utf8_string (const char *str)
strcat (utf8_str, cp);
g_free (cp);
}
- if (error)
+ if (err)
{
- g_error_free (error);
- error = NULL;
+ g_error_free (err);
+ err = NULL;
}
}
return utf8_str;
@@ -514,28 +553,43 @@ xg_check_special_colors (struct frame *f,
XColor *color)
{
int success_p = 0;
- if (FRAME_GTK_WIDGET (f))
- {
- if (strcmp ("gtk_selection_bg_color", color_name) == 0)
- {
- GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f));
- color->red = gsty->bg[GTK_STATE_SELECTED].red;
- color->green = gsty->bg[GTK_STATE_SELECTED].green;
- color->blue = gsty->bg[GTK_STATE_SELECTED].blue;
- color->pixel = gsty->bg[GTK_STATE_SELECTED].pixel;
- success_p = 1;
- }
- else if (strcmp ("gtk_selection_fg_color", color_name) == 0)
- {
- GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f));
- color->red = gsty->fg[GTK_STATE_SELECTED].red;
- color->green = gsty->fg[GTK_STATE_SELECTED].green;
- color->blue = gsty->fg[GTK_STATE_SELECTED].blue;
- color->pixel = gsty->fg[GTK_STATE_SELECTED].pixel;
- success_p = 1;
- }
- }
+ int get_bg = strcmp ("gtk_selection_bg_color", color_name) == 0;
+ int get_fg = !get_bg && strcmp ("gtk_selection_fg_color", color_name) == 0;
+ if (! FRAME_GTK_WIDGET (f) || ! (get_bg || get_fg))
+ return success_p;
+
+ BLOCK_INPUT;
+ {
+#ifdef HAVE_GTK3
+ GtkStyleContext *gsty
+ = gtk_widget_get_style_context (FRAME_GTK_OUTER_WIDGET (f));
+ GdkRGBA col;
+ char buf[64];
+ int state = GTK_STATE_FLAG_SELECTED|GTK_STATE_FLAG_FOCUSED;
+ if (get_fg)
+ gtk_style_context_get_color (gsty, state, &col);
+ else
+ gtk_style_context_get_background_color (gsty, state, &col);
+
+ sprintf (buf, "rgbi:%lf/%lf/%lf", col.red, col.green, col.blue);
+ success_p = XParseColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f),
+ buf, color);
+#else
+ GtkStyle *gsty = gtk_widget_get_style (FRAME_GTK_WIDGET (f));
+ GdkColor *grgb = get_bg
+ ? &gsty->bg[GTK_STATE_SELECTED]
+ : &gsty->fg[GTK_STATE_SELECTED];
+
+ color->red = grgb->red;
+ color->green = grgb->green;
+ color->blue = grgb->blue;
+ color->pixel = grgb->pixel;
+ success_p = 1;
+#endif
+
+ }
+ UNBLOCK_INPUT;
return success_p;
}
@@ -629,7 +683,7 @@ xg_prepare_tooltip (FRAME_PTR f,
encoded_string = ENCODE_UTF_8 (string);
widget = GTK_WIDGET (x->ttip_lbl);
gwin = gtk_widget_get_window (GTK_WIDGET (x->ttip_window));
- screen = gdk_drawable_get_screen (gwin);
+ screen = gdk_window_get_screen (gwin);
settings = gtk_settings_get_for_screen (screen);
g_object_get (settings, "gtk-enable-tooltips", &tt_enabled, NULL);
if (tt_enabled)
@@ -650,7 +704,7 @@ xg_prepare_tooltip (FRAME_PTR f,
gtk_tooltip_set_custom (x->ttip_widget, widget);
gtk_tooltip_set_text (x->ttip_widget, SDATA (encoded_string));
- gtk_widget_size_request (GTK_WIDGET (x->ttip_window), &req);
+ gtk_widget_get_preferred_size (GTK_WIDGET (x->ttip_window), NULL, &req);
if (width) *width = req.width;
if (height) *height = req.height;
@@ -696,7 +750,7 @@ xg_hide_tooltip (FRAME_PTR f)
if (g_object_get_data (G_OBJECT (win), "restore-tt"))
{
GdkWindow *gwin = gtk_widget_get_window (GTK_WIDGET (win));
- GdkScreen *screen = gdk_drawable_get_screen (gwin);
+ GdkScreen *screen = gdk_window_get_screen (gwin);
GtkSettings *settings = gtk_settings_get_for_screen (screen);
g_object_set (settings, "gtk-enable-tooltips", TRUE, NULL);
}
@@ -797,7 +851,7 @@ xg_frame_resized (FRAME_PTR f, int pixelwidth, int pixelheight)
if (FRAME_GTK_WIDGET (f) && gtk_widget_get_mapped (FRAME_GTK_WIDGET (f)))
gdk_window_get_geometry (gtk_widget_get_window (FRAME_GTK_WIDGET (f)),
0, 0,
- &pixelwidth, &pixelheight, 0);
+ &pixelwidth, &pixelheight);
else return;
}
@@ -910,8 +964,8 @@ xg_win_to_widget (Display *dpy, Window wdesc)
BLOCK_INPUT;
- gdkwin = gdk_xid_table_lookup_for_display (gdk_x11_lookup_xdisplay (dpy),
- wdesc);
+ gdkwin = gdk_x11_window_lookup_for_display (gdk_x11_lookup_xdisplay (dpy),
+ wdesc);
if (gdkwin)
{
GdkEvent event;
@@ -923,14 +977,29 @@ xg_win_to_widget (Display *dpy, Window wdesc)
return gwdesc;
}
-/* Fill in the GdkColor C so that it represents PIXEL.
- W is the widget that color will be used for. Used to find colormap. */
+/* Set the background of widget W to PIXEL. */
static void
-xg_pix_to_gcolor (GtkWidget *w, long unsigned int pixel, GdkColor *c)
+xg_set_widget_bg (FRAME_PTR f, GtkWidget *w, long unsigned int pixel)
{
+#ifdef HAVE_GTK3
+ GdkRGBA bg;
+ XColor xbg;
+ xbg.pixel = pixel;
+ if (XQueryColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &xbg))
+ {
+ bg.red = (double)xbg.red/65536.0;
+ bg.green = (double)xbg.green/65536.0;
+ bg.blue = (double)xbg.blue/65536.0;
+ bg.alpha = 1.0;
+ gtk_widget_override_background_color (w, GTK_STATE_FLAG_NORMAL, &bg);
+ }
+#else
+ GdkColor bg;
GdkColormap *map = gtk_widget_get_colormap (w);
- gdk_colormap_query_color (map, pixel, c);
+ gdk_colormap_query_color (map, pixel, &bg);
+ gtk_widget_modify_bg (FRAME_GTK_WIDGET (f), GTK_STATE_NORMAL, &bg);
+#endif
}
/* Callback called when the gtk theme changes.
@@ -953,6 +1022,28 @@ style_changed_cb (GObject *go,
kbd_buffer_store_event (&event);
}
+/* Called when a delete-event occurs on WIDGET. */
+
+static gboolean
+delete_cb (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+#ifdef HAVE_GTK3
+ /* The event doesn't arrive in the normal event loop. Send event
+ here. */
+ FRAME_PTR f = (FRAME_PTR) user_data;
+ struct input_event ie;
+
+ EVENT_INIT (ie);
+ ie.kind = DELETE_WINDOW_EVENT;
+ XSETFRAME (ie.frame_or_window, f);
+ kbd_buffer_store_event (&ie);
+#endif
+
+ return TRUE;
+}
+
/* Create and set up the GTK widgets for frame F.
Return 0 if creation failed, non-zero otherwise. */
@@ -962,7 +1053,6 @@ xg_create_frame_widgets (FRAME_PTR f)
GtkWidget *wtop;
GtkWidget *wvbox, *whbox;
GtkWidget *wfixed;
- GdkColor bg;
GtkRcStyle *style;
char *title = 0;
@@ -1029,7 +1119,7 @@ xg_create_frame_widgets (FRAME_PTR f)
/* Add callback to do nothing on WM_DELETE_WINDOW. The default in
GTK is to destroy the widget. We want Emacs to do that instead. */
g_signal_connect (G_OBJECT (wtop), "delete-event",
- G_CALLBACK (gtk_true), 0);
+ G_CALLBACK (delete_cb), f);
/* Convert our geometry parameters into a geometry string
and specify it.
@@ -1057,9 +1147,9 @@ xg_create_frame_widgets (FRAME_PTR f)
/* Since GTK clears its window by filling with the background color,
we must keep X and GTK background in sync. */
- xg_pix_to_gcolor (wfixed, FRAME_BACKGROUND_PIXEL (f), &bg);
- gtk_widget_modify_bg (wfixed, GTK_STATE_NORMAL, &bg);
+ xg_set_widget_bg (f, wfixed, FRAME_BACKGROUND_PIXEL (f));
+#ifndef HAVE_GTK3
/* Also, do not let any background pixmap to be set, this looks very
bad as Emacs overwrites the background pixmap with its own idea
of background color. */
@@ -1068,6 +1158,9 @@ xg_create_frame_widgets (FRAME_PTR f)
/* Must use g_strdup because gtk_widget_modify_style does g_free. */
style->bg_pixmap_name[GTK_STATE_NORMAL] = g_strdup ("<none>");
gtk_widget_modify_style (wfixed, style);
+#else
+ gtk_widget_set_can_focus (wfixed, TRUE);
+#endif
#ifdef USE_GTK_TOOLTIP
/* Steal a tool tip window we can move ourselves. */
@@ -1104,7 +1197,9 @@ xg_free_frame_widgets (FRAME_PTR f)
{
if (FRAME_GTK_OUTER_WIDGET (f))
{
+#ifdef USE_GTK_TOOLTIP
struct x_output *x = f->output_data.x;
+#endif
gtk_widget_destroy (FRAME_GTK_OUTER_WIDGET (f));
FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow in xterm.c */
FRAME_GTK_OUTER_WIDGET (f) = 0;
@@ -1224,11 +1319,8 @@ xg_set_background_color (FRAME_PTR f, long unsigned int bg)
{
if (FRAME_GTK_WIDGET (f))
{
- GdkColor gdk_bg;
-
BLOCK_INPUT;
- xg_pix_to_gcolor (FRAME_GTK_WIDGET (f), bg, &gdk_bg);
- gtk_widget_modify_bg (FRAME_GTK_WIDGET (f), GTK_STATE_NORMAL, &gdk_bg);
+ xg_set_widget_bg (f, FRAME_GTK_WIDGET (f), FRAME_BACKGROUND_PIXEL (f));
UNBLOCK_INPUT;
}
}
@@ -1240,11 +1332,10 @@ xg_set_background_color (FRAME_PTR f, long unsigned int bg)
void
xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask)
{
- GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
- GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap);
- GdkPixmap *gmask = gdk_pixmap_foreign_new_for_display (gdpy, icon_mask);
- GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, NULL);
-
+ GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (f,
+ icon_pixmap,
+ icon_mask);
+ if (gp)
gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), gp);
}
@@ -1326,8 +1417,6 @@ create_dialog (widget_value *wv,
GtkDialog *wd = GTK_DIALOG (wdialog);
GtkBox *cur_box = GTK_BOX (gtk_dialog_get_action_area (wd));
widget_value *item;
- GtkWidget *wvbox;
- GtkWidget *whbox_up;
GtkWidget *whbox_down;
/* If the number of buttons is greater than 4, make two rows of buttons
@@ -1343,8 +1432,8 @@ create_dialog (widget_value *wv,
if (make_two_rows)
{
- wvbox = gtk_vbox_new (TRUE, button_spacing);
- whbox_up = gtk_hbox_new (FALSE, 0);
+ GtkWidget *wvbox = gtk_vbox_new (TRUE, button_spacing);
+ GtkWidget *whbox_up = gtk_hbox_new (FALSE, 0);
whbox_down = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (cur_box, wvbox, FALSE, FALSE, 0);
@@ -1381,7 +1470,7 @@ create_dialog (widget_value *wv,
/* Try to make dialog look better. Must realize first so
the widget can calculate the size it needs. */
gtk_widget_realize (w);
- gtk_widget_size_request (w, &req);
+ gtk_widget_get_preferred_size (w, NULL, &req);
gtk_box_set_spacing (wvbox, req.height);
if (item->value && strlen (item->value) > 0)
button_spacing = 2*req.width/strlen (item->value);
@@ -1613,7 +1702,7 @@ xg_get_file_with_chooser (FRAME_PTR f,
int mustmatch_p, int only_dir_p,
xg_get_file_func *func)
{
- char message[1024];
+ char msgbuf[1024];
GtkWidget *filewin, *wtoggle, *wbox, *wmessage;
GtkWindow *gwin = GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f));
@@ -1649,16 +1738,16 @@ xg_get_file_with_chooser (FRAME_PTR f,
if (x_gtk_file_dialog_help_text)
{
- message[0] = '\0';
+ msgbuf[0] = '\0';
/* Gtk+ 2.10 has the file name text entry box integrated in the dialog.
Show the C-l help text only for versions < 2.10. */
if (gtk_check_version (2, 10, 0) && action != GTK_FILE_CHOOSER_ACTION_SAVE)
- strcat (message, "\nType C-l to display a file name text entry box.\n");
- strcat (message, "\nIf you don't like this file selector, use the "
+ strcat (msgbuf, "\nType C-l to display a file name text entry box.\n");
+ strcat (msgbuf, "\nIf you don't like this file selector, use the "
"corresponding\nkey binding or customize "
"use-file-dialog to turn it off.");
- wmessage = gtk_label_new (message);
+ wmessage = gtk_label_new (msgbuf);
gtk_widget_show (wmessage);
}
@@ -3028,7 +3117,7 @@ menubar_map_cb (GtkWidget *w, gpointer user_data)
{
GtkRequisition req;
FRAME_PTR f = (FRAME_PTR) user_data;
- gtk_widget_size_request (w, &req);
+ gtk_widget_get_preferred_size (w, NULL, &req);
if (FRAME_MENUBAR_HEIGHT (f) != req.height)
{
FRAME_MENUBAR_HEIGHT (f) = req.height;
@@ -3059,7 +3148,7 @@ xg_update_frame_menubar (FRAME_PTR f)
g_signal_connect (x->menubar_widget, "map", G_CALLBACK (menubar_map_cb), f);
gtk_widget_show_all (x->menubar_widget);
- gtk_widget_size_request (x->menubar_widget, &req);
+ gtk_widget_get_preferred_size (x->menubar_widget, NULL, &req);
/* If menu bar doesn't know its height yet, cheat a little so the frame
doesn't jump so much when resized later in menubar_map_cb. */
@@ -3120,7 +3209,7 @@ xg_event_is_for_menubar (FRAME_PTR f, XEvent *event)
return 0;
gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
- gw = gdk_xid_table_lookup_for_display (gdpy, event->xbutton.window);
+ gw = gdk_x11_window_lookup_for_display (gdpy, event->xbutton.window);
if (! gw) return 0;
gevent.any.window = gw;
gwdesc = gtk_get_event_widget (&gevent);
@@ -3284,8 +3373,12 @@ xg_create_scroll_bar (FRAME_PTR f,
{
GtkWidget *wscroll;
GtkWidget *webox;
- GtkObject *vadj;
int scroll_id;
+#ifdef HAVE_GTK3
+ GtkAdjustment *vadj;
+#else
+ GtkObject *vadj;
+#endif
/* Page, step increment values are not so important here, they
will be corrected in x_set_toolkit_scroll_bar_thumb. */
@@ -3295,7 +3388,9 @@ xg_create_scroll_bar (FRAME_PTR f,
wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj));
webox = gtk_event_box_new ();
gtk_widget_set_name (wscroll, scroll_bar_name);
+#ifndef HAVE_GTK3
gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS);
+#endif
g_object_set_data (G_OBJECT (wscroll), XG_FRAME_DATA, (gpointer)f);
scroll_id = xg_store_widget_in_map (wscroll);
@@ -3474,7 +3569,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
changed = 1;
}
- if (changed || (int) gtk_range_get_value (GTK_RANGE (wscroll)) != value)
+ if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
{
BLOCK_INPUT;
@@ -3482,7 +3577,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
ignore_gtk_scrollbar to make the callback do nothing */
xg_ignore_gtk_scrollbar = 1;
- if ((int) gtk_range_get_value (GTK_RANGE (wscroll)) != value)
+ if (int_gtk_range_get_value (GTK_RANGE (wscroll)) != value)
gtk_range_set_value (GTK_RANGE (wscroll), (gdouble)value);
else if (changed)
gtk_adjustment_changed (adj);
@@ -3578,8 +3673,8 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
{
/* The EMACS_INT cast avoids a warning. */
int idx = (int) (EMACS_INT) client_data;
- int mod = (int) (EMACS_INT) g_object_get_data (G_OBJECT (w),
- XG_TOOL_BAR_LAST_MODIFIER);
+ gpointer gmod = g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER);
+ int mod = (int) (EMACS_INT) gmod;
FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
Lisp_Object key, frame;
@@ -3793,8 +3888,8 @@ xg_tool_bar_detach_callback (GtkHandleBox *wbox,
{
GtkRequisition req, req2;
FRAME_X_OUTPUT (f)->toolbar_detached = 1;
- gtk_widget_size_request (GTK_WIDGET (wbox), &req);
- gtk_widget_size_request (w, &req2);
+ gtk_widget_get_preferred_size (GTK_WIDGET (wbox), NULL, &req);
+ gtk_widget_get_preferred_size (w, NULL, &req2);
req.width -= req2.width;
req.height -= req2.height;
if (FRAME_TOOLBAR_TOP_HEIGHT (f) != 0)
@@ -3828,8 +3923,8 @@ xg_tool_bar_attach_callback (GtkHandleBox *wbox,
{
GtkRequisition req, req2;
FRAME_X_OUTPUT (f)->toolbar_detached = 0;
- gtk_widget_size_request (GTK_WIDGET (wbox), &req);
- gtk_widget_size_request (w, &req2);
+ gtk_widget_get_preferred_size (GTK_WIDGET (wbox), NULL, &req);
+ gtk_widget_get_preferred_size (w, NULL, &req2);
req.width += req2.width;
req.height += req2.height;
if (FRAME_TOOLBAR_TOP_HEIGHT (f) != 0)
@@ -3894,6 +3989,7 @@ xg_tool_bar_help_callback (GtkWidget *w,
Returns FALSE to tell GTK to keep processing this event. */
+#ifndef HAVE_GTK3
static gboolean
xg_tool_bar_item_expose_callback (GtkWidget *w,
GdkEventExpose *event,
@@ -3902,7 +3998,6 @@ xg_tool_bar_item_expose_callback (GtkWidget *w,
gint width, height;
gdk_drawable_get_size (event->window, &width, &height);
-
event->area.x -= width > event->area.width ? width-event->area.width : 0;
event->area.y -= height > event->area.height ? height-event->area.height : 0;
@@ -3914,6 +4009,7 @@ xg_tool_bar_item_expose_callback (GtkWidget *w,
return FALSE;
}
+#endif
#ifdef HAVE_GTK_ORIENTABLE_SET_ORIENTATION
#define toolbar_set_orientation(w, o) \
@@ -4063,13 +4159,14 @@ xg_make_tool_item (FRAME_PTR f,
g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f);
+#ifndef HAVE_GTK3
/* Catch expose events to overcome an annoying redraw bug, see
comment for xg_tool_bar_item_expose_callback. */
g_signal_connect (G_OBJECT (ti),
"expose-event",
G_CALLBACK (xg_tool_bar_item_expose_callback),
0);
-
+#endif
gtk_tool_item_set_homogeneous (ti, FALSE);
/* Callback to save modifyer mask (Shift/Control, etc). GTK makes
@@ -4128,9 +4225,9 @@ xg_tool_item_stale_p (GtkWidget *wbutton, const char *stock_name,
}
else
{
- Pixmap old_img
- = (Pixmap) g_object_get_data (G_OBJECT (wimage),
- XG_TOOL_BAR_IMAGE_DATA);
+ gpointer gold_img = g_object_get_data (G_OBJECT (wimage),
+ XG_TOOL_BAR_IMAGE_DATA);
+ Pixmap old_img = (Pixmap) gold_img;
if (old_img != img->pixmap)
return 1;
}
@@ -4153,7 +4250,7 @@ xg_update_tool_bar_sizes (FRAME_PTR f)
GtkRequisition req;
int nl = 0, nr = 0, nt = 0, nb = 0;
- gtk_widget_size_request (GTK_WIDGET (x->handlebox_widget), &req);
+ gtk_widget_get_preferred_size (GTK_WIDGET (x->handlebox_widget), NULL, &req);
if (x->toolbar_in_hbox)
{
int pos;
@@ -4203,7 +4300,6 @@ update_frame_tool_bar (FRAME_PTR f)
GtkToolItem *ti;
GtkTextDirection dir;
int pack_tool_bar = x->handlebox_widget == NULL;
-
Lisp_Object style;
int text_image, horiz;
@@ -4551,13 +4647,13 @@ xg_initialize (void)
/* Make dialogs close on C-g. Since file dialog inherits from
dialog, this works for them also. */
binding_set = gtk_binding_set_by_class (g_type_class_ref (GTK_TYPE_DIALOG));
- gtk_binding_entry_add_signal (binding_set, GDK_g, GDK_CONTROL_MASK,
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_g, GDK_CONTROL_MASK,
"close", 0);
/* Make menus close on C-g. */
binding_set = gtk_binding_set_by_class (g_type_class_ref
(GTK_TYPE_MENU_SHELL));
- gtk_binding_entry_add_signal (binding_set, GDK_g, GDK_CONTROL_MASK,
+ gtk_binding_entry_add_signal (binding_set, GDK_KEY_g, GDK_CONTROL_MASK,
"cancel", 0);
}
diff --git a/src/image.c b/src/image.c
index 73a45633f3..91308c540b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -550,10 +550,6 @@ x_create_bitmap_mask (struct frame *f, int id)
Image types
***********************************************************************/
-/* Value is the number of elements of vector VECTOR. */
-
-#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR))
-
/* List of supported image types. Use define_image_type to add new
types. Use lookup_image_type to find a type for a given symbol. */
@@ -1139,7 +1135,7 @@ static RGB_PIXEL_COLOR
four_corners_best (XImagePtr_or_DC ximg, int *corners,
unsigned long width, unsigned long height)
{
- RGB_PIXEL_COLOR corner_pixels[4], best;
+ RGB_PIXEL_COLOR corner_pixels[4], best IF_LINT (= 0);
int i, best_count;
if (corners && corners[BOT_CORNER] >= 0)
@@ -1491,7 +1487,7 @@ free_image_cache (struct frame *f)
If image-cache-eviction-delay is non-nil, this frees images in the cache
which weren't displayed for at least that many seconds. */
-void
+static void
clear_image_cache (struct frame *f, Lisp_Object filter)
{
struct image_cache *c = FRAME_IMAGE_CACHE (f);
@@ -1559,9 +1555,9 @@ clear_image_cache (struct frame *f, Lisp_Object filter)
FOR_EACH_FRAME (tail, frame)
{
- struct frame *f = XFRAME (frame);
- if (FRAME_IMAGE_CACHE (f) == c)
- clear_current_matrices (f);
+ struct frame *fr = XFRAME (frame);
+ if (FRAME_IMAGE_CACHE (fr) == c)
+ clear_current_matrices (fr);
}
++windows_or_buffers_changed;
@@ -2653,11 +2649,11 @@ xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *e
if (LA1 == XBM_TK_NUMBER)
{
- char *p = strrchr (buffer, '_');
- p = p ? p + 1 : buffer;
- if (strcmp (p, "width") == 0)
+ char *q = strrchr (buffer, '_');
+ q = q ? q + 1 : buffer;
+ if (strcmp (q, "width") == 0)
*width = value;
- else if (strcmp (p, "height") == 0)
+ else if (strcmp (q, "height") == 0)
*height = value;
}
expect (XBM_TK_NUMBER);
@@ -3427,11 +3423,12 @@ xpm_load (struct frame *f, struct image *img)
{
Lisp_Object name;
Lisp_Object color;
+ char *empty_string = (char *) "";
if (!CONSP (XCAR (tail)))
{
- xpm_syms[i].name = "";
- xpm_syms[i].value = "";
+ xpm_syms[i].name = empty_string;
+ xpm_syms[i].value = empty_string;
continue;
}
name = XCAR (XCAR (tail));
@@ -3442,14 +3439,14 @@ xpm_load (struct frame *f, struct image *img)
strcpy (xpm_syms[i].name, SSDATA (name));
}
else
- xpm_syms[i].name = "";
+ xpm_syms[i].name = empty_string;
if (STRINGP (color))
{
xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1);
strcpy (xpm_syms[i].value, SSDATA (color));
}
else
- xpm_syms[i].value = "";
+ xpm_syms[i].value = empty_string;
}
}
@@ -4605,14 +4602,14 @@ x_detect_edges (struct frame *f, struct image *img, int *matrix, int color_adjus
for (x = 1; x < img->width - 1; ++x, ++p)
{
- int r, g, b, y1, x1;
+ int r, g, b, yy, xx;
r = g = b = i = 0;
- for (y1 = y - 1; y1 < y + 2; ++y1)
- for (x1 = x - 1; x1 < x + 2; ++x1, ++i)
+ for (yy = y - 1; yy < y + 2; ++yy)
+ for (xx = x - 1; xx < x + 2; ++xx, ++i)
if (matrix[i])
{
- XColor *t = COLOR (colors, x1, y1);
+ XColor *t = COLOR (colors, xx, yy);
r += matrix[i] * t->red;
g += matrix[i] * t->green;
b += matrix[i] * t->blue;
@@ -4688,7 +4685,7 @@ x_edge_detection (struct frame *f, struct image *img, Lisp_Object matrix,
color_adjust = make_number (0xffff / 2);
if (i == 9 && NUMBERP (color_adjust))
- x_detect_edges (f, img, trans, (int) XFLOATINT (color_adjust));
+ x_detect_edges (f, img, trans, XFLOATINT (color_adjust));
}
@@ -5531,6 +5528,7 @@ init_png_functions (Lisp_Object libraries)
/* Error and warning handlers installed when the PNG library
is initialized. */
+static void my_png_error (png_struct *, const char *) NO_RETURN;
static void
my_png_error (png_struct *png_ptr, const char *msg)
{
@@ -6030,7 +6028,6 @@ jpeg_image_p (Lisp_Object object)
/* Work around a warning about HAVE_STDLIB_H being redefined in
jconfig.h. */
#ifdef HAVE_STDLIB_H
-#define HAVE_STDLIB_H_1
#undef HAVE_STDLIB_H
#endif /* HAVE_STLIB_H */
@@ -6106,6 +6103,7 @@ struct my_jpeg_error_mgr
};
+static void my_error_exit (j_common_ptr) NO_RETURN;
static void
my_error_exit (j_common_ptr cinfo)
{
@@ -6366,10 +6364,10 @@ jpeg_load (struct frame *f, struct image *img)
if (rc == 1)
{
/* Called from my_error_exit. Display a JPEG error. */
- char buffer[JMSG_LENGTH_MAX];
- cinfo.err->format_message ((j_common_ptr) &cinfo, buffer);
+ char buf[JMSG_LENGTH_MAX];
+ cinfo.err->format_message ((j_common_ptr) &cinfo, buf);
image_error ("Error reading JPEG image `%s': %s", img->spec,
- build_string (buffer));
+ build_string (buf));
}
/* Close the input file and destroy the JPEG object. */
@@ -7105,7 +7103,7 @@ gif_load (struct frame *f, struct image *img)
Lisp_Object file, specified_file;
Lisp_Object specified_data;
int rc, width, height, x, y, i;
- boolean transparent_p;
+ boolean transparent_p = 0;
XImagePtr ximg;
ColorMapObject *gif_color_map;
unsigned long pixel_colors[256];
@@ -7114,7 +7112,7 @@ gif_load (struct frame *f, struct image *img)
int ino, image_height, image_width;
gif_memory_source memsrc;
unsigned char *raster;
- unsigned int transparency_color_index;
+ unsigned int transparency_color_index IF_LINT (= 0);
specified_file = image_spec_value (img->spec, QCfile, NULL);
specified_data = image_spec_value (img->spec, QCdata, NULL);
@@ -7129,7 +7127,7 @@ gif_load (struct frame *f, struct image *img)
}
/* Open the GIF file. */
- gif = fn_DGifOpenFileName (SDATA (file));
+ gif = fn_DGifOpenFileName (SSDATA (file));
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
@@ -7302,9 +7300,9 @@ gif_load (struct frame *f, struct image *img)
for (x = 0; x < image_width; x++)
{
- int i = raster[(y * image_width) + x];
+ int c = raster[(y * image_width) + x];
XPutPixel (ximg, x + img->corners[LEFT_CORNER],
- row + img->corners[TOP_CORNER], pixel_colors[i]);
+ row + img->corners[TOP_CORNER], pixel_colors[c]);
}
row += interlace_increment[pass];
@@ -7315,9 +7313,9 @@ gif_load (struct frame *f, struct image *img)
for (y = 0; y < image_height; ++y)
for (x = 0; x < image_width; ++x)
{
- int i = raster[y * image_width + x];
+ int c = raster[y * image_width + x];
XPutPixel (ximg, x + img->corners[LEFT_CORNER],
- y + img->corners[TOP_CORNER], pixel_colors[i]);
+ y + img->corners[TOP_CORNER], pixel_colors[c]);
}
}
diff --git a/src/indent.c b/src/indent.c
index 37ce647556..baea064194 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -274,20 +274,20 @@ skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Ob
This macro is used in current_column_1, Fmove_to_column, and
compute_motion. */
-#define MULTIBYTE_BYTES_WIDTH(p, dp) \
+#define MULTIBYTE_BYTES_WIDTH(p, dp, bytes, width) \
do { \
- int c; \
+ int ch; \
\
wide_column = 0; \
- c = STRING_CHAR_AND_LENGTH (p, bytes); \
+ ch = STRING_CHAR_AND_LENGTH (p, bytes); \
if (BYTES_BY_CHAR_HEAD (*p) != bytes) \
width = bytes * 4; \
else \
{ \
- if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) \
- width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; \
+ if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
+ width = XVECTOR (DISP_CHAR_VECTOR (dp, ch))->size; \
else \
- width = CHAR_WIDTH (c); \
+ width = CHAR_WIDTH (ch); \
if (width > 1) \
wide_column = width; \
} \
@@ -569,14 +569,14 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
prev_col = col;
{ /* Check display property. */
- EMACS_INT end;
- int width = check_display_width (scan, col, &end);
+ EMACS_INT endp;
+ int width = check_display_width (scan, col, &endp);
if (width >= 0)
{
col += width;
- if (end > scan) /* Avoid infinite loops with 0-width overlays. */
+ if (endp > scan) /* Avoid infinite loops with 0-width overlays. */
{
- scan = end; scan_byte = charpos_to_bytepos (scan);
+ scan = endp; scan_byte = charpos_to_bytepos (scan);
continue;
}
}
@@ -669,7 +669,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
int bytes, width, wide_column;
ptr = BYTE_POS_ADDR (scan_byte);
- MULTIBYTE_BYTES_WIDTH (ptr, dp);
+ MULTIBYTE_BYTES_WIDTH (ptr, dp, bytes, width);
/* Subtract one to compensate for the increment
that is going to happen below. */
scan_byte += bytes - 1;
@@ -1657,15 +1657,15 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
{
/* Start of multi-byte form. */
unsigned char *ptr;
- int bytes, width, wide_column;
+ int mb_bytes, mb_width, wide_column;
pos_byte--; /* rewind POS_BYTE */
ptr = BYTE_POS_ADDR (pos_byte);
- MULTIBYTE_BYTES_WIDTH (ptr, dp);
- pos_byte += bytes;
+ MULTIBYTE_BYTES_WIDTH (ptr, dp, mb_bytes, mb_width);
+ pos_byte += mb_bytes;
if (wide_column)
wide_column_end_hpos = hpos + wide_column;
- hpos += width;
+ hpos += mb_width;
}
else if (VECTORP (charvec))
++hpos;
@@ -1995,7 +1995,7 @@ whether or not it is currently displayed in some window. */)
Lisp_Object old_buffer;
struct gcpro gcpro1;
Lisp_Object lcols = Qnil;
- double cols;
+ double cols IF_LINT (= 0);
/* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */
if (CONSP (lines) && (NUMBERP (XCAR (lines))))
@@ -2029,7 +2029,7 @@ whether or not it is currently displayed in some window. */)
}
else
{
- int it_start, first_x, it_overshoot_expected;
+ int it_start, first_x, it_overshoot_expected IF_LINT (= 0);
SET_TEXT_POS (pt, PT, PT_BYTE);
start_display (&it, w, pt);
diff --git a/src/insdel.c b/src/insdel.c
index 7fcf9522a3..ad3460f9a6 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -70,11 +70,14 @@ Lisp_Object combine_after_change_buffer;
Lisp_Object Qinhibit_modification_hooks;
#define CHECK_MARKERS() \
- if (check_markers_debug_flag) \
- check_markers (); \
- else
+ do \
+ { \
+ if (check_markers_debug_flag) \
+ check_markers (); \
+ } \
+ while (0)
-void
+static void
check_markers (void)
{
register struct Lisp_Marker *tail;
@@ -411,9 +414,7 @@ adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte,
static void
adjust_point (EMACS_INT nchars, EMACS_INT nbytes)
{
- BUF_PT (current_buffer) += nchars;
- BUF_PT_BYTE (current_buffer) += nbytes;
-
+ SET_BUF_PT_BOTH (current_buffer, PT + nchars, PT_BYTE + nbytes);
/* In a single-byte buffer, the two positions must be equal. */
eassert (PT_BYTE >= PT && PT_BYTE - PT <= ZV_BYTE - ZV);
}
@@ -453,7 +454,7 @@ adjust_markers_for_replace (EMACS_INT from, EMACS_INT from_byte,
/* Make the gap NBYTES_ADDED bytes longer. */
-void
+static void
make_gap_larger (EMACS_INT nbytes_added)
{
Lisp_Object tem;
@@ -508,7 +509,7 @@ make_gap_larger (EMACS_INT nbytes_added)
/* Make the gap NBYTES_REMOVED bytes shorter. */
-void
+static void
make_gap_smaller (EMACS_INT nbytes_removed)
{
Lisp_Object tem;
@@ -595,7 +596,6 @@ copy_text (const unsigned char *from_addr, unsigned char *to_addr,
{
EMACS_INT nchars = 0;
EMACS_INT bytes_left = nbytes;
- Lisp_Object tbl = Qnil;
while (bytes_left > 0)
{
@@ -2101,7 +2101,7 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
VARIABLE is the variable to maybe set to nil.
NO-ERROR-FLAG is nil if there was an error,
anything else meaning no error (so this function does nothing). */
-Lisp_Object
+static Lisp_Object
reset_var_on_error (Lisp_Object val)
{
if (NILP (XCDR (val)))
@@ -2265,7 +2265,7 @@ signal_after_change (EMACS_INT charpos, EMACS_INT lendel, EMACS_INT lenins)
unbind_to (count, Qnil);
}
-Lisp_Object
+static Lisp_Object
Fcombine_after_change_execute_1 (Lisp_Object val)
{
Vcombine_after_change_calls = val;
diff --git a/src/intervals.c b/src/intervals.c
index 6aee6e9d7f..12b2789cc7 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1892,8 +1892,7 @@ temp_set_point_both (struct buffer *buffer,
if (charpos > BUF_ZV (buffer) || charpos < BUF_BEGV (buffer))
abort ();
- BUF_PT_BYTE (buffer) = bytepos;
- BUF_PT (buffer) = charpos;
+ SET_BUF_PT_BOTH (buffer, charpos, bytepos);
}
/* Set point "temporarily", without checking any text properties. */
@@ -2312,10 +2311,9 @@ get_local_map (register EMACS_INT position, register struct buffer *buffer,
old_zv = BUF_ZV (buffer);
old_begv_byte = BUF_BEGV_BYTE (buffer);
old_zv_byte = BUF_ZV_BYTE (buffer);
- BUF_BEGV (buffer) = BUF_BEG (buffer);
- BUF_ZV (buffer) = BUF_Z (buffer);
- BUF_BEGV_BYTE (buffer) = BUF_BEG_BYTE (buffer);
- BUF_ZV_BYTE (buffer) = BUF_Z_BYTE (buffer);
+
+ SET_BUF_BEGV_BOTH (buffer, BUF_BEG (buffer), BUF_BEG_BYTE (buffer));
+ SET_BUF_ZV_BOTH (buffer, BUF_Z (buffer), BUF_Z_BYTE (buffer));
XSETFASTINT (lispy_position, position);
XSETBUFFER (lispy_buffer, buffer);
@@ -2329,10 +2327,8 @@ get_local_map (register EMACS_INT position, register struct buffer *buffer,
if (NILP (prop))
prop = get_pos_property (lispy_position, type, lispy_buffer);
- BUF_BEGV (buffer) = old_begv;
- BUF_ZV (buffer) = old_zv;
- BUF_BEGV_BYTE (buffer) = old_begv_byte;
- BUF_ZV_BYTE (buffer) = old_zv_byte;
+ SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte);
+ SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte);
/* Use the local map only if it is valid. */
prop = get_keymap (prop, 0, 0);
diff --git a/src/keyboard.c b/src/keyboard.c
index 78aa1cfea7..63e7573fbe 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -451,7 +451,7 @@ static int store_user_signal_events (void);
C can be a character, which is printed prettily ("M-C-x" and all that
jazz), or a symbol, whose name is printed. */
-void
+static void
echo_char (Lisp_Object c)
{
if (current_kboard->immediate_echo)
@@ -538,7 +538,7 @@ echo_char (Lisp_Object c)
/* Temporarily add a dash to the end of the echo string if it's not
empty, so that it serves as a mini-prompt for the very next character. */
-void
+static void
echo_dash (void)
{
/* Do nothing if not echoing at all. */
@@ -967,7 +967,7 @@ restore_kboard_configuration (Lisp_Object was_locked)
/* Handle errors that are not handled at inner levels
by printing an error message and returning to the editor command loop. */
-Lisp_Object
+static Lisp_Object
cmd_error (Lisp_Object data)
{
Lisp_Object old_level, old_length;
@@ -1132,7 +1132,7 @@ command_loop_2 (Lisp_Object ignore)
return Qnil;
}
-Lisp_Object
+static Lisp_Object
top_level_2 (void)
{
return Feval (Vtop_level, Qnil);
@@ -1169,6 +1169,7 @@ This also exits all active minibuffers. */)
Fthrow (Qtop_level, Qnil);
}
+Lisp_Object Fexit_recursive_edit (void) NO_RETURN;
DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "",
doc: /* Exit from the innermost recursive edit or minibuffer. */)
(void)
@@ -1179,6 +1180,7 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0,
error ("No recursive edit is in progress");
}
+Lisp_Object Fabort_recursive_edit (void) NO_RETURN;
DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "",
doc: /* Abort the command that requested this recursive edit or minibuffer input. */)
(void)
@@ -1885,7 +1887,7 @@ poll_for_input_1 (void)
/* Timer callback function for poll_timer. TIMER is equal to
poll_timer. */
-void
+static void
poll_for_input (struct atimer *timer)
{
if (poll_suppress_count == 0)
@@ -2184,7 +2186,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
int *used_mouse_menu, struct timeval *end_time)
{
volatile Lisp_Object c;
- int count, jmpcount;
+ int jmpcount;
jmp_buf local_getcjmp;
jmp_buf save_jump;
volatile int key_already_recorded = 0;
@@ -2461,21 +2463,21 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame));
if (kb != current_kboard)
{
- Lisp_Object link = KVAR (kb, kbd_queue);
+ Lisp_Object last = KVAR (kb, kbd_queue);
/* We shouldn't get here if we were in single-kboard mode! */
if (single_kboard)
abort ();
- if (CONSP (link))
+ if (CONSP (last))
{
- while (CONSP (XCDR (link)))
- link = XCDR (link);
- if (!NILP (XCDR (link)))
+ while (CONSP (XCDR (last)))
+ last = XCDR (last);
+ if (!NILP (XCDR (last)))
abort ();
}
- if (!CONSP (link))
+ if (!CONSP (last))
KVAR (kb, kbd_queue) = Fcons (c, Qnil);
else
- XSETCDR (link, Fcons (c, Qnil));
+ XSETCDR (last, Fcons (c, Qnil));
kb->kbd_queue_has_data = 1;
current_kboard = kb;
/* This is going to exit from read_char
@@ -2692,7 +2694,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
if (NILP (c))
{
- KBOARD *kb;
+ KBOARD *kb IF_LINT (= NULL);
if (end_time)
{
@@ -2712,18 +2714,18 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
if (! NILP (c) && (kb != current_kboard))
{
- Lisp_Object link = KVAR (kb, kbd_queue);
- if (CONSP (link))
+ Lisp_Object last = KVAR (kb, kbd_queue);
+ if (CONSP (last))
{
- while (CONSP (XCDR (link)))
- link = XCDR (link);
- if (!NILP (XCDR (link)))
+ while (CONSP (XCDR (last)))
+ last = XCDR (last);
+ if (!NILP (XCDR (last)))
abort ();
}
- if (!CONSP (link))
+ if (!CONSP (last))
KVAR (kb, kbd_queue) = Fcons (c, Qnil);
else
- XSETCDR (link, Fcons (c, Qnil));
+ XSETCDR (last, Fcons (c, Qnil));
kb->kbd_queue_has_data = 1;
c = Qnil;
if (single_kboard)
@@ -2912,7 +2914,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
{
Lisp_Object keys;
int key_count, key_count_reset;
- struct gcpro gcpro1;
+ struct gcpro inner_gcpro1;
int count = SPECPDL_INDEX ();
/* Save the echo status. */
@@ -2940,7 +2942,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
keys = Fcopy_sequence (this_command_keys);
else
keys = Qnil;
- GCPRO1 (keys);
+ GCPRO1_VAR (keys, inner_gcpro);
/* Clear out this_command_keys. */
this_command_key_count = 0;
@@ -2978,7 +2980,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
if (saved_immediate_echo)
echo_now ();
- UNGCPRO;
+ UNGCPRO_VAR (inner_gcpro);
/* The input method can return no events. */
if (! CONSP (tem))
@@ -3000,16 +3002,16 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
if (CONSP (c) && EQ (XCAR (c), Qhelp_echo))
{
/* (help-echo FRAME HELP WINDOW OBJECT POS). */
- Lisp_Object help, object, position, window, tem;
+ Lisp_Object help, object, position, window, htem;
- tem = Fcdr (XCDR (c));
- help = Fcar (tem);
- tem = Fcdr (tem);
- window = Fcar (tem);
- tem = Fcdr (tem);
- object = Fcar (tem);
- tem = Fcdr (tem);
- position = Fcar (tem);
+ htem = Fcdr (XCDR (c));
+ help = Fcar (htem);
+ htem = Fcdr (htem);
+ window = Fcar (htem);
+ htem = Fcdr (htem);
+ object = Fcar (htem);
+ htem = Fcdr (htem);
+ position = Fcar (htem);
show_help_echo (help, window, object, position, 0);
@@ -3051,7 +3053,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
if (!NILP (Vhelp_form) && help_char_p (c))
{
Lisp_Object tem0;
- count = SPECPDL_INDEX ();
+ int count = SPECPDL_INDEX ();
help_form_saved_window_configs
= Fcons (Fcurrent_window_configuration (Qnil),
@@ -4024,7 +4026,7 @@ kbd_buffer_get_event (KBOARD **kbp,
Lisp_Object bar_window;
enum scroll_bar_part part;
Lisp_Object x, y;
- unsigned long time;
+ unsigned long t;
*kbp = current_kboard;
/* Note that this uses F to determine which terminal to look at.
@@ -4035,7 +4037,7 @@ kbd_buffer_get_event (KBOARD **kbp,
/* XXX Can f or mouse_position_hook be NULL here? */
if (f && FRAME_TERMINAL (f)->mouse_position_hook)
(*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window,
- &part, &x, &y, &time);
+ &part, &x, &y, &t);
obj = Qnil;
@@ -4059,7 +4061,7 @@ kbd_buffer_get_event (KBOARD **kbp,
/* If we didn't decide to make a switch-frame event, go ahead and
return a mouse-motion event. */
if (!NILP (x) && NILP (obj))
- obj = make_lispy_movement (f, bar_window, part, x, y, time);
+ obj = make_lispy_movement (f, bar_window, part, x, y, t);
}
#endif /* HAVE_MOUSE || HAVE GPM */
else
@@ -5037,7 +5039,7 @@ int double_click_count;
static Lisp_Object
make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
- unsigned long time)
+ unsigned long t)
{
enum window_part part;
Lisp_Object posn = Qnil;
@@ -5218,7 +5220,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
Fcons (posn,
Fcons (Fcons (make_number (xret),
make_number (yret)),
- Fcons (make_number (time),
+ Fcons (make_number (t),
extra_info))));
}
@@ -5642,19 +5644,19 @@ make_lispy_event (struct input_event *event)
/* On window-system frames, use the value of
double-click-fuzz as is. On other frames, interpret it
as a multiple of 1/8 characters. */
- struct frame *f;
+ struct frame *fr;
int fuzz;
int symbol_num;
int is_double;
if (WINDOWP (event->frame_or_window))
- f = XFRAME (XWINDOW (event->frame_or_window)->frame);
+ fr = XFRAME (XWINDOW (event->frame_or_window)->frame);
else if (FRAMEP (event->frame_or_window))
- f = XFRAME (event->frame_or_window);
+ fr = XFRAME (event->frame_or_window);
else
abort ();
- fuzz = FRAME_WINDOW_P (f)
+ fuzz = FRAME_WINDOW_P (fr)
? double_click_fuzz : double_click_fuzz / 8;
if (event->modifiers & up_modifier)
@@ -5927,7 +5929,7 @@ make_lispy_event (struct input_event *event)
static Lisp_Object
make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part,
- Lisp_Object x, Lisp_Object y, unsigned long time)
+ Lisp_Object x, Lisp_Object y, unsigned long t)
{
/* Is it a scroll bar movement? */
if (frame && ! NILP (bar_window))
@@ -5939,7 +5941,7 @@ make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_pa
Fcons (list5 (bar_window,
Qvertical_scroll_bar,
Fcons (x, y),
- make_number (time),
+ make_number (t),
part_sym),
Qnil));
}
@@ -5947,7 +5949,7 @@ make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_pa
else
{
Lisp_Object position;
- position = make_lispy_position (frame, x, y, time);
+ position = make_lispy_position (frame, x, y, t);
return list2 (Qmouse_movement, position);
}
}
@@ -6236,7 +6238,7 @@ DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,
static Lisp_Object
apply_modifiers (int modifiers, Lisp_Object base)
{
- Lisp_Object cache, index, entry, new_symbol;
+ Lisp_Object cache, idx, entry, new_symbol;
/* Mask out upper bits. We don't know where this value's been. */
modifiers &= INTMASK;
@@ -6246,8 +6248,8 @@ apply_modifiers (int modifiers, Lisp_Object base)
/* The click modifier never figures into cache indices. */
cache = Fget (base, Qmodifier_cache);
- XSETFASTINT (index, (modifiers & ~click_modifier));
- entry = assq_no_quit (index, cache);
+ XSETFASTINT (idx, (modifiers & ~click_modifier));
+ entry = assq_no_quit (idx, cache);
if (CONSP (entry))
new_symbol = XCDR (entry);
@@ -6260,14 +6262,14 @@ apply_modifiers (int modifiers, Lisp_Object base)
SBYTES (SYMBOL_NAME (base)));
/* Add the new symbol to the base's cache. */
- entry = Fcons (index, new_symbol);
+ entry = Fcons (idx, new_symbol);
Fput (base, Qmodifier_cache, Fcons (entry, cache));
/* We have the parsing info now for free, so we could add it to
the caches:
- XSETFASTINT (index, modifiers);
+ XSETFASTINT (idx, modifiers);
Fput (new_symbol, Qevent_symbol_element_mask,
- Fcons (base, Fcons (index, Qnil)));
+ Fcons (base, Fcons (idx, Qnil)));
Fput (new_symbol, Qevent_symbol_elements,
Fcons (base, lispy_modifier_list (modifiers)));
Sadly, this is only correct if `base' is indeed a base event,
@@ -6821,16 +6823,17 @@ decode_keyboard_code (struct tty_display_info *tty,
return;
for (i = 0, p = coding->destination; i < coding->produced_char; i++)
{
- struct input_event buf;
+ struct input_event event_buf;
- EVENT_INIT (buf);
- buf.code = STRING_CHAR_ADVANCE (p);
- buf.kind = (ASCII_CHAR_P (buf.code)
- ? ASCII_KEYSTROKE_EVENT : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
+ EVENT_INIT (event_buf);
+ event_buf.code = STRING_CHAR_ADVANCE (p);
+ event_buf.kind =
+ (ASCII_CHAR_P (event_buf.code)
+ ? ASCII_KEYSTROKE_EVENT : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
/* See the comment in tty_read_avail_input. */
- buf.frame_or_window = tty->top_frame;
- buf.arg = Qnil;
- kbd_buffer_store_event (&buf);
+ event_buf.frame_or_window = tty->top_frame;
+ event_buf.arg = Qnil;
+ kbd_buffer_store_event (&event_buf);
}
}
@@ -6890,11 +6893,11 @@ tty_read_avail_input (struct terminal *terminal,
if (gpm_tty == tty)
{
Gpm_Event event;
- struct input_event hold_quit;
+ struct input_event gpm_hold_quit;
int gpm, fd = gpm_fd;
- EVENT_INIT (hold_quit);
- hold_quit.kind = NO_EVENT;
+ EVENT_INIT (gpm_hold_quit);
+ gpm_hold_quit.kind = NO_EVENT;
/* gpm==1 if event received.
gpm==0 if the GPM daemon has closed the connection, in which case
@@ -6903,13 +6906,13 @@ tty_read_avail_input (struct terminal *terminal,
select masks.
gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */
while (gpm = Gpm_GetEvent (&event), gpm == 1) {
- nread += handle_one_term_event (tty, &event, &hold_quit);
+ nread += handle_one_term_event (tty, &event, &gpm_hold_quit);
}
if (gpm == 0)
/* Presumably the GPM daemon has closed the connection. */
close_gpm (fd);
- if (hold_quit.kind != NO_EVENT)
- kbd_buffer_store_event (&hold_quit);
+ if (gpm_hold_quit.kind != NO_EVENT)
+ kbd_buffer_store_event (&gpm_hold_quit);
if (nread)
return nread;
}
@@ -7056,7 +7059,7 @@ tty_read_avail_input (struct terminal *terminal,
return nread;
}
-void
+static void
handle_async_input (void)
{
interrupt_input_pending = 0;
@@ -7329,8 +7332,6 @@ menu_bar_items (Lisp_Object old)
int mapno;
Lisp_Object oquit;
- int i;
-
/* In order to build the menus, we need to call the keymap
accessors. They all call QUIT. But this function is called
during redisplay, during which a quit is fatal. So inhibit
@@ -7432,15 +7433,18 @@ menu_bar_items (Lisp_Object old)
}
/* Add nil, nil, nil, nil at the end. */
- i = menu_bar_items_index;
- if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
- menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil);
- /* Add this item. */
- XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
- XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
- XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
- XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
- menu_bar_items_index = i;
+ {
+ int i = menu_bar_items_index;
+ if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
+ menu_bar_items_vector =
+ larger_vector (menu_bar_items_vector, 2 * i, Qnil);
+ /* Add this item. */
+ XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
+ XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
+ XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
+ XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
+ menu_bar_items_index = i;
+ }
Vinhibit_quit = oquit;
return menu_bar_items_vector;
@@ -8118,12 +8122,12 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
/* Process the rest of the properties. */
for (; CONSP (item) && CONSP (XCDR (item)); item = XCDR (XCDR (item)))
{
- Lisp_Object key, value;
+ Lisp_Object ikey, value;
- key = XCAR (item);
+ ikey = XCAR (item);
value = XCAR (XCDR (item));
- if (EQ (key, QCenable))
+ if (EQ (ikey, QCenable))
{
/* `:enable FORM'. */
if (!NILP (Venable_disabled_menus_and_buttons))
@@ -8131,20 +8135,20 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
else
PROP (TOOL_BAR_ITEM_ENABLED_P) = value;
}
- else if (EQ (key, QCvisible))
+ else if (EQ (ikey, QCvisible))
{
/* `:visible FORM'. If got a visible property and that
evaluates to nil then ignore this item. */
if (NILP (menu_item_eval_property (value)))
return 0;
}
- else if (EQ (key, QChelp))
+ else if (EQ (ikey, QChelp))
/* `:help HELP-STRING'. */
PROP (TOOL_BAR_ITEM_HELP) = value;
- else if (EQ (key, QCvert_only))
+ else if (EQ (ikey, QCvert_only))
/* `:vert-only t/nil'. */
PROP (TOOL_BAR_ITEM_VERT_ONLY) = value;
- else if (EQ (key, QClabel))
+ else if (EQ (ikey, QClabel))
{
const char *bad_label = "!!?GARBLED ITEM?!!";
/* `:label LABEL-STRING'. */
@@ -8153,10 +8157,10 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
: make_string (bad_label, strlen (bad_label));
have_label = 1;
}
- else if (EQ (key, QCfilter))
+ else if (EQ (ikey, QCfilter))
/* ':filter FORM'. */
filter = value;
- else if (EQ (key, QCbutton) && CONSP (value))
+ else if (EQ (ikey, QCbutton) && CONSP (value))
{
/* `:button (TYPE . SELECTED)'. */
Lisp_Object type, selected;
@@ -8169,13 +8173,13 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
PROP (TOOL_BAR_ITEM_TYPE) = type;
}
}
- else if (EQ (key, QCimage)
+ else if (EQ (ikey, QCimage)
&& (CONSP (value)
|| (VECTORP (value) && XVECTOR (value)->size == 4)))
/* Value is either a single image specification or a vector
of 4 such specifications for the different button states. */
PROP (TOOL_BAR_ITEM_IMAGES) = value;
- else if (EQ (key, Qrtl))
+ else if (EQ (ikey, Qrtl))
/* ':rtl STRING' */
PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value;
}
@@ -8184,35 +8188,34 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
if (!have_label)
{
/* Try to make one from caption and key. */
- Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY);
- Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION);
- const char *label = SYMBOLP (key) ? SSDATA (SYMBOL_NAME (key)) : "";
- const char *caption = STRINGP (capt) ? SSDATA (capt) : "";
+ Lisp_Object tkey = PROP (TOOL_BAR_ITEM_KEY);
+ Lisp_Object tcapt = PROP (TOOL_BAR_ITEM_CAPTION);
+ const char *label = SYMBOLP (tkey) ? SSDATA (SYMBOL_NAME (tkey)) : "";
+ const char *capt = STRINGP (tcapt) ? SSDATA (tcapt) : "";
EMACS_INT max_lbl = 2 * tool_bar_max_label_size;
char *buf = (char *) xmalloc (max_lbl + 1);
Lisp_Object new_lbl;
- size_t caption_len = strlen (caption);
+ size_t caption_len = strlen (capt);
- if (caption_len <= max_lbl && caption[0] != '\0')
+ if (caption_len <= max_lbl && capt[0] != '\0')
{
- strcpy (buf, caption);
+ strcpy (buf, capt);
while (caption_len > 0 && buf[caption_len - 1] == '.')
caption_len--;
buf[caption_len] = '\0';
- label = caption = buf;
+ label = capt = buf;
}
if (strlen (label) <= max_lbl && label[0] != '\0')
{
- int i;
+ int j;
if (label != buf)
strcpy (buf, label);
- for (i = 0; buf[i] != '\0'; ++i)
- if (buf[i] == '-')
- buf[i] = ' ';
+ for (j = 0; buf[j] != '\0'; ++j)
+ if (buf[j] == '-')
+ buf[j] = ' ';
label = buf;
-
}
else
label = "";
@@ -8871,7 +8874,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
/* The length of the echo buffer when we started reading, and
the length of this_command_keys when we started reading. */
- int echo_start;
+ int echo_start IF_LINT (= 0);
int keys_start;
/* The number of keymaps we're scanning right now, and the number of
@@ -8949,7 +8952,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
Lisp_Object first_event;
#endif
- Lisp_Object original_uppercase;
+ Lisp_Object original_uppercase IF_LINT (= Qnil);
int original_uppercase_position = -1;
/* Gets around Microsoft compiler limitations. */
@@ -8964,9 +8967,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
int junk;
#endif
- struct gcpro gcpro1;
+ struct gcpro outer_gcpro1;
- GCPRO1 (fake_prefixed_keys);
+ GCPRO1_VAR (fake_prefixed_keys, outer_gcpro);
raw_keybuf_count = 0;
last_nonmenu_event = Qnil;
@@ -9128,7 +9131,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
while those allow us to restart the entire key sequence,
echo_local_start and keys_local_start allow us to throw away
just one key. */
- int echo_local_start, keys_local_start, local_first_binding;
+ int echo_local_start IF_LINT (= 0);
+ int keys_local_start, local_first_binding;
eassert (indec.end == t || (indec.end > t && indec.end <= mock_input));
eassert (indec.start <= indec.end);
@@ -9260,7 +9264,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
if (EQ (key, Qt))
{
unbind_to (count, Qnil);
- UNGCPRO;
+ UNGCPRO_VAR (outer_gcpro);
return -1;
}
@@ -9838,7 +9842,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
&& /* indec.start >= t && fkey.start >= t && */ keytran.start >= t
&& INTEGERP (key)
&& ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK))
- && UPPERCASEP (XINT (key) & ~CHAR_MODIFIER_MASK))
+ && uppercasep (XINT (key) & ~CHAR_MODIFIER_MASK))
|| (XINT (key) & shift_modifier)))
{
Lisp_Object new_key;
@@ -9849,7 +9853,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
if (XINT (key) & shift_modifier)
XSETINT (new_key, XINT (key) & ~shift_modifier);
else
- XSETINT (new_key, (DOWNCASE (XINT (key) & ~CHAR_MODIFIER_MASK)
+ XSETINT (new_key, (downcase (XINT (key) & ~CHAR_MODIFIER_MASK)
| (XINT (key) & CHAR_MODIFIER_MASK)));
/* We have to do this unconditionally, regardless of whether
@@ -9877,13 +9881,13 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
|| (INTEGERP (key)
&& (KEY_TO_CHAR (key)
< XCHAR_TABLE (BVAR (current_buffer, downcase_table))->size)
- && UPPERCASEP (KEY_TO_CHAR (key))))
+ && uppercasep (KEY_TO_CHAR (key))))
{
Lisp_Object new_key
= (modifiers & shift_modifier
? apply_modifiers (modifiers & ~shift_modifier,
XCAR (breakdown))
- : make_number (DOWNCASE (KEY_TO_CHAR (key)) | modifiers));
+ : make_number (downcase (KEY_TO_CHAR (key)) | modifiers));
original_uppercase = key;
original_uppercase_position = t - 1;
@@ -9943,7 +9947,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
add_command_key (keybuf[t]);
}
- UNGCPRO;
+ UNGCPRO_VAR (outer_gcpro);
return t;
}
@@ -9990,11 +9994,11 @@ is nil, then the event will be put off until after the current key sequence.
sequences, where they wouldn't conflict with ordinary bindings. See
`function-key-map' for more details.
-The optional fifth argument COMMAND-LOOP, if non-nil, means
+The optional fifth argument CMD-LOOP, if non-nil, means
that this key sequence is being read by something that will
read commands one after another. It should be nil if the caller
will read just one key sequence. */)
- (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object command_loop)
+ (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object cmd_loop)
{
Lisp_Object keybuf[30];
register int i;
@@ -10006,9 +10010,9 @@ will read just one key sequence. */)
QUIT;
specbind (Qinput_method_exit_on_first_char,
- (NILP (command_loop) ? Qt : Qnil));
+ (NILP (cmd_loop) ? Qt : Qnil));
specbind (Qinput_method_use_echo_area,
- (NILP (command_loop) ? Qt : Qnil));
+ (NILP (cmd_loop) ? Qt : Qnil));
memset (keybuf, 0, sizeof keybuf);
GCPRO1 (keybuf[0]);
@@ -10051,7 +10055,7 @@ will read just one key sequence. */)
DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
Sread_key_sequence_vector, 1, 5, 0,
doc: /* Like `read-key-sequence' but always return a vector. */)
- (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object command_loop)
+ (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object cmd_loop)
{
Lisp_Object keybuf[30];
register int i;
@@ -10063,9 +10067,9 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
QUIT;
specbind (Qinput_method_exit_on_first_char,
- (NILP (command_loop) ? Qt : Qnil));
+ (NILP (cmd_loop) ? Qt : Qnil));
specbind (Qinput_method_use_echo_area,
- (NILP (command_loop) ? Qt : Qnil));
+ (NILP (cmd_loop) ? Qt : Qnil));
memset (keybuf, 0, sizeof keybuf);
GCPRO1 (keybuf[0]);
diff --git a/src/keyboard.h b/src/keyboard.h
index 10bf16d5c5..00745a0914 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -90,7 +90,7 @@ struct kboard
/* User-supplied table to translate input characters through. */
Lisp_Object KBOARD_INTERNAL_FIELD (Vkeyboard_translate_table);
-
+
/* Last command that may be repeated by `repeat'. */
Lisp_Object KBOARD_INTERNAL_FIELD (Vlast_repeatable_command);
@@ -140,12 +140,12 @@ struct kboard
/* Keymap mapping keys to alternative preferred forms.
See the DEFVAR for more documentation. */
Lisp_Object KBOARD_INTERNAL_FIELD (Vlocal_function_key_map);
-
+
/* Keymap mapping ASCII function key sequences onto their preferred
forms. Initialized by the terminal-specific lisp files. See the
DEFVAR for more documentation. */
Lisp_Object KBOARD_INTERNAL_FIELD (Vinput_decode_map);
-
+
/* Minibufferless frames on this display use this frame's minibuffer. */
Lisp_Object KBOARD_INTERNAL_FIELD (Vdefault_minibuffer_frame);
@@ -494,6 +494,7 @@ extern int input_polling_used (void);
extern void clear_input_pending (void);
extern int requeued_events_pending_p (void);
extern void bind_polling_period (int);
+extern int make_ctrl_char (int);
extern void stuff_buffered_input (Lisp_Object);
extern void clear_waiting_for_input (void);
extern void swallow_events (int);
@@ -517,4 +518,8 @@ extern void add_user_signal (int, const char *);
extern int tty_read_avail_input (struct terminal *, int,
struct input_event *);
extern EMACS_TIME timer_check (int);
+extern void mark_kboards (void);
+#ifdef WINDOWSNT
+extern const char *const lispy_function_keys[];
+#endif
diff --git a/src/keymap.c b/src/keymap.c
index 4459ef07d6..06968a0d94 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -34,9 +34,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "keymap.h"
#include "window.h"
-/* The number of elements in keymap vectors. */
-#define DENSE_TABLE_SIZE (0200)
-
/* Actually allocate storage for these variables */
Lisp_Object current_global_map; /* Current global keymap */
@@ -191,8 +188,9 @@ when reading a key-sequence to be looked-up in this keymap. */)
If the map needs to be autoloaded, but AUTOLOAD is zero (and ERROR
is zero as well), return Qt.
- ERROR controls how we respond if OBJECT isn't a keymap.
- If ERROR is non-zero, signal an error; otherwise, just return Qnil.
+ ERROR_IF_NOT_KEYMAP controls how we respond if OBJECT isn't a keymap.
+ If ERROR_IF_NOT_KEYMAP is non-zero, signal an error; otherwise,
+ just return Qnil.
Note that most of the time, we don't want to pursue autoloads.
Functions like Faccessible_keymaps which scan entire keymap trees
@@ -204,7 +202,7 @@ when reading a key-sequence to be looked-up in this keymap. */)
do_autoload which can GC. */
Lisp_Object
-get_keymap (Lisp_Object object, int error, int autoload)
+get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
{
Lisp_Object tem;
@@ -222,7 +220,7 @@ get_keymap (Lisp_Object object, int error, int autoload)
/* Should we do an autoload? Autoload forms for keymaps have
Qkeymap as their fifth element. */
- if ((autoload || !error) && EQ (XCAR (tem), Qautoload)
+ if ((autoload || !error_if_not_keymap) && EQ (XCAR (tem), Qautoload)
&& SYMBOLP (object))
{
Lisp_Object tail;
@@ -247,7 +245,7 @@ get_keymap (Lisp_Object object, int error, int autoload)
}
end:
- if (error)
+ if (error_if_not_keymap)
wrong_type_argument (Qkeymapp, object);
return Qnil;
}
@@ -255,7 +253,7 @@ get_keymap (Lisp_Object object, int error, int autoload)
/* Return the parent map of KEYMAP, or nil if it has none.
We assume that KEYMAP is a valid keymap. */
-Lisp_Object
+static Lisp_Object
keymap_parent (Lisp_Object keymap, int autoload)
{
Lisp_Object list;
@@ -283,7 +281,7 @@ If KEYMAP has no parent, return nil. */)
}
/* Check whether MAP is one of MAPS parents. */
-int
+static int
keymap_memberp (Lisp_Object map, Lisp_Object maps)
{
if (NILP (map)) return 0;
@@ -468,19 +466,19 @@ access_keymap (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int au
/* See if there is a meta-map. If there's none, there is
no binding for IDX, unless a default binding exists in MAP. */
struct gcpro gcpro1;
- Lisp_Object meta_map;
+ Lisp_Object event_meta_map;
GCPRO1 (map);
/* A strange value in which Meta is set would cause
infinite recursion. Protect against that. */
if (XINT (meta_prefix_char) & CHAR_META)
meta_prefix_char = make_number (27);
- meta_map = get_keymap (access_keymap (map, meta_prefix_char,
- t_ok, noinherit, autoload),
- 0, autoload);
+ event_meta_map = get_keymap (access_keymap (map, meta_prefix_char,
+ t_ok, noinherit, autoload),
+ 0, autoload);
UNGCPRO;
- if (CONSP (meta_map))
+ if (CONSP (event_meta_map))
{
- map = meta_map;
+ map = event_meta_map;
idx = make_number (XUINT (idx) & ~meta_modifier);
}
else if (t_ok)
@@ -598,7 +596,7 @@ map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val)
/* Call FUN for every binding in MAP and stop at (and return) the parent.
FUN is called with 4 arguments: FUN (KEY, BINDING, ARGS, DATA). */
-Lisp_Object
+static Lisp_Object
map_keymap_internal (Lisp_Object map,
map_keymap_function_t fun,
Lisp_Object args,
@@ -960,7 +958,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
EXFUN (Fcopy_keymap, 1);
-Lisp_Object
+static Lisp_Object
copy_keymap_item (Lisp_Object elt)
{
Lisp_Object res, tem;
@@ -1142,10 +1140,10 @@ binding KEY to DEF is added at the front of KEYMAP. */)
int i = ASIZE (def);
while (--i >= 0)
{
- Lisp_Object c = AREF (def, i);
- if (CONSP (c) && lucid_event_type_list_p (c))
- c = Fevent_convert_list (c);
- ASET (tmp, i, c);
+ Lisp_Object defi = AREF (def, i);
+ if (CONSP (defi) && lucid_event_type_list_p (defi))
+ defi = Fevent_convert_list (defi);
+ ASET (tmp, i, defi);
}
def = tmp;
}
@@ -1337,7 +1335,7 @@ define_as_prefix (Lisp_Object keymap, Lisp_Object c)
/* Append a key to the end of a key sequence. We always make a vector. */
-Lisp_Object
+static Lisp_Object
append_key (Lisp_Object key_sequence, Lisp_Object key)
{
Lisp_Object args[2];
@@ -2439,7 +2437,7 @@ around function keys and event symbols. */)
return Qnil;
}
-char *
+static char *
push_text_char_description (register unsigned int c, register char *p)
{
if (c >= 0200)
@@ -2774,8 +2772,8 @@ remapped command in the returned list. */)
considered remapped sequences yet, copy them over and
process them. */
|| (!remapped && (sequences = remapped_sequences,
- remapped = 1),
- CONSP (sequences)))
+ remapped = 1,
+ CONSP (sequences))))
{
Lisp_Object sequence, function;
@@ -2815,9 +2813,9 @@ remapped command in the returned list. */)
seems to be only one menu item to report. */
if (! NILP (sequence))
{
- Lisp_Object tem;
- tem = Faref (sequence, make_number (ASIZE (sequence) - 1));
- if (STRINGP (tem))
+ Lisp_Object tem1;
+ tem1 = Faref (sequence, make_number (ASIZE (sequence) - 1));
+ if (STRINGP (tem1))
Faset (sequence, make_number (ASIZE (sequence) - 1),
build_string ("(any string)"));
}
@@ -3122,13 +3120,13 @@ key binding\n\
/* Delete from MAPS each element that is for the menu bar. */
for (list = maps; CONSP (list); list = XCDR (list))
{
- Lisp_Object elt, prefix, tem;
+ Lisp_Object elt, elt_prefix, tem;
elt = XCAR (list);
- prefix = Fcar (elt);
- if (XVECTOR (prefix)->size >= 1)
+ elt_prefix = Fcar (elt);
+ if (XVECTOR (elt_prefix)->size >= 1)
{
- tem = Faref (prefix, make_number (0));
+ tem = Faref (elt_prefix, make_number (0));
if (EQ (tem, Qmenu_bar))
maps = Fdelq (elt, maps);
}
@@ -3153,10 +3151,10 @@ key binding\n\
for (; CONSP (maps); maps = XCDR (maps))
{
- register Lisp_Object elt, prefix, tail;
+ register Lisp_Object elt, elt_prefix, tail;
elt = XCAR (maps);
- prefix = Fcar (elt);
+ elt_prefix = Fcar (elt);
sub_shadows = Qnil;
@@ -3168,8 +3166,8 @@ key binding\n\
/* If the sequence by which we reach this keymap is zero-length,
then the shadow map for this keymap is just SHADOW. */
- if ((STRINGP (prefix) && SCHARS (prefix) == 0)
- || (VECTORP (prefix) && XVECTOR (prefix)->size == 0))
+ if ((STRINGP (elt_prefix) && SCHARS (elt_prefix) == 0)
+ || (VECTORP (elt_prefix) && XVECTOR (elt_prefix)->size == 0))
;
/* If the sequence by which we reach this keymap actually has
some elements, then the sequence's definition in SHADOW is
@@ -3195,12 +3193,12 @@ key binding\n\
for (tail = orig_maps; !EQ (tail, maps); tail = XCDR (tail))
{
Lisp_Object tem;
- tem = Fequal (Fcar (XCAR (tail)), prefix);
+ tem = Fequal (Fcar (XCAR (tail)), elt_prefix);
if (!NILP (tem))
sub_shadows = Fcons (XCDR (XCAR (tail)), sub_shadows);
}
- describe_map (Fcdr (elt), prefix,
+ describe_map (Fcdr (elt), elt_prefix,
transl ? describe_translation : describe_command,
partial, sub_shadows, &seen, nomenu, mention_shadow);
diff --git a/src/lisp.h b/src/lisp.h
index e4788e63f5..9cbaf24cac 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -27,9 +27,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
types of run time checks for Lisp objects. */
#ifdef GC_CHECK_CONS_LIST
-#define CHECK_CONS_LIST() check_cons_list()
+extern void check_cons_list (void);
+#define CHECK_CONS_LIST() check_cons_list ()
#else
-#define CHECK_CONS_LIST() ((void)0)
+#define CHECK_CONS_LIST() ((void) 0)
#endif
/* These are default choices for the types to use. */
@@ -85,7 +86,7 @@ extern void die (const char *, const char *, int) NO_RETURN;
/* Define an Emacs version of "assert", since some system ones are
flaky. */
#ifndef ENABLE_CHECKING
-#define eassert(X) (void) 0
+#define eassert(X) ((void) (0 && (X))) /* Check that X compiles. */
#else /* ENABLE_CHECKING */
#if defined (__GNUC__) && __GNUC__ >= 2 && defined (__STDC__)
#define eassert(cond) CHECK(cond,"assertion failed: " #cond)
@@ -841,6 +842,9 @@ struct Lisp_Vector
#endif /* not __GNUC__ */
+/* Nonzero iff C is an ASCII character. */
+#define ASCII_CHAR_P(c) ((unsigned) (c) < 0x80)
+
/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
characters. Do not check validity of CT. */
#define CHAR_TABLE_REF(CT, IDX) \
@@ -2046,50 +2050,6 @@ extern int pending_signals;
#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit))
-/* Variables used locally in the following case handling macros. */
-extern int case_temp1;
-extern Lisp_Object case_temp2;
-
-/* Current buffer's map from characters to lower-case characters. */
-
-#define DOWNCASE_TABLE BVAR (current_buffer, downcase_table)
-
-/* Current buffer's map from characters to upper-case characters. */
-
-#define UPCASE_TABLE BVAR (current_buffer, upcase_table)
-
-/* Downcase a character, or make no change if that cannot be done. */
-
-#define DOWNCASE(CH) \
- ((case_temp1 = (CH), \
- case_temp2 = CHAR_TABLE_REF (DOWNCASE_TABLE, case_temp1), \
- NATNUMP (case_temp2)) \
- ? XFASTINT (case_temp2) : case_temp1)
-
-/* 1 if CH is upper case. */
-
-#define UPPERCASEP(CH) (DOWNCASE (CH) != (CH))
-
-/* 1 if CH is neither upper nor lower case. */
-
-#define NOCASEP(CH) (UPCASE1 (CH) == (CH))
-
-/* 1 if CH is lower case. */
-
-#define LOWERCASEP(CH) (!UPPERCASEP (CH) && !NOCASEP(CH))
-
-/* Upcase a character, or make no change if that cannot be done. */
-
-#define UPCASE(CH) (!UPPERCASEP (CH) ? UPCASE1 (CH) : (CH))
-
-/* Upcase a character known to be not upper case. */
-
-#define UPCASE1(CH) \
- ((case_temp1 = (CH), \
- case_temp2 = CHAR_TABLE_REF (UPCASE_TABLE, case_temp1), \
- NATNUMP (case_temp2)) \
- ? XFASTINT (case_temp2) : case_temp1)
-
extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
extern Lisp_Object Vascii_canon_table, Vascii_eqv_table;
@@ -2155,126 +2115,143 @@ struct gcpro
|| GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS)
+#define GCPRO1(var) \
+ GCPRO1_VAR (var, gcpro)
+#define GCPRO2(var1, var2) \
+ GCPRO2_VAR (var1, var2, gcpro)
+#define GCPRO3(var1, var2, var3) \
+ GCPRO3_VAR (var1, var2, var3, gcpro)
+#define GCPRO4(var1, var2, var3, var4) \
+ GCPRO4_VAR (var1, var2, var3, var4, gcpro)
+#define GCPRO5(var1, var2, var3, var4, var5) \
+ GCPRO5_VAR (var1, var2, var3, var4, var5, gcpro)
+#define GCPRO6(var1, var2, var3, var4, var5, var6) \
+ GCPRO6_VAR (var1, var2, var3, var4, var5, var6, gcpro)
+#define UNGCPRO UNGCPRO_VAR (gcpro)
+
#if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
/* Do something silly with gcproN vars just so gcc shuts up. */
/* You get warnings from MIPSPro... */
-#define GCPRO1(varname) ((void) gcpro1)
-#define GCPRO2(varname1, varname2)(((void) gcpro2, (void) gcpro1))
-#define GCPRO3(varname1, varname2, varname3) \
- (((void) gcpro3, (void) gcpro2, (void) gcpro1))
-#define GCPRO4(varname1, varname2, varname3, varname4) \
- (((void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1))
-#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
- (((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1))
-#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
- (((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1))
-#define UNGCPRO ((void) 0)
+#define GCPRO1_VAR(var, gcpro) ((void) gcpro##1)
+#define GCPRO2_VAR(var1, var2, gcpro) \
+ ((void) gcpro##2, (void) gcpro##1)
+#define GCPRO3_VAR(var1, var2, var3, gcpro) \
+ ((void) gcpro##3, (void) gcpro##2, (void) gcpro##1)
+#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \
+ ((void) gcpro##4, (void) gcpro##3, (void) gcpro##2, (void) gcpro##1)
+#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \
+ ((void) gcpro##5, (void) gcpro##4, (void) gcpro##3, (void) gcpro##2, \
+ (void) gcpro##1)
+#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \
+ ((void) gcpro##6, (void) gcpro##5, (void) gcpro##4, (void) gcpro##3, \
+ (void) gcpro##2, (void) gcpro##1)
+#define UNGCPRO_VAR(gcpro) ((void) 0)
#else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */
#ifndef DEBUG_GCPRO
-#define GCPRO1(varname) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \
- gcprolist = &gcpro1; }
-
-#define GCPRO2(varname1, varname2) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcprolist = &gcpro2; }
-
-#define GCPRO3(varname1, varname2, varname3) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
- gcprolist = &gcpro3; }
-
-#define GCPRO4(varname1, varname2, varname3, varname4) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
- gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
- gcprolist = &gcpro4; }
-
-#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
- gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
- gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
- gcprolist = &gcpro5; }
-
-#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
- gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
- gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
- gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \
- gcprolist = &gcpro6; }
-
-#define UNGCPRO (gcprolist = gcpro1.next)
+#define GCPRO1_VAR(var, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \
+ gcprolist = &gcpro##1; }
+
+#define GCPRO2_VAR(var1, var2, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcprolist = &gcpro##2; }
+
+#define GCPRO3_VAR(var1, var2, var3, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
+ gcprolist = &gcpro##3; }
+
+#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
+ gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
+ gcprolist = &gcpro##4; }
+
+#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
+ gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
+ gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \
+ gcprolist = &gcpro##5; }
+
+#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
+ gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
+ gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \
+ gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \
+ gcprolist = &gcpro##6; }
+
+#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1.next)
#else
extern int gcpro_level;
-#define GCPRO1(varname) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \
- gcpro1.level = gcpro_level++; \
- gcprolist = &gcpro1; }
-
-#define GCPRO2(varname1, varname2) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro1.level = gcpro_level; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro2.level = gcpro_level++; \
- gcprolist = &gcpro2; }
-
-#define GCPRO3(varname1, varname2, varname3) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro1.level = gcpro_level; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
- gcpro3.level = gcpro_level++; \
- gcprolist = &gcpro3; }
-
-#define GCPRO4(varname1, varname2, varname3, varname4) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro1.level = gcpro_level; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
- gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
- gcpro4.level = gcpro_level++; \
- gcprolist = &gcpro4; }
-
-#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro1.level = gcpro_level; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
- gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
- gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
- gcpro5.level = gcpro_level++; \
- gcprolist = &gcpro5; }
-
-#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
- gcpro1.level = gcpro_level; \
- gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \
- gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \
- gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \
- gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
- gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \
- gcpro6.level = gcpro_level++; \
- gcprolist = &gcpro6; }
-
-#define UNGCPRO \
- ((--gcpro_level != gcpro1.level) \
- ? (abort (), 0) \
- : ((gcprolist = gcpro1.next), 0))
+#define GCPRO1_VAR(var, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \
+ gcpro##1.level = gcpro_level++; \
+ gcprolist = &gcpro##1; }
+
+#define GCPRO2_VAR(var1, var2, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##1.level = gcpro_level; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##2.level = gcpro_level++; \
+ gcprolist = &gcpro##2; }
+
+#define GCPRO3_VAR(var1, var2, var3, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##1.level = gcpro_level; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
+ gcpro##3.level = gcpro_level++; \
+ gcprolist = &gcpro##3; }
+
+#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##1.level = gcpro_level; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
+ gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
+ gcpro##4.level = gcpro_level++; \
+ gcprolist = &gcpro##4; }
+
+#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##1.level = gcpro_level; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
+ gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
+ gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \
+ gcpro##5.level = gcpro_level++; \
+ gcprolist = &gcpro##5; }
+
+#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \
+ {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \
+ gcpro##1.level = gcpro_level; \
+ gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \
+ gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \
+ gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \
+ gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \
+ gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \
+ gcpro##6.level = gcpro_level++; \
+ gcprolist = &gcpro##6; }
+
+#define UNGCPRO_VAR(gcpro) \
+ ((--gcpro_level != gcpro##1.level) \
+ ? (abort (), 0) \
+ : ((gcprolist = gcpro##1.next), 0))
#endif /* DEBUG_GCPRO */
#endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */
@@ -2542,7 +2519,10 @@ extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y);
/* Defined in fringe.c */
extern void syms_of_fringe (void);
extern void init_fringe (void);
+#ifdef HAVE_WINDOW_SYSTEM
+extern void mark_fringe_data (void);
extern void init_fringe_once (void);
+#endif /* HAVE_WINDOW_SYSTEM */
/* Defined in image.c */
extern Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
@@ -2606,6 +2586,7 @@ extern void syms_of_insdel (void);
/* Defined in dispnew.c */
extern Lisp_Object selected_frame;
+extern Lisp_Object Vwindow_system;
EXFUN (Fding, 1);
EXFUN (Fredraw_frame, 1);
EXFUN (Fsleep_for, 2);
@@ -2788,6 +2769,7 @@ EXFUN (Fprint, 2);
EXFUN (Ferror_message_string, 1);
extern Lisp_Object Qstandard_output;
extern Lisp_Object Qexternal_debugging_output;
+extern void debug_output_compilation_hack (int);
extern void temp_output_buffer_setup (const char *);
extern int print_level;
extern Lisp_Object Qprint_escape_newlines;
@@ -2899,8 +2881,10 @@ extern Lisp_Object safe_call (int, Lisp_Object *);
extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
extern void init_eval (void);
+extern void mark_backtrace (void);
extern void syms_of_eval (void);
+/* Defined in editfns.c */
extern Lisp_Object Qfield;
EXFUN (Fcurrent_message, 0);
EXFUN (Fgoto_char, 1);
@@ -2940,6 +2924,8 @@ extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int);
extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT,
EMACS_INT, int);
extern void init_editfns (void);
+const char *get_system_name (void);
+const char *get_operating_system_release (void);
extern void syms_of_editfns (void);
EXFUN (Fconstrain_to_field, 5);
EXFUN (Ffield_end, 3);
@@ -2996,12 +2982,14 @@ extern EMACS_INT marker_byte_position (Lisp_Object);
extern void clear_charpos_cache (struct buffer *);
extern EMACS_INT charpos_to_bytepos (EMACS_INT);
extern EMACS_INT buf_charpos_to_bytepos (struct buffer *, EMACS_INT);
+extern EMACS_INT verify_bytepos (EMACS_INT charpos);
extern EMACS_INT buf_bytepos_to_charpos (struct buffer *, EMACS_INT);
extern void unchain_marker (struct Lisp_Marker *marker);
extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object);
extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT);
extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object,
EMACS_INT, EMACS_INT);
+extern int count_markers (struct buffer *);
extern void syms_of_marker (void);
/* Defined in fileio.c */
@@ -3010,6 +2998,7 @@ extern Lisp_Object Qfile_error;
extern Lisp_Object Qfile_exists_p;
extern Lisp_Object Qfile_directory_p;
extern Lisp_Object Qinsert_file_contents;
+extern Lisp_Object Qfile_name_history;
EXFUN (Ffind_file_name_handler, 2);
EXFUN (Ffile_name_as_directory, 1);
EXFUN (Fexpand_file_name, 2);
@@ -3051,6 +3040,10 @@ EXFUN (Fset_match_data, 2);
EXFUN (Fmatch_beginning, 1);
EXFUN (Fmatch_end, 1);
extern void record_unwind_save_match_data (void);
+struct re_registers;
+extern struct re_pattern_buffer *compile_pattern (Lisp_Object,
+ struct re_registers *,
+ Lisp_Object, int, int);
extern int fast_string_match (Lisp_Object, Lisp_Object);
extern int fast_c_string_match_ignore_case (Lisp_Object, const char *);
extern int fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
@@ -3142,6 +3135,7 @@ extern void cmd_error_internal (Lisp_Object, const char *);
extern Lisp_Object command_loop_1 (void);
extern Lisp_Object recursive_edit_1 (void);
extern void record_auto_save (void);
+extern void force_auto_save_soon (void);
extern void init_keyboard (void);
extern void syms_of_keyboard (void);
extern void keys_of_keyboard (void);
@@ -3194,6 +3188,7 @@ extern Lisp_Object decode_env_path (const char *, const char *);
extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
extern Lisp_Object Qfile_name_handler_alist;
extern void (*fatal_error_signal_hook) (void);
+extern SIGTYPE fatal_error_signal (int);
EXFUN (Fkill_emacs, 1) NO_RETURN;
#if HAVE_SETLOCALE
void fixup_locale (void);
@@ -3341,6 +3336,8 @@ extern void child_setup_tty (int);
extern void setup_pty (int);
extern int set_window_size (int, int, int);
extern void create_process (Lisp_Object, char **, Lisp_Object);
+extern long get_random (void);
+extern void seed_random (long);
extern int emacs_open (const char *, int, int);
extern int emacs_close (int);
extern int emacs_read (int, char *, unsigned int);
@@ -3387,6 +3384,7 @@ extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object,
/* Defined in term.c */
extern int *char_ins_del_vector;
+extern void mark_ttys (void);
extern void syms_of_term (void);
extern void fatal (const char *msgid, ...) NO_RETURN;
@@ -3533,6 +3531,13 @@ extern void init_system_name (void);
&& (circular_list_error ((list)), 1))) \
: 0)))
+/* Use this to suppress gcc's `...may be used before initialized' warnings. */
+#ifdef lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
/* The ubiquitous min and max macros. */
#ifdef max
diff --git a/src/lread.c b/src/lread.c
index c8c07bed47..7a8d7cf9a6 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -370,15 +370,15 @@ unreadchar (Lisp_Object readcharfun, int c)
else if (BUFFERP (readcharfun))
{
struct buffer *b = XBUFFER (readcharfun);
+ EMACS_INT charpos = BUF_PT (b);
EMACS_INT bytepos = BUF_PT_BYTE (b);
- BUF_PT (b)--;
if (! NILP (BVAR (b, enable_multibyte_characters)))
BUF_DEC_POS (b, bytepos);
else
bytepos--;
- BUF_PT_BYTE (b) = bytepos;
+ SET_BUF_PT_BOTH (b, charpos - 1, bytepos);
}
else if (MARKERP (readcharfun))
{
@@ -1133,10 +1133,10 @@ Return t if the file exists and loads successfully. */)
Also, just loading a file recursively is not always an error in
the general case; the second load may do something different. */
{
- int count = 0;
+ int load_count = 0;
Lisp_Object tem;
for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem))
- if (!NILP (Fequal (found, XCAR (tem))) && (++count > 3))
+ if (!NILP (Fequal (found, XCAR (tem))) && (++load_count > 3))
{
if (fd >= 0)
emacs_close (fd);
@@ -1787,8 +1787,8 @@ readevalloop (Lisp_Object readcharfun,
to a different value when evaluated. */
if (BUFFERP (readcharfun))
{
- struct buffer *b = XBUFFER (readcharfun);
- if (BUF_PT (b) == BUF_ZV (b))
+ struct buffer *buf = XBUFFER (readcharfun);
+ if (BUF_PT (buf) == BUF_ZV (buf))
continue_reading_p = 0;
}
}
@@ -2810,7 +2810,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
{
char *p = read_buffer;
char *end = read_buffer + read_buffer_size;
- register int c;
+ register int ch;
/* Nonzero if we saw an escape sequence specifying
a multibyte character. */
int force_multibyte = 0;
@@ -2820,8 +2820,8 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
int cancel = 0;
int nchars = 0;
- while ((c = READCHAR) >= 0
- && c != '\"')
+ while ((ch = READCHAR) >= 0
+ && ch != '\"')
{
if (end - p < MAX_MULTIBYTE_LENGTH)
{
@@ -2832,44 +2832,44 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
end = read_buffer + read_buffer_size;
}
- if (c == '\\')
+ if (ch == '\\')
{
int modifiers;
- c = read_escape (readcharfun, 1);
+ ch = read_escape (readcharfun, 1);
- /* C is -1 if \ newline has just been seen */
- if (c == -1)
+ /* CH is -1 if \ newline has just been seen */
+ if (ch == -1)
{
if (p == read_buffer)
cancel = 1;
continue;
}
- modifiers = c & CHAR_MODIFIER_MASK;
- c = c & ~CHAR_MODIFIER_MASK;
+ modifiers = ch & CHAR_MODIFIER_MASK;
+ ch = ch & ~CHAR_MODIFIER_MASK;
- if (CHAR_BYTE8_P (c))
+ if (CHAR_BYTE8_P (ch))
force_singlebyte = 1;
- else if (! ASCII_CHAR_P (c))
+ else if (! ASCII_CHAR_P (ch))
force_multibyte = 1;
- else /* i.e. ASCII_CHAR_P (c) */
+ else /* i.e. ASCII_CHAR_P (ch) */
{
/* Allow `\C- ' and `\C-?'. */
if (modifiers == CHAR_CTL)
{
- if (c == ' ')
- c = 0, modifiers = 0;
- else if (c == '?')
- c = 127, modifiers = 0;
+ if (ch == ' ')
+ ch = 0, modifiers = 0;
+ else if (ch == '?')
+ ch = 127, modifiers = 0;
}
if (modifiers & CHAR_SHIFT)
{
/* Shift modifier is valid only with [A-Za-z]. */
- if (c >= 'A' && c <= 'Z')
+ if (ch >= 'A' && ch <= 'Z')
modifiers &= ~CHAR_SHIFT;
- else if (c >= 'a' && c <= 'z')
- c -= ('a' - 'A'), modifiers &= ~CHAR_SHIFT;
+ else if (ch >= 'a' && ch <= 'z')
+ ch -= ('a' - 'A'), modifiers &= ~CHAR_SHIFT;
}
if (modifiers & CHAR_META)
@@ -2877,7 +2877,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
/* Move the meta bit to the right place for a
string. */
modifiers &= ~CHAR_META;
- c = BYTE8_TO_CHAR (c | 0x80);
+ ch = BYTE8_TO_CHAR (ch | 0x80);
force_singlebyte = 1;
}
}
@@ -2885,20 +2885,20 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
/* Any modifiers remaining are invalid. */
if (modifiers)
error ("Invalid modifier in string");
- p += CHAR_STRING (c, (unsigned char *) p);
+ p += CHAR_STRING (ch, (unsigned char *) p);
}
else
{
- p += CHAR_STRING (c, (unsigned char *) p);
- if (CHAR_BYTE8_P (c))
+ p += CHAR_STRING (ch, (unsigned char *) p);
+ if (CHAR_BYTE8_P (ch))
force_singlebyte = 1;
- else if (! ASCII_CHAR_P (c))
+ else if (! ASCII_CHAR_P (ch))
force_multibyte = 1;
}
nchars++;
}
- if (c < 0)
+ if (ch < 0)
end_of_file_error ();
/* If purifying, and string starts with \ newline,
@@ -2917,8 +2917,9 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
p = read_buffer + nchars;
}
else
- /* Otherwise, READ_BUFFER contains only ASCII. */
- ;
+ {
+ /* Otherwise, READ_BUFFER contains only ASCII. */
+ }
/* We want readchar_count to be the number of characters, not
bytes. Hence we adjust for multibyte characters in the
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 7a702fd45b..62c40ca1f9 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -221,7 +221,7 @@ GLOBAL_SOURCES = dosfns.c msdos.c \
region-cache.c sound.c atimer.c \
doprnt.c intervals.c textprop.c composite.c
SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
- xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o dbusbind.o
+ xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o dbusbind.o
obj = $(GLOBAL_SOURCES:.c=.o)
globals.h: gl-stamp
@@ -386,6 +386,7 @@ $(BLD)/alloc.$(O) : \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -396,7 +397,6 @@ $(BLD)/alloc.$(O) : \
$(SRC)/frame.h \
$(SRC)/intervals.h \
$(SRC)/keyboard.h \
- $(PROCESS_H) \
$(SRC)/puresize.h \
$(SRC)/syssignal.h \
$(SRC)/systime.h \
@@ -484,8 +484,10 @@ $(BLD)/callproc.$(O) : \
$(CONFIG_H) \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/file.h \
+ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -497,7 +499,6 @@ $(BLD)/callproc.$(O) : \
$(SRC)/dispextern.h \
$(SRC)/epaths.h \
$(SRC)/frame.h \
- $(PROCESS_H) \
$(SRC)/syssignal.h \
$(SRC)/systime.h \
$(SRC)/systty.h \
@@ -653,6 +654,7 @@ $(BLD)/dired.$(O) : \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/dir.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
+ $(EMACS_ROOT)/lib/filemode.h \
$(LISP_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
@@ -662,7 +664,6 @@ $(BLD)/dired.$(O) : \
$(SRC)/coding.h \
$(SRC)/commands.h \
$(SRC)/composite.h \
- $(EMACS_ROOT)/lib/filemode.h \
$(SRC)/ndir.h \
$(SRC)/regex.h \
$(SRC)/systime.h
@@ -673,6 +674,7 @@ $(BLD)/dispnew.$(O) : \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -687,7 +689,6 @@ $(BLD)/dispnew.$(O) : \
$(SRC)/indent.h \
$(SRC)/intervals.h \
$(SRC)/keyboard.h \
- $(PROCESS_H) \
$(SRC)/syssignal.h \
$(SRC)/systime.h \
$(SRC)/termchar.h \
@@ -726,6 +727,7 @@ $(BLD)/editfns.$(O) : \
$(EMACS_ROOT)/nt/inc/pwd.h \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
+ $(EMACS_ROOT)/lib/intprops.h \
$(EMACS_ROOT)/lib/strftime.h \
$(LISP_H) \
$(SRC)/atimer.h \
@@ -746,8 +748,10 @@ $(BLD)/emacs.$(O) : \
$(CONFIG_H) \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/file.h \
+ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -756,15 +760,14 @@ $(BLD)/emacs.$(O) : \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
$(SRC)/frame.h \
- $(SRC)/gnutls.h \
$(SRC)/intervals.h \
$(SRC)/keyboard.h \
$(SRC)/keymap.h \
- $(PROCESS_H) \
$(SRC)/syssignal.h \
$(SRC)/systime.h \
$(SRC)/systty.h \
$(SRC)/termhooks.h \
+ $(SRC)/unexec.h \
$(SRC)/w32.h \
$(SRC)/w32gui.h \
$(SRC)/w32heap.h \
@@ -836,6 +839,7 @@ $(BLD)/fns.$(O) : \
$(CONFIG_H) \
$(EMACS_ROOT)/nt/inc/langinfo.h \
$(EMACS_ROOT)/nt/inc/nl_types.h \
+ $(EMACS_ROOT)/nt/inc/stdint.h \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(EMACS_ROOT)/lib/md5.h \
@@ -1029,6 +1033,7 @@ $(BLD)/keyboard.$(O) : \
$(EMACS_ROOT)/nt/inc/sys/ioctl.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -1043,7 +1048,6 @@ $(BLD)/keyboard.$(O) : \
$(SRC)/keyboard.h \
$(SRC)/keymap.h \
$(SRC)/macros.h \
- $(PROCESS_H) \
$(SRC)/puresize.h \
$(SRC)/syntax.h \
$(SRC)/syssignal.h \
@@ -1181,11 +1185,11 @@ $(BLD)/w32.$(O) : \
$(EMACS_ROOT)/nt/inc/sys/socket.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/coding.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
$(SRC)/ndir.h \
- $(PROCESS_H) \
$(SRC)/systime.h \
$(SRC)/w32.h \
$(SRC)/w32gui.h \
@@ -1224,11 +1228,11 @@ $(BLD)/w32proc.$(O) : \
$(EMACS_ROOT)/nt/inc/sys/file.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/character.h \
$(SRC)/coding.h \
$(SRC)/composite.h \
$(SRC)/dispextern.h \
- $(PROCESS_H) \
$(SRC)/syssignal.h \
$(SRC)/systime.h \
$(SRC)/syswait.h \
@@ -1260,6 +1264,7 @@ $(BLD)/print.$(O) : \
$(EMACS_ROOT)/lib/ftoastr.h \
$(EMACS_ROOT)/lib/intprops.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -1273,7 +1278,6 @@ $(BLD)/print.$(O) : \
$(SRC)/frame.h \
$(SRC)/intervals.h \
$(SRC)/keyboard.h \
- $(PROCESS_H) \
$(SRC)/systime.h \
$(SRC)/termchar.h \
$(SRC)/termhooks.h \
@@ -1288,9 +1292,11 @@ $(BLD)/process.$(O) : \
$(EMACS_ROOT)/nt/inc/arpa/inet.h \
$(EMACS_ROOT)/nt/inc/netinet/in.h \
$(EMACS_ROOT)/nt/inc/sys/file.h \
+ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
$(EMACS_ROOT)/nt/inc/sys/socket.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -1301,7 +1307,6 @@ $(BLD)/process.$(O) : \
$(SRC)/dispextern.h \
$(SRC)/frame.h \
$(SRC)/keyboard.h \
- $(PROCESS_H) \
$(SRC)/sysselect.h \
$(SRC)/syssignal.h \
$(SRC)/systime.h \
@@ -1414,10 +1419,12 @@ $(BLD)/sysdep.$(O) : \
$(EMACS_ROOT)/nt/inc/pwd.h \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/file.h \
+ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
$(EMACS_ROOT)/nt/inc/sys/socket.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(EMACS_ROOT)/lib/ignore-value.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/cm.h \
@@ -1426,7 +1433,6 @@ $(BLD)/sysdep.$(O) : \
$(SRC)/dispextern.h \
$(SRC)/frame.h \
$(SRC)/keyboard.h \
- $(PROCESS_H) \
$(SRC)/sysselect.h \
$(SRC)/syssignal.h \
$(SRC)/systime.h \
@@ -1444,6 +1450,7 @@ $(BLD)/term.$(O) : \
$(CONFIG_H) \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/file.h \
+ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
$(SRC)/atimer.h \
@@ -1466,6 +1473,7 @@ $(BLD)/term.$(O) : \
$(SRC)/termchar.h \
$(SRC)/termhooks.h \
$(SRC)/termopts.h \
+ $(SRC)/tparam.h \
$(SRC)/w32gui.h \
$(SRC)/window.h
@@ -1499,7 +1507,8 @@ $(BLD)/textprop.$(O) : \
$(BLD)/tparam.$(O) : \
$(SRC)/tparam.c \
$(CONFIG_H) \
- $(LISP_H)
+ $(LISP_H) \
+ $(SRC)/tparam.h
$(BLD)/undo.$(O) : \
$(SRC)/undo.c \
@@ -1514,6 +1523,7 @@ $(BLD)/undo.$(O) : \
$(BLD)/unexw32.$(O) : \
$(SRC)/unexw32.c \
$(CONFIG_H) \
+ $(SRC)/unexec.h \
$(SRC)/w32heap.h
$(BLD)/vm-limit.$(O) : \
@@ -1553,6 +1563,7 @@ $(BLD)/xdisp.$(O) : \
$(EMACS_ROOT)/nt/inc/unistd.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -1572,7 +1583,6 @@ $(BLD)/xdisp.$(O) : \
$(SRC)/keyboard.h \
$(SRC)/keymap.h \
$(SRC)/macros.h \
- $(PROCESS_H) \
$(SRC)/region-cache.h \
$(SRC)/systime.h \
$(SRC)/termchar.h \
@@ -1664,8 +1674,10 @@ $(BLD)/w32term.$(O) : \
$(SRC)/w32term.c \
$(CONFIG_H) \
$(EMACS_ROOT)/nt/inc/unistd.h \
+ $(EMACS_ROOT)/nt/inc/sys/ioctl.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(LISP_H) \
+ $(PROCESS_H) \
$(SRC)/atimer.h \
$(SRC)/blockinput.h \
$(SRC)/buffer.h \
@@ -1682,7 +1694,6 @@ $(BLD)/w32term.$(O) : \
$(SRC)/intervals.h \
$(SRC)/keyboard.h \
$(SRC)/keymap.h \
- $(PROCESS_H) \
$(SRC)/systime.h \
$(SRC)/systty.h \
$(SRC)/termchar.h \
@@ -1705,7 +1716,6 @@ $(BLD)/w32select.$(O) : \
$(SRC)/charset.h \
$(SRC)/coding.h \
$(SRC)/composite.h \
- $(SRC)/keyboard.h \
$(SRC)/systime.h \
$(SRC)/w32gui.h \
$(SRC)/w32heap.h \
diff --git a/src/marker.c b/src/marker.c
index 72c564f420..7d46109914 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -257,9 +257,10 @@ verify_bytepos (EMACS_INT charpos)
return below_byte;
}
-/* bytepos_to_charpos returns the char position corresponding to BYTEPOS. */
+/* buf_bytepos_to_charpos returns the char position corresponding to
+ BYTEPOS. */
-/* This macro is a subroutine of bytepos_to_charpos.
+/* This macro is a subroutine of buf_bytepos_to_charpos.
It is used when BYTEPOS is actually the byte position. */
#define CONSIDER(BYTEPOS, CHARPOS) \
@@ -303,12 +304,6 @@ verify_bytepos (EMACS_INT charpos)
}
EMACS_INT
-bytepos_to_charpos (EMACS_INT bytepos)
-{
- return buf_bytepos_to_charpos (current_buffer, bytepos);
-}
-
-EMACS_INT
buf_bytepos_to_charpos (struct buffer *b, EMACS_INT bytepos)
{
struct Lisp_Marker *tail;
@@ -896,4 +891,3 @@ syms_of_marker (void)
doc: /* Non-nil enables debugging checks in byte/char position conversions. */);
byte_debug_flag = 0;
}
-
diff --git a/src/minibuf.c b/src/minibuf.c
index 75a24686d5..986765ae6f 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -72,6 +72,7 @@ Lisp_Object Qcompletion_ignore_case;
Lisp_Object Qminibuffer_completion_table;
Lisp_Object Qminibuffer_completion_predicate;
Lisp_Object Qminibuffer_completion_confirm;
+Lisp_Object Qcompleting_read_default;
Lisp_Object Quser_variable_p;
Lisp_Object Qminibuffer_default;
@@ -135,7 +136,7 @@ choose_minibuf_frame (void)
}
}
-Lisp_Object
+static Lisp_Object
choose_minibuf_frame_1 (Lisp_Object ignore)
{
choose_minibuf_frame ();
@@ -1213,7 +1214,7 @@ is used to further constrain the set of candidates. */)
&& (!SYMBOLP (XCAR (collection))
|| NILP (XCAR (collection)))))
? list_table : function_table));
- int index = 0, obsize = 0;
+ int idx = 0, obsize = 0;
int matchcount = 0;
int bindcount = -1;
Lisp_Object bucket, zero, end, tem;
@@ -1232,7 +1233,7 @@ is used to further constrain the set of candidates. */)
{
collection = check_obarray (collection);
obsize = XVECTOR (collection)->size;
- bucket = XVECTOR (collection)->contents[index];
+ bucket = XVECTOR (collection)->contents[idx];
}
while (1)
@@ -1263,23 +1264,23 @@ is used to further constrain the set of candidates. */)
else
XSETFASTINT (bucket, 0);
}
- else if (++index >= obsize)
+ else if (++idx >= obsize)
break;
else
{
- bucket = XVECTOR (collection)->contents[index];
+ bucket = XVECTOR (collection)->contents[idx];
continue;
}
}
else /* if (type == hash_table) */
{
- while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection))
- && NILP (HASH_HASH (XHASH_TABLE (collection), index)))
- index++;
- if (index >= HASH_TABLE_SIZE (XHASH_TABLE (collection)))
+ while (idx < HASH_TABLE_SIZE (XHASH_TABLE (collection))
+ && NILP (HASH_HASH (XHASH_TABLE (collection), idx)))
+ idx++;
+ if (idx >= HASH_TABLE_SIZE (XHASH_TABLE (collection)))
break;
else
- elt = eltstring = HASH_KEY (XHASH_TABLE (collection), index++);
+ elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++);
}
/* Is this element a possible completion? */
@@ -1334,7 +1335,7 @@ is used to further constrain the set of candidates. */)
tem = (type == hash_table
? call2 (predicate, elt,
HASH_VALUE (XHASH_TABLE (collection),
- index - 1))
+ idx - 1))
: call1 (predicate, elt));
UNGCPRO;
}
@@ -1478,7 +1479,7 @@ with a space are ignored unless STRING itself starts with a space. */)
: NILP (collection) || (CONSP (collection)
&& (!SYMBOLP (XCAR (collection))
|| NILP (XCAR (collection))));
- int index = 0, obsize = 0;
+ int idx = 0, obsize = 0;
int bindcount = -1;
Lisp_Object bucket, tem, zero;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
@@ -1495,7 +1496,7 @@ with a space are ignored unless STRING itself starts with a space. */)
{
collection = check_obarray (collection);
obsize = XVECTOR (collection)->size;
- bucket = XVECTOR (collection)->contents[index];
+ bucket = XVECTOR (collection)->contents[idx];
}
while (1)
@@ -1526,23 +1527,23 @@ with a space are ignored unless STRING itself starts with a space. */)
else
XSETFASTINT (bucket, 0);
}
- else if (++index >= obsize)
+ else if (++idx >= obsize)
break;
else
{
- bucket = XVECTOR (collection)->contents[index];
+ bucket = XVECTOR (collection)->contents[idx];
continue;
}
}
else /* if (type == 3) */
{
- while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection))
- && NILP (HASH_HASH (XHASH_TABLE (collection), index)))
- index++;
- if (index >= HASH_TABLE_SIZE (XHASH_TABLE (collection)))
+ while (idx < HASH_TABLE_SIZE (XHASH_TABLE (collection))
+ && NILP (HASH_HASH (XHASH_TABLE (collection), idx)))
+ idx++;
+ if (idx >= HASH_TABLE_SIZE (XHASH_TABLE (collection)))
break;
else
- elt = eltstring = HASH_KEY (XHASH_TABLE (collection), index++);
+ elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++);
}
/* Is this element a possible completion? */
@@ -1567,8 +1568,6 @@ with a space are ignored unless STRING itself starts with a space. */)
{
/* Yes. */
Lisp_Object regexps;
- Lisp_Object zero;
- XSETFASTINT (zero, 0);
/* Ignore this element if it fails to match all the regexps. */
{
@@ -1604,7 +1603,7 @@ with a space are ignored unless STRING itself starts with a space. */)
GCPRO4 (tail, eltstring, allmatches, string);
tem = type == 3
? call2 (predicate, elt,
- HASH_VALUE (XHASH_TABLE (collection), index - 1))
+ HASH_VALUE (XHASH_TABLE (collection), idx - 1))
: call1 (predicate, elt);
UNGCPRO;
}
@@ -1677,7 +1676,27 @@ If INHERIT-INPUT-METHOD is non-nil, the minibuffer inherits
the current input method and the setting of `enable-multibyte-characters'.
Completion ignores case if the ambient value of
- `completion-ignore-case' is non-nil. */)
+ `completion-ignore-case' is non-nil.
+
+See also `completing-read-function'. */)
+ (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
+{
+ Lisp_Object args[9];
+ args[0] = Vcompleting_read_function;
+ args[1] = prompt;
+ args[2] = collection;
+ args[3] = predicate;
+ args[4] = require_match;
+ args[5] = initial_input;
+ args[6] = hist;
+ args[7] = def;
+ args[8] = inherit_input_method;
+ return Ffuncall (9, args);
+}
+
+DEFUN ("completing-read-default", Fcompleting_read_default, Scompleting_read_default, 2, 8, 0,
+ doc: /* Default method for reading from the minibuffer with completion.
+See `completing-read' for the meaning of the arguments. */)
(Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
{
Lisp_Object val, histvar, histpos, position;
@@ -1975,6 +1994,9 @@ syms_of_minibuf (void)
minibuf_save_list = Qnil;
staticpro (&minibuf_save_list);
+ Qcompleting_read_default = intern_c_string ("completing-read-default");
+ staticpro (&Qcompleting_read_default);
+
Qcompletion_ignore_case = intern_c_string ("completion-ignore-case");
staticpro (&Qcompletion_ignore_case);
@@ -2119,6 +2141,12 @@ If the value is `confirm-after-completion', the user may exit with an
doc: /* Non-nil means completing file names. */);
Vminibuffer_completing_file_name = Qnil;
+ DEFVAR_LISP ("completing-read-function",
+ Vcompleting_read_function,
+ doc: /* The function called by `completing-read' to do the work.
+It should accept the same arguments as `completing-read'. */);
+ Vcompleting_read_function = Qcompleting_read_default;
+
DEFVAR_LISP ("minibuffer-help-form", Vminibuffer_help_form,
doc: /* Value that `help-form' takes on inside the minibuffer. */);
Vminibuffer_help_form = Qnil;
@@ -2194,4 +2222,5 @@ properties. */);
defsubr (&Stest_completion);
defsubr (&Sassoc_string);
defsubr (&Scompleting_read);
+ defsubr (&Scompleting_read_default);
}
diff --git a/src/msdos.c b/src/msdos.c
index 261a09ac85..b0bf5c4fdd 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -844,6 +844,7 @@ IT_set_face (int face)
extern unsigned char *encode_terminal_code (struct glyph *, int,
struct coding_system *);
+
static void
IT_write_glyphs (struct frame *f, struct glyph *str, int str_len)
{
@@ -2998,17 +2999,17 @@ XMenuCreate (Display *foo1, Window foo2, char *foo3)
to do. */
int
-XMenuAddPane (Display *foo, XMenu *menu, char *txt, int enable)
+XMenuAddPane (Display *foo, XMenu *menu, const char *txt, int enable)
{
int len;
- char *p;
+ const char *p;
if (!enable)
abort ();
IT_menu_make_room (menu);
menu->submenu[menu->count] = IT_menu_create ();
- menu->text[menu->count] = txt;
+ menu->text[menu->count] = (char *)txt;
menu->panenumber[menu->count] = ++menu->panecount;
menu->help_text[menu->count] = NULL;
menu->count++;
diff --git a/src/msdos.h b/src/msdos.h
index 4bbe9b134d..5051f2f383 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -105,7 +105,7 @@ typedef struct x_menu_struct
} XMenu;
XMenu *XMenuCreate (Display *, Window, char *);
-int XMenuAddPane (Display *, XMenu *, char *, int);
+int XMenuAddPane (Display *, XMenu *, const char *, int);
int XMenuAddSelection (Display *, XMenu *, int, int, char *, int, char *);
void XMenuLocate (Display *, XMenu *, int, int, int, int,
int *, int *, int *, int *);
diff --git a/src/nsterm.m b/src/nsterm.m
index cc2c4cf980..c7cd411c61 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2235,7 +2235,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
-------------------------------------------------------------------------- */
{
NSRect r, s;
- int fx, fy, h;
+ int fx, fy, h, cursor_height;
struct frame *f = WINDOW_XFRAME (w);
struct glyph *phys_cursor_glyph;
int overspill;
@@ -2279,13 +2279,20 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
get_phys_cursor_geometry (w, glyph_row, phys_cursor_glyph, &fx, &fy, &h);
/* The above get_phys_cursor_geometry call set w->phys_cursor_width
- to the glyph width; replace with CURSOR_WIDTH for bar cursors. */
- if (cursor_type == BAR_CURSOR || cursor_type == HBAR_CURSOR)
+ to the glyph width; replace with CURSOR_WIDTH for (V)BAR cursors. */
+ if (cursor_type == BAR_CURSOR)
{
if (cursor_width < 1)
cursor_width = max (FRAME_CURSOR_WIDTH (f), 1);
w->phys_cursor_width = cursor_width;
}
+ /* If we have an HBAR, "cursor_width" MAY specify height. */
+ else if (cursor_type == HBAR_CURSOR)
+ {
+ cursor_height = (cursor_width < 1) ? lrint (0.25 * h) : cursor_width;
+ fy += h - cursor_height;
+ h = cursor_height;
+ }
r.origin.x = fx, r.origin.y = fy;
r.size.height = h;
@@ -2337,10 +2344,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
[FRAME_CURSOR_COLOR (f) set];
break;
case HBAR_CURSOR:
- s = r;
- s.origin.y += lrint (0.75 * s.size.height);
- s.size.height = lrint (s.size.height * 0.25);
- NSRectFill (s);
+ NSRectFill (r);
break;
case BAR_CURSOR:
s = r;
diff --git a/src/print.c b/src/print.c
index 602575b5b0..b826642247 100644
--- a/src/print.c
+++ b/src/print.c
@@ -801,7 +801,7 @@ append to existing target file. */)
{
file = Fexpand_file_name (file, Qnil);
initial_stderr_stream = stderr;
- stderr = fopen (SDATA (file), NILP (append) ? "w" : "a");
+ stderr = fopen (SSDATA (file), NILP (append) ? "w" : "a");
if (stderr == NULL)
{
stderr = initial_stderr_stream;
@@ -1120,6 +1120,16 @@ print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
print_object (obj, printcharfun, escapeflag);
}
+#define PRINT_CIRCLE_CANDIDATE_P(obj) \
+ (STRINGP (obj) || CONSP (obj) \
+ || (VECTORLIKEP (obj) \
+ && (VECTORP (obj) || COMPILEDP (obj) \
+ || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) \
+ || HASH_TABLE_P (obj) || FONTP (obj))) \
+ || (! NILP (Vprint_gensym) \
+ && SYMBOLP (obj) \
+ && !SYMBOL_INTERNED_P (obj)))
+
/* Construct Vprint_number_table according to the structure of OBJ.
OBJ itself and all its elements will be added to Vprint_number_table
recursively if it is a list, vector, compiled function, char-table,
@@ -1154,12 +1164,7 @@ print_preprocess (Lisp_Object obj)
halftail = obj;
loop:
- if (STRINGP (obj) || CONSP (obj) || VECTORP (obj)
- || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
- || HASH_TABLE_P (obj)
- || (! NILP (Vprint_gensym)
- && SYMBOLP (obj)
- && !SYMBOL_INTERNED_P (obj)))
+ if (PRINT_CIRCLE_CANDIDATE_P (obj))
{
if (!HASH_TABLE_P (Vprint_number_table))
{
@@ -1336,12 +1341,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
error ("Apparently circular structure being printed");
/* Detect circularities and truncate them. */
- if (STRINGP (obj) || CONSP (obj) || VECTORP (obj)
- || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)
- || HASH_TABLE_P (obj)
- || (! NILP (Vprint_gensym)
- && SYMBOLP (obj)
- && !SYMBOL_INTERNED_P (obj)))
+ if (PRINT_CIRCLE_CANDIDATE_P (obj))
{
if (NILP (Vprint_circle) && NILP (Vprint_gensym))
{
diff --git a/src/process.c b/src/process.c
index 210287a85f..c9b420ab2a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -162,12 +162,6 @@ extern Lisp_Object QCfilter;
/* Define first descriptor number available for subprocesses. */
#define FIRST_PROC_DESC 3
-extern const char *get_operating_system_release (void);
-
-/* From sysdep.c or w32.c */
-extern int serial_open (char *port);
-extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact);
-
#ifndef HAVE_H_ERRNO
extern int h_errno;
#endif
@@ -499,7 +493,7 @@ status_message (struct Lisp_Process *p)
string = (code_convert_string_norecord
(string, Vlocale_coding_system, 0));
c1 = STRING_CHAR (SDATA (string));
- c2 = DOWNCASE (c1);
+ c2 = downcase (c1);
if (c1 != c2)
Faset (string, make_number (0), make_number (c2));
}
@@ -541,17 +535,16 @@ static char pty_name[24];
static int
allocate_pty (void)
{
- register int c, i;
int fd;
#ifdef PTY_ITERATION
PTY_ITERATION
#else
+ register int c, i;
for (c = FIRST_PTY_LETTER; c <= 'z'; c++)
for (i = 0; i < 16; i++)
#endif
{
- struct stat stb; /* Used in some PTY_OPEN. */
#ifdef PTY_NAME_SPRINTF
PTY_NAME_SPRINTF
#else
@@ -568,6 +561,7 @@ allocate_pty (void)
three failures in a row before deciding that we've reached the
end of the ptys. */
int failed_count = 0;
+ struct stat stb;
if (stat (pty_name, &stb) < 0)
{
@@ -2730,7 +2724,8 @@ usage: (serial-process-configure &rest ARGS) */)
}
/* Used by make-serial-process to recover from errors. */
-Lisp_Object make_serial_process_unwind (Lisp_Object proc)
+static Lisp_Object
+make_serial_process_unwind (Lisp_Object proc)
{
if (!PROCESSP (proc))
abort ();
@@ -5482,7 +5477,7 @@ read_process_output (Lisp_Object proc, register int channel)
jmp_buf send_process_frame;
Lisp_Object process_sent_to;
-SIGTYPE
+static SIGTYPE
send_process_trap (int ignore)
{
SIGNAL_THREAD_CHECK (SIGPIPE);
@@ -6391,7 +6386,7 @@ process has been transmitted to the serial port. */)
indirectly; if it does, that is a bug */
#ifdef SIGCHLD
-SIGTYPE
+static SIGTYPE
sigchld_handler (int signo)
{
int old_errno = errno;
diff --git a/src/regex.c b/src/regex.c
index 9284be95ff..a60ff0ce35 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -340,7 +340,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
|| ((c) >= 'A' && (c) <= 'Z')) \
: SYNTAX (c) == Sword)
-# define ISLOWER(c) (LOWERCASEP (c))
+# define ISLOWER(c) lowercasep (c)
# define ISPUNCT(c) (IS_REAL_ASCII (c) \
? ((c) > ' ' && (c) < 0177 \
@@ -351,7 +351,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
# define ISSPACE(c) (SYNTAX (c) == Swhitespace)
-# define ISUPPER(c) (UPPERCASEP (c))
+# define ISUPPER(c) uppercasep (c)
# define ISWORD(c) (SYNTAX (c) == Sword)
@@ -551,8 +551,6 @@ init_syntax_once (void)
/* (Re)Allocate N items of type T using malloc, or fail. */
#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
-#define RETALLOC_IF(addr, n, t) \
- if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
#define BYTEWIDTH 8 /* In bits. */
@@ -843,11 +841,6 @@ extract_number_and_incr (destination, source)
((p)[2 + CHARSET_BITMAP_SIZE (p)] \
+ (p)[3 + CHARSET_BITMAP_SIZE (p)] * 0x100)
-/* Test if C is listed in the bitmap of charset P. */
-#define CHARSET_LOOKUP_BITMAP(p, c) \
- ((c) < CHARSET_BITMAP_SIZE (p) * BYTEWIDTH \
- && (p)[2 + (c) / BYTEWIDTH] & (1 << ((c) % BYTEWIDTH)))
-
/* Return the address of end of RANGE_TABLE. COUNT is number of
ranges (which is a pair of (start, end)) in the RANGE_TABLE. `* 2'
is start of range and end of range. `* 3' is size of each start
@@ -861,14 +854,14 @@ extract_number_and_incr (destination, source)
do \
{ \
re_wchar_t range_start, range_end; \
- re_char *p; \
+ re_char *rtp; \
re_char *range_table_end \
= CHARSET_RANGE_TABLE_END ((range_table), (count)); \
\
- for (p = (range_table); p < range_table_end; p += 2 * 3) \
+ for (rtp = (range_table); rtp < range_table_end; rtp += 2 * 3) \
{ \
- EXTRACT_CHARACTER (range_start, p); \
- EXTRACT_CHARACTER (range_end, p + 3); \
+ EXTRACT_CHARACTER (range_start, rtp); \
+ EXTRACT_CHARACTER (range_end, rtp + 3); \
\
if (range_start <= (c) && (c) <= range_end) \
{ \
@@ -1274,6 +1267,13 @@ print_double_string (where, string1, size1, string2, size2)
#endif /* not DEBUG */
+/* Use this to suppress gcc's `...may be used before initialized' warnings. */
+#ifdef lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
also be assigned to arbitrarily: each pattern buffer stores its own
syntax, so it can be changed between regex compilations. */
@@ -1413,7 +1413,6 @@ typedef struct
} fail_stack_type;
#define FAIL_STACK_EMPTY() (fail_stack.frame == 0)
-#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
/* Define macros to initialize and free the failure stack.
@@ -1433,8 +1432,6 @@ typedef struct
fail_stack.avail = 0; \
fail_stack.frame = 0; \
} while (0)
-
-# define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
#else
# define INIT_FAIL_STACK() \
do { \
@@ -1442,7 +1439,8 @@ typedef struct
fail_stack.frame = 0; \
} while (0)
-# define RESET_FAIL_STACK() ((void)0)
+# define RETALLOC_IF(addr, n, t) \
+ if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
#endif
@@ -1495,17 +1493,10 @@ typedef struct
#define PUSH_FAILURE_INT(item) \
fail_stack.stack[fail_stack.avail++].integer = (item)
-/* Push a fail_stack_elt_t value onto the failure stack.
- Assumes the variable `fail_stack'. Probably should only
- be called from within `PUSH_FAILURE_POINT'. */
-#define PUSH_FAILURE_ELT(item) \
- fail_stack.stack[fail_stack.avail++] = (item)
-
-/* These three POP... operations complement the three PUSH... operations.
+/* These POP... operations complement the PUSH... operations.
All assume that `fail_stack' is nonempty. */
#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer
#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer
-#define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail]
/* Individual items aside from the registers. */
#define NUM_NONREG_ITEMS 3
@@ -1555,22 +1546,22 @@ do { \
/* Pop a saved register off the stack. */
#define POP_FAILURE_REG_OR_COUNT() \
do { \
- int reg = POP_FAILURE_INT (); \
- if (reg == -1) \
+ int pfreg = POP_FAILURE_INT (); \
+ if (pfreg == -1) \
{ \
/* It's a counter. */ \
/* Here, we discard `const', making re_match non-reentrant. */ \
unsigned char *ptr = (unsigned char*) POP_FAILURE_POINTER (); \
- reg = POP_FAILURE_INT (); \
- STORE_NUMBER (ptr, reg); \
- DEBUG_PRINT3 (" Pop counter %p = %d\n", ptr, reg); \
+ pfreg = POP_FAILURE_INT (); \
+ STORE_NUMBER (ptr, pfreg); \
+ DEBUG_PRINT3 (" Pop counter %p = %d\n", ptr, pfreg); \
} \
else \
{ \
- regend[reg] = POP_FAILURE_POINTER (); \
- regstart[reg] = POP_FAILURE_POINTER (); \
+ regend[pfreg] = POP_FAILURE_POINTER (); \
+ regstart[pfreg] = POP_FAILURE_POINTER (); \
DEBUG_PRINT4 (" Pop reg %d (spanning %p -> %p)\n", \
- reg, regstart[reg], regend[reg]); \
+ pfreg, regstart[pfreg], regend[pfreg]); \
} \
} while (0)
@@ -1765,16 +1756,6 @@ static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
} while (0)
-/* As with BUF_PUSH_2, except for three bytes. */
-#define BUF_PUSH_3(c1, c2, c3) \
- do { \
- GET_BUFFER_SPACE (3); \
- *b++ = (unsigned char) (c1); \
- *b++ = (unsigned char) (c2); \
- *b++ = (unsigned char) (c3); \
- } while (0)
-
-
/* Store a jump with opcode OP at LOC to location TO. We store a
relative address offset by the three bytes the jump itself occupies. */
#define STORE_JUMP(op, loc, to) \
@@ -2524,9 +2505,6 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
/* We fetch characters from PATTERN here. */
register re_wchar_t c, c1;
- /* A random temporary spot in PATTERN. */
- re_char *p1;
-
/* Points to the end of the buffer, where we should append. */
register unsigned char *b;
@@ -2574,17 +2552,14 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
/* If the object matched can contain multibyte characters. */
const boolean multibyte = RE_MULTIBYTE_P (bufp);
- /* If a target of matching can contain multibyte characters. */
- const boolean target_multibyte = RE_TARGET_MULTIBYTE_P (bufp);
-
/* Nonzero if we have pushed down into a subpattern. */
int in_subpattern = 0;
/* These hold the values of p, pattern, and pend from the main
pattern when we have pushed into a subpattern. */
- re_char *main_p;
- re_char *main_pattern;
- re_char *main_pend;
+ re_char *main_p IF_LINT (= NULL);
+ re_char *main_pattern IF_LINT (= NULL);
+ re_char *main_pend IF_LINT (= NULL);
#ifdef DEBUG
debug++;
@@ -2894,6 +2869,8 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
case '[':
{
+ re_char *p1;
+
CLEAR_RANGE_TABLE_WORK_USED (range_table_work);
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
@@ -2929,7 +2906,7 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
{
boolean escaped_char = false;
const unsigned char *p2 = p;
- re_wchar_t ch, c2;
+ re_wchar_t ch;
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
@@ -2992,10 +2969,7 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct
them). */
if (c == ':' && *p == ']')
{
- re_wctype_t cc;
- int limit;
-
- cc = re_wctype (str);
+ re_wctype_t cc = re_wctype (str);
if (cc == 0)
FREE_STACK_RETURN (REG_ECTYPE);
@@ -4329,10 +4303,6 @@ WEAK_ALIAS (__re_search, re_search)
#define HEAD_ADDR_VSTRING(P) \
(((P) >= size1 ? string2 : string1))
-/* End address of virtual concatenation of string. */
-#define STOP_ADDR_VSTRING(P) \
- (((P) >= size1 ? string2 + size2 : string1 + size1))
-
/* Address of POS in the concatenation of virtual string. */
#define POS_ADDR_VSTRING(POS) \
(((POS) >= size1 ? string2 - size1 : string1) + (POS))
@@ -4559,7 +4529,6 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, int size1, const
if (multibyte)
{
re_char *p = POS_ADDR_VSTRING (startpos);
- re_char *pend = STOP_ADDR_VSTRING (startpos);
int len = BYTES_BY_CHAR_HEAD (*p);
range -= len;
@@ -4644,16 +4613,6 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
#define AT_STRINGS_END(d) ((d) == end2)
-
-/* Test if D points to a character which is word-constituent. We have
- two special cases to check for: if past the end of string1, look at
- the first character in string2; and if before the beginning of
- string2, look at the last character in string1. */
-#define WORDCHAR_P(d) \
- (SYNTAX ((d) == end1 ? *string2 \
- : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
- == Sword)
-
/* Disabled due to a compiler bug -- see comment at case wordbound */
/* The comment at case wordbound is following one, but we don't use
@@ -4665,6 +4624,15 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
macro and introducing temporary variables works around the bug. */
#if 0
+/* Test if D points to a character which is word-constituent. We have
+ two special cases to check for: if past the end of string1, look at
+ the first character in string2; and if before the beginning of
+ string2, look at the last character in string1. */
+#define WORDCHAR_P(d) \
+ (SYNTAX ((d) == end1 ? *string2 \
+ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
+ == Sword)
+
/* Test if the character before D and the one at D differ with respect
to being word-constituent. */
#define AT_WORD_BOUNDARY(d) \
@@ -4674,7 +4642,14 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
/* Free everything we malloc. */
#ifdef MATCH_MAY_ALLOCATE
-# define FREE_VAR(var) if (var) { REGEX_FREE (var); var = NULL; } else
+# define FREE_VAR(var) \
+ do { \
+ if (var) \
+ { \
+ REGEX_FREE (var); \
+ var = NULL; \
+ } \
+ } while (0)
# define FREE_VARIABLES() \
do { \
REGEX_FREE_STACK (fail_stack.stack); \
@@ -5024,7 +4999,6 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
/* General temporaries. */
int mcnt;
size_t reg;
- boolean not;
/* Just past the end of the corresponding string. */
re_char *end1, *end2;
@@ -5464,7 +5438,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
else
do
{
- int pat_charlen, buf_charlen;
+ int pat_charlen;
int pat_ch, buf_ch;
PREFETCH ();
@@ -5535,7 +5509,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
/* Start of actual range_table, or end of bitmap if there is no
range table. */
- re_char *range_table;
+ re_char *range_table IF_LINT (= NULL);
/* Nonzero if there is a range table. */
int range_table_exists;
@@ -5622,8 +5596,8 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
if (!not) goto fail;
d += len;
- break;
}
+ break;
/* The beginning of a group is represented by start_memory.
@@ -6005,46 +5979,48 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
case wordbound:
case notwordbound:
- not = (re_opcode_t) *(p - 1) == notwordbound;
- DEBUG_PRINT2 ("EXECUTING %swordbound.\n", not?"not":"");
+ {
+ boolean not = (re_opcode_t) *(p - 1) == notwordbound;
+ DEBUG_PRINT2 ("EXECUTING %swordbound.\n", not?"not":"");
- /* We SUCCEED (or FAIL) in one of the following cases: */
+ /* We SUCCEED (or FAIL) in one of the following cases: */
- /* Case 1: D is at the beginning or the end of string. */
- if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
- not = !not;
- else
- {
- /* C1 is the character before D, S1 is the syntax of C1, C2
- is the character at D, and S2 is the syntax of C2. */
- re_wchar_t c1, c2;
- int s1, s2;
- int dummy;
+ /* Case 1: D is at the beginning or the end of string. */
+ if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
+ not = !not;
+ else
+ {
+ /* C1 is the character before D, S1 is the syntax of C1, C2
+ is the character at D, and S2 is the syntax of C2. */
+ re_wchar_t c1, c2;
+ int s1, s2;
+ int dummy;
#ifdef emacs
- int offset = PTR_TO_OFFSET (d - 1);
- int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
- UPDATE_SYNTAX_TABLE (charpos);
+ int offset = PTR_TO_OFFSET (d - 1);
+ int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
+ UPDATE_SYNTAX_TABLE (charpos);
#endif
- GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2);
- s1 = SYNTAX (c1);
+ GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2);
+ s1 = SYNTAX (c1);
#ifdef emacs
- UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1);
+ UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1);
#endif
- PREFETCH_NOLIMIT ();
- GET_CHAR_AFTER (c2, d, dummy);
- s2 = SYNTAX (c2);
-
- if (/* Case 2: Only one of S1 and S2 is Sword. */
- ((s1 == Sword) != (s2 == Sword))
- /* Case 3: Both of S1 and S2 are Sword, and macro
- WORD_BOUNDARY_P (C1, C2) returns nonzero. */
- || ((s1 == Sword) && WORD_BOUNDARY_P (c1, c2)))
- not = !not;
- }
- if (not)
- break;
- else
- goto fail;
+ PREFETCH_NOLIMIT ();
+ GET_CHAR_AFTER (c2, d, dummy);
+ s2 = SYNTAX (c2);
+
+ if (/* Case 2: Only one of S1 and S2 is Sword. */
+ ((s1 == Sword) != (s2 == Sword))
+ /* Case 3: Both of S1 and S2 are Sword, and macro
+ WORD_BOUNDARY_P (C1, C2) returns nonzero. */
+ || ((s1 == Sword) && WORD_BOUNDARY_P (c1, c2)))
+ not = !not;
+ }
+ if (not)
+ break;
+ else
+ goto fail;
+ }
case wordbeg:
DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
@@ -6224,25 +6200,27 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
case syntaxspec:
case notsyntaxspec:
- not = (re_opcode_t) *(p - 1) == notsyntaxspec;
- mcnt = *p++;
- DEBUG_PRINT3 ("EXECUTING %ssyntaxspec %d.\n", not?"not":"", mcnt);
- PREFETCH ();
-#ifdef emacs
{
- int offset = PTR_TO_OFFSET (d);
- int pos1 = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
- UPDATE_SYNTAX_TABLE (pos1);
- }
+ boolean not = (re_opcode_t) *(p - 1) == notsyntaxspec;
+ mcnt = *p++;
+ DEBUG_PRINT3 ("EXECUTING %ssyntaxspec %d.\n", not?"not":"", mcnt);
+ PREFETCH ();
+#ifdef emacs
+ {
+ int offset = PTR_TO_OFFSET (d);
+ int pos1 = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
+ UPDATE_SYNTAX_TABLE (pos1);
+ }
#endif
- {
- int len;
- re_wchar_t c;
+ {
+ int len;
+ re_wchar_t c;
- GET_CHAR_AFTER (c, d, len);
- if ((SYNTAX (c) != (enum syntaxcode) mcnt) ^ not)
- goto fail;
- d += len;
+ GET_CHAR_AFTER (c, d, len);
+ if ((SYNTAX (c) != (enum syntaxcode) mcnt) ^ not)
+ goto fail;
+ d += len;
+ }
}
break;
@@ -6267,18 +6245,21 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int
case categoryspec:
case notcategoryspec:
- not = (re_opcode_t) *(p - 1) == notcategoryspec;
- mcnt = *p++;
- DEBUG_PRINT3 ("EXECUTING %scategoryspec %d.\n", not?"not":"", mcnt);
- PREFETCH ();
{
- int len;
- re_wchar_t c;
+ boolean not = (re_opcode_t) *(p - 1) == notcategoryspec;
+ mcnt = *p++;
+ DEBUG_PRINT3 ("EXECUTING %scategoryspec %d.\n",
+ not?"not":"", mcnt);
+ PREFETCH ();
- GET_CHAR_AFTER (c, d, len);
- if ((!CHAR_HAS_CATEGORY (c, mcnt)) ^ not)
- goto fail;
- d += len;
+ {
+ int len;
+ re_wchar_t c;
+ GET_CHAR_AFTER (c, d, len);
+ if ((!CHAR_HAS_CATEGORY (c, mcnt)) ^ not)
+ goto fail;
+ d += len;
+ }
}
break;
diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h
index 443fc03457..c2715fffe0 100644
--- a/src/s/aix4-2.h
+++ b/src/s/aix4-2.h
@@ -32,7 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* In AIX, you allocate a pty by opening /dev/ptc to get the master side.
To get the name of the slave side, you just ttyname() the master side. */
-#define PTY_ITERATION for (c = 0; !c ; c++)
+#define PTY_ITERATION int c; for (c = 0; !c ; c++)
#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc");
#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));
diff --git a/src/s/cygwin.h b/src/s/cygwin.h
index ceebe23f1e..af5308ff7b 100644
--- a/src/s/cygwin.h
+++ b/src/s/cygwin.h
@@ -46,7 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
-#define PTY_ITERATION for (i = 0; i < 1; i++) /* ick */
+#define PTY_ITERATION int i; for (i = 0; i < 1; i++) /* ick */
#define PTY_NAME_SPRINTF /* none */
#define PTY_TTY_NAME_SPRINTF /* none */
#define PTY_OPEN \
@@ -102,4 +102,3 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Send signals to subprocesses by "typing" special chars at them. */
#define SIGNALS_VIA_CHARACTERS
-
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 4fc2f4d103..dd0d0c3402 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -68,7 +68,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
Note: PTYs are broken on darwin <6. Use at your own risk. */
#define HAVE_PTYS
/* Run only once. We need a `for'-loop because the code uses `continue'. */
-#define PTY_ITERATION for (i = 0; i < 1; i++)
+#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
#define PTY_NAME_SPRINTF /* none */
#define PTY_TTY_NAME_SPRINTF /* none */
/* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
@@ -148,4 +148,3 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
-
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 84fe5b92da..178d7082f7 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -44,7 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define UNIX98_PTYS
/* Run only once. We need a `for'-loop because the code uses `continue'. */
-#define PTY_ITERATION for (i = 0; i < 1; i++)
+#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
#ifdef HAVE_GETPT
#define PTY_NAME_SPRINTF
diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h
index 92465ded2e..d283571d8f 100644
--- a/src/s/irix6-5.h
+++ b/src/s/irix6-5.h
@@ -60,6 +60,7 @@ char *_getpty();
#define PTY_OPEN \
{ \
struct sigaction ocstat, cstat; \
+ struct stat stb; \
char * name; \
sigemptyset(&cstat.sa_mask); \
cstat.sa_handler = SIG_DFL; \
@@ -95,5 +96,3 @@ char *_getpty();
/* Tested on Irix 6.5. SCM worked on earlier versions. */
#define GC_SETJMP_WORKS 1
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
-
-
diff --git a/src/scroll.c b/src/scroll.c
index 1343b89c41..33af18d209 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -938,8 +938,8 @@ line_ins_del (FRAME_PTR frame, int ov1, int pf1, int ovn, int pfn, register int
static void
ins_del_costs (FRAME_PTR frame,
- char *one_line_string, char *multi_string,
- char *setup_string, char *cleanup_string,
+ const char *one_line_string, const char *multi_string,
+ const char *setup_string, const char *cleanup_string,
int *costvec, int *ncostvec,
int coefficient)
{
@@ -994,9 +994,12 @@ ins_del_costs (FRAME_PTR frame,
void
do_line_insertion_deletion_costs (FRAME_PTR frame,
- char *ins_line_string, char *multi_ins_string,
- char *del_line_string, char *multi_del_string,
- char *setup_string, char *cleanup_string,
+ const char *ins_line_string,
+ const char *multi_ins_string,
+ const char *del_line_string,
+ const char *multi_del_string,
+ const char *setup_string,
+ const char *cleanup_string,
int coefficient)
{
if (FRAME_INSERT_COST (frame) != 0)
diff --git a/src/search.c b/src/search.c
index 1e2036f6dc..bf93a7fe44 100644
--- a/src/search.c
+++ b/src/search.c
@@ -114,17 +114,13 @@ matcher_overflow (void)
PATTERN is the pattern to compile.
CP is the place to put the result.
TRANSLATE is a translation table for ignoring case, or nil for none.
- REGP is the structure that says where to store the "register"
- values that will result from matching this pattern.
- If it is 0, we should compile the pattern not to record any
- subexpression bounds.
POSIX is nonzero if we want full backtracking (POSIX style)
for this pattern. 0 means backtrack only enough to get a valid match.
The behavior also depends on Vsearch_spaces_regexp. */
static void
-compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object translate, struct re_registers *regp, int posix)
+compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object translate, int posix)
{
char *val;
reg_syntax_t old;
@@ -247,7 +243,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object tra
if (cp->next == 0)
{
compile_it:
- compile_pattern_1 (cp, pattern, translate, regp, posix);
+ compile_pattern_1 (cp, pattern, translate, posix);
break;
}
}
@@ -1558,7 +1554,6 @@ simple_search (EMACS_INT n, unsigned char *pat,
while (this_len > 0)
{
- int charlen;
int pat_ch, buf_ch;
DEC_BOTH (this_pos, this_pos_byte);
@@ -1730,17 +1725,17 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
/* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a
byte following them are the target of translation. */
unsigned char str[MAX_MULTIBYTE_LENGTH];
- int len = CHAR_STRING (char_base, str);
+ int cblen = CHAR_STRING (char_base, str);
- translate_prev_byte1 = str[len - 2];
- if (len > 2)
+ translate_prev_byte1 = str[cblen - 2];
+ if (cblen > 2)
{
- translate_prev_byte2 = str[len - 3];
- if (len > 3)
+ translate_prev_byte2 = str[cblen - 3];
+ if (cblen > 3)
{
- translate_prev_byte3 = str[len - 4];
- if (len > 4)
- translate_prev_byte4 = str[len - 5];
+ translate_prev_byte3 = str[cblen - 4];
+ if (cblen > 4)
+ translate_prev_byte4 = str[cblen - 5];
}
}
}
@@ -2474,7 +2469,7 @@ since only regular expressions have distinguished subexpressions. */)
else
FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, string, pos, pos_byte);
- if (LOWERCASEP (c))
+ if (lowercasep (c))
{
/* Cannot be all caps if any original char is lower case */
@@ -2484,7 +2479,7 @@ since only regular expressions have distinguished subexpressions. */)
else
some_multiletter_word = 1;
}
- else if (UPPERCASEP (c))
+ else if (uppercasep (c))
{
some_uppercase = 1;
if (SYNTAX (prevc) != Sword)
diff --git a/src/syntax.c b/src/syntax.c
index 707c2c19f3..c1442c396c 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -513,7 +513,7 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
EMACS_INT comment_end = from;
EMACS_INT comment_end_byte = from_byte;
EMACS_INT comstart_pos = 0;
- EMACS_INT comstart_byte;
+ EMACS_INT comstart_byte IF_LINT (= 0);
/* Place where the containing defun starts,
or 0 if we didn't come across it yet. */
EMACS_INT defun_start = 0;
@@ -554,7 +554,7 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax)
&& SYNTAX_FLAGS_COMEND_SECOND (prev_syntax));
comstart = (com2start || code == Scomment);
-
+
/* Nasty cases with overlapping 2-char comment markers:
- snmp-mode: -- c -- foo -- c --
--- c --
@@ -1421,7 +1421,7 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl
register unsigned int c;
unsigned char fastmap[0400];
/* Store the ranges of non-ASCII characters. */
- int *char_ranges;
+ int *char_ranges IF_LINT (= NULL);
int n_char_ranges = 0;
int negate = 0;
register EMACS_INT i, i_byte;
@@ -2363,7 +2363,7 @@ between them, return t; otherwise return nil. */)
if (code == Scomment_fence)
{
/* Skip until first preceding unquoted comment_fence. */
- int found = 0;
+ int fence_found = 0;
EMACS_INT ini = from, ini_byte = from_byte;
while (1)
@@ -2374,13 +2374,13 @@ between them, return t; otherwise return nil. */)
if (SYNTAX (c) == Scomment_fence
&& !char_quoted (from, from_byte))
{
- found = 1;
+ fence_found = 1;
break;
}
else if (from == stop)
break;
}
- if (found == 0)
+ if (fence_found == 0)
{
from = ini; /* Set point to ini + 1. */
from_byte = ini_byte;
@@ -2669,12 +2669,12 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
/* We must record the comment style encountered so that
later, we can match only the proper comment begin
sequence of the same style. */
- int c1, other_syntax;
+ int c2, other_syntax;
DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
code = Sendcomment;
- c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
- other_syntax = SYNTAX_WITH_FLAGS (c1);
+ c2 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
+ other_syntax = SYNTAX_WITH_FLAGS (c2);
comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax);
comnested
= comnested || SYNTAX_FLAGS_COMMENT_NESTED (other_syntax);
@@ -3528,4 +3528,3 @@ In both cases, LIMIT bounds the search. */);
defsubr (&Sbackward_prefix_chars);
defsubr (&Sparse_partial_sexp);
}
-
diff --git a/src/sysdep.c b/src/sysdep.c
index 5760d0224e..6ef3d88c5c 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -292,10 +292,6 @@ init_baud_rate (int fd)
int wait_debugging; /* Set nonzero to make following function work under dbx
(at least for bsd). */
-SIGTYPE
-wait_for_termination_signal (void)
-{}
-
#ifndef MSDOS
/* Wait for subprocess with process id `pid' to terminate and
make sure it will get eliminated (not remain forever as a zombie) */
@@ -492,7 +488,7 @@ sys_subshell (void)
int pid;
struct save_signal saved_handlers[5];
Lisp_Object dir;
- unsigned char *str = 0;
+ unsigned char * IF_LINT (volatile) str = 0;
int len;
saved_handlers[0].code = SIGINT;
@@ -632,7 +628,7 @@ init_sigio (int fd)
{
}
-void
+static void
reset_sigio (int fd)
{
}
@@ -662,7 +658,7 @@ init_sigio (int fd)
interrupts_deferred = 0;
}
-void
+static void
reset_sigio (int fd)
{
#ifdef FASYNC
@@ -1890,13 +1886,13 @@ emacs_write (int fildes, const char *buf, unsigned int nbyte)
* under error conditions.
*/
+#ifndef HAVE_GETWD
+
#ifndef MAXPATHLEN
/* In 4.1, param.h fails to define this. */
#define MAXPATHLEN 1024
#endif
-#ifndef HAVE_GETWD
-
char *
getwd (char *pathname)
{
@@ -2671,8 +2667,8 @@ system_process_attributes (Lisp_Object pid)
size_t cmdsize = 0, cmdline_size;
unsigned char c;
int proc_id, ppid, uid, gid, pgrp, sess, tty, tpgid, thcount;
- unsigned long long utime, stime, cutime, cstime, start;
- long priority, nice, rss;
+ unsigned long long u_time, s_time, cutime, cstime, start;
+ long priority, niceness, rss;
unsigned long minflt, majflt, cminflt, cmajflt, vsize;
time_t sec;
unsigned usec;
@@ -2752,8 +2748,8 @@ system_process_attributes (Lisp_Object pid)
sscanf (p, "%c %d %d %d %d %d %*u %lu %lu %lu %lu %Lu %Lu %Lu %Lu %ld %ld %d %*d %Lu %lu %ld",
&c, &ppid, &pgrp, &sess, &tty, &tpgid,
&minflt, &cminflt, &majflt, &cmajflt,
- &utime, &stime, &cutime, &cstime,
- &priority, &nice, &thcount, &start, &vsize, &rss);
+ &u_time, &s_time, &cutime, &cstime,
+ &priority, &niceness, &thcount, &start, &vsize, &rss);
{
char state_str[2];
@@ -2781,13 +2777,14 @@ system_process_attributes (Lisp_Object pid)
if (clocks_per_sec < 0)
clocks_per_sec = 100;
attrs = Fcons (Fcons (Qutime,
- ltime_from_jiffies (utime, clocks_per_sec)),
+ ltime_from_jiffies (u_time, clocks_per_sec)),
attrs);
attrs = Fcons (Fcons (Qstime,
- ltime_from_jiffies (stime, clocks_per_sec)),
+ ltime_from_jiffies (s_time, clocks_per_sec)),
attrs);
attrs = Fcons (Fcons (Qtime,
- ltime_from_jiffies (stime+utime, clocks_per_sec)),
+ ltime_from_jiffies (s_time + u_time,
+ clocks_per_sec)),
attrs);
attrs = Fcons (Fcons (Qcutime,
ltime_from_jiffies (cutime, clocks_per_sec)),
@@ -2799,7 +2796,7 @@ system_process_attributes (Lisp_Object pid)
ltime_from_jiffies (cstime+cutime, clocks_per_sec)),
attrs);
attrs = Fcons (Fcons (Qpri, make_number (priority)), attrs);
- attrs = Fcons (Fcons (Qnice, make_number (nice)), attrs);
+ attrs = Fcons (Fcons (Qnice, make_number (niceness)), attrs);
attrs = Fcons (Fcons (Qthcount, make_fixnum_or_float (thcount_eint)), attrs);
EMACS_GET_TIME (tnow);
get_up_time (&sec, &usec);
@@ -2829,7 +2826,7 @@ system_process_attributes (Lisp_Object pid)
make_number
(EMACS_USECS (telapsed)))),
attrs);
- time_from_jiffies (utime + stime, clocks_per_sec, &sec, &usec);
+ time_from_jiffies (u_time + s_time, clocks_per_sec, &sec, &usec);
pcpu = (sec + usec / 1000000.0) / (EMACS_SECS (telapsed) + EMACS_USECS (telapsed) / 1000000.0);
if (pcpu > 1.0)
pcpu = 1.0;
@@ -2848,8 +2845,10 @@ system_process_attributes (Lisp_Object pid)
fd = emacs_open (fn, O_RDONLY, 0);
if (fd >= 0)
{
- for (cmdline_size = 0; emacs_read (fd, &c, 1) == 1; cmdline_size++)
+ char ch;
+ for (cmdline_size = 0; emacs_read (fd, &ch, 1) == 1; cmdline_size++)
{
+ c = ch;
if (isspace (c) || c == '\\')
cmdline_size++; /* for later quoting, see below */
}
diff --git a/src/systime.h b/src/systime.h
index eae302904f..cb1ea230f7 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -144,10 +144,8 @@ extern void set_waiting_for_input (EMACS_TIME *);
happen when this files is used outside the src directory).
Use GCPRO1 to determine if lisp.h was included. */
#ifdef GCPRO1
-/* defined in dired.c */
-extern Lisp_Object make_time (time_t);
-
/* defined in editfns.c*/
+extern Lisp_Object make_time (time_t);
extern int lisp_time_argument (Lisp_Object, time_t *, int *);
#endif
@@ -172,4 +170,3 @@ extern int lisp_time_argument (Lisp_Object, time_t *, int *);
#define EMACS_TIME_LE(T1, T2) (EMACS_TIME_CMP (T1, T2) <= 0)
#endif /* EMACS_SYSTIME_H */
-
diff --git a/src/systty.h b/src/systty.h
index 2eacfdb271..1548952e7a 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -118,3 +118,6 @@ struct emacs_tty {
extern int emacs_get_tty (int, struct emacs_tty *);
extern int emacs_set_tty (int, struct emacs_tty *, int);
+/* From sysdep.c or w32.c */
+extern int serial_open (char *);
+extern void serial_configure (struct Lisp_Process *, Lisp_Object);
diff --git a/src/term.c b/src/term.c
index f082bb40e8..e84bbe125f 100644
--- a/src/term.c
+++ b/src/term.c
@@ -32,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "termchar.h"
#include "termopts.h"
+#include "tparam.h"
#include "buffer.h"
#include "character.h"
#include "charset.h"
@@ -53,18 +54,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
static int been_here = -1;
#endif
-/* For now, don't try to include termcap.h. On some systems,
- configure finds a non-standard termcap.h that the main build
- won't find. */
-extern void tputs (const char *, int, int (*)(int));
-extern int tgetent (char *, const char *);
-extern int tgetflag (char *id);
-extern int tgetnum (char *id);
-
-char *tparam (char *, char *, int, int, ...);
-
-extern char *tgetstr (char *, char **);
-
#include "cm.h"
#ifdef HAVE_X_WINDOWS
#include "xterm.h"
@@ -262,7 +251,7 @@ tty_set_scroll_region (struct frame *f, int start, int stop)
struct tty_display_info *tty = FRAME_TTY (f);
if (tty->TS_set_scroll_region)
- buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1);
+ buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1, 0, 0);
else if (tty->TS_set_scroll_region_1)
buf = tparam (tty->TS_set_scroll_region_1, 0, 0,
FRAME_LINES (f), start,
@@ -544,8 +533,8 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi
{
if (src->type == COMPOSITE_GLYPH)
{
- struct composition *cmp;
- Lisp_Object gstring;
+ struct composition *cmp IF_LINT (= NULL);
+ Lisp_Object gstring IF_LINT (= Qnil);
int i;
nbytes = buf - encode_terminal_src;
@@ -606,7 +595,7 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi
else if (! CHAR_GLYPH_PADDING_P (*src))
{
GLYPH g;
- int c;
+ int c IF_LINT (= 0);
Lisp_Object string;
string = Qnil;
@@ -664,8 +653,6 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi
}
else
{
- unsigned char *p = SDATA (string);
-
if (! STRING_MULTIBYTE (string))
string = string_to_multibyte (string);
nbytes = buf - encode_terminal_src;
@@ -861,7 +848,7 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
if (tty->TS_ins_multi_chars)
{
- buf = tparam (tty->TS_ins_multi_chars, 0, 0, len);
+ buf = tparam (tty->TS_ins_multi_chars, 0, 0, len, 0, 0, 0);
OUTPUT1 (tty, buf);
xfree (buf);
if (start)
@@ -957,7 +944,7 @@ tty_delete_glyphs (struct frame *f, int n)
if (tty->TS_del_multi_chars)
{
- buf = tparam (tty->TS_del_multi_chars, 0, 0, n);
+ buf = tparam (tty->TS_del_multi_chars, 0, 0, n, 0, 0, 0);
OUTPUT1 (tty, buf);
xfree (buf);
}
@@ -974,9 +961,10 @@ static void
tty_ins_del_lines (struct frame *f, int vpos, int n)
{
struct tty_display_info *tty = FRAME_TTY (f);
- char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines;
- char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
- char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll;
+ const char *multi =
+ n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines;
+ const char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
+ const char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll;
register int i = n > 0 ? n : -n;
register char *buf;
@@ -999,7 +987,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
{
raw_cursor_to (f, vpos, 0);
tty_background_highlight (tty);
- buf = tparam (multi, 0, 0, i);
+ buf = tparam (multi, 0, 0, i, 0, 0, 0);
OUTPUT (tty, buf);
xfree (buf);
}
@@ -1151,9 +1139,9 @@ calculate_costs (struct frame *frame)
if (FRAME_TERMCAP_P (frame))
{
struct tty_display_info *tty = FRAME_TTY (frame);
- register char *f = (tty->TS_set_scroll_region
- ? tty->TS_set_scroll_region
- : tty->TS_set_scroll_region_1);
+ register const char *f = (tty->TS_set_scroll_region
+ ? tty->TS_set_scroll_region
+ : tty->TS_set_scroll_region_1);
FRAME_SCROLL_REGION_COST (frame) = string_cost (f);
@@ -1207,7 +1195,7 @@ calculate_costs (struct frame *frame)
}
struct fkey_table {
- char *cap, *name;
+ const char *cap, *name;
};
/* Termcap capability names that correspond directly to X keysyms.
@@ -1365,9 +1353,9 @@ term_get_fkeys_1 (void)
"k;", and if it is present, assuming that "k0" denotes F0, otherwise F10.
*/
{
- char *k_semi = tgetstr ("k;", address);
- char *k0 = tgetstr ("k0", address);
- char *k0_name = "f10";
+ const char *k_semi = tgetstr ("k;", address);
+ const char *k0 = tgetstr ("k0", address);
+ const char *k0_name = "f10";
if (k_semi)
{
@@ -1460,7 +1448,7 @@ static void append_glyph (struct it *);
static void produce_stretch_glyph (struct it *);
static void append_composite_glyph (struct it *);
static void produce_composite_glyph (struct it *);
-static void append_glyphless_glyph (struct it *, int, char *);
+static void append_glyphless_glyph (struct it *, int, const char *);
static void produce_glyphless_glyph (struct it *, int, Lisp_Object);
/* Append glyphs to IT's glyph_row. Called from produce_glyphs for
@@ -1828,7 +1816,7 @@ produce_composite_glyph (struct it *it)
comes from it->nglyphs bytes). */
static void
-append_glyphless_glyph (struct it *it, int face_id, char *str)
+append_glyphless_glyph (struct it *it, int face_id, const char *str)
{
struct glyph *glyph, *end;
int i;
@@ -1903,7 +1891,8 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
{
int face_id;
int len;
- char buf[9], *str = " ";
+ char buf[9];
+ char const *str = " ";
/* Get a face ID for the glyph by utilizing a cache (the same way as
done for `escape-glyph' in get_next_display_element). */
@@ -2122,12 +2111,13 @@ turn_on_face (struct frame *f, int face_id)
if (tty->TN_max_colors > 0)
{
- char *ts, *p;
+ const char *ts;
+ char *p;
ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
if (fg >= 0 && ts)
{
- p = tparam (ts, NULL, 0, (int) fg);
+ p = tparam (ts, NULL, 0, (int) fg, 0, 0, 0);
OUTPUT (tty, p);
xfree (p);
}
@@ -2135,7 +2125,7 @@ turn_on_face (struct frame *f, int face_id)
ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
if (bg >= 0 && ts)
{
- p = tparam (ts, NULL, 0, (int) bg);
+ p = tparam (ts, NULL, 0, (int) bg, 0, 0, 0);
OUTPUT (tty, p);
xfree (p);
}
@@ -2698,14 +2688,14 @@ term_mouse_movement (FRAME_PTR frame, Gpm_Event *event)
Set *bar_window to Qnil, and *x and *y to the column and
row of the character cell the mouse is over.
- Set *time to the time the mouse was at the returned position.
+ Set *timeptr to the time the mouse was at the returned position.
This clears mouse_moved until the next motion
event arrives. */
static void
term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
enum scroll_bar_part *part, Lisp_Object *x,
- Lisp_Object *y, unsigned long *time)
+ Lisp_Object *y, unsigned long *timeptr)
{
struct timeval now;
@@ -2718,7 +2708,7 @@ term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
XSETINT (*x, last_mouse_x);
XSETINT (*y, last_mouse_y);
gettimeofday(&now, 0);
- *time = (now.tv_sec * 1000) + (now.tv_usec / 1000);
+ *timeptr = (now.tv_sec * 1000) + (now.tv_usec / 1000);
}
/* Prepare a mouse-event in *RESULT for placement in the input queue.
@@ -3532,10 +3522,10 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
If it were in the termcap entry, it would confuse other programs. */
if (!tty->TS_set_window)
{
- p = tty->TS_termcap_modes;
- while (*p && strcmp (p, "\033v "))
- p++;
- if (*p)
+ const char *m = tty->TS_termcap_modes;
+ while (*m && strcmp (m, "\033v "))
+ m++;
+ if (*m)
tty->TS_set_window = "\033v%C %C %C %C ";
}
/* Termcap entry often fails to have :in: flag */
diff --git a/src/termcap.c b/src/termcap.c
index 69ce56d93b..27a20a67ae 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -25,6 +25,10 @@ Boston, MA 02110-1301, USA. */
#include <unistd.h>
#include "lisp.h"
+#include "tparam.h"
+#ifdef MSDOS
+#include "msdos.h"
+#endif
#ifndef NULL
#define NULL (char *) 0
@@ -65,7 +69,7 @@ static char *tgetst1 (char *ptr, char **area);
0 if not found. */
static char *
-find_capability (register char *bp, register char *cap)
+find_capability (register char *bp, register const char *cap)
{
for (; *bp; bp++)
if (bp[0] == ':'
@@ -76,7 +80,7 @@ find_capability (register char *bp, register char *cap)
}
int
-tgetnum (char *cap)
+tgetnum (const char *cap)
{
register char *ptr = find_capability (term_entry, cap);
if (!ptr || ptr[-1] != '#')
@@ -85,7 +89,7 @@ tgetnum (char *cap)
}
int
-tgetflag (char *cap)
+tgetflag (const char *cap)
{
register char *ptr = find_capability (term_entry, cap);
return ptr && ptr[-1] == ':';
@@ -97,7 +101,7 @@ tgetflag (char *cap)
If AREA is null, space is allocated with `malloc'. */
char *
-tgetstr (char *cap, char **area)
+tgetstr (const char *cap, char **area)
{
register char *ptr = find_capability (term_entry, cap);
if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~'))
@@ -263,7 +267,7 @@ tgetst1 (char *ptr, char **area)
char PC;
void
-tputs (register char *str, int nlines, register int (*outfun) (/* ??? */))
+tputs (register const char *str, int nlines, int (*outfun) (int))
{
register int padcount = 0;
register int speed;
@@ -355,7 +359,7 @@ valid_filename_p (fn)
in it, and some other value otherwise. */
int
-tgetent (char *bp, char *name)
+tgetent (char *bp, const char *name)
{
register char *termcap_name;
register int fd;
@@ -442,7 +446,7 @@ tgetent (char *bp, char *name)
buf.size = BUFSIZE;
/* Add 1 to size to ensure room for terminating null. */
buf.beg = (char *) xmalloc (buf.size + 1);
- term = indirect ? indirect : name;
+ term = indirect ? indirect : (char *)name;
if (!bp)
{
diff --git a/src/termchar.h b/src/termchar.h
index 277a96932b..035974a8ce 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -84,58 +84,58 @@ struct tty_display_info
/* Strings, numbers and flags taken from the termcap entry. */
- char *TS_ins_line; /* "al" */
- char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */
- char *TS_bell; /* "bl" */
- char *TS_clr_to_bottom; /* "cd" */
- char *TS_clr_line; /* "ce", clear to end of line */
- char *TS_clr_frame; /* "cl" */
- char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */
- char *TS_set_scroll_region_1; /* "cS" (4 params: total lines,
+ const char *TS_ins_line; /* "al" */
+ const char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */
+ const char *TS_bell; /* "bl" */
+ const char *TS_clr_to_bottom; /* "cd" */
+ const char *TS_clr_line; /* "ce", clear to end of line */
+ const char *TS_clr_frame; /* "cl" */
+ const char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */
+ const char *TS_set_scroll_region_1; /* "cS" (4 params: total lines,
lines above scroll region, lines below it,
total lines again) */
- char *TS_del_char; /* "dc" */
- char *TS_del_multi_chars; /* "DC" (one parameter, # chars to delete) */
- char *TS_del_line; /* "dl" */
- char *TS_del_multi_lines; /* "DL" (one parameter, # lines to delete) */
- char *TS_delete_mode; /* "dm", enter character-delete mode */
- char *TS_end_delete_mode; /* "ed", leave character-delete mode */
- char *TS_end_insert_mode; /* "ei", leave character-insert mode */
- char *TS_ins_char; /* "ic" */
- char *TS_ins_multi_chars; /* "IC" (one parameter, # chars to insert) */
- char *TS_insert_mode; /* "im", enter character-insert mode */
- char *TS_pad_inserted_char; /* "ip". Just padding, no commands. */
- char *TS_end_keypad_mode; /* "ke" */
- char *TS_keypad_mode; /* "ks" */
- char *TS_pad_char; /* "pc", char to use as padding */
- char *TS_repeat; /* "rp" (2 params, # times to repeat
+ const char *TS_del_char; /* "dc" */
+ const char *TS_del_multi_chars; /* "DC" (one parameter, # chars to delete) */
+ const char *TS_del_line; /* "dl" */
+ const char *TS_del_multi_lines; /* "DL" (one parameter, # lines to delete) */
+ const char *TS_delete_mode; /* "dm", enter character-delete mode */
+ const char *TS_end_delete_mode; /* "ed", leave character-delete mode */
+ const char *TS_end_insert_mode; /* "ei", leave character-insert mode */
+ const char *TS_ins_char; /* "ic" */
+ const char *TS_ins_multi_chars; /* "IC" (one parameter, # chars to insert) */
+ const char *TS_insert_mode; /* "im", enter character-insert mode */
+ const char *TS_pad_inserted_char; /* "ip". Just padding, no commands. */
+ const char *TS_end_keypad_mode; /* "ke" */
+ const char *TS_keypad_mode; /* "ks" */
+ const char *TS_pad_char; /* "pc", char to use as padding */
+ const char *TS_repeat; /* "rp" (2 params, # times to repeat
and character to be repeated) */
- char *TS_end_standout_mode; /* "se" */
- char *TS_fwd_scroll; /* "sf" */
- char *TS_standout_mode; /* "so" */
- char *TS_rev_scroll; /* "sr" */
- char *TS_end_termcap_modes; /* "te" */
- char *TS_termcap_modes; /* "ti" */
- char *TS_visible_bell; /* "vb" */
- char *TS_cursor_normal; /* "ve" */
- char *TS_cursor_visible; /* "vs" */
- char *TS_cursor_invisible; /* "vi" */
- char *TS_set_window; /* "wi" (4 params, start and end of window,
+ const char *TS_end_standout_mode; /* "se" */
+ const char *TS_fwd_scroll; /* "sf" */
+ const char *TS_standout_mode; /* "so" */
+ const char *TS_rev_scroll; /* "sr" */
+ const char *TS_end_termcap_modes; /* "te" */
+ const char *TS_termcap_modes; /* "ti" */
+ const char *TS_visible_bell; /* "vb" */
+ const char *TS_cursor_normal; /* "ve" */
+ const char *TS_cursor_visible; /* "vs" */
+ const char *TS_cursor_invisible; /* "vi" */
+ const char *TS_set_window; /* "wi" (4 params, start and end of window,
each as vpos and hpos) */
- char *TS_enter_bold_mode; /* "md" -- turn on bold (extra bright mode). */
- char *TS_enter_dim_mode; /* "mh" -- turn on half-bright mode. */
- char *TS_enter_blink_mode; /* "mb" -- enter blinking mode. */
- char *TS_enter_reverse_mode; /* "mr" -- enter reverse video mode. */
- char *TS_exit_underline_mode; /* "us" -- start underlining. */
- char *TS_enter_underline_mode; /* "ue" -- end underlining. */
+ const char *TS_enter_bold_mode; /* "md" -- turn on bold (extra bright mode). */
+ const char *TS_enter_dim_mode; /* "mh" -- turn on half-bright mode. */
+ const char *TS_enter_blink_mode; /* "mb" -- enter blinking mode. */
+ const char *TS_enter_reverse_mode; /* "mr" -- enter reverse video mode. */
+ const char *TS_exit_underline_mode; /* "us" -- start underlining. */
+ const char *TS_enter_underline_mode; /* "ue" -- end underlining. */
/* "as"/"ae" -- start/end alternate character set. Not really
supported, yet. */
- char *TS_enter_alt_charset_mode;
- char *TS_exit_alt_charset_mode;
+ const char *TS_enter_alt_charset_mode;
+ const char *TS_exit_alt_charset_mode;
- char *TS_exit_attribute_mode; /* "me" -- switch appearances off. */
+ const char *TS_exit_attribute_mode; /* "me" -- switch appearances off. */
/* Value of the "NC" (no_color_video) capability, or 0 if not present. */
int TN_no_color_video;
@@ -147,12 +147,12 @@ struct tty_display_info
int TN_max_pairs;
/* "op" -- SVr4 set default pair to its original value. */
- char *TS_orig_pair;
+ const char *TS_orig_pair;
/* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color.
1 param, the color index. */
- char *TS_set_foreground;
- char *TS_set_background;
+ const char *TS_set_foreground;
+ const char *TS_set_background;
int TF_hazeltine; /* termcap hz flag. */
int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */
@@ -210,4 +210,3 @@ extern struct tty_display_info *tty_list;
: (abort(), (struct tty_display_info *) 0))
#define CURTTY() FRAME_TTY (SELECTED_FRAME())
-
diff --git a/src/termhooks.h b/src/termhooks.h
index b147f6ed0a..0ccd2dac9e 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -654,6 +654,9 @@ extern void delete_terminal (struct terminal *);
/* The initial terminal device, created by initial_term_init. */
extern struct terminal *initial_terminal;
+extern unsigned char *encode_terminal_code (struct glyph *, int,
+ struct coding_system *);
+
#ifdef HAVE_GPM
extern void close_gpm (int gpm_fd);
#endif
diff --git a/src/terminal.c b/src/terminal.c
index 309cc0095e..c5185601fb 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -109,7 +109,7 @@ void
raw_cursor_to (struct frame *f, int row, int col)
{
if (FRAME_TERMINAL (f)->raw_cursor_to_hook)
- (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row, col);
+ (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row, col);
}
/* Erase operations */
@@ -444,7 +444,7 @@ selected frame's terminal). */)
/* Set the value of terminal parameter PARAMETER in terminal D to VALUE.
Return the previous value. */
-Lisp_Object
+static Lisp_Object
store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object value)
{
Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
@@ -569,4 +569,3 @@ or some time later. */);
Fprovide (intern_c_string ("multi-tty"), Qnil);
}
-
diff --git a/src/tparam.c b/src/tparam.c
index fcbb63881e..6aae0b97db 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -21,6 +21,7 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#include <setjmp.h>
#include "lisp.h" /* for xmalloc */
+#include "tparam.h"
#ifndef NULL
#define NULL (char *) 0
@@ -38,11 +39,12 @@ Boston, MA 02110-1301, USA. */
The fourth and following args to tparam serve as the parameter values. */
-static char *tparam1 (char *string, char *outstring, int len, char *up, char *left, register int *argp);
+static char *tparam1 (char const *string, char *outstring, int len,
+ char *up, char *left, int *argp);
-/* VARARGS 2 */
char *
-tparam (char *string, char *outstring, int len, int arg0, int arg1, int arg2, int arg3)
+tparam (const char *string, char *outstring, int len,
+ int arg0, int arg1, int arg2, int arg3)
{
int arg[4];
@@ -59,7 +61,7 @@ char *UP;
static char tgoto_buf[50];
char *
-tgoto (char *cm, int hpos, int vpos)
+tgoto (const char *cm, int hpos, int vpos)
{
int args[2];
if (!cm)
@@ -70,10 +72,11 @@ tgoto (char *cm, int hpos, int vpos)
}
static char *
-tparam1 (char *string, char *outstring, int len, char *up, char *left, register int *argp)
+tparam1 (const char *string, char *outstring, int len,
+ char *up, char *left, register int *argp)
{
register int c;
- register char *p = string;
+ register const char *p = string;
register char *op = outstring;
char *outend;
int outlen = 0;
@@ -277,4 +280,3 @@ main (argc, argv)
}
#endif /* DEBUG */
-
diff --git a/src/tparam.h b/src/tparam.h
new file mode 100644
index 0000000000..3cd3e6053c
--- /dev/null
+++ b/src/tparam.h
@@ -0,0 +1,31 @@
+/* Interface definitions for termcap entries.
+
+Copyright (C) 2011 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 <http://www.gnu.org/licenses/>. */
+
+
+/* Don't try to include termcap.h. On some systems, configure finds a
+ non-standard termcap.h that the main build won't find. */
+
+void tputs (const char *, int, int (*) (int));
+int tgetent (char *, const char *);
+int tgetflag (const char *);
+int tgetnum (const char *);
+char *tgetstr (const char *, char **);
+char *tgoto (const char *, int, int);
+
+char *tparam (const char *, char *, int, int, int, int, int);
diff --git a/src/unexaix.c b/src/unexaix.c
index fe9d13d3e4..df4c5b8905 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -40,6 +40,8 @@ what you give them. Help stamp out software-hoarding! */
*/
#include <config.h>
+#include "unexec.h"
+
#define PERROR(file) report_error (file, new)
#include <a.out.h>
/* Define getpagesize () if the system does not.
@@ -119,7 +121,8 @@ static void write_segment (int, char *, char *);
*
* driving logic.
*/
-int unexec (const char *new_name, const char *a_name)
+void
+unexec (const char *new_name, const char *a_name)
{
int new = -1, a_out = -1;
@@ -139,14 +142,13 @@ int unexec (const char *new_name, const char *a_name)
|| unrelocate_symbols (new, a_out, a_name, new_name) < 0)
{
close (new);
- return -1;
+ return;
}
close (new);
if (a_out >= 0)
close (a_out);
mark_x (new_name);
- return 0;
}
/* ****************************************************************
@@ -637,4 +639,3 @@ start_of_text (void)
{
return ((char *) 0x10000000);
}
-
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 4dafabab68..ef86a40023 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -50,6 +50,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
*/
#include <config.h>
+#include "unexec.h"
+
#define PERROR(file) report_error (file, new)
#ifndef CANNOT_DUMP /* all rest of file! */
@@ -522,7 +524,7 @@ adjust_lnnoptrs (int writedesc, int readdesc, const char *new_name)
*
* driving logic.
*/
-int
+void
unexec (const char *new_name, const char *a_name)
{
int new = -1, a_out = -1;
@@ -543,15 +545,13 @@ unexec (const char *new_name, const char *a_name)
)
{
close (new);
- return -1;
+ return;
}
close (new);
if (a_out >= 0)
close (a_out);
mark_x (new_name);
- return 0;
}
#endif /* not CANNOT_DUMP */
-
diff --git a/src/unexcw.c b/src/unexcw.c
index 02add901bb..f643c196de 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include "unexec.h"
+
#include <setjmp.h>
#include <lisp.h>
#include <stdio.h>
@@ -247,7 +249,7 @@ add_exe_suffix_if_necessary (const char *name, char *modified)
return (modified);
}
-int
+void
unexec (const char *outfile, const char *infile)
{
char infile_buffer[FILENAME_MAX];
@@ -261,7 +263,7 @@ unexec (const char *outfile, const char *infile)
{
/* can only dump once */
printf ("You can only dump Emacs once on this platform.\n");
- return (1);
+ return;
}
report_sheap_usage (1);
@@ -296,7 +298,4 @@ unexec (const char *outfile, const char *infile)
ret = close (fd_out);
assert (ret == 0);
-
- return (0);
}
-
diff --git a/src/unexec.h b/src/unexec.h
new file mode 100644
index 0000000000..343eb6d8db
--- /dev/null
+++ b/src/unexec.h
@@ -0,0 +1 @@
+void unexec (const char *, const char *);
diff --git a/src/unexelf.c b/src/unexelf.c
index 1009c87066..b58c78501b 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -386,6 +386,8 @@ temacs:
Instead we read the whole file, modify it, and write it out. */
#include <config.h>
+#include <unexec.h>
+
extern void fatal (const char *msgid, ...);
#include <sys/types.h>
@@ -518,10 +520,6 @@ typedef struct {
# define ElfW(type) ElfExpandBitsW (ELFSIZE, type)
#endif
-#ifndef ELF_BSS_SECTION_NAME
-#define ELF_BSS_SECTION_NAME ".bss"
-#endif
-
/* Get the address of a particular section or program header entry,
* accounting for the size of the entries.
*/
@@ -553,8 +551,6 @@ typedef struct {
(*(ElfW(Shdr) *) ((byte *) old_section_h + old_file_h->e_shentsize * (n)))
#define NEW_SECTION_H(n) \
(*(ElfW(Shdr) *) ((byte *) new_section_h + new_file_h->e_shentsize * (n)))
-#define OLD_PROGRAM_H(n) \
- (*(ElfW(Phdr) *) ((byte *) old_program_h + old_file_h->e_phentsize * (n)))
#define NEW_PROGRAM_H(n) \
(*(ElfW(Phdr) *) ((byte *) new_program_h + new_file_h->e_phentsize * (n)))
@@ -623,6 +619,10 @@ unexec (const char *new_name, const char *old_name)
{
int new_file, old_file, new_file_size;
+#if defined (emacs) || !defined (DEBUG)
+ void *new_break;
+#endif
+
/* Pointers to the base of the image of the two files. */
caddr_t old_base, new_base;
@@ -753,7 +753,8 @@ unexec (const char *new_name, const char *old_name)
old_name, old_file_h, old_section_h, 0);
#if defined (emacs) || !defined (DEBUG)
- new_bss_addr = (ElfW(Addr)) sbrk (0);
+ new_break = sbrk (0);
+ new_bss_addr = (ElfW(Addr)) new_break;
#else
new_bss_addr = old_bss_addr + old_bss_size + 0x1234;
#endif
@@ -954,13 +955,13 @@ temacs:
Link Info Adralgn Entsize
[22] 1 3 0x335150 0x315150 0x4 .data.rel.local
- 0 0 0x4 0
+ 0 0 0x4 0
[23] 8 3 0x335158 0x315158 0x42720 .bss
- 0 0 0x8 0
+ 0 0 0x8 0
[24] 2 0 0 0x315154 0x1c9d0 .symtab
- 25 1709 0x4 0x10
+ 25 1709 0x4 0x10
*/
if (NEW_SECTION_H (nn).sh_offset >= old_bss_offset
@@ -1228,8 +1229,8 @@ temacs:
ElfW(Shdr) section = NEW_SECTION_H (n);
/* Cause a compilation error if anyone uses n instead of nn below. */
- struct {int a;} n;
- (void)n.a; /* Prevent `unused variable' warnings. */
+ #define n ((void) 0);
+ n /* Prevent 'macro "n" is not used' warnings. */
switch (section.sh_type)
{
@@ -1276,6 +1277,8 @@ temacs:
}
break;
}
+
+ #undef n
}
/* Write out new_file, and free the buffers. */
@@ -1307,4 +1310,3 @@ temacs:
if (chmod (new_name, stat_buf.st_mode) == -1)
fatal ("Can't chmod (%s): errno %d\n", new_name, errno);
}
-
diff --git a/src/unexhp9k800.c b/src/unexhp9k800.c
index c0471992a7..f27415a252 100644
--- a/src/unexhp9k800.c
+++ b/src/unexhp9k800.c
@@ -50,6 +50,8 @@
*/
#include <config.h>
+#include "unexec.h"
+
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
@@ -74,7 +76,7 @@ run_time_remap (ignored)
/* Create a new a.out file, same as old but with current data space */
-int
+void
unexec (const char *new_name, /* name of the new a.out file to be created */
const char *old_name) /* name of the old a.out file */
{
@@ -131,7 +133,6 @@ unexec (const char *new_name, /* name of the new a.out file to be created *
/* Close the binary file */
close (old);
close (new);
- return 0;
}
/* Save current data space in the file, update header. */
@@ -319,4 +320,3 @@ display_header (hdr, auxhdr)
hdr->unloadable_sp_location, hdr->unloadable_sp_size);
}
#endif /* DEBUG */
-
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 7a55498085..04e3edf463 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -95,6 +95,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef malloc
#undef realloc
#undef free
+
+#include "unexec.h"
+
#include <stdio.h>
#include <fcntl.h>
#include <stdarg.h>
@@ -828,6 +831,7 @@ copy_data_segment (struct load_command *lc)
}
else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
|| strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
+ || strncmp (sectp->sectname, "__got", 16) == 0
|| strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0
|| strncmp (sectp->sectname, "__dyld", 16) == 0
|| strncmp (sectp->sectname, "__const", 16) == 0
@@ -1223,7 +1227,7 @@ dump_it (void)
from it. The file names of the output and input files are outfile
and infile, respectively. The three other parameters are
ignored. */
-int
+void
unexec (const char *outfile, const char *infile)
{
if (in_dumped_exec)
@@ -1254,7 +1258,6 @@ unexec (const char *outfile, const char *infile)
dump_it ();
close (outfd);
- return 0;
}
@@ -1379,4 +1382,3 @@ unexec_free (void *ptr)
else
malloc_zone_free (emacs_zone, (unexec_malloc_header_t *) ptr - 1);
}
-
diff --git a/src/unexsol.c b/src/unexsol.c
index e1a10f7d21..ef1e34e6f0 100644
--- a/src/unexsol.c
+++ b/src/unexsol.c
@@ -1,6 +1,8 @@
/* Trivial unexec for Solaris. */
#include <config.h>
+#include "unexec.h"
+
#include <dlfcn.h>
#include <setjmp.h>
@@ -9,14 +11,14 @@
#include "charset.h"
#include "coding.h"
-int
+void
unexec (const char *new_name, const char *old_name)
{
Lisp_Object data;
Lisp_Object errstring;
if (! dldump (0, new_name, RTLD_MEMORY))
- return 0;
+ return;
data = Fcons (build_string (new_name), Qnil);
synchronize_system_messages_locale ();
@@ -26,4 +28,3 @@ unexec (const char *new_name, const char *old_name)
xsignal (Qfile_error,
Fcons (build_string ("Cannot unexec"), Fcons (errstring, data)));
}
-
diff --git a/src/unexw32.c b/src/unexw32.c
index 829c864c96..cd8211d6be 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
*/
#include <config.h>
+#include "unexec.h"
#include <stdio.h>
#include <fcntl.h>
@@ -723,7 +724,7 @@ copy_executable_and_dump_data (file_data *p_infile,
/* Dump out .data and .bss sections into a new executable. */
-int
+void
unexec (const char *new_name, const char *old_name)
{
file_data in_file, out_file;
@@ -819,9 +820,6 @@ unexec (const char *new_name, const char *old_name)
close_file_data (&in_file);
close_file_data (&out_file);
-
- return 0;
}
/* eof */
-
diff --git a/src/w32.c b/src/w32.c
index ae2373be46..721cea07d2 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -147,9 +147,6 @@ typedef HRESULT (WINAPI * ShGetFolderPath_fn)
void globals_of_w32 (void);
static DWORD get_rid (PSID);
-/* Defined in process.c for its own purpose. */
-extern Lisp_Object Qlocal;
-
/* Initialization states.
@@ -5666,8 +5663,6 @@ sys_write (int fd, const void * buffer, unsigned int count)
static void
check_windows_init_file (void)
{
- extern int noninteractive, inhibit_window_system;
-
/* A common indication that Emacs is not installed properly is when
it cannot find the Windows installation file. If this file does
not exist in the expected place, tell the user. */
diff --git a/src/w32console.c b/src/w32console.c
index 31c4a7c4e5..3c200405cb 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -41,12 +41,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* from window.c */
extern Lisp_Object Frecenter (Lisp_Object);
-/* from keyboard.c */
-extern int detect_input_pending (void);
-
-/* from sysdep.c */
-extern int read_input_pending (void);
-
static void w32con_move_cursor (struct frame *f, int row, int col);
static void w32con_clear_to_end (struct frame *f);
static void w32con_clear_frame (struct frame *f);
@@ -277,9 +271,6 @@ w32con_insert_glyphs (struct frame *f, register struct glyph *start,
}
}
-extern unsigned char *encode_terminal_code (struct glyph *, int,
- struct coding_system *);
-
static void
w32con_write_glyphs (struct frame *f, register struct glyph *string,
register int len)
diff --git a/src/w32fns.c b/src/w32fns.c
index ec48397657..0c899cdcef 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -60,6 +60,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <dlgs.h>
#include <imm.h>
#define FILE_NAME_TEXT_FIELD edt1
+#define FILE_NAME_COMBO_BOX cmb13
+#define FILE_NAME_LIST lst1
#include "font.h"
#include "w32font.h"
@@ -78,10 +80,6 @@ extern void w32_menu_display_help (HWND, HMENU, UINT, UINT);
extern void w32_free_menu_strings (HWND);
extern const char *map_w32_filename (const char *, const char **);
-extern int quit_char;
-
-extern const char *const lispy_function_keys[];
-
/* If non-zero, a w32 timer that, when it expires, displays an
hourglass cursor on all frames. */
static unsigned hourglass_timer = 0;
@@ -185,18 +183,10 @@ unsigned int msh_mousewheel = 0;
#define MENU_FREE_DELAY 1000
static unsigned menu_free_timer = 0;
-extern Lisp_Object Qtooltip;
-
#ifdef GLYPH_DEBUG
int image_cache_refcount, dpyinfo_refcount;
#endif
-
-extern HWND w32_system_caret_hwnd;
-
-extern int w32_system_caret_height;
-extern int w32_system_caret_x;
-extern int w32_system_caret_y;
static HWND w32_visible_system_caret_hwnd;
/* From w32menu.c */
@@ -5849,7 +5839,6 @@ Value is t if tooltip was open, nil otherwise. */)
/***********************************************************************
File selection dialog
***********************************************************************/
-extern Lisp_Object Qfile_name_history;
/* Callback for altering the behavior of the Open File dialog.
Makes the Filename text field contain "Current Directory" and be
@@ -5868,13 +5857,37 @@ file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND dialog = GetParent (hwnd);
HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
+ HWND list = GetDlgItem (dialog, FILE_NAME_LIST);
- /* Directories is in index 2. */
+ /* At least on Windows 7, the above attempt to get the window handle
+ to the File Name Text Field fails. The following code does the
+ job though. Note that this code is based on my examination of the
+ window hierarchy using Microsoft Spy++. bk */
+ if (edit_control == NULL)
+ {
+ HWND tmp = GetDlgItem (dialog, FILE_NAME_COMBO_BOX);
+ if (tmp)
+ {
+ tmp = GetWindow (tmp, GW_CHILD);
+ if (tmp)
+ edit_control = GetWindow (tmp, GW_CHILD);
+ }
+ }
+
+ /* Directories is in index 2. */
if (notify->lpOFN->nFilterIndex == 2)
{
CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD,
"Current Directory");
EnableWindow (edit_control, FALSE);
+ /* Note that at least on Windows 7, the above call to EnableWindow
+ disables the window that would ordinarily have focus. If we
+ do not set focus to some other window here, focus will land in
+ no man's land and the user will be unable to tab through the
+ dialog box (pressing tab will only result in a beep).
+ Avoid that problem by setting focus to the list here. */
+ if (notify->hdr.code == CDN_INITDONE)
+ SetFocus (list);
}
else
{
@@ -5951,6 +5964,13 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
else
filename[0] = '\0';
+ /* The code in file_dialog_callback that attempts to set the text
+ of the file name edit window when handling the CDN_INITDONE
+ WM_NOTIFY message does not work. Setting filename to "Current
+ Directory" in the only_dir_p case here does work however. */
+ if (filename[0] == 0 && ! NILP (only_dir_p))
+ strcpy (filename, "Current Directory");
+
{
NEWOPENFILENAME new_file_details;
BOOL file_opened = FALSE;
diff --git a/src/w32font.c b/src/w32font.c
index aef62f61a3..40ff0782b8 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -54,8 +54,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define JOHAB_CHARSET 130
#endif
-extern struct font_driver w32font_driver;
-
Lisp_Object Qgdi;
Lisp_Object Quniscribe;
static Lisp_Object QCformat;
@@ -64,7 +62,6 @@ static Lisp_Object Qserif, Qscript, Qdecorative;
static Lisp_Object Qraster, Qoutline, Qunknown;
/* antialiasing */
-extern Lisp_Object QCantialias, QCotf, QClang; /* defined in font.c */
extern Lisp_Object Qnone; /* reuse from w32fns.c */
static Lisp_Object Qstandard, Qsubpixel, Qnatural;
diff --git a/src/w32inevt.c b/src/w32inevt.c
index d0b097100f..c4858dea90 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -40,18 +40,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "w32heap.h"
#include "w32term.h"
-/* stdin, from ntterm */
+/* stdin, from w32console.c */
extern HANDLE keyboard_handle;
/* Info for last mouse motion */
static COORD movement_pos;
static DWORD movement_time;
-/* from keyboard.c */
-extern void reinvoke_input_signal (void);
-
+/* from w32fns.c */
extern unsigned int map_keypad_keys (unsigned int, unsigned int);
-
extern unsigned int w32_key_to_modifier (int key);
/* Event queue */
@@ -261,8 +258,6 @@ w32_kbd_patch_key (KEY_EVENT_RECORD *event)
}
-extern const char *const lispy_function_keys[];
-
static int faked_key = 0;
/* return code -1 means that event_queue_ptr won't be incremented.
diff --git a/src/w32menu.c b/src/w32menu.c
index 92447eb9fa..a2e62f24f6 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -84,14 +84,6 @@ MessageBoxW_Proc unicode_message_box = NULL;
Lisp_Object Qdebug_on_next_call;
-extern Lisp_Object Qmenu_bar;
-
-extern Lisp_Object QCtoggle, QCradio;
-
-extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
-
-extern Lisp_Object Qmenu_bar_update_hook;
-
void set_frame_menubar (FRAME_PTR, int, int);
#ifdef HAVE_DIALOGS
diff --git a/src/w32proc.c b/src/w32proc.c
index bb8b428ffe..e94d9aa325 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -67,8 +67,6 @@ extern BOOL WINAPI IsValidLocale (LCID, DWORD);
+ ((DWORD)(var) - (section)->VirtualAddress) \
+ (filedata).file_base))
-extern Lisp_Object Qlocal;
-
Lisp_Object Qhigh, Qlow;
#ifdef EMACSDEBUG
@@ -1053,7 +1051,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
detect that we were woken up by C-g, we return -1 with errno set to
EINTR as on Unix. */
-/* From ntterm.c */
+/* From w32console.c */
extern HANDLE keyboard_handle;
/* From w32xfns.c */
@@ -1559,8 +1557,6 @@ sys_kill (int pid, int sig)
return rc;
}
-/* extern int report_file_error (char *, Lisp_Object); */
-
/* The following two routines are used to manipulate stdin, stdout, and
stderr of our child processes.
@@ -1660,7 +1656,7 @@ set_process_dir (char * dir)
dial-up users to only be connected when they actually need to use
socket services. */
-/* From nt.c */
+/* From w32.c */
extern HANDLE winsock_lib;
extern BOOL term_winsock (void);
extern BOOL init_winsock (int load_now);
diff --git a/src/w32select.c b/src/w32select.c
index 23d5fb68c7..ef0cb3adc2 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -78,7 +78,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "w32term.h" /* for all of the w32 includes */
#include "w32heap.h" /* os_subtype */
#include "blockinput.h"
-#include "keyboard.h" /* cmd_error_internal() */
#include "charset.h"
#include "coding.h"
#include "character.h"
@@ -391,6 +390,7 @@ run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg)
with global variables and calling strange looking functions. Is
this really the right way to run Lisp callbacks? */
+ extern int waiting_for_input; /* from keyboard.c */
int owfi;
BLOCK_INPUT;
diff --git a/src/w32term.c b/src/w32term.c
index 67e853f21f..f31c4e90e7 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -88,8 +88,6 @@ extern void free_frame_menubar (struct frame *);
extern int w32_codepage_for_font (char *fontname);
extern Cursor w32_load_cursor (LPCTSTR name);
-extern Lisp_Object Vwindow_system;
-
#define x_any_window_to_frame x_window_to_frame
#define x_top_window_to_frame x_window_to_frame
@@ -138,13 +136,6 @@ BOOL (WINAPI *pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
#define WS_EX_LAYERED 0x80000
#endif
-/* Frame being updated by update_frame. This is declared in term.c.
- This is set by update_begin and looked at by all the
- w32 functions. It is zero while not inside an update.
- In that case, the w32 functions assume that `SELECTED_FRAME ()'
- is the frame to apply to. */
-extern struct frame *updating_frame;
-
/* This is a frame waiting to be autoraised, within w32_read_socket. */
struct frame *pending_autoraise_frame;
@@ -2536,8 +2527,7 @@ x_delete_glyphs (struct frame *f, register int n)
}
-/* Clear entire frame. If updating_frame is non-null, clear that
- frame. Otherwise clear the selected frame. */
+/* Clear entire frame. */
static void
x_clear_frame (struct frame *f)
@@ -6060,7 +6050,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
terminal->mouse_position_hook = w32_mouse_position;
terminal->frame_rehighlight_hook = w32_frame_rehighlight;
terminal->frame_raise_lower_hook = w32_frame_raise_lower;
- // terminal->fullscreen_hook = XTfullscreen_hook;
+ /* terminal->fullscreen_hook = XTfullscreen_hook; */
terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
diff --git a/src/w32term.h b/src/w32term.h
index c79352a8db..cf6751b7d6 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -547,7 +547,7 @@ do { \
#define WM_APPCOMMAND 0x319
#define GET_APPCOMMAND_LPARAM(lParam) (HIWORD(lParam) & 0x7fff)
#endif
-#ifndef WM_UNICHAR
+#ifndef WM_UNICHAR
#define WM_UNICHAR 0x109
#endif
#ifndef UNICODE_NOCHAR
@@ -697,3 +697,7 @@ typedef BOOL (WINAPI * AppendMenuW_Proc) (
IN UINT_PTR,
IN LPCWSTR);
+extern HWND w32_system_caret_hwnd;
+extern int w32_system_caret_height;
+extern int w32_system_caret_x;
+extern int w32_system_caret_y;
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 319f934e3b..39d1ee5c85 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -52,10 +52,6 @@ int uniscribe_available = 0;
extern Lisp_Object Quniscribe;
extern Lisp_Object Qopentype;
-extern int initialized;
-
-extern struct font_driver uniscribe_font_driver;
-
/* EnumFontFamiliesEx callback. */
static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *,
NEWTEXTMETRICEX *,
diff --git a/src/w32xfns.c b/src/w32xfns.c
index df9acca5fb..fbbf11bd65 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -97,7 +97,7 @@ select_palette (FRAME_PTR f, HDC hdc)
else
f->output_data.w32->old_palette = NULL;
- if (RealizePalette (hdc))
+ if (RealizePalette (hdc) != GDI_ERROR)
{
Lisp_Object frame, framelist;
FOR_EACH_FRAME (framelist, frame)
diff --git a/src/window.c b/src/window.c
index 9a0955955f..f35815d757 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2209,13 +2209,13 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
case DELETE_BUFFER_WINDOWS:
if (EQ (w->buffer, obj))
{
- struct frame *f = XFRAME (WINDOW_FRAME (w));
+ struct frame *fr = XFRAME (WINDOW_FRAME (w));
/* If this window is dedicated, and in a frame of its own,
kill the frame. */
- if (EQ (window, FRAME_ROOT_WINDOW (f))
+ if (EQ (window, FRAME_ROOT_WINDOW (fr))
&& !NILP (w->dedicated)
- && other_visible_frames (f))
+ && other_visible_frames (fr))
{
/* Skip the other windows on this frame.
There might be one, the minibuffer! */
@@ -2267,16 +2267,16 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
if (EQ (w->buffer, obj))
{
Lisp_Object buffer;
- struct frame *f = XFRAME (w->frame);
+ struct frame *fr = XFRAME (w->frame);
/* Find another buffer to show in this window. */
buffer = Fother_buffer (obj, Qnil, w->frame);
/* If this window is dedicated, and in a frame of its own,
kill the frame. */
- if (EQ (window, FRAME_ROOT_WINDOW (f))
+ if (EQ (window, FRAME_ROOT_WINDOW (fr))
&& !NILP (w->dedicated)
- && other_visible_frames (f))
+ && other_visible_frames (fr))
{
/* Skip the other windows on this frame.
There might be one, the minibuffer! */
@@ -2290,11 +2290,11 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
}
else if (!NILP (w->dedicated) && !NILP (w->parent))
{
- Lisp_Object window;
- XSETWINDOW (window, w);
+ Lisp_Object window_to_delete;
+ XSETWINDOW (window_to_delete, w);
/* If this window is dedicated and not the only window
in its frame, then kill it. */
- Fdelete_window (window);
+ Fdelete_window (window_to_delete);
}
else
{
@@ -3124,7 +3124,7 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
}
else if (!NILP (*forward))
{
- int fixed_size, each, extra, n;
+ int fixed_size, each IF_LINT (= 0), extra IF_LINT (= 0), n;
int resize_fixed_p, nfixed;
int last_pos, first_pos, nchildren, total;
int *new_sizes = NULL;
@@ -3170,11 +3170,11 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
last_pos = first_pos;
for (n = 0, child = *forward; !NILP (child); child = c->next, ++n)
{
- int new_size, old_size;
+ int new_child_size, old_child_size;
c = XWINDOW (child);
- old_size = WINDOW_TOTAL_SIZE (c, width_p);
- new_size = old_size;
+ old_child_size = WINDOW_TOTAL_SIZE (c, width_p);
+ new_child_size = old_child_size;
/* The top or left edge position of this child equals the
bottom or right edge of its predecessor. */
@@ -3186,18 +3186,20 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
/* If this child can be resized, do it. */
if (resize_fixed_p || !window_fixed_size_p (c, width_p, 0))
{
- new_size = new_sizes ? new_sizes[n] : old_size + each + extra;
+ new_child_size =
+ new_sizes ? new_sizes[n] : old_child_size + each + extra;
extra = 0;
}
/* Set new size. Note that size_window also propagates
edge positions to children, so it's not a no-op if we
didn't change the child's size. */
- size_window (child, new_size, width_p, 1, first_only, last_only);
+ size_window (child, new_child_size, width_p, 1,
+ first_only, last_only);
/* Remember the bottom/right edge position of this child; it
will be used to set the top/left edge of the next child. */
- last_pos += new_size;
+ last_pos += new_child_size;
}
xfree (new_sizes);
@@ -3325,12 +3327,12 @@ run_window_configuration_change_hook (struct frame *f)
if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook,
buffer)))
{
- int count = SPECPDL_INDEX ();
+ int count1 = SPECPDL_INDEX ();
record_unwind_protect (select_window_norecord, Fselected_window ());
select_window_norecord (window);
run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook,
buffer));
- unbind_to (count, Qnil);
+ unbind_to (count1, Qnil);
}
}
}
@@ -3602,7 +3604,7 @@ select_frame_norecord (Lisp_Object frame)
? Fselect_frame (frame, Qt) : selected_frame;
}
-Lisp_Object
+static Lisp_Object
display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame)
{
return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame);
@@ -4128,7 +4130,7 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
{
/* If trying to grow this window to or beyond size of the parent,
just delete all the sibling windows. */
- Lisp_Object start, tem, next;
+ Lisp_Object start, tem;
start = XWINDOW (parent)->vchild;
if (NILP (start))
@@ -4138,9 +4140,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
tem = XWINDOW (window)->next;
while (! NILP (tem))
{
- next = XWINDOW (tem)->next;
+ Lisp_Object next1 = XWINDOW (tem)->next;
delete_window (tem);
- tem = next;
+ tem = next1;
}
/* Delete any siblings that come after WINDOW.
@@ -4149,9 +4151,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
tem = start;
while (! EQ (tem, window))
{
- next = XWINDOW (tem)->next;
+ Lisp_Object next1 = XWINDOW (tem)->next;
delete_window (tem);
- tem = next;
+ tem = next1;
}
}
else
@@ -5529,7 +5531,7 @@ and redisplay normally--don't erase and redraw the frame. */)
struct buffer *obuf = current_buffer;
int center_p = 0;
EMACS_INT charpos, bytepos;
- int iarg;
+ int iarg IF_LINT (= 0);
int this_scroll_margin;
/* If redisplay is suppressed due to an error, try again. */
@@ -7211,4 +7213,3 @@ keys_of_window (void)
initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
initial_define_key (meta_map, 'v', "scroll-down-command");
}
-
diff --git a/src/window.h b/src/window.h
index 9f0809e4f1..ad627aca34 100644
--- a/src/window.h
+++ b/src/window.h
@@ -778,6 +778,7 @@ extern void freeze_window_starts (struct frame *, int);
extern void grow_mini_window (struct window *, int);
extern void shrink_mini_window (struct window *);
extern int window_relative_x_coord (struct window *, enum window_part, int);
+extern void check_all_windows (void);
void run_window_configuration_change_hook (struct frame *f);
diff --git a/src/xdisp.c b/src/xdisp.c
index 44cb713011..a7955f41e0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10909,7 +10909,7 @@ hscroll_window_tree (Lisp_Object window)
current_buffer = XBUFFER (w->buffer);
if (w == XWINDOW (selected_window))
- pt = BUF_PT (current_buffer);
+ pt = PT;
else
{
pt = marker_position (w->pointm);
@@ -11347,7 +11347,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
EMACS_INT pt;
if (w == XWINDOW (selected_window))
- pt = BUF_PT (current_buffer);
+ pt = PT;
else
pt = marker_position (w->pointm);
@@ -13697,6 +13697,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
int buffer_unchanged_p = 0;
int temp_scroll_step = 0;
int count = SPECPDL_INDEX ();
+ int rc;
int centering_position = -1;
int last_line_misfit = 0;
EMACS_INT beg_unchanged, end_unchanged;
@@ -14008,15 +14009,12 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
/* Handle case where text has not changed, only point, and it has
not moved off the frame, and we are not retrying after hscroll.
(current_matrix_up_to_date_p is nonzero when retrying.) */
- if (current_matrix_up_to_date_p)
+ if (current_matrix_up_to_date_p
+ && (rc = try_cursor_movement (window, startp, &temp_scroll_step),
+ rc != CURSOR_MOVEMENT_CANNOT_BE_USED))
{
- int rc = try_cursor_movement (window, startp, &temp_scroll_step);
-
switch (rc)
{
- case CURSOR_MOVEMENT_CANNOT_BE_USED:
- break;
-
case CURSOR_MOVEMENT_SUCCESS:
used_current_matrix_p = 1;
goto done;
@@ -14165,11 +14163,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
{
/* The function returns -1 if new fonts were loaded, 1 if
successful, 0 if not successful. */
- int rc = try_scrolling (window, just_this_one_p,
+ int ss = try_scrolling (window, just_this_one_p,
scroll_conservatively,
emacs_scroll_step,
temp_scroll_step, last_line_misfit);
- switch (rc)
+ switch (ss)
{
case SCROLLING_SUCCESS:
goto done;
@@ -17231,14 +17229,16 @@ display_line (struct it *it)
struct glyph_row *row = it->glyph_row;
Lisp_Object overlay_arrow_string;
struct it wrap_it;
- int may_wrap = 0, wrap_x;
- int wrap_row_used = -1, wrap_row_ascent, wrap_row_height;
- int wrap_row_phys_ascent, wrap_row_phys_height;
- int wrap_row_extra_line_spacing;
- EMACS_INT wrap_row_min_pos, wrap_row_min_bpos;
- EMACS_INT wrap_row_max_pos, wrap_row_max_bpos;
+ int may_wrap = 0, wrap_x IF_LINT (= 0);
+ int wrap_row_used = -1;
+ int wrap_row_ascent IF_LINT (= 0), wrap_row_height IF_LINT (= 0);
+ int wrap_row_phys_ascent IF_LINT (= 0), wrap_row_phys_height IF_LINT (= 0);
+ int wrap_row_extra_line_spacing IF_LINT (= 0);
+ EMACS_INT wrap_row_min_pos IF_LINT (= 0), wrap_row_min_bpos IF_LINT (= 0);
+ EMACS_INT wrap_row_max_pos IF_LINT (= 0), wrap_row_max_bpos IF_LINT (= 0);
int cvpos;
- EMACS_INT min_pos = ZV + 1, min_bpos, max_pos = 0, max_bpos;
+ EMACS_INT min_pos = ZV + 1, max_pos = 0;
+ EMACS_INT min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0);
/* We always start displaying at hpos zero even if hscrolled. */
xassert (it->hpos == 0 && it->current_x == 0);
@@ -17912,16 +17912,13 @@ paragraphs, text begins at the right margin and is read from right to left.
See also `bidi-paragraph-direction'. */)
(Lisp_Object buffer)
{
- struct buffer *buf;
- struct buffer *old;
+ struct buffer *buf = current_buffer;
+ struct buffer *old = buf;
- if (NILP (buffer))
- buf = current_buffer;
- else
+ if (! NILP (buffer))
{
CHECK_BUFFER (buffer);
buf = XBUFFER (buffer);
- old = current_buffer;
}
if (NILP (BVAR (buf, bidi_display_reordering)))
@@ -17938,8 +17935,7 @@ See also `bidi-paragraph-direction'. */)
EMACS_INT bytepos = BUF_PT_BYTE (buf);
int c;
- if (buf != current_buffer)
- set_buffer_temp (buf);
+ set_buffer_temp (buf);
/* bidi_paragraph_init finds the base direction of the paragraph
by searching forward from paragraph start. We need the base
direction of the current or _previous_ paragraph, so we need
@@ -17967,8 +17963,7 @@ See also `bidi-paragraph-direction'. */)
itb.paragraph_dir = NEUTRAL_DIR;
bidi_paragraph_init (NEUTRAL_DIR, &itb, 1);
- if (buf != current_buffer)
- set_buffer_temp (old);
+ set_buffer_temp (old);
switch (itb.paragraph_dir)
{
case L2R:
@@ -21092,7 +21087,7 @@ compute_overhangs_and_x (struct glyph_string *s, int x, int backward_p)
int cmp_id = (row)->glyphs[area][START].u.cmp.id; \
struct composition *cmp = composition_table[cmp_id]; \
XChar2b *char2b; \
- struct glyph_string *first_s; \
+ struct glyph_string *first_s IF_LINT (= NULL); \
int n; \
\
char2b = (XChar2b *) alloca ((sizeof *char2b) * cmp->glyph_len); \
@@ -21296,7 +21291,8 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
{
struct glyph_string *h, *t;
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- int mouse_beg_col, mouse_end_col, check_mouse_face = 0;
+ int mouse_beg_col IF_LINT (= 0), mouse_end_col IF_LINT (= 0);
+ int check_mouse_face = 0;
int dummy_x = 0;
/* If mouse highlighting is on, we may need to draw adjacent
@@ -22292,7 +22288,13 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
if (metrics_upper.width >= metrics_lower.width)
lower_xoff = (width - metrics_lower.width) / 2;
else
- upper_xoff = (width - metrics_upper.width) / 2;
+ {
+ /* FIXME: This code doesn't look right. It formerly was
+ missing the "lower_xoff = 0;", which couldn't have
+ been right since it left lower_xoff uninitialized. */
+ lower_xoff = 0;
+ upper_xoff = (width - metrics_upper.width) / 2;
+ }
}
/* +5 is for horizontal bars of a box plus 1-pixel spaces at
@@ -25453,7 +25455,8 @@ note_mouse_highlight (struct frame *f, int x, int y)
{
/* The mouse-highlighting, if any, comes from an overlay
or text property in the buffer. */
- Lisp_Object buffer, cover_string;
+ Lisp_Object buffer IF_LINT (= Qnil);
+ Lisp_Object cover_string IF_LINT (= Qnil);
if (STRINGP (object))
{
diff --git a/src/xfaces.c b/src/xfaces.c
index 4cc47c8505..0fc5dd6f8a 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -297,16 +297,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR))
-/* Make a copy of string S on the stack using alloca. Value is a pointer
- to the copy. */
-
-#define STRDUPA(S) strcpy ((char *) alloca (strlen ((S)) + 1), (S))
-
-/* Make a copy of the contents of Lisp string S on the stack using
- alloca. Value is a pointer to the copy. */
-
-#define LSTRDUPA(S) STRDUPA (SDATA ((S)))
-
/* Size of hash table of realized faces in face caches (should be a
prime number). */
@@ -847,7 +837,6 @@ clear_face_cache (int clear_fonts_p)
{
#ifdef HAVE_WINDOW_SYSTEM
Lisp_Object tail, frame;
- struct frame *f;
if (clear_fonts_p
|| ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT)
@@ -875,7 +864,7 @@ clear_face_cache (int clear_fonts_p)
/* Clear GCs of realized faces. */
FOR_EACH_FRAME (tail, frame)
{
- f = XFRAME (frame);
+ struct frame *f = XFRAME (frame);
if (FRAME_WINDOW_P (f))
clear_face_gcs (FRAME_FACE_CACHE (f));
}
@@ -1113,7 +1102,7 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color, XColor
/* A version of defined_color for non-X frames. */
-int
+static int
tty_defined_color (struct frame *f, const char *color_name,
XColor *color_def, int alloc)
{
@@ -1721,7 +1710,7 @@ the WIDTH times as wide as FACE on FRAME. */)
(Lisp_Object pattern, Lisp_Object face, Lisp_Object frame, Lisp_Object maximum, Lisp_Object width)
{
struct frame *f;
- int size, avgwidth;
+ int size, avgwidth IF_LINT (= 0);
check_x ();
CHECK_STRING (pattern);
@@ -1754,14 +1743,14 @@ the WIDTH times as wide as FACE on FRAME. */)
/* This is of limited utility since it works with character
widths. Keep it for compatibility. --gerd. */
int face_id = lookup_named_face (f, face, 0);
- struct face *face = (face_id < 0
- ? NULL
- : FACE_FROM_ID (f, face_id));
+ struct face *width_face = (face_id < 0
+ ? NULL
+ : FACE_FROM_ID (f, face_id));
- if (face && face->font)
+ if (width_face && width_face->font)
{
- size = face->font->pixel_size;
- avgwidth = face->font->average_width;
+ size = width_face->font->pixel_size;
+ avgwidth = width_face->font->average_width;
}
else
{
@@ -1838,6 +1827,7 @@ the WIDTH times as wide as FACE on FRAME. */)
#define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX)
#define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX)
+#if XASSERTS
/* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size
LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */
@@ -1845,6 +1835,7 @@ the WIDTH times as wide as FACE on FRAME. */)
(VECTORP (LFACE) \
&& XVECTOR (LFACE)->size == LFACE_VECTOR_SIZE \
&& EQ (AREF (LFACE, 0), Qface))
+#endif
#if GLYPH_DEBUG
@@ -2252,7 +2243,7 @@ set_lface_from_font (struct frame *f, Lisp_Object lface, Lisp_Object font_object
`relative' heights; the returned value is always an absolute height
unless both FROM and TO are relative. */
-Lisp_Object
+static Lisp_Object
merge_face_heights (Lisp_Object from, Lisp_Object to, Lisp_Object invalid)
{
Lisp_Object result = invalid;
@@ -3869,19 +3860,19 @@ return the font name used for CHARACTER. */)
{
struct frame *f = frame_or_selected_frame (frame, 1);
int face_id = lookup_named_face (f, face, 1);
- struct face *face = FACE_FROM_ID (f, face_id);
+ struct face *fface = FACE_FROM_ID (f, face_id);
- if (! face)
+ if (! fface)
return Qnil;
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f) && !NILP (character))
{
CHECK_CHARACTER (character);
- face_id = FACE_FOR_CHAR (f, face, XINT (character), -1, Qnil);
- face = FACE_FROM_ID (f, face_id);
+ face_id = FACE_FOR_CHAR (f, fface, XINT (character), -1, Qnil);
+ fface = FACE_FROM_ID (f, face_id);
}
- return (face->font
- ? face->font->props[FONT_NAME_INDEX]
+ return (fface->font
+ ? fface->font->props[FONT_NAME_INDEX]
: Qnil);
#else /* !HAVE_WINDOW_SYSTEM */
return build_string (FRAME_MSDOS_P (f)
@@ -4313,45 +4304,6 @@ free_realized_faces (struct face_cache *c)
}
-/* Free all realized faces that are using FONTSET on frame F. */
-
-void
-free_realized_faces_for_fontset (struct frame *f, int fontset)
-{
- struct face_cache *cache = FRAME_FACE_CACHE (f);
- struct face *face;
- int i;
-
- /* We must block input here because we can't process X events safely
- while only some faces are freed, or when the frame's current
- matrix still references freed faces. */
- BLOCK_INPUT;
-
- for (i = 0; i < cache->used; i++)
- {
- face = cache->faces_by_id[i];
- if (face
- && face->fontset == fontset)
- {
- uncache_face (cache, face);
- free_realized_face (f, face);
- }
- }
-
- /* Must do a thorough redisplay the next time. Mark current
- matrices as invalid because they will reference faces freed
- above. This function is also called when a frame is destroyed.
- In this case, the root window of F is nil. */
- if (WINDOWP (f->root_window))
- {
- clear_current_matrices (f);
- ++windows_or_buffers_changed;
- }
-
- UNBLOCK_INPUT;
-}
-
-
/* Free all realized faces on FRAME or on all frames if FRAME is nil.
This is done after attributes of a named face have been changed,
because we can't tell which realized faces depend on that face. */
@@ -5287,10 +5239,6 @@ be found. Value is ALIST. */)
#ifdef HAVE_WINDOW_SYSTEM
-/* Ignore the difference of font point size less than this value. */
-
-#define FONT_POINT_SIZE_QUANTUM 5
-
/* Return the fontset id of the base fontset name or alias name given
by the fontset attribute of ATTRS. Value is -1 if the fontset
attribute of ATTRS doesn't name a fontset. */
@@ -6349,7 +6297,7 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */)
CHECK_STRING (filename);
abspath = Fexpand_file_name (filename, Qnil);
- fp = fopen (SDATA (filename), "rt");
+ fp = fopen (SDATA (abspath), "rt");
if (fp)
{
char buf[512];
diff --git a/src/xfns.c b/src/xfns.c
index deb0e192a5..e50d688717 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -461,7 +461,7 @@ x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
Window win = f->output_data.x->parent_desc;
Atom actual_type;
unsigned long actual_size, bytes_remaining;
- int i, rc, actual_format;
+ int rc, actual_format;
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
long max_len = 400;
Display *dpy = FRAME_X_DISPLAY (f);
@@ -648,7 +648,7 @@ x_defined_color (struct frame *f, const char *color_name,
is a monochrome frame, return MONO_COLOR regardless of what ARG says.
Signal an error if color can't be allocated. */
-int
+static int
x_decode_color (FRAME_PTR f, Lisp_Object color_name, int mono_color)
{
XColor cdef;
@@ -746,7 +746,6 @@ xg_set_icon (FRAME_PTR f, Lisp_Object file)
int
xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data)
{
- int result = 0;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data);
if (!pixbuf)
@@ -1635,7 +1634,7 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name)
suggesting a new name, which lisp code should override; if
F->explicit_name is set, ignore the new name; otherwise, set it. */
-void
+static void
x_set_name (struct frame *f, Lisp_Object name, int explicit)
{
/* Make sure that requests from lisp code override requests from
@@ -2620,7 +2619,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
#else /* not USE_X_TOOLKIT */
#ifdef USE_GTK
-void
+static void
x_window (FRAME_PTR f)
{
if (! xg_create_frame_widgets (f))
@@ -2660,7 +2659,7 @@ x_window (FRAME_PTR f)
#else /*! USE_GTK */
/* Create and set up the X window for frame F. */
-void
+static void
x_window (struct frame *f)
{
XClassHint class_hints;
@@ -3184,7 +3183,7 @@ This function is an internal primitive--use `make-frame' instead. */)
to get the color reference counts right, so initialize them! */
{
Lisp_Object black;
- struct gcpro gcpro1;
+ struct gcpro inner_gcpro1;
/* Function x_decode_color can signal an error. Make
sure to initialize color slots so that we won't try
@@ -3197,7 +3196,7 @@ This function is an internal primitive--use `make-frame' instead. */)
f->output_data.x->mouse_pixel = -1;
black = build_string ("black");
- GCPRO1 (black);
+ GCPRO1_VAR (black, inner_gcpro);
FRAME_FOREGROUND_PIXEL (f)
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
FRAME_BACKGROUND_PIXEL (f)
@@ -3210,7 +3209,7 @@ This function is an internal primitive--use `make-frame' instead. */)
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
f->output_data.x->mouse_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
- UNGCPRO;
+ UNGCPRO_VAR (inner_gcpro);
}
/* Specify the parent under which to make this X window. */
@@ -3448,8 +3447,9 @@ This function is an internal primitive--use `make-frame' instead. */)
else if (! NILP (visibility))
x_make_frame_visible (f);
else
- /* Must have been Qnil. */
- ;
+ {
+ /* Must have been Qnil. */
+ }
}
BLOCK_INPUT;
@@ -4577,7 +4577,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
Lisp_Object text)
{
struct frame *f;
- Lisp_Object frame, tem;
+ Lisp_Object frame;
Lisp_Object name;
long window_prompting = 0;
int width, height;
@@ -4651,7 +4651,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
to get the color reference counts right, so initialize them! */
{
Lisp_Object black;
- struct gcpro gcpro1;
+ struct gcpro inner_gcpro1;
/* Function x_decode_color can signal an error. Make
sure to initialize color slots so that we won't try
@@ -4664,7 +4664,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
f->output_data.x->mouse_pixel = -1;
black = build_string ("black");
- GCPRO1 (black);
+ GCPRO1_VAR (black, inner_gcpro);
FRAME_FOREGROUND_PIXEL (f)
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
FRAME_BACKGROUND_PIXEL (f)
@@ -4677,7 +4677,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
f->output_data.x->mouse_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
- UNGCPRO;
+ UNGCPRO_VAR (inner_gcpro);
}
/* Set the name; the functions to which we pass f expect the name to
@@ -5035,7 +5035,7 @@ Text larger than the specified size is clipped. */)
&& !NILP (Fequal (last_string, string))
&& !NILP (Fequal (last_parms, parms)))
{
- struct frame *f = XFRAME (tip_frame);
+ struct frame *tip_f = XFRAME (tip_frame);
/* Only DX and DY have changed. */
if (!NILP (tip_timer))
@@ -5046,9 +5046,9 @@ Text larger than the specified size is clipped. */)
}
BLOCK_INPUT;
- compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f),
- FRAME_PIXEL_HEIGHT (f), &root_x, &root_y);
- XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ compute_tip_xy (tip_f, parms, dx, dy, FRAME_PIXEL_WIDTH (tip_f),
+ FRAME_PIXEL_HEIGHT (tip_f), &root_x, &root_y);
+ XMoveWindow (FRAME_X_DISPLAY (tip_f), FRAME_X_WINDOW (tip_f),
root_x, root_y);
UNBLOCK_INPUT;
goto start_timer;
@@ -5565,11 +5565,11 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
BLOCK_INPUT;
if (STRINGP (default_filename))
- cdef_file = SDATA (default_filename);
+ cdef_file = SSDATA (default_filename);
else
- cdef_file = SDATA (dir);
+ cdef_file = SSDATA (dir);
- fn = xg_get_file_name (f, SDATA (prompt), cdef_file,
+ fn = xg_get_file_name (f, SSDATA (prompt), cdef_file,
! NILP (mustmatch),
! NILP (only_dir_p));
@@ -5625,12 +5625,12 @@ If FRAME is omitted or nil, it defaults to the selected frame. */)
XSETFONT (font, FRAME_FONT (f));
font_param = Ffont_get (font, intern (":name"));
if (STRINGP (font_param))
- default_name = xstrdup (SDATA (font_param));
+ default_name = xstrdup (SSDATA (font_param));
else
{
font_param = Fframe_parameter (frame, Qfont_param);
if (STRINGP (font_param))
- default_name = xstrdup (SDATA (font_param));
+ default_name = xstrdup (SSDATA (font_param));
}
if (default_name == NULL && x_last_font_name != NULL)
@@ -5694,7 +5694,7 @@ present and mapped to the usual X keysyms. */)
struct frame *f = check_x_frame (frame);
Display *dpy = FRAME_X_DISPLAY (f);
Lisp_Object have_keys;
- int major, minor, op, event, error;
+ int major, minor, op, event, error_code;
BLOCK_INPUT;
@@ -5710,7 +5710,7 @@ present and mapped to the usual X keysyms. */)
/* Check that the server supports XKB. */
major = XkbMajorVersion;
minor = XkbMinorVersion;
- if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor))
+ if (!XkbQueryExtension (dpy, &op, &event, &error_code, &major, &minor))
{
UNBLOCK_INPUT;
return Qlambda;
diff --git a/src/xgselect.c b/src/xgselect.c
index 359a8fbc89..96d763ff08 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -38,7 +38,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
GMainContext *context = g_main_context_default ();
int have_wfds = wfds != NULL;
int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0;
- int prio, i, nfds, tmo_in_millisec;
+ int i, nfds, tmo_in_millisec;
if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds));
else FD_ZERO (&all_rfds);
@@ -49,9 +49,9 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
g_main_context_pending (context);
do {
- if (n_gfds > gfds_size)
+ if (n_gfds > gfds_size)
{
- while (n_gfds > gfds_size)
+ while (n_gfds > gfds_size)
gfds_size *= 2;
xfree (gfds);
gfds = xmalloc (sizeof (*gfds) * gfds_size);
@@ -64,7 +64,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
gfds_size);
} while (n_gfds > gfds_size);
- for (i = 0; i < n_gfds; ++i)
+ for (i = 0; i < n_gfds; ++i)
{
if (gfds[i].events & G_IO_IN)
{
@@ -87,7 +87,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
else
{
EMACS_TIME difference;
-
+
EMACS_SUB_TIME (difference, tmo, *timeout);
if (EMACS_TIME_NEG_P (difference)) our_tmo = 1;
}
@@ -100,7 +100,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
if (nfds < 0)
retval = nfds;
- else if (nfds > 0)
+ else if (nfds > 0)
{
for (i = 0; i < max_fds+1; ++i)
{
@@ -127,7 +127,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
if (our_fds > 0 || (nfds == 0 && our_tmo))
{
-
+
/* If Gtk+ is in use eventually gtk_main_iteration will be called,
unless retval is zero. */
#ifdef USE_GTK
@@ -137,7 +137,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
g_main_context_dispatch (context);
/* To not have to recalculate timeout, return like this. */
- if (retval == 0)
+ if (retval == 0)
{
retval = -1;
errno = EINTR;
@@ -156,4 +156,3 @@ xgselect_initialize (void)
gfds = xmalloc (sizeof (*gfds)*gfds_size);
#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
}
-
diff --git a/src/xmenu.c b/src/xmenu.c
index 934db0f040..eab7bb03f2 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -124,11 +124,11 @@ static int update_frame_menubar (struct frame *);
Xt on behalf of one of the widget sets. */
static int popup_activated_flag;
-static int next_menubar_widget_id;
-
#ifdef USE_X_TOOLKIT
+static int next_menubar_widget_id;
+
/* Return the frame whose ->output_data.x->id equals ID, or 0 if none. */
static struct frame *
@@ -723,7 +723,7 @@ show_help_event (FRAME_PTR f, xt_or_gtk_widget widget, Lisp_Object help)
unhighlighting. */
#ifdef USE_GTK
-void
+static void
menu_highlight_callback (GtkWidget *widget, gpointer call_data)
{
xg_menu_item_cb_data *cb_data;
@@ -742,7 +742,7 @@ menu_highlight_callback (GtkWidget *widget, gpointer call_data)
show_help_event (cb_data->cl_data->f, widget, help);
}
#else
-void
+static void
menu_highlight_callback (Widget widget, LWLIB_ID id, void *call_data)
{
struct frame *f;
@@ -1175,8 +1175,6 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
}
else
{
- GtkWidget *wvbox = f->output_data.x->vbox_widget;
-
menubar_widget
= xg_create_widget ("menubar", "menubar", f, first_wv,
G_CALLBACK (menubar_selection_callback),
@@ -1390,7 +1388,7 @@ menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer
/* Check if there is room for the menu. If not, adjust x/y so that
the menu is fully visible. */
- gtk_widget_size_request (GTK_WIDGET (menu), &req);
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &req);
if (data->x + req.width > disp_width)
*x -= data->x + req.width - disp_width;
if (data->y + req.height > disp_height)
@@ -1600,7 +1598,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
Lisp_Object
xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
- Lisp_Object title, const char **error, EMACS_UINT timestamp)
+ Lisp_Object title, const char **error_name, EMACS_UINT timestamp)
{
int i;
widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
@@ -1615,11 +1613,11 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
if (! FRAME_X_P (f))
abort ();
- *error = NULL;
+ *error_name = NULL;
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
{
- *error = "Empty menu";
+ *error_name = "Empty menu";
return Qnil;
}
@@ -1664,7 +1662,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
{
/* Create a new pane. */
Lisp_Object pane_name, prefix;
- char *pane_string;
+ const char *pane_string;
pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
@@ -2012,7 +2010,7 @@ xdialog_show (FRAME_PTR f,
representing the text label and buttons. */
{
Lisp_Object pane_name, prefix;
- char *pane_string;
+ const char *pane_string;
pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME];
prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX];
pane_string = (NILP (pane_name)
@@ -2307,7 +2305,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
{
/* Create a new pane. */
Lisp_Object pane_name, prefix;
- char *pane_string;
+ const char *pane_string;
maxlines = max (maxlines, lines);
lines = 0;
diff --git a/src/xrdb.c b/src/xrdb.c
index 9fb3f3474f..a79f453e5e 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -28,6 +28,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <setjmp.h>
+#include "lisp.h"
+
+/* This may include sys/types.h, and that somehow loses
+ if this is not done before the other system files. */
+#include "xterm.h"
+
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/X.h>
@@ -38,8 +44,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#include <sys/stat.h>
-#include "lisp.h"
-
#ifdef USE_MOTIF
/* For Vdouble_click_time. */
#include "keyboard.h"
@@ -50,8 +54,6 @@ extern char *getenv (const char *);
extern struct passwd *getpwuid (uid_t);
extern struct passwd *getpwnam (const char *);
-extern const char *get_system_name (void);
-
char *x_get_string_resource (XrmDatabase rdb, const char *name,
const char *class);
static int file_p (const char *filename);
diff --git a/src/xselect.c b/src/xselect.c
index a502a74f90..5254fa9683 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -97,7 +97,6 @@ static Lisp_Object clean_local_selection_data (Lisp_Object);
#define TRACE0(fmt) (void) 0
#define TRACE1(fmt, a0) (void) 0
#define TRACE2(fmt, a0, a1) (void) 0
-#define TRACE3(fmt, a0, a1) (void) 0
#endif
@@ -330,7 +329,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
struct frame *sf = SELECTED_FRAME ();
Window selecting_window;
Display *display;
- Time time = last_event_timestamp;
+ Time timestamp = last_event_timestamp;
Atom selection_atom;
struct x_display_info *dpyinfo;
@@ -346,7 +345,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
BLOCK_INPUT;
x_catch_errors (display);
- XSetSelectionOwner (display, selection_atom, selecting_window, time);
+ XSetSelectionOwner (display, selection_atom, selecting_window, timestamp);
x_check_errors (display, "Can't set selection: %s");
x_uncatch_errors ();
UNBLOCK_INPUT;
@@ -357,7 +356,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
Lisp_Object selection_data;
Lisp_Object prev_value;
- selection_time = long_to_cons ((unsigned long) time);
+ selection_time = long_to_cons ((unsigned long) timestamp);
selection_data = list4 (selection_name, selection_value,
selection_time, selected_frame);
prev_value = assq_no_quit (selection_name, Vselection_alist);
@@ -2085,7 +2084,7 @@ DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
Sx_disown_selection_internal, 1, 2, 0,
doc: /* If we own the selection SELECTION, disown it.
Disowning it means there is no such selection. */)
- (Lisp_Object selection, Lisp_Object time)
+ (Lisp_Object selection, Lisp_Object time_object)
{
Time timestamp;
Atom selection_atom;
@@ -2104,10 +2103,10 @@ Disowning it means there is no such selection. */)
display = FRAME_X_DISPLAY (sf);
dpyinfo = FRAME_X_DISPLAY_INFO (sf);
CHECK_SYMBOL (selection);
- if (NILP (time))
+ if (NILP (time_object))
timestamp = last_event_timestamp;
else
- timestamp = cons_to_long (time);
+ timestamp = cons_to_long (time_object);
if (NILP (assq_no_quit (selection, Vselection_alist)))
return Qnil; /* Don't disown the selection when we're not the owner. */
@@ -2131,26 +2130,6 @@ Disowning it means there is no such selection. */)
return Qt;
}
-/* Get rid of all the selections in buffer BUFFER.
- This is used when we kill a buffer. */
-
-void
-x_disown_buffer_selections (Lisp_Object buffer)
-{
- Lisp_Object tail;
- struct buffer *buf = XBUFFER (buffer);
-
- for (tail = Vselection_alist; CONSP (tail); tail = XCDR (tail))
- {
- Lisp_Object elt, value;
- elt = XCAR (tail);
- value = XCDR (elt);
- if (CONSP (value) && MARKERP (XCAR (value))
- && XMARKER (XCAR (value))->buffer == buf)
- Fx_disown_selection_internal (XCAR (elt), Qnil);
- }
-}
-
DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
0, 1, 0,
doc: /* Whether the current Emacs process owns the given X Selection.
@@ -2455,7 +2434,6 @@ x_handle_dnd_message (struct frame *f, XClientMessageEvent *event, struct x_disp
if (event->format == 32 && event->format < BITS_PER_LONG)
{
- int i;
for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
idata[i] = (int) event->data.l[i];
data = (unsigned char *) idata;
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 825cec451d..f3879dbcec 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -41,6 +41,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "process.h"
#include "keyboard.h"
+#ifndef HAVE_GTK3
+#define gdk_x11_set_sm_client_id(w) gdk_set_sm_client_id (w)
+#endif
+
/* This is the event used when SAVE_SESSION_EVENT occurs. */
static struct input_event emacs_event;
@@ -459,7 +463,7 @@ x_session_initialize (struct x_display_info *dpyinfo)
#ifdef USE_GTK
/* GTK creats a leader window by itself, but we need to tell
it about our client_id. */
- gdk_set_sm_client_id (client_id);
+ gdk_x11_set_sm_client_id (client_id);
#else
create_client_leader_window (dpyinfo, client_id);
#endif
diff --git a/src/xterm.c b/src/xterm.c
index 909b6978f5..fd7ffd68e6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -279,10 +279,6 @@ Lisp_Object Qx_gtk_map_stock;
/* Some functions take this as char *, not const char *. */
static char emacs_class[] = EMACS_CLASS;
-/* XEmbed implementation. */
-
-#define XEMBED_VERSION 0
-
enum xembed_info
{
XEMBED_MAPPED = 1 << 0
@@ -321,6 +317,7 @@ static void XTframe_up_to_date (struct frame *);
static void XTset_terminal_modes (struct terminal *);
static void XTreset_terminal_modes (struct terminal *);
static void x_clear_frame (struct frame *);
+static void x_ins_del_lines (struct frame *, int, int) NO_RETURN;
static void frame_highlight (struct frame *);
static void frame_unhighlight (struct frame *);
static void x_new_focus_frame (struct x_display_info *, struct frame *);
@@ -877,6 +874,7 @@ static void x_draw_glyph_string_foreground (struct glyph_string *);
static void x_draw_composite_glyph_string_foreground (struct glyph_string *);
static void x_draw_glyph_string_box (struct glyph_string *);
static void x_draw_glyph_string (struct glyph_string *);
+static void x_delete_glyphs (struct frame *, int) NO_RETURN;
static void x_compute_glyph_string_overhangs (struct glyph_string *);
static void x_set_cursor_gc (struct glyph_string *);
static void x_set_mode_line_face_gc (struct glyph_string *);
@@ -1791,27 +1789,6 @@ x_copy_color (struct frame *f, long unsigned int pixel)
}
-/* Allocate color PIXEL on display DPY. PIXEL must already be allocated.
- It's necessary to do this instead of just using PIXEL directly to
- get color reference counts right. */
-
-unsigned long
-x_copy_dpy_color (Display *dpy, Colormap cmap, long unsigned int pixel)
-{
- XColor color;
-
- color.pixel = pixel;
- BLOCK_INPUT;
- XQueryColor (dpy, cmap, &color);
- XAllocColor (dpy, cmap, &color);
- UNBLOCK_INPUT;
-#ifdef DEBUG_X_COLORS
- register_color (pixel);
-#endif
- return color.pixel;
-}
-
-
/* Brightness beyond which a color won't have its highlight brightness
boosted.
@@ -2260,12 +2237,12 @@ x_draw_image_foreground (struct glyph_string *s)
nothing here for mouse-face. */
if (s->hl == DRAW_CURSOR)
{
- int r = s->img->relief;
- if (r < 0) r = -r;
+ int relief = s->img->relief;
+ if (relief < 0) relief = -relief;
XDrawRectangle (s->display, s->window, s->gc,
- x - r, y - r,
- s->slice.width + r*2 - 1,
- s->slice.height + r*2 - 1);
+ x - relief, y - relief,
+ s->slice.width + relief*2 - 1,
+ s->slice.height + relief*2 - 1);
}
}
}
@@ -2907,7 +2884,7 @@ x_draw_glyph_string (struct glyph_string *s)
/* Shift display to make room for inserted glyphs. */
-void
+static void
x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height, int shift_by)
{
XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_X_WINDOW (f),
@@ -3011,7 +2988,7 @@ timeval_subtract (struct timeval *result, struct timeval x, struct timeval y)
return x.tv_sec < y.tv_sec;
}
-void
+static void
XTflash (struct frame *f)
{
BLOCK_INPUT;
@@ -3021,6 +2998,17 @@ XTflash (struct frame *f)
/* Use Gdk routines to draw. This way, we won't draw over scroll bars
when the scroll bars and the edit widget share the same X window. */
GdkWindow *window = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
+#ifdef HAVE_GTK3
+ cairo_t *cr = gdk_cairo_create (window);
+ cairo_set_source_rgb (cr, 1, 1, 1);
+ cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE);
+#define XFillRectangle(d, win, gc, x, y, w, h) \
+ do { \
+ cairo_rectangle (cr, x, y, w, h); \
+ cairo_fill (cr); \
+ } \
+ while (0)
+#else /* ! HAVE_GTK3 */
GdkGCValues vals;
GdkGC *gc;
vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
@@ -3030,7 +3018,8 @@ XTflash (struct frame *f)
&vals, GDK_GC_FUNCTION | GDK_GC_FOREGROUND);
#define XFillRectangle(d, win, gc, x, y, w, h) \
gdk_draw_rectangle (window, gc, TRUE, x, y, w, h)
-#else
+#endif /* ! HAVE_GTK3 */
+#else /* ! USE_GTK */
GC gc;
/* Create a GC that will use the GXxor function to flip foreground
@@ -3151,7 +3140,11 @@ XTflash (struct frame *f)
width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
#ifdef USE_GTK
+#ifdef HAVE_GTK3
+ cairo_destroy (cr);
+#else
g_object_unref (G_OBJECT (gc));
+#endif
#undef XFillRectangle
#else
XFreeGC (FRAME_X_DISPLAY (f), gc);
@@ -3186,7 +3179,7 @@ XTtoggle_invisible_pointer (FRAME_PTR f, int invisible)
/* Make audible bell. */
-void
+static void
XTring_bell (struct frame *f)
{
if (FRAME_X_DISPLAY (f))
@@ -3800,7 +3793,7 @@ redo_mouse_highlight (void)
mouse is on, *BAR_WINDOW to nil, and *X and *Y to the character cell
the mouse is over.
- Set *TIME to the server time-stamp for the time at which the mouse
+ Set *TIMESTAMP to the server time-stamp for the time at which the mouse
was at this position.
Don't store anything if we don't have a valid set of values to report.
@@ -3809,14 +3802,16 @@ redo_mouse_highlight (void)
movement. */
static void
-XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, long unsigned int *time)
+XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
+ enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y,
+ long unsigned int *timestamp)
{
FRAME_PTR f1;
BLOCK_INPUT;
if (! NILP (last_mouse_scroll_bar) && insist == 0)
- x_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
+ x_scroll_bar_report_motion (fp, bar_window, part, x, y, timestamp);
else
{
Window root;
@@ -3989,7 +3984,7 @@ XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, enum scrol
*fp = f1;
XSETINT (*x, win_x);
XSETINT (*y, win_y);
- *time = last_mouse_movement_time;
+ *timestamp = last_mouse_movement_time;
}
}
}
@@ -5541,7 +5536,9 @@ x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event)
on the scroll bar. */
static void
-x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, long unsigned int *time)
+x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window,
+ enum scroll_bar_part *part, Lisp_Object *x,
+ Lisp_Object *y, long unsigned int *timestamp)
{
struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
Window w = bar->x_window;
@@ -5601,7 +5598,7 @@ x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, enum scroll_
last_mouse_scroll_bar = Qnil;
}
- *time = last_mouse_movement_time;
+ *timestamp = last_mouse_movement_time;
UNBLOCK_INPUT;
}
@@ -5775,7 +5772,8 @@ static void xembed_send_message (struct frame *f, Time time,
We return the number of characters stored into the buffer. */
static int
-handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, struct input_event *hold_quit)
+handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
+ int *finish, struct input_event *hold_quit)
{
union {
struct input_event ie;
@@ -5786,7 +5784,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish,
int nbytes = 0;
struct frame *f = NULL;
struct coding_system coding;
- XEvent event = *eventp;
+ XEvent event = *eventptr;
Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
*finish = X_EVENT_NORMAL;
@@ -6486,7 +6484,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish,
{ /* Raw bytes, not keysym. */
register int i;
- register int c;
int nchars, len;
for (i = 0, nchars = 0; i < nbytes; i++)
@@ -6526,14 +6523,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish,
character events. */
for (i = 0; i < nbytes; i += len)
{
+ int ch;
if (nchars == nbytes)
- c = copy_bufptr[i], len = 1;
+ ch = copy_bufptr[i], len = 1;
else
- c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, len);
- inev.ie.kind = (SINGLE_BYTE_CHAR_P (c)
+ ch = STRING_CHAR_AND_LENGTH (copy_bufptr + i, len);
+ inev.ie.kind = (SINGLE_BYTE_CHAR_P (ch)
? ASCII_KEYSTROKE_EVENT
: MULTIBYTE_CHAR_KEYSTROKE_EVENT);
- inev.ie.code = c;
+ inev.ie.code = ch;
kbd_buffer_store_event_hold (&inev.ie, hold_quit);
}
@@ -6972,7 +6970,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish,
count++;
}
- *eventp = event;
+ *eventptr = event;
return count;
}
@@ -7012,7 +7010,6 @@ static int
XTread_socket (struct terminal *terminal, int expected, struct input_event *hold_quit)
{
int count = 0;
- XEvent event;
int event_found = 0;
if (interrupt_input_blocked)
@@ -7046,6 +7043,7 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold
while (XPending (terminal->display_info.x->display))
{
int finish;
+ XEvent event;
XNextEvent (terminal->display_info.x->display, &event);
@@ -7063,6 +7061,8 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold
goto out;
}
+ out:;
+
#else /* USE_GTK */
/* For GTK we must use the GTK event loop. But XEvents gets passed
@@ -7089,8 +7089,6 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold
}
#endif /* USE_GTK */
- out:;
-
/* On some systems, an X bug causes Emacs to get no more events
when the window is destroyed. Detect that. (1994.) */
if (! event_found)
@@ -7226,9 +7224,9 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text
the bar might not be in the window. */
if (cursor_glyph->type == IMAGE_GLYPH)
{
- struct glyph_row *row;
- row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
- draw_phys_cursor_glyph (w, row, DRAW_CURSOR);
+ struct glyph_row *r;
+ r = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
+ draw_phys_cursor_glyph (w, r, DRAW_CURSOR);
}
else
{
@@ -7517,9 +7515,9 @@ static struct x_error_message_stack *x_error_message;
x_catch_errors is in effect. */
static void
-x_error_catcher (Display *display, XErrorEvent *error)
+x_error_catcher (Display *display, XErrorEvent *event)
{
- XGetErrorText (display, error->error_code,
+ XGetErrorText (display, event->error_code,
x_error_message->string,
X_ERROR_MESSAGE_SIZE);
}
@@ -7668,17 +7666,6 @@ x_connection_signal (int signalnum) /* If we don't have an argument, */
static char *error_msg;
-/* Function installed as fatal_error_signal_hook in
- x_connection_closed. Print the X error message, and exit normally,
- instead of dumping core when XtCloseDisplay fails. */
-
-static void
-x_fatal_error_signal (void)
-{
- fprintf (stderr, "%s\n", error_msg);
- exit (70);
-}
-
/* Handle the loss of connection to display DPY. ERROR_MESSAGE is
the text of an error message that lead to the connection loss. */
@@ -7687,7 +7674,7 @@ x_connection_closed (Display *dpy, const char *error_message)
{
struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
Lisp_Object frame, tail;
- int index = SPECPDL_INDEX ();
+ int idx = SPECPDL_INDEX ();
error_msg = (char *) alloca (strlen (error_message) + 1);
strcpy (error_msg, error_message);
@@ -7782,8 +7769,12 @@ For details, see etc/PROBLEMS.\n",
sigunblock (sigmask (SIGALRM));
TOTALLY_UNBLOCK_INPUT;
- unbind_to (index, Qnil);
+ unbind_to (idx, Qnil);
clear_waiting_for_input ();
+
+ /* Tell GCC not to suggest attribute 'noreturn' for this function. */
+ IF_LINT (if (! terminal_list) return; )
+
/* 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'. */
@@ -7798,12 +7789,12 @@ static void x_error_quitter (Display *, XErrorEvent *);
It calls x_error_quitter or x_error_catcher. */
static int
-x_error_handler (Display *display, XErrorEvent *error)
+x_error_handler (Display *display, XErrorEvent *event)
{
if (x_error_message)
- x_error_catcher (display, error);
+ x_error_catcher (display, event);
else
- x_error_quitter (display, error);
+ x_error_quitter (display, event);
return 0;
}
@@ -7817,22 +7808,22 @@ x_error_handler (Display *display, XErrorEvent *error)
after x_error_handler prevents inlining into the former. */
static void NO_INLINE
-x_error_quitter (Display *display, XErrorEvent *error)
+x_error_quitter (Display *display, XErrorEvent *event)
{
char buf[256], buf1[356];
/* Ignore BadName errors. They can happen because of fonts
or colors that are not defined. */
- if (error->error_code == BadName)
+ if (event->error_code == BadName)
return;
/* Note that there is no real way portable across R3/R4 to get the
original error handler. */
- XGetErrorText (display, error->error_code, buf, sizeof (buf));
+ XGetErrorText (display, event->error_code, buf, sizeof (buf));
sprintf (buf1, "X protocol error: %s on protocol request %d",
- buf, error->request_code);
+ buf, event->request_code);
x_connection_closed (display, buf1);
}
@@ -8119,7 +8110,7 @@ xim_close_dpy (struct x_display_info *dpyinfo)
/* Calculate the absolute position in frame F
from its current recorded position values and gravity. */
-void
+static void
x_calc_absolute_position (struct frame *f)
{
int flags = f->size_hint_flags;
@@ -8862,31 +8853,6 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
UNBLOCK_INPUT;
}
-/* focus shifting, raising and lowering. */
-
-void
-x_focus_on_frame (struct frame *f)
-{
-#if 0
- /* I don't think that the ICCCM allows programs to do things like this
- without the interaction of the window manager. Whatever you end up
- doing with this code, do it to x_unfocus_frame too. */
- XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- RevertToPointerRoot, CurrentTime);
-#endif /* ! 0 */
-}
-
-void
-x_unfocus_frame (struct frame *f)
-{
-#if 0
- /* Look at the remarks in x_focus_on_frame. */
- if (FRAME_X_DISPLAY_INFO (f)->x_focus_frame == f)
- XSetInputFocus (FRAME_X_DISPLAY (f), PointerRoot,
- RevertToPointerRoot, CurrentTime);
-#endif /* ! 0 */
-}
-
/* Raise frame F. */
void
@@ -8947,6 +8913,12 @@ XTframe_raise_lower (FRAME_PTR f, int raise_flag)
/* XEmbed implementation. */
+#if defined USE_X_TOOLKIT || ! defined USE_GTK
+
+/* XEmbed implementation. */
+
+#define XEMBED_VERSION 0
+
static void
xembed_set_info (struct frame *f, enum xembed_info flags)
{
@@ -8960,9 +8932,11 @@ xembed_set_info (struct frame *f, enum xembed_info flags)
dpyinfo->Xatom_XEMBED_INFO, dpyinfo->Xatom_XEMBED_INFO,
32, PropModeReplace, (unsigned char *) data, 2);
}
+#endif /* defined USE_X_TOOLKIT || ! defined USE_GTK */
static void
-xembed_send_message (struct frame *f, Time time, enum xembed_message message, long int detail, long int data1, long int data2)
+xembed_send_message (struct frame *f, Time t, enum xembed_message msg,
+ long int detail, long int data1, long int data2)
{
XEvent event;
@@ -8970,8 +8944,8 @@ xembed_send_message (struct frame *f, Time time, enum xembed_message message, lo
event.xclient.window = FRAME_X_OUTPUT (f)->parent_desc;
event.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_XEMBED;
event.xclient.format = 32;
- event.xclient.data.l[0] = time;
- event.xclient.data.l[1] = message;
+ event.xclient.data.l[0] = t;
+ event.xclient.data.l[1] = msg;
event.xclient.data.l[2] = detail;
event.xclient.data.l[3] = data1;
event.xclient.data.l[4] = data2;
@@ -9212,7 +9186,9 @@ x_make_frame_invisible (struct frame *f)
void
x_iconify_frame (struct frame *f)
{
+#ifdef USE_X_TOOLKIT
int result;
+#endif
Lisp_Object type;
/* Don't keep the highlight on an invisible frame. */
@@ -9295,19 +9271,19 @@ x_iconify_frame (struct frame *f)
/* X11R4: send a ClientMessage to the window manager using the
WM_CHANGE_STATE type. */
{
- XEvent message;
+ XEvent msg;
- message.xclient.window = FRAME_X_WINDOW (f);
- message.xclient.type = ClientMessage;
- message.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_change_state;
- message.xclient.format = 32;
- message.xclient.data.l[0] = IconicState;
+ msg.xclient.window = FRAME_X_WINDOW (f);
+ msg.xclient.type = ClientMessage;
+ msg.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_change_state;
+ msg.xclient.format = 32;
+ msg.xclient.data.l[0] = IconicState;
if (! XSendEvent (FRAME_X_DISPLAY (f),
DefaultRootWindow (FRAME_X_DISPLAY (f)),
False,
SubstructureRedirectMask | SubstructureNotifyMask,
- &message))
+ &msg))
{
UNBLOCK_INPUT_RESIGNAL;
error ("Can't notify window manager of iconification");
@@ -9339,9 +9315,11 @@ void
x_free_frame_resources (struct frame *f)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
+#ifdef USE_X_TOOLKIT
Lisp_Object bar;
struct scroll_bar *b;
- Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
+#endif
BLOCK_INPUT;
@@ -9797,10 +9775,11 @@ x_display_ok (const char *display)
#ifdef USE_GTK
static void
-my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
+my_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
+ const gchar *msg, gpointer user_data)
{
- if (!strstr (message, "g_set_prgname"))
- fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message);
+ if (!strstr (msg, "g_set_prgname"))
+ fprintf (stderr, "%s-WARNING **: %s\n", log_domain, msg);
}
#endif
@@ -9863,6 +9842,13 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
XSetLocaleModifiers ("");
+ /* Emacs can only handle core input events, so make sure
+ Gtk doesn't use Xinput or Xinput2 extensions. */
+ {
+ static char fix_events[] = "GDK_CORE_DEVICE_EVENTS=1";
+ putenv (fix_events);
+ }
+
/* Work around GLib bug that outputs a faulty warning. See
https://bugzilla.gnome.org/show_bug.cgi?id=563627. */
id = g_log_set_handler ("GLib", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
@@ -9874,11 +9860,12 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
fixup_locale ();
xg_initialize ();
- dpy = GDK_DISPLAY ();
+ dpy = DEFAULT_GDK_DISPLAY ();
/* NULL window -> events for all windows go to our function */
gdk_window_add_filter (NULL, event_handler_gdk, NULL);
+#if GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION <= 90
/* Load our own gtkrc if it exists. */
{
const char *file = "~/.emacs.d/gtkrc";
@@ -9890,6 +9877,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
if (! NILP (abs_file) && !NILP (Ffile_readable_p (abs_file)))
gtk_rc_parse (SSDATA (abs_file));
}
+#endif
XSetErrorHandler (x_error_handler);
XSetIOErrorHandler (x_io_error_quitter);
diff --git a/src/xterm.h b/src/xterm.h
index 48d6855779..15630e902e 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -675,9 +675,20 @@ enum
#define gtk_adjustment_get_upper(w) ((w)->upper)
#endif
+#ifdef HAVE_GTK3
+#define DEFAULT_GDK_DISPLAY() \
+ gdk_x11_display_get_xdisplay (gdk_display_get_default ())
+#else
+#undef GDK_WINDOW_XID
+#define GDK_WINDOW_XID(w) GDK_WINDOW_XWINDOW (w)
+#define DEFAULT_GDK_DISPLAY() GDK_DISPLAY ()
+#define gtk_widget_get_preferred_size(a, ign, b) \
+ gtk_widget_size_request(a, b)
+#endif
+
#define GTK_WIDGET_TO_X_WIN(w) \
((w) && gtk_widget_get_window (w) \
- ? GDK_WINDOW_XWINDOW (gtk_widget_get_window (w)) : 0)
+ ? GDK_WINDOW_XID (gtk_widget_get_window (w)) : 0)
#define FRAME_GTK_OUTER_WIDGET(f) ((f)->output_data.x->widget)
#define FRAME_GTK_WIDGET(f) ((f)->output_data.x->edit_widget)
@@ -979,6 +990,7 @@ extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *);
extern void x_query_colors (struct frame *f, XColor *, int);
extern void x_query_color (struct frame *f, XColor *);
extern void x_clear_area (Display *, Window, int, int, int, int, int);
+extern void x_mouse_leave (struct x_display_info *);
extern void set_vertical_scroll_bar (struct window *);
extern int x_dispatch_event (XEvent *, Display *);